diff --git a/README.md b/README.md index ca7ff64..31f9ae0 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,74 @@ -# ddei-editor +# DDei-在线设计器简介 -This template should help get you started developing with Vue 3 in Vite. +## 概述 -## Recommended IDE Setup +  DDei是一个遵循Apache2.0开源协议开发的设计器组件,允许用户通过拖拉拽等方式创建和编辑图形。 +使用者可以通过组件引用的方式,将其嵌入到应用的任意位置,使之拥有在线绘图的能力。 -[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). -## Type Support for `.vue` Imports in TS +## 功能特性 -TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types. +  DDei以组件的方式提供使用,功能强大且易于集成,大多数功能都可以通过初始化配置和引入插件完成,无需复杂编码。以下是DDei的功能特性 -If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps: +**画布大小** -1. Disable the built-in TypeScript Extension - 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette - 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)` -2. Reload the VSCode window by running `Developer: Reload Window` from the command palette. +  支持设置设计器的大小。 -## Customize configuration +**背景** -See [Vite Configuration Reference](https://vitejs.dev/config/). +  支持空白、图片、纯色以及透明度设置。 -## Project Setup +**纸张** -```sh -npm install -``` +  开启后会在背景上显示纸张。允许设置纸张的大小(如:A4、A5、自定义)以及方向(横向、纵向)。 -### Compile and Hot-Reload for Development +**标尺** -```sh -npm run dev -``` +  开启后会在绘图区域的周围显示标尺,同时会影响辅助网格的尺寸。支持毫米、厘米、米、英寸、像素等单位。 -### Type-Check, Compile and Minify for Production +**辅助对齐** -```sh -npm run build -``` +  开启后拖拽时会显示对齐辅助线。 + +**辅助网格** + +  开启后会在背景上绘制用于对齐的辅助网格线。支持点阵和网格两种类型。 + +**水印** + +  开启后图形上方显示水印。支持文字、图像两种水印类型,可以调整水印的字体、文本、图片、方向、颜色和透明度。 + +**无限画布** + +  开启后在操作超出画布大小时会自动扩展画布。可以限制扩展方向(横向或纵向)。 + +**权限控制** + +  可以配置操作权限。支持全局只读设置,或到图形实例级的创建、修改、选择、删除、连线等权限。 +**多文件** + +  可以配置插件实现多文件编辑。 + +**多页签** + +  可以配置插件实现多页签编辑。 + +**多图层** + +  开启后可以创建多个图层,并在不同图层之间切换、锁定或删除图层。 + +**数据驱动** + +  DDei采用数据驱动,图形的绘制与JSON模型绑定,图形操作和模型数据会相互同步。可以通过API获取图形的JSON数据,或通过已有的JSON数据显示加载画布。 + + +**插件机制** +  DDei提供了插件机制,使用者可以通过扩展插件对设计器功能进行装载或卸载。也可以通过自定义插件扩展个性化功能,从而满足使用需求。 + + +## 安装、示例与API +  作者提供了完整的安装指南和示例,请进入[DDei官网]https://www.ddei.top查看最新文档。 + + +## 技术支持 +
QQ:3697355039     邮箱:3697355039@qq.com
\ No newline at end of file diff --git a/index.html b/index.html index a888544..d88bfab 100644 --- a/index.html +++ b/index.html @@ -2,9 +2,15 @@ - - Vite App + + + + + + + + DDei-在线设计器V1.2.0
diff --git a/package-lock.json b/package-lock.json index fcdff1e..524b613 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,30 +1,38 @@ { "name": "ddei-editor", - "version": "0.0.1", + "version": "1.2.12-5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ddei-editor", - "version": "0.0.1", + "version": "1.2.12-5", + "license": "Apache License 2.0", "dependencies": { - "vue": "^3.3.4" + "ddei-framework": "^1.2.37" }, "devDependencies": { "@tsconfig/node18": "^18.2.0", - "@types/node": "^18.17.0", + "@types/lodash": "^4.14.197", + "@types/node": "^18.17.6", "@vitejs/plugin-vue": "^4.2.3", "@vue/tsconfig": "^0.4.0", + "less": "^4.2.0", "npm-run-all": "^4.1.5", "typescript": "~5.1.6", "vite": "^4.4.6", + "vite-plugin-compression": "^0.5.1", "vue-tsc": "^1.8.6" + }, + "engines": { + "node": ">=16.0.0" } }, "node_modules/@babel/parser": { - "version": "7.22.7", - "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.7.tgz", - "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.4.tgz", + "integrity": "sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==", + "dev": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -32,58 +40,10 @@ "node": ">=6.0.0" } }, - "node_modules/@esbuild/android-arm": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.18.17.tgz", - "integrity": "sha512-wHsmJG/dnL3OkpAcwbgoBTTMHVi4Uyou3F5mf58ZtmUyIKfcdA7TROav/6tCzET4A3QW2Q2FC+eFneMU+iyOxg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.18.17.tgz", - "integrity": "sha512-9np+YYdNDed5+Jgr1TdWBsozZ85U1Oa3xW0c7TWqH0y2aGghXtZsuT8nYRbzOMcl0bXZXjOGbksoTtVOlWrRZg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.18.17.tgz", - "integrity": "sha512-O+FeWB/+xya0aLg23hHEM2E3hbfwZzjqumKMSIqcHbNvDa+dza2D0yLuymRBQQnC34CWrsJUXyH2MG5VnLd6uw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.17.tgz", - "integrity": "sha512-M9uJ9VSB1oli2BE/dJs3zVr9kcCBBsE883prage1NWz6pBS++1oNn/7soPNS3+1DGj0FrkSvnED4Bmlu1VAE9g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "cpu": [ "arm64" ], @@ -96,410 +56,141 @@ "node": ">=12" } }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.18.17.tgz", - "integrity": "sha512-XDre+J5YeIJDMfp3n0279DFNrGCXlxOuGsWIkRb1NThMZ0BsrWXoTg23Jer7fEXQ9Ye5QjrvXpxnhzl3bHtk0g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.17.tgz", - "integrity": "sha512-cjTzGa3QlNfERa0+ptykyxs5A6FEUQQF0MuilYXYBGdBxD3vxJcKnzDlhDCa1VAJCmAxed6mYhA2KaJIbtiNuQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.17.tgz", - "integrity": "sha512-sOxEvR8d7V7Kw8QqzxWc7bFfnWnGdaFBut1dRUYtu+EIRXefBc/eIsiUiShnW0hM3FmQ5Zf27suDuHsKgZ5QrA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.18.17.tgz", - "integrity": "sha512-2d3Lw6wkwgSLC2fIvXKoMNGVaeY8qdN0IC3rfuVxJp89CRfA3e3VqWifGDfuakPmp90+ZirmTfye1n4ncjv2lg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.18.17.tgz", - "integrity": "sha512-c9w3tE7qA3CYWjT+M3BMbwMt+0JYOp3vCMKgVBrCl1nwjAlOMYzEo+gG7QaZ9AtqZFj5MbUc885wuBBmu6aADQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.18.17.tgz", - "integrity": "sha512-1DS9F966pn5pPnqXYz16dQqWIB0dmDfAQZd6jSSpiT9eX1NzKh07J6VKR3AoXXXEk6CqZMojiVDSZi1SlmKVdg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.18.17.tgz", - "integrity": "sha512-EvLsxCk6ZF0fpCB6w6eOI2Fc8KW5N6sHlIovNe8uOFObL2O+Mr0bflPHyHwLT6rwMg9r77WOAWb2FqCQrVnwFg==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.17.tgz", - "integrity": "sha512-e0bIdHA5p6l+lwqTE36NAW5hHtw2tNRmHlGBygZC14QObsA3bD4C6sXLJjvnDIjSKhW1/0S3eDy+QmX/uZWEYQ==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.17.tgz", - "integrity": "sha512-BAAilJ0M5O2uMxHYGjFKn4nJKF6fNCdP1E0o5t5fvMYYzeIqy2JdAP88Az5LHt9qBoUa4tDaRpfWt21ep5/WqQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.17.tgz", - "integrity": "sha512-Wh/HW2MPnC3b8BqRSIme/9Zhab36PPH+3zam5pqGRH4pE+4xTrVLx2+XdGp6fVS3L2x+DrsIcsbMleex8fbE6g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.18.17.tgz", - "integrity": "sha512-j/34jAl3ul3PNcK3pfI0NSlBANduT2UO5kZ7FCaK33XFv3chDhICLY8wJJWIhiQ+YNdQ9dxqQctRg2bvrMlYgg==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.18.17.tgz", - "integrity": "sha512-QM50vJ/y+8I60qEmFxMoxIx4de03pGo2HwxdBeFd4nMh364X6TIBZ6VQ5UQmPbQWUVWHWws5MmJXlHAXvJEmpQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.17.tgz", - "integrity": "sha512-/jGlhWR7Sj9JPZHzXyyMZ1RFMkNPjC6QIAan0sDOtIo2TYk3tZn5UDrkE0XgsTQCxWTTOcMPf9p6Rh2hXtl5TQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.17.tgz", - "integrity": "sha512-rSEeYaGgyGGf4qZM2NonMhMOP/5EHp4u9ehFiBrg7stH6BYEEjlkVREuDEcQ0LfIl53OXLxNbfuIj7mr5m29TA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.18.17.tgz", - "integrity": "sha512-Y7ZBbkLqlSgn4+zot4KUNYst0bFoO68tRgI6mY2FIM+b7ZbyNVtNbDP5y8qlu4/knZZ73fgJDlXID+ohY5zt5g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.18.17.tgz", - "integrity": "sha512-bwPmTJsEQcbZk26oYpc4c/8PvTY3J5/QK8jM19DVlEsAB41M39aWovWoHtNm78sd6ip6prilxeHosPADXtEJFw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.18.17.tgz", - "integrity": "sha512-H/XaPtPKli2MhW+3CQueo6Ni3Avggi6hP/YvgkEe1aSaxw+AeO8MFjq8DlgfTd9Iz4Yih3QCZI6YLMoyccnPRg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.18.17.tgz", - "integrity": "sha512-fGEb8f2BSA3CW7riJVurug65ACLuQAzKq0SSqkY2b2yHHH0MzDfbLyKIGzHwOI/gkHcxM/leuSW6D5w/LMNitA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", - "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true, + "peer": true }, "node_modules/@tsconfig/node18": { - "version": "18.2.0", - "resolved": "https://registry.npmmirror.com/@tsconfig/node18/-/node18-18.2.0.tgz", - "integrity": "sha512-yhxwIlFVSVcMym3O31HoMnRXpoenmpIxcj4Yoes2DUpe+xCJnA7ECQP1Vw889V0jTt/2nzvpLQ/UuMYCd3JPIg==", + "version": "18.2.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.4.tgz", + "integrity": "sha512-5xxU8vVs9/FNcvm3gE07fPbn9tl6tqGGWA9tSlwsUEkBxtRnTsNmwrV8gasZ9F/EobaSv9+nu8AxUKccw77JpQ==", + "dev": true + }, + "node_modules/@types/lodash": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz", + "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==", "dev": true }, "node_modules/@types/node": { - "version": "18.17.1", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-18.17.1.tgz", - "integrity": "sha512-xlR1jahfizdplZYRU59JlUx9uzF1ARa8jbhM11ccpCJya8kvos5jwdm2ZAgxSCwOl0fq21svP18EVwPBXMQudw==", - "dev": true + "version": "18.19.31", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.31.tgz", + "integrity": "sha512-ArgCD39YpyyrtFKIqMDvjz79jto5fcI/SVUs2HwB+f0dAzq68yqOdyaSivLiLugSziTpNXLQrVb7RZFmdZzbhA==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@vitejs/plugin-vue": { - "version": "4.2.3", - "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz", - "integrity": "sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.6.2.tgz", + "integrity": "sha512-kqf7SGFoG+80aZG6Pf+gsZIVvGSCKE98JbiWqcCV9cThtg91Jav0yvYFC9Zb+jKetNGF6ZKeoaxgZfND21fWKw==", "dev": true, "engines": { "node": "^14.18.0 || >=16.0.0" }, "peerDependencies": { - "vite": "^4.0.0", + "vite": "^4.0.0 || ^5.0.0", "vue": "^3.2.25" } }, "node_modules/@volar/language-core": { - "version": "1.10.0", - "resolved": "https://registry.npmmirror.com/@volar/language-core/-/language-core-1.10.0.tgz", - "integrity": "sha512-ddyWwSYqcbEZNFHm+Z3NZd6M7Ihjcwl/9B5cZd8kECdimVXUFdFi60XHWD27nrWtUQIsUYIG7Ca1WBwV2u2LSQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.11.1.tgz", + "integrity": "sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw==", "dev": true, "dependencies": { - "@volar/source-map": "1.10.0" + "@volar/source-map": "1.11.1" } }, "node_modules/@volar/source-map": { - "version": "1.10.0", - "resolved": "https://registry.npmmirror.com/@volar/source-map/-/source-map-1.10.0.tgz", - "integrity": "sha512-/ibWdcOzDGiq/GM1JU2eX8fH1bvAhl66hfe8yEgLEzg9txgr6qb5sQ/DEz5PcDL75tF5H5sCRRwn8Eu8ezi9mw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.11.1.tgz", + "integrity": "sha512-hJnOnwZ4+WT5iupLRnuzbULZ42L7BWWPMmruzwtLhJfpDVoZLjNBxHDi2sY2bgZXCKlpU5XcsMFoYrsQmPhfZg==", "dev": true, "dependencies": { "muggle-string": "^0.3.1" } }, "node_modules/@volar/typescript": { - "version": "1.10.0", - "resolved": "https://registry.npmmirror.com/@volar/typescript/-/typescript-1.10.0.tgz", - "integrity": "sha512-OtqGtFbUKYC0pLNIk3mHQp5xWnvL1CJIUc9VE39VdZ/oqpoBh5jKfb9uJ45Y4/oP/WYTrif/Uxl1k8VTPz66Gg==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.11.1.tgz", + "integrity": "sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ==", "dev": true, "dependencies": { - "@volar/language-core": "1.10.0" + "@volar/language-core": "1.11.1", + "path-browserify": "^1.0.1" } }, "node_modules/@vue/compiler-core": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.4.tgz", - "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.24.tgz", + "integrity": "sha512-vbW/tgbwJYj62N/Ww99x0zhFTkZDTcGh3uwJEuadZ/nF9/xuFMC4693P9r+3sxGXISABpDKvffY5ApH9pmdd1A==", + "dev": true, "dependencies": { - "@babel/parser": "^7.21.3", - "@vue/shared": "3.3.4", + "@babel/parser": "^7.24.4", + "@vue/shared": "3.4.24", + "entities": "^4.5.0", "estree-walker": "^2.0.2", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" } }, "node_modules/@vue/compiler-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", - "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.24.tgz", + "integrity": "sha512-4XgABML/4cNndVsQndG6BbGN7+EoisDwi3oXNovqL/4jdNhwvP8/rfRMTb6FxkxIxUUtg6AI1/qZvwfSjxJiWA==", + "dev": true, "dependencies": { - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-core": "3.4.24", + "@vue/shared": "3.4.24" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", - "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.24.tgz", + "integrity": "sha512-nRAlJUK02FTWfA2nuvNBAqsDZuERGFgxZ8sGH62XgFSvMxO2URblzulExsmj4gFZ8e+VAyDooU9oAoXfEDNxTA==", + "dev": true, + "peer": true, "dependencies": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-ssr": "3.3.4", - "@vue/reactivity-transform": "3.3.4", - "@vue/shared": "3.3.4", + "@babel/parser": "^7.24.4", + "@vue/compiler-core": "3.4.24", + "@vue/compiler-dom": "3.4.24", + "@vue/compiler-ssr": "3.4.24", + "@vue/shared": "3.4.24", "estree-walker": "^2.0.2", - "magic-string": "^0.30.0", - "postcss": "^8.1.10", - "source-map-js": "^1.0.2" + "magic-string": "^0.30.10", + "postcss": "^8.4.38", + "source-map-js": "^1.2.0" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", - "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.24.tgz", + "integrity": "sha512-ZsAtr4fhaUFnVcDqwW3bYCSDwq+9Gk69q2r/7dAHDrOMw41kylaMgOP4zRnn6GIEJkQznKgrMOGPMFnLB52RbQ==", + "dev": true, + "peer": true, "dependencies": { - "@vue/compiler-dom": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-dom": "3.4.24", + "@vue/shared": "3.4.24" } }, "node_modules/@vue/language-core": { - "version": "1.8.8", - "resolved": "https://registry.npmmirror.com/@vue/language-core/-/language-core-1.8.8.tgz", - "integrity": "sha512-i4KMTuPazf48yMdYoebTkgSOJdFraE4pQf0B+FTOFkbB+6hAfjrSou/UmYWRsWyZV6r4Rc6DDZdI39CJwL0rWw==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.27.tgz", + "integrity": "sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==", "dev": true, "dependencies": { - "@volar/language-core": "~1.10.0", - "@volar/source-map": "~1.10.0", + "@volar/language-core": "~1.11.1", + "@volar/source-map": "~1.11.1", "@vue/compiler-dom": "^3.3.0", - "@vue/reactivity": "^3.3.0", "@vue/shared": "^3.3.0", - "minimatch": "^9.0.0", + "computeds": "^0.0.1", + "minimatch": "^9.0.3", "muggle-string": "^0.3.1", + "path-browserify": "^1.0.1", "vue-template-compiler": "^2.7.14" }, "peerDependencies": { @@ -513,7 +204,7 @@ }, "node_modules/@vue/language-core/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { @@ -521,92 +212,82 @@ } }, "node_modules/@vue/language-core/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@vue/reactivity": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.4.tgz", - "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.24.tgz", + "integrity": "sha512-nup3fSYg4i4LtNvu9slF/HF/0dkMQYfepUdORBcMSsankzRPzE7ypAFurpwyRBfU1i7Dn1kcwpYsE1wETSh91g==", + "dev": true, + "peer": true, "dependencies": { - "@vue/shared": "3.3.4" - } - }, - "node_modules/@vue/reactivity-transform": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", - "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", - "dependencies": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.0" + "@vue/shared": "3.4.24" } }, "node_modules/@vue/runtime-core": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.4.tgz", - "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.24.tgz", + "integrity": "sha512-c7iMfj6cJMeAG3s5yOn9Rc5D9e2/wIuaozmGf/ICGCY3KV5H7mbTVdvEkd4ZshTq7RUZqj2k7LMJWVx+EBiY1g==", + "dev": true, + "peer": true, "dependencies": { - "@vue/reactivity": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/reactivity": "3.4.24", + "@vue/shared": "3.4.24" } }, "node_modules/@vue/runtime-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", - "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.24.tgz", + "integrity": "sha512-uXKzuh/Emfad2Y7Qm0ABsLZZV6H3mAJ5ZVqmAOlrNQRf+T5mxpPGZBfec1hkP41t6h6FwF6RSGCs/gd8WbuySQ==", + "dev": true, + "peer": true, "dependencies": { - "@vue/runtime-core": "3.3.4", - "@vue/shared": "3.3.4", - "csstype": "^3.1.1" + "@vue/runtime-core": "3.4.24", + "@vue/shared": "3.4.24", + "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.4.tgz", - "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.24.tgz", + "integrity": "sha512-H+DLK4sQF6sRgzKyofmlEVBIV/9KrQU6HIV7nt6yIwSGGKvSwlV8pqJlebUKLpbXaNHugdSfAbP6YmXF69lxow==", + "dev": true, + "peer": true, "dependencies": { - "@vue/compiler-ssr": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-ssr": "3.4.24", + "@vue/shared": "3.4.24" }, "peerDependencies": { - "vue": "3.3.4" + "vue": "3.4.24" } }, "node_modules/@vue/shared": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.4.tgz", - "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.24.tgz", + "integrity": "sha512-BW4tajrJBM9AGAknnyEw5tO2xTmnqgup0VTnDAMcxYmqOX0RG0b9aSUGAbEKolD91tdwpA6oCwbltoJoNzpItw==", + "dev": true }, "node_modules/@vue/tsconfig": { "version": "0.4.0", - "resolved": "https://registry.npmmirror.com/@vue/tsconfig/-/tsconfig-0.4.0.tgz", + "resolved": "https://registry.npmjs.org/@vue/tsconfig/-/tsconfig-0.4.0.tgz", "integrity": "sha512-CPuIReonid9+zOG/CGTT05FXrPYATEqoDGNrEaqS4hwcw5BUNM2FguC0mOwJD4Jr16UpRVl9N0pY3P+srIbqmg==", "dev": true }, - "node_modules/@vue/typescript": { - "version": "1.8.8", - "resolved": "https://registry.npmmirror.com/@vue/typescript/-/typescript-1.8.8.tgz", - "integrity": "sha512-jUnmMB6egu5wl342eaUH236v8tdcEPXXkPgj+eI/F6JwW/lb+yAU6U07ZbQ3MVabZRlupIlPESB7ajgAGixhow==", - "dev": true, - "dependencies": { - "@volar/typescript": "~1.10.0", - "@vue/language-core": "1.8.8" - } - }, "node_modules/ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-3.2.1.tgz", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "dependencies": { @@ -617,50 +298,67 @@ } }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", - "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", "dev": true, "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "get-intrinsic": "^1.2.1", - "is-array-buffer": "^3.0.2", + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", "is-shared-array-buffer": "^1.0.2" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "node_modules/brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-1.1.11.tgz", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { @@ -669,18 +367,27 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/chalk": { "version": "2.4.2", - "resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "dependencies": { @@ -694,7 +401,7 @@ }, "node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-1.9.3.tgz", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "dependencies": { @@ -703,19 +410,37 @@ }, "node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, + "node_modules/computeds": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/computeds/-/computeds-0.0.1.tgz", + "integrity": "sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==", + "dev": true + }, "node_modules/concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/copy-anything": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz", + "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", + "dev": true, + "dependencies": { + "is-what": "^3.14.1" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, "node_modules/cross-spawn": { "version": "6.0.5", - "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-6.0.5.tgz", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "dependencies": { @@ -730,32 +455,166 @@ } }, "node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dev": true, + "peer": true + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ddei-autolink": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ddei-autolink/-/ddei-autolink-1.1.1.tgz", + "integrity": "sha512-tdMuLdcJyreope1BWfnYqTQaIkSIrU/KtY9yX5mNGd+tYeJ0Y99ARHDuYnEABPX/8yh/r0Kl169v5ODg2vr98g==" + }, + "node_modules/ddei-framework": { + "version": "1.2.37", + "resolved": "https://registry.npmjs.org/ddei-framework/-/ddei-framework-1.2.37.tgz", + "integrity": "sha512-yaiFKS27WQhDhJLsz/nYZ5cm5zCCigf49+lc4VcpeNnjzKO4zWu2DoNVRXTYYnd5svJgrgQmRbytQond/eQIaQ==", + "dependencies": { + "ddei-autolink": "^1.1.1", + "lodash": "^4.17.21", + "three": "^0.156.1" + }, + "engines": { + "node": ">=16.0.0" + } }, "node_modules/de-indent": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", "dev": true }, - "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "optional": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" } }, "node_modules/error-ex": { "version": "1.3.2", - "resolved": "https://registry.npmmirror.com/error-ex/-/error-ex-1.3.2.tgz", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "dependencies": { @@ -763,64 +622,107 @@ } }, "node_modules/es-abstract": { - "version": "1.22.1", - "resolved": "https://registry.npmmirror.com/es-abstract/-/es-abstract-1.22.1.tgz", - "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", "dev": true, "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.1", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-set-tostringtag": "^2.0.1", + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.1", - "get-symbol-description": "^1.0.0", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", "globalthis": "^1.0.3", "gopd": "^1.0.1", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.3", + "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", - "safe-array-concat": "^1.0.0", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", - "typed-array-buffer": "^1.0.0", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.10" + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -828,7 +730,7 @@ }, "node_modules/es-to-primitive": { "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "dependencies": { @@ -838,12 +740,15 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/esbuild": { - "version": "0.18.17", - "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.18.17.tgz", - "integrity": "sha512-1GJtYnUxsJreHYA0Y+iQz2UEykonY66HNWOb0yXYZi9/kNrORUEHVg87eQsCtqh59PEJ5YVZJO98JHznMJSWjg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "dev": true, "hasInstallScript": true, "bin": { @@ -853,33 +758,33 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.17", - "@esbuild/android-arm64": "0.18.17", - "@esbuild/android-x64": "0.18.17", - "@esbuild/darwin-arm64": "0.18.17", - "@esbuild/darwin-x64": "0.18.17", - "@esbuild/freebsd-arm64": "0.18.17", - "@esbuild/freebsd-x64": "0.18.17", - "@esbuild/linux-arm": "0.18.17", - "@esbuild/linux-arm64": "0.18.17", - "@esbuild/linux-ia32": "0.18.17", - "@esbuild/linux-loong64": "0.18.17", - "@esbuild/linux-mips64el": "0.18.17", - "@esbuild/linux-ppc64": "0.18.17", - "@esbuild/linux-riscv64": "0.18.17", - "@esbuild/linux-s390x": "0.18.17", - "@esbuild/linux-x64": "0.18.17", - "@esbuild/netbsd-x64": "0.18.17", - "@esbuild/openbsd-x64": "0.18.17", - "@esbuild/sunos-x64": "0.18.17", - "@esbuild/win32-arm64": "0.18.17", - "@esbuild/win32-ia32": "0.18.17", - "@esbuild/win32-x64": "0.18.17" + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "node_modules/escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { @@ -888,22 +793,37 @@ }, "node_modules/estree-walker": { "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true }, "node_modules/for-each": { "version": "0.3.3", - "resolved": "https://registry.npmmirror.com/for-each/-/for-each-0.3.3.tgz", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "dependencies": { "is-callable": "^1.1.3" } }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -915,60 +835,80 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmmirror.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/functions-have-names": { "version": "1.2.3", - "resolved": "https://registry.npmmirror.com/functions-have-names/-/functions-have-names-1.2.3.tgz", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true - }, - "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/globalthis": { "version": "1.0.3", - "resolved": "https://registry.npmmirror.com/globalthis/-/globalthis-1.0.3.tgz", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", "dev": true, "dependencies": { @@ -976,44 +916,41 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/gopd": { "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/graceful-fs": { "version": "4.2.11", - "resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmmirror.com/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/has-bigints/-/has-bigints-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { @@ -1021,39 +958,63 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-symbols": { "version": "1.0.3", - "resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.0.3.tgz", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" }, "engines": { "node": ">= 0.4" @@ -1061,7 +1022,7 @@ }, "node_modules/he": { "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/he/-/he-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, "bin": { @@ -1070,18 +1031,44 @@ }, "node_modules/hosted-git-info": { "version": "2.8.9", - "resolved": "https://registry.npmmirror.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==", + "dev": true, + "optional": true, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, "dependencies": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "hasown": "^2.0.0", "side-channel": "^1.0.4" }, "engines": { @@ -1089,34 +1076,42 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmmirror.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-arrayish": { "version": "0.2.1", - "resolved": "https://registry.npmmirror.com/is-arrayish/-/is-arrayish-0.2.1.tgz", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "node_modules/is-bigint": { "version": "1.0.4", - "resolved": "https://registry.npmmirror.com/is-bigint/-/is-bigint-1.0.4.tgz", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, "dependencies": { "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-boolean-object": { "version": "1.1.2", - "resolved": "https://registry.npmmirror.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "dependencies": { @@ -1125,29 +1120,53 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-callable": { "version": "1.2.7", - "resolved": "https://registry.npmmirror.com/is-callable/-/is-callable-1.2.7.tgz", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmmirror.com/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-date-object": { "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/is-date-object/-/is-date-object-1.0.5.tgz", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, "dependencies": { @@ -1155,20 +1174,26 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-number-object": { "version": "1.0.7", - "resolved": "https://registry.npmmirror.com/is-number-object/-/is-number-object-1.0.7.tgz", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "dependencies": { @@ -1176,11 +1201,14 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-regex": { "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/is-regex/-/is-regex-1.1.4.tgz", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, "dependencies": { @@ -1189,20 +1217,29 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-string": { "version": "1.0.7", - "resolved": "https://registry.npmmirror.com/is-string/-/is-string-1.0.7.tgz", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, "dependencies": { @@ -1210,11 +1247,14 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-symbol": { "version": "1.0.4", - "resolved": "https://registry.npmmirror.com/is-symbol/-/is-symbol-1.0.4.tgz", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, "dependencies": { @@ -1222,50 +1262,103 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-typed-array": { - "version": "1.1.12", - "resolved": "https://registry.npmmirror.com/is-typed-array/-/is-typed-array-1.1.12.tgz", - "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dev": true, "dependencies": { - "which-typed-array": "^1.1.11" + "which-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakref": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/is-weakref/-/is-weakref-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-what": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", + "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==", + "dev": true + }, "node_modules/isarray": { "version": "2.0.5", - "resolved": "https://registry.npmmirror.com/isarray/-/isarray-2.0.5.tgz", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true }, "node_modules/isexe": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "node_modules/json-parse-better-errors": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/less": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/less/-/less-4.2.0.tgz", + "integrity": "sha512-P3b3HJDBtSzsXUl0im2L7gTO5Ubg8mEN6G8qoTS77iXxXX4Hvu4Qj540PZDvQ8V6DmX6iXo98k7Md0Cm1PrLaA==", + "dev": true, + "dependencies": { + "copy-anything": "^2.0.1", + "parse-node-version": "^1.0.1", + "tslib": "^2.3.0" + }, + "bin": { + "lessc": "bin/lessc" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "needle": "^3.1.0", + "source-map": "~0.6.0" + } + }, "node_modules/load-json-file": { "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/load-json-file/-/load-json-file-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", "dev": true, "dependencies": { @@ -1278,9 +1371,23 @@ "node": ">=4" } }, + "node_modules/load-json-file/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-6.0.0.tgz", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { @@ -1291,28 +1398,54 @@ } }, "node_modules/magic-string": { - "version": "0.30.2", - "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.2.tgz", - "integrity": "sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==", + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "dev": true, + "peer": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "optional": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" }, "engines": { - "node": ">=12" + "node": ">=6" } }, "node_modules/memorystream": { "version": "0.3.1", - "resolved": "https://registry.npmmirror.com/memorystream/-/memorystream-0.3.1.tgz", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", "dev": true, "engines": { "node": ">= 0.10.0" } }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/minimatch": { "version": "3.1.2", - "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { @@ -1322,16 +1455,29 @@ "node": "*" } }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/muggle-string": { "version": "0.3.1", - "resolved": "https://registry.npmmirror.com/muggle-string/-/muggle-string-0.3.1.tgz", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.3.1.tgz", "integrity": "sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==", "dev": true }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1339,15 +1485,32 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/needle": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-3.3.1.tgz", + "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==", + "dev": true, + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.3", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, "node_modules/nice-try": { "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/nice-try/-/nice-try-1.0.5.tgz", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "node_modules/normalize-package-data": { "version": "2.5.0", - "resolved": "https://registry.npmmirror.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "dependencies": { @@ -1359,7 +1522,7 @@ }, "node_modules/npm-run-all": { "version": "4.1.5", - "resolved": "https://registry.npmmirror.com/npm-run-all/-/npm-run-all-4.1.5.tgz", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", "dev": true, "dependencies": { @@ -1383,14 +1546,17 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "dev": true + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/object-keys": { "version": "1.1.1", - "resolved": "https://registry.npmmirror.com/object-keys/-/object-keys-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, "engines": { @@ -1398,23 +1564,26 @@ } }, "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmmirror.com/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/parse-json": { "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/parse-json/-/parse-json-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", "dev": true, "dependencies": { @@ -1425,9 +1594,24 @@ "node": ">=4" } }, + "node_modules/parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, "node_modules/path-key": { "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/path-key/-/path-key-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", "dev": true, "engines": { @@ -1436,13 +1620,13 @@ }, "node_modules/path-parse": { "version": "1.0.7", - "resolved": "https://registry.npmmirror.com/path-parse/-/path-parse-1.0.7.tgz", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "node_modules/path-type": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/path-type/-/path-type-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, "dependencies": { @@ -1452,14 +1636,24 @@ "node": ">=4" } }, + "node_modules/path-type/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/picocolors": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true }, "node_modules/pidtree": { "version": "0.3.1", - "resolved": "https://registry.npmmirror.com/pidtree/-/pidtree-0.3.1.tgz", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", "dev": true, "bin": { @@ -1470,30 +1664,62 @@ } }, "node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", "dev": true, "engines": { - "node": ">=4" + "node": ">= 0.4" } }, "node_modules/postcss": { - "version": "8.4.27", - "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.27.tgz", - "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "nanoid": "^3.3.6", + "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" } }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true, + "optional": true + }, "node_modules/read-pkg": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/read-pkg/-/read-pkg-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", "dev": true, "dependencies": { @@ -1506,37 +1732,44 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmmirror.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmmirror.com/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/rollup": { - "version": "3.27.0", - "resolved": "https://registry.npmmirror.com/rollup/-/rollup-3.27.0.tgz", - "integrity": "sha512-aOltLCrYZ0FhJDm7fCqwTjIUEVjWjcydKBV/Zeid6Mn8BWgDCUBBWT5beM5ieForYNo/1ZHuGJdka26kvQ3Gzg==", + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -1550,43 +1783,98 @@ } }, "node_modules/safe-array-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/safe-array-concat/-/safe-array-concat-1.0.0.tgz", - "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, "engines": { "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "optional": true + }, + "node_modules/sax": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", + "dev": true, + "optional": true + }, "node_modules/semver": { "version": "5.7.2", - "resolved": "https://registry.npmmirror.com/semver/-/semver-5.7.2.tgz", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", "dev": true, "dependencies": { @@ -1598,7 +1886,7 @@ }, "node_modules/shebang-regex": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", "dev": true, "engines": { @@ -1607,32 +1895,53 @@ }, "node_modules/shell-quote": { "version": "1.8.1", - "resolved": "https://registry.npmmirror.com/shell-quote/-/shell-quote-1.8.1.tgz", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", - "dev": true + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/spdx-correct": { "version": "3.2.0", - "resolved": "https://registry.npmmirror.com/spdx-correct/-/spdx-correct-3.2.0.tgz", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "dev": true, "dependencies": { @@ -1641,14 +1950,14 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmmirror.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "dev": true }, "node_modules/spdx-expression-parse": { "version": "3.0.1", - "resolved": "https://registry.npmmirror.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "dependencies": { @@ -1657,64 +1966,81 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.13", - "resolved": "https://registry.npmmirror.com/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", "dev": true }, "node_modules/string.prototype.padend": { - "version": "3.1.4", - "resolved": "https://registry.npmmirror.com/string.prototype.padend/-/string.prototype.padend-3.1.4.tgz", - "integrity": "sha512-67otBXoksdjsnXXRUq+KMVTdlVRZ2af422Y0aTyTjVaoQkGr3mxl2Bc5emi7dOQ3OGVVQQskmLEWwFXwommpNw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trim": { - "version": "1.2.7", - "resolved": "https://registry.npmmirror.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", - "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimend": { - "version": "1.0.6", - "resolved": "https://registry.npmmirror.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", - "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.6", - "resolved": "https://registry.npmmirror.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", - "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-bom": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/strip-bom/-/strip-bom-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "engines": { @@ -1723,7 +2049,7 @@ }, "node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-5.5.0.tgz", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { @@ -1735,72 +2061,103 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/three": { + "version": "0.156.1", + "resolved": "https://registry.npmjs.org/three/-/three-0.156.1.tgz", + "integrity": "sha512-kP7H0FK9d/k6t/XvQ9FO6i+QrePoDcNhwl0I02+wmUJRNSLCUIDMcfObnzQvxb37/0Uc9TDT0T1HgsRRrO6SYQ==" + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/typed-array-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", - "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "is-typed-array": "^1.1.10" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", - "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", - "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typed-array-length": { - "version": "1.0.4", - "resolved": "https://registry.npmmirror.com/typed-array-length/-/typed-array-length-1.0.4.tgz", - "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typescript": { "version": "5.1.6", - "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.1.6.tgz", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, "bin": { @@ -1813,7 +2170,7 @@ }, "node_modules/unbox-primitive": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { @@ -1821,11 +2178,29 @@ "has-bigints": "^1.0.2", "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" } }, "node_modules/validate-npm-package-license": { "version": "3.0.4", - "resolved": "https://registry.npmmirror.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "dependencies": { @@ -1834,14 +2209,14 @@ } }, "node_modules/vite": { - "version": "4.4.8", - "resolved": "https://registry.npmmirror.com/vite/-/vite-4.4.8.tgz", - "integrity": "sha512-LONawOUUjxQridNWGQlNizfKH89qPigK36XhMI7COMGztz8KNY0JHim7/xDd71CZwGT4HtSRgI7Hy+RlhG0Gvg==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", + "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", "dev": true, "dependencies": { "esbuild": "^0.18.10", - "postcss": "^8.4.26", - "rollup": "^3.25.2" + "postcss": "^8.4.27", + "rollup": "^3.27.1" }, "bin": { "vite": "bin/vite.js" @@ -1849,6 +2224,9 @@ "engines": { "node": "^14.18.0 || >=16.0.0" }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, "optionalDependencies": { "fsevents": "~2.3.2" }, @@ -1885,22 +2263,116 @@ } } }, - "node_modules/vue": { - "version": "3.3.4", - "resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.4.tgz", - "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", + "node_modules/vite-plugin-compression": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/vite-plugin-compression/-/vite-plugin-compression-0.5.1.tgz", + "integrity": "sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==", + "dev": true, "dependencies": { - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-sfc": "3.3.4", - "@vue/runtime-dom": "3.3.4", - "@vue/server-renderer": "3.3.4", - "@vue/shared": "3.3.4" + "chalk": "^4.1.2", + "debug": "^4.3.3", + "fs-extra": "^10.0.0" + }, + "peerDependencies": { + "vite": ">=2.0.0" + } + }, + "node_modules/vite-plugin-compression/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/vite-plugin-compression/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/vite-plugin-compression/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/vite-plugin-compression/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/vite-plugin-compression/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/vite-plugin-compression/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/vue": { + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.24.tgz", + "integrity": "sha512-NPdx7dLGyHmKHGRRU5bMRYVE+rechR+KDU5R2tSTNG36PuMwbfAJ+amEvOAw7BPfZp5sQulNELSLm5YUkau+Sg==", + "dev": true, + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.4.24", + "@vue/compiler-sfc": "3.4.24", + "@vue/runtime-dom": "3.4.24", + "@vue/server-renderer": "3.4.24", + "@vue/shared": "3.4.24" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/vue-template-compiler": { - "version": "2.7.14", - "resolved": "https://registry.npmmirror.com/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz", - "integrity": "sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==", + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz", + "integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==", "dev": true, "dependencies": { "de-indent": "^1.0.2", @@ -1908,14 +2380,14 @@ } }, "node_modules/vue-tsc": { - "version": "1.8.8", - "resolved": "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-1.8.8.tgz", - "integrity": "sha512-bSydNFQsF7AMvwWsRXD7cBIXaNs/KSjvzWLymq/UtKE36697sboX4EccSHFVxvgdBlI1frYPc/VMKJNB7DFeDQ==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.27.tgz", + "integrity": "sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==", "dev": true, "dependencies": { - "@vue/language-core": "1.8.8", - "@vue/typescript": "1.8.8", - "semver": "^7.3.8" + "@volar/typescript": "~1.11.1", + "@vue/language-core": "1.8.27", + "semver": "^7.5.4" }, "bin": { "vue-tsc": "bin/vue-tsc.js" @@ -1925,9 +2397,9 @@ } }, "node_modules/vue-tsc/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmmirror.com/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1941,7 +2413,7 @@ }, "node_modules/which": { "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/which/-/which-1.3.1.tgz", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "dependencies": { @@ -1953,7 +2425,7 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, "dependencies": { @@ -1962,27 +2434,33 @@ "is-number-object": "^1.0.4", "is-string": "^1.0.5", "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-typed-array": { - "version": "1.1.11", - "resolved": "https://registry.npmmirror.com/which-typed-array/-/which-typed-array-1.1.11.tgz", - "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true } diff --git a/package.json b/package.json index ae222e9..5f5cce7 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,67 @@ { "name": "ddei-editor", - "version": "0.0.1", - "private": true, + "version": "1.2.13", + "private": false, + "type": "module", + "author": "hoslay <3697355039@qq.com>", + "license": "Apache License 2.0", + "description": "ddei在线设计器,提供在线图形设计工具及扩展API,支持用户自己创建页面、每个页面中可以创建多个页签、在页签中通过拖拉拽的方式绘制UML、数据库设计图、软件架构图等多种类型的设计图形。支持等圆形、矩形、三角形、平行四边形等多边形绘图;支持流程图、思维导图、组织架构图的在线绘制;支持多文件、多页签编辑;支持复制、粘贴、复制样式、修改字体大小、颜色等特性;提供扩展API,能够允许外部程序调用扩展能力", + "keywords": [ + "ddei", + "ddei-plugin", + "ddei-editor", + "图形框架", + "流程图", + "思维导图", + "插件扩展", + "在线设计器" + ], + "homepage": "https://www.ddei.top", + "repository": { + "type": "git", + "url": "https://gitee.com/hoslay/ddei-editor.git" + }, + "files": [ + "dist/*", + "README.md", + "package.json" + ], + "bugs": { + "url": "https://gitee.com/hoslay/ddei-editor", + "email": "3697355039@qq.com" + }, + "main": "./dist/ddei-editor.umd.cjs", + "module": "./dist/ddei-editor.umd.cjs", + "exports": { + ".": { + "import": "./dist/ddei-editor.umd.cjs", + "require": "./dist/ddei-editor.umd.cjs" + } + }, + "engines": { + "node": ">=16.0.0" + }, "scripts": { - "dev": "vite", - "build": "run-p type-check build-only", + "dev": "vite --host=0.0.0.0", + "build": "vite build", "preview": "vite preview", "build-only": "vite build", "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false" }, "dependencies": { - "vue": "^3.3.4" + "ddei-framework": "^1.2.37" }, "devDependencies": { "@tsconfig/node18": "^18.2.0", - "@types/node": "^18.17.0", + "@types/lodash": "^4.14.197", + "@types/node": "^18.17.6", "@vitejs/plugin-vue": "^4.2.3", "@vue/tsconfig": "^0.4.0", + "less": "^4.2.0", "npm-run-all": "^4.1.5", "typescript": "~5.1.6", "vite": "^4.4.6", + "vite-plugin-compression": "^0.5.1", "vue-tsc": "^1.8.6" } } diff --git a/plugins/core/components/buttons/QBTBorderDash.vue b/plugins/core/components/buttons/QBTBorderDash.vue new file mode 100644 index 0000000..f3694eb --- /dev/null +++ b/plugins/core/components/buttons/QBTBorderDash.vue @@ -0,0 +1,255 @@ + + + + + diff --git a/plugins/core/components/buttons/QBTBorderWeight.vue b/plugins/core/components/buttons/QBTBorderWeight.vue new file mode 100644 index 0000000..dbac25f --- /dev/null +++ b/plugins/core/components/buttons/QBTBorderWeight.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/plugins/core/components/buttons/QBTEditAddFontSize.vue b/plugins/core/components/buttons/QBTEditAddFontSize.vue new file mode 100644 index 0000000..1374efb --- /dev/null +++ b/plugins/core/components/buttons/QBTEditAddFontSize.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/plugins/core/components/buttons/QBTEditBox.vue b/plugins/core/components/buttons/QBTEditBox.vue new file mode 100644 index 0000000..e83e1b2 --- /dev/null +++ b/plugins/core/components/buttons/QBTEditBox.vue @@ -0,0 +1,295 @@ + + + + + diff --git a/plugins/core/components/buttons/QBTEditColor.vue b/plugins/core/components/buttons/QBTEditColor.vue new file mode 100644 index 0000000..cd85898 --- /dev/null +++ b/plugins/core/components/buttons/QBTEditColor.vue @@ -0,0 +1,254 @@ + + + + + diff --git a/plugins/core/components/buttons/QBTEditTextAlign.vue b/plugins/core/components/buttons/QBTEditTextAlign.vue new file mode 100644 index 0000000..2b48d46 --- /dev/null +++ b/plugins/core/components/buttons/QBTEditTextAlign.vue @@ -0,0 +1,224 @@ + + + + + diff --git a/plugins/core/components/buttons/QBTFontFamily.vue b/plugins/core/components/buttons/QBTFontFamily.vue new file mode 100644 index 0000000..e829723 --- /dev/null +++ b/plugins/core/components/buttons/QBTFontFamily.vue @@ -0,0 +1,323 @@ + + + + + diff --git a/plugins/core/components/buttons/QBTFontSize.vue b/plugins/core/components/buttons/QBTFontSize.vue new file mode 100644 index 0000000..198ab23 --- /dev/null +++ b/plugins/core/components/buttons/QBTFontSize.vue @@ -0,0 +1,373 @@ + + + + + diff --git a/plugins/core/components/buttons/QBTLinePointType.vue b/plugins/core/components/buttons/QBTLinePointType.vue new file mode 100644 index 0000000..0de162e --- /dev/null +++ b/plugins/core/components/buttons/QBTLinePointType.vue @@ -0,0 +1,214 @@ + + + + + diff --git a/plugins/core/components/buttons/QBTLineType.vue b/plugins/core/components/buttons/QBTLineType.vue new file mode 100644 index 0000000..82d4e22 --- /dev/null +++ b/plugins/core/components/buttons/QBTLineType.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/plugins/core/components/buttons/qbt-addfontsize.ts b/plugins/core/components/buttons/qbt-addfontsize.ts new file mode 100644 index 0000000..8eb4775 --- /dev/null +++ b/plugins/core/components/buttons/qbt-addfontsize.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTEditAddFontSize from './QBTEditAddFontSize.vue'; + +class DDeiCoreAddFontSizeButton extends DDeiPluginBase{ + name: string = QBTEditAddFontSize.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreAddFontSizeButton = new DDeiCoreAddFontSizeButton(null); + + + plugins: object[] = [QBTEditAddFontSize] + + getComponents(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTEditAddFontSize.name]) { + for (let i in options[QBTEditAddFontSize.name]) { + newOptions[i] = options[QBTEditAddFontSize.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreAddFontSizeButton(newOptions); + return panels; + } + } + return DDeiCoreAddFontSizeButton; + } +} + +export default DDeiCoreAddFontSizeButton \ No newline at end of file diff --git a/plugins/core/components/buttons/qbt-borderdash.ts b/plugins/core/components/buttons/qbt-borderdash.ts new file mode 100644 index 0000000..8fbfefc --- /dev/null +++ b/plugins/core/components/buttons/qbt-borderdash.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTBorderDash from './QBTBorderDash.vue'; + +class DDeiCoreBorderDashButton extends DDeiPluginBase{ + name: string = QBTBorderDash.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreBorderDashButton = new DDeiCoreBorderDashButton(null); + + plugins: object[] = [QBTBorderDash] + + getComponents(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTBorderDash.name]) { + for (let i in options[QBTBorderDash.name]) { + newOptions[i] = options[QBTBorderDash.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreBorderDashButton(newOptions); + return panels; + } + } + return DDeiCoreBorderDashButton; + } +} + +export default DDeiCoreBorderDashButton \ No newline at end of file diff --git a/plugins/core/components/buttons/qbt-borderweight.ts b/plugins/core/components/buttons/qbt-borderweight.ts new file mode 100644 index 0000000..039aec2 --- /dev/null +++ b/plugins/core/components/buttons/qbt-borderweight.ts @@ -0,0 +1,41 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTBorderWeight from './QBTBorderWeight.vue'; + +class DDeiCoreBorderWeightButton extends DDeiPluginBase{ + name: string = QBTBorderWeight.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreBorderWeightButton = new DDeiCoreBorderWeightButton(null); + + plugins: object[] = [QBTBorderWeight] + + getComponents(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTBorderWeight.name]) { + for (let i in options[QBTBorderWeight.name]) { + newOptions[i] = options[QBTBorderWeight.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreBorderWeightButton(newOptions); + return panels; + } + } + return DDeiCoreBorderWeightButton; + } +} + +export default DDeiCoreBorderWeightButton \ No newline at end of file diff --git a/plugins/core/components/buttons/qbt-editbox.ts b/plugins/core/components/buttons/qbt-editbox.ts new file mode 100644 index 0000000..842efed --- /dev/null +++ b/plugins/core/components/buttons/qbt-editbox.ts @@ -0,0 +1,41 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTEditBox from './QBTEditBox.vue'; + +class DDeiCoreEditBoxButton extends DDeiPluginBase{ + name: string = QBTEditBox.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreEditBoxButton = new DDeiCoreEditBoxButton(null); + + plugins: object[] = [QBTEditBox] + + getComponents(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTEditBox.name]) { + for (let i in options[QBTEditBox.name]) { + newOptions[i] = options[QBTEditBox.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreEditBoxButton(newOptions); + return panels; + } + } + return DDeiCoreEditBoxButton; + } +} + +export default DDeiCoreEditBoxButton \ No newline at end of file diff --git a/plugins/core/components/buttons/qbt-editcolor.ts b/plugins/core/components/buttons/qbt-editcolor.ts new file mode 100644 index 0000000..c634dcc --- /dev/null +++ b/plugins/core/components/buttons/qbt-editcolor.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTEditColor from './QBTEditColor.vue'; + +class DDeiCoreEditColorButton extends DDeiPluginBase{ + name: string = QBTEditColor.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreEditColorButton = new DDeiCoreEditColorButton(null); + + + plugins: object[] = [QBTEditColor] + + getComponents(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTEditColor.name]) { + for (let i in options[QBTEditColor.name]) { + newOptions[i] = options[QBTEditColor.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreEditColorButton(newOptions); + return panels; + } + } + return DDeiCoreEditColorButton; + } +} + +export default DDeiCoreEditColorButton \ No newline at end of file diff --git a/plugins/core/components/buttons/qbt-fontfamily.ts b/plugins/core/components/buttons/qbt-fontfamily.ts new file mode 100644 index 0000000..12a6227 --- /dev/null +++ b/plugins/core/components/buttons/qbt-fontfamily.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTFontFamily from './QBTFontFamily.vue'; + +class DDeiCoreEditFontFamilyButton extends DDeiPluginBase{ + name: string = QBTFontFamily.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreEditFontFamilyButton = new DDeiCoreEditFontFamilyButton(null); + + plugins: object[] = [QBTFontFamily] + + getComponents(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTFontFamily.name]) { + for (let i in options[QBTFontFamily.name]) { + newOptions[i] = options[QBTFontFamily.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreEditFontFamilyButton(newOptions); + return panels; + } + } + return DDeiCoreEditFontFamilyButton; + } +} + +export default DDeiCoreEditFontFamilyButton \ No newline at end of file diff --git a/plugins/core/components/buttons/qbt-fontsize.ts b/plugins/core/components/buttons/qbt-fontsize.ts new file mode 100644 index 0000000..6ff13a8 --- /dev/null +++ b/plugins/core/components/buttons/qbt-fontsize.ts @@ -0,0 +1,45 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTFontSize from './QBTFontSize.vue'; + +class DDeiCoreEditFontSizeButton extends DDeiPluginBase{ + + name: string = QBTFontSize.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreEditFontSizeButton = new DDeiCoreEditFontSizeButton(null); + + + + plugins: object[] = [QBTFontSize] + + getComponents(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTFontSize.name]) { + for (let i in options[QBTFontSize.name]) { + newOptions[i] = options[QBTFontSize.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreEditFontSizeButton(newOptions); + return panels; + } + } + return DDeiCoreEditFontSizeButton; + } +} + +export default DDeiCoreEditFontSizeButton \ No newline at end of file diff --git a/plugins/core/components/buttons/qbt-linepointtype.ts b/plugins/core/components/buttons/qbt-linepointtype.ts new file mode 100644 index 0000000..3551932 --- /dev/null +++ b/plugins/core/components/buttons/qbt-linepointtype.ts @@ -0,0 +1,44 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTLinePointType from './QBTLinePointType.vue'; + +class DDeiCoreEditLinePointTypeButton extends DDeiPluginBase{ + name: string = QBTLinePointType.name + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreEditLinePointTypeButton = new DDeiCoreEditLinePointTypeButton(null); + + + plugins: object[] = [QBTLinePointType] + + getComponents(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTLinePointType.name]) { + for (let i in options[QBTLinePointType.name]) { + newOptions[i] = options[QBTLinePointType.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreEditLinePointTypeButton(newOptions); + return panels; + } + } + return DDeiCoreEditLinePointTypeButton; + } +} + +export default DDeiCoreEditLinePointTypeButton \ No newline at end of file diff --git a/plugins/core/components/buttons/qbt-linetype.ts b/plugins/core/components/buttons/qbt-linetype.ts new file mode 100644 index 0000000..6a0c18a --- /dev/null +++ b/plugins/core/components/buttons/qbt-linetype.ts @@ -0,0 +1,45 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTLineType from './QBTLineType.vue'; + +class DDeiCoreEditLineTypeButton extends DDeiPluginBase{ + name: string = QBTLineType.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreEditLineTypeButton = new DDeiCoreEditLineTypeButton(null); + + + + plugins: object[] = [QBTLineType] + + getComponents(editor){ + return this.plugins; + } + + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTLineType.name]) { + for (let i in options[QBTLineType.name]) { + newOptions[i] = options[QBTLineType.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreEditLineTypeButton(newOptions); + return panels; + } + } + return DDeiCoreEditLineTypeButton; + } +} + +export default DDeiCoreEditLineTypeButton \ No newline at end of file diff --git a/plugins/core/components/buttons/qbt-textalign.ts b/plugins/core/components/buttons/qbt-textalign.ts new file mode 100644 index 0000000..9a7de0a --- /dev/null +++ b/plugins/core/components/buttons/qbt-textalign.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QBTEditTextAlign from './QBTEditTextAlign.vue'; + +class DDeiCoreEditTextAlignButton extends DDeiPluginBase{ + name: string = QBTEditTextAlign.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreEditTextAlignButton = new DDeiCoreEditTextAlignButton(null); + + + plugins: object[] = [QBTEditTextAlign] + + getComponents(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QBTEditTextAlign.name]) { + for (let i in options[QBTEditTextAlign.name]) { + newOptions[i] = options[QBTEditTextAlign.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreEditTextAlignButton(newOptions); + return panels; + } + } + return DDeiCoreEditTextAlignButton; + } +} + +export default DDeiCoreEditTextAlignButton \ No newline at end of file diff --git a/plugins/core/components/index.ts b/plugins/core/components/index.ts new file mode 100644 index 0000000..8ab2b28 --- /dev/null +++ b/plugins/core/components/index.ts @@ -0,0 +1,62 @@ +import {DDeiPluginBase} from "ddei-framework"; +import DDeiCoreAddFontSizeButton from "./buttons/qbt-addfontsize" +import DDeiCoreBorderDashButton from "./buttons/qbt-borderdash" +import DDeiCoreBorderWeightButton from "./buttons/qbt-borderweight" +import DDeiCoreEditBoxButton from "./buttons/qbt-editbox" +import DDeiCoreEditColorButton from "./buttons/qbt-editcolor" +import DDeiCoreEditFontFamilyButton from "./buttons/qbt-fontfamily" +import DDeiCoreEditFontSizeButton from "./buttons/qbt-fontsize" +import DDeiCoreEditLinePointTypeButton from "./buttons/qbt-linepointtype" +import DDeiCoreEditLineTypeButton from "./buttons/qbt-linetype" +import DDeiCoreEditTextAlignButton from "./buttons/qbt-textalign" + +class DDeiCoreComponents extends DDeiPluginBase{ + + type: string = "package" + + plugins: object[] = [DDeiCoreAddFontSizeButton, DDeiCoreBorderDashButton, DDeiCoreBorderWeightButton + , DDeiCoreEditBoxButton, DDeiCoreEditColorButton, + DDeiCoreEditFontFamilyButton, DDeiCoreEditFontSizeButton, DDeiCoreEditLinePointTypeButton, DDeiCoreEditLineTypeButton, DDeiCoreEditTextAlignButton] + + /** + * 缺省实例 + */ + static defaultIns:DDeiCoreComponents = new DDeiCoreComponents(null); + + + getComponents(editor){ + let components = [] + this.plugins?.forEach(plugin => { + let ls + if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { + ls = plugin.defaultIns.getComponents(editor); + } else if (plugin instanceof DDeiPluginBase) { + ls = plugin.getComponents(editor); + } + if (ls?.length > 0) { + components = components.concat(ls); + } + }) + return components + } + + + + static configuration(options) { + //解析options,只使用自己相关的 + if (options) { + //解析options,只使用自己相关的 + let components = new DDeiCoreComponents(options); + for (let i = 0; i < components.plugins?.length; i++) { + components.plugins[i] = components.plugins[i].configuration(options, true) + } + return components; + } + return DDeiCoreComponents; + } +} + +export {DDeiCoreComponents,DDeiCoreAddFontSizeButton, DDeiCoreBorderDashButton, DDeiCoreBorderWeightButton + , DDeiCoreEditBoxButton, DDeiCoreEditColorButton, + DDeiCoreEditFontFamilyButton, DDeiCoreEditFontSizeButton, DDeiCoreEditLinePointTypeButton, DDeiCoreEditLineTypeButton, DDeiCoreEditTextAlignButton} +export default DDeiCoreComponents \ No newline at end of file diff --git a/plugins/core/controls/control/base/compose-container.ts b/plugins/core/controls/control/base/compose-container.ts new file mode 100644 index 0000000..4f3b2c4 --- /dev/null +++ b/plugins/core/controls/control/base/compose-container.ts @@ -0,0 +1,14 @@ +export default { + 'id': '100202', + 'name': '组合容器', + 'code': 'comp', + 'desc': '用于组合关系的容器', + 'type': 'DDeiRectContainer', + 'from': '100201', + + 'define': { + ext: { + groups: [] + } + } +} \ No newline at end of file diff --git a/plugins/core/controls/control/base/container.ts b/plugins/core/controls/control/base/container.ts new file mode 100644 index 0000000..13fecd7 --- /dev/null +++ b/plugins/core/controls/control/base/container.ts @@ -0,0 +1,521 @@ +export default { + 'id': '100201', + 'name': '矩形容器', + 'code': 'rectange_container', + 'desc': '矩形形状的容器,能够包含其他容器', + 'type': 'DDeiRectContainer', + + /** + * 定义组件属性 + * 样式属性会影响图形的显示,修改样式属性也会刷新图形 + * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 + * 事件属性一般用来作为扩展用 + * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) + * 特殊属性: + * code属性编码在统一个组中,code唯一 + * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 + * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 + * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row + */ + attrs: [ + { + 'code': 'layout', + 'name': '布局', + 'desc': '文本的字体名称', + 'controlType': 'radio', + 'dataSource': [ + { 'text': '自由布局', 'value': 'free' }, + { 'text': '完全填充', 'value': 'full' }, + { 'text': '九宫格', 'value': 'nine' }, + { 'text': '表格', 'value': 'table' }, + { 'text': '圆心', 'value': 'cc' }, + ], + 'defaultValue': null, + 'hiddenTitle': true, + 'display': 'column', + 'dataType': 'string', + }, + { + 'code': 'width', + 'name': '宽度', + 'desc': '控件的宽度', + 'controlType': 'text', + 'dataSource': null, + 'dataType': 'integer', + 'defaultValue': "150", + }, + { + 'code': 'height', + 'name': '高度', + 'desc': '控件的高度', + 'controlType': 'text', + 'dataSource': null, + 'dataType': 'integer', + 'defaultValue': "150", + }, + { + 'id': '100500003', + 'code': 'border.type', + 'name': '边框类型', + 'desc': '用来快速选择边框的类型,以便于套用相关的样式', + 'controlType': 'border-type', + 'dataSource': [{ 'text': '无线条', 'value': '0' }, { 'text': '实线', 'value': '1' }], + 'dataType': 'string', + 'defaultValue': '1', + 'hiddenTitle': true, + 'display': 'column', + }, + { + 'id': '100500004', + 'code': 'border.color', + 'name': '颜色', + 'desc': '图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': 'black', + }, + { + 'code': 'borderOpacity', + 'name': '透明度', + 'desc': '图形的边框的透明度,0完全透明~1完全不透明', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'mapping': ["border.opacity"], + 'dataType': 'float', + 'defaultValue': 1, + 'display': 'column', + }, + { + 'code': 'borderWidth', + 'name': '粗细', + 'desc': '图形的边框的粗细,0为无边框', + 'controlType': 'range', + 'min': 0, + 'max': 10, + 'step': 0.1, + 'mapping': ["border.width"], + 'dataType': 'integer', + 'defaultValue': 1, + }, + { + 'code': 'borderDash', + 'name': '虚线', + 'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成', + 'controlType': 'border-dash', + 'dataSource': [ + { 'text': '1', 'value': [] }, + { 'text': '2', 'value': [10, 5] }, + { 'text': '3', 'value': [5, 5] }, + { 'text': '4', 'value': [10, 4, 2, 4] }, + { 'text': '5', 'value': [10, 4, 2, 4, 2, 4] }, + { 'text': '6', 'value': [10, 4, 10, 4, 2, 4] }, + { 'text': '7', 'value': [20, 5, 10, 5] }, + { 'text': '8', 'value': [20, 5, 10, 5, 10, 5] }, + { 'text': '9', 'value': [3, 3] }, + { 'text': '10', 'value': [2, 2] }, + { 'text': '11', 'value': [3, 2, 2, 2] }, + { 'text': '13', 'value': [20, 10] }, + ], + 'mapping': ["border.dash"], + 'dataType': 'integer', + 'defaultValue': [], + 'isArray': true, + }, + { + 'code': 'borderRound', + 'name': '圆角', + 'desc': '图形的边框的是否为为圆角的弧度', + 'controlType': 'range', + 'mapping': ["border.round"], + 'min': 0, + 'max': 30, + 'step': 1, + 'defaultValue': 0, + 'dataType': 'integer', + }, + { + 'code': 'fill.type', + 'name': '填充类型', + 'desc': '图形填充的类型快速设置', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '无', 'value': 0 }, { 'text': '纯色', 'value': 1 }, { 'text': '图片', 'value': 2 }], + 'defaultValue': 1, + 'type': 1, + 'orderNo': 2, + 'cascadeDisplay': { 1: { show: ['fill.color', 'fill.opacity'], hidden: ['fill.image'] }, 2: { show: ['fill.image', 'fill.opacity'], hidden: ['fill.color'] }, default: { show: ['fill.color', 'fill.opacity'], hidden: ['fill.image'] }, empty: { hidden: ['fill.color', 'fill.image', 'fill.opacity'] } }, + 'hiddenTitle': true, + 'display': 'column', + }, + { + 'code': 'fill.color', + 'name': '颜色', + 'desc': '图形的填充颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': 'white', + }, + { + 'code': 'fill.image', + 'name': '图片', + 'desc': '图形的填充图片', + 'controlType': 'text', + 'dataType': 'string', + 'defaultValue': '', + 'type': 1, + }, + { + 'code': 'fill.opacity', + 'name': '透明度', + 'desc': '图形的填充的透明度,0完全透明~1完全不透明', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'defaultValue': 1, + 'dataType': 'float', + 'display': 'column', + }, + + + { + 'code': 'font.family', + 'name': '字体', + 'desc': '文本的字体名称', + 'controlType': 'combox', + 'dataType': 'string', + 'dataSource': { + 'type': 'config', + 'data': 'fonts', + 'text': 'ch', + 'value': 'en', + 'bold': 'isSystemDefault', + 'fontFamily': 'en' + }, + 'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, + 'canSearch': true, + 'defaultValue': "Microsoft YaHei", + }, + { + 'code': 'font.size', + 'name': '大小', + 'desc': '文本的字体大小', + 'max': 50, + 'min': 5, + 'step': 0.5, + 'controlType': 'font-size', + 'dataType': 'float', + 'defaultValue': 14, + }, + { + 'code': 'font.color', + 'name': '颜色', + 'desc': '文本的颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': "#252525", + }, + { + 'code': 'fontAlign', + 'name': '对齐', + 'desc': '文本的对齐,采用九宫格式设置', + 'controlType': 'align-type', + 'mapping': [], + 'dataType': 'string', + }, + { + 'code': 'textStyle.feed', + 'name': '换行', + 'desc': '自动换行', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.scale', + 'name': '缩小字体', + 'desc': '文本的自动缩小字体填充', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.hollow', + 'name': '镂空', + 'desc': '文本的镂空显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.bold', + 'name': '粗体', + 'desc': '文本的加粗显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.italic', + 'name': '斜体', + 'desc': '文本的斜体显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.underline', + 'name': '下划线', + 'desc': '文本的下划线显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.deleteline', + 'name': '删除线', + 'desc': '文本的删除线显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.topline', + 'name': '顶部线', + 'desc': '文本的删除线显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.bgcolor', + 'name': '文字背景', + 'desc': '文本的背景颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': '', + }, + { + 'code': 'textStyle.subtype', + 'name': '标注类型', + 'desc': '文本的标注类型', + 'controlType': 'radio', + 'dataType': 'integer', + 'dataSource': [{ 'text': '正常', 'value': 0 }, { 'text': '上标', 'value': 1 }, { 'text': '中标', 'value': 2 }, { 'text': '下标', 'value': 3 }], + 'defaultValue': 0, + }, + + { + 'code': 'textStyle.align', + 'name': '水平对齐', + 'desc': '文本的水平对齐', + 'controlType': 'text', + 'dataType': 'integer', + 'defaultValue': 2, + }, + { + 'code': 'textStyle.valign', + 'name': '垂直对齐', + 'desc': '文本的垂直对齐', + 'controlType': 'text', + 'dataType': 'integer', + 'defaultValue': 2, + }, + { + 'code': 'textStyle.hspace', + 'name': '水平间距', + 'desc': '文本之间的水平间距', + 'controlType': 'range', + 'min': 0, + 'max': 10, + 'step': 0.1, + 'dataType': 'float', + 'defaultValue': 0.5, + }, + { + 'code': 'textStyle.vspace', + 'name': '垂直间距', + 'desc': '文本之间的垂直间距', + 'controlType': 'range', + 'min': 0, + 'max': 10, + 'step': 0.1, + 'dataType': 'float', + 'defaultValue': 0.5, + }, + { + 'code': 'borderCreatingOpacity', + 'name': '透明度', + 'desc': '图形的边框的透明度,0完全透明~1完全不透明', + 'controlType': 'text', + 'mapping': ["border.creating.top.opacity", "border.creating.right.opacity", "border.creating.bottom.opacity", "border.creating.left.opacity"], + 'dataType': 'float', + 'defaultValue': 0.5, + 'display': 'column', + }, + { + 'code': 'fillCreatingOpacity', + 'name': '透明度', + 'desc': '图形的填充的透明度,0完全透明~1完全不透明', + 'controlType': 'text', + 'mapping': ["fill.creating.opacity"], + 'dataType': 'float', + 'defaultValue': 0.5, + 'display': 'column', + }, + { + 'code': 'imageCreatingOpacity', + 'name': '透明度', + 'desc': '图形的填充图片的透明度,0完全透明~1完全不透明', + 'controlType': 'text', + 'mapping': ["fill.creating.opacity"], + 'dataType': 'float', + 'defaultValue': 0.5, + 'display': 'column', + }, + { + 'code': 'id', + 'name': 'id', + 'desc': '控件在画布的全局唯一ID', + 'controlType': 'text', + 'dataType': 'string', + 'readonly': true, + }, + { + 'code': 'code', + 'name': '编码', + 'desc': '控件在业务上的唯一编码,缺省和控件ID一致', + 'controlType': 'text', + 'dataType': 'string', + 'defaultValue': '编码001', + }, + { + 'code': 'text', + 'name': '文本', + 'desc': '控件的主体显示文本', + 'controlType': 'textarea', + 'defaultValue': '', + 'dataType': 'string', + 'type': [1, 2], //类别,1图形,2业务,3事件 + 'readonly': true, + }, + { + 'code': 'fmt.type', + 'name': '格式', + 'desc': '文本的显示格式', + 'controlType': 'radio', + 'dataType': 'integer', + 'dataSource': [{ 'text': '文本', 'value': 0 }, { 'text': '数字', 'value': 1 }, { 'text': '金额', 'value': 2 }, { 'text': '时间', 'value': 3 }], + 'defaultValue': 0, + 'type': [1, 2], + 'cascadeDisplay': { 1: { show: ['fmt.nscale', 'fmt.tmark'], hidden: ['fmt.mmark', 'fmt.munit', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] }, 2: { show: ['fmt.nscale', 'fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.mrmb'], hidden: ['fmt.dtype', 'fmt.format'] }, 3: { show: ['fmt.dtype', 'fmt.format'], hidden: ['fmt.mrmb', 'fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale'] }, default: { hidden: ['fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] }, empty: { hidden: ['fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] } }, + }, + { + 'code': 'fmt.nscale', + 'name': '小数位数', + 'desc': '格式化小数位数', + 'controlType': 'range', + 'min': 0, + 'max': 5, + 'dataType': 'integer', + 'defaultValue': 0, + 'type': [1, 2] + }, + { + 'code': 'fmt.tmark', + 'name': '千分符', + 'desc': '显示逗号千分符', + 'controlType': 'switch-checkbox', + 'dataType': 'integer', + 'defaultValue': 0, + 'hiddenTitle': true, + 'display': 'column', + 'type': [1, 2] + }, + { + 'code': 'fmt.mmark', + 'name': '货币符号', + 'desc': '显示货币符号', + 'controlType': 'combox', + 'dataSource': [{ 'text': '无', 'value': '' }, { 'text': '人民币', 'value': '¥' }, { 'text': '美元', 'value': '$' }, { 'text': '欧元', 'value': '€' }, { 'text': '英镑', 'value': '£' }, { 'text': '日元', 'value': '¥' }, { 'text': '卢布', 'value': '₽' }, { 'text': '法郎', 'value': '€' }], + 'defaultValue': '', + 'dataType': 'string', + 'type': [1, 2], + 'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, + }, + { + 'code': 'fmt.munit', + 'name': '货币单位', + 'desc': '显示在后方的货币单位', + 'controlType': 'text', + 'defaultValue': '', + 'dataType': 'string', + 'type': [1, 2] + }, + { + 'code': 'fmt.mrmb', + 'name': '人民币大写', + 'desc': '显示为人民币大写', + 'controlType': 'switch-checkbox', + 'dataType': 'integer', + 'defaultValue': 0, + 'hiddenTitle': true, + 'display': 'column', + 'type': [1, 2] + }, + { + 'code': 'fmt.dtype', + 'name': '日期类型', + 'desc': '日期和时间的格式化类型', + 'controlType': 'radio', + 'dataSource': [{ 'text': '2023-01-01', 'value': 1 }, { 'text': '23:59:59', 'value': 2 }, { 'text': '2023-01-01 23:59:59', 'value': 3 }, { 'text': '自定义', 'value': 99 }], + 'dataType': 'integer', + 'defaultValue': 1, + 'hiddenTitle': true, + 'display': 'column', + 'cascadeDisplay': { 1: { show: [], hidden: ['fmt.format'] }, 2: { show: [], hidden: ['fmt.format'] }, 3: { show: [], hidden: ['fmt.format'] }, 99: { hidden: [], show: ['fmt.format'] }, default: { hidden: ['fmt.format'] }, empty: { hidden: ['fmt.format'] } }, + }, + { + 'code': 'fmt.format', + 'name': '格式化', + 'desc': '自定义格式化字符串', + 'controlType': 'text', + 'dataType': 'string', + } + + + ], + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "布局", + attrs: ["layout"] + }, + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + ] + }, + ] +} \ No newline at end of file diff --git a/plugins/core/controls/control/base/line.ts b/plugins/core/controls/control/base/line.ts new file mode 100644 index 0000000..75609ff --- /dev/null +++ b/plugins/core/controls/control/base/line.ts @@ -0,0 +1,250 @@ +export default { + 'id': '100401', + 'name': '连接线', + 'code': 'line', + 'desc': '直线、折线、曲线三种连接线', + 'type': 'DDeiLine', + 'icon': 'icon-line-fold', + /** + * 定义组件属性 + * 样式属性会影响图形的显示,修改样式属性也会刷新图形 + * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 + * 事件属性一般用来作为扩展用 + * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) + * 特殊属性: + * code属性编码在统一个组中,code唯一 + * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 + * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 + * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row + */ + attrs: [ + { + 'code': 'type', + 'name': '类型', + 'desc': '用来快速连线类型,以便于套用相关的样式', + 'controlType': 'radio', + 'dataSource': [{ 'text': '直线', 'value': 1 }, { 'text': '折线', 'value': 2 }, { 'text': '曲线', 'value': 3 }], + 'dataType': 'integer', + 'defaultValue': 1, + 'cascadeDisplay': { 2: { show: ['round'], hidden: [] }, default: { show: [], hidden: ['round'] }, notempty: { hidden: ['round'] } }, + 'mapping': [], + 'type': 1 + }, + { + 'code': 'weight', + 'name': '线段', + 'desc': '控件的宽度', + 'controlType': 'range', + 'min': 0.1, + 'max': 10, + 'step': 0.1, + 'dataType': 'float', + 'defaultValue': 1, + }, + { + 'code': 'color', + 'name': '颜色', + 'desc': '线段的边框显示颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': '', + }, + { + 'code': 'fill.weight', + 'name': '填充', + 'desc': '填充的大小', + 'controlType': 'range', + 'min': 0, + 'max': 30, + 'step': 1, + 'defaultValue': 0, + 'dataType': 'integer', + }, + { + 'code': 'fill.color', + 'name': '填充色', + 'desc': '线段的边框显示颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': 'black', + }, + + { + 'code': 'dash', + 'name': '虚线', + 'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成', + 'controlType': 'border-dash', + 'dataSource': [ + { 'text': '1', 'value': [] }, + { 'text': '2', 'value': [10, 5] }, + { 'text': '3', 'value': [5, 5] }, + { 'text': '4', 'value': [10, 4, 2, 4] }, + { 'text': '5', 'value': [10, 4, 2, 4, 2, 4] }, + { 'text': '6', 'value': [10, 4, 10, 4, 2, 4] }, + { 'text': '7', 'value': [20, 5, 10, 5] }, + { 'text': '8', 'value': [20, 5, 10, 5, 10, 5] }, + { 'text': '9', 'value': [3, 3] }, + { 'text': '10', 'value': [2, 2] }, + { 'text': '11', 'value': [3, 2, 2, 2] }, + { 'text': '13', 'value': [20, 10] }, + ], + 'dataType': 'integer', + 'defaultValue': [], + 'isArray': true, + }, + { + 'code': 'opacity', + 'name': '透明度', + 'desc': '图形的边框的透明度,0完全透明~1完全不透明', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'dataType': 'float', + 'defaultValue': 1, + 'display': 'column', + }, + + + { + 'code': 'sp.type', + 'name': '起点类型', + 'desc': '起点的样式样式', + 'controlType': 'combox', + 'dataSource': [ + { 'text': '无', 'value': -1 }, + { 'text': '箭头', 'value': 1 }, + { 'text': '圆形', 'value': 2 }, + { 'text': '圆形-实心', 'value': 21 }, + { 'text': '方形', 'value': 3 }, + { 'text': '方形-实心', 'value': 31 }, + { 'text': '菱形', 'value': 4 }, + { 'text': '菱形-实心', 'value': 41 }, + { 'text': '三角形', 'value': 5 }, + { 'text': '三角形-实心', 'value': 51 }, + { 'text': '半圆', 'value': 6 }, + { 'text': '半圆-实心', 'value': 61 }, + + ], + 'itemStyle': { width: 80, height: 25, col: 2, row: 6 }, + 'dataType': 'integer', + 'cascadeDisplay': { "-1": { hidden: ['startWeidht'] }, empty: { hidden: ['startWeidht'] }, notempty: { show: ['startWeidht'] } }, + 'defaultValue': -1, + }, + { + 'code': 'sp.weight', + 'name': '大小', + 'desc': '起点的箭头的宽度', + 'controlType': 'range', + 'min': 1, + 'max': 30, + 'step': 1, + 'defaultValue': 6, + 'dataType': 'integer', + }, + { + 'code': 'ep.type', + 'name': '终点类型', + 'desc': '终点的样式样式', + 'controlType': 'combox', + 'dataSource': [ + { 'text': '无', 'value': -1 }, + { 'text': '箭头', 'value': 1 }, + { 'text': '圆形', 'value': 2 }, + { 'text': '圆形-实心', 'value': 21 }, + { 'text': '方形', 'value': 3 }, + { 'text': '方形-实心', 'value': 31 }, + { 'text': '菱形', 'value': 4 }, + { 'text': '菱形-实心', 'value': 41 }, + { 'text': '三角形', 'value': 5 }, + { 'text': '三角形-实心', 'value': 51 }, + { 'text': '半圆', 'value': 6 }, + { 'text': '半圆-实心', 'value': 61 }, + ], + 'itemStyle': { width: 80, height: 25, col: 2, row: 6 }, + 'dataType': 'integer', + 'cascadeDisplay': { "-1": { hidden: ['endWeidht'] }, empty: { hidden: ['endWeidht'] }, notempty: { show: ['endWeidht'] } }, + 'defaultValue': 5, + }, + { + 'code': 'ep.weight', + 'name': '大小', + 'desc': '终点的箭头的宽度', + 'controlType': 'range', + 'min': 1, + 'max': 30, + 'step': 1, + 'defaultValue': 6, + 'dataType': 'integer', + }, + + { + 'code': 'round', + 'name': '圆角', + 'desc': '图形的边框的是否为为圆角的弧度', + 'controlType': 'range', + 'min': 0, + 'max': 30, + 'step': 1, + 'defaultValue': 0, + 'dataType': 'integer', + }, + { + 'code': 'jumpline', + 'name': '跳线', + 'desc': '用来控制当前线段的跳线类型', + 'controlType': 'radio', + 'dataSource': [{ 'text': '是', 'value': 1 }, { 'text': '否', 'value': 2 }, { 'text': '全局', 'value': 0 }], + 'dataType': 'integer', + 'defaultValue': 0, + 'type': 1, + }, + { + 'code': 'id', + 'name': 'id', + 'desc': '控件在画布的全局唯一ID', + 'controlType': 'text', + 'dataType': 'string', + 'readonly': true, + }, + { + 'code': 'code', + 'name': '编码', + 'desc': '控件在业务上的唯一编码,缺省和控件ID一致', + 'controlType': 'text', + 'dataType': 'string', + 'defaultValue': '编码001', + }, + ], + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + + { + name: "线条", + attrs: ["type", "weight", "color", "fill.weight", "fill.color", "dash", "opacity", + "sp.type", "sp.weight", "ep.type", "ep.weight", "round", "jumpline" + ] + }, + ] + }, + { + name: "属性", + icon: 'icon-a-ziyuan409', + subGroups: [ + { + name: "属性", + attrs: ["code"] + }, + + ] + }, + + + ] +} \ No newline at end of file diff --git a/plugins/core/controls/control/base/polygon.ts b/plugins/core/controls/control/base/polygon.ts new file mode 100644 index 0000000..a4a369b --- /dev/null +++ b/plugins/core/controls/control/base/polygon.ts @@ -0,0 +1,545 @@ +export default { + 'id': '100500', + 'name': '多边形', + 'code': 'polygon', + 'desc': '多个3-N边构成的多边形', + 'type': 'DDeiPolygon', + + /** + * 定义组件属性 + * 样式属性会影响图形的显示,修改样式属性也会刷新图形 + * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 + * 事件属性一般用来作为扩展用 + * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) + * 特殊属性: + * code属性编码在统一个组中,code唯一 + * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 + * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 + * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row + */ + attrs: [ + { + 'code': 'width', + 'name': '宽度', + 'desc': '控件的宽度', + 'controlType': 'text', + 'dataSource': null, + 'dataType': 'integer', + 'defaultValue': "150", + }, + { + 'code': 'height', + 'name': '高度', + 'desc': '控件的高度', + 'controlType': 'text', + 'dataSource': null, + 'dataType': 'integer', + 'defaultValue': "150", + }, + { + 'code': 'border.type', + 'name': '边框类型', + 'desc': '用来快速选择边框的类型,以便于套用相关的样式', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '无线条', 'value': 0 }, { 'text': '实线', 'value': 1 }], + 'defaultValue': 1, + 'hiddenTitle': true, + 'display': 'column', + 'cascadeDisplay': { 1: { show: ["border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"], hidden: [] }, default: { show: ["border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"], hidden: [] }, empty: { hidden: ["border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } }, + }, + { + 'code': 'border.color', + 'name': '颜色', + 'desc': '图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式', + 'controlType': 'color-combo', + + 'dataType': 'string', + 'defaultValue': '', + }, + { + 'code': 'borderOpacity', + 'name': '透明度', + 'desc': '图形的边框的透明度,0完全透明~1完全不透明', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'mapping': ["border.opacity"], + 'dataType': 'float', + 'defaultValue': 1, + 'display': 'column', + }, + { + 'code': 'borderWidth', + 'name': '粗细', + 'desc': '图形的边框的粗细,0为无边框', + 'controlType': 'range', + 'min': 0, + 'max': 10, + 'step': 0.1, + 'mapping': ["border.width"], + 'dataType': 'integer', + 'defaultValue': 1, + }, + { + 'code': 'borderDash', + 'name': '虚线', + 'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成', + 'controlType': 'border-dash', + 'dataSource': [ + { 'text': '1', 'value': [] }, + { 'text': '2', 'value': [10, 5] }, + { 'text': '3', 'value': [5, 5] }, + { 'text': '4', 'value': [10, 4, 2, 4] }, + { 'text': '5', 'value': [10, 4, 2, 4, 2, 4] }, + { 'text': '6', 'value': [10, 4, 10, 4, 2, 4] }, + { 'text': '7', 'value': [20, 5, 10, 5] }, + { 'text': '8', 'value': [20, 5, 10, 5, 10, 5] }, + { 'text': '9', 'value': [3, 3] }, + { 'text': '10', 'value': [2, 2] }, + { 'text': '11', 'value': [3, 2, 2, 2] }, + { 'text': '13', 'value': [20, 10] }, + ], + 'mapping': ["border.dash"], + 'dataType': 'integer', + 'defaultValue': [], + 'isArray': true, + }, + { + 'code': 'borderRound', + 'name': '圆角', + 'desc': '图形的边框的是否为为圆角的弧度', + 'controlType': 'range', + 'mapping': ["border.round"], + 'min': 0, + 'max': 30, + 'step': 1, + 'defaultValue': 0, + 'dataType': 'integer', + }, + { + 'code': 'fill.type', + 'name': '填充类型', + 'desc': '图形填充的类型快速设置', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '无', 'value': 0 }, { 'text': '纯色', 'value': 1 }, { 'text': '图片', 'value': 2 }], + 'defaultValue': 1, + 'type': 1, + 'orderNo': 2, + 'cascadeDisplay': { 1: { show: ['fill.color', 'fill.opacity'], hidden: ['fill.image'] }, 2: { show: ['fill.image', 'fill.opacity'], hidden: ['fill.color'] }, default: { show: ['fill.color', 'fill.opacity'], hidden: ['fill.image'] }, empty: { hidden: ['fill.color', 'fill.image', 'fill.opacity'] } }, + 'hiddenTitle': true, + 'display': 'column', + }, + { + 'code': 'fill.color', + 'name': '颜色', + 'desc': '图形的填充颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': '', + }, + { + 'code': 'fill.image', + 'name': '图片', + 'desc': '图形的填充图片', + 'controlType': 'image', + 'dataType': 'string', + 'defaultValue': '', + 'type': 1, + }, + { + 'code': 'fill.opacity', + 'name': '透明度', + 'desc': '图形的填充的透明度,0完全透明~1完全不透明', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'defaultValue': 1, + 'dataType': 'float', + 'display': 'column', + }, + + + { + 'code': 'font.family', + 'name': '字体', + 'desc': '文本的字体名称', + 'controlType': 'combox', + 'dataType': 'string', + 'dataSource': { + 'type': 'config', + 'data': 'fonts', + 'text': 'ch', + 'value': 'en', + 'bold': 'isSystemDefault', + 'fontFamily': 'en' + }, + 'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, + 'canSearch': true, + 'defaultValue': "Microsoft YaHei", + }, + { + 'code': 'font.size', + 'name': '大小', + 'desc': '文本的字体大小', + 'max': 50, + 'min': 5, + 'step': 0.5, + 'controlType': 'font-size', + 'dataType': 'float', + 'defaultValue': 14, + }, + { + 'code': 'font.color', + 'name': '颜色', + 'desc': '文本的颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': "", + }, + { + 'code': 'fontAlign', + 'name': '对齐', + 'desc': '文本的对齐,采用九宫格式设置', + 'controlType': 'align-type', + 'mapping': [], + 'dataType': 'string', + }, + { + 'code': 'textStyle.feed', + 'name': '换行', + 'desc': '自动换行', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '1', + }, + { + 'code': 'textStyle.scale', + 'name': '超出范围', + 'desc': '文本的超出范围后的策略', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '隐藏', 'value': '0' }, { 'text': '省略', 'value': '2' }, { 'text': '缩小', 'value': '1' }, { 'text': '扩展', 'value': '3' }], + 'defaultValue': '0', + 'cascadeDisplay': { 3: { show: ['textStyle.lockWidth'], hidden: [] }, default: { hidden: ['textStyle.lockWidth'] }, empty: { hidden: ['textStyle.lockWidth'] }, notempty: { hidden: ['textStyle.lockWidth'] } } + }, + { + 'code': 'textStyle.lockWidth', + 'name': '锁定宽度', + 'desc': '超范围自动扩展的情况下锁定宽度', + 'controlType': 'switch-checkbox', + 'dataType': 'integer', + 'defaultValue': 0, + 'hiddenTitle': true, + 'display': 'column', + 'type': [1, 2] + }, + { + 'code': 'textStyle.hollow', + 'name': '镂空', + 'desc': '文本的镂空显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.bold', + 'name': '粗体', + 'desc': '文本的加粗显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.italic', + 'name': '斜体', + 'desc': '文本的斜体显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.underline', + 'name': '下划线', + 'desc': '文本的下划线显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.deleteline', + 'name': '删除线', + 'desc': '文本的删除线显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.topline', + 'name': '顶部线', + 'desc': '文本的删除线显示', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + }, + { + 'code': 'textStyle.bgcolor', + 'name': '文字背景', + 'desc': '文本的背景颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': '', + }, + { + 'code': 'textStyle.subtype', + 'name': '标注类型', + 'desc': '文本的标注类型', + 'controlType': 'radio', + 'dataType': 'integer', + 'dataSource': [{ 'text': '正常', 'value': 0 }, { 'text': '上标', 'value': 1 }, { 'text': '中标', 'value': 2 }, { 'text': '下标', 'value': 3 }], + 'defaultValue': 0, + }, + + { + 'code': 'textStyle.align', + 'name': '水平对齐', + 'desc': '文本的水平对齐', + 'controlType': 'text', + 'dataType': 'integer', + 'defaultValue': 2, + }, + { + 'code': 'textStyle.valign', + 'name': '垂直对齐', + 'desc': '文本的垂直对齐', + 'controlType': 'text', + 'dataType': 'integer', + 'defaultValue': 2, + }, + { + 'code': 'textStyle.hspace', + 'name': '水平间距', + 'desc': '文本之间的水平间距', + 'controlType': 'range', + 'min': 0, + 'max': 10, + 'step': 0.1, + 'dataType': 'float', + 'defaultValue': 0.5, + }, + { + 'code': 'textStyle.vspace', + 'name': '垂直间距', + 'desc': '文本之间的垂直间距', + 'controlType': 'range', + 'min': 0, + 'max': 10, + 'step': 0.1, + 'dataType': 'float', + 'defaultValue': 0.5, + }, + { + 'code': 'borderCreatingOpacity', + 'name': '透明度', + 'desc': '图形的边框的透明度,0完全透明~1完全不透明', + 'controlType': 'text', + 'mapping': ["border.creating.top.opacity", "border.creating.right.opacity", "border.creating.bottom.opacity", "border.creating.left.opacity"], + 'dataType': 'float', + 'defaultValue': 0.5, + 'display': 'column', + }, + { + 'code': 'fillCreatingOpacity', + 'name': '透明度', + 'desc': '图形的填充的透明度,0完全透明~1完全不透明', + 'controlType': 'text', + 'mapping': ["fill.creating.opacity"], + 'dataType': 'float', + 'defaultValue': 0.5, + 'display': 'column', + }, + { + 'code': 'imageCreatingOpacity', + 'name': '透明度', + 'desc': '图形的填充图片的透明度,0完全透明~1完全不透明', + 'controlType': 'text', + 'mapping': ["fill.creating.opacity"], + 'dataType': 'float', + 'defaultValue': 0.5, + 'display': 'column', + }, + { + 'code': 'id', + 'name': 'id', + 'desc': '控件在画布的全局唯一ID', + 'controlType': 'text', + 'dataType': 'string', + 'readonly': true, + }, + { + 'code': 'code', + 'name': '编码', + 'desc': '控件在业务上的唯一编码,缺省和控件ID一致', + 'controlType': 'text', + 'dataType': 'string', + 'defaultValue': '编码001', + }, + { + 'code': 'text', + 'name': '文本', + 'desc': '控件的主体显示文本', + 'controlType': 'textarea', + 'defaultValue': '', + 'dataType': 'string', + 'type': [1, 2], //类别,1图形,2业务,3事件 + 'readonly': true, + }, + { + 'code': 'text1', + 'name': '文本1', + 'desc': '控件的主体显示文本', + 'controlType': 'excheckbox', + 'dataType': 'integer', + 'dataSource': [{ 'text': '文本', 'value': 0 }, { 'text': '数字', 'value': 1 }, { 'text': '金额', 'value': 2 }, { 'text': '时间', 'value': 3 }], + 'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, + 'isArray':true, + 'defaultValue': [1,2], + 'type': [1, 2], //类别,1图形,2业务,3事件 + 'readonly': true, + }, + { + 'code': 'fmt.type', + 'name': '格式', + 'desc': '文本的显示格式', + 'controlType': 'radio', + 'dataType': 'integer', + 'dataSource': [{ 'text': '文本', 'value': 0 }, { 'text': '数字', 'value': 1 }, { 'text': '金额', 'value': 2 }, { 'text': '时间', 'value': 3 }], + 'defaultValue': 0, + 'type': [1, 2], + 'cascadeDisplay': { 1: { show: ['fmt.nscale', 'fmt.tmark'], hidden: ['fmt.mmark', 'fmt.munit', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] }, 2: { show: ['fmt.nscale', 'fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.mrmb'], hidden: ['fmt.dtype', 'fmt.format'] }, 3: { show: ['fmt.dtype', 'fmt.format'], hidden: ['fmt.mrmb', 'fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale'] }, default: { hidden: ['fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] }, empty: { hidden: ['fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] } }, + }, + { + 'code': 'fmt.nscale', + 'name': '小数位数', + 'desc': '格式化小数位数', + 'controlType': 'range', + 'min': 0, + 'max': 5, + 'dataType': 'integer', + 'defaultValue': 0, + 'type': [1, 2] + }, + { + 'code': 'fmt.tmark', + 'name': '千分符', + 'desc': '显示逗号千分符', + 'controlType': 'switch-checkbox', + 'dataType': 'integer', + 'defaultValue': 0, + 'hiddenTitle': true, + 'display': 'column', + 'type': [1, 2] + }, + { + 'code': 'fmt.mmark', + 'name': '货币符号', + 'desc': '显示货币符号', + 'controlType': 'combox', + 'dataSource': [{ 'text': '无', 'value': '' }, { 'text': '人民币', 'value': '¥' }, { 'text': '美元', 'value': '$' }, { 'text': '欧元', 'value': '€' }, { 'text': '英镑', 'value': '£' }, { 'text': '日元', 'value': '¥' }, { 'text': '卢布', 'value': '₽' }, { 'text': '法郎', 'value': '€' }], + 'defaultValue': '', + 'dataType': 'string', + 'type': [1, 2], + 'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, + }, + { + 'code': 'fmt.munit', + 'name': '货币单位', + 'desc': '显示在后方的货币单位', + 'controlType': 'text', + 'defaultValue': '', + 'dataType': 'string', + 'type': [1, 2] + }, + { + 'code': 'fmt.mrmb', + 'name': '人民币大写', + 'desc': '显示为人民币大写', + 'controlType': 'switch-checkbox', + 'dataType': 'integer', + 'defaultValue': 0, + 'hiddenTitle': true, + 'display': 'column', + 'type': [1, 2] + }, + { + 'code': 'fmt.dtype', + 'name': '日期类型', + 'desc': '日期和时间的格式化类型', + 'controlType': 'radio', + 'dataSource': [{ 'text': '2023-01-01', 'value': 1 }, { 'text': '23:59:59', 'value': 2 }, { 'text': '2023-01-01 23:59:59', 'value': 3 }, { 'text': '自定义', 'value': 99 }], + 'dataType': 'integer', + 'defaultValue': 1, + 'hiddenTitle': true, + 'display': 'column', + 'cascadeDisplay': { 1: { show: [], hidden: ['fmt.format'] }, 2: { show: [], hidden: ['fmt.format'] }, 3: { show: [], hidden: ['fmt.format'] }, 99: { hidden: [], show: ['fmt.format'] }, default: { hidden: ['fmt.format'] }, empty: { hidden: ['fmt.format'] } }, + }, + { + 'code': 'fmt.format', + 'name': '格式化', + 'desc': '自定义格式化字符串', + 'controlType': 'text', + 'dataType': 'string', + } + + ], + + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.lockWidth", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + }, + { + name: "数据", + icon: 'icon-a-ziyuan409', + subGroups: [ + { + name: "基础信息", + attrs: ["code", "text", "text1", "fmt.type", "fmt.nscale", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.mrmb", "fmt.dtype", "fmt.format"] + }, + + ] + }, + + + ] +} diff --git a/plugins/core/controls/control/base/table-cell.ts b/plugins/core/controls/control/base/table-cell.ts new file mode 100644 index 0000000..36babfb --- /dev/null +++ b/plugins/core/controls/control/base/table-cell.ts @@ -0,0 +1,467 @@ +export default { + 'id': '100302', + 'name': '单元格', + 'code': 'table-cell', + 'desc': '表格的单元格', + 'type': 'DDeiTableCell', + 'icon': 'toolbox-shape-rect' +} + + +/** + * 定义组件的样式属性,样式属性会影响图形的显示,修改样式属性也会刷新图形 + * 样式属性通常从001段ID开始计数 + * 属性采用三层结构:组(styles、datas、events)、子分组(group)、以及属性 + * 特殊属性: + * code属性编码在统一个组中,code唯一 + * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 + * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 + * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row + */ +export const styles = { + 'name': '样式', + 'children': [ + { + 'id': '100302001', + 'code': 'width', + 'name': '宽度', + 'desc': '控件的宽度', + 'group': '布局', + 'controlType': 'text', + 'dataSource': null, + 'dataType': 'integer', + 'defaultValue': "160", + 'orderNo': 1, + 'visiable': false + }, + { + 'id': '100302002', + 'code': 'height', + 'name': '高度', + 'desc': '控件的高度', + 'group': '布局', + 'controlType': 'text', + 'dataSource': null, + 'dataType': 'integer', + 'defaultValue': "80", + 'orderNo': 2, + 'visiable': false + }, + { + 'id': '100302003', + 'code': 'border.type', + 'name': '边框类型', + 'desc': '用来快速选择边框的类型,以便于套用相关的样式', + 'group': '边框', + 'controlType': 'border-type', + 'dataSource': [{ 'text': '无线条', 'value': '0' }, { 'text': '实线', 'value': '1' }], + 'dataType': 'string', + 'defaultValue': '1', + 'hiddenTitle': true, + 'display': 'column', + 'exmapping': ['border.top.disabled', 'border.right.disabled', 'border.bottom.disabled', 'border.left.disabled'], + 'orderNo': 1, + 'visiable': true + }, + { + 'id': '100302004', + 'code': 'border.color', + 'name': '颜色', + 'desc': '图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式', + 'group': '边框', + 'controlType': 'color-combo', + 'mapping': ["border.top.color", "border.right.color", "border.bottom.color", "border.left.color"], + 'dataType': 'string', + 'defaultValue': 'rgb(219,219,233)', + 'orderNo': 2, + 'visiable': true + }, + { + 'id': '100302005', + 'code': 'borderOpacity', + 'name': '透明度', + 'desc': '图形的边框的透明度,0完全透明~1完全不透明', + 'group': '边框', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'mapping': ["border.top.opacity", "border.right.opacity", "border.bottom.opacity", "border.left.opacity"], + 'dataType': 'float', + 'defaultValue': 1, + 'display': 'column', + 'orderNo': 3, + 'visiable': true + }, + { + 'id': '100302006', + 'code': 'borderWidth', + 'name': '粗细', + 'desc': '图形的边框的粗细,0为无边框', + 'group': '边框', + 'controlType': 'range', + 'min': 0, + 'max': 10, + 'step': 0.1, + 'mapping': ["border.top.width", "border.right.width", "border.bottom.width", "border.left.width"], + 'dataType': 'integer', + 'defaultValue': 1, + 'orderNo': 4, + 'visiable': true + }, + { + 'id': '100302007', + 'code': 'borderDash', + 'name': '虚线', + 'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成', + 'group': '边框', + 'controlType': 'combox', + 'dataSource': [ + { 'img': 'icon-line-00', 'text': '1', 'value': [] }, + { 'img': 'icon-line-00', 'text': '2', 'value': [10, 5] }, + { 'img': 'icon-line-00', 'text': '3', 'value': [5, 5] }, + { 'img': 'icon-line-00', 'text': '4', 'value': [10, 4, 2, 4] }, + { 'img': 'icon-line-00', 'text': '5', 'value': [10, 4, 2, 4, 2, 4] }, + { 'img': 'icon-line-00', 'text': '6', 'value': [10, 4, 10, 4, 2, 4] }, + { 'img': 'icon-line-00', 'text': '7', 'value': [20, 5, 10, 5] }, + { 'img': 'icon-line-00', 'text': '8', 'value': [20, 5, 10, 5, 10, 5] }, + { 'img': 'icon-line-00', 'text': '9', 'value': [3, 3] }, + { 'img': 'icon-line-00', 'text': '10', 'value': [2, 2] }, + { 'img': 'icon-line-00', 'text': '11', 'value': [3, 2, 2, 2] }, + { 'img': 'icon-line-00', 'text': '12', 'value': [3, 2, 2, 2, 2, 2] }, + ], + 'itemStyle': { width: 80, height: 25, col: 2, row: 6, imgWidth: 60, imgHeight: 20, display: "img-text" }, + 'mapping': ["border.top.dash", "border.right.dash", "border.bottom.dash", "border.left.dash"], + 'dataType': 'integer', + 'defaultValue': [], + 'isArray': true, + 'orderNo': 5, + 'visiable': true + }, + { + 'id': '100302008', + 'code': 'borderRound', + 'name': '圆角', + 'desc': '图形的边框的是否为为圆角的弧度', + 'group': '边框', + 'controlType': 'range', + 'mapping': ["border.top.round", "border.right.round", "border.bottom.round", "border.left.round"], + 'min': 0, + 'max': 100, + 'step': 1, + 'defaultValue': 0, + 'dataType': 'integer', + 'orderNo': 6, + 'visiable': true + }, + { + 'id': '100302101', + 'code': 'fillType', + 'name': '填充类型', + 'desc': '图形填充的类型快速设置', + 'group': '填充', + 'controlType': 'fill-type', + 'dataSource': [{ 'text': '无填充', 'value': '0' }, { 'text': '单色填充', 'value': '1' }], + 'exmapping': ['fill.disabled'], + 'dataType': 'string', + 'defaultValue': '1', + 'hiddenTitle': true, + 'display': 'column', + 'orderNo': 1, + 'visiable': true + }, + { + 'id': '100302102', + 'code': 'fill.color', + 'name': '颜色', + 'desc': '图形的填充颜色', + 'group': '填充', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': 'white', + 'orderNo': 2, + 'visiable': true + }, + { + 'id': '100302103', + 'code': 'fill.opacity', + 'name': '透明度', + 'desc': '图形的填充的透明度,0完全透明~1完全不透明', + 'group': '填充', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'defaultValue': 1, + 'dataType': 'float', + 'display': 'column', + 'orderNo': 3, + 'visiable': true + }, + { + 'id': '100302201', + 'code': 'font.family', + 'name': '字体', + 'desc': '文本的字体名称', + 'group': '文本', + 'controlType': 'combox', + 'dataType': 'string', + 'dataSource': { + 'type': 'config', + 'data': 'fonts', + 'text': 'ch', + 'value': 'en', + 'bold': 'isSystemDefault', + 'fontFamily': 'en' + }, + 'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, + 'canSearch': true, + 'defaultValue': "Microsoft YaHei", + 'orderNo': 1, + 'visiable': true + }, + { + 'id': '100302202', + 'code': 'font.size', + 'name': '大小', + 'desc': '文本的字体大小', + 'group': '文本', + 'max': 50, + 'min': 5, + 'step': 0.5, + 'controlType': 'font-size', + 'dataType': 'float', + 'defaultValue': 14, + 'orderNo': 2, + 'visiable': true + }, + { + 'id': '100302203', + 'code': 'font.color', + 'name': '颜色', + 'desc': '文本的颜色', + 'group': '文本', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': "#252525", + 'orderNo': 3, + 'visiable': true + }, + { + 'id': '100302204', + 'code': 'fontAlign', + 'name': '对齐', + 'desc': '文本的对齐,采用九宫格式设置', + 'group': '文本', + 'controlType': 'align-type', + 'mapping': [], + 'dataType': 'string', + 'orderNo': 4, + 'visiable': true + }, + { + 'id': '100302205', + 'code': 'textStyle.feed', + 'name': '换行', + 'desc': '自动换行', + 'group': '文本', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + 'orderNo': 10, + 'visiable': true + }, + { + 'id': '100302206', + 'code': 'textStyle.scale', + 'name': '缩小字体', + 'desc': '文本的自动缩小字体填充', + 'group': '文本', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + 'orderNo': 11, + 'visiable': true + }, + { + 'id': '100302207', + 'code': 'textStyle.hollow', + 'name': '镂空', + 'desc': '文本的镂空显示', + 'group': '文本', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + 'orderNo': 9, + 'visiable': true + }, + { + 'id': '100302208', + 'code': 'textStyle.bold', + 'name': '粗体', + 'desc': '文本的加粗显示', + 'group': '文本', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + 'orderNo': 5, + 'visiable': true + }, + { + 'id': '100302209', + 'code': 'textStyle.italic', + 'name': '斜体', + 'desc': '文本的斜体显示', + 'group': '文本', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + 'orderNo': 6, + 'visiable': true + }, + { + 'id': '100302210', + 'code': 'textStyle.underline', + 'name': '下划线', + 'desc': '文本的下划线显示', + 'group': '文本', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + 'orderNo': 7, + 'visiable': true + }, + { + 'id': '100302211', + 'code': 'textStyle.deleteline', + 'name': '删除线', + 'desc': '文本的删除线显示', + 'group': '文本', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + 'orderNo': 8, + 'visiable': true + }, + { + 'id': '100302212', + 'code': 'textStyle.topline', + 'name': '顶部线', + 'desc': '文本的删除线显示', + 'group': '文本', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }], + 'defaultValue': '0', + 'orderNo': 8, + 'visiable': true + }, + + { + 'id': '100302303', + 'code': 'textStyle.align', + 'name': '水平对齐', + 'desc': '文本的水平对齐', + 'group': '文本', + 'controlType': 'text', + 'dataType': 'integer', + 'defaultValue': 2, + 'visiable': false + }, + { + 'id': '100302304', + 'code': 'textStyle.valign', + 'name': '垂直对齐', + 'desc': '文本的垂直对齐', + 'group': '文本', + 'controlType': 'text', + 'dataType': 'integer', + 'defaultValue': 2, + 'visiable': false + }, + ], + 'visiable': false, + 'order': 1 +} + +/** + * 定义组件的数据属性,数据属性一般用于业务就算,修改数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 + * 数据属性通常占用400段ID,开始计数 + */ +export const datas = { + 'name': '数据', + 'children': [ + { + 'id': '100302401', + 'code': 'id', + 'name': 'id', + 'desc': '控件在画布的全局唯一ID', + 'group': '布局与文本', + 'controlType': 'text', + 'dataType': 'string', + 'readonly': true, + 'orderNo': 1, + 'visiable': false + }, + { + 'id': '100302403', + 'code': 'text', + 'name': '文本', + 'desc': '控件的主体显示文本', + 'group': '布局与文本', + 'controlType': 'textarea', + 'defaultValue': '文本', + 'hiddenTitle': false, + 'display': 'column', + 'dataType': 'string', + 'type': [1, 2], //类别,1图形,2业务,3事件 + 'orderNo': 3, + 'visiable': true, + }, + { + 'id': '100302404', + 'code': 'layout', + 'name': '布局', + 'desc': '文本的字体名称', + 'group': '布局与文本', + 'controlType': 'radio', + 'dataSource': [ + { 'text': '自由布局', 'value': 'free' }, + { 'text': '完全填充', 'value': 'full' }, + { 'text': '九宫格', 'value': 'nine' }, + { 'text': '表格', 'value': 'table' }, + { 'text': '圆心', 'value': 'cc' }, + ], + 'defaultValue': 'full', + 'hiddenTitle': false, + 'display': 'column', + 'dataType': 'string', + 'orderNo': 2, + 'visiable': true + }, + ], + 'visiable': true, + 'order': 2 +} + + + + +/** + * 定义组件的事件属性,事件属性一般用于外部扩展 + * 数据属性通常占用800段ID,开始计数 + */ +export const events = { + 'name': '事件', + 'children': [ + ], + 'visiable': false, + 'order': 3 +} diff --git a/plugins/core/controls/control/base/table.ts b/plugins/core/controls/control/base/table.ts new file mode 100644 index 0000000..42509e7 --- /dev/null +++ b/plugins/core/controls/control/base/table.ts @@ -0,0 +1,281 @@ +export default { + 'id': '100301', + 'name': '表格', + 'code': 'table', + 'desc': '表格控件,可以通过插入、移动、合并单元格完成复杂的布局', + 'type': 'DDeiTable', + 'icon': 'icon-table', + 'subcontrol': '100302' +} + + +/** + * 定义组件的样式属性,样式属性会影响图形的显示,修改样式属性也会刷新图形 + * 样式属性通常从001段ID开始计数 + * 属性采用三层结构:组(styles、datas、events)、子分组(group)、以及属性 + * 特殊属性: + * code属性编码在统一个组中,code唯一 + * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 + * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 + * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row + */ +export const styles = { + 'name': '样式', + 'children': [ + { + 'id': '100301001', + 'code': 'width', + 'name': '宽度', + 'desc': '控件的宽度', + 'group': '布局', + 'controlType': 'text', + 'dataSource': null, + 'dataType': 'integer', + 'defaultValue': "600", + 'orderNo': 1, + 'visiable': false + }, + { + 'id': '100301002', + 'code': 'height', + 'name': '高度', + 'desc': '控件的高度', + 'group': '布局', + 'controlType': 'text', + 'dataSource': null, + 'dataType': 'integer', + 'defaultValue': "200", + 'orderNo': 2, + 'visiable': false + }, + { + 'id': '100301003', + 'code': 'border.type', + 'name': '边框类型', + 'desc': '用来快速选择边框的类型,以便于套用相关的样式', + 'group': '边框', + 'controlType': 'border-type', + 'dataSource': [{ 'text': '无线条', 'value': '0' }, { 'text': '实线', 'value': '1' }], + 'dataType': 'string', + 'defaultValue': '1', + 'hiddenTitle': true, + 'display': 'column', + 'exmapping': ['border.top.disabled', 'border.right.disabled', 'border.bottom.disabled', 'border.left.disabled'], + 'orderNo': 1, + 'visiable': true + }, + { + 'id': '100301004', + 'code': 'border.color', + 'name': '颜色', + 'desc': '图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式', + 'group': '边框', + 'controlType': 'color-combo', + 'mapping': ["border.top.color", "border.right.color", "border.bottom.color", "border.left.color"], + 'dataType': 'string', + 'defaultValue': 'black', + 'orderNo': 2, + 'visiable': true + }, + { + 'id': '100301005', + 'code': 'borderOpacity', + 'name': '透明度', + 'desc': '图形的边框的透明度,0完全透明~1完全不透明', + 'group': '边框', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'mapping': ["border.top.opacity", "border.right.opacity", "border.bottom.opacity", "border.left.opacity"], + 'dataType': 'float', + 'defaultValue': 1, + 'display': 'column', + 'orderNo': 3, + 'visiable': true + }, + { + 'id': '100301006', + 'code': 'borderWidth', + 'name': '粗细', + 'desc': '图形的边框的粗细,0为无边框', + 'group': '边框', + 'controlType': 'range', + 'min': 0, + 'max': 10, + 'step': 0.1, + 'mapping': ["border.top.width", "border.right.width", "border.bottom.width", "border.left.width"], + 'dataType': 'integer', + 'defaultValue': 1, + 'orderNo': 4, + 'visiable': true + }, + { + 'id': '100301007', + 'code': 'borderDash', + 'name': '虚线', + 'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成', + 'group': '边框', + 'controlType': 'combox', + 'dataSource': [ + { 'img': 'icon-line-00', 'text': '1', 'value': [] }, + { 'img': 'icon-line-00', 'text': '2', 'value': [10, 5] }, + { 'img': 'icon-line-00', 'text': '3', 'value': [5, 5] }, + { 'img': 'icon-line-00', 'text': '4', 'value': [10, 4, 2, 4] }, + { 'img': 'icon-line-00', 'text': '5', 'value': [10, 4, 2, 4, 2, 4] }, + { 'img': 'icon-line-00', 'text': '6', 'value': [10, 4, 10, 4, 2, 4] }, + { 'img': 'icon-line-00', 'text': '7', 'value': [20, 5, 10, 5] }, + { 'img': 'icon-line-00', 'text': '8', 'value': [20, 5, 10, 5, 10, 5] }, + { 'img': 'icon-line-00', 'text': '9', 'value': [3, 3] }, + { 'img': 'icon-line-00', 'text': '10', 'value': [2, 2] }, + { 'img': 'icon-line-00', 'text': '11', 'value': [3, 2, 2, 2] }, + { 'img': 'icon-line-00', 'text': '12', 'value': [3, 2, 2, 2, 2, 2] }, + ], + 'itemStyle': { width: 80, height: 25, col: 2, row: 6, imgWidth: 60, imgHeight: 20, display: "img-text" }, + 'mapping': ["border.top.dash", "border.right.dash", "border.bottom.dash", "border.left.dash"], + 'dataType': 'integer', + 'defaultValue': [], + 'isArray': true, + 'orderNo': 5, + 'visiable': true + }, + { + 'id': '100301008', + 'code': 'borderRound', + 'name': '圆角', + 'desc': '图形的边框的是否为为圆角的弧度', + 'group': '边框', + 'controlType': 'range', + 'mapping': ["border.top.round", "border.right.round", "border.bottom.round", "border.left.round"], + 'min': 0, + 'max': 100, + 'step': 1, + 'defaultValue': 0, + 'dataType': 'integer', + 'orderNo': 6, + 'visiable': true + }, + { + 'id': '100301305', + 'code': 'borderCreatingOpacity', + 'name': '透明度', + 'desc': '图形的边框的透明度,0完全透明~1完全不透明', + 'group': '边框', + 'controlType': 'text', + 'mapping': ["border.creating.top.opacity", "border.creating.right.opacity", "border.creating.bottom.opacity", "border.creating.left.opacity"], + 'dataType': 'float', + 'defaultValue': 0.5, + 'display': 'column', + 'orderNo': 3, + 'visiable': false + }, + { + 'id': '100301306', + 'code': 'fillCreatingOpacity', + 'name': '透明度', + 'desc': '图形的填充的透明度,0完全透明~1完全不透明', + 'group': '填充', + 'controlType': 'text', + 'mapping': ["fill.creating.opacity"], + 'dataType': 'float', + 'defaultValue': 0.5, + 'display': 'column', + 'orderNo': 3, + 'visiable': false + }, + ], + 'visiable': false, + 'order': 1 +} + +/** + * 定义组件的数据属性,数据属性一般用于业务就算,修改数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 + * 数据属性通常占用400段ID,开始计数 + */ +export const datas = { + 'name': '数据', + 'children': [ + { + 'id': '100301401', + 'code': 'id', + 'name': 'id', + 'desc': '控件在画布的全局唯一ID', + 'group': '基础信息', + 'controlType': 'text', + 'dataType': 'string', + 'readonly': true, + 'orderNo': 1, + 'visiable': false + }, + { + 'id': '100301402', + 'code': 'code', + 'name': '编码', + 'desc': '控件在业务上的唯一编码,缺省和控件ID一致', + 'group': '基础信息', + 'controlType': 'text', + 'dataType': 'string', + 'defaultValue': '编码001', + 'orderNo': 2, + 'visiable': true + }, + + ], + 'visiable': true, + 'order': 1 +} + + +/** + * 定义组件的事件属性,事件属性一般用于外部扩展 + * 数据属性通常占用800段ID,开始计数 + */ +export const events = { + 'name': '事件', + 'children': [ + ], + 'visiable': false, + 'order': 3 +} + + + +/** + * 定义组件的右键菜单 + */ +export const menus = [ + { + 'code': 'insert-row', + 'name': '插入行', + 'icon': 'icon-insert-row', + }, + { + 'code': 'insert-col', + 'name': '插入列', + 'icon': 'icon-insert-col', + }, + { + 'code': 'remove-row', + 'name': '删除行', + 'icon': 'icon-delete-row', + }, + { + 'code': 'remove-col', + 'name': '删除列', + 'icon': 'icon-delete-column', + }, + { + 'code': 'split', + }, + { + 'code': 'merge-cell', + 'name': '合并单元格', + 'icon': 'icon-merge-cells', + }, + { + 'code': 'cancel-merge-cell', + 'name': '取消合并单元格', + 'icon': 'icon-merge-cells', + }, + +] diff --git a/plugins/core/controls/control/basic/circle-split.ts b/plugins/core/controls/control/basic/circle-split.ts new file mode 100644 index 0000000..9c12081 --- /dev/null +++ b/plugins/core/controls/control/basic/circle-split.ts @@ -0,0 +1,33 @@ +export default { + 'id': '100104', + 'name': '圆形-切割', + 'code': 'circle', + 'desc': '由圆形,从中间横向/纵向切割开', + 'from': '100103', + 'icon': 'toolbox-shape-circle', + 'define': { + //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 + ext: { + //追加一个从中间切开的采样点,用于横向切割 + sample: { + direct: 1,//1横向切割,2纵向切割 + pvalue: 0,//切割的坐标,横向切割时为纵坐标,纵向切割时为横坐标 + rules: [ + `(i, sample, pvs, model, ovs){ + if(i == 0){ + if(sample.direct == 1){ + pvs.push({begin:1,x:-50,y:sample.pvalue,stroke:1,type:1}); + pvs.push({end:1,x:50,y:sample.pvalue,stroke:1,type:1}); + }else{ + pvs.push({begin:1,x:sample.pvalue,y:-50,stroke:1,type:1}); + pvs.push({end:1,x:sample.pvalue,y:50,stroke:1,type:1}); + } + } + }` + ] + } + } + + } + +} diff --git a/plugins/core/controls/control/basic/circle-text.ts b/plugins/core/controls/control/basic/circle-text.ts new file mode 100644 index 0000000..ece649e --- /dev/null +++ b/plugins/core/controls/control/basic/circle-text.ts @@ -0,0 +1,47 @@ +export default { + 'id': '100003', + 'name': '圆形', + 'code': 'circle', + 'desc': '由极坐标系构造的圆形,带有text', + 'from': '100103', + + + 'define': { + ext: { + //采样信息 + sample: { + //采样的规则,多组采样返回多组规则 + rules: [ + //文本区域 + `(i, sample, pvs, model, ovs){ + pvs.push({x:sample.x,y:sample.y,r:sample.r,text:1}); + }`, + ] + }, + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] + }, + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + }, + ] + + } + } + +} diff --git a/plugins/core/controls/control/basic/circle.ts b/plugins/core/controls/control/basic/circle.ts new file mode 100644 index 0000000..c87e76a --- /dev/null +++ b/plugins/core/controls/control/basic/circle.ts @@ -0,0 +1,67 @@ +export default { + 'id': '100103', + 'name': '圆形', + 'code': 'circle', + 'desc': '由极坐标系构造的圆形', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + eqrat: 1, + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 45, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let x = er * sample.cos + let y = er * sample.sin + pvs.push({x:x,y:y,r:er,select:1}); + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); + if(i == 3){ + pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); + } + }`, + //绘制线段、填充区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({r:sample.r,stroke:1,fill:1,clip:1,begin:1,end:1}); + } + }` + ] + }, + ext: { + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] + } + ] + }, + ] + } + } +} diff --git a/plugins/core/controls/control/basic/cube.ts b/plugins/core/controls/control/basic/cube.ts new file mode 100644 index 0000000..d39f425 --- /dev/null +++ b/plugins/core/controls/control/basic/cube.ts @@ -0,0 +1,58 @@ +export default { + 'id': '100501', + 'name': '正方体', + 'code': 'cube', + 'desc': '正方体', + 'from': '100500', + 'icon': 'toolbox-shape-square', + 'define': { + width: 100, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + eqrat: true, + //只采样一次 + loop: 1, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //允许文本输入 + textInput: 1, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + pvs.push({begin:1,x:50,y:50,stroke:1,select:1,oppoint:2,fill:1}); + pvs.push({x:-50,y:50,stroke:1,select:1,oppoint:2,fill:1}); + pvs.push({x:-50,y:-50,stroke:1,select:1,oppoint:2,fill:1}); + pvs.push({x:-45,y:-60,stroke:1,select:1,oppoint:1,fill:1}); + pvs.push({x:55,y:-60,stroke:1,select:1,oppoint:1,fill:1}); + pvs.push({end:1,x:55,y:40,stroke:1,select:1,oppoint:1,fill:1}); + }`, + //内部连线 + `(i, sample, pvs, model, ovs){ + pvs.push({begin:1,x:-50,y:-50,stroke:1}); + pvs.push({x:50,y:-50,stroke:1,oppoint:2,op2close:1}); + pvs.push({x:55,y:-60,stroke:1}); + pvs.push({x:-50,y:-50,type:3}); + pvs.push({x:50,y:-50,stroke:1}); + pvs.push({x:50,y:50,stroke:1}); + pvs.push({x:-50,y:-50,type:3}); + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + pvs.push({x:-48,y:48,text:sample.textInput}); + pvs.push({x:-48,y:-48,text:sample.textInput}); + pvs.push({x:48,y:-48,text:sample.textInput}); + pvs.push({x:48,y:48,text:sample.textInput}); + }`, + + + ] + } + } + +} diff --git a/plugins/core/controls/control/basic/diamond-round.ts b/plugins/core/controls/control/basic/diamond-round.ts new file mode 100644 index 0000000..f8a0fb7 --- /dev/null +++ b/plugins/core/controls/control/basic/diamond-round.ts @@ -0,0 +1,14 @@ +export default { + 'id': '100041', + 'name': '菱形', + 'code': 'diamond', + 'desc': '圆角的菱形', + 'from': '100040', + + 'define': { + + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/diamond.ts b/plugins/core/controls/control/basic/diamond.ts new file mode 100644 index 0000000..8eb9a44 --- /dev/null +++ b/plugins/core/controls/control/basic/diamond.ts @@ -0,0 +1,36 @@ +export default { + 'id': '100040', + 'name': '菱形', + 'code': 'diamond', + 'desc': '标准的菱形', + 'from': '100500', + + 'define': { + width: 160, + height: 80, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: -90, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + pvs.push({begin:i==0,end:i==3,x:sample.x,y:sample.y,select:1,oppoint:1,stroke:1,fill:1,clip:1}); + }`, + `(i, sample, pvs, model, ovs){ + let er = sample.r * Math.cos(45) + let x = er * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + let y = er * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + pvs.push({begin:i==0,end:i==3,x:x,y:y,text:1}); + }`, + ] + } + } +} + diff --git a/plugins/core/controls/control/basic/ellipse.ts b/plugins/core/controls/control/basic/ellipse.ts new file mode 100644 index 0000000..2add430 --- /dev/null +++ b/plugins/core/controls/control/basic/ellipse.ts @@ -0,0 +1,52 @@ +export default { + 'id': '100006', + 'name': '椭圆', + 'code': 'ellipse', + 'desc': '由极坐标系构造的椭圆形', + 'from': '100500', + + 'define': { + width: 160, + height: 80, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 45, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let x = er * sample.cos + let y = er * sample.sin + pvs.push({x:x,y:y,r:er,select:1}); + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); + if(i == 3){ + pvs.push({x:0,y:0,r:sample.r ,oppoint:3}); + } + }`, + //绘制线段、填充区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({r:sample.r,stroke:1,fill:1,clip:1,begin:1,end:1}); + } + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + pvs.push({x:sample.x,y:sample.y,r:sample.r,text:1}); + }`, + ] + } + } +} diff --git a/plugins/core/controls/control/basic/fivestar.ts b/plugins/core/controls/control/basic/fivestar.ts new file mode 100644 index 0000000..705923c --- /dev/null +++ b/plugins/core/controls/control/basic/fivestar.ts @@ -0,0 +1,65 @@ +export default { + 'id': '100070', + 'name': '五角星', + 'code': 'fivestar', + 'desc': '由极坐标系构造的五角星', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + eqrat: true, + //一圈10次采样 + loop: 10, + //初始次采样的开始角度 + angle: -90, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model,ovs){ + let er = i % 2 == 0 ? sample.r : sample.r / 2.7+(ovs[0].x-ovs[0].ovi.x) + let x = er * sample.cos + let y = er * sample.sin + pvs.push({ begin:i==0,end:i==9,x: x, y: y ,fill:1,select:1,stroke:1,clip:1,oppoint:1}); + }`, + `(i, sample, pvs, model,ovs){ + if (i == 0) { + let er = sample.r / 3+(ovs[0].x-ovs[0].ovi.x) + let x = er * Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let y = er * Math.sin(45 * DDeiConfig.ROTATE_UNIT) + pvs.push({ begin:1,x: x, y: y, text:1 }); + x = er * Math.cos(135 * DDeiConfig.ROTATE_UNIT) + y = er * Math.sin(135 * DDeiConfig.ROTATE_UNIT) + pvs.push({ x: x, y: y, text:1 }); + x = er * Math.cos(225 * DDeiConfig.ROTATE_UNIT) + y = er * Math.sin(225 * DDeiConfig.ROTATE_UNIT) + pvs.push({ x: x, y: y, text:1 }); + x = er * Math.cos(315 * DDeiConfig.ROTATE_UNIT) + y = er * Math.sin(315 * DDeiConfig.ROTATE_UNIT) + pvs.push({ end:1,x: x, y: y, text:1 }); + } + }`, + ] + + }, + //操作点定义 + ovs: [ + { + x: 10, y: 0, ix: 10, iy: 0, + //约束,控制点的移动路径和位置 + constraint: { + type: 2,//矩形范围 + x0: 0, + x1: 30, + y0: 0, + y1: 0, + } + } + ] + } +} diff --git a/plugins/core/controls/control/basic/half-circle.ts b/plugins/core/controls/control/basic/half-circle.ts new file mode 100644 index 0000000..bb7b66d --- /dev/null +++ b/plugins/core/controls/control/basic/half-circle.ts @@ -0,0 +1,78 @@ +export default { + 'id': '100110', + 'name': '半圆', + 'code': 'hcircle', + 'desc': '由极坐标系构造的半圆形', + 'from': '100500', + + + 'define': { + width: 100, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + eqrat: 1, + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 45, + //半径距离 + r: 50, + //方向,上右下左1,2,3,4 + direct: 2, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let deltaRotate = 0 + switch(sample.direct){ + case 1: + deltaRotate = -90 + break; + case 3: + deltaRotate = -270 + break; + case 4: + deltaRotate = -180 + break; + } + let rad1 = (90+deltaRotate) * DDeiConfig.ROTATE_UNIT + let rad2 = (-90+deltaRotate) * DDeiConfig.ROTATE_UNIT + let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT + let x0 = sample.r * Math.cos(rad0) + let y0 = sample.r * Math.sin(rad0) + let x1 = sample.r * Math.cos(rad1) + let y1 = sample.r * Math.sin(rad1) + let x2 = sample.r * Math.cos(rad2) + let y2 = sample.r * Math.sin(rad2) + pvs.push({begin:1,x:x2,y:y2,r:sample.r,rad:rad2,stroke:1,type:2,direct:1}); + pvs.push({x:x2,y:y2,r:sample.r,rad:rad1,stroke:1,type:2,direct:1}); + pvs.push({x:x2,y:y2}); + pvs.push({end:1,x:0,y:0}); + pvs.push({x:x1,y:y1,type:0,oppoint:1}); + pvs.push({x:x2,y:y2,type:0,oppoint:1}); + + pvs.push({x:x0,y:0,type:0,oppoint:1}); + pvs.push({x:x2,y:0,type:0,oppoint:1}); + pvs.push({x:x0,y:y2,type:0}); + pvs.push({x:x0,y:y1,type:0}); + } + }`, + //选中区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let x = er * sample.cos + let y = er * sample.sin + pvs.push({x:x,y:y,r:er,select:1}); + }`, + ], + + }, + iconPos: { + dx: -50 + } + } +} diff --git a/plugins/core/controls/control/basic/hexagon-round.ts b/plugins/core/controls/control/basic/hexagon-round.ts new file mode 100644 index 0000000..2458db6 --- /dev/null +++ b/plugins/core/controls/control/basic/hexagon-round.ts @@ -0,0 +1,13 @@ +export default { + 'id': '100031', + 'name': '六边形', + 'code': 'hexagon', + 'desc': '由六个点构成的六边形', + 'from': '100030', + + 'define': { + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/hexagon.ts b/plugins/core/controls/control/basic/hexagon.ts new file mode 100644 index 0000000..358dced --- /dev/null +++ b/plugins/core/controls/control/basic/hexagon.ts @@ -0,0 +1,51 @@ +export default { + 'id': '100030', + 'name': '六边形', + 'code': 'hexagon', + 'desc': '由六个点构成的六边形', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 6, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let x = er * sample.cos + let y = er * sample.sin + pvs.push({begin:i == 0,end:i == 5,op2close:i == 5 ? 1 :0,oppoint:2,x:x,y:y,select:1,clip:1,stroke:1,fill:1}); + }`, + + `(i, sample, pvs, model, ovs){ + + switch(i){ + case 0:; + case 2:; + case 3:; + case 5: + let er = sample.r / Math.cos(30 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+30) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + pvs.push({begin:i == 0,end:i == 5,x:x,y:y,text:1}); + ; + } + }`, + + + + ] + } + } +} diff --git a/plugins/core/controls/control/basic/hexstar.ts b/plugins/core/controls/control/basic/hexstar.ts new file mode 100644 index 0000000..1943dfe --- /dev/null +++ b/plugins/core/controls/control/basic/hexstar.ts @@ -0,0 +1,55 @@ +export default { + 'id': '100075', + 'name': '六芒星', + 'code': 'hexstar', + 'desc': '由极坐标系构造的六芒星', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈6次采样 + loop: 12, + //初始次采样的开始角度 + angle: -90, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let er = i%2 == 0 ? sample.r : sample.r * 0.58 + let x = er * sample.cos + let y = er * sample.sin + pvs.push({begin:i==0,end:i==11, x: x, y: y, oppoint:1,select:1,clip:1,stroke:1,fill:1 }); + }`, + `(i, sample, pvs, model, ovs){ + if(i % 2 == 1){ + let er = sample.r * 0.58 + let x = er * sample.cos + let y = er * sample.sin + pvs.push({begin:i==1,end:i==11, x: x, y: y,stroke:1,fill:1 }); + } + }`, + `(i, sample, pvs, model, ovs){ + if(i % 2 == 0 && i != 6 && i !=0){ + let er = sample.r * 0.5 + let x = er * sample.cos + let y = er * sample.sin + pvs.push({begin:i==2,end:i==10, x: x, y: y,text:1 }); + } + }`, + + ] + }, + textArea: [ + { x: -2.5, y: 32.5, z: 1 }, + { x: 102.5, y: 32.5, z: 1 }, + { x: 102.5, y: 142.5, z: 1 }, + { x: -2.5, y: 142.5, z: 1 }, + ], + } +} diff --git a/plugins/core/controls/control/basic/hexstar1.ts b/plugins/core/controls/control/basic/hexstar1.ts new file mode 100644 index 0000000..1632505 --- /dev/null +++ b/plugins/core/controls/control/basic/hexstar1.ts @@ -0,0 +1,40 @@ +export default { + 'id': '100076', + 'name': '六角形', + 'code': 'hexstar', + 'desc': '由极坐标系构造的六角星', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈6次采样 + loop: 12, + //初始次采样的开始角度 + angle: -90, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let er = i%2 == 0 ? sample.r : sample.r * 0.58 + let x = er * sample.cos + let y = er * sample.sin + pvs.push({begin:i==0,end:i==11, x: x, y: y,select:1,clip:1,stroke:1,fill:1,oppoint:1 }); + }`, + `(i, sample, pvs, model, ovs){ + if(i % 2 == 0 && i != 6 && i !=0){ + let x = sample.x * 0.5 + let y = sample.y * 0.5 + pvs.push({begin:i==2,end:i==10, x: x, y: y,text:1 }); + } + }`, + + ] + }, + } +} diff --git a/plugins/core/controls/control/basic/hexstar2.ts b/plugins/core/controls/control/basic/hexstar2.ts new file mode 100644 index 0000000..fa78a72 --- /dev/null +++ b/plugins/core/controls/control/basic/hexstar2.ts @@ -0,0 +1,74 @@ +export default { + 'id': '100077', + 'name': '六芒星', + 'code': 'hexstar', + 'desc': '由极坐标系构造的六芒星', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈6次采样 + loop: 12, + //初始次采样的开始角度 + angle: -90, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选择范围 + `(i, sample, pvs, model, ovs){ + if(i % 3 == 0){ + let er = (sample.r+5) / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let x = er * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + let y = er * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + pvs.push({ begin:i==0,end:i==9,x: x, y: y,select:1 }); + } + }`, + //第一层圈 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let er = sample.r+5 + let x = er * sample.cos + let y = er * sample.sin + pvs.push({begin:1,end:1, x: x, y: y,r:er,clip:1,stroke:1,fill:1 }); + } + }`, + //第二层圈 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,end:1, x: sample.x, y: sample.y,r:sample.r,stroke:1,fill:1 }); + } + }`, + //六边形外围 + `(i, sample, pvs, model, ovs){ + let er = i%2 == 0 ? sample.r : sample.r * 0.58 + let x = er * sample.cos + let y = er * sample.sin + pvs.push({ begin:i==0,end:i==11,x: x, y: y,oppoint:1,stroke:1,fill:1 }); + }`, + //内部五边形 + `(i, sample, pvs, model, ovs){ + if(i % 2 == 1){ + let x = sample.x * 0.58 + let y = sample.y * 0.58 + pvs.push({ begin:i==1,end:i==11,x: x, y: y,stroke:1,fill:1 }); + } + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i % 2 == 0 && i != 6 && i !=0){ + let x = sample.x*0.5 + let y = sample.y*0.5 + pvs.push({ begin:i==2,end:i==10,x: x, y: y,text:1 }); + } + }`, + + ], + }, + } +} diff --git a/plugins/core/controls/control/basic/left-arrow.ts b/plugins/core/controls/control/basic/left-arrow.ts new file mode 100644 index 0000000..693fb34 --- /dev/null +++ b/plugins/core/controls/control/basic/left-arrow.ts @@ -0,0 +1,16 @@ +export default { + 'id': '100121', + 'name': '左箭头', + 'code': 'arr-l', + 'desc': '指向左边的箭头', + 'from': '100120', + + 'define': { + //采样信息 + ext: { + sample: { + angle: 180 + } + } + } +} diff --git a/plugins/core/controls/control/basic/parallelogram-round.ts b/plugins/core/controls/control/basic/parallelogram-round.ts new file mode 100644 index 0000000..ebf9c4d --- /dev/null +++ b/plugins/core/controls/control/basic/parallelogram-round.ts @@ -0,0 +1,14 @@ +export default { + 'id': '100051', + 'name': '平行四边形', + 'code': 'paralgram', + 'desc': '由4个点组成的平行四边形', + 'from': '100050', + + 'define': { + + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/parallelogram.ts b/plugins/core/controls/control/basic/parallelogram.ts new file mode 100644 index 0000000..52c31b5 --- /dev/null +++ b/plugins/core/controls/control/basic/parallelogram.ts @@ -0,0 +1,97 @@ +export default { + 'id': '100050', + 'name': '平行四边形', + 'code': 'paralgram', + 'desc': '由4个点组成的平行四边形', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model,ovs){ + switch(i){ + case 0: + pvs.push({begin:1,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,stroke:1,fill:1}); + break; + case 1: + pvs.push({x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,stroke:1,fill:1}); + break; + case 2: + pvs.push({x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,stroke:1,fill:1}); + break; + case 3: + pvs.push({end:1,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,op2close:1,stroke:1,fill:1}); + pvs[0].y = pvs[1].y + pvs[1].x = pvs[2].x + pvs[2].y = pvs[3].y + pvs[3].x = pvs[0].x+(ovs[0].x-ovs[0].ovi.x) + pvs[2].x = pvs[2].x+(ovs[0].x-ovs[0].ovi.x) + pvs[0].x = pvs[0].x-(ovs[0].x-ovs[0].ovi.x) + pvs[1].x = pvs[1].x-(ovs[0].x-ovs[0].ovi.x) + break; + } + }`, + //文本区域 + `(i, sample, pvs, model,ovs){ + switch(i){ + case 0: + pvs.push({begin:1,x:sample.x,y:sample.y,text:1}); + break; + case 1: + pvs.push({x:sample.x,y:sample.y,text:1}); + break; + case 2: + pvs.push({x:sample.x,y:sample.y,text:1}); + break; + case 3: + pvs.push({end:1,x:sample.x,y:sample.y,text:1}); + pvs[0].y = pvs[1].y + pvs[1].x = pvs[2].x + pvs[2].y = pvs[3].y + pvs[3].x = pvs[0].x+(ovs[0].x-ovs[0].ovi.x) + pvs[2].x = pvs[2].x+(ovs[0].x-ovs[0].ovi.x) + pvs[0].x = pvs[0].x-(ovs[0].x-ovs[0].ovi.x) + pvs[1].x = pvs[1].x-(ovs[0].x-ovs[0].ovi.x) + + let x0 = Math.max(pvs[1].x,pvs[2].x) + let x1 = Math.min(pvs[3].x,pvs[0].x) + pvs[0].x = x1 + pvs[3].x = x1 + pvs[1].x = x0 + pvs[2].x = x0 + + break; + } + }` + + ], + }, + //操作点定义 + ovs: [ + { + x: 25, y: -50, ix: 0, iy: -50, + //约束,控制点的移动路径和位置 + constraint: { + type: 2,//矩形范围 + x0: -100, + x1: 100, + y0: -50, + y1: -50, + } + } + ] + + } +} diff --git a/plugins/core/controls/control/basic/pentagon-round.ts b/plugins/core/controls/control/basic/pentagon-round.ts new file mode 100644 index 0000000..1b2094f --- /dev/null +++ b/plugins/core/controls/control/basic/pentagon-round.ts @@ -0,0 +1,14 @@ +export default { + 'id': '100021', + 'name': '五边形', + 'code': 'pentagon', + 'desc': '由五个点构成的五边形', + 'from': '100020', + + 'define': { + + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/pentagon.ts b/plugins/core/controls/control/basic/pentagon.ts new file mode 100644 index 0000000..3e38482 --- /dev/null +++ b/plugins/core/controls/control/basic/pentagon.ts @@ -0,0 +1,47 @@ +export default { + 'id': '100020', + 'name': '五边形', + 'code': 'pentagon', + 'desc': '由五个点构成的五边形', + 'from': '100500', + + 'define': { + width: 154, + height: 154, + poly: 2, + //采样信息 + sample: { + eqrat: true, + //一圈5次采样 + loop: 5, + //初始次采样的开始角度 + angle: 198, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 4: + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,clip:1,oppoint:2,op2close:i == 4?1:0,stroke:1,fill:1}); + }`, + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:28,y:35,text:1}); + pvs.push({x:-28,y:35,text:1}); + pvs.push({x:-28,y:-28,text:1}); + pvs.push({end:1,x:28,y:-28,text:1}); + } + }`, + + ] + } + } +} diff --git a/plugins/core/controls/control/basic/rectangle-border.ts b/plugins/core/controls/control/basic/rectangle-border.ts new file mode 100644 index 0000000..b0c9134 --- /dev/null +++ b/plugins/core/controls/control/basic/rectangle-border.ts @@ -0,0 +1,87 @@ +export default { + 'id': '100007', + 'name': '矩形边框', + 'code': 'rect', + 'desc': '带边框的矩形', + 'from': '100002', + + 'define': { + width: 160, + height: 80, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let er = sample.r * 1.25 + let x = er * sample.cos + let y = er * sample.sin + let begin = 0,end = 0,op2close = 0 + switch(i){ + case 0: + begin = 1 + break; + case 1: + pvs[0].y=y + break; + case 2: + pvs[1].x=x + break; + case 3: + op2close = 1 + pvs[2].y=y + x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:begin,end:end,x:x,y:y,r:er,select:1,clip:1,oppoint:2,op2close:op2close}); + }`, + + `(i, sample, pvs, model, ovs){ + let er = sample.r + let x = sample.x + let y = sample.y + let begin = 0,end = 0 + switch(i){ + case 0: + begin = 1 + break; + case 1: + pvs[0].y=y + break; + case 2: + pvs[1].x=x + break; + case 3: + pvs[2].y=y + x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:begin,end:end,x:x,y:y,r:er,stroke:1,fill:1,text:1}); + }`, + ], + + + }, + //组合控件 + composes: [ + { + width: 200, + height: 100, + id: '100002', + cIndex: 1, + }, + ] + } +} diff --git a/plugins/core/controls/control/basic/rectangle-round.ts b/plugins/core/controls/control/basic/rectangle-round.ts new file mode 100644 index 0000000..7fe9283 --- /dev/null +++ b/plugins/core/controls/control/basic/rectangle-round.ts @@ -0,0 +1,13 @@ +export default { + 'id': '100005', + 'name': '圆角矩形', + 'code': 'rect', + 'desc': '由4个点组成的矩形', + 'from': '100002', + + 'define': { + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/rectangle-split.ts b/plugins/core/controls/control/basic/rectangle-split.ts new file mode 100644 index 0000000..c58a001 --- /dev/null +++ b/plugins/core/controls/control/basic/rectangle-split.ts @@ -0,0 +1,33 @@ +export default { + 'id': '100009', + 'name': '长方形-切割', + 'code': 'rect', + 'desc': '由4个点组成的长方形,从中间横向/纵向切割开', + 'from': '100008', + + 'define': { + //扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息 + ext: { + //追加一个从中间切开的采样点,用于横向切割 + sample: { + direct: 1,//1横向切割,2纵向切割 + pvalue: -10,//切割的坐标,横向切割时为纵坐标,纵向切割时为横坐标 + rules: [ + `(i, sample, pvs, model, ovs){ + if(i == 0){ + if(sample.direct == 1){ + pvs.push({begin:1,x:-50,y:sample.pvalue,stroke:1,type:1}); + pvs.push({end:1,x:50,y:sample.pvalue,stroke:1,type:1}); + }else{ + pvs.push({begin:1,x:sample.pvalue,y:-50,stroke:1,type:1}); + pvs.push({end:1,x:sample.pvalue,y:50,stroke:1,type:1}); + } + } + }` + ] + } + } + + } + +} diff --git a/plugins/core/controls/control/basic/rectangle-text.ts b/plugins/core/controls/control/basic/rectangle-text.ts new file mode 100644 index 0000000..80dd3dd --- /dev/null +++ b/plugins/core/controls/control/basic/rectangle-text.ts @@ -0,0 +1,40 @@ +export default { + 'id': '100002', + 'name': '长方形-带文本', + 'code': 'rect', + 'desc': '由4个点组成的长方形', + 'from': '100008', + + 'define': { + ext: { + sample: { + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1}); + }` + + ] + } + } + + } + +} diff --git a/plugins/core/controls/control/basic/rectangle.ts b/plugins/core/controls/control/basic/rectangle.ts new file mode 100644 index 0000000..7c55dec --- /dev/null +++ b/plugins/core/controls/control/basic/rectangle.ts @@ -0,0 +1,19 @@ +export default { + 'id': '100008', + 'name': '长方形', + 'code': 'rect', + 'desc': '由4个点组成的长方形', + 'from': '100000', + + 'define': { + width: 160, + height: 80, + ext: { + //采样信息 + sample: { + eqrat: false, + } + } + } + +} diff --git a/plugins/core/controls/control/basic/right-arrow.ts b/plugins/core/controls/control/basic/right-arrow.ts new file mode 100644 index 0000000..95452e3 --- /dev/null +++ b/plugins/core/controls/control/basic/right-arrow.ts @@ -0,0 +1,35 @@ +export default { + 'id': '100120', + 'name': '左箭头', + 'code': 'arr-r', + 'desc': '指向左边的箭头', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈12次采样 + loop: 12, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + if(i % 4 == 0){ + let op2close = 0 + if(i == 8){ + op2close = 1 + } + pvs.push({begin:i == 0,end:i == 8,x:sample.x,y:sample.y,select:1,clip:1,oppoint:2,op2close:op2close,stroke:1,fill:1}); + } + }` + ] + } + } +} diff --git a/plugins/core/controls/control/basic/square-round.ts b/plugins/core/controls/control/basic/square-round.ts new file mode 100644 index 0000000..f60336e --- /dev/null +++ b/plugins/core/controls/control/basic/square-round.ts @@ -0,0 +1,13 @@ +export default { + 'id': '100004', + 'name': '圆角正方形', + 'code': 'square', + 'desc': '由4个点组成的正方形', + 'from': '100001', + 'icon': 'toolbox-shape-square', + 'define': { + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/square-text.ts b/plugins/core/controls/control/basic/square-text.ts new file mode 100644 index 0000000..ea6e1c0 --- /dev/null +++ b/plugins/core/controls/control/basic/square-text.ts @@ -0,0 +1,38 @@ +export default { + 'id': '100001', + 'name': '正方形-带文本', + 'code': 'square', + 'desc': '由4个点组成的正方形', + 'from': '100000', + 'icon': 'toolbox-shape-square', + 'define': { + ext: { + sample: { + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1}); + }` + + ] + } + } + } +} diff --git a/plugins/core/controls/control/basic/square.ts b/plugins/core/controls/control/basic/square.ts new file mode 100644 index 0000000..598e496 --- /dev/null +++ b/plugins/core/controls/control/basic/square.ts @@ -0,0 +1,50 @@ +export default { + 'id': '100000', + 'name': '正方形', + 'code': 'square', + 'desc': '由4个点组成的正方形', + 'from': '100500', + 'icon': 'toolbox-shape-square', + 'define': { + + width: 100, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + eqrat: true, + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0,op2close = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + op2close = 1 + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,op2close:op2close,align:1,stroke:1,fill:1}); + }`, + + ] + } + } +} diff --git a/plugins/core/controls/control/basic/text.ts b/plugins/core/controls/control/basic/text.ts new file mode 100644 index 0000000..c408fc4 --- /dev/null +++ b/plugins/core/controls/control/basic/text.ts @@ -0,0 +1,71 @@ +export default { + 'id': '100200', + 'name': '文本', + 'code': 'text', + 'desc': '跟随内容变化大小的文本', + 'from': '100002', + 'define': { + borderType: 0, + border: { + type: 0 + }, + fill: { + type: 0 + }, + text: "文本", + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.lockWidth", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + { + name: "边框", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + } + + ] + }, + { + name: "数据", + icon: 'icon-a-ziyuan409', + subGroups: [ + { + name: "数据属性", + attrs: ["code", "text", "fmt.type", "fmt.nscale", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.mrmb", "fmt.dtype", "fmt.format"] + }, + + ] + }, + + + ], + attrs: [ + { + 'code': 'textStyle.scale', + 'name': '超出范围', + 'desc': '文本的超出范围后的策略', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '隐藏', 'value': '0' }, { 'text': '省略', 'value': '2' }, { 'text': '缩小', 'value': '1' }, { 'text': '扩展', 'value': '3' }], + 'defaultValue': '3', + 'cascadeDisplay': { 3: { show: ['textStyle.lockWidth'], hidden: [] }, default: { hidden: ['textStyle.lockWidth'] }, empty: { hidden: ['textStyle.lockWidth'] }, notempty: { hidden: ['textStyle.lockWidth'] } } + } + ] + } + }, + +} diff --git a/plugins/core/controls/control/basic/trapezoid-round.ts b/plugins/core/controls/control/basic/trapezoid-round.ts new file mode 100644 index 0000000..a16dc1b --- /dev/null +++ b/plugins/core/controls/control/basic/trapezoid-round.ts @@ -0,0 +1,14 @@ +export default { + 'id': '100061', + 'name': '圆角梯形', + 'code': 'trapezoid', + 'desc': '由4个点组成的梯形', + 'from': '100060', + + 'define': { + + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/trapezoid.ts b/plugins/core/controls/control/basic/trapezoid.ts new file mode 100644 index 0000000..d5383e0 --- /dev/null +++ b/plugins/core/controls/control/basic/trapezoid.ts @@ -0,0 +1,74 @@ +export default { + 'id': '100060', + 'name': '梯形', + 'code': 'trapezoid', + 'desc': '由4个点组成的梯形', + 'from': '100500', + + 'define': { + + width: 160, + height: 80, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + eqrat: true, + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0,op2close = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + sample.x+=20 + break; + case 3: + op2close = 1 + pvs[2].y=sample.y + sample.x = pvs[0].x-20 + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:op2close,select:1,clip:1,stroke:1,fill:1}); + }`, + + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + sample.x -= 20 + break; + case 1: + pvs[0].y=sample.y + sample.x += 20 + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1}); + }` + + ] + } + } +} diff --git a/plugins/core/controls/control/basic/triangle-left-90-round.ts b/plugins/core/controls/control/basic/triangle-left-90-round.ts new file mode 100644 index 0000000..04b171b --- /dev/null +++ b/plugins/core/controls/control/basic/triangle-left-90-round.ts @@ -0,0 +1,14 @@ +export default { + 'id': '100014', + 'name': '直角三角形', + 'code': 'triangle', + 'desc': '由三个点构成的三角形', + 'from': '100011', + + 'define': { + + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/triangle-left-90.ts b/plugins/core/controls/control/basic/triangle-left-90.ts new file mode 100644 index 0000000..030843c --- /dev/null +++ b/plugins/core/controls/control/basic/triangle-left-90.ts @@ -0,0 +1,47 @@ +export default { + 'id': '100011', + 'name': '直角三角形', + 'code': 'triangle', + 'desc': '由三个点构成的三角形', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈1次采样 + loop: 1, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + pvs.push({begin:1,x:50,y:50,select:1,clip:1}); + pvs.push({x:-50,y:50,select:1,clip:1}); + pvs.push({x:-50,y:-50,select:1,clip:1}); + pvs.push({end:1,x:50,y:-50,select:1,clip:1}); + }`, + `(i, sample, pvs, model, ovs){ + pvs.push({begin:1,x:50,y:50,oppoint:2,align:1,stroke:1,fill:1}); + pvs.push({x:-50,y:50,oppoint:2,align:1,stroke:1,fill:1}); + pvs.push({end:1,x:-50,y:-50,oppoint:2,op2close:1,align:1,stroke:1,fill:1}); + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:-50,y:50,text:1}); + pvs.push({x:0,y:50,text:1}); + pvs.push({x:0,y:0,text:1}); + pvs.push({end:1,x:-50,y:0,text:1}); + } + }`, + + ] + } + } +} diff --git a/plugins/core/controls/control/basic/triangle-right-90-round.ts b/plugins/core/controls/control/basic/triangle-right-90-round.ts new file mode 100644 index 0000000..8242243 --- /dev/null +++ b/plugins/core/controls/control/basic/triangle-right-90-round.ts @@ -0,0 +1,14 @@ +export default { + 'id': '100015', + 'name': '直角三角形', + 'code': 'triangle', + 'desc': '由三个点构成的三角形', + 'from': '100012', + + 'define': { + + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/triangle-right-90.ts b/plugins/core/controls/control/basic/triangle-right-90.ts new file mode 100644 index 0000000..afc3681 --- /dev/null +++ b/plugins/core/controls/control/basic/triangle-right-90.ts @@ -0,0 +1,47 @@ +export default { + 'id': '100012', + 'name': '直角三角形', + 'code': 'triangle', + 'desc': '由三个点构成的三角形', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈1次采样 + loop: 1, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + pvs.push({begin:1,x:50,y:50,select:1,clip:1}); + pvs.push({x:-50,y:50,select:1,clip:1}); + pvs.push({x:-50,y:-50,select:1,clip:1}); + pvs.push({end:1,x:50,y:-50,select:1,clip:1}); + }`, + `(i, sample, pvs, model, ovs){ + pvs.push({begin:1,x:50,y:50,oppoint:2,align:1,stroke:1,fill:1}); + pvs.push({x:-50,y:50,oppoint:2,align:1,stroke:1,fill:1}); + pvs.push({end:1,x:50,y:-50,oppoint:2,op2close:1,align:1,stroke:1,fill:1}); + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:50,y:50,text:1}); + pvs.push({x:0,y:50,text:1}); + pvs.push({x:0,y:0,text:1}); + pvs.push({end:1,x:50,y:0,text:1}); + } + }`, + + ] + } + } +} diff --git a/plugins/core/controls/control/basic/triangle-round.ts b/plugins/core/controls/control/basic/triangle-round.ts new file mode 100644 index 0000000..ad4604c --- /dev/null +++ b/plugins/core/controls/control/basic/triangle-round.ts @@ -0,0 +1,13 @@ +export default { + 'id': '100013', + 'name': '三角形', + 'code': 'triangle', + 'desc': '由三个点构成的三角形', + 'from': '100010', + + 'define': { + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basic/triangle.ts b/plugins/core/controls/control/basic/triangle.ts new file mode 100644 index 0000000..a7c8df3 --- /dev/null +++ b/plugins/core/controls/control/basic/triangle.ts @@ -0,0 +1,86 @@ +export default { + 'id': '100010', + 'name': '三角形', + 'code': 'triangle', + 'desc': '由三个点构成的三角形', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + eqrat: true, + //一圈12次采样 + loop: 12, + //初始次采样的开始角度 + angle: -90, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + if(i % 4 == 0){ + let op2close = 0 + if(i == 8){ + op2close = 1 + } + pvs.push({begin:i == 0,end:i == 8,x:sample.x,y:sample.y,clip:1,oppoint:2,op2close:op2close,stroke:1,fill:1}); + } + }`, + + `(i, sample, pvs, model, ovs){ + if(i % 3 == 0){ + let er = sample.r/2 + let x = er * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + let y = er * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + pvs.push({begin:i == 0,end:i == 9,x:x,y:y,text:1}); + } + }`, + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let sita = 45; + let rad = sita * DDeiConfig.ROTATE_UNIT + let cos = parseFloat(Math.cos(rad).toFixed(4)) + let sin = parseFloat(Math.sin(rad).toFixed(4)) + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let x = er * cos + let y = er * sin + pvs.push({x:x,y:y,r:er,select:1}); + sita = 135; + rad = sita * DDeiConfig.ROTATE_UNIT + cos = parseFloat(Math.cos(rad).toFixed(4)) + sin = parseFloat(Math.sin(rad).toFixed(4)) + er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + x = er * cos + y = er * sin + pvs.push({x:x,y:y,r:er,select:1}); + sita = 225; + rad = sita * DDeiConfig.ROTATE_UNIT + cos = parseFloat(Math.cos(rad).toFixed(4)) + sin = parseFloat(Math.sin(rad).toFixed(4)) + er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + x = er * cos + y = er * sin + pvs.push({x:x,y:y,r:er,select:1}); + sita = 315; + rad = sita * DDeiConfig.ROTATE_UNIT + cos = parseFloat(Math.cos(rad).toFixed(4)) + sin = parseFloat(Math.sin(rad).toFixed(4)) + er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + x = er * cos + y = er * sin + pvs.push({x:x,y:y,r:er,select:1}); + } + }`, + ], + + }, + iconPos: { + dy: 10 + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-card-tab.ts b/plugins/core/controls/control/basicflow/flow-card-tab.ts new file mode 100644 index 0000000..ca986ee --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-card-tab.ts @@ -0,0 +1,53 @@ +export default { + 'id': '102053', + 'name': '卡片', + 'code': 'fct', + 'desc': '流程的卡片', + 'from': '100500', + + 'define': { + width: 110, + height: 70, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let weight = 20 + switch(i){ + case 0: + pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); + break; + case 1: + pvs[0].y=sample.y + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); + break; + case 2: + pvs[1].x=sample.x + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); + break; + case 3: + pvs[2].y=sample.y+weight + pvs.push({x:pvs[2].x+weight,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); + sample.x = pvs[0].x + + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,stroke:1,fill:1,oppoint:2,op2close:1,end:1}); + + pvs.push({x:sample.x,y:pvs[2].y,text:1,type:0}); + break; + } + + }` + + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-control-transfer.ts b/plugins/core/controls/control/basicflow/flow-control-transfer.ts new file mode 100644 index 0000000..bd7ccd3 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-control-transfer.ts @@ -0,0 +1,53 @@ +export default { + 'id': '102058', + 'name': '控制传递', + 'code': 'ctran', + 'desc': '控制传递', + 'from': '100401', + + 'define': { + type: 2, + ep: { + type: 1 + }, + pvs: [ + { x: -75, y: 0, z: 1 }, + { x: 0, y: 0, z: 1 }, + { x: 75, y: 0, z: 1 }, + ], + cpv: { + x: 0, y: 0 + }, + //组合控件 + composes: [ + { + width: 30, + height: 30, + id: '100120', + cIndex: 1, + initCPV: { + x: 0, y: 0, z: 1 + } + }, + ], + //操作点 + ovs: [ + { + x: 0, y: 0, ix: 0, iy: 0, + //约束,控制点的移动路径和位置 + constraint: { + type: 1,//跟随线段 + pvs: ["pvs"]//当前对象的pvs + }, + //联动,点移动后控制的其它点 + links: [ + { + type: 1,//1施加矩阵 + pvs: ["composes[0]"] + } + ] + } + ] + + } +} diff --git a/plugins/core/controls/control/basicflow/flow-data.ts b/plugins/core/controls/control/basicflow/flow-data.ts new file mode 100644 index 0000000..ec51282 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-data.ts @@ -0,0 +1,40 @@ +export default { + 'id': '102030', + 'name': '数据', + 'code': 'fdata', + 'desc': '流程的数据节点', + 'from': '100500', + + 'define': { + width: 150, + height: 90, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 45, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + `(i,sample, pvs, model){ + let ds = i == 2 || i ==3 ? 5: -5 + let x = sample.x+ds + let y = sample.y + let op2close = i == 3 ? 1 :0 + pvs.push({begin:i==0,end:i==3, x: x, y: y,select:1,clip:1,fill:1,stroke:1,oppoint:2,op2close:op2close }); + }`, + `(i,sample, pvs, model){ + let ds = i == 1 || i ==2 ? 5: -5 + let x = sample.x+ds + let y = sample.y + pvs.push({ begin:i==0,end:i==3, x: x, y: y,text:1 }); + }`, + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-data1.ts b/plugins/core/controls/control/basicflow/flow-data1.ts new file mode 100644 index 0000000..48439e0 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-data1.ts @@ -0,0 +1,13 @@ +export default { + 'id': '102031', + 'name': '数据', + 'code': 'fdata', + 'desc': '流程的数据节点', + 'from': '102030', + + 'define': { + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-data2.ts b/plugins/core/controls/control/basicflow/flow-data2.ts new file mode 100644 index 0000000..2801da9 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-data2.ts @@ -0,0 +1,65 @@ +export default { + 'id': '102032', + 'name': '存储数据', + 'code': 'fdata', + 'desc': '流程的数据节点', + 'from': '102030', + + 'define': { + width: 100, + height: 70, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 1, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let dr = -50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT) + pvs.push({begin:1,x:-dr,y:50,select:1}) + pvs.push({x:dr,y:50,select:1}) + pvs.push({x:dr,y:-50,select:1}) + pvs.push({end:1,x:-dr,y:-50,select:1}) + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + let dr = 50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT) + pvs.push({x:100-dr,y:0,oppoint:1}) + pvs.push({x:-dr,y:0,oppoint:1}) + pvs.push({x:0,y:50,oppoint:1}) + pvs.push({x:0,y:-50,oppoint:1}) + }`, + //主体区域 + `(i, sample, pvs, model, ovs){ + let dr = 50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad1 = 135 * DDeiConfig.ROTATE_UNIT + let rad2 = 225 * DDeiConfig.ROTATE_UNIT + pvs.push({begin:1,x:50,y:50,stroke:1,fill:1,clip:1}) + pvs.push({x:-50,y:50,r:dr,rad:rad1,stroke:1,fill:1,clip:1}) + pvs.push({x:-50,y:-50,type:2,r:dr,rad:rad2,direct:1,stroke:1,fill:1,clip:1}) + pvs.push({x:50,y:-50,r:dr,rad:rad2,stroke:1,fill:1,clip:1}) + pvs.push({end:1,dx:100,type:2,r:dr,rad:rad1,direct:0,stroke:1,fill:1,clip:1}) + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + let dr = 50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT) + pvs.push({begin:1,x:100-dr,y:50,text:1}) + pvs.push({x:-50,y:50,text:1}) + pvs.push({x:-50,y:-50,text:1}) + pvs.push({end:1,x:100-dr,y:-50,text:1}) + }`, + ], + + }, iconPos: { + dw: 15 + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-data3.ts b/plugins/core/controls/control/basicflow/flow-data3.ts new file mode 100644 index 0000000..1499ed2 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-data3.ts @@ -0,0 +1,57 @@ +export default { + 'id': '102033', + 'name': '顺序数据', + 'code': 'sqdata', + 'desc': '流程的顺序数据节点', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + eqrat: 1, + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 45, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + 2 + let x = er * sample.cos + let y = er * sample.sin + pvs.push({x:x,y:y,r:er,select:1}); + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT) + pvs.push({x:x,y:y,r:sample.r ,oppoint:1}); + + }`, + //绘制线段、填充区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:50,y:50}); + pvs.push({y:50,x:0,stroke:1,type:1,end:1}); + } + }`, + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({r:sample.r,stroke:1,fill:1,begin:1,end:1}); + } + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + pvs.push({x:sample.x,y:sample.y,r:sample.r,text:1}); + }`, + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-defflow.ts b/plugins/core/controls/control/basicflow/flow-defflow.ts new file mode 100644 index 0000000..fd53251 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-defflow.ts @@ -0,0 +1,57 @@ +export default { + 'id': '102041', + 'name': '预定义流程', + 'code': 'defflow', + 'desc': '流程的子流程节点', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 45, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + pvs.push({ begin:i==0,end:i==3,x: sample.x, y: sample.y,select:1,clip:1,stroke:1,fill:1 }); + }`, + + `(i, sample, pvs, model, ovs){ + let er = sample.r + let x = sample.x + let y = sample.y + let op2close = i == 3?1:0 + pvs.push({x:x,y:y,r:er,type:0,oppoint:2,op2close:op2close}); + + }`, + + + `(i, sample, pvs, model, ovs){ + if(i == 1){ + pvs.push({begin:1, x: sample.x, y: sample.y,stroke:1}); + }else if(i == 2){ + pvs[3] = {end:1, x: sample.x, y: sample.y,stroke:1}; + pvs[1] = { x: sample.x+10, y: sample.y,stroke:1}; + pvs[2] = { x: pvs[0].x+10, y: pvs[0].y,stroke:1}; + } + }`, + + `(i, sample, pvs, model, ovs){ + let ds = i == 1 || i ==2 ? 10: -10 + let x = sample.x+ds + let y = sample.y + pvs.push({ begin:i==0,end:i==3,x: x, y: y,text:1,stroke:1 }); + }`, + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-delay.ts b/plugins/core/controls/control/basicflow/flow-delay.ts new file mode 100644 index 0000000..24ae2a4 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-delay.ts @@ -0,0 +1,87 @@ +export default { + 'id': '102055', + 'name': '推迟', + 'code': 'fdy', + 'desc': '数据库图标', + 'from': '100500', + + 'define': { + width: 80, + height: 80, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:100,y:50,select:1,clip:1}) + pvs.push({x:-50,y:50,select:1,clip:1}) + pvs.push({x:-50,y:-50,select:1,clip:1}) + pvs.push({end:1,x:100,y:-50,select:1,clip:1}) + } + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:100,y:0,oppoint:1}) + pvs.push({x:0,y:50,oppoint:1}) + pvs.push({x:-50,y:0,oppoint:1}) + pvs.push({end:1,x:0,y:-50,oppoint:1}) + } + }`, + //绘制线段区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + let rad90 = 90 * DDeiConfig.ROTATE_UNIT + switch(i){ + case 0: + pvs.push({begin:1,x:x,y:y,fill:1,stroke:1,r:er,rad:0}); + break; + case 1: + pvs.push({x:x,y:y,fill:1,stroke:1}); + break; + case 2: + + pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:rad90}); + break; + case 3: + pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:-rad90}); + pvs.push({r:er,dx:50,rad:rad90,stroke:1,type:4,direct:1,end:1}); + pvs.push({r:sample.r}); + pvs.push({r:sample.r}); + break; + } + }`, + + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:50,y:50,text:1}) + pvs.push({x:-50,y:50,text:1}) + pvs.push({x:-50,y:-50,text:1}) + pvs.push({end:1,x:50,y:-50,text:1}) + } + }`, + ], + + }, + iconPos: { + dx: -20, + dw: 10 + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-display-content.ts b/plugins/core/controls/control/basicflow/flow-display-content.ts new file mode 100644 index 0000000..df511fd --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-display-content.ts @@ -0,0 +1,90 @@ +export default { + 'id': '102056', + 'name': '显示内容', + 'code': 'fdc', + 'desc': '显示内容', + 'from': '100500', + + 'define': { + width: 80, + height: 80, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:135,y:50,select:1,clip:1}) + pvs.push({x:-135,y:50,select:1,clip:1}) + pvs.push({x:-135,y:-50,select:1,clip:1}) + pvs.push({end:1,x:135,y:-50,select:1,clip:1}) + } + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:65,y:0,oppoint:1}) + pvs.push({x:0,y:50,oppoint:1}) + pvs.push({x:-135,y:0,oppoint:1}) + pvs.push({end:1,x:0,y:-50,oppoint:1}) + } + }`, + //绘制线段区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + let rad90 = 90 * DDeiConfig.ROTATE_UNIT + switch(i){ + case 0: + pvs.push({begin:1,x:x-10,y:y,fill:1,stroke:1,r:er,rad:0}); + break; + case 1: + pvs.push({x:x,y:y,fill:1,stroke:1}); + break; + case 2: + pvs.push({x:-135,y:0,fill:1,stroke:1}); + pvs.push({x:x,y:y,fill:1,stroke:1}); + break; + case 3: + pvs.push({x:x-10,y:y,fill:1,stroke:1,r:er,rad:-rad90,rd:0}); + pvs.push({r:er,dx:40,rad:rad90,stroke:1,type:4,direct:1,end:1}); + pvs.push({r:25}); + pvs.push({r:sample.r}); + break; + } + }`, + + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({begin:1,x:50,y:50,text:1}) + pvs.push({x:-50,y:50,text:1}) + pvs.push({x:-50,y:-50,text:1}) + pvs.push({end:1,x:50,y:-50,text:1}) + } + }`, + ], + + }, + iconPos: { + dx: 20, + dw: 10, + }, + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-end.ts b/plugins/core/controls/control/basicflow/flow-end.ts new file mode 100644 index 0000000..2baa719 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-end.ts @@ -0,0 +1,34 @@ +export default { + 'id': '102090', + 'name': '结束', + 'code': 'end', + 'desc': '流程的开始节点', + 'from': '102001', + + 'define': { + width: 40, + height: 40, + fill: { + color: 'black' + }, + ext: { + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + ] + }, + + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-end1.ts b/plugins/core/controls/control/basicflow/flow-end1.ts new file mode 100644 index 0000000..7da2d5f --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-end1.ts @@ -0,0 +1,44 @@ +export default { + 'id': '102091', + 'name': '结束', + 'code': 'end', + 'desc': '流程的开始节点', + 'from': '100003', + + 'define': { + width: 40, + height: 40, + cIndex: 1, + composes: [ + { + id: "102090", + width: 30, + height: 30, + cIndex: 2, + attrLinks: [ + { code: "fill", mapping: ["*"] }, + { code: "border", mapping: ["*"] }, + ] + } + ], + ext: { + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + ] + }, + + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-end2.ts b/plugins/core/controls/control/basicflow/flow-end2.ts new file mode 100644 index 0000000..2381b7f --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-end2.ts @@ -0,0 +1,37 @@ +export default { + 'id': '102092', + 'name': '结束', + 'code': 'end', + 'desc': '流程的开始节点', + 'from': '100003', + + 'define': { + width: 40, + height: 40, + fill: { + color: 'red' + }, + border: { + type: 0 + }, + ext: { + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + ] + }, + + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-end3.ts b/plugins/core/controls/control/basicflow/flow-end3.ts new file mode 100644 index 0000000..edf615a --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-end3.ts @@ -0,0 +1,45 @@ +export default { + 'id': '102093', + 'name': '结束', + 'code': 'end', + 'desc': '流程的开始节点', + 'from': '100003', + + 'define': { + width: 40, + height: 40, + cIndex: 1, + composes: [ + { + id: "102001", + width: 30, + height: 30, + cIndex: 2, + attrLinks: [ + { code: "fill", mapping: ["*"] }, + { code: "border", mapping: ["*"] }, + ] + } + ], + ext: { + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] + }, + + ] + }, + + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-hand-input.ts b/plugins/core/controls/control/basicflow/flow-hand-input.ts new file mode 100644 index 0000000..2a6fd0c --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-hand-input.ts @@ -0,0 +1,52 @@ +export default { + 'id': '102052', + 'name': '手动输入', + 'code': 'fhi', + 'desc': '流程的手动输入节点', + 'from': '100500', + + 'define': { + width: 110, + height: 70, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let weight = 20 + switch(i){ + case 0: + pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); + break; + case 1: + pvs[0].y=sample.y + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); + break; + case 2: + pvs[1].x=sample.x + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); + break; + case 3: + pvs[2].y=sample.y+weight + + sample.x = pvs[0].x + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,stroke:1,fill:1,oppoint:2,op2close:1,end:1}); + pvs.push({x:sample.x,y:pvs[2].y,text:1,type:0}); + + break; + } + + }` + + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-loop-area.ts b/plugins/core/controls/control/basicflow/flow-loop-area.ts new file mode 100644 index 0000000..58a0f5f --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-loop-area.ts @@ -0,0 +1,52 @@ +export default { + 'id': '102050', + 'name': '循环界限', + 'code': 'fla', + 'desc': '流程的循环界限', + 'from': '100500', + + 'define': { + width: 110, + height: 70, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let weight = 20 + switch(i){ + case 0: + pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1}); + break; + case 1: + pvs[0].y=sample.y + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); + break; + case 2: + pvs[1].x=sample.x + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1}); + break; + case 3: + pvs[2].y=sample.y+weight + pvs.push({x:pvs[2].x+weight,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); + sample.x = pvs[0].x + pvs.push({x:sample.x-weight,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); + pvs.push({x:sample.x,y:sample.y+weight,select:1,clip:1,text:1,stroke:1,oppoint:2,op2close:1,fill:1,end:1}); + + break; + } + + }` + + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-manual-operate.ts b/plugins/core/controls/control/basicflow/flow-manual-operate.ts new file mode 100644 index 0000000..9650ff2 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-manual-operate.ts @@ -0,0 +1,71 @@ +export default { + 'id': '102057', + 'name': '手动操作', + 'code': 'fmo', + 'desc': '由人工手动完成的节点', + 'from': '100500', + + 'define': { + width: 140, + height: 70, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + eqrat: true, + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + sample.x -= 20 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x = sample.x+20 + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x+20 + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 :0,select:1,clip:1,stroke:1,fill:1}); + }`, + + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + sample.x +=20 + pvs[1].x = sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1}); + }` + + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-page-ref.ts b/plugins/core/controls/control/basicflow/flow-page-ref.ts new file mode 100644 index 0000000..375dfae --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-page-ref.ts @@ -0,0 +1,46 @@ +export default { + 'id': '102051', + 'name': '跨页引用', + 'code': 'fpr', + 'desc': '流程的跨页引用', + 'from': '100500', + + 'define': { + width: 70, + height: 70, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + switch(i){ + case 0: + pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1}); + break; + case 1: + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); + break; + case 2: + pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1}); + break; + case 3: + pvs.push({x:-pvs[0].x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1}); + pvs.push({x:pvs[0].x,y:sample.y,select:1,clip:1,text:1,oppoint:2,op2close:1,stroke:1,fill:1,end:1}); + + break; + } + + }` + + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-prepare.ts b/plugins/core/controls/control/basicflow/flow-prepare.ts new file mode 100644 index 0000000..b197e98 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-prepare.ts @@ -0,0 +1,12 @@ +export default { + 'id': '102054', + 'name': '准备', + 'code': 'prepare', + 'desc': '流程的准备', + 'from': '100030', + + 'define': { + width: 100, + height: 70 + } +} diff --git a/plugins/core/controls/control/basicflow/flow-start.ts b/plugins/core/controls/control/basicflow/flow-start.ts new file mode 100644 index 0000000..ae7bd3c --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-start.ts @@ -0,0 +1,12 @@ +export default { + 'id': '102001', + 'name': '开始', + 'code': 'start', + 'desc': '流程的开始节点', + 'from': '100103', + + 'define': { + width: 40, + height: 40, + } +} diff --git a/plugins/core/controls/control/basicflow/flow-start1.ts b/plugins/core/controls/control/basicflow/flow-start1.ts new file mode 100644 index 0000000..5a09573 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-start1.ts @@ -0,0 +1,12 @@ +export default { + 'id': '102002', + 'name': '开始', + 'code': 'start', + 'desc': '流程的开始节点', + 'from': '102001', + + 'define': { + width: 100, + height: 50, + } +} diff --git a/plugins/core/controls/control/basicflow/flow-subflow.ts b/plugins/core/controls/control/basicflow/flow-subflow.ts new file mode 100644 index 0000000..783aa19 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-subflow.ts @@ -0,0 +1,45 @@ +export default { + 'id': '102040', + 'name': '子流程', + 'code': 'subflow', + 'desc': '流程的子流程节点', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 45, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + + `(i, sample, pvs, model, ovs){ + pvs.push({ begin:i==0,end:i==3,x: sample.x, y: sample.y,select:1,clip:1,stroke:1,fill:1 }); + }`, + + `(i, sample, pvs, model, ovs){ + let er = sample.r + let x = sample.x + let y = sample.y + pvs.push({x:x,y:y,r:er,type:0,oppoint:2,op2close:i == 3 ? 1: 0}); + + }`, + `(i, sample, pvs, model, ovs){ + let ds = i == 1 || i ==2 ? 10: -10 + let x = sample.x+ds + let y = sample.y + pvs.push({ begin:i==0,end:i==3,x: x, y: y,text:1,stroke:1 }); + }`, + ] + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-switch.ts b/plugins/core/controls/control/basicflow/flow-switch.ts new file mode 100644 index 0000000..6c41b78 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-switch.ts @@ -0,0 +1,13 @@ +export default { + 'id': '102020', + 'name': '分支', + 'code': 'switch', + 'desc': '流程的分支节点', + 'from': '100040', + + 'define': { + width: 110, + height: 70, + + } +} diff --git a/plugins/core/controls/control/basicflow/flow-switch1.ts b/plugins/core/controls/control/basicflow/flow-switch1.ts new file mode 100644 index 0000000..916c4a4 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-switch1.ts @@ -0,0 +1,13 @@ +export default { + 'id': '102021', + 'name': '分支', + 'code': 'switch', + 'desc': '流程的分支节点', + 'from': '102020', + + 'define': { + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-task.ts b/plugins/core/controls/control/basicflow/flow-task.ts new file mode 100644 index 0000000..efe7400 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-task.ts @@ -0,0 +1,13 @@ +export default { + 'id': '102010', + 'name': '任务', + 'code': 'task', + 'desc': '流程的任务节点', + 'from': '100002', + + 'define': { + width: 110, + height: 70, + + } +} diff --git a/plugins/core/controls/control/basicflow/flow-task1.ts b/plugins/core/controls/control/basicflow/flow-task1.ts new file mode 100644 index 0000000..0f02784 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-task1.ts @@ -0,0 +1,13 @@ +export default { + 'id': '102011', + 'name': '任务', + 'code': 'task', + 'desc': '流程的任务节点', + 'from': '102010', + + 'define': { + border: { + round: 5 + } + } +} diff --git a/plugins/core/controls/control/basicflow/flow-task2.ts b/plugins/core/controls/control/basicflow/flow-task2.ts new file mode 100644 index 0000000..19cb8d4 --- /dev/null +++ b/plugins/core/controls/control/basicflow/flow-task2.ts @@ -0,0 +1,15 @@ +export default { + 'id': '102012', + 'name': '开始或结束', + 'code': 'flowsoe', + 'desc': '流程的开始或结束节点', + 'from': '102010', + + 'define': { + height: 60, + width: 100, + border: { + round: 15 + } + } +} diff --git a/plugins/core/controls/control/common/bidfunnel.ts b/plugins/core/controls/control/common/bidfunnel.ts new file mode 100644 index 0000000..7ecd2be --- /dev/null +++ b/plugins/core/controls/control/common/bidfunnel.ts @@ -0,0 +1,56 @@ +export default { + 'id': '103007', + 'name': '双向漏斗', + 'code': 'bidfunnel', + 'desc': '双向漏斗', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 6, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i !=0 && i != 3){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let x = er * sample.cos + let y = er * sample.sin + pvs.push({begin:i == 1,end:i == 5,x:x,y:y,select:1,clip:1}); + } + }`, + //主体图形 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let x = er * sample.cos + let y = er * sample.sin + switch(i){ + case 1: + pvs.push({begin:1,x:x,y:y,oppoint:2,clip:1,stroke:1,fill:1}); + break; + case 2: + pvs.push({x:x,y:y,oppoint:2,clip:1,stroke:1,fill:1}); + pvs.push({x:0,y:0,oppoint:1,clip:1,stroke:1,fill:1}); + break; + case 4: + pvs.push({end:1,x:x,y:y,oppoint:2,op2close:1,clip:1,stroke:1,fill:1}); + break; + case 5: + pvs.splice(3,0,{x:x,y:y,oppoint:2,clip:1,stroke:1,fill:1}) + break; + } + }` + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-big-left-text.ts b/plugins/core/controls/control/common/bracket-big-left-text.ts new file mode 100644 index 0000000..82e97f9 --- /dev/null +++ b/plugins/core/controls/control/common/bracket-big-left-text.ts @@ -0,0 +1,112 @@ +export default { + 'id': '104124', + 'name': '大括号', + 'code': 'bmt', + 'desc': '左大括号,带文本编辑', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); + }` + ], + + }, + + //组合控件 + composes: [ + { + width: 30, + height: 100, + id: '104122', + cIndex: 2, + initCPV: { + x: -65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 150, + height: 95, + id: '100002', + cIndex: 1, + initCPV: { + x: 5, y: 0, z: 1 + }, + border: { + type: 0 + }, + fill: { + type: 0 + }, + textStyle: { + feed: 1, + scale: 1, + align: 1 + }, + attrLinks: [ + { code: "textStyle", mapping: ["*"] }, + { code: "font", mapping: ["*"] } + ] + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-big-left.ts b/plugins/core/controls/control/common/bracket-big-left.ts new file mode 100644 index 0000000..7de426c --- /dev/null +++ b/plugins/core/controls/control/common/bracket-big-left.ts @@ -0,0 +1,18 @@ +export default { + 'id': '104122', + 'name': '大括号', + 'code': 'bb', + 'desc': '由极坐标系构造的右大括号,不带任何文本', + 'from': '104121', + + 'define': { + width: 50, + height: 100, + ext: { + //采样信息 + sample: { + direct: 4 + } + } + } +} diff --git a/plugins/core/controls/control/common/bracket-big-right-text.ts b/plugins/core/controls/control/common/bracket-big-right-text.ts new file mode 100644 index 0000000..9e8adad --- /dev/null +++ b/plugins/core/controls/control/common/bracket-big-right-text.ts @@ -0,0 +1,112 @@ +export default { + 'id': '104123', + 'name': '大括号', + 'code': 'bbt', + 'desc': '右大括号,带文本编辑', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); + }` + ], + + }, + + //组合控件 + composes: [ + { + width: 30, + height: 100, + id: '104121', + cIndex: 2, + initCPV: { + x: 65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 150, + height: 95, + id: '100002', + cIndex: 1, + initCPV: { + x: -5, y: 0, z: 1 + }, + border: { + type: 0 + }, + fill: { + type: 0 + }, + textStyle: { + feed: 1, + scale: 1, + align: 3 + }, + attrLinks: [ + { code: "textStyle", mapping: ["*"] }, + { code: "font", mapping: ["*"] } + ] + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-big-right.ts b/plugins/core/controls/control/common/bracket-big-right.ts new file mode 100644 index 0000000..2d9c503 --- /dev/null +++ b/plugins/core/controls/control/common/bracket-big-right.ts @@ -0,0 +1,197 @@ +export default { + 'id': '104121', + 'name': '大括号', + 'code': 'bb', + 'desc': '由极坐标系构造的右大括号,不带任何文本', + 'from': '100500', + + 'define': { + width: 50, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 45, + //半径距离 + r: 50, + //方向,上右下左1,2,3,4 + direct: 2, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let deltaRotate = 0 + switch(sample.direct){ + case 1: + deltaRotate = -90 + break; + case 3: + deltaRotate = -270 + break; + case 4: + deltaRotate = -180 + break; + } + let rad1 = (72+deltaRotate) * DDeiConfig.ROTATE_UNIT + let rad2 = (-72+deltaRotate) * DDeiConfig.ROTATE_UNIT + let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT + let x0 = sample.r * Math.cos(rad0) + let y0 = sample.r * Math.sin(rad0) + let x1 = sample.r * Math.cos(rad1) + let y1 = sample.r * Math.sin(rad1) + let x2 = sample.r * Math.cos(rad2) + let y2 = sample.r * Math.sin(rad2) + switch(sample.direct){ + case 1: + pvs.push({begin:1,x:x2,y:y1+10,type:3}); + pvs.push({x:x2,y:y1+10,type:5,stroke:1}); + pvs.push({x:x2-2,y:y0+10}); + pvs.push({x:(x2+10)/2,y:y0+25}); + pvs.push({x:-10,y:y0+20}); + + pvs.push({x:-10,y:y0+20,type:5,stroke:1}); + pvs.push({x:-3,y:y0+18}); + pvs.push({x:0,y:y0+10}); + pvs.push({x:0,y:y0}); + + pvs.push({x:0,y:y0,stroke:1,type:5}); + pvs.push({x:0,y:y0+10}); + pvs.push({x:3,y:y0+18}); + pvs.push({x:10,y:y0+20}); + + pvs.push({x:10,y:y0+20,stroke:1,type:5}); + pvs.push({x:(x1-10)/2,y:y0+25}); + pvs.push({x:x1+2,y:y0+10}); + pvs.push({x:x1,y:y2+10}); + + + pvs.push({x:x1,y:y1+10,type:0,oppoint:1,select:1}); + pvs.push({x:x2,y:y2+10,type:0,oppoint:1,select:1}); + pvs.push({x:0,y:y0,type:0,oppoint:1}); + pvs.push({x:0,y:y2+10,type:0,oppoint:1}); + pvs.push({x:x2,y:y0,type:0,select:1}); + pvs.push({x:x1,y:y0,type:0,select:1}); + break; + case 2: + //由4段贝塞尔曲线构造 + pvs.push({begin:1,x:x2-10,y:y2,type:3}); + pvs.push({x:x2-10,y:y2,type:5,stroke:1}); + pvs.push({x:x0-10,y:y2-2}); + pvs.push({x:x0-25,y:(y2-10)/2}); + pvs.push({x:x0-20,y:-10}); + + pvs.push({x:x0-20,y:-10,stroke:1,type:5}); + pvs.push({x:x0-18,y:-3}); + pvs.push({x:x0-10,y:0}); + pvs.push({x:x0,y:0}); + + pvs.push({x:x0,y:0,stroke:1,type:5}); + pvs.push({x:x0-10,y:0}); + pvs.push({x:x0-18,y:3}); + pvs.push({x:x0-20,y:10}); + + pvs.push({x:x0-20,y:10,stroke:1,type:5}); + pvs.push({x:x0-25,y:(y1-10)/2}); + pvs.push({x:x0-10,y:y1+2}); + pvs.push({x:x2-10,y:y1}); + + pvs.push({x:x1-10,y:y1,type:0,oppoint:1,select:1}); + pvs.push({x:x2-10,y:y2,type:0,oppoint:1,select:1}); + pvs.push({x:x0,y:0,type:0,oppoint:1}); + pvs.push({x:x2-10,y:0,type:0,oppoint:1}); + pvs.push({x:x0,y:y2,type:0,select:1}); + pvs.push({x:x0,y:y1,type:0,select:1}); + break; + case 3: + //由4段贝塞尔曲线构造 + pvs.push({begin:1,x:x1,y:y1-10,type:3}); + pvs.push({x:x1,y:y1-10,type:5,stroke:1}); + pvs.push({x:x1-2,y:y0-10}); + pvs.push({x:(x1+10)/2,y:y0-25}); + pvs.push({x:-10,y:y0-20}); + + pvs.push({x:-10,y:y0-20,type:5,stroke:1}); + pvs.push({x:-3,y:y0-18}); + pvs.push({x:0,y:y0-10}); + pvs.push({x:0,y:y0}); + + pvs.push({x:0,y:y0,stroke:1,type:5}); + pvs.push({x:0,y:y0-10}); + pvs.push({x:3,y:y0-18}); + pvs.push({x:10,y:y0-20}); + + pvs.push({x:10,y:y0-20,stroke:1,type:5}); + pvs.push({x:(x2-10)/2,y:y0-25}); + pvs.push({x:x2+2,y:y0-10}); + pvs.push({x:x2,y:y2-10}); + + + pvs.push({x:x1,y:y1-10,type:0,oppoint:1,select:1}); + pvs.push({x:x2,y:y2-10,type:0,oppoint:1,select:1}); + pvs.push({x:0,y:y0,type:0,oppoint:1}); + pvs.push({x:0,y:y2-10,type:0,oppoint:1}); + pvs.push({x:x2,y:y0,type:0,select:1}); + pvs.push({x:x1,y:y0,type:0,select:1}); + + break; + case 4: + //由4段贝塞尔曲线构造 + pvs.push({begin:1,x:x2+10,y:y1,type:3}); + pvs.push({x:x2+10,y:y1,type:5,stroke:1}); + pvs.push({x:x0+10,y:y1-2}); + pvs.push({x:x0+25,y:(y1-10)/2}); + pvs.push({x:x0+20,y:-10}); + + pvs.push({x:x0+20,y:-10,stroke:1,type:5}); + pvs.push({x:x0+18,y:-3}); + pvs.push({x:x0+10,y:0}); + pvs.push({x:x0,y:0}); + + pvs.push({x:x0,y:0,stroke:1,type:5}); + pvs.push({x:x0+10,y:0}); + pvs.push({x:x0+18,y:3}); + pvs.push({x:x0+20,y:10}); + + pvs.push({x:x0+20,y:10,stroke:1,type:5}); + pvs.push({x:x0+25,y:(y2-10)/2}); + pvs.push({x:x0+10,y:y2+2}); + pvs.push({x:x2+10,y:y2}); + + pvs.push({x:x1+10,y:y2,type:0,oppoint:1,select:1}); + pvs.push({x:x2+10,y:y1,type:0,oppoint:1,select:1}); + pvs.push({x:x0,y:0,type:0,oppoint:1}); + pvs.push({x:x2+10,y:0,type:0,oppoint:1}); + pvs.push({x:x0,y:y1,type:0,select:1}); + pvs.push({x:x0,y:y2,type:0,select:1}); + break; + } + + + } + }`, + ] + }, + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + } + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-big-text.ts b/plugins/core/controls/control/common/bracket-big-text.ts new file mode 100644 index 0000000..5674b51 --- /dev/null +++ b/plugins/core/controls/control/common/bracket-big-text.ts @@ -0,0 +1,123 @@ +export default { + 'id': '104125', + 'name': '大括号', + 'code': 'bmt', + 'desc': '左右大括号,带文本编辑', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,oppoint:2,op2close:i == 3 ? 1 : 0,clip:1}); + }` + ], + + }, + + //组合控件 + composes: [ + { + width: 30, + height: 100, + id: '104122', + cIndex: 2, + initCPV: { + x: -65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 30, + height: 100, + id: '104121', + cIndex: 2, + initCPV: { + x: 65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 140, + height: 95, + id: '100002', + cIndex: 1, + initCPV: { + x: 0, y: 0, z: 1 + }, + border: { + type: 0 + }, + fill: { + type: 0 + }, + textStyle: { + feed: 1, + scale: 1, + }, + attrLinks: [ + { code: "textStyle", mapping: ["*"] }, + { code: "font", mapping: ["*"] } + ] + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-middle-left-text.ts b/plugins/core/controls/control/common/bracket-middle-left-text.ts new file mode 100644 index 0000000..a266d9b --- /dev/null +++ b/plugins/core/controls/control/common/bracket-middle-left-text.ts @@ -0,0 +1,112 @@ +export default { + 'id': '104114', + 'name': '中括号', + 'code': 'bmt', + 'desc': '左中括号,带文本编辑', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); + }` + ], + + }, + + //组合控件 + composes: [ + { + width: 30, + height: 100, + id: '104112', + cIndex: 2, + initCPV: { + x: -65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 150, + height: 95, + id: '100002', + cIndex: 1, + initCPV: { + x: 5, y: 0, z: 1 + }, + border: { + type: 0 + }, + fill: { + type: 0 + }, + textStyle: { + feed: 1, + scale: 1, + align: 1 + }, + attrLinks: [ + { code: "textStyle", mapping: ["*"] }, + { code: "font", mapping: ["*"] } + ] + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-middle-left.ts b/plugins/core/controls/control/common/bracket-middle-left.ts new file mode 100644 index 0000000..f34786e --- /dev/null +++ b/plugins/core/controls/control/common/bracket-middle-left.ts @@ -0,0 +1,16 @@ +export default { + 'id': '104112', + 'name': '小括号', + 'code': 'bm', + 'desc': '由极坐标系构造的左中括号,不带任何文本', + 'from': '104111', + + 'define': { + ext: { + sample: { + //方向,上右下左1,2,3,4 + direct: 4, + } + } + } +} diff --git a/plugins/core/controls/control/common/bracket-middle-right-text.ts b/plugins/core/controls/control/common/bracket-middle-right-text.ts new file mode 100644 index 0000000..318727b --- /dev/null +++ b/plugins/core/controls/control/common/bracket-middle-right-text.ts @@ -0,0 +1,112 @@ +export default { + 'id': '104113', + 'name': '中括号', + 'code': 'bmt', + 'desc': '右中括号,带文本编辑', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); + }` + ], + + }, + + //组合控件 + composes: [ + { + width: 30, + height: 100, + id: '104111', + cIndex: 2, + initCPV: { + x: 65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 150, + height: 95, + id: '100002', + cIndex: 1, + initCPV: { + x: -5, y: 0, z: 1 + }, + border: { + type: 0 + }, + fill: { + type: 0 + }, + textStyle: { + feed: 1, + scale: 1, + align: 3 + }, + attrLinks: [ + { code: "textStyle", mapping: ["*"] }, + { code: "font", mapping: ["*"] } + ] + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-middle-right.ts b/plugins/core/controls/control/common/bracket-middle-right.ts new file mode 100644 index 0000000..86e42dc --- /dev/null +++ b/plugins/core/controls/control/common/bracket-middle-right.ts @@ -0,0 +1,84 @@ +export default { + 'id': '104111', + 'name': '中括号', + 'code': 'bm', + 'desc': '由极坐标系构造的右中括号,不带任何文本', + 'from': '100500', + + 'define': { + width: 50, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 45, + //半径距离 + r: 50, + //方向,上右下左1,2,3,4 + direct: 2, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let deltaRotate = 0 + switch(sample.direct){ + case 1: + deltaRotate = -90 + break; + case 3: + deltaRotate = -270 + break; + case 4: + deltaRotate = -180 + break; + } + let rad1 = (72+deltaRotate) * DDeiConfig.ROTATE_UNIT + let rad2 = (-72+deltaRotate) * DDeiConfig.ROTATE_UNIT + let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT + let x0 = sample.r * Math.cos(rad0) + let y0 = sample.r * Math.sin(rad0) + let x1 = sample.r * Math.cos(rad1) + let y1 = sample.r * Math.sin(rad1) + let x2 = sample.r * Math.cos(rad2) + let y2 = sample.r * Math.sin(rad2) + pvs.push({begin:1,x:x2,y:y2}); + pvs.push({x:x0,y:y2,stroke:1}); + pvs.push({x:x0,y:y1,stroke:1}); + pvs.push({x:x1,y:y1,stroke:1}); + + + pvs.push({x:x1,y:y1,type:0,oppoint:1,select:1}); + pvs.push({x:x2,y:y2,type:0,oppoint:1,select:1}); + + pvs.push({x:x0,y:0,type:0,oppoint:1}); + pvs.push({x:x2,y:0,type:0,oppoint:1}); + pvs.push({x:x0,y:y2,type:0,select:1}); + pvs.push({x:x0,y:y1,type:0,select:1}); + } + }`, + ] + }, + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + } + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-middle-text.ts b/plugins/core/controls/control/common/bracket-middle-text.ts new file mode 100644 index 0000000..6a3eb2b --- /dev/null +++ b/plugins/core/controls/control/common/bracket-middle-text.ts @@ -0,0 +1,123 @@ +export default { + 'id': '104115', + 'name': '中括号', + 'code': 'bmt', + 'desc': '左右中括号,带文本编辑', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,oppoint:2,op2close:i == 3 ? 1 : 0,clip:1}); + }` + ], + + }, + + //组合控件 + composes: [ + { + width: 30, + height: 100, + id: '104112', + cIndex: 2, + initCPV: { + x: -65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 30, + height: 100, + id: '104111', + cIndex: 2, + initCPV: { + x: 65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 140, + height: 95, + id: '100002', + cIndex: 1, + initCPV: { + x: 0, y: 0, z: 1 + }, + border: { + type: 0 + }, + fill: { + type: 0 + }, + textStyle: { + feed: 1, + scale: 1, + }, + attrLinks: [ + { code: "textStyle", mapping: ["*"] }, + { code: "font", mapping: ["*"] } + ] + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-small-left-text.ts b/plugins/core/controls/control/common/bracket-small-left-text.ts new file mode 100644 index 0000000..5f921f2 --- /dev/null +++ b/plugins/core/controls/control/common/bracket-small-left-text.ts @@ -0,0 +1,112 @@ +export default { + 'id': '104104', + 'name': '小括号', + 'code': 'bst', + 'desc': '左小括号,带文本编辑', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); + }` + ], + + }, + + //组合控件 + composes: [ + { + width: 30, + height: 100, + id: '104102', + cIndex: 2, + initCPV: { + x: -65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 150, + height: 95, + id: '100002', + cIndex: 1, + initCPV: { + x: 5, y: 0, z: 1 + }, + border: { + type: 0 + }, + fill: { + type: 0 + }, + textStyle: { + feed: 1, + scale: 1, + align: 1 + }, + attrLinks: [ + { code: "textStyle", mapping: ["*"] } + , { code: "font", mapping: ["*"] } + ] + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-small-left.ts b/plugins/core/controls/control/common/bracket-small-left.ts new file mode 100644 index 0000000..9dd1e87 --- /dev/null +++ b/plugins/core/controls/control/common/bracket-small-left.ts @@ -0,0 +1,16 @@ +export default { + 'id': '104102', + 'name': '小括号', + 'code': 'bs', + 'desc': '由极坐标系构造的左小括号,不带任何文本', + 'from': '104101', + + 'define': { + ext: { + sample: { + //方向,上右下左1,2,3,4 + direct: 4, + } + } + } +} diff --git a/plugins/core/controls/control/common/bracket-small-right-text.ts b/plugins/core/controls/control/common/bracket-small-right-text.ts new file mode 100644 index 0000000..b539fc7 --- /dev/null +++ b/plugins/core/controls/control/common/bracket-small-right-text.ts @@ -0,0 +1,112 @@ +export default { + 'id': '104103', + 'name': '小括号', + 'code': 'bst', + 'desc': '右小括号,带文本编辑', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1}); + }` + ], + + }, + + //组合控件 + composes: [ + { + width: 30, + height: 100, + id: '104101', + cIndex: 2, + initCPV: { + x: 65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 150, + height: 95, + id: '100002', + cIndex: 1, + initCPV: { + x: -5, y: 0, z: 1 + }, + border: { + type: 0 + }, + fill: { + type: 0 + }, + textStyle: { + feed: 1, + scale: 1, + align: 3 + }, + attrLinks: [ + { code: "textStyle", mapping: ["*"] } + , { code: "font", mapping: ["*"] } + ] + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-small-right.ts b/plugins/core/controls/control/common/bracket-small-right.ts new file mode 100644 index 0000000..b1bf62b --- /dev/null +++ b/plugins/core/controls/control/common/bracket-small-right.ts @@ -0,0 +1,82 @@ +export default { + 'id': '104101', + 'name': '小括号', + 'code': 'bs', + 'desc': '由极坐标系构造的右小括号,不带任何文本', + 'from': '100500', + + 'define': { + width: 50, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 45, + //半径距离 + r: 50, + //方向,上右下左1,2,3,4 + direct: 2, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let deltaRotate = 0 + switch(sample.direct){ + case 1: + deltaRotate = -90 + break; + case 3: + deltaRotate = -270 + break; + case 4: + deltaRotate = -180 + break; + } + let rad1 = (72+deltaRotate) * DDeiConfig.ROTATE_UNIT + let rad2 = (-72+deltaRotate) * DDeiConfig.ROTATE_UNIT + let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT + let x0 = sample.r * Math.cos(rad0) + let y0 = sample.r * Math.sin(rad0) + let x1 = sample.r * Math.cos(rad1) + let y1 = sample.r * Math.sin(rad1) + let x2 = sample.r * Math.cos(rad2) + let y2 = sample.r * Math.sin(rad2) + pvs.push({begin:1,x:x2,y:y2,r:sample.r,rad:rad2,stroke:1,type:2,direct:1}); + pvs.push({x:x2,y:y2,r:sample.r,rad:rad1,stroke:1,type:2,direct:1}); + pvs.push({x:x2,y:y2}); + pvs.push({end:1,x:0,y:0}); + pvs.push({x:x1,y:y1,type:0,oppoint:1,select:1}); + pvs.push({x:x2,y:y2,type:0,oppoint:1,select:1}); + + pvs.push({x:x0,y:0,type:0,oppoint:1}); + pvs.push({x:x2,y:0,type:0,oppoint:1}); + pvs.push({x:x0,y:y2,type:0,select:1}); + pvs.push({x:x0,y:y1,type:0,select:1}); + } + }`, + ] + }, + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + } + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/bracket-small-text.ts b/plugins/core/controls/control/common/bracket-small-text.ts new file mode 100644 index 0000000..d2f88ba --- /dev/null +++ b/plugins/core/controls/control/common/bracket-small-text.ts @@ -0,0 +1,124 @@ +export default { + 'id': '104105', + 'name': '小括号', + 'code': 'bst', + 'desc': '左右小括号,带文本编辑', + 'from': '100500', + + 'define': { + width: 160, + height: 100, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,oppoint:2,op2close:i == 3 ? 1 : 0,clip:1}); + }` + ], + + }, + + + //组合控件 + composes: [ + { + width: 30, + height: 100, + id: '104102', + cIndex: 2, + initCPV: { + x: -65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 30, + height: 100, + id: '104101', + cIndex: 2, + initCPV: { + x: 65, y: 0, z: 1 + }, + attrLinks: [ + { code: "border", mapping: ["*"] }, + ] + }, + { + width: 140, + height: 95, + id: '100002', + cIndex: 1, + initCPV: { + x: 0, y: 0, z: 1 + }, + border: { + type: 0 + }, + fill: { + type: 0 + }, + textStyle: { + feed: 1, + scale: 1, + }, + attrLinks: [ + { code: "textStyle", mapping: ["*"] }, + { code: "font", mapping: ["*"] } + ] + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/comment.ts b/plugins/core/controls/control/common/comment.ts new file mode 100644 index 0000000..d782243 --- /dev/null +++ b/plugins/core/controls/control/common/comment.ts @@ -0,0 +1,86 @@ +export default { + 'id': '103005', + 'name': '注释', + 'code': 'comment', + 'desc': '注释备注', + 'from': '100500', + + 'define': { + width: 110, + height: 70, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //允许文本输入 + textInput: 1, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let weight = 20 + let x=sample.x,y=sample.y + switch(i){ + case 0: + pvs.push({begin:1,x:x,y:y,select:1,clip:1,oppoint:2,stroke:1,fill:1}); + break; + case 1: + pvs[0].y=y + pvs.push({x:x,y:y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); + break; + case 2: + pvs[1].x=x + pvs.push({x:x,y:y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); + break; + case 3: + pvs[2].y=y + x = pvs[0].x + pvs.push({x:x-weight,y:y,select:1,clip:1,stroke:1,oppoint:2,fill:1}); + pvs.push({x:x,y:y+weight,select:1,clip:1,stroke:1,oppoint:2,op2close:1,fill:1,end:1}); + + break; + } + }`, + `(i, sample, pvs, model, ovs){ + if(i==3){ + pvs.push({x:30,y:sample.y,stroke:1,type:1,begin:1}); + pvs.push({x:30,y:sample.y+20,stroke:1,type:1}); + pvs.push({x:50,y:sample.y+20,stroke:1,type:1}); + pvs.push({x:50,y:sample.y+20,end:1}); + } + }`, + //文本 + `(i, sample, pvs, model, ovs){ + if(sample.textInput){ + let weight = 20 + let x=sample.x,y=sample.y + switch(i){ + case 0: + pvs.push({begin:1,x:x,y:y,text:1}); + break; + case 1: + pvs[0].y=y + pvs.push({x:x,y:y,text:1}); + break; + case 2: + pvs[1].x=x + pvs.push({x:x,y:y,text:1}); + break; + case 3: + pvs[2].y=y+weight + x = pvs[0].x + pvs.push({x:x,y:pvs[2].y,text:1}); + break; + } + } + }`, + + ] + } + } +} diff --git a/plugins/core/controls/control/common/database.ts b/plugins/core/controls/control/common/database.ts new file mode 100644 index 0000000..7208b0c --- /dev/null +++ b/plugins/core/controls/control/common/database.ts @@ -0,0 +1,111 @@ +export default { + 'id': '103010', + 'name': '数据库', + 'code': 'database', + 'desc': '数据库图标', + 'from': '100500', + + 'define': { + width: 100, + height: 60, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 12; + pvs.push({begin:1,x:50,y:50+dn,select:1,clip:1}) + pvs.push({x:-50,y:50+dn,select:1,clip:1}) + pvs.push({x:-50,y:-50-dn,select:1,clip:1}) + pvs.push({end:1,x:50,y:-50-dn,select:1,clip:1}) + } + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 12; + pvs.push({begin:1,x:50,y:0,oppoint:1}) + pvs.push({x:0,y:50+dn,oppoint:1}) + pvs.push({x:-50,y:0,oppoint:1}) + pvs.push({end:1,x:0,y:-50-dn,oppoint:1}) + } + }`, + //绘制线段区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + let rad180 = 0 + switch(i){ + case 0: + pvs.push({begin:1,x:x,y:y,fill:1,r:er,rad:0}); + break; + case 1: + rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({r:er,dy:50,rad:rad180,stroke:1,type:4,direct:1}); + pvs.push({r:sample.r}); + pvs.push({r:10}); + pvs.push({x:pvs[0].x,y:pvs[0].y}); + pvs.push({x:x,y:y}); + break; + case 2: + rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({x:x,y:y,stroke:1,rad:rad180,r:er}); + break; + case 3: + rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({r:er,dy:-50,rad:0,stroke:1,type:4,direct:1}); + pvs.push({r:sample.r}); + pvs.push({r:10}); + pvs.push({end:1,x:pvs[0].x,y:pvs[0].y,stroke:1}); + break; + } + }`, + // 上方的下半椭圆 + `(i, sample, pvs, model, ovs){ + if(i == 2 || i ==3){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + switch(i){ + case 2: + let rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({begin:1,x:x,y:y,r:er,rad:rad180}); + break; + case 3: + pvs.push({r:er,dy:-50,rad:0,stroke:1,type:4,direct:0}); + pvs.push({r:sample.r}); + pvs.push({r:10}); + pvs.push({end:1,x:x,y:y}); + break; + } + } + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 10; + pvs.push({begin:1,x:50,y:50,text:1}) + pvs.push({x:-50,y:50,text:1}) + pvs.push({x:-50,y:-50+dn,text:1}) + pvs.push({end:1,x:50,y:-50+dn,text:1}) + } + }`, + ] + }, + } +} diff --git a/plugins/core/controls/control/common/database1.ts b/plugins/core/controls/control/common/database1.ts new file mode 100644 index 0000000..350e96c --- /dev/null +++ b/plugins/core/controls/control/common/database1.ts @@ -0,0 +1,153 @@ +export default { + 'id': '103011', + 'name': '数据库', + 'code': 'database', + 'desc': '数据库图标', + 'from': '100500', + + 'define': { + width: 100, + height: 60, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 12; + pvs.push({begin:1,x:50,y:50+dn,select:1,clip:1}) + pvs.push({x:-50,y:50+dn,select:1,clip:1}) + pvs.push({x:-50,y:-50-dn,select:1,clip:1}) + pvs.push({end:1,x:50,y:-50-dn,select:1,clip:1}) + } + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 12; + pvs.push({begin:1,x:50,y:0,oppoint:1}) + pvs.push({x:0,y:50+dn,oppoint:1}) + pvs.push({x:-50,y:0,oppoint:1}) + pvs.push({end:1,x:0,y:-50-dn,oppoint:1}) + } + }`, + //绘制线段区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + let rad180 = 0 + switch(i){ + case 0: + pvs.push({begin:1,x:x,y:y,fill:1,r:er,rad:0}); + break; + case 1: + rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({r:er,dy:50,rad:rad180,stroke:1,type:4,direct:1}); + pvs.push({r:sample.r}); + pvs.push({r:10}); + pvs.push({x:pvs[0].x,y:pvs[0].y}); + pvs.push({x:x,y:y}); + break; + case 2: + rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({x:x,y:y,stroke:1,rad:rad180,r:er}); + break; + case 3: + rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({r:er,dy:-50,rad:0,stroke:1,type:4,direct:1}); + pvs.push({r:sample.r}); + pvs.push({r:10}); + pvs.push({end:1,x:pvs[0].x,y:pvs[0].y,stroke:1}); + break; + } + }`, + // 上方的下半椭圆 + `(i, sample, pvs, model, ovs){ + if(i == 2 || i ==3){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + switch(i){ + case 2: + let rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({begin:1,x:x,y:y,r:er,rad:rad180}); + break; + case 3: + pvs.push({r:er,dy:-50,rad:0,stroke:1,type:4,direct:0}); + pvs.push({r:sample.r}); + pvs.push({r:10}); + pvs.push({end:1,x:x,y:y}); + break; + } + } + }`, + // 上方的下半椭圆 + `(i, sample, pvs, model, ovs){ + if(i == 2 || i ==3){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + switch(i){ + case 2: + let rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({begin:1,x:x,y:y,r:er,rad:rad180}); + break; + case 3: + pvs.push({r:er,dy:-40,rad:0,stroke:1,type:4,direct:0}); + pvs.push({r:sample.r}); + pvs.push({r:10}); + pvs.push({end:1,x:x,y:y}); + break; + } + } + }`, + // 上方的下半椭圆 + `(i, sample, pvs, model, ovs){ + if(i == 2 || i ==3){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + switch(i){ + case 2: + let rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({begin:1,x:x,y:y,r:er,rad:rad180}); + break; + case 3: + pvs.push({r:er,dy:-30,rad:0,stroke:1,type:4,direct:0}); + pvs.push({r:sample.r}); + pvs.push({r:10}); + pvs.push({end:1,x:x,y:y}); + break; + } + } + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 10; + pvs.push({begin:1,x:50,y:50,text:1}) + pvs.push({x:-50,y:50,text:1}) + pvs.push({x:-50,y:-30+dn,text:1}) + pvs.push({end:1,x:50,y:-30+dn,text:1}) + } + }`, + ] + }, + } +} diff --git a/plugins/core/controls/control/common/database2.ts b/plugins/core/controls/control/common/database2.ts new file mode 100644 index 0000000..fee8fd3 --- /dev/null +++ b/plugins/core/controls/control/common/database2.ts @@ -0,0 +1,152 @@ +export default { + 'id': '103012', + 'name': '数据库', + 'code': 'database', + 'desc': '数据库图标', + 'from': '100500', + + 'define': { + width: 100, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 12; + pvs.push({begin:1,x:50,y:50,select:1,clip:1}) + pvs.push({x:-50,y:50,select:1,clip:1}) + pvs.push({x:-50,y:-50-dn,select:1,clip:1}) + pvs.push({end:1,x:50,y:-50-dn,select:1,clip:1}) + } + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 12; + pvs.push({begin:1,x:50,y:0,oppoint:1}) + pvs.push({x:0,y:56,oppoint:1}) + pvs.push({x:-50,y:0,oppoint:1}) + pvs.push({end:1,x:0,y:-50-dn,oppoint:1}) + } + }`, + //绘制线段区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + let rad180 = 0 + switch(i){ + case 0: + pvs.push({begin:1,x:x,y:y,fill:1,r:er,rad:0,strokeClear:1}); + break; + case 1: + rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({r:er,dy:35,rad:rad180,stroke:1,type:4,direct:1}); + pvs.push({r:sample.r}); + pvs.push({r:20}); + pvs.push({x:pvs[0].x,y:pvs[0].y}); + pvs.push({x:x,y:y}); + break; + case 2: + rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({x:x,y:y,stroke:1,rad:rad180,r:er}); + break; + case 3: + rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({r:er,dy:-40,rad:0,stroke:1,type:4,direct:1}); + pvs.push({r:sample.r}); + pvs.push({r:25}); + pvs.push({end:1,x:pvs[0].x,y:pvs[0].y,stroke:1}); + break; + } + }`, + + + + // 上方的下半椭圆 + `(i, sample, pvs, model, ovs){ + if(i == 2 || i ==3){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + switch(i){ + case 2: + let rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({begin:1,x:x,y:y,r:er,rad:rad180,strokeClear:1}); + break; + case 3: + pvs.push({r:er,dy:-40,rad:0,stroke:1,type:4,direct:0}); + pvs.push({r:sample.r}); + pvs.push({r:25}); + pvs.push({end:1,x:x,y:y}); + break; + } + } + }`, + // 上方的下半椭圆 + `(i, sample, pvs, model, ovs){ + if(i == 2 || i ==3){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + switch(i){ + case 2: + let rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({begin:1,x:x,y:y,r:er,rad:rad180,strokeClear:1}); + break; + case 3: + pvs.push({r:er,dy:-12,rad:0,stroke:1,type:4,direct:0}); + pvs.push({r:sample.r}); + pvs.push({r:20}); + pvs.push({end:1,x:x,y:y}); + break; + } + } + }`, + // 上方的下半椭圆 + `(i, sample, pvs, model, ovs){ + if(i == 2 || i ==3){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + switch(i){ + case 2: + let rad180 = 180 * DDeiConfig.ROTATE_UNIT + pvs.push({begin:1,x:x,y:y,r:er,rad:rad180,strokeClear:1}); + break; + case 3: + pvs.push({r:er,dy:12,rad:0,stroke:1,type:4,direct:0}); + pvs.push({r:sample.r}); + pvs.push({r:20}); + pvs.push({end:1,x:x,y:y}); + break; + } + } + }`, + ] + }, + border: { + width: 10, + }, + fill: { + color: "#017fff" + } + } +} diff --git a/plugins/core/controls/control/common/database3.ts b/plugins/core/controls/control/common/database3.ts new file mode 100644 index 0000000..a2a5bba --- /dev/null +++ b/plugins/core/controls/control/common/database3.ts @@ -0,0 +1,101 @@ +export default { + 'id': '103013', + 'name': '数据库', + 'code': 'database', + 'desc': '数据库图标', + 'from': '100500', + + 'define': { + width: 110, + height: 70, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 2, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + //选中区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 12; + pvs.push({begin:1,x:50+dn,y:50,select:1,clip:1}) + pvs.push({x:-50-dn,y:50,select:1,clip:1}) + pvs.push({x:-50-dn,y:-50,select:1,clip:1}) + pvs.push({end:1,x:50+dn,y:-50,select:1,clip:1}) + } + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 12; + pvs.push({begin:1,x:50+dn,y:0,oppoint:1}) + pvs.push({x:0,y:50,oppoint:1}) + pvs.push({x:-50-dn,y:0,oppoint:1}) + pvs.push({end:1,x:0,y:-50,oppoint:1}) + } + }`, + //绘制线段区域 + `(i, sample, pvs, model, ovs){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + let rad90 = 90 * DDeiConfig.ROTATE_UNIT + switch(i){ + case 0: + pvs.push({begin:1,x:x,y:y,fill:1,stroke:1,r:er,rad:0}); + break; + case 1: + pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:rad90}); + break; + case 2: + pvs.push({r:er,dx:-50,rad:-rad90,stroke:1,type:4,direct:1}); + pvs.push({r:10}); + pvs.push({r:sample.r}); + + break; + case 3: + pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:-rad90}); + pvs.push({r:er,dx:50,rad:rad90,stroke:1,type:4,direct:1,end:1}); + pvs.push({r:10}); + pvs.push({r:sample.r}); + break; + } + }`, + // 右方左半椭圆 + `(i, sample, pvs, model, ovs){ + if(i == 3){ + let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT + let x = er * Math.cos(rad) + let y = er * Math.sin(rad) + let rad90 = 90 * DDeiConfig.ROTATE_UNIT + pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:-rad90}); + pvs.push({r:er,dx:50,rad:rad90,stroke:1,type:4,direct:0}); + pvs.push({r:10}); + pvs.push({r:sample.r}); + pvs.push({end:1,x:50,y:-50}); + } + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + let dn = 10; + pvs.push({begin:1,x:50-dn,y:50,text:1}) + pvs.push({x:-50,y:50,text:1}) + pvs.push({x:-50,y:-50,text:1}) + pvs.push({end:1,x:50-dn,y:-50,text:1}) + } + }`, + ] + }, + } +} diff --git a/plugins/core/controls/control/common/document.ts b/plugins/core/controls/control/common/document.ts new file mode 100644 index 0000000..8754886 --- /dev/null +++ b/plugins/core/controls/control/common/document.ts @@ -0,0 +1,85 @@ +export default { + 'id': '103003', + 'name': '文档', + 'code': 'doc', + 'desc': '文档', + 'from': '100500', + 'icon': 'toolbox-shape-square', + 'define': { + width: 100, + height: 60, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + sample.y += 15 + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + break; + case 3: + pvs[2].y=sample.y + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1}); + }`, + `(i, sample, pvs, model, ovs){ + if(i == 0){ + //从左下,左上,右上,右下,曲线:左下 + pvs.push({begin:1,x:-sample.x,y:sample.x,fill:1,clip:1}); + + pvs.push({x:-sample.x,y:-sample.x,stroke:1,oppoint:2}); + pvs.push({x:sample.x,y:-sample.x,stroke:1,oppoint:2}); + pvs.push({x:sample.x,y:sample.x,stroke:1}); + //贝塞尔曲线,至少需要四个点, + pvs.push({x:50,y:50,stroke:1,type:5}); + pvs.push({x:33,y:30}); + pvs.push({x:16,y:30}); + pvs.push({x:0,y:50}); + + pvs.push({x:0,y:50,type:5,stroke:1,stroke:1,end:1}); + pvs.push({x:-17,y:70}); + pvs.push({x:-34,y:70}); + pvs.push({x:-50,y:50}); + pvs.push({x:-sample.x,y:0,type:0,oppoint:1}); + pvs.push({x:sample.x,y:0,type:0,oppoint:1}); + pvs.push({x:0,y:50,type:0,oppoint:1}); + } + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + //从左下,左上,右上,右下,曲线:左下 + pvs.push({begin:1,x:-sample.x,y:sample.x-15,text:1}); + pvs.push({x:-sample.x,y:-sample.x,text:1}); + pvs.push({x:sample.x,y:-sample.x,text:1}); + pvs.push({x:sample.x,y:sample.x-15,end:1,text:1}); + } + }` + + ], + + }, + iconPos: { + dh: 5 + } + } +} diff --git a/plugins/core/controls/control/common/human.ts b/plugins/core/controls/control/common/human.ts new file mode 100644 index 0000000..47b2bcb --- /dev/null +++ b/plugins/core/controls/control/common/human.ts @@ -0,0 +1,115 @@ +export default { + 'id': '103001', + 'name': '人', + 'code': 'human', + 'desc': '人形图标', + 'from': '100500', + + 'define': { + width: 50, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 1, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let x = sample.x + let y = sample.y + switch(i){ + case 1: + pvs[0].y=y + break; + case 2: + pvs[1].x=x + break; + case 3: + pvs[2].y=y + x = pvs[0].x + break; + } + pvs.push({begin:i==0,end:i==3,x:x,y:y,select:1,clip:1}); + }`, + `(i, sample, pvs, model, ovs){ + if(i == 0){ + + let x = 0 + let y = -20 + pvs.push({begin:1,x:x,y:y,stroke:1}); + y = 10 + pvs.push({x:x,y:y,stroke:1}); + y += 10 + let y1= y + let x1 = x + pvs.push({x:x,y:y,stroke:1}); + let er = sample.r + x = sample.x + y = sample.y + let y2 = er * Math.sin(90 * DDeiConfig.ROTATE_UNIT) + pvs.push({x:x,y:y2,oppoint:1,stroke:1}); + pvs.push({x:x1,y:y1,type:3}); + let x3 = er * Math.cos(180 * DDeiConfig.ROTATE_UNIT) + let y3 = er * Math.sin(180 * DDeiConfig.ROTATE_UNIT) + pvs.push({x:x3,y:y2,oppoint:1,stroke:1}); + pvs.push({x:x1,y:y1,type:3}); + pvs.push({x:0,y:-10,type:3}); + pvs.push({x:x3,y:10,oppoint:1,stroke:1}); + pvs.push({x:0,y:-10,type:3}); + pvs.push({x:x,y:10,oppoint:1,stroke:1}); + pvs.push({x:0,y:-10,type:3}); + } + }`, + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({x:0,y:-50,oppoint:1,type:0}); + } + }` + ] + }, + //组合控件 + composes: [ + { + id: '100103', + cIndex: 2, + initCPV: { + x: 0, y: -35 + }, + width: 30, + height: 30, + attrLinks: [ + { code: "border", mapping: ["*"] }, + { code: "fill", mapping: ["*"] }, + ] + }, + ], + ext: { + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] + }, + + + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/human1.ts b/plugins/core/controls/control/common/human1.ts new file mode 100644 index 0000000..a753d2b --- /dev/null +++ b/plugins/core/controls/control/common/human1.ts @@ -0,0 +1,101 @@ +export default { + 'id': '103002', + 'name': '人', + 'code': 'human', + 'desc': '人形图标', + 'from': '100500', + + 'define': { + width: 60, + height: 85, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 1, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let x = sample.x + let y = sample.y + switch(i){ + case 1: + y = y-8 + pvs[0].y=y + break; + case 2: + pvs[1].x=x + break; + case 3: + y = y-8 + pvs[2].y=y + x = pvs[0].x + break; + } + pvs.push({begin:i==0,end:i==3,x:x,y:y,select:1,oppoint:2,op2close:i == 3 ? 1 : 0,clip:1}); + }`, + + ], + + }, + iconPos: { + dy: 20 + }, + //组合控件 + composes: [ + { + id: '100103', + cIndex: 2, + initCPV: { + x: 0, y: -35 + }, + width: 35, + height: 35 + , attrLinks: [ + { code: "border", mapping: ["*"] }, + { code: "fill", mapping: ["*"] }, + ] + }, + { + id: '100008', + cIndex: 1, + width: 60, + height: 50, + attrLinks: [ + { code: "border", mapping: ["*"] }, + { code: "fill", mapping: ["*"] }, + ] + }, + ] + , border: { + round: 15 + }, + ext: { + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] + }, + + + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/human2.ts b/plugins/core/controls/control/common/human2.ts new file mode 100644 index 0000000..78e6fda --- /dev/null +++ b/plugins/core/controls/control/common/human2.ts @@ -0,0 +1,119 @@ +export default { + 'id': '103006', + 'name': '人', + 'code': 'human', + 'desc': '人形图标', + 'from': '100500', + + 'define': { + width: 50, + height: 100, + //2为极坐标,缺省点为原点 + poly: 2, + cIndex: 1, + fill: { + type: 0 + }, + //采样信息 + sample: { + //一圈采样次数 + loop: 4, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let x = sample.x + let y = sample.y + switch(i){ + case 1: + pvs[0].y=y + break; + case 2: + pvs[1].x=x + break; + case 3: + pvs[2].y=y + x = pvs[0].x + break; + } + pvs.push({begin:i==0,end:i==3,x:x,y:y,select:1,clip:1}); + }`, + `(i, sample, pvs, model, ovs){ + if(i == 0){ + + let x = 0 + let y = -20 + pvs.push({begin:1,x:x,y:y,stroke:1}); + y = 10 + pvs.push({x:x,y:y,stroke:1}); + y += 10 + let y1= y + let x1 = x + pvs.push({x:x,y:y,stroke:1}); + let er = sample.r + x = sample.x + y = sample.y + let y2 = er * Math.sin(90 * DDeiConfig.ROTATE_UNIT) + pvs.push({x:x,y:y2,oppoint:1,stroke:1}); + pvs.push({x:x1,y:y1,type:3}); + let x3 = er * Math.cos(180 * DDeiConfig.ROTATE_UNIT) + let y3 = er * Math.sin(180 * DDeiConfig.ROTATE_UNIT) + pvs.push({x:x3,y:y2,oppoint:1,stroke:1}); + pvs.push({x:x1,y:y1,type:3}); + pvs.push({x:0,y:-10,type:3}); + pvs.push({x:x3,y:-10,oppoint:1,stroke:1}); + pvs.push({x:0,y:-10,type:3}); + pvs.push({x:x,y:-10,oppoint:1,stroke:1}); + pvs.push({x:0,y:-10,type:3}); + } + }`, + `(i, sample, pvs, model, ovs){ + if(i == 0){ + pvs.push({x:0,y:-50,oppoint:1,type:0}); + } + }` + ], + + }, + //组合控件 + composes: [ + { + id: '100103', + cIndex: 2, + initCPV: { + x: 0, y: -35 + }, + width: 30, + height: 30, + attrLinks: [ + { code: "border", mapping: ["*"] }, + { code: "fill", mapping: ["*"] }, + ] + }, + ], + ext: { + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "填充", + attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"] + }, + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] + }, + + + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/common/papertape.ts b/plugins/core/controls/control/common/papertape.ts new file mode 100644 index 0000000..e433778 --- /dev/null +++ b/plugins/core/controls/control/common/papertape.ts @@ -0,0 +1,101 @@ +export default { + 'id': '103004', + 'name': '纸带', + 'code': 'ptap', + 'desc': '纸带', + 'from': '100500', + 'icon': 'toolbox-shape-square', + 'define': { + width: 100, + height: 60, + //2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放 + poly: 2, + //采样信息 + sample: { + //一圈4次采样 + loop: 4, + //初始次采样的开始角度 + angle: 0, + //半径距离 + r: 50, + //采样的规则,多组采样返回多组规则 + rules: [ + `(i, sample, pvs, model, ovs){ + let start = 0,end = 0 + switch(i){ + case 0: + start = 1 + break; + case 1: + sample.y += 15 + pvs[0].y=sample.y + break; + case 2: + pvs[1].x=sample.x + sample.y -= 15 + break; + case 3: + pvs[2].y=sample.y + sample.y -= 15 + sample.x = pvs[0].x + end = 1 + break; + } + pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1}); + }`, + `(i, sample, pvs, model, ovs){ + if(i == 0){ + //从左下,左上,曲线:右上,右下,曲线:左下 + pvs.push({begin:1,x:-sample.x,y:sample.x,fill:1}); + pvs.push({x:-sample.x,y:-sample.x,stroke:1}); + //贝塞尔曲线,至少需要四个点, + pvs.push({x:-50,y:-50,stroke:1,type:5}); + pvs.push({x:-33,y:-30}); + pvs.push({x:-16,y:-30}); + pvs.push({x:0,y:-50}); + + pvs.push({x:0,y:-50,type:5,stroke:1,stroke:1}); + pvs.push({x:17,y:-70}); + pvs.push({x:34,y:-70}); + pvs.push({x:50,y:-50}); + + pvs.push({x:sample.x,y:sample.x,stroke:1}); + //贝塞尔曲线,至少需要四个点, + pvs.push({x:50,y:50,stroke:1,type:5}); + pvs.push({x:33,y:30}); + pvs.push({x:16,y:30}); + pvs.push({x:0,y:50}); + + pvs.push({x:0,y:50,type:5,stroke:1,stroke:1,end:1}); + pvs.push({x:-17,y:70}); + pvs.push({x:-34,y:70}); + pvs.push({x:-50,y:50}); + + + } + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + //从左下,左上,右上,右下,曲线:左下 + pvs.push({begin:1,x:-sample.x,y:sample.x-15,text:1}); + pvs.push({x:-sample.x,y:-sample.x+15,text:1}); + pvs.push({x:sample.x,y:-sample.x+15,text:1}); + pvs.push({x:sample.x,y:sample.x-15,end:1,text:1}); + } + }`, + //操作点 + `(i, sample, pvs, model, ovs){ + if(i == 0){ + + pvs.push({x:-sample.x,y:0,type:0,oppoint:1}); + pvs.push({x:sample.x,y:0,type:0,oppoint:1}); + pvs.push({x:0,y:50,type:0,oppoint:1}); + pvs.push({x:0,y:-50,type:0,oppoint:1}); + } + }` + + ] + } + } +} diff --git a/plugins/core/controls/control/layer.ts b/plugins/core/controls/control/layer.ts new file mode 100644 index 0000000..227d949 --- /dev/null +++ b/plugins/core/controls/control/layer.ts @@ -0,0 +1,115 @@ +export default { + 'id': 'DDeiLayer', + 'name': '图层', + 'code': 'layer', + 'desc': '整体图层的属性', + 'type': 'DDeiLayer', + /** + * 定义组件属性 + * 样式属性会影响图形的显示,修改样式属性也会刷新图形 + * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 + * 事件属性一般用来作为扩展用 + * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) + * 特殊属性: + * code属性编码在统一个组中,code唯一 + * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 + * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 + * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row + */ + attrs: [ + { + 'code': 'bg.type', + 'name': '背景', + 'desc': '背景的类型', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '无', 'value': -1 }, { 'text': '纯色', 'value': 1 }, { 'text': '图片', 'value': 2 }], + 'defaultValue': 1, + 'type': 1, + 'cascadeDisplay': { 1: { show: ['bg.color', 'bg.opacity'], hidden: ['bg.image', 'bg.imageMode', 'bg.imageScale', 'bg.imageAlign'] }, 2: { show: ['bg.image', 'bg.imageMode', 'bg.imageScale', 'bg.imageAlign'], hidden: ['bg.color'] }, 0: { hidden: ['bg.opacity', 'bg.color', 'bg.image', 'bg.imageMode', 'bg.imageScale', 'bg.imageAlign'] }, default: { show: ['bg.color', 'bg.opacity'], hidden: ['bg.image', 'bg.imageMode', 'bg.imageScale', 'bg.imageAlign'] } }, + 'hiddenTitle': true, + 'display': 'column', + + }, + { + 'code': 'bg.color', + 'name': '背景颜色', + 'desc': '背景的颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': '', + 'type': 1 + }, + { + 'code': 'bg.image', + 'name': '背景图片', + 'desc': '背景的图片', + 'controlType': 'image', + 'dataType': 'string', + 'defaultValue': '', + 'type': 1 + }, + { + 'code': 'bg.opacity', + 'name': '透明度', + 'desc': '背景的透明度', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'dataType': 'float', + 'defaultValue': 1, + 'display': 'column', + 'type': 1, + }, + { + 'code': 'bg.imageMode', + 'name': '模式', + 'desc': '背景的图片的模式', + 'controlType': 'radio', + 'dataType': 'integer', + 'dataSource': [{ 'text': '原始', 'value': 0 }, { 'text': '缩放', 'value': 1 }, { 'text': '填充', 'value': 2 }], + 'cascadeDisplay': { 1: { show: ['bg.imageScale', 'bg.imageAlign'] }, 2: { hidden: ['bg.imageScale', 'bg.imageAlign'] }, empty: { hidden: ['bg.imageScale'], show: ['bg.imageAlign'] } }, + 'defaultValue': 2, + 'type': 1 + }, + { + 'code': 'bg.imageScale', + 'name': '缩放比例', + 'desc': '背景的图片的缩放比例', + 'controlType': 'range', + 'min': 0.01, + 'max': 10, + 'step': 0.01, + 'dataType': 'float', + 'defaultValue': 1, + 'type': 1, + }, + + { + 'code': 'bg.imageAlign', + 'name': '位置', + 'desc': '背景的图片布局方位', + 'controlType': 'align-type', + 'dataType': 'string', + 'type': 1, + }, + + ], + + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "背景", + icon: 'icon-a-ziyuan419', + subGroups: [ + { + name: "背景", + attrs: ["bg.type", "bg.color", "bg.image", "bg.opacity", "bg.imageMode", "bg.imageScale", "bg.imageAlign"] + }, + ] + } + ] +} diff --git a/plugins/core/controls/control/math/angle.ts b/plugins/core/controls/control/math/angle.ts new file mode 100644 index 0000000..e770130 --- /dev/null +++ b/plugins/core/controls/control/math/angle.ts @@ -0,0 +1,164 @@ +export default { + 'id': '104001', + 'name': '角度', + 'code': 'angle', + 'desc': '表示一个角度', + 'from': '100500', + + 'define': { + width: 200, + height: 200, + //2为极坐标,缺省点为原点 + poly: 2, + font: { + size: 10 + }, + //采样信息 + sample: { + eqrat: true, + //一圈采样次数 + loop: 1, + //半径距离 + r: 50, + //初始次采样的开始角度 + angle: 0, + //半径距离 + //采样的规则,多组采样返回多组规则 + rules: [ + //选择区域 + `(i, sample, pvs, model, ovs){ + let sita = Math.round(ovs[1].sita) + let hdelta = (ovs[2].x-ovs[2].ovi.x) + + pvs.push({begin:1,x:hdelta,y:hdelta,select:1,clip:1}); + pvs.push({x:-hdelta,y:hdelta,select:1,clip:1}); + pvs.push({x:-hdelta,y:-hdelta,select:1,clip:1}); + pvs.push({x:hdelta,y:-hdelta,select:1,clip:1}); + + }`, + //下方直线 + `(i, sample, pvs, model, ovs){ + pvs.push({begin:1,x:0,y:0,stroke:1,oppoint:1,type:1}); + pvs.push({end:1,x:(ovs[2].x-ovs[2].ovi.x),y:0,stroke:1,oppoint:1,type:1}); + }`, + //上方直线 + `(i, sample, pvs, model, ovs){ + let rad = (ovs[1].sita) * DDeiConfig.ROTATE_UNIT + let hdelta = (ovs[2].x-ovs[2].ovi.x) + let x = hdelta * Math.cos(rad) + let y = hdelta * Math.sin(rad) + pvs.push({begin:1,x:0,y:0,stroke:1,type:1}); + pvs.push({end:1,x:x,y:y,stroke:1,oppoint:1,type:1}); + }`, + //弧线/直角线 + `(i, sample, pvs, model, ovs){ + let sita = ovs[1].sita + if(Math.round(sita) == -90){ + let ar = (ovs[0].x-ovs[0].ovi.x) + pvs.push({begin:1,x:0,y:-ar,stroke:1}); + pvs.push({x:ar,y:-ar,stroke:1}); + pvs.push({x:ar,y:0,stroke:1}); + pvs.push({end:1,x:0,y:0,stroke:1}); + }else{ + let rad = sita * DDeiConfig.ROTATE_UNIT + let ar = (ovs[0].x-ovs[0].ovi.x) + let x = ar * Math.cos(rad) + let y = ar * Math.sin(rad) + pvs.push({begin:1,x:ar,y:0,r:ar,rad:0,stroke:1}); + pvs.push({end:1,x:x,y:y,r:ar,rad:rad,stroke:1}); + } + }`, + //文本区域 + `(i, sample, pvs, model, ovs){ + let sita = ovs[1].sita + let disSita + //显示半径 + let ar = (ovs[0].x-ovs[0].ovi.x)+7 + let dtSita = sita / 2 + + let x = ar * Math.cos(dtSita * DDeiConfig.ROTATE_UNIT) + let y = ar * Math.sin(dtSita * DDeiConfig.ROTATE_UNIT) + if(sita<0 && sita >= -180){ + disSita = (-sita.toFixed(1))+"" + }else{ + x = -x + y = -y + disSita = (180+(180-sita)).toFixed(1)+"" + } + let size = 10; + pvs.push({begin:1,x:x+size,y:y+size/2,text:1}); + pvs.push({x:x-size,y:y+size/2,text:1}); + pvs.push({x:x-size,y:y-size/2,text:1}); + pvs.push({end:1,x:x+size,y:y-size/2,text:1}); + model.text = disSita + model.render?.setCachedValue("text",disSita) + }`, + ], + + }, + iconPos: { + dx: -50, + dy: 50 + }, + //操作点定义 + ovs: [ + //控制角度显示位置 + { + x: 25, y: 0, ix: 0, iy: 0, + //约束,控制点的移动路径和位置 + constraint: { + type: 2,//矩形范围 + x0: 0, + x1: 50, + y0: 0, + y1: 0, + } + }, + //控制角度 + { + //初始化的角度 + isita: 30, + //约束,控制点的移动路径和位置 + constraint: { + type: 3,//圆形范围 + r: 25 + } + }, + { + x: 50, y: 0, ix: 0, iy: 0, + //约束,控制点的移动路径和位置 + constraint: { + type: 2,//矩形范围 + x0: 5, + x1: 100, + y0: 0, + y1: 0, + } + }, + ], + ext: { + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan375', + subGroups: [ + { + name: "线条", + attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"] + }, + + { + name: "文本", + attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + }, + ] + } + ] + } + } +} diff --git a/plugins/core/controls/control/stage.ts b/plugins/core/controls/control/stage.ts new file mode 100644 index 0000000..45d12f7 --- /dev/null +++ b/plugins/core/controls/control/stage.ts @@ -0,0 +1,230 @@ +export default { + 'id': 'DDeiStage', + 'name': '画布', + 'code': 'stage', + 'desc': '整体画布的属性', + 'type': 'DDeiStage', + /** + * 定义组件属性 + * 样式属性会影响图形的显示,修改样式属性也会刷新图形 + * 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系 + * 事件属性一般用来作为扩展用 + * 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写) + * 特殊属性: + * code属性编码在统一个组中,code唯一 + * mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射 + * hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题 + * display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row + */ + attrs: [ + { + 'code': 'paper.type', + 'name': '纸张类型', + 'desc': '用来快速选择纸张的类型,以便于套用相关的样式', + 'controlType': 'combox', + 'dataType': 'string', + 'dataSource': { + 'type': 'config', + 'data': 'PAPER_DATASOURCE', + 'text': 'name', + 'value': 'code', + 'desc': 'desc' + }, + 'canSearch': false, + 'itemStyle': { width: 170, align: 'left', paddingLeft: '10px', height: 25, col: 1, row: 8, imgWidth: 20, imgHeight: 20 }, + 'defaultValue': 'A4', + 'cascadeDisplay': { '无': { hidden: ['paper.direct', 'paper.width', 'paper.height', 'paper.unit'] }, '自定义': { show: ['paper.direct', 'paper.width', 'paper.height', 'paper.unit'] }, notempty: { show: ['paper.direct'], hidden: ['paper.width', 'paper.height', 'paper.unit'] }, empty: { hidden: ['paper.width', 'paper.height', 'paper.unit'] }, default: { hidden: ['paper.width', 'paper.height', 'paper.unit'] } }, + 'type': 1, + }, + { + 'code': 'paper.width', + 'name': '宽度', + 'desc': '用来设置纸张的宽度,以便于套用相关的样式', + 'controlType': 'text', + 'dataType': 'integer', + 'defaultValue': 210, + 'type': 1 + }, + { + 'code': 'paper.height', + 'name': '高度', + 'desc': '用来设置纸张的高度,以便于套用相关的样式', + 'controlType': 'text', + 'dataType': 'integer', + 'defaultValue': 297, + 'type': 1, + }, + { + 'code': 'paper.unit', + 'name': '单位', + 'desc': '用来设置纸张的宽高单位,以便于套用相关的样式', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '毫米', 'value': 'mm' }, { 'text': '厘米', 'value': 'cm' }, { 'text': '米', 'value': 'm' }, { 'text': '英寸', 'value': 'inch' }, { 'text': '像素', 'value': 'px' }], + 'defaultValue': 'mm', + }, + { + 'code': 'paper.direct', + 'name': '方向', + 'desc': '用来设置纸张的方向,以便于套用相关的样式', + 'controlType': 'radio', + 'dataSource': [{ 'text': '纵向', 'value': 1 }, { 'text': '横向', 'value': 2 }], + 'dataType': 'integer', + 'defaultValue': 2, + 'type': 1, + }, + + { + 'code': 'mark.type', + 'name': '水印类型', + 'desc': '用来快速选择水印的类型,以便于套用相关的样式', + 'controlType': 'radio', + 'dataSource': [{ 'text': '无水印', 'value': 0 }, { 'text': '文本', 'value': 1 }, { 'text': '图片', 'value': 2 }], + 'dataType': 'integer', + 'defaultValue': 0, + 'hiddenTitle': true, + 'display': 'column', + 'cascadeDisplay': { 1: { show: ['mark.data', 'mark.direct', 'mark.opacity', 'mark.font.family', 'mark.font.size', 'mark.font.color'] }, 2: { show: ['mark.data', 'mark.direct', 'mark.opacity'], hidden: ['mark.font.family', 'mark.font.size', 'mark.font.color'] }, empty: { hidden: ['mark.data', 'mark.direct', 'mark.opacity', 'mark.font.family', 'mark.font.size', 'mark.font.color'] } }, + 'mapping': [], + 'type': 1, + }, + { + 'code': 'mark.data', + 'name': '水印', + 'desc': '当水印类型为1时,此字段将显示文本,当类行为2时,此字段显示为图片', + 'controlType': 'image', + 'dataType': 'string', + 'defaultValue': '', + 'type': 1, + }, + + { + 'code': 'mark.direct', + 'name': '方向', + 'desc': '水印的显示方向', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '从左往右', 'value': '1' }, { 'text': '从右往左', 'value': '2' }, { 'text': '水平显示', 'value': '3' }], + 'defaultValue': '1', + 'type': 1, + }, + { + 'code': 'mark.opacity', + 'name': '透明度', + 'desc': '透明度,0完全透明~1完全不透明', + 'controlType': 'range', + 'min': 0, + 'max': 1, + 'step': 0.01, + 'dataType': 'float', + 'defaultValue': 0.25, + 'display': 'column', + }, + { + 'code': 'mark.font.family', + 'name': '字体', + 'desc': '文本的字体名称', + 'controlType': 'combox', + 'dataType': 'string', + 'dataSource': { + 'type': 'config', + 'data': 'fonts', + 'text': 'ch', + 'value': 'en', + 'bold': 'isSystemDefault', + 'fontFamily': 'en' + }, + 'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, + 'canSearch': true, + 'defaultValue': "", + }, + { + 'code': 'mark.font.size', + 'name': '大小', + 'desc': '文本的字体大小', + 'max': 50, + 'min': 5, + 'step': 0.5, + 'controlType': 'font-size', + 'dataType': 'float', + 'defaultValue': 14, + }, + { + 'code': 'mark.font.color', + 'name': '颜色', + 'desc': '文本的颜色', + 'controlType': 'color-combo', + 'dataType': 'string', + 'defaultValue': "", + }, + { + 'code': 'ruler.display', + 'name': '标尺', + 'desc': '是否显示标尺', + 'controlType': 'switch-checkbox', + 'dataType': 'integer', + 'defaultValue': 1, + 'display': 'column', + 'hiddenTitle': true, + 'type': 1, + 'cascadeDisplay': { 1: { show: ['ruler.unit'] }, default: { show: ['ruler.unit'] }, empty: { hidden: ['ruler.unit'] } }, + }, + { + 'code': 'ruler.unit', + 'name': '单位', + 'desc': '用来设置标尺单位样式', + 'controlType': 'combox', + 'dataType': 'string', + 'dataSource': [{ 'text': '毫米', 'value': 'mm' }, { 'text': '厘米', 'value': 'cm' }, { 'text': '米', 'value': 'm' }, { 'text': '英寸', 'value': 'inch' }, { 'text': '像素', 'value': 'px' }], + 'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 }, + 'defaultValue': 'mm', + 'type': 1, + }, + { + 'code': 'grid.display', + 'name': '网格', + 'desc': '设置网格线样式', + 'controlType': 'radio', + 'dataType': 'string', + 'dataSource': [{ 'text': '无', 'value': '0' }, { 'text': '线条', 'value': '1' }, { 'text': '点阵', 'value': '2' }], + 'defaultValue': '1', + 'type': 1, + }, + { + 'code': 'global.jumpline', + 'name': '跳线', + 'desc': '遇到线交叉时,展示跳线', + 'controlType': 'switch-checkbox', + 'dataType': 'integer', + 'defaultValue': 1, + 'type': 1, + 'display': 'column', + 'hiddenTitle': true, + }, + ], + + /** + * 定义分组,用于属性编辑 + */ + groups: [ + { + name: "样式", + icon: 'icon-a-ziyuan418', + subGroups: [ + { + name: "纸张", + attrs: ["paper.type", "paper.width", "paper.height", "paper.unit", "paper.direct"] + }, + { + name: "水印", + attrs: ["mark.type", "mark.data", "mark.direct", "mark.opacity", "mark.font.family", "mark.font.size", "mark.font.color"] + }, + { + name: "辅助功能", + attrs: ["ruler.display", "ruler.unit", "grid.display", "global.jumpline"] + } + + ] + } + ] +} \ No newline at end of file diff --git a/plugins/core/controls/group/basic/basic-flow-shapes.ts b/plugins/core/controls/group/basic/basic-flow-shapes.ts new file mode 100644 index 0000000..b4129ca --- /dev/null +++ b/plugins/core/controls/group/basic/basic-flow-shapes.ts @@ -0,0 +1,172 @@ +export default { + 'id': '102', + 'name': '基础流程形状', + 'code': 'basic-flow-shapes', + 'desc': '基础的流程形状,包含了开始、结束、任务、分支等基础形状', + 'orderNo': 2, + 'subject': 'basic', + //当前分组下所有控件 + 'controls': [ + { + 'id': '102001', + 'name': '开始', + 'orderNo': 1, + }, + { + 'id': '102002', + 'name': '开始', + 'orderNo': 2, + }, + { + 'id': '102010', + 'name': '任务', + 'orderNo': 10 + }, + { + 'id': '102011', + 'name': '任务', + 'orderNo': 11 + }, + { + 'id': '102012', + 'name': '开始或结束', + 'orderNo': 12 + }, + { + 'id': '102020', + 'name': '分支', + 'orderNo': 20 + }, + { + 'id': '102021', + 'name': '分支', + 'orderNo': 21 + }, + { + 'id': '102040', + 'name': '子流程', + 'orderNo': 25 + }, + { + 'id': '102041', + 'name': '预定义流程', + 'orderNo': 26 + }, + { + 'id': '103003', + 'name': '文档', + 'orderNo': 27 + }, + { + 'id': '102030', + 'name': '数据', + 'orderNo': 30 + }, + { + 'id': '102031', + 'name': '数据', + 'orderNo': 31 + }, + { + 'id': '102032', + 'name': '存储数据', + 'orderNo': 32 + }, + { + 'id': '102033', + 'name': '顺序数据', + 'orderNo': 33 + }, + { + 'id': '103013', + 'name': '直接数据', + 'orderNo': 34 + }, + + { + 'id': '102090', + 'name': '结束', + 'orderNo': 50, + }, + { + 'id': '102091', + 'name': '结束', + 'orderNo': 51, + }, + { + 'id': '102092', + 'name': '结束', + 'orderNo': 52, + }, + + { + 'id': '103010', + 'name': '数据库', + 'orderNo': 60 + }, + { + 'id': '103001', + 'name': '人员', + 'orderNo': 71 + }, + { + 'id': '103002', + 'name': '人员', + 'orderNo': 72 + }, + { + 'id': '102050', + 'name': '循环界限', + 'orderNo': 73 + }, + { + 'id': '102052', + 'name': '手动输入', + 'orderNo': 74 + }, + { + 'id': '102057', + 'name': '手动操作', + 'orderNo': 74 + }, + { + 'id': '102053', + 'name': '卡片', + 'orderNo': 75 + }, + { + 'id': '102054', + 'name': '准备', + 'orderNo': 76 + }, + { + 'id': '103004', + 'name': '纸带', + 'orderNo': 77 + }, + { + 'id': '102055', + 'name': '推迟', + 'orderNo': 78 + }, + { + 'id': '102056', + 'name': '显示内容', + 'orderNo': 79 + }, + + { + 'id': '102051', + 'name': '跨页引用', + 'orderNo': 83 + }, + { + 'id': '102058', + 'name': '控制传递', + 'orderNo': 84 + }, + + + + ] +} diff --git a/plugins/core/controls/group/basic/basic-shapes.ts b/plugins/core/controls/group/basic/basic-shapes.ts new file mode 100644 index 0000000..e80e4fb --- /dev/null +++ b/plugins/core/controls/group/basic/basic-shapes.ts @@ -0,0 +1,209 @@ +export default { + 'id': '101', + 'name': '基础绘图形状', + 'code': 'basic-shapes', + 'desc': '基础的绘图形状,包含了正方形、长方形、三角形、圆形、线条等基础形状', + 'orderNo': 1, + 'subject': 'basic', + //当前分组下所有控件 + 'controls': [ + { + 'id': '100200', + 'name': '文本', + 'orderNo': 0, + }, + { + 'id': '100001', + 'name': '正方形', + 'orderNo': 1, + }, + { + 'id': '100002', + 'name': '长方形', + 'orderNo': 2 + }, + + { + 'id': '100003', + 'name': '圆形', + 'orderNo': 3 + }, + { + 'id': '100004', + 'name': '圆角正方形', + 'orderNo': 4 + }, + { + 'id': '100005', + 'name': '圆角矩形', + 'orderNo': 5 + }, + { + 'id': '100006', + 'name': '椭圆', + 'text': '', + 'orderNo': 6 + }, + { + 'id': '100007', + 'name': '矩形边框', + 'text': '', + 'orderNo': 7 + }, + + { + 'id': '100010', + 'name': '三角形', + 'text': '', + 'orderNo': 10 + }, + { + 'id': '100011', + 'name': '直角三角形', + 'text': '', + 'orderNo': 11 + }, + { + 'id': '100012', + 'name': '直角三角形', + 'text': '', + 'orderNo': 12 + }, + { + 'id': '100013', + 'name': '圆角三角形', + 'text': '', + 'orderNo': 13 + }, + { + 'id': '100014', + 'name': '圆角三角形', + 'text': '', + 'orderNo': 14 + }, + { + 'id': '100015', + 'name': '圆角三角形', + 'text': '', + 'orderNo': 15 + }, + { + 'id': '100020', + 'name': '五边形', + 'orderNo': 20 + }, + { + 'id': '100021', + 'name': '圆角五边形', + 'text': '', + 'orderNo': 21 + }, + { + 'id': '100030', + 'name': '六边形', + 'text': '', + 'orderNo': 30 + }, + { + 'id': '100031', + 'name': '圆角六边形', + 'text': '', + 'orderNo': 31 + }, + { + 'id': '100040', + 'name': '菱形', + 'orderNo': 40 + }, + { + 'id': '100041', + 'name': '圆角菱形', + 'text': '', + 'orderNo': 41 + }, + { + 'id': '100050', + 'name': '平行四边形', + 'text': '', + 'orderNo': 50 + }, + { + 'id': '100051', + 'name': '平行四边形', + 'text': '', + 'orderNo': 51 + }, + { + 'id': '100060', + 'name': '梯形', + 'text': '', + 'orderNo': 60 + }, + { + 'id': '100061', + 'name': '圆角梯形', + 'text': '', + 'orderNo': 61 + }, + { + 'id': '100070', + 'name': '五角星', + 'text': '', + 'orderNo': 70 + }, + { + 'id': '100076', + 'name': '六角形', + 'text': '', + 'orderNo': 75 + }, + { + 'id': '100075', + 'name': '六芒星', + 'text': '', + 'orderNo': 76 + }, + { + 'id': '100077', + 'name': '六芒星', + 'text': '', + 'orderNo': 77 + }, + { + 'id': '104001', + 'name': '角', + 'text': '', + 'orderNo': 80 + }, + + { + 'id': '104105', + 'name': '小括号', + 'text': '', + 'orderNo': 91 + }, + { + 'id': '104115', + 'name': '中括号', + 'text': '', + 'orderNo': 92 + }, + { + 'id': '104125', + 'name': '大括号', + 'text': '', + 'orderNo': 93 + }, + { + 'id': '100110', + 'name': '半圆', + 'text': '', + 'orderNo': 94 + }, + + + + + + ] +} diff --git a/plugins/core/controls/group/common/databases.ts b/plugins/core/controls/group/common/databases.ts new file mode 100644 index 0000000..9d055c4 --- /dev/null +++ b/plugins/core/controls/group/common/databases.ts @@ -0,0 +1,26 @@ +export default { + 'id': '201', + 'name': '数据库', + 'code': 'databases', + 'desc': '包含了数据库的各种类型', + 'orderNo': 21, + 'subject': 'basic', + //当前分组下所有控件 + 'controls': [ + { + 'id': '103010', + 'name': '数据库', + 'orderNo': 0 + }, + { + 'id': '103011', + 'name': '数据库', + 'orderNo': 1 + }, + { + 'id': '103012', + 'name': '数据库', + 'orderNo': 2 + }, + ] +} diff --git a/plugins/core/controls/index.ts b/plugins/core/controls/index.ts new file mode 100644 index 0000000..425ca42 --- /dev/null +++ b/plugins/core/controls/index.ts @@ -0,0 +1,70 @@ +import {DDeiPluginBase} from "ddei-framework"; +import { loadControlByFrom, loadAndSortGroup } from "./toolgroup" +import { cloneDeep } from "lodash" +const control_ctx = import.meta.glob('./control/**', { eager: true }) +const group_ctx = import.meta.glob('./group/**', { eager: true }) + +class DDeiCoreControls extends DDeiPluginBase{ + /** + * 缺省实例 + */ + static defaultIns:DDeiCoreControls = new DDeiCoreControls(null); + + controls:Map = new Map() + + getControls(editor) { + //获取扩展options + let extOptions = this.getOptions(); + //加载控件定义 + let controls: Map = new Map(); + let controls1 = new Map(editor.controls); + for (let i in control_ctx) { + let control = control_ctx[i].default; + + if (control) { + let c = cloneDeep(control) + controls.set(control.id, c); + controls1.set(control.id, c); + + if (extOptions && extOptions[control.id]){ + for (let x in extOptions[control.id]){ + c.define[x] = extOptions[control.id][x] + } + } + } + } + + //初始化控件定义 + controls.forEach(control => { + + loadControlByFrom(controls1, control) + }); + this.controls = controls; + return controls + } + + getGroups(editor) { + if (!this.controls){ + this.getControls(editor); + } + //加载分组定义 + let groups = []; + for (let path in group_ctx) { + groups.push(group_ctx[path].default); + } + + loadAndSortGroup(groups, this.controls) + return groups; + } + + static configuration(options) { + if (options){ + let controls = new DDeiCoreControls(options); + return controls; + } + return DDeiCoreControls; + } +} + +export {DDeiCoreControls} +export default DDeiCoreControls \ No newline at end of file diff --git a/plugins/core/controls/toolgroup.ts b/plugins/core/controls/toolgroup.ts new file mode 100644 index 0000000..2cee1a7 --- /dev/null +++ b/plugins/core/controls/toolgroup.ts @@ -0,0 +1,279 @@ +import {DDeiEditorArrtibute} from 'ddei-framework'; +import { cloneDeep } from 'lodash' +import {DDeiUtil} from 'ddei-framework'; + +const ToDefaultPropertys = ["fill.type", "fill.color", "fill.image", "fill.opacity", "border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound", + "font.family", "font.size", "font.color", "fontAlign", "textStyle.feed" + , "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic" + , "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"] + +//将属性转换为更深的groups中 +const parseAttrsToGroup = function (control) { + + if (control.attrs) { + control.attrs.forEach(curAttr => { + + let attrDefine = new DDeiEditorArrtibute(curAttr); + //在define中寻找样式值,如果有值,作为属性缺省值,再删除属性 + if (ToDefaultPropertys.indexOf(curAttr.code) != -1) { + let defValue = DDeiUtil.getDataByPathList(control.define, curAttr.code, curAttr.mapping); + if (defValue || defValue == 0) { + attrDefine.defaultValue = defValue + } + } + + //将属性加入控件的属性map + if (!control.attrDefineMap) { + control.attrDefineMap = new Map(); + } + control.attrDefineMap.set(curAttr.code, attrDefine); + }); + } + control.groups?.forEach(group => { + group.subGroups?.forEach(subGroup => { + let attrs = [] + subGroup.attrs?.forEach(attrCode => { + let attrDefine = control.attrDefineMap.get(attrCode) + if (attrDefine) { + attrDefine.topGroup = group + attrDefine.modelCode = control.id + attrs.push(attrDefine); + + } + }); + subGroup.children = attrs + }); + }); + +} + +const loadControlByFrom = function (controlOriginDefinies: Map, control: object) { + if (control.from && !control.def) { + let fromControl = controlOriginDefinies.get(control.from) + if (fromControl.from) { + loadControlByFrom(controlOriginDefinies, fromControl) + } + control.attrs = cloneDeep(fromControl.attrs) + control.groups = cloneDeep(fromControl.groups) + let fromMenus = cloneDeep(fromControl.menus) + let fromDefine = cloneDeep(fromControl.define) + //合并控件自身与from组件的define、menu + if (fromDefine) { + if (!control.define) { + control.define = {}; + } + for (let i in fromDefine) { + if (!(control.define[i] || control.define[i] == 0)) { + control.define[i] = fromDefine[i] + } + } + } + //处理ext + if (control.define?.ext) { + + for (let i in control.define.ext) { + switch (i) { + case "composes": { + let extComps = control.define?.ext.composes + let defineComps = control.define.composes + for (let j = 0; j < extComps.length; j++) { + let extComp = extComps[j] + let defComp = defineComps[j] + //替换当前部分值 + if (defComp && !extComp.type) { + for (let k in extComp) { + defComp[k] = extComp[k] + } + } + } + break; + } + case "ovs": { + let extOVS = control.define?.ext.ovs + let defineOVS = control.define.ovs + for (let j = 0; j < extOVS.length; j++) { + let extComp = extOVS[j] + let defComp = defineOVS[j] + //替换当前部分值 + if (defComp && extComp) { + for (let k in extComp) { + defComp[k] = extComp[k] + } + } + } + break; + } + case "sample": { + if (!control.define?.sample) { + control.define.sample = {} + } + for (let j in control.define.ext.sample) { + + if (j != 'rules') { + control.define.sample[j] = control.define.ext.sample[j] + } else { + if (!control.define.sample.rules) { + control.define.sample.rules = [] + } + control.define.ext.sample[j].forEach(rule => { + control.define.sample.rules.push(rule) + }); + } + } + break; + } + case "attrs": { + let extAttrs = control.define.ext.attrs; + extAttrs?.forEach(extAttr => { + let append = true + for (let x = 0; x < control.attrs.length; x++) { + //覆盖 + if (control.attrs[x].code == extAttr.code) { + control.attrs[x] = extAttr + append = false; + break; + } + } + if (append) { + control.attrs.push(extAttr) + } + }); + break; + } + case "groups": { + //覆盖 + let extGroups = control.define.ext.groups; + control.groups = extGroups + break; + } + default: { + control.define[i] = control.define.ext[i] + break; + } + } + + } + delete control.define.ext + } + + //处理composes + if (control.define?.composes) { + control.define?.composes.forEach(compose => { + let composeControlDefine = controlOriginDefinies.get(compose.id) + if (composeControlDefine.from) { + loadControlByFrom(controlOriginDefinies, composeControlDefine) + } + compose.attrs = cloneDeep(composeControlDefine.attrs) + let composeDefine = cloneDeep(composeControlDefine.define) + //合并控件自身与from组件的define、menu + if (composeDefine) { + + for (let i in composeDefine) { + if (!(compose[i] || compose[i] == 0)) { + compose[i] = composeDefine[i] + } + } + } + }); + } + + //处理others + loadControlOthers(controlOriginDefinies, control) + + if (fromMenus) { + if (!control.menus) { + control.menus = {}; + } + for (let i in fromMenus) { + if (!(control.menus[i] || control.menus[i] == 0)) { + control.menus[i] = fromMenus[i] + } + } + } + + control.menus = fromMenus + control.attrDefineMap = new Map() + control.type = fromControl.type + + + controlOriginDefinies.set(control.id, control); + } + parseAttrsToGroup(control) + control.def = true; +}; + +const loadControlOthers = function (controlOriginDefinies, control) { + if (control.others) { + control.others.forEach(other => { + let otherControlDefine = controlOriginDefinies.get(other.id) + if (otherControlDefine.from) { + loadControlByFrom(controlOriginDefinies, otherControlDefine) + } + other.code = otherControlDefine.code + let otherDefine = cloneDeep(otherControlDefine.define) + //合并控件自身与from组件的define、menu + if (otherDefine) { + for (let i in otherDefine) { + if (!other.define) { + other.define = {} + } + if (!(other.define[i] || other.define[i] == 0)) { + other.define[i] = otherDefine[i] + } + } + } + other.type = otherControlDefine.type + other.others = otherControlDefine.others + loadControlOthers(controlOriginDefinies, other) + }); + } +} + + + +const loadAndSortGroup = function (groups, controlOriginDefinies){ + let groupOriginDefinies = [] + //组的定义 + groups.forEach(group => { + //读取控件的信息,将实际的控件读取进到group中 + if (group.controls) { + let cos = []; + group.controls.forEach(control => { + let id = control.id; + let controlDefine = controlOriginDefinies.get(id); + if (controlDefine) { + //复制控件定义 + let c = cloneDeep(controlDefine); + //复写group中定义的属性 + for (let i in control) { + if (control[i] != undefined && control[i] != null) { + c[i] = control[i]; + } + } + //处理属性 + cos.push(c); + } + }); + // 内部控件排序 + cos.sort((a, b) => { + return a.orderNo - b.orderNo + }) + group.controls = cos; + } + group.display = true + groupOriginDefinies.push(group) + }); + + //对分组进行排序 + groupOriginDefinies.sort((a, b) => { + return a.orderNo - b.orderNo + }) + + return groupOriginDefinies; +} + + + + + +export { loadControlByFrom, loadAndSortGroup }; diff --git a/plugins/core/dialogs/AlignDialog.vue b/plugins/core/dialogs/AlignDialog.vue new file mode 100644 index 0000000..16578fd --- /dev/null +++ b/plugins/core/dialogs/AlignDialog.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/plugins/core/dialogs/ChangeRatioDialog.vue b/plugins/core/dialogs/ChangeRatioDialog.vue new file mode 100644 index 0000000..42bc62b --- /dev/null +++ b/plugins/core/dialogs/ChangeRatioDialog.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/plugins/core/dialogs/ChooseControlGroupDialog.vue b/plugins/core/dialogs/ChooseControlGroupDialog.vue new file mode 100644 index 0000000..82cab9e --- /dev/null +++ b/plugins/core/dialogs/ChooseControlGroupDialog.vue @@ -0,0 +1,276 @@ + + + + + diff --git a/plugins/core/dialogs/CloseFileConfirmDialog.vue b/plugins/core/dialogs/CloseFileConfirmDialog.vue new file mode 100644 index 0000000..cadb2b4 --- /dev/null +++ b/plugins/core/dialogs/CloseFileConfirmDialog.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/plugins/core/dialogs/CollFileConfirmDialog.vue b/plugins/core/dialogs/CollFileConfirmDialog.vue new file mode 100644 index 0000000..4e0d58f --- /dev/null +++ b/plugins/core/dialogs/CollFileConfirmDialog.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/plugins/core/dialogs/LinePointTypeDialog.vue b/plugins/core/dialogs/LinePointTypeDialog.vue new file mode 100644 index 0000000..42701d8 --- /dev/null +++ b/plugins/core/dialogs/LinePointTypeDialog.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/plugins/core/dialogs/LineTypeDialog.vue b/plugins/core/dialogs/LineTypeDialog.vue new file mode 100644 index 0000000..7fbccf5 --- /dev/null +++ b/plugins/core/dialogs/LineTypeDialog.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/plugins/core/dialogs/ManageLayersDialog.vue b/plugins/core/dialogs/ManageLayersDialog.vue new file mode 100644 index 0000000..7afa728 --- /dev/null +++ b/plugins/core/dialogs/ManageLayersDialog.vue @@ -0,0 +1,458 @@ + + + + + diff --git a/plugins/core/dialogs/MergeComposeDialog.vue b/plugins/core/dialogs/MergeComposeDialog.vue new file mode 100644 index 0000000..8dbb876 --- /dev/null +++ b/plugins/core/dialogs/MergeComposeDialog.vue @@ -0,0 +1,212 @@ + + + + + diff --git a/plugins/core/dialogs/PositionDialog.vue b/plugins/core/dialogs/PositionDialog.vue new file mode 100644 index 0000000..5bc3b07 --- /dev/null +++ b/plugins/core/dialogs/PositionDialog.vue @@ -0,0 +1,185 @@ + + + + + diff --git a/plugins/core/dialogs/PublishFileConfirmDialog.vue b/plugins/core/dialogs/PublishFileConfirmDialog.vue new file mode 100644 index 0000000..4ef2bd9 --- /dev/null +++ b/plugins/core/dialogs/PublishFileConfirmDialog.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/plugins/core/dialogs/QCViewDialog.vue b/plugins/core/dialogs/QCViewDialog.vue new file mode 100644 index 0000000..7e6e618 --- /dev/null +++ b/plugins/core/dialogs/QCViewDialog.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/plugins/core/dialogs/QuickSetStyleDialog.vue b/plugins/core/dialogs/QuickSetStyleDialog.vue new file mode 100644 index 0000000..729c911 --- /dev/null +++ b/plugins/core/dialogs/QuickSetStyleDialog.vue @@ -0,0 +1,284 @@ + + + + + diff --git a/plugins/core/dialogs/RotateDialog.vue b/plugins/core/dialogs/RotateDialog.vue new file mode 100644 index 0000000..783e75f --- /dev/null +++ b/plugins/core/dialogs/RotateDialog.vue @@ -0,0 +1,269 @@ + + + + + diff --git a/plugins/core/dialogs/SelectBorderDashDialog.vue b/plugins/core/dialogs/SelectBorderDashDialog.vue new file mode 100644 index 0000000..f27ff42 --- /dev/null +++ b/plugins/core/dialogs/SelectBorderDashDialog.vue @@ -0,0 +1,206 @@ + + + + + diff --git a/plugins/core/dialogs/SelectBorderWeightDialog.vue b/plugins/core/dialogs/SelectBorderWeightDialog.vue new file mode 100644 index 0000000..0fb7892 --- /dev/null +++ b/plugins/core/dialogs/SelectBorderWeightDialog.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/plugins/core/dialogs/SelectColorDialog.vue b/plugins/core/dialogs/SelectColorDialog.vue new file mode 100644 index 0000000..e3bd60e --- /dev/null +++ b/plugins/core/dialogs/SelectColorDialog.vue @@ -0,0 +1,388 @@ + + + + + diff --git a/plugins/core/dialogs/SelectFontDialog.vue b/plugins/core/dialogs/SelectFontDialog.vue new file mode 100644 index 0000000..bbe76c4 --- /dev/null +++ b/plugins/core/dialogs/SelectFontDialog.vue @@ -0,0 +1,166 @@ + + + + + diff --git a/plugins/core/dialogs/SelectFontSizeDialog.vue b/plugins/core/dialogs/SelectFontSizeDialog.vue new file mode 100644 index 0000000..cede2c3 --- /dev/null +++ b/plugins/core/dialogs/SelectFontSizeDialog.vue @@ -0,0 +1,164 @@ + + + + + diff --git a/plugins/core/dialogs/TextAlignDialog.vue b/plugins/core/dialogs/TextAlignDialog.vue new file mode 100644 index 0000000..22d412c --- /dev/null +++ b/plugins/core/dialogs/TextAlignDialog.vue @@ -0,0 +1,206 @@ + + + + + diff --git a/plugins/core/dialogs/aligndialog.ts b/plugins/core/dialogs/aligndialog.ts new file mode 100644 index 0000000..9a17b56 --- /dev/null +++ b/plugins/core/dialogs/aligndialog.ts @@ -0,0 +1,43 @@ +import {DDeiPluginBase} from "ddei-framework"; +import AlignDialog from './AlignDialog.vue'; + +class DDeiCoreAlignDialog extends DDeiPluginBase{ + + name: string = AlignDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreAlignDialog = new DDeiCoreAlignDialog(null); + + + plugins: object[] = [AlignDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[AlignDialog.name]) { + for (let i in options[AlignDialog.name]) { + newOptions[i] = options[AlignDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreAlignDialog(newOptions); + return panels; + } + } + return DDeiCoreAlignDialog; + } +} + +export default DDeiCoreAlignDialog \ No newline at end of file diff --git a/plugins/core/dialogs/changeratiodialog.ts b/plugins/core/dialogs/changeratiodialog.ts new file mode 100644 index 0000000..25ab385 --- /dev/null +++ b/plugins/core/dialogs/changeratiodialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import ChangeRatioDialog from './ChangeRatioDialog.vue'; + +class DDeiCoreChangeRatioDialog extends DDeiPluginBase{ + name: string = ChangeRatioDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreChangeRatioDialog = new DDeiCoreChangeRatioDialog(null); + + + plugins: object[] = [ChangeRatioDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[ChangeRatioDialog.name]) { + for (let i in options[ChangeRatioDialog.name]) { + newOptions[i] = options[ChangeRatioDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreChangeRatioDialog(newOptions); + return panels; + } + } + return DDeiCoreChangeRatioDialog; + } +} + +export default DDeiCoreChangeRatioDialog \ No newline at end of file diff --git a/plugins/core/dialogs/choosecontrolgroupdialog.ts b/plugins/core/dialogs/choosecontrolgroupdialog.ts new file mode 100644 index 0000000..5195fc8 --- /dev/null +++ b/plugins/core/dialogs/choosecontrolgroupdialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import ChooseControlGroupDialog from './ChooseControlGroupDialog.vue'; + +class DDeiCoreChooseControlGroupDialog extends DDeiPluginBase{ + name: string = ChooseControlGroupDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreChooseControlGroupDialog = new DDeiCoreChooseControlGroupDialog(null); + + + plugins: object[] = [ChooseControlGroupDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[ChooseControlGroupDialog.name]) { + for (let i in options[ChooseControlGroupDialog.name]) { + newOptions[i] = options[ChooseControlGroupDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreChooseControlGroupDialog(newOptions); + return panels; + } + } + return DDeiCoreChooseControlGroupDialog; + } +} + +export default DDeiCoreChooseControlGroupDialog \ No newline at end of file diff --git a/plugins/core/dialogs/closefileconfirmdialog.ts b/plugins/core/dialogs/closefileconfirmdialog.ts new file mode 100644 index 0000000..fe37340 --- /dev/null +++ b/plugins/core/dialogs/closefileconfirmdialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import CloseFileConfirmDialog from './CloseFileConfirmDialog.vue'; + +class DDeiCoreCloseFileConfirmDialog extends DDeiPluginBase{ + name: string = CloseFileConfirmDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreCloseFileConfirmDialog = new DDeiCoreCloseFileConfirmDialog(null); + + + plugins: object[] = [CloseFileConfirmDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[CloseFileConfirmDialog.name]) { + for (let i in options[CloseFileConfirmDialog.name]) { + newOptions[i] = options[CloseFileConfirmDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreCloseFileConfirmDialog(newOptions); + return panels; + } + } + return DDeiCoreCloseFileConfirmDialog; + } +} + +export default DDeiCoreCloseFileConfirmDialog \ No newline at end of file diff --git a/plugins/core/dialogs/collfileconfirmdialog.ts b/plugins/core/dialogs/collfileconfirmdialog.ts new file mode 100644 index 0000000..2305f40 --- /dev/null +++ b/plugins/core/dialogs/collfileconfirmdialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import CollFileConfirmDialog from './CollFileConfirmDialog.vue'; + +class DDeiCoreCollFileConfirmDialog extends DDeiPluginBase{ + name: string = CollFileConfirmDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreCollFileConfirmDialog = new DDeiCoreCollFileConfirmDialog(null); + + + plugins: object[] = [CollFileConfirmDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[CollFileConfirmDialog.name]) { + for (let i in options[CollFileConfirmDialog.name]) { + newOptions[i] = options[CollFileConfirmDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreCollFileConfirmDialog(newOptions); + return panels; + } + } + return DDeiCoreCollFileConfirmDialog; + } +} + +export default DDeiCoreCollFileConfirmDialog \ No newline at end of file diff --git a/plugins/core/dialogs/dialog.ts b/plugins/core/dialogs/dialog.ts new file mode 100644 index 0000000..27e7ab9 --- /dev/null +++ b/plugins/core/dialogs/dialog.ts @@ -0,0 +1,30 @@ +import {DDeiEditor} from "ddei-framework"; +const DialogBase = { + props:{ + editor: { + type: DDeiEditor, + default: null + } + }, + data: function () { + return { + forceRefresh: false, + } + }, + methods: { + forceRefreshView: function () { + this.forceRefresh = false + this.$nextTick(() => { + this.forceRefresh = true; + if (this.refreshData){ + this.refreshData(); + } + }); + } + }, + mounted () { + this.editor.dialogs[this.dialogId].viewer = this + } +}; + +export default DialogBase \ No newline at end of file diff --git a/plugins/core/dialogs/index.ts b/plugins/core/dialogs/index.ts new file mode 100644 index 0000000..e1ca186 --- /dev/null +++ b/plugins/core/dialogs/index.ts @@ -0,0 +1,80 @@ +import {DDeiPluginBase} from "ddei-framework"; +import DDeiCoreAlignDialog from "./aligndialog" +import DDeiCoreChangeRatioDialog from "./changeratiodialog" +import DDeiCoreChooseControlGroupDialog from "./choosecontrolgroupdialog" +import DDeiCoreCloseFileConfirmDialog from "./closefileconfirmdialog" +import DDeiCoreCollFileConfirmDialog from "./collfileconfirmdialog" +import DDeiCoreLinePointTypeDialog from "./linepointtypedialog" +import DDeiCoreLineTypeDialog from "./linetypedialog" +import DDeiCoreManageLayersDialog from "./managelayersdialog" +import DDeiCoreMergeComposeDialog from "./mergecomposedialog" +import DDeiCorePositionDialog from "./positiondialog" +import DDeiCorePublishFileConfirmDialog from "./publishfileconfirmdialog" +import DDeiCoreQCViewDialog from "./qcviewdialog" +import DDeiCoreQuickSetStyleDialog from "./quicksetstyledialog" +import DDeiCoreRotateDialog from "./rotatedialog" +import DDeiCoreSelectBorderDashDialog from "./selectborderdashdialog" +import DDeiCoreSelectBorderWeightDialog from "./selectborderweightdialog" +import DDeiCoreSelectColorDialog from "./selectcolordialog" +import DDeiCoreSelectFontDialog from "./selectfontdialog" +import DDeiCoreSelectFontSizeDialog from "./selectfontsizedialog" +import DDeiCoreTextAlignDialog from "./textaligndialog" + +class DDeiCoreDialogs extends DDeiPluginBase { + + type: string = "package" + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreDialogs = new DDeiCoreDialogs(null); + + plugins: object[] = [DDeiCoreAlignDialog, DDeiCoreChangeRatioDialog, + DDeiCoreChooseControlGroupDialog, DDeiCoreCloseFileConfirmDialog, DDeiCoreCollFileConfirmDialog, + DDeiCoreLinePointTypeDialog, + DDeiCoreLineTypeDialog, DDeiCoreManageLayersDialog, DDeiCoreMergeComposeDialog, DDeiCorePositionDialog, + DDeiCorePublishFileConfirmDialog, DDeiCoreQCViewDialog, DDeiCoreQuickSetStyleDialog, + DDeiCoreRotateDialog, DDeiCoreSelectBorderDashDialog, DDeiCoreSelectBorderWeightDialog, DDeiCoreSelectColorDialog, + DDeiCoreSelectFontDialog, DDeiCoreSelectFontSizeDialog, DDeiCoreTextAlignDialog + ] + + getDialogs(editor) { + let panels = [] + this.plugins?.forEach(plugin => { + let ls + if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { + ls = plugin.defaultIns.getDialogs(editor); + } else if (plugin instanceof DDeiPluginBase) { + ls = plugin.getDialogs(editor); + } + if (ls?.length > 0) { + panels = panels.concat(ls); + } + }) + return panels + } + + + + static configuration(options) { + if (options) { + //解析options,只使用自己相关的 + let panels = new DDeiCoreDialogs(options); + for (let i = 0; i < panels.plugins?.length; i++) { + panels.plugins[i] = panels.plugins[i].configuration(options, true) + } + return panels; + } + return DDeiCoreDialogs; + } +} + + +export {DDeiCoreDialogs,DDeiCoreAlignDialog, DDeiCoreChangeRatioDialog, + DDeiCoreChooseControlGroupDialog, DDeiCoreCloseFileConfirmDialog, DDeiCoreCollFileConfirmDialog, + DDeiCoreLinePointTypeDialog, + DDeiCoreLineTypeDialog, DDeiCoreManageLayersDialog, DDeiCoreMergeComposeDialog, DDeiCorePositionDialog, + DDeiCorePublishFileConfirmDialog, DDeiCoreQCViewDialog, DDeiCoreQuickSetStyleDialog, + DDeiCoreRotateDialog, DDeiCoreSelectBorderDashDialog, DDeiCoreSelectBorderWeightDialog, DDeiCoreSelectColorDialog, + DDeiCoreSelectFontDialog, DDeiCoreSelectFontSizeDialog, DDeiCoreTextAlignDialog +} +export default DDeiCoreDialogs \ No newline at end of file diff --git a/plugins/core/dialogs/linepointtypedialog.ts b/plugins/core/dialogs/linepointtypedialog.ts new file mode 100644 index 0000000..7b5d5c5 --- /dev/null +++ b/plugins/core/dialogs/linepointtypedialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import LinePointTypeDialog from './LinePointTypeDialog.vue'; + +class DDeiCoreLinePointTypeDialog extends DDeiPluginBase{ + name: string = LinePointTypeDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreLinePointTypeDialog = new DDeiCoreLinePointTypeDialog(null); + + + plugins: object[] = [LinePointTypeDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[LinePointTypeDialog.name]) { + for (let i in options[LinePointTypeDialog.name]) { + newOptions[i] = options[LinePointTypeDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreLinePointTypeDialog(newOptions); + return panels; + } + } + return DDeiCoreLinePointTypeDialog; + } +} + +export default DDeiCoreLinePointTypeDialog \ No newline at end of file diff --git a/plugins/core/dialogs/linetypedialog.ts b/plugins/core/dialogs/linetypedialog.ts new file mode 100644 index 0000000..b7ca801 --- /dev/null +++ b/plugins/core/dialogs/linetypedialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import LineTypeDialog from './LineTypeDialog.vue'; + +class DDeiCoreLineTypeDialog extends DDeiPluginBase{ + name: string = LineTypeDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreLineTypeDialog = new DDeiCoreLineTypeDialog(null); + + + plugins: object[] = [LineTypeDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[LineTypeDialog.name]) { + for (let i in options[LineTypeDialog.name]) { + newOptions[i] = options[LineTypeDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreLineTypeDialog(newOptions); + return panels; + } + } + return DDeiCoreLineTypeDialog; + } +} + +export default DDeiCoreLineTypeDialog \ No newline at end of file diff --git a/plugins/core/dialogs/managelayersdialog.ts b/plugins/core/dialogs/managelayersdialog.ts new file mode 100644 index 0000000..f96a06f --- /dev/null +++ b/plugins/core/dialogs/managelayersdialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import ManageLayersDialog from './ManageLayersDialog.vue'; + +class DDeiCoreManageLayersDialog extends DDeiPluginBase{ + name: string = ManageLayersDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreManageLayersDialog = new DDeiCoreManageLayersDialog(null); + + + plugins: object[] = [ManageLayersDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[ManageLayersDialog.name]) { + for (let i in options[ManageLayersDialog.name]) { + newOptions[i] = options[ManageLayersDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreManageLayersDialog(newOptions); + return panels; + } + } + return DDeiCoreManageLayersDialog; + } +} + +export default DDeiCoreManageLayersDialog \ No newline at end of file diff --git a/plugins/core/dialogs/mergecomposedialog.ts b/plugins/core/dialogs/mergecomposedialog.ts new file mode 100644 index 0000000..27632c7 --- /dev/null +++ b/plugins/core/dialogs/mergecomposedialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import MergeComposeDialog from './MergeComposeDialog.vue'; + +class DDeiCoreMergeComposeDialog extends DDeiPluginBase{ + name: string = MergeComposeDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreMergeComposeDialog = new DDeiCoreMergeComposeDialog(null); + + + plugins: object[] = [MergeComposeDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[MergeComposeDialog.name]) { + for (let i in options[MergeComposeDialog.name]) { + newOptions[i] = options[MergeComposeDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreMergeComposeDialog(newOptions); + return panels; + } + } + return DDeiCoreMergeComposeDialog; + } +} + +export default DDeiCoreMergeComposeDialog \ No newline at end of file diff --git a/plugins/core/dialogs/positiondialog.ts b/plugins/core/dialogs/positiondialog.ts new file mode 100644 index 0000000..3e56d38 --- /dev/null +++ b/plugins/core/dialogs/positiondialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import PositionDialog from './PositionDialog.vue'; + +class DDeiCorePositionDialog extends DDeiPluginBase{ + name: string = PositionDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCorePositionDialog = new DDeiCorePositionDialog(null); + + + plugins: object[] = [PositionDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[PositionDialog.name]) { + for (let i in options[PositionDialog.name]) { + newOptions[i] = options[PositionDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCorePositionDialog(newOptions); + return panels; + } + } + return DDeiCorePositionDialog; + } +} + +export default DDeiCorePositionDialog \ No newline at end of file diff --git a/plugins/core/dialogs/publishfileconfirmdialog.ts b/plugins/core/dialogs/publishfileconfirmdialog.ts new file mode 100644 index 0000000..d009f13 --- /dev/null +++ b/plugins/core/dialogs/publishfileconfirmdialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import PublishFileConfirmDialog from './PublishFileConfirmDialog.vue'; + +class DDeiCorePublishFileConfirmDialog extends DDeiPluginBase{ + name: string = PublishFileConfirmDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCorePublishFileConfirmDialog = new DDeiCorePublishFileConfirmDialog(null); + + + plugins: object[] = [PublishFileConfirmDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[PublishFileConfirmDialog.name]) { + for (let i in options[PublishFileConfirmDialog.name]) { + newOptions[i] = options[PublishFileConfirmDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCorePublishFileConfirmDialog(newOptions); + return panels; + } + } + return DDeiCorePublishFileConfirmDialog; + } +} + +export default DDeiCorePublishFileConfirmDialog \ No newline at end of file diff --git a/plugins/core/dialogs/qcviewdialog.ts b/plugins/core/dialogs/qcviewdialog.ts new file mode 100644 index 0000000..690ba8b --- /dev/null +++ b/plugins/core/dialogs/qcviewdialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QCViewDialog from './QCViewDialog.vue'; + +class DDeiCoreQCViewDialog extends DDeiPluginBase{ + name: string = QCViewDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreQCViewDialog = new DDeiCoreQCViewDialog(null); + + + plugins: object[] = [QCViewDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QCViewDialog.name]) { + for (let i in options[QCViewDialog.name]) { + newOptions[i] = options[QCViewDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreQCViewDialog(newOptions); + return panels; + } + } + return DDeiCoreQCViewDialog; + } +} + +export default DDeiCoreQCViewDialog \ No newline at end of file diff --git a/plugins/core/dialogs/quicksetstyledialog.ts b/plugins/core/dialogs/quicksetstyledialog.ts new file mode 100644 index 0000000..9467064 --- /dev/null +++ b/plugins/core/dialogs/quicksetstyledialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QuickSetStyleDialog from './QuickSetStyleDialog.vue'; + +class DDeiCoreQuickSetStyleDialog extends DDeiPluginBase{ + name: string = QuickSetStyleDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreQuickSetStyleDialog = new DDeiCoreQuickSetStyleDialog(null); + + + plugins: object[] = [QuickSetStyleDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QuickSetStyleDialog.name]) { + for (let i in options[QuickSetStyleDialog.name]) { + newOptions[i] = options[QuickSetStyleDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreQuickSetStyleDialog(newOptions); + return panels; + } + } + return DDeiCoreQuickSetStyleDialog; + } +} + +export default DDeiCoreQuickSetStyleDialog \ No newline at end of file diff --git a/plugins/core/dialogs/rotatedialog.ts b/plugins/core/dialogs/rotatedialog.ts new file mode 100644 index 0000000..316a456 --- /dev/null +++ b/plugins/core/dialogs/rotatedialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import RotateDialog from './RotateDialog.vue'; + +class DDeiCoreRotateDialog extends DDeiPluginBase{ + name: string = RotateDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreRotateDialog = new DDeiCoreRotateDialog(null); + + + plugins: object[] = [RotateDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[RotateDialog.name]) { + for (let i in options[RotateDialog.name]) { + newOptions[i] = options[RotateDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreRotateDialog(newOptions); + return panels; + } + } + return DDeiCoreRotateDialog; + } +} + +export default DDeiCoreRotateDialog \ No newline at end of file diff --git a/plugins/core/dialogs/selectborderdashdialog.ts b/plugins/core/dialogs/selectborderdashdialog.ts new file mode 100644 index 0000000..39aa6e0 --- /dev/null +++ b/plugins/core/dialogs/selectborderdashdialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import SelectBorderDashDialog from './SelectBorderDashDialog.vue'; + +class DDeiCoreSelectBorderDashDialog extends DDeiPluginBase{ + name: string = SelectBorderDashDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreSelectBorderDashDialog = new DDeiCoreSelectBorderDashDialog(null); + + + plugins: object[] = [SelectBorderDashDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[SelectBorderDashDialog.name]) { + for (let i in options[SelectBorderDashDialog.name]) { + newOptions[i] = options[SelectBorderDashDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreSelectBorderDashDialog(newOptions); + return panels; + } + } + return DDeiCoreSelectBorderDashDialog; + } +} + +export default DDeiCoreSelectBorderDashDialog \ No newline at end of file diff --git a/plugins/core/dialogs/selectborderweightdialog.ts b/plugins/core/dialogs/selectborderweightdialog.ts new file mode 100644 index 0000000..1909632 --- /dev/null +++ b/plugins/core/dialogs/selectborderweightdialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import SelectBorderWeightDialog from './SelectBorderWeightDialog.vue'; + +class DDeiCoreSelectBorderWeightDialog extends DDeiPluginBase{ + name: string = SelectBorderWeightDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreSelectBorderWeightDialog = new DDeiCoreSelectBorderWeightDialog(null); + + + plugins: object[] = [SelectBorderWeightDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[SelectBorderWeightDialog.name]) { + for (let i in options[SelectBorderWeightDialog.name]) { + newOptions[i] = options[SelectBorderWeightDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreSelectBorderWeightDialog(newOptions); + return panels; + } + } + return DDeiCoreSelectBorderWeightDialog; + } +} + +export default DDeiCoreSelectBorderWeightDialog \ No newline at end of file diff --git a/plugins/core/dialogs/selectcolordialog.ts b/plugins/core/dialogs/selectcolordialog.ts new file mode 100644 index 0000000..0d6cd87 --- /dev/null +++ b/plugins/core/dialogs/selectcolordialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import SelectColorDialog from './SelectColorDialog.vue'; + +class DDeiCoreSelectColorDialog extends DDeiPluginBase{ + name: string = SelectColorDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreSelectColorDialog = new DDeiCoreSelectColorDialog(null); + + + plugins: object[] = [SelectColorDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[SelectColorDialog.name]) { + for (let i in options[SelectColorDialog.name]) { + newOptions[i] = options[SelectColorDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreSelectColorDialog(newOptions); + return panels; + } + } + return DDeiCoreSelectColorDialog; + } +} + +export default DDeiCoreSelectColorDialog \ No newline at end of file diff --git a/plugins/core/dialogs/selectfontdialog.ts b/plugins/core/dialogs/selectfontdialog.ts new file mode 100644 index 0000000..b747d97 --- /dev/null +++ b/plugins/core/dialogs/selectfontdialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import SelectFontDialog from './SelectFontDialog.vue'; + +class DDeiCoreSelectFontDialog extends DDeiPluginBase{ + name: string = SelectFontDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreSelectFontDialog = new DDeiCoreSelectFontDialog(null); + + + plugins: object[] = [SelectFontDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[SelectFontDialog.name]) { + for (let i in options[SelectFontDialog.name]) { + newOptions[i] = options[SelectFontDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreSelectFontDialog(newOptions); + return panels; + } + } + return DDeiCoreSelectFontDialog; + } +} + +export default DDeiCoreSelectFontDialog \ No newline at end of file diff --git a/plugins/core/dialogs/selectfontsizedialog.ts b/plugins/core/dialogs/selectfontsizedialog.ts new file mode 100644 index 0000000..b63c39c --- /dev/null +++ b/plugins/core/dialogs/selectfontsizedialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import SelectFontSizeDialog from './SelectFontSizeDialog.vue'; + +class DDeiCoreSelectFontSizeDialog extends DDeiPluginBase{ + name: string = SelectFontSizeDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreSelectFontSizeDialog = new DDeiCoreSelectFontSizeDialog(null); + + + plugins: object[] = [SelectFontSizeDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[SelectFontSizeDialog.name]) { + for (let i in options[SelectFontSizeDialog.name]) { + newOptions[i] = options[SelectFontSizeDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreSelectFontSizeDialog(newOptions); + return panels; + } + } + return DDeiCoreSelectFontSizeDialog; + } +} + +export default DDeiCoreSelectFontSizeDialog \ No newline at end of file diff --git a/plugins/core/dialogs/textaligndialog.ts b/plugins/core/dialogs/textaligndialog.ts new file mode 100644 index 0000000..8981693 --- /dev/null +++ b/plugins/core/dialogs/textaligndialog.ts @@ -0,0 +1,42 @@ +import {DDeiPluginBase} from "ddei-framework"; +import TextAlignDialog from './TextAlignDialog.vue'; + +class DDeiCoreTextAlignDialog extends DDeiPluginBase{ + name: string = TextAlignDialog.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreTextAlignDialog = new DDeiCoreTextAlignDialog(null); + + + plugins: object[] = [TextAlignDialog] + + getDialogs(editor){ + return this.plugins; + } + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[TextAlignDialog.name]) { + for (let i in options[TextAlignDialog.name]) { + newOptions[i] = options[TextAlignDialog.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreTextAlignDialog(newOptions); + return panels; + } + } + return DDeiCoreTextAlignDialog; + } +} + +export default DDeiCoreTextAlignDialog \ No newline at end of file diff --git a/plugins/core/hotkeys/actions/key-action-all-select.ts b/plugins/core/hotkeys/actions/key-action-all-select.ts new file mode 100644 index 0000000..2651279 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-all-select.ts @@ -0,0 +1,95 @@ +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import {DDeiEnumOperateType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:全选 + * 全选所有控件 + */ +class DDeiKeyActionAllSelect extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-all-select" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionAllSelect = new DDeiKeyActionAllSelect(); + + defaultOptions: object = { + 'keys': [ + { + ctrl: 1, keys: "65", editorState: DDeiEditorState.DESIGNING + } + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionAllSelect.defaultIns.name]) { + for (let i in options[DDeiKeyActionAllSelect.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionAllSelect.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionAllSelect(newOptions); + return panels; + } + } + return DDeiKeyActionAllSelect; + } + + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let models = [] + if (ddInstance.stage.selectedModels?.size > 0) { + models = Array.from(ddInstance.stage.selectedModels?.values()); + } + if (models?.length == 1 && models[0].baseModelType == 'DDeiTable' && models[0].curRow != -1 && models[0].curCol != -1) { + //选中当前表格所有单元格 + for (let i = 0; i < models[0].rows.length; i++) { + let rowObj = models[0].rows[i]; + for (let j = 0; j < rowObj.length; j++) { + rowObj[j].setState(DDeiEnumControlState.SELECTED) + } + } + } else { + //当前激活的图层 + let layer = ddInstance.stage.layers[ddInstance.stage.layerIndex] + //加载事件的配置 + let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_SELECT_BEFORE", DDeiEnumOperateType.SELECT, { models: Array.from(layer.models.values()) }, ddInstance, evt) + if (rsState == 0 || rsState == 1) { + ddInstance?.bus?.push(DDeiEnumBusCommandType.ModelChangeSelect, { models: layer.models, value: DDeiEnumControlState.SELECTED }, evt); + ddInstance?.bus?.push(DDeiEnumBusCommandType.StageChangeSelectModels, {}, evt); + } + } + //渲染图形 + ddInstance?.bus?.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + + ddInstance?.bus?.executeAll(); + } + } + +} + + +export default DDeiKeyActionAllSelect diff --git a/plugins/core/hotkeys/actions/key-action-brushdata.ts b/plugins/core/hotkeys/actions/key-action-brushdata.ts new file mode 100644 index 0000000..fffe461 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-brushdata.ts @@ -0,0 +1,127 @@ +import {DDei} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import { cloneDeep } from 'lodash' + +/** + * 键行为:记录当前控件的格式 + */ +class DDeiKeyActionBrushData extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-brush-data" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionBrushData = new DDeiKeyActionBrushData(); + + defaultOptions: object = { + 'keys': [ + { + ctrl: 1, shift: 1, keys: "67", editorState: DDeiEditorState.DESIGNING + } + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionBrushData.defaultIns.name]) { + for (let i in options[DDeiKeyActionBrushData.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionBrushData.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionBrushData(newOptions); + return panels; + } + } + return DDeiKeyActionBrushData; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //记录当前格式信息,修改状态为刷子状态 + if (ddInstance && ddInstance.stage) { + let stage = ddInstance.stage + let editor = DDeiEditor.ACTIVE_INSTANCE; + let models = Array.from(ddInstance.stage.selectedModels?.values()); + stage.brushData = null + if (models?.length == 1) { + if (models[0].baseModelType == 'DDeiTable') { + let table = models[0] + let selectedCells = table.getSelectedCells(); + let minMaxColRow = table.getMinMaxRowAndCol(selectedCells); + stage.brushData = [] + for (let i = minMaxColRow.minRow; i <= minMaxColRow.maxRow; i++) { + let rowObj = table.rows[i]; + let rowData = [] + + for (let j = minMaxColRow.minCol; j <= minMaxColRow.maxCol; j++) { + let cellObj = rowObj[j]; + rowData.push(cellObj); + } + stage.brushData.push(rowData); + } + if (stage.brushData.length > 0) { + editor.changeState(DDeiEditorState.DESIGNING) + editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); + editor.bus.executeAll(); + } + } else { + + if (editor.state == DDeiEditorState.QUICK_EDITING) { + let shadowControl = editor.ddInstance.stage.render.editorShadowControl + if (shadowControl?.render.isEditoring) { + let editorText = DDeiUtil.getEditorText(); + //开始光标与结束光标 + let curSIdx = -1 + let curEIdx = -1 + if (editorText) { + curSIdx = editorText.selectionStart + curEIdx = editorText.selectionEnd + } + stage.brushDataText = cloneDeep(shadowControl.getSptAllStyles(curSIdx, curEIdx)) + } + + + delete stage.brushData + editor.bus?.push(DDeiEnumBusCommandType.ChangeCursor, { image: 'cursor-brush' }) + editor.bus?.executeAll(); + } else { + let model = models[0] + stage.brushData = [model] + delete stage.brushDataText + editor.changeState(DDeiEditorState.DESIGNING) + editor.bus?.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); + editor.bus?.push(DDeiEnumBusCommandType.ChangeCursor, { image: 'cursor-brush' }) + editor.bus?.executeAll(); + } + + } + + } + + } + } + +} + + +export default DDeiKeyActionBrushData diff --git a/plugins/core/hotkeys/actions/key-action-cancel-compose.ts b/plugins/core/hotkeys/actions/key-action-cancel-compose.ts new file mode 100644 index 0000000..f0130b3 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-cancel-compose.ts @@ -0,0 +1,75 @@ +import {DDeiConfig} from "ddei-framework"; +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiEnumOperateState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:取消组合 + * 取消已组合的图形,必须是容器类图形才能被取消组合 + */ +class DDeiKeyActionCancelCompose extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-cancel-compose" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCancelCompose = new DDeiKeyActionCancelCompose(); + + defaultOptions: object = { + 'keys': [ + { + keys: "71", ctrl: 1, shift: 1, editorState: DDeiEditorState.DESIGNING + } + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCancelCompose.defaultIns.name]) { + for (let i in options[DDeiKeyActionCancelCompose.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCancelCompose.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCancelCompose(newOptions); + return panels; + } + } + return DDeiKeyActionCancelCompose; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + //当前激活的图层 + let layer = ddInstance.stage.layers[ddInstance.stage.layerIndex] + let selectedModels = layer.getSelectedModels(); + if (selectedModels.size > 0) { + ddInstance.bus.push(DDeiEnumBusCommandType.ModelCancelMerge); + ddInstance.bus.executeAll(); + } + } + } + +} + + +export default DDeiKeyActionCancelCompose diff --git a/plugins/core/hotkeys/actions/key-action-cancel-control-create.ts b/plugins/core/hotkeys/actions/key-action-cancel-control-create.ts new file mode 100644 index 0000000..07408e3 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-cancel-control-create.ts @@ -0,0 +1,82 @@ +import {DDei} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; + +/** + * 键行为:取消控件创建 + * 取消控件创建 + */ +class DDeiKeyActionCancelControlCreate extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-cancel-control-create" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCancelControlCreate = new DDeiKeyActionCancelControlCreate(); + + defaultOptions: object = { + 'keys': [ + { + keys: "27", editorState: DDeiEditorState.CONTROL_CREATING + } + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCancelControlCreate.defaultIns.name]) { + for (let i in options[DDeiKeyActionCancelControlCreate.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCancelControlCreate.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCancelControlCreate(newOptions); + return panels; + } + } + return DDeiKeyActionCancelControlCreate; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei, editor: DDeiEditor): void { + if (editor.state == DDeiEditorState.CONTROL_CREATING) { + if (editor.creatingControls) { + let layer = ddInstance.stage.layers[ddInstance.stage.layerIndex]; + //从layer中移除控件 + layer.removeModels(editor.creatingControls); + editor.creatingControls = null + layer.opPoints = []; + if (layer.opLine?.render) { + layer.opLine.render.enableRefreshShape() + } + delete layer.opLine; + //清除临时变量 + editor.bus.push(DDeiEnumBusCommandType.ClearTemplateVars); + //渲染图形 + editor.bus.push(DDeiEnumBusCommandType.RefreshShape); + editor.bus.executeAll(); + } + } + } + +} + + +export default DDeiKeyActionCancelControlCreate diff --git a/plugins/core/hotkeys/actions/key-action-cancel-current-action.ts b/plugins/core/hotkeys/actions/key-action-cancel-current-action.ts new file mode 100644 index 0000000..70b34e2 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-cancel-current-action.ts @@ -0,0 +1,89 @@ +import {DDei} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEnumOperateState} from "ddei-framework"; + +/** + * 键行为:取消当前正在进行的动作 + * 取消当前正在进行的动作 + */ +class DDeiKeyActionCancelCurrentAction extends DDeiKeyAction { + + + name: string = "ddei-core-keyaction-cancel-current-action" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCancelCurrentAction = new DDeiKeyActionCancelCurrentAction(); + + defaultOptions: object = { + 'keys': [ + { keys: "27", editorState: DDeiEditorState.DESIGNING}, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCancelCurrentAction.defaultIns.name]) { + for (let i in options[DDeiKeyActionCancelCurrentAction.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCancelCurrentAction.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCancelCurrentAction(newOptions); + return panels; + } + } + return DDeiKeyActionCancelCurrentAction; + } + + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei, editor: DDeiEditor): void { + if (editor.state == DDeiEditorState.DESIGNING) { + let stage = ddInstance.stage; + let layer = stage.layers[stage?.layerIndex]; + if (layer) { + layer.opPoints = [] + if (layer.opLine?.render) { + layer.opLine.render.enableRefreshShape() + } + delete layer.opLine; + //清空shadows + layer.shadowControls?.forEach(c => { + c.destroyed() + }) + layer.shadowControls = []; + stage.render.operateState = DDeiEnumOperateState.NONE; + //清空临时变量 + ddInstance.bus.push(DDeiEnumBusCommandType.ClearTemplateVars, null, evt); + ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds, null, evt); + //渲染图形 + ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + //排序并执行所有action + ddInstance.bus.executeAll(); + } + } + } + +} + + +export default DDeiKeyActionCancelCurrentAction diff --git a/plugins/core/hotkeys/actions/key-action-cancel-quick-edit.ts b/plugins/core/hotkeys/actions/key-action-cancel-quick-edit.ts new file mode 100644 index 0000000..cec3622 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-cancel-quick-edit.ts @@ -0,0 +1,78 @@ +import {DDei} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; + +/** + * 键行为:取消快捷编辑 + * 取消快捷编辑 + */ +class DDeiKeyActionCancelQuickEdit extends DDeiKeyAction { + name: string = "ddei-core-keyaction-quickedit-cancel" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCancelQuickEdit = new DDeiKeyActionCancelQuickEdit(); + + defaultOptions: object = { + 'keys': [ + { keys: "27", editorState: DDeiEditorState.QUICK_EDITING}, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCancelQuickEdit.defaultIns.name]) { + for (let i in options[DDeiKeyActionCancelQuickEdit.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCancelQuickEdit.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCancelQuickEdit(newOptions); + return panels; + } + } + return DDeiKeyActionCancelQuickEdit; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + if (ddInstance.stage.brushDataText) { + delete ddInstance.stage.brushDataText + } else { + let editor = DDeiEditor.ACTIVE_INSTANCE; + let inputEle = editor.quickEditorInput; + inputEle.value = ""; + ddInstance.stage.render.editorShadowControl = null; + editor.quickEditorModel = null + delete ddInstance.stage.brushDataText + editor.changeState(DDeiEditorState.DESIGNING); + editor.bus.push(DDeiEnumBusCommandType.ClearTemplateVars); + editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); + editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["topmenu"] }); + editor.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); + editor.bus.push(DDeiEnumBusCommandType.RefreshShape); + editor.bus.executeAll(); + } + } + +} + + +export default DDeiKeyActionCancelQuickEdit diff --git a/plugins/core/hotkeys/actions/key-action-cancel-select.ts b/plugins/core/hotkeys/actions/key-action-cancel-select.ts new file mode 100644 index 0000000..2c27444 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-cancel-select.ts @@ -0,0 +1,88 @@ +import {DDei} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import { DDeiEditorState, DDeiEnumOperateState } from "ddei-framework"; + +/** + * 键行为:取消全选 + * 取消选择所有控件 + */ +class DDeiKeyActionCancelSelect extends DDeiKeyAction { + name: string = "ddei-core-keyaction-cancel-select" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCancelSelect = new DDeiKeyActionCancelSelect(); + + defaultOptions: object = { + 'keys': [ + //取消全选,500毫秒内,连续按两下esc键 + { keys: "27", times: 2, interval: 500, editorState: DDeiEditorState.DESIGNING,operateState:DDeiEnumOperateState.NONE }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCancelSelect.defaultIns.name]) { + for (let i in options[DDeiKeyActionCancelSelect.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCancelSelect.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCancelSelect(newOptions); + return panels; + } + } + return DDeiKeyActionCancelSelect; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let models = Array.from(ddInstance.stage.selectedModels?.values()); + if (models?.length == 1 && models[0].baseModelType == 'DDeiTable' && models[0].curRow != -1 && models[0].curCol != -1) { + //选中当前表格所有单元格 + for (let i = 0; i < models[0].rows.length; i++) { + let rowObj = models[0].rows[i]; + for (let j = 0; j < rowObj.length; j++) { + rowObj[j].setState(DDeiEnumControlState.DEFAULT) + } + } + models[0].curRow = -1 + models[0].curCol = -1 + models[0].tempDragCell = null + } else { + //当前激活的图层 + let layer = ddInstance.stage.layers[ddInstance.stage.layerIndex] + + ddInstance?.bus?.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, { container: layer, curLevel: true }, evt); + ddInstance?.bus?.push(DDeiEnumBusCommandType.StageChangeSelectModels, {}, evt); + ddInstance?.bus?.push(DDeiEnumBusCommandType.UpdateSelectorBounds, null, evt); + } + //渲染图形 + ddInstance?.bus?.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + + ddInstance?.bus?.executeAll(); + } + } + +} + + +export default DDeiKeyActionCancelSelect diff --git a/plugins/core/hotkeys/actions/key-action-clear-brushdata.ts b/plugins/core/hotkeys/actions/key-action-clear-brushdata.ts new file mode 100644 index 0000000..5f0196b --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-clear-brushdata.ts @@ -0,0 +1,71 @@ +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiEnumOperateState} from "ddei-framework"; + +/** + * 键行为:清除格式刷格式 + */ +class DDeiKeyActionClearBrushData extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-clear-brushdata" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionClearBrushData = new DDeiKeyActionClearBrushData(); + + defaultOptions: object = { + 'keys': [ + { keys: "27", editorState: DDeiEditorState.DESIGNING }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionClearBrushData.defaultIns.name]) { + for (let i in options[DDeiKeyActionClearBrushData.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionClearBrushData.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionClearBrushData(newOptions); + return panels; + } + } + return DDeiKeyActionClearBrushData; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //记录当前格式信息,修改状态为刷子状态 + if (ddInstance && ddInstance.stage) { + let stage = ddInstance.stage + if (stage) { + stage.brushData = null; + ddInstance?.bus?.push(DDeiEnumBusCommandType.ChangeCursor, { cursor: 'default' }) + ddInstance?.bus?.executeAll(); + } + } + } + +} + + +export default DDeiKeyActionClearBrushData diff --git a/plugins/core/hotkeys/actions/key-action-close-dialog.ts b/plugins/core/hotkeys/actions/key-action-close-dialog.ts new file mode 100644 index 0000000..7d98de2 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-close-dialog.ts @@ -0,0 +1,68 @@ +import {DDeiConfig} from "ddei-framework"; +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiEnumOperateState} from "ddei-framework"; +import {DDeiRectContainer} from "ddei-framework"; +import {DDeiAbstractShape} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import {DDeiEditorUtil} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:关闭弹出框 + * 关闭已打开的的弹出框 + */ +class DDeiKeyActionCloseDialog extends DDeiKeyAction { + name: string = "ddei-core-keyaction-close-dialog" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCloseDialog = new DDeiKeyActionCloseDialog(); + + defaultOptions: object = { + 'keys': [ + //ESC关闭弹出框 + { keys: "27", editorState: DDeiEditorState.PROPERTY_EDITING }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCloseDialog.defaultIns.name]) { + for (let i in options[DDeiKeyActionCloseDialog.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCloseDialog.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCloseDialog(newOptions); + return panels; + } + } + return DDeiKeyActionCloseDialog; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + DDeiEditorUtil.closeDialogs(DDeiEditorUtil.getEditorInsByDDei(ddInstance),["bottom-dialog", "property-dialog", "top-dialog", "toolbox-dialog"]) + } + +} + + +export default DDeiKeyActionCloseDialog diff --git a/plugins/core/hotkeys/actions/key-action-compose.ts b/plugins/core/hotkeys/actions/key-action-compose.ts new file mode 100644 index 0000000..e64cb43 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-compose.ts @@ -0,0 +1,72 @@ +import {DDeiConfig} from "ddei-framework"; +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiEnumOperateState} from "ddei-framework"; +import {DDeiRectContainer} from "ddei-framework"; +import {DDeiAbstractShape} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:组合 + * 组合已选择的图形,至少两个图形才可以完成组合 + */ +class DDeiKeyActionCompose extends DDeiKeyAction { + name: string = "ddei-core-keyaction-compose" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCompose = new DDeiKeyActionCompose(); + + defaultOptions: object = { + 'keys': [ + //组合 + { keys: "71", ctrl: 1, editorState: DDeiEditorState.DESIGNING }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCompose.defaultIns.name]) { + for (let i in options[DDeiKeyActionCompose.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCompose.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCompose(newOptions); + return panels; + } + } + return DDeiKeyActionCompose; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //修改当前操作控件坐标 + if (ddInstance) { + //当前激活的图层 + ddInstance.bus.push(DDeiEnumBusCommandType.ModelMerge, null, evt); + ddInstance.bus.executeAll(); + + } + } + +} + + +export default DDeiKeyActionCompose diff --git a/plugins/core/hotkeys/actions/key-action-copy-image.ts b/plugins/core/hotkeys/actions/key-action-copy-image.ts new file mode 100644 index 0000000..7b4bf5a --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-copy-image.ts @@ -0,0 +1,158 @@ +import {DDeiConfig} from "ddei-framework"; +import {DDei} from "ddei-framework"; +import {DDeiAbstractShape} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; + +/** + * 键行为:复制为图片 + * 复制当前的已选控件 + */ +class DDeiKeyActionCopyImage extends DDeiKeyAction { + name: string = "ddei-core-keyaction-copy-image" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCopyImage = new DDeiKeyActionCopyImage(); + + defaultOptions: object = { + 'keys': [ + { ctrl: 1, keys: "73", editorState: DDeiEditorState.DESIGNING}, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCopyImage.defaultIns.name]) { + for (let i in options[DDeiKeyActionCopyImage.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCopyImage.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCopyImage(newOptions); + return panels; + } + } + return DDeiKeyActionCopyImage; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei, editor: DDeiEditor): void { + if (DDeiConfig.ALLOW_CLIPBOARD || DDeiConfig.ALLOW_CLIPBOARD == undefined) { + + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + //当前激活的图层 + let selectedControls = ddInstance.stage.selectedModels; + //存在选中控件 + if (selectedControls?.size > 0) { + let models = Array.from(selectedControls?.values()); + this.copyToImage(editor, ddInstance, models) + } + } + + + } + } + + copyToImage(editor, ddInstance, models) { + try { + //转换为图片 + let canvas = document.createElement('canvas'); + //获得 2d 上下文对象 + let ctx = canvas.getContext('2d'); + //获取缩放比例 + let oldRat1 = ddInstance.render.ratio + + //如果高清屏,rat一般大于2印此系数为1保持不变,如果非高清则扩大为2倍保持清晰 + let scaleSize = oldRat1 < 2 ? 2 / oldRat1 : 1 + let rat1 = oldRat1 * scaleSize + let rat2 = oldRat1 / window.remRatio + ddInstance.render.ratio = rat1 + ddInstance.render.tempCanvas = canvas; + //所选择区域的最大范围 + let outRect = DDeiAbstractShape.getOutRectByPV(models); + let lineOffset = models[0].render.getCachedValue("border.width"); + let addWidth = 0; + if (lineOffset) { + addWidth = lineOffset * rat1 + if (models.length > 1) { + addWidth = lineOffset * 2 + } + } + let editorId = DDeiUtil.getEditorId(ddInstance); + let containerDiv = document.getElementById(editorId+"_ddei_cut_img_div") + + canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + (1 / rat2) + ");display:block;zoom:" + (1 / rat2)); + let cW = outRect.width * oldRat1 + addWidth + let cH = outRect.height * oldRat1 + addWidth + canvas.setAttribute("width", cW) + canvas.setAttribute("height", cH) + ctx.scale(1 / scaleSize, 1 / scaleSize) + ctx.translate(-outRect.x * rat1 + addWidth / 2, -outRect.y * rat1 + addWidth / 2) + + containerDiv.appendChild(canvas) + + models[0].pModel.midList.forEach(mid=>{ + models.forEach(item => { + if (item.id == mid){ + item.render.clearCachedValue() + item.render.drawShape({}); + } + }) + }) + + + ddInstance.render.ratio = oldRat1 + let dataURL = canvas.toDataURL() + + containerDiv.removeChild(canvas) + + let blob = DDeiUtil.dataURLtoBlob(dataURL) + + + let cbData = navigator.clipboard; + //得到blob对象 + + let writeDatas = [new ClipboardItem({ [blob.type]: blob })] + cbData.write(writeDatas).then(function () { + + //清空临时canvas + ddInstance.render.tempCanvas = null; + editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { + parts: ["topmenu"], + }); + editor.bus.executeAll(); + editor.changeState(DDeiEditorState.DESIGNING); + }, function (e) { + //清空临时canvas + ddInstance.render.tempCanvas = null; + }); + } catch (e) { + console.error(e) + DDeiConfig.ALLOW_CLIPBOARD = false + } + + } + +} + + +export default DDeiKeyActionCopyImage diff --git a/plugins/core/hotkeys/actions/key-action-copy.ts b/plugins/core/hotkeys/actions/key-action-copy.ts new file mode 100644 index 0000000..e6ae388 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-copy.ts @@ -0,0 +1,177 @@ +import {DDeiConfig} from "ddei-framework"; +import {DDei} from "ddei-framework"; +import {DDeiAbstractShape} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; + +/** + * 键行为:复制 + * 复制当前的已选控件 + */ +class DDeiKeyActionCopy extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-copy" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCopy = new DDeiKeyActionCopy(); + + defaultOptions: object = { + 'keys': [ + { ctrl: 1, keys: "67", editorState: DDeiEditorState.DESIGNING }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCopy.defaultIns.name]) { + for (let i in options[DDeiKeyActionCopy.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCopy.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCopy(newOptions); + return panels; + } + } + return DDeiKeyActionCopy; + } + + + // ============================ 方法 =============================== + async action(evt: Event, ddInstance: DDei, editor: DDeiEditor): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + //当前激活的图层 + let selectedControls = ddInstance.stage.selectedModels; + //存在选中控件 + if (selectedControls?.size > 0) { + //按照midlist排序输出 + let models = Array.from(selectedControls.values()) + let sortedModels = [] + models[0].pModel.midList.forEach(mid => { + models.forEach(item => { + if (item.id == mid) { + sortedModels.push(item) + } + }) + }) + //生成控件HTML + let copyHtml = ''; + copyHtml += '' + let jsonStr = '[' + let jsonLinksStr = '[' + let innerHTML = '' + + sortedModels?.forEach((model, key) => { + if (selectedControls?.size == 1) { + if (model.baseModelType == "DDeiTable") { + if (model.curRow == -1 && model.curCol == -1) { + let json = model.toJSON(); + jsonStr += JSON.stringify(json) + "," + } + let html = model.render.getHTML(); + if (html) { + innerHTML += html + } + } else { + let json = model.toJSON(); + jsonStr += JSON.stringify(json) + "," + } + } else { + let json = model.toJSON(); + jsonStr += JSON.stringify(json) + "," + } + //如果控件为线段,则复制linkModels + if (model.baseModelType == "DDeiLine") { + let distModelLinks = ddInstance.stage?.getDistModelLinks(model.id) + //如果被复制的控件也在linkmodels里面,则需要复制linkModel信息 + distModelLinks?.forEach(link => { + if (selectedControls?.has(link?.sm?.id)) { + jsonLinksStr += JSON.stringify(link) + "," + } + }) + //需要进一步复制其linkModels + model.linkModels?.forEach(lineLM => { + if (lineLM.dm) { + if (!selectedControls.has(lineLM.dm.id)) { + //添加到复制的model中 + let json = lineLM.dm.toJSON(); + jsonStr += JSON.stringify(json) + "," + } + } + }); + } + }) + if (jsonStr.length > 1) { + + jsonStr = jsonStr.substring(0, jsonStr.length - 1) + jsonStr += ']' + ddInstance.stage.copyMode = "copy" + jsonStr = '{"mode":"copy","data":' + jsonStr + if (jsonLinksStr.length > 1) { + jsonLinksStr = jsonLinksStr.substring(0, jsonLinksStr.length - 1) + jsonLinksStr += ']' + jsonStr += " , \"links\":" + jsonLinksStr + } + jsonStr += "}" + + } else { + jsonStr = ""; + } + copyHtml += jsonStr + '' + copyHtml += '' + innerHTML + '' + let blob = new Blob([copyHtml], { + type: 'text/html' + }) + + //如果不支持剪切板,则采用window对象存储,此时不允许外部复制粘贴 + if (DDeiConfig.ALLOW_CLIPBOARD || DDeiConfig.ALLOW_CLIPBOARD == undefined) { + try { + let writeDatas = [] + writeDatas.push(new ClipboardItem({ "text/html": blob })); + + let cbData = navigator.clipboard; + cbData.write(writeDatas).then(function () { + editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { + parts: ["topmenu"], + }); + editor.bus.executeAll(); + editor.changeState(DDeiEditorState.DESIGNING); + }, function (e) { + console.error("复制失败" + e); + }); + } catch (e) { + DDeiConfig.ALLOW_CLIPBOARD = false + } + } + + if (!DDeiConfig.ALLOW_CLIPBOARD) { + window.DDEI_CLIPBOARD = blob + } + } + } + } + +} + + +export default DDeiKeyActionCopy diff --git a/plugins/core/hotkeys/actions/key-action-cut.ts b/plugins/core/hotkeys/actions/key-action-cut.ts new file mode 100644 index 0000000..3402694 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-cut.ts @@ -0,0 +1,165 @@ +import {DDeiConfig} from "ddei-framework"; +import {DDei} from "ddei-framework"; +import {DDeiAbstractShape} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; + +/** + * 键行为:剪切 + * 剪切当前的已选控件 + */ +class DDeiKeyActionCut extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-cut" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionCut = new DDeiKeyActionCut(); + + defaultOptions: object = { + 'keys': [ + { ctrl: 1, keys: "88", editorState: DDeiEditorState.DESIGNING }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionCut.defaultIns.name]) { + for (let i in options[DDeiKeyActionCut.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionCut.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionCut(newOptions); + return panels; + } + } + return DDeiKeyActionCut; + } + + // ============================ 方法 =============================== + async action(evt: Event, ddInstance: DDei, editor: DDeiEditor): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + //当前激活的图层 + let selectedControls = ddInstance.stage.selectedModels; + //存在选中控件 + if (selectedControls?.size > 0) { + //生成控件HTML + let copyHtml = ''; + copyHtml += '' + let jsonStr = '[' + let jsonLinksStr = '[' + let innerHTML = '' + selectedControls?.forEach((model, key) => { + if (selectedControls?.size == 1) { + if (model.baseModelType == "DDeiTable") { + if (model.curRow == -1 && model.curCol == -1) { + let json = model.toJSON(); + jsonStr += JSON.stringify(json) + "," + } + let html = model.render.getHTML(); + if (html) { + innerHTML += html + } + } else { + let json = model.toJSON(); + jsonStr += JSON.stringify(json) + "," + } + } else { + let json = model.toJSON(); + jsonStr += JSON.stringify(json) + "," + } + //如果控件为线段,则复制linkModels + if (model.baseModelType == "DDeiLine") { + let distModelLinks = ddInstance.stage?.getDistModelLinks(model.id) + //如果被复制的控件也在linkmodels里面,则需要复制linkModel信息 + distModelLinks?.forEach(link => { + if (selectedControls?.has(link?.sm?.id)) { + jsonLinksStr += JSON.stringify(link) + "," + } + }) + //需要进一步复制其linkModels + model.linkModels?.forEach(lineLM => { + if (lineLM.dm) { + if (!selectedControls.has(lineLM.dm.id)) { + //添加到复制的model中 + let json = lineLM.dm.toJSON(); + jsonStr += JSON.stringify(json) + "," + } + } + }); + } + }) + if (jsonStr.length > 1) { + + jsonStr = jsonStr.substring(0, jsonStr.length - 1) + jsonStr += ']' + ddInstance.stage.copyMode = "cut"; + jsonStr = '{"mode":"cut","data":' + jsonStr + if (jsonLinksStr.length > 1) { + jsonLinksStr = jsonLinksStr.substring(0, jsonLinksStr.length - 1) + jsonLinksStr += ']' + jsonStr += " , \"links\":" + jsonLinksStr + } + jsonStr += "}" + + } else { + jsonStr = ""; + } + copyHtml += jsonStr + '' + copyHtml += '' + innerHTML + '' + let blob = new Blob([copyHtml], { + type: 'text/html' + }) + + //如果不支持剪切板,则采用window对象存储,此时不允许外部复制粘贴 + if (DDeiConfig.ALLOW_CLIPBOARD || DDeiConfig.ALLOW_CLIPBOARD == undefined) { + try { + let writeDatas = [] + writeDatas.push(new ClipboardItem({ "text/html": blob })); + + let cbData = navigator.clipboard; + cbData.write(writeDatas).then(function () { + editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { + parts: ["topmenu"], + }); + editor.bus.executeAll(); + editor.changeState(DDeiEditorState.DESIGNING); + }, function (e) { + console.error("复制失败" + e); + }); + } catch (e) { + DDeiConfig.ALLOW_CLIPBOARD = false + } + } + + if (!DDeiConfig.ALLOW_CLIPBOARD) { + window.DDEI_CLIPBOARD = blob + } + } + } + } + +} + + +export default DDeiKeyActionCut diff --git a/plugins/core/hotkeys/actions/key-action-enter-quick-edit.ts b/plugins/core/hotkeys/actions/key-action-enter-quick-edit.ts new file mode 100644 index 0000000..8bd8613 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-enter-quick-edit.ts @@ -0,0 +1,64 @@ +import {DDei} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:确认快捷编辑 + * 确认快捷编辑 + */ +class DDeiKeyActionEnterQuickEdit extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-quickedit-enter" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionEnterQuickEdit = new DDeiKeyActionEnterQuickEdit(); + + defaultOptions: object = { + 'keys': [ + { keys: "13", shift: 1, editorState: DDeiEditorState.QUICK_EDITING }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionEnterQuickEdit.defaultIns.name]) { + for (let i in options[DDeiKeyActionEnterQuickEdit.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionEnterQuickEdit.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionEnterQuickEdit(newOptions); + return panels; + } + } + return DDeiKeyActionEnterQuickEdit; + } + + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + let editor = DDeiEditor.ACTIVE_INSTANCE; + editor.quickEditorInput?.enterValue(); + + } + +} + + +export default DDeiKeyActionEnterQuickEdit diff --git a/plugins/core/hotkeys/actions/key-action-move-models.ts b/plugins/core/hotkeys/actions/key-action-move-models.ts new file mode 100644 index 0000000..6dea5d0 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-move-models.ts @@ -0,0 +1,197 @@ +import {DDeiEditor} from "ddei-framework"; +import {DDei} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiAbstractShape} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:移动模型 + * 批量移动模型 + */ +class DDeiKeyActionMoveModels extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-move-models" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionMoveModels = new DDeiKeyActionMoveModels(); + + defaultOptions: object = { + 'keys': [ + //上 + { shift: 2, keys: "38", editorState: DDeiEditorState.DESIGNING }, + //下 + { shift: 2, keys: "40", editorState: DDeiEditorState.DESIGNING}, + //左 + { shift: 2, keys: "37", editorState: DDeiEditorState.DESIGNING}, + //右 + { shift: 2, keys: "39", editorState: DDeiEditorState.DESIGNING}, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionMoveModels.defaultIns.name]) { + for (let i in options[DDeiKeyActionMoveModels.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionMoveModels.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionMoveModels(newOptions); + return panels; + } + } + return DDeiKeyActionMoveModels; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei,editor:DDeiEditor): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let selectedModels = ddInstance.stage.selectedModels; + let models = Array.from(selectedModels.values()); + if (models.length == 1 && models[0].baseModelType == 'DDeiTable' && models[0].curRow != -1 && models[0].curCol != -1) { + + //上 + if (evt.keyCode == 38) { + if (models[0].curRow > 0) { + if (models[0].tempDragCell) { + models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT) + } + models[0].curRow--; + models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol] + models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED) + } + }//下 + else if (evt.keyCode == 40) { + if (models[0].curRow < models[0].rows.length - 1) { + if (models[0].tempDragCell) { + models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT) + } + models[0].curRow++; + models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol] + models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED) + } + }//左 + else if (evt.keyCode == 37) { + if (models[0].curCol > 0) { + if (models[0].tempDragCell) { + models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT) + } + models[0].curCol--; + models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol] + models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED) + } + }//右 + else if (evt.keyCode == 39) { + if (models[0].curCol < models[0].cols.length - 1) { + if (models[0].tempDragCell) { + models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT) + } + models[0].curCol++; + models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol] + models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED) + } + } + } else if (editor.GLOBAL_KEYBOARD_ALIGN_ENABLE){ + let moveSize = 1; + + let isShift = DDei.KEY_DOWN_STATE.get("shift"); + if (!isShift) { + + //辅助对齐线宽度 + moveSize = 10; + } + let moveOriginLines = [] + models.forEach(md => { + if (md.baseModelType == 'DDeiLine') { + moveOriginLines.push(md.id) + } + }); + let outRect = DDeiAbstractShape.getOutRectByPV(models); + let deltaX, deltaY + //上 + if (evt.keyCode == 38) { + let mod = 0; + //如果开启辅助对齐线,则跳回到对齐线上 + if (!isShift) { + if (outRect.y % moveSize > 0) { + mod = moveSize - (outRect.y % moveSize); + } + } + deltaY = - moveSize + mod + } + //下 + else if (evt.keyCode == 40) { + let mod = 0; + if (!isShift) { + mod = outRect.y % moveSize; + } + deltaY = moveSize - mod + } + //左 + else if (evt.keyCode == 37) { + let mod = 0; + //如果开启辅助对齐线,则跳回到对齐线上 + if (!isShift) { + if (outRect.x % moveSize > 0) { + mod = moveSize - (outRect.x % moveSize); + } + } + deltaX = - moveSize + mod + } + //右 + else if (evt.keyCode == 39) { + let mod = 0; + if (!isShift) { + mod = outRect.x % moveSize; + } + deltaX = moveSize - mod + } + let stage = ddInstance.stage + + DDeiAbstractShape.moveModels(models, deltaX, deltaY, moveOriginLines); + + stage.layers[stage.layerIndex].opPoints = [] + if (stage.layers[stage.layerIndex].opLine?.render) { + stage.layers[stage.layerIndex].opLine.render.enableRefreshShape() + } + delete stage.layers[stage.layerIndex].opLine; + stage.render.refreshJumpLine = false + ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); + ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + ddInstance.bus.push(DDeiEnumBusCommandType.ClearTemplateVars); + //渲染图形 + ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + + ddInstance.bus.executeAll(); + + + + } + + + } + } + +} + + +export default DDeiKeyActionMoveModels diff --git a/plugins/core/hotkeys/actions/key-action-paste.ts b/plugins/core/hotkeys/actions/key-action-paste.ts new file mode 100644 index 0000000..54a8423 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-paste.ts @@ -0,0 +1,1163 @@ +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import {DDeiStage} from "ddei-framework"; +import {DDeiConfig} from "ddei-framework"; +import {DDeiAbstractShape} from "ddei-framework"; +import {DDeiTable} from "ddei-framework"; +import { Matrix3 } from 'three'; +import {DDeiEnumOperateType} from "ddei-framework"; +import {DDeiPolygon} from "ddei-framework"; +import {DDeiLink} from "ddei-framework"; +import {DDeiLineLink} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +/** + * 键行为:粘贴 + * 粘贴剪切板内容 + */ +class DDeiKeyActionPaste extends DDeiKeyAction { + name: string = "ddei-core-keyaction-paste" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionPaste = new DDeiKeyActionPaste(); + + defaultOptions: object = { + 'keys': [ + { ctrl: 1, keys: "86", editorState: DDeiEditorState.DESIGNING}, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionPaste.defaultIns.name]) { + for (let i in options[DDeiKeyActionPaste.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionPaste.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionPaste(newOptions); + return panels; + } + } + return DDeiKeyActionPaste; + } + + + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let modeName = DDeiUtil.getConfigValue("MODE_NAME", ddInstance); + let accessCreate = DDeiUtil.isAccess( + DDeiEnumOperateType.CREATE, null, null, modeName, + ddInstance + ); + //校验权限 + if (accessCreate) { + this.doPaste(evt, ddInstance); + } + } + } + + /** + * 执行粘贴 + */ + async doPaste(evt: Event, ddInstance: DDei) { + + //剪切板中的数据 + let blobData = null; + let type = null; + if (DDeiConfig.ALLOW_CLIPBOARD || DDeiConfig.ALLOW_CLIPBOARD == undefined) { + try { + //读取剪切板数据 + let items = await navigator.clipboard.read(); + //优先级html>图片/文本 + items[0].types.forEach(t => { + if (!type) { + type = t; + } else if (t = 'text/html') { + type = t; + } + }); + //三种粘贴类型,文本、图片、HTML + blobData = await items[0].getType(type) + DDeiConfig.ALLOW_CLIPBOARD = true + } catch (e) { + DDeiConfig.ALLOW_CLIPBOARD = false + } + } + //如果不支持剪切板,则从window.DDEI_CLIPBOARD取得数据 + if (!DDeiConfig.ALLOW_CLIPBOARD) { + type = 'text/html' + blobData = window.DDEI_CLIPBOARD + } + if (blobData) { + switch (type) { + //剪切板中是文本 + case 'text/plain': { + let dataText = await new Response(blobData).text() + this.textPaste(evt, ddInstance.stage, dataText); + break; + } + //剪切板中是图片 + case 'image/png': { + this.imagePaste(evt, ddInstance.stage, blobData); + break; + } + //剪切板中是HTML + case 'text/html': { + let dataText = await new Response(blobData).text() + this.htmlPaste(evt, ddInstance.stage, dataText); + } + } + } + } + + + /** + * 粘贴图片 + */ + imagePaste(evt: Event, stage: DDeiStage, blobData: object) { + let that = this; + //将二进制转换为图片 + let reader = new FileReader(); + reader.onload = function (e) { + let image = new Image(); + image.onload = function () { + let imgBase64 = e.target.result + //当前激活的图层 + let layer = stage.layers[stage.layerIndex]; + //获取当前的鼠标落点 + let offsetX = DDeiUtil.offsetX; + let offsetY = DDeiUtil.offsetY; + //当前选中控件是否为1且有表格,且选中表格的单元格,则作为表格单元格的内容粘贴 + let createControl = true; + let hasChange = false; + if (stage.selectedModels?.size == 1) { + let table = Array.from(stage.selectedModels.values())[0] + if (table.baseModelType == 'DDeiTable') { + //粘贴到表格单元格 + let cells = table.getSelectedCells(); + if (cells.length > 0) { + cells.forEach(cell => { + cell.setImgBase64(imgBase64); + }) + hasChange = true; + createControl = false + } + } else { + if (!table.fill) { + table.fill = { type: 2 } + + } + table.fill.type = 2 + table.fill.image = imgBase64 + // table.setImgBase64(imgBase64); + hasChange = true; + createControl = false + } + } else if (stage.selectedModels?.size > 1) { + let isSimpleControl = true + stage.selectedModels?.forEach(item => { + if (isSimpleControl && (item.baseModelType == 'DDeiTable' || item.baseModelType == 'DDeiContainer')) { + isSimpleControl = false; + } + }) + //如果都是简单控件,则允许粘贴 + if (isSimpleControl) { + createControl = false; + stage.selectedModels?.forEach(item => { + if (!item.fill) { + item.fill = { type: 2 } + + } + item.fill.type = 2 + item.fill.image = imgBase64 + }) + hasChange = true; + } + } + + + + //如果没有粘贴到表格在最外层容器的鼠标位置,创建rectangle控件 + if (createControl) { + that.createNewImage(image, imgBase64, offsetX, offsetY, stage, layer, evt) + hasChange = true; + } + if (hasChange) { + stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + } + stage.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + stage.ddInstance.bus?.executeAll(); + } + image.src = e.target.result + } + reader.readAsDataURL(blobData); + } + + + + /** + * 粘贴文本 + */ + textPaste(evt: Event, stage: DDeiStage, textData: string) { + //当前激活的图层 + let layer = stage.layers[stage.layerIndex]; + //获取当前的鼠标落点 + let offsetX = DDeiUtil.offsetX; + let offsetY = DDeiUtil.offsetY; + //当前选中控件是否为1且有表格,且选中表格的单元格,则作为表格单元格的内容粘贴 + let createControl = true; + let hasChange = false; + if (stage.selectedModels?.size == 1) { + let table = Array.from(stage.selectedModels.values())[0] + if (table.baseModelType == 'DDeiTable') { + //粘贴到表格单元格 + let cells = table.getSelectedCells(); + if (cells.length > 0) { + cells.forEach(cell => { + cell.text = textData + }) + hasChange = true + createControl = false + } + } else if (table.baseModelType != 'DDeiContainer') { + table.text = textData + hasChange = true + createControl = false + } + } else if (stage.selectedModels?.size > 1) { + let isSimpleControl = true + stage.selectedModels?.forEach(item => { + if (isSimpleControl && (item.baseModelType == 'DDeiTable' || item.baseModelType == 'DDeiContainer')) { + isSimpleControl = false; + } + }) + //如果都是简单控件,则允许粘贴 + if (isSimpleControl) { + createControl = false; + stage.selectedModels?.forEach(item => { + item.text = textData + }) + hasChange = true; + } + + } + + //如果没有粘贴到表格在最外层容器的鼠标位置,创建rectangle控件 + if (createControl) { + stage.idIdx++ + hasChange = true; + + let searchPaths = [ + "font.size", + "font.family", + ]; + let configAtrs = DDeiUtil.getAttrValueByConfig( + { modelCode: "100002" }, + searchPaths + ); + let stageRatio = stage.getStageRatio() + //获取文本高度宽度 + let size = DDeiUtil.measureTextSize(stage.ddInstance, textData, configAtrs.get('font.family').data, configAtrs.get('font.size').data * stageRatio) + + + let dataJson = { + id: "rect_" + stage.idIdx, + modelCode: "100002", + + }; + + + let ccDefine = DDeiUtil.getControlDefine(dataJson) + //设置配置的属性值 + searchPaths.forEach((key) => { + if (configAtrs.get(key)) { + dataJson[key] = configAtrs.get(key).data; + } + if (ccDefine[key] != undefined && ccDefine[key] != null) { + dataJson[key] = ccDefine[key]; + } + }); + + for (let i in ccDefine?.define) { + dataJson[i] = ccDefine?.define[i]; + } + dataJson.text = textData; + dataJson.border = { type: 0 }; + dataJson.fill = { type: 0 } + dataJson.width = size.width; + dataJson.height = size.height; + //如果有from则根据from读取属性 + delete dataJson.ovs + delete dataJson.font + + let model: DDeiAbstractShape = DDeiPolygon.initByJSON( + dataJson, + { currentStage: stage } + ); + + model.initPVS() + + let moveMatrix = new Matrix3( + 1, 0, offsetX, + 0, 1, offsetY, + 0, 0, 1 + ) + + model.transVectors(moveMatrix) + stage.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: layer, models: [model] }, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); + stage.ddInstance.bus?.push(DDeiEnumBusCommandType.ModelChangeSelect, { models: [model], value: DDeiEnumControlState.SELECTED }, evt); + } + if (hasChange) { + stage.ddInstance.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels, {}, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds, {}, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + } + + stage.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + stage.ddInstance.bus?.executeAll(); + + } + + + /** + * 粘贴HTML + */ + htmlPaste(evt: Event, stage: DDeiStage, textData: string) { + //当前激活的图层 + let layer = stage.layers[stage.layerIndex]; + //获取当前的鼠标落点 + let offsetX = DDeiUtil.offsetX; + let offsetY = DDeiUtil.offsetY; + //识别粘贴的内容来自于外部还是内部 + let ddeiJson = null; + + try { + let searchText = ''; + if (textData.indexOf(searchText) != -1) { + let startIndex = textData.indexOf(searchText) + searchText.length; + let endIndex = textData.indexOf('') + let ddeiJsonStr = textData.substring(startIndex, endIndex); + if (ddeiJsonStr) { + ddeiJson = JSON.parse(ddeiJsonStr); + } + } + } catch (e) { + console.error(e) + } + //内部复制 + let hasChange = false; + if (ddeiJson) { + //对内部复制的对象进行反序列化处理 + let mode = ddeiJson.mode + let jsonArray = ddeiJson.data + let jsonLinkArray = ddeiJson.links + if (!Array.isArray(jsonArray)) { + jsonArray = [jsonArray] + } + //当前选中控件是否为1且有表格,且选中表格的单元格,则作为表格单元格的内容粘贴 + let createControl = true; + if (stage.selectedModels?.size == 1) { + let model = Array.from(stage.selectedModels.values())[0] + if (model.baseModelType == 'DDeiTable') { + //添加控件到表格单元格 + let cells = model.getSelectedCells(); + if (cells.length > 0) { + cells.forEach(cell => { + this.createControl(jsonArray, jsonLinkArray, offsetX, offsetY, stage, cell, mode, evt) + }) + hasChange = true; + createControl = false + } + } + //添加到容器 + else if (model.baseModelType == 'DDeiContainer') { + this.createControl(jsonArray, jsonLinkArray, offsetX, offsetY, stage, model, mode, evt) + createControl = false + hasChange = true; + } + } + //如果没有粘贴到表格在最外层容器的鼠标位置,反序列化控件,重新设置ID,其他信息保留 + if (createControl) { + this.createControl(jsonArray, jsonLinkArray, offsetX, offsetY, stage, layer, mode, evt) + hasChange = true; + } + if (hasChange) { + stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.UpdatePaperArea); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels, {}, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds, {}, evt); + // stage.ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts); + } + stage.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + stage.ddInstance.bus?.executeAll(); + } + //外部复制 + else { + //只考虑从excel粘贴的情况,识别为一个table + let tableJson = this.parseDomToJson(textData); + let createControl = true; + if (stage.selectedModels?.size == 1) { + let model = Array.from(stage.selectedModels.values())[0] + if (model.baseModelType == 'DDeiTable') { + //复制表格内容到表格 + this.copyTableToTableCell(model, tableJson); + createControl = false + hasChange = true; + } + //添加表格到容器 + else if (model.baseModelType == 'DDeiContainer') { + this.createTable(tableJson, offsetX, offsetY, stage, model, evt) + createControl = false + hasChange = true; + } + } + //如果没有粘贴到表格在最外层容器的鼠标位置,反序列化控件,重新设置ID,其他信息保留 + if (createControl) { + this.createTable(tableJson, offsetX, offsetY, stage, layer, evt) + hasChange = true; + } + if (hasChange) { + stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + } + stage.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + stage.ddInstance.bus?.executeAll(); + } + } + + /** + * 复制表格内容到另外一个表格的单元格中 + * @param table 表格 + * @param tableJson 表格单元格 + */ + copyTableToTableCell(table: DDeiTable, tableJson: object): void { + //取得当前表格的当前选中单元格 + let distCells = table.getSelectedCells(); + //校验目标区域和当前源区域是否能够满足粘贴条件 + if (distCells && distCells.length > 0 && tableJson) { + let sourceTable = tableJson; + let distTable = table; + let sourceMinMaxRow = { minRow: 0, minCol: 0, maxRow: sourceTable.rows.length - 1, maxCol: sourceTable.rows[0].length - 1 } + //校验1:目标是否为一个连续的选中区域 + let distMinMaxRow = distTable.getMinMaxRowAndCol(distCells); + let distAreaAllSelected = distTable.isAllSelected(distMinMaxRow.minRow, distMinMaxRow.minCol, distMinMaxRow.maxRow, distMinMaxRow.maxCol); + + if (!distAreaAllSelected) { + console.log("表格粘贴目标不是一个有效的连续区域"); + return; + } + //计算粘贴后的区域大小 + let rowNum = 1; + let colNum = 1; + let sourceRowNum = sourceMinMaxRow.maxRow - sourceMinMaxRow.minRow + 1; + let distRowNum = distMinMaxRow.maxRow - distMinMaxRow.minRow + 1; + let sourceColNum = sourceMinMaxRow.maxCol - sourceMinMaxRow.minCol + 1; + let distColNum = distMinMaxRow.maxCol - distMinMaxRow.minCol + 1; + //如果目标区域的行数/列数=1,则粘贴后的目标行数=源行数/列数=源列数,如果不是,则取得能够整除的区域 + if (distRowNum == sourceRowNum) { + rowNum = sourceRowNum; + } else if (distRowNum > sourceRowNum) { + rowNum = distRowNum - (distRowNum % sourceRowNum); + } else if (distRowNum < sourceRowNum) { + rowNum = sourceRowNum; + } + if (distColNum == sourceColNum) { + colNum = sourceColNum; + } else if (distColNum > sourceColNum) { + colNum = distColNum - (distColNum % sourceColNum); + } else if (distColNum < sourceColNum) { + colNum = sourceColNum; + } + + //校验2:粘贴区域内存在合并单元格 + if (distTable.hasMergeCell(distMinMaxRow.minRow, distMinMaxRow.minCol, distMinMaxRow.minRow + rowNum - 1, distMinMaxRow.minCol + colNum - 1)) { + console.log("表格粘贴区域存在合并单元格"); + return; + } + + //校验3:粘贴后超出表格所在最大区域 + if (distTable.rows.length <= distMinMaxRow.minRow + rowNum - 1 || distTable.cols.length <= distMinMaxRow.minCol + colNum - 1) { + console.log("表格粘贴区域超出表格所在最大区域"); + return; + } + //执行复制 + let mergeCells = []; + for (let i = 0; i < rowNum && distMinMaxRow.minRow + i < distTable.rows.length; i++) { + let offsetI = i % sourceRowNum; + for (let j = 0; j < colNum && distMinMaxRow.minCol + j < distTable.cols.length; j++) { + //获取要复制的单元格 + let offsetJ = j % sourceColNum; + let sourceCell = sourceTable.rows[sourceMinMaxRow.minRow + offsetI][sourceMinMaxRow.minCol + offsetJ]; + //取得目标单元格 + let targetCell = distTable.rows[distMinMaxRow.minRow + i][distMinMaxRow.minCol + j]; + //文本 + targetCell.text = sourceCell.text; + //样式 + targetCell.textStyle = sourceCell.textStyle; + targetCell.font = sourceCell.font + targetCell.border = sourceCell.border; + //记录合并单元格 + if (sourceCell.mergeRowNum > 1 || sourceCell.mergeColNum > 1) { + targetCell.mergeRowNum = sourceCell.mergeRowNum; + targetCell.mergeColNum = sourceCell.mergeColNum; + mergeCells[mergeCells.length] = targetCell; + } + targetCell.render?.renderCacheData?.clear(); + } + } + //执行合并单元格 + for (let i = 0; i < mergeCells.length; i++) { + let mc = mergeCells[i]; + //合并单元格 + let cells = distTable.getCellsByRect(mc.row, mc.col, mc.row + mc.mergeRowNum - 1, mc.col + mc.mergeColNum - 1); + distTable.mergeCells(cells); + } + } + } + + /** + * 解析dom文本到json + * @param textData 文本 + * @returns json + */ + parseDomToJson(textData): string { + let tableJson = { rows: [], modelCode: "100301" } + let parser = new DOMParser(); + let doc = parser.parseFromString(textData, "text/html"); + //解析table,获取基本的行列定义 + if (doc) { + let tableEle = doc.body.children[0]; + let tableHeight = 0; + tableJson.id = 'copytable' + let tableWidth = 0; + //解析行列 + let eleRows = tableEle.rows; + //合并区域的定义 + let mergeAreas = [] + let colSize = {} + let rowSize = {} + for (let i = 0; i < eleRows.length; i++) { + let eleCells = eleRows[i].cells; + if (!tableJson.rows[i]) { + tableJson.rows[i] = [] + } + let rowJson = tableJson.rows[i] + for (let j = 0; j < eleCells.length; j++) { + let cellEle = eleCells[j] + //获取样式以及合并单元格信息 + //合并单元格信息 + let cellJson = { modelCode: '100302', row: i, col: j, text: cellEle.innerText, domRow: i, domCol: j } + rowJson.push(cellJson) + + + if (cellEle.rowSpan > 1) { + cellJson.mergeRowNum = parseInt(cellEle.rowSpan) + } + if (cellEle.colSpan > 1) { + cellJson.mergeColNum = parseInt(cellEle.colSpan) + } + + //记录合并单元格区域 + if (cellJson.mergeRowNum > 1 || cellJson.mergeColNum > 1) { + if (!cellJson.mergeRowNum) { + cellJson.mergeRowNum = 1; + } + if (!cellJson.mergeColNum) { + cellJson.mergeColNum = 1; + } + mergeAreas.push(cellJson); + } + + //字体样式信息 + cellJson.font = {} + if (cellEle.style.fontSize) { + cellJson.font.size = parseFloat(cellEle.style.fontSize) + } + if (cellEle.style.color) { + cellJson.font.color = DDeiUtil.getColor(cellEle.style.color) + } + if (cellEle.style.fontFamily) { + cellJson.font.family = cellEle.style.fontFamily + } + cellJson.border = {} + cellJson.border.top = {} + cellJson.border.bottom = {} + cellJson.border.left = {} + cellJson.border.right = {} + if (cellEle.style.borderTopColor) { + cellJson.border.top.color = cellEle.style.borderTopColor + if (cellJson.border.top.color == 'initial') { + delete cellJson.border.top.color + } + } + if (cellEle.style.borderTopWidth) { + cellJson.border.top.width = parseFloat(cellEle.style.borderTopWidth) + if (isNaN(cellJson.border.top.width) || cellJson.border.top.width == 'initial') { + delete cellJson.border.top.width + } + } + if (cellEle.style.borderTopStyle) { + cellJson.border.top.style = cellEle.style.borderTopStyle + } + + + + if (cellEle.style.borderBottomColor) { + cellJson.border.bottom.color = cellEle.style.borderBottomColor + if (cellJson.border.bottom.color == 'initial') { + delete cellJson.border.bottom.color; + } + } + if (cellEle.style.borderBottomWidth) { + cellJson.border.bottom.width = parseFloat(cellEle.style.borderBottomWidth) + if (isNaN(cellJson.border.bottom.width) || cellJson.border.bottom.width == 'initial') { + delete cellJson.border.bottom.width + } + } + if (cellEle.style.borderBottomStyle) { + cellJson.border.bottom.style = cellEle.style.borderBottomStyle + } + + + if (cellEle.style.borderLeftColor) { + cellJson.border.left.color = cellEle.style.borderLeftColor + if (cellJson.border.left.color == 'initial') { + delete cellJson.border.left.color + } + } + if (cellEle.style.borderLeftWidth) { + cellJson.border.left.width = parseFloat(cellEle.style.borderLeftWidth) + if (isNaN(cellJson.border.left.width) || cellJson.border.left.width == 'initial') { + delete cellJson.border.left.width + } + } + if (cellEle.style.borderLeftStyle) { + cellJson.border.left.style = cellEle.style.borderLeftStyle + } + + if (cellEle.style.borderRightColor) { + cellJson.border.right.color = cellEle.style.borderRightColor + if (cellJson.border.right.color == 'initial') { + delete cellJson.border.right.color + } + } + if (cellEle.style.borderRightWidth) { + cellJson.border.right.width = parseFloat(cellEle.style.borderRightWidth) + if (isNaN(cellJson.border.right.width) || cellJson.border.right.width == 'initial') { + delete cellJson.border.right.width + } + } + if (cellEle.style.borderRightStyle) { + cellJson.border.right.style = cellEle.style.borderRightStyle + } + + //填充信息 + cellJson.fill = {}; + if (cellEle.style.backgroundColor) { + cellJson.fill.color = cellEle.style.backgroundColor + } + //对齐 + cellJson.textStyle = {} + if (cellEle.style.textAlign) { + if (cellEle.style.textAlign == "left") { + cellJson.textStyle.align = 1 + } else if (cellEle.style.textAlign == "center") { + cellJson.textStyle.align = 2 + } else if (cellEle.style.textAlign == "right") { + cellJson.textStyle.align = 3 + } + } + if (cellEle.style.verticalAlign) { + if (cellEle.style.verticalAlign == "top") { + cellJson.textStyle.valign = 1 + } else if (cellEle.style.verticalAlign == "middle") { + cellJson.textStyle.valign = 2 + } else if (cellEle.style.verticalAlign == "bottom") { + cellJson.textStyle.valign = 3 + } + } + if (cellEle.style.textDecoration == "underline") { + cellJson.textStyle.underline = "1" + } + if (cellEle.style.textDecoration == "line-through") { + cellJson.textStyle.deleteline = "1" + } + if (cellEle.style.whiteSpace == "nowrap") { + cellJson.textStyle.feed = "0" + } else { + cellJson.textStyle.feed = "1" + } + + if (cellEle.style.fontStyle == "italic") { + cellJson.textStyle.italic = "1" + } + if (cellEle.style.fontWeight) { + if (cellEle.style.fontWeight == 'bold') { + cellJson.textStyle.bold = "1" + } + else if (parseInt(cellEle.style.fontWeight) > 400) + cellJson.textStyle.bold = "1" + } + } + } + //处理合并单元格区域 + mergeAreas.forEach(mergeCell => { + //向右下方扩展表格区域 + for (let i = 1; i <= mergeCell.mergeRowNum; i++) { + for (let j = 1; j <= mergeCell.mergeColNum; j++) { + //自身单元格不用扩展 + if (!(i == 1 && j == 1)) { + tableJson.rows[mergeCell.row + i - 1].splice(mergeCell.col + j - 1, 0, { width: 0, height: 0, modelCode: '100302', mCell: mergeCell }); + //重新设置关系 + for (let k = 0; k < tableJson.rows.length; k++) { + let rowObj = tableJson.rows[k]; + for (let l = 0; l < rowObj.length; l++) { + rowObj[l].row = k; + rowObj[l].col = l; + } + } + } + } + } + }); + + //计算每一行列的大小以及合并单元格的大小 + for (let k = 0; k < tableJson.rows.length; k++) { + let rowObj = tableJson.rows[k]; + for (let l = 0; l < rowObj.length; l++) { + if ((rowObj[l].domRow || rowObj[l].domRow == 0) + && (!rowObj[l].mergeRowNum || rowObj[l].mergeRowNum <= 1) && (!rowObj[l].mergeColNum <= 1 || rowObj[l].mergeColNum <= 1)) { + let rowHeight = null; + let domRowEle = tableEle.rows[rowObj[l].domRow]; + let domCellEle = tableEle.rows[rowObj[l].domRow].cells[rowObj[l].domCol]; + if (!rowSize["" + k]) { + if (domRowEle.style.height) { + rowHeight = parseFloat(domRowEle.style.height); + } else { + rowHeight = parseFloat(domRowEle.getAttribute("height")); + } + if (!isNaN(rowHeight)) { + rowSize["" + k] = rowHeight; + } + } + let colWidth = null; + if (!colSize["" + l]) { + if (domCellEle.style.width) { + colWidth = parseFloat(domCellEle.style.width); + } else { + colWidth = parseFloat(domCellEle.getAttribute("width")); + } + if (!isNaN(colWidth)) { + colSize["" + l] = colWidth; + } + } + } + } + } + //补全行列大小 + for (let k = 0; k < tableJson.rows.length; k++) { + //可能存在合并单元格, + if (!rowSize[k]) { + //寻找非合并单元格,填充大小,如果找不到则用合并单元格大小的平均数 + let mCell = null; + let rowObj = tableJson.rows[k]; + for (let l = 0; l < rowObj.length; l++) { + if (rowObj[l].domRow || rowObj[l].domRow == 0) { + let domCellEle = tableEle.rows[rowObj[l].domRow].cells[rowObj[l].domCol]; + if (rowObj[l].mergeRowNum > 1 || rowObj[l].mergeColNum > 1) { + mCell = rowObj[l]; + } else if (!mCell && rowObj[l].mCell) { + mCell = rowObj[l].mCell; + } else if (!rowObj[l].mCell) { + let rowHeight = 0; + if (domCellEle.style.height) { + rowHeight = parseFloat(domCellEle.style.height); + } else { + rowHeight = parseFloat(domCellEle.getAttribute("height")); + } + if (!isNaN(rowHeight)) { + rowSize["" + k] = rowHeight; + } + break; + } + } + } + if (!rowSize[k] && mCell) { + let domCellEle = tableEle.rows[mCell.domRow].cells[mCell.domCol]; + let rowHeight = 0; + if (domCellEle.style.height) { + rowHeight = parseFloat(domCellEle.style.height); + } else { + rowHeight = parseFloat(domCellEle.getAttribute("height")); + } + if (!isNaN(rowHeight)) { + rowSize[k] = rowHeight / mCell.mergeRowNum + } + } + } + } + for (let l = 0; l < tableJson.rows[0].length; l++) { + //可能存在合并单元格, + if (!colSize[l]) { + //寻找非合并单元格,填充大小,如果找不到则用合并单元格大小的平均数 + let mCell = null; + + for (let k = 0; k < tableJson.rows.length; k++) { + if (tableJson.rows[k][l].domRow || tableJson.rows[k][l].domRow == 0) { + let domCellEle = tableEle.rows[tableJson.rows[k][l].domRow].cells[tableJson.rows[k][l].domCol]; + if (tableJson.rows[k][l].mergeRowNum > 1 || tableJson.rows[k][l].mergeColNum > 1) { + mCell = tableJson.rows[k][l]; + } else if (!mCell && tableJson.rows[k][l].mCell) { + mCell = tableJson.rows[k][l].mCell; + } else if (!tableJson.rows[k][l].mCell) { + let colWidth = 0; + if (domCellEle.style.width) { + colWidth = parseFloat(domCellEle.style.width); + } else { + colWidth = parseFloat(domCellEle.getAttribute("width")); + } + if (!isNaN(colWidth)) { + colSize["" + l] = colWidth; + } + break; + } + } + } + if (!colSize[l] && mCell) { + let domCellEle = tableEle.rows[mCell.domRow].cells[mCell.domCol]; + let colWidth = 0; + if (domCellEle.style.width) { + colWidth = parseFloat(domCellEle.style.width); + } else { + colWidth = parseFloat(domCellEle.getAttribute("width")); + } + if (!isNaN(colWidth)) { + colSize[l] = colWidth / mCell.mergeColNum + } + } + } + } + //写入单元格大小 + for (let k = 0; k < tableJson.rows.length; k++) { + let rowObj = tableJson.rows[k]; + for (let l = 0; l < rowObj.length; l++) { + if (k == 0) { + if (isNaN(colSize["" + l])) { + colSize["" + l] = 40 + } + tableWidth += colSize["" + l]; + } + if (l == 0) { + if (isNaN(rowSize["" + k])) { + rowSize["" + k] = 20 + } + tableHeight += rowSize["" + k]; + } + + //如果是合并单元格 + if (rowObj[l].mergeRowNum > 1 || rowObj[l].mergeColNum > 1) { + //计算高度和宽度 + let mHeight = 0 + let mWidth = 0 + for (let ki = 1; ki <= rowObj[l].mergeRowNum; ki++) { + if (isNaN(rowSize["" + (k + ki - 1)])) { + rowSize["" + (k + ki - 1)] = 20 + } + mHeight += rowSize["" + (k + ki - 1)]; + } + for (let ki = 1; ki <= rowObj[l].mergeColNum; ki++) { + if (isNaN(colSize["" + (l + ki - 1)])) { + colSize["" + (l + ki - 1)] = 40 + } + mWidth += colSize["" + (l + ki - 1)]; + } + rowObj[l].height = mHeight; + rowObj[l].width = mWidth; + rowObj[l].originWidth = colSize["" + l]; + rowObj[l].originHeight = rowSize["" + k]; + delete rowObj[l].domRow + delete rowObj[l].domCol + } + //如果不是合并单元格但是属于合并单元格区域,则属于被合并单元格 + else if (rowObj[l].mCell) { + rowObj[l].originWidth = colSize["" + l]; + rowObj[l].originHeight = rowSize["" + k]; + delete rowObj[l].mCell + delete rowObj[l].domRow + delete rowObj[l].domCol + } + //普通单元格 + else { + rowObj[l].width = colSize["" + l]; + rowObj[l].height = rowSize["" + k]; + delete rowObj[l].domRow + delete rowObj[l].domCol + } + } + } + tableJson.height = tableHeight + tableJson.width = tableWidth + return tableJson + } + } + + //创建新的表格 + createTable(tableJson: object, x: number, y: number, stage: DDeiStage, container: object, evt: Event): void { + //当前激活的图层 + let layer = stage.layers[stage.layerIndex]; + let tableModel = DDeiTable.loadFromJSON(tableJson, { currentDdInstance: stage.ddInstance, currentStage: stage, currentLayer: layer, currentContainer: container }); + stage.idIdx++ + let newId = "table_" + stage.idIdx; + tableModel.id = newId + tableModel.x = x - tableModel.width / 2; + tableModel.y = y - tableModel.height / 2; + tableModel.resetCellData(); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: container, models: [tableModel] }, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeSelect, { models: [tableModel], value: DDeiEnumControlState.SELECTED }, evt); + } + + + //创建新的控件 + createControl(jsonArray: [], jsonLinkArray: [], x: number, y: number, stage: DDeiStage, container: object, mode: string, evt: Event): void { + //当前激活的图层 + let layer = stage.layers[stage.layerIndex]; + let models: DDeiAbstractShape[] = [] + jsonArray.forEach(json => { + if (mode == 'copy') { + let copyModel = stage.ddInstance.controlModelClasses[json.modelType].loadFromJSON(json, { currentDdInstance: stage.ddInstance, currentStage: stage, currentLayer: layer, currentContainer: container }); + + models.push(copyModel); + + } else if (mode == 'cut') { + let model = stage.getModelById(json.id); + models.push(model); + } + }); + //加载事件的配置 + let rsState = -1 + if(mode == 'copy'){ + rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_BEFORE", DDeiEnumOperateType.CREATE, { models: models }, stage.ddInstance) + } else if (mode == 'cut') { + rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_DRAG_BEFORE", DDeiEnumOperateType.DRAG, { models: models }, stage.ddInstance) + } + //选中前 + if (rsState != -1) { + //重新计算坐标,基于粘贴的中心点 + let outRect = DDeiAbstractShape.getOutRectByPV(models); + + outRect = { x: outRect.x + outRect.width / 2, y: outRect.y + outRect.height / 2 } + let oldIdMap = {} + models.forEach(item => { + let oldModelId = item.id + if (mode == 'copy') { + this.changeModelId(stage, item) + } + oldIdMap[oldModelId] = item + let cpx = item.cpv.x; + let cpy = item.cpv.y; + let dx = outRect.x - cpx; + let dy = outRect.y - cpy; + let moveMatrix = new Matrix3( + 1, 0, x - dx - cpx, + 0, 1, y - dy - cpy, + 0, 0, 1 + ) + item.transVectors(moveMatrix) + + }) + //处理links信息,构建新的link信息 + if (mode == 'copy') { + let appendExPvs = {} + jsonLinkArray?.forEach(lk => { + let sm = null; + let dm = null; + if (lk.smid) { + sm = oldIdMap[lk.smid] + } + if (lk.dmid) { + dm = oldIdMap[lk.dmid] + } + //重命名关联的smpath以及点 + if (lk.smpath) { + let sourcePV = DDeiUtil.getDataByPathList(sm, lk.smpath) + let newId = "_" + DDeiUtil.getUniqueCode() + sourcePV.id = newId + if (!appendExPvs[sm.id]) { + appendExPvs[sm.id] = {} + } + appendExPvs[sm.id][newId] = sourcePV + lk.smpath = "exPvs." + newId + } + let link = new DDeiLink({ + group: lk.group, + smpath: lk.smpath, + dmpath: lk.dmpath, + stage: stage, + sm: sm, + dm: dm + }); + stage.links.push(link); + }) + models.forEach(item => { + item.exPvs = {} + if (appendExPvs[item.id]) { + item.exPvs = appendExPvs[item.id] + } + //处理linkmodels + if (item.baseModelType == 'DDeiLine') { + let linkModels: Map = new Map(); + for (let key in item.linkModels) { + let lkItem = item.linkModels[key]; + if (lkItem?.dmid) { + let dm = oldIdMap[lkItem.dmid] + lkItem.dm = dm + lkItem.line = item; + let lm = new DDeiLineLink(lkItem); + linkModels.set(dm.id, lm) + } + } + item.linkModels = linkModels + } + }) + + + stage.refreshLinkCache() + } + + stage.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: container, models: models }, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeSelect, { models: models, value: DDeiEnumControlState.SELECTED }, evt); + if (mode == 'copy') { + stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyControlCreated, { + models: models, + }); + } else if (mode == 'cut') { + DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_DRAG_AFTER", DDeiEnumOperateType.DRAG, { models: models }, stage.ddInstance, evt) + } + } + } + + /** + * 修改模型ID + * @param stage 舞台 + * @param item 控件 + * @return 新的ID + */ + changeModelId(stage: DDeiStage, item: DDeiAbstractShape): string { + stage.idIdx++ + let newId = "" + if (item.id.indexOf("_") != -1) { + newId = item.id.substring(0, item.id.lastIndexOf("_")) + "_" + stage.idIdx; + } else { + newId = item.id + "_cp_" + stage.idIdx; + } + item.id = newId + item.unicode = DDeiUtil.getUniqueCode() + let accuContainer = item.getAccuContainer() + if (accuContainer?.baseModelType == 'DDeiContainer') { + let midList: string = [] + let models: Map = new Map(); + accuContainer.midList.forEach(mid => { + let model = accuContainer.models.get(mid); + let modelNewId = this.changeModelId(stage, model) + models.set(modelNewId, model) + midList.push(modelNewId) + }) + accuContainer.models = models + accuContainer.midList = midList + } else if (accuContainer?.baseModelType == 'DDeiTable') { + for (let i = 0; i < accuContainer.rows; i++) { + let rowObj = accuContainer.rows[i]; + for (let j = 0; j < rowObj.length; j++) { + let accuContainer = rowObj[j].getAccuContainer() + let midList: string[] = [] + let models: Map = new Map(); + accuContainer.midList.forEach(mid => { + let model = accuContainer.models.get(mid); + let modelNewId = this.changeModelId(stage, model) + models.set(modelNewId, model) + midList.push(modelNewId) + }) + accuContainer.models = models + accuContainer.midList = midList + } + } + } + return newId; + } + + //创建新的图片控件 + createNewImage(image: Image, imgBase64: string, x: number, y: number, stage: DDeiStage, container: object, evt: Event): void { + stage.idIdx++ + let rat1 = stage.ddInstance.render.ratio; + let stageRatio = stage.getStageRatio() + + let dataJson = { + id: "img_" + stage.idIdx, + modelCode: "100002" + }; + + + let ccDefine = DDeiUtil.getControlDefine(dataJson) + for (let i in ccDefine?.define) { + dataJson[i] = ccDefine?.define[i]; + } + dataJson.text = ""; + dataJson.border = { type: 0 }; + dataJson.fill = { type: 2 }; + dataJson.fill.image = imgBase64 + dataJson.width = image.width / rat1 / stageRatio; + dataJson.height = image.height / rat1 / stageRatio; + //如果有from则根据from读取属性 + delete dataJson.ovs + + let model: DDeiAbstractShape = DDeiPolygon.initByJSON( + dataJson, + { currentStage: stage } + ); + + model.initPVS() + + let moveMatrix = new Matrix3( + 1, 0, x, + 0, 1, y, + 0, 0, 1 + ) + + model.transVectors(moveMatrix) + // model.setImgBase64(imgBase64); + + stage.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeContainer, { newContainer: container, models: [model] }, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.ModelChangeSelect, { models: [model], value: DDeiEnumControlState.SELECTED }, evt); + stage.ddInstance.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); + } +} + +export default DDeiKeyActionPaste diff --git a/plugins/core/hotkeys/actions/key-action-push-models.ts b/plugins/core/hotkeys/actions/key-action-push-models.ts new file mode 100644 index 0000000..0e9fd88 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-push-models.ts @@ -0,0 +1,104 @@ +import {DDei} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiConfig} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:图形移动到上层或下层、顶层或底层 + * 将已选图形移动到当前图层的上层或下层、顶层或底层 + */ +class DDeiKeyActionPushModels extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-push-models" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionPushModels = new DDeiKeyActionPushModels(); + + defaultOptions: object = { + 'keys': [ + //置于上层 + { ctrl: 1, keys: "38", editorState: DDeiEditorState.DESIGNING }, + //置于下层 + { ctrl: 1, keys: "40", editorState: DDeiEditorState.DESIGNING }, + //置于顶层 + { ctrl: 1, shift: 1, keys: "38", editorState: DDeiEditorState.DESIGNING}, + //置于底层 + { ctrl: 1, shift: 1, keys: "40", editorState: DDeiEditorState.DESIGNING}, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionPushModels.defaultIns.name]) { + for (let i in options[DDeiKeyActionPushModels.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionPushModels.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionPushModels(newOptions); + return panels; + } + } + return DDeiKeyActionPushModels; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let stageRender = ddInstance.stage.render; + let optContainer = stageRender.currentOperateContainer; + if (optContainer) { + let isCtrl = DDei.KEY_DOWN_STATE.get("ctrl"); + let isShift = DDei.KEY_DOWN_STATE.get("shift"); + //同时按下ctrl和shift + if (isCtrl && isShift) { + //上 + if (evt.keyCode == 38) { + ddInstance.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: "top" }, evt); + } + //下 + else if (evt.keyCode == 40) { + ddInstance.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: "bottom" }, evt); + } + } + //只按下了ctrl + else if (isCtrl) { + //上 + if (evt.keyCode == 38) { + ddInstance.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: "up" }, evt); + } + //下 + else if (evt.keyCode == 40) { + ddInstance.bus.push(DDeiEnumBusCommandType.ModelPush, { container: optContainer, type: "down" }, evt); + } + } + } + //渲染图形 + ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + + ddInstance.bus.executeAll(); + } + } + +} + + +export default DDeiKeyActionPushModels diff --git a/plugins/core/hotkeys/actions/key-action-quick-editor-newrow.ts b/plugins/core/hotkeys/actions/key-action-quick-editor-newrow.ts new file mode 100644 index 0000000..c7acfce --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-quick-editor-newrow.ts @@ -0,0 +1,55 @@ +import {DDei} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; + +/** + * 键行为:新行 + * 确认快捷编辑 + */ +class DDeiKeyActionNewRowQuickEdit extends DDeiKeyAction { + name: string = "ddei-core-keyaction-quickedit-newrow" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionNewRowQuickEdit = new DDeiKeyActionNewRowQuickEdit(); + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionNewRowQuickEdit.defaultIns.name]) { + for (let i in options[DDeiKeyActionNewRowQuickEdit.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionNewRowQuickEdit.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionNewRowQuickEdit(newOptions); + return panels; + } + } + return DDeiKeyActionNewRowQuickEdit; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + let editor = DDeiEditor.ACTIVE_INSTANCE; + editor.quickEditorInput.value += '\n' + editor.quickEditorInput.selectionEnd = editor.quickEditorInput.value.length + } + +} + + +export default DDeiKeyActionNewRowQuickEdit diff --git a/plugins/core/hotkeys/actions/key-action-remove-models.ts b/plugins/core/hotkeys/actions/key-action-remove-models.ts new file mode 100644 index 0000000..64fa90b --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-remove-models.ts @@ -0,0 +1,98 @@ +import {DDeiConfig} from "ddei-framework"; +import {DDei} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import {DDeiEnumOperateType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +/** + * 键行为:删除模型 + * 删除模型 + */ +class DDeiKeyActionRemoveModels extends DDeiKeyAction { + name: string = "ddei-core-keyaction-remove-models" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionRemoveModels = new DDeiKeyActionRemoveModels(); + + defaultOptions: object = { + 'keys': [ + { keys: "8", editorState: DDeiEditorState.DESIGNING}, + { keys: "46", editorState: DDeiEditorState.DESIGNING}, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionRemoveModels.defaultIns.name]) { + for (let i in options[DDeiKeyActionRemoveModels.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionRemoveModels.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionRemoveModels(newOptions); + return panels; + } + } + return DDeiKeyActionRemoveModels; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let stageRender = ddInstance.stage.render; + let optContainer = stageRender.currentOperateContainer; + if (optContainer) { + let selectedModels = optContainer.getSelectedModels(); + //加载事件的配置 + let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_DEL_BEFORE", DDeiEnumOperateType.DEL, { models: Array.from(selectedModels.values()) }, ddInstance, evt) + if (rsState == 0 || rsState == 1) { + let models = Array.from(selectedModels.values()) + models[0].layer.opPoints = []; + + if (models[0].layer.opLine?.render) { + models[0].layer.opLine.render.enableRefreshShape() + } + delete models[0].layer.opLine; + optContainer.removeModels(models, true) + optContainer.cascadeRemoveSelf() + + + ddInstance.bus.push(DDeiEnumBusCommandType.UpdatePaperArea); + ddInstance.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); + ddInstance.bus.push(DDeiEnumBusCommandType.UpdateSelectorBounds); + ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy); + ddInstance.bus.push(DDeiEnumBusCommandType.ChangeStageWPV, { + dragObj: { dx: 0, dy: 0 }, x: 0, y: 0 + }) + //渲染图形 + ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); + + ddInstance.bus.executeAll(); + DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_DEL_AFTER", DDeiEnumOperateType.DEL, { models: Array.from(selectedModels.values()) }, ddInstance, evt) + } + } + } + } + +} + + +export default DDeiKeyActionRemoveModels diff --git a/plugins/core/hotkeys/actions/key-action-rerevoke.ts b/plugins/core/hotkeys/actions/key-action-rerevoke.ts new file mode 100644 index 0000000..7b4063c --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-rerevoke.ts @@ -0,0 +1,136 @@ +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiLayer} from "ddei-framework"; +import {DDeiActiveType} from "ddei-framework"; +import {DDeiFile} from "ddei-framework"; +import {DDeiFileState} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import {DDeiEditorUtil} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:反撤销 + * 撤销前一次撤销动作 + */ +class DDeiKeyActionReRevoke extends DDeiKeyAction { + name: string = "ddei-core-keyaction-re-revoke" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionReRevoke = new DDeiKeyActionReRevoke(); + + defaultOptions: object = { + 'keys': [ + //反撤销 + { ctrl: 1, keys: "89", editorState: DDeiEditorState.DESIGNING}, + { ctrl: 1, shift: 1, keys: "90", editorState: DDeiEditorState.DESIGNING }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionReRevoke.defaultIns.name]) { + for (let i in options[DDeiKeyActionReRevoke.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionReRevoke.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionReRevoke(newOptions); + return panels; + } + } + return DDeiKeyActionReRevoke; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + let editor = DDeiEditor.ACTIVE_INSTANCE; + let histype = DDeiEditorUtil.getConfigValue("HISTROY_LEVEL", editor); + if (histype == 'file') { + if (editor?.files.length > 0 && (editor.currentFileIndex == 0 || editor.currentFileIndex)) { + let file = editor?.files[editor.currentFileIndex] + //从历史恢复文件 + if (file?.active == DDeiActiveType.ACTIVE) { + let hisData = file.reRevokeHistroyData(); + if (hisData?.data) { + let jsonData = JSON.parse(hisData?.data) + if (jsonData) { + let ddInstance = editor?.ddInstance; + let hisFile = DDeiFile.loadFromJSON(jsonData, { + currentDdInstance: ddInstance, + }); + if (hisData.isNew == true) { + file.state = DDeiFileState.NONE; + } else { + file.state = DDeiFileState.MODIFY + } + file.name = hisFile?.name; + file.desc = hisFile?.desc; + file.lastUpdateTime = hisFile?.lastUpdateTime; + file.sheets = hisFile?.sheets; + if (file && file.sheets && ddInstance) { + file.changeSheet(hisFile.currentSheetIndex); + let stage = file.sheets[file.currentSheetIndex].stage; + stage.ddInstance = ddInstance; + //刷新页面 + ddInstance.stage = stage; + //加载场景渲染器 + stage.initRender(); + ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); + ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts) + ddInstance.bus.executeAll(); + } + } + } + } + } + } else if (histype == 'stage') { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let hisData = ddInstance.stage.reRevokeHistroyData(); + if (hisData?.data) { + let jsonData = JSON.parse(hisData?.data) + if (jsonData) { + let tempData = { "currentDdInstance": ddInstance, "currentStage": ddInstance.stage } + tempData[ddInstance.stage.id] = ddInstance.stage + let layers = []; + jsonData.layers.forEach(layer => { + let model = DDeiLayer.loadFromJSON(layer, tempData); + layers.push(model); + }) + ddInstance.stage.idIdx = jsonData.idIdx; + ddInstance.stage.layers = layers + ddInstance.stage.initRender(); + //渲染图形 + ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts) + ddInstance.bus.executeAll(); + } + } + + } + } + } + +} + + +export default DDeiKeyActionReRevoke diff --git a/plugins/core/hotkeys/actions/key-action-revoke.ts b/plugins/core/hotkeys/actions/key-action-revoke.ts new file mode 100644 index 0000000..60ed0c3 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-revoke.ts @@ -0,0 +1,140 @@ +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiStage} from "ddei-framework"; +import {DDeiLayer} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiActiveType} from "ddei-framework"; +import {DDeiFile} from "ddei-framework"; +import {DDeiFileState} from "ddei-framework"; +import {DDeiEditorUtil} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:撤销 + * 撤销上一步操作 + */ +class DDeiKeyActionRevoke extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-revoke" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionRevoke = new DDeiKeyActionRevoke(); + + defaultOptions: object = { + 'keys': [ + //撤销 + { ctrl: 1, keys: "90", editorState: DDeiEditorState.DESIGNING}, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionRevoke.defaultIns.name]) { + for (let i in options[DDeiKeyActionRevoke.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionRevoke.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionRevoke(newOptions); + return panels; + } + } + return DDeiKeyActionRevoke; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + let editor = DDeiEditor.ACTIVE_INSTANCE; + let histype = DDeiEditorUtil.getConfigValue("HISTROY_LEVEL", editor); + if (histype == 'file') { + let editor = DDeiEditor.ACTIVE_INSTANCE; + if (editor?.files.length > 0 && (editor.currentFileIndex == 0 || editor.currentFileIndex)) { + let file = editor?.files[editor.currentFileIndex] + //从历史恢复文件 + if (file?.active == DDeiActiveType.ACTIVE) { + let hisData = file.revokeHistroyData(); + if (hisData?.data) { + let jsonData = JSON.parse(hisData?.data) + if (jsonData) { + let ddInstance = editor?.ddInstance; + let hisFile = DDeiFile.loadFromJSON(jsonData, { + currentDdInstance: ddInstance, + }); + + if (hisData.isNew == true) { + file.state = DDeiFileState.NONE; + } else { + file.state = DDeiFileState.MODIFY + } + file.name = hisFile?.name; + file.desc = hisFile?.desc; + file.lastUpdateTime = hisFile?.lastUpdateTime; + file.sheets = hisFile?.sheets; + if (file && file.sheets && ddInstance) { + file.changeSheet(hisFile.currentSheetIndex); + let stage = file.sheets[file.currentSheetIndex].stage; + stage.ddInstance = ddInstance; + //刷新页面 + ddInstance.stage = stage; + //加载场景渲染器 + stage.initRender(); + + ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape); + ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts) + ddInstance.bus.executeAll(); + } + } + } + } + } + } else if (histype == 'stage') { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let hisData = ddInstance.stage.revokeHistroyData(); + if (hisData?.data) { + let jsonData = JSON.parse(hisData?.data) + if (jsonData) { + let tempData = { "currentDdInstance": ddInstance, "currentStage": ddInstance.stage } + tempData[ddInstance.stage.id] = ddInstance.stage + let layers = []; + jsonData.layers.forEach(layer => { + let model = DDeiLayer.loadFromJSON(layer, tempData); + layers.push(model); + }) + ddInstance.stage.idIdx = jsonData.idIdx; + ddInstance.stage.layers = layers + ddInstance.stage.initRender(); + //渲染图形 + ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts) + ddInstance.bus.executeAll(); + } + } + + } + } + + } + +} + + +export default DDeiKeyActionRevoke diff --git a/plugins/core/hotkeys/actions/key-action-save-file.ts b/plugins/core/hotkeys/actions/key-action-save-file.ts new file mode 100644 index 0000000..3a4c46b --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-save-file.ts @@ -0,0 +1,66 @@ +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiActiveType} from "ddei-framework"; +import {DDeiFileState} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; + +/** + * 键行为:保存文件 + * 保存当前文件 + */ +class DDeiKeyActionSaveFile extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-save-file" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionSaveFile = new DDeiKeyActionSaveFile(); + + defaultOptions: object = { + 'keys': [ + //保存 + { ctrl: 1, keys: "83" }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionSaveFile.defaultIns.name]) { + for (let i in options[DDeiKeyActionSaveFile.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionSaveFile.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionSaveFile(newOptions); + return panels; + } + } + return DDeiKeyActionSaveFile; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + ddInstance.bus?.push(DDeiEditorEnumBusCommandType.SaveFile, {}, evt) + ddInstance.bus?.executeAll() + } + +} + + +export default DDeiKeyActionSaveFile diff --git a/plugins/core/hotkeys/actions/key-action-start-quick-edit.ts b/plugins/core/hotkeys/actions/key-action-start-quick-edit.ts new file mode 100644 index 0000000..bcf1413 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-start-quick-edit.ts @@ -0,0 +1,263 @@ +import {DDeiConfig} from "ddei-framework"; +import { DDei, DDeiEnumOperateType } from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiLineLink} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import { Matrix3, Vector3 } from 'three'; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumOperateState} from "ddei-framework"; +import {DDeiAbstractShape} from "ddei-framework"; + +/** + * 键行为:开启快捷编辑 + * 开启快捷编辑 + */ +class DDeiKeyActionStartQuickEdit extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-quickedit-start" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionStartQuickEdit = new DDeiKeyActionStartQuickEdit(); + + defaultOptions: object = { + 'keys': [ + //F2快捷编辑 + { keys: "113", editorState: DDeiEditorState.DESIGNING }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionStartQuickEdit.defaultIns.name]) { + for (let i in options[DDeiKeyActionStartQuickEdit.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionStartQuickEdit.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionStartQuickEdit(newOptions); + return panels; + } + } + return DDeiKeyActionStartQuickEdit; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //获取当前编辑控件 + if (ddInstance.stage?.selectedModels?.size == 1) { + let model = Array.from(ddInstance.stage?.selectedModels.values())[0] + let editor = DDeiEditor.ACTIVE_INSTANCE; + + let editState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: [model] }, ddInstance, null) + if (editState == 0 || editState== 1){ + let stage = ddInstance.stage; + if (model?.render) { + let ex = -1; + let ey = -1; + if (evt.offsetX || evt.offsetY) { + ex = evt.offsetX + ey = evt.offsetY + ex /= window.remRatio + ey /= window.remRatio + ex -= stage.wpv.x; + ey -= stage.wpv.y; + + } + if (model.baseModelType == 'DDeiTable') { + let selectCells = model.getSelectedCells(); + if (selectCells?.length == 1) { + model = selectCells[0]; + editor.quickEditorModel = model; + } else { + editor.quickEditorModel = null; + return; + } + } else if (model.baseModelType == 'DDeiLine') { + //计算事件发生在线的哪个位置,键盘为中间,鼠标则需要判断位置 + let type = 3; + let linePoint = null; + //鼠标事件 + if (evt.offsetX || evt.offsetY) { + let cdist = DDeiUtil.getPointDistance(model.pvs[0].x, model.pvs[1].y, model.pvs[model.pvs.length - 1].x, model.pvs[model.pvs.length - 1].y); + let sdist = DDeiUtil.getPointDistance(ex, ey, model.pvs[0].x, model.pvs[0].y); + let edist = DDeiUtil.getPointDistance(ex, ey, model.pvs[model.pvs.length - 1].x, model.pvs[model.pvs.length - 1].y); + //开始 + if (sdist < cdist / 5) { + type = 1; + } + //结束 + else if (edist < cdist / 5) { + type = 2; + } + } + if (type == 1) { + linePoint = model.startPoint; + } + else if (type == 2) { + linePoint = model.endPoint; + } + else if (type == 3) { + //奇数,取正中间 + let pi = Math.floor(model.pvs.length / 2) + if (model.pvs.length % 3 == 0) { + linePoint = model.pvs[pi]; + } + //偶数,取两边的中间点 + else { + linePoint = { + x: (model.pvs[pi - 1].x + model.pvs[pi].x) / 2, + y: (model.pvs[pi - 1].y + model.pvs[pi].y) / 2 + } + } + } + let realModel = null; + + model.linkModels.forEach(lm => { + if (lm.type == type) { + realModel = lm.dm; + } + }); + + //如果控件不存在,则创建控件并创建链接 + if (!realModel) { + + //根据control的定义,初始化临时控件,并推送至上层Editor + let dataJson = { + + modelCode: "100200", + + }; + let controlDefine = DDeiUtil.getControlDefine(dataJson) + for (let i in controlDefine?.define) { + dataJson[i] = controlDefine.define[i]; + } + dataJson["id"] = "lsm_" + (stage.idIdx++) + dataJson["width"] = 80 + dataJson["height"] = 25 + dataJson["font"] = { size: 12 } + realModel = ddInstance.controlModelClasses["DDeiPolygon"].initByJSON( + dataJson, + { currentStage: stage, currentDdInstance: ddInstance, currentContainer: model.pModel } + ); + let move1Matrix = new Matrix3( + 1, 0, linePoint.x, + 0, 1, linePoint.y, + 0, 0, 1); + realModel.transVectors(move1Matrix) + model.layer.addModel(realModel); + + realModel.initRender() + let lineLink = new DDeiLineLink({ + line: model, + type: type, + dm: realModel, + dx: 0, + dy: 0 + }) + model.linkModels.set(realModel.id, lineLink); + } + model = realModel; + editor.quickEditorModel = model; + } + + //获取控件所占区域 + //判断控件是否有composes,如果被composes拦截了,则启用componses的编辑 + model = DDeiAbstractShape.findBottomComponseByArea(model, ex, ey); + + let fillArea = model.textArea + + if (fillArea?.length > 0) { + editor.quickEditorModel = model; + let canvasPos = DDeiUtil.getDomAbsPosition(ddInstance.render.canvas); + //创建大文本框 + let inputEle = DDeiUtil.getEditorText(); + let rotate = model.rotate + let stageRatio = ddInstance.stage.getStageRatio(); + let pos = new Vector3(model.pvs[0].x, model.pvs[0].y, 1) + if (rotate != 0) { + let pvc = new Vector3(model.cpv.x, model.cpv.y, 1); + let angle = (rotate * DDeiConfig.ROTATE_UNIT).toFixed(4); + //计算input的正确打开位置,由节点0 + let move1Matrix = new Matrix3( + 1, 0, -pvc.x, + 0, 1, -pvc.y, + 0, 0, 1); + let rotateMatrix = new Matrix3( + Math.cos(angle), Math.sin(angle), 0, + -Math.sin(angle), Math.cos(angle), 0, + 0, 0, 1); + let move2Matrix = new Matrix3( + 1, 0, pvc.x, + 0, 1, pvc.y, + 0, 0, 1); + let m1 = new Matrix3().premultiply(move1Matrix).premultiply(rotateMatrix).premultiply(move2Matrix); + pos.applyMatrix3(m1) + } + + inputEle.value = model.text ? model.text : '' + inputEle.style.fontSize = (model.render.getCachedValue("font.size") * stageRatio) + "px" + inputEle.style.color = DDeiUtil.getColor(model.render.getCachedValue("font.color")) + inputEle.style.width = (fillArea.width) * stageRatio + "px"; + inputEle.style.height = (fillArea.height) * stageRatio + "px"; + + + inputEle.style.left = canvasPos.left + pos.x + ddInstance.stage.wpv.x + 1 + "px"; + inputEle.style.top = canvasPos.top + pos.y + ddInstance.stage.wpv.y + 10 + "px"; + // inputEle.style.transform = "rotate(" + rotate + "deg)"; + // inputEle.style.backgroundColor = "grey" + inputEle.style.display = "block"; + + let textAreaRect = DDeiAbstractShape.pvsToOutRect(model.textArea); + inputEle.style.width = textAreaRect.width + "px" + inputEle.style.height = textAreaRect.height + "px" + //创建编辑影子元素 + ddInstance.stage.render.editorShadowControl = DDeiUtil.getShadowControl(model); + //清空当前opPoints + model.layer.opPoints = []; + if (model.layer.opLine?.render) { + model.layer.opLine.render.enableRefreshShape() + } + delete model.layer.opLine; + ddInstance.stage.render.editorShadowControl.render.isEditoring = true + inputEle.focus() + + inputEle.selectionStart = 0 // 选中开始位置 + inputEle.selectionEnd = inputEle.value.length // 获取输入框里的长度。 + //修改编辑器状态为快捷编辑中 + editor.changeState(DDeiEditorState.QUICK_EDITING); + delete ddInstance.stage.brushData + delete ddInstance.stage.brushDataText + ddInstance.stage.render.operateState = DDeiEnumOperateState.QUICK_EDITING + //发出通知,选中的焦点发生变化 + editor.bus.push(DDeiEnumBusCommandType.StageChangeSelectModels); + editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos); + editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); + editor.bus.executeAll(); + } + } + } + } + } + +} + + +export default DDeiKeyActionStartQuickEdit diff --git a/plugins/core/hotkeys/actions/key-action-table-next-col.ts b/plugins/core/hotkeys/actions/key-action-table-next-col.ts new file mode 100644 index 0000000..29b7877 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-table-next-col.ts @@ -0,0 +1,80 @@ +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:移动到表格下一列 + */ +class DDeiKeyActionTableNextCol extends DDeiKeyAction { + + + name: string = "ddei-core-keyaction-table-next-col" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionTableNextCol = new DDeiKeyActionTableNextCol(); + + defaultOptions: object = { + 'keys': [ + //表格内部tab,往下一列 + { keys: "9", modelType: 'DDeiTable', editorState: DDeiEditorState.DESIGNING}, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionTableNextCol.defaultIns.name]) { + for (let i in options[DDeiKeyActionTableNextCol.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionTableNextCol.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionTableNextCol(newOptions); + return panels; + } + } + return DDeiKeyActionTableNextCol; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let models = Array.from(ddInstance.stage.selectedModels?.values()); + if (models?.length == 1 && models[0].baseModelType == 'DDeiTable' && models[0].curRow != -1 && models[0].curCol != -1) { + if (models[0].curCol < models[0].cols.length - 1) { + if (models[0].tempDragCell) { + models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT) + } + models[0].curCol++; + models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol] + models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED) + } + } + //渲染图形 + ddInstance?.bus?.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + + ddInstance?.bus?.executeAll(); + } + } + +} + + +export default DDeiKeyActionTableNextCol diff --git a/plugins/core/hotkeys/actions/key-action-table-next-row.ts b/plugins/core/hotkeys/actions/key-action-table-next-row.ts new file mode 100644 index 0000000..5908216 --- /dev/null +++ b/plugins/core/hotkeys/actions/key-action-table-next-row.ts @@ -0,0 +1,79 @@ +import {DDei} from "ddei-framework"; +import {DDeiEnumControlState} from "ddei-framework"; +import {DDeiKeyAction} from "ddei-framework"; +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; + +/** + * 键行为:移动到表格下一行 + */ +class DDeiKeyActionTableNextRow extends DDeiKeyAction { + + name: string = "ddei-core-keyaction-table-next-row" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiKeyActionTableNextRow = new DDeiKeyActionTableNextRow(); + + defaultOptions: object = { + 'keys': [ + //表格内部回车,往下一行 + { keys: "13", modelType: 'DDeiTable', editorState: DDeiEditorState.DESIGNING }, + ] + } + + getHotKeys(editor) { + return [this]; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[DDeiKeyActionTableNextRow.defaultIns.name]) { + for (let i in options[DDeiKeyActionTableNextRow.defaultIns.name]) { + newOptions[i] = options[DDeiKeyActionTableNextRow.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiKeyActionTableNextRow(newOptions); + return panels; + } + } + return DDeiKeyActionTableNextRow; + } + // ============================ 方法 =============================== + action(evt: Event, ddInstance: DDei): void { + //修改当前操作控件坐标 + if (ddInstance && ddInstance.stage) { + let models = Array.from(ddInstance.stage.selectedModels?.values()); + if (models?.length == 1 && models[0].baseModelType == 'DDeiTable' && models[0].curRow != -1 && models[0].curCol != -1) { + if (models[0].curRow < models[0].rows.length - 1) { + if (models[0].tempDragCell) { + models[0].tempDragCell.setState(DDeiEnumControlState.DEFAULT) + } + models[0].curRow++; + models[0].tempDragCell = models[0].rows[models[0].curRow][models[0].curCol] + models[0].tempDragCell.setState(DDeiEnumControlState.SELECTED) + } + } + //渲染图形 + ddInstance?.bus?.push(DDeiEnumBusCommandType.RefreshShape, null, evt); + + ddInstance?.bus?.executeAll(); + } + } + +} + + +export default DDeiKeyActionTableNextRow diff --git a/plugins/core/hotkeys/index.ts b/plugins/core/hotkeys/index.ts new file mode 100644 index 0000000..b3b184f --- /dev/null +++ b/plugins/core/hotkeys/index.ts @@ -0,0 +1,87 @@ +import {DDeiPluginBase} from "ddei-framework"; +import DDeiKeyActionAllSelect from "./actions/key-action-all-select" +import DDeiKeyActionBrushData from "./actions/key-action-brushdata" +import DDeiKeyActionCancelCompose from "./actions/key-action-cancel-compose" +import DDeiKeyActionCancelControlCreate from "./actions/key-action-cancel-control-create" +import DDeiKeyActionCancelCurrentAction from "./actions/key-action-cancel-current-action" +import DDeiKeyActionCancelQuickEdit from "./actions/key-action-cancel-quick-edit" +import DDeiKeyActionCancelSelect from "./actions/key-action-cancel-select" +import DDeiKeyActionClearBrushData from "./actions/key-action-clear-brushdata" +import DDeiKeyActionCloseDialog from "./actions/key-action-close-dialog" +import DDeiKeyActionCompose from "./actions/key-action-compose" +import DDeiKeyActionCopy from "./actions/key-action-copy" +import DDeiKeyActionCopyImage from "./actions/key-action-copy-image" +import DDeiKeyActionCut from "./actions/key-action-cut" +import DDeiKeyActionEnterQuickEdit from "./actions/key-action-enter-quick-edit" +import DDeiKeyActionMoveModels from "./actions/key-action-move-models" +import DDeiKeyActionPaste from "./actions/key-action-paste" +import DDeiKeyActionPushModels from "./actions/key-action-push-models" +import DDeiKeyActionNewRowQuickEdit from "./actions/key-action-quick-editor-newrow" +import DDeiKeyActionRemoveModels from "./actions/key-action-remove-models" +import DDeiKeyActionReRevoke from "./actions/key-action-rerevoke" +import DDeiKeyActionRevoke from "./actions/key-action-revoke" +import DDeiKeyActionSaveFile from "./actions/key-action-save-file" +import DDeiKeyActionStartQuickEdit from "./actions/key-action-start-quick-edit" +import DDeiKeyActionTableNextCol from "./actions/key-action-table-next-col" +import DDeiKeyActionTableNextRow from "./actions/key-action-table-next-row" + +/** + * 快捷键扩展 + */ +class DDeiCoreHotkeys extends DDeiPluginBase{ + + type: string = "package" + /** + * 缺省实例 + */ + static defaultIns:DDeiCoreHotkeys = new DDeiCoreHotkeys(null); + + + plugins: object[] = [DDeiKeyActionAllSelect, DDeiKeyActionBrushData, DDeiKeyActionCancelCompose, DDeiKeyActionCancelControlCreate, + DDeiKeyActionCancelCurrentAction, DDeiKeyActionCancelQuickEdit, DDeiKeyActionCancelSelect, + DDeiKeyActionClearBrushData, DDeiKeyActionCloseDialog, DDeiKeyActionCompose, + DDeiKeyActionCopy, DDeiKeyActionCopyImage, DDeiKeyActionCut, + DDeiKeyActionEnterQuickEdit, DDeiKeyActionMoveModels, DDeiKeyActionReRevoke, + DDeiKeyActionRevoke, DDeiKeyActionSaveFile, DDeiKeyActionStartQuickEdit, + DDeiKeyActionTableNextCol, DDeiKeyActionTableNextRow, DDeiKeyActionPaste, + DDeiKeyActionPushModels, DDeiKeyActionNewRowQuickEdit, DDeiKeyActionRemoveModels + ] + + + getHotKeys(editor){ + let hotkeys = [] + this.plugins?.forEach(plugin=>{ + let ls + if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { + ls = plugin.defaultIns.getHotKeys(editor); + } else if (plugin instanceof DDeiPluginBase) { + ls = plugin.getHotKeys(editor); + } + + if (ls?.length > 0) { + hotkeys = hotkeys.concat(ls); + } + }) + return hotkeys + } + + + static configuration(options) { + let hotkeys = new DDeiCoreHotkeys(options); + for (let i = 0; i < hotkeys.plugins?.length;i++){ + hotkeys.plugins[i] = hotkeys.plugins[i].configuration(options,true) + } + return hotkeys; + } +} +export { + DDeiCoreHotkeys, DDeiKeyActionAllSelect, DDeiKeyActionBrushData, DDeiKeyActionCancelCompose, DDeiKeyActionCancelControlCreate, + DDeiKeyActionCancelCurrentAction, DDeiKeyActionCancelQuickEdit, DDeiKeyActionCancelSelect, + DDeiKeyActionClearBrushData, DDeiKeyActionCloseDialog, DDeiKeyActionCompose, + DDeiKeyActionCopy, DDeiKeyActionCopyImage, DDeiKeyActionCut, + DDeiKeyActionEnterQuickEdit, DDeiKeyActionMoveModels, DDeiKeyActionReRevoke, + DDeiKeyActionRevoke, DDeiKeyActionSaveFile, DDeiKeyActionStartQuickEdit, + DDeiKeyActionTableNextCol, DDeiKeyActionTableNextRow, DDeiKeyActionPaste, + DDeiKeyActionPushModels, DDeiKeyActionNewRowQuickEdit, DDeiKeyActionRemoveModels +} +export default DDeiCoreHotkeys \ No newline at end of file diff --git a/plugins/core/index.ts b/plugins/core/index.ts new file mode 100644 index 0000000..b5ff42e --- /dev/null +++ b/plugins/core/index.ts @@ -0,0 +1,158 @@ +import DDeiCorePanels from "./panels" +import DDeiCoreComponents from "./components" +import DDeiCoreLayouts from "./layouts"; +import DDeiCoreDialogs from "./dialogs"; +import DDeiCorePropEditors from "./propeditors"; +import DDeiCoreHotkeys from "./hotkeys"; +import DDeiCoreControls from "./controls"; +import DDeiCoreMenus from "./menus"; +import DDeiCoreThemes from "./themes" +import {DDeiPluginBase} from "ddei-framework"; + +class DDeiCore extends DDeiPluginBase { + type: string = "package" + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCore = new DDeiCore(null); + + + layouts: object = DDeiCoreLayouts; + + panels: object = DDeiCorePanels; + + components: object = DDeiCoreComponents; + + dialogs:object = DDeiCoreDialogs; + + propeditors: object = DDeiCorePropEditors; + + hotkeys: object = DDeiCoreHotkeys; + + controls: object = DDeiCoreControls; + + menus: object = DDeiCoreMenus; + + themes: object = DDeiCoreThemes; + + getOptions(): object { + let options = {} + let array = [this.layouts, this.panels, this.propeditors, this.dialogs, this.components, this.hotkeys, this.controls, this.menus, this.themes] + array.forEach(plugin => { + if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { + options = Object.assign({}, options, plugin.defaultIns.getOptions()) + } else if (plugin instanceof DDeiPluginBase) { + options = Object.assign({}, options, plugin.getOptions()) + } + }); + return options; + } + + getComponents(editor) { + if (DDeiPluginBase.isSubclass(this.components, DDeiPluginBase)) { + return this.components.defaultIns.getComponents(editor); + } else if (this.components instanceof DDeiPluginBase) { + return this.components.getComponents(editor); + } + } + + getPanels(editor) { + if (DDeiPluginBase.isSubclass(this.panels, DDeiPluginBase)) { + return this.panels.defaultIns.getPanels(editor); + } else if (this.panels instanceof DDeiPluginBase) { + return this.panels.getPanels(editor); + } + } + + getLayouts(editor) { + if (DDeiPluginBase.isSubclass(this.layouts, DDeiPluginBase)) { + return this.layouts.defaultIns.getLayouts(editor); + } else if (this.layouts instanceof DDeiPluginBase) { + return this.layouts.getLayouts(editor); + } + } + + getDialogs(editor){ + if (DDeiPluginBase.isSubclass(this.dialogs, DDeiPluginBase)) { + return this.dialogs.defaultIns.getDialogs(editor); + } else if (this.dialogs instanceof DDeiPluginBase) { + return this.dialogs.getDialogs(editor); + } + } + + getPropEditors(editor) { + if (DDeiPluginBase.isSubclass(this.propeditors, DDeiPluginBase)) { + return this.propeditors.defaultIns.getPropEditors(editor); + } else if (this.propeditors instanceof DDeiPluginBase) { + return this.propeditors.getPropEditors(editor); + } + } + + getHotKeys(editor) { + if (DDeiPluginBase.isSubclass(this.hotkeys, DDeiPluginBase)) { + return this.hotkeys.defaultIns.getHotKeys(editor); + } else if (this.hotkeys instanceof DDeiPluginBase) { + return this.hotkeys.getHotKeys(editor); + } + } + + getControls(editor) { + if (DDeiPluginBase.isSubclass(this.controls, DDeiPluginBase)) { + return this.controls.defaultIns.getControls(editor); + } else if (this.controls instanceof DDeiPluginBase) { + return this.controls.getControls(editor); + } + } + + getGroups(editor) { + if (DDeiPluginBase.isSubclass(this.controls, DDeiPluginBase)) { + return this.controls.defaultIns.getGroups(editor); + } else if (this.controls instanceof DDeiPluginBase) { + return this.controls.getGroups(editor); + } + } + + getMenus(editor) { + if (DDeiPluginBase.isSubclass(this.menus, DDeiPluginBase)) { + return this.menus.defaultIns.getMenus(editor); + } else if (this.menus instanceof DDeiPluginBase) { + return this.menus.getMenus(editor); + } + } + + getThemes(editor) { + if (DDeiPluginBase.isSubclass(this.themes, DDeiPluginBase)) { + return this.themes.defaultIns.getThemes(editor); + } else if (this.themes instanceof DDeiPluginBase) { + return this.themes.getThemes(editor); + } + } + + static configuration(options) { + let core = new DDeiCore(options); + core.layouts = core.layouts.configuration(options,true) + core.panels = core.panels.configuration(options,true) + core.components = core.components.configuration(options, true) + core.dialogs = core.dialogs.configuration(options, true) + core.propeditors = core.propeditors.configuration(options, true) + core.hotkeys = core.hotkeys.configuration(options, true) + core.controls = core.controls.configuration(options, true) + core.menus = core.menus.configuration(options, true) + core.themes = core.themes.configuration(options, true) + return core; + } +} + +export * from "./panels" +export * from "./components" +export * from "./layouts"; +export * from "./dialogs"; +export * from "./propeditors"; +export * from "./hotkeys"; +export * from "./menus" +export * from "./controls" +export * from "./themes" +export {DDeiCore} +export default DDeiCore; \ No newline at end of file diff --git a/plugins/core/layouts/StandardLayout.vue b/plugins/core/layouts/StandardLayout.vue new file mode 100644 index 0000000..f1e5e7d --- /dev/null +++ b/plugins/core/layouts/StandardLayout.vue @@ -0,0 +1,271 @@ + + + + + + diff --git a/plugins/core/layouts/index.ts b/plugins/core/layouts/index.ts new file mode 100644 index 0000000..65a6f63 --- /dev/null +++ b/plugins/core/layouts/index.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import DDeiCoreStandLayout from "./stand-layout"; + + + +class DDeiCoreLayouts extends DDeiPluginBase{ + + type: string = "package" + /** + * 缺省实例 + */ + static defaultIns:DDeiCoreLayouts = new DDeiCoreLayouts(null); + + + plugins: object[] = [DDeiCoreStandLayout] + + + getLayouts(editor){ + let layouts = [] + this.plugins?.forEach(plugin=>{ + let ls + if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { + ls = plugin.defaultIns.getLayouts(editor); + } else if (plugin instanceof DDeiPluginBase) { + ls = plugin.getLayouts(editor); + } + + if (ls?.length > 0) { + layouts = layouts.concat(ls); + } + }) + return layouts + } + + + static configuration(options) { + let layouts = new DDeiCoreLayouts(options); + for (let i = 0; i < layouts.plugins?.length;i++){ + layouts.plugins[i] = layouts.plugins[i].configuration(options,true) + } + return layouts; + } +} + +export {DDeiCoreLayouts,DDeiCoreStandLayout} +export default DDeiCoreLayouts \ No newline at end of file diff --git a/plugins/core/layouts/stand-layout.ts b/plugins/core/layouts/stand-layout.ts new file mode 100644 index 0000000..6edff4b --- /dev/null +++ b/plugins/core/layouts/stand-layout.ts @@ -0,0 +1,55 @@ +import {DDeiPluginBase} from "ddei-framework"; +import Layout from './StandardLayout.vue'; + + + +class DDeiCoreStandLayout extends DDeiPluginBase{ + + name: string = Layout.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreStandLayout = new DDeiCoreStandLayout(); + + defaultOptions: object = { + top: ['ddei-core-panel-topmenu'], + left: ['ddei-core-panel-toolbox'], + middle: ['ddei-core-panel-canvasview'], + right: ['ddei-core-panel-propertyview'], + bottom: ['ddei-core-panel-bottommenu'] + } + + + plugins:object[] = [Layout] + + getLayouts(editor){ + return this.plugins + } + + static configuration(options,fullConfig:boolean = false ) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = Object.assign({}, {}, DDeiCoreStandLayout.defaultIns.defaultOptions) + if (fullConfig) { + if (fullConfig) { + if (options[Layout.name]) { + for (let i in options[Layout.name]) { + newOptions[i] = options[Layout.name][i] + } + } + } + }else{ + for (let i in options) { + newOptions[i] = options[i] + } + } + if (newOptions && Object.keys(newOptions).length !== 0){ + let layouts = new DDeiCoreStandLayout(newOptions); + return layouts; + } + } + return DDeiCoreStandLayout; + } +} + +export default DDeiCoreStandLayout \ No newline at end of file diff --git a/plugins/core/menus/index.ts b/plugins/core/menus/index.ts new file mode 100644 index 0000000..41c5865 --- /dev/null +++ b/plugins/core/menus/index.ts @@ -0,0 +1,58 @@ +import {DDeiPluginBase} from "ddei-framework"; +import MenuCancelMergeCell from "./menu-cancel-merge-cell" +import MenuCopySheet from "./menu-copy-sheet" +import MenuInsertCol from "./menu-insert-col" +import MenuInsertRow from "./menu-insert-row" +import MenuMergeCell from "./menu-merge-cell" +import MenuRemoveCol from "./menu-remove-col" +import MenuRemoveRow from "./menu-remove-row" +import MenuRemoveSheet from "./menu-remove-sheet" + + +/** + * 快捷键扩展 + */ +class DDeiCoreMenus extends DDeiPluginBase{ + + type: string = "package" + /** + * 缺省实例 + */ + static defaultIns:DDeiCoreMenus = new DDeiCoreMenus(null); + + + plugins: object[] = [MenuCancelMergeCell, MenuCopySheet, MenuInsertCol, MenuInsertRow, + MenuMergeCell, MenuRemoveCol, MenuRemoveRow, MenuRemoveSheet] + + + getMenus(editor){ + let menus = [] + this.plugins?.forEach(plugin=>{ + let ls + if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { + ls = plugin.defaultIns.getMenus(editor); + } else if (plugin instanceof DDeiPluginBase) { + ls = plugin.getMenus(editor); + } + + if (ls?.length > 0) { + menus = menus.concat(ls); + } + }) + return menus + } + + + static configuration(options) { + let menus = new DDeiCoreMenus(options); + for (let i = 0; i < menus.plugins?.length;i++){ + menus.plugins[i] = menus.plugins[i].configuration(options,true) + } + return menus; + } +} +export { + DDeiCoreMenus, MenuCancelMergeCell, MenuCopySheet, MenuInsertCol, MenuInsertRow, + MenuMergeCell, MenuRemoveCol, MenuRemoveRow, MenuRemoveSheet +} +export default DDeiCoreMenus \ No newline at end of file diff --git a/plugins/core/menus/menu-cancel-merge-cell.ts b/plugins/core/menus/menu-cancel-merge-cell.ts new file mode 100644 index 0000000..460fb67 --- /dev/null +++ b/plugins/core/menus/menu-cancel-merge-cell.ts @@ -0,0 +1,82 @@ +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiMenuBase} from "ddei-framework"; + +/** + * 取消合并单元格菜单 + */ +class MenuCancelMergeCell extends DDeiMenuBase { + + + name: string = "ddei-core-menu-cancel-merge-cell" + + + /** + * 缺省实例 + */ + static defaultIns: MenuCancelMergeCell = new MenuCancelMergeCell(); + + defaultOptions: object = { + 'label': '取消合并单元格', + 'icon': 'icon-merge-cells', + 'disabled':false + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[MenuCancelMergeCell.defaultIns.name]) { + for (let i in options[MenuCancelMergeCell.defaultIns.name]) { + newOptions[i] = options[MenuCancelMergeCell.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new MenuCancelMergeCell(newOptions); + return panels; + } + } + return MenuCancelMergeCell; + } + + // ============================ 方法 =============================== + /** + * 执行的方法 + */ + action(model: object, evt: Event): void { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (model?.baseModelType == 'DDeiTable') { + let table: DDeiTable = model; + //执行取消合并单元格 + table.cancelSelectedMergeCells(); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + model.stage.ddInstance.bus.executeAll(); + } + } + + /** + * 判定是否显示的方法 + */ + isVisiable(model: object): boolean { + //当前控件为表格控件 + if (!this.disabled && model?.baseModelType == 'DDeiTable') { + let table = model; + let selectedCells = table.getSelectedCells(); + //判断当前选中的单元格是否具备取消合并单元格的条件,如果具备条件,则返回true + if (selectedCells.length == 1 && (selectedCells[0].mergeRowNum > 1 || selectedCells[0].mergeColNum > 1)) { + return true; + } + } + return false; + } + +} + +export default MenuCancelMergeCell; diff --git a/plugins/core/menus/menu-copy-sheet.ts b/plugins/core/menus/menu-copy-sheet.ts new file mode 100644 index 0000000..8e117de --- /dev/null +++ b/plugins/core/menus/menu-copy-sheet.ts @@ -0,0 +1,92 @@ +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiSheet} from "ddei-framework"; +import {DDeiMenuBase} from "ddei-framework"; +/** + * 复制页签 + */ +class MenuCopySheet extends DDeiMenuBase { + + + name: string = "ddei-core-menu-copy-sheet" + + + + /** + * 缺省实例 + */ + static defaultIns: MenuCopySheet = new MenuCopySheet(); + + defaultOptions: object = { + 'label': '复制', + 'icon': '#icon-a-ziyuan488', + 'models': ["DDeiSheet"], + 'disabled': false + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[MenuCopySheet.defaultIns.name]) { + for (let i in options[MenuCopySheet.defaultIns.name]) { + newOptions[i] = options[MenuCopySheet.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new MenuCopySheet(newOptions); + return panels; + } + } + return MenuCopySheet; + } + /** + * 执行的方法 + */ + action(model: object, evt: Event): void { + if (model.modelType == 'DDeiSheet') { + //将sheet插入文件 + let editor = DDeiEditor.ACTIVE_INSTANCE + let file = editor?.files[editor.currentFileIndex]; + let ddInstance = model.stage.ddInstance + let sheetJson = model.toJSON() + let newSheet = DDeiSheet.loadFromJSON(sheetJson, { currentDdInstance: ddInstance }); + file.sheets.splice(file?.currentSheetIndex + 1, 0, newSheet); + newSheet.name = "页面-" + file.sheets.length + file.changeSheet(file.currentSheetIndex + 1); + let stage = newSheet.stage; + stage.ddInstance = ddInstance; + //刷新页面 + ddInstance.stage = stage; + //加载场景渲染器 + stage.initRender(); + editor.changeState(DDeiEditorState.DESIGNING); + editor.bus.push(DDeiEditorEnumBusCommandType.ClearTemplateUI); + editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, null); + //记录日志 + editor.bus.push(DDeiEnumBusCommandType.AddHistroy) + editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu"] }) + editor.bus?.executeAll(); + editor.editorViewer?.changeFileModifyDirty(); + } + } + + /** + * 判定是否显示的方法 + */ + isVisiable(model: object): boolean { + return !this.disabled; + } + +} + +export default MenuCopySheet; diff --git a/plugins/core/menus/menu-insert-col.ts b/plugins/core/menus/menu-insert-col.ts new file mode 100644 index 0000000..5921012 --- /dev/null +++ b/plugins/core/menus/menu-insert-col.ts @@ -0,0 +1,86 @@ +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiMenuBase} from "ddei-framework"; +/** + * 插入列菜单 + */ +class MenuInsertCol extends DDeiMenuBase { + + + name: string = "ddei-core-menu-insert-col" + + + /** + * 缺省实例 + */ + static defaultIns: MenuInsertCol = new MenuInsertCol(); + + defaultOptions: object = { + 'label': '合并单元格', + 'icon': 'icon-merge-cells', + 'disabled': false + } + + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[MenuInsertCol.defaultIns.name]) { + for (let i in options[MenuInsertCol.defaultIns.name]) { + newOptions[i] = options[MenuInsertCol.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new MenuInsertCol(newOptions); + return panels; + } + } + return MenuInsertCol; + } + /** + * 执行的方法 + */ + action(model: object, evt: Event): void { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (model?.baseModelType == 'DDeiTable') { + let table: DDeiTable = model; + //获取当前单元格 + if (table.curRow != undefined && table.curCol != undefined && table.curRow != -1 && table.curCol != -1) { + let cell = table.rows[table.curRow][table.curCol]; + //model所在列 + let col = cell.col; + if (col < 0) { + col = -1; + } else if (col > table.cols.length - 1) { + col = table.cols.length - 1; + } + //调用table的插入行方法插入行 + table.insertCol(col, 2); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + model.stage.ddInstance.bus.executeAll(); + } + } + } + + /** + * 判定是否显示的方法 + */ + isVisiable(model: object): boolean { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (!this.disabled && model?.baseModelType == 'DDeiTable') { + return true + } + return false; + } + +} + +export default MenuInsertCol; diff --git a/plugins/core/menus/menu-insert-row.ts b/plugins/core/menus/menu-insert-row.ts new file mode 100644 index 0000000..196e39d --- /dev/null +++ b/plugins/core/menus/menu-insert-row.ts @@ -0,0 +1,94 @@ +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiTable} from "ddei-framework"; +import {DDeiMenuBase} from "ddei-framework"; + +/** + * 插入行菜单 + */ +class MenuInsertRow extends DDeiMenuBase { + + + name: string = "ddei-core-menu-insert-row" + + + /** + * 缺省实例 + */ + static defaultIns: MenuInsertRow = new MenuInsertRow(); + + defaultOptions: object = { + 'label': '插入行', + 'icon': 'icon-insert-row', + 'disabled': false + } + + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[MenuInsertRow.defaultIns.name]) { + for (let i in options[MenuInsertRow.defaultIns.name]) { + newOptions[i] = options[MenuInsertRow.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new MenuInsertRow(newOptions); + return panels; + } + } + return MenuInsertRow; + } + + + /** + * 执行的方法 + */ + action(model: object, evt: Event): void { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (model?.baseModelType == 'DDeiTable') { + let table: DDeiTable = model; + //获取当前单元格 + if (table.curRow != undefined && table.curCol != undefined && table.curRow != -1 && table.curCol != -1) { + let cell = table.rows[table.curRow][table.curCol]; + let row = cell.row; + if (row - 1 < 0) { + row = -1; + } else { + row = row - 1; + } + if (row < 0) { + row = -1; + } else if (row > table.rows.length - 1) { + row = table.rows.length - 1; + } + //调用table的插入行方法插入行 + table.insertRow(row, 1); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + model.stage.ddInstance.bus.executeAll(); + } + } + } + + /** + * 判定是否显示的方法 + */ + isVisiable(model: object): boolean { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (!this.disabled && model?.baseModelType == 'DDeiTable') { + return true + } + return false; + } + +} + +export default MenuInsertRow; diff --git a/plugins/core/menus/menu-merge-cell.ts b/plugins/core/menus/menu-merge-cell.ts new file mode 100644 index 0000000..6945269 --- /dev/null +++ b/plugins/core/menus/menu-merge-cell.ts @@ -0,0 +1,81 @@ +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiMenuBase} from "ddei-framework"; +/** + * 合并单元格菜单 + */ +class MenuMergeCell extends DDeiMenuBase { + + + name: string = "ddei-core-menu-merge-cell" + + + /** + * 缺省实例 + */ + static defaultIns: MenuMergeCell = new MenuMergeCell(); + + defaultOptions: object = { + 'label': '插入列', + 'icon': 'icon-insert-col', + 'disabled': false + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[MenuMergeCell.defaultIns.name]) { + for (let i in options[MenuMergeCell.defaultIns.name]) { + newOptions[i] = options[MenuMergeCell.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new MenuMergeCell(newOptions); + return panels; + } + } + return MenuMergeCell; + } + /** + * 执行的方法 + */ + action(model: object, evt: Event): void { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (model?.baseModelType == 'DDeiTable') { + let table: DDeiTable = model; + //执行合并单元格 + table.mergeSelectedCells(); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + model.stage.ddInstance.bus.executeAll(); + } + } + + /** + * 判定是否显示的方法 + */ + isVisiable(model: object): boolean { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (!this.disabled && model?.baseModelType == 'DDeiTable') { + //判断是否满足合并单元格条件 + let table = model; + //如果出现连续的单元格则允许合并,循环选中最大和最小区域,如果都选中,则返回true + let selectedCells = table.getSelectedCells(); + if (selectedCells.length >= 2) { + let minMaxColRow = table.getMinMaxRowAndCol(selectedCells); + return table.isAllSelected(minMaxColRow.minRow, minMaxColRow.minCol, minMaxColRow.maxRow, minMaxColRow.maxCol); + } + } + return false; + } + +} + +export default MenuMergeCell; diff --git a/plugins/core/menus/menu-remove-col.ts b/plugins/core/menus/menu-remove-col.ts new file mode 100644 index 0000000..1f65330 --- /dev/null +++ b/plugins/core/menus/menu-remove-col.ts @@ -0,0 +1,85 @@ +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiMenuBase} from "ddei-framework"; +/** + * 删除列菜单 + */ +class MenuRemoveCol extends DDeiMenuBase { + + + name: string = "ddei-core-menu-remove-col" + + + /** + * 缺省实例 + */ + static defaultIns: MenuRemoveCol = new MenuRemoveCol(); + + defaultOptions: object = { + 'label': '删除列', + 'icon': 'icon-delete-column', + 'disabled': false + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[MenuRemoveCol.defaultIns.name]) { + for (let i in options[MenuRemoveCol.defaultIns.name]) { + newOptions[i] = options[MenuRemoveCol.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new MenuRemoveCol(newOptions); + return panels; + } + } + return MenuRemoveCol; + } + /** + * 执行的方法 + */ + action(model: object, evt: Event): void { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (model?.baseModelType == 'DDeiTable') { + let table: DDeiTable = model; + //获取当前单元格 + if (table.curRow != undefined && table.curCol != undefined && table.curRow != -1 && table.curCol != -1) { + let cell = table.rows[table.curRow][table.curCol]; + let col = cell.col; + if (col < 0) { + col = 0; + } else if (col > table.cols.length - 1) { + col = table.cols.length - 1; + } + table.removeCol(col); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + model.stage.ddInstance.bus.executeAll(); + } + } + } + + /** + * 判定是否显示的方法 + */ + isVisiable(model: object): boolean { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (!this.disabled && model?.baseModelType == 'DDeiTable') { + if (model?.cols?.length > 1) { + return true + } + } + return false; + } + +} + +export default MenuRemoveCol; diff --git a/plugins/core/menus/menu-remove-row.ts b/plugins/core/menus/menu-remove-row.ts new file mode 100644 index 0000000..7d0b11a --- /dev/null +++ b/plugins/core/menus/menu-remove-row.ts @@ -0,0 +1,86 @@ +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiMenuBase} from "ddei-framework"; + +/** + * 删除行菜单 + */ +class MenuRemoveRow extends DDeiMenuBase { + + + name: string = "ddei-core-menu-remove-row" + + + /** + * 缺省实例 + */ + static defaultIns: MenuRemoveRow = new MenuRemoveRow(); + + defaultOptions: object = { + 'label': '删除行', + 'icon': 'icon-delete-row', + 'disabled': false + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[MenuRemoveRow.defaultIns.name]) { + for (let i in options[MenuRemoveRow.defaultIns.name]) { + newOptions[i] = options[MenuRemoveRow.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new MenuRemoveRow(newOptions); + return panels; + } + } + return MenuRemoveRow; + } + /** + * 执行的方法 + */ + action(model: object, evt: Event): void { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (model?.baseModelType == 'DDeiTable') { + let table: DDeiTable = model; + //获取当前单元格 + if (table.curRow != undefined && table.curCol != undefined && table.curRow != -1 && table.curCol != -1) { + let cell = table.rows[table.curRow][table.curCol]; + let row = cell.row; + if (row < 0) { + row = 0; + } else if (row > table.rows.length - 1) { + row = table.rows.length - 1; + } + table.removeRow(row); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.NodifyChange); + model.stage.ddInstance.bus.push(DDeiEnumBusCommandType.AddHistroy, null, evt); + model.stage.ddInstance.bus.executeAll(); + } + } + } + + /** + * 判定是否显示的方法 + */ + isVisiable(model: object): boolean { + //当前控件为表格控件,TODO 或者布局方式为表格的容器控件 + if (!this.disabled && model?.baseModelType == 'DDeiTable') { + if (model?.rows?.length > 1) { + return true + } + } + return false; + } + +} + +export default MenuRemoveRow; diff --git a/plugins/core/menus/menu-remove-sheet.ts b/plugins/core/menus/menu-remove-sheet.ts new file mode 100644 index 0000000..7652f56 --- /dev/null +++ b/plugins/core/menus/menu-remove-sheet.ts @@ -0,0 +1,145 @@ +import {DDeiEnumBusCommandType} from "ddei-framework"; +import {DDeiEditor} from "ddei-framework"; +import {DDeiEditorEnumBusCommandType} from "ddei-framework"; +import {DDeiEditorState} from "ddei-framework"; +import {DDeiUtil} from "ddei-framework"; +import {DDeiEditorUtil} from "ddei-framework"; +import {DDeiMenuBase} from "ddei-framework"; + +/** + * 插入列菜单 + */ +class MenuRemoveSheet extends DDeiMenuBase { + + + name: string = "ddei-core-menu-remove-sheet" + + + /** + * 缺省实例 + */ + static defaultIns: MenuRemoveSheet = new MenuRemoveSheet(); + + defaultOptions: object = { + 'label': '删除', + 'icon': '#icon-a-ziyuan401', + 'models':["DDeiSheet"], + 'disabled': false + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[MenuRemoveSheet.defaultIns.name]) { + for (let i in options[MenuRemoveSheet.defaultIns.name]) { + newOptions[i] = options[MenuRemoveSheet.defaultIns.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new MenuRemoveSheet(newOptions); + return panels; + } + } + return MenuRemoveSheet; + } + + + action(model: object, evt: Event): void { + if (model.modelType == 'DDeiSheet') { + //将sheet插入文件 + let editor = DDeiEditor.ACTIVE_INSTANCE + let file = editor?.files[editor.currentFileIndex]; + if (file.sheets.length > 1) { + let ddInstance = model.stage.ddInstance + let currentIndex = -1; + for (let i = 0; i < file?.sheets?.length; i++) { + if (file.sheets[i].unicode == model.unicode) { + currentIndex = i; + break; + } + } + + file.sheets.splice(currentIndex, 1); + + if (currentIndex <= file.currentSheetIndex) { + file.changeSheet(file.currentSheetIndex - 1); + } + let stage = file.sheets[file?.currentSheetIndex].stage; + stage.ddInstance = ddInstance; + //刷新页面 + ddInstance.stage = stage; + //加载场景渲染器 + stage.initRender(); + + editor.editorViewer?.changeFileModifyDirty(); + editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, null); + //记录日志 + editor.bus.push(DDeiEnumBusCommandType.AddHistroy) + editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, { parts: ["bottommenu"] }) + editor.bus?.executeAll(); + MenuRemoveSheet.showPopPicker(stage) + editor.changeState(DDeiEditorState.DESIGNING); + } + } + } + + static showPopPicker(stage) { + //显示弹出框 + if (stage.selectedModels?.size > 0) { + let models = Array.from(stage.selectedModels.values()) + if (models?.length > 0) { + let height = 100; + //计算弹出框的显示位置,这里需要把模型的坐标转换为dom的坐标 + let modelPos = DDeiUtil.getModelsDomAbsPosition(models) + let left = modelPos.left + (modelPos.width / 2) + let top = modelPos.top + (modelPos.height / 2) + if (modelPos.top - height <= modelPos.cTop) { + if (modelPos.height > 400) { + top = top + height + 20 + } else { + top = top + modelPos.height / 2 + 20; + } + } else { + top = top - height; + } + if (top < 0) { + top = modelPos.cTop + modelPos.cHeight / 2 + } + + if (left < 0) { + left = 0 + } + DDeiEditorUtil.showDialog(this.editor,'ddei-core-dialog-quickpop', { + group: "canvas-pop" + }, { type: 99, left: left, top: top, hiddenMask: true }, null, true, true) + } + } + } + + + /** + * 判定是否显示的方法 + */ + isVisiable(model: object): boolean { + if (!this.disabled && model?.modelType == 'DDeiSheet') { + //将sheet插入文件 + let editor = DDeiEditor.ACTIVE_INSTANCE + let file = editor?.files[editor.currentFileIndex]; + if (file.sheets.length > 1) { + return true + } + } + return false; + } + +} + +export default MenuRemoveSheet; diff --git a/plugins/core/panels/bottom/ChangeRatio.vue b/plugins/core/panels/bottom/ChangeRatio.vue new file mode 100644 index 0000000..29ef79c --- /dev/null +++ b/plugins/core/panels/bottom/ChangeRatio.vue @@ -0,0 +1,255 @@ + + + + diff --git a/plugins/core/panels/bottom/ManageLayers.vue b/plugins/core/panels/bottom/ManageLayers.vue new file mode 100644 index 0000000..0fd424a --- /dev/null +++ b/plugins/core/panels/bottom/ManageLayers.vue @@ -0,0 +1,66 @@ + + + + diff --git a/plugins/core/panels/bottom/Play.vue b/plugins/core/panels/bottom/Play.vue new file mode 100644 index 0000000..53602f6 --- /dev/null +++ b/plugins/core/panels/bottom/Play.vue @@ -0,0 +1,49 @@ + + + + diff --git a/plugins/core/panels/bottom/ShapeCount.vue b/plugins/core/panels/bottom/ShapeCount.vue new file mode 100644 index 0000000..2e66c92 --- /dev/null +++ b/plugins/core/panels/bottom/ShapeCount.vue @@ -0,0 +1,45 @@ + + + + diff --git a/plugins/core/panels/bottom/Sheets.vue b/plugins/core/panels/bottom/Sheets.vue new file mode 100644 index 0000000..789f2f0 --- /dev/null +++ b/plugins/core/panels/bottom/Sheets.vue @@ -0,0 +1,555 @@ + + + + diff --git a/plugins/core/panels/bottom/SuitRatio.vue b/plugins/core/panels/bottom/SuitRatio.vue new file mode 100644 index 0000000..d6b9f66 --- /dev/null +++ b/plugins/core/panels/bottom/SuitRatio.vue @@ -0,0 +1,125 @@ + + + + diff --git a/plugins/core/panels/bottom/changeratio.ts b/plugins/core/panels/bottom/changeratio.ts new file mode 100644 index 0000000..507dbe9 --- /dev/null +++ b/plugins/core/panels/bottom/changeratio.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import ChangeRatio from './ChangeRatio.vue'; + +class DDeiCoreChangeRatioPanel extends DDeiPluginBase{ + + name: string = ChangeRatio.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreChangeRatioPanel = new DDeiCoreChangeRatioPanel(null); + + + plugins: object[] = [ChangeRatio] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[ChangeRatio.name]) { + for (let i in options[ChangeRatio.name]) { + newOptions[i] = options[ChangeRatio.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreChangeRatioPanel(newOptions); + return panels; + } + } + return DDeiCoreChangeRatioPanel; + } +} + +export default DDeiCoreChangeRatioPanel \ No newline at end of file diff --git a/plugins/core/panels/bottom/index.ts b/plugins/core/panels/bottom/index.ts new file mode 100644 index 0000000..1ac7580 --- /dev/null +++ b/plugins/core/panels/bottom/index.ts @@ -0,0 +1,56 @@ +import {DDeiPluginBase} from "ddei-framework"; +import DDeiCoreShapeCountPanel from './shapecount'; +import DDeiCoreManageLayersPanel from './managelayers'; +import DDeiCorePlayPanel from './play'; +import DDeiCoreSuitRatioPanel from './suitratio'; +import DDeiCoreChangeRatioPanel from './changeratio'; +import DDeiCoreSheetsPanel from './sheets'; + +class DDeiCoreBottomPanels extends DDeiPluginBase{ + + + type:string = "package" + /** + * 缺省实例 + */ + static defaultIns:DDeiCoreBottomPanels = new DDeiCoreBottomPanels(null); + + plugins: object[] = [DDeiCoreShapeCountPanel, DDeiCoreManageLayersPanel, DDeiCorePlayPanel + , DDeiCoreSuitRatioPanel, DDeiCoreChangeRatioPanel, DDeiCoreSheetsPanel] + + getPanels(editor){ + let panels = [] + this.plugins?.forEach(plugin => { + let ls + if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { + ls = plugin.defaultIns.getPanels(editor); + } else if (plugin instanceof DDeiPluginBase) { + ls = plugin.getPanels(editor); + } + if (ls?.length > 0) { + panels = panels.concat(ls); + } + }) + return panels + } + + + + static configuration(options) { + if (options){ + //解析options,只使用自己相关的 + let panels = new DDeiCoreBottomPanels(options); + for (let i = 0; i < panels.plugins?.length;i++){ + panels.plugins[i] = panels.plugins[i].configuration(options,true) + } + return panels; + } + return DDeiCoreBottomPanels; + } +} + + +export { + DDeiCoreBottomPanels, DDeiCoreShapeCountPanel, DDeiCoreManageLayersPanel + , DDeiCorePlayPanel, DDeiCoreSuitRatioPanel, DDeiCoreChangeRatioPanel, DDeiCoreSheetsPanel } +export default DDeiCoreBottomPanels \ No newline at end of file diff --git a/plugins/core/panels/bottom/managelayers.ts b/plugins/core/panels/bottom/managelayers.ts new file mode 100644 index 0000000..5f0b3cf --- /dev/null +++ b/plugins/core/panels/bottom/managelayers.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import ManageLayers from './ManageLayers.vue'; + +class DDeiCoreManageLayersPanel extends DDeiPluginBase{ + + name: string = ManageLayers.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreManageLayersPanel = new DDeiCoreManageLayersPanel(null); + + + plugins: object[] = [ManageLayers] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[ManageLayers.name]) { + for (let i in options[ManageLayers.name]) { + newOptions[i] = options[ManageLayers.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreManageLayersPanel(newOptions); + return panels; + } + } + return DDeiCoreManageLayersPanel; + } +} + +export default DDeiCoreManageLayersPanel \ No newline at end of file diff --git a/plugins/core/panels/bottom/play.ts b/plugins/core/panels/bottom/play.ts new file mode 100644 index 0000000..2b9f988 --- /dev/null +++ b/plugins/core/panels/bottom/play.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import Play from './Play.vue'; + +class DDeiCorePlayPanel extends DDeiPluginBase{ + + name: string = Play.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCorePlayPanel = new DDeiCorePlayPanel(null); + + + plugins: object[] = [Play] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[Play.name]) { + for (let i in options[Play.name]) { + newOptions[i] = options[Play.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCorePlayPanel(newOptions); + return panels; + } + } + return DDeiCorePlayPanel; + } +} + +export default DDeiCorePlayPanel \ No newline at end of file diff --git a/plugins/core/panels/bottom/shapecount.ts b/plugins/core/panels/bottom/shapecount.ts new file mode 100644 index 0000000..78bc502 --- /dev/null +++ b/plugins/core/panels/bottom/shapecount.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import ShapeCount from './ShapeCount.vue'; + +class DDeiCoreShapeCountPanel extends DDeiPluginBase{ + + name: string = ShapeCount.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreShapeCountPanel = new DDeiCoreShapeCountPanel(null); + + + plugins: object[] = [ShapeCount] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[ShapeCount.name]) { + for (let i in options[ShapeCount.name]) { + newOptions[i] = options[ShapeCount.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreShapeCountPanel(newOptions); + return panels; + } + } + return DDeiCoreShapeCountPanel; + } +} + +export default DDeiCoreShapeCountPanel \ No newline at end of file diff --git a/plugins/core/panels/bottom/sheets.ts b/plugins/core/panels/bottom/sheets.ts new file mode 100644 index 0000000..c42cac3 --- /dev/null +++ b/plugins/core/panels/bottom/sheets.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import Sheets from './Sheets.vue'; + +class DDeiCoreSheetsPanel extends DDeiPluginBase{ + + name: string = Sheets.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreSheetsPanel = new DDeiCoreSheetsPanel(null); + + + plugins: object[] = [Sheets] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[Sheets.name]) { + for (let i in options[Sheets.name]) { + newOptions[i] = options[Sheets.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreSheetsPanel(newOptions); + return panels; + } + } + return DDeiCoreSheetsPanel; + } +} + +export default DDeiCoreSheetsPanel \ No newline at end of file diff --git a/plugins/core/panels/bottom/suitratio.ts b/plugins/core/panels/bottom/suitratio.ts new file mode 100644 index 0000000..b07aea7 --- /dev/null +++ b/plugins/core/panels/bottom/suitratio.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import SuitRatio from './SuitRatio.vue'; + +class DDeiCoreSuitRatioPanel extends DDeiPluginBase{ + + name: string = SuitRatio.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreSuitRatioPanel = new DDeiCoreSuitRatioPanel(null); + + + plugins: object[] = [SuitRatio] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[SuitRatio.name]) { + for (let i in options[SuitRatio.name]) { + newOptions[i] = options[SuitRatio.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreSuitRatioPanel(newOptions); + return panels; + } + } + return DDeiCoreSuitRatioPanel; + } +} + +export default DDeiCoreSuitRatioPanel \ No newline at end of file diff --git a/plugins/core/panels/bottommenu/BottomMenu.vue b/plugins/core/panels/bottommenu/BottomMenu.vue new file mode 100644 index 0000000..483236f --- /dev/null +++ b/plugins/core/panels/bottommenu/BottomMenu.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/plugins/core/panels/bottommenu/index.ts b/plugins/core/panels/bottommenu/index.ts new file mode 100644 index 0000000..1dad839 --- /dev/null +++ b/plugins/core/panels/bottommenu/index.ts @@ -0,0 +1,48 @@ +import {DDeiPluginBase} from "ddei-framework"; +import BottomMenu from './BottomMenu.vue'; + +class DDeiCoreBottomMenuPanel extends DDeiPluginBase{ + + name: string = BottomMenu.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreBottomMenuPanel = new DDeiCoreBottomMenuPanel(); + + defaultOptions: object = { + 'panels': ["ddei-core-panel-bottom-sheets", "ddei-core-panel-bottom-shapecount", "ddei-core-panel-bottom-play", + "ddei-core-panel-bottom-managelayers", "ddei-core-panel-bottom-changeratio", "ddei-core-panel-bottom-suitratio"] + } + + plugins: object[] = [BottomMenu] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[BottomMenu.name]) { + for (let i in options[BottomMenu.name]) { + newOptions[i] = options[BottomMenu.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreBottomMenuPanel(newOptions); + return panels; + } + } + return DDeiCoreBottomMenuPanel; + } +} + +export default DDeiCoreBottomMenuPanel \ No newline at end of file diff --git a/plugins/core/panels/canvasview/CanvasView.vue b/plugins/core/panels/canvasview/CanvasView.vue new file mode 100644 index 0000000..dbdb48d --- /dev/null +++ b/plugins/core/panels/canvasview/CanvasView.vue @@ -0,0 +1,474 @@ + + + + + diff --git a/plugins/core/panels/canvasview/index.ts b/plugins/core/panels/canvasview/index.ts new file mode 100644 index 0000000..7d0caeb --- /dev/null +++ b/plugins/core/panels/canvasview/index.ts @@ -0,0 +1,45 @@ +import {DDeiPluginBase} from "ddei-framework"; +import CanvasView from './CanvasView.vue'; + +class DDeiCoreCanvasViewPanel extends DDeiPluginBase{ + + name: string = CanvasView.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreCanvasViewPanel = new DDeiCoreCanvasViewPanel(null); + + + plugins: object[] = [CanvasView] + + getPanels(editor){ + return this.plugins; + } + + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[CanvasView.name]) { + for (let i in options[CanvasView.name]) { + newOptions[i] = options[CanvasView.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreCanvasViewPanel(newOptions); + return panels; + } + } + return DDeiCoreCanvasViewPanel; + } +} + +export default DDeiCoreCanvasViewPanel \ No newline at end of file diff --git a/plugins/core/panels/common/ExportAndImport.vue b/plugins/core/panels/common/ExportAndImport.vue new file mode 100644 index 0000000..14a5d86 --- /dev/null +++ b/plugins/core/panels/common/ExportAndImport.vue @@ -0,0 +1,199 @@ + + + + diff --git a/plugins/core/panels/common/FileInfo.vue b/plugins/core/panels/common/FileInfo.vue new file mode 100644 index 0000000..5902a1f --- /dev/null +++ b/plugins/core/panels/common/FileInfo.vue @@ -0,0 +1,436 @@ + + + + diff --git a/plugins/core/panels/common/FileOperate.vue b/plugins/core/panels/common/FileOperate.vue new file mode 100644 index 0000000..6b3e371 --- /dev/null +++ b/plugins/core/panels/common/FileOperate.vue @@ -0,0 +1,306 @@ + + + + diff --git a/plugins/core/panels/common/FontAndText.vue b/plugins/core/panels/common/FontAndText.vue new file mode 100644 index 0000000..41f9080 --- /dev/null +++ b/plugins/core/panels/common/FontAndText.vue @@ -0,0 +1,237 @@ + + + + diff --git a/plugins/core/panels/common/Operate.vue b/plugins/core/panels/common/Operate.vue new file mode 100644 index 0000000..df50212 --- /dev/null +++ b/plugins/core/panels/common/Operate.vue @@ -0,0 +1,252 @@ + + + + diff --git a/plugins/core/panels/common/Sort.vue b/plugins/core/panels/common/Sort.vue new file mode 100644 index 0000000..4b84b70 --- /dev/null +++ b/plugins/core/panels/common/Sort.vue @@ -0,0 +1,237 @@ + + + + diff --git a/plugins/core/panels/common/Style.vue b/plugins/core/panels/common/Style.vue new file mode 100644 index 0000000..36d4695 --- /dev/null +++ b/plugins/core/panels/common/Style.vue @@ -0,0 +1,188 @@ + + + + diff --git a/plugins/core/panels/common/Tool.vue b/plugins/core/panels/common/Tool.vue new file mode 100644 index 0000000..172aa96 --- /dev/null +++ b/plugins/core/panels/common/Tool.vue @@ -0,0 +1,182 @@ + + + + diff --git a/plugins/core/panels/common/exportandimport.ts b/plugins/core/panels/common/exportandimport.ts new file mode 100644 index 0000000..3f1791c --- /dev/null +++ b/plugins/core/panels/common/exportandimport.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import ExportAndImport from './ExportAndImport.vue'; + +class DDeiCoreExportAndImportPanel extends DDeiPluginBase{ + + name: string = ExportAndImport.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreExportAndImportPanel = new DDeiCoreExportAndImportPanel(null); + + + plugins: object[] = [ExportAndImport] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[ExportAndImport.name]) { + for (let i in options[ExportAndImport.name]) { + newOptions[i] = options[ExportAndImport.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreExportAndImportPanel(newOptions); + return panels; + } + } + return DDeiCoreExportAndImportPanel; + } +} + +export default DDeiCoreExportAndImportPanel \ No newline at end of file diff --git a/plugins/core/panels/common/fileinfo.ts b/plugins/core/panels/common/fileinfo.ts new file mode 100644 index 0000000..30ffaad --- /dev/null +++ b/plugins/core/panels/common/fileinfo.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import FileInfo from './FileInfo.vue'; + +class DDeiCoreFileInfoPanel extends DDeiPluginBase{ + + name: string = FileInfo.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreFileInfoPanel = new DDeiCoreFileInfoPanel(null); + + + plugins: object[] = [FileInfo] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[FileInfo.name]) { + for (let i in options[FileInfo.name]) { + newOptions[i] = options[FileInfo.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreFileInfoPanel(newOptions); + return panels; + } + } + return DDeiCoreFileInfoPanel; + } +} + +export default DDeiCoreFileInfoPanel \ No newline at end of file diff --git a/plugins/core/panels/common/fileoperate.ts b/plugins/core/panels/common/fileoperate.ts new file mode 100644 index 0000000..290280b --- /dev/null +++ b/plugins/core/panels/common/fileoperate.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import FileOperate from './FileOperate.vue'; + +class DDeiCoreFileOperatePanel extends DDeiPluginBase{ + + name: string = FileOperate.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreFileOperatePanel = new DDeiCoreFileOperatePanel(null); + + + plugins: object[] = [FileOperate] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[FileOperate.name]) { + for (let i in options[FileOperate.name]) { + newOptions[i] = options[FileOperate.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreFileOperatePanel(newOptions); + return panels; + } + } + return DDeiCoreFileOperatePanel; + } +} + +export default DDeiCoreFileOperatePanel \ No newline at end of file diff --git a/plugins/core/panels/common/fontandtext.ts b/plugins/core/panels/common/fontandtext.ts new file mode 100644 index 0000000..b631fcc --- /dev/null +++ b/plugins/core/panels/common/fontandtext.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import FontAndText from './FontAndText.vue'; + +class DDeiCoreFontAndTextPanel extends DDeiPluginBase{ + + name: string = FontAndText.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreFontAndTextPanel = new DDeiCoreFontAndTextPanel(null); + + + plugins: object[] = [FontAndText] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[FontAndText.name]) { + for (let i in options[FontAndText.name]) { + newOptions[i] = options[FontAndText.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreFontAndTextPanel(newOptions); + return panels; + } + } + return DDeiCoreFontAndTextPanel; + } +} + +export default DDeiCoreFontAndTextPanel \ No newline at end of file diff --git a/plugins/core/panels/common/index.ts b/plugins/core/panels/common/index.ts new file mode 100644 index 0000000..1c82ec3 --- /dev/null +++ b/plugins/core/panels/common/index.ts @@ -0,0 +1,61 @@ +import {DDeiPluginBase} from "ddei-framework"; +import DDeiCoreExportAndImportPanel from './exportandimport'; +import DDeiCoreFileInfoPanel from './fileinfo'; +import DDeiCoreFileOperatePanel from './fileoperate'; +import DDeiCoreFontAndTextPanel from './fontandtext'; +import DDeiCoreOperatePanel from './operate'; +import DDeiCoreSortPanel from './sort'; +import DDeiCoreStylePanel from './style'; +import DDeiCoreToolPanel from './tool'; + +class DDeiCoreCommonPanels extends DDeiPluginBase{ + + + type:string = "package" + /** + * 缺省实例 + */ + static defaultIns:DDeiCoreCommonPanels = new DDeiCoreCommonPanels(null); + + plugins: object[] = [DDeiCoreExportAndImportPanel, DDeiCoreFileInfoPanel, + DDeiCoreFileOperatePanel, DDeiCoreFontAndTextPanel, DDeiCoreOperatePanel, + DDeiCoreOperatePanel, DDeiCoreSortPanel, DDeiCoreStylePanel, + DDeiCoreToolPanel] + + getPanels(editor){ + let panels = [] + this.plugins?.forEach(plugin => { + let ls + if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { + ls = plugin.defaultIns.getPanels(editor); + } else if (plugin instanceof DDeiPluginBase) { + ls = plugin.getPanels(editor); + } + if (ls?.length > 0) { + panels = panels.concat(ls); + } + }) + return panels + } + + + + static configuration(options) { + if (options){ + //解析options,只使用自己相关的 + let panels = new DDeiCoreCommonPanels(options); + for (let i = 0; i < panels.plugins?.length;i++){ + panels.plugins[i] = panels.plugins[i].configuration(options,true) + } + return panels; + } + return DDeiCoreCommonPanels; + } +} + + +export {DDeiCoreCommonPanels, DDeiCoreExportAndImportPanel, DDeiCoreFileInfoPanel, + DDeiCoreFileOperatePanel, DDeiCoreFontAndTextPanel, DDeiCoreOperatePanel, + DDeiCoreSortPanel, DDeiCoreStylePanel, + DDeiCoreToolPanel} +export default DDeiCoreCommonPanels \ No newline at end of file diff --git a/plugins/core/panels/common/operate.ts b/plugins/core/panels/common/operate.ts new file mode 100644 index 0000000..184e363 --- /dev/null +++ b/plugins/core/panels/common/operate.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import Operate from './Operate.vue'; + +class DDeiCoreOperatePanel extends DDeiPluginBase{ + + name: string = Operate.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreOperatePanel = new DDeiCoreOperatePanel(null); + + + plugins: object[] = [Operate] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[Operate.name]) { + for (let i in options[Operate.name]) { + newOptions[i] = options[Operate.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreOperatePanel(newOptions); + return panels; + } + } + return DDeiCoreOperatePanel; + } +} + +export default DDeiCoreOperatePanel \ No newline at end of file diff --git a/plugins/core/panels/common/sort.ts b/plugins/core/panels/common/sort.ts new file mode 100644 index 0000000..3d185dc --- /dev/null +++ b/plugins/core/panels/common/sort.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import Sort from './Sort.vue'; + +class DDeiCoreSortPanel extends DDeiPluginBase{ + + name: string = Sort.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreSortPanel = new DDeiCoreSortPanel(null); + + + plugins: object[] = [Sort] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[Sort.name]) { + for (let i in options[Sort.name]) { + newOptions[i] = options[Sort.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreSortPanel(newOptions); + return panels; + } + } + return DDeiCoreSortPanel; + } +} + +export default DDeiCoreSortPanel \ No newline at end of file diff --git a/plugins/core/panels/common/style.ts b/plugins/core/panels/common/style.ts new file mode 100644 index 0000000..9405225 --- /dev/null +++ b/plugins/core/panels/common/style.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import Style from './Style.vue'; + +class DDeiCoreStylePanel extends DDeiPluginBase{ + + name: string = Style.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreStylePanel = new DDeiCoreStylePanel(null); + + + plugins: object[] = [Style] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[Style.name]) { + for (let i in options[Style.name]) { + newOptions[i] = options[Style.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreStylePanel(newOptions); + return panels; + } + } + return DDeiCoreStylePanel; + } +} + +export default DDeiCoreStylePanel \ No newline at end of file diff --git a/plugins/core/panels/common/tool.ts b/plugins/core/panels/common/tool.ts new file mode 100644 index 0000000..2876967 --- /dev/null +++ b/plugins/core/panels/common/tool.ts @@ -0,0 +1,46 @@ +import {DDeiPluginBase} from "ddei-framework"; +import Tool from './Tool.vue'; + +class DDeiCoreToolPanel extends DDeiPluginBase{ + + name: string = Tool.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreToolPanel = new DDeiCoreToolPanel(null); + + + plugins: object[] = [Tool] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[Tool.name]) { + for (let i in options[Tool.name]) { + newOptions[i] = options[Tool.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreToolPanel(newOptions); + return panels; + } + } + return DDeiCoreToolPanel; + } +} + +export default DDeiCoreToolPanel \ No newline at end of file diff --git a/plugins/core/panels/index.ts b/plugins/core/panels/index.ts new file mode 100644 index 0000000..631be50 --- /dev/null +++ b/plugins/core/panels/index.ts @@ -0,0 +1,68 @@ +import {DDeiPluginBase} from "ddei-framework"; +import DDeiCoreTopMenuPanel from './topmenu'; +import DDeiCoreToolboxPanel from './toolbox'; +import DDeiCoreQuickColorViewPanel from './quickcolor'; +import DDeiCorePropertyViewPanel from './propertyview'; +import DDeiCoreOpenFilesViewPanel from './openfilesview'; +import DDeiCoreCanvasViewPanel from './canvasview'; +import DDeiCoreBottomMenuPanel from './bottommenu'; +import DDeiCoreCommonPanels from './common'; +import DDeiCoreBottomPanels from './bottom'; + +class DDeiCorePanels extends DDeiPluginBase{ + + type:string = "package" + /** + * 缺省实例 + */ + static defaultIns:DDeiCorePanels = new DDeiCorePanels(null); + + plugins: object[] = [DDeiCoreTopMenuPanel, DDeiCoreToolboxPanel, DDeiCoreQuickColorViewPanel, DDeiCorePropertyViewPanel, + DDeiCoreOpenFilesViewPanel, DDeiCoreCanvasViewPanel, DDeiCoreBottomMenuPanel, DDeiCoreCommonPanels, DDeiCoreBottomPanels] + + getPanels(editor){ + let panels = [] + this.plugins?.forEach(plugin => { + let ls + if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) { + ls = plugin.defaultIns.getPanels(editor); + } else if (plugin instanceof DDeiPluginBase) { + ls = plugin.getPanels(editor); + } + if (ls?.length > 0) { + panels = panels.concat(ls); + } + }) + return panels + } + + + + static configuration(options) { + if (options){ + //解析options,只使用自己相关的 + let panels = new DDeiCorePanels(options); + for (let i = 0; i < panels.plugins?.length;i++){ + panels.plugins[i] = panels.plugins[i].configuration(options,true) + } + return panels; + } + return DDeiCorePanels; + } +} + + +export * from './topmenu' +export * from './toolbox' +export * from './quickcolor' +export * from './propertyview' +export * from './openfilesview' +export * from './canvasview' +export * from './bottommenu' +export * from './common' +export * from './bottom' +export { + DDeiCorePanels, DDeiCoreTopMenuPanel, DDeiCoreToolboxPanel, DDeiCoreQuickColorViewPanel, DDeiCorePropertyViewPanel, + DDeiCoreOpenFilesViewPanel, DDeiCoreCanvasViewPanel, DDeiCoreBottomMenuPanel, DDeiCoreCommonPanels, DDeiCoreBottomPanels +} +export default DDeiCorePanels \ No newline at end of file diff --git a/plugins/core/panels/openfilesview/OpenFilesView.vue b/plugins/core/panels/openfilesview/OpenFilesView.vue new file mode 100644 index 0000000..b1d722f --- /dev/null +++ b/plugins/core/panels/openfilesview/OpenFilesView.vue @@ -0,0 +1,752 @@ + + + + + diff --git a/plugins/core/panels/openfilesview/index.ts b/plugins/core/panels/openfilesview/index.ts new file mode 100644 index 0000000..141e951 --- /dev/null +++ b/plugins/core/panels/openfilesview/index.ts @@ -0,0 +1,44 @@ +import {DDeiPluginBase} from "ddei-framework"; +import OpenFilesView from './OpenFilesView.vue'; + +class DDeiCoreOpenFilesViewPanel extends DDeiPluginBase{ + + name: string = OpenFilesView.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreOpenFilesViewPanel = new DDeiCoreOpenFilesViewPanel(null); + + + plugins: object[] = [OpenFilesView] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[OpenFilesView.name]) { + for (let i in options[OpenFilesView.name]) { + newOptions[i] = options[OpenFilesView.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreOpenFilesViewPanel(newOptions); + return panels; + } + } + return DDeiCoreOpenFilesViewPanel; + } +} + +export default DDeiCoreOpenFilesViewPanel \ No newline at end of file diff --git a/plugins/core/panels/propertyview/PropertyView.vue b/plugins/core/panels/propertyview/PropertyView.vue new file mode 100644 index 0000000..1ee0fd2 --- /dev/null +++ b/plugins/core/panels/propertyview/PropertyView.vue @@ -0,0 +1,647 @@ + + + + + diff --git a/plugins/core/panels/propertyview/index.ts b/plugins/core/panels/propertyview/index.ts new file mode 100644 index 0000000..40170e0 --- /dev/null +++ b/plugins/core/panels/propertyview/index.ts @@ -0,0 +1,45 @@ +import {DDeiPluginBase} from "ddei-framework"; +import PropertyView from './PropertyView.vue'; + +class DDeiCorePropertyViewPanel extends DDeiPluginBase{ + + name: string = PropertyView.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCorePropertyViewPanel = new DDeiCorePropertyViewPanel(); + + + plugins: object[] = [PropertyView] + + getPanels(editor){ + return this.plugins; + } + + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[PropertyView.name]) { + for (let i in options[PropertyView.name]) { + newOptions[i] = options[PropertyView.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCorePropertyViewPanel(newOptions); + return panels; + } + } + return DDeiCorePropertyViewPanel; + } +} + +export default DDeiCorePropertyViewPanel \ No newline at end of file diff --git a/plugins/core/panels/quickcolor/QuickColorView.vue b/plugins/core/panels/quickcolor/QuickColorView.vue new file mode 100644 index 0000000..18b4c9f --- /dev/null +++ b/plugins/core/panels/quickcolor/QuickColorView.vue @@ -0,0 +1,285 @@ + + + + + diff --git a/plugins/core/panels/quickcolor/index.ts b/plugins/core/panels/quickcolor/index.ts new file mode 100644 index 0000000..2020e09 --- /dev/null +++ b/plugins/core/panels/quickcolor/index.ts @@ -0,0 +1,43 @@ +import {DDeiPluginBase} from "ddei-framework"; +import QuickColorView from './QuickColorView.vue'; + +class DDeiCoreQuickColorViewPanel extends DDeiPluginBase{ + name: string = QuickColorView.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreQuickColorViewPanel = new DDeiCoreQuickColorViewPanel(null); + + + plugins: object[] = [QuickColorView] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[QuickColorView.name]) { + for (let i in options[QuickColorView.name]) { + newOptions[i] = options[QuickColorView.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreQuickColorViewPanel(newOptions); + return panels; + } + } + return DDeiCoreQuickColorViewPanel; + } +} + +export default DDeiCoreQuickColorViewPanel \ No newline at end of file diff --git a/plugins/core/panels/toolbox/Toolbox.vue b/plugins/core/panels/toolbox/Toolbox.vue new file mode 100644 index 0000000..d48c189 --- /dev/null +++ b/plugins/core/panels/toolbox/Toolbox.vue @@ -0,0 +1,649 @@ + + + + + diff --git a/plugins/core/panels/toolbox/index.ts b/plugins/core/panels/toolbox/index.ts new file mode 100644 index 0000000..dc74885 --- /dev/null +++ b/plugins/core/panels/toolbox/index.ts @@ -0,0 +1,43 @@ +import {DDeiPluginBase} from "ddei-framework"; +import Toolbox from './Toolbox.vue'; + +class DDeiCoreToolboxPanel extends DDeiPluginBase{ + name: string = Toolbox.name + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreToolboxPanel = new DDeiCoreToolboxPanel(); + + plugins: object[] = [Toolbox] + + getPanels(editor){ + return this.plugins; + } + + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[Toolbox.name]) { + for (let i in options[Toolbox.name]) { + newOptions[i] = options[Toolbox.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreToolboxPanel(newOptions); + return panels; + } + } + return DDeiCoreToolboxPanel; + } +} + +export default DDeiCoreToolboxPanel \ No newline at end of file diff --git a/plugins/core/panels/topmenu/TopMenu.vue b/plugins/core/panels/topmenu/TopMenu.vue new file mode 100644 index 0000000..da3bf18 --- /dev/null +++ b/plugins/core/panels/topmenu/TopMenu.vue @@ -0,0 +1,91 @@ + + + + diff --git a/plugins/core/panels/topmenu/index.ts b/plugins/core/panels/topmenu/index.ts new file mode 100644 index 0000000..a81ec84 --- /dev/null +++ b/plugins/core/panels/topmenu/index.ts @@ -0,0 +1,53 @@ +import {DDeiPluginBase} from "ddei-framework"; +import TopMenu from './TopMenu.vue'; + + +class DDeiCoreTopMenuPanel extends DDeiPluginBase{ + + name: string = TopMenu.name + + + /** + * 缺省实例 + */ + static defaultIns: DDeiCoreTopMenuPanel = new DDeiCoreTopMenuPanel(); + + defaultOptions: object = { + 'panels': ["ddei-core-panel-fileinfo", + "ddei-core-panel-operate", "ddei-core-panel-fontandtext", "ddei-core-panel-tool" + , "ddei-core-panel-sort"] + } + + + plugins: object[] = [TopMenu] + + getPanels(editor){ + return this.plugins; + } + + + static configuration(options, fullConfig: boolean = false) { + //解析options,只使用自己相关的 + if (options) { + let newOptions = {} + if (fullConfig) { + if (fullConfig) { + if (options[TopMenu.name]) { + for (let i in options[TopMenu.name]) { + newOptions[i] = options[TopMenu.name][i] + } + } + } + } else { + newOptions = options + } + if (newOptions && Object.keys(newOptions).length !== 0) { + let panels = new DDeiCoreTopMenuPanel(newOptions); + return panels; + } + } + return DDeiCoreTopMenuPanel; + } +} + +export default DDeiCoreTopMenuPanel \ No newline at end of file diff --git a/plugins/core/propeditors/PVAlignTypeEditor.vue b/plugins/core/propeditors/PVAlignTypeEditor.vue new file mode 100644 index 0000000..8d69ac4 --- /dev/null +++ b/plugins/core/propeditors/PVAlignTypeEditor.vue @@ -0,0 +1,366 @@ + + + + + diff --git a/plugins/core/propeditors/PVBaseCombox.vue b/plugins/core/propeditors/PVBaseCombox.vue new file mode 100644 index 0000000..08899a8 --- /dev/null +++ b/plugins/core/propeditors/PVBaseCombox.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/plugins/core/propeditors/PVBorderDashComboEditor.vue b/plugins/core/propeditors/PVBorderDashComboEditor.vue new file mode 100644 index 0000000..695084c --- /dev/null +++ b/plugins/core/propeditors/PVBorderDashComboEditor.vue @@ -0,0 +1,260 @@ + + + + + diff --git a/plugins/core/propeditors/PVBorderTypeEditor.vue b/plugins/core/propeditors/PVBorderTypeEditor.vue new file mode 100644 index 0000000..5465846 --- /dev/null +++ b/plugins/core/propeditors/PVBorderTypeEditor.vue @@ -0,0 +1,312 @@ + + + + + diff --git a/plugins/core/propeditors/PVColorComboEditor.vue b/plugins/core/propeditors/PVColorComboEditor.vue new file mode 100644 index 0000000..3e9b6c7 --- /dev/null +++ b/plugins/core/propeditors/PVColorComboEditor.vue @@ -0,0 +1,249 @@ + + + + + diff --git a/plugins/core/propeditors/PVColorEditor.vue b/plugins/core/propeditors/PVColorEditor.vue new file mode 100644 index 0000000..12fe5ca --- /dev/null +++ b/plugins/core/propeditors/PVColorEditor.vue @@ -0,0 +1,251 @@ + + + + + diff --git a/plugins/core/propeditors/PVComboxEditor.vue b/plugins/core/propeditors/PVComboxEditor.vue new file mode 100644 index 0000000..d20ada9 --- /dev/null +++ b/plugins/core/propeditors/PVComboxEditor.vue @@ -0,0 +1,405 @@ + + + + + diff --git a/plugins/core/propeditors/PVExCheckboxEditor.vue b/plugins/core/propeditors/PVExCheckboxEditor.vue new file mode 100644 index 0000000..45f8397 --- /dev/null +++ b/plugins/core/propeditors/PVExCheckboxEditor.vue @@ -0,0 +1,432 @@ + + + + + diff --git a/plugins/core/propeditors/PVFillTypeEditor.vue b/plugins/core/propeditors/PVFillTypeEditor.vue new file mode 100644 index 0000000..34d8c26 --- /dev/null +++ b/plugins/core/propeditors/PVFillTypeEditor.vue @@ -0,0 +1,307 @@ + + + + + diff --git a/plugins/core/propeditors/PVFontSizeEditor.vue b/plugins/core/propeditors/PVFontSizeEditor.vue new file mode 100644 index 0000000..91354ed --- /dev/null +++ b/plugins/core/propeditors/PVFontSizeEditor.vue @@ -0,0 +1,259 @@ + + + + + diff --git a/plugins/core/propeditors/PVImageEditor.vue b/plugins/core/propeditors/PVImageEditor.vue new file mode 100644 index 0000000..3ac6d37 --- /dev/null +++ b/plugins/core/propeditors/PVImageEditor.vue @@ -0,0 +1,260 @@ + + + + + diff --git a/plugins/core/propeditors/PVRadioEditor.vue b/plugins/core/propeditors/PVRadioEditor.vue new file mode 100644 index 0000000..3423895 --- /dev/null +++ b/plugins/core/propeditors/PVRadioEditor.vue @@ -0,0 +1,244 @@ + + + + + diff --git a/plugins/core/propeditors/PVRangeEditor.vue b/plugins/core/propeditors/PVRangeEditor.vue new file mode 100644 index 0000000..1a75ba9 --- /dev/null +++ b/plugins/core/propeditors/PVRangeEditor.vue @@ -0,0 +1,241 @@ + + + + + diff --git a/plugins/core/propeditors/PVSwitchCheckboxEditor.vue b/plugins/core/propeditors/PVSwitchCheckboxEditor.vue new file mode 100644 index 0000000..5c81ba3 --- /dev/null +++ b/plugins/core/propeditors/PVSwitchCheckboxEditor.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/plugins/core/propeditors/PVTextAreaEditor.vue b/plugins/core/propeditors/PVTextAreaEditor.vue new file mode 100644 index 0000000..9e3420f --- /dev/null +++ b/plugins/core/propeditors/PVTextAreaEditor.vue @@ -0,0 +1,195 @@ +