diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 77738287f..000000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist/ \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 0041bf7e0..3fbfc3524 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,29 +21,23 @@ "ecmaVersion": 6, "sourceType": "module", "ecmaFeatures": { - "modules": true, - "legacyDecorators": true + "modules": true } }, "plugins": ["@typescript-eslint/eslint-plugin"], "overrides": [{ "files": ["src/*.js","src/**/*.js", "demo/*.js", "demo/**/*.js", "i18n/**/*.js", "i18n/*.js", "test/**/*.js", "test/*.js", "examples/*.js", "examples/**/*.js"], - "extends": "plugin:@fui/esnext", + "extends": "plugin:@fui/es5", "rules": { "no-param-reassign": "off", "quotes": [2, "double"], - "comma-dangle": ["error", { "arrays": "never", "objects": "always-multiline"}], // 多行对象字面量中要求拖尾逗号 - "no-var": 2, - "prefer-const": 2, - "indent": ["error", 4, { "SwitchCase": 1 }], - "no-use-before-define": 0, - "eqeqeq": 0 + "comma-dangle": ["error", { "arrays": "never", "objects": "always-multiline"}] // 多行对象字面量中要求拖尾逗号 } }, { "files": ["webpack/*.js", "./*.js", "lib/**/*.js", "lib/*.js", "./bin/*.js", "./bin/**/*.js"], "extends": "plugin:@fui/esnext" - // }, { - // "files": ["types/*.ts", "typescript/*.ts","typescript/**/*.ts"], - // "extends": "plugin:@fui/typescript" + }, { + "files": ["types/*.ts", "typescript/*.ts","typescript/**/*.ts"], + "extends": "plugin:@fui/typescript" }] } diff --git a/.gitignore b/.gitignore index 7ccb96f74..a0270fb28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,2 @@ -node_modules/ -/.idea/ -#demo.js -#demo.css -.DS_Store -coverage -unit.test.statistic.json -package-lock.json -yarn.lock -*.tgz -dist/ +node_modules +dist \ No newline at end of file diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 0f0f7d2e4..000000000 --- a/.npmignore +++ /dev/null @@ -1,44 +0,0 @@ -* -!public/less/*.less -!src/less/**/* -!dist/lib/*.d.ts -!dist/lib/**/*.d.ts -!dist/font.css -!dist/fineui.css -!dist/fineui.js -!dist/fineui.js.map -!dist/fineui.min.css -!dist/fineui_without_normalize.min.css -!dist/fineui.min.js -!dist/fineui.min.js.map -!dist/core.css -!dist/core.js -!dist/resource.css -!dist/resource.js -!dist/utils.js -!dist/utils.js.map -!dist/utils.min.js -!dist/utils.min.js.map -!dist/fineui_without_jquery_polyfill.js -!dist/2.0/fineui.css -!dist/2.0/fineui.js -!dist/2.0/fineui.js.map -!dist/2.0/fineui.min.css -!dist/2.0/fineui.min.js -!dist/2.0/fineui.min.js.map -!dist/2.0/fineui_without_normalize.css -!dist/2.0/fineui_without_normalize.min.css -!dist/font/* -!dist/font/**/* -!dist/images/* -!dist/images/**/* -!dist/router.js -!babel.config.js -!babel.config.ie8.js -!.eslintrc -!dist/2.0/jsy.min.css -!dist/2.0/bi.min.css -!bin/* -!bin/**/* -!plugins/* -!plugins/**/* diff --git a/.npmrc b/.npmrc index 92937ea32..53b9f67c8 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,3 @@ puppeteer_download_host=https://npm.taobao.org/mirrors -@fui:registry=https://npm.fineres.com/ +# @fui:registry=http://43.143.93.24:4873/ +@fui:registry=https://npm.fineres.com/ \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..0b2315b16 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "singleQuote": false, + "tabWidth": 4, + "printWidth": 120, + "arrowParens": "avoid", + "endOfLine": "auto" +} diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 76cf19ec8..000000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright©2015-present 帆软软件有限公司 - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index d77fa284b..000000000 --- a/README.md +++ /dev/null @@ -1,15 +0,0 @@ -FineUI -============ -[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) -> UI Framework used in FineBI and FineReport - -For more details, see the website [http://www.fanruan.com](http://www.fanruan.com). - -Documentation -============= - -http://fanruan.design/doc.html?post=0169cf558d - -License -============ -Please refer to [LICENSE](https://code.fanruan.com/fanruan/fineui/src/branch/master/LICENSE) file. diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 12cd09e66..000000000 --- a/babel.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@fui/babel-preset-fineui').configs.base; diff --git a/bi.lessconfig.json b/bi.lessconfig.json deleted file mode 100644 index d82f94985..000000000 --- a/bi.lessconfig.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "@color-primary": "#2C60DB", - "@color-green-100": "#3FC47B", - "@color-light-blue-100": "#19B8EA", - "@color-orange-100": "#FAAA39", - "@color-red-100": "#E65251", - "@color-black": "#091E40", - "@color-light-gray": "#ECEEF3", - "@color-light-gray-theme-dark": "#292F45", - "@border-color-line": "rgba(9, 30, 64, 0.15)", - "@border-color-light-line": "#E6E9EF", - "@border-color-dark-line": "#2E3A4D", - "@color-sliver-theme-dark": "#363E55", - "@border-color-disabled": "rgba(9, 30, 64, 0.07)", - "@font-color-normal": "#091E40", - "@font-color-gray": "rgba(9, 30, 64, 0.9)", - "@font-color-light-gray": "rgba(9, 30, 64, 0.66)", - "@font-color-tips": "rgba(9, 30, 64, 0.47)", - "@font-color-disabled": "rgba(9, 30, 64, 0.25)", - "@background-color-normal": "#F8F9FC", - "@color-bi-background-active-radio": "transparent", - "@color-bi-border-radio": "rgba(9, 30, 64, 0.37)", - "@color-bi-border-disabled-radio": "rgba(9, 30, 64, 0.19)", - "@color-bi-background-active-radio-content": "#2C60DB", - "@color-bi-border-checkbox-theme-dark": "rgba(255, 255, 255, 0.37)", - "@color-bi-border-hover-active-radio-theme-dark": "#3869DC", - "@color-bi-background-active-radio-content-theme-dark": "#3869DC", - "@color-bi-background-disabled-active-radio-content": "#FFFFFF", - "@color-bi-background-disabled-active-radio-content-theme-dark": "#606479", - "@color-bi-background-disabled-active-checkbox-content": "#FFFFFF", - "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479", - "@color-bi-background-tooltip-success": "#3F506A", - "@color-bi-background-tooltip-failure": "#E65251", - "@color-bi-border-tooltip-success": "#2E3A4D", - "@color-bi-background-toast-success": "#FFFFFF", - "@color-bi-background-toast-warning": "#FFFFFF", - "@color-bi-background-toast-error": "#FFFFFF", - "@color-bi-background-toast-normal": "#FFFFFF", - "@color-bi-color-toast-success": "#3FC47B", - "@color-bi-color-toast-warning": "#FAAA39", - "@color-bi-color-toast-error": "#E65251", - "@color-bi-color-toast-normal": "#2C60DB", - "@color-bi-color-toast-text": "#000A19", - "@color-bi-text-header-background": "rgba(9, 30, 64, 0.9)", - "@color-bi-text-header-background-theme-dark": "rgba(255, 255, 255, 0.9)", - "@font-date": "e733", - "@font-trigger-triangle": "e924", - "@font-solid-bottom": "e905", - "@font-solid-right": "e906", - "@font-dot": "e762", - "@font-down-triangle": "e70b" -} diff --git a/bin/cli/cli.js b/bin/cli/cli.js deleted file mode 100755 index 513024023..000000000 --- a/bin/cli/cli.js +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env node -const yargs = require('yargs/yargs'); -const { hideBin } = require('yargs/helpers'); - -const workerCmd = require('./worker/cli.worker'); - -const argv = yargs(hideBin(process.argv)).argv; - -const cmd = argv._[0]; - -const cmds = new Map([ - ['worker', workerCmd], -]); - -if (!cmd) throw new Error('Command is undefined!'); - -if (cmds.has(cmd)) { - cmds.get(cmd)?.exec(argv); -} else { - throw new Error(`Command ${cmd} not supported`); -} diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js deleted file mode 100644 index b67513fbb..000000000 --- a/bin/cli/worker/cli.worker.js +++ /dev/null @@ -1,76 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -function first2UpperCase(str) { - return str.toLowerCase().replace(/( |^)[a-z]/g, L => L.toUpperCase()); -} - -function scanAndCreate(structure, workerName, root) { - Object.keys(structure) - .forEach(name => { - if (typeof structure[name] === 'object') { - fs.mkdirSync(path.resolve(root, name)); - - scanAndCreate(structure[name], workerName, path.resolve(root, `./${name}`)); - } else if (structure[name] === '') { - fs.appendFileSync(path.resolve(root, name), ''); - } else if (typeof structure[name] === 'string') { - let content = fs.readFileSync(structure[name]).toString(); - - content = content - .replace(/\${WorkerName}/g, first2UpperCase(workerName)) - .replace(/\${workerName}/g, workerName); - - fs.appendFileSync(path.resolve(root, name), content); - } - }); -} - -module.exports = { - exec: async args => { - if (!args.init) { - throw new Error(`Command init not found in args`); - } - - if (!args.name) { - throw new Error('Command --name=... not found in args'); - } - - const name = args.name; - - const structure = { - [`${name}_worker`]: { - 'main_thread': { - action: { - 'action.worker_ability_test.ts': path.resolve(__dirname, './template/main_thread/action/action.worker_ability_test.t'), - }, - [`${name}_main_thread.ts`]: path.resolve(__dirname, './template/main_thread/main_thread.t'), - }, - utils: { - 'action_type.ts': path.resolve(__dirname, './template/utils/action_type.t'), - 'payload_type.ts': path.resolve(__dirname, './template/utils/payload_type.t'), - }, - 'worker_thread': { - action: { - 'action.worker_ability_test.ts': path.resolve(__dirname, './template/worker_thread/action/action.worker_ability_test.t'), - }, - [`${name}_worker_thread.ts`]: path.resolve(__dirname, './template/worker_thread/worker_thread.t'), - }, - [`${name}_main_thread.helper.ts`]: path.resolve(__dirname, './template/main_thread.helper.t'), - }, - }; - - scanAndCreate(structure, name, args.where ? path.resolve(args.where) : process.cwd()); - }, -}; - -// 结构 -// -xxx_worker -// -|--main_thread -// -|--|--action -// -|--|--xxx_main_thread.ts -// -|--utils -// -|--|--action_type.ts -// -|--worker_thread -// -|--|--action -// -|--|--worker_main_thread.ts diff --git a/bin/cli/worker/template/main_thread.helper.t b/bin/cli/worker/template/main_thread.helper.t deleted file mode 100644 index 2ee06acb7..000000000 --- a/bin/cli/worker/template/main_thread.helper.t +++ /dev/null @@ -1,48 +0,0 @@ -import { ${WorkerName}MainThreadWorker } from './main_thread/${workerName}_main_thread'; -// 不需要一起打包的话则不需要引入这行 -// FuiWorkerPlugin中的属性会同步到fui-worker中,同时支持loader行内传入属性 -// 根据实际需求传入inline,返回格式 true -> blob url,false -> servicePath -import workerUrl from 'fui-worker!./worker_thread/${workerName}_worker_thread'; - -export class ${WorkerName}WorkerHelper { - private worker: ${WorkerName}MainThreadWorker; - - /** - * 拿到helper中的worker - */ - public getWorker() { - if (this.worker) { - return this.worker; - } - - this.worker = BI.Workers.createWorker(${WorkerName}MainThreadWorker, { - workerUrl: this.urlFormatter(workerUrl), - workerName: BI.UUID(), - }); - - return this.worker; - } - - /** - * 格式化worker url,比如补充一些环境信息到参数里 - * 可通过 #hash 将参数传入blob url - * @param url worker url - */ - private urlFormatter(url: string) { - return url; - } - - /** - * 终止worker - */ - public terminate() { - this.worker?.terminate(); - } -} - -// 使用示例 -// const workerHelper = new ${WorkerName}WorkerHelper(); - -// workerHelper.getWorker() -// .testCommunication() -// .then(res => console.log(res)); diff --git a/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t b/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t deleted file mode 100644 index 42425b859..000000000 --- a/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t +++ /dev/null @@ -1,13 +0,0 @@ -import { WorkerAbilityTestActionType } from '../../utils/action_type'; -import { WorkerAbilityTestPayload, WorkerAbilityTestReponse } from '../../utils/payload_type'; - -export class WorkerAbilityTestMainThreadAction extends BI.Workers.WorkerBaseAction { - /** - * 通信能力检测 - */ - public communicationTest(): Promise { - const mainThreadPostTime: WorkerAbilityTestPayload['CommunicationTest'] = Date.now(); - - return this.controller.requestPromise(WorkerAbilityTestActionType.CommunicationTest, mainThreadPostTime); - } -} diff --git a/bin/cli/worker/template/main_thread/main_thread.t b/bin/cli/worker/template/main_thread/main_thread.t deleted file mode 100644 index 00fb09177..000000000 --- a/bin/cli/worker/template/main_thread/main_thread.t +++ /dev/null @@ -1,13 +0,0 @@ -import { WorkerAbilityTestMainThreadAction } from './action/action.worker_ability_test'; - -export class ${WorkerName}MainThreadWorker extends BI.Workers.MainThreadWorker { - private communicationTest: WorkerAbilityTestMainThreadAction; - - public initActions(): void { - this.communicationTest = this.createAction(WorkerAbilityTestMainThreadAction); - } - - public testCommunication() { - return this.communicationTest.communicationTest(); - } -} diff --git a/bin/cli/worker/template/utils/action_type.t b/bin/cli/worker/template/utils/action_type.t deleted file mode 100644 index c92de897a..000000000 --- a/bin/cli/worker/template/utils/action_type.t +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Worker 事务标识 - * 每类事务有命名空间, 包含多个具体事务 - */ - -export const enum WorkerAbilityTestActionType { - CommunicationTest = 'CommunicationTest', -} diff --git a/bin/cli/worker/template/utils/payload_type.t b/bin/cli/worker/template/utils/payload_type.t deleted file mode 100644 index 6b9a71509..000000000 --- a/bin/cli/worker/template/utils/payload_type.t +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 跨线程通信各事务的发送数据类型声明 - */ -export interface WorkerAbilityTestPayload { - CommunicationTest: number; -} - -/** - * 跨线程通信各事务的响应数据类型声明 - */ -export interface WorkerAbilityTestReponse { - CommunicationTest: number; -} diff --git a/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t b/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t deleted file mode 100644 index f7d1248f4..000000000 --- a/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t +++ /dev/null @@ -1,24 +0,0 @@ -import { WorkerAbilityTestActionType } from '../../utils/action_type'; -import { WorkerAbilityTestPayload, WorkerAbilityTestReponse } from '../../utils/payload_type'; - -export class WorkerAbilityTestWorkerThreadAction extends BI.Workers.WorkerBaseAction { - protected addActionHandler(): void { - this.controller.addActionHandler( - WorkerAbilityTestActionType.CommunicationTest, - this.communicationTest.bind(this) - ); - } - - /** - * 通信能力检测的处理器 - */ - private communicationTest( - payload: WorkerAbilityTestPayload['CommunicationTest'] - ): WorkerAbilityTestReponse['CommunicationTest'] { - const mainThreadPostTime = payload; - // 收到主线程信息的耗时 - const workerGetMessageDuration = Date.now() - mainThreadPostTime; - - return workerGetMessageDuration; - } -} diff --git a/bin/cli/worker/template/worker_thread/worker_thread.t b/bin/cli/worker/template/worker_thread/worker_thread.t deleted file mode 100644 index f437bbc23..000000000 --- a/bin/cli/worker/template/worker_thread/worker_thread.t +++ /dev/null @@ -1,12 +0,0 @@ -// TODO: 这边需要先import fineui资源 -import { WorkerAbilityTestWorkerThreadAction } from './action/action.worker_ability_test'; - -class ${WorkerName}WorkerTreadWorker extends BI.Workers.WorkerThreadWorker { - public communicationTest: WorkerAbilityTestWorkerThreadAction; - - public initActions(): void { - this.communicationTest = this.createAction(WorkerAbilityTestWorkerThreadAction); - } -} - -export const ${workerName}WorkerTreadWorker = BI.Workers.createWorker(${WorkerName}WorkerTreadWorker); diff --git a/changelog.md b/changelog.md deleted file mode 100644 index dbcca9ccd..000000000 --- a/changelog.md +++ /dev/null @@ -1,281 +0,0 @@ -# 更新日志 - -3.0(2022-05) -- 下拉选择框支持清空 - -3.0(2022-03) -- 支持响应式 -- 全面支持Typescript -- 增加JSX支持 -- 布局组件支持更多动态特性 -- 底层API支持动画 -- 增加WebWorker支持 -- 支持路由 -- 插件支持版本控制 -- Fix数据流支持proxy版本 - -2.0(2022-01) -- 提供自定义表单 - -2.0(2021-12) -- 新增Context组件 -- toast支持closable属性,可控制是否显示关闭按钮 -- 新增气泡弹框控件 -- BI.point支持widget添加埋点 -- childContext废弃,替换成provide -- 支持BI.useContext获取上下文环境 -- BI.Msg.alert支持message传json格式 -- 支持BI.config(function(){})进行系统配置 - -2.0(2021-11) -- 限制了复选下拉框一次粘贴添加值个数最大2000 - -2.0(2021-10) -- combo增加window.blur事件触发隐藏 - -2.0(2021-09) -- 支持自动watch -- 支持h函数传递left、right,优化left_right_vertical_adapt布局的jsx写法 -- 新增bi.virtual_group_list组件 - -2.0(2021-07) -- layout支持forceUpdate刷新方式 -- width属性支持calc() -- 修改了颜色选择器交互 -- 新增bi.horizontal_fill、bi.vertical_fill布局 -- 增加module定义插件版本号 -- bubble使用popper.js实现 -- 优化了日期类型控件标红时的报错提示 -- 支持虚拟dom -- 修复了树控件节点未初始化时调用树的getValue始终为空的问题 - -2.0(2021-05) -- 支持搜索的控件支持搜索包含空格的字符串 -- 解决了树列表populate调用两次itemsCreator的问题 - -2.0(2021-03) -- 优化left_right_vertical_adapt布局,去掉float属性只使用flex -- inline布局支持用calc计算fill列宽度 -- 时间类型控件无翻页限制 -- 时间类型控件优化动态时间面板的交互 - -2.0(2021-02) -- 增加beforeRender生命周期函数 - -2.0(2021-01) -- 修改了日期下拉面板中的当前时间按钮的交互效果 -- 新增年区间和年季度区间控件 -- 日期类型控件不操作下拉面板收起不发Confirm事件 -- 日期类型控件全系列可设置是否显示动态日期 -- 日期类型控件全系列可设置最大最小日期 -- 调整了combo的popup显示位置计算逻辑 - -2.0(2020-12) -- multi_layer_down_list_combo支持无限层级 -- 新增不带全选的同步复选下拉框 -- 日期选择控件为年月选择器子组件新增POPUP弹出前事件 -- 文件上传控件新增API(setMaxFileLength)以动态设置最大上传文件数量 -- 复选下拉树显示查看已选效果改成和复选下拉列表一致 -- Pane系列提供small和big两种大小的加载动画 -- 同步树列表系列支持不显示节点连接线和展开收起图标 -- 规范了下拉树trigger中显示值的显示顺序 -- bi.editor支持传入autocomplete -- [视觉]editor水印间距统一与文本域水印不可选中 -- 修复bi.file的url参数拼接问题 -- 修复了colorChooser选择透明后, 打开更多选色面板, 直接点保存会选中自动的问题 -- bi.file支持限制上传文件数 - -2.0(2020-11) -- bi.file上传文件errorMsg默认调用国际化 -- 修复了文本标签text传递空字符串后显示value值的问题 -- 限制了title的最大高度 -- bi.textarea_editor添加setWatermark方法 -- 生命周期可以通过属性传递来操作 -- 修复了颜色选择器hex框不能输入为空的问题 -- 增加纯文本组件bi.pure_text -- store支持webworker,引入多线程机制 -- 修复了Popover小屏幕上看不完整的问题 -- 颜色选择器支持输入16进制颜色编号 -- bi.textarea_editor支持气泡提示报错 - -2.0(2020-10) -- 支持Composition API -- pane和loadingPane支持加载时自定义提示文本 - -2.0(2020-09) -- combo增加click-blur(点击显示,blur消失)作为触发条件功能 -- allCountPager支持是否显示总行数 -- 修复区间滑块setEnable(false)滑块不灰化的问题 -- 修复同步复选下拉框系列setValue所有值后触发器不显示全选的问题 -- BI.Tree.traversal方法迭代函数增加父节点参数 - -2.0(2020-08) -- bi.sign_editor支持显示值居左/居中/居右显示 -- bi.iframe新增EVENT_LOADED事件 -- 修复了searcher在允许搜索的情况下输入空格直接退出搜索的问题 -- 修复了复选下拉系列'点按空格添加完全匹配项'添加的是显示值而非实际值的问题 -- search_text_value_combo支持水印 -- BI.makeObject 方法支持传入iteratee - -2.0(2020-07) -- 修复了日期类型控件先展开切换日期月份面板,再设置区间使得该月份不合法,查看该月份面板灰化不对的问题 -- bi.file文件上传控件accept属性与 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) 统一 -- 修复了日期类型控件设置一个不在minDate和maxDate之间的日期值时,面板灰化与翻页按钮状态不对的问题 -- BI.OB的on方法返回一个解除监听的函数 -- 修复了grid_view执行_unMount时不调用子组件的_unMount的问题 -- combo新增belowMouse属性,允许popup在点击处弹出 -- combo新增hideWhenAnotherComboOpen属性,开启则其他combo下拉时当前combo收起 -- 修复了datePicker在setValue的时候没有动态刷新可用月份的问题 -- 同步复选下拉及其面板新增getAllValue获取所有已选值 -- 同步复选下拉树及其面板新增getAllValue获取完整的选中树节点 -- 修复date_picker最大值最小值与面板展示判断问题 -- 复选下拉树和下拉列表添加showView和hideVIew方法 -- number_editor支持自动检测数值与范围是否合法 -- 修复了颜色选择器设置值为null的时候,trigger和popup表现不一致的问题 - -2.0(2020-06) -- 修复了复选下拉树半选节点的子节点未加载的时候,点选该半选节点是取消选中的问题 -- 下拉树系列支持isNeedAdjustWidth以动态变化宽度 -- 修复了新增值的下拉控件传递valueFormatter搜索完全匹配项提示新增 -- 修复了选色控件历史记录没有选中的问题的问题 -- 修复了单选下拉框新增值的时候没有发事件的问题 -- 修复了单选标红combo类setValue为空字符串会标红的问题 -- BI.history提供与注册路由对应的卸载路由方法unRoute -- 修复了单选标红combo类setValue为空和空数组行为不一致的问题 -- 单选列表支持新增选项 -- 增加组件shortcut未定义的错误提示 - -2.0(2020-05) -- 修复调用BI.history.navigate(XXX, {trigger: false})时, XXX包含中文空格等字符仍然触发回调的问题 -- 新增BI.after和BI.before方法 -- 修复bi.button设置宽度并配置iconCls后,文本很长的情况下显示截断的问题 -- 填加bi-user-select-enable和bi-user-select-disable通用类名 -- 修复树系列多层半选状态下,勾选祖先节点,后代节点不受影响的问题 -- 修复上传控件多个title问题 - -2.0(2020-04) -- 修复树列表通过空格回到初始面板没有刷新的问题 -- 下拉树系列添加下拉popup弹出前事件 -- 修复了复选下拉勾选值和搜索结果中含有父子串关系时提示不正确的问题 -- searcher提供可配是否支持搜索空格的allSearchBlank -- 修复了复选下拉全选状态下使用空格添加值trigger显示更新不对的问题 -- 复选下拉树展开节点提供分页加载和滚动加载两种方式 -- 修复了复选下拉列表初始化的时候发送执行两次itemsCreator的问题 -- 修复了virtual_list重新populate无效的问题 -- 复选下拉框新增值的时候外抛事件 -- 空格不再编码成  -- 支持文本区域水印可滚动 - -2.0(2020-03) -- 修复了IE9下使用bi.file上传包含特殊字符的excel出错的问题 -- 修复了下拉类型控件不允许编辑的时候没有title的问题 -- 修复了连续多次调用BI.Msg.alert后只有最后弹出的可以关闭的问题 -- 修复了time_combo设置格式为%M:%S后value设置大于30分钟的值时标红的问题 -- 复选下拉树系列展开节点性能优化 - -2.0(2020-02) -- 拓展BI.concat,使其可以拼接多个数组 -- 修复勾选节点不影响父子节点勾选状态的树搜索选中getValue不正常的问题 - -2.0(2020-01) -- 修复单值系滑块滑动松手后发两次EVENT_CHANGE的问题 - -2.0(2019-12) -- 修复多层级单选下拉树主动设置container后搜索面板弹出问题 -- bi.search_editor支持搜索中间含有空格的字符串 -- 修复了监听日期下拉框before_popup_view事件,调用setMinDate无效的问题 -- 修复了数值滑块逆向排列滑块后populate显示效果不对的问题 -- 不影响父节点勾选状态的复选树支持自定义水印和默认值 -- 修复text组件重新设置文本后标红丢失问题 -- 添加无全选按钮的复选下拉框组件 - -2.0(2019-11) -- 日期系列新增setMinDate和setMaxDate接口 -- 修复了同步复选树设置节点默认open后, 叶子节点无法选中的问题 -- 修复了连续多音字搜索可能导致结果异常或者标红异常的问题 -- 新增BI.set(object, path, value)方法 -- getSearchResult兼容了对null值的处理 -- 增加了异步单选下拉树请求完数据后加载完节点后会自动调整宽高的逻辑 - -2.0(2019-10) -- 修改了下拉树展开图标模糊的问题 -- 修复了下拉树搜索高亮字符与正常字符间存在间距的问题 -- 复选下拉系列的计数器从trigger中拆分, 作为独立的部分 -- 增加BI.createElement方法 -- 统一了单选下拉和复选下拉添加自定义值的交互效果 - -2.0(2019-09) -- [视觉]popover弹出框增加圆角 -- 文本列表通过复制粘贴的形式选中值的时候发送事件 -- 修复tree_value_chooser选中节点的唯一子节点后搜索该子节点,无法取消选中的问题 -- button的bubble创建的popup在收起的时候会destroy -- 修复了dynamic_date_pane在切换静态时间和动态时间的时候不会发事件的问题 - -2.0(2019-08) -- 修复valueChooser系列不支持value属性的问题 -- 更新了若干icon-font的样式 -- 修复了单选树同步搜索状态下父节点前可能没有展开符号的问题 -- 单选树可展示并选中不存在的值 -- 树类型下拉新增可搜索实际值的配置 -- 可编辑的combo新增水印配置 -- 单选下拉树同步状态下内置搜索 - -2.0(2019-07) -- 修改了下拉框控件默认值的配色 -- input及其派生编辑控件在PAUSE事件之前会触发CHANGE事件 - -2.0(2019-06) -- 单选下拉树支持搜索与异步加载节点 -- 提供了AES加密方法 - -2.0(2019-05) -- editor类控件新增EVENT_CHANGE_CONFIRM事件 -- 复选下拉控件和树下拉控件支持trigger是否可编辑 -- 时分秒控件支持自定义时间显示格式和是否可编辑 -- 日期/时间/日期区间/时间区间支持自定义日期选择范围和是否可编辑 -- 日期/时间/日期区间/时间区间支持自定义日期显示格式和是否可编辑 -- 增加less函数: 字体资源添加函数addFontRes和字体激活函数activeFont - -> @fontList: "dec", "report"; -> .addFontRes("dec"); -> .addFontRes("report"); -> .activateFont(@fontList); - -以上即可使用自定义的dec,report字体和fineui的资源字体 - -2.0(2019-04) -- 新增`bi.multi_tree_list_combo`控件, 此下拉树勾选节点时不会影响父子节点的勾选状态 -- 新增`bi.multi_tree_insert_combo`控件, 此下拉树可以插入不存在的新值 -- 新增`bi.list_tree_value_chooser_insert_combo`部件, 封装`bi.multi_tree_list_combo`数据处理逻辑 -- 新增`bi.tree_value_chooser_insert_combo`部件, 封装`bi.multi_tree_insert_combo`数据处理逻辑 -- 增加BI.DOM.ready方法 - -2.0(2019-03) -- 新增`bi.time_combo`时分秒控件和`bi.time_periods`时间选择区间,时间区间无有效值校验 -- Label控件增加highlight参数, 可指定初始化标蓝 - -2.0(2019-01) -- 加载更多的单选下拉系列新增allowNoSelect参数配置, 使得可以不选任意一个值 - -2.0(2018-12) -- 增加Button的点击动画和Combo下拉时下拉图标动画 - - -2.0(2018-11) -- 增加`bi.html`和`bi.html_label`类型,text支持html文本,不支持keyword - - -2.0(2018-10) -- popover增加高度自适应,即open的时候回根据内容高度调整popover的高度 - - -2.0(2018-09) -- 增加Fix对configuable为false的对象的不内部构造响应式数据的性能优化处理,例如: - -> this.model.json = Object.freeze({name: "zhang"}); - -只会对this.model.json进行响应式处理,不会对内部的name进行响应式处理 - - -2.0(2018-08) -- 增加BI.mount方法,支持同构 diff --git a/demo/app.js b/demo/app.js deleted file mode 100644 index f15b97c14..000000000 --- a/demo/app.js +++ /dev/null @@ -1,124 +0,0 @@ -Demo = { - version: 1.0 -}; - -BI.EVENT_BLUR = false - -BI.$(function () { - var ref; - - BI.each(Demo.CONFIG, function (index, item) { - !item.id && (item.id = item.value || item.text); - }); - var tree = BI.Tree.transformToTreeFormat(Demo.CONFIG); - - var routes = [{ - path: "/", - component: function () { - return Promise.resolve({ - type: "demo.face" - }); - } - }, { - name: "component", - path: "/component/:componentId", - component: function () { - return Promise.resolve({ - type: "demo.router" - }); - }, - }, { - name: "user", - path: "/user/:name", - component: function () { - return Promise.resolve({ - type: "bi.vtape", - items: [{ - type: "bi.label", - text: "user", - height: 50 - }, { - type: "bi.router_view", - deps: 1, - height: 100 - }, { - type: "bi.router_view", - name: 'tool-buttons', - deps: 1 - }] - }); - }, - children: [{ - path: '', - components: { - default: function () { - return Promise.resolve({ - type: "bi.label", - text: 'home' - }); - }, - } - }, { - name: 'dashboard', - path: 'dashboard', - component: function () { - return Promise.resolve({ - type: "bi.label", - text: 'dashboard' - }); - } - }, { - name: 'tables', - path: 'tables/:id', - components: { - default: function () { - return Promise.resolve({ - type: "bi.label", - text: 'table-view' - }); - }, - "tool-buttons": function () { - return Promise.resolve({ - type: "bi.label", - text: '预览按钮', - }); - }, - } - }] - }]; - - // BI.Tree.traversal(tree, function (index, node) { - // if (!node.children || BI.isEmptyArray(node.children)) { - // routes.push({ - // path: "/", - // component: function () { - // return Promise.resolve({ - // type: node.value - // }); - // } - // }); - // } - // }); - - // var AppRouter = BI.inherit(BI.Router, obj); - // new AppRouter; - // BI.history.start(); - - BI.createWidget({ - type: "bi.router", - ref: function (_ref) { - BI.$router = _ref.$router; - }, - element: "#wrapper", - routes: routes, - render: function () { - return { - type: "demo.main", - ref: function (_ref) { - console.log(_ref); - ref = _ref; - } - }; - } - }); -}); diff --git a/demo/config.js b/demo/config.js deleted file mode 100644 index a20f13ebe..000000000 --- a/demo/config.js +++ /dev/null @@ -1,1584 +0,0 @@ -Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG).concat(Demo.FIX_CONFIG); - -Demo.CONSTANTS = { - SIMPLE_ITEMS: BI.map("柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂".match(/[^\s]+/g), function (i, v) { - return { - text: v, - value: v, - title: v - }; - }), - ITEMS: BI.map("柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂 柳州市积玉贸易有限公司 柳州市福运来贸易有限责任公司 柳州市钢义物资有限公司 柳州市洋力化工有限公司 柳州市悦盛贸易有限公司 柳州市雁城钢管物资有限公司 柳州市恒瑞钢材经营部 柳州市科拓电子有限公司 柳州市九方电子有限公司 柳州市桂龙汽车配件厂 柳州市制鞋工厂 柳州市炜力科贸有限公司 柳州市希翼贸易有限公司 柳州市兆金物资有限公司 柳州市和润电子科技有限责任公司 柳州市汇凯贸易有限公司 柳州市好机汇商贸有限公司 柳州市泛源商贸经营部 柳州市利汇达物资有限公司 广西全民药业有限责任公司 柳州超凡物资贸易有限责任公司 柳州市贵宏物资有限责任公司 柳州昊恒贸易有限责任公司 柳州市浦联物资有限公司 柳州市广通园林绿化工程有限责任公司 柳州市松发物资贸易有限责任公司 柳州市奥士达办公设备有限责任公司 柳州市海泰物资有限公司 柳州市金三环针织厂 柳州市钢贸物资有限公司 柳州市明阳纺织有限公司 柳州市世科科技发展有限公司 柳州市禄羊贸易有限公司 柳州市金兆阳商贸有限公司 柳州市汇昌物资经营部 柳州市林泰金属物资供应站 柳州市自来水管道材料设备公司 柳州市丹柳铝板有限公司 柳州市桂冶物资有限公司 柳州市宸业物资经营部 柳州市耀成贸易有限公司 柳州奥易自动化科技有限公司 柳州市萃丰科技有限责任公司 柳州市华储贸易有限责任公司 柳州市黄颜钢材有限责任公司 柳州市银盛物资有限责任公司 柳州市新仪化玻供应站 柳州市晶凯化工有限公司 广西柳州市柳江包装纸厂 柳州市志新物资有限责任公司 柳州市兆钢物资有限公司 柳州市友方科技发展有限责任公司 柳州市缝纫机台板家具总厂 柳州市晖海数码办公设备有限责任公司 柳州市富兰特服饰有限责任公司 柳州市柳北区富兴物资经营部 柳州市柳锌福利厂 柳州市海泉印刷有限责任公司 柳州市乾亨贸易有限公司 柳州市悦宁物资贸易有限公司 柳州市昊天贸易有限公司 广西惠字钢铁有限公司 柳州市名青物资有限公司 柳州市林郝物资有限公司 柳州市民政服装厂 柳州市多维劳保用品厂 柳州市轻工物资供应公司 柳州市程源物资有限责任公司 柳州市寿丰物资贸易有限责任公司 柳州市凯凡物资有限公司 柳州市利晖物资经营部 柳州市恒茂金属物资供应站 柳州市中储物资经营部 柳州市第二医疗器械厂 柳州市来鑫物资经营部 柳州市钢鑫物资贸易有限责任公司 柳州市双合袜业有限责任公司 柳州市茂松经贸有限责任公司 柳州市行行物资贸易有限公司 柳州市方一物资有限公司 柳州成异钢管销售有限公司 柳州广惠佳电脑有限公司 桂林市圣泽鑫物资有限公司柳州分公司 柳州市砼基建材贸易有限公司 柳州市海燕针织厂 上海浦光仪表厂柳州销售处 柳州市能电工贸有限责任公司 柳州市广贸物资有限公司 柳州市柳北区大昌电工灯饰经营部 柳州市金龙印务有限公司 柳州市奇缘婚典服务有限公司 柳州市盛博物资经营部 柳州市项元钢铁贸易有限公司 柳州市虞美人化妆品经营部 柳州市俊彦鞋厂 柳州市聚源特钢有限公司 柳州市迅龙科贸有限责任公司 柳州市恒飞电子有限责任公司 柳州市蓝正现代办公设备有限责任公司 柳州地区农业生产资料公司 柳州华菱钢管销售有限公司 柳州融通物资有限公司 柳州市可仁广告策划有限责任公司 柳州市鸟鑫物资有限责任公司 柳州市五丰钢材供应站 柳州市金江不锈钢有限公司 柳州市美日物资设备有限责任公司 柳州市鑫东物资贸易有限责任公司 柳州地区日用杂品公司 柳州市华纳物资贸易有限公司 柳州乾利金虹物资贸易有限责任公司 柳州市新迈计算机有限公司 柳州市富丽实业发展公司 柳州市石钢金属材料有限公司 柳州市力志传真机销售有限公司 广西宝森投资有限公司 柳州市嵘基商贸有限公司 柳州市景民商贸有限责任公司 柳州市银桥化玻有限责任公司 柳州市宏文糖烟店 柳州市科苑电脑网络有限公司 柳州市两面针旅游用品厂 柳州市立早室内装璜有限责任公司 柳州地化建材有限公司 柳州市涛达贸易有限公司 柳州市兰丰档案服务中心 柳州市惠贸物资有限责任公司 柳州市立文物资有限责任公司 柳州市致和商贸经营部 柳州市金色阳光信息咨询有限公司 柳州市赛利钢材经销部 柳州市日用化工厂 柳州市昆廷物资有限责任公司 柳州市邦盛贸易有限公司 柳州市济华贸易有限公司 柳州昕威橡塑化工经营部 柳州市联业贸易有限公司 柳州市兰钢贸易有限公司 柳州市子欣科技有限公司 柳州市狄龙机电设备有限公司 柳州市方真物资贸易有限公司 柳州市银鸥废旧回收中心 柳州市冠宝贸易有限公司 柳州市鑫盛德商务咨询有限责任公司 柳州市泰汇银通经贸有限公司 广西瀚维智测科技有限公司 柳州市钓鱼郎制衣有限责任公司 柳州溪水物资有限公司 柳州市融峰物资有限责任公司 广西新地科技有限责任公司 柳州市纺织装饰公司 柳州市粤翔冶金炉料有限公司 柳州市远腾贸易有限公司 柳州市东鸿城市改造有限公司 广西丛欣实业有限公司 柳州市服装厂 柳州市立安联合刀片有限公司 广西国扬投资有限责任公司 柳州市铭泰办公设备公司 柳州市桂钢物资供应站 柳州市昱升物资有限责任公司 柳州市鹰飞灿科贸有限公司 柳州市先导科贸有限公司 柳州市金秋建材物资经营部 柳州市童装厂 柳州市民泽物资有限公司 柳州市恒先物资贸易有限公司 柳州市银夏冷气工程有限责任公司 柳州粮食批发有限责任公司 柳州市金银华窗纱制造有限责任公司 柳州市三方贸易有限公司 柳州市丰涛商贸有限责任公司 柳州华智企业管理咨询有限责任公司 柳州市诚正建筑工程施工图审查有限公司 柳州市今科电讯设备营销中心 柳州市闽德电子有限公司 柳州市鑫虹针织厂 柳州市畅通通讯器材有限责任公司 柳州市正钢物资经营部 柳州市新柳饲料有限责任公司 柳州市黄村油库 柳州市天泰电力装饰工程有限公司 柳州市兆吉物资有限责任公司 柳州市八龙纸制品有限责任公司 柳州市巨佳电脑网络科技有限公司 ".match(/[^\s]+/g), function (i, v) { - return { - text: v, - value: v, - title: v - }; - }), - TREEITEMS: [{ pId: "0", id: "0_0", text: "( 共25个 )", value: "", open: true }, { - pId: "0_0", - id: "0_0_0", - text: "安徽省( 共1个 )", - value: "安徽省", - open: true - }, { pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true }, { - pId: "0_0", - id: "0_0_1", - text: "北京市( 共6个 )", - value: "北京市", - open: true - }, { pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true }, { - pId: "0_0_1", - id: "0_0_1_1", - text: "朝阳区", - value: "朝阳区", - open: true - }, { pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true }, { - pId: "0_0_1", - id: "0_0_1_3", - text: "海淀区4内", - value: "海淀区4内", - open: true - }, { pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true }, { - pId: "0_0_1", - id: "0_0_1_5", - text: "石景山区", - value: "石景山区", - open: true - }, { pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true }, { - pId: "0_0_2", - id: "0_0_2_0", - text: "莆田市", - value: "莆田市", - open: true - }, { pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true }, { - pId: "0_0", - id: "0_0_3", - text: "甘肃省( 共1个 )", - value: "甘肃省", - open: true - }, { pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true }, { - pId: "0_0", - id: "0_0_4", - text: "广东省( 共5个 )", - value: "广东省", - open: true - }, { pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true }, { - pId: "0_0_4", - id: "0_0_4_1", - text: "广州市", - value: "广州市", - open: true - }, { pId: "0_0_4", id: "0_0_4_2", text: "惠州市", value: "惠州市", open: true }, { - pId: "0_0_4", - id: "0_0_4_3", - text: "深圳市", - value: "深圳市", - open: true - }, { pId: "0_0_4", id: "0_0_4_4", text: "珠海市", value: "珠海市", open: true }, { - pId: "0_0", - id: "0_0_5", - text: "广西壮族自治区( 共1个 )", - value: "广西壮族自治区", - open: true - }, { pId: "0_0_5", id: "0_0_5_0", text: "南宁市", value: "南宁市", open: true }, { - pId: "0_0", - id: "0_0_6", - text: "河北省( 共2个 )", - value: "河北省", - open: true - }, { pId: "0_0_6", id: "0_0_6_0", text: "保定市", value: "保定市", open: true }, { - pId: "0_0_6", - id: "0_0_6_1", - text: "邢台市", - value: "邢台市", - open: true - }, { pId: "0_0", id: "0_0_7", text: "河南省( 共1个 )", value: "河南省", open: true }, { - pId: "0_0_7", - id: "0_0_7_0", - text: "郑州市", - value: "郑州市", - open: true - }, { pId: "0_0", id: "0_0_8", text: "黑龙江省( 共7个 )", value: "黑龙江省", open: true }, { - pId: "0_0_8", - id: "0_0_8_0", - text: "大庆市", - value: "大庆市", - open: true - }, { pId: "0_0_8", id: "0_0_8_1", text: "哈尔滨市", value: "哈尔滨市", open: true }, { - pId: "0_0_8", - id: "0_0_8_2", - text: "鸡西市", - value: "鸡西市", - open: true - }, { pId: "0_0_8", id: "0_0_8_3", text: "佳木斯市", value: "佳木斯市", open: true }, { - pId: "0_0_8", - id: "0_0_8_4", - text: "牡丹江市", - value: "牡丹江市", - open: true - }, { pId: "0_0_8", id: "0_0_8_5", text: "齐齐哈尔市", value: "齐齐哈尔市", open: true }, { - pId: "0_0_8", - id: "0_0_8_6", - text: "双鸭山市", - value: "双鸭山市", - open: true - }, { pId: "0_0", id: "0_0_9", text: "湖北省( 共1个 )", value: "湖北省", open: true }, { - pId: "0_0_9", - id: "0_0_9_0", - text: "武汉市", - value: "武汉市", - open: true - }, { pId: "0_0", id: "0_0_10", text: "湖南省( 共3个 )", value: "湖南省", open: true }, { - pId: "0_0_10", - id: "0_0_10_0", - text: "常德市", - value: "常德市", - open: true - }, { pId: "0_0_10", id: "0_0_10_1", text: "长沙市", value: "长沙市", open: true }, { - pId: "0_0_10", - id: "0_0_10_2", - text: "邵阳市", - value: "邵阳市", - open: true - }, { pId: "0_0", id: "0_0_11", text: "吉林省( 共4个 )", value: "吉林省", open: true }, { - pId: "0_0_11", - id: "0_0_11_0", - text: "白山市", - value: "白山市", - open: true - }, { pId: "0_0_11", id: "0_0_11_1", text: "长春市", value: "长春市", open: true }, { - pId: "0_0_11", - id: "0_0_11_2", - text: "松原市", - value: "松原市", - open: true - }, { pId: "0_0_11", id: "0_0_11_3", text: "通化市", value: "通化市", open: true }, { - pId: "0_0", - id: "0_0_12", - text: "江苏省( 共8个 )", - value: "江苏省", - open: true - }, { pId: "0_0_12", id: "0_0_12_0", text: "常州市", value: "常州市", open: true }, { - pId: "0_0_12", - id: "0_0_12_1", - text: "南京市", - value: "南京市", - open: true - }, { pId: "0_0_12", id: "0_0_12_2", text: "南通市", value: "南通市", open: true }, { - pId: "0_0_12", - id: "0_0_12_3", - text: "苏州市", - value: "苏州市", - open: true - }, { pId: "0_0_12", id: "0_0_12_4", text: "宿迁市", value: "宿迁市", open: true }, { - pId: "0_0_12", - id: "0_0_12_5", - text: "泰州市", - value: "泰州市", - open: true - }, { pId: "0_0_12", id: "0_0_12_6", text: "无锡市", value: "无锡市", open: true }, { - pId: "0_0_12", - id: "0_0_12_7", - text: "盐城市", - value: "盐城市", - open: true - }, { pId: "0_0", id: "0_0_13", text: "辽宁省( 共11个 )", value: "辽宁省", open: true }, { - pId: "0_0_13", - id: "0_0_13_0", - text: "鞍山市", - value: "鞍山市", - open: true - }, { pId: "0_0_13", id: "0_0_13_1", text: "本溪市", value: "本溪市", open: true }, { - pId: "0_0_13", - id: "0_0_13_2", - text: "朝阳市", - value: "朝阳市", - open: true - }, { pId: "0_0_13", id: "0_0_13_3", text: "大连市", value: "大连市", open: true }, { - pId: "0_0_13", - id: "0_0_13_4", - text: "抚顺市", - value: "抚顺市", - open: true - }, { pId: "0_0_13", id: "0_0_13_5", text: "葫芦岛市", value: "葫芦岛市", open: true }, { - pId: "0_0_13", - id: "0_0_13_6", - text: "锦州市", - value: "锦州市", - open: true - }, { pId: "0_0_13", id: "0_0_13_7", text: "辽阳市", value: "辽阳市", open: true }, { - pId: "0_0_13", - id: "0_0_13_8", - text: "盘锦市", - value: "盘锦市", - open: true - }, { pId: "0_0_13", id: "0_0_13_9", text: "沈阳市", value: "沈阳市", open: true }, { - pId: "0_0_13", - id: "0_0_13_10", - text: "营口市", - value: "营口市", - open: true - }, { pId: "0_0", id: "0_0_14", text: "内蒙古( 共1个 )", value: "内蒙古", open: true }, { - pId: "0_0_14", - id: "0_0_14_0", - text: "鄂尔多斯市", - value: "鄂尔多斯市", - open: true - }, { pId: "0_0", id: "0_0_15", text: "宁夏回族自治区( 共1个 )", value: "宁夏回族自治区", open: true }, { - pId: "0_0_15", - id: "0_0_15_0", - text: "银川市", - value: "银川市", - open: true - }, { pId: "0_0", id: "0_0_16", text: "山东省( 共7个 )", value: "山东省", open: true }, { - pId: "0_0_16", - id: "0_0_16_0", - text: "济南市", - value: "济南市", - open: true - }, { pId: "0_0_16", id: "0_0_16_1", text: "济宁市", value: "济宁市", open: true }, { - pId: "0_0_16", - id: "0_0_16_2", - text: "聊城市", - value: "聊城市", - open: true - }, { pId: "0_0_16", id: "0_0_16_3", text: "临沂市", value: "临沂市", open: true }, { - pId: "0_0_16", - id: "0_0_16_4", - text: "青岛市", - value: "青岛市", - open: true - }, { pId: "0_0_16", id: "0_0_16_5", text: "烟台市", value: "烟台市", open: true }, { - pId: "0_0_16", - id: "0_0_16_6", - text: "枣庄市", - value: "枣庄市", - open: true - }, { pId: "0_0", id: "0_0_17", text: "山西省( 共1个 )", value: "山西省", open: true }, { - pId: "0_0_17", - id: "0_0_17_0", - text: "太原市", - value: "太原市", - open: true - }, { pId: "0_0", id: "0_0_18", text: "陕西省( 共1个 )", value: "陕西省", open: true }, { - pId: "0_0_18", - id: "0_0_18_0", - text: "西安市", - value: "西安市", - open: true - }, { pId: "0_0", id: "0_0_19", text: "上海市( 共1个 )", value: "上海市", open: true }, { - pId: "0_0_19", - id: "0_0_19_0", - text: "上海市区", - value: "上海市区", - open: true - }, { pId: "0_0", id: "0_0_20", text: "四川省( 共1个 )", value: "四川省", open: true }, { - pId: "0_0_20", - id: "0_0_20_0", - text: "成都市", - value: "成都市", - open: true - }, { pId: "0_0", id: "0_0_21", text: "新疆维吾尔族自治区( 共2个 )", value: "新疆维吾尔族自治区", open: true }, { - pId: "0_0_21", - id: "0_0_21_0", - text: "吐鲁番地区", - value: "吐鲁番地区", - open: true - }, { pId: "0_0_21", id: "0_0_21_1", text: "乌鲁木齐", value: "乌鲁木齐", open: true }, { - pId: "0_0", - id: "0_0_22", - text: "云南省( 共1个 )", - value: "云南省", - open: true - }, { pId: "0_0_22", id: "0_0_22_0", text: "昆明市", value: "昆明市", open: true }, { - pId: "0_0", - id: "0_0_23", - text: "浙江省( 共5个 )", - value: "浙江省", - open: true - }, { pId: "0_0_23", id: "0_0_23_0", text: "杭州市", value: "杭州市", open: true }, { - pId: "0_0_23", - id: "0_0_23_1", - text: "湖州市", - value: "湖州市", - open: true - }, { pId: "0_0_23", id: "0_0_23_2", text: "嘉兴市", value: "嘉兴市", open: true }, { - pId: "0_0_23", - id: "0_0_23_3", - text: "宁波市", - value: "宁波市", - open: true - }, { pId: "0_0_23", id: "0_0_23_4", text: "绍兴市", value: "绍兴市", open: true }, { - pId: "0_0", - id: "0_0_24", - text: "重庆市( 共1个 )", - value: "重庆市", - open: true - }, { pId: "0_0_24", id: "0_0_24_0", text: "重庆市区", value: "重庆市区", open: true }, { - pId: "0", - id: "0_1", - text: "中国( 共34个 )", - value: "中国", - open: true - }, { pId: "0_1", id: "0_1_0", text: "安徽省( 共19个 )", value: "安徽省", open: true }, { - pId: "0_1_0", - id: "0_1_0_0", - text: "安庆市", - value: "安庆市", - open: true - }, { pId: "0_1_0", id: "0_1_0_1", text: "蚌埠市", value: "蚌埠市", open: true }, { - pId: "0_1_0", - id: "0_1_0_2", - text: "亳州市", - value: "亳州市", - open: true - }, { pId: "0_1_0", id: "0_1_0_3", text: "巢湖市", value: "巢湖市", open: true }, { - pId: "0_1_0", - id: "0_1_0_4", - text: "池州市", - value: "池州市", - open: true - }, { pId: "0_1_0", id: "0_1_0_5", text: "滁州市", value: "滁州市", open: true }, { - pId: "0_1_0", - id: "0_1_0_6", - text: "阜阳市", - value: "阜阳市", - open: true - }, { pId: "0_1_0", id: "0_1_0_7", text: "毫州市", value: "毫州市", open: true }, { - pId: "0_1_0", - id: "0_1_0_8", - text: "合肥市", - value: "合肥市", - open: true - }, { pId: "0_1_0", id: "0_1_0_9", text: "淮北市", value: "淮北市", open: true }, { - pId: "0_1_0", - id: "0_1_0_10", - text: "淮南市", - value: "淮南市", - open: true - }, { pId: "0_1_0", id: "0_1_0_11", text: "黄山市", value: "黄山市", open: true }, { - pId: "0_1_0", - id: "0_1_0_12", - text: "六安市", - value: "六安市", - open: true - }, { pId: "0_1_0", id: "0_1_0_13", text: "马鞍山市", value: "马鞍山市", open: true }, { - pId: "0_1_0", - id: "0_1_0_14", - text: "濮阳市", - value: "濮阳市", - open: true - }, { pId: "0_1_0", id: "0_1_0_15", text: "宿州市", value: "宿州市", open: true }, { - pId: "0_1_0", - id: "0_1_0_16", - text: "铜陵市", - value: "铜陵市", - open: true - }, { pId: "0_1_0", id: "0_1_0_17", text: "芜湖市", value: "芜湖市", open: true }, { - pId: "0_1_0", - id: "0_1_0_18", - text: "宣城市", - value: "宣城市", - open: true - }, { pId: "0_1", id: "0_1_1", text: "澳门特别行政区( 共1个 )", value: "澳门特别行政区", open: true }, { - pId: "0_1_1", - id: "0_1_1_0", - text: "澳门", - value: "澳门", - open: true - }, { pId: "0_1", id: "0_1_2", text: "北京市( 共17个 )", value: "北京市", open: true }, { - pId: "0_1_2", - id: "0_1_2_0", - text: "北京市区", - value: "北京市区", - open: true - }, { pId: "0_1_2", id: "0_1_2_1", text: "昌平区", value: "昌平区", open: true }, { - pId: "0_1_2", - id: "0_1_2_2", - text: "朝阳区", - value: "朝阳区", - open: true - }, { pId: "0_1_2", id: "0_1_2_3", text: "大兴区", value: "大兴区", open: true }, { - pId: "0_1_2", - id: "0_1_2_4", - text: "东城区", - value: "东城区", - open: true - }, { pId: "0_1_2", id: "0_1_2_5", text: "房山区", value: "房山区", open: true }, { - pId: "0_1_2", - id: "0_1_2_6", - text: "丰台区", - value: "丰台区", - open: true - }, { pId: "0_1_2", id: "0_1_2_7", text: "海淀区", value: "海淀区", open: true }, { - pId: "0_1_2", - id: "0_1_2_8", - text: "海淀区4内", - value: "海淀区4内", - open: true - }, { pId: "0_1_2", id: "0_1_2_9", text: "海淀区4外", value: "海淀区4外", open: true }, { - pId: "0_1_2", - id: "0_1_2_10", - text: "门头沟区", - value: "门头沟区", - open: true - }, { pId: "0_1_2", id: "0_1_2_11", text: "平谷区", value: "平谷区", open: true }, { - pId: "0_1_2", - id: "0_1_2_12", - text: "石景山区", - value: "石景山区", - open: true - }, { pId: "0_1_2", id: "0_1_2_13", text: "顺义区", value: "顺义区", open: true }, { - pId: "0_1_2", - id: "0_1_2_14", - text: "通州区", - value: "通州区", - open: true - }, { pId: "0_1_2", id: "0_1_2_15", text: "西城区", value: "西城区", open: true }, { - pId: "0_1_2", - id: "0_1_2_16", - text: "西城区 ", - value: "西城区 ", - open: true - }, { pId: "0_1", id: "0_1_3", text: "福建省( 共9个 )", value: "福建省", open: true }, { - pId: "0_1_3", - id: "0_1_3_0", - text: "福州市", - value: "福州市", - open: true - }, { pId: "0_1_3", id: "0_1_3_1", text: "龙岩市", value: "龙岩市", open: true }, { - pId: "0_1_3", - id: "0_1_3_2", - text: "南平市", - value: "南平市", - open: true - }, { pId: "0_1_3", id: "0_1_3_3", text: "宁德市", value: "宁德市", open: true }, { - pId: "0_1_3", - id: "0_1_3_4", - text: "莆田市", - value: "莆田市", - open: true - }, { pId: "0_1_3", id: "0_1_3_5", text: "泉州市", value: "泉州市", open: true }, { - pId: "0_1_3", - id: "0_1_3_6", - text: "三明市", - value: "三明市", - open: true - }, { pId: "0_1_3", id: "0_1_3_7", text: "厦门市", value: "厦门市", open: true }, { - pId: "0_1_3", - id: "0_1_3_8", - text: "漳州市", - value: "漳州市", - open: true - }, { pId: "0_1", id: "0_1_4", text: "甘肃省( 共12个 )", value: "甘肃省", open: true }, { - pId: "0_1_4", - id: "0_1_4_0", - text: "白银市", - value: "白银市", - open: true - }, { pId: "0_1_4", id: "0_1_4_1", text: "嘉峪关市", value: "嘉峪关市", open: true }, { - pId: "0_1_4", - id: "0_1_4_2", - text: "金昌市", - value: "金昌市", - open: true - }, { pId: "0_1_4", id: "0_1_4_3", text: "酒泉市", value: "酒泉市", open: true }, { - pId: "0_1_4", - id: "0_1_4_4", - text: "兰州市", - value: "兰州市", - open: true - }, { pId: "0_1_4", id: "0_1_4_5", text: "陇南市", value: "陇南市", open: true }, { - pId: "0_1_4", - id: "0_1_4_6", - text: "平凉市", - value: "平凉市", - open: true - }, { pId: "0_1_4", id: "0_1_4_7", text: "庆阳市", value: "庆阳市", open: true }, { - pId: "0_1_4", - id: "0_1_4_8", - text: "天津市区", - value: "天津市区", - open: true - }, { pId: "0_1_4", id: "0_1_4_9", text: "天水市", value: "天水市", open: true }, { - pId: "0_1_4", - id: "0_1_4_10", - text: "武威市", - value: "武威市", - open: true - }, { pId: "0_1_4", id: "0_1_4_11", text: "张掖市", value: "张掖市", open: true }, { - pId: "0_1", - id: "0_1_5", - text: "广东省( 共21个 )", - value: "广东省", - open: true - }, { pId: "0_1_5", id: "0_1_5_0", text: "潮州市", value: "潮州市", open: true }, { - pId: "0_1_5", - id: "0_1_5_1", - text: "东莞市", - value: "东莞市", - open: true - }, { pId: "0_1_5", id: "0_1_5_2", text: "佛山市", value: "佛山市", open: true }, { - pId: "0_1_5", - id: "0_1_5_3", - text: "广州市", - value: "广州市", - open: true - }, { pId: "0_1_5", id: "0_1_5_4", text: "河源市", value: "河源市", open: true }, { - pId: "0_1_5", - id: "0_1_5_5", - text: "惠州市", - value: "惠州市", - open: true - }, { pId: "0_1_5", id: "0_1_5_6", text: "江门市", value: "江门市", open: true }, { - pId: "0_1_5", - id: "0_1_5_7", - text: "揭阳市", - value: "揭阳市", - open: true - }, { pId: "0_1_5", id: "0_1_5_8", text: "茂名市", value: "茂名市", open: true }, { - pId: "0_1_5", - id: "0_1_5_9", - text: "梅州市", - value: "梅州市", - open: true - }, { pId: "0_1_5", id: "0_1_5_10", text: "清远市", value: "清远市", open: true }, { - pId: "0_1_5", - id: "0_1_5_11", - text: "汕头市", - value: "汕头市", - open: true - }, { pId: "0_1_5", id: "0_1_5_12", text: "汕尾市", value: "汕尾市", open: true }, { - pId: "0_1_5", - id: "0_1_5_13", - text: "韶关市", - value: "韶关市", - open: true - }, { pId: "0_1_5", id: "0_1_5_14", text: "深圳市", value: "深圳市", open: true }, { - pId: "0_1_5", - id: "0_1_5_15", - text: "阳江市", - value: "阳江市", - open: true - }, { pId: "0_1_5", id: "0_1_5_16", text: "云浮市", value: "云浮市", open: true }, { - pId: "0_1_5", - id: "0_1_5_17", - text: "湛江市", - value: "湛江市", - open: true - }, { pId: "0_1_5", id: "0_1_5_18", text: "肇庆市", value: "肇庆市", open: true }, { - pId: "0_1_5", - id: "0_1_5_19", - text: "中山市", - value: "中山市", - open: true - }, { pId: "0_1_5", id: "0_1_5_20", text: "珠海市", value: "珠海市", open: true }, { - pId: "0_1", - id: "0_1_6", - text: "广西壮族自治区( 共14个 )", - value: "广西壮族自治区", - open: true - }, { pId: "0_1_6", id: "0_1_6_0", text: "百色市", value: "百色市", open: true }, { - pId: "0_1_6", - id: "0_1_6_1", - text: "北海市", - value: "北海市", - open: true - }, { pId: "0_1_6", id: "0_1_6_2", text: "崇左市", value: "崇左市", open: true }, { - pId: "0_1_6", - id: "0_1_6_3", - text: "防城港市", - value: "防城港市", - open: true - }, { pId: "0_1_6", id: "0_1_6_4", text: "桂林市", value: "桂林市", open: true }, { - pId: "0_1_6", - id: "0_1_6_5", - text: "贵港市", - value: "贵港市", - open: true - }, { pId: "0_1_6", id: "0_1_6_6", text: "河池市", value: "河池市", open: true }, { - pId: "0_1_6", - id: "0_1_6_7", - text: "贺州市", - value: "贺州市", - open: true - }, { pId: "0_1_6", id: "0_1_6_8", text: "来宾市", value: "来宾市", open: true }, { - pId: "0_1_6", - id: "0_1_6_9", - text: "柳州市", - value: "柳州市", - open: true - }, { pId: "0_1_6", id: "0_1_6_10", text: "南宁市", value: "南宁市", open: true }, { - pId: "0_1_6", - id: "0_1_6_11", - text: "钦州市", - value: "钦州市", - open: true - }, { pId: "0_1_6", id: "0_1_6_12", text: "梧州市", value: "梧州市", open: true }, { - pId: "0_1_6", - id: "0_1_6_13", - text: "玉林市", - value: "玉林市", - open: true - }, { pId: "0_1", id: "0_1_7", text: "贵州省( 共9个 )", value: "贵州省", open: true }, { - pId: "0_1_7", - id: "0_1_7_0", - text: "安顺市", - value: "安顺市", - open: true - }, { pId: "0_1_7", id: "0_1_7_1", text: "毕节地区", value: "毕节地区", open: true }, { - pId: "0_1_7", - id: "0_1_7_2", - text: "贵阳市", - value: "贵阳市", - open: true - }, { pId: "0_1_7", id: "0_1_7_3", text: "六盘水市", value: "六盘水市", open: true }, { - pId: "0_1_7", - id: "0_1_7_4", - text: "黔东南州", - value: "黔东南州", - open: true - }, { pId: "0_1_7", id: "0_1_7_5", text: "黔南州", value: "黔南州", open: true }, { - pId: "0_1_7", - id: "0_1_7_6", - text: "黔西南市", - value: "黔西南市", - open: true - }, { pId: "0_1_7", id: "0_1_7_7", text: "铜仁地区", value: "铜仁地区", open: true }, { - pId: "0_1_7", - id: "0_1_7_8", - text: "遵义市", - value: "遵义市", - open: true - }, { pId: "0_1", id: "0_1_8", text: "海南省( 共2个 )", value: "海南省", open: true }, { - pId: "0_1_8", - id: "0_1_8_0", - text: "海口市", - value: "海口市", - open: true - }, { pId: "0_1_8", id: "0_1_8_1", text: "三亚市", value: "三亚市", open: true }, { - pId: "0_1", - id: "0_1_9", - text: "河北省( 共12个 )", - value: "河北省", - open: true - }, { pId: "0_1_9", id: "0_1_9_0", text: "保定市", value: "保定市", open: true }, { - pId: "0_1_9", - id: "0_1_9_1", - text: "沧州市", - value: "沧州市", - open: true - }, { pId: "0_1_9", id: "0_1_9_2", text: "承德市", value: "承德市", open: true }, { - pId: "0_1_9", - id: "0_1_9_3", - text: "邯郸市", - value: "邯郸市", - open: true - }, { pId: "0_1_9", id: "0_1_9_4", text: "衡水市", value: "衡水市", open: true }, { - pId: "0_1_9", - id: "0_1_9_5", - text: "廊坊市", - value: "廊坊市", - open: true - }, { pId: "0_1_9", id: "0_1_9_6", text: "秦皇岛市", value: "秦皇岛市", open: true }, { - pId: "0_1_9", - id: "0_1_9_7", - text: "石家庄市", - value: "石家庄市", - open: true - }, { pId: "0_1_9", id: "0_1_9_8", text: "唐山市", value: "唐山市", open: true }, { - pId: "0_1_9", - id: "0_1_9_9", - text: "天津市区", - value: "天津市区", - open: true - }, { pId: "0_1_9", id: "0_1_9_10", text: "邢台市", value: "邢台市", open: true }, { - pId: "0_1_9", - id: "0_1_9_11", - text: "张家口市", - value: "张家口市", - open: true - }, { pId: "0_1", id: "0_1_10", text: "河南省( 共19个 )", value: "河南省", open: true }, { - pId: "0_1_10", - id: "0_1_10_0", - text: "安阳市", - value: "安阳市", - open: true - }, { pId: "0_1_10", id: "0_1_10_1", text: "鹤壁市", value: "鹤壁市", open: true }, { - pId: "0_1_10", - id: "0_1_10_2", - text: "济源市", - value: "济源市", - open: true - }, { pId: "0_1_10", id: "0_1_10_3", text: "焦作市", value: "焦作市", open: true }, { - pId: "0_1_10", - id: "0_1_10_4", - text: "开封市", - value: "开封市", - open: true - }, { pId: "0_1_10", id: "0_1_10_5", text: "廊坊市", value: "廊坊市", open: true }, { - pId: "0_1_10", - id: "0_1_10_6", - text: "洛阳市", - value: "洛阳市", - open: true - }, { pId: "0_1_10", id: "0_1_10_7", text: "漯河市", value: "漯河市", open: true }, { - pId: "0_1_10", - id: "0_1_10_8", - text: "南阳市", - value: "南阳市", - open: true - }, { pId: "0_1_10", id: "0_1_10_9", text: "平顶山市", value: "平顶山市", open: true }, { - pId: "0_1_10", - id: "0_1_10_10", - text: "濮阳市", - value: "濮阳市", - open: true - }, { pId: "0_1_10", id: "0_1_10_11", text: "三门峡市", value: "三门峡市", open: true }, { - pId: "0_1_10", - id: "0_1_10_12", - text: "商丘市", - value: "商丘市", - open: true - }, { pId: "0_1_10", id: "0_1_10_13", text: "新乡市", value: "新乡市", open: true }, { - pId: "0_1_10", - id: "0_1_10_14", - text: "信阳市", - value: "信阳市", - open: true - }, { pId: "0_1_10", id: "0_1_10_15", text: "许昌市", value: "许昌市", open: true }, { - pId: "0_1_10", - id: "0_1_10_16", - text: "郑州市", - value: "郑州市", - open: true - }, { pId: "0_1_10", id: "0_1_10_17", text: "周口市", value: "周口市", open: true }, { - pId: "0_1_10", - id: "0_1_10_18", - text: "驻马店市", - value: "驻马店市", - open: true - }, { pId: "0_1", id: "0_1_11", text: "黑龙江省( 共13个 )", value: "黑龙江省", open: true }, { - pId: "0_1_11", - id: "0_1_11_0", - text: "大庆市", - value: "大庆市", - open: true - }, { pId: "0_1_11", id: "0_1_11_1", text: "大兴安岭地区", value: "大兴安岭地区", open: true }, { - pId: "0_1_11", - id: "0_1_11_2", - text: "大兴安岭市", - value: "大兴安岭市", - open: true - }, { pId: "0_1_11", id: "0_1_11_3", text: "哈尔滨市", value: "哈尔滨市", open: true }, { - pId: "0_1_11", - id: "0_1_11_4", - text: "鹤港市", - value: "鹤港市", - open: true - }, { pId: "0_1_11", id: "0_1_11_5", text: "黑河市", value: "黑河市", open: true }, { - pId: "0_1_11", - id: "0_1_11_6", - text: "佳木斯市", - value: "佳木斯市", - open: true - }, { pId: "0_1_11", id: "0_1_11_7", text: "牡丹江市", value: "牡丹江市", open: true }, { - pId: "0_1_11", - id: "0_1_11_8", - text: "七台河市", - value: "七台河市", - open: true - }, { pId: "0_1_11", id: "0_1_11_9", text: "齐齐哈尔市", value: "齐齐哈尔市", open: true }, { - pId: "0_1_11", - id: "0_1_11_10", - text: "双鸭山市", - value: "双鸭山市", - open: true - }, { pId: "0_1_11", id: "0_1_11_11", text: "绥化市", value: "绥化市", open: true }, { - pId: "0_1_11", - id: "0_1_11_12", - text: "伊春市", - value: "伊春市", - open: true - }, { pId: "0_1", id: "0_1_12", text: "湖北省( 共16个 )", value: "湖北省", open: true }, { - pId: "0_1_12", - id: "0_1_12_0", - text: "鄂州市", - value: "鄂州市", - open: true - }, { pId: "0_1_12", id: "0_1_12_1", text: "恩施土家族苗族自治州", value: "恩施土家族苗族自治州", open: true }, { - pId: "0_1_12", - id: "0_1_12_2", - text: "黄冈市", - value: "黄冈市", - open: true - }, { pId: "0_1_12", id: "0_1_12_3", text: "黄石市", value: "黄石市", open: true }, { - pId: "0_1_12", - id: "0_1_12_4", - text: "荆门市", - value: "荆门市", - open: true - }, { pId: "0_1_12", id: "0_1_12_5", text: "荆州市", value: "荆州市", open: true }, { - pId: "0_1_12", - id: "0_1_12_6", - text: "神农架市", - value: "神农架市", - open: true - }, { pId: "0_1_12", id: "0_1_12_7", text: "十堰市", value: "十堰市", open: true }, { - pId: "0_1_12", - id: "0_1_12_8", - text: "随州市", - value: "随州市", - open: true - }, { pId: "0_1_12", id: "0_1_12_9", text: "天门市", value: "天门市", open: true }, { - pId: "0_1_12", - id: "0_1_12_10", - text: "武汉市", - value: "武汉市", - open: true - }, { pId: "0_1_12", id: "0_1_12_11", text: "咸宁市", value: "咸宁市", open: true }, { - pId: "0_1_12", - id: "0_1_12_12", - text: "襄樊市", - value: "襄樊市", - open: true - }, { pId: "0_1_12", id: "0_1_12_13", text: "襄阳市", value: "襄阳市", open: true }, { - pId: "0_1_12", - id: "0_1_12_14", - text: "孝感市", - value: "孝感市", - open: true - }, { pId: "0_1_12", id: "0_1_12_15", text: "宜昌市", value: "宜昌市", open: true }, { - pId: "0_1", - id: "0_1_13", - text: "湖南省( 共15个 )", - value: "湖南省", - open: true - }, { pId: "0_1_13", id: "0_1_13_0", text: "常德市", value: "常德市", open: true }, { - pId: "0_1_13", - id: "0_1_13_1", - text: "长沙市", - value: "长沙市", - open: true - }, { pId: "0_1_13", id: "0_1_13_2", text: "郴州市", value: "郴州市", open: true }, { - pId: "0_1_13", - id: "0_1_13_3", - text: "衡阳市", - value: "衡阳市", - open: true - }, { pId: "0_1_13", id: "0_1_13_4", text: "怀化市", value: "怀化市", open: true }, { - pId: "0_1_13", - id: "0_1_13_5", - text: "娄底市", - value: "娄底市", - open: true - }, { pId: "0_1_13", id: "0_1_13_6", text: "邵阳市", value: "邵阳市", open: true }, { - pId: "0_1_13", - id: "0_1_13_7", - text: "湘潭市", - value: "湘潭市", - open: true - }, { pId: "0_1_13", id: "0_1_13_8", text: "湘西市", value: "湘西市", open: true }, { - pId: "0_1_13", - id: "0_1_13_9", - text: "湘西土家族苗族自治州", - value: "湘西土家族苗族自治州", - open: true - }, { pId: "0_1_13", id: "0_1_13_10", text: "益阳市", value: "益阳市", open: true }, { - pId: "0_1_13", - id: "0_1_13_11", - text: "永州市", - value: "永州市", - open: true - }, { pId: "0_1_13", id: "0_1_13_12", text: "岳阳市", value: "岳阳市", open: true }, { - pId: "0_1_13", - id: "0_1_13_13", - text: "张家界市", - value: "张家界市", - open: true - }, { pId: "0_1_13", id: "0_1_13_14", text: "株洲市", value: "株洲市", open: true }, { - pId: "0_1", - id: "0_1_14", - text: "吉林省( 共10个 )", - value: "吉林省", - open: true - }, { pId: "0_1_14", id: "0_1_14_0", text: "白城市", value: "白城市", open: true }, { - pId: "0_1_14", - id: "0_1_14_1", - text: "白山市", - value: "白山市", - open: true - }, { pId: "0_1_14", id: "0_1_14_2", text: "长春市", value: "长春市", open: true }, { - pId: "0_1_14", - id: "0_1_14_3", - text: "大庆市", - value: "大庆市", - open: true - }, { pId: "0_1_14", id: "0_1_14_4", text: "吉林市", value: "吉林市", open: true }, { - pId: "0_1_14", - id: "0_1_14_5", - text: "辽源市", - value: "辽源市", - open: true - }, { pId: "0_1_14", id: "0_1_14_6", text: "四平市", value: "四平市", open: true }, { - pId: "0_1_14", - id: "0_1_14_7", - text: "松原市", - value: "松原市", - open: true - }, { pId: "0_1_14", id: "0_1_14_8", text: "通化市", value: "通化市", open: true }, { - pId: "0_1_14", - id: "0_1_14_9", - text: "延边朝鲜族自治州", - value: "延边朝鲜族自治州", - open: true - }, { pId: "0_1", id: "0_1_15", text: "江苏省( 共13个 )", value: "江苏省", open: true }, { - pId: "0_1_15", - id: "0_1_15_0", - text: "常州市", - value: "常州市", - open: true - }, { pId: "0_1_15", id: "0_1_15_1", text: "淮安市", value: "淮安市", open: true }, { - pId: "0_1_15", - id: "0_1_15_2", - text: "连云港市", - value: "连云港市", - open: true - }, { pId: "0_1_15", id: "0_1_15_3", text: "南京市", value: "南京市", open: true }, { - pId: "0_1_15", - id: "0_1_15_4", - text: "南通市", - value: "南通市", - open: true - }, { pId: "0_1_15", id: "0_1_15_5", text: "苏州市", value: "苏州市", open: true }, { - pId: "0_1_15", - id: "0_1_15_6", - text: "宿迁市", - value: "宿迁市", - open: true - }, { pId: "0_1_15", id: "0_1_15_7", text: "泰州市", value: "泰州市", open: true }, { - pId: "0_1_15", - id: "0_1_15_8", - text: "无锡市", - value: "无锡市", - open: true - }, { pId: "0_1_15", id: "0_1_15_9", text: "徐州市", value: "徐州市", open: true }, { - pId: "0_1_15", - id: "0_1_15_10", - text: "盐城市", - value: "盐城市", - open: true - }, { pId: "0_1_15", id: "0_1_15_11", text: "扬州市", value: "扬州市", open: true }, { - pId: "0_1_15", - id: "0_1_15_12", - text: "镇江市", - value: "镇江市", - open: true - }, { pId: "0_1", id: "0_1_16", text: "江西省( 共10个 )", value: "江西省", open: true }, { - pId: "0_1_16", - id: "0_1_16_0", - text: "抚州市", - value: "抚州市", - open: true - }, { pId: "0_1_16", id: "0_1_16_1", text: "赣州市", value: "赣州市", open: true }, { - pId: "0_1_16", - id: "0_1_16_2", - text: "景德镇市", - value: "景德镇市", - open: true - }, { pId: "0_1_16", id: "0_1_16_3", text: "九江市", value: "九江市", open: true }, { - pId: "0_1_16", - id: "0_1_16_4", - text: "南昌市", - value: "南昌市", - open: true - }, { pId: "0_1_16", id: "0_1_16_5", text: "萍乡市", value: "萍乡市", open: true }, { - pId: "0_1_16", - id: "0_1_16_6", - text: "上饶市", - value: "上饶市", - open: true - }, { pId: "0_1_16", id: "0_1_16_7", text: "新余市", value: "新余市", open: true }, { - pId: "0_1_16", - id: "0_1_16_8", - text: "宜春市", - value: "宜春市", - open: true - }, { pId: "0_1_16", id: "0_1_16_9", text: "鹰潭市", value: "鹰潭市", open: true }, { - pId: "0_1", - id: "0_1_17", - text: "辽宁省( 共14个 )", - value: "辽宁省", - open: true - }, { pId: "0_1_17", id: "0_1_17_0", text: "鞍山市", value: "鞍山市", open: true }, { - pId: "0_1_17", - id: "0_1_17_1", - text: "本溪市", - value: "本溪市", - open: true - }, { pId: "0_1_17", id: "0_1_17_2", text: "朝阳市", value: "朝阳市", open: true }, { - pId: "0_1_17", - id: "0_1_17_3", - text: "大连市", - value: "大连市", - open: true - }, { pId: "0_1_17", id: "0_1_17_4", text: "丹东市", value: "丹东市", open: true }, { - pId: "0_1_17", - id: "0_1_17_5", - text: "抚顺市", - value: "抚顺市", - open: true - }, { pId: "0_1_17", id: "0_1_17_6", text: "阜新市", value: "阜新市", open: true }, { - pId: "0_1_17", - id: "0_1_17_7", - text: "葫芦岛市", - value: "葫芦岛市", - open: true - }, { pId: "0_1_17", id: "0_1_17_8", text: "锦州市", value: "锦州市", open: true }, { - pId: "0_1_17", - id: "0_1_17_9", - text: "辽阳市", - value: "辽阳市", - open: true - }, { pId: "0_1_17", id: "0_1_17_10", text: "盘锦市", value: "盘锦市", open: true }, { - pId: "0_1_17", - id: "0_1_17_11", - text: "沈阳市", - value: "沈阳市", - open: true - }, { pId: "0_1_17", id: "0_1_17_12", text: "铁岭市", value: "铁岭市", open: true }, { - pId: "0_1_17", - id: "0_1_17_13", - text: "营口市", - value: "营口市", - open: true - }, { pId: "0_1", id: "0_1_18", text: "内蒙古( 共10个 )", value: "内蒙古", open: true }, { - pId: "0_1_18", - id: "0_1_18_0", - text: "包头市", - value: "包头市", - open: true - }, { pId: "0_1_18", id: "0_1_18_1", text: "赤峰市", value: "赤峰市", open: true }, { - pId: "0_1_18", - id: "0_1_18_2", - text: "鄂尔多斯市", - value: "鄂尔多斯市", - open: true - }, { pId: "0_1_18", id: "0_1_18_3", text: "呼和浩特市", value: "呼和浩特市", open: true }, { - pId: "0_1_18", - id: "0_1_18_4", - text: "呼伦贝尔市", - value: "呼伦贝尔市", - open: true - }, { pId: "0_1_18", id: "0_1_18_5", text: "通辽市", value: "通辽市", open: true }, { - pId: "0_1_18", - id: "0_1_18_6", - text: "乌海市", - value: "乌海市", - open: true - }, { pId: "0_1_18", id: "0_1_18_7", text: "锡林郭勒市", value: "锡林郭勒市", open: true }, { - pId: "0_1_18", - id: "0_1_18_8", - text: "兴安市", - value: "兴安市", - open: true - }, { pId: "0_1_18", id: "0_1_18_9", text: "运城市", value: "运城市", open: true }, { - pId: "0_1", - id: "0_1_19", - text: "宁夏回族自治区( 共5个 )", - value: "宁夏回族自治区", - open: true - }, { pId: "0_1_19", id: "0_1_19_0", text: "固原市", value: "固原市", open: true }, { - pId: "0_1_19", - id: "0_1_19_1", - text: "石嘴山市", - value: "石嘴山市", - open: true - }, { pId: "0_1_19", id: "0_1_19_2", text: "吴忠市", value: "吴忠市", open: true }, { - pId: "0_1_19", - id: "0_1_19_3", - text: "银川市", - value: "银川市", - open: true - }, { pId: "0_1_19", id: "0_1_19_4", text: "中卫市", value: "中卫市", open: true }, { - pId: "0_1", - id: "0_1_20", - text: "青海省( 共4个 )", - value: "青海省", - open: true - }, { pId: "0_1_20", id: "0_1_20_0", text: "海东地区", value: "海东地区", open: true }, { - pId: "0_1_20", - id: "0_1_20_1", - text: "海南藏族自治州", - value: "海南藏族自治州", - open: true - }, { pId: "0_1_20", id: "0_1_20_2", text: "海西蒙古族藏族自治州", value: "海西蒙古族藏族自治州", open: true }, { - pId: "0_1_20", - id: "0_1_20_3", - text: "西宁市", - value: "西宁市", - open: true - }, { pId: "0_1", id: "0_1_21", text: "山东省( 共17个 )", value: "山东省", open: true }, { - pId: "0_1_21", - id: "0_1_21_0", - text: "滨州市", - value: "滨州市", - open: true - }, { pId: "0_1_21", id: "0_1_21_1", text: "德州市", value: "德州市", open: true }, { - pId: "0_1_21", - id: "0_1_21_2", - text: "东营市", - value: "东营市", - open: true - }, { pId: "0_1_21", id: "0_1_21_3", text: "菏泽市", value: "菏泽市", open: true }, { - pId: "0_1_21", - id: "0_1_21_4", - text: "济南市", - value: "济南市", - open: true - }, { pId: "0_1_21", id: "0_1_21_5", text: "济宁市", value: "济宁市", open: true }, { - pId: "0_1_21", - id: "0_1_21_6", - text: "莱芜市", - value: "莱芜市", - open: true - }, { pId: "0_1_21", id: "0_1_21_7", text: "聊城市", value: "聊城市", open: true }, { - pId: "0_1_21", - id: "0_1_21_8", - text: "临沂市", - value: "临沂市", - open: true - }, { pId: "0_1_21", id: "0_1_21_9", text: "青岛市", value: "青岛市", open: true }, { - pId: "0_1_21", - id: "0_1_21_10", - text: "日照市", - value: "日照市", - open: true - }, { pId: "0_1_21", id: "0_1_21_11", text: "泰安市", value: "泰安市", open: true }, { - pId: "0_1_21", - id: "0_1_21_12", - text: "威海市", - value: "威海市", - open: true - }, { pId: "0_1_21", id: "0_1_21_13", text: "潍坊市", value: "潍坊市", open: true }, { - pId: "0_1_21", - id: "0_1_21_14", - text: "烟台市", - value: "烟台市", - open: true - }, { pId: "0_1_21", id: "0_1_21_15", text: "枣庄市", value: "枣庄市", open: true }, { - pId: "0_1_21", - id: "0_1_21_16", - text: "淄博市", - value: "淄博市", - open: true - }, { pId: "0_1", id: "0_1_22", text: "山西省( 共12个 )", value: "山西省", open: true }, { - pId: "0_1_22", - id: "0_1_22_0", - text: "长治市", - value: "长治市", - open: true - }, { pId: "0_1_22", id: "0_1_22_1", text: "大同市", value: "大同市", open: true }, { - pId: "0_1_22", - id: "0_1_22_2", - text: "晋城市", - value: "晋城市", - open: true - }, { pId: "0_1_22", id: "0_1_22_3", text: "晋中市", value: "晋中市", open: true }, { - pId: "0_1_22", - id: "0_1_22_4", - text: "临汾市", - value: "临汾市", - open: true - }, { pId: "0_1_22", id: "0_1_22_5", text: "吕梁市", value: "吕梁市", open: true }, { - pId: "0_1_22", - id: "0_1_22_6", - text: "青岛市", - value: "青岛市", - open: true - }, { pId: "0_1_22", id: "0_1_22_7", text: "朔州市", value: "朔州市", open: true }, { - pId: "0_1_22", - id: "0_1_22_8", - text: "太原市", - value: "太原市", - open: true - }, { pId: "0_1_22", id: "0_1_22_9", text: "忻州市", value: "忻州市", open: true }, { - pId: "0_1_22", - id: "0_1_22_10", - text: "阳泉市", - value: "阳泉市", - open: true - }, { pId: "0_1_22", id: "0_1_22_11", text: "运城市", value: "运城市", open: true }, { - pId: "0_1", - id: "0_1_23", - text: "陕西省( 共9个 )", - value: "陕西省", - open: true - }, { pId: "0_1_23", id: "0_1_23_0", text: "安康市", value: "安康市", open: true }, { - pId: "0_1_23", - id: "0_1_23_1", - text: "宝鸡市", - value: "宝鸡市", - open: true - }, { pId: "0_1_23", id: "0_1_23_2", text: "汉中市", value: "汉中市", open: true }, { - pId: "0_1_23", - id: "0_1_23_3", - text: "商洛市", - value: "商洛市", - open: true - }, { pId: "0_1_23", id: "0_1_23_4", text: "渭南市", value: "渭南市", open: true }, { - pId: "0_1_23", - id: "0_1_23_5", - text: "西安市", - value: "西安市", - open: true - }, { pId: "0_1_23", id: "0_1_23_6", text: "咸阳市", value: "咸阳市", open: true }, { - pId: "0_1_23", - id: "0_1_23_7", - text: "延安市", - value: "延安市", - open: true - }, { pId: "0_1_23", id: "0_1_23_8", text: "榆林市", value: "榆林市", open: true }, { - pId: "0_1", - id: "0_1_24", - text: "上海市( 共19个 )", - value: "上海市", - open: true - }, { pId: "0_1_24", id: "0_1_24_0", text: "宝山区", value: "宝山区", open: true }, { - pId: "0_1_24", - id: "0_1_24_1", - text: "长宁区", - value: "长宁区", - open: true - }, { pId: "0_1_24", id: "0_1_24_2", text: "崇明县", value: "崇明县", open: true }, { - pId: "0_1_24", - id: "0_1_24_3", - text: "奉贤区", - value: "奉贤区", - open: true - }, { pId: "0_1_24", id: "0_1_24_4", text: "虹口区", value: "虹口区", open: true }, { - pId: "0_1_24", - id: "0_1_24_5", - text: "黄浦区", - value: "黄浦区", - open: true - }, { pId: "0_1_24", id: "0_1_24_6", text: "嘉定区", value: "嘉定区", open: true }, { - pId: "0_1_24", - id: "0_1_24_7", - text: "金山区", - value: "金山区", - open: true - }, { pId: "0_1_24", id: "0_1_24_8", text: "静安区", value: "静安区", open: true }, { - pId: "0_1_24", - id: "0_1_24_9", - text: "昆明市", - value: "昆明市", - open: true - }, { pId: "0_1_24", id: "0_1_24_10", text: "闵行区", value: "闵行区", open: true }, { - pId: "0_1_24", - id: "0_1_24_11", - text: "普陀区", - value: "普陀区", - open: true - }, { pId: "0_1_24", id: "0_1_24_12", text: "浦东新区", value: "浦东新区", open: true }, { - pId: "0_1_24", - id: "0_1_24_13", - text: "青浦区", - value: "青浦区", - open: true - }, { pId: "0_1_24", id: "0_1_24_14", text: "上海市区", value: "上海市区", open: true }, { - pId: "0_1_24", - id: "0_1_24_15", - text: "松江区", - value: "松江区", - open: true - }, { pId: "0_1_24", id: "0_1_24_16", text: "徐汇区", value: "徐汇区", open: true }, { - pId: "0_1_24", - id: "0_1_24_17", - text: "杨浦区", - value: "杨浦区", - open: true - }, { pId: "0_1_24", id: "0_1_24_18", text: "闸北区", value: "闸北区", open: true }, { - pId: "0_1", - id: "0_1_25", - text: "四川省( 共21个 )", - value: "四川省", - open: true - }, { pId: "0_1_25", id: "0_1_25_0", text: "阿坝藏族羌族自治州", value: "阿坝藏族羌族自治州", open: true }, { - pId: "0_1_25", - id: "0_1_25_1", - text: "巴中市", - value: "巴中市", - open: true - }, { pId: "0_1_25", id: "0_1_25_2", text: "成都市", value: "成都市", open: true }, { - pId: "0_1_25", - id: "0_1_25_3", - text: "达州市", - value: "达州市", - open: true - }, { pId: "0_1_25", id: "0_1_25_4", text: "德阳市", value: "德阳市", open: true }, { - pId: "0_1_25", - id: "0_1_25_5", - text: "甘孜市", - value: "甘孜市", - open: true - }, { pId: "0_1_25", id: "0_1_25_6", text: "广安市", value: "广安市", open: true }, { - pId: "0_1_25", - id: "0_1_25_7", - text: "广元市", - value: "广元市", - open: true - }, { pId: "0_1_25", id: "0_1_25_8", text: "乐山市", value: "乐山市", open: true }, { - pId: "0_1_25", - id: "0_1_25_9", - text: "凉山市", - value: "凉山市", - open: true - }, { pId: "0_1_25", id: "0_1_25_10", text: "泸州市", value: "泸州市", open: true }, { - pId: "0_1_25", - id: "0_1_25_11", - text: "眉山市", - value: "眉山市", - open: true - }, { pId: "0_1_25", id: "0_1_25_12", text: "绵阳市", value: "绵阳市", open: true }, { - pId: "0_1_25", - id: "0_1_25_13", - text: "南充市", - value: "南充市", - open: true - }, { pId: "0_1_25", id: "0_1_25_14", text: "内江市", value: "内江市", open: true }, { - pId: "0_1_25", - id: "0_1_25_15", - text: "攀枝花市", - value: "攀枝花市", - open: true - }, { pId: "0_1_25", id: "0_1_25_16", text: "遂宁市", value: "遂宁市", open: true }, { - pId: "0_1_25", - id: "0_1_25_17", - text: "雅安市", - value: "雅安市", - open: true - }, { pId: "0_1_25", id: "0_1_25_18", text: "宜宾市", value: "宜宾市", open: true }, { - pId: "0_1_25", - id: "0_1_25_19", - text: "资阳市", - value: "资阳市", - open: true - }, { pId: "0_1_25", id: "0_1_25_20", text: "自贡市", value: "自贡市", open: true }, { - pId: "0_1", - id: "0_1_26", - text: "台湾( 共1个 )", - value: "台湾", - open: true - }, { pId: "0_1_26", id: "0_1_26_0", text: "台北市", value: "台北市", open: true }, { - pId: "0_1", - id: "0_1_27", - text: "天津市( 共1个 )", - value: "天津市", - open: true - }, { pId: "0_1_27", id: "0_1_27_0", text: "天津市区", value: "天津市区", open: true }, { - pId: "0_1", - id: "0_1_28", - text: "西藏自治区( 共2个 )", - value: "西藏自治区", - open: true - }, { pId: "0_1_28", id: "0_1_28_0", text: "阿里市", value: "阿里市", open: true }, { - pId: "0_1_28", - id: "0_1_28_1", - text: "日喀则市", - value: "日喀则市", - open: true - }, { pId: "0_1", id: "0_1_29", text: "香港特别行政区( 共1个 )", value: "香港特别行政区", open: true }, { - pId: "0_1_29", - id: "0_1_29_0", - text: "香港", - value: "香港", - open: true - }, { - pId: "0_1", - id: "0_1_30", - text: "新疆维吾尔族自治区( 共11个 )", - value: "新疆维吾尔族自治区", - open: true - }, { pId: "0_1_30", id: "0_1_30_0", text: "巴音郭楞市", value: "巴音郭楞市", open: true }, { - pId: "0_1_30", - id: "0_1_30_1", - text: "哈密市", - value: "哈密市", - open: true - }, { pId: "0_1_30", id: "0_1_30_2", text: "和田市", value: "和田市", open: true }, { - pId: "0_1_30", - id: "0_1_30_3", - text: "喀什地区", - value: "喀什地区", - open: true - }, { pId: "0_1_30", id: "0_1_30_4", text: "克拉玛依市", value: "克拉玛依市", open: true }, { - pId: "0_1_30", - id: "0_1_30_5", - text: "克孜勒苏柯州", - value: "克孜勒苏柯州", - open: true - }, { pId: "0_1_30", id: "0_1_30_6", text: "石河子市", value: "石河子市", open: true }, { - pId: "0_1_30", - id: "0_1_30_7", - text: "塔城市", - value: "塔城市", - open: true - }, { pId: "0_1_30", id: "0_1_30_8", text: "吐鲁番地区", value: "吐鲁番地区", open: true }, { - pId: "0_1_30", - id: "0_1_30_9", - text: "乌鲁木齐", - value: "乌鲁木齐", - open: true - }, { pId: "0_1_30", id: "0_1_30_10", text: "伊犁市", value: "伊犁市", open: true }, { - pId: "0_1", - id: "0_1_31", - text: "云南省( 共12个 )", - value: "云南省", - open: true - }, { pId: "0_1_31", id: "0_1_31_0", text: "保山市", value: "保山市", open: true }, { - pId: "0_1_31", - id: "0_1_31_1", - text: "楚雄彝族自治州", - value: "楚雄彝族自治州", - open: true - }, { pId: "0_1_31", id: "0_1_31_2", text: "大理白族自治州", value: "大理白族自治州", open: true }, { - pId: "0_1_31", - id: "0_1_31_3", - text: "红河哈尼族彝族自治州", - value: "红河哈尼族彝族自治州", - open: true - }, { pId: "0_1_31", id: "0_1_31_4", text: "昆明市", value: "昆明市", open: true }, { - pId: "0_1_31", - id: "0_1_31_5", - text: "丽江市", - value: "丽江市", - open: true - }, { pId: "0_1_31", id: "0_1_31_6", text: "临沧市", value: "临沧市", open: true }, { - pId: "0_1_31", - id: "0_1_31_7", - text: "曲靖市", - value: "曲靖市", - open: true - }, { pId: "0_1_31", id: "0_1_31_8", text: "思茅市", value: "思茅市", open: true }, { - pId: "0_1_31", - id: "0_1_31_9", - text: "文山市", - value: "文山市", - open: true - }, { pId: "0_1_31", id: "0_1_31_10", text: "玉溪市", value: "玉溪市", open: true }, { - pId: "0_1_31", - id: "0_1_31_11", - text: "昭通市", - value: "昭通市", - open: true - }, { pId: "0_1", id: "0_1_32", text: "浙江省( 共12个 )", value: "浙江省", open: true }, { - pId: "0_1_32", - id: "0_1_32_0", - text: "杭州市", - value: "杭州市", - open: true - }, { pId: "0_1_32", id: "0_1_32_1", text: "湖州市", value: "湖州市", open: true }, { - pId: "0_1_32", - id: "0_1_32_2", - text: "嘉兴市", - value: "嘉兴市", - open: true - }, { pId: "0_1_32", id: "0_1_32_3", text: "金华市", value: "金华市", open: true }, { - pId: "0_1_32", - id: "0_1_32_4", - text: "丽水市", - value: "丽水市", - open: true - }, { pId: "0_1_32", id: "0_1_32_5", text: "宁波市", value: "宁波市", open: true }, { - pId: "0_1_32", - id: "0_1_32_6", - text: "衢州市", - value: "衢州市", - open: true - }, { pId: "0_1_32", id: "0_1_32_7", text: "绍兴市", value: "绍兴市", open: true }, { - pId: "0_1_32", - id: "0_1_32_8", - text: "台州市", - value: "台州市", - open: true - }, { pId: "0_1_32", id: "0_1_32_9", text: "温州市", value: "温州市", open: true }, { - pId: "0_1_32", - id: "0_1_32_10", - text: "浙江省", - value: "浙江省", - open: true - }, { pId: "0_1_32", id: "0_1_32_11", text: "舟山市", value: "舟山市", open: true }, { - pId: "0_1", - id: "0_1_33", - text: "重庆市( 共1个 )", - value: "重庆市", - open: true - }, { pId: "0_1_33", id: "0_1_33_0", text: "重庆市区", value: "重庆市区", open: true }], - - TREE: [{ id: -1, pId: -2, value: "根目录", text: "根目录" }, - { id: 1, pId: -1, value: "1", text: "第一级目录1", disabled: true }, - { id: 11, pId: 1, value: "11", text: "第二级文件1" }, - { id: 12, pId: 1, value: "12", text: "第二级目录2" }, - { id: 121, pId: 12, value: "121", text: "第三级目录1" }, - { id: 122, pId: 12, value: "122", text: "第三级文件1" }, - { id: 1211, pId: 121, value: "1211", text: "第四级目录1" }, - { - id: 12111, - pId: 1211, - value: "12111", - text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - }, - { id: 2, pId: -1, value: "2", text: "第一级目录2" }, - { id: 21, pId: 2, value: "21", text: "第二级目录3" }, - { id: 22, pId: 2, value: "22", text: "第二级文件2" }, - { id: 211, pId: 21, value: "211", text: "第三级目录2" }, - { id: 212, pId: 21, value: "212", text: "第三级文件2" }, - { id: 2111, pId: 211, value: "2111", text: "第四级文件1" }], - LEVELTREE: [{ - id: 1, - text: "第一项", - value: "1" - }, { - id: 2, - text: "第二项", - value: "2" - }, { - id: 3, - text: "第三项", - value: "3", - open: true - }, { - id: 11, - pId: 1, - text: "子项1", - value: "11" - }, { - id: 12, - pId: 1, - text: "子项2", - value: "12" - }, { - id: 13, - pId: 1, - text: "子项3", - value: "13" - }, { - id: 31, - pId: 3, - text: "子项1", - value: "31" - }, { - id: 32, - pId: 3, - text: "子项2", - value: "32" - }, { - id: 33, - pId: 3, - text: "子项3", - value: "33" - }] -}; - diff --git a/demo/index.js b/demo/index.js deleted file mode 100644 index dbe298959..000000000 --- a/demo/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./app"; -export * from "./config"; -export * from "./version"; -export * from "./js"; \ No newline at end of file diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js deleted file mode 100644 index 823ea0d6c..000000000 --- a/demo/js/base/button/demo.button.js +++ /dev/null @@ -1,449 +0,0 @@ -import { shortcut, Widget, parseInt, Msg, map } from "@/core"; - -@shortcut() -export class Button extends Widget { - static xtype = "demo.button"; - - props = { baseCls: "demo-button" }; - - render() { - const items = [ - { - type: "bi.button", - text: "一般按钮1111111111111", - level: "common", - whiteSpace: "nowrap", - width: 100, - height: 30, - handler() { - console.log("触发点击事件"); - this.loading(); - setTimeout(() => { - this.loaded(); - }, 5 * 1000); - }, - }, - { - type: "bi.button", - text: "表示成功状态按钮", - level: "success", - height: 30, - }, - { - type: "bi.button", - text: "表示警告状态的按钮", - level: "warning", - height: 30, - }, - { - type: "bi.button", - text: "表示错误状态的按钮", - level: "error", - height: 30, - }, - { - type: "bi.button", - text: "表示忽略状态的按钮", - level: "ignore", - height: 30, - }, - { - type: "bi.button", - text: "普通灰化按钮", - disabled: true, - level: "success", - height: 30, - }, - { - type: "bi.button", - text: "忽略状态灰化按钮", - disabled: true, - level: "ignore", - height: 30, - }, - { - type: "bi.button", - text: "带图标的按钮", - // level: 'ignore', - iconCls: "close-font", - height: 30, - }, - { - type: "bi.button", - text: "一般按钮", - block: true, - level: "common", - height: 30, - }, - { - type: "bi.button", - text: "表示成功状态按钮", - block: true, - level: "success", - height: 30, - }, - { - type: "bi.button", - text: "表示警告状态的按钮", - block: true, - level: "warning", - height: 30, - }, - { - type: "bi.button", - text: "表示忽略状态的按钮", - block: true, - level: "ignore", - height: 30, - }, - { - type: "bi.button", - text: "普通灰化按钮", - block: true, - disabled: true, - level: "success", - height: 30, - }, - { - type: "bi.button", - text: "忽略状态灰化按钮", - block: true, - disabled: true, - level: "ignore", - height: 30, - }, - { - type: "bi.button", - text: "带图标的按钮", - block: true, - // level: 'ignore', - iconCls: "close-font", - height: 30, - }, - { - type: "bi.button", - text: "一般按钮", - clear: true, - level: "common", - height: 30, - }, - { - type: "bi.button", - text: "表示成功状态按钮", - clear: true, - level: "success", - height: 30, - }, - { - type: "bi.button", - text: "表示警告状态的按钮", - clear: true, - level: "warning", - height: 30, - }, - { - type: "bi.button", - text: "表示忽略状态的按钮", - clear: true, - level: "ignore", - height: 30, - }, - { - type: "bi.button", - text: "普通灰化按钮", - clear: true, - disabled: true, - level: "success", - height: 30, - }, - { - type: "bi.button", - text: "忽略状态灰化按钮", - clear: true, - disabled: true, - level: "ignore", - height: 30, - }, - { - type: "bi.button", - text: "带图标的按钮", - clear: true, - // level: 'ignore', - iconCls: "close-font", - height: 30, - }, - { - type: "bi.text_button", - text: "文字按钮", - height: 30, - }, - { - type: "bi.button", - text: "幽灵按钮(common)", - ghost: true, - height: 30, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "幽灵按钮(common)", - ghost: true, - height: 30, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "幽灵按钮(common)", - ghost: true, - level: "warning", - height: 30, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "幽灵按钮(common)", - ghost: true, - level: "error", - height: 30, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "幽灵按钮(common)", - ghost: true, - level: "success", - height: 30, - }, - { - type: "bi.button", - text: "幽灵按钮(common)灰化", - disabled: true, - ghost: true, - height: 30, - }, - { - type: "bi.button", - text: "弹出bubble", - bubble() { - return `${parseInt(Math.random() * 100) % 10}提示`; - }, - handler() { - Msg.toast("1111"); - }, - height: 30, - }, - { - type: "bi.button", - text: "自动撑开", - iconCls: "close-font", - // textHeight: 32, - // height: 32, - iconGap: 64, - vgap: 16, - hgap: 100, - iconPosition: "bottom", - }, - { - type: "bi.button", - text: "图标在下面的按钮", - iconCls: "close-font", - iconPosition: "bottom", - }, - { - type: "bi.button", - text: "图标在左边的按钮", - iconCls: "close-font", - iconPosition: "left", - }, - { - type: "bi.button", - text: "图标在右边的按钮", - iconCls: "close-font", - iconPosition: "right", - }, - { - type: "bi.button", - text: "浅色的一般按钮", - iconCls: "plus-font", - light: true, - }, - { - type: "bi.button", - text: "浅色的成功按钮", - level: "success", - iconCls: "plus-font", - light: true, - }, - { - type: "bi.button", - text: "浅色的警告按钮", - level: "warning", - iconCls: "plus-font", - light: true, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "浅色的失败按钮", - level: "error", - cls: "hover-mask", - light: true, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "common", - plain: true, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "success", - plain: true, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "error", - plain: true, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "warning", - plain: true, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "ignore", - plain: true, - }, - { - type: "bi.button", - iconCls: "plus-font", - plain: true, - level: "error", - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - plain: true, - disabled: true, - }, - { - type: "bi.button", - iconCls: "plus-font", - text: "点我,更改图标", - handler() { - this.i = this.i === undefined ? 0 : ++this.i; - const arr = [ - "text-background-font", - "check-mark-ha-font", - "close-font", - "search-font", - "date-change-h-font" - ]; - if (this.i >= arr.length) { - this.i = 0; - } - this.setIcon(arr[this.i]); - }, - height: 24, - }, - { - type: "bi.button", - text: "带加载的按钮", - handler() { - console.log("触发点击事件"); - this.loading(); - setTimeout(() => { - this.loaded(); - }, 5 * 1000); - }, - }, - { - type: "bi.button", - text: "带加载的按钮", - iconCls: "circle-close-font", - handler() { - console.log("触发点击事件"); - this.loading(); - setTimeout(() => { - this.loaded(); - }, 5 * 1000); - }, - }, - { - type: "bi.button", - clear: true, - text: "带加载的按钮", - iconCls: "circle-close-font", - handler() { - console.log("触发点击事件"); - this.loading(); - setTimeout(() => { - this.loaded(); - }, 5 * 1000); - }, - }, - { - type: "bi.button", - text: "加载中的按钮", - loading: true, - handler() { - console.log("我是无法被触发的!"); - }, - }, - { - type: "bi.button", - text: "自定义图标按钮(点我修改)", - icon: { - type: "demo.joker.icon", - }, - handler() { - console.log("触发点击事件"); - this.loading(); - setTimeout(() => { - this.loaded(); - }, 5 * 1000); - }, - }, - { - type: "bi.button", - text: "文字偏左的按钮", - textAlign: "left", - width: 200, - }, - { - type: "bi.button", - text: "小于最小宽度的按钮", - width: 50, - }, - { - type: "bi.button", - text: "一个文字超级超级长的 button, 他比按钮宽度还长。", - textWidth: 500, - width: 100, - } - ]; - - return { - type: "bi.left", - scrolly: true, - vgap: 100, - hgap: 20, - items: map(items, (index, value) => { - return { - el: value, - }; - }), - }; - } -} diff --git a/demo/js/base/button/demo.icon_button.js b/demo/js/base/button/demo.icon_button.js deleted file mode 100644 index 1f61b18ee..000000000 --- a/demo/js/base/button/demo.icon_button.js +++ /dev/null @@ -1,28 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Button extends Widget { - static xtype = "demo.icon_button"; - - props = { baseCls: "demo-button" }; - - render() { - const items = [ - { - el: { - type: "bi.icon_button", - cls: "close-ha-font", - width: 25, - height: 25, - }, - } - ]; - - return { - type: "bi.left", - vgap: 200, - hgap: 20, - items, - }; - } -} diff --git a/demo/js/base/button/demo.image_button.js b/demo/js/base/button/demo.image_button.js deleted file mode 100644 index f46bf9ab1..000000000 --- a/demo/js/base/button/demo.image_button.js +++ /dev/null @@ -1,28 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Button extends Widget { - static xtype = "demo.image_button"; - - props = { baseCls: "demo-button" }; - - render() { - const items = [ - { - el: { - type: "bi.image_button", - src: "http://www.easyicon.net/api/resizeApi.php?id=1206741&size=128", - width: 100, - height: 100, - }, - } - ]; - - return { - type: "bi.left", - vgap: 200, - hgap: 20, - items, - }; - } -} diff --git a/demo/js/base/button/demo.joker.icon.js b/demo/js/base/button/demo.joker.icon.js deleted file mode 100644 index 934351a2d..000000000 --- a/demo/js/base/button/demo.joker.icon.js +++ /dev/null @@ -1,26 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class JokerIcon extends Widget { - static xtype = "demo.joker.icon"; - - render() { - const self = this; - - return { - type: "bi.label", - cls: "anim-rotate", - ref (ref) { - self.text = ref; - }, - }; - } - - loading() { - this.text.setText("🤡"); - } - - loaded() { - this.text.setText(""); - } -} diff --git a/demo/js/base/button/demo.text_button.js b/demo/js/base/button/demo.text_button.js deleted file mode 100644 index e67b33b79..000000000 --- a/demo/js/base/button/demo.text_button.js +++ /dev/null @@ -1,28 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Button extends Widget { - static xtype = "demo.text_button"; - - props = { baseCls: "demo-button" }; - - render() { - const items = [ - { - el: { - type: "bi.text_button", - text: "文字按钮", - height: 30, - keyword: "w", - }, - } - ]; - - return { - type: "bi.left", - vgap: 200, - hgap: 20, - items, - }; - } -} diff --git a/demo/js/base/button/index.js b/demo/js/base/button/index.js deleted file mode 100644 index 03d382db9..000000000 --- a/demo/js/base/button/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./demo.button"; -export * from "./demo.icon_button"; -export * from "./demo.image_button"; -export * from "./demo.joker.icon"; -export * from "./demo.text_button"; \ No newline at end of file diff --git a/demo/js/base/demo.html.js b/demo/js/base/demo.html.js deleted file mode 100644 index f0dc67cf7..000000000 --- a/demo/js/base/demo.html.js +++ /dev/null @@ -1,26 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Html extends Widget { - static xtype = "demo.html"; - - props = { baseCls: "demo-html" }; - - render() { - return { - type: "bi.vertical", - items: [ - { - type: "bi.html", - text: "

在bi.html标签中使用html原生标签

", - }, - { - type: "bi.html", - text: "", - } - ], - hgap: 300, - vgap: 20, - }; - } -} diff --git a/demo/js/base/demo.icon_label.js b/demo/js/base/demo.icon_label.js deleted file mode 100644 index 1e6e34474..000000000 --- a/demo/js/base/demo.icon_label.js +++ /dev/null @@ -1,26 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class IconLabel extends Widget { - static xtype = "demo.icon_label"; - - props = { baseCls: "demo-bubble" }; - - render() { - return { - type: "bi.default", - items: [ - { - type: "bi.label", - text: "这是一个icon标签,在加了border之后仍然是居中显示的", - }, - { - type: "bi.icon_label", - cls: "date-font bi-border", - height: 40, - width: 40, - } - ], - }; - } -} diff --git a/demo/js/base/demo.label.js b/demo/js/base/demo.label.js deleted file mode 100644 index 60c67d9e7..000000000 --- a/demo/js/base/demo.label.js +++ /dev/null @@ -1,167 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Label extends Widget { - static xtype = "demo.label"; - - props = { baseCls: "demo-label" }; - - render() { - return { - type: "bi.vertical", - items: [ - { - type: "bi.label", - cls: "layout-bg6", - text: "这是一个label控件,默认居中", - disabled: true, - textAlign: "center", - }, - { - type: "bi.label", - cls: "layout-bg1", - text: "这是一个label控件, 高度为30,默认居中", - textAlign: "center", - height: 30, - }, - { - type: "bi.label", - cls: "layout-bg3", - text: "这是一个label控件,使用水平居左", - textAlign: "left", - height: 30, - }, - { - type: "bi.label", - cls: "layout-bg2", - text: "这是一个label控件,whiteSpace是normal,不设置高度,为了演示这个是真的是normal的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - }, - { - type: "bi.label", - cls: "layout-bg5", - text: "这是一个label控件,whiteSpace是默认的nowrap,不设置高度,为了演示这个是真的是nowrap的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - }, - { - type: "bi.label", - cls: "layout-bg7", - text: "这是一个label控件,whiteSpace是默认的nowrap,高度为30,为了演示这个是真的是nowrap的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - height: 30, - }, - { - type: "bi.label", - cls: "layout-bg3", - text: "这是一个label控件,whiteSpace设置为normal,高度为60,为了演示这个是真的是normal的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - height: 60, - }, - { - type: "bi.label", - cls: "layout-bg5", - text: "这是一个label控件,whiteSpace设置为normal,textHeight控制text的lineHeight,这样可以实现换行效果,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textHeight: 30, - height: 60, - }, - { - type: "bi.label", - cls: "layout-bg1", - text: "这是一个label控件,whiteSpace设置为nowrap,textWidth控制text的width", - textWidth: 200, - height: 60, - }, - { - type: "bi.label", - cls: "layout-bg8", - text: "这是一个label控件,whiteSpace设置为normal,textWidth控制text的width,这样可以实现换行效果,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textWidth: 200, - height: 60, - }, - { - type: "bi.label", - cls: "layout-bg7", - text: "whiteSpace为默认的nowrap,高度设置为60,宽度设置为300", - height: 60, - width: 300, - }, - { - type: "bi.label", - cls: "layout-bg6", - text: "设置了宽度300,高度60,whiteSpace设置为normal", - whiteSpace: "normal", - width: 300, - height: 60, - }, - { - type: "bi.label", - cls: "layout-bg8", - text: "textWidth设置为200,textHeight设置为30,width设置300,凑点字数看效果", - width: 300, - textWidth: 200, - textHeight: 30, - height: 60, - whiteSpace: "normal", - }, - { - type: "bi.label", - cls: "layout-bg1", - text: "textWidth设置为200,width设置300,看下水平居左的换行效果", - textAlign: "left", - width: 300, - textWidth: 200, - textHeight: 30, - height: 60, - whiteSpace: "normal", - }, - { - type: "bi.label", - cls: "layout-bg2", - text: "使用默认的nowrap,再去设置textHeight,只会有一行的效果", - textAlign: "left", - width: 300, - textWidth: 200, - textHeight: 30, - height: 60, - }, - { - type: "bi.left", - items: [ - { - type: "bi.label", - cls: "layout-bg3", - text: "在float布局中自适应的,不设高度和宽度,文字多长这个就有多长", - } - ], - height: 30, - }, - { - type: "bi.left", - items: [ - { - type: "bi.label", - cls: "layout-bg4", - text: "在float布局中自适应的,设置了宽度200,后面还有", - width: 200, - } - ], - height: 30, - }, - { - type: "bi.left", - items: [ - { - type: "bi.label", - text: "在float布局中自适应的,设置了高度,文字多长这个就有多长", - cls: "layout-bg5", - height: 30, - } - ], - height: 30, - } - ], - hgap: 300, - vgap: 20, - }; - } -} diff --git a/demo/js/base/demo.label.scene.js b/demo/js/base/demo.label.scene.js deleted file mode 100644 index 50a09866b..000000000 --- a/demo/js/base/demo.label.scene.js +++ /dev/null @@ -1,673 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class LabelScene extends Widget { - static xtype = "demo.label_scene"; - - props = { baseCls: "demo-label" }; - - render() { - const items = []; - - items.push( - this.createExpander("1.1.1 文字居中,有宽度和高度,有文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg6", - text: "设置了textWidth,则一定是嵌套结构,因此需要用center_adapt布局容纳一下.为了实现不足一行时文字水平居中,超出一行时左对齐,需要设置maxWidth.", - whiteSpace: "normal", - height: 50, - width: 500, - textWidth: 200, - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.1.2 居中,有宽度和高度,有文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg6", - text: "居中,有宽度高度,有文字宽度,whiteSpace为nowrap,maxWidth会限制文字", - whiteSpace: "nowrap", - height: 50, - width: 500, - textWidth: 350, - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.2.1 居中,有宽度无高度,有文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg6", - text: "居中,有宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - width: 500, - textWidth: 200, - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.2.1 居中,有宽度无高度,有文字宽度,whiteSpace为normal,高度被父容器拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg6", - text: "此时虽然没有对label设置高度,但由于使用了center_adapt布局,依然会垂直方向居中", - whiteSpace: "normal", - width: 500, - textWidth: 200, - textAlign: "center", - }, - top: 0, - left: 0, - bottom: 0, - } - ], - }) - ); - - items.push( - this.createExpander("1.2.2 居中,有宽度无高度,有文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg6", - text: "居中,有宽度无高度,有文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - width: 500, - textWidth: 350, - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.3.1 居中,有宽度和高度,无文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg3", - text: "居中,有宽度高度,无文字宽度,whiteSpace为normal,只需用center_adapt布局包一下即可.度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,whiteSpace为normal", - width: 500, - whiteSpace: "normal", - textAlign: "center", - height: 50, - }) - ); - - items.push( - this.createExpander("1.3.2 居中,有宽度无高度,无文字宽度,whiteSpace为normal", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg3", - text: "居中,有宽度无高度,无文字宽度,whiteSpace为normal,只需用center_adapt布局包一下即可.度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,whiteSpace为normal", - width: 500, - whiteSpace: "normal", - textAlign: "center", - }, - top: 0, - left: 0, - bottom: 0, - } - ], - }) - ); - - items.push( - this.createExpander("1.4 居中,有宽度和高度,无文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg3", - text: "居中,有宽度500有高度50,无文字宽度,whiteSpace为nowrap,此处无需两层div,设置text即可,然后设置line-height为传入高度即可实现垂直方向居中", - width: 500, - whiteSpace: "nowrap", - textAlign: "center", - height: 50, - }) - ); - - items.push( - this.createExpander("1.5.1 居中,有宽度无高度,无文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg3", - text: "居中,有宽度500无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - width: 500, - whiteSpace: "nowrap", - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.5.2 居中,有宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", { - type: "bi.absolute", - height: 50, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg3", - text: "居中,有宽度500无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - width: 500, - whiteSpace: "nowrap", - textAlign: "center", - }, - top: 0, - left: 0, - bottom: 0, - } - ], - }) - ); - - items.push( - this.createExpander("1.6.1 居中,无宽度无高度,有文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg3", - text: "居中,无宽度,有文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - textWidth: 500, - whiteSpace: "nowrap", - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.6.2 居中,无宽度无高度,有文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg3", - text: "居中,无宽度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - textWidth: 500, - whiteSpace: "normal", - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.6.3 居中,无宽度无,有文字宽度,whiteSpace为normal,被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg3", - text: "居中,无宽度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - textWidth: 500, - whiteSpace: "normal", - textAlign: "center", - }, - left: 0, - right: 0, - top: 0, - bottom: 0, - } - ], - }) - ); - - items.push( - this.createExpander("1.7.1 居中,无宽度无高度,无文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg3", - text: "居中,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.7.2 居中,无宽度无高度,无文字宽度,whiteSpace为normal,被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg3", - text: "居中,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "center", - }, - left: 0, - right: 0, - top: 0, - bottom: 0, - } - ], - }) - ); - - items.push( - this.createExpander("1.7.3 居中,无宽度有高度,无文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg3", - text: "居中,无宽度有高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - height: 50, - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.8 居中,无宽度有高度,无文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg3", - text: "居中,无宽度有高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - height: 50, - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.9 居中,无宽度无高度,无文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg3", - text: "居中,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "center", - }) - ); - - items.push( - this.createExpander("1.9.1 居中,无宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", { - type: "bi.absolute", - height: 50, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg3", - text: "居中,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "center", - }, - top: 0, - left: 0, - right: 0, - bottom: 0, - } - ], - }) - ); - - items.push( - this.createExpander("2.1.1 居左,有宽度有高度,有文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,有宽度有高度,有文字宽度,whiteSpace为normal,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - textWidth: 300, - height: 50, - width: 500, - }) - ); - - items.push( - this.createExpander("2.1.2 居左,有宽度有高度,有文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,有宽度有高度,有文字宽度,whiteSpace为normal,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "left", - textWidth: 300, - height: 50, - width: 500, - }) - ); - - items.push( - this.createExpander("2.2.1 居左,有宽度无高度,有文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,有宽度无高度,有文字宽度,whiteSpace为normal,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - textWidth: 300, - width: 500, - }) - ); - - items.push( - this.createExpander("2.2.2 居左,有宽度无高度,有文字宽度,whiteSpace为normal,高度被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg2", - text: "居左,有宽度无高度,有文字宽度,whiteSpace为normal,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - textWidth: 300, - width: 500, - }, - top: 0, - bottom: 0, - left: 0, - } - ], - }) - ); - - items.push( - this.createExpander("2.2.3 居左,有宽度无高度,有文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,有宽度无高度,有文字宽度,whiteSpace为nowrap,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "left", - textWidth: 300, - width: 500, - }) - ); - - items.push( - this.createExpander("2.2.4 居左,有宽度无高度,有文字宽度,whiteSpace为nowrap,高度被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg2", - text: "居左,有宽度无高度,有文字宽度,whiteSpace为nowrap,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "left", - textWidth: 300, - width: 500, - }, - top: 0, - bottom: 0, - left: 0, - } - ], - }) - ); - - items.push( - this.createExpander("2.3.1 居左,有宽度有高度,无文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,有宽度有高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "left", - height: 50, - vgap: 5, - width: 500, - }) - ); - - items.push( - this.createExpander("2.3.2 居左,有宽度有高度,无文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,有宽度有高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - height: 50, - width: 500, - }) - ); - - items.push( - this.createExpander("2.4.1 居左,有宽度无高度,无文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,有宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - width: 500, - }) - ); - - items.push( - this.createExpander("2.4.2 居左,有宽度无高度,无文字宽度,whiteSpace为normal,高度被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg1", - text: "居左,有宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - width: 500, - }, - top: 0, - left: 0, - bottom: 0, - } - ], - }) - ); - - items.push( - this.createExpander("2.5.1 居左,无宽度无高度,有文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - textWidth: 300, - }) - ); - - items.push( - this.createExpander("2.5.2 居左,无宽度无高度,有文字宽度,whiteSpace为normal,高度被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - textWidth: 300, - }, - top: 0, - left: 0, - bottom: 0, - right: 0, - } - ], - }) - ); - - items.push( - this.createExpander("2.5.3 居左,无宽度无高度,有文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "left", - textWidth: 300, - }) - ); - - items.push( - this.createExpander("2.5.4 居左,无宽度无高度,有文字宽度,whiteSpace为nowrap,高度被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "left", - textWidth: 300, - }, - top: 0, - left: 0, - bottom: 0, - right: 0, - } - ], - }) - ); - - items.push( - this.createExpander("2.6.1 居左,无宽度有高度,无文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度有高度,无文字宽度,whiteSpace为nowrap,注意这个是设置了vgap的,为了实现居中,lineHeight要做计算,才能准确的垂直居中", - whiteSpace: "nowrap", - textAlign: "left", - vgap: 10, - height: 50, - }) - ); - - items.push( - this.createExpander("2.6.2 居左,无宽度有高度,无文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度有高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - height: 50, - }) - ); - - items.push( - this.createExpander("2.7.1 居左,无宽度无高度,无文字宽度,whiteSpace为normal", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - }) - ); - - items.push( - this.createExpander("2.7.2 居左,无宽度无高度,无文字宽度,whiteSpace为normal,高度被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - }, - top: 0, - left: 0, - bottom: 0, - right: 0, - } - ], - }) - ); - - items.push( - this.createExpander("2.7.3 居左,无宽度无高度,无文字宽度,whiteSpace为nowrap", { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "left", - }) - ); - - items.push( - this.createExpander("2.7.4 居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "left", - }, - top: 0, - left: 0, - bottom: 0, - right: 0, - } - ], - }) - ); - - items.push( - this.createExpander("2.8 居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "nowrap", - textAlign: "left", - }, - top: 0, - left: 0, - bottom: 0, - right: 0, - } - ], - }) - ); - - items.push( - this.createExpander("2.8.2 居左,无宽度无高度,无文字宽度,whiteSpace为normal,高度被父级拉满", { - type: "bi.absolute", - height: 100, - items: [ - { - el: { - type: "bi.label", - cls: "layout-bg2", - text: "居左,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", - whiteSpace: "normal", - textAlign: "left", - }, - top: 0, - left: 0, - bottom: 0, - right: 0, - } - ], - }) - ); - - return { - type: "bi.vertical", - items, - hgap: 300, - vgap: 20, - }; - } - - createExpander(text, popup) { - return { - type: "bi.vertical", - items: [ - { - type: "bi.label", - cls: "demo-font-weight-bold", - textAlign: "left", - text, - height: 30, - }, - { - el: popup, - } - ], - }; - } -} diff --git a/demo/js/base/demo.message.js b/demo/js/base/demo.message.js deleted file mode 100644 index 880f8957f..000000000 --- a/demo/js/base/demo.message.js +++ /dev/null @@ -1,27 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class Message extends Widget { - static xtype = "demo.message"; - - props = { baseCls: "demo-bubble" }; - - render() { - return { - type: "bi.center_adapt", - items: [ - { - el: { - type: "bi.button", - text: "点击我弹出一个消息框", - height: 30, - handler() { - Msg.alert("测试消息框", "我是测试消息框的内容"); - }, - }, - } - ], - }; - } -} diff --git a/demo/js/base/demo.pager.js b/demo/js/base/demo.pager.js deleted file mode 100644 index 571917953..000000000 --- a/demo/js/base/demo.pager.js +++ /dev/null @@ -1,126 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.pager"; - - props = { baseCls: "demo-func" }; - - render() { - return { - type: "bi.vertical", - items: [ - { - type: "bi.label", - height: 30, - text: "默认的分页", - }, - { - type: "bi.pager", - height: 50, - pages: 18, - groups: 5, - curr: 6, - first: "首页", - last: "尾页", - }, - { - type: "bi.label", - height: 30, - text: "显示上一页、下一页、首页、尾页", - }, - { - type: "bi.pager", - dynamicShow: false, - height: 50, - pages: 18, - groups: 5, - curr: 1, - first: "首页>", - last: "<尾页", - }, - { - type: "bi.label", - height: 30, - text: "显示上一页、下一页", - }, - { - type: "bi.pager", - dynamicShow: false, - dynamicShowFirstLast: true, - height: 50, - pages: 18, - groups: 5, - curr: 1, - first: "首页>", - last: "<尾页", - }, - { - type: "bi.label", - height: 30, - text: "自定义上一页、下一页", - }, - { - type: "bi.pager", - dynamicShow: false, - height: 50, - pages: 18, - groups: 5, - curr: 6, - prev: { - type: "bi.button", - cls: "", - text: "上一页", - value: "prev", - once: false, - height: 30, - handler() {}, - }, - next: { - type: "bi.button", - cls: "", - text: "下一页", - value: "next", - once: false, - handler() {}, - }, - }, - { - type: "bi.label", - height: 30, - text: "不知道总页数的情况(测试条件 1<=page<=3)", - }, - { - type: "bi.pager", - dynamicShow: false, - height: 50, - pages: false, - curr: 1, - prev: { - type: "bi.button", - cls: "", - text: "上一页", - value: "prev", - once: false, - height: 30, - handler() {}, - }, - next: { - type: "bi.button", - cls: "", - text: "下一页", - value: "next", - once: false, - handler() {}, - }, - hasPrev(v) { - return v > 1; - }, - hasNext(v) { - return v < 3; - }, - } - ], - }; - } -} diff --git a/demo/js/base/editor/demo.editor.js b/demo/js/base/editor/demo.editor.js deleted file mode 100644 index fbfc7bc40..000000000 --- a/demo/js/base/editor/demo.editor.js +++ /dev/null @@ -1,124 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; -import { Editor as BIEditor} from "@/base"; - -@shortcut() -export class Editor extends Widget { - static xtype = "demo.editor"; - - props = { baseCls: "demo-editor" }; - - render() { - const editor1 = createWidget({ - type: "bi.editor", - cls: "bi-border", - watermark: "报错信息显示在控件上方", - errorText: "字段不可重名!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - width: 200, - height: 24, - }); - editor1.on(BIEditor.EVENT_ENTER, () => { - editor1.blur(); - }); - const editor2 = createWidget({ - type: "bi.editor", - cls: "bi-border", - watermark: "输入'a'会有错误信息", - disabled: true, - errorText: "字段不可重名", - validationChecker(v) { - if (v == "a") { - return false; - } - - return true; - }, - allowBlank: true, - width: 200, - height: 24, - }); - const editor3 = createWidget({ - type: "bi.editor", - cls: "bi-border", - watermark: "输入'a'会有错误信息且回车键不能退出编辑", - errorText: "字段不可重名", - value: "a", - validationChecker(v) { - if (v == "a") { - return false; - } - - return true; - }, - quitChecker(v) { - return false; - }, - allowBlank: true, - width: 300, - height: 24, - }); - const editor4 = createWidget({ - type: "bi.editor", - cls: "bi-border", - inputType: "password", - autocomplete: "new-password", - watermark: "请输入密码", - allowBlank: true, - width: 300, - height: 24, - }); - createWidget({ - type: "bi.absolute", - element: this, - items: [ - { - el: editor1, - left: 0, - top: 0, - }, - { - el: editor2, - left: 250, - top: 30, - }, - { - el: editor3, - left: 500, - top: 60, - }, - { - el: editor4, - left: 700, - top: 60, - }, - { - el: { - type: "bi.button", - text: "disable", - handler() { - editor1.setEnable(false); - editor2.setEnable(false); - editor3.setEnable(false); - }, - height: 30, - }, - left: 100, - bottom: 60, - }, - { - el: { - type: "bi.button", - text: "enable", - handler() { - editor1.setEnable(true); - editor2.setEnable(true); - editor3.setEnable(true); - }, - height: 30, - }, - left: 200, - bottom: 60, - } - ], - }); - } -} diff --git a/demo/js/base/editor/demo.multifile_editor.js b/demo/js/base/editor/demo.multifile_editor.js deleted file mode 100644 index 103d98694..000000000 --- a/demo/js/base/editor/demo.multifile_editor.js +++ /dev/null @@ -1,33 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class CodeEditor extends Widget { - static xtype = "demo.multifile_editor"; - - props = { baseCls: "demo-editor" }; - - render() { - return { - type: "bi.absolute", - items: [ - { - el: { - type: "bi.adaptive", - cls: "layout-bg1", - items: [ - { - type: "bi.multifile_editor", - width: 400, - height: 300, - } - ], - width: 400, - height: 300, - }, - top: 50, - left: 50, - } - ], - }; - } -} diff --git a/demo/js/base/editor/demo.textarea_editor.js b/demo/js/base/editor/demo.textarea_editor.js deleted file mode 100644 index 7c7d42497..000000000 --- a/demo/js/base/editor/demo.textarea_editor.js +++ /dev/null @@ -1,52 +0,0 @@ -import { shortcut, Widget, createWidget, isNotEmptyString } from "@/core"; -import { TextAreaEditor, Msg } from "@/base"; - -@shortcut() -export class CodeEditor extends Widget { - static xtype = "demo.textarea_editor"; - - props = { baseCls: "demo-editor" }; - - render() { - const editor = createWidget({ - type: "bi.textarea_editor", - cls: "bi-border", - width: 600, - height: 400, - watermark: "请输入内容", - errorText: "检测内容有误", - validationChecker(v) { - return isNotEmptyString(v); - }, - }); - editor.on(TextAreaEditor.EVENT_FOCUS, () => { - Msg.toast("Focus"); - }); - editor.on(TextAreaEditor.EVENT_BLUR, () => { - Msg.toast("Blur"); - }); - createWidget({ - type: "bi.vertical", - element: this, - hgap: 30, - vgap: 20, - items: [ - editor, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(editor.getValue())); - }, - }, - { - type: "bi.button", - text: "setValue", - handler() { - editor.setValue("测试数据"); - }, - } - ], - }); - } -} diff --git a/demo/js/base/index.js b/demo/js/base/index.js deleted file mode 100644 index 90aeb226a..000000000 --- a/demo/js/base/index.js +++ /dev/null @@ -1,11 +0,0 @@ -export * from "./demo.html"; -export * from "./demo.icon_label"; -export * from "./demo.label"; -export * from "./demo.label.scene"; -export * from "./demo.message"; -export * from "./demo.pager"; - -export * from "./button"; -export * from "./editor"; -export * from "./tip"; -export * from "./tree"; \ No newline at end of file diff --git a/demo/js/base/tip/demo.bubble.js b/demo/js/base/tip/demo.bubble.js deleted file mode 100644 index 7396d9910..000000000 --- a/demo/js/base/tip/demo.bubble.js +++ /dev/null @@ -1,84 +0,0 @@ -import { shortcut, Widget, Bubbles } from "@/core"; - -@shortcut() -export class Bubble extends Widget { - static xtype = "demo.bubble"; - - props = { baseCls: "demo-bubble" }; - - render() { - const btns = []; - const items = [ - { - el: { - ref(_ref) { - btns.push(_ref); - }, - type: "bi.button", - text: "bubble测试(消息)", - title: "123", - height: 30, - handler() { - Bubbles.show("singleBubble1", "bubble测试", this, { - level: "common", - }); - }, - }, - }, - { - el: { - ref(_ref) { - btns.push(_ref); - }, - type: "bi.button", - text: "bubble测试(成功)", - height: 30, - handler() { - Bubbles.show("singleBubble2", "bubble测试", this, { - offsetStyle: "center", - level: "success", - }); - }, - }, - }, - { - el: { - ref(_ref) { - btns.push(_ref); - }, - type: "bi.button", - text: "bubble测试(错误)", - height: 30, - handler() { - Bubbles.show("singleBubble3", "bubble测试", this, { - offsetStyle: "right", - level: "error", - }); - }, - }, - }, - { - el: { - ref(_ref) { - btns.push(_ref); - }, - type: "bi.button", - text: "bubble测试(警告)", - height: 30, - handler() { - Bubbles.show("singleBubble4", "bubble测试", this, { - level: "warning", - }); - }, - }, - } - ]; - - return { - type: "bi.left", - vgap: 200, - hgap: 20, - items, - }; - } -} diff --git a/demo/js/base/tip/demo.title.js b/demo/js/base/tip/demo.title.js deleted file mode 100644 index c30d360db..000000000 --- a/demo/js/base/tip/demo.title.js +++ /dev/null @@ -1,68 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Title extends Widget { - static xtype = "demo.title"; - - props = { baseCls: "demo-title" }; - - render() { - return { - type: "bi.vertical", - items: [ - { - type: "bi.label", - cls: "layout-bg1", - height: 50, - title: "title提示", - text: "移上去有title提示", - textAlign: "center", - }, - { - type: "bi.label", - cls: "layout-bg6", - height: 50, - disabled: true, - warningTitle: "title错误提示", - text: "移上去有title错误提示", - textAlign: "center", - }, - { - type: "bi.label", - cls: "layout-bg2", - height: 50, - disabled: true, - tipType: "success", - title: "自定义title提示效果", - warningTitle: "自定义title提示效果", - text: "自定义title提示效果", - textAlign: "center", - }, - { - type: "bi.label", - cls: "layout-bg3", - height: 50, - title: () => "函数返回值作为title提示", - text: "title提示支持函数", - textAlign: "center", - }, - { - type: "bi.label", - cls: "layout-bg4", - height: 50, - title() { - return { - level: "success", - text: "自定义title\n提示效果", - textAlign: "center", - }; - }, - text: "title提示支持对象,作为bi.tooltip的props", - textAlign: "center", - } - ], - hgap: 300, - vgap: 20, - }; - } -} diff --git a/demo/js/base/tip/demo.toast.js b/demo/js/base/tip/demo.toast.js deleted file mode 100644 index 7447041bb..000000000 --- a/demo/js/base/tip/demo.toast.js +++ /dev/null @@ -1,86 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class Toast extends Widget { - static xtype = "demo.toast"; - - props = { baseCls: "demo-toast" }; - - render() { - const items = [ - { - el: { - type: "bi.button", - text: "简单Toast测试(success)", - height: 30, - handler() { - Msg.toast("这是一条简单的数据", { - level: "success", - }); - }, - }, - }, - { - el: { - type: "bi.button", - text: "很长的Toast测试(normal)", - height: 30, - handler() { - Msg.toast( - "这是一条很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的数据", - {} - ); - }, - }, - }, - { - el: { - type: "bi.button", - text: "非常长的Toast测试(warning)", - height: 30, - handler() { - Msg.toast( - "这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据", - { - level: "warning", - autoClose: false, - } - ); - }, - }, - }, - { - el: { - type: "bi.button", - text: "错误提示Toast测试(error)", - height: 30, - handler() { - Msg.toast("错误提示Toast测试", { - level: "error", - }); - }, - }, - }, - { - el: { - type: "bi.button", - text: "错误提示Toast测试(error), 此toast不会自动消失", - height: 30, - handler() { - Msg.toast("错误提示Toast测试", { - autoClose: false, - }); - }, - }, - } - ]; - createWidget({ - type: "bi.left", - element: this, - vgap: 200, - hgap: 20, - items, - }); - } -} diff --git a/demo/js/base/tree/demo.part_tree.js b/demo/js/base/tree/demo.part_tree.js deleted file mode 100644 index 60bc17f81..000000000 --- a/demo/js/base/tree/demo.part_tree.js +++ /dev/null @@ -1,98 +0,0 @@ -import { shortcut, Widget, isNull } from "@/core"; -import { TreeView } from "@/case"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.part_tree"; - - props = { baseCls: "demo-func" }; - - mounted() { - this.partTree.stroke({ - keyword: "1", - }); - } - - render() { - const self = this; - - return { - type: "bi.vtape", - items: [ - { - type: "bi.label", - height: 50, - text: "先初始化一份数据,然后再异步获取数据的树", - }, - { - type: "bi.part_tree", - ref(_ref) { - self.partTree = _ref; - }, - paras: { - selectedValues: { 1: {}, 2: { 1: {} } }, - }, - itemsCreator(op, callback) { - if (op.type === TreeView.REQ_TYPE_INIT_DATA) { - callback({ - items: [ - { - id: "1", - text: 1, - isParent: true, - open: true, - }, - { - id: "11", - pId: "1", - text: 11, - isParent: true, - open: true, - }, - { - id: "111", - pId: "11", - text: 111, - isParent: true, - }, - { - id: "2", - text: 2, - }, - { - id: "3", - text: 3, - } - ], - hasNext: isNull(op.id), - }); - - return; - } - callback({ - items: [ - { - id: `${op.id || ""}1`, - pId: op.id, - text: 1, - isParent: true, - }, - { - id: `${op.id || ""}2`, - pId: op.id, - text: 2, - }, - { - id: `${op.id || ""}3`, - pId: op.id, - text: 3, - } - ], - hasNext: isNull(op.id), - }); - }, - } - ], - }; - } -} diff --git a/demo/js/base/tree/demo.sync_tree.js b/demo/js/base/tree/demo.sync_tree.js deleted file mode 100644 index f8bddb317..000000000 --- a/demo/js/base/tree/demo.sync_tree.js +++ /dev/null @@ -1,119 +0,0 @@ -import { shortcut, Widget, isNull } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.sync_tree"; - - props = { baseCls: "demo-func" }; - - mounted() { - this.syncTree1.stroke({ - keyword: "1", - }); - this.syncTree2.stroke({ - keyword: "1", - }); - } - - render() { - const self = this; - - return { - type: "bi.vtape", - rowSize: [0.5, 0.5], - items: [ - { - type: "bi.vtape", - items: [ - { - type: "bi.label", - height: 50, - text: "可以异步获取数据的树", - }, - { - type: "bi.async_tree", - ref(_ref) { - self.syncTree1 = _ref; - }, - paras: { - selectedValues: { 1: {}, 2: { 1: {} } }, - }, - itemsCreator(op, callback) { - callback({ - items: [ - { - id: `${op.id || ""}1`, - pId: op.id, - text: `${op.id || ""}1`, - isParent: true, - iconCls: "close-h-font", - }, - { - id: `${op.id || ""}2`, - pId: op.id, - text: `${op.id || ""}2`, - iconCls: "search-font", - }, - { - id: `${op.id || ""}3`, - pId: op.id, - text: `${op.id || ""}3`, - iconCls: "date-font", - } - ], - hasNext: isNull(op.id), - }); - }, - } - ], - }, - { - type: "bi.vtape", - items: [ - { - type: "bi.label", - height: 50, - text: "showIcon属性搭配节点iconCls,可以显示图标", - }, - { - type: "bi.async_tree", - ref(_ref) { - self.syncTree2 = _ref; - }, - paras: { - selectedValues: { 1: {}, 2: { 1: {} } }, - }, - showIcon: true, - itemsCreator(op, callback) { - callback({ - items: [ - { - id: `${op.id || ""}1`, - pId: op.id, - text: `${op.id || ""}1`, - isParent: true, - iconCls: "close-h-font", - }, - { - id: `${op.id || ""}2`, - pId: op.id, - text: `${op.id || ""}2`, - iconCls: "search-font", - }, - { - id: `${op.id || ""}3`, - pId: op.id, - text: `${op.id || ""}3`, - iconCls: "date-font", - } - ], - hasNext: isNull(op.id), - }); - }, - } - ], - } - ], - }; - } -} diff --git a/demo/js/base/tree/demo.tree_view.js b/demo/js/base/tree/demo.tree_view.js deleted file mode 100644 index a41a43a89..000000000 --- a/demo/js/base/tree/demo.tree_view.js +++ /dev/null @@ -1,57 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.tree_view"; - - props = { baseCls: "demo-func" }; - - _createDefaultTree() { - const tree = createWidget({ - type: "bi.tree_view", - }); - tree.initTree([ - { id: 1, pId: 0, text: "test1", open: true }, - { id: 11, pId: 1, text: "test11" }, - { id: 12, pId: 1, text: "test12" }, - { id: 111, pId: 11, text: "test111" }, - { id: 2, pId: 0, text: "test2", open: true }, - { id: 21, pId: 2, text: "test21" }, - { id: 22, pId: 2, text: "test22" } - ]); - - return tree; - } - - render() { - const self = this; - createWidget({ - type: "bi.grid", - columns: 1, - rows: 1, - element: this, - items: [ - { - column: 0, - row: 0, - el: { - type: "bi.vtape", - items: [ - { - el: this._createDefaultTree(), - }, - { - el: { - type: "bi.label", - text: "tree.initTree([{\"id\":1, \"pId\":0, \"text\":\"test1\", open:true},{\"id\":11, \"pId\":1, \"text\":\"test11\"},{\"id\":12, \"pId\":1, \"text\":\"test12\"},{\"id\":111, \"pId\":11, \"text\":\"test111\"}])", - whiteSpace: "normal", - }, - height: 50, - } - ], - }, - } - ], - }); - } -} diff --git a/demo/js/case/combo/demo.search_text_value_combo.js b/demo/js/case/combo/demo.search_text_value_combo.js deleted file mode 100644 index 25cb79fc4..000000000 --- a/demo/js/case/combo/demo.search_text_value_combo.js +++ /dev/null @@ -1,122 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; -import { AllValueMultiTextValueCombo } from "@/component"; - -@shortcut() -export class SearchTextValueCombo extends Widget { - static xtype = "demo.search_text_value_combo"; - - props = { baseCls: "" }; - - render() { - let combo, searchCombo; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.search_text_value_combo", - ref() { - combo = this; - }, - warningTitle: "111", - text: "默认值", - value: 14, - width: 300, - items: [ - { - text: "ABC-1", - iconCls: "date-font", - value: 1, - }, - { - text: "BCD-2", - iconCls: "search-font", - value: 2, - }, - { - text: "CDE-3", - iconCls: "pull-right-font", - value: 3, - }, - { - text: "DEF-3", - iconCls: "pull-right-font", - value: 4, - }, - { - text: "FEG-3", - iconCls: "pull-right-font", - value: 5, - }, - { - text: "FGH-3", - iconCls: "pull-right-font", - value: 6, - }, - { - text: "GHI-3", - iconCls: "pull-right-font", - value: 7, - }, - { - text: "HIJ-3", - iconCls: "pull-right-font", - value: 8, - }, - { - text: "IJK-3", - iconCls: "pull-right-font", - value: 9, - }, - { - text: "JKL-3", - iconCls: "pull-right-font", - value: 10, - } - ], - }, - { - type: "bi.all_value_multi_text_value_combo", - items: Demo.CONSTANTS.ITEMS, - text: "提示文本", - width: 200, - value: { - type: 1, - value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"], - }, - ref() { - searchCombo = this; - }, - listeners: [ - { - eventName: AllValueMultiTextValueCombo.EVENT_CONFIRM, - action() { - BI.Msg.toast(JSON.stringify(searchCombo.getValue())); - }, - } - ], - }, - { - type: "bi.button", - text: "setValue(3)", - width: 90, - height: 25, - handler() { - combo.setValue(11); - }, - }, - { - type: "bi.button", - text: "getValue()", - width: 90, - height: 25, - handler() { - BI.Msg.toast(JSON.stringify(searchCombo.getValue())); - }, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/case/combo/demo.text_vlaue_check_combo.js b/demo/js/case/combo/demo.text_vlaue_check_combo.js deleted file mode 100644 index 9767d23db..000000000 --- a/demo/js/case/combo/demo.text_vlaue_check_combo.js +++ /dev/null @@ -1,51 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class TextValueCheckCombo extends Widget { - static xtype = "demo.text_value_check_combo"; - - props = { baseCls: "" }; - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.text_value_check_combo", - ref () { - self.combo = this; - }, - text: "默认值", - // value: 1, - width: 300, - items: [ - { - text: "MVC-1", - value: 1, - }, - { - text: "MVC-2", - value: 2, - }, - { - text: "MVC-3", - value: 3, - } - ], - }, - { - type: "bi.button", - width: 90, - height: 25, - handler () { - BI.Msg.alert("", JSON.stringify(self.combo.getValue())); - }, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/case/index.js b/demo/js/case/index.js deleted file mode 100644 index 2f9c885e3..000000000 --- a/demo/js/case/index.js +++ /dev/null @@ -1,15 +0,0 @@ -export * from "./combo"; -export * from "./editor"; -export * from "./item"; -export * from "./list"; -export * from "./pager"; -export * from "./pane"; -export * from "./tree"; -export * from "./triggers"; - - -export * from "./demo.calendar"; -export * from "./demo.click.effect"; -export * from "./demo.color_chooser"; -export * from "./demo.color_chooser_popup"; -export * from "./demo.segment"; \ No newline at end of file diff --git a/demo/js/case/list/demo.lazy_loader.js b/demo/js/case/list/demo.lazy_loader.js deleted file mode 100644 index 066c04b9d..000000000 --- a/demo/js/case/list/demo.lazy_loader.js +++ /dev/null @@ -1,27 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.lazy_loader"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this; - BI.createWidget({ - type: "bi.lazy_loader", - element: this, - el: { - layouts: [ - { - type: "bi.left", - hgap: 5, - } - ], - }, - items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), { - type: "bi.button", - }), - }); - } -} diff --git a/demo/js/case/list/demo.select_list.js b/demo/js/case/list/demo.select_list.js deleted file mode 100644 index 5c6f67c0e..000000000 --- a/demo/js/case/list/demo.select_list.js +++ /dev/null @@ -1,28 +0,0 @@ -import { shortcut, Widget, createWidget, createItems, deepClone, Selection } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.select_list"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this; - createWidget({ - type: "bi.select_list", - toolbar: { - type: "bi.multi_select_bar", - iconWrapperWidth: 26, - }, - element: this, - el: { - el: { - chooseType: Selection.Multi, - }, - }, - items: createItems(deepClone(Demo.CONSTANTS.SIMPLE_ITEMS), { - type: "bi.multi_select_item", - }), - }); - } -} diff --git a/demo/js/case/pane/demo.list_pane.js b/demo/js/case/pane/demo.list_pane.js deleted file mode 100644 index 5ee6698be..000000000 --- a/demo/js/case/pane/demo.list_pane.js +++ /dev/null @@ -1,41 +0,0 @@ -import { shortcut, Widget, createItems, deepClone } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.list_pane"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this; - - return { - type: "bi.list_pane", - ref() { - self.pane = this; - }, - itemsCreator(op, callback) { - setTimeout(() => { - callback( - createItems(deepClone(Demo.CONSTANTS.ITEMS), { - type: "bi.multi_select_item", - height: 25, - }) - ); - }, 2000); - }, - el: { - type: "bi.button_group", - layouts: [ - { - type: "bi.vertical", - } - ], - }, - }; - } - - mounted() { - this.pane.populate(); - } -} diff --git a/demo/js/case/pane/demo.multi_popup_view.js b/demo/js/case/pane/demo.multi_popup_view.js deleted file mode 100644 index e400a96ce..000000000 --- a/demo/js/case/pane/demo.multi_popup_view.js +++ /dev/null @@ -1,46 +0,0 @@ -import { shortcut, Widget, createItems, deepClone } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.multi_popup_view"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this; - - return { - type: "bi.absolute", - items: [ - { - el: { - type: "bi.combo", - width: 200, - height: 30, - el: { - type: "bi.text_button", - text: "点击", - cls: "bi-border", - height: 30, - }, - popup: { - type: "bi.multi_popup_view", - el: { - type: "bi.button_group", - layouts: [ - { - type: "bi.vertical", - } - ], - items: createItems(deepClone(Demo.CONSTANTS.ITEMS), { - type: "bi.multi_select_item", - height: 25, - }), - }, - }, - }, - } - ], - }; - } -} diff --git a/demo/js/case/pane/demo.panel.js b/demo/js/case/pane/demo.panel.js deleted file mode 100644 index 8c5c65c9e..000000000 --- a/demo/js/case/pane/demo.panel.js +++ /dev/null @@ -1,35 +0,0 @@ -import { shortcut, Widget, createItems, deepClone } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.panel"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this; - - return { - type: "bi.panel", - title: "title", - titleButtons: [ - { - type: "bi.button", - text: "操作", - } - ], - el: { - type: "bi.button_group", - layouts: [ - { - type: "bi.vertical", - } - ], - items: createItems(deepClone(Demo.CONSTANTS.ITEMS), { - type: "bi.multi_select_item", - height: 25, - }), - }, - }; - } -} diff --git a/demo/js/case/pane/demo.popup_panel.js b/demo/js/case/pane/demo.popup_panel.js deleted file mode 100644 index 4532a4f56..000000000 --- a/demo/js/case/pane/demo.popup_panel.js +++ /dev/null @@ -1,46 +0,0 @@ -import { shortcut, Widget, createItems, deepClone } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.popup_panel"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this; - - return { - type: "bi.absolute", - items: [ - { - el: { - type: "bi.combo", - width: 200, - height: 30, - el: { - type: "bi.text_button", - text: "点击", - cls: "bi-border", - height: 30, - }, - popup: { - type: "bi.popup_panel", - el: { - type: "bi.button_group", - layouts: [ - { - type: "bi.vertical", - } - ], - items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), { - type: "bi.multi_select_item", - height: 25, - }), - }, - }, - }, - } - ], - }; - } -} diff --git a/demo/js/case/tree/demo.level_tree.js b/demo/js/case/tree/demo.level_tree.js deleted file mode 100644 index 7dd4e0efc..000000000 --- a/demo/js/case/tree/demo.level_tree.js +++ /dev/null @@ -1,111 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.level_tree"; - - props = { baseCls: "demo-func" }; - - render() { - const tree = BI.createWidget({ - type: "bi.level_tree", - chooseType: 0, - items: [ - { - id: 1, - text: "第一项", - value: 1, - isParent: true, - }, - { - id: 2, - text: "第二项", - value: 2, - isParent: true, - }, - { - id: 3, - text: "第三项", - value: 1, - isParent: true, - open: true, - }, - { - id: 4, - text: "第四项", - value: 1, - }, - { - id: 11, - pId: 1, - text: "子项1", - value: 11, - }, - { - id: 12, - pId: 1, - text: "子项2", - value: 12, - }, - { - id: 13, - pId: 1, - text: "子项3", - value: 13, - }, - { - id: 111, - pId: 11, - text: "子项1-1", - value: 111, - }, - { - id: 21, - pId: 2, - text: "子项1", - value: 21, - }, - { - id: 31, - pId: 3, - text: "子项1", - value: 31, - }, - { - id: 32, - pId: 3, - text: "子项2", - value: 32, - }, - { - id: 33, - pId: 3, - text: "子项3", - value: 33, - } - ], - }); - - BI.createWidget({ - type: "bi.vtape", - element: this, - items: [ - { - el: tree, - }, - { - height: 30, - el: { - type: "bi.button", - height: 30, - text: "getValue", - handler() { - BI.Msg.alert("", tree.getValue()); - }, - }, - } - ], - }); - } -} diff --git a/demo/js/case/tree/demo.simple_tree.js b/demo/js/case/tree/demo.simple_tree.js deleted file mode 100644 index bf82d74b4..000000000 --- a/demo/js/case/tree/demo.simple_tree.js +++ /dev/null @@ -1,147 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.simple_tree"; - - props = { baseCls: "demo-func" }; - - render() { - // value值一定要是字符串 - const tree = BI.createWidget({ - type: "bi.simple_tree", - items: [ - { - id: 1, - text: "第一项", - value: "1", - }, - { - id: 2, - text: "第二项", - value: "2", - }, - { - id: 3, - text: "第三项", - value: "3", - open: true, - }, - { - id: 11, - pId: 1, - text: "子项1", - value: "11", - }, - { - id: 12, - pId: 1, - text: "子项2", - value: "12", - }, - { - id: 13, - pId: 1, - text: "子项3", - value: "13", - }, - { - id: 31, - pId: 3, - text: "子项1", - value: "31", - }, - { - id: 32, - pId: 3, - text: "子项2", - value: "32", - }, - { - id: 33, - pId: 3, - text: "子项3", - value: "33", - } - ], - value: ["31", "32", "33"], - }); - - // tree.populate([{ - // id: 1, - // text: "第一项", - // value: "1" - // }, { - // id: 2, - // text: "第二项", - // value: "2" - // }, { - // id: 3, - // text: "第三项", - // value: "3", - // open: true - // }, { - // id: 11, - // pId: 1, - // text: "子项1", - // value: "11" - // }, { - // id: 12, - // pId: 1, - // text: "子项2", - // value: "12" - // }, { - // id: 13, - // pId: 1, - // text: "子项3", - // value: "13" - // }, { - // id: 31, - // pId: 3, - // text: "子项1", - // value: "31" - // }, { - // id: 32, - // pId: 3, - // text: "子项2", - // value: "32" - // }, { - // id: 33, - // pId: 3, - // text: "子项3", - // value: "33" - // }], "z"); - BI.createWidget({ - type: "bi.vtape", - element: this, - items: [ - { - el: tree, - }, - { - height: 30, - el: { - type: "bi.button", - height: 30, - text: "setValue(['31', '32', '33'])", - handler() { - tree.setValue(["31", "32", "33"]); - }, - }, - }, - { - height: 30, - el: { - type: "bi.button", - height: 30, - text: "getValue", - handler() { - BI.Msg.alert("", JSON.stringify(tree.getValue())); - }, - }, - } - ], - }); - } -} diff --git a/demo/js/center.js b/demo/js/center.js deleted file mode 100644 index 2b20d9907..000000000 --- a/demo/js/center.js +++ /dev/null @@ -1,16 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Center extends Widget { - static xtype = "demo.center"; - - props = { baseCls: "demo-center" }; - - render() { - const self = this; - - return { - type: "bi.router_view", - }; - } -} diff --git a/demo/js/component/demo.form.js b/demo/js/component/demo.form.js deleted file mode 100644 index 54e8cdbde..000000000 --- a/demo/js/component/demo.form.js +++ /dev/null @@ -1,111 +0,0 @@ -import { shortcut, Widget, createWidget, isEmpty, isNotEmptyArray } from "@/core"; - -@shortcut() -export class Form extends Widget { - static xtype = "demo.form"; - - props = { baseCls: "demo-form" }; - - render() { - const widget = BI.createWidget({ - type: "bi.custom_form", - width: 300, - labelWidth: 100, - items: [ - { - validate(v) { - return v !== "a" && v !== ""; - }, - tip(v) { - if (BI.isEmpty(v)) { - return "不能为空"; - } - - return "不合法格式"; - }, - label: "E-mail", - el: { - type: "bi.text_editor", - watermark: "输入a报错", - allowBlank: true, - }, - }, - { - validate(v) { - return BI.isNotEmptyArray(v); - }, - tip() { - return "不能为空"; - }, - label: "性别", - el: { - type: "bi.text_value_combo", - text: "请选择", - items: [ - { - text: "男", - value: 1, - }, - { - text: "女", - value: 2, - } - ], - }, - }, - { - validate(v) { - return v !== ""; - }, - tip() { - return "不能为空"; - }, - label: "姓名", - el: { - type: "bi.text_editor", - watermark: "输入姓名", - allowBlank: true, - }, - }, - { - validate(v) { - return v !== ""; - }, - tip() { - return "不能为空"; - }, - label: "姓名", - el: { - type: "bi.textarea_editor", - cls: "bi-border", - watermark: "输入简介", - allowBlank: true, - height: 200, - }, - } - ], - layout: { - type: "bi.vertical", - vgap: 30, - }, - }); - - return { - type: "bi.vertical", - hgap: 200, - vgap: 10, - items: [ - widget, - { - type: "bi.button", - text: "提交", - handler() { - widget.validate(); - - console.log(widget.getValue()); - }, - } - ], - }; - } -} diff --git a/demo/js/component/demo.treevaluechoosercombo.js b/demo/js/component/demo.treevaluechoosercombo.js deleted file mode 100644 index c9578d906..000000000 --- a/demo/js/component/demo.treevaluechoosercombo.js +++ /dev/null @@ -1,27 +0,0 @@ -import { shortcut, Widget, createWidget, deepClone } from "@/core"; - -@shortcut() -export class TreeValueChooser extends Widget { - static xtype = "demo.tree_value_chooser_combo"; - - props = { baseCls: "demo-tree-value-chooser-combo" }; - - render() { - const widget = createWidget({ - type: "bi.tree_value_chooser_combo", - width: 300, - // items: deepClone(Demo.CONSTANTS.TREEITEMS), - itemsCreator(op, callback) { - callback(deepClone(Demo.CONSTANTS.TREEITEMS)); - }, - defaultText: "请选择", - }); - - return { - type: "bi.vertical", - hgap: 200, - vgap: 10, - items: [widget], - }; - } -} diff --git a/demo/js/component/demo.treevaluechooserpane.js b/demo/js/component/demo.treevaluechooserpane.js deleted file mode 100644 index 5ba7025f0..000000000 --- a/demo/js/component/demo.treevaluechooserpane.js +++ /dev/null @@ -1,18 +0,0 @@ -import { shortcut, Widget, deepClone } from "@/core"; - -@shortcut() -export class TreeValueChooser extends Widget { - static xtype = "demo.tree_value_chooser_pane"; - - props = { baseCls: "demo-tree-value-chooser" }; - - render() { - return { - type: "bi.tree_value_chooser_pane", - items: deepClone(Demo.CONSTANTS.TREEITEMS), - // itemsCreator: function (op, callback) { - // callback(tree); - // } - }; - } -} diff --git a/demo/js/component/demo.valuechoosercombo.js b/demo/js/component/demo.valuechoosercombo.js deleted file mode 100644 index 82ebbcb7f..000000000 --- a/demo/js/component/demo.valuechoosercombo.js +++ /dev/null @@ -1,24 +0,0 @@ -import { shortcut, Widget, createWidget, deepClone } from "@/core"; - -@shortcut() -export class ValueChooserCombo extends Widget { - static xtype = "demo.value_chooser_combo"; - - props = { baseCls: "demo-value-chooser-combo" }; - - render() { - const widget = createWidget({ - type: "bi.value_chooser_combo", - itemsCreator (op, callback) { - callback(deepClone(Demo.CONSTANTS.ITEMS)); - }, - }); - - return { - type: "bi.vertical", - hgap: 200, - vgap: 10, - items: [widget], - }; - } -} diff --git a/demo/js/component/demo.valuechooserpane.js b/demo/js/component/demo.valuechooserpane.js deleted file mode 100644 index 656aa5c17..000000000 --- a/demo/js/component/demo.valuechooserpane.js +++ /dev/null @@ -1,18 +0,0 @@ -import { shortcut, Widget, deepClone } from "@/core"; - -@shortcut() -export class ValueChooserPane extends Widget { - static xtype = "demo.value_chooser_pane"; - - props = { baseCls: "demo-value-chooser-pane" }; - - render() { - return { - type: "bi.value_chooser_pane", - items: deepClone(Demo.CONSTANTS.ITEMS), - // itemsCreator: function (op, callback) { - // callback(deepClone(Demo.CONSTANTS.ITEMS)); - // } - }; - } -} diff --git a/demo/js/component/index.js b/demo/js/component/index.js deleted file mode 100644 index a43fa5972..000000000 --- a/demo/js/component/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./demo.form"; -export * from "./demo.treevaluechoosercombo"; -export * from "./demo.treevaluechooserpane"; -export * from "./demo.valuechoosercombo"; -export * from "./demo.valuechooserpane"; \ No newline at end of file diff --git a/demo/js/config/base.js b/demo/js/config/base.js deleted file mode 100644 index d4fa19205..000000000 --- a/demo/js/config/base.js +++ /dev/null @@ -1,89 +0,0 @@ -Demo.BASE_CONFIG = [{ - id: 2, - text: "基础控件", - open: false -}, { - pId: 2, - text: "bi.label", - value: "demo.label" -},{ - pId: 2, - text: "bi.label_scene", - value: "demo.label_scene" -}, { - pId: 2, - text: "bi.icon_label", - value: "demo.icon_label" -}, { - pId: 2, - text: "bi.html", - value: "demo.html" -}, { - pId: 2, - text: "title提示", - value: "demo.title" -}, { - pId: 2, - text: "气泡提示", - value: "demo.bubble" -}, { - pId: 2, - text: "toast提示", - value: "demo.toast" -}, { - pId: 2, - id: 201, - text: "button" -}, { - pId: 201, - text: "bi.button", - value: "demo.button" -}, { - pId: 201, - text: "bi.text_button", - value: "demo.text_button" -}, { - pId: 201, - text: "bi.icon_button", - value: "demo.icon_button" -}, { - pId: 201, - text: "bi.image_button", - value: "demo.image_button" -}, { - pId: 2, - id: 202, - text: "editor" -}, { - pId: 202, - text: "bi.editor", - value: "demo.editor" -}, { - pId: 202, - text: "bi.multifile_editor", - value: "demo.multifile_editor" -}, { - pId: 202, - text: "bi.textarea_editor", - value: "demo.textarea_editor" -}, { - pId: 2, - id: 203, - text: "tree" -}, { - pId: 203, - text: "bi.tree_view", - value: "demo.tree_view" -}, { - pId: 203, - text: "bi.async_tree", - value: "demo.sync_tree" -}, { - pId: 203, - text: "bi.part_tree", - value: "demo.part_tree" -}, { - pId: 2, - text: "bi.pager", - value: "demo.pager" -}]; \ No newline at end of file diff --git a/demo/js/config/case.js b/demo/js/config/case.js deleted file mode 100644 index 7b62db09e..000000000 --- a/demo/js/config/case.js +++ /dev/null @@ -1,185 +0,0 @@ -Demo.CASE_CONFIG = [{ - id: 3, - text: "实例控件", - open: false -}, { - pId: 3, - id: 300, - text: "按钮" -}, { - pId: 300, - text: "bi.multi_select_item", - value: "demo.multi_select_item" -}, { - pId: 300, - text: "bi.single_select_item", - value: "demo.single_select_item" -}, { - pId: 300, - text: "bi.single_select_radio_item", - value: "demo.single_select_radio_item" -}, { - pId: 3, - id: 301, - text: "editors" -}, { - pId: 301, - text: "bi.shelter_editor", - value: "demo.shelter_editor" -}, { - pId: 301, - text: "bi.sign_editor", - value: "demo.sign_editor" -}, { - pId: 301, - text: "bi.state_editor", - value: "demo.state_editor" -}, { - pId: 301, - text: "bi.simple_state_editor", - value: "demo.simple_state_editor" -}, { - pId: 301, - text: "bi.clear_editor", - value: "demo.clear_editor" -}, { - pId: 3, - id: 302, - text: "列表" -}, { - pId: 302, - text: "bi.select_list", - value: "demo.select_list" -}, { - pId: 302, - text: "bi.lazy_loader", - value: "demo.lazy_loader" -}, { - pId: 3, - id: 303, - text: "面板" -}, { - pId: 303, - text: "bi.list_pane", - value: "demo.list_pane" -}, { - pId: 303, - text: "bi.panel", - value: "demo.panel" -}, { - pId: 3, - id: 304, - text: "popup弹出层" -}, { - pId: 304, - text: "bi.multi_popup_view", - value: "demo.multi_popup_view" -}, { - pId: 304, - text: "bi.popup_panel", - value: "demo.popup_panel" -}, { - pId: 3, - id: 305, - text: "触发器trigger" -}, { - pId: 305, - text: "bi.editor_trigger", - value: "demo.editor_trigger" -}, { - pId: 305, - text: "bi.icon_trigger", - value: "demo.icon_trigger" -}, { - pId: 305, - text: "bi.text_trigger", - value: "demo.text_trigger" -}, { - pId: 305, - text: "bi.select_text_trigger", - value: "demo.select_text_trigger" -}, { - pId: 3, - id: 306, - text: "combo" -}, { - pId: 306, - text: "bi.bubble_combo", - value: "demo.bubble_combo" -}, { - pId: 306, - text: "bi.icon_combo", - value: "demo.icon_combo" -}, { - pId: 306, - text: "bi.text_value_combo", - value: "demo.text_value_combo" -}, { - pId: 306, - text: "bi.search_text_value_combo", - value: "demo.search_text_value_combo" -}, { - pId: 306, - text: "bi.icon_text_value_combo", - value: "demo.icon_text_value_combo" -}, { - pId: 306, - text: "bi.text_value_check_combo", - value: "demo.text_value_check_combo" -}, { - pId: 306, - text: "bi.editor_icon_check_combo", - value: "demo.editor_icon_check_combo" -}, { - pId: 306, - text: "bi.text_value_down_list_combo", - value: "demo.text_value_down_list_combo" -}, { - pId: 3, - id: 307, - text: "tree" -}, { - pId: 307, - text: "bi.display_tree", - value: "demo.display_tree" -}, { - pId: 307, - text: "bi.simple_tree", - value: "demo.simple_tree" -}, { - pId: 307, - text: "bi.level_tree", - value: "demo.level_tree" -}, { - pId: 3, - id: 309, - text: "pager" -}, { - pId: 309, - text: "bi.all_count_pager", - value: "demo.all_count_pager" -}, { - pId: 309, - text: "bi.direction_pager", - value: "demo.direction_pager" -}, { - pId: 3, - text: "bi.calendar", - value: "demo.calendar" -}, { - pId: 3, - text: "bi.color_chooser", - value: "demo.color_chooser" -}, { - pId: 3, - text: "bi.color_chooser_popup", - value: "demo.color_chooser_popup" -}, { - pId: 3, - text: "bi.segment", - value: "demo.segment" -}, { - pId: 3, - text: "点击项样式查看", - value: "demo.click_item_effect" -}]; \ No newline at end of file diff --git a/demo/js/config/category.js b/demo/js/config/category.js deleted file mode 100644 index 1902196ff..000000000 --- a/demo/js/config/category.js +++ /dev/null @@ -1,8 +0,0 @@ -Demo.CATEGORY_CONFIG = [{ - id: 100000, - text: "专题" -}, { - pId: 100000, - text: "可以排序的树", - value: "demo.sort_tree" -}]; \ No newline at end of file diff --git a/demo/js/config/component.js b/demo/js/config/component.js deleted file mode 100644 index e6bbb9cf0..000000000 --- a/demo/js/config/component.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Created by User on 2017/3/22. - */ -Demo.COMPONENT_CONFIG = [{ - id: 5, - text: "部件+服务" -}, { - pId: 5, - text: "bi.value_chooser_combo", - value: "demo.value_chooser_combo" -}, { - pId: 5, - text: "bi.value_chooser_pane", - value: "demo.value_chooser_pane" -}, { - pId: 5, - text: "bi.tree_value_chooser_combo", - value: "demo.tree_value_chooser_combo" -}, { - pId: 5, - text: "bi.tree_value_chooser_pane", - value: "demo.tree_value_chooser_pane" -}, { - pId: 5, - text: "demo.form", - value: "demo.form" -}]; \ No newline at end of file diff --git a/demo/js/config/core.js b/demo/js/config/core.js deleted file mode 100644 index 2c5794488..000000000 --- a/demo/js/config/core.js +++ /dev/null @@ -1,203 +0,0 @@ -Demo.CORE_CONFIG = [{ - id: 1, - text: "核心控件" -}, { - id: 101, - pId: 1, - text: "布局" -}, { - pId: 101, - text: "bi.absolute", - value: "demo.absolute" -}, { - pId: 101, - text: "bi.center_adapt", - value: "demo.center_adapt" -}, { - pId: 101, - text: "bi.vertical_adapt", - value: "demo.vertical_adapt" -}, { - pId: 101, - text: "bi.horizontal_adapt", - value: "demo.horizontal_adapt" -}, { - pId: 101, - text: "bi.horizontal_auto", - value: "demo.horizontal_auto" -}, { - pId: 101, - text: "bi.horizontal_float", - value: "demo.horizontal_float" -}, { - pId: 101, - text: "bi.left_right_vertical_adapt", - value: "demo.left_right_vertical_adapt" -}, { - pId: 101, - text: "bi.center", - value: "demo.center_layout" -}, { - pId: 101, - text: "bi.float_center", - value: "demo.float_center" -}, { - pId: 101, - text: "bi.vertical", - value: "demo.vertical" -}, { - pId: 101, - text: "bi.horizontal", - value: "demo.horizontal" -}, { - pId: 101, - text: "bi.border", - value: "demo.border" -}, { - pId: 101, - text: "bi.left, bi.right", - value: "demo.flow" -}, { - pId: 101, - text: "bi.htape", - value: "demo.htape" -}, { - pId: 101, - text: "bi.vtape", - value: "demo.vtape" -}, { - pId: 101, - text: "bi.grid", - value: "demo.grid" -}, { - pId: 101, - text: "bi.table", - value: "demo.table_layout" -}, { - pId: 101, - text: "bi.td", - value: "demo.td" -}, { - pId: 101, - text: "..." -}, { - pId: 1, - id: 102, - text: "抽象控件" -}, { - pId: 102, - text: "bi.button_group", - value: "demo.button_group" -}, { - pId: 102, - text: "bi.button_tree", - value: "demo.button_tree" -}, { - pId: 102, - text: "bi.virtual_group", - value: "demo.virtual_group" -}, { - pId: 102, - text: "bi.custom_tree", - value: "demo.custom_tree" -}, { - pId: 102, - text: "bi.grid_view", - value: "demo.grid_view" -}, { - pId: 102, - text: "bi.collection_view", - value: "demo.collection_view" -}, { - pId: 102, - text: "bi.list_view", - value: "demo.list_view" -}, { - pId: 102, - text: "bi.virtual_list", - value: "demo.virtual_list" -}, { - pId: 102, - id: 10201, - text: "组合控件" -}, { - pId: 10201, - text: "bi.combo", - value: "demo.combo" -}, { - pId: 10201, - text: "bi.combo(各种位置)", - value: "demo.combo2" -}, { - pId: 10201, - text: "bi.combo(內部位置)", - value: "demo.combo3" -}, { - pId: 10201, - text: "bi.expander", - value: "demo.expander" -}, { - pId: 10201, - text: "bi.combo_group", - value: "demo.combo_group" -}, { - pId: 10201, - text: "bi.loader", - value: "demo.loader" -}, { - pId: 10201, - text: "bi.navigation", - value: "demo.navigation" -}, { - pId: 10201, - text: "bi.searcher", - value: "demo.searcher" -}, { - pId: 10201, - text: "bi.switcher", - value: "demo.switcher" -}, { - pId: 10201, - text: "bi.tab", - value: "demo.tab" -}, { - pId: 102, - id: 10202, - text: "弹出层" -}, { - pId: 10202, - text: "layer", - value: "demo.layer" -}, { - pId: 10202, - text: "bi.popover", - value: "demo.popover" -}, { - pId: 10202, - text: "bi.popup_view", - value: "demo.popup_view" -}, { - pId: 10202, - text: "bi.searcher_view", - value: "demo.searcher_view" -}, { - pId: 1, - text: "Widget(继承)", - value: "demo.widget" -}, { - pId: 1, - text: "Single(继承)", - value: "demo.single" -}, { - pId: 1, - text: "BasicButton(继承)", - value: "demo.basic_button" -}, { - pId: 1, - text: "NodeButton(继承)", - value: "demo.node_button" -}, { - pId: 1, - text: "Pane(继承)", - value: "demo.pane" -}]; \ No newline at end of file diff --git a/demo/js/config/demo.pane.js b/demo/js/config/demo.pane.js deleted file mode 100644 index cb69e17a4..000000000 --- a/demo/js/config/demo.pane.js +++ /dev/null @@ -1,34 +0,0 @@ -import { shortcut } from "@/core"; -import { Pane as BIPane } from "@/base"; - -@shortcut() -export class Pane extends BIPane { - static xtype = "demo.pane"; - - props = {}; - - mounted() { - console.log("loading pane mounted"); - } - - render() { - return { - type: "bi.center_adapt", - items: [ - { - type: "bi.label", - text: "this is pane center", - } - ], - }; - } - - beforeRender(callback) { - const self = this; - this.loading(); - setTimeout(() => { - self.loaded(); - callback(); - }, 3000); - } -} diff --git a/demo/js/config/fix.js b/demo/js/config/fix.js deleted file mode 100644 index 6eacf396e..000000000 --- a/demo/js/config/fix.js +++ /dev/null @@ -1,54 +0,0 @@ -Demo.FIX_CONFIG = [{ - id: 7, - text: "数据流框架fix-2.0" -}, { - id: 71, - pId: 7, - text: "定义响应式数据", - value: "demo.fix_define" -}, { - id: 72, - pId: 7, - text: "state属性", - value: "demo.fix_state" -}, { - id: 73, - pId: 7, - text: "计算属性", - value: "demo.fix_computed" -}, { - id: 74, - pId: 7, - text: "store", - value: "demo.fix_store" -}, { - id: 75, - pId: 7, - text: "watcher且或表达式", - value: "demo.fix_watcher" -}, { - id: 76, - pId: 7, - text: "watcher星号表达式", - value: "demo.fix_global_watcher" -}, { - id: 77, - pId: 7, - text: "context", - value: "demo.fix_context" -}, { - id: 78, - pId: 7, - text: "一个混合的例子", - value: "demo.fix" -}, { - id: 79, - pId: 7, - text: "场景", - value: "demo.fix_scene" -}, { - id: 80, - pId: 7, - text: "inject", - value: "demo.fix_inject" -}]; diff --git a/demo/js/config/index.js b/demo/js/config/index.js deleted file mode 100644 index 21b2a224c..000000000 --- a/demo/js/config/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export * from "./base"; -export * from "./case"; -export * from "./category"; -export * from "./component"; -export * from "./core"; -export * from "./demo.pane"; -export * from "./fix"; -export * from "./widget"; \ No newline at end of file diff --git a/demo/js/config/widget.js b/demo/js/config/widget.js deleted file mode 100644 index e48282492..000000000 --- a/demo/js/config/widget.js +++ /dev/null @@ -1,205 +0,0 @@ -Demo.WIDGET_CONFIG = [{ - id: 4, - text: "详细控件", - open: true -}, { - pId: 4, - id: 401, - text: "各种小控件" -}, { - pId: 401, - text: "各种通用按钮", - value: "demo.buttons" -}, { - pId: 401, - text: "各种提示性信息", - value: "demo.tips" -}, { - pId: 401, - text: "各种items", - value: "demo.items" -}, { - pId: 401, - text: "各种节点node", - value: "demo.nodes" -}, { - pId: 401, - text: "各种segment", - value: "demo.segments" -}, { - pId: 4, - id: 402, - text: "文本框控件" -}, { - pId: 402, - text: "bi.text_editor", - value: "demo.text_editor" -}, { - pId: 402, - text: "bi.search_editor", - value: "demo.search_editor" -}, { - pId: 402, - text: "bi.number_editor", - value: "demo.number_editor" -}, { - pId: 4, - id: 403, - text: "tree" -}, { - pId: 403, - text: "bi.single_level_tree", - value: "demo.single_level_tree" -}, { - pId: 403, - text: "bi.select_level_tree", - value: "demo.select_level_tree" -}, { - pId: 403, - text: "bi.multilayer_single_level_tree", - value: "demo.multilayer_single_level_tree" -}, { - pId: 403, - text: "bi.multilayer_select_level_tree", - value: "demo.multilayer_select_level_tree" -}, { - pId: 4, - id: 405, - text: "下拉列表" -}, { - pId: 405, - text: "bi.down_list_combo", - value: "demo.down_list" -}, { - pId: 4, - id: 421, - text: "单选下拉框" -}, { - pId: 421, - text: "bi.single_select_combo", - value: "demo.single_select_combo" -}, { - pId: 4, - id: 406, - text: "复选下拉框" -}, { - pId: 406, - text: "bi.multi_select_combo", - value: "demo.multi_select_combo" -}, { - pId: 406, - text: "bi.multi_select_list", - value: "demo.multi_select_list" -}, { - pId: 4, - id: 407, - text: "简单下拉树" -}, { - pId: 407, - text: "bi.single_tree_combo", - value: "demo.single_tree_combo" -}, { - pId: 4, - id: 408, - text: "多层级下拉树" -}, { - pId: 408, - text: "bi.multilayer_single_tree_combo", - value: "demo.multilayer_single_tree_combo" -}, { - pId: 4, - id: 409, - text: "可选下拉树" -}, { - pId: 409, - text: "bi.select_tree_combo", - value: "demo.select_tree_combo" -}, { - pId: 4, - id: 410, - text: "多层级可选下拉树" -}, { - pId: 410, - text: "bi.multilayer_select_tree_combo", - value: "demo.multilayer_select_tree_combo" -}, { - pId: 4, - id: 411, - text: "复选下拉树" -}, { - pId: 411, - text: "bi.multi_tree_combo", - value: "demo.multi_tree_combo" -}, { - pId: 411, - text: "bi.multi_select_tree", - value: "demo.multi_select_tree" -}, { - pId: 4, - id: 412, - text: "日期相关控件" -}, { - pId: 412, - text: "bi.year_combo", - value: "demo.year" -}, { - pId: 412, - text: "bi.year_month_combo", - value: "demo.year_month_combo" -}, { - pId: 412, - text: "bi.year_quarter_combo", - value: "demo.year_quarter_combo" -}, { - pId: 412, - text: "bi.date_pane", - value: "demo.date_pane" -}, { - pId: 412, - text: "bi.multidate_combo", - value: "demo.multidate_combo" -}, { - pId: 412, - text: "bi.date_time", - value: "demo.date_time" -}, { - pId: 412, - text: "bi.time_combo", - value: "demo.time_combo" -}, { - pId: 412, - text: "bi.time_interval", - value: "demo.time_interval" -}, { - pId: 412, - text: "bi.year_month_interval", - value: "demo.year_month_interval" -}, { - pId: 412, - text: "bi.year_quarter_interval", - value: "demo.year_quarter_interval" -}, { - pId: 412, - text: "bi.year_interval", - value: "demo.year_interval" -}, { - pId: 4, - id: 413, - text: "数值区间控件" -}, { - pId: 413, - text: "bi.number_interval", - value: "demo.number_interval" -}, { - id: 420, - text: "数值滑块sliders", - value: "demo.slider" -}, { - pId: 4, - id: 414, - text: "折叠面板" -}, { - pId: 414, - text: "bi.collapse", - value: "demo.collapse" -}]; diff --git a/demo/js/core/abstract/combination/demo.combo.js b/demo/js/core/abstract/combination/demo.combo.js deleted file mode 100644 index 76027d078..000000000 --- a/demo/js/core/abstract/combination/demo.combo.js +++ /dev/null @@ -1,450 +0,0 @@ -import { shortcut, Widget, createWidget, createItems, deepClone, map, delay, random, makeArray } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.combo"; - - props = { baseCls: "demo-func" }; - years = [ - { text: "2010年", value: 2010, iconCls: "close-ha-font" }, - { text: "2011年", value: 2011 }, - { text: "2012年", value: 2012, iconCls: "close-ha-font" }, - { text: "2013年", value: 2013 }, - { text: "2014年", value: 2014, iconCls: "close-ha-font" }, - { text: "2015年", value: 2015, iconCls: "close-ha-font" }, - { text: "2016年", value: 2016, iconCls: "close-ha-font" }, - { text: "2017年", value: 2017, iconCls: "close-ha-font" } - ]; - child = [ - { - type: "bi.combo_group", - el: { - type: "bi.icon_text_icon_item", - text: "2010年", - value: 2010, - height: 25, - iconCls1: "close-ha-font", - iconCls2: "close-ha-font", - }, - items: [ - { type: "bi.single_select_item", height: 25, text: "一月", value: 11 }, - { - type: "bi.icon_text_icon_item", - height: 25, - text: "二月", - value: 12, - iconCls1: "close-ha-font", - iconCls2: "close-ha-font", - children: [{ type: "bi.single_select_item", text: "一号", value: 101, height: 25 }], - } - ], - }, - { text: "2011年", value: 2011 }, - { text: "2012年", value: 2012, iconCls: "close-ha-font" }, - { text: "2013年", value: 2013 }, - { text: "2014年", value: 2014, iconCls: "close-ha-font" }, - { text: "2015年", value: 2015, iconCls: "close-ha-font" } - ]; - months = [ - [{ el: { text: "一月", value: 1 } }, { el: { text: "二月", value: 2 } }], - [{ el: { text: "三月", value: 3 } }, { el: { text: "四月", value: 4 } }], - [{ el: { text: "五月", value: 5 } }, { el: { text: "六月", value: 6 } }], - [{ el: { text: "七月", value: 7 } }, { el: { text: "八月", value: 8 } }], - [{ el: { text: "九月", value: 9 } }, { el: { text: "十月", value: 10 } }], - [{ el: { text: "十一月", value: 11 } }, { el: { text: "十二月", value: 12 } }] - ]; - dynamic = [ - { text: "2010年", value: 1 }, - { text: "20112222年", value: 2 }, - { text: "201233333年", value: 3 }, - { text: "2013年", value: 4 }, - { text: "2012324年", value: 5 }, - { text: "2015年", value: 6 }, - { text: "2016年", value: 7 }, - { text: "201744444444444444444444444444444444444年", value: 8 } - ]; - week = [ - { text: "周一", value: 100, iconClsLeft: "close-ha-font", iconClsRight: "close-font" }, - { text: "周二", value: 101, iconClsLeft: "close-ha-font" }, - { text: "周三", value: 102 }, - { text: "周四", value: 103, iconClsRight: "close-ha-font" }, - { text: "周五", value: 104, iconClsLeft: "close-ha-font", iconClsRight: "close-font" }, - { text: "周六", value: 105, iconClsLeft: "close-font", iconClsRight: "close-ha-font" }, - { text: "周日", value: 106, iconClsLeft: "close-font" } - ]; - - _createTop() { - const self = this; - - const yearCombo = createWidget({ - type: "bi.combo", - el: { - type: "bi.button", - text: "简单下拉框", - height: 30, - }, - popup: { - el: { - type: "bi.button_group", - items: createItems(deepClone(this.years), { - type: "bi.single_select_radio_item", - height: 25, - handler(v) {}, - }), - layouts: [ - { - type: "bi.vertical", - } - ], - }, - }, - width: 200, - }); - - var multiCombo = createWidget({ - type: "bi.combo", - el: { - type: "bi.button", - text: "多选下拉框", - height: 30, - }, - popup: { - el: { - items: createItems(deepClone(this.years), { - type: "bi.multi_select_item", - height: 25, - handler(v) {}, - }), - chooseType: 1, - layouts: [ - { - type: "bi.vertical", - } - ], - }, - tool: { - type: "bi.label", - text: "这是一个下拉框", - height: 35, - }, - tabs: [ - { - type: "bi.multi_select_bar", - height: 25, - text: "全选", - onCheck(v) { - if (v) { - multiCombo.setValue(map(deepClone(self.years), "value")); - } else { - multiCombo.setValue([]); - } - }, - isAllCheckedBySelectedValue(selectedValue) { - return selectedValue.length == self.years.length; - // return true; - }, - } - ], - buttons: [ - { - type: "bi.text_button", - text: "清空", - handler() { - multiCombo.setValue([]); - }, - }, - { - type: "bi.text_button", - text: "确定", - handler() { - Msg.alert("", multiCombo.getValue()); - }, - } - ], - }, - width: 200, - }); - - const dynamicPopupCombo = createWidget({ - type: "bi.combo", - isNeedAdjustWidth: false, - offsetStyle: "center", - el: { - type: "bi.button", - text: "动态调整宽度", - height: 30, - }, - popup: { - el: { - items: createItems(deepClone(this.dynamic), { - type: "bi.single_select_item", - height: 25, - }), - layouts: [ - { - type: "bi.vertical", - } - ], - }, - }, - width: 200, - }); - - var dynamicCombo = createWidget({ - type: "bi.combo", - el: { - type: "bi.button", - text: "搜索", - height: 30, - }, - popup: { - el: { - type: "bi.loader", - logic: { - dynamic: true, - scrolly: true, - }, - el: { - behaviors: { - redmark() { - return true; - }, - }, - layouts: [ - { - type: "bi.vertical", - } - ], - }, - itemsCreator(options, popuplate) { - const times = options.times; - delay(() => { - if (times == 3) { - popuplate([ - { - type: "bi.single_select_item", - text: "这是最后一个", - value: "这是最后一个", - py: "zszhyg", - height: 25, - } - ]); - - return; - } - - const map = map(makeArray(3, null), (i, v) => { - const val = `${i}_${random(1, 100)}`; - - return { - type: "bi.single_select_item", - text: val, - value: val, - height: 25, - }; - }); - popuplate(map); - }, 1000); - }, - hasNext(options) { - return options.times < 3; - }, - }, - buttons: [ - { - type: "bi.text_button", - text: "清空", - handler() { - dynamicCombo.setValue([]); - }, - }, - { - type: "bi.text_button", - text: "确定", - handler() { - Msg.alert("", dynamicCombo.getValue()); - }, - } - ], - }, - width: 200, - }); - - return createWidget({ - type: "bi.left", - items: [yearCombo, multiCombo, dynamicPopupCombo, dynamicCombo], - hgap: 20, - vgap: 20, - }); - } - - _createBottom() { - const combo = createWidget({ - type: "bi.combo", - el: { - type: "bi.text_button", - cls: "button-combo", - height: 30, - }, - popup: { - el: { - type: "bi.button_group", - items: createItems(deepClone(this.years), { - type: "bi.single_select_item", - iconWidth: 25, - height: 25, - handler(v) {}, - }), - chooseType: 1, - layouts: [ - { - type: "bi.vertical", - } - ], - }, - }, - width: 200, - }); - combo.setValue(deepClone(this.years)[0].value); - - const childCombo = createWidget({ - type: "bi.combo", - el: { - type: "bi.text_button", - cls: "button-combo", - height: 30, - }, - popup: { - el: { - type: "bi.button_tree", - items: createItems(deepClone(this.child), { - type: "bi.single_select_item", - height: 25, - handler(v) {}, - }), - layouts: [ - { - type: "bi.vertical", - } - ], - }, - }, - width: 200, - }); - childCombo.setValue(deepClone(this.child)[0].items[0].value); - - const monthCombo = createWidget({ - type: "bi.combo", - el: { - type: "bi.button", - text: "多层样式下拉框", - height: 30, - }, - popup: { - el: { - items: createItems(deepClone(this.months), { - type: "bi.single_select_item", - cls: "button-combo", - handler(v) {}, - }), - layouts: [ - { - type: "bi.adaptive", - items: [ - { - el: { - type: "bi.table", - columns: 2, - rows: 6, - columnSize: [0.5, "fill"], - rowSize: 30, - }, - left: 4, - right: 4, - top: 2, - bottom: 2, - } - ], - }, - { - type: "bi.absolute", - el: { left: 4, top: 2, right: 4, bottom: 2 }, - } - ], - }, - }, - width: 200, - }); - - const yearCombo = createWidget({ - type: "bi.combo", - el: { - type: "bi.button", - text: "自定义控件", - height: 30, - }, - popup: { - el: { - type: "bi.navigation", - direction: "bottom", - logic: { - dynamic: true, - }, - tab: { - height: 30, - items: [ - { - once: false, - text: "后退", - value: -1, - cls: "mvc-button layout-bg3", - }, - { - once: false, - text: "前进", - value: 1, - cls: "mvc-button layout-bg4", - } - ], - }, - cardCreator(v) { - return createWidget({ - type: "bi.text_button", - whiteSpace: "normal", - text: new Date().getFullYear() + v, - }); - }, - }, - }, - width: 200, - }); - - return createWidget({ - type: "bi.left", - items: [combo, childCombo, monthCombo, yearCombo], - hgap: 20, - vgap: 20, - }); - } - - render() { - return { - type: "bi.grid", - columns: 1, - rows: 2, - items: [ - { - column: 0, - row: 0, - el: this._createTop(), - }, - { - column: 0, - row: 1, - el: this._createBottom(), - } - ], - }; - } -} diff --git a/demo/js/core/abstract/combination/demo.combo2.js b/demo/js/core/abstract/combination/demo.combo2.js deleted file mode 100644 index a587a1a03..000000000 --- a/demo/js/core/abstract/combination/demo.combo2.js +++ /dev/null @@ -1,167 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.combo2"; - - props = { baseCls: "demo-func" }; - - _createEl() { - return { - type: "bi.button", - height: 25, - text: "点击", - }; - } - - oneCombo() { - return createWidget({ - type: "bi.combo", - adjustLength: 5, - el: this._createEl(), - popup: { - el: { - type: "bi.layout", - height: 500, - }, - maxHeight: 400, - }, - }); - } - - twoCombo() { - return createWidget({ - type: "bi.combo", - adjustXOffset: 25, - adjustYOffset: 5, - direction: "bottom,left", - el: this._createEl(), - popup: { - el: { - type: "bi.layout", - height: 1200, - }, - }, - }); - } - - threeCombo() { - return createWidget({ - type: "bi.combo", - adjustYOffset: 5, - el: this._createEl(), - isNeedAdjustHeight: false, - popup: { - el: { - type: "bi.layout", - height: 1200, - }, - }, - }); - } - - fourCombo() { - return createWidget({ - type: "bi.combo", - adjustXOffset: 25, - adjustYOffset: 5, - direction: "left", - el: this._createEl(), - isNeedAdjustHeight: true, - popup: { - el: { - type: "bi.layout", - height: 1200, - }, - }, - }); - } - - fiveCombo() { - return createWidget({ - type: "bi.combo", - adjustXOffset: 25, - adjustYOffset: 5, - direction: "left,top", - el: this._createEl(), - isNeedAdjustHeight: true, - popup: { - el: { - type: "bi.layout", - height: 1200, - }, - maxHeight: 2000, - }, - }); - } - - sixCombo() { - return createWidget({ - type: "bi.combo", - adjustXOffset: 25, - adjustYOffset: 5, - direction: "top,left", - el: this._createEl(), - isNeedAdjustHeight: true, - popup: { - el: { - type: "bi.layout", - height: 1200, - }, - }, - }); - } - - sevenCombo() { - return createWidget({ - type: "bi.combo", - adjustXOffset: 25, - adjustYOffset: 5, - direction: "bottom", - isNeedAdjustWidth: false, - // isNeedAdjustHeight: false, - offsetStyle: "center", - el: this._createEl(), - popup: { - el: { - type: "bi.layout", - width: 200, - height: 1200, - }, - }, - }); - } - - eightCombo() { - return createWidget({ - type: "bi.combo", - adjustXOffset: 25, - adjustYOffset: 5, - direction: "right", - isNeedAdjustWidth: false, - // isNeedAdjustHeight: false, - offsetStyle: "middle", - el: this._createEl(), - popup: { - el: { - type: "bi.layout", - width: 200, - height: 200, - }, - }, - }); - } - - render() { - return { - type: "bi.grid", - hgap: 10, - vgap: 5, - items: [ - [this.oneCombo(), this.twoCombo(), this.threeCombo()], - [this.fourCombo(), this.fiveCombo(), this.sixCombo()], - [this.sevenCombo(), this.eightCombo()] - ], - }; - } -} diff --git a/demo/js/core/abstract/combination/demo.combo3.js b/demo/js/core/abstract/combination/demo.combo3.js deleted file mode 100644 index 94f7b5005..000000000 --- a/demo/js/core/abstract/combination/demo.combo3.js +++ /dev/null @@ -1,77 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.combo3"; - - props = { baseCls: "demo-func" }; - - _createEl() { - return { - type: "bi.label", - cls: "bi-border", - height: "100%", - text: "点击", - }; - } - - oneCombo() { - return createWidget({ - type: "bi.combo", - direction: "right,innerRight", - isNeedAdjustWidth: false, - isNeedAdjustHeight: false, - el: this._createEl(), - popup: { - el: { - type: "bi.layout", - width: 200, - height: 200, - }, - }, - }); - } - - twoCombo() { - return createWidget({ - type: "bi.combo", - direction: "right,innerRight", - isNeedAdjustWidth: false, - isNeedAdjustHeight: false, - el: this._createEl(), - popup: { - el: { - type: "bi.layout", - width: 1000, - height: 200, - }, - }, - }); - } - - threeCombo() { - return createWidget({ - type: "bi.combo", - direction: "right,innerRight", - isNeedAdjustWidth: false, - isNeedAdjustHeight: false, - el: this._createEl(), - popup: { - el: { - type: "bi.layout", - width: 400, - height: 200, - }, - }, - }); - } - - render() { - return { - type: "bi.grid", - hgap: 10, - vgap: 5, - items: [[this.oneCombo()], [this.twoCombo()], [this.threeCombo()]], - }; - } -} diff --git a/demo/js/core/abstract/combination/demo.combo_group.js b/demo/js/core/abstract/combination/demo.combo_group.js deleted file mode 100644 index 8f643e2b8..000000000 --- a/demo/js/core/abstract/combination/demo.combo_group.js +++ /dev/null @@ -1,81 +0,0 @@ -import { shortcut, Widget, createWidget, createItems, deepClone } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.combo_group"; - - props = { baseCls: "demo-func" }; - child = [ - { - type: "bi.combo_group", - el: { type: "bi.icon_text_icon_item", text: "2010年", value: 2010, height: 25, iconCls: "close-ha-font" }, - items: [ - { type: "bi.single_select_item", height: 25, text: "一月", value: 11 }, - { - type: "bi.icon_text_icon_item", - height: 25, - text: "二月", - value: 12, - iconCls1: "close-ha-font", - iconCls2: "close-ha-font", - children: [{ type: "bi.single_select_item", text: "一号", value: 101, height: 25 }], - } - ], - }, - { text: "2011年", value: 2011 }, - { text: "2012年", value: 2012, iconCls: "close-ha-font" }, - { text: "2013年", value: 2013 }, - { text: "2014年", value: 2014, iconCls: "close-ha-font" }, - { text: "2015年", value: 2015, iconCls: "close-ha-font" } - ]; - - _createBottom() { - const childCombo = createWidget({ - type: "bi.combo", - el: { - type: "bi.text_button", - cls: "button-combo", - height: 30, - }, - popup: { - el: { - type: "bi.button_tree", - items: createItems(deepClone(this.child), { - type: "bi.single_select_item", - height: 25, - handler(v) {}, - }), - layouts: [ - { - type: "bi.vertical", - } - ], - }, - }, - width: 200, - }); - childCombo.setValue(deepClone(this.child)[0].items[0].value); - - return createWidget({ - type: "bi.left", - items: [childCombo], - hgap: 20, - vgap: 20, - }); - } - - render() { - return { - type: "bi.grid", - columns: 1, - rows: 1, - items: [ - { - column: 0, - row: 0, - el: this._createBottom(), - } - ], - }; - } -} diff --git a/demo/js/core/abstract/combination/demo.expander.js b/demo/js/core/abstract/combination/demo.expander.js deleted file mode 100644 index 36576013f..000000000 --- a/demo/js/core/abstract/combination/demo.expander.js +++ /dev/null @@ -1,54 +0,0 @@ -import { shortcut, Widget, createItems } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.expander"; - - props = { baseCls: "demo-func" }; - - render() { - return { - type: "bi.vertical", - hgap: 30, - vgap: 20, - items: [ - { - type: "bi.expander", - el: { - type: "bi.icon_text_node", - cls: "pull-right-ha-font mvc-border", - height: 25, - text: "Expander", - }, - popup: { - cls: "mvc-border", - items: createItems( - [ - { - text: "项目1", - value: 1, - }, - { - text: "项目2", - value: 2, - }, - { - text: "项目3", - value: 3, - }, - { - text: "项目4", - value: 4, - } - ], - { - type: "bi.single_select_item", - height: 25, - } - ), - }, - } - ], - }; - } -} diff --git a/demo/js/core/abstract/combination/demo.loader.js b/demo/js/core/abstract/combination/demo.loader.js deleted file mode 100644 index b7689101e..000000000 --- a/demo/js/core/abstract/combination/demo.loader.js +++ /dev/null @@ -1,33 +0,0 @@ -import { shortcut, Widget, deepClone, map, extend } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.loader"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this; - this.all = 0; - const items = deepClone(Demo.CONSTANTS.ITEMS); - - return { - type: "bi.loader", - itemsCreator(options, populate) { - setTimeout(() => { - populate( - map(items.slice((options.times - 1) * 10, options.times * 10), (i, v) => - extend(v, { - type: "bi.single_select_item", - height: 25, - }) - ) - ); - }, 1000); - }, - hasNext(options) { - return options.times * 10 < items.length; - }, - }; - } -} diff --git a/demo/js/core/abstract/combination/demo.navigation.js b/demo/js/core/abstract/combination/demo.navigation.js deleted file mode 100644 index 5fa90ef31..000000000 --- a/demo/js/core/abstract/combination/demo.navigation.js +++ /dev/null @@ -1,41 +0,0 @@ -import { shortcut, Widget, createWidget, random, bind } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.navigation"; - - props = { baseCls: "demo-func" }; - - _createNav(v) { - return createWidget({ - type: "bi.label", - cls: `layout-bg${random(1, 8)}`, - text: `第${v}页`, - }); - } - - render() { - return { - type: "bi.navigation", - showIndex: 0, - tab: { - height: 30, - items: [ - { - once: false, - text: "后退", - value: -1, - cls: "mvc-button layout-bg3", - }, - { - once: false, - text: "前进", - value: 1, - cls: "mvc-button layout-bg4", - } - ], - }, - cardCreator: bind(this._createNav, this), - }; - } -} diff --git a/demo/js/core/abstract/combination/demo.sercher.js b/demo/js/core/abstract/combination/demo.sercher.js deleted file mode 100644 index c556c3985..000000000 --- a/demo/js/core/abstract/combination/demo.sercher.js +++ /dev/null @@ -1,125 +0,0 @@ -import { shortcut, Widget, createItems, createWidget } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.searcher"; - - props = { baseCls: "demo-func" }; - - _createItems(items) { - return createItems(items, { - type: "bi.multi_select_item", - height: 25, - handler(v) {}, - }); - } - - render() { - const self = this; - const items = [ - { - text: "2010年", - value: 2010, - py: "2010n", - title: "1111111111111111111111111111111111", - }, - { - text: "2011年", - value: 2011, - py: "2011n", - title: "1111111111111111111111111111111111", - }, - { - text: "2012年", - value: 2012, - py: "2012n", - title: "1111111111111111111111111111111111", - }, - { - text: "2013年", - value: 2013, - py: "2013n", - title: "1111111111111111111111111111111111", - }, - { - text: "2014年", - value: 2014, - py: "2014n", - title: "1111111111111111111111111111111111", - }, - { - text: "2015年", - value: 2015, - py: "2015n", - title: "1111111111111111111111111111111111", - }, - { - text: "2016年", - value: 2016, - py: "2016n", - title: "1111111111111111111111111111111111", - }, - { - text: "2017年", - value: 2017, - py: "2017n", - title: "1111111111111111111111111111111111", - } - ]; - - const adapter = createWidget({ - type: "bi.button_group", - cls: "layout-bg1", - items: this._createItems(items), - chooseType: 1, - behaviors: {}, - layouts: [ - { - type: "bi.vertical", - } - ], - }); - createWidget({ - type: "bi.absolute", - element: this, - items: [ - { - el: adapter, - top: 50, - left: 50, - width: 200, - height: 100, - } - ], - }); - createWidget({ - type: "bi.absolute", - element: this, - items: [ - { - el: { - type: "bi.absolute", - width: 200, - height: 30, - items: [ - { - el: { - type: "bi.searcher", - adapter, - width: 200, - height: 30, - }, - left: 0, - right: 0, - top: 0, - bottom: 0, - } - ], - }, - top: 100, - left: 300, - } - ], - }); - } -} diff --git a/demo/js/core/abstract/combination/demo.switcher.js b/demo/js/core/abstract/combination/demo.switcher.js deleted file mode 100644 index ea4b2890b..000000000 --- a/demo/js/core/abstract/combination/demo.switcher.js +++ /dev/null @@ -1,73 +0,0 @@ -import { shortcut, Widget, createWidget, createItems } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.switcher"; - - props = { baseCls: "demo-func" }; - - render() { - const adapter = createWidget({ - type: "bi.label", - cls: "layout-bg2", - text: "将在该处弹出switcher", - }); - createWidget({ - type: "bi.absolute", - element: this, - items: [ - { - el: adapter, - top: 50, - left: 20, - width: 200, - height: 300, - } - ], - }); - createWidget({ - type: "bi.vertical", - element: this, - hgap: 30, - vgap: 20, - items: [ - { - type: "bi.switcher", - el: { - type: "bi.button", - height: 25, - text: "Switcher", - }, - popup: { - cls: "mvc-border layout-bg5", - items: createItems( - [ - { - text: "项目1", - value: 1, - }, - { - text: "项目2", - value: 2, - }, - { - text: "项目3", - value: 3, - }, - { - text: "项目4", - value: 4, - } - ], - { - type: "bi.single_select_item", - height: 25, - } - ), - }, - adapter, - } - ], - }); - } -} diff --git a/demo/js/core/abstract/combination/demo.tab.js b/demo/js/core/abstract/combination/demo.tab.js deleted file mode 100644 index 76365ab33..000000000 --- a/demo/js/core/abstract/combination/demo.tab.js +++ /dev/null @@ -1,80 +0,0 @@ -import { shortcut, Widget, createWidget, bind } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.tab"; - - props = { baseCls: "demo-func" }; - - _createTabs(v) { - switch (v) { - case 1: - return createWidget({ - type: "bi.label", - cls: "layout-bg1", - text: "面板1", - }); - case 2: - return createWidget({ - type: "bi.label", - cls: "layout-bg2", - text: "面板2", - }); - } - } - - render() { - this.tab = createWidget({ - type: "bi.button_group", - height: 30, - items: [ - { - text: "Tab1", - value: 1, - width: 50, - cls: "mvc-button layout-bg3", - }, - { - text: "Tab2", - value: 2, - width: 50, - cls: "mvc-button layout-bg4", - } - ], - layouts: [ - { - type: "bi.center_adapt", - items: [ - { - el: { - type: "bi.horizontal", - width: 100, - }, - } - ], - } - ], - }); - - const tab = createWidget({ - direction: "custom", - type: "bi.tab", - element: this, - tab: this.tab, - cardCreator: bind(this._createTabs, this), - }); - createWidget({ - type: "bi.absolute", - element: this, - items: [ - { - el: this.tab, - left: 200, - top: 200, - } - ], - }); - - tab.setSelect(2); - } -} diff --git a/demo/js/core/abstract/demo.button_group.js b/demo/js/core/abstract/demo.button_group.js deleted file mode 100644 index b59b1eafa..000000000 --- a/demo/js/core/abstract/demo.button_group.js +++ /dev/null @@ -1,80 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { ButtonGroup } from "@/base"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.button_group"; - - props = { baseCls: "demo-func" }; - - render() { - let ref; - - return { - type: "bi.vertical", - items: [ - { - type: "bi.button_group", - ref(_ref) { - ref = _ref; - }, - chooseType: ButtonGroup.CHOOSE_TYPE_NONE, - layouts: [ - { - type: "bi.vertical", - items: [ - { - type: "bi.vtape", - height: 200, - } - ], - } - ], - items: [ - { - el: { - type: "bi.label", - text: "button_group是一类具有相同属性或相似属性的抽象, 本案例实现的是布局的嵌套(vertical布局下内嵌center_adapt布局)", - }, - height: 150, - }, - { - el: { - type: "bi.button", - text: "1", - }, - } - ], - }, - { - type: "bi.button", - text: "populate", - handler() { - ref.populate([ - { - el: { - type: "bi.label", - text: "1", - }, - height: 50, - }, - { - el: { - type: "bi.button", - text: "2", - }, - height: 50, - }, - { - el: { - type: "bi.label", - text: "3", - }, - } - ]); - }, - } - ], - }; - } -} diff --git a/demo/js/core/abstract/demo.button_tree.js b/demo/js/core/abstract/demo.button_tree.js deleted file mode 100644 index f6d2b9b96..000000000 --- a/demo/js/core/abstract/demo.button_tree.js +++ /dev/null @@ -1,36 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { ButtonGroup } from "@/base"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.button_tree"; - - props = { baseCls: "demo-func" }; - - render() { - return { - type: "bi.button_tree", - chooseType: ButtonGroup.CHOOSE_TYPE_MULTI, - layouts: [ - { - type: "bi.vertical", - }, - { - type: "bi.center_adapt", - } - ], - items: [ - { - type: "bi.label", - text: "0", - value: 0, - }, - { - type: "bi.button", - text: "1", - value: 1, - } - ], - }; - } -} diff --git a/demo/js/core/abstract/demo.collection_view.js b/demo/js/core/abstract/demo.collection_view.js deleted file mode 100644 index d3dacb08c..000000000 --- a/demo/js/core/abstract/demo.collection_view.js +++ /dev/null @@ -1,46 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.collection_view"; - - props = { baseCls: "demo-func" }; - - render() { - const items = []; - const cellCount = 100; - for (let i = 0; i < cellCount; i++) { - items[i] = { - type: "bi.label", - text: i, - }; - } - const grid = createWidget({ - type: "bi.collection_view", - width: 400, - height: 300, - items, - cellSizeAndPositionGetter(index) { - return { - x: (index % 10) * 50, - y: Math.floor(index / 10) * 50, - width: 50, - height: 50, - }; - }, - }); - createWidget({ - type: "bi.absolute", - element: this, - items: [ - { - el: grid, - left: 10, - right: 10, - top: 10, - bottom: 10, - } - ], - }); - } -} diff --git a/demo/js/core/abstract/demo.custom_tree.js b/demo/js/core/abstract/demo.custom_tree.js deleted file mode 100644 index 64cb37330..000000000 --- a/demo/js/core/abstract/demo.custom_tree.js +++ /dev/null @@ -1,282 +0,0 @@ -import { shortcut, Widget, createWidget, deepClone } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.custom_tree"; - - props = { baseCls: "demo-func" }; - - _createDefaultTree() { - const TREEITEMS = [ - { id: -1, pId: -2, value: "根目录", open: true, type: "bi.plus_group_node", height: 25 }, - { id: 1, pId: -1, value: "第一级目录1", type: "bi.plus_group_node", height: 25 }, - { id: 11, pId: 1, value: "第二级文件1", type: "bi.single_select_item", height: 25 }, - { id: 12, pId: 1, value: "第二级目录2", type: "bi.plus_group_node", height: 25 }, - { id: 121, pId: 12, value: "第三级目录1", type: "bi.plus_group_node", height: 25 }, - { id: 122, pId: 12, value: "第三级文件1", type: "bi.single_select_item", height: 25 }, - { id: 1211, pId: 121, value: "第四级目录1", type: "bi.plus_group_node", height: 25 }, - { id: 12111, pId: 1211, value: "第五级文件1", type: "bi.single_select_item", height: 25 }, - { id: 2, pId: -1, value: "第一级目录2", type: "bi.plus_group_node", height: 25 }, - { id: 21, pId: 2, value: "第二级目录3", type: "bi.plus_group_node", height: 25 }, - { id: 22, pId: 2, value: "第二级文件2", type: "bi.single_select_item", height: 25 }, - { id: 211, pId: 21, value: "第三级目录2", type: "bi.plus_group_node", height: 25 }, - { id: 212, pId: 21, value: "第三级文件2", type: "bi.single_select_item", height: 25 }, - { id: 2111, pId: 211, value: "第四级文件1", type: "bi.single_select_item", height: 25 } - ]; - this.tree = createWidget({ - type: "bi.custom_tree", - el: { - type: "bi.button_tree", - chooseType: 0, - layouts: [ - { - type: "bi.vertical", - hgap: 30, - } - ], - }, - items: deepClone(TREEITEMS), - }); - - return this.tree; - } - - _createAsyncTree() { - this.asyncTree = createWidget({ - type: "bi.custom_tree", - itemsCreator(op, callback) { - if (!op.node) { - // 根节点 - callback([ - { - id: 1, - pId: 0, - type: "bi.plus_group_node", - text: "test1", - value: 1, - height: 25, - isParent: true, - }, - { - id: 2, - pId: 0, - type: "bi.plus_group_node", - text: "test2", - value: 1, - isParent: true, - open: true, - height: 25, - } - ]); - } else { - if (op.node.id == 1) { - callback([ - { - id: 11, - pId: 1, - type: "bi.plus_group_node", - text: "test11", - value: 11, - height: 25, - isParent: true, - }, - { - id: 12, - pId: 1, - type: "bi.single_select_item", - text: "test12", - value: 12, - height: 35, - }, - { - id: 13, - pId: 1, - type: "bi.single_select_item", - text: "test13", - value: 13, - height: 35, - }, - { - id: 14, - pId: 1, - type: "bi.single_select_item", - text: "test14", - value: 14, - height: 35, - }, - { - id: 15, - pId: 1, - type: "bi.single_select_item", - text: "test15", - value: 15, - height: 35, - }, - { - id: 16, - pId: 1, - type: "bi.single_select_item", - text: "test16", - value: 16, - height: 35, - }, - { id: 17, pId: 1, type: "bi.single_select_item", text: "test17", value: 17, height: 35 } - ]); - } else if (op.node.id == 2) { - callback([ - { - id: 21, - pId: 2, - type: "bi.single_select_item", - text: "test21", - value: 21, - height: 35, - }, - { - id: 22, - pId: 2, - type: "bi.single_select_item", - text: "test22", - value: 22, - height: 35, - } - ]); - } else if (op.node.id == 11) { - callback([ - { - id: 111, - pId: 11, - type: "bi.single_select_item", - text: "test111", - value: 111, - height: 35, - } - ]); - } - } - }, - el: { - type: "bi.loader", - next: false, - el: { - type: "bi.button_tree", - chooseType: 0, - layouts: [ - { - type: "bi.vertical", - hgap: 30, - vgap: 0, - } - ], - }, - }, - }); - - return this.asyncTree; - } - - render() { - const self = this; - createWidget({ - type: "bi.grid", - columns: 2, - rows: 1, - element: this, - items: [ - { - column: 0, - row: 0, - el: { - type: "bi.vtape", - items: [ - { - el: this._createDefaultTree(), - }, - { - el: { - type: "bi.center", - hgap: 10, - items: [ - { - type: "bi.text_button", - cls: "mvc-button layout-bg2", - text: "getValue", - height: 30, - handler() { - Msg.alert("", JSON.stringify(self.tree.getValue())); - }, - }, - { - type: "bi.text_button", - cls: "mvc-button layout-bg2", - text: "getNodeByValue(第一级目录1)", - height: 30, - handler() { - Msg.alert( - "", - `节点名称为: ${self.tree.getNodeByValue("第一级目录1").getValue()}` - ); - }, - } - ], - }, - height: 30, - } - ], - }, - }, - { - column: 1, - row: 0, - el: { - type: "bi.vtape", - items: [ - { - type: "bi.label", - text: "异步加载数据", - height: 30, - }, - { - el: this._createAsyncTree(), - }, - { - el: { - type: "bi.center", - hgap: 10, - items: [ - { - type: "bi.text_button", - cls: "mvc-button layout-bg2", - text: "getValue", - height: 30, - handler() { - Msg.alert("", JSON.stringify(self.asyncTree.getValue())); - }, - }, - { - type: "bi.text_button", - cls: "mvc-button layout-bg2", - text: "getNodeById(11)", - height: 30, - handler() { - Msg.alert( - "", - `节点名称为: ${ - self.asyncTree.getNodeById(11) && - self.asyncTree.getNodeById(11).getText() - }` - ); - }, - } - ], - }, - height: 30, - } - ], - }, - } - ], - }); - } -} diff --git a/demo/js/core/abstract/demo.grid_view.js b/demo/js/core/abstract/demo.grid_view.js deleted file mode 100644 index 7aa6c28f8..000000000 --- a/demo/js/core/abstract/demo.grid_view.js +++ /dev/null @@ -1,62 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.grid_view"; - - props = { baseCls: "demo-func" }; - - render() { - const items = []; - const rowCount = 10000, - columnCount = 100; - for (let i = 0; i < rowCount; i++) { - items[i] = []; - for (let j = 0; j < columnCount; j++) { - items[i][j] = { - type: "bi.label", - text: `${i}-${j}`, - }; - } - } - const grid = createWidget({ - type: "bi.grid_view", - width: 400, - height: 300, - estimatedRowSize: 30, - estimatedColumnSize: 100, - items, - scrollTop: 100, - rowHeightGetter() { - return 30; - }, - columnWidthGetter() { - return 100; - }, - }); - createWidget({ - type: "bi.absolute", - element: this, - items: [ - { - el: { - type: "bi.grid", - columns: 1, - rows: 1, - items: [ - { - column: 0, - row: 0, - el: grid, - } - ], - }, - left: 10, - right: 10, - top: 10, - bottom: 10, - } - ], - }); - } -} diff --git a/demo/js/core/abstract/demo.list_view.js b/demo/js/core/abstract/demo.list_view.js deleted file mode 100644 index 049fb6988..000000000 --- a/demo/js/core/abstract/demo.list_view.js +++ /dev/null @@ -1,25 +0,0 @@ -import { shortcut, Widget, map, extend } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.list_view"; - - props = { baseCls: "demo-func" }; - - render() { - return { - type: "bi.list_view", - el: { - type: "bi.left", - }, - items: map(Demo.CONSTANTS.ITEMS, (i, item) => - extend({}, item, { - type: "bi.label", - width: 200, - height: 200, - text: `${i + 1}.${item.text}`, - }) - ), - }; - } -} diff --git a/demo/js/core/abstract/demo.virtual_group.js b/demo/js/core/abstract/demo.virtual_group.js deleted file mode 100644 index 44d0fd6fb..000000000 --- a/demo/js/core/abstract/demo.virtual_group.js +++ /dev/null @@ -1,86 +0,0 @@ -import { shortcut, Widget, map, range, deepClone } from "@/core"; -import { ButtonGroup } from "@/base"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.virtual_group"; - - props = { baseCls: "demo-func" }; - - _createItems() { - const items = map(range(1000), i => { - return { - type: "demo.virtual_group_item", - value: i, - key: i + 1, - }; - }); - - return items; - } - - render() { - const self = this; - const buttonGroupItems = self._createItems(); - const virtualGroupItems = self._createItems(); - - return { - type: "bi.vertical", - vgap: 20, - items: [ - { - type: "bi.label", - cls: "layout-bg5", - height: 50, - text: "共1000个元素,演示button_group和virtual_group每次删除第一个元素,打开控制台看输出", - }, - { - type: "bi.button_group", - width: 500, - height: 300, - ref() { - self.buttonGroup = this; - }, - chooseType: ButtonGroup.CHOOSE_TYPE_MULTI, - layouts: [ - { - type: "bi.vertical", - } - ], - items: this._createItems(), - }, - { - type: "bi.button", - text: "演示button_group的刷新", - handler() { - buttonGroupItems.shift(); - self.buttonGroup.populate(deepClone(buttonGroupItems)); - }, - }, - { - type: "bi.virtual_group", - width: 500, - height: 300, - ref() { - self.virtualGroup = this; - }, - chooseType: ButtonGroup.CHOOSE_TYPE_MULTI, - layouts: [ - { - type: "bi.vertical", - } - ], - items: this._createItems(), - }, - { - type: "bi.button", - text: "演示virtual_group的刷新", - handler() { - virtualGroupItems.shift(); - self.virtualGroup.populate(deepClone(virtualGroupItems)); - }, - } - ], - }; - } -} diff --git a/demo/js/core/abstract/demo.virtual_group_item.js b/demo/js/core/abstract/demo.virtual_group_item.js deleted file mode 100644 index 8cefbd4fa..000000000 --- a/demo/js/core/abstract/demo.virtual_group_item.js +++ /dev/null @@ -1,43 +0,0 @@ -import { shortcut, Widget, UUID } from "@/core"; - -@shortcut() -export class Item extends Widget { - static xtype = "demo.virtual_group_item"; - - props = { baseCls: "demo-item", height: 30 }; - - render() { - const self = this, - o = this.options; - - return { - type: "bi.label", - ref () { - self.label = this; - }, - height: this.options.height, - text: `key:${o.key},随机数${UUID()}`, - }; - } - - shouldUpdate(nextProps) { - const o = this.options; - - return o.type !== nextProps.type || o.key !== nextProps.key || o.value !== nextProps.value; - } - - update(item) { - this.label.setText(item.value); - console.log("更新了一项"); - - return true; // 返回是不是更新成功 - } - - created() { - console.log("创建了一项"); - } - - destroyed() { - console.log("删除了一项"); - } -} diff --git a/demo/js/core/abstract/demo.virtual_list.js b/demo/js/core/abstract/demo.virtual_list.js deleted file mode 100644 index c358d7941..000000000 --- a/demo/js/core/abstract/demo.virtual_list.js +++ /dev/null @@ -1,21 +0,0 @@ -import { shortcut, Widget, map, extend } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.virtual_list"; - - props = { baseCls: "demo-func" }; - - render() { - return { - type: "bi.virtual_list", - items: map(Demo.CONSTANTS.ITEMS, (i, item) => - extend({}, item, { - type: "bi.label", - height: 30, - text: `${i + 1}.${item.text}` - }) - ) - }; - } -} diff --git a/demo/js/core/abstract/index.js b/demo/js/core/abstract/index.js deleted file mode 100644 index 6e3b38c8e..000000000 --- a/demo/js/core/abstract/index.js +++ /dev/null @@ -1,11 +0,0 @@ -export * from "./combination"; - -export * from "./demo.button_group"; -export * from "./demo.button_tree"; -export * from "./demo.collection_view"; -export * from "./demo.custom_tree"; -export * from "./demo.grid_view"; -export * from "./demo.list_view"; -export * from "./demo.virtual_group"; -export * from "./demo.virtual_group_item"; -export * from "./demo.virtual_list"; \ No newline at end of file diff --git a/demo/js/core/index.js b/demo/js/core/index.js deleted file mode 100644 index a927fd18b..000000000 --- a/demo/js/core/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./abstract"; -export * from "./layout"; -export * from "./popup"; \ No newline at end of file diff --git a/demo/js/core/layout/demo.absolute.js b/demo/js/core/layout/demo.absolute.js deleted file mode 100644 index 7a0dd1ea9..000000000 --- a/demo/js/core/layout/demo.absolute.js +++ /dev/null @@ -1,27 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class AbsoluteLayout extends Widget { - static xtype = "demo.absolute"; - - props = { baseCls: "demo-absolute" }; - - render() { - return { - type: "bi.absolute", - items: [ - { - el: { - type: "bi.label", - text: "绝对布局", - cls: "layout-bg1", - width: 300, - height: 200, - }, - left: 100, - top: 100, - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.border.js b/demo/js/core/layout/demo.border.js deleted file mode 100644 index aa69a8851..000000000 --- a/demo/js/core/layout/demo.border.js +++ /dev/null @@ -1,102 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; - -@shortcut() -export class BorderLayout extends Widget { - static xtype = "demo.border"; - - props = { baseCls: "demo-border" }; - - _createNorth() { - return createWidget({ - type: "bi.label", - text: "North", - cls: "layout-bg1", - height: 30, - }); - } - - _createWest() { - return createWidget({ - type: "bi.center", - cls: "layout-bg2", - items: [ - { - type: "bi.label", - text: "West", - whiteSpace: "normal", - } - ], - }); - } - - _createCenter() { - return createWidget({ - type: "bi.center", - cls: "layout-bg3", - items: [ - { - type: "bi.label", - text: "Center", - whiteSpace: "normal", - } - ], - }); - } - - _createEast() { - return createWidget({ - type: "bi.center", - cls: "layout-bg5", - items: [ - { - type: "bi.label", - text: "East", - whiteSpace: "normal", - } - ], - }); - } - - _createSouth() { - return createWidget({ - type: "bi.label", - text: "South", - cls: "layout-bg6", - height: 50, - }); - } - - render() { - return { - type: "bi.border", - cls: "", - items: { - north: { - el: this._createNorth(), - height: 30, - top: 20, - left: 20, - right: 20, - }, - south: { - el: this._createSouth(), - height: 50, - bottom: 20, - left: 20, - right: 20, - }, - west: { - el: this._createWest(), - width: 200, - left: 20, - }, - east: { - el: this._createEast(), - width: 300, - right: 20, - }, - center: this._createCenter(), - }, - }; - } -} diff --git a/demo/js/core/layout/demo.center.js b/demo/js/core/layout/demo.center.js deleted file mode 100644 index 214afd000..000000000 --- a/demo/js/core/layout/demo.center.js +++ /dev/null @@ -1,40 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class CenterLayout extends Widget { - static xtype = "demo.center_layout"; - - props = { baseCls: "demo-center" }; - - render() { - return { - type: "bi.center", - items: [ - { - type: "bi.label", - text: "其实是一个grid嵌套absolute的实现", - cls: "layout-bg1", - whiteSpace: "normal", - }, - { - type: "bi.label", - text: "Center 2,为了演示label是占满整个的,用了一个whiteSpace:normal", - cls: "layout-bg2", - whiteSpace: "normal", - }, - { - type: "bi.label", - text: "Center 3", - cls: "layout-bg3", - }, - { - type: "bi.label", - text: "Center 4", - cls: "layout-bg5", - } - ], - hgap: 20, - vgap: 20, - }; - } -} diff --git a/demo/js/core/layout/demo.center_adapt.js b/demo/js/core/layout/demo.center_adapt.js deleted file mode 100644 index b1703a984..000000000 --- a/demo/js/core/layout/demo.center_adapt.js +++ /dev/null @@ -1,23 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class CenterAdapt extends Widget { - static xtype = "demo.center_adapt"; - - props = { baseCls: "demo-absolute" }; - - render() { - return { - type: "bi.center_adapt", - items: [ - { - type: "bi.label", - text: "水平垂直居中", - width: 300, - height: 200, - cls: "layout-bg1", - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.float_center.js b/demo/js/core/layout/demo.float_center.js deleted file mode 100644 index 24bf679ac..000000000 --- a/demo/js/core/layout/demo.float_center.js +++ /dev/null @@ -1,30 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class FloatCenterLayout extends Widget { - static xtype = "demo.float_center"; - - props = { baseCls: "demo-float-center" }; - - render() { - return { - type: "bi.float_center", - items: [ - { - type: "bi.label", - text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度", - cls: "layout-bg1", - whiteSpace: "normal", - }, - { - type: "bi.label", - text: "浮动式的中间布局", - cls: "layout-bg2", - whiteSpace: "normal", - } - ], - hgap: 20, - vgap: 20, - }; - } -} diff --git a/demo/js/core/layout/demo.flow.js b/demo/js/core/layout/demo.flow.js deleted file mode 100644 index 9398fc900..000000000 --- a/demo/js/core/layout/demo.flow.js +++ /dev/null @@ -1,89 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class FlowLayout extends Widget { - static xtype = "demo.flow"; - - props = { baseCls: "demo-flow" }; - - render() { - return { - type: "bi.center_adapt", - items: [ - { - type: "bi.left", - items: [ - { - type: "bi.label", - height: 30, - text: "Left-1", - cls: "layout-bg1", - }, - { - type: "bi.label", - height: 30, - text: "Left-2", - cls: "layout-bg2", - }, - { - type: "bi.label", - height: 30, - text: "Left-3", - cls: "layout-bg3", - }, - { - type: "bi.label", - height: 30, - text: "Left-4", - cls: "layout-bg4", - }, - { - type: "bi.label", - height: 30, - text: "Left-5", - cls: "layout-bg5", - } - ], - hgap: 20, - }, - { - type: "bi.right", - hgap: 20, - items: [ - { - type: "bi.label", - height: 30, - text: "Right-1", - cls: "layout-bg1", - }, - { - type: "bi.label", - height: 30, - text: "Right-2", - cls: "layout-bg2", - }, - { - type: "bi.label", - height: 30, - text: "Right-3", - cls: "layout-bg3", - }, - { - type: "bi.label", - height: 30, - text: "Right-4", - cls: "layout-bg4", - }, - { - type: "bi.label", - height: 30, - text: "Right-5", - cls: "layout-bg5", - } - ], - vgap: 20, - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.grid.js b/demo/js/core/layout/demo.grid.js deleted file mode 100644 index 70531458a..000000000 --- a/demo/js/core/layout/demo.grid.js +++ /dev/null @@ -1,153 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class GridLayout extends Widget { - static xtype = "demo.grid"; - - props = { baseCls: "demo-grid" }; - - render() { - return { - type: "bi.grid", - columns: 5, - rows: 3, - items: [ - { - column: 0, - row: 0, - el: { - type: "bi.label", - text: "column-0, row-0", - cls: "layout-bg1", - }, - }, - { - column: 1, - row: 0, - el: { - type: "bi.label", - text: "column-1, row-0", - cls: "layout-bg2", - }, - }, - { - column: 2, - row: 0, - el: { - type: "bi.label", - text: "column-2, row-0", - cls: "layout-bg6", - }, - }, - { - column: 3, - row: 0, - el: { - type: "bi.label", - text: "column-3, row-0", - cls: "layout-bg3", - }, - }, - { - column: 4, - row: 0, - el: { - type: "bi.label", - text: "column-4, row-0", - cls: "layout-bg4", - }, - }, - { - column: 0, - row: 1, - el: { - type: "bi.label", - text: "column-0, row-1", - cls: "layout-bg5", - }, - }, - { - column: 1, - row: 1, - el: { - type: "bi.label", - text: "column-1, row-1", - cls: "layout-bg6", - }, - }, - { - column: 2, - row: 1, - el: { - type: "bi.label", - text: "column-2, row-1", - cls: "layout-bg7", - }, - }, - { - column: 3, - row: 1, - el: { - type: "bi.label", - text: "column-3, row-1", - cls: "layout-bg1", - }, - }, - { - column: 4, - row: 1, - el: { - type: "bi.label", - text: "column-4, row-1", - cls: "layout-bg3", - }, - }, - { - column: 0, - row: 2, - el: { - type: "bi.label", - text: "column-0, row-2", - cls: "layout-bg2", - }, - }, - { - column: 1, - row: 2, - el: { - type: "bi.label", - text: "column-1, row-2", - cls: "layout-bg3", - }, - }, - { - column: 2, - row: 2, - el: { - type: "bi.label", - text: "column-2, row-2", - cls: "layout-bg4", - }, - }, - { - column: 3, - row: 2, - el: { - type: "bi.label", - text: "column-3, row-2", - cls: "layout-bg5", - }, - }, - { - column: 4, - row: 2, - el: { - type: "bi.label", - text: "column-4, row-2", - cls: "layout-bg6", - }, - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.horizontal.js b/demo/js/core/layout/demo.horizontal.js deleted file mode 100644 index 831310a44..000000000 --- a/demo/js/core/layout/demo.horizontal.js +++ /dev/null @@ -1,153 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { VerticalAlign, HorizontalAlign } from "@/core"; - -@shortcut() -export class Horizontal extends Widget { - static xtype = "demo.horizontal"; - - props = { baseCls: "demo-horizontal" }; - - render() { - return { - type: "bi.vertical", - vgap: 10, - items: [ - { - type: "bi.horizontal", - height: 150, - hgap: 10, - items: [ - { - type: "bi.label", - whiteSpace: "normal", - text: "因为大多数场景下都需要垂直居中,所以这个布局一般会被vertical_adapt布局设置scrollx=true取代", - cls: "layout-bg3", - width: 500, - height: 50, - }, - { - type: "bi.label", - text: "水平布局", - cls: "layout-bg4", - width: 300, - height: 30, - }, - { - type: "bi.label", - text: "水平布局", - cls: "layout-bg5", - width: 300, - height: 30, - }, - { - type: "bi.label", - text: "水平布局", - cls: "layout-bg6", - width: 300, - height: 30, - } - ], - }, - { - type: "bi.layout", - height: 1, - cls: "bi-border-bottom bi-high-light-border", - }, - { - type: "bi.horizontal", - height: 150, - verticalAlign: BI.VerticalAlign.Middle, - horizontalAlign: BI.HorizontalAlign.Left, - vgap: 10, - items: [ - { - type: "bi.label", - text: "以horizontal实现的vertical_adapt垂直居中", - cls: "layout-bg1", - width: 300, - height: 30, - }, - { - type: "bi.label", - text: "以horizontal实现的vertical_adapt垂直居中", - cls: "layout-bg2", - width: 300, - height: 30, - } - ], - }, - { - type: "bi.layout", - height: 1, - cls: "bi-border-bottom bi-high-light-border", - }, - { - type: "bi.horizontal", - height: 150, - verticalAlign: BI.VerticalAlign.Top, - horizontalAlign: BI.HorizontalAlign.Center, - items: [ - { - type: "bi.label", - text: "以horizontal代替horizontal_adapt实现的水平居中(单元素)", - cls: "layout-bg1", - width: 300, - height: 30, - } - ], - }, - { - type: "bi.layout", - height: 1, - cls: "bi-border-bottom bi-high-light-border", - }, - { - type: "bi.horizontal", - height: 150, - verticalAlign: BI.VerticalAlign.Top, - horizontalAlign: BI.HorizontalAlign.Center, - columnSize: [300, "fill"], - items: [ - { - type: "bi.label", - text: "以horizontal代替horizontal_adapt实现的用于水平适应布局", - cls: "layout-bg1", - height: 30, - }, - { - type: "bi.label", - text: "以horizontal代替horizontal_adapt实现的水平自适应列", - cls: "layout-bg2", - height: 30, - } - ], - }, - { - type: "bi.layout", - height: 1, - cls: "bi-border-bottom bi-high-light-border", - }, - { - type: "bi.center_adapt", - height: 150, - verticalAlign: BI.VerticalAlign.Middle, - horizontalAlign: BI.HorizontalAlign.Center, - items: [ - { - type: "bi.label", - text: "以horizontal代替center_adapt实现的水平垂直居中", - width: 300, - height: 100, - cls: "layout-bg1", - } - ], - }, - { - type: "bi.layout", - height: 1, - cls: "bi-border-bottom bi-high-light-border", - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.horizontal_adapt.js b/demo/js/core/layout/demo.horizontal_adapt.js deleted file mode 100644 index 07318fe65..000000000 --- a/demo/js/core/layout/demo.horizontal_adapt.js +++ /dev/null @@ -1,64 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; - -@shortcut() -export class HorizontalAdapt extends Widget { - static xtype = "demo.horizontal_adapt"; - - props = { baseCls: "demo-horizontal-adapt" }; - - _createLayout() { - return createWidget({ - type: "bi.horizontal_adapt", - items: [ - { - type: "bi.label", - text: "例子1:可用做水平居中", - cls: "layout-bg1", - width: 300, - height: 30, - } - ], - }); - } - - _createAdaptLayout() { - return createWidget({ - type: "bi.horizontal_adapt", - columnSize: [300, "fill"], - items: [ - { - type: "bi.label", - text: "例子2:用于水平适应布局", - cls: "layout-bg1", - height: 30, - }, - { - type: "bi.label", - text: "水平自适应列", - cls: "layout-bg2", - height: 30, - } - ], - }); - } - - render() { - return { - type: "bi.grid", - columns: 1, - rows: 2, - items: [ - { - column: 0, - row: 0, - el: this._createLayout(), - }, - { - column: 0, - row: 1, - el: this._createAdaptLayout(), - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.horizontal_auto.js b/demo/js/core/layout/demo.horizontal_auto.js deleted file mode 100644 index 0adc9d715..000000000 --- a/demo/js/core/layout/demo.horizontal_auto.js +++ /dev/null @@ -1,45 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; - -@shortcut() -export class HorizontalAuto extends Widget { - static xtype = "demo.horizontal_auto"; - - props = { baseCls: "demo-horizontal-auto" }; - - _createLayout() { - return createWidget({ - type: "bi.horizontal_auto", - items: [ - { - type: "bi.label", - text: "水平居中", - cls: "layout-bg1", - width: 300, - height: 30, - }, - { - type: "bi.label", - text: "水平居中优先使用该布局", - cls: "layout-bg2", - width: 300, - height: 30, - } - ], - }); - } - - render() { - return { - type: "bi.grid", - columns: 1, - rows: 2, - items: [ - { - column: 0, - row: 0, - el: this._createLayout(), - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.horizontal_float.js b/demo/js/core/layout/demo.horizontal_float.js deleted file mode 100644 index bb9cd8a67..000000000 --- a/demo/js/core/layout/demo.horizontal_float.js +++ /dev/null @@ -1,22 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class HorizontalFloat extends Widget { - static xtype = "demo.horizontal_float"; - - props = { baseCls: "demo-horizontal-float" }; - - render() { - return { - type: "bi.horizontal_float", - items: [ - { - type: "bi.label", - text: "浮动式水平居中布局方案,用于宽度未知的情况", - cls: "layout-bg1", - height: 30, - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.htape.js b/demo/js/core/layout/demo.htape.js deleted file mode 100644 index bcd7a092d..000000000 --- a/demo/js/core/layout/demo.htape.js +++ /dev/null @@ -1,40 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class HtapeLayout extends Widget { - static xtype = "demo.htape"; - - props = { baseCls: "demo-htape" }; - - render() { - return { - type: "bi.htape", - items: [ - { - width: 100, - el: { - type: "bi.label", - text: "1", - cls: "bi-background", - }, - }, - { - width: 200, - el: { - type: "bi.label", - text: "2", - cls: "layout-bg2", - }, - }, - { - width: "fill", - el: { - type: "bi.label", - text: "3", - cls: "layout-bg3", - }, - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.left_right_vertical_adapt.js b/demo/js/core/layout/demo.left_right_vertical_adapt.js deleted file mode 100644 index 7cf1ed74d..000000000 --- a/demo/js/core/layout/demo.left_right_vertical_adapt.js +++ /dev/null @@ -1,50 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class LeftRightVerticalAdaptLayout extends Widget { - static xtype = "demo.left_right_vertical_adapt"; - - props = { baseCls: "demo-left-right-vertical-adapt" }; - - render() { - return { - type: "bi.left_right_vertical_adapt", - lhgap: 10, - rhgap: 30, - items: { - left: [ - { - type: "bi.label", - text: "左边的垂直居中", - cls: "layout-bg1", - width: 100, - height: 30, - }, - { - type: "bi.label", - text: "左边的垂直居中", - cls: "layout-bg2", - width: 100, - height: 30, - } - ], - right: [ - { - type: "bi.label", - text: "右边的垂直居中", - cls: "layout-bg1", - width: 100, - height: 30, - }, - { - type: "bi.label", - text: "右边的垂直居中", - cls: "layout-bg2", - width: 100, - height: 30, - } - ], - }, - }; - } -} diff --git a/demo/js/core/layout/demo.table.js b/demo/js/core/layout/demo.table.js deleted file mode 100644 index 9cbdc666c..000000000 --- a/demo/js/core/layout/demo.table.js +++ /dev/null @@ -1,164 +0,0 @@ -import { shortcut, Widget, createItems } from "@/core"; - -@shortcut() -export class TableLayout extends Widget { - static xtype = "demo.table_layout"; - - props = { baseCls: "demo-table-layout" }; - - _createTable1() { - return { - type: "bi.table", - items: createItems( - [ - [ - { - el: { - cls: "layout-bg1", - }, - }, - { - el: { - cls: "layout-bg2", - }, - }, - { - el: { - cls: "layout-bg3", - }, - } - ], - [ - { - el: { - cls: "layout-bg4", - }, - }, - { - el: { - cls: "layout-bg5", - }, - }, - { - el: { - cls: "layout-bg6", - }, - } - ], - [ - { - el: { - cls: "layout-bg7", - }, - }, - { - el: { - cls: "layout-bg8", - }, - }, - { - el: { - cls: "layout-bg1", - }, - } - ], - [ - { - el: { - cls: "layout-bg2", - }, - }, - { - el: { - cls: "layout-bg3", - }, - }, - { - el: { - cls: "layout-bg4", - }, - } - ], - [ - { - el: { - cls: "layout-bg5", - }, - }, - { - el: { - cls: "layout-bg6", - }, - }, - { - el: { - cls: "layout-bg7", - }, - } - ], - [ - { - el: { - cls: "layout-bg8", - }, - }, - { - el: { - cls: "layout-bg1", - }, - }, - { - el: { - cls: "layout-bg2", - }, - } - ], - [ - { - el: { - cls: "layout-bg6", - }, - }, - { - el: { - cls: "layout-bg7", - }, - }, - { - el: { - cls: "layout-bg8", - }, - } - ] - ], - { - type: "bi.layout", - } - ), - columnSize: [100, "fill", 200], - rowSize: [10, 30, 50, 70, 90, 110, 130], - hgap: 20, - vgap: 10, - }; - } - - render() { - return { - type: "bi.grid", - columns: 1, - rows: 1, - items: [ - { - column: 0, - row: 0, - el: this._createTable1(), - } - // , { - // column: 0, - // row: 1, - // el: this._createTable2() - // } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.td.js b/demo/js/core/layout/demo.td.js deleted file mode 100644 index 704c55380..000000000 --- a/demo/js/core/layout/demo.td.js +++ /dev/null @@ -1,73 +0,0 @@ -import { shortcut, Widget, createItems } from "@/core"; - -@shortcut() -export class TdLayout extends Widget { - static xtype = "demo.td"; - - props = { baseCls: "demo-td" }; - - render() { - return { - type: "bi.vertical", - items: [ - { - type: "bi.td", - columnSize: [100, 100, ""], - items: createItems( - [ - [ - { - el: { - type: "bi.label", - text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", - cls: "layout-bg1", - }, - }, - { - el: { - type: "bi.label", - text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", - cls: "layout-bg2", - }, - }, - { - el: { - type: "bi.label", - text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", - cls: "layout-bg3", - }, - } - ], - [ - { - el: { - type: "bi.label", - text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", - cls: "layout-bg5", - }, - }, - { - el: { - type: "bi.label", - text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", - cls: "layout-bg6", - }, - }, - { - el: { - type: "bi.label", - text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", - cls: "layout-bg7", - }, - } - ] - ], - { - whiteSpace: "normal", - } - ), - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.vertical.js b/demo/js/core/layout/demo.vertical.js deleted file mode 100644 index 5f2e299f1..000000000 --- a/demo/js/core/layout/demo.vertical.js +++ /dev/null @@ -1,29 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class VerticalLayout extends Widget { - static xtype = "demo.vertical"; - - props = { baseCls: "demo-vertical" }; - - render() { - return { - type: "bi.vertical", - vgap: 10, - items: [ - { - type: "bi.label", - cls: "layout-bg3", - text: "垂直布局", - height: 30, - }, - { - type: "bi.label", - cls: "layout-bg4", - text: "垂直布局", - height: 30, - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.vertical_adapt.js b/demo/js/core/layout/demo.vertical_adapt.js deleted file mode 100644 index be3a23d84..000000000 --- a/demo/js/core/layout/demo.vertical_adapt.js +++ /dev/null @@ -1,46 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; - -@shortcut() -export class VerticalAdaptLayout extends Widget { - static xtype = "demo.vertical_adapt"; - - props = { baseCls: "demo-vertical-adapt" }; - - _createLayout() { - return createWidget({ - type: "bi.vertical_adapt", - vgap: 10, - items: [ - { - type: "bi.label", - text: "垂直居中", - cls: "layout-bg1", - width: 300, - height: 30, - }, - { - type: "bi.label", - text: "垂直居中", - cls: "layout-bg2", - width: 300, - height: 30, - } - ], - }); - } - - render() { - return { - type: "bi.grid", - columns: 2, - rows: 1, - items: [ - { - column: 0, - row: 0, - el: this._createLayout(), - } - ], - }; - } -} diff --git a/demo/js/core/layout/demo.vtape.js b/demo/js/core/layout/demo.vtape.js deleted file mode 100644 index c8f221451..000000000 --- a/demo/js/core/layout/demo.vtape.js +++ /dev/null @@ -1,43 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class VtapeLayout extends Widget { - static xtype = "demo.vtape"; - - props = { baseCls: "demo-vtape" }; - - render() { - return { - type: "bi.vtape", - vgap: 10, - items: [ - { - height: 100, - el: { - type: "bi.label", - text: "1", - cls: "layout-bg1", - }, - tgap: 10, - vgap: 10, - }, - { - height: 200, - el: { - type: "bi.label", - text: "2", - cls: "layout-bg2", - }, - }, - { - height: "fill", - el: { - type: "bi.label", - text: "3", - cls: "layout-bg3", - }, - } - ], - }; - } -} diff --git a/demo/js/core/layout/index.js b/demo/js/core/layout/index.js deleted file mode 100644 index 14277ed22..000000000 --- a/demo/js/core/layout/index.js +++ /dev/null @@ -1,18 +0,0 @@ -export * from "./demo.absolute"; -export * from "./demo.border"; -export * from "./demo.center"; -export * from "./demo.center_adapt"; -export * from "./demo.float_center"; -export * from "./demo.flow"; -export * from "./demo.grid"; -export * from "./demo.horizontal"; -export * from "./demo.horizontal_adapt"; -export * from "./demo.horizontal_auto"; -export * from "./demo.horizontal_float"; -export * from "./demo.htape"; -export * from "./demo.left_right_vertical_adapt"; -export * from "./demo.table"; -export * from "./demo.td"; -export * from "./demo.vertical"; -export * from "./demo.vertical_adapt"; -export * from "./demo.vtape"; \ No newline at end of file diff --git a/demo/js/core/popup/demo.layer.js b/demo/js/core/popup/demo.layer.js deleted file mode 100644 index 767219d52..000000000 --- a/demo/js/core/popup/demo.layer.js +++ /dev/null @@ -1,78 +0,0 @@ -import { shortcut, Widget, UUID } from "@/core"; -import { Layers } from "@/base"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.layer"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this, - id1 = UUID(), - id2 = UUID(); - - return { - type: "bi.vertical", - vgap: 10, - items: [ - { - type: "bi.button", - text: "create形式创建layer, 遮住当前面板, 返回创建的面板对象", - height: 30, - handler() { - Layers.create(id1, self, { - // 偏移量 - offset: { - left: 10, - right: 10, - top: 10, - bottom: 10, - }, - type: "bi.center_adapt", - cls: "bi-card", - items: [ - { - type: "bi.button", - text: "点击关闭", - handler() { - Layers.hide(id1); - }, - } - ], - }); - Layers.show(id1); - }, - }, - { - type: "bi.button", - text: "make形式创建layer,可以指定放到哪个面板内,这里指定当前面板(默认放在body下撑满), 返回创建的面板对象", - height: 30, - handler() { - Layers.make(id2, self, { - // 偏移量 - offset: { - left: 10, - right: 10, - top: 10, - bottom: 10, - }, - type: "bi.center_adapt", - cls: "bi-card", - items: [ - { - type: "bi.button", - text: "点击关闭", - handler() { - Layers.remove(id2); - }, - } - ], - }); - Layers.show(id2); - }, - } - ], - }; - } -} diff --git a/demo/js/core/popup/demo.popover.js b/demo/js/core/popup/demo.popover.js deleted file mode 100644 index a5ae5ecac..000000000 --- a/demo/js/core/popup/demo.popover.js +++ /dev/null @@ -1,219 +0,0 @@ -import { shortcut, Widget, UUID, map, range } from "@/core"; -import { Popovers } from "@/base"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.popover"; - - props = { baseCls: "demo-func" }; - - render() { - const id = UUID(); - let body; - - return { - type: "bi.vertical", - vgap: 10, - items: [ - { - type: "bi.text_button", - text: "点击弹出Popover(normal size & fixed)", - height: 30, - handler() { - Popovers.remove(id); - Popovers.create(id, { - type: "bi.bar_popover", - size: "normal", - header: { - type: "bi.label", - text: "这个是header", - }, - body: { - type: "bi.label", - text: "这个是body", - }, - }).open(id); - }, - }, - { - type: "bi.text_button", - text: "点击弹出Popover(small size & fixed)", - height: 30, - handler() { - Popovers.remove(id); - Popovers.create(id, { - type: "bi.bar_popover", - size: "small", - header: { - type: "bi.label", - text: "这个是header", - }, - body: { - type: "bi.label", - text: "这个是body", - }, - }).open(id); - }, - }, - { - type: "bi.text_button", - text: "点击弹出Popover(big size & fixed)", - height: 30, - handler() { - Popovers.remove(id); - Popovers.create(id, { - type: "bi.bar_popover", - size: "big", - header: { - type: "bi.label", - text: "这个是header", - }, - body: { - type: "bi.label", - text: "这个是body", - }, - }).open(id); - }, - }, - { - type: "bi.text_button", - text: "点击弹出Popover(normal size & adapt body区域高度是300)", - height: 30, - handler() { - Popovers.remove(id); - Popovers.create(id, { - type: "bi.bar_popover", - size: "normal", - logic: { - dynamic: true, - }, - header: { - type: "bi.label", - text: "这个是header", - }, - body: { - type: "bi.vertical", - items: [ - { - type: "bi.button_group", - ref() { - body = this; - }, - items: map(range(0, 10), () => { - return { - type: "bi.label", - text: "1", - height: 30, - }; - }), - layouts: [ - { - type: "bi.vertical", - } - ], - } - ], - }, - }).open(id); - }, - }, - { - type: "bi.text_button", - text: "点击弹出Popover(small size & adapt body区域高度是900)", - height: 30, - handler() { - Popovers.remove(id); - Popovers.create(id, { - type: "bi.bar_popover", - size: "small", - logic: { - dynamic: true, - }, - header: { - type: "bi.label", - text: "这个是header", - }, - body: { - type: "bi.vertical", - items: [ - { - type: "bi.button_group", - ref() { - body = this; - }, - items: map(range(0, 30), () => { - return { - type: "bi.label", - text: "1", - height: 30, - }; - }), - layouts: [ - { - type: "bi.vertical", - } - ], - } - ], - }, - }).open(id); - }, - }, - { - type: "bi.text_button", - text: "点击弹出Popover(custom)", - height: 30, - handler() { - Popovers.remove(id); - Popovers.create(id, { - width: 400, - height: 300, - header: { - type: "bi.label", - text: "这个是header", - }, - body: { - type: "bi.label", - text: "这个是body", - }, - footer: { - type: "bi.label", - text: "这个是footer", - }, - }).open(id); - }, - }, - { - type: "bi.text_button", - height: 30, - text: "弹出一个高度动态的popover层, 此弹出层指定size为small, 但是高度随内容自适应,自适应支持的最大高度为默认为600px", - handler() { - const id = "弹出层id1"; - Popovers.create(id, { - // String或者是json都行 - header: "弹出层标题", - logic: { - dynamic: true, - maxHeight: 700, - }, - size: "small", - body: { - type: "bi.vertical", - items: map(range(0, 50), (idx, v) => { - return { - type: "bi.label", - text: "弹出层内容", - }; - }), - }, - footer: { - type: "bi.label", - text: "这个是footer", - }, - }).open(id); - }, - } - ], - }; - } -} diff --git a/demo/js/core/popup/demo.popup_view.js b/demo/js/core/popup/demo.popup_view.js deleted file mode 100644 index 3dd0d35b7..000000000 --- a/demo/js/core/popup/demo.popup_view.js +++ /dev/null @@ -1,46 +0,0 @@ -import { shortcut, Widget, createItems, deepClone } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.popup_view"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this; - - return { - type: "bi.absolute", - items: [ - { - el: { - type: "bi.combo", - width: 200, - height: 30, - el: { - type: "bi.text_button", - text: "点击", - cls: "bi-border", - height: 30, - }, - popup: { - type: "bi.popup_view", - el: { - type: "bi.button_group", - layouts: [ - { - type: "bi.vertical", - } - ], - items: createItems(deepClone(Demo.CONSTANTS.ITEMS), { - type: "bi.multi_select_item", - height: 25, - }), - }, - }, - }, - } - ], - }; - } -} diff --git a/demo/js/core/popup/demo.searcher_view.js b/demo/js/core/popup/demo.searcher_view.js deleted file mode 100644 index 84920aae2..000000000 --- a/demo/js/core/popup/demo.searcher_view.js +++ /dev/null @@ -1,61 +0,0 @@ -import { shortcut, Widget, createItems } from "@/core"; - -@shortcut() -export class Func extends Widget { - static xtype = "demo.searcher_view"; - - props = { baseCls: "demo-func" }; - - render() { - const self = this; - - return { - type: "bi.absolute", - items: [ - { - el: { - type: "bi.searcher_view", - ref() { - self.searcherView = this; - }, - }, - left: 100, - top: 20, - width: 230, - } - ], - }; - } - - mounted() { - this.searcherView.populate( - createItems( - [ - { - text: 2012, - }, - { - text: 2013, - }, - { - text: 2014, - }, - { - text: 2015, - } - ], - { - type: "bi.label", - textHeight: 24, - height: 24, - } - ), - [ - { - text: 2, - } - ], - "2" - ); - } -} diff --git a/demo/js/core/popup/index.js b/demo/js/core/popup/index.js deleted file mode 100644 index 3a8fed100..000000000 --- a/demo/js/core/popup/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./demo.layer"; -export * from "./demo.popover"; -export * from "./demo.popup_view"; -export * from "./demo.searcher_view"; \ No newline at end of file diff --git a/demo/js/face.js b/demo/js/face.js deleted file mode 100644 index 82a4b4754..000000000 --- a/demo/js/face.js +++ /dev/null @@ -1,878 +0,0 @@ -import { shortcut, Widget, each } from "@/core"; -import { Msg, StyleLoaders } from "@/base"; -import { ColorChooser } from "@/case"; - -@shortcut() -export class Face extends Widget { - static xtype = "demo.face"; - - props = { baseCls: "demo-face" }; - - _createLabel(text) { - return { - width: 200, - el: { - type: "bi.label", - text, - textAlign: "left", - hgap: 5, - height: 40, - cls: "config-label", - }, - }; - } - - _createColorPicker(ref, action) { - return { - el: { - type: "bi.vertical_adapt", - items: [ - { - type: "bi.color_chooser", - listeners: [ - { - eventName: ColorChooser.EVENT_CHANGE, - action, - } - ], - ref, - width: 24, - height: 24, - } - ], - }, - }; - } - - _createBackgroundConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("背景色:"), - this._createColorPicker( - function () { - self.backgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ) - ], - }; - } - - _createFontConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("字体颜色:"), - this._createColorPicker( - function () { - self.fontColor = this; - }, - () => { - self._runGlobalStyle(); - } - ) - ], - }; - } - - _createActiveFontConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("激活状态字体颜色:"), - this._createColorPicker( - function () { - self.activeFontColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.text_button", - cls: "bi-list-item-active", - text: "测试激活状态", - }, - } - ], - }; - } - - _createSelectFontConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("选中状态字体颜色:"), - this._createColorPicker( - function () { - self.selectFontColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.text_button", - cls: "bi-list-item-active", - text: "测试选中状态", - }, - } - ], - }; - } - - _createGrayFontConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("tip提示字体颜色:"), - this._createColorPicker( - function () { - self.grayFontColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.icon_text_item", - cls: "bi-tips copy-font", - height: 40, - text: "测试提示文字", - }, - } - ], - }; - } - - _createDisableFontConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("灰化字体颜色:"), - this._createColorPicker( - function () { - self.disabledFontColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.text_button", - text: "这个按钮是灰化的", - disabled: true, - }, - } - ], - }; - } - - _createCardBackgroundConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("Card背景颜色:"), - this._createColorPicker( - function () { - self.cardBackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ) - ], - }; - } - - _createHoverBackgroundColor() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("悬浮状态背景颜色:"), - this._createColorPicker( - function () { - self.hoverBackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.text_button", - cls: "bi-list-item-active", - text: "测试悬浮状态", - }, - } - ], - }; - } - - _createActiveBackgroundColor() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("激活状态背景颜色:"), - this._createColorPicker( - function () { - self.activeBackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.text_button", - cls: "bi-list-item-active", - text: "测试激活状态", - }, - } - ], - }; - } - - _createSelectBackgroundColor() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("选中状态背景颜色:"), - this._createColorPicker( - function () { - self.selectBackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.text_button", - cls: "bi-list-item-active", - text: "测试选中状态", - }, - } - ], - }; - } - - _createSlitColor() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("分割线颜色:"), - this._createColorPicker( - function () { - self.slitColor = this; - }, - () => { - self._runGlobalStyle(); - } - ) - ], - }; - } - - _createBaseConfig() { - return { - type: "bi.vertical", - items: [ - this._createLabel("--通用配色--"), - this._createBackgroundConfig(), - this._createCardBackgroundConfig(), - this._createFontConfig(), - this._createActiveFontConfig(), - this._createSelectFontConfig(), - this._createGrayFontConfig(), - this._createDisableFontConfig(), - this._createHoverBackgroundColor(), - this._createActiveBackgroundColor(), - this._createSelectBackgroundColor(), - this._createSlitColor() - ], - }; - } - - _createButton1BackgroundConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("按钮背景色1:"), - this._createColorPicker( - function () { - self.button1BackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.vertical_adapt", - height: 40, - items: [ - { - type: "bi.button", - cls: "config-button1", - text: "测试按钮", - } - ], - }, - } - ], - }; - } - - _createButton2BackgroundConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("按钮背景色2:"), - this._createColorPicker( - function () { - self.button2BackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.vertical_adapt", - height: 40, - items: [ - { - type: "bi.button", - level: "success", - cls: "config-button2", - text: "测试按钮", - } - ], - }, - } - ], - }; - } - - _createButton3BackgroundConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("按钮背景色3:"), - this._createColorPicker( - function () { - self.button3BackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.vertical_adapt", - height: 40, - items: [ - { - type: "bi.button", - level: "warning", - cls: "config-button3", - text: "测试按钮", - } - ], - }, - } - ], - }; - } - - _createButton4BackgroundConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("按钮背景色4:"), - this._createColorPicker( - function () { - self.button4BackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.vertical_adapt", - height: 40, - items: [ - { - type: "bi.button", - level: "ignore", - cls: "config-button4", - text: "测试按钮", - } - ], - }, - } - ], - }; - } - - _createScrollBackgroundConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("滚动条底色:"), - this._createColorPicker( - function () { - self.scrollBackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ) - ], - }; - } - - _createScrollThumbConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("滚动条thumb颜色:"), - this._createColorPicker( - function () { - self.scrollThumbColor = this; - }, - () => { - self._runGlobalStyle(); - } - ) - ], - }; - } - - _createPopupBackgroundConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("下拉框背景颜色:"), - this._createColorPicker( - function () { - self.popupBackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.vertical_adapt", - items: [ - { - type: "bi.down_list_combo", - items: [ - [ - { - el: { - text: "column 1111", - iconCls1: "check-mark-e-font", - value: 11, - }, - children: [ - { - text: "column 1.1", - value: 21, - cls: "dot-e-font", - selected: true, - }, - { - text: "column 1.222222222222222222222222222222222222", - cls: "dot-e-font", - value: 22, - }, - { - text: "column 1.3", - cls: "dot-e-font", - value: 23, - }, - { - text: "column 1.4", - cls: "dot-e-font", - value: 24, - }, - { - text: "column 1.5", - cls: "dot-e-font", - value: 25, - } - ], - } - ], - [ - { - el: { - type: "bi.icon_text_icon_item", - text: "column 2", - iconCls1: "chart-type-e-font", - cls: "dot-e-font", - value: 12, - }, - disabled: true, - children: [ - { - type: "bi.icon_text_item", - cls: "dot-e-font", - height: 25, - text: "column 2.1", - value: 11, - }, - { text: "column 2.2", value: 12, cls: "dot-e-font" } - ], - } - ], - [ - { - text: "column 33333333333333333333333333333333", - cls: "style-set-e-font", - value: 13, - } - ], - [ - { - text: "column 4", - cls: "filter-e-font", - value: 14, - } - ], - [ - { - text: "column 5", - cls: "copy-e-font", - value: 15, - } - ], - [ - { - text: "column 6", - cls: "delete-e-font", - value: 16, - } - ], - [ - { - text: "column 7", - cls: "dimension-from-e-font", - value: 17, - disabled: true, - } - ] - ], - } - ], - }, - } - ], - }; - } - - _createMaskBackgroundConfig() { - const self = this; - - return { - type: "bi.htape", - cls: "config-item bi-border-bottom", - height: 40, - items: [ - this._createLabel("弹出层蒙版颜色:"), - this._createColorPicker( - function () { - self.maskBackgroundColor = this; - }, - () => { - self._runGlobalStyle(); - } - ), - { - width: 100, - el: { - type: "bi.vertical_adapt", - items: [ - { - type: "bi.button", - text: "mask测试", - handler() { - Msg.alert("弹出层", "弹出层面板"); - }, - } - ], - }, - } - ], - }; - } - - _createCommonConfig() { - return { - type: "bi.vertical", - items: [ - this._createLabel("--一般配色--"), - this._createButton1BackgroundConfig(), - this._createButton2BackgroundConfig(), - this._createButton3BackgroundConfig(), - this._createButton4BackgroundConfig(), - this._createScrollBackgroundConfig(), - this._createScrollThumbConfig(), - this._createPopupBackgroundConfig(), - this._createMaskBackgroundConfig() - ], - }; - } - - render() { - const self = this; - - return { - type: "bi.grid", - items: [ - [ - { - el: { - type: "bi.vertical", - cls: "face-config bi-border-right", - items: [this._createBaseConfig(), this._createCommonConfig()], - }, - }, - { - el: { - type: "bi.layout", - }, - } - ] - ], - }; - } - - _setStyle(objects) { - let result = ""; - each(objects, (cls, object) => { - result += `${cls}{`; - each(object, (name, value) => { - result += `${name}:${value};`; - }); - result += "} "; - }); - StyleLoaders.removeStyle("style").loadStyle("style", result); - } - - _runGlobalStyle() { - const backgroundColor = this.backgroundColor.getValue(); - const fontColor = this.fontColor.getValue(); - const activeFontColor = this.activeFontColor.getValue(); - const selectFontColor = this.selectFontColor.getValue(); - const grayFontColor = this.grayFontColor.getValue(); - const disabledFontColor = this.disabledFontColor.getValue(); - const cardBackgroundColor = this.cardBackgroundColor.getValue(); - const hoverBackgroundColor = this.hoverBackgroundColor.getValue(); - const activeBackgroundColor = this.activeBackgroundColor.getValue(); - const selectBackgroundColor = this.selectBackgroundColor.getValue(); - const slitColor = this.slitColor.getValue(); - - const button1BackgroundColor = this.button1BackgroundColor.getValue(); - const button2BackgroundColor = this.button2BackgroundColor.getValue(); - const button3BackgroundColor = this.button3BackgroundColor.getValue(); - const button4BackgroundColor = this.button4BackgroundColor.getValue(); - const scrollBackgroundColor = this.scrollBackgroundColor.getValue(); - const scrollThumbColor = this.scrollThumbColor.getValue(); - const popupBackgroundColor = this.popupBackgroundColor.getValue(); - const maskBackgroundColor = this.maskBackgroundColor.getValue(); - - this._setStyle({ - "body.bi-background, body .bi-background": { - "background-color": backgroundColor, - color: fontColor, - }, - "body .bi-card": { - "background-color": cardBackgroundColor, - color: fontColor, - }, - "body .bi-tips": { - color: grayFontColor, - }, - "div::-webkit-scrollbar,.scrollbar-layout-main": { - "background-color": `${scrollBackgroundColor}!important`, - }, - "div::-webkit-scrollbar-thumb,.public-scrollbar-face:after": { - "background-color": `${scrollThumbColor}!important`, - }, - ".base-disabled": { - color: `${disabledFontColor}!important`, - }, - ".base-disabled .b-font:before": { - color: `${disabledFontColor}!important`, - }, - ".list-view-outer": { - "background-color": `${popupBackgroundColor}!important`, - }, - ".bi-z-index-mask": { - "background-color": `${maskBackgroundColor}!important`, - }, - ".bi-list-item:hover,.bi-list-item-hover:hover,.bi-list-item-active:hover,.bi-list-item-select:hover,.bi-list-item-effect:hover": - { - "background-color": `${hoverBackgroundColor}!important`, - }, - ".bi-list-item-active:active,.bi-list-item-select:active,.bi-list-item-effect:active": { - "background-color": `${activeBackgroundColor}!important`, - color: `${activeFontColor}!important`, - }, - ".bi-list-item-active.active,.bi-list-item-select.active,.bi-list-item-effect.active": { - "background-color": `${selectBackgroundColor}!important`, - color: `${selectFontColor}!important`, - }, - "body .bi-button.button-common": { - "background-color": button1BackgroundColor, - "border-color": button1BackgroundColor, - }, - "body .bi-button.button-success": { - "background-color": button2BackgroundColor, - "border-color": button2BackgroundColor, - }, - "body .bi-button.button-warning": { - "background-color": button3BackgroundColor, - "border-color": button3BackgroundColor, - }, - "body .bi-button.button-ignore": { - "background-color": button4BackgroundColor, - }, - // 以下是分割线颜色 - "body .bi-border,body .bi-border-top,#wrapper .bi-border-bottom,body .bi-border-left,body .bi-border-right": - { - "border-color": slitColor, - }, - ".bi-collection-table-cell": { - "border-right-color": slitColor, - "border-bottom-color": slitColor, - }, - ".bi-collection-table-cell.first-col": { - "border-left-color": slitColor, - }, - ".bi-collection-table-cell.first-row": { - "border-top-color": slitColor, - }, - }); - } - - mounted() { - this.backgroundColor.setValue(""); - this.fontColor.setValue(""); - this.activeFontColor.setValue(""); - this.selectFontColor.setValue(""); - this.grayFontColor.setValue(""); - this.disabledFontColor.setValue(""); - this.cardBackgroundColor.setValue(""); - this.hoverBackgroundColor.setValue(""); - this.activeBackgroundColor.setValue(""); - this.selectBackgroundColor.setValue(""); - - this.button1BackgroundColor.setValue(""); - this.button2BackgroundColor.setValue(""); - this.button3BackgroundColor.setValue(""); - this.button4BackgroundColor.setValue(""); - this.scrollBackgroundColor.setValue(""); - this.scrollThumbColor.setValue(""); - this.popupBackgroundColor.setValue(""); - this.maskBackgroundColor.setValue(""); - this.slitColor.setValue(""); - this._runGlobalStyle(); - } -} diff --git a/demo/js/fix-2.0/computed.js b/demo/js/fix-2.0/computed.js deleted file mode 100644 index 7dd00c30e..000000000 --- a/demo/js/fix-2.0/computed.js +++ /dev/null @@ -1,52 +0,0 @@ -(function () { - var model = Fix.define({ - name: "原始属性", - arr: [{ - n: "a" - }, { - n: "b" - }] - }); - var Computed = BI.inherit(Fix.Model, { - computed: { - b: function () { - return this.name + "-计算属性"; - } - } - }); - - Demo.Fix = BI.inherit(BI.Widget, { - _store: function () { - return new Computed(model); - }, - watch: { - b: function () { - this.button.setText(this.model.b); - } - }, - render: function () { - var self = this; - return { - type: "bi.absolute", - items: [{ - el: { - type: "bi.button", - ref: function () { - self.button = this; - }, - handler: function () { - self.model.name = "这是改变后的属性"; - }, - text: this.model.b - } - }] - }; - }, - mounted: function () { - - - } - }); - - BI.shortcut("demo.fix_computed", Demo.Fix); -}()); \ No newline at end of file diff --git a/demo/js/fix-2.0/context.js b/demo/js/fix-2.0/context.js deleted file mode 100644 index b248b502c..000000000 --- a/demo/js/fix-2.0/context.js +++ /dev/null @@ -1,79 +0,0 @@ -(function () { - var ParentStore = BI.inherit(Fix.Model, { - state: function () { - return { - context: "默认context" - }; - }, - childContext: ["context"] - }); - - BI.model("demo.model.context.parent_store",ParentStore) - - var ChildStore = BI.inherit(Fix.Model, { - context: ["context"], - computed: { - currContext: function () { - return this.model.context; - } - }, - actions: { - changeContext: function () { - this.model.context = "改变后的context"; - } - } - }); - - BI.model("demo.model.context.child_store",ChildStore) - - var Child = BI.inherit(BI.Widget, { - _store: function () { - return BI.Models.getModel("demo.model.context.child_store"); - }, - watch: { - currContext: function (val) { - this.button.setText(val); - } - }, - render: function () { - var self = this; - return { - type: "bi.button", - ref: function () { - self.button = this; - }, - text: this.model.context, - handler: function () { - self.store.changeContext(); - } - }; - }, - mounted: function () { - - } - }); - - BI.shortcut("demo.fix_context_child", Child); - - var Parent = BI.inherit(BI.Widget, { - _store: function () { - return BI.Models.getModel("demo.model.context.parent_store"); - }, - render: function () { - var self = this; - return { - type: "bi.absolute", - items: [{ - el: { - type: "demo.fix_context_child" - } - }] - }; - }, - mounted: function () { - - } - }); - - BI.shortcut("demo.fix_context", Parent); -}()); diff --git a/demo/js/fix-2.0/define.js b/demo/js/fix-2.0/define.js deleted file mode 100644 index 969c87f3f..000000000 --- a/demo/js/fix-2.0/define.js +++ /dev/null @@ -1,45 +0,0 @@ -(function () { - var model = Fix.define({ - name: "原始属性", - arr: [{ - n: "a" - }, { - n: "b" - }] - }); - - Demo.Fix = BI.inherit(BI.Widget, { - _store: function () { - return model; - }, - watch: { - name: function () { - this.button.setText(this.model.name); - } - }, - render: function () { - var self = this; - return { - type: "bi.absolute", - items: [{ - el: { - type: "bi.button", - ref: function () { - self.button = this; - }, - handler: function () { - self.model.name = "这是改变后的属性"; - }, - text: this.model.name - } - }] - }; - }, - mounted: function () { - - - } - }); - - BI.shortcut("demo.fix_define", Demo.Fix); -}()); diff --git a/demo/js/fix-2.0/demo.js b/demo/js/fix-2.0/demo.js deleted file mode 100644 index dab4b410c..000000000 --- a/demo/js/fix-2.0/demo.js +++ /dev/null @@ -1,74 +0,0 @@ -(function () { - var model = Fix.define({ - name: 1, - arr: [{ - n: "a" - }, { - n: 0 - }] - }); - var Computed = BI.inherit(Fix.Model, { - computed: { - b: function () { - return this.name + 1; - }, - c: function () { - return this.arr[1].n + this.b; - } - } - }); - - var Store = BI.inherit(Fix.Model, { - _init: function () { - this.comp = new Computed(model); - }, - computed: { - b: function () { - return this.comp.c + 1; - }, - c: function () { - return this.comp.arr[1].n & 1; - } - }, - actions: { - run: function () { - this.comp.name++; - this.comp.arr[1].n++; - } - } - }); - - Demo.Fix = BI.inherit(BI.Widget, { - _store: function () { - return new Store(); - }, - watch: { - "b&&(c||b)": function () { - this.button.setText(this.model.b); - } - }, - render: function () { - var self = this; - return { - type: "bi.absolute", - items: [{ - el: { - type: "bi.button", - ref: function () { - self.button = this; - }, - handler: function () { - self.store.run(); - }, - text: this.model.b - } - }] - }; - }, - mounted: function () { - - } - }); - - BI.shortcut("demo.fix", Demo.Fix); -}()); \ No newline at end of file diff --git a/demo/js/fix-2.0/globalwatcher.js b/demo/js/fix-2.0/globalwatcher.js deleted file mode 100644 index 248fb1671..000000000 --- a/demo/js/fix-2.0/globalwatcher.js +++ /dev/null @@ -1,52 +0,0 @@ -(function () { - var model = Fix.define({ - name: "原始属性", - arr: [{ - n: "a" - }, { - n: 0 - }] - }); - - Demo.Fix = BI.inherit(BI.Widget, { - _store: function () { - return model; - }, - watch: { - "*.*.n": function () { - debugger - }, - "**": function () { - debugger - }, - "arr.1.*": function () { - this.button.setText(this.model.name + "-" + this.model.arr[1].n); - } - }, - render: function () { - var self = this; - return { - type: "bi.absolute", - items: [{ - el: { - type: "bi.button", - ref: function () { - self.button = this; - }, - handler: function () { - self.model.arr[0].n += 1; - self.model.arr[1].n += 1; - }, - text: this.model.name + "-" + this.model.arr[1].n - } - }] - }; - }, - mounted: function () { - - - } - }); - - BI.shortcut("demo.fix_global_watcher", Demo.Fix); -}()); \ No newline at end of file diff --git a/demo/js/fix-2.0/index.js b/demo/js/fix-2.0/index.js deleted file mode 100644 index dab34ad3a..000000000 --- a/demo/js/fix-2.0/index.js +++ /dev/null @@ -1,10 +0,0 @@ -export * from "./computed"; -export * from "./context"; -export * from "./define"; -export * from "./demo"; -export * from "./globalwatcher"; -export * from "./inject"; -export * from "./scene"; -export * from "./state"; -export * from "./store"; -export * from "./watcher"; \ No newline at end of file diff --git a/demo/js/fix-2.0/inject.js b/demo/js/fix-2.0/inject.js deleted file mode 100644 index a5734635a..000000000 --- a/demo/js/fix-2.0/inject.js +++ /dev/null @@ -1,102 +0,0 @@ -(function () { - var ParentStore = BI.inherit(Fix.Model, { - state: function () { - return { - context: { - one: { - key: "one.key" - } - } - }; - }, - childContext: ["context"], - - actions: { - changeContext: function () { - this.model.context = { - two: { - key: "two.key" - } - }; - } - } - }); - - BI.model("demo.model.inject.parent_store", ParentStore); - - var ChildStore = BI.inherit(Fix.Model, { - inject: ["context"], - computed: { - currContext: function () { - return this.model.context.one.key; - } - }, - actions: { - changeContext: function () { - this.model.context = { - one: { - key: "one.changed_key" - } - }; - } - } - }); - - BI.model("demo.model.inject.child_store", ChildStore); - - var Child = BI.inherit(BI.Widget, { - _store: function () { - return BI.Models.getModel("demo.model.inject.child_store"); - }, - watch: { - currContext: function (val) { - this.button.setText(val); - } - }, - render: function () { - var self = this; - return { - type: "bi.button", - ref: function () { - self.button = this; - }, - text: this.model.currContext, - handler: function () { - self.store.changeContext(); - } - }; - }, - }); - - BI.shortcut("demo.fix_inject_child", Child); - - var Parent = BI.inherit(BI.Widget, { - _store: function () { - return BI.Models.getModel("demo.model.inject.parent_store"); - }, - render: function () { - var self = this; - return { - type: "bi.vertical", - items: [{ - el: { - type: "demo.fix_inject_child" - } - }, { - el: { - type: "bi.button", - text: "点击修改parent state", - handler: function () { - self.store.changeContext(); - } - } - }] - }; - }, - mounted: function () { - - } - }); - - BI.shortcut("demo.fix_inject", Parent); -}()); diff --git a/demo/js/fix-2.0/scene.js b/demo/js/fix-2.0/scene.js deleted file mode 100644 index 821da1d6f..000000000 --- a/demo/js/fix-2.0/scene.js +++ /dev/null @@ -1,445 +0,0 @@ -/** - * @Author: Young - * @CreationDate 2017-11-06 10:32 - * @Description - */ -(function () { - var model = Fix.define({ - groups: [{ - id: "27a9c8bf159e99e", - name: "功能数据", - packages: [{ - id: "82a96a4b03ac17e6", - name: "通信行业", - type: 1, - tables: [{ - id: "品类", - name: "品类", - connName: "BIDemo", - fields: [{ - id: "sd2ad2f343ca23", - name: "类别", - type: 32, - enable: true, - usable: true - }, { - id: "f34ds34aw2345w", - name: "描述", - type: 32, - enable: true, - usable: true - }] - }] - }] - }, { - id: "das2dw24214sa4", - name: "样式数据", - packages: [{ - id: "hi23i1o34a34we", - name: "零售行业", - type: 1, - tables: [{ - id: "销售记录", - name: "销售记录", - connName: "BIDemo", - fields: [{ - id: "wr213d24t345", - name: "分类", - type: 16, - enable: true, - usable: true - }, { - id: "faw134r24al344", - name: "金额", - type: 32, - enable: true, - usable: true - }] - }] - }, { - id: "fwr124f3453fa", - name: "地产行业", - tables: [{ - id: "开发商名称", - name: "开发商名称", - connName: "BIDemo", - fields: [{ - id: "sa13f345fg356", - name: "编号", - type: 32, - enable: true, - usable: true - }, { - id: "ad2r24tt232a22", - name: "名称", - type: 16, - enable: true, - usable: true - }] - }, { - id: "楼盘", - name: "楼盘", - connName: "BIDemo", - fields: [{ - id: "hfe3345fg356", - name: "编号", - type: 32, - enable: true, - usable: true - }, { - id: "kl224tt232a22", - name: "名称", - type: 16, - enable: true, - usable: true - }] - }] - }] - }], - fineIndexUpdate: { - needUpdate: false, - lastUpdate: 1509953199062 - } - }); - - Demo.FixScene = BI.inherit(BI.Widget, { - constant: { - TAB1: 1, - TAB2: 2 - }, - - _store: function () { - return model; - }, - - watch: { - "groups.*.name": function () { - this.fineIndexTab.setText("FineIndex更新(******* 分组名变化 需要更新 *******)"); - this.model.fineIndexUpdate.needUpdate = true; - }, - "groups.*.packages.*.name": function () { - this.fineIndexTab.setText("FineIndex更新(******* 业务包名变化 需要更新 *******)"); - this.model.fineIndexUpdate.needUpdate = true; - }, - "groups.*.packages.*.tables.*.name": function () { - this.fineIndexTab.setText("FineIndex更新(******* 表名变化 需要更新 *******)"); - this.model.fineIndexUpdate.needUpdate = true; - }, - "groups.*.packages.*.tables.*.fields.*.name": function () { - this.fineIndexTab.setText("FineIndex更新(******* 字段名变化 需要更新 *******)"); - this.model.fineIndexUpdate.needUpdate = true; - }, - "fineIndexUpdate.needUpdate": function (needUpdate) { - !needUpdate && this.fineIndexTab.setText("FineIndex更新"); - } - }, - - render: function () { - var self = this; - return { - type: "bi.tab", - showIndex: this.constant.TAB1, - single: true, - tab: { - type: "bi.button_group", - items: BI.createItems([{ - text: "业务包管理", - value: this.constant.TAB1 - }, { - text: "FineIndex更新", - value: this.constant.TAB2, - ref: function (ref) { - self.fineIndexTab = ref; - } - }], { - type: "bi.text_button", - cls: "bi-list-item-active", - height: 50 - }), - height: 50 - }, - cardCreator: BI.bind(this.cardCreator, this) - }; - }, - - cardCreator: function (v) { - switch (v) { - case this.constant.TAB1: - return { - type: "demo.fix_scene_data_manager", - data: this.model - }; - case this.constant.TAB2: - return { - type: "demo.fix_scene_fine_index_update" - }; - } - } - }); - BI.shortcut("demo.fix_scene", Demo.FixScene); - - Demo.FixSceneDataManager = BI.inherit(BI.Widget, { - _store: function () { - return this.options.data; - }, - - watch: { - "*.name": function () { - - } - }, - - render: function () { - var items = []; - BI.each(this.model.groups, function (i, group) { - items.push({ - type: "demo.fix_scene_group", - group: group - }); - }); - - return { - type: "bi.vertical", - items: [{ - type: "bi.left", - items: BI.createItems([{ - text: "分组名" - }, { - text: "业务包名" - }, { - text: "表名" - }, { - text: "字段名" - }], { - type: "bi.label", - cls: "layout-bg1", - width: 150 - }) - - }, { - type: "bi.vertical", - items: items - }], - vgap: 20, - hgap: 20 - }; - } - - }); - BI.shortcut("demo.fix_scene_data_manager", Demo.FixSceneDataManager); - - Demo.FixSceneGroup = BI.inherit(BI.Widget, { - props: { - group: {} - }, - - _store: function () { - return this.options.group; - }, - - render: function () { - var self = this; - var items = []; - BI.each(this.model.packages, function (i, child) { - items.push({ - type: "demo.fix_scene_package", - pack: child - }); - }); - return { - type: "bi.left", - items: [{ - type: "bi.sign_editor", - cls: "bi-border-bottom", - width: 100, - height: 30, - value: this.model.name, - listeners: [{ - eventName: BI.SignEditor.EVENT_CHANGE, - action: function () { - self.model.name = this.getValue(); - } - }] - }, { - type: "bi.vertical", - items: items - }], - hgap: 20 - }; - } - }); - BI.shortcut("demo.fix_scene_group", Demo.FixSceneGroup); - - - Demo.FixScenePackage = BI.inherit(BI.Widget, { - props: { - pack: {} - }, - - _store: function () { - return this.options.pack; - }, - - render: function () { - var self = this; - var items = []; - BI.each(this.model.tables, function (i, child) { - items.push({ - type: "demo.fix_scene_table", - table: child - }); - }); - return { - type: "bi.left", - items: [{ - type: "bi.sign_editor", - cls: "bi-border-bottom", - width: 100, - height: 30, - value: this.model.name, - listeners: [{ - eventName: BI.SignEditor.EVENT_CHANGE, - action: function () { - self.model.name = this.getValue(); - } - }] - }, { - type: "bi.vertical", - items: items - }], - hgap: 20 - }; - } - }); - BI.shortcut("demo.fix_scene_package", Demo.FixScenePackage); - - Demo.FixSceneTable = BI.inherit(BI.Widget, { - props: { - table: {} - }, - - _store: function () { - return this.options.table; - }, - - render: function () { - var self = this; - var items = []; - BI.each(this.model.fields, function (i, child) { - items.push({ - type: "demo.fix_scene_field", - field: child - }); - }); - return { - type: "bi.left", - items: [{ - type: "bi.sign_editor", - cls: "bi-border-bottom", - width: 100, - height: 30, - value: this.model.name, - listeners: [{ - eventName: BI.SignEditor.EVENT_CHANGE, - action: function () { - self.model.name = this.getValue(); - } - }] - }, { - type: "bi.vertical", - items: items - }], - hgap: 20 - }; - } - }); - BI.shortcut("demo.fix_scene_table", Demo.FixSceneTable); - - Demo.FixSceneField = BI.inherit(BI.Widget, { - props: { - field: {} - }, - - _store: function () { - return this.options.field; - }, - - render: function () { - var self = this; - return { - type: "bi.center_adapt", - items: [{ - type: "bi.sign_editor", - cls: "bi-border-bottom", - width: 100, - height: 30, - value: this.model.name, - listeners: [{ - eventName: BI.SignEditor.EVENT_CHANGE, - action: function () { - self.model.name = this.getValue(); - } - }] - }] - }; - } - }); - BI.shortcut("demo.fix_scene_field", Demo.FixSceneField); - - Demo.FixSceneFineIndexUpdateStore = BI.inherit(Fix.Model, { - _init: function () { - this.fineIndexUpdate = model.fineIndexUpdate; - }, - computed: { - text: function () { - return "立即更新(上次更新时间:" + BI.date2Str(new Date(this.fineIndexUpdate.lastUpdate), "yyyy-MM-dd HH:mm:ss") + ")"; - }, - needUpdate: function () { - return this.fineIndexUpdate.needUpdate; - } - }, - actions: { - updateFineIndex: function () { - this.fineIndexUpdate.needUpdate = false; - this.fineIndexUpdate.lastUpdate = new Date().getTime(); - } - } - }); - - Demo.FixSceneFineIndexUpdate = BI.inherit(BI.Widget, { - _store: function () { - return new Demo.FixSceneFineIndexUpdateStore(); - }, - - watch: { - needUpdate: function () { - this.button.setEnable(this.model.needUpdate); - }, - text: function () { - this.button.setText(this.model.text); - } - }, - - render: function () { - var self = this; - return { - type: "bi.center_adapt", - items: [{ - type: "bi.button", - text: this.model.text, - disabled: !this.model.needUpdate, - height: 30, - width: 360, - handler: function () { - self.store.updateFineIndex(); - }, - ref: function (ref) { - self.button = ref; - } - }] - }; - } - }); - BI.shortcut("demo.fix_scene_fine_index_update", Demo.FixSceneFineIndexUpdate); - -})(); \ No newline at end of file diff --git a/demo/js/fix-2.0/state.js b/demo/js/fix-2.0/state.js deleted file mode 100644 index ce33b7f0b..000000000 --- a/demo/js/fix-2.0/state.js +++ /dev/null @@ -1,49 +0,0 @@ -(function () { - var State = BI.inherit(Fix.Model, { - state: function () { - return { - name: "原始属性" - }; - }, - computed: { - b: function () { - return this.model.name + "-计算属性"; - } - } - }); - - Demo.Fix = BI.inherit(BI.Widget, { - _store: function () { - return new State(); - }, - watch: { - b: function () { - this.button.setText(this.model.b); - } - }, - render: function () { - var self = this; - return { - type: "bi.absolute", - items: [{ - el: { - type: "bi.button", - ref: function () { - self.button = this; - }, - handler: function () { - self.model.name = "这是改变后的属性"; - }, - text: this.model.b - } - }] - }; - }, - mounted: function () { - - - } - }); - - BI.shortcut("demo.fix_state", Demo.Fix); -}()); \ No newline at end of file diff --git a/demo/js/fix-2.0/store.js b/demo/js/fix-2.0/store.js deleted file mode 100644 index 188a5b906..000000000 --- a/demo/js/fix-2.0/store.js +++ /dev/null @@ -1,60 +0,0 @@ -(function () { - var model = Fix.define({ - name: "原始属性", - arr: [{ - n: "a" - }, { - n: "b" - }] - }); - - var Store = BI.inherit(Fix.Model, { - _init: function () { - }, - computed: { - b: function () { - return model.name + "-计算属性"; - } - }, - actions: { - run: function () { - model.name = "这是改变后的属性"; - } - } - }); - - Demo.Fix = BI.inherit(BI.Widget, { - _store: function () { - return new Store(); - }, - watch: { - b: function () { - this.button.setText(this.model.b); - } - }, - render: function () { - var self = this; - return { - type: "bi.absolute", - items: [{ - el: { - type: "bi.button", - ref: function () { - self.button = this; - }, - handler: function () { - self.store.run(); - }, - text: this.model.b - } - }] - }; - }, - mounted: function () { - - - } - }); - - BI.shortcut("demo.fix_store", Demo.Fix); -}()); \ No newline at end of file diff --git a/demo/js/fix-2.0/watcher.js b/demo/js/fix-2.0/watcher.js deleted file mode 100644 index 98716ed59..000000000 --- a/demo/js/fix-2.0/watcher.js +++ /dev/null @@ -1,51 +0,0 @@ -(function () { - var model = Fix.define({ - name: "原始属性", - arr: [{ - n: "a" - }, { - n: 0 - }] - }); - - Demo.Fix = BI.inherit(BI.Widget, { - _store: function () { - return model; - }, - watch: { - "name||arr.1.n": function () { - this.button.setText(this.model.name + "-" + this.model.arr[1].n); - } - }, - render: function () { - var self = this; - var cnt = 0; - return { - type: "bi.absolute", - items: [{ - el: { - type: "bi.button", - ref: function () { - self.button = this; - }, - handler: function () { - if (cnt & 1) { - self.model.name += 1; - } else { - self.model.arr[1].n += 1; - } - cnt++; - }, - text: this.model.name + "-" + this.model.arr[1].n - } - }] - }; - }, - mounted: function () { - - - } - }); - - BI.shortcut("demo.fix_watcher", Demo.Fix); -}()); \ No newline at end of file diff --git a/demo/js/index.js b/demo/js/index.js deleted file mode 100644 index 251e834a7..000000000 --- a/demo/js/index.js +++ /dev/null @@ -1,16 +0,0 @@ -export * from "./center"; -export * from "./face"; -export * from "./main"; -export * from "./main.store"; -export * from "./north"; -export * from "./preview"; -export * from "./router"; -export * from "./west"; - -export * from "./base"; -export * from "./case"; -export * from "./component"; -export * from "./config"; -export * from "./core"; -export * from "./fix-2.0"; -export * from "./widget"; \ No newline at end of file diff --git a/demo/js/main.js b/demo/js/main.js deleted file mode 100644 index e42ae5a08..000000000 --- a/demo/js/main.js +++ /dev/null @@ -1,62 +0,0 @@ -import { shortcut, Widget, Stores } from "@/core"; - -@shortcut() -export class Main extends Widget { - static xtype = "demo.main"; - - props = { baseCls: "demo-main bi-background" }; - - _store() { - return Stores.getStore("demo.store.main"); - } - - beforeInit(cb) { - this.store.init(cb); - } - - render() { - const self = this; - - return { - type: "bi.border", - items: { - north: { - height: 50, - el: { - type: "demo.north", - listeners: [ - { - eventName: Demo.North.EVENT_VALUE_CHANGE, - action (v) { - self.store.handleTreeSelectChange(v); - }, - } - ], - }, - }, - west: { - width: 230, - el: { - type: "demo.west", - listeners: [ - { - eventName: Demo.West.EVENT_VALUE_CHANGE, - action (v) { - self.store.handleTreeSelectChange(v); - }, - } - ], - }, - }, - center: { - el: { - type: "demo.center", - ref (_ref) { - self.center = _ref; - }, - }, - }, - }, - }; - } -} diff --git a/demo/js/main.store.js b/demo/js/main.store.js deleted file mode 100644 index 82d3b81df..000000000 --- a/demo/js/main.store.js +++ /dev/null @@ -1,65 +0,0 @@ -!(function () { - var Store = BI.inherit(Fix.Model, { - _init: function () { - - }, - - computed: {}, - - watch: {}, - - actions: { - init: function (cb) { - var tree = BI.Tree.transformToTreeFormat(Demo.CONFIG); - var traversal = function (array, callback) { - var t = []; - BI.some(array, function (i, item) { - var match = callback(i, item); - if (match) { - t.push(item.id); - } - var b = traversal(item.children, callback); - if (BI.isNotEmptyArray(b)) { - t = BI.concat([item.id], b); - } - }); - return t; - }; - var paths = traversal(tree, function (index, node) { - if (!node.children || BI.isEmptyArray(node.children)) { - if (node.value === Demo.showIndex) { - return true; - } - } - }); - BI.each(Demo.CONFIG, function (index, item) { - if (BI.contains(paths, item.id)) { - item.open = true; - } - }); - - cb(); - }, - - handleTreeSelectChange: function (v) { - var matched = BI.some(Demo.CONFIG, function (index, item) { - if (item.value === v) { - BI.Router.$router.push({ - name: "component", - params: { - componentId: item.value - } - }); - // BI.history.navigate(item.text, {trigger: true}); - return true; - } - }); - if (!matched) { - BI.Router.$router.push("/"); - // BI.history.navigate("", {trigger: true}); - } - } - } - }); - BI.store("demo.store.main", Store); -})(); diff --git a/demo/js/north.js b/demo/js/north.js deleted file mode 100644 index 90b9b1473..000000000 --- a/demo/js/north.js +++ /dev/null @@ -1,46 +0,0 @@ -Demo.North = BI.inherit(BI.Widget, { - props: { - baseCls: "demo-north" - }, - render: function () { - var self = this; - return { - type: "bi.htape", - items: [{ - width: 230, - el: { - type: "bi.text_button", - listeners: [{ - eventName: BI.Button.EVENT_CHANGE, - action: function () { - self.fireEvent(Demo.North.EVENT_VALUE_CHANGE, ""); - } - }], - cls: "logo", - height: 50, - text: "FineUI2.0" - } - }, { - el: { - type: "bi.right", - hgap: 10, - items: [{ - type: "bi.text_button", - text: "星空蓝", - handler: function () { - BI.$("html").removeClass("bi-theme-default").addClass("bi-theme-dark"); - } - }, { - type: "bi.text_button", - text: "典雅白", - handler: function () { - BI.$("html").removeClass("bi-theme-dark").addClass("bi-theme-default"); - } - }] - } - }] - }; - } -}); -Demo.North.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE"; -BI.shortcut("demo.north", Demo.North); \ No newline at end of file diff --git a/demo/js/preview.js b/demo/js/preview.js deleted file mode 100644 index d1fd6a27a..000000000 --- a/demo/js/preview.js +++ /dev/null @@ -1,95 +0,0 @@ -import { shortcut, Widget, isEqual } from "@/core"; - -@shortcut() -export class Preview extends Widget { - static xtype = "demo.preview"; - - props = { baseCls: "demo-preview" }; - - render() { - const self = this; - const items = [], - header = [], - columnSize = []; - - const rowCount = 100, - columnCount = 100; - for (var i = 0; i < 1; i++) { - header[i] = []; - for (var j = 0; j < columnCount; j++) { - header[i][j] = { - type: "bi.label", - text: `表头${i}-${j}`, - }; - columnSize[j] = 100; - } - } - for (var i = 0; i < rowCount; i++) { - items[i] = []; - for (var j = 0; j < columnCount; j++) { - items[i][j] = { - type: "bi.label", - text: `${i < 3 ? 0 : i}-${j}`, - }; - } - } - - return { - type: "bi.absolute", - cls: "preview-background", - items: [ - { - el: { - type: "bi.vtape", - cls: "preview-card bi-card", - items: [ - { - el: { - type: "bi.label", - cls: "preview-title bi-border-bottom", - height: 40, - text: "Card", - hgap: 10, - textAlign: "left", - }, - height: 40, - }, - { - type: "bi.center_adapt", - scrollable: true, - items: [ - { - type: "bi.resizable_table", - el: { - type: "bi.collection_table", - }, - width: 500, - height: 400, - isResizeAdapt: true, - isNeedResize: true, - isNeedMerge: true, - mergeCols: [0, 1], - mergeRule (col1, col2) { - return isEqual(col1, col2); - }, - isNeedFreeze: true, - freezeCols: [0, 1], - columnSize, - items, - header, - } - ], - } - ], - }, - left: 60, - right: 60, - top: 60, - bottom: 60, - } - ], - }; - } - - mounted() {} -} diff --git a/demo/js/router.js b/demo/js/router.js deleted file mode 100644 index 99ffb0e44..000000000 --- a/demo/js/router.js +++ /dev/null @@ -1,17 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Router extends Widget { - static xtype = "demo.router"; - - props = { baseCls: "demo-router" }; - - render() { - const self = this; - const params = BI.Router.$router.history.current.params; - - return { - type: params.componentId, - }; - } -} diff --git a/demo/js/west.js b/demo/js/west.js deleted file mode 100644 index d2cd70109..000000000 --- a/demo/js/west.js +++ /dev/null @@ -1,77 +0,0 @@ -Demo.West = BI.inherit(BI.Widget, { - props: { - baseCls: "demo-west bi-border-right bi-card" - }, - - mounted: function () { - this.searcher.setAdapter(this.tree); - }, - - render: function () { - var self = this; - - - var selectedId = BI.Router.$router.currentRoute.params?.componentId; - - return { - type: "bi.vtape", - items: [{ - type: "bi.center_adapt", - items: [{ - type: "bi.searcher", - el: { - type: "bi.search_editor", - watermark: "简单搜索" - }, - width: 200, - isAutoSearch: false, - isAutoSync: false, - ref: function (ref) { - self.searcher = ref; - }, - popup: { - type: "bi.multilayer_single_level_tree", - cls: "bi-card", - listeners: [{ - eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE, - action: function (v) { - self.fireEvent(Demo.West.EVENT_VALUE_CHANGE, v); - } - }] - }, - onSearch: function (op, callback) { - var result = BI.Func.getSearchResult(Demo.CONFIG, op.keyword, "text"); - var items = BI.concat(result.match, result.find); - var children = []; - BI.each(items, function (index, item) { - var childList = BI.Func.getSearchResult(Demo.CONFIG, item.id, "pId"); - BI.each(childList.match, function (index, child) { - if (child.value) { - children.push(child); - } - }); - }); - items = BI.concat(items, children); - callback(items); - } - }], - height: 40 - }, { - type: "bi.multilayer_single_level_tree", - listeners: [{ - eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE, - action: function (v) { - self.fireEvent(Demo.West.EVENT_VALUE_CHANGE, v); - } - }], - value: selectedId || Demo.showIndex, - items: Demo.CONFIG, - ref: function (ref) { - self.tree = ref; - } - }] - }; - } -}); -Demo.West.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE"; -BI.shortcut("demo.west", Demo.West); diff --git a/demo/js/widget/basewidget/demo.buttons.js b/demo/js/widget/basewidget/demo.buttons.js deleted file mode 100644 index 33242f774..000000000 --- a/demo/js/widget/basewidget/demo.buttons.js +++ /dev/null @@ -1,87 +0,0 @@ -import { shortcut, Widget, each } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class Buttons extends Widget { - static xtype = "demo.buttons"; - - props = { baseCls: "demo-button" }; - - render() { - const items = [ - { - el: { - type: "bi.button", - text: "一般按钮", - level: "common", - height: 30, - }, - }, - { - el: { - type: "bi.button", - text: "带图标的按钮", - // level: 'ignore', - iconCls: "close-font", - height: 30, - }, - }, - { - el: { - type: "bi.button", - text: "一般按钮", - block: true, - level: "common", - height: 30, - }, - }, - { - el: { - type: "bi.button", - text: "一般按钮", - clear: true, - level: "common", - height: 30, - }, - }, - { - el: { - type: "bi.multi_select_bar", - selected: true, - halfSelected: true, - }, - }, - { - el: { - type: "bi.multi_select_bar", - selected: true, - halfSelected: false, - }, - }, - { - el: { - type: "bi.multi_select_bar", - selected: false, - halfSelected: true, - }, - }, - { - el: { - type: "bi.multi_select_bar", - }, - } - ]; - each(items, (i, item) => { - item.el.handler = function () { - Msg.alert("按钮", this.options.text); - }; - }); - - return { - type: "bi.left", - vgap: 100, - hgap: 20, - items, - }; - } -} diff --git a/demo/js/widget/basewidget/demo.items.js b/demo/js/widget/basewidget/demo.items.js deleted file mode 100644 index 113d50d8b..000000000 --- a/demo/js/widget/basewidget/demo.items.js +++ /dev/null @@ -1,43 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Items extends Widget { - static xtype = "demo.items"; - - render() { - return { - type: "bi.vertical", - items: [ - { - type: "bi.text_button", - cls: "bi-list-item-select bi-high-light-border bi-border", - height: 30, - level: "warning", - text: "单选item", - }, - { - type: "bi.single_select_item", - text: "单选项", - }, - { - type: "bi.single_select_radio_item", - text: "单选项", - }, - { - type: "bi.label", - height: 30, - text: "复选item", - }, - { - type: "bi.multi_select_item", - text: "复选项", - }, - { - type: "bi.switch", - selected: true, - } - ], - hgap: 300, - }; - } -} diff --git a/demo/js/widget/basewidget/demo.nodes.js b/demo/js/widget/basewidget/demo.nodes.js deleted file mode 100644 index e8b5cc801..000000000 --- a/demo/js/widget/basewidget/demo.nodes.js +++ /dev/null @@ -1,41 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Nodes extends Widget { - static xtype = "demo.nodes"; - - render(vessel) { - return { - type: "bi.vertical", - items: [ - { - type: "bi.label", - height: 30, - text: "十字形的节点", - }, - { - type: "bi.plus_group_node", - text: "十字形的节点", - }, - { - type: "bi.label", - height: 30, - text: "箭头节点", - }, - { - type: "bi.arrow_group_node", - text: "箭头节点", - }, - { - type: "bi.icon_arrow_node", - iconCls: "search-font", - text: "箭头图标节点", - }, - { - type: "bi.multilayer_icon_arrow_node", - layer: 2, - } - ], - }; - } -} diff --git a/demo/js/widget/basewidget/demo.sagments.js b/demo/js/widget/basewidget/demo.sagments.js deleted file mode 100644 index 3cd9b5c20..000000000 --- a/demo/js/widget/basewidget/demo.sagments.js +++ /dev/null @@ -1,40 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class Segments extends Widget { - static xtype = "demo.segments"; - - render() { - return { - type: "bi.vertical", - items: [ - { - type: "bi.label", - height: 30, - text: "默认风格", - }, - { - type: "bi.segment", - items: [ - { - text: "tab1", - value: 1, - selected: true, - }, - { - text: "tab2", - value: 2, - }, - { - text: "tab3 disabled", - disabled: true, - value: 3, - } - ], - } - ], - hgap: 50, - vgap: 20, - }; - } -} diff --git a/demo/js/widget/basewidget/demo.tips.js b/demo/js/widget/basewidget/demo.tips.js deleted file mode 100644 index 150b9ce72..000000000 --- a/demo/js/widget/basewidget/demo.tips.js +++ /dev/null @@ -1,164 +0,0 @@ -import { shortcut, Widget, createWidget, each } from "@/core"; -import { Bubbles, Msg } from "@/base"; - -@shortcut() -export class Tips extends Widget { - static xtype = "demo.tips"; - - props = { baseCls: "demo-tips" }; - - render() { - const btns = []; - const bubble = createWidget({ - type: "bi.left", - items: [ - { - el: { - type: "bi.button", - text: "bubble测试", - height: 30, - handler() { - Bubbles.show("singleBubble1", "bubble测试", this); - btns.push("singleBubble1"); - }, - }, - }, - { - el: { - type: "bi.button", - text: "bubble测试(居中显示)", - height: 30, - handler() { - Bubbles.show("singleBubble2", "bubble测试", this, { - offsetStyle: "center", - }); - btns.push("singleBubble2"); - }, - }, - }, - { - el: { - type: "bi.button", - text: "bubble测试(右边显示)", - height: 30, - handler() { - Bubbles.show("singleBubble3", "bubble测试", this, { - offsetStyle: "right", - }); - btns.push("singleBubble3"); - }, - }, - }, - { - el: { - type: "bi.button", - text: "隐藏所有 bubble", - height: 30, - cls: "layout-bg2", - handler() { - each(btns, (index, value) => { - Bubbles.hide(value); - }); - }, - }, - } - ], - hgap: 20, - }); - - const title = createWidget({ - type: "bi.vertical", - items: [ - { - type: "bi.label", - cls: "layout-bg1", - height: 50, - title: "title提示", - text: "移上去有title提示", - textAlign: "center", - }, - { - type: "bi.label", - cls: "layout-bg6", - height: 50, - disabled: true, - warningTitle: "title错误提示", - text: "移上去有title错误提示", - textAlign: "center", - }, - { - type: "bi.label", - cls: "layout-bg2", - height: 50, - disabled: true, - tipType: "success", - title: "自定义title提示效果", - warningTitle: "自定义title提示效果", - text: "自定义title提示效果", - textAlign: "center", - } - ], - hgap: 20, - vgap: 20, - }); - - const toast = createWidget({ - type: "bi.vertical", - items: [ - { - el: { - type: "bi.button", - text: "简单Toast测试", - height: 30, - handler() { - Msg.toast("这是一条简单的数据"); - }, - }, - }, - { - el: { - type: "bi.button", - text: "很长的Toast测试", - height: 30, - handler() { - Msg.toast( - "这是一条很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的数据" - ); - }, - }, - }, - { - el: { - type: "bi.button", - text: "非常长的Toast测试", - height: 30, - handler() { - Msg.toast( - "这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据" - ); - }, - }, - }, - { - el: { - type: "bi.button", - text: "错误提示Toast测试", - level: "warning", - height: 30, - handler() { - Msg.toast("错误提示Toast测试", "warning"); - }, - }, - } - ], - vgap: 20, - }); - - return { - type: "bi.horizontal_auto", - vgap: 20, - hgap: 20, - items: [bubble, title, toast], - }; - } -} diff --git a/demo/js/widget/basewidget/index.js b/demo/js/widget/basewidget/index.js deleted file mode 100644 index 48de6947f..000000000 --- a/demo/js/widget/basewidget/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./demo.buttons"; -export * from "./demo.items"; -export * from "./demo.nodes"; -export * from "./demo.sagments"; -export * from "./demo.tips"; \ No newline at end of file diff --git a/demo/js/widget/collapase/API.md b/demo/js/widget/collapase/API.md deleted file mode 100644 index 2ba16aa32..000000000 --- a/demo/js/widget/collapase/API.md +++ /dev/null @@ -1,12 +0,0 @@ -## API - -### bi.collapse - -| 参数 | 说明 | 类型 | 默认值 | -| ---------- | ---------- | ------- | -------------------- | -| accordion | 手风琴模式 | boolean | false | -| bordered | 带边框风格的折叠面板 | boolean | true | -| ghost | 使折叠面板透明且无边框 | boolean | false | -| openMotion | 展开动画 | object | { animation: "bi-slide-up", animationDuring: 100} -| value | 初始化选中面板的 key | string\[]
number\[] | - | -| listeners | 监听切换面板事件 | [{eventName: "EVENT_EXPAND", action:(activeKey) => void}] | - | diff --git a/demo/js/widget/collapase/demo.collapse.js b/demo/js/widget/collapase/demo.collapse.js deleted file mode 100644 index 9218b87db..000000000 --- a/demo/js/widget/collapase/demo.collapse.js +++ /dev/null @@ -1,74 +0,0 @@ -import { shortcut, Widget, createItems } from "@/core"; - -@shortcut() -export class Collapse extends Widget { - static xtype = "demo.collapse"; - - props = { baseCls: "demo-collapse" }; - - render() { - const self = this; - - const items = [ - { - value: "test", - popup: { - cls: "mvc-border", - items: createItems( - [ - { - text: "项目1", - value: 1, - }, - { - text: "项目2", - value: 2, - }, - { - text: "项目3", - value: 3, - }, - { - text: "项目4", - value: 4, - } - ], - { - type: "bi.single_select_item", - height: 25, - } - ), - }, - }, - { - value: 2, - popup: { - type: "bi.label", - value: "给岁月以文明,而不是给文明以岁月", - }, - }, - { - value: 3, - popup: { - type: "bi.label", - value: "漂流瓶隐没于黑暗里,在一千米见方的宇宙中,只有生态球里的小太阳发出一点光芒。在这个小小的生命世界中,几只清澈的水球在零重力环境中静静地飘浮着,有一条小鱼从一只水球中蹦出,跃入另一只水球,轻盈地穿游于绿藻之间。", - }, - } - ]; - - return { - type: "bi.vertical", - items: [ - { - type: "bi.collapse", - accordion: true, - items, - value: [2], - } - ], - width: "60%", - tgap: 100, - hgap: 100, - }; - } -} diff --git a/demo/js/widget/collapase/index.js b/demo/js/widget/collapase/index.js deleted file mode 100644 index 4bbdbc7d5..000000000 --- a/demo/js/widget/collapase/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from "./demo.collapse"; \ No newline at end of file diff --git a/demo/js/widget/date/demo.datepane.js b/demo/js/widget/date/demo.datepane.js deleted file mode 100644 index c879484db..000000000 --- a/demo/js/widget/date/demo.datepane.js +++ /dev/null @@ -1,93 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class DatePane extends Widget { - static xtype = "demo.date_pane"; - - props = { baseCls: "demo-datepane" }; - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.vertical", - vgap: 10, - items: [ - { - type: "bi.label", - cls: "layout-bg2", - text: "bi.date_pane", - }, - { - type: "bi.dynamic_date_pane", - // value: { - // type: 1, - // value: { - // year: 2017, - // month: 12, - // day: 11 - // } - // }, - ref (_ref) { - self.datepane = _ref; - }, - height: 300, - }, - { - type: "bi.button", - text: "getValue", - handler () { - Msg.toast(`date${JSON.stringify(self.datepane.getValue())}`); - }, - }, - { - type: "bi.dynamic_date_time_pane", - value: { - type: 1, - value: { - year: 2017, - month: 12, - day: 11, - hour: 12, - minute: 12, - second: 12, - }, - }, - ref (_ref) { - self.dateTimePane = _ref; - }, - height: 340, - }, - { - type: "bi.button", - text: "getValue", - handler () { - Msg.toast(`date${JSON.stringify(self.dateTimePane.getValue())}`); - }, - }, - { - type: "bi.button", - text: "setValue '2017-12-31'", - handler () { - self.datepane.setValue({ - year: 2017, - month: 12, - day: 31, - }); - }, - } - ], - width: "50%", - } - ], - }; - } - - mounted() { - this.datepane.setValue(); // 不设value值表示当前时间 - } -} diff --git a/demo/js/widget/date/demo.multidate_combo.js b/demo/js/widget/date/demo.multidate_combo.js deleted file mode 100644 index 3cbb99ff0..000000000 --- a/demo/js/widget/date/demo.multidate_combo.js +++ /dev/null @@ -1,111 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class Date extends Widget { - static xtype = "demo.multidate_combo"; - - props = { baseCls: "demo-date" }; - - _init() { - Demo.Date.superclass._init.apply(this, arguments); - } - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - vgap: 20, - items: [ - { - type: "bi.dynamic_date_combo", - ref() { - self.datecombo = this; - }, - width: 300, - // allowEdit: false, - // format: "%Y-%X-%d", // yyyy-MM-dd - // format: "%Y/%X/%d", // yyyy/MM/dd - // format: "%Y-%x-%e", // yyyy-M-d - // format: "%Y/%x/%e", // yyyy/M/d - // format: "%X/%d/%Y", // MM/dd/yyyy - // format: "%X/%e/%y", // MM/d/yy - // format: "%X.%d.%Y", // MM.dd.yyyy - // format: "%X.%e.%Y", // MM.d.yyyy - // format: "%X-%e-%y", // MM.d.yyyy - value: { - type: 1, - value: { - year: 2018, - month: 2, - day: 23, - }, - }, - }, - { - type: "bi.button", - text: "getValue", - width: 300, - handler() { - Msg.alert("date", JSON.stringify(self.datecombo.getValue())); - }, - }, - { - type: "bi.dynamic_date_time_combo", - ref() { - self.datetimecombo = this; - }, - width: 300, - // allowEdit: false, - // format: "%Y-%X-%d %H:%M:%S", // yyyy-MM-dd HH:mm:ss - // format: "%Y/%X/%d %H:%M:%S", // yyyy/MM/dd HH:mm:ss - // format: "%Y-%X-%d %I:%M:%S", // yyyy-MM-dd hh:mm:ss - // format: "%Y/%X/%d %I:%M:%S", // yyyy/MM/dd hh:mm:ss - // format: "%Y-%X-%d %H:%M:%S %p", // yyyy-MM-dd HH:mm:ss a - // format: "Y/%X/%d %H:%M:%S %p", // yyyy/MM/dd HH:mm:ss a - // format: "%Y-%X-%d %I:%M:%S %p", // yyyy-MM-dd hh:mm:ss a - // format: "%Y/%X/%d %I:%M:%S %p", // yyyy/MM/dd hh:mm:ss a - // format: "%X/%d/%Y %I:%M:%S", // MM/dd/yyyy hh:mm:ss - // format: "%X/%d/%Y %H:%M:%S", // MM/dd/yyyy HH:mm:ss - // format: "%X/%d/%Y %I:%M:%S", // MM/dd/yyyy hh:mm:ss a - // format: "%X/%d/%Y %H:%M:%S %p", // MM/dd/yyyy HH:mm:ss a - // format: "%X/%d/%Y %I:%M:%S %p", // MM/dd/yyyy hh:mm:ss a - // format: "%X/%d/%Y %H:%M:%S %p", // MM/dd/yyyy HH:mm:ss a - // format: "%X/%d/%Y %l:%M %p", // MM/dd/yyyy h:mm a - // format: "%X-%d-%Y %k:%M %p", // MM/dd/yyyy H:mm a - // format: "%Y-%x-%e %l:%M", // yyyy-M-d h:mm - // format: "%Y-%x-%e %k:%M", // yyyy-M-d H:mm - value: { - type: 1, - value: { - year: 2018, - month: 2, - day: 23, - }, - }, - }, - { - type: "bi.button", - text: "getValue", - width: 300, - handler() { - Msg.alert("date", JSON.stringify(self.datetimecombo.getValue())); - }, - }, - { - type: "bi.button", - text: "setValue '2017-12-31'", - width: 300, - handler() { - self.datecombo.setValue({ - year: 2017, - month: 11, - day: 31, - }); - }, - } - ], - }; - } -} diff --git a/demo/js/widget/datetime/demo.datetime.js b/demo/js/widget/datetime/demo.datetime.js deleted file mode 100644 index da6b22f47..000000000 --- a/demo/js/widget/datetime/demo.datetime.js +++ /dev/null @@ -1,57 +0,0 @@ -import { shortcut, Widget, print } from "@/core"; -import { Msg } from "@/base"; -import { DateTimeCombo } from "@/widget"; - -@shortcut() -export class CustomDateTime extends Widget { - static xtype = "demo.date_time"; - - props = {}; - - render() { - const self = this; - - return { - type: "bi.absolute", - items: [ - { - el: { - type: "bi.date_time_combo", - listeners: [ - { - eventName: DateTimeCombo.EVENT_CONFIRM, - action() { - const value = this.getValue(); - const date = new Date( - value.year, - value.month - 1, - value.day, - value.hour, - value.minute, - value.second - ); - const dateStr = print(date, "%Y-%X-%d %H:%M:%S"); - Msg.alert("日期", dateStr); - }, - }, - { - eventName: DateTimeCombo.EVENT_CANCEL, - action() {}, - } - ], - value: { - year: 2017, - month: 2, - day: 23, - hour: 12, - minute: 11, - second: 1, - }, - }, - top: 200, - left: 200, - } - ], - }; - } -} diff --git a/demo/js/widget/downlist/demo.downlist.icon.js b/demo/js/widget/downlist/demo.downlist.icon.js deleted file mode 100644 index 23bca0db3..000000000 --- a/demo/js/widget/downlist/demo.downlist.icon.js +++ /dev/null @@ -1,13 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class CustomIcon extends Widget { - static xtype = "demo.downlist.icon"; - - render() { - return { - type: "bi.label", - text: "✨", - }; - } -} diff --git a/demo/js/widget/downlist/demo.downlist.js b/demo/js/widget/downlist/demo.downlist.js deleted file mode 100644 index 4ac1d0936..000000000 --- a/demo/js/widget/downlist/demo.downlist.js +++ /dev/null @@ -1,267 +0,0 @@ -import { shortcut, Widget, i18nText } from "@/core"; -import { DownListCombo } from "@/widget"; - -@shortcut() -export class Downlist extends Widget { - static xtype = "demo.down_list"; - - props = { baseCls: "demo-downlist" }; - - mounted() { - const downlist = this.downlist; - const label = this.label; - this.downlist.setValue([ - { - value: [11, 6], - childValue: 67, - } - ]); - downlist.on(DownListCombo.EVENT_CHANGE, (value, fatherValue) => { - label.setValue(JSON.stringify(downlist.getValue())); - }); - - this.downlist.on(DownListCombo.EVENT_SON_VALUE_CHANGE, (value, fatherValue) => { - label.setValue(JSON.stringify(downlist.getValue())); - }); - } - - render() { - const self = this; - - return { - type: "bi.left", - items: [ - { - type: "bi.down_list_combo", - ref (_ref) { - self.downlist = _ref; - }, - // value: [{"childValue":22,"value":11},{"value":18},{"value":20}], - height: 30, - width: 100, - items: [ - [ - { - text: "column 1111", - iconCls1: "dot-e-font", - value: 12, - children: [ - { - text: "column 1.1", - value: 21, - cls: "dot-e-font", - }, - { - text: "column 1.2", - value: 22, - cls: "dot-e-font", - } - ], - } - ], - [ - { - el: { - text: "column 1111", - iconCls1: "dot-e-font", - value: 11, - }, - children: [ - { - text: "column 1.1", - value: 21, - cls: "dot-e-font", - }, - { - text: "column 1.2", - value: 22, - cls: "dot-e-font", - } - ], - // children: [{ - // text: i18nText("BI-Basic_None"), - // cls: "dot-e-font", - // value: 1 - // }, { - // text: i18nText("BI-Basic_Calculate_Same_Period"), - // cls: "dot-e-font", - // value: 2 - // }, { - // text: i18nText("BI-Basic_Calculate_Same_Ring"), - // cls: "dot-e-font", - // value: 3 - // }, { - // text: i18nText("BI-Basic_Calculate_Same_Period_Rate"), - // cls: "dot-e-font", - // value: 4 - // }, { - // text: i18nText("BI-Basic_Calculate_Same_Ring_Rate"), - // cls: "dot-e-font", - // value: 5 - // }, { - // el: { - // text: i18nText("BI-Basic_Rank"), - // iconCls1: "dot-e-font", - // value: 6 - // }, - // children: [{ - // text: "test1", - // cls: "dot-e-font", - // value: 67 - // }, { - // text: "test2", - // cls: "dot-e-font", - // value: 68 - // }] - // }, { - // text: i18nText("BI-Basic_Rank_In_Group"), - // cls: "dot-e-font", - // value: 7 - // }, { - // text: i18nText("BI-Basic_Sum_Of_All"), - // cls: "dot-e-font", - // value: 8 - // }, { - // text: i18nText("BI-Basic_Sum_Of_All_In_Group"), - // cls: "dot-e-font", - // value: 9 - // }, { - // text: i18nText("BI-Basic_Sum_Of_Above"), - // cls: "dot-e-font", - // value: 10 - // }, { - // text: i18nText("BI-Basic_Sum_Of_Above_In_Group"), - // cls: "dot-e-font", - // value: 11 - // }, { - // text: i18nText("BI-Design_Current_Dimension_Percent"), - // cls: "dot-e-font", - // value: 12 - // }, { - // text: i18nText("BI-Design_Current_Target_Percent"), - // cls: "dot-e-font", - // value: 13 - // }] - } - ] - ], - }, - { - type: "bi.down_list_combo", - el: { - type: "bi.button", - ghost: true, - iconPosition: "right", - icon: "column-next-page-h-font", - text: "自定义 trigger 和 icon 的级联下拉框", - }, - listeners: [ - { - eventName: "EVENT_CHANGE", - action (v) { - console.log("触发值", v); - }, - }, - { - eventName: "EVENT_SON_VALUE_CHANGE", - action (v) { - console.log("二级菜单触发值", v); - }, - } - ], - items: [ - [ - { - text: "选项一", - value: 1, - icon: { - type: "demo.downlist.icon", - }, - children: [ - { - text: "选项一", - value: 11, - icon: { - type: "demo.downlist.icon", - }, - }, - { - text: "选项二", - value: 12, - } - ], - }, - { - text: "选项二", - value: 2, - } - ] - ], - }, - { - type: "bi.multi_layer_down_list_combo", - ref (_ref) { - self.downlist = _ref; - }, - // value: [{"childValue":22,"value":11},{"value":18},{"value":20}], - height: 30, - width: 100, - items: [ - [ - { - el: { - text: "column 1111", - iconCls1: "dot-e-font", - value: 12, - }, - children: [ - { - text: "column 1.1", - value: 21, - cls: "dot-e-font", - }, - { - text: "column 1.2", - value: 22, - cls: "dot-e-font", - } - ], - } - ], - [ - { - el: { - text: "column 1111", - iconCls1: "dot-e-font", - value: 11, - }, - children: [ - { - text: "column 1.1", - value: 21, - cls: "dot-e-font", - }, - { - text: "column 1.2", - value: 22, - cls: "dot-e-font", - } - ], - } - ] - ], - }, - { - type: "bi.label", - text: "显示选择值", - width: 500, - cls: "layout-bg3", - ref (_ref) { - self.label = _ref; - }, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/editor/demo.search_editor.js b/demo/js/widget/editor/demo.search_editor.js deleted file mode 100644 index 0b0b516cc..000000000 --- a/demo/js/widget/editor/demo.search_editor.js +++ /dev/null @@ -1,31 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class SearchEditor extends Widget { - static xtype = "demo.search_editor"; - - props = { baseCls: "demo-exceltable" }; - - render() { - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.search_editor", - width: 300, - watermark: "添加合法性判断", - errorText: "长度必须大于4", - validationChecker() { - return this.getValue().length > 4; - }, - }, - { - type: "bi.small_search_editor", - width: 300, - watermark: "这个是 small,小一号", - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/editor/demo.text_editor.js b/demo/js/widget/editor/demo.text_editor.js deleted file mode 100644 index 231beb714..000000000 --- a/demo/js/widget/editor/demo.text_editor.js +++ /dev/null @@ -1,29 +0,0 @@ -import { shortcut, Widget } from "@/core"; - -@shortcut() -export class TextEditor extends Widget { - static xtype = "demo.text_editor"; - - props = { baseCls: "demo-exceltable" }; - - render() { - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.text_editor", - watermark: "这是水印,watermark", - width: 300, - }, - { - type: "bi.text_editor", - watermark: "这个不予许空", - allowBlank: false, - errorText: "非空!", - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/index.js b/demo/js/widget/index.js deleted file mode 100644 index db5525e6e..000000000 --- a/demo/js/widget/index.js +++ /dev/null @@ -1,23 +0,0 @@ -export * from "./basewidget"; -export * from "./collapase"; -export * from "./date"; -export * from "./datetime"; -export * from "./downlist"; -export * from "./editor"; -export * from "./multiselect"; -export * from "./multiselect"; -export * from "./multitree"; -export * from "./numbereditor"; -export * from "./numberinterval"; -export * from "./selecttree"; -export * from "./singleselct"; -export * from "./slider"; -export * from "./timecombo"; -export * from "./timeinterval"; -export * from "./tree"; -export * from "./year"; -export * from "./yearinterval"; -export * from "./yearmonth"; -export * from "./yearmonthinterval"; -export * from "./yearquarter"; -export * from "./yearquarterinterval"; \ No newline at end of file diff --git a/demo/js/widget/multiselect/demo.multi_select_combo.js b/demo/js/widget/multiselect/demo.multi_select_combo.js deleted file mode 100644 index e6483ffae..000000000 --- a/demo/js/widget/multiselect/demo.multi_select_combo.js +++ /dev/null @@ -1,96 +0,0 @@ -import { shortcut, Widget, Func, createWidget, bind, each, makeObject, filter, delay } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class MultiSelectCombo extends Widget { - static xtype = "demo.multi_select_combo"; - - props = { baseCls: "demo-multi-select-combo" }; - - _createMultiSelectCombo() { - const self = this; - const widget = createWidget({ - type: "bi.multi_select_insert_combo", - // allowEdit: false, - itemsCreator: bind(this._itemsCreator, this), - width: 200, - value: { - type: 1, - value: [ - "柳州市城贸金属材料有限责任公司", - "柳州市建福房屋租赁有限公司", - "柳州市迅昌数码办公设备有限责任公司" - ], - }, - }); - - widget.on(MultiSelectCombo.EVENT_CONFIRM, function () { - Msg.toast(JSON.stringify(this.getValue())); - }); - - return widget; - } - - _getItemsByTimes(items, times) { - const res = []; - for (let i = (times - 1) * 100; items[i] && i < times * 100; i++) { - res.push(items[i]); - } - - return res; - } - - _hasNextByTimes(items, times) { - return times * 100 < items.length; - } - - _itemsCreator(options, callback) { - const self = this; - let items = Demo.CONSTANTS.ITEMS; - const keywords = (options.keywords || []).slice(); - if (options.keyword) { - keywords.push(options.keyword); - } - each(keywords, (i, kw) => { - const search = Func.getSearchResult(items, kw); - items = search.match.concat(search.find); - }); - if (options.selectedValues) { - // 过滤 - const filter = makeObject(options.selectedValues, true); - items = filter(items, (i, ob) => !filter[ob.value]); - } - if (options.type == MultiSelectCombo.REQ_GET_ALL_DATA) { - callback({ - items, - }); - - return; - } - if (options.type == MultiSelectCombo.REQ_GET_DATA_LENGTH) { - callback({ count: items.length }); - - return; - } - delay(() => { - callback({ - items: self._getItemsByTimes(items, options.times), - hasNext: self._hasNextByTimes(items, options.times), - }); - }, 1000); - } - - render() { - return { - type: "bi.absolute", - scrolly: false, - items: [ - { - el: this._createMultiSelectCombo(), - right: "50%", - top: 10, - } - ], - }; - } -} diff --git a/demo/js/widget/multiselect/demo.multi_select_list.js b/demo/js/widget/multiselect/demo.multi_select_list.js deleted file mode 100644 index 87254dd1c..000000000 --- a/demo/js/widget/multiselect/demo.multi_select_list.js +++ /dev/null @@ -1,104 +0,0 @@ -import { shortcut, Widget, createWidget, Func, bind, each, makeObject, filter, delay } from "@/core"; -import { Msg } from "@/base"; -import { MultiSelectCombo } from "@/widget"; - -@shortcut() -export class MultiSelectList extends Widget { - static xtype = "demo.multi_select_list"; - - props = { baseCls: "demo-multi-select-combo" }; - - mounted() { - this.list.populate(); - } - - _createMultiSelectCombo() { - const self = this; - const widget = createWidget({ - type: "bi.multi_select_insert_list", - ref(ref) { - self.list = ref; - }, - itemsCreator: bind(this._itemsCreator, this), - value: { - type: 1, - value: [ - "柳州市城贸金属材料有限责任公司", - "柳州市建福房屋租赁有限公司", - "柳州市迅昌数码办公设备有限责任公司" - ], - }, - }); - - widget.on(MultiSelectCombo.EVENT_CONFIRM, function () { - Msg.toast(JSON.stringify(this.getValue())); - }); - - return widget; - } - - _getItemsByTimes(items, times) { - const res = []; - for (let i = (times - 1) * 10; items[i] && i < times * 10; i++) { - res.push(items[i]); - } - - return res; - } - - _hasNextByTimes(items, times) { - return times * 10 < items.length; - } - - _itemsCreator(options, callback) { - const self = this; - let items = Demo.CONSTANTS.ITEMS; - const keywords = (options.keywords || []).slice(); - if (options.keyword) { - keywords.push(options.keyword); - } - each(keywords, (i, kw) => { - const search = Func.getSearchResult(items, kw); - items = search.match.concat(search.find); - }); - if (options.selectedValues) { - // 过滤 - const filter = makeObject(options.selectedValues, true); - items = filter(items, (i, ob) => !filter[ob.value]); - } - if (options.type == MultiSelectCombo.REQ_GET_ALL_DATA) { - callback({ - items, - }); - - return; - } - if (options.type == MultiSelectCombo.REQ_GET_DATA_LENGTH) { - callback({ count: items.length }); - - return; - } - delay(() => { - callback({ - items: self._getItemsByTimes(items, options.times), - hasNext: self._hasNextByTimes(items, options.times), - }); - }, 1000); - } - - render() { - return { - type: "bi.absolute", - scrolly: false, - items: [ - { - el: this._createMultiSelectCombo(), - top: 50, - left: 50, - right: 50, - bottom: 50, - } - ], - }; - } -} diff --git a/demo/js/widget/multitree/demo.multi_tree_combo.js b/demo/js/widget/multitree/demo.multi_tree_combo.js deleted file mode 100644 index b6b9fcbbb..000000000 --- a/demo/js/widget/multitree/demo.multi_tree_combo.js +++ /dev/null @@ -1,67 +0,0 @@ -import { shortcut, Widget, deepClone } from "@/core"; -import { Msg } from "@/base"; -import { TreeView } from "@/case"; - -@shortcut() -export class MultiTreeCombo extends Widget { - static xtype = "demo.multi_tree_combo"; - - props = { baseCls: "" }; - - render() { - const self = this; - const items = deepClone(Demo.CONSTANTS.TREE); - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.multi_tree_combo", - ref(_ref) { - self.tree = _ref; - }, - itemsCreator(options, callback) { - console.log(options); - // 根据不同的类型处理相应的结果 - switch (options.type) { - case TreeView.REQ_TYPE_INIT_DATA: - break; - case TreeView.REQ_TYPE_ADJUST_DATA: - break; - case TreeView.REQ_TYPE_SELECT_DATA: - break; - case TreeView.REQ_TYPE_GET_SELECTED_DATA: - break; - default: - break; - } - callback({ - items, - }); - }, - width: 300, - value: { - 根目录: {}, - }, - listeners: [ - { - eventName: "EVENT_CONFIRM", - action() { - console.log("EVENT_CONFIRM", this.getValue()); - }, - } - ], - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.tree.getValue())); - }, - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/multitree/demo.multi_tree_list.js b/demo/js/widget/multitree/demo.multi_tree_list.js deleted file mode 100644 index 836a32b6e..000000000 --- a/demo/js/widget/multitree/demo.multi_tree_list.js +++ /dev/null @@ -1,73 +0,0 @@ -import { shortcut, Widget, deepClone } from "@/core"; -import { Msg } from "@/base"; -import { TreeView } from "@/case"; - -@shortcut() -export class MultiTreeCombo extends Widget { - static xtype = "demo.multi_select_tree"; - - props = { baseCls: "" }; - - mounted() { - this.tree.populate(); - } - - render() { - const self = this; - const items = deepClone(Demo.CONSTANTS.TREE); - - return { - type: "bi.absolute", - items: [ - { - el: { - type: "bi.multi_select_tree", - ref(_ref) { - self.tree = _ref; - }, - itemsCreator(options, callback) { - console.log(options); - // 根据不同的类型处理相应的结果 - switch (options.type) { - case TreeView.REQ_TYPE_INIT_DATA: - break; - case TreeView.REQ_TYPE_ADJUST_DATA: - break; - case TreeView.REQ_TYPE_SELECT_DATA: - break; - case TreeView.REQ_TYPE_GET_SELECTED_DATA: - break; - default: - break; - } - callback({ - items: deepClone(items), - }); - }, - width: 300, - value: { - 根目录: {}, - }, - }, - top: 50, - bottom: 50, - left: 50, - right: 50, - }, - { - el: { - type: "bi.button", - height: 30, - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.tree.getValue())); - }, - }, - left: 50, - right: 50, - bottom: 20, - } - ], - }; - } -} diff --git a/demo/js/widget/numbereditor/demo.number_editor.js b/demo/js/widget/numbereditor/demo.number_editor.js deleted file mode 100644 index 898a57bf8..000000000 --- a/demo/js/widget/numbereditor/demo.number_editor.js +++ /dev/null @@ -1,67 +0,0 @@ -import { shortcut, Widget, createWidget, parseFloat } from "@/core"; -import { Msg } from "@/base"; -import { NumberEditor } from "@/widget"; - -@shortcut() -export class FileManager extends Widget { - static xtype = "demo.number_editor"; - - props = { baseCls: "" }; - - render() { - const editor1 = createWidget({ - type: "bi.number_editor", - validationChecker(v) { - return parseFloat(v) <= 100 && parseFloat(v) >= 0; - }, - height: 24, - width: 150, - errorText: "hahah", - watermark: "每个人都是自己健康的第一责任人", - }); - editor1.on(NumberEditor.EVENT_CHANGE, function () { - if (parseFloat(this.getValue()) < 1) { - editor1.setDownEnable(false); - } else { - editor1.setDownEnable(true); - } - Msg.toast(editor1.getValue()); - }); - - const editor2 = createWidget({ - type: "bi.number_editor", - validationChecker(v) { - return parseFloat(v) <= 100 && parseFloat(v) >= 0; - }, - valueFormatter: v => `${v}$`, - valueParser: v => v.replace(/\$\s?|(,*)/g, ""), - height: 24, - width: 150, - errorText: "hahah", - }); - editor2.on(NumberEditor.EVENT_CHANGE, function () { - if (parseFloat(this.getValue()) < 1) { - editor2.setDownEnable(false); - } else { - editor2.setDownEnable(true); - } - Msg.toast(editor2.getValue()); - }); - - return { - type: "bi.vertical", - hgap: 20, - vgap: 20, - items: [ - { - el: editor1, - height: 24, - }, - { - el: editor2, - height: 24, - } - ], - }; - } -} diff --git a/demo/js/widget/numberinterval/demo.number_interval.js b/demo/js/widget/numberinterval/demo.number_interval.js deleted file mode 100644 index 8ff722b02..000000000 --- a/demo/js/widget/numberinterval/demo.number_interval.js +++ /dev/null @@ -1,51 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { NumberInterval } from "@/widget"; - -@shortcut() -export class NumericalInterval extends Widget { - static xtype = "demo.number_interval"; - - props = { baseCls: "demo-exceltable" }; - - mounted() { - const numerical = this.numerical; - const label = this.label; - numerical.on(NumberInterval.EVENT_CONFIRM, () => { - const temp = numerical.getValue(); - const res = `大于${temp.closemin ? "等于 " : " "}${temp.min} 小于${temp.closemax ? "等于 " : " "}${ - temp.max - }`; - label.setValue(res); - }); - } - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.number_interval", - ref(_ref) { - self.numerical = _ref; - }, - width: 500, - value: { - max: 300, - closeMax: true, - closeMin: false, - }, - }, - { - type: "bi.label", - ref(_ref) { - self.label = _ref; - }, - text: "显示结果", - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js b/demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js deleted file mode 100644 index 944431a89..000000000 --- a/demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js +++ /dev/null @@ -1,47 +0,0 @@ -import { shortcut, Widget, deepClone } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class MultiLayerSelectTreeCombo extends Widget { - static xtype = "demo.multilayer_select_tree_combo"; - - props = { baseCls: "" }; - - render() { - const self = this; - const items = deepClone(Demo.CONSTANTS.TREE); - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.multilayer_select_tree_combo", - ref(_ref) { - self.tree = _ref; - }, - defaultText: "请选择", - items, - width: 300, - value: ["第五级文件1"], - }, - { - type: "bi.button", - text: "getVlaue", - handler() { - Msg.toast(self.tree.getValue()[0]); - }, - width: 300, - }, - { - type: "bi.button", - text: "setVlaue (第二级文件1)", - handler() { - self.tree.setValue(["11"]); - }, - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/selecttree/demo.select_tree_combo.js b/demo/js/widget/selecttree/demo.select_tree_combo.js deleted file mode 100644 index 66d69983d..000000000 --- a/demo/js/widget/selecttree/demo.select_tree_combo.js +++ /dev/null @@ -1,47 +0,0 @@ -import { shortcut, Widget, deepClone } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class SelectTreeCombo extends Widget { - static xtype = "demo.select_tree_combo"; - - props = { baseCls: "demo-exceltable" }; - - render() { - const self = this; - const items = deepClone(Demo.CONSTANTS.LEVELTREE); - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.select_tree_combo", - ref(_ref) { - self.tree = _ref; - }, - value: "11", - text: "默认值", - items, - width: 300, - }, - { - type: "bi.button", - text: "getVlaue", - handler() { - Msg.toast(self.tree.getValue()[0]); - }, - width: 300, - }, - { - type: "bi.button", - text: "setVlaue (11)", - handler() { - self.tree.setValue(["2"]); - }, - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/singleselct/demo.single_select_combo.js b/demo/js/widget/singleselct/demo.single_select_combo.js deleted file mode 100644 index fea2603bf..000000000 --- a/demo/js/widget/singleselct/demo.single_select_combo.js +++ /dev/null @@ -1,103 +0,0 @@ -import { shortcut, Widget, Func } from "@/core"; - -@shortcut() -export class SingleSelectCombo extends Widget { - static xtype = "demo.single_select_combo"; - - props = { baseCls: "demo-single-select-combo" }; - - _createSingleSelectCombo() { - const self = this; - const widget = createWidget({ - type: "bi.single_select_combo", - itemsCreator: bind(this._itemsCreator, this), - width: 200, - ref() { - self.SingleSelectCombo = this; - }, - value: "柳州市针织总厂", - }); - - widget.populate(); - - widget.on(SingleSelectCombo.EVENT_CONFIRM, function () { - Msg.toast(JSON.stringify(this.getValue())); - }); - - return widget; - } - - _getItemsByTimes(items, times) { - const res = []; - for (let i = (times - 1) * 100; items[i] && i < times * 100; i++) { - res.push(items[i]); - } - - return res; - } - - _hasNextByTimes(items, times) { - return times * 100 < items.length; - } - - _itemsCreator(options, callback) { - const self = this; - let items = Demo.CONSTANTS.ITEMS; - const keywords = (options.keywords || []).slice(); - if (options.keyword) { - keywords.push(options.keyword); - } - each(keywords, (i, kw) => { - const search = Func.getSearchResult(items, kw); - items = search.match.concat(search.find); - }); - if (options.selectedValues) { - // 过滤 - const filter = makeObject(options.selectedValues, true); - items = filter(items, (i, ob) => !filter[ob.value]); - } - if (options.type == SingleSelectCombo.REQ_GET_ALL_DATA) { - callback({ - items, - }); - - return; - } - if (options.type == SingleSelectCombo.REQ_GET_DATA_LENGTH) { - callback({ count: items.length }); - - return; - } - delay(() => { - callback({ - items: self._getItemsByTimes(items, options.times), - hasNext: self._hasNextByTimes(items, options.times), - }); - }, 1000); - } - - render() { - const self = this; - - return { - type: "bi.absolute", - scrolly: false, - items: [ - { - el: this._createSingleSelectCombo(), - right: "50%", - top: 10, - }, - { - el: { - type: "bi.button", - text: "setValue(\"柳州市针织总厂\")", - handler() { - self.SingleSelectCombo.setValue("柳州市针织总厂"); - }, - }, - } - ], - }; - } -} diff --git a/demo/js/widget/singletree/demo.multilayer_single_tree_combo.js b/demo/js/widget/singletree/demo.multilayer_single_tree_combo.js deleted file mode 100644 index df283e47a..000000000 --- a/demo/js/widget/singletree/demo.multilayer_single_tree_combo.js +++ /dev/null @@ -1,46 +0,0 @@ -import { shortcut, Widget, deepClone } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class MultiLayerSingleTreeCombo extends Widget { - static xtype = "demo.multilayer_single_tree_combo"; - - props = { baseCls: "" }; - - render() { - const self = this; - const items = deepClone(Demo.CONSTANTS.TREE); - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.multilayer_single_tree_combo", - ref(_ref) { - self.tree = _ref; - }, - defaultText: "请选择", - items, - width: 300, - }, - { - type: "bi.button", - text: "getVlaue", - handler() { - Msg.toast(self.tree.getValue()[0]); - }, - width: 300, - }, - { - type: "bi.button", - text: "setVlaue (11)", - handler() { - self.tree.setValue(["11"]); - }, - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/singletree/demo.single_tree_combo.js b/demo/js/widget/singletree/demo.single_tree_combo.js deleted file mode 100644 index 736f52f3e..000000000 --- a/demo/js/widget/singletree/demo.single_tree_combo.js +++ /dev/null @@ -1,47 +0,0 @@ -import { shortcut, Widget, deepClone } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class SingleTreeCombo extends Widget { - static xtype = "demo.single_tree_combo"; - - props = { baseCls: "demo-exceltable" }; - - render() { - const self = this; - const items = deepClone(Demo.CONSTANTS.LEVELTREE); - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.single_tree_combo", - ref(_ref) { - self.tree = _ref; - }, - defaultText: "请选择", - items, - width: 300, - value: "11", - }, - { - type: "bi.button", - text: "getVlaue", - handler() { - Msg.toast(self.tree.getValue()[0]); - }, - width: 300, - }, - { - type: "bi.button", - text: "setVlaue (第二级文件1)", - handler() { - self.tree.setValue(["2"]); - }, - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/slider/demo.slider.js b/demo/js/widget/slider/demo.slider.js deleted file mode 100644 index 78276fc32..000000000 --- a/demo/js/widget/slider/demo.slider.js +++ /dev/null @@ -1,127 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; -import { SingleSlider, SingleSliderNormal } from "@/widget"; - -@shortcut() -export class Slider extends Widget { - static xtype = "demo.slider"; - - props = { baseCls: "demo-slider", width: 300, height: 50, min: 0, max: 100 }; - - render() { - const self = this, - o = this.options; - const singleSlider = createWidget({ - type: "bi.single_slider", - digit: 0, - width: o.width, - height: o.height, - cls: "layout-bg-white", - value: 30, - min: 10, - max: 100, - }); - singleSlider.on(SingleSlider.EVENT_CHANGE, function () { - console.log(this.getValue()); - }); - - const normalSingleSlider = createWidget({ - type: "bi.single_slider_normal", - width: o.width, - height: 30, - cls: "layout-bg-white", - min: o.min, - max: o.max, - value: 30, - }); - normalSingleSlider.on(SingleSliderNormal.EVENT_DRAG, function () { - console.log(this.getValue()); - }); - - const singleSliderLabel = createWidget({ - type: "bi.single_slider_label", - width: o.width, - height: o.height, - digit: 0, - unit: "个", - cls: "layout-bg-white", - min: o.min, - max: o.max, - value: 10, - }); - - const intervalSlider = createWidget({ - type: "bi.interval_slider", - width: o.width, - digit: 0, - cls: "layout-bg-white", - min: o.min, - max: o.max, - value: { - min: 10, - max: 70, - }, - }); - - const intervalSliderLabel = createWidget({ - type: "bi.interval_slider", - width: o.width, - unit: "px", - cls: "layout-bg-white", - digit: 1, - min: 0, - max: 120, - value: { - min: 60, - max: 120, - }, - }); - - return { - type: "bi.vertical", - element: this, - items: [ - { - type: "bi.center_adapt", - items: [ - { - el: singleSlider, - } - ], - }, - { - type: "bi.center_adapt", - items: [ - { - el: normalSingleSlider, - } - ], - }, - { - type: "bi.center_adapt", - items: [ - { - el: singleSliderLabel, - } - ], - }, - { - type: "bi.center_adapt", - items: [ - { - el: intervalSlider, - } - ], - }, - { - type: "bi.center_adapt", - items: [ - { - el: intervalSliderLabel, - } - ], - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/timecombo/demo.timecombo.js b/demo/js/widget/timecombo/demo.timecombo.js deleted file mode 100644 index 6257b40dd..000000000 --- a/demo/js/widget/timecombo/demo.timecombo.js +++ /dev/null @@ -1,51 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class TimeCombo extends Widget { - static xtype = "demo.time_combo"; - - props = { baseCls: "" }; - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.time_combo", - ref(_ref) { - self.timeCombo = _ref; - }, - // allowEdit: true, - // format: "%H:%M:%S", // HH:mm:ss - // format: "%I:%M:%S", // hh:mm:ss - // format: "%l:%M:%S", // h:mm:ss - // format: "%k:%M:%S", // H:mm:ss - // format: "%l:%M:%S %p", // h:mm:ss a - // format: "%l:%M", // h:mm - // format: "%k:%M", // H:mm - // format: "%I:%M", // hh:mm - // format: "%H:%M", // HH:mm - // format: "%M:%S", // mm:ss - value: { - hour: 12, - minute: 0, - second: 0, - }, - width: 300, - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.timeCombo.getValue())); - }, - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/timeinterval/demo.time_interval.js b/demo/js/widget/timeinterval/demo.time_interval.js deleted file mode 100644 index 81fb79933..000000000 --- a/demo/js/widget/timeinterval/demo.time_interval.js +++ /dev/null @@ -1,112 +0,0 @@ -import { shortcut, Widget, deepClone } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class TimeInterval extends Widget { - static xtype = "demo.time_interval"; - - props = { baseCls: "" }; - - render() { - const self = this; - const items = deepClone(Demo.CONSTANTS.TREE); - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.date_interval", - ref(_ref) { - self.dateInterval = _ref; - }, - value: { - start: { - type: 2, - value: { - year: -1, - position: 2, - }, - }, - end: { - type: 1, - value: { - year: 2018, - month: 1, - day: 12, - }, - }, - }, - width: 300, - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.dateInterval.getValue())); - }, - width: 300, - }, - { - type: "bi.time_interval", - ref(_ref) { - self.interval = _ref; - }, - value: { - start: { - type: 2, - value: { - year: -1, - position: 2, - }, - }, - end: { - type: 1, - value: { - year: 2018, - month: 1, - day: 12, - }, - }, - }, - width: 400, - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.interval.getValue())); - }, - width: 300, - }, - { - type: "bi.time_periods", - value: { - start: { - hour: 7, - minute: 23, - second: 14, - }, - end: { - hour: 23, - minute: 34, - second: 32, - }, - }, - ref(_ref) { - self.periods = _ref; - }, - width: 180, - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.periods.getValue())); - }, - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/tree/demo.multilayer_select_level_tree.js b/demo/js/widget/tree/demo.multilayer_select_level_tree.js deleted file mode 100644 index c4950e1eb..000000000 --- a/demo/js/widget/tree/demo.multilayer_select_level_tree.js +++ /dev/null @@ -1,49 +0,0 @@ -import { shortcut, Widget, createWidget, deepClone } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class MultiLayerSelectLevelTree extends Widget { - static xtype = "demo.multilayer_select_level_tree"; - - render() { - const self = this; - const tree = createWidget({ - type: "bi.multilayer_select_level_tree", - items: deepClone(Demo.CONSTANTS.TREE), - value: "第五级文件1", - }); - - return { - type: "bi.vtape", - items: [ - { - el: tree, - }, - { - el: { - type: "bi.button", - height: 25, - text: "getValue", - handler() { - Msg.alert("", JSON.stringify(tree.getValue())); - }, - }, - height: 25, - }, - { - el: { - type: "bi.button", - height: 25, - text: "setValue (第二级文件1)", - handler() { - tree.setValue(["11"]); - }, - }, - height: 25, - } - ], - width: 500, - hgap: 300, - }; - } -} diff --git a/demo/js/widget/tree/demo.multilayer_single_level_tree.js b/demo/js/widget/tree/demo.multilayer_single_level_tree.js deleted file mode 100644 index de980c51a..000000000 --- a/demo/js/widget/tree/demo.multilayer_single_level_tree.js +++ /dev/null @@ -1,74 +0,0 @@ -import { shortcut, Widget, createWidget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class MultiLayerSingleLevelTree extends Widget { - static xtype = "demo.multilayer_single_level_tree"; - - render() { - const self = this; - this.tree = createWidget({ - type: "bi.multilayer_single_level_tree", - items: [], - value: "第二级文件1", - }); - - return { - type: "bi.vtape", - items: [ - { - el: this.tree, - }, - { - el: { - type: "bi.button", - height: 25, - text: "getValue", - handler() { - Msg.alert("", JSON.stringify(self.tree.getValue())); - }, - }, - height: 25, - }, - { - el: { - type: "bi.button", - height: 25, - text: "setValue (第二级文件1)", - handler() { - self.tree.setValue(["第二级文件1"]); - }, - }, - height: 25, - } - ], - width: 500, - hgap: 300, - }; - } - - mounted() { - const tree = [ - // {id: -2, pId: 0, value: "根目录1", text: "根目录1"}, - { id: -1, pId: 0, value: "根目录", text: "根目录" }, - { id: 1, pId: -1, value: "第一级目录1", text: "第一级目录1" }, - { id: 11, pId: 1, value: "第二级文件1", text: "第二级文件1" }, - { id: 12, pId: 1, value: "第二级目录2", text: "第二级目录2", disabled: true }, - { id: 121, pId: 12, value: "第三级目录1", text: "第三级目录1" }, - { id: 122, pId: 12, value: "第三级文件1", text: "第三级文件1" }, - { id: 1211, pId: 121, value: "第四级目录1", text: "第四级目录1" }, - { id: 2, pId: -1, value: "第一级目录2", text: "第一级目录2" }, - { id: 21, pId: 2, value: "第二级目录3", text: "第二级目录3" }, - { id: 22, pId: 2, value: "第二级文件2", text: "第二级文件2" }, - { id: 211, pId: 21, value: "第三级目录2", text: "第三级目录2" }, - { id: 212, pId: 21, value: "第三级文件2", text: "第三级文件2" }, - { id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1" }, - { id: 3, pId: -1, value: "第一级目录3", text: "第一级目录3" }, - { id: 31, pId: 3, value: "第二级文件2", text: "第二级文件2" }, - { id: 33, pId: 3, value: "第二级目录3", text: "第二级目录1" }, - { id: 32, pId: 3, value: "第二级文件3", text: "第二级文件3" }, - { id: 331, pId: 33, value: "第三级文件1", text: "第三级文件1" } - ]; - this.tree.populate(tree); - } -} diff --git a/demo/js/widget/tree/demo.select_level_tree.js b/demo/js/widget/tree/demo.select_level_tree.js deleted file mode 100644 index 2d920d8b2..000000000 --- a/demo/js/widget/tree/demo.select_level_tree.js +++ /dev/null @@ -1,49 +0,0 @@ -import { shortcut, Widget, createWidget, deepClone } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class SelectLevelTree extends Widget { - static xtype = "demo.select_level_tree"; - - render() { - const self = this; - const tree = createWidget({ - type: "bi.select_level_tree", - items: deepClone(Demo.CONSTANTS.LEVELTREE), - value: "11", - }); - - return { - type: "bi.vtape", - items: [ - { - el: tree, - }, - { - el: { - type: "bi.button", - height: 25, - text: "getValue", - handler() { - Msg.alert("", JSON.stringify(tree.getValue())); - }, - }, - height: 25, - }, - { - el: { - type: "bi.button", - height: 25, - text: "setValue (第二级文件1)", - handler() { - tree.setValue(["2"]); - }, - }, - height: 25, - } - ], - width: 500, - hgap: 300, - }; - } -} diff --git a/demo/js/widget/tree/demo.single_level_tree.js b/demo/js/widget/tree/demo.single_level_tree.js deleted file mode 100644 index 85af7ca6b..000000000 --- a/demo/js/widget/tree/demo.single_level_tree.js +++ /dev/null @@ -1,49 +0,0 @@ -import { shortcut, Widget, createWidget, deepClone } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class SingleLevelTree extends Widget { - static xtype = "demo.single_level_tree"; - - render() { - const self = this; - const tree = createWidget({ - type: "bi.single_level_tree", - items: deepClone(Demo.CONSTANTS.LEVELTREE), - value: "11", - }); - - return { - type: "bi.vtape", - items: [ - { - el: tree, - }, - { - el: { - type: "bi.button", - height: 25, - text: "getValue", - handler() { - Msg.alert("", JSON.stringify(tree.getValue())); - }, - }, - height: 25, - }, - { - el: { - type: "bi.button", - height: 25, - text: "setValue (第二级文件1)", - handler() { - tree.setValue(["2"]); - }, - }, - height: 25, - } - ], - width: 500, - hgap: 300, - }; - } -} diff --git a/demo/js/widget/year/demo.year.js b/demo/js/widget/year/demo.year.js deleted file mode 100644 index 540d47063..000000000 --- a/demo/js/widget/year/demo.year.js +++ /dev/null @@ -1,50 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class Year extends Widget { - static xtype = "demo.year"; - - props = { baseCls: "demo-exceltable" }; - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - vgap: 10, - items: [ - { - type: "bi.dynamic_year_combo", - width: 300, - ref() { - self.yearcombo = this; - }, - value: { - type: 1, - value: { - year: 2017, - }, - }, - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.yearcombo.getValue())); - }, - width: 300, - }, - { - type: "bi.button", - text: "setValue : 2018", - handler() { - self.yearcombo.setValue(2018); - }, - width: 300, - } - ], - vgap: 10, - }; - } -} diff --git a/demo/js/widget/yearinterval/demo.year_interval.js b/demo/js/widget/yearinterval/demo.year_interval.js deleted file mode 100644 index b8950954c..000000000 --- a/demo/js/widget/yearinterval/demo.year_interval.js +++ /dev/null @@ -1,53 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class YearInterval extends Widget { - static xtype = "demo.year_interval"; - - props = { baseCls: "" }; - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.year_interval", - ref(_ref) { - self.widget = _ref; - }, - width: 300, - minDate: "2012-01-01", - maxDate: "2013-12-31", - value: { - type: 1, - value: { - year: 2012, - }, - }, - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.widget.getValue())); - }, - width: 300, - }, - { - type: "bi.button", - text: "setValue '2017-12'", - width: 300, - handler() { - self.widget.setValue({ - year: 2017, - }); - }, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/yearmonth/demo.year_month_combo.js b/demo/js/widget/yearmonth/demo.year_month_combo.js deleted file mode 100644 index ac018af4d..000000000 --- a/demo/js/widget/yearmonth/demo.year_month_combo.js +++ /dev/null @@ -1,53 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class YearMonthCombo extends Widget { - static xtype = "demo.year_month_combo"; - - props = { baseCls: "" }; - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.dynamic_year_month_combo", - ref(_ref) { - self.widget = _ref; - }, - width: 300, - // value: { - // type: 1, - // value: { - // year: 2018, - // month: 1 - // } - // } - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.widget.getValue())); - }, - width: 300, - }, - { - type: "bi.button", - text: "setValue '2017-12'", - width: 300, - handler() { - self.widget.setValue({ - year: 2017, - month: 12, - }); - }, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/yearmonthinterval/demo.year_month_interval.js b/demo/js/widget/yearmonthinterval/demo.year_month_interval.js deleted file mode 100644 index ed3389eb3..000000000 --- a/demo/js/widget/yearmonthinterval/demo.year_month_interval.js +++ /dev/null @@ -1,51 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class YearMonthInterval extends Widget { - static xtype = "demo.year_month_interval"; - - props = { baseCls: "" }; - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.year_month_interval", - ref(_ref) { - self.interval = _ref; - }, - value: { - start: { - type: 2, - value: { - year: -1, - month: 1, - }, - }, - end: { - type: 1, - value: { - year: 2018, - month: 1, - }, - }, - }, - width: 400, - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.interval.getValue())); - }, - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/yearquarter/demo.year_quarter_combo.js b/demo/js/widget/yearquarter/demo.year_quarter_combo.js deleted file mode 100644 index 79bd8f8e7..000000000 --- a/demo/js/widget/yearquarter/demo.year_quarter_combo.js +++ /dev/null @@ -1,55 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class YearQuarterCombo extends Widget { - static xtype = "demo.year_quarter_combo"; - - props = { baseCls: "" }; - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.dynamic_year_quarter_combo", - width: 300, - ref(_ref) { - self.widget = _ref; - }, - yearBehaviors: {}, - quarterBehaviors: {}, - value: { - type: 1, - value: { - year: 2018, - quarter: 1, - }, - }, - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.widget.getValue())); - }, - width: 300, - }, - { - type: "bi.button", - text: "setVlaue '2017 季度3'", - width: 300, - handler() { - self.widget.setValue({ - year: 2017, - quarter: 3, - }); - }, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/js/widget/yearquarterinterval/demo.yearquarterinterval.js b/demo/js/widget/yearquarterinterval/demo.yearquarterinterval.js deleted file mode 100644 index b2b7f589d..000000000 --- a/demo/js/widget/yearquarterinterval/demo.yearquarterinterval.js +++ /dev/null @@ -1,53 +0,0 @@ -import { shortcut, Widget } from "@/core"; -import { Msg } from "@/base"; - -@shortcut() -export class YearQuarterInterval extends Widget { - static xtype = "demo.year_quarter_interval"; - - props = { baseCls: "" }; - - render() { - const self = this; - - return { - type: "bi.horizontal_auto", - items: [ - { - type: "bi.year_quarter_interval", - ref(_ref) { - self.interval = _ref; - }, - minDate: "2012-07-01", - maxDate: "2012-12-31", - value: { - start: { - type: 2, - value: { - year: -1, - month: 1, - }, - }, - end: { - type: 1, - value: { - year: 2018, - month: 1, - }, - }, - }, - width: 400, - }, - { - type: "bi.button", - text: "getValue", - handler() { - Msg.toast(JSON.stringify(self.interval.getValue())); - }, - width: 300, - } - ], - vgap: 20, - }; - } -} diff --git a/demo/less/center.less b/demo/less/center.less deleted file mode 100644 index b15dc85a3..000000000 --- a/demo/less/center.less +++ /dev/null @@ -1,3 +0,0 @@ -.demo-center { - -} \ No newline at end of file diff --git a/demo/less/face.less b/demo/less/face.less deleted file mode 100644 index 3e22a078b..000000000 --- a/demo/less/face.less +++ /dev/null @@ -1,11 +0,0 @@ -@import "index.less"; - -.demo-face { - .face-config { - .config-label { - font-size: 1.4rem; - } - .config-item { - } - } -} \ No newline at end of file diff --git a/demo/less/index.less b/demo/less/index.less deleted file mode 100644 index 9c7a9a367..000000000 --- a/demo/less/index.less +++ /dev/null @@ -1 +0,0 @@ -@import "../../src/less/index.less"; \ No newline at end of file diff --git a/demo/less/main.less b/demo/less/main.less deleted file mode 100644 index 87a094414..000000000 --- a/demo/less/main.less +++ /dev/null @@ -1,102 +0,0 @@ -@import "index.less"; -.layout-bg-white { - background-color: #ffffff; -} - -.layout-bg-gray { - background-color: #eeeeee; -} - -.layout-bg1 { - color: #ffffff; - background-color: #0088cc; -} - -.layout-bg2 { - color: #ffffff; - background-color: #008B8B; -} - -.layout-bg3 { - color: #ffffff; - background-color: #6495ED; -} - -.layout-bg4 { - color: #ffffff; - background-color: #ff69b4; -} - -.layout-bg5 { - color: #ffffff; - background-color: #B8860B; -} - -.layout-bg6 { - color: #ffffff; - background-color: #d9534f; -} - -.layout-bg7 { - color: #ffffff; - background-color: #ea4738; -} - -.layout-bg8 { - color: #ffffff; - background-color: #6495ed; -} - -.demo-main { - & .bg1 { - background-color: #178cdf; - } -} - -body { - background-color: @color-bi-background-normal; -} - -#wrapper { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - font-size: 1.2rem; -} - -.bi-theme-dark body { - background-color: @color-bi-background-normal-theme-dark; -} - -.demo-editor { - border: 1px solid rgb(204, 204, 204); -} - -.demo-clolor { - color: #1a1a1a; -} - -.bi-progress-bar-processor { - transition: all 0.5s ease; - -webkit-transition: all 0.5s ease; - -moz-transition: all 0.5s ease; - -o-transition: all 0.5s ease; - background: #3f8ce8; - border-radius: 2rem; - overflow: hidden; - overflow-x: hidden; - overflow-y: hidden; -} - -.bi-progress-text-bar-processor { - transition: all 0.5s ease; - -webkit-transition: all 0.5s ease; - -moz-transition: all 0.5s ease; - -o-transition: all 0.5s ease; -} - -.bi-progress-bar-bar { - border-radius: 2rem; -} diff --git a/demo/less/north.less b/demo/less/north.less deleted file mode 100644 index 12fbdb5b4..000000000 --- a/demo/less/north.less +++ /dev/null @@ -1,12 +0,0 @@ -@import "index.less"; - -.demo-north { - background-color: #3c8dbc; - & .logo { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - color: @color-bi-text; - background-color: #367fa9; - font-size: 2rem; - font-weight: 300; - } -} \ No newline at end of file diff --git a/demo/less/preview.less b/demo/less/preview.less deleted file mode 100644 index 600ec4476..000000000 --- a/demo/less/preview.less +++ /dev/null @@ -1,4 +0,0 @@ -@import "index.less"; - -.demo-preview { -} \ No newline at end of file diff --git a/demo/less/vm.less b/demo/less/vm.less deleted file mode 100644 index 45094646a..000000000 --- a/demo/less/vm.less +++ /dev/null @@ -1,123 +0,0 @@ -@import "index.less"; - -.mvc-button { - &:hover, &.hover { - .opacity(0.5); - } - &.active, &:active { - .opacity(0.5) - } -} - -.bi-set-get { - & .left-title, & .right-title { - background: #0088cc; - color: #ffffff; - } - & .left-nav { - border-bottom: 1px solid #cccccc; - &.active, &:active { - color: #ffffff; - background-color: #d9534f; - } - } -} - -.bi-local { - & .top-button { - background-color: #448eea; - color: #ffffff - } - & .bottom-label { - background-color: #EA4738; - color: #ffffff; - } - & .delete-button { - background-color: #008B8B; - color: #ffffff; - } - & .vessel-border { - border-left: 1px solid #cccccc; - border-bottom: 1px solid #cccccc; - border-right: 1px solid #cccccc; - } -} - -.bi-event { - & .title { - background: #0088cc; - color: #ffffff; - } - & .front { - background: #ADD8E6; - } - & .nav { - border: 1px solid #cccccc; - } -} - -.bi-skip-to { - color: #ffffff; - - & .red-pane { - background-color: #0088cc; - } - & .blue-pane { - background-color: #6495ED; - } - & .green-pane { - background-color: #008B8B; - } - & .yellow-pane { - background-color: #B8860B; - } -} - -.bi-change { - & .outer-text { - background-color: #0088cc; - color: #ffffff; - } - & .inner { - border-left: 1px solid #cccccc; - border-bottom: 1px solid #cccccc; - border-right: 1px solid #cccccc; - } - - & .type-first { - background-color: #008B8B; - } - - & .type-second { - background-color: #6495ED; - } - - & .type-third { - background-color: #0088cc; - } -} - -.bi-tmp { - & .tmp-button { - color: #ffffff; - background: #0088cc; - } -} - -.bi-splice-duplicate { - & .superiors-label { - color: white; - background-color: #008B8B; - } - & .sd-child { - border: 1px solid #cccccc; - & .right-button-add { - color: white; - background-color: #0088cc; - } - & .right-button-del { - color: white; - background-color: #d9534f; - } - } -} \ No newline at end of file diff --git a/demo/less/west.less b/demo/less/west.less deleted file mode 100644 index c9f6477ee..000000000 --- a/demo/less/west.less +++ /dev/null @@ -1,4 +0,0 @@ -@import "index.less"; - -.demo-west { -} diff --git a/demo/version.js b/demo/version.js deleted file mode 100644 index 8b1378917..000000000 --- a/demo/version.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/dist/README.md b/dist/README.md deleted file mode 100644 index f6a3a9ec7..000000000 --- a/dist/README.md +++ /dev/null @@ -1,31 +0,0 @@ -#### fineui.js - -整个fineui打包文件,不包括配置文件 - -#### fineui.css - -整个fineui打包文件,不包括资源文件 - -#### config.js - -配置文件,这只是一个案例,集成进系统的时候需要进行配置 - -#### resource.css - -app.css background.css icon.css font.css的合并文件,集成进系统的时候需要进行配置 - -#### router.js - -#### 路由文件,使用fineui路由的时候才需要引入 - -#### bundle.js bundle.css - -所有文件的合并文件, 主要给在线demo和文档用的 - -#### core_without_normalize.css - -不带标准化的core.css文件,只引入通用css样式的时候才需要 - -#### chart.js - -封装好的一层图表api diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js deleted file mode 100644 index dced5e166..000000000 --- a/dist/fix/fix.compact.js +++ /dev/null @@ -1,193 +0,0 @@ -;(function () { - function initWatch (vm, watch) { - vm._watchers || (vm._watchers = []); - for (var key in watch) { - var handler = watch[key]; - if (BI.isArray(handler)) { - for (var i = 0; i < handler.length; i++) { - vm._watchers.push(createWatcher(vm, key, handler[i])); - } - } else { - vm._watchers.push(createWatcher(vm, key, handler)); - } - } - BI.each(vm.$watchDelayCallbacks, function (i, watchDelayCallback) { - var innerWatch = watchDelayCallback[0]; - var innerHandler = watchDelayCallback[1]; - if (BI.isKey(innerWatch)) { - var key = innerWatch; - innerWatch = {}; - innerWatch[key] = innerHandler; - } - for (var key in innerWatch) { - var handler = innerWatch[key]; - if (BI.isArray(handler)) { - for (var i = 0; i < handler.length; i++) { - vm._watchers.push(createWatcher(vm, key, handler[i])); - } - } else { - vm._watchers.push(createWatcher(vm, key, handler)); - } - } - }); - } - - function createWatcher (vm, keyOrFn, cb, options) { - if (BI.isPlainObject(cb)) { - options = cb; - cb = cb.handler; - } - options = options || {}; - return Fix.watch(vm.model, keyOrFn, BI._.bind(cb, vm), BI.extend(options, { - store: vm.store - })); - } - - var target = null; - var targetStack = []; - - function pushTarget (_target) { - if (target) targetStack.push(target); - Fix.Model.target = target = _target; - } - - function popTarget () { - Fix.Model.target = target = targetStack.pop(); - } - - BI.Model = Fix.Model; - - var oldWatch = Fix.watch; - Fix.watch = function (model, expOrFn, cb, options) { - if (BI.isPlainObject(cb)) { - options = cb; - cb = cb.handler; - } - if (typeof cb === "string") { - cb = model[cb]; - } - return oldWatch.call(this, model, expOrFn, function () { - options && options.store && pushTarget(options.store); - try { - var res = cb.apply(this, arguments); - } catch (e) { - console.error(e); - } - options && options.store && popTarget(); - return res; - }, options); - }; - - BI.Widget.findStore = function findStore (widget) { - if (target != null) { - return target; - } - widget = widget || BI.Widget.context; - var p = widget; - while (p) { - if (p instanceof Fix.Model || p.store || p.__cacheStore) { - break; - } - p = p._parent || (p.options && p.options.element) || p._context; - } - if (p) { - if (p instanceof Fix.Model) { - return widget.__cacheStore = p; - } - widget.__cacheStore = p.store || p.__cacheStore; - return p.__cacheStore || p.store; - } - } - - function createStore () { - var needPop = false; - var workerMode = BI.Providers.getProvider("bi.provider.system").getWorkerMode(); - if (workerMode && this._worker) { - return; - } - if (this.store) { - pushTarget(this.store); - return true; - } - if (this._store || this.options._store) { - var store = BI.Widget.findStore(this.options.context || this._parent || this.options.element || this._context); - if (store) { - pushTarget(store); - needPop = true; - } - this.store = (this._store || this.options._store).call(this); - this.store && (this.store._widget = this); - needPop && popTarget(); - needPop = false; - pushTarget(this.store); - if (this.store instanceof Fix.Model) { - this.model = this.store.model; - } else { - this.model = this.store; - } - needPop = true; - } - return needPop; - } - - var _init = BI.Widget.prototype._init; - BI.Widget.prototype._init = function () { - var self = this; - var needPop = createStore.call(this); - try { - _init.apply(this, arguments); - } catch (e) { - console.error(e); - } - needPop && popTarget(); - }; - - var __initWatch = BI.Widget.prototype.__initWatch; - BI.Widget.prototype.__initWatch = function () { - __initWatch.apply(this, arguments); - var workerMode = BI.Providers.getProvider("bi.provider.system").getWorkerMode(); - if (workerMode && this._worker) { - return; - } - if (this._store) { - initWatch(this, this.watch); - } - }; - - var unMount = BI.Widget.prototype.__destroy; - BI.Widget.prototype.__destroy = function () { - try { - unMount.apply(this, arguments); - } catch (e) { - console.error(e); - } - this.store && BI.isFunction(this.store.destroy) && this.store.destroy(); - BI.each(this._watchers, function (i, unwatches) { - unwatches = BI.isArray(unwatches) ? unwatches : [unwatches]; - BI.each(unwatches, function (j, unwatch) { - unwatch(); - }); - }); - this._watchers && (this._watchers = []); - if (this.store) { - this.store._parent && (this.store._parent = null); - this.store._widget && (this.store._widget = null); - this.store = null; - } - delete this.__cacheStore; - }; - - BI._.each(["_render", "__afterRender", "_mount", "__afterMount"], function (name) { - var old = BI.Widget.prototype[name]; - old && (BI.Widget.prototype[name] = function () { - this.store && pushTarget(this.store); - try { - var res = old.apply(this, arguments); - } catch (e) { - console.error(e); - } - this.store && popTarget(); - return res; - }); - }); -}()); diff --git a/dist/fix/fix.js b/dist/fix/fix.js deleted file mode 100644 index 9a106ae7a..000000000 --- a/dist/fix/fix.js +++ /dev/null @@ -1,1419 +0,0 @@ -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : factory(global.Fix = global.Fix || {}); -})(this, function (exports) { - 'use strict'; - - function noop(a, b, c) {} - - function isNative(Ctor) { - return typeof Ctor === 'function' && /native code/.test(Ctor.toString()); - } - - var hasProto = '__proto__' in {}; - - var _toString = Object.prototype.toString; - - function isPlainObject(obj) { - return _toString.call(obj) === '[object Object]'; - } - - function isConfigurable(obj, key) { - var configurable = true; - var property = Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(obj, key); - if (property && property.configurable === false) { - configurable = false; - } - return configurable; - } - - function isExtensible(obj) { - if (Object.isExtensible) { - return Object.isExtensible(obj); - } - var name = ''; - while (obj.hasOwnProperty(name)) { - name += '?'; - } - obj[name] = true; - var returnValue = obj.hasOwnProperty(name); - delete obj[name]; - return returnValue; - } - - function remove(arr, item) { - if (arr && arr.length) { - var _index = arr.indexOf(item); - if (_index > -1) { - return arr.splice(_index, 1); - } - } - } - - // const bailRE = /[^\w.$]/ - - function parsePath(path) { - // 正常表达式比较慢,能不要的就不要了 - // if (bailRE.test(path)) { - // return - // } - var segments = path.split('.'); - return function (obj) { - for (var i = 0; i < segments.length; i++) { - if (!obj) return; - obj = obj[segments[i]]; - } - return obj; - }; - } - - var nextTick = function () { - var callbacks = []; - var pending = false; - var timerFunc = void 0; - - function nextTickHandler() { - pending = false; - var copies = callbacks.slice(0); - callbacks.length = 0; - for (var i = 0; i < copies.length; i++) { - copies[i](); - } - } - - // An asynchronous deferring mechanism. - // In pre 2.4, we used to use microtasks (Promise/MutationObserver) - // but microtasks actually has too high a priority and fires in between - // supposedly sequential events (e.g. #4521, #6690) or even between - // bubbling of the same event (#6566). Technically setImmediate should be - // the ideal choice, but it's not available everywhere; and the only polyfill - // that consistently queues the callback after all DOM events triggered in the - // same loop is by using MessageChannel. - /* istanbul ignore if */ - if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { - timerFunc = function timerFunc() { - setImmediate(nextTickHandler); - }; - } else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) || - // PhantomJS - MessageChannel.toString() === '[object MessageChannelConstructor]')) { - var channel = new MessageChannel(); - var port = channel.port2; - channel.port1.onmessage = nextTickHandler; - timerFunc = function timerFunc() { - port.postMessage(1); - }; - } else - /* istanbul ignore next */ - if (typeof Promise !== 'undefined' && isNative(Promise)) { - // use microtask in non-DOM environments, e.g. Weex - var p = Promise.resolve(); - timerFunc = function timerFunc() { - p.then(nextTickHandler); - }; - } else { - // fallback to setTimeout - timerFunc = function timerFunc() { - setTimeout(nextTickHandler, 0); - }; - } - - return function queueNextTick(cb, ctx) { - var _resolve = void 0; - callbacks.push(function () { - if (cb) { - try { - cb.call(ctx); - } catch (e) { - console.error(e); - } - } else if (_resolve) { - _resolve(ctx); - } - }); - if (!pending) { - pending = true; - timerFunc(); - } - // $flow-disable-line - if (!cb && typeof Promise !== 'undefined') { - return new Promise(function (resolve, reject) { - _resolve = resolve; - }); - } - }; - }(); - - var falsy; - var $$skipArray = { - __ob__: falsy, - $accessors: falsy, - $vbthis: falsy, - $vbsetter: falsy - }; - - var uid = 0; - - /** - * A dep is an observable that can have multiple - * directives subscribing to it. - */ - - var Dep = function () { - function Dep() { - _classCallCheck(this, Dep); - - this.id = uid++; - this.subs = []; - } - - Dep.prototype.addSub = function addSub(sub) { - this.subs.push(sub); - }; - - Dep.prototype.removeSub = function removeSub(sub) { - remove(this.subs, sub); - }; - - Dep.prototype.depend = function depend() { - if (Dep.target) { - Dep.target.addDep(this); - } - }; - - Dep.prototype.notify = function notify(options) { - // stabilize the subscriber list first - var subs = this.subs.slice(); - for (var i = 0, l = subs.length; i < l; i++) { - subs[i].update(options); - } - }; - - return Dep; - }(); - - // the current target watcher being evaluated. - // this is globally unique because there could be only one - // watcher being evaluated at any time. - - - Dep.target = null; - var targetStack = []; - - function pushTarget(_target) { - if (Dep.target) targetStack.push(Dep.target); - Dep.target = _target; - } - - function popTarget() { - Dep.target = targetStack.pop(); - } - - //如果浏览器不支持ecma262v5的Object.defineProperties或者存在BUG,比如IE8 - //标准浏览器使用__defineGetter__, __defineSetter__实现 - var canHideProperty = true; - try { - Object.defineProperty({}, '_', { - value: 'x' - }); - delete $$skipArray.$vbsetter; - delete $$skipArray.$vbthis; - } catch (e) { - /* istanbul ignore next*/ - canHideProperty = false; - } - - var createViewModel = Object.defineProperties; - var defineProperty = void 0; - - /* istanbul ignore if*/ - if (!canHideProperty) { - if ('__defineGetter__' in {}) { - defineProperty = function defineProperty(obj, prop, desc) { - if ('value' in desc) { - obj[prop] = desc.value; - } - if ('get' in desc) { - obj.__defineGetter__(prop, desc.get); - } - if ('set' in desc) { - obj.__defineSetter__(prop, desc.set); - } - return obj; - }; - createViewModel = function createViewModel(obj, descs) { - for (var prop in descs) { - if (descs.hasOwnProperty(prop)) { - defineProperty(obj, prop, descs[prop]); - } - } - return obj; - }; - } - } - - var createViewModel$1 = createViewModel; - - var queue = []; - var activatedChildren = []; - var has = {}; - var waiting = false; - var flushing = false; - var index = 0; - - function resetSchedulerState() { - index = queue.length = activatedChildren.length = 0; - has = {}; - waiting = flushing = false; - } - - function flushSchedulerQueue() { - flushing = true; - var watcher = void 0, - id = void 0, - options = void 0; - - // Sort queue before flush. - // This ensures that: - // 1. Components are updated from parent to child. (because parent is always - // created before the child) - // 2. A component's user watchers are run before its render watcher (because - // user watchers are created before the render watcher) - // 3. If a component is destroyed during a parent component's watcher run, - // its watchers can be skipped. - queue.sort(function (a, b) { - return a.id - b.id; - }); - - // do not cache length because more watchers might be pushed - // as we run existing watchers - for (index = 0; index < queue.length; index++) { - watcher = queue[index].watcher; - options = queue[index].options; - id = watcher.id; - has[id] = null; - watcher.run(options); - } - - resetSchedulerState(); - } - - function queueWatcher(watcher, options) { - var id = watcher.id; - if (has[id] == null) { - has[id] = true; - if (!flushing) { - queue.push({ watcher: watcher, options: options }); - } else { - // if already flushing, splice the watcher based on its id - // if already past its id, it will be run next immediately. - var i = queue.length - 1; - while (i > index && queue[i].watcher.id > watcher.id) { - i--; - } - queue.splice(i + 1, 0, { watcher: watcher, options: options }); - } - // queue the flush - if (!waiting) { - waiting = true; - nextTick(flushSchedulerQueue); - } - } - } - - var uid$1 = 0; - - var Watcher = function () { - function Watcher(vm, expOrFn, cb, options) { - _classCallCheck(this, Watcher); - - this.vm = vm; - // vm._watchers || (vm._watchers = []) - // vm._watchers.push(this) - // options - if (options) { - this.deep = !!options.deep; - this.user = !!options.user; - this.lazy = !!options.lazy; - this.sync = !!options.sync; - } else { - this.deep = this.user = this.lazy = this.sync = false; - } - this.cb = cb; - this.id = ++uid$1; // uid for batching - this.active = true; - this.dirty = this.lazy; // for lazy watchers - this.deps = []; - this.newDeps = []; - this.depIds = new Set(); - this.newDepIds = new Set(); - this.expression = ''; - // parse expression for getter - if (typeof expOrFn === 'function') { - this.getter = expOrFn; - } else { - this.getter = parsePath(expOrFn); - if (!this.getter) { - this.getter = function () {}; - } - } - this.value = this.lazy ? undefined : this.get(); - } - - Watcher.prototype.get = function get() { - pushTarget(this); - var value = void 0; - var vm = this.vm; - try { - value = this.getter.call(vm, vm); - } catch (e) { - // if (this.user) { - // } else { - // console.error(e) - // } - } finally { - // "touch" every property so they are all tracked as - // dependencies for deep watching - if (this.deep) { - traverse(value); - } - popTarget(); - this.cleanupDeps(); - } - return value; - }; - - Watcher.prototype.addDep = function addDep(dep) { - var id = dep.id; - if (!this.newDepIds.has(id)) { - this.newDepIds.add(id); - this.newDeps.push(dep); - if (!this.depIds.has(id)) { - dep.addSub(this); - } - } - }; - - Watcher.prototype.cleanupDeps = function cleanupDeps() { - var i = this.deps.length; - while (i--) { - var dep = this.deps[i]; - if (!this.newDepIds.has(dep.id)) { - dep.removeSub(this); - } - } - var tmp = this.depIds; - this.depIds = this.newDepIds; - this.newDepIds = tmp; - this.newDepIds.clear(); - tmp = this.deps; - this.deps = this.newDeps; - this.newDeps = tmp; - this.newDeps.length = 0; - }; - - Watcher.prototype.update = function update(options) { - /* istanbul ignore else */ - if (this.lazy) { - this.dirty = true; - } else if (this.sync) { - this.run(options); - } else { - queueWatcher(this, options); - } - }; - - Watcher.prototype.run = function run(options) { - if (this.active) { - var value = this.get(); - if (value !== this.value || - // Deep watchers and watchers on Object/Arrays should fire even - // when the value is the same, because the value may - // have mutated. - BI._.isObject(value) && options && options.refresh || this.deep) { - // set new value - var oldValue = this.value; - this.value = value; - if (this.user) { - try { - this.cb.call(this.vm, value, oldValue, options); - } catch (e) { - console.error(e); - } - } else { - try { - this.cb.call(this.vm, value, oldValue, options); - } catch (e) { - console.error(e); - } - } - } - } - }; - - Watcher.prototype.evaluate = function evaluate() { - this.value = this.get(); - this.dirty = false; - }; - - Watcher.prototype.depend = function depend() { - var i = this.deps.length; - while (i--) { - this.deps[i].depend(); - } - }; - - Watcher.prototype.teardown = function teardown() { - if (this.active) { - // remove self from vm's watcher list - // this is a somewhat expensive operation so we skip it - // if the vm is being destroyed. - remove(this.vm && this.vm._watchers, this); - var i = this.deps.length; - while (i--) { - this.deps[i].removeSub(this); - } - this.active = false; - } - }; - - return Watcher; - }(); - - var seenObjects = new Set(); - - function traverse(val) { - seenObjects.clear(); - _traverse(val, seenObjects); - } - - function _traverse(val, seen) { - var i = void 0, - keys = void 0; - var isA = BI._.isArray(val); - if (!isA && !BI._.isObject(val)) { - return; - } - if (val.__ob__) { - var depId = val.__ob__.dep.id; - if (seen.has(depId)) { - return; - } - seen.add(depId); - } - if (isA) { - i = val.length; - while (i--) { - _traverse(val[i], seen); - } - } else { - keys = BI._.keys(val); - i = keys.length; - while (i--) { - _traverse(val[keys[i]], seen); - } - } - } - - var arrayProto = Array.prototype; - var arrayMethods = []; - BI._.each(['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'], function (method) { - var original = arrayProto[method]; - arrayMethods[method] = function mutator() { - for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) { - args[_key2] = arguments[_key2]; - } - - var ob = this.__ob__; - var inserted = void 0; - switch (method) { - case 'push': - case 'unshift': - inserted = args; - break; - case 'splice': - inserted = args.slice(2); - break; - } - if (inserted) inserted = ob.observeArray(inserted); - switch (method) { - case 'push': - case 'unshift': - args = inserted; - break; - case 'splice': - if (args.length > 2) { - args = [args[0], args[1]].concat(inserted ? inserted : []); - } - break; - } - var result = original.apply(this, args); - notify(ob.parent, ob.parentKey, ob.dep, true); - return result; - }; - }); - - var arrayKeys = BI._.keys(arrayMethods); - - var observerState = { - shouldConvert: true - }; - - function def(obj, key, val, enumerable) { - Object.defineProperty(obj, key, { - value: val, - enumerable: !!enumerable, - writable: true, - configurable: true - }); - } - - /** - * Observer class that are attached to each observed - * object. Once attached, the observer converts target - * object's property keys into getter/setters that - * collect dependencies and dispatches updates. - */ - - var Observer = function () { - function Observer(value) { - _classCallCheck(this, Observer); - - this.value = value; - this.dep = new Dep(); - this.vmCount = 0; - if (BI._.isArray(value)) { - var augment = hasProto ? protoAugment : copyAugment; - augment(value, arrayMethods, arrayKeys); - this.model = this.observeArray(value); - } else { - this.model = this.walk(value); - } - def(this.model, "__ob__", this); - } - - Observer.prototype.walk = function walk(obj) { - return defineReactive(obj, this); - }; - - Observer.prototype.observeArray = function observeArray(items) { - for (var i = 0, l = items.length; i < l; i++) { - var ob = observe(items[i], this, i); - items[i] = ob ? ob.model : items[i]; - } - return items; - }; - - return Observer; - }(); - - function protoAugment(target, src, keys) { - /* eslint-disable no-proto */ - target.__proto__ = src; - /* eslint-enable no-proto */ - } - - /* istanbul ignore next */ - function copyAugment(target, src, keys) { - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - target[key] = src[key]; - } - } - - function observe(value, parentObserver, parentKey) { - if (!BI._.isObject(value)) { - return; - } - var ob = void 0; - if (value.__ob__ instanceof Observer) { - ob = value.__ob__; - } else if (observerState.shouldConvert && isExtensible(value) && (BI._.isArray(value) || isPlainObject(value))) { - ob = new Observer(value); - } - if (ob) { - ob.parent = parentObserver || ob.parent; - ob.parentKey = parentKey; - } - return ob; - } - - function notify(observer, key, dep, refresh) { - dep.notify({ observer: observer, key: key, refresh: refresh }); - if (observer) { - //触发a.*绑定的依赖 - BI._.each(observer._deps, function (dep) { - dep.notify({ observer: observer, key: key }); - }); - //触发a.**绑定的依赖 - var parent = observer, - root = observer, - route = key || ""; - while (parent) { - BI._.each(parent._scopeDeps, function (dep) { - dep.notify({ observer: observer, key: key }); - }); - if (parent.parentKey != null) { - route = parent.parentKey + '.' + route; - } - root = parent; - parent = parent.parent; - } - for (var _key in root._globalDeps) { - var reg = new RegExp(_key); - if (reg.test(route)) { - for (var i = 0; i < root._globalDeps[_key].length; i++) { - root._globalDeps[_key][i].notify({ observer: observer, key: _key }); - } - } - } - } - } - - function defineReactive(obj, observer, shallow) { - var props = {}; - var model = void 0; - BI._.each(obj, function (val, key) { - if (key in $$skipArray) { - return; - } - var configurable = isConfigurable(obj, key); - var dep = observer && observer['__dep' + key] || new Dep(); - observer && (observer['__dep' + key] = dep); - var childOb = configurable && !shallow && observe(val, observer, key); - props[key] = { - enumerable: true, - configurable: true, - get: function reactiveGetter() { - var value = childOb ? childOb.model : val; - if (Dep.target) { - dep.depend(); - if (childOb) { - childOb.dep.depend(); - if (BI._.isArray(value)) { - dependArray(value); - } - } - } - return value; - }, - set: function reactiveSetter(newVal) { - var value = childOb ? childOb.model : val; - if (newVal === value || newVal !== newVal && value !== value) { - return; - } - val = newVal; - childOb = configurable && !shallow && observe(newVal, observer, key); - if (childOb && value && value.__ob__) { - childOb._scopeDeps = value.__ob__._scopeDeps; - childOb._deps = value.__ob__._deps; - } - obj[key] = childOb ? childOb.model : newVal; - notify(model.__ob__, key, dep); - } - }; - }); - return model = createViewModel$1(obj, props); - } - - function defineReactiveProperty(obj, key, val, shallow) { - - var dep = new Dep(); - - var configurable = isConfigurable(obj, key); - if (!configurable) { - return; - } - - if (arguments.length === 2) { - val = obj[key]; - } - - var childOb = !shallow && observe(val); - Object.defineProperty(obj, key, { - enumerable: true, - configurable: true, - get: function reactiveGetter() { - var value = childOb ? childOb.model : val; - if (Dep.target) { - dep.depend(); - if (childOb) { - childOb.dep.depend(); - if (BI._.isArray(value)) { - dependArray(value); - } - } - } - return value; - }, - set: function reactiveSetter(newVal) { - var value = childOb ? childOb.model : val; - if (newVal === value || newVal !== newVal && value !== value) { - return; - } - - childOb = configurable && !shallow && observe(newVal); - val = newVal; - obj[key] = childOb ? childOb.model : newVal; - dep.notify(); - } - }); - } - - /** - * Set a property on an object. Adds the new property and - * triggers change notification if the property doesn't - * already exist. - */ - function set(target, key, val) { - if (BI._.isArray(target)) { - target.length = Math.max(target.length, key); - target.splice(key, 1, val); - return val; - } - if (BI._.has(target, key)) { - target[key] = val; - return val; - } - var ob = target.__ob__; - if (!ob) { - target[key] = val; - return val; - } - ob.value[key] = val; - target = defineReactive(ob.value, ob); - notify(ob, key, ob.dep); - return target; - } - - function freeze() { - return Object.freeze.apply(null, arguments); - } - - /** - * Delete a property and trigger change if necessary. - */ - function del(target, key) { - if (BI._.isArray(target)) { - target.splice(key, 1); - return; - } - var ob = target.__ob__; - if (!BI._.has(target, key)) { - return; - } - if (!ob) { - delete target[key]; - return target; - } - delete ob.value[key]; - target = defineReactive(ob.value, ob); - notify(ob, key, ob.dep); - return target; - } - - /** - * Collect dependencies on array elements when the array is touched, since - * we cannot intercept array element access like property getters. - */ - function dependArray(value) { - for (var e, i = 0, l = value.length; i < l; i++) { - e = value[i]; - e && e.__ob__ && e.__ob__.dep.depend(); - if (BI._.isArray(e)) { - dependArray(e); - } - } - } - - var falsy$1; - var operators = { - '||': falsy$1, - '&&': falsy$1, - '(': falsy$1, - ')': falsy$1 - }; - - function runBinaryFunction(binarys) { - var expr = ''; - for (var i = 0, len = binarys.length; i < len; i++) { - if (BI._.isBoolean(binarys[i]) || BI._.has(operators, binarys[i])) { - expr += binarys[i]; - } else { - expr += 'false'; - } - } - return new Function('return ' + expr)(); - } - - function routeToRegExp(route) { - route = route.replace(/\*\*/g, '[a-zA-Z0-9_]+').replace(/\*./g, '[a-zA-Z0-9_]+.'); - return '^' + route + '$'; - } - - function watch(model, expOrFn, cb, options) { - if (isPlainObject(cb)) { - options = cb; - cb = cb.handler; - } - if (typeof cb === 'string') { - cb = model[cb]; - } - options = options || {}; - options.user = true; - var exps = void 0; - if (BI._.isFunction(expOrFn) || !(exps = expOrFn.match(/[a-zA-Z0-9BI._.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && expOrFn.indexOf("*") < 0) { - var watcher = new Watcher(model, expOrFn, cb, options); - if (options.immediate) { - cb(watcher.value); - } - return function unwatchFn() { - watcher.teardown(); - }; - } - var watchers = []; - var fns = exps.slice(); - var complete = false, - running = false; - var callback = function callback(index, newValue, oldValue, attrs) { - if (complete === true) { - return; - } - fns[index] = true; - if (runBinaryFunction(fns)) { - complete = true; - cb(newValue, oldValue, attrs); - } - if (options && options.sync) { - complete = false; - running = false; - fns = exps.slice(); - } else { - if (!running) { - running = true; - nextTick(function () { - complete = false; - running = false; - fns = exps.slice(); - }); - } - } - }; - BI._.each(exps, function (exp, i) { - if (BI._.has(operators, exp)) { - return; - } - if (exp.indexOf("*") >= 0) { - //a.**或a.*形式 - if (/^[1-9a-zA-Z.]+(\*\*$|\*$)/.test(exp) || exp === "**" || exp === "*") { - var isGlobal = exp.indexOf("**") >= 0; - if (isGlobal) { - //a.**的形式 - exp = exp.replace(".**", ""); - } else { - //a.*的形式 - exp = exp.replace(".*", ""); - } - var getter = exp === "**" || exp === "*" ? function (m) { - return m; - } : parsePath(exp); - var v = getter.call(model, model); - var _dep = new Dep(); - if (isGlobal) { - (v.__ob__._scopeDeps || (v.__ob__._scopeDeps = [])).push(_dep); - } else { - (v.__ob__._deps || (v.__ob__._deps = [])).push(_dep); - } - var _w = new Watcher(model, function () { - _dep.depend(); - return NaN; - }, function (newValue, oldValue, attrs) { - callback(i, newValue, oldValue, BI._.extend({ index: i }, attrs)); - }, options); - watchers.push(function unwatchFn() { - _w.teardown(); - v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, _dep); - v.__ob__._deps && remove(v.__ob__._deps, _dep); - }); - return; - } - // **.a.**的情况,场景:a.b.c, 如果用b.**监听, a被重新赋值b上的_scopeDes就不存在了 - if (/^(\*\*\.)+[1-9a-zA-Z]+(\.\*\*$)/.test(exp)) { - //先获取到能获取到的对象 - var _paths = exp.split("."); - var _currentModel = model[_paths[1]]; - exp = _paths[1] + ".**"; - //补全路径 - var _parent = _currentModel.__ob__.parent, - _root = _currentModel.__ob__; - while (_parent) { - exp = '*.' + exp; - _root = _parent; - _parent = _parent.parent; - } - var _regStr = routeToRegExp(exp); - var _dep2 = new Dep(); - _root._globalDeps || (_root._globalDeps = {}); - if (BI._.isArray(_root._globalDeps[_regStr])) { - _root._globalDeps[_regStr].push(_dep2); - } else { - _root._globalDeps[_regStr] = [_dep2]; - } - - var _w2 = new Watcher(_currentModel, function () { - _dep2.depend(); - return NaN; - }, function (newValue, oldValue, attrs) { - callback(i, newValue, oldValue, BI._.extend({ index: i }, attrs)); - }, options); - watchers.push(function unwatchFn() { - if (_root._globalDeps) { - remove(_root._globalDeps[_regStr], _dep2); - - if (_root._globalDeps[_regStr].length === 0) { - delete _root._globalDeps[_regStr]; - _w2.teardown(); - } - } - }); - return; - } - // 再有结尾有*的就不支持了 - if (exp[exp.length - 1] === "*") { - throw new Error('not support'); - } - //其他含有*的情况,如*.a,*.*.a,a.*.a - var currentModel = model; - //先获取到能获取到的对象 - var paths = exp.split("."); - for (var _i = 0, len = paths.length; _i < len; _i++) { - if (paths[_i] === "*") { - break; - } - currentModel = model[paths[_i]]; - } - exp = exp.substr(exp.indexOf("*")); - //补全路径 - var parent = currentModel.__ob__.parent, - root = currentModel.__ob__; - while (parent) { - exp = '*.' + exp; - root = parent; - parent = parent.parent; - } - var regStr = routeToRegExp(exp); - var dep = new Dep(); - root._globalDeps || (root._globalDeps = {}); - if (BI._.isArray(root._globalDeps[regStr])) { - root._globalDeps[regStr].push(dep); - } else { - root._globalDeps[regStr] = [dep]; - } - - var w = new Watcher(currentModel, function () { - dep.depend(); - return NaN; - }, function (newValue, oldValue, attrs) { - callback(i, newValue, oldValue, BI._.extend({ index: i }, attrs)); - }, options); - watchers.push(function unwatchFn() { - if (root._globalDeps) { - remove(root._globalDeps[regStr], dep); - if (root._globalDeps[regStr].length === 0) { - delete root._globalDeps[regStr]; - w.teardown(); - } - } - }); - return; - } - var watcher = new Watcher(model, exp, function (newValue, oldValue, attrs) { - callback(i, newValue, oldValue, BI._.extend({ index: i }, attrs)); - }, options); - watchers.push(function unwatchFn() { - watcher.teardown(); - }); - }); - return watchers; - } - - var mixinInjection = {}; - - function getMixins(type) { - return mixinInjection[type]; - } - - function mixin(xtype, cls) { - mixinInjection[xtype] = BI._.cloneDeep(cls); - } - - var computedWatcherOptions = { lazy: true }; - var REACTIVE = true; - - function initState(vm, state) { - if (state) { - vm.$$state = REACTIVE ? observe(state).model : state; - } - } - - function initComputed(vm, computed) { - var watchers = vm._computedWatchers = {}; - defineComputed(vm, computed); - for (var key in computed) { - watchers[key] = defineComputedWatcher(vm, computed[key]); - } - } - - function defineComputedWatcher(vm, userDef) { - var context = vm.$$model ? vm.model : vm; - var getter = typeof userDef === "function" ? userDef : userDef.get; - - return new Watcher(context, getter || noop, noop, computedWatcherOptions); - } - - function defineOneComputedGetter(vm, key, userDef) { - var shouldCache = true; - var sharedPropertyDefinition = { - enumerable: true, - configurable: true, - get: noop, - set: noop - }; - if (typeof userDef === "function") { - sharedPropertyDefinition.get = createComputedGetter(vm, key); - sharedPropertyDefinition.set = noop; - } else { - sharedPropertyDefinition.get = userDef.get ? shouldCache && userDef.cache !== false ? createComputedGetter(vm, key) : userDef.get : noop; - sharedPropertyDefinition.set = userDef.set ? userDef.set : noop; - } - return sharedPropertyDefinition; - } - - function defineComputed(vm, computed) { - var props = {}; - for (var key in computed) { - if (!(key in vm)) { - props[key] = defineOneComputedGetter(vm, key, computed[key]); - } - } - vm.$$computed = createViewModel$1({}, props); - } - - function createComputedGetter(vm, key) { - return function computedGetter() { - var watcher = vm._computedWatchers && vm._computedWatchers[key]; - if (watcher) { - if (watcher.dirty) { - watcher.evaluate(); - } - if (REACTIVE && Dep.target) { - watcher.depend(); - } - return watcher.value; - } - }; - } - - function initWatch(vm, watch$$1) { - vm._watchers || (vm._watchers = []); - for (var key in watch$$1) { - var handler = watch$$1[key]; - if (BI._.isArray(handler)) { - for (var i = 0; i < handler.length; i++) { - vm._watchers.push(createWatcher(vm, key, handler[i])); - } - } else { - vm._watchers.push(createWatcher(vm, key, handler)); - } - } - } - - function createWatcher(vm, keyOrFn, cb, options) { - if (isPlainObject(cb)) { - options = cb; - cb = cb.handler; - } - if (typeof cb === 'string') { - cb = vm[cb]; - } - return watch(vm.model, keyOrFn, BI._.bind(cb, vm.$$model ? vm.model : vm), options); - } - - function initMethods(vm, methods) { - for (var key in methods) { - vm[key] = methods[key] == null ? noop : BI._.bind(methods[key], vm.$$model ? vm.model : vm); - } - } - - function initMixins(vm, mixins) { - mixins = (mixins || []).slice(0); - - BI._.each(mixins.reverse(), function (mixinType) { - var mixin$$1 = getMixins(mixinType); - - for (var key in mixin$$1) { - if (typeof mixin$$1[key] !== "function") continue; - - if (BI._.has(vm, key)) continue; - - vm[key] = BI._.bind(mixin$$1[key], vm.$$model ? vm.model : vm); - } - }); - } - - function defineProps(vm, keys) { - var props = {}; - // if (typeof Proxy === 'function') { - // return vm.model = new Proxy(props, { - // has: function (target, key) { - // return keys.indexOf(key) > -1; - // }, - // get: function (target, key) { - // if (key in $$skipArray) { - // return props[key] - // } - // if (vm.$$computed && key in vm.$$computed) { - // return vm.$$computed[key] - // } - // if (vm.$$state && key in vm.$$state) { - // return vm.$$state[key] - // } - // return vm.$$model[key] - // }, - // set: function (target, key, val) { - // if (key in $$skipArray) { - // return props[key] = val - // } - // if (vm.$$state && key in vm.$$state) { - // return vm.$$state[key] = val - // } - // if (vm.$$model && key in vm.$$model) { - // return vm.$$model[key] = val - // } - // } - // }) - // } - - var _loop = function _loop(i, len) { - var key = keys[i]; - if (!(key in $$skipArray)) { - props[key] = { - enumerable: true, - configurable: true, - get: function get() { - if (vm.$$computed && key in vm.$$computed) { - return vm.$$computed[key]; - } - if (vm.$$state && key in vm.$$state) { - return vm.$$state[key]; - } - if (vm.$$model && key in vm.$$model) { - return vm.$$model[key]; - } - var p = vm._parent; - while (p) { - if (p.$$context && key in p.$$context) { - return p.$$context[key]; - } - p = p._parent; - } - }, - set: function set(val) { - if (vm.$$state && key in vm.$$state) { - return vm.$$state[key] = val; - } - if (vm.$$model && key in vm.$$model) { - return vm.$$model[key] = val; - } - var p = vm._parent; - while (p) { - if (p.$$context && key in p.$$context) { - return p.$$context[key] = val; - } - p = p._parent; - } - } - }; - } - }; - - for (var i = 0, len = keys.length; i < len; i++) { - _loop(i, len); - } - vm.model = createViewModel$1({}, props); - } - - function defineContext(vm, keys) { - var props = {}; - - var _loop2 = function _loop2(i, len) { - var key = keys[i]; - if (!(key in $$skipArray)) { - props[key] = { - enumerable: true, - configurable: true, - get: function get() { - return vm.model[key]; - }, - set: function set(val) { - return vm.model[key] = val; - } - }; - } - }; - - for (var i = 0, len = keys.length; i < len; i++) { - _loop2(i, len); - } - vm.$$context = createViewModel$1({}, props); - } - - function getInjectValue(vm, key) { - var p = vm._parent; - while (p) { - if (p.$$context && key in p.$$context) { - return p.$$context[key]; - } - p = p._parent; - } - } - - function getInjectValues(vm) { - var inject = vm.inject || []; - var result = {}; - BI._.each(inject, function (key) { - result[key] = getInjectValue(vm, key); - }); - return result; - } - - var Model = function () { - function Model() { - _classCallCheck(this, Model); - } - - Model.prototype._constructor = function _constructor(model, destroyHandler) { - if (model instanceof Observer || model instanceof Model) { - model = model.model; - } - if (model && model.__ob__) { - this.$$model = model; - } else { - this.options = model || {}; - } - this._parent = Model.target; - var state = BI._.isFunction(this.state) ? this.state() : this.state; - var computed = this.computed; - var context = this.context; - var inject = this.inject; - var childContext = this.childContext; - var provide = this.provide; - var watch$$1 = this.watch; - var actions = this.actions; - var keys = BI._.keys(this.$$model).concat(BI._.keys(state)).concat(BI._.keys(computed)).concat(inject || []).concat(context || []); - var mixins = this.mixins; - defineProps(this, keys); - // deprecated - childContext && defineContext(this, childContext); - provide && defineContext(this, provide); - this.$$model && (this.model.__ob__ = this.$$model.__ob__); - initMixins(this, mixins); - this.init(); - initState(this, BI._.extend(getInjectValues(this), state)); - initComputed(this, computed); - REACTIVE && initWatch(this, watch$$1); - initMethods(this, actions); - this.created && this.created(); - this._destroyHandler = destroyHandler; - if (this.$$model) { - return this.model; - } - }; - - Model.prototype._init = function _init() {}; - - Model.prototype.init = function init() { - this._init(); - }; - - Model.prototype.destroy = function destroy() { - for (var _key3 in this._computedWatchers) { - this._computedWatchers[_key3].teardown(); - } - BI._.each(this._watchers, function (unwatches) { - unwatches = BI._.isArray(unwatches) ? unwatches : [unwatches]; - BI._.each(unwatches, function (unwatch) { - unwatch(); - }); - }); - this._watchers && (this._watchers = []); - this.destroyed && this.destroyed(); - this.$$model = null; - this.$$computed = null; - this.$$state = null; - this._destroyHandler && this._destroyHandler(); - }; - - return Model; - }(); - - function define(model) { - return REACTIVE ? new Observer(model).model : model; - } - - var reactive = define; - - function config(options) { - options || (options = {}); - if ("reactive" in options) { - REACTIVE = options.reactive; - } - } - - function toJSON(model) { - var result = void 0; - if (BI._.isArray(model)) { - result = []; - for (var i = 0, len = model.length; i < len; i++) { - result[i] = toJSON(model[i]); - } - } else if (model && isPlainObject(model)) { - result = {}; - for (var _key4 in model) { - if (!BI._.has($$skipArray, _key4)) { - result[_key4] = toJSON(model[_key4]); - } - } - } else { - result = model; - } - return result; - } - - var version = '2.0'; - - exports.version = version; - exports.$$skipArray = $$skipArray; - exports.mixin = mixin; - exports.Model = Model; - exports.define = define; - exports.reactive = reactive; - exports.config = config; - exports.observerState = observerState; - exports.Observer = Observer; - exports.observe = observe; - exports.notify = notify; - exports.defineReactive = defineReactive; - exports.defineReactiveProperty = defineReactiveProperty; - exports.set = set; - exports.freeze = freeze; - exports.del = del; - exports.Watcher = Watcher; - exports.pushTarget = pushTarget; - exports.popTarget = popTarget; - exports.watch = watch; - exports.toJSON = toJSON; - - exports.__esModule = true; -}); \ No newline at end of file diff --git a/dist/fix/fix.proxy.js b/dist/fix/fix.proxy.js deleted file mode 100644 index 4a709fb3c..000000000 --- a/dist/fix/fix.proxy.js +++ /dev/null @@ -1,2475 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Fix = {})); -})(this, (function (exports) { 'use strict'; - - function _typeof(obj) { - "@babel/helpers - typeof"; - - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }, _typeof(obj); - } - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; - } - - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; - } - - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); - } - - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); - } - - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); - } - - function _iterableToArrayLimit(arr, i) { - var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; - - if (_i == null) return; - var _arr = []; - var _n = true; - var _d = false; - - var _s, _e; - - try { - for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); - } - - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; - } - - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function _createForOfIteratorHelper(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - - if (!it) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - - var F = function () {}; - - return { - s: F, - n: function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }, - e: function (e) { - throw e; - }, - f: F - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - var normalCompletion = true, - didErr = false, - err; - return { - s: function () { - it = it.call(o); - }, - n: function () { - var step = it.next(); - normalCompletion = step.done; - return step; - }, - e: function (e) { - didErr = true; - err = e; - }, - f: function () { - try { - if (!normalCompletion && it.return != null) it.return(); - } finally { - if (didErr) throw err; - } - } - }; - } - - /** - * Make a map and return a function for checking if a key - * is in that map. - * IMPORTANT: all calls of this function must be prefixed with - * \/\*#\_\_PURE\_\_\*\/ - * So that rollup can tree-shake them if necessary. - */ - function makeMap(str, expectsLowerCase) { - var map = Object.create(null); - var list = str.split(','); - - for (var i = 0; i < list.length; i++) { - map[list[i]] = true; - } - - return expectsLowerCase ? function (val) { - return !!map[val.toLowerCase()]; - } : function (val) { - return !!map[val]; - }; - } - - Object.freeze({}); - Object.freeze([]); - var extend = Object.assign; - var hasOwnProperty = Object.prototype.hasOwnProperty; - - var hasOwn = function hasOwn(val, key) { - return hasOwnProperty.call(val, key); - }; - - var isArray = Array.isArray; - - var isMap$1 = function isMap(val) { - return toTypeString$1(val) === '[object Map]'; - }; - - var isFunction = function isFunction(val) { - return typeof val === 'function'; - }; - - var isString = function isString(val) { - return typeof val === 'string'; - }; - - var isSymbol = function isSymbol(val) { - return _typeof(val) === 'symbol'; - }; - - var isObject = function isObject(val) { - return val !== null && _typeof(val) === 'object'; - }; - - var objectToString$1 = Object.prototype.toString; - - var toTypeString$1 = function toTypeString(value) { - return objectToString$1.call(value); - }; - - var toRawType = function toRawType(value) { - // extract "RawType" from strings like "[object RawType]" - return toTypeString$1(value).slice(8, -1); - }; - - var isIntegerKey = function isIntegerKey(key) { - return isString(key) && key !== 'NaN' && key[0] !== '-' && '' + parseInt(key, 10) === key; - }; - - var cacheStringFunction = function cacheStringFunction(fn) { - var cache = Object.create(null); - return function (str) { - var hit = cache[str]; - return hit || (cache[str] = fn(str)); - }; - }; - /** - * @private - */ - - - var capitalize = cacheStringFunction(function (str) { - return str.charAt(0).toUpperCase() + str.slice(1); - }); // compare whether a value has changed, accounting for NaN. - - var hasChanged$1 = function hasChanged(value, oldValue) { - return !Object.is(value, oldValue); - }; - - var activeEffectScope; - - function recordEffectScope(effect, scope) { - scope = scope || activeEffectScope; - - if (scope && scope.active) { - scope.effects.push(effect); - } - } - - var createDep = function createDep(effects) { - var dep = new Set(effects); - dep.w = 0; - dep.n = 0; - return dep; - }; - - var wasTracked = function wasTracked(dep) { - return (dep.w & trackOpBit) > 0; - }; - - var newTracked = function newTracked(dep) { - return (dep.n & trackOpBit) > 0; - }; - - var initDepMarkers = function initDepMarkers(_ref) { - var deps = _ref.deps; - - if (deps.length) { - for (var i = 0; i < deps.length; i++) { - deps[i].w |= trackOpBit; // set was tracked - } - } - }; - - var finalizeDepMarkers = function finalizeDepMarkers(effect) { - var deps = effect.deps; - - if (deps.length) { - var ptr = 0; - - for (var i = 0; i < deps.length; i++) { - var dep = deps[i]; - - if (wasTracked(dep) && !newTracked(dep)) { - dep.delete(effect); - } else { - deps[ptr++] = dep; - } // clear bits - - - dep.w &= ~trackOpBit; - dep.n &= ~trackOpBit; - } - - deps.length = ptr; - } - }; - - var targetMap = new WeakMap(); // The number of effects currently being tracked recursively. - - var effectTrackDepth = 0; - var trackOpBit = 1; - /** - * The bitwise track markers support at most 30 levels of recursion. - * This value is chosen to enable modern JS engines to use a SMI on all platforms. - * When recursion depth is greater, fall back to using a full cleanup. - */ - - var maxMarkerBits = 30; - var effectStack = []; - var activeEffect; - var ITERATE_KEY = Symbol('iterate'); - var MAP_KEY_ITERATE_KEY = Symbol('Map key iterate'); - - var ReactiveEffect = /*#__PURE__*/function () { - function ReactiveEffect(fn) { - var scheduler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var scope = arguments.length > 2 ? arguments[2] : undefined; - - _classCallCheck(this, ReactiveEffect); - - this.fn = fn; - this.scheduler = scheduler; - this.active = true; - this.deps = []; - recordEffectScope(this, scope); - } - - _createClass(ReactiveEffect, [{ - key: "run", - value: function run() { - if (!this.active) { - return this.fn(); - } - - if (!effectStack.includes(this)) { - try { - effectStack.push(activeEffect = this); - enableTracking(); - trackOpBit = 1 << ++effectTrackDepth; - - if (effectTrackDepth <= maxMarkerBits) { - initDepMarkers(this); - } else { - cleanupEffect(this); - } - - return this.fn(); - } finally { - if (effectTrackDepth <= maxMarkerBits) { - finalizeDepMarkers(this); - } - - trackOpBit = 1 << --effectTrackDepth; - resetTracking(); - effectStack.pop(); - var n = effectStack.length; - activeEffect = n > 0 ? effectStack[n - 1] : undefined; - } - } - } - }, { - key: "stop", - value: function stop() { - if (this.active) { - cleanupEffect(this); - - if (this.onStop) { - this.onStop(); - } - - this.active = false; - } - } - }]); - - return ReactiveEffect; - }(); - - function cleanupEffect(effect) { - var deps = effect.deps; - - if (deps.length) { - for (var i = 0; i < deps.length; i++) { - deps[i].delete(effect); - } - - deps.length = 0; - } - } - - function effect(fn, options) { - if (fn.effect) { - fn = fn.effect.fn; - } - - var _effect = new ReactiveEffect(fn); - - if (options) { - extend(_effect, options); - if (options.scope) recordEffectScope(_effect, options.scope); - } - - if (!options || !options.lazy) { - _effect.run(); - } - - var runner = _effect.run.bind(_effect); - - runner.effect = _effect; - return runner; - } - - function stop(runner) { - runner.effect.stop(); - } - - var shouldTrack = true; - var trackStack = []; - - function pauseTracking() { - trackStack.push(shouldTrack); - shouldTrack = false; - } - - function enableTracking() { - trackStack.push(shouldTrack); - shouldTrack = true; - } - - function resetTracking() { - var last = trackStack.pop(); - shouldTrack = last === undefined ? true : last; - } - - function track(target, type, key) { - if (!isTracking()) { - return; - } - - var depsMap = targetMap.get(target); - - if (!depsMap) { - targetMap.set(target, depsMap = new Map()); - } - - var dep = depsMap.get(key); - - if (!dep) { - depsMap.set(key, dep = createDep()); - } - - var eventInfo = { - effect: activeEffect, - target: target, - type: type, - key: key - }; - trackEffects(dep, eventInfo); - } - - function isTracking() { - return shouldTrack && activeEffect !== undefined; - } - - function trackEffects(dep, debuggerEventExtraInfo) { - var shouldTrack = false; - - if (effectTrackDepth <= maxMarkerBits) { - if (!newTracked(dep)) { - dep.n |= trackOpBit; // set newly tracked - - shouldTrack = !wasTracked(dep); - } - } else { - // Full cleanup mode. - shouldTrack = !dep.has(activeEffect); - } - - if (shouldTrack) { - dep.add(activeEffect); - activeEffect.deps.push(dep); - - if (activeEffect.onTrack) { - activeEffect.onTrack(Object.assign({ - effect: activeEffect - }, debuggerEventExtraInfo)); - } - } - } - - function trigger(target, type, key, newValue, oldValue, oldTarget) { - var depsMap = targetMap.get(target); - - if (!depsMap) { - // never been tracked - return; - } - - var deps = []; - - if (type === "clear" - /* CLEAR */ - ) { - // collection being cleared - // trigger all effects for target - deps = _toConsumableArray(depsMap.values()); - } else if (key === 'length' && isArray(target)) { - depsMap.forEach(function (dep, key) { - if (key === 'length' || key >= newValue) { - deps.push(dep); - } - }); - } else { - // schedule runs for SET | ADD | DELETE - if (key !== void 0) { - deps.push(depsMap.get(key)); - } // also run for iteration key on ADD | DELETE | Map.SET - - - switch (type) { - case "add" - /* ADD */ - : - if (!isArray(target)) { - deps.push(depsMap.get(ITERATE_KEY)); - - if (isMap$1(target)) { - deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); - } - } else if (isIntegerKey(key)) { - // new index added to array -> length changes - deps.push(depsMap.get('length')); - } - - break; - - case "delete" - /* DELETE */ - : - if (!isArray(target)) { - deps.push(depsMap.get(ITERATE_KEY)); - - if (isMap$1(target)) { - deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); - } - } - - break; - - case "set" - /* SET */ - : - if (isMap$1(target)) { - deps.push(depsMap.get(ITERATE_KEY)); - } - - break; - } - } - - var eventInfo = { - target: target, - type: type, - key: key, - newValue: newValue, - oldValue: oldValue, - oldTarget: oldTarget - }; - - if (deps.length === 1) { - if (deps[0]) { - { - triggerEffects(deps[0], eventInfo); - } - } - } else { - var effects = []; - - var _iterator = _createForOfIteratorHelper(deps), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var dep = _step.value; - - if (dep) { - effects.push.apply(effects, _toConsumableArray(dep)); - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - - { - triggerEffects(createDep(effects), eventInfo); - } - } - } - - function triggerEffects(dep, debuggerEventExtraInfo) { - // spread into array for stabilization - var _iterator2 = _createForOfIteratorHelper(isArray(dep) ? dep : _toConsumableArray(dep)), - _step2; - - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var _effect2 = _step2.value; - - if (_effect2 !== activeEffect || _effect2.allowRecurse) { - if (_effect2.onTrigger) { - _effect2.onTrigger(extend({ - effect: _effect2 - }, debuggerEventExtraInfo)); - } - - if (_effect2.scheduler) { - _effect2.scheduler(); - } else { - _effect2.run(); - } - } - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } - - var isNonTrackableKeys = /*#__PURE__*/makeMap("__proto__,__v_isRef,__isVue"); - var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map(function (key) { - return Symbol[key]; - }).filter(isSymbol)); - var get = /*#__PURE__*/createGetter(); - var readonlyGet = /*#__PURE__*/createGetter(true); - var arrayInstrumentations = /*#__PURE__*/createArrayInstrumentations(); - - function createArrayInstrumentations() { - var instrumentations = {}; - ['includes', 'indexOf', 'lastIndexOf'].forEach(function (key) { - instrumentations[key] = function () { - var arr = toRaw(this); - - for (var i = 0, l = this.length; i < l; i++) { - track(arr, "get" - /* GET */ - , i + ''); - } // we run the method using the original args first (which may be reactive) - - - for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) { - args[_key3] = arguments[_key3]; - } - - var res = arr[key].apply(arr, args); - - if (res === -1 || res === false) { - // if that didn't work, run it again using raw values. - return arr[key].apply(arr, _toConsumableArray(args.map(toRaw))); - } else { - return res; - } - }; - }); - ['push', 'pop', 'shift', 'unshift', 'splice'].forEach(function (key) { - instrumentations[key] = function () { - pauseTracking(); - - for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) { - args[_key4] = arguments[_key4]; - } - - var res = toRaw(this)[key].apply(this, args); - resetTracking(); - return res; - }; - }); - return instrumentations; - } - - function createGetter() { - var isReadonly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - var shallow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - return function get(target, key, receiver) { - if (key === "__v_isReactive" - /* IS_REACTIVE */ - ) { - return !isReadonly; - } else if (key === "__v_isReadonly" - /* IS_READONLY */ - ) { - return isReadonly; - } else if (key === "__v_raw" - /* RAW */ - && receiver === (isReadonly ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { - return target; - } - - var targetIsArray = isArray(target); - - if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) { - return Reflect.get(arrayInstrumentations, key, receiver); - } - - var res = Reflect.get(target, key, receiver); - - if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { - return res; - } - - if (!isReadonly) { - track(target, "get" - /* GET */ - , key); - } - - if (shallow) { - return res; - } - - if (isRef(res)) { - // ref unwrapping - does not apply for Array + integer key. - var shouldUnwrap = !targetIsArray || !isIntegerKey(key); - return shouldUnwrap ? res.value : res; - } - - if (isObject(res)) { - // Convert returned value into a proxy as well. we do the isObject check - // here to avoid invalid value warning. Also need to lazy access readonly - // and reactive here to avoid circular dependency. - return isReadonly ? readonly(res) : reactive(res); - } - - return res; - }; - } - - var set$1 = /*#__PURE__*/createSetter(); - - function createSetter() { - var shallow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - return function set(target, key, value, receiver) { - var oldValue = target[key]; - - if (!shallow && !isReadonly(value)) { - value = toRaw(value); - oldValue = toRaw(oldValue); - - if (!isArray(target) && isRef(oldValue) && !isRef(value)) { - oldValue.value = value; - return true; - } - } - - var hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); - var result = Reflect.set(target, key, value, receiver); // don't trigger if target is something up in the prototype chain of original - - if (target === toRaw(receiver)) { - if (!hadKey) { - trigger(target, "add" - /* ADD */ - , key, value); - } else if (hasChanged$1(value, oldValue)) { - trigger(target, "set" - /* SET */ - , key, value, oldValue); - } - } - - return result; - }; - } - - function deleteProperty(target, key) { - var hadKey = hasOwn(target, key); - var oldValue = target[key]; - var result = Reflect.deleteProperty(target, key); - - if (result && hadKey) { - trigger(target, "delete" - /* DELETE */ - , key, undefined, oldValue); - } - - return result; - } - - function has$1(target, key) { - var result = Reflect.has(target, key); - - if (!isSymbol(key) || !builtInSymbols.has(key)) { - track(target, "has" - /* HAS */ - , key); - } - - return result; - } - - function ownKeys(target) { - track(target, "iterate" - /* ITERATE */ - , isArray(target) ? 'length' : ITERATE_KEY); - return Reflect.ownKeys(target); - } - - var mutableHandlers = { - get: get, - set: set$1, - deleteProperty: deleteProperty, - has: has$1, - ownKeys: ownKeys - }; - var readonlyHandlers = { - get: readonlyGet, - set: function set(target, key) { - { - console.warn("Set operation on key \"".concat(String(key), "\" failed: target is readonly."), target); - } - return true; - }, - deleteProperty: function deleteProperty(target, key) { - { - console.warn("Delete operation on key \"".concat(String(key), "\" failed: target is readonly."), target); - } - return true; - } - }; - - var toShallow = function toShallow(value) { - return value; - }; - - var getProto = function getProto(v) { - return Reflect.getPrototypeOf(v); - }; - - function get$1(target, key) { - var isReadonly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var isShallow = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - // #1772: readonly(reactive(Map)) should return readonly + reactive version - // of the value - target = target["__v_raw" - /* RAW */ - ]; - var rawTarget = toRaw(target); - var rawKey = toRaw(key); - - if (key !== rawKey) { - !isReadonly && track(rawTarget, "get" - /* GET */ - , key); - } - - !isReadonly && track(rawTarget, "get" - /* GET */ - , rawKey); - - var _getProto = getProto(rawTarget), - has = _getProto.has; - - var wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; - - if (has.call(rawTarget, key)) { - return wrap(target.get(key)); - } else if (has.call(rawTarget, rawKey)) { - return wrap(target.get(rawKey)); - } else if (target !== rawTarget) { - // #3602 readonly(reactive(Map)) - // ensure that the nested reactive `Map` can do tracking for itself - target.get(key); - } - } - - function has$1$1(key) { - var isReadonly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var target = this["__v_raw" - /* RAW */ - ]; - var rawTarget = toRaw(target); - var rawKey = toRaw(key); - - if (key !== rawKey) { - !isReadonly && track(rawTarget, "has" - /* HAS */ - , key); - } - - !isReadonly && track(rawTarget, "has" - /* HAS */ - , rawKey); - return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); - } - - function size(target) { - var isReadonly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - target = target["__v_raw" - /* RAW */ - ]; - !isReadonly && track(toRaw(target), "iterate" - /* ITERATE */ - , ITERATE_KEY); - return Reflect.get(target, 'size', target); - } - - function add(value) { - value = toRaw(value); - var target = toRaw(this); - var proto = getProto(target); - var hadKey = proto.has.call(target, value); - - if (!hadKey) { - target.add(value); - trigger(target, "add" - /* ADD */ - , value, value); - } - - return this; - } - - function set$1$1(key, value) { - value = toRaw(value); - var target = toRaw(this); - - var _getProto2 = getProto(target), - has = _getProto2.has, - get = _getProto2.get; - - var hadKey = has.call(target, key); - - if (!hadKey) { - key = toRaw(key); - hadKey = has.call(target, key); - } else { - checkIdentityKeys(target, has, key); - } - - var oldValue = get.call(target, key); - target.set(key, value); - - if (!hadKey) { - trigger(target, "add" - /* ADD */ - , key, value); - } else if (hasChanged$1(value, oldValue)) { - trigger(target, "set" - /* SET */ - , key, value, oldValue); - } - - return this; - } - - function deleteEntry(key) { - var target = toRaw(this); - - var _getProto3 = getProto(target), - has = _getProto3.has, - get = _getProto3.get; - - var hadKey = has.call(target, key); - - if (!hadKey) { - key = toRaw(key); - hadKey = has.call(target, key); - } else { - checkIdentityKeys(target, has, key); - } - - var oldValue = get ? get.call(target, key) : undefined; // forward the operation before queueing reactions - - var result = target.delete(key); - - if (hadKey) { - trigger(target, "delete" - /* DELETE */ - , key, undefined, oldValue); - } - - return result; - } - - function clear() { - var target = toRaw(this); - var hadItems = target.size !== 0; - var oldTarget = isMap$1(target) ? new Map(target) : new Set(target); // forward the operation before queueing reactions - - var result = target.clear(); - - if (hadItems) { - trigger(target, "clear" - /* CLEAR */ - , undefined, undefined, oldTarget); - } - - return result; - } - - function createForEach(isReadonly, isShallow) { - return function forEach(callback, thisArg) { - var observed = this; - var target = observed["__v_raw" - /* RAW */ - ]; - var rawTarget = toRaw(target); - var wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; - !isReadonly && track(rawTarget, "iterate" - /* ITERATE */ - , ITERATE_KEY); - return target.forEach(function (value, key) { - // important: make sure the callback is - // 1. invoked with the reactive map as `this` and 3rd arg - // 2. the value received should be a corresponding reactive/readonly. - return callback.call(thisArg, wrap(value), wrap(key), observed); - }); - }; - } - - function createIterableMethod(method, isReadonly, isShallow) { - return function () { - var target = this["__v_raw" - /* RAW */ - ]; - var rawTarget = toRaw(target); - var targetIsMap = isMap$1(rawTarget); - var isPair = method === 'entries' || method === Symbol.iterator && targetIsMap; - var isKeyOnly = method === 'keys' && targetIsMap; - var innerIterator = target[method].apply(target, arguments); - var wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; - !isReadonly && track(rawTarget, "iterate" - /* ITERATE */ - , isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); // return a wrapped iterator which returns observed versions of the - // values emitted from the real iterator - - return _defineProperty({ - // iterator protocol - next: function next() { - var _innerIterator$next = innerIterator.next(), - value = _innerIterator$next.value, - done = _innerIterator$next.done; - - return done ? { - value: value, - done: done - } : { - value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), - done: done - }; - } - }, Symbol.iterator, function () { - return this; - }); - }; - } - - function createReadonlyMethod(type) { - return function () { - { - var key = (arguments.length <= 0 ? undefined : arguments[0]) ? "on key \"".concat(arguments.length <= 0 ? undefined : arguments[0], "\" ") : ""; - console.warn("".concat(capitalize(type), " operation ").concat(key, "failed: target is readonly."), toRaw(this)); - } - return type === "delete" - /* DELETE */ - ? false : this; - }; - } - - function createInstrumentations() { - var mutableInstrumentations = { - get: function get(key) { - return get$1(this, key); - }, - - get size() { - return size(this); - }, - - has: has$1$1, - add: add, - set: set$1$1, - delete: deleteEntry, - clear: clear, - forEach: createForEach(false, false) - }; - var shallowInstrumentations = { - get: function get(key) { - return get$1(this, key, false, true); - }, - - get size() { - return size(this); - }, - - has: has$1$1, - add: add, - set: set$1$1, - delete: deleteEntry, - clear: clear, - forEach: createForEach(false, true) - }; - var readonlyInstrumentations = { - get: function get(key) { - return get$1(this, key, true); - }, - - get size() { - return size(this, true); - }, - - has: function has(key) { - return has$1$1.call(this, key, true); - }, - add: createReadonlyMethod("add" - /* ADD */ - ), - set: createReadonlyMethod("set" - /* SET */ - ), - delete: createReadonlyMethod("delete" - /* DELETE */ - ), - clear: createReadonlyMethod("clear" - /* CLEAR */ - ), - forEach: createForEach(true, false) - }; - var shallowReadonlyInstrumentations = { - get: function get(key) { - return get$1(this, key, true, true); - }, - - get size() { - return size(this, true); - }, - - has: function has(key) { - return has$1$1.call(this, key, true); - }, - add: createReadonlyMethod("add" - /* ADD */ - ), - set: createReadonlyMethod("set" - /* SET */ - ), - delete: createReadonlyMethod("delete" - /* DELETE */ - ), - clear: createReadonlyMethod("clear" - /* CLEAR */ - ), - forEach: createForEach(true, true) - }; - var iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator]; - iteratorMethods.forEach(function (method) { - mutableInstrumentations[method] = createIterableMethod(method, false, false); - readonlyInstrumentations[method] = createIterableMethod(method, true, false); - shallowInstrumentations[method] = createIterableMethod(method, false, true); - shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true); - }); - return [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations]; - } - - var _createInstrumentatio = /* #__PURE__*/createInstrumentations(), - _createInstrumentatio2 = _slicedToArray(_createInstrumentatio, 4), - mutableInstrumentations = _createInstrumentatio2[0], - readonlyInstrumentations = _createInstrumentatio2[1], - shallowInstrumentations = _createInstrumentatio2[2], - shallowReadonlyInstrumentations = _createInstrumentatio2[3]; - - function createInstrumentationGetter(isReadonly, shallow) { - var instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations; - return function (target, key, receiver) { - if (key === "__v_isReactive" - /* IS_REACTIVE */ - ) { - return !isReadonly; - } else if (key === "__v_isReadonly" - /* IS_READONLY */ - ) { - return isReadonly; - } else if (key === "__v_raw" - /* RAW */ - ) { - return target; - } - - return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); - }; - } - - var mutableCollectionHandlers = { - get: /*#__PURE__*/createInstrumentationGetter(false, false) - }; - var readonlyCollectionHandlers = { - get: /*#__PURE__*/createInstrumentationGetter(true, false) - }; - - function checkIdentityKeys(target, has, key) { - var rawKey = toRaw(key); - - if (rawKey !== key && has.call(target, rawKey)) { - var type = toRawType(target); - console.warn("Reactive ".concat(type, " contains both the raw and reactive ") + "versions of the same object".concat(type === "Map" ? " as keys" : "", ", ") + "which can lead to inconsistencies. " + "Avoid differentiating between the raw and reactive versions " + "of an object and only use the reactive version if possible."); - } - } - - var reactiveMap = new WeakMap(); - var shallowReactiveMap = new WeakMap(); - var readonlyMap = new WeakMap(); - var shallowReadonlyMap = new WeakMap(); - - function targetTypeMap(rawType) { - switch (rawType) { - case 'Object': - case 'Array': - return 1 - /* COMMON */ - ; - - case 'Map': - case 'Set': - case 'WeakMap': - case 'WeakSet': - return 2 - /* COLLECTION */ - ; - - default: - return 0 - /* INVALID */ - ; - } - } - - function getTargetType(value) { - return value["__v_skip" - /* SKIP */ - ] || !Object.isExtensible(value) ? 0 - /* INVALID */ - : targetTypeMap(toRawType(value)); - } - - function reactive(target) { - // if trying to observe a readonly proxy, return the readonly version. - if (target && target["__v_isReadonly" - /* IS_READONLY */ - ]) { - return target; - } - - return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); - } - /** - * Creates a readonly copy of the original object. Note the returned copy is not - * made reactive, but `readonly` can be called on an already reactive object. - */ - - - function readonly(target) { - return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); - } - - function createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) { - if (!isObject(target)) { - { - console.warn("value cannot be made reactive: ".concat(String(target))); - } - return target; - } // target is already a Proxy, return it. - // exception: calling readonly() on a reactive object - - - if (target["__v_raw" - /* RAW */ - ] && !(isReadonly && target["__v_isReactive" - /* IS_REACTIVE */ - ])) { - return target; - } // target already has corresponding Proxy - - - var existingProxy = proxyMap.get(target); - - if (existingProxy) { - return existingProxy; - } // only a whitelist of value types can be observed. - - - var targetType = getTargetType(target); - - if (targetType === 0 - /* INVALID */ - ) { - return target; - } - - var proxy = new Proxy(target, targetType === 2 - /* COLLECTION */ - ? collectionHandlers : baseHandlers); - proxyMap.set(target, proxy); - return proxy; - } - - function isReactive(value) { - if (isReadonly(value)) { - return isReactive(value["__v_raw" - /* RAW */ - ]); - } - - return !!(value && value["__v_isReactive" - /* IS_REACTIVE */ - ]); - } - - function isReadonly(value) { - return !!(value && value["__v_isReadonly" - /* IS_READONLY */ - ]); - } - - function toRaw(observed) { - var raw = observed && observed["__v_raw" - /* RAW */ - ]; - return raw ? toRaw(raw) : observed; - } - - var toReactive = function toReactive(value) { - return isObject(value) ? reactive(value) : value; - }; - - var toReadonly = function toReadonly(value) { - return isObject(value) ? readonly(value) : value; - }; - - function trackRefValue(ref) { - if (isTracking()) { - ref = toRaw(ref); - - if (!ref.dep) { - ref.dep = createDep(); - } - - { - trackEffects(ref.dep, { - target: ref, - type: "get" - /* GET */ - , - key: 'value' - }); - } - } - } - - function triggerRefValue(ref, newVal) { - ref = toRaw(ref); - - if (ref.dep) { - { - triggerEffects(ref.dep, { - target: ref, - type: "set" - /* SET */ - , - key: 'value', - newValue: newVal - }); - } - } - } - - function isRef(r) { - return Boolean(r && r.__v_isRef === true); - } - - var ComputedRefImpl = /*#__PURE__*/function () { - function ComputedRefImpl(getter, _setter, isReadonly) { - var _this2 = this; - - _classCallCheck(this, ComputedRefImpl); - - this._setter = _setter; - this.dep = undefined; - this._dirty = true; - this.__v_isRef = true; - this.effect = new ReactiveEffect(getter, function () { - if (!_this2._dirty) { - _this2._dirty = true; - triggerRefValue(_this2); - } - }); - this["__v_isReadonly" - /* IS_READONLY */ - ] = isReadonly; - } - - _createClass(ComputedRefImpl, [{ - key: "value", - get: function get() { - // the computed ref may get wrapped by other proxies e.g. readonly() #3376 - var self = toRaw(this); - trackRefValue(self); - - if (self._dirty) { - self._dirty = false; - self._value = self.effect.run(); - } - - return self._value; - }, - set: function set(newValue) { - this._setter(newValue); - } - }]); - - return ComputedRefImpl; - }(); - - function computed(getterOrOptions, debugOptions) { - var getter; - var setter; - var onlyGetter = isFunction(getterOrOptions); - - if (onlyGetter) { - getter = getterOrOptions; - - setter = function setter() { - console.warn('Write operation failed: computed value is readonly'); - }; - } else { - getter = getterOrOptions.get; - setter = getterOrOptions.set; - } - - var cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter); - - if (debugOptions) { - cRef.effect.onTrack = debugOptions.onTrack; - cRef.effect.onTrigger = debugOptions.onTrigger; - } - - return cRef; - } - - Promise.resolve(); - - function noop() {} - function isNative(Ctor) { - return typeof Ctor === "function" && /native code/.test(Ctor.toString()); - } - var isIE = function isIE() { - if (typeof navigator === "undefined") { - return false; - } - - return /(msie|trident)/i.test(navigator.userAgent.toLowerCase()); - }; - var getIEVersion = function getIEVersion() { - var version = 0; - - if (typeof navigator === "undefined") { - return false; - } - - var agent = navigator.userAgent.toLowerCase(); - var v1 = agent.match(/(?:msie\s([\w.]+))/); - var v2 = agent.match(/(?:trident.*rv:([\w.]+))/); - - if (v1 && v2 && v1[1] && v2[1]) { - version = Math.max(v1[1] * 1, v2[1] * 1); - } else if (v1 && v1[1]) { - version = v1[1] * 1; - } else if (v2 && v2[1]) { - version = v2[1] * 1; - } else { - version = 0; - } - - return version; - }; - isIE() && getIEVersion() < 9; - var _toString = Object.prototype.toString; - function isPlainObject(obj) { - return _toString.call(obj) === "[object Object]"; - } - - function parsePath(path) { - // if (bailRE.test(path)) { - // return; - // } - var segments = path.length > 0 ? path.split(".") : []; - return function (obj) { - for (var i = 0; i < segments.length; i++) { - if (!obj) return; - obj = obj[segments[i]]; - } - - return obj; - }; - } - var nextTick = function () { - var callbacks = []; - var pending = false; - var timerFunc; - - function nextTickHandler() { - pending = false; - var copies = callbacks.slice(0); - callbacks.length = 0; - - for (var i = 0; i < copies.length; i++) { - copies[i](); - } - } // An asynchronous deferring mechanism. - // In pre 2.4, we used to use microtasks (Promise/MutationObserver) - // but microtasks actually has too high a priority and fires in between - // supposedly sequential events (e.g. #4521, #6690) or even between - // bubbling of the same event (#6566). Technically setImmediate should be - // the ideal choice, but it's not available everywhere; and the only polyfill - // that consistently queues the callback after all DOM events triggered in the - // same loop is by using MessageChannel. - - /* istanbul ignore if */ - - - if (typeof setImmediate !== "undefined" && isNative(setImmediate)) { - timerFunc = function timerFunc() { - setImmediate(nextTickHandler); - }; - } else if (typeof MessageChannel !== "undefined" && (isNative(MessageChannel) || // PhantomJS - MessageChannel.toString() === "[object MessageChannelConstructor]")) { - var channel = new MessageChannel(); - var port = channel.port2; - channel.port1.onmessage = nextTickHandler; - - timerFunc = function timerFunc() { - port.postMessage(1); - }; - } else if (typeof Promise !== "undefined" && isNative(Promise)) { - /* istanbul ignore next */ - // use microtask in non-DOM environments, e.g. Weex - var p = Promise.resolve(); - - timerFunc = function timerFunc() { - p.then(nextTickHandler); - }; - } else { - // fallback to setTimeout - timerFunc = function timerFunc() { - setTimeout(nextTickHandler, 0); - }; - } - - return function queueNextTick(cb, ctx) { - var _resolve; - - callbacks.push(function () { - if (cb) { - try { - cb.call(ctx); - } catch (e) { - console.error(e); - } - } else if (_resolve) { - _resolve(ctx); - } - }); - - if (!pending) { - pending = true; - timerFunc(); - } // $flow-disable-line - - - if (!cb && typeof Promise !== "undefined") { - return new Promise(function (resolve) { - _resolve = resolve; - }); - } - }; - }(); - - var mixinInjection = {}; - function getMixins(type) { - return mixinInjection[type]; - } - function mixin(xtype, cls) { - mixinInjection[xtype] = BI._.cloneDeep(cls); - } - - var queue = []; - var has = {}; - var waiting = false; - var flushing = false; - var index = 0; - - function resetSchedulerState() { - index = queue.length = 0; - has = {}; - waiting = flushing = false; - } - - function flushSchedulerQueue() { - flushing = true; - var watcher; - var id; - var options; // Sort queue before flush. - // This ensures that: - // 1. Components are updated from parent to child. (because parent is always - // created before the child) - // 2. A component's user watchers are run before its render watcher (because - // user watchers are created before the render watcher) - // 3. If a component is destroyed during a parent component's watcher run, - // its watchers can be skipped. - - queue.sort(function (a, b) { - return a.id - b.id; - }); // do not cache length because more watchers might be pushed - // as we run existing watchers - - for (index = 0; index < queue.length; index++) { - watcher = queue[index].watcher; - options = queue[index].options; - id = watcher.id; - has[id] = null; - watcher(options); - } - - resetSchedulerState(); - } - - function queueWatcher(watcher, options) { - var id = watcher.id; - - if (has[id] == null) { - has[id] = true; - - if (!flushing) { - queue.push({ - watcher: watcher, - options: options - }); - } else { - // if already flushing, splice the watcher based on its id - // if already past its id, it will be run next immediately. - var i = queue.length - 1; - - while (i > index && queue[i].watcher.id > watcher.id) { - i--; - } - - queue.splice(i + 1, 0, { - watcher: watcher, - options: options - }); - } // queue the flush - - - if (!waiting) { - waiting = true; - nextTick(flushSchedulerQueue); - } - } - } - - function innerWatch(source, cb, options) { - if (!BI._.isFunction(cb)) { - console.warn("`watch(fn, options?)` signature has been moved to a separate API. " + "Use `watchEffect(fn, options?)` instead. `watch` now only " + "supports `watch(source, cb, options?) signature."); - } - - return doWatch(source, cb, options); - } - var INITIAL_WATCHER_VALUE = {}; - var objectToString = Object.prototype.toString; - - var toTypeString = function toTypeString(value) { - return objectToString.call(value); - }; - - var isMap = function isMap(val) { - return toTypeString(val) === "[object Map]"; - }; - - var isSet = function isSet(val) { - return toTypeString(val) === "[object Set]"; - }; - - var hasChanged = function hasChanged(value, oldValue) { - return value !== oldValue && (value === value || oldValue === oldValue); - }; - - var uid = 0; - - function doWatch(source, cb, options, instance) { - options = options || {}; - var _options = options, - immediate = _options.immediate, - deep = _options.deep, - sync = _options.sync, - onTrack = _options.onTrack, - onTrigger = _options.onTrigger; - - if (!cb) { - if (immediate !== undefined) { - console.warn("watch() \"immediate\" option is only respected when using the " + "watch(source, callback, options?) signature."); - } - - if (deep !== undefined) { - console.warn("watch() \"deep\" option is only respected when using the " + "watch(source, callback, options?) signature."); - } - } - - var warnInvalidSource = function warnInvalidSource(s) { - console.warn("Invalid watch source: ", s, "A watch source can only be a getter/effect function, a ref, " + "a reactive object, or an array of these types."); - }; - - var getter; - var forceTrigger = false; - - if (isRef(source)) { - getter = function getter() { - return source.value; - }; - - forceTrigger = !!source._shallow; - } else if (isReactive(source)) { - getter = function getter() { - return source; - }; - - deep = true; - } else if (BI._.isArray(source)) { - getter = function getter() { - return source.map(function (s) { - if (isRef(s)) { - return s.value; - } else if (isReactive(s)) { - return traverse(s); - } else if (BI._.isFunction(s)) { - return s.call(instance); - } else { - warnInvalidSource(s); - } - }); - }; - } else if (BI._.isFunction(source)) { - if (cb) { - // getter with cb - getter = function getter() { - return source.call(instance); - }; - } else { - // no cb -> simple effect - getter = function getter() { - if (instance && instance.isUnmounted) { - return; - } - - if (cleanup) { - cleanup(); - } - - return source.call(instance, onInvalidate); - }; - } - } else { - getter = function getter() {}; - - warnInvalidSource(source); - } - - if (cb && deep) { - var baseGetter = getter; - - getter = function getter() { - return traverse(baseGetter()); - }; - } - - var cleanup; - - var onInvalidate = function onInvalidate(fn) { - cleanup = runner.options.onStop = function () { - fn.call(instance); - }; - }; - - var oldValue = BI._.isArray(source) ? [] : INITIAL_WATCHER_VALUE; - - var job = function job() { - // 这里去掉的原因是,新增属性没有生效也会触发变化监听 - if (!runner.effect.active) { - return; - } - - if (cb) { - // watch(source, cb) - var newValue = runner(); - - if (deep || forceTrigger || hasChanged(newValue, oldValue)) { - // cleanup before running cb again - if (cleanup) { - cleanup(); - } - - cb.apply(instance, [newValue, // pass undefined as the old value when it's changed for the first time - oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue, onInvalidate]); - oldValue = newValue; - } - } else { - // watchEffect - runner(); - } - }; // important: mark the job as a watcher callback so that scheduler knows - // it is allowed to self-trigger (#1727) - - - job.allowRecurse = !!cb; - job.id = ++uid; - var scheduler; - - if (sync === true) { - scheduler = job; - } else { - scheduler = function scheduler() { - return queueWatcher(job); - }; - } - - var runner = effect(function () { - try { - return getter(); - } catch (e) {// 吞掉异常 - } - }, { - lazy: true, - onTrack: onTrack, - onTrigger: onTrigger, - scheduler: scheduler - }); // initial run - - if (cb) { - if (immediate) { - job(); - } else { - oldValue = runner(); - } - } else { - runner(); - } - - return function () { - stop(runner); - }; - } - - function traverse(value) { - var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set(); - - if (!BI._.isObject(value) || seen.has(value)) { - return value; - } - - seen.add(value); - - if (isRef(value)) { - traverse(value.value, seen); - } else if (BI._.isArray(value)) { - for (var i = 0; i < value.length; i++) { - traverse(value[i], seen); - } - } else if (isSet(value) || isMap(value)) { - value.forEach(function (v) { - traverse(v, seen); - }); - } else { - for (var key in value) { - traverse(value[key], seen); - } - } - - return value; - } - - var falsy; - var operators = { - "||": falsy, - "&&": falsy, - "(": falsy, - ")": falsy - }; - - function runBinaryFunction(binarys) { - var expr = ""; - - for (var i = 0, len = binarys.length; i < len; i++) { - if (BI._.isBoolean(binarys[i]) || BI._.has(operators, binarys[i])) { - expr += binarys[i]; - } else { - expr += "false"; - } - } - - return new Function("return " + expr)(); - } - - function watchExp(model, getter) { - var result = getter.call(model, model); - - if (BI._.isArray(result)) { - return result.concat(); - } - - return result; - } - - function watch(model, expOrFn, cb, options) { - if (isPlainObject(cb)) { - options = cb; - cb = cb.handler; - } - - if (typeof cb === "string") { - cb = model[cb]; - } - - options = options || {}; - options.user = true; - var exps; - - if (BI._.isFunction(expOrFn)) { - var watcher = innerWatch(expOrFn, cb, options); - return function unwatchFn() { - watcher(); - }; - } - - if (!(exps = expOrFn.match(/[a-zA-Z0-9BI._.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && !/\*/.test(expOrFn)) { - var paths = expOrFn.split("."); - var prePaths = paths.slice(0, paths.length - 1); - var preGetter = parsePath(prePaths.join(".")); - var v = preGetter.call(model, model); - var getter = parsePath(paths[paths.length - 1]); - - var _watcher = innerWatch(function () { - return watchExp(v, getter); - }, cb, options); - - return function unwatchFn() { - _watcher(); - }; - } - - var watchers = []; - var fns = exps.slice(); - var complete = false, - running = false; - - var callback = function callback(index, newValue, oldValue, attrs) { - if (complete === true) { - return; - } - - fns[index] = true; - - if (runBinaryFunction(fns)) { - complete = true; - cb(newValue, oldValue, attrs); - } - - if (options && options.sync) { - complete = false; - running = false; - fns = exps.slice(); - } else { - if (!running) { - running = true; - nextTick(function () { - complete = false; - running = false; - fns = exps.slice(); - }); - } - } - }; - - BI._.each(exps, function (exp, i) { - if (BI._.has(operators, exp)) { - return; - } - - if (exp.indexOf("*") >= 0) { - // eslint-disable-next-line no-inner-declarations - var travers = function travers(root, deps, parent, key, res) { - if (deps.length === _paths.length) { - root !== undefined && res.push({ - parent: parent, - k: key - }); - return; - } - - if (root) { - if (_paths[deps.length] === "*") { - // 遍历所有节点 - for (var k in root) { - travers(root[k], deps.concat([k]), root, k, res); - } - } else { - var nextKey = _paths[deps.length]; - travers(root[nextKey], deps.concat([nextKey]), root, nextKey, res); - } - } - }; - - //a.**形式 - if (/^[1-9a-zA-Z.]+\*\*$/.test(exp) || exp === "**") { - exp = exp.replace(".**", ""); - - var _paths2 = exp.split("."); - - var _prePaths2 = _paths2.slice(0, _paths2.length - 1); - - var _preGetter = parsePath(_prePaths2.join(".")); - - var _v2 = _preGetter.call(model, model); - - var _getter = exp === "**" ? function (m) { - return m; - } : parsePath(_paths2[_paths2.length - 1]); - - watchers.push(innerWatch(function () { - return watchExp(_v2, _getter); - }, function (newValue, oldValue) { - // a.** 在a变化的时候不会触发change - if (!BI._.isArray(newValue) && oldValue !== newValue) { - return; - } - - callback(i, NaN, NaN, BI._.extend({ - index: i - })); - }, BI._.extend({ - deep: true - }, options))); - return; - } - - if (/^(\*\*\.)+[1-9a-zA-Z]+(\.\*\*$)/.test(exp)) { - throw new Error("not support"); - } //含有*的情况,如a.*,如*.a,*.*.a,a.*.a - //先获取到能获取到的对象 - - - var _paths = exp.split("."); - - var _prePaths = []; - - for (var _i = 0, len = _paths.length; _i < len; _i++) { - if (_paths[_i] === "*") { - break; - } - - _prePaths[_i] = _paths[_i]; - } - - var _v; - - if (_prePaths.length > 0) { - var _getter2 = parsePath(_prePaths.join(".")); - - _v = _getter2.call(model, model); - } else { - _v = model; - } - - _paths = _paths.slice(_prePaths.length); - var changes = []; - watchers.push(innerWatch(function () { - var routes = []; - travers(_v, [], _v, null, routes); - - for (var _i2 = 0, _len = routes.length; _i2 < _len; _i2++) { - var _routes$_i = routes[_i2], - parent = _routes$_i.parent, - k = _routes$_i.k; - - for (var j = 0, l = changes.length; j < l; j++) { - var _changes$j = changes[j], - target = _changes$j.target, - key = _changes$j.key; - - if (target === toRaw(parent) && key === k) { - return true; - } - } - } - }, function (newValue) { - changes = []; - - if (newValue === true) { - callback(i, NaN, NaN, BI._.extend({ - index: i - })); - } - }, BI._.extend({}, options, { - deep: true, - onTrigger: function onTrigger(_ref) { - var target = _ref.target, - key = _ref.key; - changes.push({ - target: target, - key: key - }); - } - }))); - return; - } - - var getter = parsePath(exp); - watchers.push(innerWatch(function () { - return watchExp(model, getter); - }, function (newValue, oldValue) { - callback(i, newValue, oldValue, BI._.extend({ - index: i - })); - }, options)); - }); - - return watchers; - } - - var REACTIVE = true; - - function initState(vm, state) { - if (state) { - vm.$$state = REACTIVE ? reactive(state) : state; - } - } - - function initComputed(vm, c) { - var $$computed = vm.$$computed = {}; - - for (var key in c) { - $$computed[key] = computed(BI._.bind(c[key], vm)); - } - } - - function initWatch(vm, watch) { - vm._watchers || (vm._watchers = []); - - for (var key in watch) { - var handler = watch[key]; - - if (BI._.isArray(handler)) { - for (var i = 0; i < handler.length; i++) { - vm._watchers.push(createWatcher(vm, key, handler[i])); - } - } else { - vm._watchers.push(createWatcher(vm, key, handler)); - } - } - } - - function createWatcher(vm, keyOrFn, cb, options) { - if (isPlainObject(cb)) { - options = cb; - cb = cb.handler; - } - - if (typeof cb === "string") { - cb = vm[cb]; - } - - return watch(vm.model, keyOrFn, BI._.bind(cb, vm), options); - } - - function initMethods(vm, methods) { - for (var key in methods) { - vm[key] = methods[key] == null ? noop : BI._.bind(methods[key], vm); - } - } - - function initMixins(vm, mixins) { - mixins = (mixins || []).slice(0); - - BI._.each(mixins.reverse(), function (mixinType) { - var mixin = getMixins(mixinType); - - for (var key in mixin) { - if (typeof mixin[key] !== "function") continue; - if (BI._.has(vm, key)) continue; - vm[key] = BI._.bind(mixin[key], vm); - } - }); - } - - function defineProps(vm) { - vm.model = new Proxy({}, { - get: function get(target, key) { - if (vm.$$computed && key in vm.$$computed) { - try { - return vm.$$computed[key].value; - } catch (e) {// 吞掉异常 - } - - return; - } - - if (vm.$$state && key in vm.$$state) { - return vm.$$state[key]; - } - - var p = vm._parent; - - while (p) { - if (p.$$context && key in p.$$context) { - return p.$$context[key]; - } - - p = p._parent; - } - }, - set: function set(target, key, value) { - if (vm.$$state && key in vm.$$state) { - vm.$$state[key] = value; - return true; - } - - var p = vm._parent; - - while (p) { - if (p.$$context && key in p.$$context) { - p.$$context[key] = value; - return true; - } - - p = p._parent; - } - - return true; - } - }); - } - - function defineContext(vm, keys) { - var props = {}; - - var _loop = function _loop(i, len) { - var key = keys[i]; - props[key] = { - enumerable: true, - configurable: true, - get: function get() { - return vm.model[key]; - }, - set: function set(val) { - return vm.model[key] = val; - } - }; - }; - - for (var i = 0, len = keys.length; i < len; i++) { - _loop(i); - } - - vm.$$context = Object.defineProperties({}, props); - } - - function getInjectValue(vm, key) { - var p = vm._parent; - - while (p) { - if (p.$$context && key in p.$$context) { - return p.$$context[key]; - } - - p = p._parent; - } - } - - function getInjectValues(vm) { - var inject = vm.inject || []; - var result = {}; - - BI._.each(inject, function (key) { - result[key] = getInjectValue(vm, key); - }); - - return result; - } - - var Model = /*#__PURE__*/function () { - function Model() { - _classCallCheck(this, Model); - } - - _createClass(Model, [{ - key: "_constructor", - value: function _constructor(options, destroyHandler) { - this.options = options || {}; - this._parent = Model.target; - var state = BI._.isFunction(this.state) ? this.state() : this.state; - var computed = this.computed; - var context = this.context; - var inject = this.inject; - var childContext = this.childContext; - var watch = this.watch; - var actions = this.actions; - - BI._.keys(state).concat(BI._.keys(computed)).concat(inject || []).concat(context || []); - - var mixins = this.mixins; - defineProps(this); - childContext && defineContext(this, childContext); - initMixins(this, mixins); - this.init(); - initState(this, BI._.extend(getInjectValues(this), state)); - initComputed(this, computed); - REACTIVE && initWatch(this, watch); - initMethods(this, actions); - this.created && this.created(); - this._destroyHandler = destroyHandler; - } - }, { - key: "_init", - value: function _init() {} - }, { - key: "init", - value: function init() { - this._init(); - } - }, { - key: "destroy", - value: function destroy() { - BI._.each(this._watchers, function (unwatches) { - unwatches = BI._.isArray(unwatches) ? unwatches : [unwatches]; - - BI._.each(unwatches, function (unwatch) { - unwatch(); - }); - }); - - this._watchers && (this._watchers = []); - this.destroyed && this.destroyed(); - this.$$computed = null; - this.$$state = null; - this._destroyHandler && this._destroyHandler(); - } - }]); - - return Model; - }(); - function set(target, key, val) { - if (BI._.isArray(target)) { - target.length = Math.max(target.length, key); - target.splice(key, 1, val); - return val; - } - - target[key] = val; - return target; - } - function freeze(value) { - Object.defineProperty(value, '__v_skip', { - configurable: true, - enumerable: false, - value: value - }); - return value; - } - function del(target, key) { - if (BI._.isArray(target)) { - target.splice(key, 1); - return; - } - - if (!BI._.has(target, key)) { - return; - } - - delete target[key]; - } - function define(model) { - return REACTIVE ? reactive(model) : model; - } - function config(options) { - options || (options = {}); - - if ("reactive" in options) { - REACTIVE = options.reactive; - } - } - - function toJSON(model) { - var result; - - if (BI._.isArray(model)) { - result = []; - - for (var i = 0, len = model.length; i < len; i++) { - result[i] = toJSON(model[i]); - } - } else if (model && isPlainObject(model)) { - result = {}; - - for (var key in model) { - result[key] = toJSON(model[key]); - } - } else { - result = model; - } - - return result; - } - - var version = "3.0"; - - exports.Model = Model; - exports.config = config; - exports.define = define; - exports.del = del; - exports.freeze = freeze; - exports.mixin = mixin; - exports.set = set; - exports.toJSON = toJSON; - exports.version = version; - exports.watch = watch; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/dist/fix/worker.compact.js b/dist/fix/worker.compact.js deleted file mode 100644 index e537706ad..000000000 --- a/dist/fix/worker.compact.js +++ /dev/null @@ -1,123 +0,0 @@ -;(function () { - var contexts = {}; - var init = false; - - var WORKER; - - var enableWorker = function () { - if (init) { - return init; - } - // 开启Worker模式 - BI.config("bi.provider.system", function (provider) { - provider.setWorkerMode(true); - }); - var _init = BI.Widget.prototype._init; - BI.Widget.prototype._init = function () { - this.$destroyWorker = createWorker.call(this); - try { - _init.apply(this, arguments); - } catch (e) { - console.error(e); - } - }; - - var _initRender = BI.Widget.prototype._initRender; - var postMessage = function (data) { - switch (data.eventType) { - case "create": - this.model = data.msg; - _initRender.call(this); - break; - case "watch": - var watchArgs = data.args; - this.watch[data.currentWatchType].apply(this, watchArgs); - break; - } - }; - BI.Widget.prototype._initRender = function () { - if (WORKER && this._worker) { - this.__asking = true; - this.__async = true; - } else { - _initRender.apply(this, arguments); - } - }; - - var unMount = BI.Widget.prototype.__d; - BI.Widget.prototype.__d = function () { - this.$destroyWorker && this.$destroyWorker(); - try { - unMount.apply(this, arguments); - } catch (e) { - console.error(e); - } - }; - init = postMessage; - return postMessage; - }; - - BI.useWorker = function (wk) { - if (!_global.Worker || !_global.Proxy) { - return; - } - var postMessage = enableWorker(); - WORKER = wk; - if (WORKER) { - WORKER.addEventListener("message", function (e) { - var data = e.data; - postMessage.apply(contexts[data.name], [data]); - }, false); - } - }; - - function createWorker () { - var self = this; - if (this._worker) { - var name = this.getName(); - var modelType = this._worker(); - var options; - if (BI.isArray(modelType)) { - options = modelType[1]; - modelType = modelType[0]; - } - if (WORKER) { - contexts[name] = this; - WORKER.postMessage({ - type: modelType, - name: name, - eventType: "create", - options: options, - watches: BI.map(this.$watch || this.watch, function (key) { - return key; - }) - }); - var store = {}; - this.store = new Proxy(store, { - get: function (target, key) { - return function () { - WORKER.postMessage({ - type: modelType, - name: name, - eventType: "action", - action: key, - args: [].slice.call(arguments) - }); - }; - }, - set: function (target, key, value) { - return Reflect.set(target, key, value); - } - }); - return function () { - delete contexts[name]; - WORKER.postMessage({ - type: modelType, - name: name, - eventType: "destroy" - }); - }; - } - } - } -}()); diff --git a/dist/font/iconfont.eot b/dist/font/iconfont.eot deleted file mode 100644 index 876d0c407..000000000 Binary files a/dist/font/iconfont.eot and /dev/null differ diff --git a/dist/font/iconfont.svg b/dist/font/iconfont.svg deleted file mode 100644 index bf89d8452..000000000 --- a/dist/font/iconfont.svg +++ /dev/null @@ -1,2117 +0,0 @@ - - - - Created by iconfont - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dist/font/iconfont.ttf b/dist/font/iconfont.ttf deleted file mode 100644 index d126a7c97..000000000 Binary files a/dist/font/iconfont.ttf and /dev/null differ diff --git a/dist/font/iconfont.woff b/dist/font/iconfont.woff deleted file mode 100644 index 3ea104492..000000000 Binary files a/dist/font/iconfont.woff and /dev/null differ diff --git a/dist/font/iconfont.woff2 b/dist/font/iconfont.woff2 deleted file mode 100644 index a695ead6a..000000000 Binary files a/dist/font/iconfont.woff2 and /dev/null differ diff --git a/dist/images/1x/background/auto_color.png b/dist/images/1x/background/auto_color.png deleted file mode 100644 index a7bf3ce94..000000000 Binary files a/dist/images/1x/background/auto_color.png and /dev/null differ diff --git a/dist/images/1x/background/auto_color_disable.png b/dist/images/1x/background/auto_color_disable.png deleted file mode 100644 index a15403d20..000000000 Binary files a/dist/images/1x/background/auto_color_disable.png and /dev/null differ diff --git a/dist/images/1x/background/auto_color_normal.png b/dist/images/1x/background/auto_color_normal.png deleted file mode 100644 index 2018e4725..000000000 Binary files a/dist/images/1x/background/auto_color_normal.png and /dev/null differ diff --git a/dist/images/1x/background/auto_color_normal_disable.png b/dist/images/1x/background/auto_color_normal_disable.png deleted file mode 100644 index fe1fb3035..000000000 Binary files a/dist/images/1x/background/auto_color_normal_disable.png and /dev/null differ diff --git a/dist/images/1x/background/auto_color_normal_select.png b/dist/images/1x/background/auto_color_normal_select.png deleted file mode 100644 index 344b849c1..000000000 Binary files a/dist/images/1x/background/auto_color_normal_select.png and /dev/null differ diff --git a/dist/images/1x/background/auto_color_select.png b/dist/images/1x/background/auto_color_select.png deleted file mode 100644 index 11e92b766..000000000 Binary files a/dist/images/1x/background/auto_color_select.png and /dev/null differ diff --git a/dist/images/1x/background/line_conn.gif b/dist/images/1x/background/line_conn.gif deleted file mode 100644 index d561d36a9..000000000 Binary files a/dist/images/1x/background/line_conn.gif and /dev/null differ diff --git a/dist/images/1x/background/trans_color.png b/dist/images/1x/background/trans_color.png deleted file mode 100644 index f32144f25..000000000 Binary files a/dist/images/1x/background/trans_color.png and /dev/null differ diff --git a/dist/images/1x/background/trans_disable.png b/dist/images/1x/background/trans_disable.png deleted file mode 100644 index c070eb9bb..000000000 Binary files a/dist/images/1x/background/trans_disable.png and /dev/null differ diff --git a/dist/images/1x/background/trans_normal.png b/dist/images/1x/background/trans_normal.png deleted file mode 100644 index 4f63b4314..000000000 Binary files a/dist/images/1x/background/trans_normal.png and /dev/null differ diff --git a/dist/images/1x/background/trans_select.png b/dist/images/1x/background/trans_select.png deleted file mode 100644 index 1e3837a5f..000000000 Binary files a/dist/images/1x/background/trans_select.png and /dev/null differ diff --git a/dist/images/1x/icon/auto_no_square_normal.png b/dist/images/1x/icon/auto_no_square_normal.png deleted file mode 100644 index a2482a149..000000000 Binary files a/dist/images/1x/icon/auto_no_square_normal.png and /dev/null differ diff --git a/dist/images/1x/icon/auto_square_normal.png b/dist/images/1x/icon/auto_square_normal.png deleted file mode 100644 index 1b90b9bb0..000000000 Binary files a/dist/images/1x/icon/auto_square_normal.png and /dev/null differ diff --git a/dist/images/1x/icon/check_box_active.png b/dist/images/1x/icon/check_box_active.png deleted file mode 100644 index c063dff94..000000000 Binary files a/dist/images/1x/icon/check_box_active.png and /dev/null differ diff --git a/dist/images/1x/icon/check_box_disable.png b/dist/images/1x/icon/check_box_disable.png deleted file mode 100644 index bfeefc386..000000000 Binary files a/dist/images/1x/icon/check_box_disable.png and /dev/null differ diff --git a/dist/images/1x/icon/check_box_disable2.png b/dist/images/1x/icon/check_box_disable2.png deleted file mode 100644 index 556ba1c21..000000000 Binary files a/dist/images/1x/icon/check_box_disable2.png and /dev/null differ diff --git a/dist/images/1x/icon/check_box_hover.png b/dist/images/1x/icon/check_box_hover.png deleted file mode 100644 index c452173a0..000000000 Binary files a/dist/images/1x/icon/check_box_hover.png and /dev/null differ diff --git a/dist/images/1x/icon/check_box_normal.png b/dist/images/1x/icon/check_box_normal.png deleted file mode 100644 index 02ecc0515..000000000 Binary files a/dist/images/1x/icon/check_box_normal.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/auto_square_normal.png b/dist/images/1x/icon/dark/auto_square_normal.png deleted file mode 100644 index e9e6405c3..000000000 Binary files a/dist/images/1x/icon/dark/auto_square_normal.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/trans_normal.png b/dist/images/1x/icon/dark/trans_normal.png deleted file mode 100755 index 5de946e14..000000000 Binary files a/dist/images/1x/icon/dark/trans_normal.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/trans_select.png b/dist/images/1x/icon/dark/trans_select.png deleted file mode 100755 index ce061d9ae..000000000 Binary files a/dist/images/1x/icon/dark/trans_select.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_collapse_1.png b/dist/images/1x/icon/dark/tree_collapse_1.png deleted file mode 100644 index 3b8bcf82f..000000000 Binary files a/dist/images/1x/icon/dark/tree_collapse_1.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_collapse_2.png b/dist/images/1x/icon/dark/tree_collapse_2.png deleted file mode 100644 index e05a3c2a1..000000000 Binary files a/dist/images/1x/icon/dark/tree_collapse_2.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_collapse_3.png b/dist/images/1x/icon/dark/tree_collapse_3.png deleted file mode 100644 index b9435ff49..000000000 Binary files a/dist/images/1x/icon/dark/tree_collapse_3.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_collapse_4.png b/dist/images/1x/icon/dark/tree_collapse_4.png deleted file mode 100644 index c83be64c7..000000000 Binary files a/dist/images/1x/icon/dark/tree_collapse_4.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_expand_1.png b/dist/images/1x/icon/dark/tree_expand_1.png deleted file mode 100644 index 4538bdab3..000000000 Binary files a/dist/images/1x/icon/dark/tree_expand_1.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_expand_2.png b/dist/images/1x/icon/dark/tree_expand_2.png deleted file mode 100644 index f6d8fe280..000000000 Binary files a/dist/images/1x/icon/dark/tree_expand_2.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_expand_3.png b/dist/images/1x/icon/dark/tree_expand_3.png deleted file mode 100644 index 48283b573..000000000 Binary files a/dist/images/1x/icon/dark/tree_expand_3.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_expand_4.png b/dist/images/1x/icon/dark/tree_expand_4.png deleted file mode 100644 index 0e2bd0c15..000000000 Binary files a/dist/images/1x/icon/dark/tree_expand_4.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_collapse_1.png b/dist/images/1x/icon/dark/tree_solid_collapse_1.png deleted file mode 100644 index 3825febd3..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_collapse_1.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_collapse_2.png b/dist/images/1x/icon/dark/tree_solid_collapse_2.png deleted file mode 100644 index d9c33bada..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_collapse_2.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_collapse_3.png b/dist/images/1x/icon/dark/tree_solid_collapse_3.png deleted file mode 100644 index a73232ffb..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_collapse_3.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_collapse_4.png b/dist/images/1x/icon/dark/tree_solid_collapse_4.png deleted file mode 100644 index aeb12dd5a..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_collapse_4.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_collapse_5.png b/dist/images/1x/icon/dark/tree_solid_collapse_5.png deleted file mode 100644 index ea1e4a8d6..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_collapse_5.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_expand_1.png b/dist/images/1x/icon/dark/tree_solid_expand_1.png deleted file mode 100644 index 6365fbd12..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_expand_1.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_expand_2.png b/dist/images/1x/icon/dark/tree_solid_expand_2.png deleted file mode 100644 index fa29e6eb1..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_expand_2.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_expand_3.png b/dist/images/1x/icon/dark/tree_solid_expand_3.png deleted file mode 100644 index 9513a4b82..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_expand_3.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_expand_4.png b/dist/images/1x/icon/dark/tree_solid_expand_4.png deleted file mode 100644 index 6be667d7d..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_expand_4.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_expand_5.png b/dist/images/1x/icon/dark/tree_solid_expand_5.png deleted file mode 100644 index 66648d619..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_expand_5.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_vertical_line_1.png b/dist/images/1x/icon/dark/tree_solid_vertical_line_1.png deleted file mode 100644 index a64ab7e49..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_vertical_line_1.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_vertical_line_2.png b/dist/images/1x/icon/dark/tree_solid_vertical_line_2.png deleted file mode 100644 index e43e151e7..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_vertical_line_2.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_vertical_line_3.png b/dist/images/1x/icon/dark/tree_solid_vertical_line_3.png deleted file mode 100644 index a7b4e4bf0..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_vertical_line_3.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_solid_vertical_line_4.png b/dist/images/1x/icon/dark/tree_solid_vertical_line_4.png deleted file mode 100644 index 20d66af62..000000000 Binary files a/dist/images/1x/icon/dark/tree_solid_vertical_line_4.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_vertical_line_1.png b/dist/images/1x/icon/dark/tree_vertical_line_1.png deleted file mode 100644 index da1525d02..000000000 Binary files a/dist/images/1x/icon/dark/tree_vertical_line_1.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_vertical_line_2.png b/dist/images/1x/icon/dark/tree_vertical_line_2.png deleted file mode 100644 index 95dc9470b..000000000 Binary files a/dist/images/1x/icon/dark/tree_vertical_line_2.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_vertical_line_3.png b/dist/images/1x/icon/dark/tree_vertical_line_3.png deleted file mode 100644 index ecd99fd2d..000000000 Binary files a/dist/images/1x/icon/dark/tree_vertical_line_3.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_vertical_line_4.png b/dist/images/1x/icon/dark/tree_vertical_line_4.png deleted file mode 100644 index 6584a862e..000000000 Binary files a/dist/images/1x/icon/dark/tree_vertical_line_4.png and /dev/null differ diff --git a/dist/images/1x/icon/dark/tree_vertical_line_5.png b/dist/images/1x/icon/dark/tree_vertical_line_5.png deleted file mode 100644 index 3125a9baa..000000000 Binary files a/dist/images/1x/icon/dark/tree_vertical_line_5.png and /dev/null differ diff --git a/dist/images/1x/icon/dots.png b/dist/images/1x/icon/dots.png deleted file mode 100644 index 55b461b5f..000000000 Binary files a/dist/images/1x/icon/dots.png and /dev/null differ diff --git a/dist/images/1x/icon/half_selected.png b/dist/images/1x/icon/half_selected.png deleted file mode 100644 index 7ec85e364..000000000 Binary files a/dist/images/1x/icon/half_selected.png and /dev/null differ diff --git a/dist/images/1x/icon/half_selected_disable.png b/dist/images/1x/icon/half_selected_disable.png deleted file mode 100644 index 5e9add3de..000000000 Binary files a/dist/images/1x/icon/half_selected_disable.png and /dev/null differ diff --git a/dist/images/1x/icon/icon_down_arrow.png b/dist/images/1x/icon/icon_down_arrow.png deleted file mode 100644 index b77c33090..000000000 Binary files a/dist/images/1x/icon/icon_down_arrow.png and /dev/null differ diff --git a/dist/images/1x/icon/loading.gif b/dist/images/1x/icon/loading.gif deleted file mode 100644 index d04fdd212..000000000 Binary files a/dist/images/1x/icon/loading.gif and /dev/null differ diff --git a/dist/images/1x/icon/push_down.png b/dist/images/1x/icon/push_down.png deleted file mode 100644 index 7eb88eb00..000000000 Binary files a/dist/images/1x/icon/push_down.png and /dev/null differ diff --git a/dist/images/1x/icon/push_up.png b/dist/images/1x/icon/push_up.png deleted file mode 100644 index a3042a409..000000000 Binary files a/dist/images/1x/icon/push_up.png and /dev/null differ diff --git a/dist/images/1x/icon/radio_active.png b/dist/images/1x/icon/radio_active.png deleted file mode 100644 index ff21dd124..000000000 Binary files a/dist/images/1x/icon/radio_active.png and /dev/null differ diff --git a/dist/images/1x/icon/radio_disable.png b/dist/images/1x/icon/radio_disable.png deleted file mode 100644 index 1de4dc7bc..000000000 Binary files a/dist/images/1x/icon/radio_disable.png and /dev/null differ diff --git a/dist/images/1x/icon/radio_disable2.png b/dist/images/1x/icon/radio_disable2.png deleted file mode 100644 index 3808cfbce..000000000 Binary files a/dist/images/1x/icon/radio_disable2.png and /dev/null differ diff --git a/dist/images/1x/icon/radio_hover.png b/dist/images/1x/icon/radio_hover.png deleted file mode 100644 index c4250d509..000000000 Binary files a/dist/images/1x/icon/radio_hover.png and /dev/null differ diff --git a/dist/images/1x/icon/radio_normal.png b/dist/images/1x/icon/radio_normal.png deleted file mode 100644 index d2fe03747..000000000 Binary files a/dist/images/1x/icon/radio_normal.png and /dev/null differ diff --git a/dist/images/1x/icon/slider_active.png b/dist/images/1x/icon/slider_active.png deleted file mode 100644 index a84164f62..000000000 Binary files a/dist/images/1x/icon/slider_active.png and /dev/null differ diff --git a/dist/images/1x/icon/slider_active_small.png b/dist/images/1x/icon/slider_active_small.png deleted file mode 100644 index 1c29cec84..000000000 Binary files a/dist/images/1x/icon/slider_active_small.png and /dev/null differ diff --git a/dist/images/1x/icon/slider_normal.png b/dist/images/1x/icon/slider_normal.png deleted file mode 100644 index 8a611ffc9..000000000 Binary files a/dist/images/1x/icon/slider_normal.png and /dev/null differ diff --git a/dist/images/1x/icon/slider_normal_small.png b/dist/images/1x/icon/slider_normal_small.png deleted file mode 100644 index 7bd6fc789..000000000 Binary files a/dist/images/1x/icon/slider_normal_small.png and /dev/null differ diff --git a/dist/images/1x/icon/trans_normal.png b/dist/images/1x/icon/trans_normal.png deleted file mode 100755 index e80ef6744..000000000 Binary files a/dist/images/1x/icon/trans_normal.png and /dev/null differ diff --git a/dist/images/1x/icon/trans_select.png b/dist/images/1x/icon/trans_select.png deleted file mode 100755 index ce061d9ae..000000000 Binary files a/dist/images/1x/icon/trans_select.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_collapse_1.png b/dist/images/1x/icon/tree_collapse_1.png deleted file mode 100644 index d67ba2999..000000000 Binary files a/dist/images/1x/icon/tree_collapse_1.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_collapse_2.png b/dist/images/1x/icon/tree_collapse_2.png deleted file mode 100644 index 6d807542f..000000000 Binary files a/dist/images/1x/icon/tree_collapse_2.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_collapse_3.png b/dist/images/1x/icon/tree_collapse_3.png deleted file mode 100644 index 64cac3286..000000000 Binary files a/dist/images/1x/icon/tree_collapse_3.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_collapse_4.png b/dist/images/1x/icon/tree_collapse_4.png deleted file mode 100644 index 42d2a1ef8..000000000 Binary files a/dist/images/1x/icon/tree_collapse_4.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_expand_1.png b/dist/images/1x/icon/tree_expand_1.png deleted file mode 100644 index 578a49621..000000000 Binary files a/dist/images/1x/icon/tree_expand_1.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_expand_2.png b/dist/images/1x/icon/tree_expand_2.png deleted file mode 100644 index ec715ed54..000000000 Binary files a/dist/images/1x/icon/tree_expand_2.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_expand_3.png b/dist/images/1x/icon/tree_expand_3.png deleted file mode 100644 index dc32dc7f8..000000000 Binary files a/dist/images/1x/icon/tree_expand_3.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_expand_4.png b/dist/images/1x/icon/tree_expand_4.png deleted file mode 100644 index f16647181..000000000 Binary files a/dist/images/1x/icon/tree_expand_4.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_collapse_1.png b/dist/images/1x/icon/tree_solid_collapse_1.png deleted file mode 100644 index a5e5dcf9c..000000000 Binary files a/dist/images/1x/icon/tree_solid_collapse_1.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_collapse_2.png b/dist/images/1x/icon/tree_solid_collapse_2.png deleted file mode 100644 index 2acf7e7c4..000000000 Binary files a/dist/images/1x/icon/tree_solid_collapse_2.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_collapse_3.png b/dist/images/1x/icon/tree_solid_collapse_3.png deleted file mode 100644 index 5bd6fbe19..000000000 Binary files a/dist/images/1x/icon/tree_solid_collapse_3.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_collapse_4.png b/dist/images/1x/icon/tree_solid_collapse_4.png deleted file mode 100644 index b445df5d9..000000000 Binary files a/dist/images/1x/icon/tree_solid_collapse_4.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_collapse_5.png b/dist/images/1x/icon/tree_solid_collapse_5.png deleted file mode 100644 index f69e7dfb7..000000000 Binary files a/dist/images/1x/icon/tree_solid_collapse_5.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_expand_1.png b/dist/images/1x/icon/tree_solid_expand_1.png deleted file mode 100644 index 0b28d5e7e..000000000 Binary files a/dist/images/1x/icon/tree_solid_expand_1.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_expand_2.png b/dist/images/1x/icon/tree_solid_expand_2.png deleted file mode 100644 index e418819a2..000000000 Binary files a/dist/images/1x/icon/tree_solid_expand_2.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_expand_3.png b/dist/images/1x/icon/tree_solid_expand_3.png deleted file mode 100644 index 6759ade95..000000000 Binary files a/dist/images/1x/icon/tree_solid_expand_3.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_expand_4.png b/dist/images/1x/icon/tree_solid_expand_4.png deleted file mode 100644 index b8357157d..000000000 Binary files a/dist/images/1x/icon/tree_solid_expand_4.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_expand_5.png b/dist/images/1x/icon/tree_solid_expand_5.png deleted file mode 100644 index a4ed55589..000000000 Binary files a/dist/images/1x/icon/tree_solid_expand_5.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_vertical_line_1.png b/dist/images/1x/icon/tree_solid_vertical_line_1.png deleted file mode 100644 index b80a5808f..000000000 Binary files a/dist/images/1x/icon/tree_solid_vertical_line_1.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_vertical_line_2.png b/dist/images/1x/icon/tree_solid_vertical_line_2.png deleted file mode 100644 index 894cfd153..000000000 Binary files a/dist/images/1x/icon/tree_solid_vertical_line_2.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_vertical_line_3.png b/dist/images/1x/icon/tree_solid_vertical_line_3.png deleted file mode 100644 index 8a6914b63..000000000 Binary files a/dist/images/1x/icon/tree_solid_vertical_line_3.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_solid_vertical_line_4.png b/dist/images/1x/icon/tree_solid_vertical_line_4.png deleted file mode 100644 index 28d18d2a9..000000000 Binary files a/dist/images/1x/icon/tree_solid_vertical_line_4.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_vertical_line_1.png b/dist/images/1x/icon/tree_vertical_line_1.png deleted file mode 100644 index 1eae66352..000000000 Binary files a/dist/images/1x/icon/tree_vertical_line_1.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_vertical_line_2.png b/dist/images/1x/icon/tree_vertical_line_2.png deleted file mode 100644 index 9d160d99a..000000000 Binary files a/dist/images/1x/icon/tree_vertical_line_2.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_vertical_line_3.png b/dist/images/1x/icon/tree_vertical_line_3.png deleted file mode 100644 index 4b8c500a8..000000000 Binary files a/dist/images/1x/icon/tree_vertical_line_3.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_vertical_line_4.png b/dist/images/1x/icon/tree_vertical_line_4.png deleted file mode 100644 index 25be9ef04..000000000 Binary files a/dist/images/1x/icon/tree_vertical_line_4.png and /dev/null differ diff --git a/dist/images/1x/icon/tree_vertical_line_5.png b/dist/images/1x/icon/tree_vertical_line_5.png deleted file mode 100644 index c9a5754ac..000000000 Binary files a/dist/images/1x/icon/tree_vertical_line_5.png and /dev/null differ diff --git a/dist/images/1x/icon/wave_loading.gif b/dist/images/1x/icon/wave_loading.gif deleted file mode 100644 index 143462217..000000000 Binary files a/dist/images/1x/icon/wave_loading.gif and /dev/null differ diff --git a/dist/images/2x/background/auto_color_disable.png b/dist/images/2x/background/auto_color_disable.png deleted file mode 100644 index b61713005..000000000 Binary files a/dist/images/2x/background/auto_color_disable.png and /dev/null differ diff --git a/dist/images/2x/background/auto_color_normal.png b/dist/images/2x/background/auto_color_normal.png deleted file mode 100644 index 2085e7c23..000000000 Binary files a/dist/images/2x/background/auto_color_normal.png and /dev/null differ diff --git a/dist/images/2x/background/auto_color_select.png b/dist/images/2x/background/auto_color_select.png deleted file mode 100644 index 547fffce4..000000000 Binary files a/dist/images/2x/background/auto_color_select.png and /dev/null differ diff --git a/dist/images/2x/background/line_conn.gif b/dist/images/2x/background/line_conn.gif deleted file mode 100644 index d561d36a9..000000000 Binary files a/dist/images/2x/background/line_conn.gif and /dev/null differ diff --git a/dist/images/2x/background/trans_normal.png b/dist/images/2x/background/trans_normal.png deleted file mode 100644 index 663a84262..000000000 Binary files a/dist/images/2x/background/trans_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/auto_no_square_normal.png b/dist/images/2x/icon/auto_no_square_normal.png deleted file mode 100644 index a2482a149..000000000 Binary files a/dist/images/2x/icon/auto_no_square_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/auto_normal.png b/dist/images/2x/icon/auto_normal.png deleted file mode 100644 index 527212c10..000000000 Binary files a/dist/images/2x/icon/auto_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/auto_select.png b/dist/images/2x/icon/auto_select.png deleted file mode 100644 index 49423cac0..000000000 Binary files a/dist/images/2x/icon/auto_select.png and /dev/null differ diff --git a/dist/images/2x/icon/auto_square_normal.png b/dist/images/2x/icon/auto_square_normal.png deleted file mode 100644 index 850bdbec2..000000000 Binary files a/dist/images/2x/icon/auto_square_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/check_box_active.png b/dist/images/2x/icon/check_box_active.png deleted file mode 100644 index a23036f9f..000000000 Binary files a/dist/images/2x/icon/check_box_active.png and /dev/null differ diff --git a/dist/images/2x/icon/check_box_disable.png b/dist/images/2x/icon/check_box_disable.png deleted file mode 100644 index 700bda33c..000000000 Binary files a/dist/images/2x/icon/check_box_disable.png and /dev/null differ diff --git a/dist/images/2x/icon/check_box_disable2.png b/dist/images/2x/icon/check_box_disable2.png deleted file mode 100644 index d134520cc..000000000 Binary files a/dist/images/2x/icon/check_box_disable2.png and /dev/null differ diff --git a/dist/images/2x/icon/check_box_hover.png b/dist/images/2x/icon/check_box_hover.png deleted file mode 100644 index ebbec3fda..000000000 Binary files a/dist/images/2x/icon/check_box_hover.png and /dev/null differ diff --git a/dist/images/2x/icon/check_box_normal.png b/dist/images/2x/icon/check_box_normal.png deleted file mode 100644 index da76aef31..000000000 Binary files a/dist/images/2x/icon/check_box_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/auto_square_normal.png b/dist/images/2x/icon/dark/auto_square_normal.png deleted file mode 100644 index 1df5c8826..000000000 Binary files a/dist/images/2x/icon/dark/auto_square_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/trans_normal.png b/dist/images/2x/icon/dark/trans_normal.png deleted file mode 100755 index 3e68e88c3..000000000 Binary files a/dist/images/2x/icon/dark/trans_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/trans_select.png b/dist/images/2x/icon/dark/trans_select.png deleted file mode 100755 index afaeecfa7..000000000 Binary files a/dist/images/2x/icon/dark/trans_select.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_collapse_1.png b/dist/images/2x/icon/dark/tree_collapse_1.png deleted file mode 100644 index b3f555f80..000000000 Binary files a/dist/images/2x/icon/dark/tree_collapse_1.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_collapse_2.png b/dist/images/2x/icon/dark/tree_collapse_2.png deleted file mode 100644 index 4a78b939a..000000000 Binary files a/dist/images/2x/icon/dark/tree_collapse_2.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_collapse_3.png b/dist/images/2x/icon/dark/tree_collapse_3.png deleted file mode 100644 index 3361b8a46..000000000 Binary files a/dist/images/2x/icon/dark/tree_collapse_3.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_collapse_4.png b/dist/images/2x/icon/dark/tree_collapse_4.png deleted file mode 100644 index 9e7af4a78..000000000 Binary files a/dist/images/2x/icon/dark/tree_collapse_4.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_expand_1.png b/dist/images/2x/icon/dark/tree_expand_1.png deleted file mode 100644 index 484843f1c..000000000 Binary files a/dist/images/2x/icon/dark/tree_expand_1.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_expand_2.png b/dist/images/2x/icon/dark/tree_expand_2.png deleted file mode 100644 index d44e15d4e..000000000 Binary files a/dist/images/2x/icon/dark/tree_expand_2.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_expand_3.png b/dist/images/2x/icon/dark/tree_expand_3.png deleted file mode 100644 index 3190b87f0..000000000 Binary files a/dist/images/2x/icon/dark/tree_expand_3.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_expand_4.png b/dist/images/2x/icon/dark/tree_expand_4.png deleted file mode 100644 index bf35d7548..000000000 Binary files a/dist/images/2x/icon/dark/tree_expand_4.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_collapse_1.png b/dist/images/2x/icon/dark/tree_solid_collapse_1.png deleted file mode 100644 index 1b39baa92..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_collapse_1.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_collapse_2.png b/dist/images/2x/icon/dark/tree_solid_collapse_2.png deleted file mode 100644 index 37029e095..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_collapse_2.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_collapse_3.png b/dist/images/2x/icon/dark/tree_solid_collapse_3.png deleted file mode 100644 index ff6c4f653..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_collapse_3.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_collapse_4.png b/dist/images/2x/icon/dark/tree_solid_collapse_4.png deleted file mode 100644 index fb8e354d3..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_collapse_4.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_collapse_5.png b/dist/images/2x/icon/dark/tree_solid_collapse_5.png deleted file mode 100644 index b3c53e8a0..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_collapse_5.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_expand_1.png b/dist/images/2x/icon/dark/tree_solid_expand_1.png deleted file mode 100644 index 05a11cd9c..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_expand_1.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_expand_2.png b/dist/images/2x/icon/dark/tree_solid_expand_2.png deleted file mode 100644 index 6a744dbb0..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_expand_2.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_expand_3.png b/dist/images/2x/icon/dark/tree_solid_expand_3.png deleted file mode 100644 index 09e0ad07d..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_expand_3.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_expand_4.png b/dist/images/2x/icon/dark/tree_solid_expand_4.png deleted file mode 100644 index 066a7cb3f..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_expand_4.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_expand_5.png b/dist/images/2x/icon/dark/tree_solid_expand_5.png deleted file mode 100644 index 039b0e1cc..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_expand_5.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_vertical_line_1.png b/dist/images/2x/icon/dark/tree_solid_vertical_line_1.png deleted file mode 100644 index 3bc014f46..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_vertical_line_1.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_vertical_line_2.png b/dist/images/2x/icon/dark/tree_solid_vertical_line_2.png deleted file mode 100644 index 22688bcaf..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_vertical_line_2.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_vertical_line_3.png b/dist/images/2x/icon/dark/tree_solid_vertical_line_3.png deleted file mode 100644 index d155fcdad..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_vertical_line_3.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_solid_vertical_line_4.png b/dist/images/2x/icon/dark/tree_solid_vertical_line_4.png deleted file mode 100644 index 9af333f28..000000000 Binary files a/dist/images/2x/icon/dark/tree_solid_vertical_line_4.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_vertical_line_1.png b/dist/images/2x/icon/dark/tree_vertical_line_1.png deleted file mode 100644 index 9ae642458..000000000 Binary files a/dist/images/2x/icon/dark/tree_vertical_line_1.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_vertical_line_2.png b/dist/images/2x/icon/dark/tree_vertical_line_2.png deleted file mode 100644 index 0e43988fc..000000000 Binary files a/dist/images/2x/icon/dark/tree_vertical_line_2.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_vertical_line_3.png b/dist/images/2x/icon/dark/tree_vertical_line_3.png deleted file mode 100644 index 54fd20153..000000000 Binary files a/dist/images/2x/icon/dark/tree_vertical_line_3.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_vertical_line_4.png b/dist/images/2x/icon/dark/tree_vertical_line_4.png deleted file mode 100644 index 60f2c0a8c..000000000 Binary files a/dist/images/2x/icon/dark/tree_vertical_line_4.png and /dev/null differ diff --git a/dist/images/2x/icon/dark/tree_vertical_line_5.png b/dist/images/2x/icon/dark/tree_vertical_line_5.png deleted file mode 100644 index 27531a35b..000000000 Binary files a/dist/images/2x/icon/dark/tree_vertical_line_5.png and /dev/null differ diff --git a/dist/images/2x/icon/dots.png b/dist/images/2x/icon/dots.png deleted file mode 100644 index beae59d3d..000000000 Binary files a/dist/images/2x/icon/dots.png and /dev/null differ diff --git a/dist/images/2x/icon/half_selected.png b/dist/images/2x/icon/half_selected.png deleted file mode 100644 index 7fe3379aa..000000000 Binary files a/dist/images/2x/icon/half_selected.png and /dev/null differ diff --git a/dist/images/2x/icon/half_selected_disable.png b/dist/images/2x/icon/half_selected_disable.png deleted file mode 100644 index 7157ac641..000000000 Binary files a/dist/images/2x/icon/half_selected_disable.png and /dev/null differ diff --git a/dist/images/2x/icon/icon_down_arrow.png b/dist/images/2x/icon/icon_down_arrow.png deleted file mode 100644 index 5285f739a..000000000 Binary files a/dist/images/2x/icon/icon_down_arrow.png and /dev/null differ diff --git a/dist/images/2x/icon/loading.gif b/dist/images/2x/icon/loading.gif deleted file mode 100644 index d04fdd212..000000000 Binary files a/dist/images/2x/icon/loading.gif and /dev/null differ diff --git a/dist/images/2x/icon/push_down.png b/dist/images/2x/icon/push_down.png deleted file mode 100644 index 88ef8d5fb..000000000 Binary files a/dist/images/2x/icon/push_down.png and /dev/null differ diff --git a/dist/images/2x/icon/push_up.png b/dist/images/2x/icon/push_up.png deleted file mode 100644 index 040d502e6..000000000 Binary files a/dist/images/2x/icon/push_up.png and /dev/null differ diff --git a/dist/images/2x/icon/radio_active.png b/dist/images/2x/icon/radio_active.png deleted file mode 100644 index 60aadf28d..000000000 Binary files a/dist/images/2x/icon/radio_active.png and /dev/null differ diff --git a/dist/images/2x/icon/radio_disable.png b/dist/images/2x/icon/radio_disable.png deleted file mode 100644 index 3cf082470..000000000 Binary files a/dist/images/2x/icon/radio_disable.png and /dev/null differ diff --git a/dist/images/2x/icon/radio_disable2.png b/dist/images/2x/icon/radio_disable2.png deleted file mode 100644 index a8b773ccc..000000000 Binary files a/dist/images/2x/icon/radio_disable2.png and /dev/null differ diff --git a/dist/images/2x/icon/radio_hover.png b/dist/images/2x/icon/radio_hover.png deleted file mode 100644 index 5814caa36..000000000 Binary files a/dist/images/2x/icon/radio_hover.png and /dev/null differ diff --git a/dist/images/2x/icon/radio_normal.png b/dist/images/2x/icon/radio_normal.png deleted file mode 100644 index f7eed2831..000000000 Binary files a/dist/images/2x/icon/radio_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/slider_active.png b/dist/images/2x/icon/slider_active.png deleted file mode 100644 index cf361f74d..000000000 Binary files a/dist/images/2x/icon/slider_active.png and /dev/null differ diff --git a/dist/images/2x/icon/slider_active_small.png b/dist/images/2x/icon/slider_active_small.png deleted file mode 100644 index 1c29cec84..000000000 Binary files a/dist/images/2x/icon/slider_active_small.png and /dev/null differ diff --git a/dist/images/2x/icon/slider_normal.png b/dist/images/2x/icon/slider_normal.png deleted file mode 100644 index a81cf0387..000000000 Binary files a/dist/images/2x/icon/slider_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/slider_normal_small.png b/dist/images/2x/icon/slider_normal_small.png deleted file mode 100644 index 7bd6fc789..000000000 Binary files a/dist/images/2x/icon/slider_normal_small.png and /dev/null differ diff --git a/dist/images/2x/icon/trans_normal.png b/dist/images/2x/icon/trans_normal.png deleted file mode 100755 index 4dcecc5ad..000000000 Binary files a/dist/images/2x/icon/trans_normal.png and /dev/null differ diff --git a/dist/images/2x/icon/trans_select.png b/dist/images/2x/icon/trans_select.png deleted file mode 100755 index afaeecfa7..000000000 Binary files a/dist/images/2x/icon/trans_select.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_collapse_1.png b/dist/images/2x/icon/tree_collapse_1.png deleted file mode 100644 index 2041a0e4b..000000000 Binary files a/dist/images/2x/icon/tree_collapse_1.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_collapse_2.png b/dist/images/2x/icon/tree_collapse_2.png deleted file mode 100644 index f2b989399..000000000 Binary files a/dist/images/2x/icon/tree_collapse_2.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_collapse_3.png b/dist/images/2x/icon/tree_collapse_3.png deleted file mode 100644 index 24eb8e827..000000000 Binary files a/dist/images/2x/icon/tree_collapse_3.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_collapse_4.png b/dist/images/2x/icon/tree_collapse_4.png deleted file mode 100644 index 242f034da..000000000 Binary files a/dist/images/2x/icon/tree_collapse_4.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_expand_1.png b/dist/images/2x/icon/tree_expand_1.png deleted file mode 100644 index 9f5acc590..000000000 Binary files a/dist/images/2x/icon/tree_expand_1.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_expand_2.png b/dist/images/2x/icon/tree_expand_2.png deleted file mode 100644 index 5b630d0a2..000000000 Binary files a/dist/images/2x/icon/tree_expand_2.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_expand_3.png b/dist/images/2x/icon/tree_expand_3.png deleted file mode 100644 index b995958c0..000000000 Binary files a/dist/images/2x/icon/tree_expand_3.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_expand_4.png b/dist/images/2x/icon/tree_expand_4.png deleted file mode 100644 index e8df787d6..000000000 Binary files a/dist/images/2x/icon/tree_expand_4.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_collapse_1.png b/dist/images/2x/icon/tree_solid_collapse_1.png deleted file mode 100644 index 94ed363d4..000000000 Binary files a/dist/images/2x/icon/tree_solid_collapse_1.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_collapse_2.png b/dist/images/2x/icon/tree_solid_collapse_2.png deleted file mode 100644 index 0796aaf5a..000000000 Binary files a/dist/images/2x/icon/tree_solid_collapse_2.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_collapse_3.png b/dist/images/2x/icon/tree_solid_collapse_3.png deleted file mode 100644 index 125a28dc7..000000000 Binary files a/dist/images/2x/icon/tree_solid_collapse_3.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_collapse_4.png b/dist/images/2x/icon/tree_solid_collapse_4.png deleted file mode 100644 index 643f0123b..000000000 Binary files a/dist/images/2x/icon/tree_solid_collapse_4.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_collapse_5.png b/dist/images/2x/icon/tree_solid_collapse_5.png deleted file mode 100644 index 0cb0d5d73..000000000 Binary files a/dist/images/2x/icon/tree_solid_collapse_5.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_expand_1.png b/dist/images/2x/icon/tree_solid_expand_1.png deleted file mode 100644 index d607d042c..000000000 Binary files a/dist/images/2x/icon/tree_solid_expand_1.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_expand_2.png b/dist/images/2x/icon/tree_solid_expand_2.png deleted file mode 100644 index bde83809a..000000000 Binary files a/dist/images/2x/icon/tree_solid_expand_2.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_expand_3.png b/dist/images/2x/icon/tree_solid_expand_3.png deleted file mode 100644 index e16463b19..000000000 Binary files a/dist/images/2x/icon/tree_solid_expand_3.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_expand_4.png b/dist/images/2x/icon/tree_solid_expand_4.png deleted file mode 100644 index 9738216c4..000000000 Binary files a/dist/images/2x/icon/tree_solid_expand_4.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_expand_5.png b/dist/images/2x/icon/tree_solid_expand_5.png deleted file mode 100644 index 74bd1198e..000000000 Binary files a/dist/images/2x/icon/tree_solid_expand_5.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_vertical_line_1.png b/dist/images/2x/icon/tree_solid_vertical_line_1.png deleted file mode 100644 index 2b1a23d9b..000000000 Binary files a/dist/images/2x/icon/tree_solid_vertical_line_1.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_vertical_line_2.png b/dist/images/2x/icon/tree_solid_vertical_line_2.png deleted file mode 100644 index 56c00c080..000000000 Binary files a/dist/images/2x/icon/tree_solid_vertical_line_2.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_vertical_line_3.png b/dist/images/2x/icon/tree_solid_vertical_line_3.png deleted file mode 100644 index 43aab5d89..000000000 Binary files a/dist/images/2x/icon/tree_solid_vertical_line_3.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_solid_vertical_line_4.png b/dist/images/2x/icon/tree_solid_vertical_line_4.png deleted file mode 100644 index 4b40cc497..000000000 Binary files a/dist/images/2x/icon/tree_solid_vertical_line_4.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_vertical_line_1.png b/dist/images/2x/icon/tree_vertical_line_1.png deleted file mode 100644 index c6b8e799c..000000000 Binary files a/dist/images/2x/icon/tree_vertical_line_1.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_vertical_line_2.png b/dist/images/2x/icon/tree_vertical_line_2.png deleted file mode 100644 index 6b3a595e5..000000000 Binary files a/dist/images/2x/icon/tree_vertical_line_2.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_vertical_line_3.png b/dist/images/2x/icon/tree_vertical_line_3.png deleted file mode 100644 index 878ea613b..000000000 Binary files a/dist/images/2x/icon/tree_vertical_line_3.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_vertical_line_4.png b/dist/images/2x/icon/tree_vertical_line_4.png deleted file mode 100644 index 7d9469617..000000000 Binary files a/dist/images/2x/icon/tree_vertical_line_4.png and /dev/null differ diff --git a/dist/images/2x/icon/tree_vertical_line_5.png b/dist/images/2x/icon/tree_vertical_line_5.png deleted file mode 100644 index 3c3c9c8fe..000000000 Binary files a/dist/images/2x/icon/tree_vertical_line_5.png and /dev/null differ diff --git a/dist/images/2x/icon/wave_loading.gif b/dist/images/2x/icon/wave_loading.gif deleted file mode 100644 index 932045e8b..000000000 Binary files a/dist/images/2x/icon/wave_loading.gif and /dev/null differ diff --git a/examples/ThemeProvider.html b/examples/ThemeProvider.html deleted file mode 100644 index 7848ee406..000000000 --- a/examples/ThemeProvider.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/examples/config-render.html b/examples/config-render.html deleted file mode 100644 index 41545d3b4..000000000 --- a/examples/config-render.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/demo.worker.js b/examples/demo.worker.js deleted file mode 100644 index dae3c723a..000000000 --- a/examples/demo.worker.js +++ /dev/null @@ -1,29 +0,0 @@ -if (this.importScripts) { - importScripts("https://fanruan.design/fineui/fineui_without_jquery_polyfill.js"); - BI.useInWorker(); -} -var Model = BI.inherit(Fix.Model, { - state: function () { - return { - count: 0 - }; - }, - - computed: { - name: function () { - return this.getText(this.model.count); - } - }, - - actions: { - addCount: function () { - this.model.count += 1; - } - }, - - getText (count) { - return "被点击了" + count + "次"; - } -}); - -BI.model("demo.model", Model); diff --git a/examples/dev.html b/examples/dev.html deleted file mode 100644 index 167c18ac5..000000000 --- a/examples/dev.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/effect.html b/examples/effect.html deleted file mode 100644 index 34bae9199..000000000 --- a/examples/effect.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/hooks.html b/examples/hooks.html deleted file mode 100644 index c9302a0d5..000000000 --- a/examples/hooks.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/loader-context.html b/examples/loader-context.html deleted file mode 100644 index a8ba36a96..000000000 --- a/examples/loader-context.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/resize.html b/examples/resize.html deleted file mode 100644 index dda9edda3..000000000 --- a/examples/resize.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/style.html b/examples/style.html deleted file mode 100644 index 339f14365..000000000 --- a/examples/style.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/tab-context.html b/examples/tab-context.html deleted file mode 100644 index 6a0a2d130..000000000 --- a/examples/tab-context.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/test-id.html b/examples/test-id.html deleted file mode 100644 index 7eec9e549..000000000 --- a/examples/test-id.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - -
- - - - diff --git a/examples/useContext.html b/examples/useContext.html deleted file mode 100644 index 4092713e9..000000000 --- a/examples/useContext.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - -
- - - diff --git a/examples/virtual-group.html b/examples/virtual-group.html deleted file mode 100644 index a21a37fe6..000000000 --- a/examples/virtual-group.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/visible.html b/examples/visible.html deleted file mode 100644 index 790d091c1..000000000 --- a/examples/visible.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - -
- - - diff --git a/examples/worker.html b/examples/worker.html deleted file mode 100644 index 759f0eac4..000000000 --- a/examples/worker.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/examples/worker_new.html b/examples/worker_new.html deleted file mode 100644 index 53e83c4ee..000000000 --- a/examples/worker_new.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - Document - - - - -
- - - \ No newline at end of file diff --git a/examples/worker_new/index.js b/examples/worker_new/index.js deleted file mode 100644 index b95fbbad6..000000000 --- a/examples/worker_new/index.js +++ /dev/null @@ -1,105 +0,0 @@ -document.cookie = "test=demo"; - -// worker获取主线程资源 -var CookieAction = BI.inherit(BI.Workers.WorkerBaseAction, { - addActionHandler: function() { - this.controller.addActionHandler("Cookie", this.getCookie.bind(this)); - }, - - getCookie: function() { - return document.cookie; - } -}); - -// 调用worker计算 -var FibonacciAction = BI.inherit(BI.Workers.WorkerBaseAction, { - addActionHandler: function() {}, - - getResult: function(times) { - return this.controller.requestPromise("Fibonacci", { times: times }) - .then(function(v) { - console.log(v); - }); - } -}); - -// 主线程与worker多次交互 -const HeartBeatCheckAction = BI.inherit(BI.Workers.WorkerBaseAction, { - addActionHandler: function() { - this.controller.addActionHandler("HeartBeatChecked", this.recieveHeartBeatChecked.bind(this)); - }, - - recieveHeartBeatChecked: function (payload) { - console.log("heartbeat: " + payload.time); - }, - - startHeatBeatCheck: function() { - return this.controller.request("HeartBeatCheckStart"); - }, - - stopHeatBeatCheck: function() { - return this.controller.request("HeartBeatCheckStop"); - } -}); - -var MainThreadWorker = BI.inherit(BI.Workers.MainThreadWorker, { - initActions: function() { - this.cookieAction = this.createAction(CookieAction); - - this.fibonacciAction = this.createAction(FibonacciAction); - - this.heartBeatCheckAction = this.createAction(HeartBeatCheckAction); - }, - - calculateFibonacci: function(times) { - this.fibonacciAction.getResult(times); - }, - - startHeatBeatCheck: function() { - this.heartBeatCheckAction.startHeatBeatCheck(); - }, - - stopHeatBeatCheck: function() { - this.heartBeatCheckAction.stopHeatBeatCheck(); - } -}); - -var mainThreadWorker = BI.Workers.createWorker(MainThreadWorker, { - workerUrl: "./worker_new/worker.js", - workerName: "demo" -}); - -BI.createWidget({ - type: "bi.vertical", - element: "#wrapper", - vgap: 10, - hgap: 10, - items: [ - { - type: "bi.button", - text: "点击计算斐波那契数列第40项", - width: 200, - handler: function() { - console.log("click"); - - mainThreadWorker.calculateFibonacci(40); - } - }, - { - type: "bi.button", - text: "开始心跳", - width: 200, - handler: function() { - mainThreadWorker.startHeatBeatCheck(); - } - }, - { - type: "bi.button", - text: "停止心跳", - width: 200, - handler: function() { - mainThreadWorker.stopHeatBeatCheck(); - } - } - ] -}); diff --git a/examples/worker_new/worker.js b/examples/worker_new/worker.js deleted file mode 100644 index 96e88e542..000000000 --- a/examples/worker_new/worker.js +++ /dev/null @@ -1,80 +0,0 @@ -self.importScripts("https://fanruan.design/fineui/fineui_without_jquery_polyfill.js"); - -var CookieAction = BI.inherit(BI.Workers.WorkerBaseAction, { - addActionHandler: function() {}, - - getCookie: function() { - return this.controller.requestPromise("Cookie"); - } -}); - -function fibonacci(n) { - if (n === 1 || n === 2) { - return 1; - } - - return fibonacci(n - 2) + fibonacci(n - 1); -} - -var FibonacciAction = BI.inherit(BI.Workers.WorkerBaseAction, { - addActionHandler: function() { - this.controller.addActionHandler("Fibonacci", this.getResult.bind(this)); - }, - - getResult: function(payload) { - return fibonacci(payload.times); - } -}); - -const HeartBeatCheckAction = BI.inherit(BI.Workers.WorkerBaseAction, { - addActionHandler: function() { - this.controller.addActionHandler("HeartBeatCheckStart", this.startHeatBeatCheck.bind(this)); - this.controller.addActionHandler("HeartBeatCheckStop", this.stopHeatBeatCheck.bind(this)); - }, - - startHeatBeatCheck: function() { - var self = this; - - if (!this.timer) { - console.log("heart beat check started"); - - this.timer = setInterval(function() { - // 模拟请求 - setTimeout(function() { - self.controller.request("HeartBeatChecked", { - time: new Date() - }); - }, 50); - }, 5 * 1000); - } else { - console.log("heart beat has already started!"); - } - }, - - stopHeatBeatCheck: function() { - console.log("heart beat check stopped"); - - clearInterval(this.timer); - } -}); - -var MainThreadWorker = BI.inherit(BI.Workers.WorkerThreadWorker, { - initActions: function() { - this.cookieAction = this.createAction(CookieAction); - - this.fibonacciAction = this.createAction(FibonacciAction); - - this.heartBeatCheckAction = this.createAction(HeartBeatCheckAction); - }, - - fetchCookie: function() { - return this.cookieAction.getCookie() - .then(function (v) { - console.log(v); - }); - } -}); - -var workerThreadWorker = BI.Workers.createWorker(MainThreadWorker); - -workerThreadWorker.fetchCookie(); diff --git a/examples/响应式布局.html b/examples/响应式布局.html deleted file mode 100644 index 72a71951f..000000000 --- a/examples/响应式布局.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - - - PullRequest | Code Review as a Service - - - - - - - - - -
- - - diff --git a/examples/插件设计.html b/examples/插件设计.html deleted file mode 100644 index 91c2b29c8..000000000 --- a/examples/插件设计.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - -
- - - - diff --git a/examples/替换loading动画.html b/examples/替换loading动画.html deleted file mode 100644 index 9ae3707d4..000000000 --- a/examples/替换loading动画.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - Document - - - - - - -
- - - - \ No newline at end of file diff --git a/i18n/i18n.cn.js b/i18n/i18n.cn.js deleted file mode 100644 index 900ff7630..000000000 --- a/i18n/i18n.cn.js +++ /dev/null @@ -1,204 +0,0 @@ -BI.i18n = { - "BI-Multi_Date_Quarter_End": "季度末", - "BI-Multi_Date_Month_Begin": "月初", - "BI-Multi_Date_YMD": "年月日", - "BI-Custom_Color": "自定义颜色", - "BI-Numerical_Interval_Input_Data": "请输入数值", - "BI-Please_Input_Natural_Number": "请输入非负整数", - "BI-No_More_Data": "无更多数据", - "BI-Basic_Altogether": "共", - "BI-Basic_Sunday": "星期日", - "BI-Widget_Background_Colour": "组件背景", - "BI-Color_Picker_Error_Text": "请输入0-255的正整数", - "BI-Multi_Date_Month": "月", - "BI-No_Selected_Item": "没有可选项", - "BI-Multi_Date_Year_Begin": "年初", - "BI-Quarter_1": "第1季度", - "BI-Quarter_2": "第2季度", - "BI-Quarter_3": "第3季度", - "BI-Quarter_4": "第4季度", - "BI-Multi_Date_Year_Next": "年后", - "BI-Multi_Date_Month_Prev": "个月前", - "BI-Month_Trigger_Error_Text": "请输入1~12的正整数", - "BI-Less_And_Equal": "小于等于", - "BI-Year_Trigger_Invalid_Text": "请输入有效时间", - "BI-Multi_Date_Week_Next": "周后", - "BI-Font_Size": "字号", - "BI-Basic_Total": "共", - "BI-Already_Selected": "已选择", - "BI-Formula_Insert": "插入", - "BI-Select_All": "全选", - "BI-Basic_Tuesday": "星期二", - "BI-Multi_Date_Month_End": "月末", - "BI-Load_More": "点击加载更多数据", - "BI-Basic_September": "九月", - "BI-Current_Is_Last_Page": "当前已是最后一页", - "BI-Basic_Auto": "自动", - "BI-Basic_Count": "个", - "BI-Basic_Value": "值", - "BI-Basic_Unrestricted": "无限制", - "BI-Quarter_Trigger_Error_Text": "请输入1~4的正整数", - "BI-Basic_More": "更多", - "BI-Basic_Wednesday": "星期三", - "BI-Basic_Bold": "加粗", - "BI-Basic_Simple_Saturday": "六", - "BI-Multi_Date_Month_Next": "个月后", - "BI-Basic_March": "三月", - "BI-Current_Is_First_Page": "当前已是第一页", - "BI-Basic_Thursday": "星期四", - "BI-Basic_Prompt": "提示", - "BI-Multi_Date_Today": "今天", - "BI-Multi_Date_Quarter_Prev": "个季度前", - "BI-Row_Header": "行表头", - "BI-Date_Trigger_Error_Text": "日期格式示例:2015-3-11", - "BI-Basic_Cancel": "取消", - "BI-Basic_January": "一月", - "BI-Basic_June": "六月", - "BI-Basic_July": "七月", - "BI-Basic_April": "四月", - "BI-Multi_Date_Quarter_Begin": "季度初", - "BI-Multi_Date_Week": "周", - "BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项", - "BI-Basic_August": "八月", - "BI-Word_Align_Left": "文字居左", - "BI-Basic_November": "十一月", - "BI-Font_Colour": "字体颜色", - "BI-Multi_Date_Day_Prev": "天前", - "BI-Select_Part": "部分选择", - "BI-Multi_Date_Day_Next": "天后", - "BI-Less_Than": "小于", - "BI-Basic_February": "二月", - "BI-Multi_Date_Year": "年", - "BI-Number_Index": "序号", - "BI-Multi_Date_Week_Prev": "周前", - "BI-Next_Page": "下一页", - "BI-Right_Page": "向右翻页", - "BI-Numerical_Interval_Signal_Value": "前后值相等,请将操作符改为“≤”", - "BI-Basic_December": "十二月", - "BI-Basic_Saturday": "星期六", - "BI-Basic_Simple_Wednesday": "三", - "BI-Multi_Date_Quarter_Next": "个季度后", - "BI-Basic_October": "十月", - "BI-Basic_Simple_Friday": "五", - "BI-Basic_Save": "保存", - "BI-Numerical_Interval_Number_Value": "请保证前面的数值小于/等于后面的数值", - "BI-Previous_Page": "上一页", - "BI-No_Select": "搜索结果为空", - "BI-Basic_Clears": "清空", - "BI-Created_By_Me": "我创建的", - "BI-Basic_Simple_Tuesday": "二", - "BI-Word_Align_Right": "文字居右", - "BI-Summary_Values": "汇总", - "BI-Basic_Clear": "清除", - "BI-Upload_File_Size_Error": "文件大小不支持", - "BI-Upload_File_Count_Error": "超出上传数量上限{R1},请重新上传", - "BI-Up_Page": "向上翻页", - "BI-Basic_Simple_Sunday": "日", - "BI-Multi_Date_Relative_Current_Time": "相对当前时间", - "BI-Selected_Data": "已选数据:", - "BI-Multi_Date_Quarter": "季度", - "BI-Check_Selected": "查看已选", - "BI-Basic_Search": "搜索", - "BI-Basic_May": "五月", - "BI-Continue_Select": "继续选择", - "BI-Please_Input_Positive_Integer": "请输入正整数", - "BI-Upload_File_Type_Error": "文件类型不支持", - "BI-Upload_File_Error": "文件上传失败", - "BI-Basic_Friday": "星期五", - "BI-Down_Page": "向下翻页", - "BI-Basic_Monday": "星期一", - "BI-Left_Page": "向左翻页", - "BI-Transparent_Color": "透明", - "BI-Basic_Simple_Monday": "一", - "BI-Multi_Date_Year_End": "年末", - "BI-Time_Interval_Error_Text": "请保证开始时间早于/等于结束时间", - "BI-Basic_Time": "时间", - "BI-Basic_OK": "确定", - "BI-Basic_Sure": "确定", - "BI-Basic_Simple_Thursday": "四", - "BI-Multi_Date_Year_Prev": "年前", - "BI-Tiao_Data": "条数据", - "BI-Basic_Italic": "斜体", - "BI-Basic_Dynamic_Title": "动态时间", - "BI-Basic_Year": "年", - "BI-Basic_Single_Quarter": "季", - "BI-Basic_Month": "月", - "BI-Basic_Week": "周", - "BI-Basic_Day": "天", - "BI-Basic_Work_Day": "工作日", - "BI-Basic_Front": "前", - "BI-Basic_Behind": "后", - "BI-Basic_Empty": "空", - "BI-Basic_Month_End": "月末", - "BI-Basic_Month_Begin": "月初", - "BI-Basic_Year_End": "年末", - "BI-Basic_Year_Begin": "年初", - "BI-Basic_Quarter_End": "季末", - "BI-Basic_Quarter_Begin": "季初", - "BI-Basic_Week_End": "周末", - "BI-Basic_Week_Begin": "周初", - "BI-Basic_Current_Day": "当天", - "BI-Basic_Begin_Start": "初", - "BI-Basic_End_Stop": "末", - "BI-Basic_Current_Year": "今年", - "BI-Basic_Year_Fen": "年份", - "BI-Basic_Current_Month": "本月", - "BI-Basic_Current_Quarter": "本季度", - "BI-Basic_Year_Month": "年月", - "BI-Basic_Year_Quarter": "年季度", - "BI-Basic_Input_Can_Not_Null": "输入框不能为空", - "BI-Basic_Date_Time_Error_Text": "日期格式示例:2015-3-11 00:00:00", - "BI-Basic_Input_From_To_Number": "请输入{R1}的数值", - "BI-Basic_Or": "或", - "BI-Basic_And": "且", - "BI-Conf_Add_Formula": "添加公式", - "BI-Conf_Add_Condition": "添加条件", - "BI-Conf_Formula_And": "且公式条件", - "BI-Conf_Formula_Or": "或公式条件", - "BI-Conf_Condition_And": "且条件", - "BI-Conf_Condition_Or": "或条件", - "BI-Microsoft_YaHei": "微软雅黑", - "BI-Apple_Light": "苹方-light", - "BI-Font_Family": "字体", - "BI-Basic_Please_Input_Content": "请输入内容", - "BI-Word_Align_Center": "文字居中", - "BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值", - "BI-More_Than": "大于", - "BI-More_And_Equal": "大于等于", - "BI-Please_Enter_SQL": "请输入SQL", - "BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"", - "BI-Basic_Press_Enter_To_Add_Text": "点按回车键添加\"{R1}\"", - "BI-Basic_Please_Select": "请选择", - "BI-Basic_Font_Color": "文字颜色", - "BI-Basic_Background_Color": "背景色", - "BI-Basic_Underline": "下划线", - "BI-Basic_Param_Month": "{R1}月", - "BI-Basic_Param_Day": "{R1}日", - "BI-Basic_Param_Quarter": "{R1}季度", - "BI-Basic_Param_Week_Count": "第{R1}周", - "BI-Basic_Param_Hour": "{R1}时", - "BI-Basic_Param_Minute": "{R1}分", - "BI-Basic_Param_Second": "{R1}秒", - "BI-Basic_Param_Year": "{R1}年", - "BI-Basic_Date_Day": "日", - "BI-Basic_Hour_Sin": "时", - "BI-Basic_Seconds": "秒", - "BI-Basic_Minute": "分", - "BI-Basic_Thousand": "千", - "BI-Basic_Wan": "万", - "BI-Basic_Million": "百万", - "BI-Basic_Billion": "亿", - "BI-Basic_Quarter": "季度", - "BI-Basic_No_Select": "不选", - "BI-Basic_Now": "此刻", - "BI-Color_Picker_Error_Text_Hex": "请输入6位16进制颜色编号", - "BI-Basic_Date_Range_Error": "请选择{R1}年{R2}月{R3}日-{R4}年{R5}月{R6}日的日期", - "BI-Basic_Year_Range_Error": "请选择{R1}年-{R2}年的日期", - "BI-Basic_Year_Month_Range_Error": "请选择{R1}年{R2}月-{R3}年{R4}月的日期", - "BI-Basic_Year_Quarter_Range_Error": "请选择{R1}年{R2}季度-{R3}年{R4}季度的日期", - "BI-Basic_Search_And_Patch_Paste": "搜索,支持批量粘贴、粘贴值通过换行识别", - "BI-Basic_Recommend_Color": "推荐色", - "BI-Basic_Too_Much_Value_Get_Two_Thousand": "粘贴的值过多,只能识别出前2000个值", - "BI-Basic_Simple_Open": "开", - "BI-Basic_Simple_Close": "关", -}; \ No newline at end of file diff --git a/i18n/i18n.en.js b/i18n/i18n.en.js deleted file mode 100644 index 39e7a7758..000000000 --- a/i18n/i18n.en.js +++ /dev/null @@ -1,122 +0,0 @@ -BI.i18n = { - "BI-Multi_Date_Quarter_End": "", - "BI-Multi_Date_Month_Begin": "", - "BI-Multi_Date_YMD": "", - "BI-Custom_Color": "", - "BI-Numerical_Interval_Input_Data": "", - "BI-Please_Input_Natural_Number": "", - "BI-No_More_Data": "No More Data", - "BI-Basic_Altogether": "Altogether", - "BI-Basic_Sunday": "Sunday", - "BI-Widget_Background_Colour": "", - "BI-Color_Picker_Error_Text": "", - "BI-Multi_Date_Month": "", - "BI-No_Selected_Item": "", - "BI-Multi_Date_Year_Begin": "", - "BI-Quarter_1": "First Quarter", - "BI-Quarter_2": "Second Quarter", - "BI-Quarter_3": "Third Quarter", - "BI-Quarter_4": "Fourth Quarter", - "BI-Multi_Date_Year_Next": "", - "BI-Multi_Date_Month_Prev": "", - "BI-Month_Trigger_Error_Text": "", - "BI-Less_And_Equal": "", - "BI-Year_Trigger_Invalid_Text": "", - "BI-Multi_Date_Week_Next": "", - "BI-Font_Size": "", - "BI-Basic_Total": "Total", - "BI-Already_Selected": "Already Selected items", - "BI-Formula_Insert": "", - "BI-Select_All": "Select All", - "BI-Basic_Tuesday": "Tuesday", - "BI-Multi_Date_Month_End": "", - "BI-Load_More": "Click to Load More", - "BI-Basic_September": "September", - "BI-Current_Is_Last_Page": "", - "BI-Basic_Auto": "Auto", - "BI-Basic_Count": "", - "BI-Basic_Value": "value", - "BI-Basic_Unrestricted": "unrestricted", - "BI-Quarter_Trigger_Error_Text": "", - "BI-Basic_More": "More", - "BI-Basic_Wednesday": "Wednesday", - "BI-Basic_Bold": "Bold", - "BI-Basic_Simple_Saturday": "Sat", - "BI-Multi_Date_Month_Next": "", - "BI-Basic_March": "March", - "BI-Current_Is_First_Page": "", - "BI-Basic_Thursday": "Thursday", - "BI-Basic_Prompt": "Prompt", - "BI-Multi_Date_Today": "Toady", - "BI-Multi_Date_Quarter_Prev": "", - "BI-Row_Header": "Row header", - "BI-Date_Trigger_Error_Text": "日期格式示例:2015-3-11", - "BI-Basic_Cancel": "Cancel", - "BI-Basic_January": "January", - "BI-Basic_June": "June", - "BI-Basic_July": "July", - "BI-Basic_April": "April", - "BI-Multi_Date_Quarter_Begin": "", - "BI-Multi_Date_Week": "Week", - "BI-Click_Blank_To_Select": "", - "BI-Basic_August": "August", - "BI-Word_Align_Left": "Align Left", - "BI-Basic_November": "November", - "BI-Font_Colour": "Font Color", - "BI-Multi_Date_Day_Prev": "", - "BI-Select_Part": "", - "BI-Multi_Date_Day_Next": "", - "BI-Less_Than": "Less Than", - "BI-Basic_February": "February", - "BI-Multi_Date_Year": "Year", - "BI-Number_Index": "Number", - "BI-Multi_Date_Week_Prev": "", - "BI-Next_Page": "Next", - "BI-Right_Page": "Right", - "BI-Numerical_Interval_Signal_Value": "", - "BI-Basic_December": "December", - "BI-Basic_Saturday": "Saturday", - "BI-Basic_Simple_Wednesday": "Wed", - "BI-Multi_Date_Quarter_Next": "", - "BI-Basic_October": "October", - "BI-Basic_Simple_Friday": "Fri", - "BI-Basic_Save": "Save", - "BI-Numerical_Interval_Number_Value": "", - "BI-Previous_Page": "Previous", - "BI-No_Select": "Blank", - "BI-Basic_Clears": "Clear", - "BI-Created_By_Me": "Created By Me", - "BI-Basic_Simple_Tuesday": "Tue", - "BI-Word_Align_Right": "Align Right", - "BI-Summary_Values": "Summary", - "BI-Basic_Clear": "Clear", - "BI-Upload_File_Size_Error": "", - "BI-Up_Page": "Up", - "BI-Basic_Simple_Sunday": "Sun", - "BI-Multi_Date_Relative_Current_Time": "", - "BI-Selected_Data": "Selected", - "BI-Multi_Date_Quarter": "Quarter", - "BI-Check_Selected": "", - "BI-Basic_Search": "Search", - "BI-Basic_May": "May", - "BI-Continue_Select": "Continue Select", - "BI-Please_Input_Positive_Integer": "Please Input Positive Integer", - "BI-Upload_File_Type_Error": "", - "BI-Upload_File_Error": "", - "BI-Basic_Friday": "Friday", - "BI-Down_Page": "Down", - "BI-Basic_Monday": "Monday", - "BI-Left_Page": "Left", - "BI-Transparent_Color": "Transparent", - "BI-Basic_Simple_Monday": "Mon", - "BI-Multi_Date_Year_End": "", - "BI-Time_Interval_Error_Text": "", - "BI-Basic_Time": "Time", - "BI-Basic_OK": "Ok", - "BI-Basic_Sure": "Sure", - "BI-Basic_Simple_Thursday": "Thu", - "BI-Multi_Date_Year_Prev": "", - "BI-Tiao_Data": "", - "BI-Basic_Italic": "Italic", - "BI-Color_Picker_Error_Text_Hex": "Please Input Correct Hex Value" -}; \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index 03f734a32..000000000 --- a/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Demo - - - - -
- - - diff --git a/jsy.lessconfig.json b/jsy.lessconfig.json deleted file mode 100644 index 9efbfa906..000000000 --- a/jsy.lessconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "@background-color-card-primary": "#003D4D", - "@color-primary": "#00acbe", - "font-color-normal": "#0d1540", - "font-color-light-gray": "#0d1540", - "font-color-disabled": "fade(#0d1540, 40)", - "font-color-light-disabled": "fade(#0d1540, 20)", - "font-color-success": "#28b668", - "font-color-negative": "#e65251", - "font-color-warning": "#faaa39", - "font-color-tips": "fade(#0d1540, 40)", - - "background-color-light-disabled": "fade(#0d1540, 5)", - "background-color-dark-success": "#28b668", - "background-color-negative": "#e65251", - "background-color-warning": "#faaa39", - - "border-color-disabled": "#e8eaed", - "border-color-success": "#28b668", - "border-color-negative": "#e65251" -} diff --git a/karma.conf.js b/karma.conf.js deleted file mode 100644 index 1152ccb6a..000000000 --- a/karma.conf.js +++ /dev/null @@ -1,143 +0,0 @@ -// Karma configuration -// Generated on Mon Nov 27 2017 11:16:26 GMT+0800 (中国标准时间) - -const os = require("os"); - -process.env.CHROME_BIN = require("puppeteer").executablePath(); - -module.exports = function (config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: "", - - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ["mocha", "chai"], - - - // list of files / patterns to load in the browser - files: [ - "dist/fineui.min.css", - "src/core/**/*.js", - "src/data/**/*.js", - "src/third/**/*.js", - "src/base/**/*.js", - "src/case/**/*.js", - "src/widget/**/*.js", - "src/component/**/*.js", - "dist/fix/fix.js", - "dist/fix/fix.compact.js", - "src/**/*.test.js", - "test/**/*.js" - ], - - exclude: [ - "src/base/single/input/file.js", - "src/case/ztree/**/*.js", - "src/widget/multitree/**/*.js", - "src/widget/multiselecttree/**/*.js", - "src/component/treevaluechooser/*.js" - ], - - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - "src/core/1.base.js": "coverage", - "src/core/func/**/*.js": "coverage", - "src/base/**/!(*.test).js": "coverage", - "src/case/**/!(*.test).js": "coverage", - "src/widget/**/!(*.test).js": "coverage", - "src/component/**/!(*.test).js": "coverage" - }, - - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ["progress", "coverage"], - - browserDisconnectTolerance: 3, - browserDisconnectTimeout : 300000, - browserNoActivityTimeout : 300000, - - coverageReporter: { - // specify a common output directory - dir: "coverage/", - reporters: [ - // reporters not supporting the `file` property - { type: "html", subdir: "report-html" }, - { type: "json-summary", subdir: "report-json-summary" }, - { type: "cobertura", subdir: "report-cobertura"} - ] - }, - - - // web server port - port: 9878, - - - // enable / disable colors in the output (reporters and logs) - colors: true, - - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - - customLaunchers: { - HeadlessChrome: { - base: "ChromeHeadless", - flags: [ - "--no-sandbox", - "--remote-debugging-port=9222", - "--enable-logging", - "--user-data-dir=./karma-chrome", - "--v=1", - "--disable-background-timer-throttling", - "--disable-renderer-backgrounding", - "--proxy-bypass-list=*", - "--disable-web-security", - "--disable-gpu", - "--no-sandbox", - ], - }, - }, - - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: [os.platform() === "win32" - && parseFloat(os.release() - .split(".") - .slice(0, 2) - .join(".")) <= 6.1 - ? "HeadlessChrome" : "ChromeHeadless"], - - retryLimit: 30, - - captureTimeout: 30000, - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: true, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity, - - plugins: [ - "karma-mocha", - "karma-chai", - "karma-chrome-launcher", - "karma-coverage" - ] - }); -}; diff --git a/lib/postbuild/postbuild.js b/lib/postbuild/postbuild.js deleted file mode 100644 index 9e7e5301a..000000000 --- a/lib/postbuild/postbuild.js +++ /dev/null @@ -1,52 +0,0 @@ -const { resolve } = require("path"); -const { existsSync, mkdirSync, readFileSync, writeFileSync } = require("fs"); -const rimraf = require("rimraf"); -const concat = require("concat"); -const glob = require("glob"); -const { config } = require("../../webpack/attachments"); - -const dest = resolve(__dirname, '../../dist'); - -const $dest = resolve(dest, './2.0'); - -if (!existsSync($dest)) { - mkdirSync($dest); -} - -const deleteList = [ - "fineui_without_jquery_polyfill.css", - "font.js", - "font.js.map", - "resource.js", - "resource.js.map", - "2.0/fineui_without_normalize.js", - "2.0/fineui_without_normalize.js.map", - "2.0/fineui_without_normalize.min.js", - "2.0/fineui_without_normalize.min.js.map", - "fineui_without_normalize.min.js", - "fineui_without_normalize.min.js.map", -].concat(glob.sync("dist/**/*.css.map").map(name => name.replace("dist/", ""))); - -deleteList.forEach(filename => { - const sourcefile = resolve(dest, `./${filename}`); - - rimraf(sourcefile, () => { - console.log(`${sourcefile} deleted`); - }); -}); - -const fileList = ['demo.js', 'fineui.js', '2.0/fineui.js', 'core.js']; -fileList.forEach(filename => { - const sourcefile = resolve(dest, `./${filename}`); - - const paths = filename.split("/"); - - const name = paths[paths.length - 1]; - - const content = `${readFileSync(sourcefile, { encoding: 'utf8' })} -//# sourceMappingURL=./${name}.map`; - - writeFileSync(sourcefile, content); -}); - -concat(config, resolve(dest, "resource.js")); diff --git a/lib/postpublish/postpublish.js b/lib/postpublish/postpublish.js deleted file mode 100644 index 49b4ae7e6..000000000 --- a/lib/postpublish/postpublish.js +++ /dev/null @@ -1,15 +0,0 @@ -const { resolve } = require("path"); -const { execSync } = require("child_process"); -const { writeFileSync } = require("fs"); - -const packageJSON = require("../../package.json"); - -packageJSON.name = "fineui"; - -packageJSON.publishConfig.registry = 'https://registry.npmjs.org'; - -writeFileSync(resolve(__dirname, "../../package.json"), JSON.stringify(packageJSON, null, 2)); - -execSync('git add dist/'); -execSync('git add package.json'); -execSync(`git diff-index --quiet HEAD || git commit -am "auto upgrade version to ${packageJSON.version}"`); diff --git a/lib/prepublish/prepublish.js b/lib/prepublish/prepublish.js deleted file mode 100644 index 4f082ab6a..000000000 --- a/lib/prepublish/prepublish.js +++ /dev/null @@ -1,63 +0,0 @@ -const { resolve, join } = require("path"); -const { writeFileSync } = require("fs"); -const { spawnSync } = require('child_process'); -const { bundleWithoutNormalize } = require('../../webpack/attachments'); - -function pad2(n) {// always returns a string - return (n < 10 ? "0" : "") + n; -} - -const d = new Date(); - -const version = d.getFullYear() + - pad2(d.getMonth() + 1) + - pad2(d.getDate()) + - pad2(d.getHours()) + - pad2(d.getMinutes()) + - pad2(d.getSeconds()); - -const packageJSON = require("../../package.json"); - -const versionChars = packageJSON.version.split("."); - -versionChars[versionChars.length - 1] = version; - -packageJSON.version = versionChars.join("."); - -packageJSON.publishConfig.registry = 'https://npm.fineres.com/'; - -packageJSON.name = "@fui/core"; - -writeFileSync(resolve(__dirname, "../../package.json"), JSON.stringify(packageJSON, null, 2)); - -// 将less打包成fineui.less发布到npm以供用户定制主题 -const lessPath = join(process.cwd(), '/src/less'); - -function copyFiles(from, to) { - spawnSync('cp', ['-r', from, to]); -} - -function removeFiles(src) { - spawnSync('rm', ['-rf', src]); -} - -function finalizeCompile() { - let lessContent = ''; - - bundleWithoutNormalize.forEach(path => { - const relativePath = path.replace(/.*src\/less/, 'src/less').replace(/.*public\/less/, 'public/less'); - lessContent += `@import "../../${relativePath}";\n`; - }); - - writeFileSync( - join(lessPath, 'fineui.less'), - lessContent, - ); -} - -removeFiles(`${lessPath}/font`); -removeFiles(`${lessPath}/fineui.less`); - -finalizeCompile(); - -copyFiles(`${process.cwd()}/dist/font`, lessPath); diff --git a/lodash.md b/lodash.md deleted file mode 100644 index 411585265..000000000 --- a/lodash.md +++ /dev/null @@ -1 +0,0 @@ -lodash core plus="debounce,throttle,get,set,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy,before,after,unescape,chunk,pick,pickBy,identity" diff --git a/package.json b/package.json index aeaef1f66..cb4d5c201 100644 --- a/package.json +++ b/package.json @@ -1,108 +1,33 @@ { - "name": "fineui", - "version": "2.0.20230208163847", - "description": "fineui", - "main": "dist/fineui_without_conflict.min.js", - "module": "dist/esm/index.js", - "sideEffects": [ - "dist/esm/polyfill/**/*", - "dist/esm/core/platform/**/*.js" - ], - "types": "dist/lib/index.d.ts", - "bin": { - "fui-cli": "./bin/cli/cli.js" - }, - "devDependencies": { - "@babel/cli": "^7.21.0", - "@babel/core": "^7.17.4", - "@fui/babel-preset-fineui": "^3.0.0", - "@fui/eslint-plugin": "^1.0.19", - "@juggle/resize-observer": "^3.4.0", - "@rollup/plugin-alias": "4.0.3", - "@rollup/plugin-babel": "6.0.3", - "@rollup/plugin-commonjs": "24.0.1", - "@rollup/plugin-node-resolve": "15.0.1", - "@types/node": "15.6.1", - "@typescript-eslint/eslint-plugin": "2.33.0", - "@typescript-eslint/parser": "2.33.0", - "autoprefixer": "9.6.1", - "babel-loader": "8.0.6", - "babel-plugin-module-resolver": "^5.0.0", - "chai": "4.2.0", - "concat": "1.0.3", - "core-js": "3.3.2", - "cross-env": "6.0.0", - "css-loader": "3.0.0", - "es6-promise": "4.2.8", - "eslint": "7.32.0", - "expose-loader": "0.7.5", - "express": "4.15.2", - "fork-ts-checker-webpack-plugin": "1.4.3", - "glob": "^7.2.0", - "html-webpack-plugin": "3.2.0", - "husky": "^3.1.0", - "karma": "3.1.4", - "karma-chai": "0.1.0", - "karma-chrome-launcher": "2.2.0", - "karma-coverage": "1.1.2", - "karma-mocha": "1.3.0", - "less": "3.11.2", - "less-loader": "5.0.0", - "mini-css-extract-plugin": "0.7.0", - "mocha": "5.2.0", - "npm-run-all": "4.1.5", - "open": "0.0.5", - "optimize-css-assets-webpack-plugin": "5.0.3", - "postcss-loader": "3.0.0", - "postcss-simple-vars": "5.0.2", - "prettier": "2.8.2", - "puppeteer": "^13.3.0", - "rimraf": "3.0.2", - "script-loader": "0.7.2", - "source-map-loader": "0.2.4", - "style-loader": "0.23.1", - "terser-webpack-plugin": "4.2.3", - "typescript": "3.9.2", - "webpack": "4.35.2", - "webpack-cli": "3.3.5", - "webpack-dev-server": "3.7.2", - "webpack-merge": "4.2.1" - }, - "scripts": { - "webpack:dev": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js -p --progress --host 0.0.0.0 --config=webpack/webpack.dev.js --mode development", - "webpack:prod": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack -p --progress --config=webpack/webpack.prod.js --mode production && npm run biCss && npm run jsyCss", - "webpack:css": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack -p --progress --config=webpack/webpack.css.js --mode production", - "start": "node server.js", - "build": "npm run esm && npm run webpack:prod && tsc", - "postbuild": "node ./lib/postbuild/postbuild.js", - "test": "karma start", - "dev": "npm run webpack:dev", - "esm": "babel src -d dist\\esm --config-file .\\es6.babel.js", - "esm:dev": "babel src -d dist\\esm --config-file .\\es6.babel.js -w", - "prepublishToPrivate": "npm run build && node ./lib/prepublish/prepublish.js", - "publishToPrivate": "npm publish", - "postpublishToPrivate": " node ./lib/postpublish/postpublish.js", - "biCss": "cross-env LESS_CONFIG_PATH=bi.lessconfig.json LESS_FILE_NAME=bi npm run webpack:css", - "jsyCss": "cross-env LESS_CONFIG_PATH=jsy.lessconfig.json LESS_FILE_NAME=jsy npm run webpack:css" - }, - "repository": { - "type": "git", - "url": "https://git.coding.net/fanruan/fineui.git" - }, - "keywords": [ - "ui", - "fineui", - "finebi" - ], - "publishConfig": { - "registry": "https://registry.npmjs.org" - }, - "author": "fanruan", - "license": "MIT", - "dependencies": { - "@popperjs/core": "2.11.6", - "@types/yargs": "17.0.13", - "jquery": "3.6.3", - "yargs": "17.6.2" - } + "name": "monorepo", + "version": "1.0.0", + "description": "", + "keywords": [], + "author": "", + "license": "ISC", + "scripts": { + "dev": "npm-run-all --parallel dev:*", + "dev:demo": "cd packages/demo && npm run dev", + "dev:fineui": "cd packages/fineui && npm run dev", + "static": "node script/code.static.js" + }, + "devDependencies": { + "@babel/cli": "^7.21.0", + "@babel/core": "^7.21.0", + "@babel/runtime": "^7.21.0", + "@fui/babel-preset-fineui": "^3.0.1", + "babel-loader": "^9.1.2", + "babel-plugin-module-resolver": "^5.0.0", + "css-loader": "^6.7.3", + "html-webpack-plugin": "^5.5.0", + "less": "^4.1.3", + "less-loader": "^11.1.0", + "npm-run-all": "^4.1.5", + "style-loader": "^3.3.1", + "typescript": "^4.9.5", + "webpack": "^5.75.0", + "webpack-bundle-analyzer": "^4.8.0", + "webpack-cli": "^5.0.1", + "webpack-dev-server": "^4.11.1" + } } diff --git a/packages/demo/babel.config.js b/packages/demo/babel.config.js new file mode 100644 index 000000000..d01a496d7 --- /dev/null +++ b/packages/demo/babel.config.js @@ -0,0 +1 @@ +module.exports = require('@fui/babel-preset-fineui').configs.base; \ No newline at end of file diff --git a/packages/demo/i18n/i18n.cn.js b/packages/demo/i18n/i18n.cn.js new file mode 100644 index 000000000..879cf1c49 --- /dev/null +++ b/packages/demo/i18n/i18n.cn.js @@ -0,0 +1,205 @@ +window.BI = {}; +window.BI.i18n = { + 'BI-Multi_Date_Quarter_End': '季度末', + 'BI-Multi_Date_Month_Begin': '月初', + 'BI-Multi_Date_YMD': '年月日', + 'BI-Custom_Color': '自定义颜色', + 'BI-Numerical_Interval_Input_Data': '请输入数值', + 'BI-Please_Input_Natural_Number': '请输入非负整数', + 'BI-No_More_Data': '无更多数据', + 'BI-Basic_Altogether': '共', + 'BI-Basic_Sunday': '星期日', + 'BI-Widget_Background_Colour': '组件背景', + 'BI-Color_Picker_Error_Text': '请输入0-255的正整数', + 'BI-Multi_Date_Month': '月', + 'BI-No_Selected_Item': '没有可选项', + 'BI-Multi_Date_Year_Begin': '年初', + 'BI-Quarter_1': '第1季度', + 'BI-Quarter_2': '第2季度', + 'BI-Quarter_3': '第3季度', + 'BI-Quarter_4': '第4季度', + 'BI-Multi_Date_Year_Next': '年后', + 'BI-Multi_Date_Month_Prev': '个月前', + 'BI-Month_Trigger_Error_Text': '请输入1~12的正整数', + 'BI-Less_And_Equal': '小于等于', + 'BI-Year_Trigger_Invalid_Text': '请输入有效时间', + 'BI-Multi_Date_Week_Next': '周后', + 'BI-Font_Size': '字号', + 'BI-Basic_Total': '共', + 'BI-Already_Selected': '已选择', + 'BI-Formula_Insert': '插入', + 'BI-Select_All': '全选', + 'BI-Basic_Tuesday': '星期二', + 'BI-Multi_Date_Month_End': '月末', + 'BI-Load_More': '点击加载更多数据', + 'BI-Basic_September': '九月', + 'BI-Current_Is_Last_Page': '当前已是最后一页', + 'BI-Basic_Auto': '自动', + 'BI-Basic_Count': '个', + 'BI-Basic_Value': '值', + 'BI-Basic_Unrestricted': '无限制', + 'BI-Quarter_Trigger_Error_Text': '请输入1~4的正整数', + 'BI-Basic_More': '更多', + 'BI-Basic_Wednesday': '星期三', + 'BI-Basic_Bold': '加粗', + 'BI-Basic_Simple_Saturday': '六', + 'BI-Multi_Date_Month_Next': '个月后', + 'BI-Basic_March': '三月', + 'BI-Current_Is_First_Page': '当前已是第一页', + 'BI-Basic_Thursday': '星期四', + 'BI-Basic_Prompt': '提示', + 'BI-Multi_Date_Today': '今天', + 'BI-Multi_Date_Quarter_Prev': '个季度前', + 'BI-Row_Header': '行表头', + 'BI-Date_Trigger_Error_Text': '日期格式示例:2015-3-11', + 'BI-Basic_Cancel': '取消', + 'BI-Basic_January': '一月', + 'BI-Basic_June': '六月', + 'BI-Basic_July': '七月', + 'BI-Basic_April': '四月', + 'BI-Multi_Date_Quarter_Begin': '季度初', + 'BI-Multi_Date_Week': '周', + 'BI-Click_Blank_To_Select': '点击"空格键"选中完全匹配项', + 'BI-Basic_August': '八月', + 'BI-Word_Align_Left': '文字居左', + 'BI-Basic_November': '十一月', + 'BI-Font_Colour': '字体颜色', + 'BI-Multi_Date_Day_Prev': '天前', + 'BI-Select_Part': '部分选择', + 'BI-Multi_Date_Day_Next': '天后', + 'BI-Less_Than': '小于', + 'BI-Basic_February': '二月', + 'BI-Multi_Date_Year': '年', + 'BI-Number_Index': '序号', + 'BI-Multi_Date_Week_Prev': '周前', + 'BI-Next_Page': '下一页', + 'BI-Right_Page': '向右翻页', + 'BI-Numerical_Interval_Signal_Value': '前后值相等,请将操作符改为“≤”', + 'BI-Basic_December': '十二月', + 'BI-Basic_Saturday': '星期六', + 'BI-Basic_Simple_Wednesday': '三', + 'BI-Multi_Date_Quarter_Next': '个季度后', + 'BI-Basic_October': '十月', + 'BI-Basic_Simple_Friday': '五', + 'BI-Basic_Save': '保存', + 'BI-Numerical_Interval_Number_Value': '请保证前面的数值小于/等于后面的数值', + 'BI-Previous_Page': '上一页', + 'BI-No_Select': '搜索结果为空', + 'BI-Basic_Clears': '清空', + 'BI-Created_By_Me': '我创建的', + 'BI-Basic_Simple_Tuesday': '二', + 'BI-Word_Align_Right': '文字居右', + 'BI-Summary_Values': '汇总', + 'BI-Basic_Clear': '清除', + 'BI-Upload_File_Size_Error': '文件大小不支持', + 'BI-Upload_File_Count_Error': '超出上传数量上限{R1},请重新上传', + 'BI-Up_Page': '向上翻页', + 'BI-Basic_Simple_Sunday': '日', + 'BI-Multi_Date_Relative_Current_Time': '相对当前时间', + 'BI-Selected_Data': '已选数据:', + 'BI-Multi_Date_Quarter': '季度', + 'BI-Check_Selected': '查看已选', + 'BI-Basic_Search': '搜索', + 'BI-Basic_May': '五月', + 'BI-Continue_Select': '继续选择', + 'BI-Please_Input_Positive_Integer': '请输入正整数', + 'BI-Upload_File_Type_Error': '文件类型不支持', + 'BI-Upload_File_Error': '文件上传失败', + 'BI-Basic_Friday': '星期五', + 'BI-Down_Page': '向下翻页', + 'BI-Basic_Monday': '星期一', + 'BI-Left_Page': '向左翻页', + 'BI-Transparent_Color': '透明', + 'BI-Basic_Simple_Monday': '一', + 'BI-Multi_Date_Year_End': '年末', + 'BI-Time_Interval_Error_Text': '请保证开始时间早于/等于结束时间', + 'BI-Basic_Time': '时间', + 'BI-Basic_OK': '确定', + 'BI-Basic_Sure': '确定', + 'BI-Basic_Simple_Thursday': '四', + 'BI-Multi_Date_Year_Prev': '年前', + 'BI-Tiao_Data': '条数据', + 'BI-Basic_Italic': '斜体', + 'BI-Basic_Dynamic_Title': '动态时间', + 'BI-Basic_Year': '年', + 'BI-Basic_Single_Quarter': '季', + 'BI-Basic_Month': '月', + 'BI-Basic_Week': '周', + 'BI-Basic_Day': '天', + 'BI-Basic_Work_Day': '工作日', + 'BI-Basic_Front': '前', + 'BI-Basic_Behind': '后', + 'BI-Basic_Empty': '空', + 'BI-Basic_Month_End': '月末', + 'BI-Basic_Month_Begin': '月初', + 'BI-Basic_Year_End': '年末', + 'BI-Basic_Year_Begin': '年初', + 'BI-Basic_Quarter_End': '季末', + 'BI-Basic_Quarter_Begin': '季初', + 'BI-Basic_Week_End': '周末', + 'BI-Basic_Week_Begin': '周初', + 'BI-Basic_Current_Day': '当天', + 'BI-Basic_Begin_Start': '初', + 'BI-Basic_End_Stop': '末', + 'BI-Basic_Current_Year': '今年', + 'BI-Basic_Year_Fen': '年份', + 'BI-Basic_Current_Month': '本月', + 'BI-Basic_Current_Quarter': '本季度', + 'BI-Basic_Year_Month': '年月', + 'BI-Basic_Year_Quarter': '年季度', + 'BI-Basic_Input_Can_Not_Null': '输入框不能为空', + 'BI-Basic_Date_Time_Error_Text': '日期格式示例:2015-3-11 00:00:00', + 'BI-Basic_Input_From_To_Number': '请输入{R1}的数值', + 'BI-Basic_Or': '或', + 'BI-Basic_And': '且', + 'BI-Conf_Add_Formula': '添加公式', + 'BI-Conf_Add_Condition': '添加条件', + 'BI-Conf_Formula_And': '且公式条件', + 'BI-Conf_Formula_Or': '或公式条件', + 'BI-Conf_Condition_And': '且条件', + 'BI-Conf_Condition_Or': '或条件', + 'BI-Microsoft_YaHei': '微软雅黑', + 'BI-Apple_Light': '苹方-light', + 'BI-Font_Family': '字体', + 'BI-Basic_Please_Input_Content': '请输入内容', + 'BI-Word_Align_Center': '文字居中', + 'BI-Basic_Please_Enter_Number_Between': '请输入{R1}-{R2}的值', + 'BI-More_Than': '大于', + 'BI-More_And_Equal': '大于等于', + 'BI-Please_Enter_SQL': '请输入SQL', + 'BI-Basic_Click_To_Add_Text': '+点击新增"{R1}"', + 'BI-Basic_Press_Enter_To_Add_Text': '点按回车键添加"{R1}"', + 'BI-Basic_Please_Select': '请选择', + 'BI-Basic_Font_Color': '文字颜色', + 'BI-Basic_Background_Color': '背景色', + 'BI-Basic_Underline': '下划线', + 'BI-Basic_Param_Month': '{R1}月', + 'BI-Basic_Param_Day': '{R1}日', + 'BI-Basic_Param_Quarter': '{R1}季度', + 'BI-Basic_Param_Week_Count': '第{R1}周', + 'BI-Basic_Param_Hour': '{R1}时', + 'BI-Basic_Param_Minute': '{R1}分', + 'BI-Basic_Param_Second': '{R1}秒', + 'BI-Basic_Param_Year': '{R1}年', + 'BI-Basic_Date_Day': '日', + 'BI-Basic_Hour_Sin': '时', + 'BI-Basic_Seconds': '秒', + 'BI-Basic_Minute': '分', + 'BI-Basic_Thousand': '千', + 'BI-Basic_Wan': '万', + 'BI-Basic_Million': '百万', + 'BI-Basic_Billion': '亿', + 'BI-Basic_Quarter': '季度', + 'BI-Basic_No_Select': '不选', + 'BI-Basic_Now': '此刻', + 'BI-Color_Picker_Error_Text_Hex': '请输入6位16进制颜色编号', + 'BI-Basic_Date_Range_Error': '请选择{R1}年{R2}月{R3}日-{R4}年{R5}月{R6}日的日期', + 'BI-Basic_Year_Range_Error': '请选择{R1}年-{R2}年的日期', + 'BI-Basic_Year_Month_Range_Error': '请选择{R1}年{R2}月-{R3}年{R4}月的日期', + 'BI-Basic_Year_Quarter_Range_Error': '请选择{R1}年{R2}季度-{R3}年{R4}季度的日期', + 'BI-Basic_Search_And_Patch_Paste': '搜索,支持批量粘贴、粘贴值通过换行识别', + 'BI-Basic_Recommend_Color': '推荐色', + 'BI-Basic_Too_Much_Value_Get_Two_Thousand': '粘贴的值过多,只能识别出前2000个值', + 'BI-Basic_Simple_Open': '开', + 'BI-Basic_Simple_Close': '关', +}; diff --git a/packages/demo/i18n/i18n.en.js b/packages/demo/i18n/i18n.en.js new file mode 100644 index 000000000..0acc5cb29 --- /dev/null +++ b/packages/demo/i18n/i18n.en.js @@ -0,0 +1,122 @@ +BI.i18n = { + 'BI-Multi_Date_Quarter_End': '', + 'BI-Multi_Date_Month_Begin': '', + 'BI-Multi_Date_YMD': '', + 'BI-Custom_Color': '', + 'BI-Numerical_Interval_Input_Data': '', + 'BI-Please_Input_Natural_Number': '', + 'BI-No_More_Data': 'No More Data', + 'BI-Basic_Altogether': 'Altogether', + 'BI-Basic_Sunday': 'Sunday', + 'BI-Widget_Background_Colour': '', + 'BI-Color_Picker_Error_Text': '', + 'BI-Multi_Date_Month': '', + 'BI-No_Selected_Item': '', + 'BI-Multi_Date_Year_Begin': '', + 'BI-Quarter_1': 'First Quarter', + 'BI-Quarter_2': 'Second Quarter', + 'BI-Quarter_3': 'Third Quarter', + 'BI-Quarter_4': 'Fourth Quarter', + 'BI-Multi_Date_Year_Next': '', + 'BI-Multi_Date_Month_Prev': '', + 'BI-Month_Trigger_Error_Text': '', + 'BI-Less_And_Equal': '', + 'BI-Year_Trigger_Invalid_Text': '', + 'BI-Multi_Date_Week_Next': '', + 'BI-Font_Size': '', + 'BI-Basic_Total': 'Total', + 'BI-Already_Selected': 'Already Selected items', + 'BI-Formula_Insert': '', + 'BI-Select_All': 'Select All', + 'BI-Basic_Tuesday': 'Tuesday', + 'BI-Multi_Date_Month_End': '', + 'BI-Load_More': 'Click to Load More', + 'BI-Basic_September': 'September', + 'BI-Current_Is_Last_Page': '', + 'BI-Basic_Auto': 'Auto', + 'BI-Basic_Count': '', + 'BI-Basic_Value': 'value', + 'BI-Basic_Unrestricted': 'unrestricted', + 'BI-Quarter_Trigger_Error_Text': '', + 'BI-Basic_More': 'More', + 'BI-Basic_Wednesday': 'Wednesday', + 'BI-Basic_Bold': 'Bold', + 'BI-Basic_Simple_Saturday': 'Sat', + 'BI-Multi_Date_Month_Next': '', + 'BI-Basic_March': 'March', + 'BI-Current_Is_First_Page': '', + 'BI-Basic_Thursday': 'Thursday', + 'BI-Basic_Prompt': 'Prompt', + 'BI-Multi_Date_Today': 'Toady', + 'BI-Multi_Date_Quarter_Prev': '', + 'BI-Row_Header': 'Row header', + 'BI-Date_Trigger_Error_Text': '日期格式示例:2015-3-11', + 'BI-Basic_Cancel': 'Cancel', + 'BI-Basic_January': 'January', + 'BI-Basic_June': 'June', + 'BI-Basic_July': 'July', + 'BI-Basic_April': 'April', + 'BI-Multi_Date_Quarter_Begin': '', + 'BI-Multi_Date_Week': 'Week', + 'BI-Click_Blank_To_Select': '', + 'BI-Basic_August': 'August', + 'BI-Word_Align_Left': 'Align Left', + 'BI-Basic_November': 'November', + 'BI-Font_Colour': 'Font Color', + 'BI-Multi_Date_Day_Prev': '', + 'BI-Select_Part': '', + 'BI-Multi_Date_Day_Next': '', + 'BI-Less_Than': 'Less Than', + 'BI-Basic_February': 'February', + 'BI-Multi_Date_Year': 'Year', + 'BI-Number_Index': 'Number', + 'BI-Multi_Date_Week_Prev': '', + 'BI-Next_Page': 'Next', + 'BI-Right_Page': 'Right', + 'BI-Numerical_Interval_Signal_Value': '', + 'BI-Basic_December': 'December', + 'BI-Basic_Saturday': 'Saturday', + 'BI-Basic_Simple_Wednesday': 'Wed', + 'BI-Multi_Date_Quarter_Next': '', + 'BI-Basic_October': 'October', + 'BI-Basic_Simple_Friday': 'Fri', + 'BI-Basic_Save': 'Save', + 'BI-Numerical_Interval_Number_Value': '', + 'BI-Previous_Page': 'Previous', + 'BI-No_Select': 'Blank', + 'BI-Basic_Clears': 'Clear', + 'BI-Created_By_Me': 'Created By Me', + 'BI-Basic_Simple_Tuesday': 'Tue', + 'BI-Word_Align_Right': 'Align Right', + 'BI-Summary_Values': 'Summary', + 'BI-Basic_Clear': 'Clear', + 'BI-Upload_File_Size_Error': '', + 'BI-Up_Page': 'Up', + 'BI-Basic_Simple_Sunday': 'Sun', + 'BI-Multi_Date_Relative_Current_Time': '', + 'BI-Selected_Data': 'Selected', + 'BI-Multi_Date_Quarter': 'Quarter', + 'BI-Check_Selected': '', + 'BI-Basic_Search': 'Search', + 'BI-Basic_May': 'May', + 'BI-Continue_Select': 'Continue Select', + 'BI-Please_Input_Positive_Integer': 'Please Input Positive Integer', + 'BI-Upload_File_Type_Error': '', + 'BI-Upload_File_Error': '', + 'BI-Basic_Friday': 'Friday', + 'BI-Down_Page': 'Down', + 'BI-Basic_Monday': 'Monday', + 'BI-Left_Page': 'Left', + 'BI-Transparent_Color': 'Transparent', + 'BI-Basic_Simple_Monday': 'Mon', + 'BI-Multi_Date_Year_End': '', + 'BI-Time_Interval_Error_Text': '', + 'BI-Basic_Time': 'Time', + 'BI-Basic_OK': 'Ok', + 'BI-Basic_Sure': 'Sure', + 'BI-Basic_Simple_Thursday': 'Thu', + 'BI-Multi_Date_Year_Prev': '', + 'BI-Tiao_Data': '', + 'BI-Basic_Italic': 'Italic', + 'BI-Color_Picker_Error_Text_Hex': 'Please Input Correct Hex Value', +}; diff --git a/packages/demo/index.html b/packages/demo/index.html new file mode 100644 index 000000000..5560a4205 --- /dev/null +++ b/packages/demo/index.html @@ -0,0 +1,16 @@ + + + + + + Document + + + +
+ + diff --git a/packages/demo/jsconfig.json b/packages/demo/jsconfig.json new file mode 100644 index 000000000..215f7a417 --- /dev/null +++ b/packages/demo/jsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "experimentalDecorators": true + } +} diff --git a/packages/demo/package.json b/packages/demo/package.json new file mode 100644 index 000000000..deaabb82e --- /dev/null +++ b/packages/demo/package.json @@ -0,0 +1,15 @@ +{ + "name": "demo", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "dev": "webpack-dev-server --open --config=webpack.dev.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@fui/core": "workspace:^2.0.20230208163847" + } +} diff --git a/demo/js/case/combo/demo.bubble_combo.js b/packages/demo/src/case/combo/demo.bubble_combo.js similarity index 100% rename from demo/js/case/combo/demo.bubble_combo.js rename to packages/demo/src/case/combo/demo.bubble_combo.js diff --git a/demo/js/case/combo/demo.editor_icon_check_combo.js b/packages/demo/src/case/combo/demo.editor_icon_check_combo.js similarity index 100% rename from demo/js/case/combo/demo.editor_icon_check_combo.js rename to packages/demo/src/case/combo/demo.editor_icon_check_combo.js diff --git a/demo/js/case/combo/demo.icon_combo.js b/packages/demo/src/case/combo/demo.icon_combo.js similarity index 100% rename from demo/js/case/combo/demo.icon_combo.js rename to packages/demo/src/case/combo/demo.icon_combo.js diff --git a/demo/js/case/combo/demo.icon_text_value_combo.js b/packages/demo/src/case/combo/demo.icon_text_value_combo.js similarity index 100% rename from demo/js/case/combo/demo.icon_text_value_combo.js rename to packages/demo/src/case/combo/demo.icon_text_value_combo.js diff --git a/packages/demo/src/case/combo/demo.search_text_value_combo.js b/packages/demo/src/case/combo/demo.search_text_value_combo.js new file mode 100644 index 000000000..1c4c6c695 --- /dev/null +++ b/packages/demo/src/case/combo/demo.search_text_value_combo.js @@ -0,0 +1,121 @@ +import { CONSTANTS } from "@/config/constant"; +import { shortcut, Widget, Msg, AllValueMultiTextValueCombo} from "@fui/core"; + +@shortcut() +export class SearchTextValueCombo extends Widget { + static xtype = "demo.search_text_value_combo"; + + props = { baseCls: "" }; + + render() { + let combo, searchCombo; + + return { + type: "bi.horizontal_auto", + items: [ + { + type: "bi.search_text_value_combo", + ref() { + combo = this; + }, + warningTitle: "111", + text: "默认值", + value: 14, + width: 300, + items: [ + { + text: "ABC-1", + iconCls: "date-font", + value: 1, + }, + { + text: "BCD-2", + iconCls: "search-font", + value: 2, + }, + { + text: "CDE-3", + iconCls: "pull-right-font", + value: 3, + }, + { + text: "DEF-3", + iconCls: "pull-right-font", + value: 4, + }, + { + text: "FEG-3", + iconCls: "pull-right-font", + value: 5, + }, + { + text: "FGH-3", + iconCls: "pull-right-font", + value: 6, + }, + { + text: "GHI-3", + iconCls: "pull-right-font", + value: 7, + }, + { + text: "HIJ-3", + iconCls: "pull-right-font", + value: 8, + }, + { + text: "IJK-3", + iconCls: "pull-right-font", + value: 9, + }, + { + text: "JKL-3", + iconCls: "pull-right-font", + value: 10, + } + ], + }, + { + type: "bi.all_value_multi_text_value_combo", + items: CONSTANTS.ITEMS, + text: "提示文本", + width: 200, + value: { + type: 1, + value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"], + }, + ref() { + searchCombo = this; + }, + listeners: [ + { + eventName: AllValueMultiTextValueCombo.EVENT_CONFIRM, + action() { + Msg.toast(JSON.stringify(searchCombo.getValue())); + }, + } + ], + }, + { + type: "bi.button", + text: "setValue(3)", + width: 90, + height: 25, + handler() { + combo.setValue(11); + }, + }, + { + type: "bi.button", + text: "getValue()", + width: 90, + height: 25, + handler() { + Msg.toast(JSON.stringify(searchCombo.getValue())); + }, + } + ], + vgap: 20, + }; + } +} diff --git a/demo/js/case/combo/demo.text_value_combo.js b/packages/demo/src/case/combo/demo.text_value_combo.js similarity index 100% rename from demo/js/case/combo/demo.text_value_combo.js rename to packages/demo/src/case/combo/demo.text_value_combo.js diff --git a/demo/js/case/combo/demo.text_value_down_list_combo.js b/packages/demo/src/case/combo/demo.text_value_down_list_combo.js similarity index 100% rename from demo/js/case/combo/demo.text_value_down_list_combo.js rename to packages/demo/src/case/combo/demo.text_value_down_list_combo.js diff --git a/packages/demo/src/case/combo/demo.text_vlaue_check_combo.js b/packages/demo/src/case/combo/demo.text_vlaue_check_combo.js new file mode 100644 index 000000000..74b662c20 --- /dev/null +++ b/packages/demo/src/case/combo/demo.text_vlaue_check_combo.js @@ -0,0 +1,50 @@ +import { Msg, shortcut, Widget } from "@fui/core"; + +@shortcut() +export class TextValueCheckCombo extends Widget { + static xtype = "demo.text_value_check_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: "bi.horizontal_auto", + items: [ + { + type: "bi.text_value_check_combo", + ref () { + self.combo = this; + }, + text: "默认值", + // value: 1, + width: 300, + items: [ + { + text: "MVC-1", + value: 1, + }, + { + text: "MVC-2", + value: 2, + }, + { + text: "MVC-3", + value: 3, + } + ], + }, + { + type: "bi.button", + width: 90, + height: 25, + handler () { + Msg.alert("", JSON.stringify(self.combo.getValue())); + }, + } + ], + vgap: 20, + }; + } +} diff --git a/demo/js/case/combo/index.js b/packages/demo/src/case/combo/index.js similarity index 100% rename from demo/js/case/combo/index.js rename to packages/demo/src/case/combo/index.js diff --git a/demo/js/case/demo.calendar.js b/packages/demo/src/case/demo.calendar.js similarity index 100% rename from demo/js/case/demo.calendar.js rename to packages/demo/src/case/demo.calendar.js diff --git a/demo/js/case/demo.click.effect.js b/packages/demo/src/case/demo.click.effect.js similarity index 100% rename from demo/js/case/demo.click.effect.js rename to packages/demo/src/case/demo.click.effect.js diff --git a/demo/js/case/demo.color_chooser.js b/packages/demo/src/case/demo.color_chooser.js similarity index 100% rename from demo/js/case/demo.color_chooser.js rename to packages/demo/src/case/demo.color_chooser.js diff --git a/demo/js/case/demo.color_chooser_popup.js b/packages/demo/src/case/demo.color_chooser_popup.js similarity index 100% rename from demo/js/case/demo.color_chooser_popup.js rename to packages/demo/src/case/demo.color_chooser_popup.js diff --git a/demo/js/case/demo.segment.js b/packages/demo/src/case/demo.segment.js similarity index 100% rename from demo/js/case/demo.segment.js rename to packages/demo/src/case/demo.segment.js diff --git a/demo/js/case/editor/demo.clear_editor.js b/packages/demo/src/case/editor/demo.clear_editor.js similarity index 100% rename from demo/js/case/editor/demo.clear_editor.js rename to packages/demo/src/case/editor/demo.clear_editor.js diff --git a/demo/js/case/editor/demo.shelter_editor.js b/packages/demo/src/case/editor/demo.shelter_editor.js similarity index 100% rename from demo/js/case/editor/demo.shelter_editor.js rename to packages/demo/src/case/editor/demo.shelter_editor.js diff --git a/demo/js/case/editor/demo.sign_editor.js b/packages/demo/src/case/editor/demo.sign_editor.js similarity index 100% rename from demo/js/case/editor/demo.sign_editor.js rename to packages/demo/src/case/editor/demo.sign_editor.js diff --git a/demo/js/case/editor/demo.simple_state_editor.js b/packages/demo/src/case/editor/demo.simple_state_editor.js similarity index 100% rename from demo/js/case/editor/demo.simple_state_editor.js rename to packages/demo/src/case/editor/demo.simple_state_editor.js diff --git a/demo/js/case/editor/demo.state_editor.js b/packages/demo/src/case/editor/demo.state_editor.js similarity index 100% rename from demo/js/case/editor/demo.state_editor.js rename to packages/demo/src/case/editor/demo.state_editor.js diff --git a/demo/js/case/editor/index.js b/packages/demo/src/case/editor/index.js similarity index 100% rename from demo/js/case/editor/index.js rename to packages/demo/src/case/editor/index.js diff --git a/packages/demo/src/case/index.js b/packages/demo/src/case/index.js new file mode 100644 index 000000000..161b58b4d --- /dev/null +++ b/packages/demo/src/case/index.js @@ -0,0 +1,15 @@ +// export * from "./combo"; +// export * from "./editor"; +// export * from "./item"; +// export * from "./list"; +// export * from "./pager"; +// export * from "./pane"; +// export * from "./tree"; +// export * from "./triggers"; + +export const caseComponent = {}; +// export * from "./demo.calendar"; +// export * from "./demo.click.effect"; +// export * from "./demo.color_chooser"; +// export * from "./demo.color_chooser_popup"; +// export * from "./demo.segment"; diff --git a/demo/js/case/item/demo.multi_select_item.js b/packages/demo/src/case/item/demo.multi_select_item.js similarity index 100% rename from demo/js/case/item/demo.multi_select_item.js rename to packages/demo/src/case/item/demo.multi_select_item.js diff --git a/demo/js/case/item/demo.single_select_item.js b/packages/demo/src/case/item/demo.single_select_item.js similarity index 100% rename from demo/js/case/item/demo.single_select_item.js rename to packages/demo/src/case/item/demo.single_select_item.js diff --git a/demo/js/case/item/demo.single_select_radio_item.js b/packages/demo/src/case/item/demo.single_select_radio_item.js similarity index 100% rename from demo/js/case/item/demo.single_select_radio_item.js rename to packages/demo/src/case/item/demo.single_select_radio_item.js diff --git a/demo/js/case/item/index.js b/packages/demo/src/case/item/index.js similarity index 100% rename from demo/js/case/item/index.js rename to packages/demo/src/case/item/index.js diff --git a/packages/demo/src/case/list/demo.lazy_loader.js b/packages/demo/src/case/list/demo.lazy_loader.js new file mode 100644 index 000000000..6878824ac --- /dev/null +++ b/packages/demo/src/case/list/demo.lazy_loader.js @@ -0,0 +1,28 @@ +import { CONSTANTS } from "@/config/constant"; +import { shortcut, Widget } from "@fui/core"; + +@shortcut() +export class Func extends Widget { + static xtype = "demo.lazy_loader"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + createWidget({ + type: "bi.lazy_loader", + element: this, + el: { + layouts: [ + { + type: "bi.left", + hgap: 5, + } + ], + }, + items: createItems(deepClone(CONSTANTS.ITEMS), { + type: "bi.button", + }), + }); + } +} diff --git a/packages/demo/src/case/list/demo.select_list.js b/packages/demo/src/case/list/demo.select_list.js new file mode 100644 index 000000000..36550c128 --- /dev/null +++ b/packages/demo/src/case/list/demo.select_list.js @@ -0,0 +1,29 @@ +import { CONSTANTS } from "@/config/constant"; +import { shortcut, Widget, createWidget, createItems, deepClone, Selection } from "@/core"; + +@shortcut() +export class Func extends Widget { + static xtype = "demo.select_list"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + createWidget({ + type: "bi.select_list", + toolbar: { + type: "bi.multi_select_bar", + iconWrapperWidth: 26, + }, + element: this, + el: { + el: { + chooseType: Selection.Multi, + }, + }, + items: createItems(deepClone(CONSTANTS.SIMPLE_ITEMS), { + type: "bi.multi_select_item", + }), + }); + } +} diff --git a/demo/js/case/list/index.js b/packages/demo/src/case/list/index.js similarity index 100% rename from demo/js/case/list/index.js rename to packages/demo/src/case/list/index.js diff --git a/demo/js/case/pager/demo.all_count_pager.js b/packages/demo/src/case/pager/demo.all_count_pager.js similarity index 100% rename from demo/js/case/pager/demo.all_count_pager.js rename to packages/demo/src/case/pager/demo.all_count_pager.js diff --git a/demo/js/case/pager/demo.direction_pager.js b/packages/demo/src/case/pager/demo.direction_pager.js similarity index 100% rename from demo/js/case/pager/demo.direction_pager.js rename to packages/demo/src/case/pager/demo.direction_pager.js diff --git a/demo/js/case/pager/index.js b/packages/demo/src/case/pager/index.js similarity index 100% rename from demo/js/case/pager/index.js rename to packages/demo/src/case/pager/index.js diff --git a/packages/demo/src/case/pane/demo.list_pane.js b/packages/demo/src/case/pane/demo.list_pane.js new file mode 100644 index 000000000..541d34fe5 --- /dev/null +++ b/packages/demo/src/case/pane/demo.list_pane.js @@ -0,0 +1,52 @@ +import { CONSTANTS } from "@/config/constant"; + +import { + ListPane, + MultiSelectItem, + ButtonGroup, + VerticalLayout, + shortcut, + Widget, + createItems, + deepClone, +} from "@fui/core"; + +@shortcut() +export class ListPaneDemo extends Widget { + static xtype = "demo.list_pane"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: ListPane.xtype, + ref() { + self.pane = this; + }, + itemsCreator(op, callback) { + setTimeout(() => { + callback( + createItems(deepClone(CONSTANTS.ITEMS), { + type: MultiSelectItem.xtype, + height: 25, + }) + ); + }, 2000); + }, + el: { + type: ButtonGroup.xtype, + layouts: [ + { + type: VerticalLayout.xtype, + }, + ], + }, + }; + } + + mounted() { + this.pane.populate(); + } +} diff --git a/packages/demo/src/case/pane/demo.multi_popup_view.js b/packages/demo/src/case/pane/demo.multi_popup_view.js new file mode 100644 index 000000000..9d6357212 --- /dev/null +++ b/packages/demo/src/case/pane/demo.multi_popup_view.js @@ -0,0 +1,50 @@ +import { CONSTANTS } from "@/config/constant"; + +import { AbsoluteLayout, Combo, TextButton, MultiPopupView, ButtonGroup, VerticalLayout, MultiSelectItem, shortcut, Widget, createItems, deepClone } from "@fui/core" + + +@shortcut() +export class MultiPopupViewDemo extends Widget { + static xtype = "demo.multi_popup_view"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: Combo.xtype, + width: 200, + height: 30, + el: { + type: TextButton.xtype, + text: "点击", + cls: "bi-border", + height: 30, + }, + popup: { + type: MultiPopupView.xtype, + el: { + type: ButtonGroup.xtype, + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + items: createItems(deepClone(CONSTANTS.ITEMS), { + type: MultiSelectItem.xtype, + height: 25, + }), + }, + }, + }, + } + ], + }; + } +} + diff --git a/packages/demo/src/case/pane/demo.panel.js b/packages/demo/src/case/pane/demo.panel.js new file mode 100644 index 000000000..d6835e279 --- /dev/null +++ b/packages/demo/src/case/pane/demo.panel.js @@ -0,0 +1,39 @@ +import { CONSTANTS } from "@/config/constant"; + +import { Panel, Button, ButtonGroup, VerticalLayout, MultiSelectItem, shortcut, Widget, createItems, deepClone } from "@fui/core" + + +@shortcut() +export class PanelDemo extends Widget { + static xtype = "demo.panel"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: Panel.xtype, + title: "title", + titleButtons: [ + { + type: Button.xtype, + text: "操作", + } + ], + el: { + type: ButtonGroup.xtype, + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + items: createItems(deepClone(CONSTANTS.ITEMS), { + type: MultiSelectItem.xtype, + height: 25, + }), + }, + }; + } +} + diff --git a/packages/demo/src/case/pane/demo.popup_panel.js b/packages/demo/src/case/pane/demo.popup_panel.js new file mode 100644 index 000000000..d3cc26363 --- /dev/null +++ b/packages/demo/src/case/pane/demo.popup_panel.js @@ -0,0 +1,50 @@ +import { CONSTANTS } from "@/config/constant"; + +import { createItems, deepClone, AbsoluteLayout, Combo, TextButton, PopupPanel, ButtonGroup, VerticalLayout, MultiSelectItem, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class PopupPanelDemo extends Widget { + static xtype = "demo.popup_panel"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: Combo.xtype, + width: 200, + height: 30, + el: { + type: TextButton.xtype, + text: "点击", + cls: "bi-border", + height: 30, + }, + popup: { + type: PopupPanel.xtype, + el: { + type: ButtonGroup.xtype, + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + items: createItems(deepClone(CONSTANTS.ITEMS), { + type: MultiSelectItem.xtype, + height: 25, + }), + }, + }, + }, + } + ], + }; + } +} + diff --git a/demo/js/case/pane/index.js b/packages/demo/src/case/pane/index.js similarity index 100% rename from demo/js/case/pane/index.js rename to packages/demo/src/case/pane/index.js diff --git a/demo/js/case/tree/demo.display_tree.js b/packages/demo/src/case/tree/demo.display_tree.js similarity index 100% rename from demo/js/case/tree/demo.display_tree.js rename to packages/demo/src/case/tree/demo.display_tree.js diff --git a/packages/demo/src/case/tree/demo.level_tree.js b/packages/demo/src/case/tree/demo.level_tree.js new file mode 100644 index 000000000..0f6a6222a --- /dev/null +++ b/packages/demo/src/case/tree/demo.level_tree.js @@ -0,0 +1,111 @@ +import { shortcut, Widget, createWidget } from "@/core"; +import { Msg } from "@/base"; + +@shortcut() +export class Func extends Widget { + static xtype = "demo.level_tree"; + + props = { baseCls: "demo-func" }; + + render() { + const tree = createWidget({ + type: "bi.level_tree", + chooseType: 0, + items: [ + { + id: 1, + text: "第一项", + value: 1, + isParent: true, + }, + { + id: 2, + text: "第二项", + value: 2, + isParent: true, + }, + { + id: 3, + text: "第三项", + value: 1, + isParent: true, + open: true, + }, + { + id: 4, + text: "第四项", + value: 1, + }, + { + id: 11, + pId: 1, + text: "子项1", + value: 11, + }, + { + id: 12, + pId: 1, + text: "子项2", + value: 12, + }, + { + id: 13, + pId: 1, + text: "子项3", + value: 13, + }, + { + id: 111, + pId: 11, + text: "子项1-1", + value: 111, + }, + { + id: 21, + pId: 2, + text: "子项1", + value: 21, + }, + { + id: 31, + pId: 3, + text: "子项1", + value: 31, + }, + { + id: 32, + pId: 3, + text: "子项2", + value: 32, + }, + { + id: 33, + pId: 3, + text: "子项3", + value: 33, + } + ], + }); + + createWidget({ + type: "bi.vtape", + element: this, + items: [ + { + el: tree, + }, + { + height: 30, + el: { + type: "bi.button", + height: 30, + text: "getValue", + handler() { + Msg.alert("", tree.getValue()); + }, + }, + } + ], + }); + } +} diff --git a/packages/demo/src/case/tree/demo.simple_tree.js b/packages/demo/src/case/tree/demo.simple_tree.js new file mode 100644 index 000000000..0ad803ae8 --- /dev/null +++ b/packages/demo/src/case/tree/demo.simple_tree.js @@ -0,0 +1,147 @@ +import { shortcut, Widget, createWidget } from "@/core"; +import { Msg } from "@/base"; + +@shortcut() +export class Func extends Widget { + static xtype = "demo.simple_tree"; + + props = { baseCls: "demo-func" }; + + render() { + // value值一定要是字符串 + const tree = createWidget({ + type: "bi.simple_tree", + items: [ + { + id: 1, + text: "第一项", + value: "1", + }, + { + id: 2, + text: "第二项", + value: "2", + }, + { + id: 3, + text: "第三项", + value: "3", + open: true, + }, + { + id: 11, + pId: 1, + text: "子项1", + value: "11", + }, + { + id: 12, + pId: 1, + text: "子项2", + value: "12", + }, + { + id: 13, + pId: 1, + text: "子项3", + value: "13", + }, + { + id: 31, + pId: 3, + text: "子项1", + value: "31", + }, + { + id: 32, + pId: 3, + text: "子项2", + value: "32", + }, + { + id: 33, + pId: 3, + text: "子项3", + value: "33", + } + ], + value: ["31", "32", "33"], + }); + + // tree.populate([{ + // id: 1, + // text: "第一项", + // value: "1" + // }, { + // id: 2, + // text: "第二项", + // value: "2" + // }, { + // id: 3, + // text: "第三项", + // value: "3", + // open: true + // }, { + // id: 11, + // pId: 1, + // text: "子项1", + // value: "11" + // }, { + // id: 12, + // pId: 1, + // text: "子项2", + // value: "12" + // }, { + // id: 13, + // pId: 1, + // text: "子项3", + // value: "13" + // }, { + // id: 31, + // pId: 3, + // text: "子项1", + // value: "31" + // }, { + // id: 32, + // pId: 3, + // text: "子项2", + // value: "32" + // }, { + // id: 33, + // pId: 3, + // text: "子项3", + // value: "33" + // }], "z"); + createWidget({ + type: "bi.vtape", + element: this, + items: [ + { + el: tree, + }, + { + height: 30, + el: { + type: "bi.button", + height: 30, + text: "setValue(['31', '32', '33'])", + handler() { + tree.setValue(["31", "32", "33"]); + }, + }, + }, + { + height: 30, + el: { + type: "bi.button", + height: 30, + text: "getValue", + handler() { + Msg.alert("", JSON.stringify(tree.getValue())); + }, + }, + } + ], + }); + } +} diff --git a/demo/js/case/tree/index.js b/packages/demo/src/case/tree/index.js similarity index 100% rename from demo/js/case/tree/index.js rename to packages/demo/src/case/tree/index.js diff --git a/demo/js/case/triggers/demo.editor_trigger.js b/packages/demo/src/case/triggers/demo.editor_trigger.js similarity index 100% rename from demo/js/case/triggers/demo.editor_trigger.js rename to packages/demo/src/case/triggers/demo.editor_trigger.js diff --git a/demo/js/case/triggers/demo.icon_trigger.js b/packages/demo/src/case/triggers/demo.icon_trigger.js similarity index 100% rename from demo/js/case/triggers/demo.icon_trigger.js rename to packages/demo/src/case/triggers/demo.icon_trigger.js diff --git a/demo/js/case/triggers/demo.select_text_trigger.js b/packages/demo/src/case/triggers/demo.select_text_trigger.js similarity index 100% rename from demo/js/case/triggers/demo.select_text_trigger.js rename to packages/demo/src/case/triggers/demo.select_text_trigger.js diff --git a/demo/js/case/triggers/demo.text_trigger.js b/packages/demo/src/case/triggers/demo.text_trigger.js similarity index 100% rename from demo/js/case/triggers/demo.text_trigger.js rename to packages/demo/src/case/triggers/demo.text_trigger.js diff --git a/demo/js/case/triggers/index.js b/packages/demo/src/case/triggers/index.js similarity index 100% rename from demo/js/case/triggers/index.js rename to packages/demo/src/case/triggers/index.js diff --git a/packages/demo/src/center.js b/packages/demo/src/center.js new file mode 100644 index 000000000..bb120071b --- /dev/null +++ b/packages/demo/src/center.js @@ -0,0 +1,32 @@ +import { shortcut, Widget, RouterView, Router } from '@fui/core'; + +@shortcut() +export class Center extends Widget { + static xtype = 'demo.center'; + + props = { baseCls: 'demo-center' }; + + render() { + const self = this; + + return { + type: RouterView.xtype, + }; + } +} + +@shortcut() +export class RouterDemo extends Widget { + static xtype = 'demo.router'; + + props = { + baseCls: 'demo-router', + }; + + render() { + const params = Router.$router.history.current.params; + return { + type: params.componentId, + }; + } +} diff --git a/packages/demo/src/config/base.js b/packages/demo/src/config/base.js new file mode 100644 index 000000000..195715320 --- /dev/null +++ b/packages/demo/src/config/base.js @@ -0,0 +1,11 @@ +import { basic } from "../base"; +import { transModule2Route } from "./utils"; + +export const baseConfig = [ + { + id: 2, + text: "基础控件", + open: false + }, + ...transModule2Route(basic, 2) +]; diff --git a/packages/demo/src/config/constant.js b/packages/demo/src/config/constant.js new file mode 100644 index 000000000..e6b94b74a --- /dev/null +++ b/packages/demo/src/config/constant.js @@ -0,0 +1,3600 @@ +import { map } from "@fui/core"; + +export const CONSTANTS = { + SIMPLE_ITEMS: map( + "柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂".match( + /[^\s]+/g + ), + function (i, v) { + return { + text: v, + value: v, + title: v + }; + } + ), + ITEMS: map( + "柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂 柳州市积玉贸易有限公司 柳州市福运来贸易有限责任公司 柳州市钢义物资有限公司 柳州市洋力化工有限公司 柳州市悦盛贸易有限公司 柳州市雁城钢管物资有限公司 柳州市恒瑞钢材经营部 柳州市科拓电子有限公司 柳州市九方电子有限公司 柳州市桂龙汽车配件厂 柳州市制鞋工厂 柳州市炜力科贸有限公司 柳州市希翼贸易有限公司 柳州市兆金物资有限公司 柳州市和润电子科技有限责任公司 柳州市汇凯贸易有限公司 柳州市好机汇商贸有限公司 柳州市泛源商贸经营部 柳州市利汇达物资有限公司 广西全民药业有限责任公司 柳州超凡物资贸易有限责任公司 柳州市贵宏物资有限责任公司 柳州昊恒贸易有限责任公司 柳州市浦联物资有限公司 柳州市广通园林绿化工程有限责任公司 柳州市松发物资贸易有限责任公司 柳州市奥士达办公设备有限责任公司 柳州市海泰物资有限公司 柳州市金三环针织厂 柳州市钢贸物资有限公司 柳州市明阳纺织有限公司 柳州市世科科技发展有限公司 柳州市禄羊贸易有限公司 柳州市金兆阳商贸有限公司 柳州市汇昌物资经营部 柳州市林泰金属物资供应站 柳州市自来水管道材料设备公司 柳州市丹柳铝板有限公司 柳州市桂冶物资有限公司 柳州市宸业物资经营部 柳州市耀成贸易有限公司 柳州奥易自动化科技有限公司 柳州市萃丰科技有限责任公司 柳州市华储贸易有限责任公司 柳州市黄颜钢材有限责任公司 柳州市银盛物资有限责任公司 柳州市新仪化玻供应站 柳州市晶凯化工有限公司 广西柳州市柳江包装纸厂 柳州市志新物资有限责任公司 柳州市兆钢物资有限公司 柳州市友方科技发展有限责任公司 柳州市缝纫机台板家具总厂 柳州市晖海数码办公设备有限责任公司 柳州市富兰特服饰有限责任公司 柳州市柳北区富兴物资经营部 柳州市柳锌福利厂 柳州市海泉印刷有限责任公司 柳州市乾亨贸易有限公司 柳州市悦宁物资贸易有限公司 柳州市昊天贸易有限公司 广西惠字钢铁有限公司 柳州市名青物资有限公司 柳州市林郝物资有限公司 柳州市民政服装厂 柳州市多维劳保用品厂 柳州市轻工物资供应公司 柳州市程源物资有限责任公司 柳州市寿丰物资贸易有限责任公司 柳州市凯凡物资有限公司 柳州市利晖物资经营部 柳州市恒茂金属物资供应站 柳州市中储物资经营部 柳州市第二医疗器械厂 柳州市来鑫物资经营部 柳州市钢鑫物资贸易有限责任公司 柳州市双合袜业有限责任公司 柳州市茂松经贸有限责任公司 柳州市行行物资贸易有限公司 柳州市方一物资有限公司 柳州成异钢管销售有限公司 柳州广惠佳电脑有限公司 桂林市圣泽鑫物资有限公司柳州分公司 柳州市砼基建材贸易有限公司 柳州市海燕针织厂 上海浦光仪表厂柳州销售处 柳州市能电工贸有限责任公司 柳州市广贸物资有限公司 柳州市柳北区大昌电工灯饰经营部 柳州市金龙印务有限公司 柳州市奇缘婚典服务有限公司 柳州市盛博物资经营部 柳州市项元钢铁贸易有限公司 柳州市虞美人化妆品经营部 柳州市俊彦鞋厂 柳州市聚源特钢有限公司 柳州市迅龙科贸有限责任公司 柳州市恒飞电子有限责任公司 柳州市蓝正现代办公设备有限责任公司 柳州地区农业生产资料公司 柳州华菱钢管销售有限公司 柳州融通物资有限公司 柳州市可仁广告策划有限责任公司 柳州市鸟鑫物资有限责任公司 柳州市五丰钢材供应站 柳州市金江不锈钢有限公司 柳州市美日物资设备有限责任公司 柳州市鑫东物资贸易有限责任公司 柳州地区日用杂品公司 柳州市华纳物资贸易有限公司 柳州乾利金虹物资贸易有限责任公司 柳州市新迈计算机有限公司 柳州市富丽实业发展公司 柳州市石钢金属材料有限公司 柳州市力志传真机销售有限公司 广西宝森投资有限公司 柳州市嵘基商贸有限公司 柳州市景民商贸有限责任公司 柳州市银桥化玻有限责任公司 柳州市宏文糖烟店 柳州市科苑电脑网络有限公司 柳州市两面针旅游用品厂 柳州市立早室内装璜有限责任公司 柳州地化建材有限公司 柳州市涛达贸易有限公司 柳州市兰丰档案服务中心 柳州市惠贸物资有限责任公司 柳州市立文物资有限责任公司 柳州市致和商贸经营部 柳州市金色阳光信息咨询有限公司 柳州市赛利钢材经销部 柳州市日用化工厂 柳州市昆廷物资有限责任公司 柳州市邦盛贸易有限公司 柳州市济华贸易有限公司 柳州昕威橡塑化工经营部 柳州市联业贸易有限公司 柳州市兰钢贸易有限公司 柳州市子欣科技有限公司 柳州市狄龙机电设备有限公司 柳州市方真物资贸易有限公司 柳州市银鸥废旧回收中心 柳州市冠宝贸易有限公司 柳州市鑫盛德商务咨询有限责任公司 柳州市泰汇银通经贸有限公司 广西瀚维智测科技有限公司 柳州市钓鱼郎制衣有限责任公司 柳州溪水物资有限公司 柳州市融峰物资有限责任公司 广西新地科技有限责任公司 柳州市纺织装饰公司 柳州市粤翔冶金炉料有限公司 柳州市远腾贸易有限公司 柳州市东鸿城市改造有限公司 广西丛欣实业有限公司 柳州市服装厂 柳州市立安联合刀片有限公司 广西国扬投资有限责任公司 柳州市铭泰办公设备公司 柳州市桂钢物资供应站 柳州市昱升物资有限责任公司 柳州市鹰飞灿科贸有限公司 柳州市先导科贸有限公司 柳州市金秋建材物资经营部 柳州市童装厂 柳州市民泽物资有限公司 柳州市恒先物资贸易有限公司 柳州市银夏冷气工程有限责任公司 柳州粮食批发有限责任公司 柳州市金银华窗纱制造有限责任公司 柳州市三方贸易有限公司 柳州市丰涛商贸有限责任公司 柳州华智企业管理咨询有限责任公司 柳州市诚正建筑工程施工图审查有限公司 柳州市今科电讯设备营销中心 柳州市闽德电子有限公司 柳州市鑫虹针织厂 柳州市畅通通讯器材有限责任公司 柳州市正钢物资经营部 柳州市新柳饲料有限责任公司 柳州市黄村油库 柳州市天泰电力装饰工程有限公司 柳州市兆吉物资有限责任公司 柳州市八龙纸制品有限责任公司 柳州市巨佳电脑网络科技有限公司 ".match( + /[^\s]+/g + ), + function (i, v) { + return { + text: v, + value: v, + title: v + }; + } + ), + TREEITEMS: [ + { pId: "0", id: "0_0", text: "( 共25个 )", value: "", open: true }, + { + pId: "0_0", + id: "0_0_0", + text: "安徽省( 共1个 )", + value: "安徽省", + open: true + }, + { + pId: "0_0_0", + id: "0_0_0_0", + text: "芜湖市", + value: "芜湖市", + open: true + }, + { + pId: "0_0", + id: "0_0_1", + text: "北京市( 共6个 )", + value: "北京市", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_0", + text: "北京市区", + value: "北京市区", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_1", + text: "朝阳区", + value: "朝阳区", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_2", + text: "东城区", + value: "东城区", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_3", + text: "海淀区4内", + value: "海淀区4内", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_4", + text: "海淀区4外", + value: "海淀区4外", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_5", + text: "石景山区", + value: "石景山区", + open: true + }, + { + pId: "0_0", + id: "0_0_2", + text: "福建省( 共2个 )", + value: "福建省", + open: true + }, + { + pId: "0_0_2", + id: "0_0_2_0", + text: "莆田市", + value: "莆田市", + open: true + }, + { + pId: "0_0_2", + id: "0_0_2_1", + text: "泉州市", + value: "泉州市", + open: true + }, + { + pId: "0_0", + id: "0_0_3", + text: "甘肃省( 共1个 )", + value: "甘肃省", + open: true + }, + { + pId: "0_0_3", + id: "0_0_3_0", + text: "兰州市", + value: "兰州市", + open: true + }, + { + pId: "0_0", + id: "0_0_4", + text: "广东省( 共5个 )", + value: "广东省", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_0", + text: "东莞市", + value: "东莞市", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_1", + text: "广州市", + value: "广州市", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_2", + text: "惠州市", + value: "惠州市", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_3", + text: "深圳市", + value: "深圳市", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_4", + text: "珠海市", + value: "珠海市", + open: true + }, + { + pId: "0_0", + id: "0_0_5", + text: "广西壮族自治区( 共1个 )", + value: "广西壮族自治区", + open: true + }, + { + pId: "0_0_5", + id: "0_0_5_0", + text: "南宁市", + value: "南宁市", + open: true + }, + { + pId: "0_0", + id: "0_0_6", + text: "河北省( 共2个 )", + value: "河北省", + open: true + }, + { + pId: "0_0_6", + id: "0_0_6_0", + text: "保定市", + value: "保定市", + open: true + }, + { + pId: "0_0_6", + id: "0_0_6_1", + text: "邢台市", + value: "邢台市", + open: true + }, + { + pId: "0_0", + id: "0_0_7", + text: "河南省( 共1个 )", + value: "河南省", + open: true + }, + { + pId: "0_0_7", + id: "0_0_7_0", + text: "郑州市", + value: "郑州市", + open: true + }, + { + pId: "0_0", + id: "0_0_8", + text: "黑龙江省( 共7个 )", + value: "黑龙江省", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_0", + text: "大庆市", + value: "大庆市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_1", + text: "哈尔滨市", + value: "哈尔滨市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_2", + text: "鸡西市", + value: "鸡西市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_3", + text: "佳木斯市", + value: "佳木斯市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_4", + text: "牡丹江市", + value: "牡丹江市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_5", + text: "齐齐哈尔市", + value: "齐齐哈尔市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_6", + text: "双鸭山市", + value: "双鸭山市", + open: true + }, + { + pId: "0_0", + id: "0_0_9", + text: "湖北省( 共1个 )", + value: "湖北省", + open: true + }, + { + pId: "0_0_9", + id: "0_0_9_0", + text: "武汉市", + value: "武汉市", + open: true + }, + { + pId: "0_0", + id: "0_0_10", + text: "湖南省( 共3个 )", + value: "湖南省", + open: true + }, + { + pId: "0_0_10", + id: "0_0_10_0", + text: "常德市", + value: "常德市", + open: true + }, + { + pId: "0_0_10", + id: "0_0_10_1", + text: "长沙市", + value: "长沙市", + open: true + }, + { + pId: "0_0_10", + id: "0_0_10_2", + text: "邵阳市", + value: "邵阳市", + open: true + }, + { + pId: "0_0", + id: "0_0_11", + text: "吉林省( 共4个 )", + value: "吉林省", + open: true + }, + { + pId: "0_0_11", + id: "0_0_11_0", + text: "白山市", + value: "白山市", + open: true + }, + { + pId: "0_0_11", + id: "0_0_11_1", + text: "长春市", + value: "长春市", + open: true + }, + { + pId: "0_0_11", + id: "0_0_11_2", + text: "松原市", + value: "松原市", + open: true + }, + { + pId: "0_0_11", + id: "0_0_11_3", + text: "通化市", + value: "通化市", + open: true + }, + { + pId: "0_0", + id: "0_0_12", + text: "江苏省( 共8个 )", + value: "江苏省", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_0", + text: "常州市", + value: "常州市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_1", + text: "南京市", + value: "南京市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_2", + text: "南通市", + value: "南通市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_3", + text: "苏州市", + value: "苏州市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_4", + text: "宿迁市", + value: "宿迁市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_5", + text: "泰州市", + value: "泰州市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_6", + text: "无锡市", + value: "无锡市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_7", + text: "盐城市", + value: "盐城市", + open: true + }, + { + pId: "0_0", + id: "0_0_13", + text: "辽宁省( 共11个 )", + value: "辽宁省", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_0", + text: "鞍山市", + value: "鞍山市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_1", + text: "本溪市", + value: "本溪市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_2", + text: "朝阳市", + value: "朝阳市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_3", + text: "大连市", + value: "大连市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_4", + text: "抚顺市", + value: "抚顺市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_5", + text: "葫芦岛市", + value: "葫芦岛市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_6", + text: "锦州市", + value: "锦州市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_7", + text: "辽阳市", + value: "辽阳市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_8", + text: "盘锦市", + value: "盘锦市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_9", + text: "沈阳市", + value: "沈阳市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_10", + text: "营口市", + value: "营口市", + open: true + }, + { + pId: "0_0", + id: "0_0_14", + text: "内蒙古( 共1个 )", + value: "内蒙古", + open: true + }, + { + pId: "0_0_14", + id: "0_0_14_0", + text: "鄂尔多斯市", + value: "鄂尔多斯市", + open: true + }, + { + pId: "0_0", + id: "0_0_15", + text: "宁夏回族自治区( 共1个 )", + value: "宁夏回族自治区", + open: true + }, + { + pId: "0_0_15", + id: "0_0_15_0", + text: "银川市", + value: "银川市", + open: true + }, + { + pId: "0_0", + id: "0_0_16", + text: "山东省( 共7个 )", + value: "山东省", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_0", + text: "济南市", + value: "济南市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_1", + text: "济宁市", + value: "济宁市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_2", + text: "聊城市", + value: "聊城市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_3", + text: "临沂市", + value: "临沂市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_4", + text: "青岛市", + value: "青岛市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_5", + text: "烟台市", + value: "烟台市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_6", + text: "枣庄市", + value: "枣庄市", + open: true + }, + { + pId: "0_0", + id: "0_0_17", + text: "山西省( 共1个 )", + value: "山西省", + open: true + }, + { + pId: "0_0_17", + id: "0_0_17_0", + text: "太原市", + value: "太原市", + open: true + }, + { + pId: "0_0", + id: "0_0_18", + text: "陕西省( 共1个 )", + value: "陕西省", + open: true + }, + { + pId: "0_0_18", + id: "0_0_18_0", + text: "西安市", + value: "西安市", + open: true + }, + { + pId: "0_0", + id: "0_0_19", + text: "上海市( 共1个 )", + value: "上海市", + open: true + }, + { + pId: "0_0_19", + id: "0_0_19_0", + text: "上海市区", + value: "上海市区", + open: true + }, + { + pId: "0_0", + id: "0_0_20", + text: "四川省( 共1个 )", + value: "四川省", + open: true + }, + { + pId: "0_0_20", + id: "0_0_20_0", + text: "成都市", + value: "成都市", + open: true + }, + { + pId: "0_0", + id: "0_0_21", + text: "新疆维吾尔族自治区( 共2个 )", + value: "新疆维吾尔族自治区", + open: true + }, + { + pId: "0_0_21", + id: "0_0_21_0", + text: "吐鲁番地区", + value: "吐鲁番地区", + open: true + }, + { + pId: "0_0_21", + id: "0_0_21_1", + text: "乌鲁木齐", + value: "乌鲁木齐", + open: true + }, + { + pId: "0_0", + id: "0_0_22", + text: "云南省( 共1个 )", + value: "云南省", + open: true + }, + { + pId: "0_0_22", + id: "0_0_22_0", + text: "昆明市", + value: "昆明市", + open: true + }, + { + pId: "0_0", + id: "0_0_23", + text: "浙江省( 共5个 )", + value: "浙江省", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_0", + text: "杭州市", + value: "杭州市", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_1", + text: "湖州市", + value: "湖州市", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_2", + text: "嘉兴市", + value: "嘉兴市", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_3", + text: "宁波市", + value: "宁波市", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_4", + text: "绍兴市", + value: "绍兴市", + open: true + }, + { + pId: "0_0", + id: "0_0_24", + text: "重庆市( 共1个 )", + value: "重庆市", + open: true + }, + { + pId: "0_0_24", + id: "0_0_24_0", + text: "重庆市区", + value: "重庆市区", + open: true + }, + { + pId: "0", + id: "0_1", + text: "中国( 共34个 )", + value: "中国", + open: true + }, + { + pId: "0_1", + id: "0_1_0", + text: "安徽省( 共19个 )", + value: "安徽省", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_0", + text: "安庆市", + value: "安庆市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_1", + text: "蚌埠市", + value: "蚌埠市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_2", + text: "亳州市", + value: "亳州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_3", + text: "巢湖市", + value: "巢湖市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_4", + text: "池州市", + value: "池州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_5", + text: "滁州市", + value: "滁州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_6", + text: "阜阳市", + value: "阜阳市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_7", + text: "毫州市", + value: "毫州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_8", + text: "合肥市", + value: "合肥市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_9", + text: "淮北市", + value: "淮北市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_10", + text: "淮南市", + value: "淮南市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_11", + text: "黄山市", + value: "黄山市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_12", + text: "六安市", + value: "六安市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_13", + text: "马鞍山市", + value: "马鞍山市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_14", + text: "濮阳市", + value: "濮阳市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_15", + text: "宿州市", + value: "宿州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_16", + text: "铜陵市", + value: "铜陵市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_17", + text: "芜湖市", + value: "芜湖市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_18", + text: "宣城市", + value: "宣城市", + open: true + }, + { + pId: "0_1", + id: "0_1_1", + text: "澳门特别行政区( 共1个 )", + value: "澳门特别行政区", + open: true + }, + { + pId: "0_1_1", + id: "0_1_1_0", + text: "澳门", + value: "澳门", + open: true + }, + { + pId: "0_1", + id: "0_1_2", + text: "北京市( 共17个 )", + value: "北京市", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_0", + text: "北京市区", + value: "北京市区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_1", + text: "昌平区", + value: "昌平区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_2", + text: "朝阳区", + value: "朝阳区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_3", + text: "大兴区", + value: "大兴区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_4", + text: "东城区", + value: "东城区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_5", + text: "房山区", + value: "房山区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_6", + text: "丰台区", + value: "丰台区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_7", + text: "海淀区", + value: "海淀区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_8", + text: "海淀区4内", + value: "海淀区4内", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_9", + text: "海淀区4外", + value: "海淀区4外", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_10", + text: "门头沟区", + value: "门头沟区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_11", + text: "平谷区", + value: "平谷区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_12", + text: "石景山区", + value: "石景山区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_13", + text: "顺义区", + value: "顺义区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_14", + text: "通州区", + value: "通州区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_15", + text: "西城区", + value: "西城区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_16", + text: "西城区 ", + value: "西城区 ", + open: true + }, + { + pId: "0_1", + id: "0_1_3", + text: "福建省( 共9个 )", + value: "福建省", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_0", + text: "福州市", + value: "福州市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_1", + text: "龙岩市", + value: "龙岩市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_2", + text: "南平市", + value: "南平市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_3", + text: "宁德市", + value: "宁德市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_4", + text: "莆田市", + value: "莆田市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_5", + text: "泉州市", + value: "泉州市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_6", + text: "三明市", + value: "三明市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_7", + text: "厦门市", + value: "厦门市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_8", + text: "漳州市", + value: "漳州市", + open: true + }, + { + pId: "0_1", + id: "0_1_4", + text: "甘肃省( 共12个 )", + value: "甘肃省", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_0", + text: "白银市", + value: "白银市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_1", + text: "嘉峪关市", + value: "嘉峪关市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_2", + text: "金昌市", + value: "金昌市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_3", + text: "酒泉市", + value: "酒泉市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_4", + text: "兰州市", + value: "兰州市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_5", + text: "陇南市", + value: "陇南市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_6", + text: "平凉市", + value: "平凉市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_7", + text: "庆阳市", + value: "庆阳市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_8", + text: "天津市区", + value: "天津市区", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_9", + text: "天水市", + value: "天水市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_10", + text: "武威市", + value: "武威市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_11", + text: "张掖市", + value: "张掖市", + open: true + }, + { + pId: "0_1", + id: "0_1_5", + text: "广东省( 共21个 )", + value: "广东省", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_0", + text: "潮州市", + value: "潮州市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_1", + text: "东莞市", + value: "东莞市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_2", + text: "佛山市", + value: "佛山市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_3", + text: "广州市", + value: "广州市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_4", + text: "河源市", + value: "河源市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_5", + text: "惠州市", + value: "惠州市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_6", + text: "江门市", + value: "江门市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_7", + text: "揭阳市", + value: "揭阳市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_8", + text: "茂名市", + value: "茂名市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_9", + text: "梅州市", + value: "梅州市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_10", + text: "清远市", + value: "清远市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_11", + text: "汕头市", + value: "汕头市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_12", + text: "汕尾市", + value: "汕尾市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_13", + text: "韶关市", + value: "韶关市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_14", + text: "深圳市", + value: "深圳市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_15", + text: "阳江市", + value: "阳江市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_16", + text: "云浮市", + value: "云浮市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_17", + text: "湛江市", + value: "湛江市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_18", + text: "肇庆市", + value: "肇庆市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_19", + text: "中山市", + value: "中山市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_20", + text: "珠海市", + value: "珠海市", + open: true + }, + { + pId: "0_1", + id: "0_1_6", + text: "广西壮族自治区( 共14个 )", + value: "广西壮族自治区", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_0", + text: "百色市", + value: "百色市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_1", + text: "北海市", + value: "北海市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_2", + text: "崇左市", + value: "崇左市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_3", + text: "防城港市", + value: "防城港市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_4", + text: "桂林市", + value: "桂林市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_5", + text: "贵港市", + value: "贵港市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_6", + text: "河池市", + value: "河池市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_7", + text: "贺州市", + value: "贺州市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_8", + text: "来宾市", + value: "来宾市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_9", + text: "柳州市", + value: "柳州市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_10", + text: "南宁市", + value: "南宁市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_11", + text: "钦州市", + value: "钦州市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_12", + text: "梧州市", + value: "梧州市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_13", + text: "玉林市", + value: "玉林市", + open: true + }, + { + pId: "0_1", + id: "0_1_7", + text: "贵州省( 共9个 )", + value: "贵州省", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_0", + text: "安顺市", + value: "安顺市", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_1", + text: "毕节地区", + value: "毕节地区", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_2", + text: "贵阳市", + value: "贵阳市", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_3", + text: "六盘水市", + value: "六盘水市", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_4", + text: "黔东南州", + value: "黔东南州", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_5", + text: "黔南州", + value: "黔南州", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_6", + text: "黔西南市", + value: "黔西南市", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_7", + text: "铜仁地区", + value: "铜仁地区", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_8", + text: "遵义市", + value: "遵义市", + open: true + }, + { + pId: "0_1", + id: "0_1_8", + text: "海南省( 共2个 )", + value: "海南省", + open: true + }, + { + pId: "0_1_8", + id: "0_1_8_0", + text: "海口市", + value: "海口市", + open: true + }, + { + pId: "0_1_8", + id: "0_1_8_1", + text: "三亚市", + value: "三亚市", + open: true + }, + { + pId: "0_1", + id: "0_1_9", + text: "河北省( 共12个 )", + value: "河北省", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_0", + text: "保定市", + value: "保定市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_1", + text: "沧州市", + value: "沧州市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_2", + text: "承德市", + value: "承德市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_3", + text: "邯郸市", + value: "邯郸市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_4", + text: "衡水市", + value: "衡水市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_5", + text: "廊坊市", + value: "廊坊市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_6", + text: "秦皇岛市", + value: "秦皇岛市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_7", + text: "石家庄市", + value: "石家庄市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_8", + text: "唐山市", + value: "唐山市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_9", + text: "天津市区", + value: "天津市区", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_10", + text: "邢台市", + value: "邢台市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_11", + text: "张家口市", + value: "张家口市", + open: true + }, + { + pId: "0_1", + id: "0_1_10", + text: "河南省( 共19个 )", + value: "河南省", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_0", + text: "安阳市", + value: "安阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_1", + text: "鹤壁市", + value: "鹤壁市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_2", + text: "济源市", + value: "济源市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_3", + text: "焦作市", + value: "焦作市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_4", + text: "开封市", + value: "开封市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_5", + text: "廊坊市", + value: "廊坊市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_6", + text: "洛阳市", + value: "洛阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_7", + text: "漯河市", + value: "漯河市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_8", + text: "南阳市", + value: "南阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_9", + text: "平顶山市", + value: "平顶山市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_10", + text: "濮阳市", + value: "濮阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_11", + text: "三门峡市", + value: "三门峡市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_12", + text: "商丘市", + value: "商丘市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_13", + text: "新乡市", + value: "新乡市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_14", + text: "信阳市", + value: "信阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_15", + text: "许昌市", + value: "许昌市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_16", + text: "郑州市", + value: "郑州市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_17", + text: "周口市", + value: "周口市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_18", + text: "驻马店市", + value: "驻马店市", + open: true + }, + { + pId: "0_1", + id: "0_1_11", + text: "黑龙江省( 共13个 )", + value: "黑龙江省", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_0", + text: "大庆市", + value: "大庆市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_1", + text: "大兴安岭地区", + value: "大兴安岭地区", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_2", + text: "大兴安岭市", + value: "大兴安岭市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_3", + text: "哈尔滨市", + value: "哈尔滨市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_4", + text: "鹤港市", + value: "鹤港市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_5", + text: "黑河市", + value: "黑河市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_6", + text: "佳木斯市", + value: "佳木斯市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_7", + text: "牡丹江市", + value: "牡丹江市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_8", + text: "七台河市", + value: "七台河市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_9", + text: "齐齐哈尔市", + value: "齐齐哈尔市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_10", + text: "双鸭山市", + value: "双鸭山市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_11", + text: "绥化市", + value: "绥化市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_12", + text: "伊春市", + value: "伊春市", + open: true + }, + { + pId: "0_1", + id: "0_1_12", + text: "湖北省( 共16个 )", + value: "湖北省", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_0", + text: "鄂州市", + value: "鄂州市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_1", + text: "恩施土家族苗族自治州", + value: "恩施土家族苗族自治州", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_2", + text: "黄冈市", + value: "黄冈市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_3", + text: "黄石市", + value: "黄石市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_4", + text: "荆门市", + value: "荆门市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_5", + text: "荆州市", + value: "荆州市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_6", + text: "神农架市", + value: "神农架市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_7", + text: "十堰市", + value: "十堰市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_8", + text: "随州市", + value: "随州市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_9", + text: "天门市", + value: "天门市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_10", + text: "武汉市", + value: "武汉市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_11", + text: "咸宁市", + value: "咸宁市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_12", + text: "襄樊市", + value: "襄樊市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_13", + text: "襄阳市", + value: "襄阳市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_14", + text: "孝感市", + value: "孝感市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_15", + text: "宜昌市", + value: "宜昌市", + open: true + }, + { + pId: "0_1", + id: "0_1_13", + text: "湖南省( 共15个 )", + value: "湖南省", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_0", + text: "常德市", + value: "常德市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_1", + text: "长沙市", + value: "长沙市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_2", + text: "郴州市", + value: "郴州市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_3", + text: "衡阳市", + value: "衡阳市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_4", + text: "怀化市", + value: "怀化市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_5", + text: "娄底市", + value: "娄底市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_6", + text: "邵阳市", + value: "邵阳市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_7", + text: "湘潭市", + value: "湘潭市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_8", + text: "湘西市", + value: "湘西市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_9", + text: "湘西土家族苗族自治州", + value: "湘西土家族苗族自治州", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_10", + text: "益阳市", + value: "益阳市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_11", + text: "永州市", + value: "永州市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_12", + text: "岳阳市", + value: "岳阳市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_13", + text: "张家界市", + value: "张家界市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_14", + text: "株洲市", + value: "株洲市", + open: true + }, + { + pId: "0_1", + id: "0_1_14", + text: "吉林省( 共10个 )", + value: "吉林省", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_0", + text: "白城市", + value: "白城市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_1", + text: "白山市", + value: "白山市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_2", + text: "长春市", + value: "长春市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_3", + text: "大庆市", + value: "大庆市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_4", + text: "吉林市", + value: "吉林市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_5", + text: "辽源市", + value: "辽源市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_6", + text: "四平市", + value: "四平市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_7", + text: "松原市", + value: "松原市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_8", + text: "通化市", + value: "通化市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_9", + text: "延边朝鲜族自治州", + value: "延边朝鲜族自治州", + open: true + }, + { + pId: "0_1", + id: "0_1_15", + text: "江苏省( 共13个 )", + value: "江苏省", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_0", + text: "常州市", + value: "常州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_1", + text: "淮安市", + value: "淮安市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_2", + text: "连云港市", + value: "连云港市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_3", + text: "南京市", + value: "南京市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_4", + text: "南通市", + value: "南通市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_5", + text: "苏州市", + value: "苏州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_6", + text: "宿迁市", + value: "宿迁市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_7", + text: "泰州市", + value: "泰州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_8", + text: "无锡市", + value: "无锡市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_9", + text: "徐州市", + value: "徐州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_10", + text: "盐城市", + value: "盐城市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_11", + text: "扬州市", + value: "扬州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_12", + text: "镇江市", + value: "镇江市", + open: true + }, + { + pId: "0_1", + id: "0_1_16", + text: "江西省( 共10个 )", + value: "江西省", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_0", + text: "抚州市", + value: "抚州市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_1", + text: "赣州市", + value: "赣州市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_2", + text: "景德镇市", + value: "景德镇市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_3", + text: "九江市", + value: "九江市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_4", + text: "南昌市", + value: "南昌市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_5", + text: "萍乡市", + value: "萍乡市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_6", + text: "上饶市", + value: "上饶市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_7", + text: "新余市", + value: "新余市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_8", + text: "宜春市", + value: "宜春市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_9", + text: "鹰潭市", + value: "鹰潭市", + open: true + }, + { + pId: "0_1", + id: "0_1_17", + text: "辽宁省( 共14个 )", + value: "辽宁省", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_0", + text: "鞍山市", + value: "鞍山市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_1", + text: "本溪市", + value: "本溪市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_2", + text: "朝阳市", + value: "朝阳市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_3", + text: "大连市", + value: "大连市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_4", + text: "丹东市", + value: "丹东市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_5", + text: "抚顺市", + value: "抚顺市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_6", + text: "阜新市", + value: "阜新市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_7", + text: "葫芦岛市", + value: "葫芦岛市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_8", + text: "锦州市", + value: "锦州市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_9", + text: "辽阳市", + value: "辽阳市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_10", + text: "盘锦市", + value: "盘锦市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_11", + text: "沈阳市", + value: "沈阳市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_12", + text: "铁岭市", + value: "铁岭市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_13", + text: "营口市", + value: "营口市", + open: true + }, + { + pId: "0_1", + id: "0_1_18", + text: "内蒙古( 共10个 )", + value: "内蒙古", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_0", + text: "包头市", + value: "包头市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_1", + text: "赤峰市", + value: "赤峰市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_2", + text: "鄂尔多斯市", + value: "鄂尔多斯市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_3", + text: "呼和浩特市", + value: "呼和浩特市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_4", + text: "呼伦贝尔市", + value: "呼伦贝尔市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_5", + text: "通辽市", + value: "通辽市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_6", + text: "乌海市", + value: "乌海市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_7", + text: "锡林郭勒市", + value: "锡林郭勒市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_8", + text: "兴安市", + value: "兴安市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_9", + text: "运城市", + value: "运城市", + open: true + }, + { + pId: "0_1", + id: "0_1_19", + text: "宁夏回族自治区( 共5个 )", + value: "宁夏回族自治区", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_0", + text: "固原市", + value: "固原市", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_1", + text: "石嘴山市", + value: "石嘴山市", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_2", + text: "吴忠市", + value: "吴忠市", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_3", + text: "银川市", + value: "银川市", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_4", + text: "中卫市", + value: "中卫市", + open: true + }, + { + pId: "0_1", + id: "0_1_20", + text: "青海省( 共4个 )", + value: "青海省", + open: true + }, + { + pId: "0_1_20", + id: "0_1_20_0", + text: "海东地区", + value: "海东地区", + open: true + }, + { + pId: "0_1_20", + id: "0_1_20_1", + text: "海南藏族自治州", + value: "海南藏族自治州", + open: true + }, + { + pId: "0_1_20", + id: "0_1_20_2", + text: "海西蒙古族藏族自治州", + value: "海西蒙古族藏族自治州", + open: true + }, + { + pId: "0_1_20", + id: "0_1_20_3", + text: "西宁市", + value: "西宁市", + open: true + }, + { + pId: "0_1", + id: "0_1_21", + text: "山东省( 共17个 )", + value: "山东省", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_0", + text: "滨州市", + value: "滨州市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_1", + text: "德州市", + value: "德州市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_2", + text: "东营市", + value: "东营市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_3", + text: "菏泽市", + value: "菏泽市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_4", + text: "济南市", + value: "济南市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_5", + text: "济宁市", + value: "济宁市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_6", + text: "莱芜市", + value: "莱芜市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_7", + text: "聊城市", + value: "聊城市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_8", + text: "临沂市", + value: "临沂市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_9", + text: "青岛市", + value: "青岛市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_10", + text: "日照市", + value: "日照市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_11", + text: "泰安市", + value: "泰安市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_12", + text: "威海市", + value: "威海市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_13", + text: "潍坊市", + value: "潍坊市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_14", + text: "烟台市", + value: "烟台市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_15", + text: "枣庄市", + value: "枣庄市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_16", + text: "淄博市", + value: "淄博市", + open: true + }, + { + pId: "0_1", + id: "0_1_22", + text: "山西省( 共12个 )", + value: "山西省", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_0", + text: "长治市", + value: "长治市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_1", + text: "大同市", + value: "大同市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_2", + text: "晋城市", + value: "晋城市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_3", + text: "晋中市", + value: "晋中市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_4", + text: "临汾市", + value: "临汾市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_5", + text: "吕梁市", + value: "吕梁市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_6", + text: "青岛市", + value: "青岛市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_7", + text: "朔州市", + value: "朔州市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_8", + text: "太原市", + value: "太原市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_9", + text: "忻州市", + value: "忻州市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_10", + text: "阳泉市", + value: "阳泉市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_11", + text: "运城市", + value: "运城市", + open: true + }, + { + pId: "0_1", + id: "0_1_23", + text: "陕西省( 共9个 )", + value: "陕西省", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_0", + text: "安康市", + value: "安康市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_1", + text: "宝鸡市", + value: "宝鸡市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_2", + text: "汉中市", + value: "汉中市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_3", + text: "商洛市", + value: "商洛市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_4", + text: "渭南市", + value: "渭南市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_5", + text: "西安市", + value: "西安市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_6", + text: "咸阳市", + value: "咸阳市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_7", + text: "延安市", + value: "延安市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_8", + text: "榆林市", + value: "榆林市", + open: true + }, + { + pId: "0_1", + id: "0_1_24", + text: "上海市( 共19个 )", + value: "上海市", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_0", + text: "宝山区", + value: "宝山区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_1", + text: "长宁区", + value: "长宁区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_2", + text: "崇明县", + value: "崇明县", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_3", + text: "奉贤区", + value: "奉贤区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_4", + text: "虹口区", + value: "虹口区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_5", + text: "黄浦区", + value: "黄浦区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_6", + text: "嘉定区", + value: "嘉定区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_7", + text: "金山区", + value: "金山区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_8", + text: "静安区", + value: "静安区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_9", + text: "昆明市", + value: "昆明市", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_10", + text: "闵行区", + value: "闵行区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_11", + text: "普陀区", + value: "普陀区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_12", + text: "浦东新区", + value: "浦东新区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_13", + text: "青浦区", + value: "青浦区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_14", + text: "上海市区", + value: "上海市区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_15", + text: "松江区", + value: "松江区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_16", + text: "徐汇区", + value: "徐汇区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_17", + text: "杨浦区", + value: "杨浦区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_18", + text: "闸北区", + value: "闸北区", + open: true + }, + { + pId: "0_1", + id: "0_1_25", + text: "四川省( 共21个 )", + value: "四川省", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_0", + text: "阿坝藏族羌族自治州", + value: "阿坝藏族羌族自治州", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_1", + text: "巴中市", + value: "巴中市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_2", + text: "成都市", + value: "成都市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_3", + text: "达州市", + value: "达州市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_4", + text: "德阳市", + value: "德阳市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_5", + text: "甘孜市", + value: "甘孜市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_6", + text: "广安市", + value: "广安市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_7", + text: "广元市", + value: "广元市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_8", + text: "乐山市", + value: "乐山市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_9", + text: "凉山市", + value: "凉山市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_10", + text: "泸州市", + value: "泸州市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_11", + text: "眉山市", + value: "眉山市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_12", + text: "绵阳市", + value: "绵阳市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_13", + text: "南充市", + value: "南充市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_14", + text: "内江市", + value: "内江市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_15", + text: "攀枝花市", + value: "攀枝花市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_16", + text: "遂宁市", + value: "遂宁市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_17", + text: "雅安市", + value: "雅安市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_18", + text: "宜宾市", + value: "宜宾市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_19", + text: "资阳市", + value: "资阳市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_20", + text: "自贡市", + value: "自贡市", + open: true + }, + { + pId: "0_1", + id: "0_1_26", + text: "台湾( 共1个 )", + value: "台湾", + open: true + }, + { + pId: "0_1_26", + id: "0_1_26_0", + text: "台北市", + value: "台北市", + open: true + }, + { + pId: "0_1", + id: "0_1_27", + text: "天津市( 共1个 )", + value: "天津市", + open: true + }, + { + pId: "0_1_27", + id: "0_1_27_0", + text: "天津市区", + value: "天津市区", + open: true + }, + { + pId: "0_1", + id: "0_1_28", + text: "西藏自治区( 共2个 )", + value: "西藏自治区", + open: true + }, + { + pId: "0_1_28", + id: "0_1_28_0", + text: "阿里市", + value: "阿里市", + open: true + }, + { + pId: "0_1_28", + id: "0_1_28_1", + text: "日喀则市", + value: "日喀则市", + open: true + }, + { + pId: "0_1", + id: "0_1_29", + text: "香港特别行政区( 共1个 )", + value: "香港特别行政区", + open: true + }, + { + pId: "0_1_29", + id: "0_1_29_0", + text: "香港", + value: "香港", + open: true + }, + { + pId: "0_1", + id: "0_1_30", + text: "新疆维吾尔族自治区( 共11个 )", + value: "新疆维吾尔族自治区", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_0", + text: "巴音郭楞市", + value: "巴音郭楞市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_1", + text: "哈密市", + value: "哈密市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_2", + text: "和田市", + value: "和田市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_3", + text: "喀什地区", + value: "喀什地区", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_4", + text: "克拉玛依市", + value: "克拉玛依市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_5", + text: "克孜勒苏柯州", + value: "克孜勒苏柯州", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_6", + text: "石河子市", + value: "石河子市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_7", + text: "塔城市", + value: "塔城市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_8", + text: "吐鲁番地区", + value: "吐鲁番地区", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_9", + text: "乌鲁木齐", + value: "乌鲁木齐", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_10", + text: "伊犁市", + value: "伊犁市", + open: true + }, + { + pId: "0_1", + id: "0_1_31", + text: "云南省( 共12个 )", + value: "云南省", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_0", + text: "保山市", + value: "保山市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_1", + text: "楚雄彝族自治州", + value: "楚雄彝族自治州", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_2", + text: "大理白族自治州", + value: "大理白族自治州", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_3", + text: "红河哈尼族彝族自治州", + value: "红河哈尼族彝族自治州", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_4", + text: "昆明市", + value: "昆明市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_5", + text: "丽江市", + value: "丽江市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_6", + text: "临沧市", + value: "临沧市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_7", + text: "曲靖市", + value: "曲靖市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_8", + text: "思茅市", + value: "思茅市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_9", + text: "文山市", + value: "文山市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_10", + text: "玉溪市", + value: "玉溪市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_11", + text: "昭通市", + value: "昭通市", + open: true + }, + { + pId: "0_1", + id: "0_1_32", + text: "浙江省( 共12个 )", + value: "浙江省", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_0", + text: "杭州市", + value: "杭州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_1", + text: "湖州市", + value: "湖州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_2", + text: "嘉兴市", + value: "嘉兴市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_3", + text: "金华市", + value: "金华市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_4", + text: "丽水市", + value: "丽水市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_5", + text: "宁波市", + value: "宁波市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_6", + text: "衢州市", + value: "衢州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_7", + text: "绍兴市", + value: "绍兴市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_8", + text: "台州市", + value: "台州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_9", + text: "温州市", + value: "温州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_10", + text: "浙江省", + value: "浙江省", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_11", + text: "舟山市", + value: "舟山市", + open: true + }, + { + pId: "0_1", + id: "0_1_33", + text: "重庆市( 共1个 )", + value: "重庆市", + open: true + }, + { + pId: "0_1_33", + id: "0_1_33_0", + text: "重庆市区", + value: "重庆市区", + open: true + } + ], + + TREE: [ + { id: -1, pId: -2, value: "根目录", text: "根目录" }, + { id: 1, pId: -1, value: "1", text: "第一级目录1", disabled: true }, + { id: 11, pId: 1, value: "11", text: "第二级文件1" }, + { id: 12, pId: 1, value: "12", text: "第二级目录2" }, + { id: 121, pId: 12, value: "121", text: "第三级目录1" }, + { id: 122, pId: 12, value: "122", text: "第三级文件1" }, + { id: 1211, pId: 121, value: "1211", text: "第四级目录1" }, + { + id: 12111, + pId: 1211, + value: "12111", + text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + }, + { id: 2, pId: -1, value: "2", text: "第一级目录2" }, + { id: 21, pId: 2, value: "21", text: "第二级目录3" }, + { id: 22, pId: 2, value: "22", text: "第二级文件2" }, + { id: 211, pId: 21, value: "211", text: "第三级目录2" }, + { id: 212, pId: 21, value: "212", text: "第三级文件2" }, + { id: 2111, pId: 211, value: "2111", text: "第四级文件1" } + ], + LEVELTREE: [ + { + id: 1, + text: "第一项", + value: "1" + }, + { + id: 2, + text: "第二项", + value: "2" + }, + { + id: 3, + text: "第三项", + value: "3", + open: true + }, + { + id: 11, + pId: 1, + text: "子项1", + value: "11" + }, + { + id: 12, + pId: 1, + text: "子项2", + value: "12" + }, + { + id: 13, + pId: 1, + text: "子项3", + value: "13" + }, + { + id: 31, + pId: 3, + text: "子项1", + value: "31" + }, + { + id: 32, + pId: 3, + text: "子项2", + value: "32" + }, + { + id: 33, + pId: 3, + text: "子项3", + value: "33" + } + ] +}; diff --git a/packages/demo/src/config/core.js b/packages/demo/src/config/core.js new file mode 100644 index 000000000..e66c74a8f --- /dev/null +++ b/packages/demo/src/config/core.js @@ -0,0 +1,128 @@ +import { layout, abstract } from "../core"; +import { transModule2Route } from "./utils"; + + + +export const coreConfig = [ + { + id: 1, + text: "核心控件" + }, + { + id: 101, + pId: 1, + text: "布局" + }, + ...transModule2Route(layout, 101), + { + pId: 1, + id: 102, + text: "抽象控件" + }, + ...transModule2Route(abstract, 102), + { + pId: 102, + id: 10201, + text: "组合控件" + }, + // { + // pId: 10201, + // text: "bi.combo", + // value: "demo.combo" + // }, + // { + // pId: 10201, + // text: "bi.combo(各种位置)", + // value: "demo.combo2" + // }, + // { + // pId: 10201, + // text: "bi.combo(內部位置)", + // value: "demo.combo3" + // }, + // { + // pId: 10201, + // text: "bi.expander", + // value: "demo.expander" + // }, + // { + // pId: 10201, + // text: "bi.combo_group", + // value: "demo.combo_group" + // }, + // { + // pId: 10201, + // text: "bi.loader", + // value: "demo.loader" + // }, + // { + // pId: 10201, + // text: "bi.navigation", + // value: "demo.navigation" + // }, + // { + // pId: 10201, + // text: "bi.searcher", + // value: "demo.searcher" + // }, + // { + // pId: 10201, + // text: "bi.switcher", + // value: "demo.switcher" + // }, + // { + // pId: 10201, + // text: "bi.tab", + // value: "demo.tab" + // }, + { + pId: 102, + id: 10202, + text: "弹出层" + }, + // { + // pId: 10202, + // text: "layer", + // value: "demo.layer" + // }, + // { + // pId: 10202, + // text: "bi.popover", + // value: "demo.popover" + // }, + // { + // pId: 10202, + // text: "bi.popup_view", + // value: "demo.popup_view" + // }, + // { + // pId: 10202, + // text: "bi.searcher_view", + // value: "demo.searcher_view" + // }, + // { + // pId: 1, + // text: "Widget(继承)", + // value: "demo.widget" + // }, + // { + // pId: 1, + // text: "Single(继承)", + // value: "demo.single" + // }, + // { + // pId: 1, + // text: "BasicButton(继承)", + // value: "demo.basic_button" + // }, + // { + // pId: 1, + // text: "NodeButton(继承)", + // value: "demo.node_button" + // }, + // { + // pId: 1, + // text: "Pane(继承)", + // value: "demo.pane" + // } +]; diff --git a/packages/demo/src/config/index.js b/packages/demo/src/config/index.js new file mode 100644 index 000000000..100ba07f8 --- /dev/null +++ b/packages/demo/src/config/index.js @@ -0,0 +1,3646 @@ +// import { coreConfig } from "./core"; +// import { baseConfig } from "./base"; +import { map, UUID } from "@fui/core"; +import * as DemoModule from "../demo"; + +const routes = []; +function tranvase(m, parent, text) { + if (m.__esModule) { + const keys = Object.keys(m); + const id = UUID(); + const obj = { + id, + text, + value: id + }; + if (parent) { + obj.pId = parent.id; + routes.push(obj); + } + obj.text = m.meta?.title || text; + keys.sort((keyA, keyB) => { + const rankA = m[keyA].meta?.rank || 0; + const rankB = m[keyB].meta?.rank || 0; + return rankB - rankA; + }); + keys.forEach((key) => { + tranvase(m[key], obj, key); + }); + } else if (m.xtype) { + const obj = { id: m.xtype, value: m.xtype, text: m.xtype }; + if (parent) { + obj.pId = parent.id; + } + routes.push(obj); + } +} +tranvase(DemoModule); + +// console.log(routes); + +export const demoConfig = routes; + +// Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG) +// .concat(Demo.CASE_CONFIG) +// .concat(Demo.WIDGET_CONFIG) +// .concat(Demo.COMPONENT_CONFIG) +// .concat(Demo.FIX_CONFIG); + +const CONSTANTS = { + SIMPLE_ITEMS: map( + "柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂".match( + /[^\s]+/g + ), + function (i, v) { + return { + text: v, + value: v, + title: v + }; + } + ), + ITEMS: map( + "柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂 柳州市积玉贸易有限公司 柳州市福运来贸易有限责任公司 柳州市钢义物资有限公司 柳州市洋力化工有限公司 柳州市悦盛贸易有限公司 柳州市雁城钢管物资有限公司 柳州市恒瑞钢材经营部 柳州市科拓电子有限公司 柳州市九方电子有限公司 柳州市桂龙汽车配件厂 柳州市制鞋工厂 柳州市炜力科贸有限公司 柳州市希翼贸易有限公司 柳州市兆金物资有限公司 柳州市和润电子科技有限责任公司 柳州市汇凯贸易有限公司 柳州市好机汇商贸有限公司 柳州市泛源商贸经营部 柳州市利汇达物资有限公司 广西全民药业有限责任公司 柳州超凡物资贸易有限责任公司 柳州市贵宏物资有限责任公司 柳州昊恒贸易有限责任公司 柳州市浦联物资有限公司 柳州市广通园林绿化工程有限责任公司 柳州市松发物资贸易有限责任公司 柳州市奥士达办公设备有限责任公司 柳州市海泰物资有限公司 柳州市金三环针织厂 柳州市钢贸物资有限公司 柳州市明阳纺织有限公司 柳州市世科科技发展有限公司 柳州市禄羊贸易有限公司 柳州市金兆阳商贸有限公司 柳州市汇昌物资经营部 柳州市林泰金属物资供应站 柳州市自来水管道材料设备公司 柳州市丹柳铝板有限公司 柳州市桂冶物资有限公司 柳州市宸业物资经营部 柳州市耀成贸易有限公司 柳州奥易自动化科技有限公司 柳州市萃丰科技有限责任公司 柳州市华储贸易有限责任公司 柳州市黄颜钢材有限责任公司 柳州市银盛物资有限责任公司 柳州市新仪化玻供应站 柳州市晶凯化工有限公司 广西柳州市柳江包装纸厂 柳州市志新物资有限责任公司 柳州市兆钢物资有限公司 柳州市友方科技发展有限责任公司 柳州市缝纫机台板家具总厂 柳州市晖海数码办公设备有限责任公司 柳州市富兰特服饰有限责任公司 柳州市柳北区富兴物资经营部 柳州市柳锌福利厂 柳州市海泉印刷有限责任公司 柳州市乾亨贸易有限公司 柳州市悦宁物资贸易有限公司 柳州市昊天贸易有限公司 广西惠字钢铁有限公司 柳州市名青物资有限公司 柳州市林郝物资有限公司 柳州市民政服装厂 柳州市多维劳保用品厂 柳州市轻工物资供应公司 柳州市程源物资有限责任公司 柳州市寿丰物资贸易有限责任公司 柳州市凯凡物资有限公司 柳州市利晖物资经营部 柳州市恒茂金属物资供应站 柳州市中储物资经营部 柳州市第二医疗器械厂 柳州市来鑫物资经营部 柳州市钢鑫物资贸易有限责任公司 柳州市双合袜业有限责任公司 柳州市茂松经贸有限责任公司 柳州市行行物资贸易有限公司 柳州市方一物资有限公司 柳州成异钢管销售有限公司 柳州广惠佳电脑有限公司 桂林市圣泽鑫物资有限公司柳州分公司 柳州市砼基建材贸易有限公司 柳州市海燕针织厂 上海浦光仪表厂柳州销售处 柳州市能电工贸有限责任公司 柳州市广贸物资有限公司 柳州市柳北区大昌电工灯饰经营部 柳州市金龙印务有限公司 柳州市奇缘婚典服务有限公司 柳州市盛博物资经营部 柳州市项元钢铁贸易有限公司 柳州市虞美人化妆品经营部 柳州市俊彦鞋厂 柳州市聚源特钢有限公司 柳州市迅龙科贸有限责任公司 柳州市恒飞电子有限责任公司 柳州市蓝正现代办公设备有限责任公司 柳州地区农业生产资料公司 柳州华菱钢管销售有限公司 柳州融通物资有限公司 柳州市可仁广告策划有限责任公司 柳州市鸟鑫物资有限责任公司 柳州市五丰钢材供应站 柳州市金江不锈钢有限公司 柳州市美日物资设备有限责任公司 柳州市鑫东物资贸易有限责任公司 柳州地区日用杂品公司 柳州市华纳物资贸易有限公司 柳州乾利金虹物资贸易有限责任公司 柳州市新迈计算机有限公司 柳州市富丽实业发展公司 柳州市石钢金属材料有限公司 柳州市力志传真机销售有限公司 广西宝森投资有限公司 柳州市嵘基商贸有限公司 柳州市景民商贸有限责任公司 柳州市银桥化玻有限责任公司 柳州市宏文糖烟店 柳州市科苑电脑网络有限公司 柳州市两面针旅游用品厂 柳州市立早室内装璜有限责任公司 柳州地化建材有限公司 柳州市涛达贸易有限公司 柳州市兰丰档案服务中心 柳州市惠贸物资有限责任公司 柳州市立文物资有限责任公司 柳州市致和商贸经营部 柳州市金色阳光信息咨询有限公司 柳州市赛利钢材经销部 柳州市日用化工厂 柳州市昆廷物资有限责任公司 柳州市邦盛贸易有限公司 柳州市济华贸易有限公司 柳州昕威橡塑化工经营部 柳州市联业贸易有限公司 柳州市兰钢贸易有限公司 柳州市子欣科技有限公司 柳州市狄龙机电设备有限公司 柳州市方真物资贸易有限公司 柳州市银鸥废旧回收中心 柳州市冠宝贸易有限公司 柳州市鑫盛德商务咨询有限责任公司 柳州市泰汇银通经贸有限公司 广西瀚维智测科技有限公司 柳州市钓鱼郎制衣有限责任公司 柳州溪水物资有限公司 柳州市融峰物资有限责任公司 广西新地科技有限责任公司 柳州市纺织装饰公司 柳州市粤翔冶金炉料有限公司 柳州市远腾贸易有限公司 柳州市东鸿城市改造有限公司 广西丛欣实业有限公司 柳州市服装厂 柳州市立安联合刀片有限公司 广西国扬投资有限责任公司 柳州市铭泰办公设备公司 柳州市桂钢物资供应站 柳州市昱升物资有限责任公司 柳州市鹰飞灿科贸有限公司 柳州市先导科贸有限公司 柳州市金秋建材物资经营部 柳州市童装厂 柳州市民泽物资有限公司 柳州市恒先物资贸易有限公司 柳州市银夏冷气工程有限责任公司 柳州粮食批发有限责任公司 柳州市金银华窗纱制造有限责任公司 柳州市三方贸易有限公司 柳州市丰涛商贸有限责任公司 柳州华智企业管理咨询有限责任公司 柳州市诚正建筑工程施工图审查有限公司 柳州市今科电讯设备营销中心 柳州市闽德电子有限公司 柳州市鑫虹针织厂 柳州市畅通通讯器材有限责任公司 柳州市正钢物资经营部 柳州市新柳饲料有限责任公司 柳州市黄村油库 柳州市天泰电力装饰工程有限公司 柳州市兆吉物资有限责任公司 柳州市八龙纸制品有限责任公司 柳州市巨佳电脑网络科技有限公司 ".match( + /[^\s]+/g + ), + function (i, v) { + return { + text: v, + value: v, + title: v + }; + } + ), + TREEITEMS: [ + { pId: "0", id: "0_0", text: "( 共25个 )", value: "", open: true }, + { + pId: "0_0", + id: "0_0_0", + text: "安徽省( 共1个 )", + value: "安徽省", + open: true + }, + { + pId: "0_0_0", + id: "0_0_0_0", + text: "芜湖市", + value: "芜湖市", + open: true + }, + { + pId: "0_0", + id: "0_0_1", + text: "北京市( 共6个 )", + value: "北京市", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_0", + text: "北京市区", + value: "北京市区", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_1", + text: "朝阳区", + value: "朝阳区", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_2", + text: "东城区", + value: "东城区", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_3", + text: "海淀区4内", + value: "海淀区4内", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_4", + text: "海淀区4外", + value: "海淀区4外", + open: true + }, + { + pId: "0_0_1", + id: "0_0_1_5", + text: "石景山区", + value: "石景山区", + open: true + }, + { + pId: "0_0", + id: "0_0_2", + text: "福建省( 共2个 )", + value: "福建省", + open: true + }, + { + pId: "0_0_2", + id: "0_0_2_0", + text: "莆田市", + value: "莆田市", + open: true + }, + { + pId: "0_0_2", + id: "0_0_2_1", + text: "泉州市", + value: "泉州市", + open: true + }, + { + pId: "0_0", + id: "0_0_3", + text: "甘肃省( 共1个 )", + value: "甘肃省", + open: true + }, + { + pId: "0_0_3", + id: "0_0_3_0", + text: "兰州市", + value: "兰州市", + open: true + }, + { + pId: "0_0", + id: "0_0_4", + text: "广东省( 共5个 )", + value: "广东省", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_0", + text: "东莞市", + value: "东莞市", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_1", + text: "广州市", + value: "广州市", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_2", + text: "惠州市", + value: "惠州市", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_3", + text: "深圳市", + value: "深圳市", + open: true + }, + { + pId: "0_0_4", + id: "0_0_4_4", + text: "珠海市", + value: "珠海市", + open: true + }, + { + pId: "0_0", + id: "0_0_5", + text: "广西壮族自治区( 共1个 )", + value: "广西壮族自治区", + open: true + }, + { + pId: "0_0_5", + id: "0_0_5_0", + text: "南宁市", + value: "南宁市", + open: true + }, + { + pId: "0_0", + id: "0_0_6", + text: "河北省( 共2个 )", + value: "河北省", + open: true + }, + { + pId: "0_0_6", + id: "0_0_6_0", + text: "保定市", + value: "保定市", + open: true + }, + { + pId: "0_0_6", + id: "0_0_6_1", + text: "邢台市", + value: "邢台市", + open: true + }, + { + pId: "0_0", + id: "0_0_7", + text: "河南省( 共1个 )", + value: "河南省", + open: true + }, + { + pId: "0_0_7", + id: "0_0_7_0", + text: "郑州市", + value: "郑州市", + open: true + }, + { + pId: "0_0", + id: "0_0_8", + text: "黑龙江省( 共7个 )", + value: "黑龙江省", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_0", + text: "大庆市", + value: "大庆市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_1", + text: "哈尔滨市", + value: "哈尔滨市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_2", + text: "鸡西市", + value: "鸡西市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_3", + text: "佳木斯市", + value: "佳木斯市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_4", + text: "牡丹江市", + value: "牡丹江市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_5", + text: "齐齐哈尔市", + value: "齐齐哈尔市", + open: true + }, + { + pId: "0_0_8", + id: "0_0_8_6", + text: "双鸭山市", + value: "双鸭山市", + open: true + }, + { + pId: "0_0", + id: "0_0_9", + text: "湖北省( 共1个 )", + value: "湖北省", + open: true + }, + { + pId: "0_0_9", + id: "0_0_9_0", + text: "武汉市", + value: "武汉市", + open: true + }, + { + pId: "0_0", + id: "0_0_10", + text: "湖南省( 共3个 )", + value: "湖南省", + open: true + }, + { + pId: "0_0_10", + id: "0_0_10_0", + text: "常德市", + value: "常德市", + open: true + }, + { + pId: "0_0_10", + id: "0_0_10_1", + text: "长沙市", + value: "长沙市", + open: true + }, + { + pId: "0_0_10", + id: "0_0_10_2", + text: "邵阳市", + value: "邵阳市", + open: true + }, + { + pId: "0_0", + id: "0_0_11", + text: "吉林省( 共4个 )", + value: "吉林省", + open: true + }, + { + pId: "0_0_11", + id: "0_0_11_0", + text: "白山市", + value: "白山市", + open: true + }, + { + pId: "0_0_11", + id: "0_0_11_1", + text: "长春市", + value: "长春市", + open: true + }, + { + pId: "0_0_11", + id: "0_0_11_2", + text: "松原市", + value: "松原市", + open: true + }, + { + pId: "0_0_11", + id: "0_0_11_3", + text: "通化市", + value: "通化市", + open: true + }, + { + pId: "0_0", + id: "0_0_12", + text: "江苏省( 共8个 )", + value: "江苏省", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_0", + text: "常州市", + value: "常州市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_1", + text: "南京市", + value: "南京市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_2", + text: "南通市", + value: "南通市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_3", + text: "苏州市", + value: "苏州市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_4", + text: "宿迁市", + value: "宿迁市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_5", + text: "泰州市", + value: "泰州市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_6", + text: "无锡市", + value: "无锡市", + open: true + }, + { + pId: "0_0_12", + id: "0_0_12_7", + text: "盐城市", + value: "盐城市", + open: true + }, + { + pId: "0_0", + id: "0_0_13", + text: "辽宁省( 共11个 )", + value: "辽宁省", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_0", + text: "鞍山市", + value: "鞍山市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_1", + text: "本溪市", + value: "本溪市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_2", + text: "朝阳市", + value: "朝阳市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_3", + text: "大连市", + value: "大连市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_4", + text: "抚顺市", + value: "抚顺市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_5", + text: "葫芦岛市", + value: "葫芦岛市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_6", + text: "锦州市", + value: "锦州市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_7", + text: "辽阳市", + value: "辽阳市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_8", + text: "盘锦市", + value: "盘锦市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_9", + text: "沈阳市", + value: "沈阳市", + open: true + }, + { + pId: "0_0_13", + id: "0_0_13_10", + text: "营口市", + value: "营口市", + open: true + }, + { + pId: "0_0", + id: "0_0_14", + text: "内蒙古( 共1个 )", + value: "内蒙古", + open: true + }, + { + pId: "0_0_14", + id: "0_0_14_0", + text: "鄂尔多斯市", + value: "鄂尔多斯市", + open: true + }, + { + pId: "0_0", + id: "0_0_15", + text: "宁夏回族自治区( 共1个 )", + value: "宁夏回族自治区", + open: true + }, + { + pId: "0_0_15", + id: "0_0_15_0", + text: "银川市", + value: "银川市", + open: true + }, + { + pId: "0_0", + id: "0_0_16", + text: "山东省( 共7个 )", + value: "山东省", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_0", + text: "济南市", + value: "济南市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_1", + text: "济宁市", + value: "济宁市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_2", + text: "聊城市", + value: "聊城市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_3", + text: "临沂市", + value: "临沂市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_4", + text: "青岛市", + value: "青岛市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_5", + text: "烟台市", + value: "烟台市", + open: true + }, + { + pId: "0_0_16", + id: "0_0_16_6", + text: "枣庄市", + value: "枣庄市", + open: true + }, + { + pId: "0_0", + id: "0_0_17", + text: "山西省( 共1个 )", + value: "山西省", + open: true + }, + { + pId: "0_0_17", + id: "0_0_17_0", + text: "太原市", + value: "太原市", + open: true + }, + { + pId: "0_0", + id: "0_0_18", + text: "陕西省( 共1个 )", + value: "陕西省", + open: true + }, + { + pId: "0_0_18", + id: "0_0_18_0", + text: "西安市", + value: "西安市", + open: true + }, + { + pId: "0_0", + id: "0_0_19", + text: "上海市( 共1个 )", + value: "上海市", + open: true + }, + { + pId: "0_0_19", + id: "0_0_19_0", + text: "上海市区", + value: "上海市区", + open: true + }, + { + pId: "0_0", + id: "0_0_20", + text: "四川省( 共1个 )", + value: "四川省", + open: true + }, + { + pId: "0_0_20", + id: "0_0_20_0", + text: "成都市", + value: "成都市", + open: true + }, + { + pId: "0_0", + id: "0_0_21", + text: "新疆维吾尔族自治区( 共2个 )", + value: "新疆维吾尔族自治区", + open: true + }, + { + pId: "0_0_21", + id: "0_0_21_0", + text: "吐鲁番地区", + value: "吐鲁番地区", + open: true + }, + { + pId: "0_0_21", + id: "0_0_21_1", + text: "乌鲁木齐", + value: "乌鲁木齐", + open: true + }, + { + pId: "0_0", + id: "0_0_22", + text: "云南省( 共1个 )", + value: "云南省", + open: true + }, + { + pId: "0_0_22", + id: "0_0_22_0", + text: "昆明市", + value: "昆明市", + open: true + }, + { + pId: "0_0", + id: "0_0_23", + text: "浙江省( 共5个 )", + value: "浙江省", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_0", + text: "杭州市", + value: "杭州市", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_1", + text: "湖州市", + value: "湖州市", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_2", + text: "嘉兴市", + value: "嘉兴市", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_3", + text: "宁波市", + value: "宁波市", + open: true + }, + { + pId: "0_0_23", + id: "0_0_23_4", + text: "绍兴市", + value: "绍兴市", + open: true + }, + { + pId: "0_0", + id: "0_0_24", + text: "重庆市( 共1个 )", + value: "重庆市", + open: true + }, + { + pId: "0_0_24", + id: "0_0_24_0", + text: "重庆市区", + value: "重庆市区", + open: true + }, + { + pId: "0", + id: "0_1", + text: "中国( 共34个 )", + value: "中国", + open: true + }, + { + pId: "0_1", + id: "0_1_0", + text: "安徽省( 共19个 )", + value: "安徽省", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_0", + text: "安庆市", + value: "安庆市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_1", + text: "蚌埠市", + value: "蚌埠市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_2", + text: "亳州市", + value: "亳州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_3", + text: "巢湖市", + value: "巢湖市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_4", + text: "池州市", + value: "池州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_5", + text: "滁州市", + value: "滁州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_6", + text: "阜阳市", + value: "阜阳市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_7", + text: "毫州市", + value: "毫州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_8", + text: "合肥市", + value: "合肥市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_9", + text: "淮北市", + value: "淮北市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_10", + text: "淮南市", + value: "淮南市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_11", + text: "黄山市", + value: "黄山市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_12", + text: "六安市", + value: "六安市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_13", + text: "马鞍山市", + value: "马鞍山市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_14", + text: "濮阳市", + value: "濮阳市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_15", + text: "宿州市", + value: "宿州市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_16", + text: "铜陵市", + value: "铜陵市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_17", + text: "芜湖市", + value: "芜湖市", + open: true + }, + { + pId: "0_1_0", + id: "0_1_0_18", + text: "宣城市", + value: "宣城市", + open: true + }, + { + pId: "0_1", + id: "0_1_1", + text: "澳门特别行政区( 共1个 )", + value: "澳门特别行政区", + open: true + }, + { + pId: "0_1_1", + id: "0_1_1_0", + text: "澳门", + value: "澳门", + open: true + }, + { + pId: "0_1", + id: "0_1_2", + text: "北京市( 共17个 )", + value: "北京市", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_0", + text: "北京市区", + value: "北京市区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_1", + text: "昌平区", + value: "昌平区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_2", + text: "朝阳区", + value: "朝阳区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_3", + text: "大兴区", + value: "大兴区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_4", + text: "东城区", + value: "东城区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_5", + text: "房山区", + value: "房山区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_6", + text: "丰台区", + value: "丰台区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_7", + text: "海淀区", + value: "海淀区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_8", + text: "海淀区4内", + value: "海淀区4内", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_9", + text: "海淀区4外", + value: "海淀区4外", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_10", + text: "门头沟区", + value: "门头沟区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_11", + text: "平谷区", + value: "平谷区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_12", + text: "石景山区", + value: "石景山区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_13", + text: "顺义区", + value: "顺义区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_14", + text: "通州区", + value: "通州区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_15", + text: "西城区", + value: "西城区", + open: true + }, + { + pId: "0_1_2", + id: "0_1_2_16", + text: "西城区 ", + value: "西城区 ", + open: true + }, + { + pId: "0_1", + id: "0_1_3", + text: "福建省( 共9个 )", + value: "福建省", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_0", + text: "福州市", + value: "福州市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_1", + text: "龙岩市", + value: "龙岩市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_2", + text: "南平市", + value: "南平市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_3", + text: "宁德市", + value: "宁德市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_4", + text: "莆田市", + value: "莆田市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_5", + text: "泉州市", + value: "泉州市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_6", + text: "三明市", + value: "三明市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_7", + text: "厦门市", + value: "厦门市", + open: true + }, + { + pId: "0_1_3", + id: "0_1_3_8", + text: "漳州市", + value: "漳州市", + open: true + }, + { + pId: "0_1", + id: "0_1_4", + text: "甘肃省( 共12个 )", + value: "甘肃省", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_0", + text: "白银市", + value: "白银市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_1", + text: "嘉峪关市", + value: "嘉峪关市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_2", + text: "金昌市", + value: "金昌市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_3", + text: "酒泉市", + value: "酒泉市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_4", + text: "兰州市", + value: "兰州市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_5", + text: "陇南市", + value: "陇南市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_6", + text: "平凉市", + value: "平凉市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_7", + text: "庆阳市", + value: "庆阳市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_8", + text: "天津市区", + value: "天津市区", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_9", + text: "天水市", + value: "天水市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_10", + text: "武威市", + value: "武威市", + open: true + }, + { + pId: "0_1_4", + id: "0_1_4_11", + text: "张掖市", + value: "张掖市", + open: true + }, + { + pId: "0_1", + id: "0_1_5", + text: "广东省( 共21个 )", + value: "广东省", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_0", + text: "潮州市", + value: "潮州市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_1", + text: "东莞市", + value: "东莞市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_2", + text: "佛山市", + value: "佛山市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_3", + text: "广州市", + value: "广州市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_4", + text: "河源市", + value: "河源市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_5", + text: "惠州市", + value: "惠州市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_6", + text: "江门市", + value: "江门市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_7", + text: "揭阳市", + value: "揭阳市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_8", + text: "茂名市", + value: "茂名市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_9", + text: "梅州市", + value: "梅州市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_10", + text: "清远市", + value: "清远市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_11", + text: "汕头市", + value: "汕头市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_12", + text: "汕尾市", + value: "汕尾市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_13", + text: "韶关市", + value: "韶关市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_14", + text: "深圳市", + value: "深圳市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_15", + text: "阳江市", + value: "阳江市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_16", + text: "云浮市", + value: "云浮市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_17", + text: "湛江市", + value: "湛江市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_18", + text: "肇庆市", + value: "肇庆市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_19", + text: "中山市", + value: "中山市", + open: true + }, + { + pId: "0_1_5", + id: "0_1_5_20", + text: "珠海市", + value: "珠海市", + open: true + }, + { + pId: "0_1", + id: "0_1_6", + text: "广西壮族自治区( 共14个 )", + value: "广西壮族自治区", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_0", + text: "百色市", + value: "百色市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_1", + text: "北海市", + value: "北海市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_2", + text: "崇左市", + value: "崇左市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_3", + text: "防城港市", + value: "防城港市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_4", + text: "桂林市", + value: "桂林市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_5", + text: "贵港市", + value: "贵港市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_6", + text: "河池市", + value: "河池市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_7", + text: "贺州市", + value: "贺州市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_8", + text: "来宾市", + value: "来宾市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_9", + text: "柳州市", + value: "柳州市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_10", + text: "南宁市", + value: "南宁市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_11", + text: "钦州市", + value: "钦州市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_12", + text: "梧州市", + value: "梧州市", + open: true + }, + { + pId: "0_1_6", + id: "0_1_6_13", + text: "玉林市", + value: "玉林市", + open: true + }, + { + pId: "0_1", + id: "0_1_7", + text: "贵州省( 共9个 )", + value: "贵州省", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_0", + text: "安顺市", + value: "安顺市", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_1", + text: "毕节地区", + value: "毕节地区", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_2", + text: "贵阳市", + value: "贵阳市", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_3", + text: "六盘水市", + value: "六盘水市", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_4", + text: "黔东南州", + value: "黔东南州", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_5", + text: "黔南州", + value: "黔南州", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_6", + text: "黔西南市", + value: "黔西南市", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_7", + text: "铜仁地区", + value: "铜仁地区", + open: true + }, + { + pId: "0_1_7", + id: "0_1_7_8", + text: "遵义市", + value: "遵义市", + open: true + }, + { + pId: "0_1", + id: "0_1_8", + text: "海南省( 共2个 )", + value: "海南省", + open: true + }, + { + pId: "0_1_8", + id: "0_1_8_0", + text: "海口市", + value: "海口市", + open: true + }, + { + pId: "0_1_8", + id: "0_1_8_1", + text: "三亚市", + value: "三亚市", + open: true + }, + { + pId: "0_1", + id: "0_1_9", + text: "河北省( 共12个 )", + value: "河北省", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_0", + text: "保定市", + value: "保定市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_1", + text: "沧州市", + value: "沧州市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_2", + text: "承德市", + value: "承德市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_3", + text: "邯郸市", + value: "邯郸市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_4", + text: "衡水市", + value: "衡水市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_5", + text: "廊坊市", + value: "廊坊市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_6", + text: "秦皇岛市", + value: "秦皇岛市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_7", + text: "石家庄市", + value: "石家庄市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_8", + text: "唐山市", + value: "唐山市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_9", + text: "天津市区", + value: "天津市区", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_10", + text: "邢台市", + value: "邢台市", + open: true + }, + { + pId: "0_1_9", + id: "0_1_9_11", + text: "张家口市", + value: "张家口市", + open: true + }, + { + pId: "0_1", + id: "0_1_10", + text: "河南省( 共19个 )", + value: "河南省", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_0", + text: "安阳市", + value: "安阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_1", + text: "鹤壁市", + value: "鹤壁市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_2", + text: "济源市", + value: "济源市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_3", + text: "焦作市", + value: "焦作市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_4", + text: "开封市", + value: "开封市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_5", + text: "廊坊市", + value: "廊坊市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_6", + text: "洛阳市", + value: "洛阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_7", + text: "漯河市", + value: "漯河市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_8", + text: "南阳市", + value: "南阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_9", + text: "平顶山市", + value: "平顶山市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_10", + text: "濮阳市", + value: "濮阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_11", + text: "三门峡市", + value: "三门峡市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_12", + text: "商丘市", + value: "商丘市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_13", + text: "新乡市", + value: "新乡市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_14", + text: "信阳市", + value: "信阳市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_15", + text: "许昌市", + value: "许昌市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_16", + text: "郑州市", + value: "郑州市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_17", + text: "周口市", + value: "周口市", + open: true + }, + { + pId: "0_1_10", + id: "0_1_10_18", + text: "驻马店市", + value: "驻马店市", + open: true + }, + { + pId: "0_1", + id: "0_1_11", + text: "黑龙江省( 共13个 )", + value: "黑龙江省", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_0", + text: "大庆市", + value: "大庆市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_1", + text: "大兴安岭地区", + value: "大兴安岭地区", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_2", + text: "大兴安岭市", + value: "大兴安岭市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_3", + text: "哈尔滨市", + value: "哈尔滨市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_4", + text: "鹤港市", + value: "鹤港市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_5", + text: "黑河市", + value: "黑河市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_6", + text: "佳木斯市", + value: "佳木斯市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_7", + text: "牡丹江市", + value: "牡丹江市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_8", + text: "七台河市", + value: "七台河市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_9", + text: "齐齐哈尔市", + value: "齐齐哈尔市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_10", + text: "双鸭山市", + value: "双鸭山市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_11", + text: "绥化市", + value: "绥化市", + open: true + }, + { + pId: "0_1_11", + id: "0_1_11_12", + text: "伊春市", + value: "伊春市", + open: true + }, + { + pId: "0_1", + id: "0_1_12", + text: "湖北省( 共16个 )", + value: "湖北省", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_0", + text: "鄂州市", + value: "鄂州市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_1", + text: "恩施土家族苗族自治州", + value: "恩施土家族苗族自治州", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_2", + text: "黄冈市", + value: "黄冈市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_3", + text: "黄石市", + value: "黄石市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_4", + text: "荆门市", + value: "荆门市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_5", + text: "荆州市", + value: "荆州市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_6", + text: "神农架市", + value: "神农架市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_7", + text: "十堰市", + value: "十堰市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_8", + text: "随州市", + value: "随州市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_9", + text: "天门市", + value: "天门市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_10", + text: "武汉市", + value: "武汉市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_11", + text: "咸宁市", + value: "咸宁市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_12", + text: "襄樊市", + value: "襄樊市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_13", + text: "襄阳市", + value: "襄阳市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_14", + text: "孝感市", + value: "孝感市", + open: true + }, + { + pId: "0_1_12", + id: "0_1_12_15", + text: "宜昌市", + value: "宜昌市", + open: true + }, + { + pId: "0_1", + id: "0_1_13", + text: "湖南省( 共15个 )", + value: "湖南省", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_0", + text: "常德市", + value: "常德市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_1", + text: "长沙市", + value: "长沙市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_2", + text: "郴州市", + value: "郴州市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_3", + text: "衡阳市", + value: "衡阳市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_4", + text: "怀化市", + value: "怀化市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_5", + text: "娄底市", + value: "娄底市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_6", + text: "邵阳市", + value: "邵阳市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_7", + text: "湘潭市", + value: "湘潭市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_8", + text: "湘西市", + value: "湘西市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_9", + text: "湘西土家族苗族自治州", + value: "湘西土家族苗族自治州", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_10", + text: "益阳市", + value: "益阳市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_11", + text: "永州市", + value: "永州市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_12", + text: "岳阳市", + value: "岳阳市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_13", + text: "张家界市", + value: "张家界市", + open: true + }, + { + pId: "0_1_13", + id: "0_1_13_14", + text: "株洲市", + value: "株洲市", + open: true + }, + { + pId: "0_1", + id: "0_1_14", + text: "吉林省( 共10个 )", + value: "吉林省", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_0", + text: "白城市", + value: "白城市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_1", + text: "白山市", + value: "白山市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_2", + text: "长春市", + value: "长春市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_3", + text: "大庆市", + value: "大庆市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_4", + text: "吉林市", + value: "吉林市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_5", + text: "辽源市", + value: "辽源市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_6", + text: "四平市", + value: "四平市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_7", + text: "松原市", + value: "松原市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_8", + text: "通化市", + value: "通化市", + open: true + }, + { + pId: "0_1_14", + id: "0_1_14_9", + text: "延边朝鲜族自治州", + value: "延边朝鲜族自治州", + open: true + }, + { + pId: "0_1", + id: "0_1_15", + text: "江苏省( 共13个 )", + value: "江苏省", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_0", + text: "常州市", + value: "常州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_1", + text: "淮安市", + value: "淮安市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_2", + text: "连云港市", + value: "连云港市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_3", + text: "南京市", + value: "南京市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_4", + text: "南通市", + value: "南通市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_5", + text: "苏州市", + value: "苏州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_6", + text: "宿迁市", + value: "宿迁市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_7", + text: "泰州市", + value: "泰州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_8", + text: "无锡市", + value: "无锡市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_9", + text: "徐州市", + value: "徐州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_10", + text: "盐城市", + value: "盐城市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_11", + text: "扬州市", + value: "扬州市", + open: true + }, + { + pId: "0_1_15", + id: "0_1_15_12", + text: "镇江市", + value: "镇江市", + open: true + }, + { + pId: "0_1", + id: "0_1_16", + text: "江西省( 共10个 )", + value: "江西省", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_0", + text: "抚州市", + value: "抚州市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_1", + text: "赣州市", + value: "赣州市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_2", + text: "景德镇市", + value: "景德镇市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_3", + text: "九江市", + value: "九江市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_4", + text: "南昌市", + value: "南昌市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_5", + text: "萍乡市", + value: "萍乡市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_6", + text: "上饶市", + value: "上饶市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_7", + text: "新余市", + value: "新余市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_8", + text: "宜春市", + value: "宜春市", + open: true + }, + { + pId: "0_1_16", + id: "0_1_16_9", + text: "鹰潭市", + value: "鹰潭市", + open: true + }, + { + pId: "0_1", + id: "0_1_17", + text: "辽宁省( 共14个 )", + value: "辽宁省", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_0", + text: "鞍山市", + value: "鞍山市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_1", + text: "本溪市", + value: "本溪市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_2", + text: "朝阳市", + value: "朝阳市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_3", + text: "大连市", + value: "大连市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_4", + text: "丹东市", + value: "丹东市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_5", + text: "抚顺市", + value: "抚顺市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_6", + text: "阜新市", + value: "阜新市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_7", + text: "葫芦岛市", + value: "葫芦岛市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_8", + text: "锦州市", + value: "锦州市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_9", + text: "辽阳市", + value: "辽阳市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_10", + text: "盘锦市", + value: "盘锦市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_11", + text: "沈阳市", + value: "沈阳市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_12", + text: "铁岭市", + value: "铁岭市", + open: true + }, + { + pId: "0_1_17", + id: "0_1_17_13", + text: "营口市", + value: "营口市", + open: true + }, + { + pId: "0_1", + id: "0_1_18", + text: "内蒙古( 共10个 )", + value: "内蒙古", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_0", + text: "包头市", + value: "包头市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_1", + text: "赤峰市", + value: "赤峰市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_2", + text: "鄂尔多斯市", + value: "鄂尔多斯市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_3", + text: "呼和浩特市", + value: "呼和浩特市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_4", + text: "呼伦贝尔市", + value: "呼伦贝尔市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_5", + text: "通辽市", + value: "通辽市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_6", + text: "乌海市", + value: "乌海市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_7", + text: "锡林郭勒市", + value: "锡林郭勒市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_8", + text: "兴安市", + value: "兴安市", + open: true + }, + { + pId: "0_1_18", + id: "0_1_18_9", + text: "运城市", + value: "运城市", + open: true + }, + { + pId: "0_1", + id: "0_1_19", + text: "宁夏回族自治区( 共5个 )", + value: "宁夏回族自治区", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_0", + text: "固原市", + value: "固原市", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_1", + text: "石嘴山市", + value: "石嘴山市", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_2", + text: "吴忠市", + value: "吴忠市", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_3", + text: "银川市", + value: "银川市", + open: true + }, + { + pId: "0_1_19", + id: "0_1_19_4", + text: "中卫市", + value: "中卫市", + open: true + }, + { + pId: "0_1", + id: "0_1_20", + text: "青海省( 共4个 )", + value: "青海省", + open: true + }, + { + pId: "0_1_20", + id: "0_1_20_0", + text: "海东地区", + value: "海东地区", + open: true + }, + { + pId: "0_1_20", + id: "0_1_20_1", + text: "海南藏族自治州", + value: "海南藏族自治州", + open: true + }, + { + pId: "0_1_20", + id: "0_1_20_2", + text: "海西蒙古族藏族自治州", + value: "海西蒙古族藏族自治州", + open: true + }, + { + pId: "0_1_20", + id: "0_1_20_3", + text: "西宁市", + value: "西宁市", + open: true + }, + { + pId: "0_1", + id: "0_1_21", + text: "山东省( 共17个 )", + value: "山东省", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_0", + text: "滨州市", + value: "滨州市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_1", + text: "德州市", + value: "德州市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_2", + text: "东营市", + value: "东营市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_3", + text: "菏泽市", + value: "菏泽市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_4", + text: "济南市", + value: "济南市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_5", + text: "济宁市", + value: "济宁市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_6", + text: "莱芜市", + value: "莱芜市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_7", + text: "聊城市", + value: "聊城市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_8", + text: "临沂市", + value: "临沂市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_9", + text: "青岛市", + value: "青岛市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_10", + text: "日照市", + value: "日照市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_11", + text: "泰安市", + value: "泰安市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_12", + text: "威海市", + value: "威海市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_13", + text: "潍坊市", + value: "潍坊市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_14", + text: "烟台市", + value: "烟台市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_15", + text: "枣庄市", + value: "枣庄市", + open: true + }, + { + pId: "0_1_21", + id: "0_1_21_16", + text: "淄博市", + value: "淄博市", + open: true + }, + { + pId: "0_1", + id: "0_1_22", + text: "山西省( 共12个 )", + value: "山西省", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_0", + text: "长治市", + value: "长治市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_1", + text: "大同市", + value: "大同市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_2", + text: "晋城市", + value: "晋城市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_3", + text: "晋中市", + value: "晋中市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_4", + text: "临汾市", + value: "临汾市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_5", + text: "吕梁市", + value: "吕梁市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_6", + text: "青岛市", + value: "青岛市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_7", + text: "朔州市", + value: "朔州市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_8", + text: "太原市", + value: "太原市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_9", + text: "忻州市", + value: "忻州市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_10", + text: "阳泉市", + value: "阳泉市", + open: true + }, + { + pId: "0_1_22", + id: "0_1_22_11", + text: "运城市", + value: "运城市", + open: true + }, + { + pId: "0_1", + id: "0_1_23", + text: "陕西省( 共9个 )", + value: "陕西省", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_0", + text: "安康市", + value: "安康市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_1", + text: "宝鸡市", + value: "宝鸡市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_2", + text: "汉中市", + value: "汉中市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_3", + text: "商洛市", + value: "商洛市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_4", + text: "渭南市", + value: "渭南市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_5", + text: "西安市", + value: "西安市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_6", + text: "咸阳市", + value: "咸阳市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_7", + text: "延安市", + value: "延安市", + open: true + }, + { + pId: "0_1_23", + id: "0_1_23_8", + text: "榆林市", + value: "榆林市", + open: true + }, + { + pId: "0_1", + id: "0_1_24", + text: "上海市( 共19个 )", + value: "上海市", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_0", + text: "宝山区", + value: "宝山区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_1", + text: "长宁区", + value: "长宁区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_2", + text: "崇明县", + value: "崇明县", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_3", + text: "奉贤区", + value: "奉贤区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_4", + text: "虹口区", + value: "虹口区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_5", + text: "黄浦区", + value: "黄浦区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_6", + text: "嘉定区", + value: "嘉定区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_7", + text: "金山区", + value: "金山区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_8", + text: "静安区", + value: "静安区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_9", + text: "昆明市", + value: "昆明市", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_10", + text: "闵行区", + value: "闵行区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_11", + text: "普陀区", + value: "普陀区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_12", + text: "浦东新区", + value: "浦东新区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_13", + text: "青浦区", + value: "青浦区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_14", + text: "上海市区", + value: "上海市区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_15", + text: "松江区", + value: "松江区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_16", + text: "徐汇区", + value: "徐汇区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_17", + text: "杨浦区", + value: "杨浦区", + open: true + }, + { + pId: "0_1_24", + id: "0_1_24_18", + text: "闸北区", + value: "闸北区", + open: true + }, + { + pId: "0_1", + id: "0_1_25", + text: "四川省( 共21个 )", + value: "四川省", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_0", + text: "阿坝藏族羌族自治州", + value: "阿坝藏族羌族自治州", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_1", + text: "巴中市", + value: "巴中市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_2", + text: "成都市", + value: "成都市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_3", + text: "达州市", + value: "达州市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_4", + text: "德阳市", + value: "德阳市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_5", + text: "甘孜市", + value: "甘孜市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_6", + text: "广安市", + value: "广安市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_7", + text: "广元市", + value: "广元市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_8", + text: "乐山市", + value: "乐山市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_9", + text: "凉山市", + value: "凉山市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_10", + text: "泸州市", + value: "泸州市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_11", + text: "眉山市", + value: "眉山市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_12", + text: "绵阳市", + value: "绵阳市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_13", + text: "南充市", + value: "南充市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_14", + text: "内江市", + value: "内江市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_15", + text: "攀枝花市", + value: "攀枝花市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_16", + text: "遂宁市", + value: "遂宁市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_17", + text: "雅安市", + value: "雅安市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_18", + text: "宜宾市", + value: "宜宾市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_19", + text: "资阳市", + value: "资阳市", + open: true + }, + { + pId: "0_1_25", + id: "0_1_25_20", + text: "自贡市", + value: "自贡市", + open: true + }, + { + pId: "0_1", + id: "0_1_26", + text: "台湾( 共1个 )", + value: "台湾", + open: true + }, + { + pId: "0_1_26", + id: "0_1_26_0", + text: "台北市", + value: "台北市", + open: true + }, + { + pId: "0_1", + id: "0_1_27", + text: "天津市( 共1个 )", + value: "天津市", + open: true + }, + { + pId: "0_1_27", + id: "0_1_27_0", + text: "天津市区", + value: "天津市区", + open: true + }, + { + pId: "0_1", + id: "0_1_28", + text: "西藏自治区( 共2个 )", + value: "西藏自治区", + open: true + }, + { + pId: "0_1_28", + id: "0_1_28_0", + text: "阿里市", + value: "阿里市", + open: true + }, + { + pId: "0_1_28", + id: "0_1_28_1", + text: "日喀则市", + value: "日喀则市", + open: true + }, + { + pId: "0_1", + id: "0_1_29", + text: "香港特别行政区( 共1个 )", + value: "香港特别行政区", + open: true + }, + { + pId: "0_1_29", + id: "0_1_29_0", + text: "香港", + value: "香港", + open: true + }, + { + pId: "0_1", + id: "0_1_30", + text: "新疆维吾尔族自治区( 共11个 )", + value: "新疆维吾尔族自治区", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_0", + text: "巴音郭楞市", + value: "巴音郭楞市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_1", + text: "哈密市", + value: "哈密市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_2", + text: "和田市", + value: "和田市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_3", + text: "喀什地区", + value: "喀什地区", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_4", + text: "克拉玛依市", + value: "克拉玛依市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_5", + text: "克孜勒苏柯州", + value: "克孜勒苏柯州", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_6", + text: "石河子市", + value: "石河子市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_7", + text: "塔城市", + value: "塔城市", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_8", + text: "吐鲁番地区", + value: "吐鲁番地区", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_9", + text: "乌鲁木齐", + value: "乌鲁木齐", + open: true + }, + { + pId: "0_1_30", + id: "0_1_30_10", + text: "伊犁市", + value: "伊犁市", + open: true + }, + { + pId: "0_1", + id: "0_1_31", + text: "云南省( 共12个 )", + value: "云南省", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_0", + text: "保山市", + value: "保山市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_1", + text: "楚雄彝族自治州", + value: "楚雄彝族自治州", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_2", + text: "大理白族自治州", + value: "大理白族自治州", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_3", + text: "红河哈尼族彝族自治州", + value: "红河哈尼族彝族自治州", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_4", + text: "昆明市", + value: "昆明市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_5", + text: "丽江市", + value: "丽江市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_6", + text: "临沧市", + value: "临沧市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_7", + text: "曲靖市", + value: "曲靖市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_8", + text: "思茅市", + value: "思茅市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_9", + text: "文山市", + value: "文山市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_10", + text: "玉溪市", + value: "玉溪市", + open: true + }, + { + pId: "0_1_31", + id: "0_1_31_11", + text: "昭通市", + value: "昭通市", + open: true + }, + { + pId: "0_1", + id: "0_1_32", + text: "浙江省( 共12个 )", + value: "浙江省", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_0", + text: "杭州市", + value: "杭州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_1", + text: "湖州市", + value: "湖州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_2", + text: "嘉兴市", + value: "嘉兴市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_3", + text: "金华市", + value: "金华市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_4", + text: "丽水市", + value: "丽水市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_5", + text: "宁波市", + value: "宁波市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_6", + text: "衢州市", + value: "衢州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_7", + text: "绍兴市", + value: "绍兴市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_8", + text: "台州市", + value: "台州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_9", + text: "温州市", + value: "温州市", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_10", + text: "浙江省", + value: "浙江省", + open: true + }, + { + pId: "0_1_32", + id: "0_1_32_11", + text: "舟山市", + value: "舟山市", + open: true + }, + { + pId: "0_1", + id: "0_1_33", + text: "重庆市( 共1个 )", + value: "重庆市", + open: true + }, + { + pId: "0_1_33", + id: "0_1_33_0", + text: "重庆市区", + value: "重庆市区", + open: true + } + ], + + TREE: [ + { id: -1, pId: -2, value: "根目录", text: "根目录" }, + { id: 1, pId: -1, value: "1", text: "第一级目录1", disabled: true }, + { id: 11, pId: 1, value: "11", text: "第二级文件1" }, + { id: 12, pId: 1, value: "12", text: "第二级目录2" }, + { id: 121, pId: 12, value: "121", text: "第三级目录1" }, + { id: 122, pId: 12, value: "122", text: "第三级文件1" }, + { id: 1211, pId: 121, value: "1211", text: "第四级目录1" }, + { + id: 12111, + pId: 1211, + value: "12111", + text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + }, + { id: 2, pId: -1, value: "2", text: "第一级目录2" }, + { id: 21, pId: 2, value: "21", text: "第二级目录3" }, + { id: 22, pId: 2, value: "22", text: "第二级文件2" }, + { id: 211, pId: 21, value: "211", text: "第三级目录2" }, + { id: 212, pId: 21, value: "212", text: "第三级文件2" }, + { id: 2111, pId: 211, value: "2111", text: "第四级文件1" } + ], + LEVELTREE: [ + { + id: 1, + text: "第一项", + value: "1" + }, + { + id: 2, + text: "第二项", + value: "2" + }, + { + id: 3, + text: "第三项", + value: "3", + open: true + }, + { + id: 11, + pId: 1, + text: "子项1", + value: "11" + }, + { + id: 12, + pId: 1, + text: "子项2", + value: "12" + }, + { + id: 13, + pId: 1, + text: "子项3", + value: "13" + }, + { + id: 31, + pId: 3, + text: "子项1", + value: "31" + }, + { + id: 32, + pId: 3, + text: "子项2", + value: "32" + }, + { + id: 33, + pId: 3, + text: "子项3", + value: "33" + } + ] +}; diff --git a/packages/demo/src/config/utils.js b/packages/demo/src/config/utils.js new file mode 100644 index 000000000..b58889c94 --- /dev/null +++ b/packages/demo/src/config/utils.js @@ -0,0 +1,17 @@ +/** + * 把模块转换成路由信息 + * @param {ESModule} module + * @param {string} pId + * @returns + */ +export function transModule2Route(module, pId) { + return Object.keys(module).map((key) => { + const item = module[key]; + const text = item.demoText || item.xtype; + return { + pId, + value: item.xtype, + text: text + }; + }); +} diff --git a/packages/demo/src/demo/base/button/demo.button.js b/packages/demo/src/demo/base/button/demo.button.js new file mode 100644 index 000000000..2cfc93acb --- /dev/null +++ b/packages/demo/src/demo/base/button/demo.button.js @@ -0,0 +1,452 @@ + +import { Button, TextButton, FloatLeftLayout, shortcut, Widget, parseInt, Msg, map } from "@fui/core" + + +@shortcut() +export class ButtonDemo extends Widget { + static xtype = "demo.button"; + + props = { baseCls: "demo-button" }; + + render() { + const items = [ + { + type: Button.xtype, + text: "一般按钮1111111111111", + level: "common", + whiteSpace: "nowrap", + width: 100, + height: 30, + handler() { + console.log("触发点击事件"); + this.loading(); + setTimeout(() => { + this.loaded(); + }, 5 * 1000); + }, + }, + { + type: Button.xtype, + text: "表示成功状态按钮", + level: "success", + height: 30, + }, + { + type: Button.xtype, + text: "表示警告状态的按钮", + level: "warning", + height: 30, + }, + { + type: Button.xtype, + text: "表示错误状态的按钮", + level: "error", + height: 30, + }, + { + type: Button.xtype, + text: "表示忽略状态的按钮", + level: "ignore", + height: 30, + }, + { + type: Button.xtype, + text: "普通灰化按钮", + disabled: true, + level: "success", + height: 30, + }, + { + type: Button.xtype, + text: "忽略状态灰化按钮", + disabled: true, + level: "ignore", + height: 30, + }, + { + type: Button.xtype, + text: "带图标的按钮", + // level: 'ignore', + iconCls: "close-font", + height: 30, + }, + { + type: Button.xtype, + text: "一般按钮", + block: true, + level: "common", + height: 30, + }, + { + type: Button.xtype, + text: "表示成功状态按钮", + block: true, + level: "success", + height: 30, + }, + { + type: Button.xtype, + text: "表示警告状态的按钮", + block: true, + level: "warning", + height: 30, + }, + { + type: Button.xtype, + text: "表示忽略状态的按钮", + block: true, + level: "ignore", + height: 30, + }, + { + type: Button.xtype, + text: "普通灰化按钮", + block: true, + disabled: true, + level: "success", + height: 30, + }, + { + type: Button.xtype, + text: "忽略状态灰化按钮", + block: true, + disabled: true, + level: "ignore", + height: 30, + }, + { + type: Button.xtype, + text: "带图标的按钮", + block: true, + // level: 'ignore', + iconCls: "close-font", + height: 30, + }, + { + type: Button.xtype, + text: "一般按钮", + clear: true, + level: "common", + height: 30, + }, + { + type: Button.xtype, + text: "表示成功状态按钮", + clear: true, + level: "success", + height: 30, + }, + { + type: Button.xtype, + text: "表示警告状态的按钮", + clear: true, + level: "warning", + height: 30, + }, + { + type: Button.xtype, + text: "表示忽略状态的按钮", + clear: true, + level: "ignore", + height: 30, + }, + { + type: Button.xtype, + text: "普通灰化按钮", + clear: true, + disabled: true, + level: "success", + height: 30, + }, + { + type: Button.xtype, + text: "忽略状态灰化按钮", + clear: true, + disabled: true, + level: "ignore", + height: 30, + }, + { + type: Button.xtype, + text: "带图标的按钮", + clear: true, + // level: 'ignore', + iconCls: "close-font", + height: 30, + }, + { + type: TextButton.xtype, + text: "文字按钮", + height: 30, + }, + { + type: Button.xtype, + text: "幽灵按钮(common)", + ghost: true, + height: 30, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "幽灵按钮(common)", + ghost: true, + height: 30, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "幽灵按钮(common)", + ghost: true, + level: "warning", + height: 30, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "幽灵按钮(common)", + ghost: true, + level: "error", + height: 30, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "幽灵按钮(common)", + ghost: true, + level: "success", + height: 30, + }, + { + type: Button.xtype, + text: "幽灵按钮(common)灰化", + disabled: true, + ghost: true, + height: 30, + }, + { + type: Button.xtype, + text: "弹出bubble", + bubble() { + return `${parseInt(Math.random() * 100) % 10}提示`; + }, + handler() { + Msg.toast("1111"); + }, + height: 30, + }, + { + type: Button.xtype, + text: "自动撑开", + iconCls: "close-font", + // textHeight: 32, + // height: 32, + iconGap: 64, + vgap: 16, + hgap: 100, + iconPosition: "bottom", + }, + { + type: Button.xtype, + text: "图标在下面的按钮", + iconCls: "close-font", + iconPosition: "bottom", + }, + { + type: Button.xtype, + text: "图标在左边的按钮", + iconCls: "close-font", + iconPosition: "left", + }, + { + type: Button.xtype, + text: "图标在右边的按钮", + iconCls: "close-font", + iconPosition: "right", + }, + { + type: Button.xtype, + text: "浅色的一般按钮", + iconCls: "plus-font", + light: true, + }, + { + type: Button.xtype, + text: "浅色的成功按钮", + level: "success", + iconCls: "plus-font", + light: true, + }, + { + type: Button.xtype, + text: "浅色的警告按钮", + level: "warning", + iconCls: "plus-font", + light: true, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "浅色的失败按钮", + level: "error", + cls: "hover-mask", + light: true, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "朴素的按钮", + level: "common", + plain: true, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "朴素的按钮", + level: "success", + plain: true, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "朴素的按钮", + level: "error", + plain: true, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "朴素的按钮", + level: "warning", + plain: true, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "朴素的按钮", + level: "ignore", + plain: true, + }, + { + type: Button.xtype, + iconCls: "plus-font", + plain: true, + level: "error", + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "朴素的按钮", + plain: true, + disabled: true, + }, + { + type: Button.xtype, + iconCls: "plus-font", + text: "点我,更改图标", + handler() { + this.i = this.i === undefined ? 0 : ++this.i; + const arr = [ + "text-background-font", + "check-mark-ha-font", + "close-font", + "search-font", + "date-change-h-font" + ]; + if (this.i >= arr.length) { + this.i = 0; + } + this.setIcon(arr[this.i]); + }, + height: 24, + }, + { + type: Button.xtype, + text: "带加载的按钮", + handler() { + console.log("触发点击事件"); + this.loading(); + setTimeout(() => { + this.loaded(); + }, 5 * 1000); + }, + }, + { + type: Button.xtype, + text: "带加载的按钮", + iconCls: "circle-close-font", + handler() { + console.log("触发点击事件"); + this.loading(); + setTimeout(() => { + this.loaded(); + }, 5 * 1000); + }, + }, + { + type: Button.xtype, + clear: true, + text: "带加载的按钮", + iconCls: "circle-close-font", + handler() { + console.log("触发点击事件"); + this.loading(); + setTimeout(() => { + this.loaded(); + }, 5 * 1000); + }, + }, + { + type: Button.xtype, + text: "加载中的按钮", + loading: true, + handler() { + console.log("我是无法被触发的!"); + }, + }, + { + type: Button.xtype, + text: "自定义图标按钮(点我修改)", + icon: { + type: "demo.joker.icon", + }, + handler() { + console.log("触发点击事件"); + this.loading(); + setTimeout(() => { + this.loaded(); + }, 5 * 1000); + }, + }, + { + type: Button.xtype, + text: "文字偏左的按钮", + textAlign: "left", + width: 200, + }, + { + type: Button.xtype, + text: "小于最小宽度的按钮", + width: 50, + }, + { + type: Button.xtype, + text: "一个文字超级超级长的 button, 他比按钮宽度还长。", + textWidth: 500, + width: 100, + } + ]; + + return { + type: FloatLeftLayout.xtype, + scrolly: true, + vgap: 100, + hgap: 20, + items: map(items, (index, value) => { + return { + el: value, + }; + }), + }; + } +} + diff --git a/packages/demo/src/demo/base/button/demo.icon_button.js b/packages/demo/src/demo/base/button/demo.icon_button.js new file mode 100644 index 000000000..4fb252337 --- /dev/null +++ b/packages/demo/src/demo/base/button/demo.icon_button.js @@ -0,0 +1,31 @@ + +import { IconButton, FloatLeftLayout, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class IconButtonDemo extends Widget { + static xtype = "demo.icon_button"; + + props = { baseCls: "demo-button" }; + + render() { + const items = [ + { + el: { + type: IconButton.xtype, + cls: "close-ha-font", + width: 25, + height: 25, + }, + } + ]; + + return { + type: FloatLeftLayout.xtype, + vgap: 200, + hgap: 20, + items, + }; + } +} + diff --git a/packages/demo/src/demo/base/button/demo.image_button.js b/packages/demo/src/demo/base/button/demo.image_button.js new file mode 100644 index 000000000..ba46d0d75 --- /dev/null +++ b/packages/demo/src/demo/base/button/demo.image_button.js @@ -0,0 +1,31 @@ + +import { ImageButton, FloatLeftLayout, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class ImageButtonDemo extends Widget { + static xtype = "demo.image_button"; + + props = { baseCls: "demo-button" }; + + render() { + const items = [ + { + el: { + type: ImageButton.xtype, + src: "http://www.easyicon.net/api/resizeApi.php?id=1206741&size=128", + width: 100, + height: 100, + }, + } + ]; + + return { + type: FloatLeftLayout.xtype, + vgap: 200, + hgap: 20, + items, + }; + } +} + diff --git a/packages/demo/src/demo/base/button/demo.text_button.js b/packages/demo/src/demo/base/button/demo.text_button.js new file mode 100644 index 000000000..4f4a2e292 --- /dev/null +++ b/packages/demo/src/demo/base/button/demo.text_button.js @@ -0,0 +1,31 @@ + +import { TextButton, FloatLeftLayout, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class TextButtonDemo extends Widget { + static xtype = "demo.text_button"; + + props = { baseCls: "demo-button" }; + + render() { + const items = [ + { + el: { + type: TextButton.xtype, + text: "文字按钮", + height: 30, + keyword: "w", + }, + } + ]; + + return { + type: FloatLeftLayout.xtype, + vgap: 200, + hgap: 20, + items, + }; + } +} + diff --git a/packages/demo/src/demo/base/button/index.js b/packages/demo/src/demo/base/button/index.js new file mode 100644 index 000000000..768de5c1b --- /dev/null +++ b/packages/demo/src/demo/base/button/index.js @@ -0,0 +1,4 @@ +export * from "./demo.button"; +export * from "./demo.icon_button"; +export * from "./demo.image_button"; +export * from "./demo.text_button"; \ No newline at end of file diff --git a/packages/demo/src/demo/base/demo.html.js b/packages/demo/src/demo/base/demo.html.js new file mode 100644 index 000000000..fc612e4ed --- /dev/null +++ b/packages/demo/src/demo/base/demo.html.js @@ -0,0 +1,26 @@ +import { shortcut, Widget, VerticalLayout, Html } from "@fui/core"; + +@shortcut() +export class HtmlDemo extends Widget { + static xtype = "demo.html"; + + props = { baseCls: "demo-html" }; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Html.xtype, + text: "

在bi.html标签中使用html原生标签

" + }, + { + type: Html.xtype, + text: "" + } + ], + hgap: 300, + vgap: 20 + }; + } +} diff --git a/packages/demo/src/demo/base/demo.icon_label.js b/packages/demo/src/demo/base/demo.icon_label.js new file mode 100644 index 000000000..bbc85fc4d --- /dev/null +++ b/packages/demo/src/demo/base/demo.icon_label.js @@ -0,0 +1,26 @@ +import { DefaultLayout, Label, IconLabel, shortcut, Widget } from "@fui/core"; + +@shortcut() +export class IconLabelDemo extends Widget { + static xtype = "demo.icon_label"; + + props = { baseCls: "demo-bubble" }; + + render() { + return { + type: DefaultLayout.xtype, + items: [ + { + type: Label.xtype, + text: "这是一个icon标签,在加了border之后仍然是居中显示的" + }, + { + type: IconLabel.xtype, + cls: "date-font bi-border", + height: 40, + width: 40 + } + ] + }; + } +} diff --git a/packages/demo/src/demo/base/demo.label.js b/packages/demo/src/demo/base/demo.label.js new file mode 100644 index 000000000..b396f57d3 --- /dev/null +++ b/packages/demo/src/demo/base/demo.label.js @@ -0,0 +1,173 @@ +import { + VerticalLayout, + FloatLeftLayout, + shortcut, + Widget, + Label +} from "@fui/core"; + +@shortcut() +export class LabelDemo extends Widget { + static xtype = "demo.label"; + + props = { baseCls: "demo-label" }; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + cls: "layout-bg6", + text: "这是一个label控件,默认居中", + disabled: true, + textAlign: "center" + }, + { + type: Label.xtype, + cls: "layout-bg1", + text: "这是一个label控件, 高度为30,默认居中", + textAlign: "center", + height: 30 + }, + { + type: Label.xtype, + cls: "layout-bg3", + text: "这是一个label控件,使用水平居左", + textAlign: "left", + height: 30 + }, + { + type: Label.xtype, + cls: "layout-bg2", + text: "这是一个label控件,whiteSpace是normal,不设置高度,为了演示这个是真的是normal的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal" + }, + { + type: Label.xtype, + cls: "layout-bg5", + text: "这是一个label控件,whiteSpace是默认的nowrap,不设置高度,为了演示这个是真的是nowrap的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数" + }, + { + type: Label.xtype, + cls: "layout-bg7", + text: "这是一个label控件,whiteSpace是默认的nowrap,高度为30,为了演示这个是真的是nowrap的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + height: 30 + }, + { + type: Label.xtype, + cls: "layout-bg3", + text: "这是一个label控件,whiteSpace设置为normal,高度为60,为了演示这个是真的是normal的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + height: 60 + }, + { + type: Label.xtype, + cls: "layout-bg5", + text: "这是一个label控件,whiteSpace设置为normal,textHeight控制text的lineHeight,这样可以实现换行效果,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textHeight: 30, + height: 60 + }, + { + type: Label.xtype, + cls: "layout-bg1", + text: "这是一个label控件,whiteSpace设置为nowrap,textWidth控制text的width", + textWidth: 200, + height: 60 + }, + { + type: Label.xtype, + cls: "layout-bg8", + text: "这是一个label控件,whiteSpace设置为normal,textWidth控制text的width,这样可以实现换行效果,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textWidth: 200, + height: 60 + }, + { + type: Label.xtype, + cls: "layout-bg7", + text: "whiteSpace为默认的nowrap,高度设置为60,宽度设置为300", + height: 60, + width: 300 + }, + { + type: Label.xtype, + cls: "layout-bg6", + text: "设置了宽度300,高度60,whiteSpace设置为normal", + whiteSpace: "normal", + width: 300, + height: 60 + }, + { + type: Label.xtype, + cls: "layout-bg8", + text: "textWidth设置为200,textHeight设置为30,width设置300,凑点字数看效果", + width: 300, + textWidth: 200, + textHeight: 30, + height: 60, + whiteSpace: "normal" + }, + { + type: Label.xtype, + cls: "layout-bg1", + text: "textWidth设置为200,width设置300,看下水平居左的换行效果", + textAlign: "left", + width: 300, + textWidth: 200, + textHeight: 30, + height: 60, + whiteSpace: "normal" + }, + { + type: Label.xtype, + cls: "layout-bg2", + text: "使用默认的nowrap,再去设置textHeight,只会有一行的效果", + textAlign: "left", + width: 300, + textWidth: 200, + textHeight: 30, + height: 60 + }, + { + type: FloatLeftLayout.xtype, + items: [ + { + type: Label.xtype, + cls: "layout-bg3", + text: "在float布局中自适应的,不设高度和宽度,文字多长这个就有多长" + } + ], + height: 30 + }, + { + type: FloatLeftLayout.xtype, + items: [ + { + type: Label.xtype, + cls: "layout-bg4", + text: "在float布局中自适应的,设置了宽度200,后面还有", + width: 200 + } + ], + height: 30 + }, + { + type: FloatLeftLayout.xtype, + items: [ + { + type: Label.xtype, + text: "在float布局中自适应的,设置了高度,文字多长这个就有多长", + cls: "layout-bg5", + height: 30 + } + ], + height: 30 + } + ], + hgap: 300, + vgap: 20 + }; + } +} diff --git a/packages/demo/src/demo/base/demo.label.scene.js b/packages/demo/src/demo/base/demo.label.scene.js new file mode 100644 index 000000000..b797ca169 --- /dev/null +++ b/packages/demo/src/demo/base/demo.label.scene.js @@ -0,0 +1,802 @@ +import { + Label, + AbsoluteLayout, + shortcut, + Widget, + VerticalLayout +} from "@fui/core"; + +@shortcut() +export class LabelSceneDemo extends Widget { + static xtype = "demo.label_scene"; + + props = { baseCls: "demo-label" }; + + render() { + const items = []; + + items.push( + this.createExpander( + "1.1.1 文字居中,有宽度和高度,有文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg6", + text: "设置了textWidth,则一定是嵌套结构,因此需要用center_adapt布局容纳一下.为了实现不足一行时文字水平居中,超出一行时左对齐,需要设置maxWidth.", + whiteSpace: "normal", + height: 50, + width: 500, + textWidth: 200, + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.1.2 居中,有宽度和高度,有文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg6", + text: "居中,有宽度高度,有文字宽度,whiteSpace为nowrap,maxWidth会限制文字", + whiteSpace: "nowrap", + height: 50, + width: 500, + textWidth: 350, + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.2.1 居中,有宽度无高度,有文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg6", + text: "居中,有宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + width: 500, + textWidth: 200, + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.2.1 居中,有宽度无高度,有文字宽度,whiteSpace为normal,高度被父容器拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg6", + text: "此时虽然没有对label设置高度,但由于使用了center_adapt布局,依然会垂直方向居中", + whiteSpace: "normal", + width: 500, + textWidth: 200, + textAlign: "center" + }, + top: 0, + left: 0, + bottom: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "1.2.2 居中,有宽度无高度,有文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg6", + text: "居中,有宽度无高度,有文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + width: 500, + textWidth: 350, + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.3.1 居中,有宽度和高度,无文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,有宽度高度,无文字宽度,whiteSpace为normal,只需用center_adapt布局包一下即可.度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,whiteSpace为normal", + width: 500, + whiteSpace: "normal", + textAlign: "center", + height: 50 + } + ) + ); + + items.push( + this.createExpander( + "1.3.2 居中,有宽度无高度,无文字宽度,whiteSpace为normal", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,有宽度无高度,无文字宽度,whiteSpace为normal,只需用center_adapt布局包一下即可.度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,whiteSpace为normal", + width: 500, + whiteSpace: "normal", + textAlign: "center" + }, + top: 0, + left: 0, + bottom: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "1.4 居中,有宽度和高度,无文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,有宽度500有高度50,无文字宽度,whiteSpace为nowrap,此处无需两层div,设置text即可,然后设置line-height为传入高度即可实现垂直方向居中", + width: 500, + whiteSpace: "nowrap", + textAlign: "center", + height: 50 + } + ) + ); + + items.push( + this.createExpander( + "1.5.1 居中,有宽度无高度,无文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,有宽度500无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + width: 500, + whiteSpace: "nowrap", + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.5.2 居中,有宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 50, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,有宽度500无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + width: 500, + whiteSpace: "nowrap", + textAlign: "center" + }, + top: 0, + left: 0, + bottom: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "1.6.1 居中,无宽度无高度,有文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,无宽度,有文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + textWidth: 500, + whiteSpace: "nowrap", + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.6.2 居中,无宽度无高度,有文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,无宽度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + textWidth: 500, + whiteSpace: "normal", + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.6.3 居中,无宽度无,有文字宽度,whiteSpace为normal,被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,无宽度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + textWidth: 500, + whiteSpace: "normal", + textAlign: "center" + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "1.7.1 居中,无宽度无高度,无文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.7.2 居中,无宽度无高度,无文字宽度,whiteSpace为normal,被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "center" + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "1.7.3 居中,无宽度有高度,无文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,无宽度有高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + height: 50, + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.8 居中,无宽度有高度,无文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,无宽度有高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + height: 50, + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.9 居中,无宽度无高度,无文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "center" + } + ) + ); + + items.push( + this.createExpander( + "1.9.1 居中,无宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 50, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg3", + text: "居中,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "center" + }, + top: 0, + left: 0, + right: 0, + bottom: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "2.1.1 居左,有宽度有高度,有文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,有宽度有高度,有文字宽度,whiteSpace为normal,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left", + textWidth: 300, + height: 50, + width: 500 + } + ) + ); + + items.push( + this.createExpander( + "2.1.2 居左,有宽度有高度,有文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,有宽度有高度,有文字宽度,whiteSpace为normal,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "left", + textWidth: 300, + height: 50, + width: 500 + } + ) + ); + + items.push( + this.createExpander( + "2.2.1 居左,有宽度无高度,有文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,有宽度无高度,有文字宽度,whiteSpace为normal,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left", + textWidth: 300, + width: 500 + } + ) + ); + + items.push( + this.createExpander( + "2.2.2 居左,有宽度无高度,有文字宽度,whiteSpace为normal,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,有宽度无高度,有文字宽度,whiteSpace为normal,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left", + textWidth: 300, + width: 500 + }, + top: 0, + bottom: 0, + left: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "2.2.3 居左,有宽度无高度,有文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,有宽度无高度,有文字宽度,whiteSpace为nowrap,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "left", + textWidth: 300, + width: 500 + } + ) + ); + + items.push( + this.createExpander( + "2.2.4 居左,有宽度无高度,有文字宽度,whiteSpace为nowrap,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,有宽度无高度,有文字宽度,whiteSpace为nowrap,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "left", + textWidth: 300, + width: 500 + }, + top: 0, + bottom: 0, + left: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "2.3.1 居左,有宽度有高度,无文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,有宽度有高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "left", + height: 50, + vgap: 5, + width: 500 + } + ) + ); + + items.push( + this.createExpander( + "2.3.2 居左,有宽度有高度,无文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,有宽度有高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left", + height: 50, + width: 500 + } + ) + ); + + items.push( + this.createExpander( + "2.4.1 居左,有宽度无高度,无文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,有宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left", + width: 500 + } + ) + ); + + items.push( + this.createExpander( + "2.4.2 居左,有宽度无高度,无文字宽度,whiteSpace为normal,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg1", + text: "居左,有宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left", + width: 500 + }, + top: 0, + left: 0, + bottom: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "2.5.1 居左,无宽度无高度,有文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left", + textWidth: 300 + } + ) + ); + + items.push( + this.createExpander( + "2.5.2 居左,无宽度无高度,有文字宽度,whiteSpace为normal,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left", + textWidth: 300 + }, + top: 0, + left: 0, + bottom: 0, + right: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "2.5.3 居左,无宽度无高度,有文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "left", + textWidth: 300 + } + ) + ); + + items.push( + this.createExpander( + "2.5.4 居左,无宽度无高度,有文字宽度,whiteSpace为nowrap,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "left", + textWidth: 300 + }, + top: 0, + left: 0, + bottom: 0, + right: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "2.6.1 居左,无宽度有高度,无文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度有高度,无文字宽度,whiteSpace为nowrap,注意这个是设置了vgap的,为了实现居中,lineHeight要做计算,才能准确的垂直居中", + whiteSpace: "nowrap", + textAlign: "left", + vgap: 10, + height: 50 + } + ) + ); + + items.push( + this.createExpander( + "2.6.2 居左,无宽度有高度,无文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度有高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left", + height: 50 + } + ) + ); + + items.push( + this.createExpander( + "2.7.1 居左,无宽度无高度,无文字宽度,whiteSpace为normal", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left" + } + ) + ); + + items.push( + this.createExpander( + "2.7.2 居左,无宽度无高度,无文字宽度,whiteSpace为normal,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left" + }, + top: 0, + left: 0, + bottom: 0, + right: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "2.7.3 居左,无宽度无高度,无文字宽度,whiteSpace为nowrap", + { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "left" + } + ) + ); + + items.push( + this.createExpander( + "2.7.4 居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "left" + }, + top: 0, + left: 0, + bottom: 0, + right: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "2.8 居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "nowrap", + textAlign: "left" + }, + top: 0, + left: 0, + bottom: 0, + right: 0 + } + ] + } + ) + ); + + items.push( + this.createExpander( + "2.8.2 居左,无宽度无高度,无文字宽度,whiteSpace为normal,高度被父级拉满", + { + type: AbsoluteLayout.xtype, + height: 100, + items: [ + { + el: { + type: Label.xtype, + cls: "layout-bg2", + text: "居左,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数", + whiteSpace: "normal", + textAlign: "left" + }, + top: 0, + left: 0, + bottom: 0, + right: 0 + } + ] + } + ) + ); + + return { + type: VerticalLayout.xtype, + items, + hgap: 300, + vgap: 20 + }; + } + + createExpander(text, popup) { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + cls: "demo-font-weight-bold", + textAlign: "left", + text, + height: 30 + }, + { + el: popup + } + ] + }; + } +} diff --git a/packages/demo/src/demo/base/demo.message.js b/packages/demo/src/demo/base/demo.message.js new file mode 100644 index 000000000..b9db94862 --- /dev/null +++ b/packages/demo/src/demo/base/demo.message.js @@ -0,0 +1,26 @@ +import { shortcut, Widget, Msg, CenterAdaptLayout, Button } from "@fui/core"; + +@shortcut() +export class MessageDemo extends Widget { + static xtype = "demo.message"; + + props = { baseCls: "demo-bubble" }; + + render() { + return { + type: CenterAdaptLayout.xtype, + items: [ + { + el: { + type: Button.xtype, + text: "点击我弹出一个消息框", + height: 30, + handler() { + Msg.alert("测试消息框", "我是测试消息框的内容"); + } + } + } + ] + }; + } +} diff --git a/packages/demo/src/demo/base/demo.pager.js b/packages/demo/src/demo/base/demo.pager.js new file mode 100644 index 000000000..cf1cf55df --- /dev/null +++ b/packages/demo/src/demo/base/demo.pager.js @@ -0,0 +1,126 @@ +import { VerticalLayout, Label, shortcut, Widget, Pager } from "@fui/core"; + +@shortcut() +export class FuncDemo extends Widget { + static xtype = "demo.pager"; + + props = { baseCls: "demo-func" }; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + height: 30, + text: "默认的分页" + }, + { + type: Pager.xtype, + height: 50, + pages: 18, + groups: 5, + curr: 6, + first: "首页", + last: "尾页" + }, + { + type: Label.xtype, + height: 30, + text: "显示上一页、下一页、首页、尾页" + }, + { + type: Pager.xtype, + dynamicShow: false, + height: 50, + pages: 18, + groups: 5, + curr: 1, + first: "首页>", + last: "<尾页" + }, + { + type: Label.xtype, + height: 30, + text: "显示上一页、下一页" + }, + { + type: Pager.xtype, + dynamicShow: false, + dynamicShowFirstLast: true, + height: 50, + pages: 18, + groups: 5, + curr: 1, + first: "首页>", + last: "<尾页" + }, + { + type: Label.xtype, + height: 30, + text: "自定义上一页、下一页" + }, + { + type: Pager.xtype, + dynamicShow: false, + height: 50, + pages: 18, + groups: 5, + curr: 6, + prev: { + type: Pager.xtype, + cls: "", + text: "上一页", + value: "prev", + once: false, + height: 30, + handler() {} + }, + next: { + type: Pager.xtype, + cls: "", + text: "下一页", + value: "next", + once: false, + handler() {} + } + }, + { + type: Label.xtype, + height: 30, + text: "不知道总页数的情况(测试条件 1<=page<=3)" + }, + { + type: Pager.xtype, + dynamicShow: false, + height: 50, + pages: false, + curr: 1, + prev: { + type: Pager.xtype, + cls: "", + text: "上一页", + value: "prev", + once: false, + height: 30, + handler() {} + }, + next: { + type: Pager.xtype, + cls: "", + text: "下一页", + value: "next", + once: false, + handler() {} + }, + hasPrev(v) { + return v > 1; + }, + hasNext(v) { + return v < 3; + } + } + ] + }; + } +} diff --git a/packages/demo/src/demo/base/editor/demo.editor.js b/packages/demo/src/demo/base/editor/demo.editor.js new file mode 100644 index 000000000..1fa233ad3 --- /dev/null +++ b/packages/demo/src/demo/base/editor/demo.editor.js @@ -0,0 +1,127 @@ + +import { Editor, AbsoluteLayout, Button, shortcut, Widget, createWidget, Editor as BIEditor } from "@fui/core" + + + +@shortcut() +export class EditorDemo extends Widget { + static xtype = "demo.editor"; + + props = { baseCls: "demo-editor" }; + + render() { + const editor1 = createWidget({ + type: Editor.xtype, + cls: "bi-border", + watermark: "报错信息显示在控件上方", + errorText: "字段不可重名!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", + width: 200, + height: 24, + }); + editor1.on(BIEditor.EVENT_ENTER, () => { + editor1.blur(); + }); + const editor2 = createWidget({ + type: Editor.xtype, + cls: "bi-border", + watermark: "输入'a'会有错误信息", + disabled: true, + errorText: "字段不可重名", + validationChecker(v) { + if (v == "a") { + return false; + } + + return true; + }, + allowBlank: true, + width: 200, + height: 24, + }); + const editor3 = createWidget({ + type: Editor.xtype, + cls: "bi-border", + watermark: "输入'a'会有错误信息且回车键不能退出编辑", + errorText: "字段不可重名", + value: "a", + validationChecker(v) { + if (v == "a") { + return false; + } + + return true; + }, + quitChecker(v) { + return false; + }, + allowBlank: true, + width: 300, + height: 24, + }); + const editor4 = createWidget({ + type: Editor.xtype, + cls: "bi-border", + inputType: "password", + autocomplete: "new-password", + watermark: "请输入密码", + allowBlank: true, + width: 300, + height: 24, + }); + createWidget({ + type: AbsoluteLayout.xtype, + element: this, + items: [ + { + el: editor1, + left: 0, + top: 0, + }, + { + el: editor2, + left: 250, + top: 30, + }, + { + el: editor3, + left: 500, + top: 60, + }, + { + el: editor4, + left: 700, + top: 60, + }, + { + el: { + type: Button.xtype, + text: "disable", + handler() { + editor1.setEnable(false); + editor2.setEnable(false); + editor3.setEnable(false); + }, + height: 30, + }, + left: 100, + bottom: 60, + }, + { + el: { + type: Button.xtype, + text: "enable", + handler() { + editor1.setEnable(true); + editor2.setEnable(true); + editor3.setEnable(true); + }, + height: 30, + }, + left: 200, + bottom: 60, + } + ], + }); + } +} + diff --git a/packages/demo/src/demo/base/editor/demo.multifile_editor.js b/packages/demo/src/demo/base/editor/demo.multifile_editor.js new file mode 100644 index 000000000..9bbcdfd39 --- /dev/null +++ b/packages/demo/src/demo/base/editor/demo.multifile_editor.js @@ -0,0 +1,36 @@ + +import { AbsoluteLayout, AdaptiveLayout, MultifileEditor, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class CodeEditorDemo extends Widget { + static xtype = "demo.multifile_editor"; + + props = { baseCls: "demo-editor" }; + + render() { + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: AdaptiveLayout.xtype, + cls: "layout-bg1", + items: [ + { + type: MultifileEditor.xtype, + width: 400, + height: 300, + } + ], + width: 400, + height: 300, + }, + top: 50, + left: 50, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/base/editor/demo.textarea_editor.js b/packages/demo/src/demo/base/editor/demo.textarea_editor.js new file mode 100644 index 000000000..6a62b6f8e --- /dev/null +++ b/packages/demo/src/demo/base/editor/demo.textarea_editor.js @@ -0,0 +1,55 @@ + +import { TextAreaEditor, VerticalLayout, Button, shortcut, Widget, createWidget, isNotEmptyString, Msg } from "@fui/core" + + + +@shortcut() +export class TextareaEditorDemo extends Widget { + static xtype = "demo.textarea_editor"; + + props = { baseCls: "demo-editor" }; + + render() { + const editor = createWidget({ + type: TextAreaEditor.xtype, + cls: "bi-border", + width: 600, + height: 400, + watermark: "请输入内容", + errorText: "检测内容有误", + validationChecker(v) { + return isNotEmptyString(v); + }, + }); + editor.on(TextAreaEditor.EVENT_FOCUS, () => { + Msg.toast("Focus"); + }); + editor.on(TextAreaEditor.EVENT_BLUR, () => { + Msg.toast("Blur"); + }); + createWidget({ + type: VerticalLayout.xtype, + element: this, + hgap: 30, + vgap: 20, + items: [ + editor, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(editor.getValue())); + }, + }, + { + type: Button.xtype, + text: "setValue", + handler() { + editor.setValue("测试数据"); + }, + } + ], + }); + } +} + diff --git a/demo/js/base/editor/index.js b/packages/demo/src/demo/base/editor/index.js similarity index 100% rename from demo/js/base/editor/index.js rename to packages/demo/src/demo/base/editor/index.js diff --git a/packages/demo/src/demo/base/index.js b/packages/demo/src/demo/base/index.js new file mode 100644 index 000000000..68df8186a --- /dev/null +++ b/packages/demo/src/demo/base/index.js @@ -0,0 +1,16 @@ +export const meta = { + title: "基础控件 base", + rank: 8 +}; + +export * as button from "./button"; +export * as editor from "./editor"; +export * as tip from "./tip"; +export * as tree from "./tree"; + +export * from "./demo.html"; +export * from "./demo.icon_label"; +export * from "./demo.label"; +export * from "./demo.label.scene"; +export * from "./demo.message"; +export * from "./demo.pager"; diff --git a/packages/demo/src/demo/base/tip/demo.bubble.js b/packages/demo/src/demo/base/tip/demo.bubble.js new file mode 100644 index 000000000..e59b83f3a --- /dev/null +++ b/packages/demo/src/demo/base/tip/demo.bubble.js @@ -0,0 +1,87 @@ + +import { Button, FloatLeftLayout, shortcut, Widget, Bubbles } from "@fui/core" + + +@shortcut() +export class BubbleDemo extends Widget { + static xtype = "demo.bubble"; + + props = { baseCls: "demo-bubble" }; + + render() { + const btns = []; + const items = [ + { + el: { + ref(_ref) { + btns.push(_ref); + }, + type: Button.xtype, + text: "bubble测试(消息)", + title: "123", + height: 30, + handler() { + Bubbles.show("singleBubble1", "bubble测试", this, { + level: "common", + }); + }, + }, + }, + { + el: { + ref(_ref) { + btns.push(_ref); + }, + type: Button.xtype, + text: "bubble测试(成功)", + height: 30, + handler() { + Bubbles.show("singleBubble2", "bubble测试", this, { + offsetStyle: "center", + level: "success", + }); + }, + }, + }, + { + el: { + ref(_ref) { + btns.push(_ref); + }, + type: Button.xtype, + text: "bubble测试(错误)", + height: 30, + handler() { + Bubbles.show("singleBubble3", "bubble测试", this, { + offsetStyle: "right", + level: "error", + }); + }, + }, + }, + { + el: { + ref(_ref) { + btns.push(_ref); + }, + type: Button.xtype, + text: "bubble测试(警告)", + height: 30, + handler() { + Bubbles.show("singleBubble4", "bubble测试", this, { + level: "warning", + }); + }, + }, + } + ]; + + return { + type: FloatLeftLayout.xtype, + vgap: 200, + hgap: 20, + items, + }; + } +} + diff --git a/packages/demo/src/demo/base/tip/demo.title.js b/packages/demo/src/demo/base/tip/demo.title.js new file mode 100644 index 000000000..e3c86b260 --- /dev/null +++ b/packages/demo/src/demo/base/tip/demo.title.js @@ -0,0 +1,71 @@ + +import { VerticalLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class TitleDemo extends Widget { + static xtype = "demo.title"; + + props = { baseCls: "demo-title" }; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + cls: "layout-bg1", + height: 50, + title: "title提示", + text: "移上去有title提示", + textAlign: "center", + }, + { + type: Label.xtype, + cls: "layout-bg6", + height: 50, + disabled: true, + warningTitle: "title错误提示", + text: "移上去有title错误提示", + textAlign: "center", + }, + { + type: Label.xtype, + cls: "layout-bg2", + height: 50, + disabled: true, + tipType: "success", + title: "自定义title提示效果", + warningTitle: "自定义title提示效果", + text: "自定义title提示效果", + textAlign: "center", + }, + { + type: Label.xtype, + cls: "layout-bg3", + height: 50, + title: () => "函数返回值作为title提示", + text: "title提示支持函数", + textAlign: "center", + }, + { + type: Label.xtype, + cls: "layout-bg4", + height: 50, + title() { + return { + level: "success", + text: "自定义title\n提示效果", + textAlign: "center", + }; + }, + text: "title提示支持对象,作为bi.tooltip的props", + textAlign: "center", + } + ], + hgap: 300, + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/base/tip/demo.toast.js b/packages/demo/src/demo/base/tip/demo.toast.js new file mode 100644 index 000000000..0866a7708 --- /dev/null +++ b/packages/demo/src/demo/base/tip/demo.toast.js @@ -0,0 +1,89 @@ + +import { Button, FloatLeftLayout, shortcut, Widget, createWidget, Msg } from "@fui/core" + + + +@shortcut() +export class ToastDemo extends Widget { + static xtype = "demo.toast"; + + props = { baseCls: "demo-toast" }; + + render() { + const items = [ + { + el: { + type: Button.xtype, + text: "简单Toast测试(success)", + height: 30, + handler() { + Msg.toast("这是一条简单的数据", { + level: "success", + }); + }, + }, + }, + { + el: { + type: Button.xtype, + text: "很长的Toast测试(normal)", + height: 30, + handler() { + Msg.toast( + "这是一条很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的数据", + {} + ); + }, + }, + }, + { + el: { + type: Button.xtype, + text: "非常长的Toast测试(warning)", + height: 30, + handler() { + Msg.toast( + "这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据", + { + level: "warning", + autoClose: false, + } + ); + }, + }, + }, + { + el: { + type: Button.xtype, + text: "错误提示Toast测试(error)", + height: 30, + handler() { + Msg.toast("错误提示Toast测试", { + level: "error", + }); + }, + }, + }, + { + el: { + type: Button.xtype, + text: "错误提示Toast测试(error), 此toast不会自动消失", + height: 30, + handler() { + Msg.toast("错误提示Toast测试", { + autoClose: false, + }); + }, + }, + } + ]; + createWidget({ + type: FloatLeftLayout.xtype, + element: this, + vgap: 200, + hgap: 20, + items, + }); + } +} + diff --git a/demo/js/base/tip/index.js b/packages/demo/src/demo/base/tip/index.js similarity index 100% rename from demo/js/base/tip/index.js rename to packages/demo/src/demo/base/tip/index.js diff --git a/packages/demo/src/demo/base/tree/demo.part_tree.js b/packages/demo/src/demo/base/tree/demo.part_tree.js new file mode 100644 index 000000000..deaffcb03 --- /dev/null +++ b/packages/demo/src/demo/base/tree/demo.part_tree.js @@ -0,0 +1,101 @@ + +import { VTapeLayout, Label, PartTree, shortcut, Widget, isNull, TreeView } from "@fui/core" + + + +@shortcut() +export class PartTreeDemo extends Widget { + static xtype = "demo.part_tree"; + + props = { baseCls: "demo-func" }; + + mounted() { + this.partTree.stroke({ + keyword: "1", + }); + } + + render() { + const self = this; + + return { + type: VTapeLayout.xtype, + items: [ + { + type: Label.xtype, + height: 50, + text: "先初始化一份数据,然后再异步获取数据的树", + }, + { + type: PartTree.xtype, + ref(_ref) { + self.partTree = _ref; + }, + paras: { + selectedValues: { 1: {}, 2: { 1: {} } }, + }, + itemsCreator(op, callback) { + if (op.type === TreeView.REQ_TYPE_INIT_DATA) { + callback({ + items: [ + { + id: "1", + text: 1, + isParent: true, + open: true, + }, + { + id: "11", + pId: "1", + text: 11, + isParent: true, + open: true, + }, + { + id: "111", + pId: "11", + text: 111, + isParent: true, + }, + { + id: "2", + text: 2, + }, + { + id: "3", + text: 3, + } + ], + hasNext: isNull(op.id), + }); + + return; + } + callback({ + items: [ + { + id: `${op.id || ""}1`, + pId: op.id, + text: 1, + isParent: true, + }, + { + id: `${op.id || ""}2`, + pId: op.id, + text: 2, + }, + { + id: `${op.id || ""}3`, + pId: op.id, + text: 3, + } + ], + hasNext: isNull(op.id), + }); + }, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/base/tree/demo.sync_tree.js b/packages/demo/src/demo/base/tree/demo.sync_tree.js new file mode 100644 index 000000000..f2534ab56 --- /dev/null +++ b/packages/demo/src/demo/base/tree/demo.sync_tree.js @@ -0,0 +1,122 @@ + +import { VTapeLayout, Label, Asynctree, shortcut, Widget, isNull } from "@fui/core" + + +@shortcut() +export class SyncTreeDemo extends Widget { + static xtype = "demo.sync_tree"; + + props = { baseCls: "demo-func" }; + + mounted() { + this.syncTree1.stroke({ + keyword: "1", + }); + this.syncTree2.stroke({ + keyword: "1", + }); + } + + render() { + const self = this; + + return { + type: VTapeLayout.xtype, + rowSize: [0.5, 0.5], + items: [ + { + type: VTapeLayout.xtype, + items: [ + { + type: Label.xtype, + height: 50, + text: "可以异步获取数据的树", + }, + { + type: Asynctree.xtype, + ref(_ref) { + self.syncTree1 = _ref; + }, + paras: { + selectedValues: { 1: {}, 2: { 1: {} } }, + }, + itemsCreator(op, callback) { + callback({ + items: [ + { + id: `${op.id || ""}1`, + pId: op.id, + text: `${op.id || ""}1`, + isParent: true, + iconCls: "close-h-font", + }, + { + id: `${op.id || ""}2`, + pId: op.id, + text: `${op.id || ""}2`, + iconCls: "search-font", + }, + { + id: `${op.id || ""}3`, + pId: op.id, + text: `${op.id || ""}3`, + iconCls: "date-font", + } + ], + hasNext: isNull(op.id), + }); + }, + } + ], + }, + { + type: VTapeLayout.xtype, + items: [ + { + type: Label.xtype, + height: 50, + text: "showIcon属性搭配节点iconCls,可以显示图标", + }, + { + type: Asynctree.xtype, + ref(_ref) { + self.syncTree2 = _ref; + }, + paras: { + selectedValues: { 1: {}, 2: { 1: {} } }, + }, + showIcon: true, + itemsCreator(op, callback) { + callback({ + items: [ + { + id: `${op.id || ""}1`, + pId: op.id, + text: `${op.id || ""}1`, + isParent: true, + iconCls: "close-h-font", + }, + { + id: `${op.id || ""}2`, + pId: op.id, + text: `${op.id || ""}2`, + iconCls: "search-font", + }, + { + id: `${op.id || ""}3`, + pId: op.id, + text: `${op.id || ""}3`, + iconCls: "date-font", + } + ], + hasNext: isNull(op.id), + }); + }, + } + ], + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/base/tree/demo.tree_view.js b/packages/demo/src/demo/base/tree/demo.tree_view.js new file mode 100644 index 000000000..01f87667e --- /dev/null +++ b/packages/demo/src/demo/base/tree/demo.tree_view.js @@ -0,0 +1,60 @@ + +import { TreeView, GridLayout, VTapeLayout, Label, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class FuncDemo extends Widget { + static xtype = "demo.tree_view"; + + props = { baseCls: "demo-func" }; + + _createDefaultTree() { + const tree = createWidget({ + type: TreeView.xtype, + }); + tree.initTree([ + { id: 1, pId: 0, text: "test1", open: true }, + { id: 11, pId: 1, text: "test11" }, + { id: 12, pId: 1, text: "test12" }, + { id: 111, pId: 11, text: "test111" }, + { id: 2, pId: 0, text: "test2", open: true }, + { id: 21, pId: 2, text: "test21" }, + { id: 22, pId: 2, text: "test22" } + ]); + + return tree; + } + + render() { + const self = this; + createWidget({ + type: GridLayout.xtype, + columns: 1, + rows: 1, + element: this, + items: [ + { + column: 0, + row: 0, + el: { + type: VTapeLayout.xtype, + items: [ + { + el: this._createDefaultTree(), + }, + { + el: { + type: Label.xtype, + text: "tree.initTree([{\"id\":1, \"pId\":0, \"text\":\"test1\", open:true},{\"id\":11, \"pId\":1, \"text\":\"test11\"},{\"id\":12, \"pId\":1, \"text\":\"test12\"},{\"id\":111, \"pId\":11, \"text\":\"test111\"}])", + whiteSpace: "normal", + }, + height: 50, + } + ], + }, + } + ], + }); + } +} + diff --git a/demo/js/base/tree/index.js b/packages/demo/src/demo/base/tree/index.js similarity index 100% rename from demo/js/base/tree/index.js rename to packages/demo/src/demo/base/tree/index.js diff --git a/packages/demo/src/demo/case/combo/demo.bubble_combo.js b/packages/demo/src/demo/case/combo/demo.bubble_combo.js new file mode 100644 index 000000000..b882ed4e8 --- /dev/null +++ b/packages/demo/src/demo/case/combo/demo.bubble_combo.js @@ -0,0 +1,161 @@ +import { + BubbleCombo, + Button, + ButtonGroup, + TextItem, + VerticalLayout, + TextBubblePopupBarView, + AbsoluteLayout, + shortcut, + Widget, + createWidget, + makeArray +} from "@fui/core"; + +@shortcut() +export class BubbleComboDemo extends Widget { + static xtype = "demo.bubble_combo"; + + props = { baseCls: "demo-func" }; + + render() { + let self = this, + count = 1; + const combo1 = createWidget({ + type: BubbleCombo.xtype, + trigger: "click,hover", + el: { + type: Button.xtype, + text: "测试", + height: 24 + }, + popup: { + el: { + type: ButtonGroup.xtype, + items: makeArray(100, { + type: TextItem.xtype, + height: 24, + text: "item" + }), + layouts: [ + { + type: VerticalLayout.xtype + } + ] + }, + maxHeight: 200 + } + }); + const combo2 = createWidget({ + type: BubbleCombo.xtype, + direction: "right", + el: { + type: Button.xtype, + text: "测试", + height: 24 + }, + popup: { + type: TextBubblePopupBarView.xtype, + text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字", + ref() { + self.popup = this; + } + }, + listeners: [ + { + eventName: BubbleCombo.EVENT_BEFORE_POPUPVIEW, + action() { + self.popup.populate( + count++ % 2 === 1 + ? "我的文字变少了" + : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字" + ); + } + } + ] + }); + + const combo3 = createWidget({ + type: BubbleCombo.xtype, + el: { + type: Button.xtype, + text: "测试", + height: 25 + }, + popup: { + type: TextBubblePopupBarView.xtype, + text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字", + ref() { + self.popup = this; + } + }, + listeners: [ + { + eventName: BubbleCombo.EVENT_BEFORE_POPUPVIEW, + action() { + self.popup.populate( + count++ % 2 === 1 + ? "我的文字变少了" + : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字" + ); + } + } + ] + }); + + const combo4 = createWidget({ + type: BubbleCombo.xtype, + el: { + type: Button.xtype, + text: "测试", + height: 25 + }, + popup: { + type: TextBubblePopupBarView.xtype, + text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字", + ref() { + self.popup = this; + } + }, + listeners: [ + { + eventName: BubbleCombo.EVENT_BEFORE_POPUPVIEW, + action() { + self.popup.populate( + count++ % 2 === 1 + ? "我的文字变少了" + : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字" + ); + } + } + ] + }); + + createWidget({ + type: AbsoluteLayout.xtype, + element: this, + items: [ + { + el: combo1, + left: 150, + top: 10 + }, + { + el: combo2, + left: 10, + bottom: 200 + }, + { + el: combo3, + right: 10, + bottom: 10 + }, + { + el: combo4, + right: 10, + top: 10 + } + ] + }); + } +} diff --git a/packages/demo/src/demo/case/combo/demo.editor_icon_check_combo.js b/packages/demo/src/demo/case/combo/demo.editor_icon_check_combo.js new file mode 100644 index 000000000..6faaa49c7 --- /dev/null +++ b/packages/demo/src/demo/case/combo/demo.editor_icon_check_combo.js @@ -0,0 +1,55 @@ + +import { HorizontalAutoLayout, EditorIconCheckCombo, Button, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class EditorIconCheckComboDemo extends Widget { + static xtype = "demo.editor_icon_check_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: EditorIconCheckCombo.xtype, + ref() { + self.combo = this; + }, + watermark: "默认值", + width: 200, + height: 24, + value: 2, + items: [ + { + // text: "MVC-1", + value: "1", + }, + { + // text: "MVC-2", + value: "2", + }, + { + // text: "MVC-3", + value: "3", + } + ], + }, + { + type: Button.xtype, + width: 90, + height: 25, + text: "setValue为空", + handler() { + self.combo.setValue(); + }, + } + ], + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/case/combo/demo.icon_combo.js b/packages/demo/src/demo/case/combo/demo.icon_combo.js new file mode 100644 index 000000000..271f7f326 --- /dev/null +++ b/packages/demo/src/demo/case/combo/demo.icon_combo.js @@ -0,0 +1,44 @@ + +import { HorizontalAutoLayout, IconCombo, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class IconComboDemo extends Widget { + static xtype = "demo.icon_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: IconCombo.xtype, + container: "body", + ref(_ref) { + self.refs = _ref; + }, + value: "第二项", + items: [ + { + value: "第一项", + iconCls: "close-font", + }, + { + value: "第二项", + iconCls: "search-font", + }, + { + value: "第三项", + iconCls: "copy-font", + } + ], + } + ], + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/case/combo/demo.icon_text_value_combo.js b/packages/demo/src/demo/case/combo/demo.icon_text_value_combo.js new file mode 100644 index 000000000..b631b7548 --- /dev/null +++ b/packages/demo/src/demo/case/combo/demo.icon_text_value_combo.js @@ -0,0 +1,43 @@ + +import { HorizontalAutoLayout, IconTextValueCombo, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class IconTextValueComboDemo extends Widget { + static xtype = "demo.icon_text_value_combo"; + + props = { baseCls: "" }; + + render() { + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: IconTextValueCombo.xtype, + text: "默认值", + // defaultIconCls: "next-page-h-font", + width: 300, + items: [ + { + text: "MVC-1", + iconCls: "close-font", + value: 1, + }, + { + text: "MVC-2", + iconCls: "date-font", + value: 2, + }, + { + text: "MVC-3", + iconCls: "search-close-h-font", + value: 3, + } + ], + } + ], + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/case/combo/demo.search_text_value_combo.js b/packages/demo/src/demo/case/combo/demo.search_text_value_combo.js new file mode 100644 index 000000000..a4558e64f --- /dev/null +++ b/packages/demo/src/demo/case/combo/demo.search_text_value_combo.js @@ -0,0 +1,132 @@ +import { CONSTANTS } from "@/config/constant"; +import { + HorizontalAutoLayout, + SearchTextValueCombo, + AllValueMultiTextValueCombo, + Button, + shortcut, + Widget, + Msg +} from "@fui/core"; + +@shortcut() +export class SearchTextValueComboDemo extends Widget { + static xtype = "demo.search_text_value_combo"; + + props = { baseCls: "" }; + + render() { + let combo, searchCombo; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: SearchTextValueCombo.xtype, + ref() { + combo = this; + }, + warningTitle: "111", + text: "默认值", + value: 14, + width: 300, + items: [ + { + text: "ABC-1", + iconCls: "date-font", + value: 1 + }, + { + text: "BCD-2", + iconCls: "search-font", + value: 2 + }, + { + text: "CDE-3", + iconCls: "pull-right-font", + value: 3 + }, + { + text: "DEF-3", + iconCls: "pull-right-font", + value: 4 + }, + { + text: "FEG-3", + iconCls: "pull-right-font", + value: 5 + }, + { + text: "FGH-3", + iconCls: "pull-right-font", + value: 6 + }, + { + text: "GHI-3", + iconCls: "pull-right-font", + value: 7 + }, + { + text: "HIJ-3", + iconCls: "pull-right-font", + value: 8 + }, + { + text: "IJK-3", + iconCls: "pull-right-font", + value: 9 + }, + { + text: "JKL-3", + iconCls: "pull-right-font", + value: 10 + } + ] + }, + { + type: AllValueMultiTextValueCombo.xtype, + items: CONSTANTS.ITEMS, + text: "提示文本", + width: 200, + value: { + type: 1, + value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"] + }, + ref() { + searchCombo = this; + }, + listeners: [ + { + eventName: + AllValueMultiTextValueCombo.EVENT_CONFIRM, + action() { + Msg.toast( + JSON.stringify(searchCombo.getValue()) + ); + } + } + ] + }, + { + type: Button.xtype, + text: "setValue(3)", + width: 90, + height: 25, + handler() { + combo.setValue(11); + } + }, + { + type: Button.xtype, + text: "getValue()", + width: 90, + height: 25, + handler() { + Msg.toast(JSON.stringify(searchCombo.getValue())); + } + } + ], + vgap: 20 + }; + } +} diff --git a/packages/demo/src/demo/case/combo/demo.text_value_combo.js b/packages/demo/src/demo/case/combo/demo.text_value_combo.js new file mode 100644 index 000000000..aff1e4efa --- /dev/null +++ b/packages/demo/src/demo/case/combo/demo.text_value_combo.js @@ -0,0 +1,276 @@ +import { + VerticalLayout, + TextValueCombo, + Button, + Label, + shortcut, + Selection, + Widget +} from "@fui/core"; +/** + * Created by Dailer on 2017/7/11. + */ +@shortcut() +export class TextValueComboDemo extends Widget { + static xtype = "demo.text_value_combo"; + + props = { + baseCls: "" + }; + + render() { + var combo1, combo2; + + var items = [ + { + text: "MVC-1", + iconCls: "date-font", + value: 1 + }, + { + text: "MVC-2", + iconCls: "search-font", + value: 2 + }, + { + text: "MVC-3", + iconCls: "pull-right-font", + value: 3 + } + ]; + + // 创建下拉框各种场景用例 + return { + type: VerticalLayout.xtype, + vgap: 20, + hgap: 20, + items: [ + this.createCombo("无初始值,带提示文字", { + type: TextValueCombo.xtype, + ref: (ref) => { + this.combo1 = ref; + }, + defaultText: "请选择", + width: 300, + items: items, + listeners: [ + { + eventName: TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + }), + this.createCombo("自动根据value匹配text", { + type: TextValueCombo.xtype, + ref: function () { + combo = this; + }, + defaultText: "请选择", + width: 300, + value: 1, + items: items, + listeners: [ + { + eventName: TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + }), + this.createCombo("无初始值,可以清空", { + type: TextValueCombo.xtype, + ref: function () { + combo = this; + }, + defaultText: "请选择", + width: 300, + items: items, + allowClear: true, + listeners: [ + { + eventName: TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + }), + this.createCombo("有初始值,可以清空", { + type: TextValueCombo.xtype, + ref: function () { + combo = this; + }, + defaultText: "请选择", + width: 300, + value: 1, + items: items, + allowClear: true, + listeners: [ + { + eventName: TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + }), + this.createCombo("有初始值,value不匹配,自动标红,指定标红文字", { + type: TextValueCombo.xtype, + ref: function () { + combo = this; + }, + width: 300, + text: "MVC-111", + value: 111, + items: items, + allowClear: true, + defaultText: "请选择", + warningTitle: "value值不合法", + listeners: [ + { + eventName: TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + }), + this.createCombo("无初始值,外部受控调用setValue", { + type: VerticalLayout.xtype, + items: [ + { + type: TextValueCombo.xtype, + ref: function () { + combo1 = this; + }, + width: 300, + items: items, + allowClear: true, + defaultText: "请选择", + listeners: [ + { + eventName: TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + }, + { + el: { + type: Button.xtype, + text: "setValue(1)", + handler: function () { + combo1.setValue(1); + } + }, + vgap: 10 + } + ] + }), + this.createCombo("无初始值,外部受控调用setStatus", { + type: VerticalLayout.xtype, + items: [ + { + type: TextValueCombo.xtype, + ref: function () { + combo2 = this; + }, + width: 300, + items: items, + allowClear: true, + defaultText: "请选择", + listeners: [ + { + eventName: TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + }, + { + el: { + type: Button.xtype, + text: "setStatus()", + handler: function () { + combo2.setStatus("error"); + } + }, + vgap: 10 + } + ] + }), + this.createCombo("支持复选", { + type: VerticalLayout.xtype, + items: [ + { + type: TextValueCombo.xtype, + width: 300, + items: items, + allowClear: true, + defaultText: "请选择", + chooseType: Selection.Multi, + value: [1], + // allowSelectAll: false, + listeners: [ + { + eventName: TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + } + ] + }), + this.createCombo("支持复选,不要全选功能", { + type: VerticalLayout.xtype, + items: [ + { + type: TextValueCombo.xtype, + width: 300, + items: items, + allowClear: true, + defaultText: "请选择", + chooseType: Selection.Multi, + value: [1], + allowSelectAll: false, + listeners: [ + { + eventName: TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + } + ] + }) + ] + }; + } + + createCombo(text, combo) { + return { + type: VerticalLayout.xtype, + items: [ + { + el: { + type: Label.xtype, + textAlign: "left", + text + }, + bgap: 10 + }, + { + el: combo, + bgap: 10 + } + ] + }; + } +} diff --git a/packages/demo/src/demo/case/combo/demo.text_value_down_list_combo.js b/packages/demo/src/demo/case/combo/demo.text_value_down_list_combo.js new file mode 100644 index 000000000..0cac0148e --- /dev/null +++ b/packages/demo/src/demo/case/combo/demo.text_value_down_list_combo.js @@ -0,0 +1,86 @@ + +import { HorizontalAutoLayout, TextValueDownListCombo, Button, shortcut, Widget, Msg } from "@fui/core" + + + +@shortcut() +export class TextValueDownListComboDemo extends Widget { + static xtype = "demo.text_value_down_list_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: TextValueDownListCombo.xtype, + width: 300, + ref(_ref) { + self.refs = _ref; + }, + text: "默认值", + value: 11, + items: [ + [ + { + text: "属于", + value: 1, + cls: "dot-e-font", + }, + { + text: "不属于", + value: 2, + cls: "dot-e-font", + } + ], + [ + { + el: { + text: "大于", + value: 3, + iconCls1: "dot-e-font", + }, + value: 3, + children: [ + { + text: "固定值", + value: 4, + cls: "dot-e-font", + }, + { + text: "平均值", + value: 5, + cls: "dot-e-font", + } + ], + } + ] + ], + }, + { + type: Button.xtype, + width: 90, + height: 25, + text: "setValue", + handler() { + self.refs.setValue(2); + }, + }, + { + type: Button.xtype, + width: 90, + height: 25, + text: "getValue", + handler() { + Msg.alert("", JSON.stringify(self.refs.getValue())); + }, + } + ], + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/case/combo/demo.text_vlaue_check_combo.js b/packages/demo/src/demo/case/combo/demo.text_vlaue_check_combo.js new file mode 100644 index 000000000..92d340976 --- /dev/null +++ b/packages/demo/src/demo/case/combo/demo.text_vlaue_check_combo.js @@ -0,0 +1,54 @@ + +import { Msg, HorizontalAutoLayout, TextValueCheckCombo, Button, shortcut, Widget } from "@fui/core" + + + +@shortcut() +export class TextValueCheckComboDemo extends Widget { + static xtype = "demo.text_value_check_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: TextValueCheckCombo.xtype, + ref () { + self.combo = this; + }, + text: "默认值", + // value: 1, + width: 300, + items: [ + { + text: "MVC-1", + value: 1, + }, + { + text: "MVC-2", + value: 2, + }, + { + text: "MVC-3", + value: 3, + } + ], + }, + { + type: Button.xtype, + width: 90, + height: 25, + handler () { + Msg.alert("", JSON.stringify(self.combo.getValue())); + }, + } + ], + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/case/combo/index.js b/packages/demo/src/demo/case/combo/index.js new file mode 100644 index 000000000..560d7ddff --- /dev/null +++ b/packages/demo/src/demo/case/combo/index.js @@ -0,0 +1,8 @@ +export * from "./demo.bubble_combo"; +export * from "./demo.editor_icon_check_combo"; +export * from "./demo.icon_combo"; +export * from "./demo.icon_text_value_combo"; +export * from "./demo.search_text_value_combo"; +export * from "./demo.text_value_combo"; +export * from "./demo.text_value_down_list_combo"; +export * from "./demo.text_vlaue_check_combo"; \ No newline at end of file diff --git a/packages/demo/src/demo/case/demo.calendar.js b/packages/demo/src/demo/case/demo.calendar.js new file mode 100644 index 000000000..402aeee9a --- /dev/null +++ b/packages/demo/src/demo/case/demo.calendar.js @@ -0,0 +1,38 @@ + +import { Calendar, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class CalendarDemo extends Widget { + static xtype = "demo.calendar"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + const date = new Date(); + + return { + type: Calendar.xtype, + ref() { + self.calendar = this; + }, + logic: { + dynamic: false, + }, + year: date.getFullYear(), + month: date.getMonth(), + day: date.getDate(), + }; + } + + mounted() { + const date = new Date(); + this.calendar.setValue({ + year: date.getFullYear(), + month: date.getMonth(), + day: date.getDate(), + }); + } +} + diff --git a/packages/demo/src/demo/case/demo.click.effect.js b/packages/demo/src/demo/case/demo.click.effect.js new file mode 100644 index 000000000..a475f3829 --- /dev/null +++ b/packages/demo/src/demo/case/demo.click.effect.js @@ -0,0 +1,56 @@ + +import { VerticalLayout, IconTextItem, shortcut, Widget, createItems } from "@fui/core" + + +@shortcut() +export class ClickItemEffectDemo extends Widget { + static xtype = "demo.click_item_effect"; + + props = { baseCls: "demo-func" }; + + render() { + return { + type: VerticalLayout.xtype, + items: createItems( + [ + { + text: "bi-list-item", + cls: "bi-list-item close-font", + }, + { + text: "bi-list-item-simple", + cls: "bi-list-item-simple close-font", + }, + { + text: "bi-list-item-effect", + cls: "bi-list-item-effect close-font", + }, + { + text: "bi-list-item-active", + cls: "bi-list-item-active close-font", + }, + { + text: "bi-list-item-active2", + cls: "bi-list-item-active2 close-font", + }, + { + text: "bi-list-item-select", + cls: "bi-list-item-select close-font", + }, + { + text: "bi-list-item-select2", + cls: "bi-list-item-select2 close-font", + } + ], + { + type: IconTextItem.xtype, + logic: { + dynamic: true, + }, + } + ), + vgap: 10, + }; + } +} + diff --git a/packages/demo/src/demo/case/demo.color_chooser.js b/packages/demo/src/demo/case/demo.color_chooser.js new file mode 100644 index 000000000..5489839a0 --- /dev/null +++ b/packages/demo/src/demo/case/demo.color_chooser.js @@ -0,0 +1,49 @@ + +import { AbsoluteLayout, ColorChooser, SimpleColorChooser, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class ColorChooserDemo extends Widget { + static xtype = "demo.color_chooser"; + + props = { baseCls: "demo-func" }; + + render() { + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: ColorChooser.xtype, + recommendColorsGetter() { + return ["#ffffff", "#9d775f", "#dd4b4b", "#ef8b07", "#fcc800"]; + }, + width: 24, + height: 24, + }, + left: 100, + top: 250, + }, + { + el: { + type: SimpleColorChooser.xtype, + width: 30, + height: 24, + }, + left: 400, + top: 250, + }, + { + el: { + type: ColorChooser.xtype, + width: 230, + height: 24, + }, + left: 100, + top: 350, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/case/demo.color_chooser_popup.js b/packages/demo/src/demo/case/demo.color_chooser_popup.js new file mode 100644 index 000000000..1c641a97d --- /dev/null +++ b/packages/demo/src/demo/case/demo.color_chooser_popup.js @@ -0,0 +1,35 @@ + +import { AbsoluteLayout, ColorChooserPopup, SimpleColorChooserPopup, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class ColorChooserPopupDemo extends Widget { + static xtype = "demo.color_chooser_popup"; + + props = { baseCls: "demo-func" }; + + render() { + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: ColorChooserPopup.xtype, + cls: "bi-card", + }, + left: 100, + top: 250, + }, + { + el: { + type: SimpleColorChooserPopup.xtype, + cls: "bi-card", + }, + left: 400, + top: 250, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/case/demo.segment.js b/packages/demo/src/demo/case/demo.segment.js new file mode 100644 index 000000000..a8e09e948 --- /dev/null +++ b/packages/demo/src/demo/case/demo.segment.js @@ -0,0 +1,39 @@ + +import { HorizontalLayout, Segment, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class SegmentDemo extends Widget { + static xtype = "demo.segment"; + + props = { baseCls: "demo-func" }; + + render() { + createWidget({ + type: HorizontalLayout.xtype, + element: this, + vgap: 20, + hgap: 30, + items: [ + { + type: Segment.xtype, + items: [ + { + text: "较长的选项1", + value: 1, + }, + { + text: "选项2", + value: 2, + }, + { + text: "选项3", + value: 3, + } + ], + } + ], + }); + } +} + diff --git a/packages/demo/src/demo/case/editor/demo.clear_editor.js b/packages/demo/src/demo/case/editor/demo.clear_editor.js new file mode 100644 index 000000000..7c78a0ffa --- /dev/null +++ b/packages/demo/src/demo/case/editor/demo.clear_editor.js @@ -0,0 +1,27 @@ + +import { HorizontalAutoLayout, ClearEditor, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class ClearEditorDemo extends Widget { + static xtype = "demo.clear_editor"; + + props = { baseCls: "" }; + + render() { + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: ClearEditor.xtype, + cls: "bi-border", + width: 300, + watermark: "这个是带清除按钮的", + value: 123, + } + ], + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/case/editor/demo.shelter_editor.js b/packages/demo/src/demo/case/editor/demo.shelter_editor.js new file mode 100644 index 000000000..6c0cc3802 --- /dev/null +++ b/packages/demo/src/demo/case/editor/demo.shelter_editor.js @@ -0,0 +1,51 @@ + +import { ShelterEditor, VerticalLayout, AbsoluteLayout, Button, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class ShelterEditorDemo extends Widget { + static xtype = "demo.shelter_editor"; + + props = { baseCls: "" }; + + render() { + const editor = createWidget({ + type: ShelterEditor.xtype, + cls: "bi-border", + validationChecker(v) { + return v != "a"; + }, + watermark: "可以设置标记的输入框", + value: "这是一个遮罩", + keyword: "z", + }); + createWidget({ + type: VerticalLayout.xtype, + element: this, + hgap: 30, + vgap: 20, + bgap: 50, + items: [editor], + }); + createWidget({ + type: AbsoluteLayout.xtype, + element: this, + items: [ + { + el: { + type: Button.xtype, + text: "focus", + height: 25, + handler() { + editor.focus(); + }, + }, + right: 10, + left: 10, + bottom: 10, + } + ], + }); + } +} + diff --git a/packages/demo/src/demo/case/editor/demo.sign_editor.js b/packages/demo/src/demo/case/editor/demo.sign_editor.js new file mode 100644 index 000000000..8a7ffb7cf --- /dev/null +++ b/packages/demo/src/demo/case/editor/demo.sign_editor.js @@ -0,0 +1,31 @@ + +import { SignEditor, VerticalLayout, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class SignEditorDemo extends Widget { + static xtype = "demo.sign_editor"; + + props = { baseCls: "" }; + + render() { + const editor = createWidget({ + type: SignEditor.xtype, + cls: "bi-border bi-focus-shadow", + validationChecker(v) { + return v != "abc"; + }, + watermark: "可以设置标记的输入框", + text: "这是一个标记,点击它即可进行输入", + }); + editor.setValue(2); + createWidget({ + type: VerticalLayout.xtype, + element: this, + hgap: 30, + vgap: 20, + items: [editor], + }); + } +} + diff --git a/packages/demo/src/demo/case/editor/demo.simple_state_editor.js b/packages/demo/src/demo/case/editor/demo.simple_state_editor.js new file mode 100644 index 000000000..9ddface18 --- /dev/null +++ b/packages/demo/src/demo/case/editor/demo.simple_state_editor.js @@ -0,0 +1,37 @@ + +import { HorizontalAdaptLayout, SimpleStateEditor, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class SimpleStateEditorDemo extends Widget { + static xtype = "demo.simple_state_editor"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAdaptLayout.xtype, + items: [ + { + type: SimpleStateEditor.xtype, + ref() { + self.editor = this; + }, + cls: "bi-border", + width: 300, + } + ], + vgap: 20, + }; + } + + mounted() { + const self = this; + setTimeout(() => { + self.editor.setState(["*", "*"]); + }, 1000); + } +} + diff --git a/packages/demo/src/demo/case/editor/demo.state_editor.js b/packages/demo/src/demo/case/editor/demo.state_editor.js new file mode 100644 index 000000000..98da9f000 --- /dev/null +++ b/packages/demo/src/demo/case/editor/demo.state_editor.js @@ -0,0 +1,37 @@ + +import { HorizontalAdaptLayout, StateEditor, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class StateEditorDemo extends Widget { + static xtype = "demo.state_editor"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAdaptLayout.xtype, + items: [ + { + type: StateEditor.xtype, + ref() { + self.editor = this; + }, + cls: "bi-border", + width: 300, + } + ], + vgap: 20, + }; + } + + mounted() { + const self = this; + setTimeout(() => { + self.editor.setState(["*", "*"]); + }, 1000); + } +} + diff --git a/packages/demo/src/demo/case/editor/index.js b/packages/demo/src/demo/case/editor/index.js new file mode 100644 index 000000000..684975dd1 --- /dev/null +++ b/packages/demo/src/demo/case/editor/index.js @@ -0,0 +1,5 @@ +export * from "./demo.clear_editor"; +export * from "./demo.shelter_editor"; +export * from "./demo.sign_editor"; +export * from "./demo.simple_state_editor"; +export * from "./demo.state_editor"; \ No newline at end of file diff --git a/packages/demo/src/demo/case/index.js b/packages/demo/src/demo/case/index.js new file mode 100644 index 000000000..5fbb4121f --- /dev/null +++ b/packages/demo/src/demo/case/index.js @@ -0,0 +1,19 @@ +export const meta = { + title: "实例控件 case", + rank: 7 +}; + +export * as combo from "./combo"; +export * as editor from "./editor"; +export * as item from "./item"; +export * as list from "./list"; +export * as pager from "./pager"; +export * as pane from "./pane"; +export * as tree from "./tree"; +export * as triggers from "./triggers"; + +export * from "./demo.calendar"; +export * from "./demo.click.effect"; +export * from "./demo.color_chooser"; +export * from "./demo.color_chooser_popup"; +export * from "./demo.segment"; diff --git a/packages/demo/src/demo/case/item/demo.multi_select_item.js b/packages/demo/src/demo/case/item/demo.multi_select_item.js new file mode 100644 index 000000000..575bcd55b --- /dev/null +++ b/packages/demo/src/demo/case/item/demo.multi_select_item.js @@ -0,0 +1,29 @@ + +import { VerticalLayout, Label, MultiSelectItem, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class MultiSelectItemDemo extends Widget { + static xtype = "demo.multi_select_item"; + + props = { baseCls: "demo-func" }; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + height: 30, + text: "复选item", + }, + { + type: MultiSelectItem.xtype, + text: "复选项", + } + ], + hgap: 300, + }; + } +} + diff --git a/packages/demo/src/demo/case/item/demo.single_select_item.js b/packages/demo/src/demo/case/item/demo.single_select_item.js new file mode 100644 index 000000000..1c9e51748 --- /dev/null +++ b/packages/demo/src/demo/case/item/demo.single_select_item.js @@ -0,0 +1,27 @@ + +import { VerticalLayout, Label, SingleSelectItem, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class SingleSelectItemDemo extends Widget { + static xtype = "demo.single_select_item"; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + height: 30, + text: "单选item", + }, + { + type: SingleSelectItem.xtype, + text: "单选项", + } + ], + hgap: 300, + }; + } +} + diff --git a/packages/demo/src/demo/case/item/demo.single_select_radio_item.js b/packages/demo/src/demo/case/item/demo.single_select_radio_item.js new file mode 100644 index 000000000..22f3ce14e --- /dev/null +++ b/packages/demo/src/demo/case/item/demo.single_select_radio_item.js @@ -0,0 +1,30 @@ +import { + VerticalLayout, + Label, + SingleSelectRadioItem, + shortcut, + Widget +} from "@fui/core"; + +@shortcut() +export class SingleSelectRadioItemDemo extends Widget { + static xtype = "demo.single_select_radio_item"; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + height: 30, + text: "单选item" + }, + { + type: SingleSelectRadioItem.xtype, + text: "单选项" + } + ], + hgap: 300 + }; + } +} diff --git a/packages/demo/src/demo/case/item/index.js b/packages/demo/src/demo/case/item/index.js new file mode 100644 index 000000000..a5da7036c --- /dev/null +++ b/packages/demo/src/demo/case/item/index.js @@ -0,0 +1,3 @@ +export * from "./demo.multi_select_item"; +export * from "./demo.single_select_item"; +export * from "./demo.single_select_radio_item"; \ No newline at end of file diff --git a/packages/demo/src/demo/case/list/demo.lazy_loader.js b/packages/demo/src/demo/case/list/demo.lazy_loader.js new file mode 100644 index 000000000..b99ee13ac --- /dev/null +++ b/packages/demo/src/demo/case/list/demo.lazy_loader.js @@ -0,0 +1,37 @@ +import { CONSTANTS } from "@/config/constant"; +import { + LazyLoader, + FloatLeftLayout, + Button, + shortcut, + Widget, + createWidget, + createItems, + deepClone +} from "@fui/core"; + +@shortcut() +export class LazyLoaderDemo extends Widget { + static xtype = "demo.lazy_loader"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + createWidget({ + type: LazyLoader.xtype, + element: this, + el: { + layouts: [ + { + type: FloatLeftLayout.xtype, + hgap: 5 + } + ] + }, + items: createItems(deepClone(CONSTANTS.ITEMS), { + type: Button.xtype + }) + }); + } +} diff --git a/packages/demo/src/demo/case/list/demo.select_list.js b/packages/demo/src/demo/case/list/demo.select_list.js new file mode 100644 index 000000000..5e115d0c9 --- /dev/null +++ b/packages/demo/src/demo/case/list/demo.select_list.js @@ -0,0 +1,39 @@ +import { CONSTANTS } from "@/config/constant"; +import { + SelectList, + MultiSelectBar, + MultiSelectItem, + shortcut, + Widget, + createWidget, + createItems, + deepClone, + Selection +} from "@fui/core"; + +@shortcut() +export class SelectListDemo extends Widget { + static xtype = "demo.select_list"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + createWidget({ + type: SelectList.xtype, + toolbar: { + type: MultiSelectBar.xtype, + iconWrapperWidth: 26 + }, + element: this, + el: { + el: { + chooseType: Selection.Multi + } + }, + items: createItems(deepClone(CONSTANTS.SIMPLE_ITEMS), { + type: MultiSelectItem.xtype + }) + }); + } +} diff --git a/packages/demo/src/demo/case/list/index.js b/packages/demo/src/demo/case/list/index.js new file mode 100644 index 000000000..4e008070c --- /dev/null +++ b/packages/demo/src/demo/case/list/index.js @@ -0,0 +1,2 @@ +export * from "./demo.lazy_loader"; +export * from "./demo.select_list"; \ No newline at end of file diff --git a/packages/demo/src/demo/case/pager/demo.all_count_pager.js b/packages/demo/src/demo/case/pager/demo.all_count_pager.js new file mode 100644 index 000000000..25b8babc3 --- /dev/null +++ b/packages/demo/src/demo/case/pager/demo.all_count_pager.js @@ -0,0 +1,37 @@ +import { + VerticalLayout, + Label, + AllCountPager, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class AllCountPagerDemo extends Widget { + static xtype = "demo.all_count_pager"; + + props = { baseCls: "demo-func" }; + + render() { + createWidget({ + type: VerticalLayout.xtype, + hgap: 200, + vgap: 50, + element: this, + items: [ + { + type: Label.xtype, + height: 30, + text: " (测试条件:总页数为3)" + }, + { + type: AllCountPager.xtype, + pages: 3, + curr: 1, + count: 1000 + } + ] + }); + } +} diff --git a/packages/demo/src/demo/case/pager/demo.direction_pager.js b/packages/demo/src/demo/case/pager/demo.direction_pager.js new file mode 100644 index 000000000..dca9914bf --- /dev/null +++ b/packages/demo/src/demo/case/pager/demo.direction_pager.js @@ -0,0 +1,57 @@ + +import { VerticalLayout, DirectionPager, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class DirectionPagerDemo extends Widget { + static xtype = "demo.direction_pager"; + + props = { baseCls: "demo-func" }; + + mounted() { + this.pager.populate(); + } + + render() { + const self = this; + createWidget({ + type: VerticalLayout.xtype, + hgap: 200, + vgap: 50, + element: this, + items: [ + { + type: DirectionPager.xtype, + ref(_ref) { + self.pager = _ref; + }, + horizontal: { + pages: false, // 总页数 + curr: 1, // 初始化当前页, pages为数字时可用 + + hasPrev(v) { + return v > 1; + }, + hasNext() { + return true; + }, + firstPage: 1, + }, + vertical: { + pages: false, // 总页数 + curr: 1, // 初始化当前页, pages为数字时可用 + + hasPrev(v) { + return v > 1; + }, + hasNext() { + return true; + }, + firstPage: 1, + }, + } + ], + }); + } +} + diff --git a/packages/demo/src/demo/case/pager/index.js b/packages/demo/src/demo/case/pager/index.js new file mode 100644 index 000000000..c4061c8c6 --- /dev/null +++ b/packages/demo/src/demo/case/pager/index.js @@ -0,0 +1,2 @@ +export * from "./demo.all_count_pager"; +export * from "./demo.direction_pager"; \ No newline at end of file diff --git a/packages/demo/src/demo/case/pane/demo.list_pane.js b/packages/demo/src/demo/case/pane/demo.list_pane.js new file mode 100644 index 000000000..b68799cde --- /dev/null +++ b/packages/demo/src/demo/case/pane/demo.list_pane.js @@ -0,0 +1,51 @@ +import { CONSTANTS } from "@/config/constant"; +import { + ListPane, + MultiSelectItem, + ButtonGroup, + VerticalLayout, + shortcut, + Widget, + createItems, + deepClone +} from "@fui/core"; + +@shortcut() +export class ListPaneDemo extends Widget { + static xtype = "demo.list_pane"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: ListPane.xtype, + ref() { + self.pane = this; + }, + itemsCreator(op, callback) { + setTimeout(() => { + callback( + createItems(deepClone(CONSTANTS.ITEMS), { + type: MultiSelectItem.xtype, + height: 25 + }) + ); + }, 2000); + }, + el: { + type: ButtonGroup.xtype, + layouts: [ + { + type: VerticalLayout.xtype + } + ] + } + }; + } + + mounted() { + this.pane.populate(); + } +} diff --git a/packages/demo/src/demo/case/pane/demo.multi_popup_view.js b/packages/demo/src/demo/case/pane/demo.multi_popup_view.js new file mode 100644 index 000000000..8a4263d67 --- /dev/null +++ b/packages/demo/src/demo/case/pane/demo.multi_popup_view.js @@ -0,0 +1,59 @@ +import { CONSTANTS } from "@/config/constant"; +import { + AbsoluteLayout, + Combo, + TextButton, + MultiPopupView, + ButtonGroup, + VerticalLayout, + MultiSelectItem, + shortcut, + Widget, + createItems, + deepClone +} from "@fui/core"; + +@shortcut() +export class MultiPopupViewDemo extends Widget { + static xtype = "demo.multi_popup_view"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: Combo.xtype, + width: 200, + height: 30, + el: { + type: TextButton.xtype, + text: "点击", + cls: "bi-border", + height: 30 + }, + popup: { + type: MultiPopupView.xtype, + el: { + type: ButtonGroup.xtype, + layouts: [ + { + type: VerticalLayout.xtype + } + ], + items: createItems(deepClone(CONSTANTS.ITEMS), { + type: MultiSelectItem.xtype, + height: 25 + }) + } + } + } + } + ] + }; + } +} diff --git a/packages/demo/src/demo/case/pane/demo.panel.js b/packages/demo/src/demo/case/pane/demo.panel.js new file mode 100644 index 000000000..fc3ead71c --- /dev/null +++ b/packages/demo/src/demo/case/pane/demo.panel.js @@ -0,0 +1,46 @@ +import { CONSTANTS } from "@/config/constant"; +import { + Panel, + Button, + ButtonGroup, + VerticalLayout, + MultiSelectItem, + shortcut, + Widget, + createItems, + deepClone +} from "@fui/core"; + +@shortcut() +export class PanelDemo extends Widget { + static xtype = "demo.panel"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: Panel.xtype, + title: "title", + titleButtons: [ + { + type: Button.xtype, + text: "操作" + } + ], + el: { + type: ButtonGroup.xtype, + layouts: [ + { + type: VerticalLayout.xtype + } + ], + items: createItems(deepClone(CONSTANTS.ITEMS), { + type: MultiSelectItem.xtype, + height: 25 + }) + } + }; + } +} diff --git a/packages/demo/src/demo/case/pane/demo.popup_panel.js b/packages/demo/src/demo/case/pane/demo.popup_panel.js new file mode 100644 index 000000000..b4a437a35 --- /dev/null +++ b/packages/demo/src/demo/case/pane/demo.popup_panel.js @@ -0,0 +1,59 @@ +import { CONSTANTS } from "@/config/constant"; +import { + AbsoluteLayout, + Combo, + TextButton, + PopupPanel, + ButtonGroup, + VerticalLayout, + MultiSelectItem, + shortcut, + Widget, + createItems, + deepClone +} from "@fui/core"; + +@shortcut() +export class PopupPanelDemo extends Widget { + static xtype = "demo.popup_panel"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: Combo.xtype, + width: 200, + height: 30, + el: { + type: TextButton.xtype, + text: "点击", + cls: "bi-border", + height: 30 + }, + popup: { + type: PopupPanel.xtype, + el: { + type: ButtonGroup.xtype, + layouts: [ + { + type: VerticalLayout.xtype + } + ], + items: createItems(deepClone(CONSTANTS.ITEMS), { + type: MultiSelectItem.xtype, + height: 25 + }) + } + } + } + } + ] + }; + } +} diff --git a/packages/demo/src/demo/case/pane/index.js b/packages/demo/src/demo/case/pane/index.js new file mode 100644 index 000000000..6fd6c64e2 --- /dev/null +++ b/packages/demo/src/demo/case/pane/index.js @@ -0,0 +1,4 @@ +export * from "./demo.list_pane"; +export * from "./demo.multi_popup_view"; +export * from "./demo.panel"; +export * from "./demo.popup_panel"; \ No newline at end of file diff --git a/packages/demo/src/demo/case/tree/demo.display_tree.js b/packages/demo/src/demo/case/tree/demo.display_tree.js new file mode 100644 index 000000000..35584c4de --- /dev/null +++ b/packages/demo/src/demo/case/tree/demo.display_tree.js @@ -0,0 +1,56 @@ + +import { DisplayTree, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class DisplayTreeDemo extends Widget { + static xtype = "demo.display_tree"; + + props = { baseCls: "demo-func" }; + + render() { + const tree = createWidget({ + type: DisplayTree.xtype, + element: this, + }); + + tree.initTree([ + { + id: 1, + text: "第一项", + open: true, + }, + { + id: 2, + text: "第二项", + }, + { + id: 11, + pId: 1, + text: "子项1(共2个)", + open: true, + }, + { + id: 111, + pId: 11, + text: "子子项1", + }, + { + id: 112, + pId: 11, + text: "子子项2", + }, + { + id: 12, + pId: 1, + text: "子项2", + }, + { + id: 13, + pId: 1, + text: "子项3", + } + ]); + } +} + diff --git a/packages/demo/src/demo/case/tree/demo.level_tree.js b/packages/demo/src/demo/case/tree/demo.level_tree.js new file mode 100644 index 000000000..6a432c673 --- /dev/null +++ b/packages/demo/src/demo/case/tree/demo.level_tree.js @@ -0,0 +1,114 @@ + +import { createWidget, Msg, LevelTree, VTapeLayout, Button, shortcut, Widget } from "@fui/core" + + + +@shortcut() +export class LevelTreeDemo extends Widget { + static xtype = "demo.level_tree"; + + props = { baseCls: "demo-func" }; + + render() { + const tree = createWidget({ + type: LevelTree.xtype, + chooseType: 0, + items: [ + { + id: 1, + text: "第一项", + value: 1, + isParent: true, + }, + { + id: 2, + text: "第二项", + value: 2, + isParent: true, + }, + { + id: 3, + text: "第三项", + value: 1, + isParent: true, + open: true, + }, + { + id: 4, + text: "第四项", + value: 1, + }, + { + id: 11, + pId: 1, + text: "子项1", + value: 11, + }, + { + id: 12, + pId: 1, + text: "子项2", + value: 12, + }, + { + id: 13, + pId: 1, + text: "子项3", + value: 13, + }, + { + id: 111, + pId: 11, + text: "子项1-1", + value: 111, + }, + { + id: 21, + pId: 2, + text: "子项1", + value: 21, + }, + { + id: 31, + pId: 3, + text: "子项1", + value: 31, + }, + { + id: 32, + pId: 3, + text: "子项2", + value: 32, + }, + { + id: 33, + pId: 3, + text: "子项3", + value: 33, + } + ], + }); + + createWidget({ + type: VTapeLayout.xtype, + element: this, + items: [ + { + el: tree, + }, + { + height: 30, + el: { + type: Button.xtype, + height: 30, + text: "getValue", + handler() { + Msg.alert("", tree.getValue()); + }, + }, + } + ], + }); + } +} + diff --git a/packages/demo/src/demo/case/tree/demo.simple_tree.js b/packages/demo/src/demo/case/tree/demo.simple_tree.js new file mode 100644 index 000000000..dce211fd4 --- /dev/null +++ b/packages/demo/src/demo/case/tree/demo.simple_tree.js @@ -0,0 +1,154 @@ +import { + SimpleTreeView, + VTapeLayout, + Button, + shortcut, + Widget, + createWidget, + Msg +} from "@fui/core"; + +@shortcut() +export class SimpleTreeDemo extends Widget { + static xtype = "demo.simple_tree"; + + props = { baseCls: "demo-func" }; + + render() { + // value值一定要是字符串 + const tree = createWidget({ + type: SimpleTreeView.xtype, + items: [ + { + id: 1, + text: "第一项", + value: "1" + }, + { + id: 2, + text: "第二项", + value: "2" + }, + { + id: 3, + text: "第三项", + value: "3", + open: true + }, + { + id: 11, + pId: 1, + text: "子项1", + value: "11" + }, + { + id: 12, + pId: 1, + text: "子项2", + value: "12" + }, + { + id: 13, + pId: 1, + text: "子项3", + value: "13" + }, + { + id: 31, + pId: 3, + text: "子项1", + value: "31" + }, + { + id: 32, + pId: 3, + text: "子项2", + value: "32" + }, + { + id: 33, + pId: 3, + text: "子项3", + value: "33" + } + ], + value: ["31", "32", "33"] + }); + + // tree.populate([{ + // id: 1, + // text: "第一项", + // value: "1" + // }, { + // id: 2, + // text: "第二项", + // value: "2" + // }, { + // id: 3, + // text: "第三项", + // value: "3", + // open: true + // }, { + // id: 11, + // pId: 1, + // text: "子项1", + // value: "11" + // }, { + // id: 12, + // pId: 1, + // text: "子项2", + // value: "12" + // }, { + // id: 13, + // pId: 1, + // text: "子项3", + // value: "13" + // }, { + // id: 31, + // pId: 3, + // text: "子项1", + // value: "31" + // }, { + // id: 32, + // pId: 3, + // text: "子项2", + // value: "32" + // }, { + // id: 33, + // pId: 3, + // text: "子项3", + // value: "33" + // }], "z"); + createWidget({ + type: VTapeLayout.xtype, + element: this, + items: [ + { + el: tree + }, + { + height: 30, + el: { + type: Button.xtype, + height: 30, + text: "setValue(['31', '32', '33'])", + handler() { + tree.setValue(["31", "32", "33"]); + } + } + }, + { + height: 30, + el: { + type: Button.xtype, + height: 30, + text: "getValue", + handler() { + Msg.alert("", JSON.stringify(tree.getValue())); + } + } + } + ] + }); + } +} diff --git a/packages/demo/src/demo/case/tree/index.js b/packages/demo/src/demo/case/tree/index.js new file mode 100644 index 000000000..8180d07ab --- /dev/null +++ b/packages/demo/src/demo/case/tree/index.js @@ -0,0 +1,3 @@ +export * from "./demo.display_tree"; +export * from "./demo.level_tree"; +export * from "./demo.simple_tree"; \ No newline at end of file diff --git a/packages/demo/src/demo/case/triggers/demo.editor_trigger.js b/packages/demo/src/demo/case/triggers/demo.editor_trigger.js new file mode 100644 index 000000000..f492e7dc6 --- /dev/null +++ b/packages/demo/src/demo/case/triggers/demo.editor_trigger.js @@ -0,0 +1,36 @@ +import { + VerticalLayout, + Label, + EditorTrigger, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class EditorTriggerDemo extends Widget { + static xtype = "demo.editor_trigger"; + + props = { baseCls: "demo-func" }; + + render() { + createWidget({ + type: VerticalLayout.xtype, + element: this, + items: [ + { + type: Label.xtype, + text: "输入框加图标的trigger" + }, + { + type: EditorTrigger.xtype, + watermark: "这是水印", + width: 200, + height: 24 + } + ], + hgap: 20, + vgap: 20 + }); + } +} diff --git a/packages/demo/src/demo/case/triggers/demo.icon_trigger.js b/packages/demo/src/demo/case/triggers/demo.icon_trigger.js new file mode 100644 index 000000000..867820dee --- /dev/null +++ b/packages/demo/src/demo/case/triggers/demo.icon_trigger.js @@ -0,0 +1,35 @@ +import { + VerticalLayout, + Label, + IconTrigger, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class IconTriggerDemo extends Widget { + static xtype = "demo.icon_trigger"; + + props = { baseCls: "demo-func" }; + + render() { + createWidget({ + type: VerticalLayout.xtype, + element: this, + items: [ + { + type: Label.xtype, + text: "只有一个图标的trigger" + }, + { + type: IconTrigger.xtype, + width: 30, + height: 24 + } + ], + hgap: 20, + vgap: 20 + }); + } +} diff --git a/packages/demo/src/demo/case/triggers/demo.select_text_trigger.js b/packages/demo/src/demo/case/triggers/demo.select_text_trigger.js new file mode 100644 index 000000000..dc7fd502b --- /dev/null +++ b/packages/demo/src/demo/case/triggers/demo.select_text_trigger.js @@ -0,0 +1,36 @@ +import { + VerticalLayout, + Label, + SelectTextTrigger, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class SelectTextTriggerDemo extends Widget { + static xtype = "demo.select_text_trigger"; + + props = { baseCls: "demo-func" }; + + render() { + createWidget({ + type: VerticalLayout.xtype, + element: this, + items: [ + { + type: Label.xtype, + text: "可被选择的trigger" + }, + { + type: SelectTextTrigger.xtype, + text: "这是一个简单的trigger", + width: 200, + height: 24 + } + ], + hgap: 20, + vgap: 20 + }); + } +} diff --git a/packages/demo/src/demo/case/triggers/demo.text_trigger.js b/packages/demo/src/demo/case/triggers/demo.text_trigger.js new file mode 100644 index 000000000..c9ec4447d --- /dev/null +++ b/packages/demo/src/demo/case/triggers/demo.text_trigger.js @@ -0,0 +1,36 @@ +import { + VerticalLayout, + Label, + TextTrigger, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class TextTriggerDemo extends Widget { + static xtype = "demo.text_trigger"; + + props = { baseCls: "demo-func" }; + + render() { + createWidget({ + type: VerticalLayout.xtype, + element: this, + items: [ + { + type: Label.xtype, + text: "文本加图标的trigger" + }, + { + type: TextTrigger.xtype, + text: "这是一个简单的trigger", + width: 200, + height: 24 + } + ], + hgap: 20, + vgap: 20 + }); + } +} diff --git a/packages/demo/src/demo/case/triggers/index.js b/packages/demo/src/demo/case/triggers/index.js new file mode 100644 index 000000000..0ef8e8a04 --- /dev/null +++ b/packages/demo/src/demo/case/triggers/index.js @@ -0,0 +1,4 @@ +export * from "./demo.editor_trigger"; +export * from "./demo.icon_trigger"; +export * from "./demo.select_text_trigger"; +export * from "./demo.text_trigger"; \ No newline at end of file diff --git a/packages/demo/src/demo/component/demo.form.js b/packages/demo/src/demo/component/demo.form.js new file mode 100644 index 000000000..bd26bcc4b --- /dev/null +++ b/packages/demo/src/demo/component/demo.form.js @@ -0,0 +1,114 @@ + +import { createWidget, isEmpty, isNotEmptyArray, Form, TextEditor, TextValueCombo, TextAreaEditor, VerticalLayout, Button, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class FormDemo extends Widget { + static xtype = "demo.form"; + + props = { baseCls: "demo-form" }; + + render() { + const widget = createWidget({ + type: Form.xtype, + width: 300, + labelWidth: 100, + items: [ + { + validate(v) { + return v !== "a" && v !== ""; + }, + tip(v) { + if (isEmpty(v)) { + return "不能为空"; + } + + return "不合法格式"; + }, + label: "E-mail", + el: { + type: TextEditor.xtype, + watermark: "输入a报错", + allowBlank: true, + }, + }, + { + validate(v) { + return isNotEmptyArray(v); + }, + tip() { + return "不能为空"; + }, + label: "性别", + el: { + type: TextValueCombo.xtype, + text: "请选择", + items: [ + { + text: "男", + value: 1, + }, + { + text: "女", + value: 2, + } + ], + }, + }, + { + validate(v) { + return v !== ""; + }, + tip() { + return "不能为空"; + }, + label: "姓名", + el: { + type: TextEditor.xtype, + watermark: "输入姓名", + allowBlank: true, + }, + }, + { + validate(v) { + return v !== ""; + }, + tip() { + return "不能为空"; + }, + label: "姓名", + el: { + type: TextAreaEditor.xtype, + cls: "bi-border", + watermark: "输入简介", + allowBlank: true, + height: 200, + }, + } + ], + layout: { + type: VerticalLayout.xtype, + vgap: 30, + }, + }); + + return { + type: VerticalLayout.xtype, + hgap: 200, + vgap: 10, + items: [ + widget, + { + type: Button.xtype, + text: "提交", + handler() { + widget.validate(); + + console.log(widget.getValue()); + }, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/component/demo.treevaluechoosercombo.js b/packages/demo/src/demo/component/demo.treevaluechoosercombo.js new file mode 100644 index 000000000..09e846dfb --- /dev/null +++ b/packages/demo/src/demo/component/demo.treevaluechoosercombo.js @@ -0,0 +1,30 @@ +import { CONSTANTS } from "@/config/constant"; + +import { TreeValueChooserCombo, VerticalLayout, shortcut, Widget, createWidget, deepClone } from "@fui/core" + + +@shortcut() +export class TreeValueChooserDemo extends Widget { + static xtype = "demo.tree_value_chooser_combo"; + + props = { baseCls: "demo-tree-value-chooser-combo" }; + + render() { + const widget = createWidget({ + type: TreeValueChooserCombo.xtype, + width: 300, + itemsCreator(op, callback) { + callback(deepClone(CONSTANTS.TREEITEMS)); + }, + defaultText: "请选择", + }); + + return { + type: VerticalLayout.xtype, + hgap: 200, + vgap: 10, + items: [widget], + }; + } +} + diff --git a/packages/demo/src/demo/component/demo.treevaluechooserpane.js b/packages/demo/src/demo/component/demo.treevaluechooserpane.js new file mode 100644 index 000000000..74d105be7 --- /dev/null +++ b/packages/demo/src/demo/component/demo.treevaluechooserpane.js @@ -0,0 +1,19 @@ +import { CONSTANTS } from "@/config/constant"; +import { TreeValueChooserPane, shortcut, Widget, deepClone } from "@fui/core"; + +@shortcut() +export class TreeValueChooserPaneDemo extends Widget { + static xtype = "demo.tree_value_chooser_pane"; + + props = { baseCls: "demo-tree-value-chooser" }; + + render() { + return { + type: TreeValueChooserPane.xtype, + items: deepClone(CONSTANTS.TREEITEMS) + // itemsCreator: function (op, callback) { + // callback(tree); + // } + }; + } +} diff --git a/packages/demo/src/demo/component/demo.valuechoosercombo.js b/packages/demo/src/demo/component/demo.valuechoosercombo.js new file mode 100644 index 000000000..419005a4f --- /dev/null +++ b/packages/demo/src/demo/component/demo.valuechoosercombo.js @@ -0,0 +1,28 @@ +import { CONSTANTS } from "@/config/constant"; + +import { ValueChooserCombo, VerticalLayout, shortcut, Widget, createWidget, deepClone } from "@fui/core" + + +@shortcut() +export class ValueChooserComboDemo extends Widget { + static xtype = "demo.value_chooser_combo"; + + props = { baseCls: "demo-value-chooser-combo" }; + + render() { + const widget = createWidget({ + type: ValueChooserCombo.xtype, + itemsCreator (op, callback) { + callback(deepClone(CONSTANTS.ITEMS)); + }, + }); + + return { + type: VerticalLayout.xtype, + hgap: 200, + vgap: 10, + items: [widget], + }; + } +} + diff --git a/packages/demo/src/demo/component/demo.valuechooserpane.js b/packages/demo/src/demo/component/demo.valuechooserpane.js new file mode 100644 index 000000000..94d49f7cf --- /dev/null +++ b/packages/demo/src/demo/component/demo.valuechooserpane.js @@ -0,0 +1,16 @@ +import { CONSTANTS } from "@/config/constant"; +import { ValueChooserPane, shortcut, Widget, deepClone } from "@fui/core"; + +@shortcut() +export class ValueChooserPaneDemo extends Widget { + static xtype = "demo.value_chooser_pane"; + + props = { baseCls: "demo-value-chooser-pane" }; + + render() { + return { + type: ValueChooserPane.xtype, + items: deepClone(CONSTANTS.ITEMS) + }; + } +} diff --git a/packages/demo/src/demo/component/index.js b/packages/demo/src/demo/component/index.js new file mode 100644 index 000000000..b980af9a7 --- /dev/null +++ b/packages/demo/src/demo/component/index.js @@ -0,0 +1,10 @@ +export const meta = { + title: "部件+服务", + rank: 4 +}; + +export * from "./demo.form"; +export * from "./demo.treevaluechoosercombo"; +export * from "./demo.treevaluechooserpane"; +export * from "./demo.valuechoosercombo"; +export * from "./demo.valuechooserpane"; diff --git a/packages/demo/src/demo/core/abstract/combination/demo.combo.js b/packages/demo/src/demo/core/abstract/combination/demo.combo.js new file mode 100644 index 000000000..c56563b77 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.combo.js @@ -0,0 +1,453 @@ + +import { ComboGroup, IconTextIconItem, SingleSelectItem, Combo, Button, ButtonGroup, SingleSelectRadioItem, VerticalLayout, MultiSelectItem, Label, MultiSelectBar, TextButton, Loader, FloatLeftLayout, ButtonTree, AdaptiveLayout, TableLayout, AbsoluteLayout, Navigation, GridLayout, shortcut, Widget, createWidget, createItems, deepClone, map, delay, random, makeArray, Msg } from "@fui/core" + + + +@shortcut() +export class ComboDemo extends Widget { + static xtype = "demo.combo"; + + props = { baseCls: "demo-func" }; + years = [ + { text: "2010年", value: 2010, iconCls: "close-ha-font" }, + { text: "2011年", value: 2011 }, + { text: "2012年", value: 2012, iconCls: "close-ha-font" }, + { text: "2013年", value: 2013 }, + { text: "2014年", value: 2014, iconCls: "close-ha-font" }, + { text: "2015年", value: 2015, iconCls: "close-ha-font" }, + { text: "2016年", value: 2016, iconCls: "close-ha-font" }, + { text: "2017年", value: 2017, iconCls: "close-ha-font" } + ]; + child = [ + { + type: ComboGroup.xtype, + el: { + type: IconTextIconItem.xtype, + text: "2010年", + value: 2010, + height: 25, + iconCls1: "close-ha-font", + iconCls2: "close-ha-font", + }, + items: [ + { type: SingleSelectItem.xtype, height: 25, text: "一月", value: 11 }, + { + type: IconTextIconItem.xtype, + height: 25, + text: "二月", + value: 12, + iconCls1: "close-ha-font", + iconCls2: "close-ha-font", + children: [{ type: SingleSelectItem.xtype, text: "一号", value: 101, height: 25 }], + } + ], + }, + { text: "2011年", value: 2011 }, + { text: "2012年", value: 2012, iconCls: "close-ha-font" }, + { text: "2013年", value: 2013 }, + { text: "2014年", value: 2014, iconCls: "close-ha-font" }, + { text: "2015年", value: 2015, iconCls: "close-ha-font" } + ]; + months = [ + [{ el: { text: "一月", value: 1 } }, { el: { text: "二月", value: 2 } }], + [{ el: { text: "三月", value: 3 } }, { el: { text: "四月", value: 4 } }], + [{ el: { text: "五月", value: 5 } }, { el: { text: "六月", value: 6 } }], + [{ el: { text: "七月", value: 7 } }, { el: { text: "八月", value: 8 } }], + [{ el: { text: "九月", value: 9 } }, { el: { text: "十月", value: 10 } }], + [{ el: { text: "十一月", value: 11 } }, { el: { text: "十二月", value: 12 } }] + ]; + dynamic = [ + { text: "2010年", value: 1 }, + { text: "20112222年", value: 2 }, + { text: "201233333年", value: 3 }, + { text: "2013年", value: 4 }, + { text: "2012324年", value: 5 }, + { text: "2015年", value: 6 }, + { text: "2016年", value: 7 }, + { text: "201744444444444444444444444444444444444年", value: 8 } + ]; + week = [ + { text: "周一", value: 100, iconClsLeft: "close-ha-font", iconClsRight: "close-font" }, + { text: "周二", value: 101, iconClsLeft: "close-ha-font" }, + { text: "周三", value: 102 }, + { text: "周四", value: 103, iconClsRight: "close-ha-font" }, + { text: "周五", value: 104, iconClsLeft: "close-ha-font", iconClsRight: "close-font" }, + { text: "周六", value: 105, iconClsLeft: "close-font", iconClsRight: "close-ha-font" }, + { text: "周日", value: 106, iconClsLeft: "close-font" } + ]; + + _createTop() { + const self = this; + + const yearCombo = createWidget({ + type: Combo.xtype, + el: { + type: Button.xtype, + text: "简单下拉框", + height: 30, + }, + popup: { + el: { + type: ButtonGroup.xtype, + items: createItems(deepClone(this.years), { + type: SingleSelectRadioItem.xtype, + height: 25, + handler(v) {}, + }), + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + }, + }, + width: 200, + }); + + var multiCombo = createWidget({ + type: Combo.xtype, + el: { + type: Button.xtype, + text: "多选下拉框", + height: 30, + }, + popup: { + el: { + items: createItems(deepClone(this.years), { + type: MultiSelectItem.xtype, + height: 25, + handler(v) {}, + }), + chooseType: 1, + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + }, + tool: { + type: Label.xtype, + text: "这是一个下拉框", + height: 35, + }, + tabs: [ + { + type: MultiSelectBar.xtype, + height: 25, + text: "全选", + onCheck(v) { + if (v) { + multiCombo.setValue(map(deepClone(self.years), "value")); + } else { + multiCombo.setValue([]); + } + }, + isAllCheckedBySelectedValue(selectedValue) { + return selectedValue.length == self.years.length; + // return true; + }, + } + ], + buttons: [ + { + type: TextButton.xtype, + text: "清空", + handler() { + multiCombo.setValue([]); + }, + }, + { + type: TextButton.xtype, + text: "确定", + handler() { + Msg.alert("", multiCombo.getValue()); + }, + } + ], + }, + width: 200, + }); + + const dynamicPopupCombo = createWidget({ + type: Combo.xtype, + isNeedAdjustWidth: false, + offsetStyle: "center", + el: { + type: Button.xtype, + text: "动态调整宽度", + height: 30, + }, + popup: { + el: { + items: createItems(deepClone(this.dynamic), { + type: SingleSelectItem.xtype, + height: 25, + }), + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + }, + }, + width: 200, + }); + + var dynamicCombo = createWidget({ + type: Combo.xtype, + el: { + type: Button.xtype, + text: "搜索", + height: 30, + }, + popup: { + el: { + type: Loader.xtype, + logic: { + dynamic: true, + scrolly: true, + }, + el: { + behaviors: { + redmark() { + return true; + }, + }, + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + }, + itemsCreator(options, popuplate) { + const times = options.times; + delay(() => { + if (times == 3) { + popuplate([ + { + type: SingleSelectItem.xtype, + text: "这是最后一个", + value: "这是最后一个", + py: "zszhyg", + height: 25, + } + ]); + + return; + } + + const map = map(makeArray(3, null), (i, v) => { + const val = `${i}_${random(1, 100)}`; + + return { + type: SingleSelectItem.xtype, + text: val, + value: val, + height: 25, + }; + }); + popuplate(map); + }, 1000); + }, + hasNext(options) { + return options.times < 3; + }, + }, + buttons: [ + { + type: TextButton.xtype, + text: "清空", + handler() { + dynamicCombo.setValue([]); + }, + }, + { + type: TextButton.xtype, + text: "确定", + handler() { + Msg.alert("", dynamicCombo.getValue()); + }, + } + ], + }, + width: 200, + }); + + return createWidget({ + type: FloatLeftLayout.xtype, + items: [yearCombo, multiCombo, dynamicPopupCombo, dynamicCombo], + hgap: 20, + vgap: 20, + }); + } + + _createBottom() { + const combo = createWidget({ + type: Combo.xtype, + el: { + type: TextButton.xtype, + cls: "button-combo", + height: 30, + }, + popup: { + el: { + type: ButtonGroup.xtype, + items: createItems(deepClone(this.years), { + type: SingleSelectItem.xtype, + iconWidth: 25, + height: 25, + handler(v) {}, + }), + chooseType: 1, + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + }, + }, + width: 200, + }); + combo.setValue(deepClone(this.years)[0].value); + + const childCombo = createWidget({ + type: Combo.xtype, + el: { + type: TextButton.xtype, + cls: "button-combo", + height: 30, + }, + popup: { + el: { + type: ButtonTree.xtype, + items: createItems(deepClone(this.child), { + type: SingleSelectItem.xtype, + height: 25, + handler(v) {}, + }), + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + }, + }, + width: 200, + }); + childCombo.setValue(deepClone(this.child)[0].items[0].value); + + const monthCombo = createWidget({ + type: Combo.xtype, + el: { + type: Button.xtype, + text: "多层样式下拉框", + height: 30, + }, + popup: { + el: { + items: createItems(deepClone(this.months), { + type: SingleSelectItem.xtype, + cls: "button-combo", + handler(v) {}, + }), + layouts: [ + { + type: AdaptiveLayout.xtype, + items: [ + { + el: { + type: TableLayout.xtype, + columns: 2, + rows: 6, + columnSize: [0.5, "fill"], + rowSize: 30, + }, + left: 4, + right: 4, + top: 2, + bottom: 2, + } + ], + }, + { + type: AbsoluteLayout.xtype, + el: { left: 4, top: 2, right: 4, bottom: 2 }, + } + ], + }, + }, + width: 200, + }); + + const yearCombo = createWidget({ + type: Combo.xtype, + el: { + type: Button.xtype, + text: "自定义控件", + height: 30, + }, + popup: { + el: { + type: Navigation.xtype, + direction: "bottom", + logic: { + dynamic: true, + }, + tab: { + height: 30, + items: [ + { + once: false, + text: "后退", + value: -1, + cls: "mvc-button layout-bg3", + }, + { + once: false, + text: "前进", + value: 1, + cls: "mvc-button layout-bg4", + } + ], + }, + cardCreator(v) { + return createWidget({ + type: TextButton.xtype, + whiteSpace: "normal", + text: new Date().getFullYear() + v, + }); + }, + }, + }, + width: 200, + }); + + return createWidget({ + type: FloatLeftLayout.xtype, + items: [combo, childCombo, monthCombo, yearCombo], + hgap: 20, + vgap: 20, + }); + } + + render() { + return { + type: GridLayout.xtype, + columns: 1, + rows: 2, + items: [ + { + column: 0, + row: 0, + el: this._createTop(), + }, + { + column: 0, + row: 1, + el: this._createBottom(), + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/abstract/combination/demo.combo2.js b/packages/demo/src/demo/core/abstract/combination/demo.combo2.js new file mode 100644 index 000000000..b2fc9eb7e --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.combo2.js @@ -0,0 +1,175 @@ +import { + Button, + Combo, + Layout, + GridLayout, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class Combo2Demo extends Widget { + static xtype = "demo.combo2"; + + props = { baseCls: "demo-func" }; + + _createEl() { + return { + type: Button.xtype, + height: 25, + text: "点击" + }; + } + + oneCombo() { + return createWidget({ + type: Combo.xtype, + adjustLength: 5, + el: this._createEl(), + popup: { + el: { + type: Layout.xtype, + height: 500 + }, + maxHeight: 400 + } + }); + } + + twoCombo() { + return createWidget({ + type: Combo.xtype, + adjustXOffset: 25, + adjustYOffset: 5, + direction: "bottom,left", + el: this._createEl(), + popup: { + el: { + type: Layout.xtype, + height: 1200 + } + } + }); + } + + threeCombo() { + return createWidget({ + type: Combo.xtype, + adjustYOffset: 5, + el: this._createEl(), + isNeedAdjustHeight: false, + popup: { + el: { + type: Layout.xtype, + height: 1200 + } + } + }); + } + + fourCombo() { + return createWidget({ + type: Combo.xtype, + adjustXOffset: 25, + adjustYOffset: 5, + direction: "left", + el: this._createEl(), + isNeedAdjustHeight: true, + popup: { + el: { + type: Layout.xtype, + height: 1200 + } + } + }); + } + + fiveCombo() { + return createWidget({ + type: Combo.xtype, + adjustXOffset: 25, + adjustYOffset: 5, + direction: "left,top", + el: this._createEl(), + isNeedAdjustHeight: true, + popup: { + el: { + type: Layout.xtype, + height: 1200 + }, + maxHeight: 2000 + } + }); + } + + sixCombo() { + return createWidget({ + type: Combo.xtype, + adjustXOffset: 25, + adjustYOffset: 5, + direction: "top,left", + el: this._createEl(), + isNeedAdjustHeight: true, + popup: { + el: { + type: Layout.xtype, + height: 1200 + } + } + }); + } + + sevenCombo() { + return createWidget({ + type: Combo.xtype, + adjustXOffset: 25, + adjustYOffset: 5, + direction: "bottom", + isNeedAdjustWidth: false, + // isNeedAdjustHeight: false, + offsetStyle: "center", + el: this._createEl(), + popup: { + el: { + type: Layout.xtype, + width: 200, + height: 1200 + } + } + }); + } + + eightCombo() { + return createWidget({ + type: Combo.xtype, + adjustXOffset: 25, + adjustYOffset: 5, + direction: "right", + isNeedAdjustWidth: false, + // isNeedAdjustHeight: false, + offsetStyle: "middle", + el: this._createEl(), + popup: { + el: { + type: Layout.xtype, + width: 200, + height: 200 + } + } + }); + } + + render() { + return { + type: GridLayout.xtype, + hgap: 10, + vgap: 5, + items: [ + [this.oneCombo(), this.twoCombo(), this.threeCombo()], + [this.fourCombo(), this.fiveCombo(), this.sixCombo()], + [this.sevenCombo(), this.eightCombo()] + ] + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/combination/demo.combo3.js b/packages/demo/src/demo/core/abstract/combination/demo.combo3.js new file mode 100644 index 000000000..6b4e80401 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.combo3.js @@ -0,0 +1,85 @@ +import { + Label, + Combo, + Layout, + GridLayout, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class Combo3Demo extends Widget { + static xtype = "demo.combo3"; + + props = { baseCls: "demo-func" }; + + _createEl() { + return { + type: Label.xtype, + cls: "bi-border", + height: "100%", + text: "点击" + }; + } + + oneCombo() { + return createWidget({ + type: Combo.xtype, + direction: "right,innerRight", + isNeedAdjustWidth: false, + isNeedAdjustHeight: false, + el: this._createEl(), + popup: { + el: { + type: Layout.xtype, + width: 200, + height: 200 + } + } + }); + } + + twoCombo() { + return createWidget({ + type: Combo.xtype, + direction: "right,innerRight", + isNeedAdjustWidth: false, + isNeedAdjustHeight: false, + el: this._createEl(), + popup: { + el: { + type: Layout.xtype, + width: 1000, + height: 200 + } + } + }); + } + + threeCombo() { + return createWidget({ + type: Combo.xtype, + direction: "right,innerRight", + isNeedAdjustWidth: false, + isNeedAdjustHeight: false, + el: this._createEl(), + popup: { + el: { + type: Layout.xtype, + width: 400, + height: 200 + } + } + }); + } + + render() { + return { + type: GridLayout.xtype, + hgap: 10, + vgap: 5, + items: [[this.oneCombo()], [this.twoCombo()], [this.threeCombo()]] + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/combination/demo.combo_group.js b/packages/demo/src/demo/core/abstract/combination/demo.combo_group.js new file mode 100644 index 000000000..67aadd452 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.combo_group.js @@ -0,0 +1,114 @@ +import { + ComboGroup, + IconTextIconItem, + SingleSelectItem, + Combo, + TextButton, + ButtonTree, + VerticalLayout, + FloatLeftLayout, + GridLayout, + shortcut, + Widget, + createWidget, + createItems, + deepClone +} from "@fui/core"; + +@shortcut() +export class ComboGroupDemo extends Widget { + static xtype = "demo.combo.group"; + + props = { baseCls: "demo-func" }; + child = [ + { + type: ComboGroup.xtype, + el: { + type: IconTextIconItem.xtype, + text: "2010年", + value: 2010, + height: 25, + iconCls: "close-ha-font" + }, + items: [ + { + type: SingleSelectItem.xtype, + height: 25, + text: "一月", + value: 11 + }, + { + type: IconTextIconItem.xtype, + height: 25, + text: "二月", + value: 12, + iconCls1: "close-ha-font", + iconCls2: "close-ha-font", + children: [ + { + type: SingleSelectItem.xtype, + text: "一号", + value: 101, + height: 25 + } + ] + } + ] + }, + { text: "2011年", value: 2011 }, + { text: "2012年", value: 2012, iconCls: "close-ha-font" }, + { text: "2013年", value: 2013 }, + { text: "2014年", value: 2014, iconCls: "close-ha-font" }, + { text: "2015年", value: 2015, iconCls: "close-ha-font" } + ]; + + _createBottom() { + const childCombo = createWidget({ + type: Combo.xtype, + el: { + type: TextButton.xtype, + cls: "button-combo", + height: 30 + }, + popup: { + el: { + type: ButtonTree.xtype, + items: createItems(deepClone(this.child), { + type: SingleSelectItem.xtype, + height: 25, + handler(v) {} + }), + layouts: [ + { + type: VerticalLayout.xtype + } + ] + } + }, + width: 200 + }); + childCombo.setValue(deepClone(this.child)[0].items[0].value); + + return createWidget({ + type: FloatLeftLayout.xtype, + items: [childCombo], + hgap: 20, + vgap: 20 + }); + } + + render() { + return { + type: GridLayout.xtype, + columns: 1, + rows: 1, + items: [ + { + column: 0, + row: 0, + el: this._createBottom() + } + ] + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/combination/demo.expander.js b/packages/demo/src/demo/core/abstract/combination/demo.expander.js new file mode 100644 index 000000000..49533e4b0 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.expander.js @@ -0,0 +1,62 @@ +import { + VerticalLayout, + Expander, + IconTextNode, + SingleSelectItem, + shortcut, + Widget, + createItems +} from "@fui/core"; + +@shortcut() +export class ExpanderDemo extends Widget { + static xtype = "demo.expander"; + + props = { baseCls: "demo-func" }; + + render() { + return { + type: VerticalLayout.xtype, + hgap: 30, + vgap: 20, + items: [ + { + type: Expander.xtype, + el: { + type: IconTextNode.xtype, + cls: "pull-right-ha-font mvc-border", + height: 25, + text: "Expander" + }, + popup: { + cls: "mvc-border", + items: createItems( + [ + { + text: "项目1", + value: 1 + }, + { + text: "项目2", + value: 2 + }, + { + text: "项目3", + value: 3 + }, + { + text: "项目4", + value: 4 + } + ], + { + type: SingleSelectItem.xtype, + height: 25 + } + ) + } + } + ] + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/combination/demo.loader.js b/packages/demo/src/demo/core/abstract/combination/demo.loader.js new file mode 100644 index 000000000..0cb891c6c --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.loader.js @@ -0,0 +1,34 @@ +import { Loader, SingleSelectItem, shortcut, Widget, deepClone, map, extend } from '@fui/core'; +import { CONSTANTS } from '@/config/constant'; + +@shortcut() +export class LoaderDemo extends Widget { + static xtype = 'demo.loader'; + + props = { baseCls: 'demo-func' }; + + render() { + const self = this; + this.all = 0; + const items = deepClone(CONSTANTS.ITEMS); + + return { + type: Loader.xtype, + itemsCreator(options, populate) { + setTimeout(() => { + populate( + map(items.slice((options.times - 1) * 10, options.times * 10), (i, v) => + extend(v, { + type: SingleSelectItem.xtype, + height: 25, + }) + ) + ); + }, 1000); + }, + hasNext(options) { + return options.times * 10 < items.length; + }, + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/combination/demo.navigation.js b/packages/demo/src/demo/core/abstract/combination/demo.navigation.js new file mode 100644 index 000000000..43620d356 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.navigation.js @@ -0,0 +1,49 @@ +import { + Label, + Navigation, + shortcut, + Widget, + createWidget, + random, + bind +} from "@fui/core"; + +@shortcut() +export class NagvigationDemo extends Widget { + static xtype = "demo.navigation"; + + props = { baseCls: "demo-func" }; + + _createNav(v) { + return createWidget({ + type: Label.xtype, + cls: `layout-bg${random(1, 8)}`, + text: `第${v}页` + }); + } + + render() { + return { + type: Navigation.xtype, + showIndex: 0, + tab: { + height: 30, + items: [ + { + once: false, + text: "后退", + value: -1, + cls: "mvc-button layout-bg3" + }, + { + once: false, + text: "前进", + value: 1, + cls: "mvc-button layout-bg4" + } + ] + }, + cardCreator: bind(this._createNav, this) + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/combination/demo.sercher.js b/packages/demo/src/demo/core/abstract/combination/demo.sercher.js new file mode 100644 index 000000000..50487eef5 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.sercher.js @@ -0,0 +1,135 @@ +import { + MultiSelectItem, + ButtonGroup, + VerticalLayout, + AbsoluteLayout, + Searcher, + shortcut, + Widget, + createItems, + createWidget +} from "@fui/core"; + +@shortcut() +export class SearcherDemo extends Widget { + static xtype = "demo.searcher"; + + props = { baseCls: "demo-func" }; + + _createItems(items) { + return createItems(items, { + type: MultiSelectItem.xtype, + height: 25, + handler(v) {} + }); + } + + render() { + const self = this; + const items = [ + { + text: "2010年", + value: 2010, + py: "2010n", + title: "1111111111111111111111111111111111" + }, + { + text: "2011年", + value: 2011, + py: "2011n", + title: "1111111111111111111111111111111111" + }, + { + text: "2012年", + value: 2012, + py: "2012n", + title: "1111111111111111111111111111111111" + }, + { + text: "2013年", + value: 2013, + py: "2013n", + title: "1111111111111111111111111111111111" + }, + { + text: "2014年", + value: 2014, + py: "2014n", + title: "1111111111111111111111111111111111" + }, + { + text: "2015年", + value: 2015, + py: "2015n", + title: "1111111111111111111111111111111111" + }, + { + text: "2016年", + value: 2016, + py: "2016n", + title: "1111111111111111111111111111111111" + }, + { + text: "2017年", + value: 2017, + py: "2017n", + title: "1111111111111111111111111111111111" + } + ]; + + const adapter = createWidget({ + type: ButtonGroup.xtype, + cls: "layout-bg1", + items: this._createItems(items), + chooseType: 1, + behaviors: {}, + layouts: [ + { + type: VerticalLayout.xtype + } + ] + }); + createWidget({ + type: AbsoluteLayout.xtype, + element: this, + items: [ + { + el: adapter, + top: 50, + left: 50, + width: 200, + height: 100 + } + ] + }); + createWidget({ + type: AbsoluteLayout.xtype, + element: this, + items: [ + { + el: { + type: AbsoluteLayout.xtype, + width: 200, + height: 30, + items: [ + { + el: { + type: Searcher.xtype, + adapter, + width: 200, + height: 30 + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + } + ] + }, + top: 100, + left: 300 + } + ] + }); + } +} diff --git a/packages/demo/src/demo/core/abstract/combination/demo.switcher.js b/packages/demo/src/demo/core/abstract/combination/demo.switcher.js new file mode 100644 index 000000000..d18a7c3f4 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.switcher.js @@ -0,0 +1,84 @@ +import { + Label, + AbsoluteLayout, + VerticalLayout, + Switcher, + Button, + SingleSelectItem, + shortcut, + Widget, + createWidget, + createItems +} from "@fui/core"; + +@shortcut() +export class SwitcherDemo extends Widget { + static xtype = "demo.switcher"; + + props = { baseCls: "demo-func" }; + + render() { + const adapter = createWidget({ + type: Label.xtype, + cls: "layout-bg2", + text: "将在该处弹出switcher" + }); + createWidget({ + type: AbsoluteLayout.xtype, + element: this, + items: [ + { + el: adapter, + top: 50, + left: 20, + width: 200, + height: 300 + } + ] + }); + createWidget({ + type: VerticalLayout.xtype, + element: this, + hgap: 30, + vgap: 20, + items: [ + { + type: Switcher.xtype, + el: { + type: Button.xtype, + height: 25, + text: "Switcher" + }, + popup: { + cls: "mvc-border layout-bg5", + items: createItems( + [ + { + text: "项目1", + value: 1 + }, + { + text: "项目2", + value: 2 + }, + { + text: "项目3", + value: 3 + }, + { + text: "项目4", + value: 4 + } + ], + { + type: SingleSelectItem.xtype, + height: 25 + } + ) + }, + adapter + } + ] + }); + } +} diff --git a/packages/demo/src/demo/core/abstract/combination/demo.tab.js b/packages/demo/src/demo/core/abstract/combination/demo.tab.js new file mode 100644 index 000000000..a597c331c --- /dev/null +++ b/packages/demo/src/demo/core/abstract/combination/demo.tab.js @@ -0,0 +1,91 @@ +import { + Label, + ButtonGroup, + CenterAdaptLayout, + HorizontalLayout, + Tab, + AbsoluteLayout, + shortcut, + Widget, + createWidget, + bind +} from "@fui/core"; + +@shortcut() +export class TabDemo extends Widget { + static xtype = "demo.tab"; + + props = { baseCls: "demo-func" }; + + _createTabs(v) { + switch (v) { + case 1: + return createWidget({ + type: Label.xtype, + cls: "layout-bg1", + text: "面板1" + }); + case 2: + return createWidget({ + type: Label.xtype, + cls: "layout-bg2", + text: "面板2" + }); + } + } + + render() { + this.tab = createWidget({ + type: ButtonGroup.xtype, + height: 30, + items: [ + { + text: "Tab1", + value: 1, + width: 50, + cls: "mvc-button layout-bg3" + }, + { + text: "Tab2", + value: 2, + width: 50, + cls: "mvc-button layout-bg4" + } + ], + layouts: [ + { + type: CenterAdaptLayout.xtype, + items: [ + { + el: { + type: HorizontalLayout.xtype, + width: 100 + } + } + ] + } + ] + }); + + const tab = createWidget({ + direction: "custom", + type: Tab.xtype, + element: this, + tab: this.tab, + cardCreator: bind(this._createTabs, this) + }); + createWidget({ + type: AbsoluteLayout.xtype, + element: this, + items: [ + { + el: this.tab, + left: 200, + top: 200 + } + ] + }); + + tab.setSelect(2); + } +} diff --git a/demo/js/core/abstract/combination/index.js b/packages/demo/src/demo/core/abstract/combination/index.js similarity index 100% rename from demo/js/core/abstract/combination/index.js rename to packages/demo/src/demo/core/abstract/combination/index.js diff --git a/packages/demo/src/demo/core/abstract/demo.button_group.js b/packages/demo/src/demo/core/abstract/demo.button_group.js new file mode 100644 index 000000000..ca43fdaa6 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/demo.button_group.js @@ -0,0 +1,87 @@ +import { + VerticalLayout, + ButtonGroup, + VTapeLayout, + Label, + Button, + shortcut, + Widget +} from "@fui/core"; + +@shortcut() +export class ButtonGroupDemo extends Widget { + static xtype = "demo.button_group"; + + props = { baseCls: "demo-func" }; + + render() { + let ref; + + return { + type: VerticalLayout.xtype, + items: [ + { + type: ButtonGroup.xtype, + ref(_ref) { + ref = _ref; + }, + chooseType: ButtonGroup.CHOOSE_TYPE_NONE, + layouts: [ + { + type: VerticalLayout.xtype, + items: [ + { + type: VTapeLayout.xtype, + height: 200 + } + ] + } + ], + items: [ + { + el: { + type: Label.xtype, + text: "button_group是一类具有相同属性或相似属性的抽象, 本案例实现的是布局的嵌套(vertical布局下内嵌center_adapt布局)" + }, + height: 150 + }, + { + el: { + type: Button.xtype, + text: "1" + } + } + ] + }, + { + type: Button.xtype, + text: "populate", + handler() { + ref.populate([ + { + el: { + type: Label.xtype, + text: "1" + }, + height: 50 + }, + { + el: { + type: Button.xtype, + text: "2" + }, + height: 50 + }, + { + el: { + type: Label.xtype, + text: "3" + } + } + ]); + } + } + ] + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/demo.button_tree.js b/packages/demo/src/demo/core/abstract/demo.button_tree.js new file mode 100644 index 000000000..5411f68ea --- /dev/null +++ b/packages/demo/src/demo/core/abstract/demo.button_tree.js @@ -0,0 +1,44 @@ +import { + ButtonTree, + VerticalLayout, + CenterAdaptLayout, + Label, + Button, + shortcut, + Widget, + ButtonGroup +} from "@fui/core"; + +@shortcut() +export class ButtonTreeDemo extends Widget { + static xtype = "demo.button_tree"; + + props = { baseCls: "demo-func" }; + + render() { + return { + type: ButtonTree.xtype, + chooseType: ButtonGroup.CHOOSE_TYPE_MULTI, + layouts: [ + { + type: VerticalLayout.xtype + }, + { + type: CenterAdaptLayout.xtype + } + ], + items: [ + { + type: Label.xtype, + text: "0", + value: 0 + }, + { + type: Button.xtype, + text: "1", + value: 1 + } + ] + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/demo.collection_view.js b/packages/demo/src/demo/core/abstract/demo.collection_view.js new file mode 100644 index 000000000..85d34f0dc --- /dev/null +++ b/packages/demo/src/demo/core/abstract/demo.collection_view.js @@ -0,0 +1,53 @@ +import { + Label, + CollectionView, + AbsoluteLayout, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class CollectionViewDemo extends Widget { + static xtype = "demo.collection_view"; + + props = { baseCls: "demo-func" }; + + render() { + const items = []; + const cellCount = 100; + for (let i = 0; i < cellCount; i++) { + items[i] = { + type: Label.xtype, + text: i + }; + } + const grid = createWidget({ + type: CollectionView.xtype, + width: 400, + height: 300, + items, + cellSizeAndPositionGetter(index) { + return { + x: (index % 10) * 50, + y: Math.floor(index / 10) * 50, + width: 50, + height: 50 + }; + } + }); + createWidget({ + type: AbsoluteLayout.xtype, + element: this, + items: [ + { + el: grid, + left: 10, + right: 10, + top: 10, + bottom: 10 + } + ] + }); + } +} diff --git a/packages/demo/src/demo/core/abstract/demo.custom_tree.js b/packages/demo/src/demo/core/abstract/demo.custom_tree.js new file mode 100644 index 000000000..6a6c2f244 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/demo.custom_tree.js @@ -0,0 +1,408 @@ +import { + PlusGroupNode, + SingleSelectItem, + CustomTree, + ButtonTree, + VerticalLayout, + Loader, + GridLayout, + VTapeLayout, + CenterLayout, + TextButton, + Label, + shortcut, + Widget, + createWidget, + deepClone, + Msg +} from "@fui/core"; + +@shortcut() +export class CustomTreeDemo extends Widget { + static xtype = "demo.custom_tree"; + + props = { baseCls: "demo-func" }; + + _createDefaultTree() { + const TREEITEMS = [ + { + id: -1, + pId: -2, + value: "根目录", + open: true, + type: PlusGroupNode.xtype, + height: 25 + }, + { + id: 1, + pId: -1, + value: "第一级目录1", + type: PlusGroupNode.xtype, + height: 25 + }, + { + id: 11, + pId: 1, + value: "第二级文件1", + type: SingleSelectItem.xtype, + height: 25 + }, + { + id: 12, + pId: 1, + value: "第二级目录2", + type: PlusGroupNode.xtype, + height: 25 + }, + { + id: 121, + pId: 12, + value: "第三级目录1", + type: PlusGroupNode.xtype, + height: 25 + }, + { + id: 122, + pId: 12, + value: "第三级文件1", + type: SingleSelectItem.xtype, + height: 25 + }, + { + id: 1211, + pId: 121, + value: "第四级目录1", + type: PlusGroupNode.xtype, + height: 25 + }, + { + id: 12111, + pId: 1211, + value: "第五级文件1", + type: SingleSelectItem.xtype, + height: 25 + }, + { + id: 2, + pId: -1, + value: "第一级目录2", + type: PlusGroupNode.xtype, + height: 25 + }, + { + id: 21, + pId: 2, + value: "第二级目录3", + type: PlusGroupNode.xtype, + height: 25 + }, + { + id: 22, + pId: 2, + value: "第二级文件2", + type: SingleSelectItem.xtype, + height: 25 + }, + { + id: 211, + pId: 21, + value: "第三级目录2", + type: PlusGroupNode.xtype, + height: 25 + }, + { + id: 212, + pId: 21, + value: "第三级文件2", + type: SingleSelectItem.xtype, + height: 25 + }, + { + id: 2111, + pId: 211, + value: "第四级文件1", + type: SingleSelectItem.xtype, + height: 25 + } + ]; + this.tree = createWidget({ + type: CustomTree.xtype, + el: { + type: ButtonTree.xtype, + chooseType: 0, + layouts: [ + { + type: VerticalLayout.xtype, + hgap: 30 + } + ] + }, + items: deepClone(TREEITEMS) + }); + + return this.tree; + } + + _createAsyncTree() { + this.asyncTree = createWidget({ + type: CustomTree.xtype, + itemsCreator(op, callback) { + if (!op.node) { + // 根节点 + callback([ + { + id: 1, + pId: 0, + type: PlusGroupNode.xtype, + text: "test1", + value: 1, + height: 25, + isParent: true + }, + { + id: 2, + pId: 0, + type: PlusGroupNode.xtype, + text: "test2", + value: 1, + isParent: true, + open: true, + height: 25 + } + ]); + } else { + if (op.node.id == 1) { + callback([ + { + id: 11, + pId: 1, + type: PlusGroupNode.xtype, + text: "test11", + value: 11, + height: 25, + isParent: true + }, + { + id: 12, + pId: 1, + type: SingleSelectItem.xtype, + text: "test12", + value: 12, + height: 35 + }, + { + id: 13, + pId: 1, + type: SingleSelectItem.xtype, + text: "test13", + value: 13, + height: 35 + }, + { + id: 14, + pId: 1, + type: SingleSelectItem.xtype, + text: "test14", + value: 14, + height: 35 + }, + { + id: 15, + pId: 1, + type: SingleSelectItem.xtype, + text: "test15", + value: 15, + height: 35 + }, + { + id: 16, + pId: 1, + type: SingleSelectItem.xtype, + text: "test16", + value: 16, + height: 35 + }, + { + id: 17, + pId: 1, + type: SingleSelectItem.xtype, + text: "test17", + value: 17, + height: 35 + } + ]); + } else if (op.node.id == 2) { + callback([ + { + id: 21, + pId: 2, + type: SingleSelectItem.xtype, + text: "test21", + value: 21, + height: 35 + }, + { + id: 22, + pId: 2, + type: SingleSelectItem.xtype, + text: "test22", + value: 22, + height: 35 + } + ]); + } else if (op.node.id == 11) { + callback([ + { + id: 111, + pId: 11, + type: SingleSelectItem.xtype, + text: "test111", + value: 111, + height: 35 + } + ]); + } + } + }, + el: { + type: Loader.xtype, + next: false, + el: { + type: ButtonTree.xtype, + chooseType: 0, + layouts: [ + { + type: VerticalLayout.xtype, + hgap: 30, + vgap: 0 + } + ] + } + } + }); + + return this.asyncTree; + } + + render() { + const self = this; + createWidget({ + type: GridLayout.xtype, + columns: 2, + rows: 1, + element: this, + items: [ + { + column: 0, + row: 0, + el: { + type: VTapeLayout.xtype, + items: [ + { + el: this._createDefaultTree() + }, + { + el: { + type: CenterLayout.xtype, + hgap: 10, + items: [ + { + type: TextButton.xtype, + cls: "mvc-button layout-bg2", + text: "getValue", + height: 30, + handler() { + Msg.alert( + "", + JSON.stringify( + self.tree.getValue() + ) + ); + } + }, + { + type: TextButton.xtype, + cls: "mvc-button layout-bg2", + text: "getNodeByValue(第一级目录1)", + height: 30, + handler() { + Msg.alert( + "", + `节点名称为: ${self.tree + .getNodeByValue( + "第一级目录1" + ) + .getValue()}` + ); + } + } + ] + }, + height: 30 + } + ] + } + }, + { + column: 1, + row: 0, + el: { + type: VTapeLayout.xtype, + items: [ + { + type: Label.xtype, + text: "异步加载数据", + height: 30 + }, + { + el: this._createAsyncTree() + }, + { + el: { + type: CenterLayout.xtype, + hgap: 10, + items: [ + { + type: TextButton.xtype, + cls: "mvc-button layout-bg2", + text: "getValue", + height: 30, + handler() { + Msg.alert( + "", + JSON.stringify( + self.asyncTree.getValue() + ) + ); + } + }, + { + type: TextButton.xtype, + cls: "mvc-button layout-bg2", + text: "getNodeById(11)", + height: 30, + handler() { + Msg.alert( + "", + `节点名称为: ${ + self.asyncTree.getNodeById( + 11 + ) && + self.asyncTree + .getNodeById(11) + .getText() + }` + ); + } + } + ] + }, + height: 30 + } + ] + } + } + ] + }); + } +} diff --git a/packages/demo/src/demo/core/abstract/demo.grid_view.js b/packages/demo/src/demo/core/abstract/demo.grid_view.js new file mode 100644 index 000000000..505a23c33 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/demo.grid_view.js @@ -0,0 +1,70 @@ +import { + Label, + GridView, + AbsoluteLayout, + GridLayout, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class GridViewDemo extends Widget { + static xtype = "demo.grid_view"; + + props = { baseCls: "demo-func" }; + + render() { + const items = []; + const rowCount = 10000, + columnCount = 100; + for (let i = 0; i < rowCount; i++) { + items[i] = []; + for (let j = 0; j < columnCount; j++) { + items[i][j] = { + type: Label.xtype, + text: `${i}-${j}` + }; + } + } + const grid = createWidget({ + type: GridView.xtype, + width: 400, + height: 300, + estimatedRowSize: 30, + estimatedColumnSize: 100, + items, + scrollTop: 100, + rowHeightGetter() { + return 30; + }, + columnWidthGetter() { + return 100; + } + }); + createWidget({ + type: AbsoluteLayout.xtype, + element: this, + items: [ + { + el: { + type: GridLayout.xtype, + columns: 1, + rows: 1, + items: [ + { + column: 0, + row: 0, + el: grid + } + ] + }, + left: 10, + right: 10, + top: 10, + bottom: 10 + } + ] + }); + } +} diff --git a/packages/demo/src/demo/core/abstract/demo.list_view.js b/packages/demo/src/demo/core/abstract/demo.list_view.js new file mode 100644 index 000000000..39f5e1c10 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/demo.list_view.js @@ -0,0 +1,26 @@ +import { ListView, FloatLeftLayout, Label, shortcut, Widget, map, extend } from '@fui/core'; +import { CONSTANTS } from '@/config/constant'; + +@shortcut() +export class ListViewDemo extends Widget { + static xtype = 'demo.list_view'; + + props = { baseCls: 'demo-func' }; + + render() { + return { + type: ListView.xtype, + el: { + type: FloatLeftLayout.xtype, + }, + items: map(CONSTANTS.ITEMS, (i, item) => + extend({}, item, { + type: Label.xtype, + width: 200, + height: 200, + text: `${i + 1}.${item.text}`, + }) + ), + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/demo.virtual_group.js b/packages/demo/src/demo/core/abstract/demo.virtual_group.js new file mode 100644 index 000000000..92131d284 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/demo.virtual_group.js @@ -0,0 +1,98 @@ +import { + VerticalLayout, + Label, + ButtonGroup, + Button, + VirtualGroup, + shortcut, + Widget, + map, + range, + deepClone +} from "@fui/core"; + +@shortcut() +export class VirtualGroupDemo extends Widget { + static xtype = "demo.virtual_group"; + + props = { baseCls: "demo-func" }; + + _createItems() { + const items = map(range(1000), (i) => { + return { + type: "demo.virtual_group_item", + value: i, + key: i + 1 + }; + }); + + return items; + } + + render() { + const self = this; + const buttonGroupItems = self._createItems(); + const virtualGroupItems = self._createItems(); + + return { + type: VerticalLayout.xtype, + vgap: 20, + items: [ + { + type: Label.xtype, + cls: "layout-bg5", + height: 50, + text: "共1000个元素,演示button_group和virtual_group每次删除第一个元素,打开控制台看输出" + }, + { + type: ButtonGroup.xtype, + width: 500, + height: 300, + ref() { + self.buttonGroup = this; + }, + chooseType: ButtonGroup.CHOOSE_TYPE_MULTI, + layouts: [ + { + type: VerticalLayout.xtype + } + ], + items: this._createItems() + }, + { + type: Button.xtype, + text: "演示button_group的刷新", + handler() { + buttonGroupItems.shift(); + self.buttonGroup.populate(deepClone(buttonGroupItems)); + } + }, + { + type: VirtualGroup.xtype, + width: 500, + height: 300, + ref() { + self.virtualGroup = this; + }, + chooseType: ButtonGroup.CHOOSE_TYPE_MULTI, + layouts: [ + { + type: VerticalLayout.xtype + } + ], + items: this._createItems() + }, + { + type: Button.xtype, + text: "演示virtual_group的刷新", + handler() { + virtualGroupItems.shift(); + self.virtualGroup.populate( + deepClone(virtualGroupItems) + ); + } + } + ] + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/demo.virtual_group_item.js b/packages/demo/src/demo/core/abstract/demo.virtual_group_item.js new file mode 100644 index 000000000..4a42f08c6 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/demo.virtual_group_item.js @@ -0,0 +1,47 @@ +import { Label, shortcut, Widget, UUID } from "@fui/core"; + +@shortcut() +export class VirtualGroupItemDemo extends Widget { + static xtype = "demo.virtual_group_item"; + + props = { baseCls: "demo-item", height: 30 }; + + render() { + const self = this, + o = this.options; + + return { + type: Label.xtype, + ref() { + self.label = this; + }, + height: this.options.height, + text: `key:${o.key},随机数${UUID()}` + }; + } + + shouldUpdate(nextProps) { + const o = this.options; + + return ( + o.type !== nextProps.type || + o.key !== nextProps.key || + o.value !== nextProps.value + ); + } + + update(item) { + this.label.setText(item.value); + console.log("更新了一项"); + + return true; // 返回是不是更新成功 + } + + created() { + console.log("创建了一项"); + } + + destroyed() { + console.log("删除了一项"); + } +} diff --git a/packages/demo/src/demo/core/abstract/demo.virtual_list.js b/packages/demo/src/demo/core/abstract/demo.virtual_list.js new file mode 100644 index 000000000..b6fa4a624 --- /dev/null +++ b/packages/demo/src/demo/core/abstract/demo.virtual_list.js @@ -0,0 +1,22 @@ +import { VirtualList, Label, shortcut, Widget, map, extend } from '@fui/core'; +import { CONSTANTS } from '@/config/constant'; + +@shortcut() +export class VirtualListDemo extends Widget { + static xtype = 'demo.virtual_list'; + + props = { baseCls: 'demo-func' }; + + render() { + return { + type: VirtualList.xtype, + items: map(CONSTANTS.ITEMS, (i, item) => + extend({}, item, { + type: Label.xtype, + height: 30, + text: `${i + 1}.${item.text}`, + }) + ), + }; + } +} diff --git a/packages/demo/src/demo/core/abstract/index.js b/packages/demo/src/demo/core/abstract/index.js new file mode 100644 index 000000000..8d976634f --- /dev/null +++ b/packages/demo/src/demo/core/abstract/index.js @@ -0,0 +1,16 @@ +export const meta = { + title: "抽象控件 core", + rank: 9999 +}; + +export * as combination from "./combination"; + +export * from "./demo.button_group"; +export * from "./demo.button_tree"; +export * from "./demo.collection_view"; +export * from "./demo.custom_tree"; +export * from "./demo.grid_view"; +export * from "./demo.list_view"; +export * from "./demo.virtual_group"; +export * from "./demo.virtual_group_item"; +export * from "./demo.virtual_list"; diff --git a/packages/demo/src/demo/core/index.js b/packages/demo/src/demo/core/index.js new file mode 100644 index 000000000..0136c7f8e --- /dev/null +++ b/packages/demo/src/demo/core/index.js @@ -0,0 +1,8 @@ +export const meta = { + title: "核心控件 core", + rank: 9999 +}; + +export * as layout from "./layout"; +export * as abstract from "./abstract"; +export * as popup from "./popup"; diff --git a/packages/demo/src/demo/core/layout/demo.absolute.js b/packages/demo/src/demo/core/layout/demo.absolute.js new file mode 100644 index 000000000..3df7b8b4c --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.absolute.js @@ -0,0 +1,30 @@ + +import { AbsoluteLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class AbsoluteLayoutDemo extends Widget { + static xtype = "demo.absolute"; + + props = { baseCls: "demo-absolute" }; + + render() { + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: Label.xtype, + text: "绝对布局", + cls: "layout-bg1", + width: 300, + height: 200, + }, + left: 100, + top: 100, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.border.js b/packages/demo/src/demo/core/layout/demo.border.js new file mode 100644 index 000000000..cff86a08b --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.border.js @@ -0,0 +1,105 @@ + +import { Label, CenterLayout, BorderLayout, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class BorderLayoutDemo extends Widget { + static xtype = "demo.border"; + + props = { baseCls: "demo-border" }; + + _createNorth() { + return createWidget({ + type: Label.xtype, + text: "North", + cls: "layout-bg1", + height: 30, + }); + } + + _createWest() { + return createWidget({ + type: CenterLayout.xtype, + cls: "layout-bg2", + items: [ + { + type: Label.xtype, + text: "West", + whiteSpace: "normal", + } + ], + }); + } + + _createCenter() { + return createWidget({ + type: CenterLayout.xtype, + cls: "layout-bg3", + items: [ + { + type: Label.xtype, + text: "Center", + whiteSpace: "normal", + } + ], + }); + } + + _createEast() { + return createWidget({ + type: CenterLayout.xtype, + cls: "layout-bg5", + items: [ + { + type: Label.xtype, + text: "East", + whiteSpace: "normal", + } + ], + }); + } + + _createSouth() { + return createWidget({ + type: Label.xtype, + text: "South", + cls: "layout-bg6", + height: 50, + }); + } + + render() { + return { + type: BorderLayout.xtype, + cls: "", + items: { + north: { + el: this._createNorth(), + height: 30, + top: 20, + left: 20, + right: 20, + }, + south: { + el: this._createSouth(), + height: 50, + bottom: 20, + left: 20, + right: 20, + }, + west: { + el: this._createWest(), + width: 200, + left: 20, + }, + east: { + el: this._createEast(), + width: 300, + right: 20, + }, + center: this._createCenter(), + }, + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.center_adapt.js b/packages/demo/src/demo/core/layout/demo.center_adapt.js new file mode 100644 index 000000000..5b39be5e3 --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.center_adapt.js @@ -0,0 +1,26 @@ + +import { CenterAdaptLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class CenterAdaptDemo extends Widget { + static xtype = "demo.center_adapt"; + + props = { baseCls: "demo-absolute" }; + + render() { + return { + type: CenterAdaptLayout.xtype, + items: [ + { + type: Label.xtype, + text: "水平垂直居中", + width: 300, + height: 200, + cls: "layout-bg1", + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.float_center.js b/packages/demo/src/demo/core/layout/demo.float_center.js new file mode 100644 index 000000000..dde4c36e4 --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.float_center.js @@ -0,0 +1,33 @@ + +import { FloatCenterLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class FloatCenterLayoutDemo extends Widget { + static xtype = "demo.float_center"; + + props = { baseCls: "demo-float-center" }; + + render() { + return { + type: FloatCenterLayout.xtype, + items: [ + { + type: Label.xtype, + text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度", + cls: "layout-bg1", + whiteSpace: "normal", + }, + { + type: Label.xtype, + text: "浮动式的中间布局", + cls: "layout-bg2", + whiteSpace: "normal", + } + ], + hgap: 20, + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.flow.js b/packages/demo/src/demo/core/layout/demo.flow.js new file mode 100644 index 000000000..31e897428 --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.flow.js @@ -0,0 +1,92 @@ + +import { CenterAdaptLayout, FloatLeftLayout, Label, FloatRightLayout, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class FlowLayoutDemo extends Widget { + static xtype = "demo.flow"; + + props = { baseCls: "demo-flow" }; + + render() { + return { + type: CenterAdaptLayout.xtype, + items: [ + { + type: FloatLeftLayout.xtype, + items: [ + { + type: Label.xtype, + height: 30, + text: "Left-1", + cls: "layout-bg1", + }, + { + type: Label.xtype, + height: 30, + text: "Left-2", + cls: "layout-bg2", + }, + { + type: Label.xtype, + height: 30, + text: "Left-3", + cls: "layout-bg3", + }, + { + type: Label.xtype, + height: 30, + text: "Left-4", + cls: "layout-bg4", + }, + { + type: Label.xtype, + height: 30, + text: "Left-5", + cls: "layout-bg5", + } + ], + hgap: 20, + }, + { + type: FloatRightLayout.xtype, + hgap: 20, + items: [ + { + type: Label.xtype, + height: 30, + text: "Right-1", + cls: "layout-bg1", + }, + { + type: Label.xtype, + height: 30, + text: "Right-2", + cls: "layout-bg2", + }, + { + type: Label.xtype, + height: 30, + text: "Right-3", + cls: "layout-bg3", + }, + { + type: Label.xtype, + height: 30, + text: "Right-4", + cls: "layout-bg4", + }, + { + type: Label.xtype, + height: 30, + text: "Right-5", + cls: "layout-bg5", + } + ], + vgap: 20, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.grid.js b/packages/demo/src/demo/core/layout/demo.grid.js new file mode 100644 index 000000000..f84f1607f --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.grid.js @@ -0,0 +1,156 @@ + +import { GridLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class GridLayoutDemo extends Widget { + static xtype = "demo.grid"; + + props = { baseCls: "demo-grid" }; + + render() { + return { + type: GridLayout.xtype, + columns: 5, + rows: 3, + items: [ + { + column: 0, + row: 0, + el: { + type: Label.xtype, + text: "column-0, row-0", + cls: "layout-bg1", + }, + }, + { + column: 1, + row: 0, + el: { + type: Label.xtype, + text: "column-1, row-0", + cls: "layout-bg2", + }, + }, + { + column: 2, + row: 0, + el: { + type: Label.xtype, + text: "column-2, row-0", + cls: "layout-bg6", + }, + }, + { + column: 3, + row: 0, + el: { + type: Label.xtype, + text: "column-3, row-0", + cls: "layout-bg3", + }, + }, + { + column: 4, + row: 0, + el: { + type: Label.xtype, + text: "column-4, row-0", + cls: "layout-bg4", + }, + }, + { + column: 0, + row: 1, + el: { + type: Label.xtype, + text: "column-0, row-1", + cls: "layout-bg5", + }, + }, + { + column: 1, + row: 1, + el: { + type: Label.xtype, + text: "column-1, row-1", + cls: "layout-bg6", + }, + }, + { + column: 2, + row: 1, + el: { + type: Label.xtype, + text: "column-2, row-1", + cls: "layout-bg7", + }, + }, + { + column: 3, + row: 1, + el: { + type: Label.xtype, + text: "column-3, row-1", + cls: "layout-bg1", + }, + }, + { + column: 4, + row: 1, + el: { + type: Label.xtype, + text: "column-4, row-1", + cls: "layout-bg3", + }, + }, + { + column: 0, + row: 2, + el: { + type: Label.xtype, + text: "column-0, row-2", + cls: "layout-bg2", + }, + }, + { + column: 1, + row: 2, + el: { + type: Label.xtype, + text: "column-1, row-2", + cls: "layout-bg3", + }, + }, + { + column: 2, + row: 2, + el: { + type: Label.xtype, + text: "column-2, row-2", + cls: "layout-bg4", + }, + }, + { + column: 3, + row: 2, + el: { + type: Label.xtype, + text: "column-3, row-2", + cls: "layout-bg5", + }, + }, + { + column: 4, + row: 2, + el: { + type: Label.xtype, + text: "column-4, row-2", + cls: "layout-bg6", + }, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.horizontal.js b/packages/demo/src/demo/core/layout/demo.horizontal.js new file mode 100644 index 000000000..8e76a19bc --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.horizontal.js @@ -0,0 +1,156 @@ + +import { VerticalLayout, HorizontalLayout, Label, Layout, CenterAdaptLayout, shortcut, Widget, VerticalAlign, HorizontalAlign } from "@fui/core" + + + +@shortcut() +export class HorizontalDemo extends Widget { + static xtype = "demo.horizontal"; + + props = { baseCls: "demo-horizontal" }; + + render() { + return { + type: VerticalLayout.xtype, + vgap: 10, + items: [ + { + type: HorizontalLayout.xtype, + height: 150, + hgap: 10, + items: [ + { + type: Label.xtype, + whiteSpace: "normal", + text: "因为大多数场景下都需要垂直居中,所以这个布局一般会被vertical_adapt布局设置scrollx=true取代", + cls: "layout-bg3", + width: 500, + height: 50, + }, + { + type: Label.xtype, + text: "水平布局", + cls: "layout-bg4", + width: 300, + height: 30, + }, + { + type: Label.xtype, + text: "水平布局", + cls: "layout-bg5", + width: 300, + height: 30, + }, + { + type: Label.xtype, + text: "水平布局", + cls: "layout-bg6", + width: 300, + height: 30, + } + ], + }, + { + type: Layout.xtype, + height: 1, + cls: "bi-border-bottom bi-high-light-border", + }, + { + type: HorizontalLayout.xtype, + height: 150, + verticalAlign: VerticalAlign.Middle, + horizontalAlign: HorizontalAlign.Left, + vgap: 10, + items: [ + { + type: Label.xtype, + text: "以horizontal实现的vertical_adapt垂直居中", + cls: "layout-bg1", + width: 300, + height: 30, + }, + { + type: Label.xtype, + text: "以horizontal实现的vertical_adapt垂直居中", + cls: "layout-bg2", + width: 300, + height: 30, + } + ], + }, + { + type: Layout.xtype, + height: 1, + cls: "bi-border-bottom bi-high-light-border", + }, + { + type: HorizontalLayout.xtype, + height: 150, + verticalAlign: VerticalAlign.Top, + horizontalAlign: HorizontalAlign.Center, + items: [ + { + type: Label.xtype, + text: "以horizontal代替horizontal_adapt实现的水平居中(单元素)", + cls: "layout-bg1", + width: 300, + height: 30, + } + ], + }, + { + type: Layout.xtype, + height: 1, + cls: "bi-border-bottom bi-high-light-border", + }, + { + type: HorizontalLayout.xtype, + height: 150, + verticalAlign: VerticalAlign.Top, + horizontalAlign: HorizontalAlign.Center, + columnSize: [300, "fill"], + items: [ + { + type: Label.xtype, + text: "以horizontal代替horizontal_adapt实现的用于水平适应布局", + cls: "layout-bg1", + height: 30, + }, + { + type: Label.xtype, + text: "以horizontal代替horizontal_adapt实现的水平自适应列", + cls: "layout-bg2", + height: 30, + } + ], + }, + { + type: Layout.xtype, + height: 1, + cls: "bi-border-bottom bi-high-light-border", + }, + { + type: CenterAdaptLayout.xtype, + height: 150, + verticalAlign: VerticalAlign.Middle, + horizontalAlign: HorizontalAlign.Center, + items: [ + { + type: Label.xtype, + text: "以horizontal代替center_adapt实现的水平垂直居中", + width: 300, + height: 100, + cls: "layout-bg1", + } + ], + }, + { + type: Layout.xtype, + height: 1, + cls: "bi-border-bottom bi-high-light-border", + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.horizontal_adapt.js b/packages/demo/src/demo/core/layout/demo.horizontal_adapt.js new file mode 100644 index 000000000..d89efab6c --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.horizontal_adapt.js @@ -0,0 +1,67 @@ + +import { HorizontalAdaptLayout, Label, GridLayout, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class HorizontalAdaptDemo extends Widget { + static xtype = "demo.horizontal_adapt"; + + props = { baseCls: "demo-horizontal-adapt" }; + + _createLayout() { + return createWidget({ + type: HorizontalAdaptLayout.xtype, + items: [ + { + type: Label.xtype, + text: "例子1:可用做水平居中", + cls: "layout-bg1", + width: 300, + height: 30, + } + ], + }); + } + + _createAdaptLayout() { + return createWidget({ + type: HorizontalAdaptLayout.xtype, + columnSize: [300, "fill"], + items: [ + { + type: Label.xtype, + text: "例子2:用于水平适应布局", + cls: "layout-bg1", + height: 30, + }, + { + type: Label.xtype, + text: "水平自适应列", + cls: "layout-bg2", + height: 30, + } + ], + }); + } + + render() { + return { + type: GridLayout.xtype, + columns: 1, + rows: 2, + items: [ + { + column: 0, + row: 0, + el: this._createLayout(), + }, + { + column: 0, + row: 1, + el: this._createAdaptLayout(), + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.horizontal_auto.js b/packages/demo/src/demo/core/layout/demo.horizontal_auto.js new file mode 100644 index 000000000..572b9cf6b --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.horizontal_auto.js @@ -0,0 +1,48 @@ + +import { HorizontalAutoLayout, Label, GridLayout, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class HorizontalAutoDemo extends Widget { + static xtype = "demo.horizontal_auto"; + + props = { baseCls: "demo-horizontal-auto" }; + + _createLayout() { + return createWidget({ + type: HorizontalAutoLayout.xtype, + items: [ + { + type: Label.xtype, + text: "水平居中", + cls: "layout-bg1", + width: 300, + height: 30, + }, + { + type: Label.xtype, + text: "水平居中优先使用该布局", + cls: "layout-bg2", + width: 300, + height: 30, + } + ], + }); + } + + render() { + return { + type: GridLayout.xtype, + columns: 1, + rows: 2, + items: [ + { + column: 0, + row: 0, + el: this._createLayout(), + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.horizontal_float.js b/packages/demo/src/demo/core/layout/demo.horizontal_float.js new file mode 100644 index 000000000..5cf44e22d --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.horizontal_float.js @@ -0,0 +1,25 @@ + +import { FloatHorizontalLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class HorizontalFloatDemo extends Widget { + static xtype = "demo.horizontal_float"; + + props = { baseCls: "demo-horizontal-float" }; + + render() { + return { + type: FloatHorizontalLayout.xtype, + items: [ + { + type: Label.xtype, + text: "浮动式水平居中布局方案,用于宽度未知的情况", + cls: "layout-bg1", + height: 30, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.htape.js b/packages/demo/src/demo/core/layout/demo.htape.js new file mode 100644 index 000000000..52c1a92d1 --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.htape.js @@ -0,0 +1,43 @@ + +import { HTapeLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class HtapeLayoutDemo extends Widget { + static xtype = "demo.htape"; + + props = { baseCls: "demo-htape" }; + + render() { + return { + type: HTapeLayout.xtype, + items: [ + { + width: 100, + el: { + type: Label.xtype, + text: "1", + cls: "bi-background", + }, + }, + { + width: 200, + el: { + type: Label.xtype, + text: "2", + cls: "layout-bg2", + }, + }, + { + width: "fill", + el: { + type: Label.xtype, + text: "3", + cls: "layout-bg3", + }, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.left_right_vertical_adapt.js b/packages/demo/src/demo/core/layout/demo.left_right_vertical_adapt.js new file mode 100644 index 000000000..438236051 --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.left_right_vertical_adapt.js @@ -0,0 +1,53 @@ + +import { LeftRightVerticalAdaptLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class LeftRightVerticalAdaptLayoutDemo extends Widget { + static xtype = "demo.left_right_vertical_adapt"; + + props = { baseCls: "demo-left-right-vertical-adapt" }; + + render() { + return { + type: LeftRightVerticalAdaptLayout.xtype, + lhgap: 10, + rhgap: 30, + items: { + left: [ + { + type: Label.xtype, + text: "左边的垂直居中", + cls: "layout-bg1", + width: 100, + height: 30, + }, + { + type: Label.xtype, + text: "左边的垂直居中", + cls: "layout-bg2", + width: 100, + height: 30, + } + ], + right: [ + { + type: Label.xtype, + text: "右边的垂直居中", + cls: "layout-bg1", + width: 100, + height: 30, + }, + { + type: Label.xtype, + text: "右边的垂直居中", + cls: "layout-bg2", + width: 100, + height: 30, + } + ], + }, + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.table.js b/packages/demo/src/demo/core/layout/demo.table.js new file mode 100644 index 000000000..e988d4a9e --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.table.js @@ -0,0 +1,167 @@ + +import { TableLayout, Layout, GridLayout, shortcut, Widget, createItems } from "@fui/core" + + +@shortcut() +export class TableLayoutDemo extends Widget { + static xtype = "demo.table_layout"; + + props = { baseCls: "demo-table-layout" }; + + _createTable1() { + return { + type: TableLayout.xtype, + items: createItems( + [ + [ + { + el: { + cls: "layout-bg1", + }, + }, + { + el: { + cls: "layout-bg2", + }, + }, + { + el: { + cls: "layout-bg3", + }, + } + ], + [ + { + el: { + cls: "layout-bg4", + }, + }, + { + el: { + cls: "layout-bg5", + }, + }, + { + el: { + cls: "layout-bg6", + }, + } + ], + [ + { + el: { + cls: "layout-bg7", + }, + }, + { + el: { + cls: "layout-bg8", + }, + }, + { + el: { + cls: "layout-bg1", + }, + } + ], + [ + { + el: { + cls: "layout-bg2", + }, + }, + { + el: { + cls: "layout-bg3", + }, + }, + { + el: { + cls: "layout-bg4", + }, + } + ], + [ + { + el: { + cls: "layout-bg5", + }, + }, + { + el: { + cls: "layout-bg6", + }, + }, + { + el: { + cls: "layout-bg7", + }, + } + ], + [ + { + el: { + cls: "layout-bg8", + }, + }, + { + el: { + cls: "layout-bg1", + }, + }, + { + el: { + cls: "layout-bg2", + }, + } + ], + [ + { + el: { + cls: "layout-bg6", + }, + }, + { + el: { + cls: "layout-bg7", + }, + }, + { + el: { + cls: "layout-bg8", + }, + } + ] + ], + { + type: Layout.xtype, + } + ), + columnSize: [100, "fill", 200], + rowSize: [10, 30, 50, 70, 90, 110, 130], + hgap: 20, + vgap: 10, + }; + } + + render() { + return { + type: GridLayout.xtype, + columns: 1, + rows: 1, + items: [ + { + column: 0, + row: 0, + el: this._createTable1(), + } + // , { + // column: 0, + // row: 1, + // el: this._createTable2() + // } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.td.js b/packages/demo/src/demo/core/layout/demo.td.js new file mode 100644 index 000000000..ddd5f70ff --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.td.js @@ -0,0 +1,76 @@ + +import { VerticalLayout, TdLayout, Label, shortcut, Widget, createItems } from "@fui/core" + + +@shortcut() +export class TdLayoutDemo extends Widget { + static xtype = "demo.td"; + + props = { baseCls: "demo-td" }; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: TdLayout.xtype, + columnSize: [100, 100, ""], + items: createItems( + [ + [ + { + el: { + type: Label.xtype, + text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", + cls: "layout-bg1", + }, + }, + { + el: { + type: Label.xtype, + text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", + cls: "layout-bg2", + }, + }, + { + el: { + type: Label.xtype, + text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", + cls: "layout-bg3", + }, + } + ], + [ + { + el: { + type: Label.xtype, + text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", + cls: "layout-bg5", + }, + }, + { + el: { + type: Label.xtype, + text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", + cls: "layout-bg6", + }, + }, + { + el: { + type: Label.xtype, + text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写", + cls: "layout-bg7", + }, + } + ] + ], + { + whiteSpace: "normal", + } + ), + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.vertical.js b/packages/demo/src/demo/core/layout/demo.vertical.js new file mode 100644 index 000000000..263214e1b --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.vertical.js @@ -0,0 +1,32 @@ + +import { VerticalLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class VerticalLayoutDemo extends Widget { + static xtype = "demo.vertical"; + + props = { baseCls: "demo-vertical" }; + + render() { + return { + type: VerticalLayout.xtype, + vgap: 10, + items: [ + { + type: Label.xtype, + cls: "layout-bg3", + text: "垂直布局", + height: 30, + }, + { + type: Label.xtype, + cls: "layout-bg4", + text: "垂直布局", + height: 30, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.vertical_adapt.js b/packages/demo/src/demo/core/layout/demo.vertical_adapt.js new file mode 100644 index 000000000..a6c825d54 --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.vertical_adapt.js @@ -0,0 +1,49 @@ + +import { VerticalAdaptLayout, Label, GridLayout, shortcut, Widget, createWidget } from "@fui/core" + + +@shortcut() +export class VerticalAdaptLayoutDemo extends Widget { + static xtype = "demo.vertical_adapt"; + + props = { baseCls: "demo-vertical-adapt" }; + + _createLayout() { + return createWidget({ + type: VerticalAdaptLayout.xtype, + vgap: 10, + items: [ + { + type: Label.xtype, + text: "垂直居中", + cls: "layout-bg1", + width: 300, + height: 30, + }, + { + type: Label.xtype, + text: "垂直居中", + cls: "layout-bg2", + width: 300, + height: 30, + } + ], + }); + } + + render() { + return { + type: GridLayout.xtype, + columns: 2, + rows: 1, + items: [ + { + column: 0, + row: 0, + el: this._createLayout(), + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/demo.vtape.js b/packages/demo/src/demo/core/layout/demo.vtape.js new file mode 100644 index 000000000..370c46e60 --- /dev/null +++ b/packages/demo/src/demo/core/layout/demo.vtape.js @@ -0,0 +1,46 @@ + +import { VTapeLayout, Label, shortcut, Widget } from "@fui/core" + + +@shortcut() +export class VtapeLayoutDemo extends Widget { + static xtype = "demo.vtape"; + + props = { baseCls: "demo-vtape" }; + + render() { + return { + type: VTapeLayout.xtype, + vgap: 10, + items: [ + { + height: 100, + el: { + type: Label.xtype, + text: "1", + cls: "layout-bg1", + }, + tgap: 10, + vgap: 10, + }, + { + height: 200, + el: { + type: Label.xtype, + text: "2", + cls: "layout-bg2", + }, + }, + { + height: "fill", + el: { + type: Label.xtype, + text: "3", + cls: "layout-bg3", + }, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/layout/index.js b/packages/demo/src/demo/core/layout/index.js new file mode 100644 index 000000000..151ed390b --- /dev/null +++ b/packages/demo/src/demo/core/layout/index.js @@ -0,0 +1,22 @@ +export const meta = { + title: "布局组件", + rank: 9999 +}; + +export * from "./demo.absolute"; +export * from "./demo.border"; +export * from "./demo.center_adapt"; +export * from "./demo.float_center"; +export * from "./demo.flow"; +export * from "./demo.grid"; +export * from "./demo.horizontal"; +export * from "./demo.horizontal_adapt"; +export * from "./demo.horizontal_auto"; +export * from "./demo.horizontal_float"; +export * from "./demo.htape"; +export * from "./demo.left_right_vertical_adapt"; +export * from "./demo.table"; +export * from "./demo.td"; +export * from "./demo.vertical"; +export * from "./demo.vertical_adapt"; +export * from "./demo.vtape"; diff --git a/packages/demo/src/demo/core/popup/demo.layer.js b/packages/demo/src/demo/core/popup/demo.layer.js new file mode 100644 index 000000000..b0fdc81a4 --- /dev/null +++ b/packages/demo/src/demo/core/popup/demo.layer.js @@ -0,0 +1,81 @@ + +import { VerticalLayout, Button, CenterAdaptLayout, shortcut, Widget, UUID, Layers } from "@fui/core" + + + +@shortcut() +export class LayerDemo extends Widget { + static xtype = "demo.layer"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this, + id1 = UUID(), + id2 = UUID(); + + return { + type: VerticalLayout.xtype, + vgap: 10, + items: [ + { + type: Button.xtype, + text: "create形式创建layer, 遮住当前面板, 返回创建的面板对象", + height: 30, + handler() { + Layers.create(id1, self, { + // 偏移量 + offset: { + left: 10, + right: 10, + top: 10, + bottom: 10, + }, + type: CenterAdaptLayout.xtype, + cls: "bi-card", + items: [ + { + type: Button.xtype, + text: "点击关闭", + handler() { + Layers.hide(id1); + }, + } + ], + }); + Layers.show(id1); + }, + }, + { + type: Button.xtype, + text: "make形式创建layer,可以指定放到哪个面板内,这里指定当前面板(默认放在body下撑满), 返回创建的面板对象", + height: 30, + handler() { + Layers.make(id2, self, { + // 偏移量 + offset: { + left: 10, + right: 10, + top: 10, + bottom: 10, + }, + type: CenterAdaptLayout.xtype, + cls: "bi-card", + items: [ + { + type: Button.xtype, + text: "点击关闭", + handler() { + Layers.remove(id2); + }, + } + ], + }); + Layers.show(id2); + }, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/popup/demo.popover.js b/packages/demo/src/demo/core/popup/demo.popover.js new file mode 100644 index 000000000..394b4863d --- /dev/null +++ b/packages/demo/src/demo/core/popup/demo.popover.js @@ -0,0 +1,222 @@ + +import { VerticalLayout, TextButton, BarPopover, Label, ButtonGroup, shortcut, Widget, UUID, map, range, Popovers } from "@fui/core" + + + +@shortcut() +export class PopoverDemo extends Widget { + static xtype = "demo.popover"; + + props = { baseCls: "demo-func" }; + + render() { + const id = UUID(); + let body; + + return { + type: VerticalLayout.xtype, + vgap: 10, + items: [ + { + type: TextButton.xtype, + text: "点击弹出Popover(normal size & fixed)", + height: 30, + handler() { + Popovers.remove(id); + Popovers.create(id, { + type: BarPopover.xtype, + size: "normal", + header: { + type: Label.xtype, + text: "这个是header", + }, + body: { + type: Label.xtype, + text: "这个是body", + }, + }).open(id); + }, + }, + { + type: TextButton.xtype, + text: "点击弹出Popover(small size & fixed)", + height: 30, + handler() { + Popovers.remove(id); + Popovers.create(id, { + type: BarPopover.xtype, + size: "small", + header: { + type: Label.xtype, + text: "这个是header", + }, + body: { + type: Label.xtype, + text: "这个是body", + }, + }).open(id); + }, + }, + { + type: TextButton.xtype, + text: "点击弹出Popover(big size & fixed)", + height: 30, + handler() { + Popovers.remove(id); + Popovers.create(id, { + type: BarPopover.xtype, + size: "big", + header: { + type: Label.xtype, + text: "这个是header", + }, + body: { + type: Label.xtype, + text: "这个是body", + }, + }).open(id); + }, + }, + { + type: TextButton.xtype, + text: "点击弹出Popover(normal size & adapt body区域高度是300)", + height: 30, + handler() { + Popovers.remove(id); + Popovers.create(id, { + type: BarPopover.xtype, + size: "normal", + logic: { + dynamic: true, + }, + header: { + type: Label.xtype, + text: "这个是header", + }, + body: { + type: VerticalLayout.xtype, + items: [ + { + type: ButtonGroup.xtype, + ref() { + body = this; + }, + items: map(range(0, 10), () => { + return { + type: Label.xtype, + text: "1", + height: 30, + }; + }), + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + } + ], + }, + }).open(id); + }, + }, + { + type: TextButton.xtype, + text: "点击弹出Popover(small size & adapt body区域高度是900)", + height: 30, + handler() { + Popovers.remove(id); + Popovers.create(id, { + type: BarPopover.xtype, + size: "small", + logic: { + dynamic: true, + }, + header: { + type: Label.xtype, + text: "这个是header", + }, + body: { + type: VerticalLayout.xtype, + items: [ + { + type: ButtonGroup.xtype, + ref() { + body = this; + }, + items: map(range(0, 30), () => { + return { + type: Label.xtype, + text: "1", + height: 30, + }; + }), + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + } + ], + }, + }).open(id); + }, + }, + { + type: TextButton.xtype, + text: "点击弹出Popover(custom)", + height: 30, + handler() { + Popovers.remove(id); + Popovers.create(id, { + width: 400, + height: 300, + header: { + type: Label.xtype, + text: "这个是header", + }, + body: { + type: Label.xtype, + text: "这个是body", + }, + footer: { + type: Label.xtype, + text: "这个是footer", + }, + }).open(id); + }, + }, + { + type: TextButton.xtype, + height: 30, + text: "弹出一个高度动态的popover层, 此弹出层指定size为small, 但是高度随内容自适应,自适应支持的最大高度为默认为600px", + handler() { + const id = "弹出层id1"; + Popovers.create(id, { + // String或者是json都行 + header: "弹出层标题", + logic: { + dynamic: true, + maxHeight: 700, + }, + size: "small", + body: { + type: VerticalLayout.xtype, + items: map(range(0, 50), (idx, v) => { + return { + type: Label.xtype, + text: "弹出层内容", + }; + }), + }, + footer: { + type: Label.xtype, + text: "这个是footer", + }, + }).open(id); + }, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/popup/demo.popup_view.js b/packages/demo/src/demo/core/popup/demo.popup_view.js new file mode 100644 index 000000000..69d404bf3 --- /dev/null +++ b/packages/demo/src/demo/core/popup/demo.popup_view.js @@ -0,0 +1,50 @@ + +import { AbsoluteLayout, Combo, TextButton, PopupView, ButtonGroup, VerticalLayout, MultiSelectItem, shortcut, Widget, createItems, deepClone } from "@fui/core" +import { CONSTANTS } from "@/config/constant"; + + +@shortcut() +export class PopupViewDemo extends Widget { + static xtype = "demo.popup_view"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: Combo.xtype, + width: 200, + height: 30, + el: { + type: TextButton.xtype, + text: "点击", + cls: "bi-border", + height: 30, + }, + popup: { + type: PopupView.xtype, + el: { + type: ButtonGroup.xtype, + layouts: [ + { + type: VerticalLayout.xtype, + } + ], + items: createItems(deepClone(CONSTANTS.ITEMS), { + type: MultiSelectItem.xtype, + height: 25, + }), + }, + }, + }, + } + ], + }; + } +} + diff --git a/packages/demo/src/demo/core/popup/demo.searcher_view.js b/packages/demo/src/demo/core/popup/demo.searcher_view.js new file mode 100644 index 000000000..241c54350 --- /dev/null +++ b/packages/demo/src/demo/core/popup/demo.searcher_view.js @@ -0,0 +1,68 @@ +import { + AbsoluteLayout, + SearcherView, + Label, + shortcut, + Widget, + createItems +} from "@fui/core"; + +@shortcut() +export class SearcherViewDemo extends Widget { + static xtype = "demo.searcher_view"; + + props = { baseCls: "demo-func" }; + + render() { + const self = this; + + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: SearcherView.xtype, + ref() { + self.searcherView = this; + } + }, + left: 100, + top: 20, + width: 230 + } + ] + }; + } + + mounted() { + this.searcherView.populate( + createItems( + [ + { + text: 2012 + }, + { + text: 2013 + }, + { + text: 2014 + }, + { + text: 2015 + } + ], + { + type: Label.xtype, + textHeight: 24, + height: 24 + } + ), + [ + { + text: 2 + } + ], + "2" + ); + } +} diff --git a/packages/demo/src/demo/core/popup/index.js b/packages/demo/src/demo/core/popup/index.js new file mode 100644 index 000000000..d6f2c44b0 --- /dev/null +++ b/packages/demo/src/demo/core/popup/index.js @@ -0,0 +1,4 @@ +export * from "./demo.layer"; +export * from "./demo.popover"; +export * from "./demo.popup_view"; +export * from "./demo.searcher_view"; diff --git a/packages/demo/src/demo/fix-2.0/context.js b/packages/demo/src/demo/fix-2.0/context.js new file mode 100644 index 000000000..2264ef9b6 --- /dev/null +++ b/packages/demo/src/demo/fix-2.0/context.js @@ -0,0 +1,81 @@ +import { shortcut, Widget, AbsoluteLayout, Button, Fix, model, Models } from '@fui/core'; + +@model() +class ParentStore extends Fix.Model { + static xtype = 'demo.model.context.parent_store'; + + state() { + return { + context: '默认context', + }; + } + childContext = ['context']; +} + +@model() +class ChildStore extends Fix.Model { + static xtype = 'demo.model.context.child_store'; + + context = ['context']; + computed = { + currContext: function () { + return this.model.context; + }, + }; + actions = { + changeContext: function () { + this.model.context = '改变后的context'; + }, + }; +} + +@shortcut() +class Child extends Widget { + static xtype = 'demo.fix_context_child'; + + _store() { + return Models.getModel(ChildStore.xtype); + } + + watch = { + currContext(val) { + this.button.setText(val); + }, + }; + + render() { + var self = this; + return { + type: Button.xtype, + ref() { + self.button = this; + }, + text: this.model.context, + handler() { + self.store.changeContext(); + }, + }; + } +} + +@shortcut() +export class FixContextDemo extends Widget { + static xtype = 'demo.fix_context'; + + _store() { + return Models.getModel(ParentStore.xtype); + } + + render() { + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: Child.xtype, + }, + }, + ], + }; + } +} diff --git a/packages/demo/src/demo/fix-2.0/define.js b/packages/demo/src/demo/fix-2.0/define.js new file mode 100644 index 000000000..851c2bbe3 --- /dev/null +++ b/packages/demo/src/demo/fix-2.0/define.js @@ -0,0 +1,40 @@ +import { shortcut, AbsoluteLayout, Button, Widget, Fix } from '@fui/core'; + +@shortcut() +export class DefineDemo extends Widget { + static xtype = 'demo.fix2.define'; + + watch = { + name() { + this.button.setText(this.model.name); + }, + }; + + _store() { + return Fix.define({ + name: '原始属性', + }); + } + + render() { + const self = this; + + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: Button.xtype, + ref() { + self.button = this; + }, + handler() { + self.model.name = '这是改变后的属性'; + }, + text: this.model.name, + }, + }, + ], + }; + } +} diff --git a/packages/demo/src/demo/fix-2.0/index.js b/packages/demo/src/demo/fix-2.0/index.js new file mode 100644 index 000000000..6d259a331 --- /dev/null +++ b/packages/demo/src/demo/fix-2.0/index.js @@ -0,0 +1,7 @@ +export const meta = { + title: '数据流框架 fix-2.0', + rank: 0, +}; + +export * from './define'; +export * from './context'; diff --git a/packages/demo/src/demo/index.js b/packages/demo/src/demo/index.js new file mode 100644 index 000000000..7a777eea5 --- /dev/null +++ b/packages/demo/src/demo/index.js @@ -0,0 +1,6 @@ +export * as base from "./base"; +export * as core from "./core"; +export * as caseModule from "./case"; +export * as widget from "./widget"; +export * as component from "./component"; +export * as fix from "./fix-2.0"; diff --git a/plugins/webpack-fui-worker-plugin/empty.js b/packages/demo/src/demo/slides.js similarity index 100% rename from plugins/webpack-fui-worker-plugin/empty.js rename to packages/demo/src/demo/slides.js diff --git a/packages/demo/src/demo/widget/basewidget/demo.buttons.js b/packages/demo/src/demo/widget/basewidget/demo.buttons.js new file mode 100644 index 000000000..8f60986da --- /dev/null +++ b/packages/demo/src/demo/widget/basewidget/demo.buttons.js @@ -0,0 +1,94 @@ +import { + Button, + MultiSelectBar, + FloatLeftLayout, + shortcut, + Widget, + each, + Msg +} from "@fui/core"; + +@shortcut() +export class ButtonsDemo extends Widget { + static xtype = "demo.buttons"; + + props = { baseCls: "demo-button" }; + + render() { + const items = [ + { + el: { + type: Button.xtype, + text: "一般按钮", + level: "common", + height: 30 + } + }, + { + el: { + type: Button.xtype, + text: "带图标的按钮", + // level: 'ignore', + iconCls: "close-font", + height: 30 + } + }, + { + el: { + type: Button.xtype, + text: "一般按钮", + block: true, + level: "common", + height: 30 + } + }, + { + el: { + type: Button.xtype, + text: "一般按钮", + clear: true, + level: "common", + height: 30 + } + }, + { + el: { + type: MultiSelectBar.xtype, + selected: true, + halfSelected: true + } + }, + { + el: { + type: MultiSelectBar.xtype, + selected: true, + halfSelected: false + } + }, + { + el: { + type: MultiSelectBar.xtype, + selected: false, + halfSelected: true + } + }, + { + el: { + type: MultiSelectBar.xtype + } + } + ]; + each(items, (i, item) => { + item.el.handler = function () { + Msg.alert("按钮", this.options.text); + }; + }); + + return { + type: FloatLeftLayout.xtype, + vgap: 100, + hgap: 20, + items + }; + } +} diff --git a/packages/demo/src/demo/widget/basewidget/demo.items.js b/packages/demo/src/demo/widget/basewidget/demo.items.js new file mode 100644 index 000000000..11a3959c1 --- /dev/null +++ b/packages/demo/src/demo/widget/basewidget/demo.items.js @@ -0,0 +1,53 @@ +import { + shortcut, + Widget, + VerticalLayout, + TextButton, + SingleSelectItem, + SingleSelectRadioItem, + Label, + MultiSelectItem, + Switch +} from "@fui/core"; + +@shortcut() +export class Items extends Widget { + static xtype = "demo.items"; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: TextButton.xtype, + cls: "bi-list-item-select bi-high-light-border bi-border", + height: 30, + level: "warning", + text: "单选item" + }, + { + type: SingleSelectItem.xtype, + text: "单选项" + }, + { + type: SingleSelectRadioItem.xtype, + text: "单选项" + }, + { + type: Label.xtype, + height: 30, + text: "复选item" + }, + { + type: MultiSelectItem.xtype, + text: "复选项" + }, + { + type: Switch.xtype, + selected: true + } + ], + hgap: 300 + }; + } +} diff --git a/packages/demo/src/demo/widget/basewidget/demo.nodes.js b/packages/demo/src/demo/widget/basewidget/demo.nodes.js new file mode 100644 index 000000000..494d37697 --- /dev/null +++ b/packages/demo/src/demo/widget/basewidget/demo.nodes.js @@ -0,0 +1,50 @@ +import { + shortcut, + Widget, + VerticalLayout, + Label, + PlusGroupNode, + ArrowNode, + IconArrowNode, + MultiLayerIconArrowNode +} from "@fui/core"; + +@shortcut() +export class NodesDemo extends Widget { + static xtype = "demo.nodes"; + + render(vessel) { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + height: 30, + text: "十字形的节点" + }, + { + type: PlusGroupNode.xtype, + text: "十字形的节点" + }, + { + type: Label.xtype, + height: 30, + text: "箭头节点" + }, + { + type: ArrowNode.xtype, + text: "箭头节点" + }, + { + type: IconArrowNode.xtype, + iconCls: "search-font", + text: "箭头图标节点" + }, + { + type: MultiLayerIconArrowNode.xtype, + layer: 2 + } + ] + }; + } +} diff --git a/packages/demo/src/demo/widget/basewidget/demo.sagments.js b/packages/demo/src/demo/widget/basewidget/demo.sagments.js new file mode 100644 index 000000000..ccbc2105c --- /dev/null +++ b/packages/demo/src/demo/widget/basewidget/demo.sagments.js @@ -0,0 +1,40 @@ +import { VerticalLayout, Label, Segment, shortcut, Widget } from "@fui/core"; + +@shortcut() +export class SegmentsDemo extends Widget { + static xtype = "demo.segments"; + + render() { + return { + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + height: 30, + text: "默认风格" + }, + { + type: Segment.xtype, + items: [ + { + text: "tab1", + value: 1, + selected: true + }, + { + text: "tab2", + value: 2 + }, + { + text: "tab3 disabled", + disabled: true, + value: 3 + } + ] + } + ], + hgap: 50, + vgap: 20 + }; + } +} diff --git a/packages/demo/src/demo/widget/basewidget/demo.tips.js b/packages/demo/src/demo/widget/basewidget/demo.tips.js new file mode 100644 index 000000000..3cb3fbff5 --- /dev/null +++ b/packages/demo/src/demo/widget/basewidget/demo.tips.js @@ -0,0 +1,175 @@ +import { + Bubbles, + Msg, + shortcut, + Widget, + createWidget, + each, + FloatLeftLayout, + Button, + VerticalLayout, + Label, + HorizontalAutoLayout +} from "@fui/core"; + +@shortcut() +export class TipsDemo extends Widget { + static xtype = "demo.tips"; + + props = { baseCls: "demo-tips" }; + + render() { + const btns = []; + const bubble = createWidget({ + type: FloatLeftLayout.xtype, + items: [ + { + el: { + type: Button.xtype, + text: "bubble测试", + height: 30, + handler() { + Bubbles.show("singleBubble1", "bubble测试", this); + btns.push("singleBubble1"); + } + } + }, + { + el: { + type: Button.xtype, + text: "bubble测试(居中显示)", + height: 30, + handler() { + Bubbles.show("singleBubble2", "bubble测试", this, { + offsetStyle: "center" + }); + btns.push("singleBubble2"); + } + } + }, + { + el: { + type: Button.xtype, + text: "bubble测试(右边显示)", + height: 30, + handler() { + Bubbles.show("singleBubble3", "bubble测试", this, { + offsetStyle: "right" + }); + btns.push("singleBubble3"); + } + } + }, + { + el: { + type: Button.xtype, + text: "隐藏所有 bubble", + height: 30, + cls: "layout-bg2", + handler() { + each(btns, (index, value) => { + Bubbles.hide(value); + }); + } + } + } + ], + hgap: 20 + }); + + const title = createWidget({ + type: VerticalLayout.xtype, + items: [ + { + type: Label.xtype, + cls: "layout-bg1", + height: 50, + title: "title提示", + text: "移上去有title提示", + textAlign: "center" + }, + { + type: Label.xtype, + cls: "layout-bg6", + height: 50, + disabled: true, + warningTitle: "title错误提示", + text: "移上去有title错误提示", + textAlign: "center" + }, + { + type: Label.xtype, + cls: "layout-bg2", + height: 50, + disabled: true, + tipType: "success", + title: "自定义title提示效果", + warningTitle: "自定义title提示效果", + text: "自定义title提示效果", + textAlign: "center" + } + ], + hgap: 20, + vgap: 20 + }); + + const toast = createWidget({ + type: VerticalLayout.xtype, + items: [ + { + el: { + type: Button.xtype, + text: "简单Toast测试", + height: 30, + handler() { + Msg.toast("这是一条简单的数据"); + } + } + }, + { + el: { + type: Button.xtype, + text: "很长的Toast测试", + height: 30, + handler() { + Msg.toast( + "这是一条很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的数据" + ); + } + } + }, + { + el: { + type: Button.xtype, + text: "非常长的Toast测试", + height: 30, + handler() { + Msg.toast( + "这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据" + ); + } + } + }, + { + el: { + type: Button.xtype, + text: "错误提示Toast测试", + level: "warning", + height: 30, + handler() { + Msg.toast("错误提示Toast测试", "warning"); + } + } + } + ], + vgap: 20 + }); + + return { + type: HorizontalAutoLayout.xtype, + vgap: 20, + hgap: 20, + items: [bubble, title, toast] + }; + } +} diff --git a/packages/demo/src/demo/widget/basewidget/index.js b/packages/demo/src/demo/widget/basewidget/index.js new file mode 100644 index 000000000..74e1099d2 --- /dev/null +++ b/packages/demo/src/demo/widget/basewidget/index.js @@ -0,0 +1,9 @@ +export const meta = { + title: "各种小控件" +}; + +export * from "./demo.buttons"; +export * from "./demo.items"; +export * from "./demo.nodes"; +export * from "./demo.sagments"; +export * from "./demo.tips"; diff --git a/packages/demo/src/demo/widget/collapase/demo.collapse.js b/packages/demo/src/demo/widget/collapase/demo.collapse.js new file mode 100644 index 000000000..7a9da8d11 --- /dev/null +++ b/packages/demo/src/demo/widget/collapase/demo.collapse.js @@ -0,0 +1,82 @@ +import { + shortcut, + Widget, + createItems, + SingleSelectItem, + Label, + VerticalLayout, + Collapse +} from "@fui/core"; + +@shortcut() +export class CollapseDemo extends Widget { + static xtype = "demo.collapse"; + + props = { baseCls: "demo-collapse" }; + + render() { + const self = this; + + const items = [ + { + value: "test", + popup: { + cls: "mvc-border", + items: createItems( + [ + { + text: "项目1", + value: 1 + }, + { + text: "项目2", + value: 2 + }, + { + text: "项目3", + value: 3 + }, + { + text: "项目4", + value: 4 + } + ], + { + type: SingleSelectItem.xtype, + height: 25 + } + ) + } + }, + { + value: 2, + popup: { + type: Label.xtype, + value: "给岁月以文明,而不是给文明以岁月" + } + }, + { + value: 3, + popup: { + type: Label.xtype, + value: "漂流瓶隐没于黑暗里,在一千米见方的宇宙中,只有生态球里的小太阳发出一点光芒。在这个小小的生命世界中,几只清澈的水球在零重力环境中静静地飘浮着,有一条小鱼从一只水球中蹦出,跃入另一只水球,轻盈地穿游于绿藻之间。" + } + } + ]; + + return { + type: VerticalLayout.xtype, + items: [ + { + type: Collapse.xtype, + accordion: true, + items, + value: [2] + } + ], + width: "60%", + tgap: 100, + hgap: 100 + }; + } +} diff --git a/packages/demo/src/demo/widget/collapase/index.js b/packages/demo/src/demo/widget/collapase/index.js new file mode 100644 index 000000000..874481a67 --- /dev/null +++ b/packages/demo/src/demo/widget/collapase/index.js @@ -0,0 +1,5 @@ +export const meta = { + title: "collapase" +}; + +export * from "./demo.collapse"; diff --git a/packages/demo/src/demo/widget/date/demo.datepane.js b/packages/demo/src/demo/widget/date/demo.datepane.js new file mode 100644 index 000000000..98bd52dd1 --- /dev/null +++ b/packages/demo/src/demo/widget/date/demo.datepane.js @@ -0,0 +1,104 @@ +import { + shortcut, + Widget, + Msg, + HorizontalAutoLayout, + VerticalLayout, + DynamicDatePane, + Button, + DynamicDateTimePane +} from "@fui/core"; + +@shortcut() +export class DatePane extends Widget { + static xtype = "demo.date_pane"; + + props = { baseCls: "demo-datepane" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: VerticalLayout.xtype, + vgap: 10, + items: [ + { + type: DynamicDatePane.xtype, + // value: { + // type: 1, + // value: { + // year: 2017, + // month: 12, + // day: 11 + // } + // }, + ref(_ref) { + self.datepane = _ref; + }, + height: 300 + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast( + `date${JSON.stringify( + self.datepane.getValue() + )}` + ); + } + }, + { + type: DynamicDateTimePane.xtype, + value: { + type: 1, + value: { + year: 2017, + month: 12, + day: 11, + hour: 12, + minute: 12, + second: 12 + } + }, + ref(_ref) { + self.dateTimePane = _ref; + }, + height: 340 + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast( + `date${JSON.stringify( + self.dateTimePane.getValue() + )}` + ); + } + }, + { + type: Button.xtype, + text: "setValue '2017-12-31'", + handler() { + self.datepane.setValue({ + year: 2017, + month: 12, + day: 31 + }); + } + } + ], + width: "50%" + } + ] + }; + } + + mounted() { + this.datepane.setValue(); // 不设value值表示当前时间 + } +} diff --git a/packages/demo/src/demo/widget/date/demo.multidate_combo.js b/packages/demo/src/demo/widget/date/demo.multidate_combo.js new file mode 100644 index 000000000..dfc684802 --- /dev/null +++ b/packages/demo/src/demo/widget/date/demo.multidate_combo.js @@ -0,0 +1,124 @@ +import { + shortcut, + Widget, + Msg, + HorizontalAutoLayout, + DynamicDateCombo, + Button, + DynamicDateTimeCombo +} from "@fui/core"; + +@shortcut() +export class Date extends Widget { + static xtype = "demo.multidate_combo"; + + props = { baseCls: "demo-date" }; + + _init(...args) { + super._init(...args); + } + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + vgap: 20, + items: [ + { + type: DynamicDateCombo.xtype, + ref() { + self.datecombo = this; + }, + width: 300, + // allowEdit: false, + // format: "%Y-%X-%d", // yyyy-MM-dd + // format: "%Y/%X/%d", // yyyy/MM/dd + // format: "%Y-%x-%e", // yyyy-M-d + // format: "%Y/%x/%e", // yyyy/M/d + // format: "%X/%d/%Y", // MM/dd/yyyy + // format: "%X/%e/%y", // MM/d/yy + // format: "%X.%d.%Y", // MM.dd.yyyy + // format: "%X.%e.%Y", // MM.d.yyyy + // format: "%X-%e-%y", // MM.d.yyyy + value: { + type: 1, + value: { + year: 2018, + month: 2, + day: 23 + } + } + }, + { + type: Button.xtype, + text: "getValue", + width: 300, + handler() { + Msg.alert( + "date", + JSON.stringify(self.datecombo.getValue()) + ); + } + }, + { + type: DynamicDateTimeCombo.xtype, + ref() { + self.datetimecombo = this; + }, + width: 300, + // allowEdit: false, + // format: "%Y-%X-%d %H:%M:%S", // yyyy-MM-dd HH:mm:ss + // format: "%Y/%X/%d %H:%M:%S", // yyyy/MM/dd HH:mm:ss + // format: "%Y-%X-%d %I:%M:%S", // yyyy-MM-dd hh:mm:ss + // format: "%Y/%X/%d %I:%M:%S", // yyyy/MM/dd hh:mm:ss + // format: "%Y-%X-%d %H:%M:%S %p", // yyyy-MM-dd HH:mm:ss a + // format: "Y/%X/%d %H:%M:%S %p", // yyyy/MM/dd HH:mm:ss a + // format: "%Y-%X-%d %I:%M:%S %p", // yyyy-MM-dd hh:mm:ss a + // format: "%Y/%X/%d %I:%M:%S %p", // yyyy/MM/dd hh:mm:ss a + // format: "%X/%d/%Y %I:%M:%S", // MM/dd/yyyy hh:mm:ss + // format: "%X/%d/%Y %H:%M:%S", // MM/dd/yyyy HH:mm:ss + // format: "%X/%d/%Y %I:%M:%S", // MM/dd/yyyy hh:mm:ss a + // format: "%X/%d/%Y %H:%M:%S %p", // MM/dd/yyyy HH:mm:ss a + // format: "%X/%d/%Y %I:%M:%S %p", // MM/dd/yyyy hh:mm:ss a + // format: "%X/%d/%Y %H:%M:%S %p", // MM/dd/yyyy HH:mm:ss a + // format: "%X/%d/%Y %l:%M %p", // MM/dd/yyyy h:mm a + // format: "%X-%d-%Y %k:%M %p", // MM/dd/yyyy H:mm a + // format: "%Y-%x-%e %l:%M", // yyyy-M-d h:mm + // format: "%Y-%x-%e %k:%M", // yyyy-M-d H:mm + value: { + type: 1, + value: { + year: 2018, + month: 2, + day: 23 + } + } + }, + { + type: Button.xtype, + text: "getValue", + width: 300, + handler() { + Msg.alert( + "date", + JSON.stringify(self.datetimecombo.getValue()) + ); + } + }, + { + type: Button.xtype, + text: "setValue '2017-12-31'", + width: 300, + handler() { + self.datecombo.setValue({ + year: 2017, + month: 11, + day: 31 + }); + } + } + ] + }; + } +} diff --git a/demo/js/widget/date/index.js b/packages/demo/src/demo/widget/date/index.js similarity index 100% rename from demo/js/widget/date/index.js rename to packages/demo/src/demo/widget/date/index.js diff --git a/packages/demo/src/demo/widget/datetime/demo.datetime.js b/packages/demo/src/demo/widget/datetime/demo.datetime.js new file mode 100644 index 000000000..c13242cfe --- /dev/null +++ b/packages/demo/src/demo/widget/datetime/demo.datetime.js @@ -0,0 +1,65 @@ +import { + AbsoluteLayout, + DateTimeCombo, + shortcut, + Widget, + print, + Msg, +} from "@fui/core"; + +@shortcut() +export class CustomDateTimeDemo extends Widget { + static xtype = "demo.date_time"; + + props = {}; + + render() { + const self = this; + + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: DateTimeCombo.xtype, + listeners: [ + { + eventName: DateTimeCombo.EVENT_CONFIRM, + action() { + const value = this.getValue(); + const date = new Date( + value.year, + value.month - 1, + value.day, + value.hour, + value.minute, + value.second + ); + const dateStr = print( + date, + "%Y-%X-%d %H:%M:%S" + ); + Msg.alert("日期", dateStr); + } + }, + { + eventName: DateTimeCombo.EVENT_CANCEL, + action() {} + } + ], + value: { + year: 2017, + month: 2, + day: 23, + hour: 12, + minute: 11, + second: 1 + } + }, + top: 200, + left: 200 + } + ] + }; + } +} diff --git a/demo/js/widget/datetime/index.js b/packages/demo/src/demo/widget/datetime/index.js similarity index 100% rename from demo/js/widget/datetime/index.js rename to packages/demo/src/demo/widget/datetime/index.js diff --git a/packages/demo/src/demo/widget/downlist/demo.downlist.icon.js b/packages/demo/src/demo/widget/downlist/demo.downlist.icon.js new file mode 100644 index 000000000..7ead43c98 --- /dev/null +++ b/packages/demo/src/demo/widget/downlist/demo.downlist.icon.js @@ -0,0 +1,16 @@ + +import { Label, shortcut, Widget } from "@fui/core" + +@shortcut() +export class CustomIcon extends Widget { + static xtype = "demo.downlist.icon"; + + render() { + return { + type: Label.xtype, + text: "✨", + }; + } +} + + diff --git a/packages/demo/src/demo/widget/downlist/demo.downlist.js b/packages/demo/src/demo/widget/downlist/demo.downlist.js new file mode 100644 index 000000000..fccb8c3e6 --- /dev/null +++ b/packages/demo/src/demo/widget/downlist/demo.downlist.js @@ -0,0 +1,278 @@ +import { + shortcut, + Widget, + i18nText, + DownListCombo, + FloatLeftLayout, + Button, + MultiLayerDownListCombo, + Label +} from "@fui/core"; + +@shortcut() +export class DownlistDemo extends Widget { + static xtype = "demo.down_list"; + + props = { baseCls: "demo-downlist" }; + + mounted() { + const downlist = this.downlist; + const label = this.label; + this.downlist.setValue([ + { + value: [11, 6], + childValue: 67 + } + ]); + downlist.on(DownListCombo.EVENT_CHANGE, (value, fatherValue) => { + label.setValue(JSON.stringify(downlist.getValue())); + }); + + this.downlist.on( + DownListCombo.EVENT_SON_VALUE_CHANGE, + (value, fatherValue) => { + label.setValue(JSON.stringify(downlist.getValue())); + } + ); + } + + render() { + const self = this; + + return { + type: FloatLeftLayout.xtype, + items: [ + { + type: DownListCombo.xtype, + ref(_ref) { + self.downlist = _ref; + }, + // value: [{"childValue":22,"value":11},{"value":18},{"value":20}], + height: 30, + width: 100, + items: [ + [ + { + text: "column 1111", + iconCls1: "dot-e-font", + value: 12, + children: [ + { + text: "column 1.1", + value: 21, + cls: "dot-e-font" + }, + { + text: "column 1.2", + value: 22, + cls: "dot-e-font" + } + ] + } + ], + [ + { + el: { + text: "column 1111", + iconCls1: "dot-e-font", + value: 11 + }, + children: [ + { + text: "column 1.1", + value: 21, + cls: "dot-e-font" + }, + { + text: "column 1.2", + value: 22, + cls: "dot-e-font" + } + ] + // children: [{ + // text: i18nText("BI-Basic_None"), + // cls: "dot-e-font", + // value: 1 + // }, { + // text: i18nText("BI-Basic_Calculate_Same_Period"), + // cls: "dot-e-font", + // value: 2 + // }, { + // text: i18nText("BI-Basic_Calculate_Same_Ring"), + // cls: "dot-e-font", + // value: 3 + // }, { + // text: i18nText("BI-Basic_Calculate_Same_Period_Rate"), + // cls: "dot-e-font", + // value: 4 + // }, { + // text: i18nText("BI-Basic_Calculate_Same_Ring_Rate"), + // cls: "dot-e-font", + // value: 5 + // }, { + // el: { + // text: i18nText("BI-Basic_Rank"), + // iconCls1: "dot-e-font", + // value: 6 + // }, + // children: [{ + // text: "test1", + // cls: "dot-e-font", + // value: 67 + // }, { + // text: "test2", + // cls: "dot-e-font", + // value: 68 + // }] + // }, { + // text: i18nText("BI-Basic_Rank_In_Group"), + // cls: "dot-e-font", + // value: 7 + // }, { + // text: i18nText("BI-Basic_Sum_Of_All"), + // cls: "dot-e-font", + // value: 8 + // }, { + // text: i18nText("BI-Basic_Sum_Of_All_In_Group"), + // cls: "dot-e-font", + // value: 9 + // }, { + // text: i18nText("BI-Basic_Sum_Of_Above"), + // cls: "dot-e-font", + // value: 10 + // }, { + // text: i18nText("BI-Basic_Sum_Of_Above_In_Group"), + // cls: "dot-e-font", + // value: 11 + // }, { + // text: i18nText("BI-Design_Current_Dimension_Percent"), + // cls: "dot-e-font", + // value: 12 + // }, { + // text: i18nText("BI-Design_Current_Target_Percent"), + // cls: "dot-e-font", + // value: 13 + // }] + } + ] + ] + }, + { + type: DownListCombo.xtype, + el: { + type: Button.xtype, + ghost: true, + iconPosition: "right", + icon: "column-next-page-h-font", + text: "自定义 trigger 和 icon 的级联下拉框" + }, + listeners: [ + { + eventName: "EVENT_CHANGE", + action(v) { + console.log("触发值", v); + } + }, + { + eventName: "EVENT_SON_VALUE_CHANGE", + action(v) { + console.log("二级菜单触发值", v); + } + } + ], + items: [ + [ + { + text: "选项一", + value: 1, + icon: { + type: "demo.downlist.icon" + }, + children: [ + { + text: "选项一", + value: 11, + icon: { + type: "demo.downlist.icon" + } + }, + { + text: "选项二", + value: 12 + } + ] + }, + { + text: "选项二", + value: 2 + } + ] + ] + }, + { + type: MultiLayerDownListCombo.xtype, + ref(_ref) { + self.downlist = _ref; + }, + // value: [{"childValue":22,"value":11},{"value":18},{"value":20}], + height: 30, + width: 100, + items: [ + [ + { + el: { + text: "column 1111", + iconCls1: "dot-e-font", + value: 12 + }, + children: [ + { + text: "column 1.1", + value: 21, + cls: "dot-e-font" + }, + { + text: "column 1.2", + value: 22, + cls: "dot-e-font" + } + ] + } + ], + [ + { + el: { + text: "column 1111", + iconCls1: "dot-e-font", + value: 11 + }, + children: [ + { + text: "column 1.1", + value: 21, + cls: "dot-e-font" + }, + { + text: "column 1.2", + value: 22, + cls: "dot-e-font" + } + ] + } + ] + ] + }, + { + type: Label.xtype, + text: "显示选择值", + width: 500, + cls: "layout-bg3", + ref(_ref) { + self.label = _ref; + } + } + ], + vgap: 20 + }; + } +} diff --git a/demo/js/widget/downlist/index.js b/packages/demo/src/demo/widget/downlist/index.js similarity index 100% rename from demo/js/widget/downlist/index.js rename to packages/demo/src/demo/widget/downlist/index.js diff --git a/packages/demo/src/demo/widget/editor/demo.search_editor.js b/packages/demo/src/demo/widget/editor/demo.search_editor.js new file mode 100644 index 000000000..0b3cfa9ba --- /dev/null +++ b/packages/demo/src/demo/widget/editor/demo.search_editor.js @@ -0,0 +1,37 @@ +import { + HorizontalAutoLayout, + SearchEditor, + SmallSearchEditor, + shortcut, + Widget +} from "@fui/core"; + +@shortcut() +export class SearchEditorDemo extends Widget { + static xtype = "demo.search_editor"; + + props = { baseCls: "demo-exceltable" }; + + render() { + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: SearchEditor.xtype, + width: 300, + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker() { + return this.getValue().length > 4; + } + }, + { + type: SmallSearchEditor.xtype, + width: 300, + watermark: "这个是 small,小一号" + } + ], + vgap: 20 + }; + } +} diff --git a/packages/demo/src/demo/widget/editor/demo.text_editor.js b/packages/demo/src/demo/widget/editor/demo.text_editor.js new file mode 100644 index 000000000..8ea69c4d3 --- /dev/null +++ b/packages/demo/src/demo/widget/editor/demo.text_editor.js @@ -0,0 +1,29 @@ +import { HorizontalAutoLayout, TextEditor, shortcut, Widget } from "@fui/core"; + +@shortcut() +export class TextEditorDemo extends Widget { + static xtype = "demo.text_editor"; + + props = { baseCls: "demo-exceltable" }; + + render() { + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: TextEditor.xtype, + watermark: "这是水印,watermark", + width: 300 + }, + { + type: TextEditor.xtype, + watermark: "这个不予许空", + allowBlank: false, + errorText: "非空!", + width: 300 + } + ], + vgap: 20 + }; + } +} diff --git a/demo/js/widget/editor/index.js b/packages/demo/src/demo/widget/editor/index.js similarity index 100% rename from demo/js/widget/editor/index.js rename to packages/demo/src/demo/widget/editor/index.js diff --git a/packages/demo/src/demo/widget/index.js b/packages/demo/src/demo/widget/index.js new file mode 100644 index 000000000..5d6c985fc --- /dev/null +++ b/packages/demo/src/demo/widget/index.js @@ -0,0 +1,30 @@ +export const meta = { + title: "详细控件 widget", + rank: 6 +}; + +export * as basewiget from "./basewidget"; +export * as collapase from "./collapase"; +export * as date from "./date"; +export * as datetime from "./datetime"; +export * as downlist from "./downlist"; +export * as editor from "./editor"; +export * as multiselect from "./multiselect"; +export * as multitree from "./multitree"; +export * as numbereditor from "./numbereditor"; +export * as numberinterval from "./numberinterval"; +export * as selecttree from "./selecttree"; +export * as singleselct from "./singleselct"; + +export * as singletree from "./singletree"; +export * as slider from "./slider"; +export * as timecombo from "./timecombo"; +export * as timeinterval from "./timeinterval"; +export * as tree from "./tree"; +export * as year from "./year"; +export * as yearinterval from "./yearinterval"; + +export * as yearmonth from "./yearmonth"; +export * as yearmonthinterval from "./yearmonthinterval"; +export * as yearquarter from "./yearquarter"; +export * as yearquarterinterval from "./yearquarterinterval"; diff --git a/packages/demo/src/demo/widget/multiselect/demo.multi_select_combo.js b/packages/demo/src/demo/widget/multiselect/demo.multi_select_combo.js new file mode 100644 index 000000000..e4f1d1219 --- /dev/null +++ b/packages/demo/src/demo/widget/multiselect/demo.multi_select_combo.js @@ -0,0 +1,109 @@ +import { CONSTANTS } from "@/config/constant"; +import { + MultiSelectInsertCombo, + AbsoluteLayout, + shortcut, + Widget, + Func, + createWidget, + bind, + each, + makeObject, + filter, + delay, + Msg +} from "@fui/core"; + +@shortcut() +export class MultiSelectComboDemo extends Widget { + static xtype = "demo.multi_select_combo"; + + props = { baseCls: "demo-multi-select-combo" }; + + _createMultiSelectCombo() { + const self = this; + const widget = createWidget({ + type: MultiSelectInsertCombo.xtype, + // allowEdit: false, + itemsCreator: bind(this._itemsCreator, this), + width: 200, + value: { + type: 1, + value: [ + "柳州市城贸金属材料有限责任公司", + "柳州市建福房屋租赁有限公司", + "柳州市迅昌数码办公设备有限责任公司" + ] + } + }); + + widget.on(MultiSelectComboDemo.EVENT_CONFIRM, function () { + Msg.toast(JSON.stringify(this.getValue())); + }); + + return widget; + } + + _getItemsByTimes(items, times) { + const res = []; + for (let i = (times - 1) * 100; items[i] && i < times * 100; i++) { + res.push(items[i]); + } + + return res; + } + + _hasNextByTimes(items, times) { + return times * 100 < items.length; + } + + _itemsCreator(options, callback) { + const self = this; + let items = CONSTANTS.ITEMS; + const keywords = (options.keywords || []).slice(); + if (options.keyword) { + keywords.push(options.keyword); + } + each(keywords, (i, kw) => { + const search = Func.getSearchResult(items, kw); + items = search.match.concat(search.find); + }); + if (options.selectedValues) { + // 过滤 + const filter = makeObject(options.selectedValues, true); + items = filter(items, (i, ob) => !filter[ob.value]); + } + if (options.type == MultiSelectCombo.REQ_GET_ALL_DATA) { + callback({ + items + }); + + return; + } + if (options.type == MultiSelectCombo.REQ_GET_DATA_LENGTH) { + callback({ count: items.length }); + + return; + } + delay(() => { + callback({ + items: self._getItemsByTimes(items, options.times), + hasNext: self._hasNextByTimes(items, options.times) + }); + }, 1000); + } + + render() { + return { + type: AbsoluteLayout.xtype, + scrolly: false, + items: [ + { + el: this._createMultiSelectCombo(), + right: "50%", + top: 10 + } + ] + }; + } +} diff --git a/packages/demo/src/demo/widget/multiselect/demo.multi_select_list.js b/packages/demo/src/demo/widget/multiselect/demo.multi_select_list.js new file mode 100644 index 000000000..367380644 --- /dev/null +++ b/packages/demo/src/demo/widget/multiselect/demo.multi_select_list.js @@ -0,0 +1,117 @@ +import { CONSTANTS } from "@/config/constant"; +import { + MultiSelectInsertList, + AbsoluteLayout, + shortcut, + Widget, + createWidget, + Func, + bind, + each, + makeObject, + filter, + delay, + Msg, + MultiSelectCombo +} from "@fui/core"; + +@shortcut() +export class MultiSelectListDemo extends Widget { + static xtype = "demo.multi_select_list"; + + props = { baseCls: "demo-multi-select-combo" }; + + mounted() { + this.list.populate(); + } + + _createMultiSelectCombo() { + const self = this; + const widget = createWidget({ + type: MultiSelectInsertList.xtype, + ref(ref) { + self.list = ref; + }, + itemsCreator: bind(this._itemsCreator, this), + value: { + type: 1, + value: [ + "柳州市城贸金属材料有限责任公司", + "柳州市建福房屋租赁有限公司", + "柳州市迅昌数码办公设备有限责任公司" + ] + } + }); + + widget.on(MultiSelectCombo.EVENT_CONFIRM, function () { + Msg.toast(JSON.stringify(this.getValue())); + }); + + return widget; + } + + _getItemsByTimes(items, times) { + const res = []; + for (let i = (times - 1) * 10; items[i] && i < times * 10; i++) { + res.push(items[i]); + } + + return res; + } + + _hasNextByTimes(items, times) { + return times * 10 < items.length; + } + + _itemsCreator(options, callback) { + const self = this; + let items = CONSTANTS.ITEMS; + const keywords = (options.keywords || []).slice(); + if (options.keyword) { + keywords.push(options.keyword); + } + each(keywords, (i, kw) => { + const search = Func.getSearchResult(items, kw); + items = search.match.concat(search.find); + }); + if (options.selectedValues) { + // 过滤 + const filter = makeObject(options.selectedValues, true); + items = filter(items, (i, ob) => !filter[ob.value]); + } + if (options.type == MultiSelectCombo.REQ_GET_ALL_DATA) { + callback({ + items + }); + + return; + } + if (options.type == MultiSelectCombo.REQ_GET_DATA_LENGTH) { + callback({ count: items.length }); + + return; + } + delay(() => { + callback({ + items: self._getItemsByTimes(items, options.times), + hasNext: self._hasNextByTimes(items, options.times) + }); + }, 1000); + } + + render() { + return { + type: AbsoluteLayout.xtype, + scrolly: false, + items: [ + { + el: this._createMultiSelectCombo(), + top: 50, + left: 50, + right: 50, + bottom: 50 + } + ] + }; + } +} diff --git a/demo/js/widget/multiselect/index.js b/packages/demo/src/demo/widget/multiselect/index.js similarity index 100% rename from demo/js/widget/multiselect/index.js rename to packages/demo/src/demo/widget/multiselect/index.js diff --git a/packages/demo/src/demo/widget/multitree/demo.multi_tree_combo.js b/packages/demo/src/demo/widget/multitree/demo.multi_tree_combo.js new file mode 100644 index 000000000..d5660d147 --- /dev/null +++ b/packages/demo/src/demo/widget/multitree/demo.multi_tree_combo.js @@ -0,0 +1,75 @@ +import { CONSTANTS } from "@/config/constant"; +import { + HorizontalAutoLayout, + MultiTreeCombo, + Button, + shortcut, + Widget, + deepClone, + Msg, + TreeView +} from "@fui/core"; + +@shortcut() +export class MultiTreeComboDemo extends Widget { + static xtype = "demo.multi_tree_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + const items = deepClone(CONSTANTS.TREE); + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: MultiTreeCombo.xtype, + ref(_ref) { + self.tree = _ref; + }, + itemsCreator(options, callback) { + console.log(options); + // 根据不同的类型处理相应的结果 + switch (options.type) { + case TreeView.REQ_TYPE_INIT_DATA: + break; + case TreeView.REQ_TYPE_ADJUST_DATA: + break; + case TreeView.REQ_TYPE_SELECT_DATA: + break; + case TreeView.REQ_TYPE_GET_SELECTED_DATA: + break; + default: + break; + } + callback({ + items + }); + }, + width: 300, + value: { + 根目录: {} + }, + listeners: [ + { + eventName: "EVENT_CONFIRM", + action() { + console.log("EVENT_CONFIRM", this.getValue()); + } + } + ] + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.tree.getValue())); + }, + width: 300 + } + ], + vgap: 20 + }; + } +} diff --git a/packages/demo/src/demo/widget/multitree/demo.multi_tree_list.js b/packages/demo/src/demo/widget/multitree/demo.multi_tree_list.js new file mode 100644 index 000000000..002933000 --- /dev/null +++ b/packages/demo/src/demo/widget/multitree/demo.multi_tree_list.js @@ -0,0 +1,81 @@ +import { CONSTANTS } from "@/config/constant"; +import { + AbsoluteLayout, + MultiSelectTree, + Button, + shortcut, + Widget, + deepClone, + Msg, + TreeView +} from "@fui/core"; + +@shortcut() +export class MultiSelectTreeDemo extends Widget { + static xtype = "demo.multi_select_tree"; + + props = { baseCls: "" }; + + mounted() { + this.tree.populate(); + } + + render() { + const self = this; + const items = deepClone(CONSTANTS.TREE); + + return { + type: AbsoluteLayout.xtype, + items: [ + { + el: { + type: MultiSelectTree.xtype, + ref(_ref) { + self.tree = _ref; + }, + itemsCreator(options, callback) { + console.log(options); + // 根据不同的类型处理相应的结果 + switch (options.type) { + case TreeView.REQ_TYPE_INIT_DATA: + break; + case TreeView.REQ_TYPE_ADJUST_DATA: + break; + case TreeView.REQ_TYPE_SELECT_DATA: + break; + case TreeView.REQ_TYPE_GET_SELECTED_DATA: + break; + default: + break; + } + callback({ + items: deepClone(items) + }); + }, + width: 300, + value: { + 根目录: {} + } + }, + top: 50, + bottom: 50, + left: 50, + right: 50 + }, + { + el: { + type: Button.xtype, + height: 30, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.tree.getValue())); + } + }, + left: 50, + right: 50, + bottom: 20 + } + ] + }; + } +} diff --git a/demo/js/widget/multitree/index.js b/packages/demo/src/demo/widget/multitree/index.js similarity index 100% rename from demo/js/widget/multitree/index.js rename to packages/demo/src/demo/widget/multitree/index.js diff --git a/packages/demo/src/demo/widget/numbereditor/demo.number_editor.js b/packages/demo/src/demo/widget/numbereditor/demo.number_editor.js new file mode 100644 index 000000000..727cb9ba5 --- /dev/null +++ b/packages/demo/src/demo/widget/numbereditor/demo.number_editor.js @@ -0,0 +1,73 @@ +import { + NumberEditor, + VerticalLayout, + shortcut, + Widget, + createWidget, + parseFloat, + Msg +} from "@fui/core"; + +@shortcut() +export class FileManagerDemo extends Widget { + static xtype = "demo.number_editor"; + + props = { baseCls: "" }; + + render() { + const editor1 = createWidget({ + type: NumberEditor.xtype, + validationChecker(v) { + return parseFloat(v) <= 100 && parseFloat(v) >= 0; + }, + height: 24, + width: 150, + errorText: "hahah", + watermark: "每个人都是自己健康的第一责任人" + }); + editor1.on(NumberEditor.EVENT_CHANGE, function () { + if (parseFloat(this.getValue()) < 1) { + editor1.setDownEnable(false); + } else { + editor1.setDownEnable(true); + } + Msg.toast(editor1.getValue()); + }); + + const editor2 = createWidget({ + type: NumberEditor.xtype, + validationChecker(v) { + return parseFloat(v) <= 100 && parseFloat(v) >= 0; + }, + valueFormatter: (v) => `${v}$`, + valueParser: (v) => v.replace(/\$\s?|(,*)/g, ""), + height: 24, + width: 150, + errorText: "hahah" + }); + editor2.on(NumberEditor.EVENT_CHANGE, function () { + if (parseFloat(this.getValue()) < 1) { + editor2.setDownEnable(false); + } else { + editor2.setDownEnable(true); + } + Msg.toast(editor2.getValue()); + }); + + return { + type: VerticalLayout.xtype, + hgap: 20, + vgap: 20, + items: [ + { + el: editor1, + height: 24 + }, + { + el: editor2, + height: 24 + } + ] + }; + } +} diff --git a/demo/js/widget/numbereditor/index.js b/packages/demo/src/demo/widget/numbereditor/index.js similarity index 100% rename from demo/js/widget/numbereditor/index.js rename to packages/demo/src/demo/widget/numbereditor/index.js diff --git a/packages/demo/src/demo/widget/numberinterval/demo.number_interval.js b/packages/demo/src/demo/widget/numberinterval/demo.number_interval.js new file mode 100644 index 000000000..295cd8b9a --- /dev/null +++ b/packages/demo/src/demo/widget/numberinterval/demo.number_interval.js @@ -0,0 +1,56 @@ +import { + HorizontalAutoLayout, + NumberInterval, + Label, + shortcut, + Widget +} from "@fui/core"; + +@shortcut() +export class NumericalIntervalDemo extends Widget { + static xtype = "demo.number_interval"; + + props = { baseCls: "demo-exceltable" }; + + mounted() { + const numerical = this.numerical; + const label = this.label; + numerical.on(NumberInterval.EVENT_CONFIRM, () => { + const temp = numerical.getValue(); + const res = `大于${temp.closemin ? "等于 " : " "}${temp.min} 小于${ + temp.closemax ? "等于 " : " " + }${temp.max}`; + label.setValue(res); + }); + } + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: NumberInterval.xtype, + ref(_ref) { + self.numerical = _ref; + }, + width: 500, + value: { + max: 300, + closeMax: true, + closeMin: false + } + }, + { + type: Label.xtype, + ref(_ref) { + self.label = _ref; + }, + text: "显示结果" + } + ], + vgap: 20 + }; + } +} diff --git a/demo/js/widget/numberinterval/index.js b/packages/demo/src/demo/widget/numberinterval/index.js similarity index 100% rename from demo/js/widget/numberinterval/index.js rename to packages/demo/src/demo/widget/numberinterval/index.js diff --git a/packages/demo/src/demo/widget/selecttree/demo.multilayer_select_tree_combo.js b/packages/demo/src/demo/widget/selecttree/demo.multilayer_select_tree_combo.js new file mode 100644 index 000000000..30fb4b21a --- /dev/null +++ b/packages/demo/src/demo/widget/selecttree/demo.multilayer_select_tree_combo.js @@ -0,0 +1,51 @@ +import { CONSTANTS } from "@/config/constant"; + +import { HorizontalAutoLayout, MultiLayerSelectTreeCombo, Button, shortcut, Widget, deepClone, Msg } from "@fui/core" + + + +@shortcut() +export class MultiLayerSelectTreeComboDemo extends Widget { + static xtype = "demo.multilayer_select_tree_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + const items = deepClone(CONSTANTS.TREE); + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: MultiLayerSelectTreeCombo.xtype, + ref(_ref) { + self.tree = _ref; + }, + defaultText: "请选择", + items, + width: 300, + value: ["第五级文件1"], + }, + { + type: Button.xtype, + text: "getVlaue", + handler() { + Msg.toast(self.tree.getValue()[0]); + }, + width: 300, + }, + { + type: Button.xtype, + text: "setVlaue (第二级文件1)", + handler() { + self.tree.setValue(["11"]); + }, + width: 300, + } + ], + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/widget/selecttree/demo.select_tree_combo.js b/packages/demo/src/demo/widget/selecttree/demo.select_tree_combo.js new file mode 100644 index 000000000..c891f46a8 --- /dev/null +++ b/packages/demo/src/demo/widget/selecttree/demo.select_tree_combo.js @@ -0,0 +1,55 @@ +import { CONSTANTS } from "@/config/constant"; +import { + HorizontalAutoLayout, + SelectTreeCombo, + Button, + shortcut, + Widget, + deepClone, + Msg +} from "@fui/core"; + +@shortcut() +export class SelectTreeComboDemo extends Widget { + static xtype = "demo.select_tree_combo"; + + props = { baseCls: "demo-exceltable" }; + + render() { + const self = this; + const items = deepClone(CONSTANTS.LEVELTREE); + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: SelectTreeCombo.xtype, + ref(_ref) { + self.tree = _ref; + }, + value: "11", + text: "默认值", + items, + width: 300 + }, + { + type: Button.xtype, + text: "getVlaue", + handler() { + Msg.toast(self.tree.getValue()[0]); + }, + width: 300 + }, + { + type: Button.xtype, + text: "setVlaue (11)", + handler() { + self.tree.setValue(["2"]); + }, + width: 300 + } + ], + vgap: 20 + }; + } +} diff --git a/demo/js/widget/selecttree/index.js b/packages/demo/src/demo/widget/selecttree/index.js similarity index 100% rename from demo/js/widget/selecttree/index.js rename to packages/demo/src/demo/widget/selecttree/index.js diff --git a/packages/demo/src/demo/widget/singleselct/demo.single_select_combo.js b/packages/demo/src/demo/widget/singleselct/demo.single_select_combo.js new file mode 100644 index 000000000..707389335 --- /dev/null +++ b/packages/demo/src/demo/widget/singleselct/demo.single_select_combo.js @@ -0,0 +1,107 @@ +import { CONSTANTS } from "@/config/constant"; + +import { SingleSelectCombo, AbsoluteLayout, Button, shortcut, Widget, Func, createWidget, bind, each, makeObject } from "@fui/core" + + +@shortcut() +export class SingleSelectComboDemo extends Widget { + static xtype = "demo.single_select_combo"; + + props = { baseCls: "demo-single-select-combo" }; + + _createSingleSelectCombo() { + const self = this; + const widget = createWidget({ + type: SingleSelectCombo.xtype, + itemsCreator: bind(this._itemsCreator, this), + width: 200, + ref() { + self.SingleSelectCombo = this; + }, + value: "柳州市针织总厂", + }); + + widget.populate(); + + widget.on(SingleSelectCombo.EVENT_CONFIRM, function () { + Msg.toast(JSON.stringify(this.getValue())); + }); + + return widget; + } + + _getItemsByTimes(items, times) { + const res = []; + for (let i = (times - 1) * 100; items[i] && i < times * 100; i++) { + res.push(items[i]); + } + + return res; + } + + _hasNextByTimes(items, times) { + return times * 100 < items.length; + } + + _itemsCreator(options, callback) { + const self = this; + let items = CONSTANTS.ITEMS; + const keywords = (options.keywords || []).slice(); + if (options.keyword) { + keywords.push(options.keyword); + } + each(keywords, (i, kw) => { + const search = Func.getSearchResult(items, kw); + items = search.match.concat(search.find); + }); + if (options.selectedValues) { + // 过滤 + const filter = makeObject(options.selectedValues, true); + items = filter(items, (i, ob) => !filter[ob.value]); + } + if (options.type == SingleSelectCombo.REQ_GET_ALL_DATA) { + callback({ + items, + }); + + return; + } + if (options.type == SingleSelectCombo.REQ_GET_DATA_LENGTH) { + callback({ count: items.length }); + + return; + } + delay(() => { + callback({ + items: self._getItemsByTimes(items, options.times), + hasNext: self._hasNextByTimes(items, options.times), + }); + }, 1000); + } + + render() { + const self = this; + + return { + type: AbsoluteLayout.xtype, + scrolly: false, + items: [ + { + el: this._createSingleSelectCombo(), + right: "50%", + top: 10, + }, + { + el: { + type: Button.xtype, + text: "setValue(\"柳州市针织总厂\")", + handler() { + self.SingleSelectCombo.setValue("柳州市针织总厂"); + }, + }, + } + ], + }; + } +} + diff --git a/demo/js/widget/singleselct/index.js b/packages/demo/src/demo/widget/singleselct/index.js similarity index 100% rename from demo/js/widget/singleselct/index.js rename to packages/demo/src/demo/widget/singleselct/index.js diff --git a/packages/demo/src/demo/widget/singletree/demo.multilayer_single_tree_combo.js b/packages/demo/src/demo/widget/singletree/demo.multilayer_single_tree_combo.js new file mode 100644 index 000000000..e9364ff99 --- /dev/null +++ b/packages/demo/src/demo/widget/singletree/demo.multilayer_single_tree_combo.js @@ -0,0 +1,50 @@ +import { CONSTANTS } from "@/config/constant"; + +import { HorizontalAutoLayout, MultiLayerSingleTreeCombo, Button, shortcut, Widget, deepClone, Msg } from "@fui/core" + + + +@shortcut() +export class MultiLayerSingleTreeComboDemo extends Widget { + static xtype = "demo.multilayer_single_tree_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + const items = deepClone(CONSTANTS.TREE); + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: MultiLayerSingleTreeCombo.xtype, + ref(_ref) { + self.tree = _ref; + }, + defaultText: "请选择", + items, + width: 300, + }, + { + type: Button.xtype, + text: "getVlaue", + handler() { + Msg.toast(self.tree.getValue()[0]); + }, + width: 300, + }, + { + type: Button.xtype, + text: "setVlaue (11)", + handler() { + self.tree.setValue(["11"]); + }, + width: 300, + } + ], + vgap: 20, + }; + } +} + diff --git a/packages/demo/src/demo/widget/singletree/demo.single_tree_combo.js b/packages/demo/src/demo/widget/singletree/demo.single_tree_combo.js new file mode 100644 index 000000000..930c87383 --- /dev/null +++ b/packages/demo/src/demo/widget/singletree/demo.single_tree_combo.js @@ -0,0 +1,51 @@ +import { CONSTANTS } from "@/config/constant"; + +import { HorizontalAutoLayout, SingleTreeCombo, Button, shortcut, Widget, deepClone, Msg } from "@fui/core" + + + +@shortcut() +export class SingleTreeComboDemo extends Widget { + static xtype = "demo.single_tree_combo"; + + props = { baseCls: "demo-exceltable" }; + + render() { + const self = this; + const items = deepClone(CONSTANTS.LEVELTREE); + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: SingleTreeCombo.xtype, + ref(_ref) { + self.tree = _ref; + }, + defaultText: "请选择", + items, + width: 300, + value: "11", + }, + { + type: Button.xtype, + text: "getVlaue", + handler() { + Msg.toast(self.tree.getValue()[0]); + }, + width: 300, + }, + { + type: Button.xtype, + text: "setVlaue (第二级文件1)", + handler() { + self.tree.setValue(["2"]); + }, + width: 300, + } + ], + vgap: 20, + }; + } +} + diff --git a/demo/js/widget/singletree/index.js b/packages/demo/src/demo/widget/singletree/index.js similarity index 100% rename from demo/js/widget/singletree/index.js rename to packages/demo/src/demo/widget/singletree/index.js diff --git a/packages/demo/src/demo/widget/slider/demo.slider.js b/packages/demo/src/demo/widget/slider/demo.slider.js new file mode 100644 index 000000000..d19e1a896 --- /dev/null +++ b/packages/demo/src/demo/widget/slider/demo.slider.js @@ -0,0 +1,142 @@ +import { + SingleSlider, + SingleSliderNormal, + SingleSliderLabel, + IntervalSlider, + VerticalLayout, + CenterAdaptLayout, + shortcut, + Widget, + createWidget +} from "@fui/core"; + +@shortcut() +export class SliderDemo extends Widget { + static xtype = "demo.slider"; + + props = { + baseCls: "demo-slider", + width: 300, + height: 50, + min: 0, + max: 100 + }; + + render() { + const self = this, + o = this.options; + const singleSlider = createWidget({ + type: SingleSlider.xtype, + digit: 0, + width: o.width, + height: o.height, + cls: "layout-bg-white", + value: 30, + min: 10, + max: 100 + }); + singleSlider.on(SingleSlider.EVENT_CHANGE, function () { + console.log(this.getValue()); + }); + + const normalSingleSlider = createWidget({ + type: SingleSliderNormal.xtype, + width: o.width, + height: 30, + cls: "layout-bg-white", + min: o.min, + max: o.max, + value: 30 + }); + normalSingleSlider.on(SingleSliderNormal.EVENT_DRAG, function () { + console.log(this.getValue()); + }); + + const singleSliderLabel = createWidget({ + type: SingleSliderLabel.xtype, + width: o.width, + height: o.height, + digit: 0, + unit: "个", + cls: "layout-bg-white", + min: o.min, + max: o.max, + value: 10 + }); + + const intervalSlider = createWidget({ + type: IntervalSlider.xtype, + width: o.width, + digit: 0, + cls: "layout-bg-white", + min: o.min, + max: o.max, + value: { + min: 10, + max: 70 + } + }); + + const intervalSliderLabel = createWidget({ + type: IntervalSlider.xtype, + width: o.width, + unit: "px", + cls: "layout-bg-white", + digit: 1, + min: 0, + max: 120, + value: { + min: 60, + max: 120 + } + }); + + return { + type: VerticalLayout.xtype, + element: this, + items: [ + { + type: CenterAdaptLayout.xtype, + items: [ + { + el: singleSlider + } + ] + }, + { + type: CenterAdaptLayout.xtype, + items: [ + { + el: normalSingleSlider + } + ] + }, + { + type: CenterAdaptLayout.xtype, + items: [ + { + el: singleSliderLabel + } + ] + }, + { + type: CenterAdaptLayout.xtype, + items: [ + { + el: intervalSlider + } + ] + }, + { + type: CenterAdaptLayout.xtype, + items: [ + { + el: intervalSliderLabel + } + ] + } + ], + vgap: 20 + }; + } +} diff --git a/demo/js/widget/slider/index.js b/packages/demo/src/demo/widget/slider/index.js similarity index 100% rename from demo/js/widget/slider/index.js rename to packages/demo/src/demo/widget/slider/index.js diff --git a/packages/demo/src/demo/widget/timecombo/demo.timecombo.js b/packages/demo/src/demo/widget/timecombo/demo.timecombo.js new file mode 100644 index 000000000..62fbdd0a2 --- /dev/null +++ b/packages/demo/src/demo/widget/timecombo/demo.timecombo.js @@ -0,0 +1,54 @@ + +import { HorizontalAutoLayout, TimeCombo, Button, shortcut, Widget, Msg } from "@fui/core" + + + +@shortcut() +export class TimeComboDemo extends Widget { + static xtype = "demo.time_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: TimeCombo.xtype, + ref(_ref) { + self.timeCombo = _ref; + }, + // allowEdit: true, + // format: "%H:%M:%S", // HH:mm:ss + // format: "%I:%M:%S", // hh:mm:ss + // format: "%l:%M:%S", // h:mm:ss + // format: "%k:%M:%S", // H:mm:ss + // format: "%l:%M:%S %p", // h:mm:ss a + // format: "%l:%M", // h:mm + // format: "%k:%M", // H:mm + // format: "%I:%M", // hh:mm + // format: "%H:%M", // HH:mm + // format: "%M:%S", // mm:ss + value: { + hour: 12, + minute: 0, + second: 0, + }, + width: 300, + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.timeCombo.getValue())); + }, + width: 300, + } + ], + vgap: 20, + }; + } +} + diff --git a/demo/js/widget/timecombo/index.js b/packages/demo/src/demo/widget/timecombo/index.js similarity index 100% rename from demo/js/widget/timecombo/index.js rename to packages/demo/src/demo/widget/timecombo/index.js diff --git a/packages/demo/src/demo/widget/timeinterval/demo.time_interval.js b/packages/demo/src/demo/widget/timeinterval/demo.time_interval.js new file mode 100644 index 000000000..989a101b7 --- /dev/null +++ b/packages/demo/src/demo/widget/timeinterval/demo.time_interval.js @@ -0,0 +1,115 @@ +import { CONSTANTS } from "@/config/constant"; + +import { HorizontalAutoLayout, DateInterval, Button, TimeInterval, TimePeriods, shortcut, Widget, deepClone, Msg } from "@fui/core" + + +@shortcut() +export class TimeIntervalDemo extends Widget { + static xtype = "demo.time_interval"; + + props = { baseCls: "" }; + + render() { + const self = this; + const items = deepClone(CONSTANTS.TREE); + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: DateInterval.xtype, + ref(_ref) { + self.dateInterval = _ref; + }, + value: { + start: { + type: 2, + value: { + year: -1, + position: 2, + }, + }, + end: { + type: 1, + value: { + year: 2018, + month: 1, + day: 12, + }, + }, + }, + width: 300, + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.dateInterval.getValue())); + }, + width: 300, + }, + { + type: TimeInterval.xtype, + ref(_ref) { + self.interval = _ref; + }, + value: { + start: { + type: 2, + value: { + year: -1, + position: 2, + }, + }, + end: { + type: 1, + value: { + year: 2018, + month: 1, + day: 12, + }, + }, + }, + width: 400, + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.interval.getValue())); + }, + width: 300, + }, + { + type: TimePeriods.xtype, + value: { + start: { + hour: 7, + minute: 23, + second: 14, + }, + end: { + hour: 23, + minute: 34, + second: 32, + }, + }, + ref(_ref) { + self.periods = _ref; + }, + width: 180, + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.periods.getValue())); + }, + width: 300, + } + ], + vgap: 20, + }; + } +} + diff --git a/demo/js/widget/timeinterval/index.js b/packages/demo/src/demo/widget/timeinterval/index.js similarity index 100% rename from demo/js/widget/timeinterval/index.js rename to packages/demo/src/demo/widget/timeinterval/index.js diff --git a/packages/demo/src/demo/widget/tree/demo.multilayer_select_level_tree.js b/packages/demo/src/demo/widget/tree/demo.multilayer_select_level_tree.js new file mode 100644 index 000000000..3820912fa --- /dev/null +++ b/packages/demo/src/demo/widget/tree/demo.multilayer_select_level_tree.js @@ -0,0 +1,58 @@ +import { CONSTANTS } from "@/config/constant"; +import { + MultiLayerSelectLevelTree, + VTapeLayout, + Button, + shortcut, + Widget, + createWidget, + deepClone, + Msg +} from "@fui/core"; + +@shortcut() +export class MultiLayerSelectLevelTreeDemo extends Widget { + static xtype = "demo.multilayer_select_level_tree"; + + render() { + const self = this; + const tree = createWidget({ + type: MultiLayerSelectLevelTree.xtype, + items: deepClone(CONSTANTS.TREE), + value: "第五级文件1" + }); + + return { + type: VTapeLayout.xtype, + items: [ + { + el: tree + }, + { + el: { + type: Button.xtype, + height: 25, + text: "getValue", + handler() { + Msg.alert("", JSON.stringify(tree.getValue())); + } + }, + height: 25 + }, + { + el: { + type: Button.xtype, + height: 25, + text: "setValue (第二级文件1)", + handler() { + tree.setValue(["11"]); + } + }, + height: 25 + } + ], + width: 500, + hgap: 300 + }; + } +} diff --git a/packages/demo/src/demo/widget/tree/demo.multilayer_single_level_tree.js b/packages/demo/src/demo/widget/tree/demo.multilayer_single_level_tree.js new file mode 100644 index 000000000..9b142450f --- /dev/null +++ b/packages/demo/src/demo/widget/tree/demo.multilayer_single_level_tree.js @@ -0,0 +1,77 @@ + +import { MultiLayerSingleLevelTree, VTapeLayout, Button, shortcut, Widget, createWidget, Msg } from "@fui/core" + + + +@shortcut() +export class MultiLayerSingleLevelTreeDemo extends Widget { + static xtype = "demo.multilayer_single_level_tree"; + + render() { + const self = this; + this.tree = createWidget({ + type: MultiLayerSingleLevelTree.xtype, + items: [], + value: "第二级文件1", + }); + + return { + type: VTapeLayout.xtype, + items: [ + { + el: this.tree, + }, + { + el: { + type: Button.xtype, + height: 25, + text: "getValue", + handler() { + Msg.alert("", JSON.stringify(self.tree.getValue())); + }, + }, + height: 25, + }, + { + el: { + type: Button.xtype, + height: 25, + text: "setValue (第二级文件1)", + handler() { + self.tree.setValue(["第二级文件1"]); + }, + }, + height: 25, + } + ], + width: 500, + hgap: 300, + }; + } + + mounted() { + const tree = [ + // {id: -2, pId: 0, value: "根目录1", text: "根目录1"}, + { id: -1, pId: 0, value: "根目录", text: "根目录" }, + { id: 1, pId: -1, value: "第一级目录1", text: "第一级目录1" }, + { id: 11, pId: 1, value: "第二级文件1", text: "第二级文件1" }, + { id: 12, pId: 1, value: "第二级目录2", text: "第二级目录2", disabled: true }, + { id: 121, pId: 12, value: "第三级目录1", text: "第三级目录1" }, + { id: 122, pId: 12, value: "第三级文件1", text: "第三级文件1" }, + { id: 1211, pId: 121, value: "第四级目录1", text: "第四级目录1" }, + { id: 2, pId: -1, value: "第一级目录2", text: "第一级目录2" }, + { id: 21, pId: 2, value: "第二级目录3", text: "第二级目录3" }, + { id: 22, pId: 2, value: "第二级文件2", text: "第二级文件2" }, + { id: 211, pId: 21, value: "第三级目录2", text: "第三级目录2" }, + { id: 212, pId: 21, value: "第三级文件2", text: "第三级文件2" }, + { id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1" }, + { id: 3, pId: -1, value: "第一级目录3", text: "第一级目录3" }, + { id: 31, pId: 3, value: "第二级文件2", text: "第二级文件2" }, + { id: 33, pId: 3, value: "第二级目录3", text: "第二级目录1" }, + { id: 32, pId: 3, value: "第二级文件3", text: "第二级文件3" }, + { id: 331, pId: 33, value: "第三级文件1", text: "第三级文件1" } + ]; + this.tree.populate(tree); + } +} + diff --git a/packages/demo/src/demo/widget/tree/demo.select_level_tree.js b/packages/demo/src/demo/widget/tree/demo.select_level_tree.js new file mode 100644 index 000000000..cbe9dd096 --- /dev/null +++ b/packages/demo/src/demo/widget/tree/demo.select_level_tree.js @@ -0,0 +1,58 @@ +import { CONSTANTS } from "@/config/constant"; +import { + SelectTreePopup, + VTapeLayout, + Button, + shortcut, + Widget, + createWidget, + deepClone, + Msg +} from "@fui/core"; + +@shortcut() +export class SelectLevelTreeDemo extends Widget { + static xtype = "demo.select_level_tree"; + + render() { + const self = this; + const tree = createWidget({ + type: SelectTreePopup.xtype, + items: deepClone(CONSTANTS.LEVELTREE), + value: "11" + }); + + return { + type: VTapeLayout.xtype, + items: [ + { + el: tree + }, + { + el: { + type: Button.xtype, + height: 25, + text: "getValue", + handler() { + Msg.alert("", JSON.stringify(tree.getValue())); + } + }, + height: 25 + }, + { + el: { + type: Button.xtype, + height: 25, + text: "setValue (第二级文件1)", + handler() { + tree.setValue(["2"]); + } + }, + height: 25 + } + ], + width: 500, + hgap: 300 + }; + } +} diff --git a/packages/demo/src/demo/widget/tree/demo.single_level_tree.js b/packages/demo/src/demo/widget/tree/demo.single_level_tree.js new file mode 100644 index 000000000..8615a811e --- /dev/null +++ b/packages/demo/src/demo/widget/tree/demo.single_level_tree.js @@ -0,0 +1,58 @@ +import { CONSTANTS } from "../../../config/constant"; +import { + SingleTreePopup, + VTapeLayout, + Button, + shortcut, + Widget, + createWidget, + deepClone, + Msg +} from "@fui/core"; + +@shortcut() +export class SingleLevelTreeDemo extends Widget { + static xtype = "demo.single_level_tree"; + + render() { + const self = this; + const tree = createWidget({ + type: SingleTreePopup.xtype, + items: deepClone(CONSTANTS.LEVELTREE), + value: "11" + }); + + return { + type: VTapeLayout.xtype, + items: [ + { + el: tree + }, + { + el: { + type: Button.xtype, + height: 25, + text: "getValue", + handler() { + Msg.alert("", JSON.stringify(tree.getValue())); + } + }, + height: 25 + }, + { + el: { + type: Button.xtype, + height: 25, + text: "setValue (第二级文件1)", + handler() { + tree.setValue(["2"]); + } + }, + height: 25 + } + ], + width: 500, + hgap: 300 + }; + } +} diff --git a/demo/js/widget/tree/index.js b/packages/demo/src/demo/widget/tree/index.js similarity index 100% rename from demo/js/widget/tree/index.js rename to packages/demo/src/demo/widget/tree/index.js diff --git a/packages/demo/src/demo/widget/year/demo.year.js b/packages/demo/src/demo/widget/year/demo.year.js new file mode 100644 index 000000000..a007a3b87 --- /dev/null +++ b/packages/demo/src/demo/widget/year/demo.year.js @@ -0,0 +1,53 @@ + +import { HorizontalAutoLayout, DynamicYearCombo, Button, shortcut, Widget, Msg } from "@fui/core" + + + +@shortcut() +export class YearDemo extends Widget { + static xtype = "demo.year"; + + props = { baseCls: "demo-exceltable" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + vgap: 10, + items: [ + { + type: DynamicYearCombo.xtype, + width: 300, + ref() { + self.yearcombo = this; + }, + value: { + type: 1, + value: { + year: 2017, + }, + }, + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.yearcombo.getValue())); + }, + width: 300, + }, + { + type: Button.xtype, + text: "setValue : 2018", + handler() { + self.yearcombo.setValue(2018); + }, + width: 300, + } + ], + vgap: 10, + }; + } +} + diff --git a/demo/js/widget/year/index.js b/packages/demo/src/demo/widget/year/index.js similarity index 100% rename from demo/js/widget/year/index.js rename to packages/demo/src/demo/widget/year/index.js diff --git a/packages/demo/src/demo/widget/yearinterval/demo.year_interval.js b/packages/demo/src/demo/widget/yearinterval/demo.year_interval.js new file mode 100644 index 000000000..5fe5cf16c --- /dev/null +++ b/packages/demo/src/demo/widget/yearinterval/demo.year_interval.js @@ -0,0 +1,56 @@ + +import { HorizontalAutoLayout, YearInterval, Button, shortcut, Widget, Msg } from "@fui/core" + + + +@shortcut() +export class YearIntervalDemo extends Widget { + static xtype = "demo.year_interval"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: YearInterval.xtype, + ref(_ref) { + self.widget = _ref; + }, + width: 300, + minDate: "2012-01-01", + maxDate: "2013-12-31", + value: { + type: 1, + value: { + year: 2012, + }, + }, + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.widget.getValue())); + }, + width: 300, + }, + { + type: Button.xtype, + text: "setValue '2017-12'", + width: 300, + handler() { + self.widget.setValue({ + year: 2017, + }); + }, + } + ], + vgap: 20, + }; + } +} + diff --git a/demo/js/widget/yearinterval/index.js b/packages/demo/src/demo/widget/yearinterval/index.js similarity index 100% rename from demo/js/widget/yearinterval/index.js rename to packages/demo/src/demo/widget/yearinterval/index.js diff --git a/packages/demo/src/demo/widget/yearmonth/demo.year_month_combo.js b/packages/demo/src/demo/widget/yearmonth/demo.year_month_combo.js new file mode 100644 index 000000000..1995fe9c9 --- /dev/null +++ b/packages/demo/src/demo/widget/yearmonth/demo.year_month_combo.js @@ -0,0 +1,56 @@ + +import { HorizontalAutoLayout, DynamicYearMonthCombo, Button, shortcut, Widget, Msg } from "@fui/core" + + + +@shortcut() +export class YearMonthComboDemo extends Widget { + static xtype = "demo.year_month_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: DynamicYearMonthCombo.xtype, + ref(_ref) { + self.widget = _ref; + }, + width: 300, + // value: { + // type: 1, + // value: { + // year: 2018, + // month: 1 + // } + // } + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.widget.getValue())); + }, + width: 300, + }, + { + type: Button.xtype, + text: "setValue '2017-12'", + width: 300, + handler() { + self.widget.setValue({ + year: 2017, + month: 12, + }); + }, + } + ], + vgap: 20, + }; + } +} + diff --git a/demo/js/widget/yearmonth/index.js b/packages/demo/src/demo/widget/yearmonth/index.js similarity index 100% rename from demo/js/widget/yearmonth/index.js rename to packages/demo/src/demo/widget/yearmonth/index.js diff --git a/packages/demo/src/demo/widget/yearmonthinterval/demo.year_month_interval.js b/packages/demo/src/demo/widget/yearmonthinterval/demo.year_month_interval.js new file mode 100644 index 000000000..95c9a3555 --- /dev/null +++ b/packages/demo/src/demo/widget/yearmonthinterval/demo.year_month_interval.js @@ -0,0 +1,54 @@ + +import { HorizontalAutoLayout, YearMonthInterval, Button, shortcut, Widget, Msg } from "@fui/core" + + + +@shortcut() +export class YearMonthIntervalDemo extends Widget { + static xtype = "demo.year_month_interval"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: YearMonthInterval.xtype, + ref(_ref) { + self.interval = _ref; + }, + value: { + start: { + type: 2, + value: { + year: -1, + month: 1, + }, + }, + end: { + type: 1, + value: { + year: 2018, + month: 1, + }, + }, + }, + width: 400, + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.interval.getValue())); + }, + width: 300, + } + ], + vgap: 20, + }; + } +} + diff --git a/demo/js/widget/yearmonthinterval/index.js b/packages/demo/src/demo/widget/yearmonthinterval/index.js similarity index 100% rename from demo/js/widget/yearmonthinterval/index.js rename to packages/demo/src/demo/widget/yearmonthinterval/index.js diff --git a/packages/demo/src/demo/widget/yearquarter/demo.year_quarter_combo.js b/packages/demo/src/demo/widget/yearquarter/demo.year_quarter_combo.js new file mode 100644 index 000000000..62f05fbf2 --- /dev/null +++ b/packages/demo/src/demo/widget/yearquarter/demo.year_quarter_combo.js @@ -0,0 +1,58 @@ + +import { HorizontalAutoLayout, DynamicYearQuarterCombo, Button, shortcut, Widget, Msg } from "@fui/core" + + + +@shortcut() +export class YearQuarterComboDemo extends Widget { + static xtype = "demo.year_quarter_combo"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: DynamicYearQuarterCombo.xtype, + width: 300, + ref(_ref) { + self.widget = _ref; + }, + yearBehaviors: {}, + quarterBehaviors: {}, + value: { + type: 1, + value: { + year: 2018, + quarter: 1, + }, + }, + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.widget.getValue())); + }, + width: 300, + }, + { + type: Button.xtype, + text: "setVlaue '2017 季度3'", + width: 300, + handler() { + self.widget.setValue({ + year: 2017, + quarter: 3, + }); + }, + } + ], + vgap: 20, + }; + } +} + diff --git a/demo/js/widget/yearquarter/index.js b/packages/demo/src/demo/widget/yearquarter/index.js similarity index 100% rename from demo/js/widget/yearquarter/index.js rename to packages/demo/src/demo/widget/yearquarter/index.js diff --git a/packages/demo/src/demo/widget/yearquarterinterval/demo.yearquarterinterval.js b/packages/demo/src/demo/widget/yearquarterinterval/demo.yearquarterinterval.js new file mode 100644 index 000000000..fd2bd1c68 --- /dev/null +++ b/packages/demo/src/demo/widget/yearquarterinterval/demo.yearquarterinterval.js @@ -0,0 +1,56 @@ + +import { HorizontalAutoLayout, YearQuarterInterval, Button, shortcut, Widget, Msg } from "@fui/core" + + + +@shortcut() +export class YearQuarterIntervalDemo extends Widget { + static xtype = "demo.year_quarter_interval"; + + props = { baseCls: "" }; + + render() { + const self = this; + + return { + type: HorizontalAutoLayout.xtype, + items: [ + { + type: YearQuarterInterval.xtype, + ref(_ref) { + self.interval = _ref; + }, + minDate: "2012-07-01", + maxDate: "2012-12-31", + value: { + start: { + type: 2, + value: { + year: -1, + month: 1, + }, + }, + end: { + type: 1, + value: { + year: 2018, + month: 1, + }, + }, + }, + width: 400, + }, + { + type: Button.xtype, + text: "getValue", + handler() { + Msg.toast(JSON.stringify(self.interval.getValue())); + }, + width: 300, + } + ], + vgap: 20, + }; + } +} + diff --git a/demo/js/widget/yearquarterinterval/index.js b/packages/demo/src/demo/widget/yearquarterinterval/index.js similarity index 100% rename from demo/js/widget/yearquarterinterval/index.js rename to packages/demo/src/demo/widget/yearquarterinterval/index.js diff --git a/packages/demo/src/face.js b/packages/demo/src/face.js new file mode 100644 index 000000000..c19045449 --- /dev/null +++ b/packages/demo/src/face.js @@ -0,0 +1,876 @@ +import { + Widget, + Label, + shortcut, + each, + Msg, + StyleLoaders, + ColorChooser, + VerticalAdaptLayout, + HTapeLayout, + TextButton, + IconTextItem, + VerticalLayout, + Button, + DownListCombo, + IconTextIconItem, + GridLayout, + Layout, +} from '@fui/core'; + +@shortcut() +export class Face extends Widget { + static xtype = 'demo.face'; + + props = { + baseCls: 'demo-face', + }; + + _createLabel(text) { + return { + width: 200, + el: { + type: Label.xtyp, + text: text, + textAlign: 'left', + hgap: 5, + height: 40, + cls: 'config-label', + }, + }; + } + + _createColorPicker(ref, action) { + return { + el: { + type: VerticalAdaptLayout.xtype, + items: [ + { + type: ColorChooser.xtype, + listeners: [ + { + eventName: ColorChooser.EVENT_CHANGE, + action: action, + }, + ], + ref: ref, + width: 24, + height: 24, + }, + ], + }, + }; + } + + _createBackgroundConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('背景色:'), + this._createColorPicker( + function () { + self.backgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + ], + }; + } + + _createFontConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('字体颜色:'), + this._createColorPicker( + function () { + self.fontColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + ], + }; + } + + _createActiveFontConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('激活状态字体颜色:'), + this._createColorPicker( + function () { + self.activeFontColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: TextButton.xtype, + cls: 'bi-list-item-active', + text: '测试激活状态', + }, + }, + ], + }; + } + + _createSelectFontConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('选中状态字体颜色:'), + this._createColorPicker( + function () { + self.selectFontColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: TextButton.xtype, + cls: 'bi-list-item-active', + text: '测试选中状态', + }, + }, + ], + }; + } + + _createGrayFontConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('tip提示字体颜色:'), + this._createColorPicker( + function () { + self.grayFontColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: IconTextItem.xtype, + cls: 'bi-tips copy-font', + height: 40, + text: '测试提示文字', + }, + }, + ], + }; + } + + _createDisableFontConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('灰化字体颜色:'), + this._createColorPicker( + function () { + self.disabledFontColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: TextButton.xtype, + text: '这个按钮是灰化的', + disabled: true, + }, + }, + ], + }; + } + + _createCardBackgroundConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('Card背景颜色:'), + this._createColorPicker( + function () { + self.cardBackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + ], + }; + } + + _createHoverBackgroundColor() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('悬浮状态背景颜色:'), + this._createColorPicker( + function () { + self.hoverBackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: TextButton.xtype, + cls: 'bi-list-item-active', + text: '测试悬浮状态', + }, + }, + ], + }; + } + + _createActiveBackgroundColor() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('激活状态背景颜色:'), + this._createColorPicker( + function () { + self.activeBackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: TextButton.xtype, + cls: 'bi-list-item-active', + text: '测试激活状态', + }, + }, + ], + }; + } + + _createSelectBackgroundColor() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('选中状态背景颜色:'), + this._createColorPicker( + function () { + self.selectBackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: TextButton.xtype, + cls: 'bi-list-item-active', + text: '测试选中状态', + }, + }, + ], + }; + } + + _createSlitColor() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('分割线颜色:'), + this._createColorPicker( + function () { + self.slitColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + ], + }; + } + + _createBaseConfig() { + return { + type: VerticalLayout.xtype, + items: [ + this._createLabel('--通用配色--'), + this._createBackgroundConfig(), + this._createCardBackgroundConfig(), + this._createFontConfig(), + this._createActiveFontConfig(), + this._createSelectFontConfig(), + this._createGrayFontConfig(), + this._createDisableFontConfig(), + this._createHoverBackgroundColor(), + this._createActiveBackgroundColor(), + this._createSelectBackgroundColor(), + this._createSlitColor(), + ], + }; + } + + _createButton1BackgroundConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('按钮背景色1:'), + this._createColorPicker( + function () { + self.button1BackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: VerticalAdaptLayout.xtype, + height: 40, + items: [ + { + type: Button.xtype, + cls: 'config-button1', + text: '测试按钮', + }, + ], + }, + }, + ], + }; + } + + _createButton2BackgroundConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('按钮背景色2:'), + this._createColorPicker( + function () { + self.button2BackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: VerticalAdaptLayout.xtype, + height: 40, + items: [ + { + type: Button.xtype, + level: 'success', + cls: 'config-button2', + text: '测试按钮', + }, + ], + }, + }, + ], + }; + } + + _createButton3BackgroundConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('按钮背景色3:'), + this._createColorPicker( + function () { + self.button3BackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: VerticalAdaptLayout.xtype, + height: 40, + items: [ + { + type: Button.xtype, + level: 'warning', + cls: 'config-button3', + text: '测试按钮', + }, + ], + }, + }, + ], + }; + } + + _createButton4BackgroundConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('按钮背景色4:'), + this._createColorPicker( + function () { + self.button4BackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: VerticalAdaptLayout.xtype, + height: 40, + items: [ + { + type: Button.xtype, + level: 'ignore', + cls: 'config-button4', + text: '测试按钮', + }, + ], + }, + }, + ], + }; + } + + _createScrollBackgroundConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('滚动条底色:'), + this._createColorPicker( + function () { + self.scrollBackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + ], + }; + } + + _createScrollThumbConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('滚动条thumb颜色:'), + this._createColorPicker( + function () { + self.scrollThumbColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + ], + }; + } + + _createPopupBackgroundConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('下拉框背景颜色:'), + this._createColorPicker( + function () { + self.popupBackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: VerticalAdaptLayout.xtype, + items: [ + { + type: DownListCombo.xtype, + items: [ + [ + { + el: { + text: 'column 1111', + iconCls1: 'check-mark-e-font', + value: 11, + }, + children: [ + { + text: 'column 1.1', + value: 21, + cls: 'dot-e-font', + selected: true, + }, + { + text: 'column 1.222222222222222222222222222222222222', + cls: 'dot-e-font', + value: 22, + }, + { + text: 'column 1.3', + cls: 'dot-e-font', + value: 23, + }, + { + text: 'column 1.4', + cls: 'dot-e-font', + value: 24, + }, + { + text: 'column 1.5', + cls: 'dot-e-font', + value: 25, + }, + ], + }, + ], + [ + { + el: { + type: IconTextIconItem.xtype, + text: 'column 2', + iconCls1: 'chart-type-e-font', + cls: 'dot-e-font', + value: 12, + }, + disabled: true, + children: [ + { + type: IconTextItem.xtype, + cls: 'dot-e-font', + height: 25, + text: 'column 2.1', + value: 11, + }, + { text: 'column 2.2', value: 12, cls: 'dot-e-font' }, + ], + }, + ], + [ + { + text: 'column 33333333333333333333333333333333', + cls: 'style-set-e-font', + value: 13, + }, + ], + [ + { + text: 'column 4', + cls: 'filter-e-font', + value: 14, + }, + ], + [ + { + text: 'column 5', + cls: 'copy-e-font', + value: 15, + }, + ], + [ + { + text: 'column 6', + cls: 'delete-e-font', + value: 16, + }, + ], + [ + { + text: 'column 7', + cls: 'dimension-from-e-font', + value: 17, + disabled: true, + }, + ], + ], + }, + ], + }, + }, + ], + }; + } + + _createMaskBackgroundConfig() { + var self = this; + return { + type: HTapeLayout.xtype, + cls: 'config-item bi-border-bottom', + height: 40, + items: [ + this._createLabel('弹出层蒙版颜色:'), + this._createColorPicker( + function () { + self.maskBackgroundColor = this; + }, + function () { + self._runGlobalStyle(); + } + ), + { + width: 100, + el: { + type: VerticalAdaptLayout.xtype, + items: [ + { + type: Button.xtype, + text: 'mask测试', + handler() { + Msg.alert('弹出层', '弹出层面板'); + }, + }, + ], + }, + }, + ], + }; + } + + _createCommonConfig() { + return { + type: VerticalLayout.xtype, + items: [ + this._createLabel('--一般配色--'), + this._createButton1BackgroundConfig(), + this._createButton2BackgroundConfig(), + this._createButton3BackgroundConfig(), + this._createButton4BackgroundConfig(), + this._createScrollBackgroundConfig(), + this._createScrollThumbConfig(), + this._createPopupBackgroundConfig(), + this._createMaskBackgroundConfig(), + ], + }; + } + + render() { + var self = this; + return { + type: GridLayout.xtype, + items: [ + [ + { + el: { + type: VerticalLayout.xtype, + cls: 'face-config bi-border-right', + items: [this._createBaseConfig(), this._createCommonConfig()], + }, + }, + { + el: { + type: Layout.xtype, + }, + }, + ], + ], + }; + } + + _setStyle(objects) { + var result = ''; + each(objects, function (cls, object) { + result += cls + '{'; + each(object, function (name, value) { + result += name + ':' + value + ';'; + }); + result += '} '; + }); + StyleLoaders.removeStyle('style').loadStyle('style', result); + } + + _runGlobalStyle() { + var backgroundColor = this.backgroundColor.getValue(); + var fontColor = this.fontColor.getValue(); + var activeFontColor = this.activeFontColor.getValue(); + var selectFontColor = this.selectFontColor.getValue(); + var grayFontColor = this.grayFontColor.getValue(); + var disabledFontColor = this.disabledFontColor.getValue(); + var cardBackgroundColor = this.cardBackgroundColor.getValue(); + var hoverBackgroundColor = this.hoverBackgroundColor.getValue(); + var activeBackgroundColor = this.activeBackgroundColor.getValue(); + var selectBackgroundColor = this.selectBackgroundColor.getValue(); + var slitColor = this.slitColor.getValue(); + + var button1BackgroundColor = this.button1BackgroundColor.getValue(); + var button2BackgroundColor = this.button2BackgroundColor.getValue(); + var button3BackgroundColor = this.button3BackgroundColor.getValue(); + var button4BackgroundColor = this.button4BackgroundColor.getValue(); + var scrollBackgroundColor = this.scrollBackgroundColor.getValue(); + var scrollThumbColor = this.scrollThumbColor.getValue(); + var popupBackgroundColor = this.popupBackgroundColor.getValue(); + var maskBackgroundColor = this.maskBackgroundColor.getValue(); + + this._setStyle({ + 'body.bi-background, body .bi-background': { + 'background-color': backgroundColor, + color: fontColor, + }, + 'body .bi-card': { + 'background-color': cardBackgroundColor, + color: fontColor, + }, + 'body .bi-tips': { + color: grayFontColor, + }, + 'div::-webkit-scrollbar,.scrollbar-layout-main': { + 'background-color': scrollBackgroundColor + '!important', + }, + 'div::-webkit-scrollbar-thumb,.public-scrollbar-face:after': { + 'background-color': scrollThumbColor + '!important', + }, + '.base-disabled': { + color: disabledFontColor + '!important', + }, + '.base-disabled .b-font:before': { + color: disabledFontColor + '!important', + }, + '.list-view-outer': { + 'background-color': popupBackgroundColor + '!important', + }, + '.bi-z-index-mask': { + 'background-color': maskBackgroundColor + '!important', + }, + '.bi-list-item:hover,.bi-list-item-hover:hover,.bi-list-item-active:hover,.bi-list-item-select:hover,.bi-list-item-effect:hover': + { + 'background-color': hoverBackgroundColor + '!important', + }, + '.bi-list-item-active:active,.bi-list-item-select:active,.bi-list-item-effect:active': { + 'background-color': activeBackgroundColor + '!important', + color: activeFontColor + '!important', + }, + '.bi-list-item-active.active,.bi-list-item-select.active,.bi-list-item-effect.active': { + 'background-color': selectBackgroundColor + '!important', + color: selectFontColor + '!important', + }, + 'body .bi-button.button-common': { + 'background-color': button1BackgroundColor, + 'border-color': button1BackgroundColor, + }, + 'body .bi-button.button-success': { + 'background-color': button2BackgroundColor, + 'border-color': button2BackgroundColor, + }, + 'body .bi-button.button-warning': { + 'background-color': button3BackgroundColor, + 'border-color': button3BackgroundColor, + }, + 'body .bi-button.button-ignore': { + 'background-color': button4BackgroundColor, + }, + // 以下是分割线颜色 + 'body .bi-border,body .bi-border-top,#wrapper .bi-border-bottom,body .bi-border-left,body .bi-border-right': + { + 'border-color': slitColor, + }, + '.bi-collection-table-cell': { + 'border-right-color': slitColor, + 'border-bottom-color': slitColor, + }, + '.bi-collection-table-cell.first-col': { + 'border-left-color': slitColor, + }, + '.bi-collection-table-cell.first-row': { + 'border-top-color': slitColor, + }, + }); + } + + mounted() { + this.backgroundColor.setValue(''); + this.fontColor.setValue(''); + this.activeFontColor.setValue(''); + this.selectFontColor.setValue(''); + this.grayFontColor.setValue(''); + this.disabledFontColor.setValue(''); + this.cardBackgroundColor.setValue(''); + this.hoverBackgroundColor.setValue(''); + this.activeBackgroundColor.setValue(''); + this.selectBackgroundColor.setValue(''); + + this.button1BackgroundColor.setValue(''); + this.button2BackgroundColor.setValue(''); + this.button3BackgroundColor.setValue(''); + this.button4BackgroundColor.setValue(''); + this.scrollBackgroundColor.setValue(''); + this.scrollThumbColor.setValue(''); + this.popupBackgroundColor.setValue(''); + this.maskBackgroundColor.setValue(''); + this.slitColor.setValue(''); + this._runGlobalStyle(); + } +} diff --git a/packages/demo/src/index.js b/packages/demo/src/index.js new file mode 100644 index 000000000..056a80be8 --- /dev/null +++ b/packages/demo/src/index.js @@ -0,0 +1,34 @@ +import './less/index.less'; +import '../i18n/i18n.cn'; +import { createWidget, Layout, RouterWidget } from '@fui/core'; +import { Main } from './main'; +import { RouterDemo } from './center'; + +createWidget({ + type: RouterWidget.xtype, + routes: [ + { + path: '/', + component: function () { + return Promise.resolve({ + type: Layout.xtype, + }); + }, + }, + { + name: 'component', + path: '/component/:componentId', + component() { + return Promise.resolve({ + type: RouterDemo.xtype, + }); + }, + }, + ], + render() { + return { + type: Main.xtype, + element: '#wrapper', + }; + }, +}); diff --git a/packages/demo/src/less/face.less b/packages/demo/src/less/face.less new file mode 100644 index 000000000..041cd31ba --- /dev/null +++ b/packages/demo/src/less/face.less @@ -0,0 +1,11 @@ +@import "fineui.less"; + +.demo-face { + .face-config { + .config-label { + font-size: 1.4rem; + } + .config-item { + } + } +} \ No newline at end of file diff --git a/packages/demo/src/less/fineui.less b/packages/demo/src/less/fineui.less new file mode 100644 index 000000000..77a935b79 --- /dev/null +++ b/packages/demo/src/less/fineui.less @@ -0,0 +1 @@ +@import "../../node_modules/@fui/core/src/less/index.less"; \ No newline at end of file diff --git a/packages/demo/src/less/index.less b/packages/demo/src/less/index.less new file mode 100644 index 000000000..d9e864713 --- /dev/null +++ b/packages/demo/src/less/index.less @@ -0,0 +1,7 @@ +@import "./face.less"; +@import "./index.less"; +@import "./main.less"; +@import "./north.less"; +@import "./preview.less"; +@import "./vm.less"; +@import "./west.less"; diff --git a/packages/demo/src/less/main.less b/packages/demo/src/less/main.less new file mode 100644 index 000000000..ff1f415de --- /dev/null +++ b/packages/demo/src/less/main.less @@ -0,0 +1,103 @@ +@import "fineui.less"; + +.layout-bg-white { + background-color: #ffffff; +} + +.layout-bg-gray { + background-color: #eeeeee; +} + +.layout-bg1 { + color: #ffffff; + background-color: #0088cc; +} + +.layout-bg2 { + color: #ffffff; + background-color: #008B8B; +} + +.layout-bg3 { + color: #ffffff; + background-color: #6495ED; +} + +.layout-bg4 { + color: #ffffff; + background-color: #ff69b4; +} + +.layout-bg5 { + color: #ffffff; + background-color: #B8860B; +} + +.layout-bg6 { + color: #ffffff; + background-color: #d9534f; +} + +.layout-bg7 { + color: #ffffff; + background-color: #ea4738; +} + +.layout-bg8 { + color: #ffffff; + background-color: #6495ed; +} + +.demo-main { + & .bg1 { + background-color: #178cdf; + } +} + +body { + background-color: @color-bi-background-normal; +} + +#wrapper { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + font-size: 1.2rem; +} + +.bi-theme-dark body { + background-color: @color-bi-background-normal-theme-dark; +} + +.demo-editor { + border: 1px solid rgb(204, 204, 204); +} + +.demo-clolor { + color: #1a1a1a; +} + +.bi-progress-bar-processor { + transition: all 0.5s ease; + -webkit-transition: all 0.5s ease; + -moz-transition: all 0.5s ease; + -o-transition: all 0.5s ease; + background: #3f8ce8; + border-radius: 2rem; + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; +} + +.bi-progress-text-bar-processor { + transition: all 0.5s ease; + -webkit-transition: all 0.5s ease; + -moz-transition: all 0.5s ease; + -o-transition: all 0.5s ease; +} + +.bi-progress-bar-bar { + border-radius: 2rem; +} diff --git a/packages/demo/src/less/north.less b/packages/demo/src/less/north.less new file mode 100644 index 000000000..f174587dd --- /dev/null +++ b/packages/demo/src/less/north.less @@ -0,0 +1,12 @@ +@import "fineui.less"; + +.demo-north { + background-color: #3c8dbc; + & .logo { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + color: @color-bi-text; + background-color: #367fa9; + font-size: 2rem; + font-weight: 300; + } +} \ No newline at end of file diff --git a/packages/demo/src/less/preview.less b/packages/demo/src/less/preview.less new file mode 100644 index 000000000..ac267e5a2 --- /dev/null +++ b/packages/demo/src/less/preview.less @@ -0,0 +1,8 @@ +@import "fineui.less"; + +.demo-preview { +} + +#wrapper { + font-size: 12px; +} \ No newline at end of file diff --git a/packages/demo/src/less/vm.less b/packages/demo/src/less/vm.less new file mode 100644 index 000000000..d962e2cc0 --- /dev/null +++ b/packages/demo/src/less/vm.less @@ -0,0 +1,123 @@ +@import "fineui.less"; + +.mvc-button { + &:hover, &.hover { + .opacity(0.5); + } + &.active, &:active { + .opacity(0.5) + } +} + +.bi-set-get { + & .left-title, & .right-title { + background: #0088cc; + color: #ffffff; + } + & .left-nav { + border-bottom: 1px solid #cccccc; + &.active, &:active { + color: #ffffff; + background-color: #d9534f; + } + } +} + +.bi-local { + & .top-button { + background-color: #448eea; + color: #ffffff + } + & .bottom-label { + background-color: #EA4738; + color: #ffffff; + } + & .delete-button { + background-color: #008B8B; + color: #ffffff; + } + & .vessel-border { + border-left: 1px solid #cccccc; + border-bottom: 1px solid #cccccc; + border-right: 1px solid #cccccc; + } +} + +.bi-event { + & .title { + background: #0088cc; + color: #ffffff; + } + & .front { + background: #ADD8E6; + } + & .nav { + border: 1px solid #cccccc; + } +} + +.bi-skip-to { + color: #ffffff; + + & .red-pane { + background-color: #0088cc; + } + & .blue-pane { + background-color: #6495ED; + } + & .green-pane { + background-color: #008B8B; + } + & .yellow-pane { + background-color: #B8860B; + } +} + +.bi-change { + & .outer-text { + background-color: #0088cc; + color: #ffffff; + } + & .inner { + border-left: 1px solid #cccccc; + border-bottom: 1px solid #cccccc; + border-right: 1px solid #cccccc; + } + + & .type-first { + background-color: #008B8B; + } + + & .type-second { + background-color: #6495ED; + } + + & .type-third { + background-color: #0088cc; + } +} + +.bi-tmp { + & .tmp-button { + color: #ffffff; + background: #0088cc; + } +} + +.bi-splice-duplicate { + & .superiors-label { + color: white; + background-color: #008B8B; + } + & .sd-child { + border: 1px solid #cccccc; + & .right-button-add { + color: white; + background-color: #0088cc; + } + & .right-button-del { + color: white; + background-color: #d9534f; + } + } +} \ No newline at end of file diff --git a/packages/demo/src/less/west.less b/packages/demo/src/less/west.less new file mode 100644 index 000000000..920fbc8b8 --- /dev/null +++ b/packages/demo/src/less/west.less @@ -0,0 +1,4 @@ +@import "fineui.less"; + +.demo-west { +} diff --git a/packages/demo/src/main.js b/packages/demo/src/main.js new file mode 100644 index 000000000..02f8f32ed --- /dev/null +++ b/packages/demo/src/main.js @@ -0,0 +1,36 @@ +import { shortcut, Widget, BorderLayout, Label } from "@fui/core"; +import { West } from "./west"; +import { Center } from "./center"; +import { North } from "./north"; + +@shortcut() +export class Main extends Widget { + static xtype = "demo.main"; + + props = { baseCls: "demo-main bi-background" }; + + render() { + return { + type: BorderLayout.xtype, + items: { + north: { + height: 50, + el: { + type: North, + }, + }, + west: { + width: 230, + el: { + type: West.xtype, + }, + }, + center: { + el: { + type: Center.xtype, + }, + }, + }, + }; + } +} diff --git a/packages/demo/src/north.js b/packages/demo/src/north.js new file mode 100644 index 000000000..562dbe313 --- /dev/null +++ b/packages/demo/src/north.js @@ -0,0 +1,66 @@ +import { Widget, Button, $, HTapeLayout, TextButton, FloatRightLayout, } from "@fui/core"; + +export class North extends Widget { + static xtype = "demo.north"; + static EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE"; + + props = { + baseCls: "demo-north" + }; + + render() { + var self = this; + return { + type: HTapeLayout.xtype, + items: [ + { + width: 230, + el: { + type: TextButton.xtype, + listeners: [ + { + eventName: Button.EVENT_CHANGE, + action: function () { + // self.fireEvent( + // Demo.North.EVENT_VALUE_CHANGE, + // "" + // ); + } + } + ], + cls: "logo", + height: 50, + text: "FineUI2.0" + } + }, + { + el: { + type: FloatRightLayout.xtype, + hgap: 10, + items: [ + { + type: TextButton.xtype, + text: "星空蓝", + handler: function () { + $("html") + .removeClass(undefined.xtype) + .addClass(undefined.xtype); + } + }, + { + type: TextButton.xtype, + text: "典雅白", + handler: function () { + $("html") + .removeClass(undefined.xtype) + .addClass(undefined.xtype); + } + } + ] + } + } + ] + }; + } +} + diff --git a/packages/demo/src/west.js b/packages/demo/src/west.js new file mode 100644 index 000000000..13109b203 --- /dev/null +++ b/packages/demo/src/west.js @@ -0,0 +1,101 @@ +import { + Widget, + shortcut, + VTapeLayout, + CenterAdaptLayout, + Searcher, + SearchEditor, + Func, + concat, + each, + Router, + MultiLayerSingleLevelTree, +} from '@fui/core'; +import { demoConfig } from './config'; + +@shortcut() +export class West extends Widget { + static xtype = 'demo.west'; + static EVENT_VALUE_CHANGE = 'EVENT_VALUE_CHANGE'; + + props = { + baseCls: 'demo-west bi-border-right bi-card', + }; + + mounted() { + this.searcher.setAdapter(this.tree); + } + + render() { + var self = this; + + // var selectedId = BI.Router.$router.currentRoute.params?.componentId; + + return { + type: VTapeLayout.xtype, + items: [ + { + type: CenterAdaptLayout.xtype, + items: [ + { + type: Searcher.xtype, + el: { + type: SearchEditor.xtype, + watermark: '简单搜索', + }, + width: 200, + isAutoSearch: false, + isAutoSync: false, + ref: function (ref) { + self.searcher = ref; + }, + popup: { + type: MultiLayerSingleLevelTree.xtype, + cls: 'bi-card', + listeners: [ + { + eventName: MultiLayerSingleLevelTree.EVENT_CHANGE, + action: function (v) {}, + }, + ], + }, + onSearch: function (op, callback) { + var result = Func.getSearchResult(Demo.CONFIG, op.keyword, 'text'); + var items = concat(result.match, result.find); + var children = []; + each(items, function (index, item) { + var childList = Func.getSearchResult(Demo.CONFIG, item.id, 'pId'); + each(childList.match, function (index, child) { + if (child.value) { + children.push(child); + } + }); + }); + items = concat(items, children); + callback(items); + }, + }, + ], + height: 40, + }, + { + type: MultiLayerSingleLevelTree.xtype, + listeners: [ + { + eventName: MultiLayerSingleLevelTree.EVENT_CHANGE, + action: function (v) { + Router.$router.push({ + name: 'component', + params: { + componentId: v, + }, + }); + }, + }, + ], + items: demoConfig, + }, + ], + }; + } +} diff --git a/packages/demo/webpack.dev.js b/packages/demo/webpack.dev.js new file mode 100644 index 000000000..4a3743bf1 --- /dev/null +++ b/packages/demo/webpack.dev.js @@ -0,0 +1,38 @@ +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const path = require('path'); + +module.exports = { + mode: 'development', + entry: './src/index.js', + devServer: { + port: 3000, + liveReload: true, + }, + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + }, + }, + { + test: /\.less$/i, + use: ['style-loader', 'css-loader', 'less-loader'], + }, + ], + }, + devtool: 'source-map', + resolve: { + extensions: ['.js', '.ts'], + alias: { + '@': path.resolve(__dirname, './src'), + }, + }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'index.html', + }), + ], +}; diff --git a/packages/fineui/babel.config.js b/packages/fineui/babel.config.js new file mode 100644 index 000000000..d01a496d7 --- /dev/null +++ b/packages/fineui/babel.config.js @@ -0,0 +1 @@ +module.exports = require('@fui/babel-preset-fineui').configs.base; \ No newline at end of file diff --git a/es6.babel.js b/packages/fineui/esm.babel.js similarity index 100% rename from es6.babel.js rename to packages/fineui/esm.babel.js diff --git a/packages/fineui/package.json b/packages/fineui/package.json new file mode 100644 index 000000000..a7dd64fb6 --- /dev/null +++ b/packages/fineui/package.json @@ -0,0 +1,43 @@ +{ + "name": "@fui/core", + "version": "2.0.20230208163847", + "description": "fineui", + "main": "dist/fineui_without_conflict.min.js", + "module": "dist/es/index.js", + "types": "dist/type/index.d.ts", + "sideEffects": [ + "dist/es/core/*.js", + "dist/es/polyfill/**/*.js", + "dist/es/core/platform/**/*.js", + "dist/es/case/ztree/jquery.ztree.core-3.5.js", + "dist/es/case/ztree/jquery.ztree.excheck-3.5.js" + ], + "bin": { + "fui-cli": "./bin/cli/cli.js" + }, + "scripts": { + "dev": "babel src -d dist/es --config-file ./esm.babel.js -w" + }, + "repository": { + "type": "git", + "url": "https://git.coding.net/fanruan/fineui.git" + }, + "keywords": [ + "ui", + "fineui", + "finebi" + ], + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, + "author": "fanruan", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.21.0", + "@juggle/resize-observer": "^3.4.0", + "@popperjs/core": "2.11.6", + "@types/yargs": "17.0.13", + "jquery": "3.6.3", + "yargs": "17.6.2" + } +} diff --git a/packages/fineui/src/base/0.base.js b/packages/fineui/src/base/0.base.js new file mode 100644 index 000000000..3cf9b52a3 --- /dev/null +++ b/packages/fineui/src/base/0.base.js @@ -0,0 +1,23 @@ +import { + BroadcastController, + BubblesController, + DrawerController, + LayerController, + MaskersController, + PopoverController, + ResizeController, + TooltipsController, +} from '../core/controller'; +import { StyleLoaderManager } from '../core/loader/loader.style'; + +const Resizers = new ResizeController(); +const Layers = new LayerController(); +const Maskers = new MaskersController(); +const Bubbles = new BubblesController(); +const Tooltips = new TooltipsController(); +const Popovers = new PopoverController(); +const Drawers = new DrawerController(); +const Broadcasts = new BroadcastController(); +const StyleLoaders = new StyleLoaderManager(); + +export { Resizers, Layers, Maskers, Bubbles, Tooltips, Popovers, Drawers, Broadcasts, StyleLoaders }; diff --git a/packages/fineui/src/base/1.pane.js b/packages/fineui/src/base/1.pane.js new file mode 100644 index 000000000..e36f2bd81 --- /dev/null +++ b/packages/fineui/src/base/1.pane.js @@ -0,0 +1,161 @@ +import { + AbsoluteCenterLayout, + CenterAdaptLayout, + HorizontalAdaptLayout, + VerticalLayout, + Widget, + shortcut, + isNotEmptyString, + extend, + isNull, + isEmpty, + createWidget, + Providers, + i18nText, + emptyFn, + SystemProvider +} from "@/core"; +import { Label, Text } from "./single"; +import { Layers } from "@/base/0.base"; + +/** + * 当没有元素时有提示信息的view + * + * Created by GUY on 2015/9/8. + * @class Pane + * @extends Widget + * @abstract + */ + +@shortcut() +export class Pane extends Widget { + static xtype = "bi.pane"; + static EVENT_LOADED = "EVENT_LOADED"; + static EVENT_LOADING = "EVENT_LOADING"; + + _defaultConfig() { + return extend(super._defaultConfig(), { + _baseCls: "bi-pane", + tipText: i18nText("BI-No_Selected_Item"), + loadingText: "", + loadingSize: "small", + overlap: true, + onLoaded: emptyFn, + }); + } + + _assertTip() { + if (!this._tipText) { + createWidget({ + type: AbsoluteCenterLayout.xtype, + element: this, + items: [ + { + type: Label.xtype, + ref: _ref => { + this._tipText = _ref; + }, + cls: "bi-tips", + text: this.options.tipText, + height: 25, + } + ], + }); + } + } + + loading() { + const o = this.options; + const loadingAnimation = createWidget( + Providers.getProvider(SystemProvider.xtype).getLoading({ + loadingSize: o.loadingSize, + context: this, + }) + ); + // pane在同步方式下由items决定tipText的显示与否 + // loading的异步情况下由loaded后对面板的populate的时机决定 + this.setTipVisible(false); + if (o.overlap === true) { + if (!Layers.has(`${this.getName()}-loading`)) { + createWidget({ + type: CenterAdaptLayout.xtype, + cls: "loading-container", + items: this._getLoadingTipItems(loadingAnimation), + element: Layers.make(`${this.getName()}-loading`, this), + }); + } + Layers.show(`${this.getName()}-loading`); + } else if (isNull(this._loading)) { + loadingAnimation.element.css("zIndex", 1); + createWidget({ + type: CenterAdaptLayout.xtype, + element: this, + cls: "loading-container", + items: this._getLoadingTipItems(loadingAnimation), + }); + } + this.fireEvent(Pane.EVENT_LOADING); + this.element.addClass("loading-status"); + } + + _getSize(v) { + return Math.ceil(v / (this.options.loadingSize === "small" ? 2 : 1)); + } + + _getLoadingTipItems(loadingTip) { + const o = this.options; + const loadingTipItems = [ + { + type: HorizontalAdaptLayout.xtype, + items: [loadingTip], + } + ]; + isNotEmptyString(o.loadingText) && + loadingTipItems.push({ + type: Text.xtype, + text: o.loadingText, + tgap: this._getSize(10), + }); + + return [ + { + type: VerticalLayout.xtype, + ref: _ref => { + this._loading = _ref; + }, + items: loadingTipItems, + } + ]; + } + + loaded() { + Layers.remove(`${this.getName()}-loading`); + this._loading && this._loading.destroy(); + this.options.onLoaded(); + this.fireEvent(Pane.EVENT_LOADED); + this.element.removeClass("loading-status"); + } + + check() { + this.setTipVisible(isEmpty(this.options.items)); + } + + setTipVisible(b) { + if (b === true) { + this._assertTip(); + this._tipText && this._tipText.setVisible(true); + } else { + this._tipText && this._tipText.setVisible(false); + } + } + + setTipText(text) { + this._assertTip(); + this._tipText.setText(text); + } + + populate(items) { + this.options.items = items || []; + this.check(); + } +} diff --git a/src/base/behavior/0.behavior.js b/packages/fineui/src/base/behavior/0.behavior.js similarity index 100% rename from src/base/behavior/0.behavior.js rename to packages/fineui/src/base/behavior/0.behavior.js diff --git a/src/base/behavior/behavior.highlight.js b/packages/fineui/src/base/behavior/behavior.highlight.js similarity index 100% rename from src/base/behavior/behavior.highlight.js rename to packages/fineui/src/base/behavior/behavior.highlight.js diff --git a/src/base/behavior/behavior.redmark.js b/packages/fineui/src/base/behavior/behavior.redmark.js similarity index 100% rename from src/base/behavior/behavior.redmark.js rename to packages/fineui/src/base/behavior/behavior.redmark.js diff --git a/src/base/behavior/index.js b/packages/fineui/src/base/behavior/index.js similarity index 100% rename from src/base/behavior/index.js rename to packages/fineui/src/base/behavior/index.js diff --git a/src/base/collection/__test__/collection.test.js b/packages/fineui/src/base/collection/__test__/collection.test.js similarity index 100% rename from src/base/collection/__test__/collection.test.js rename to packages/fineui/src/base/collection/__test__/collection.test.js diff --git a/src/base/collection/collection.js b/packages/fineui/src/base/collection/collection.js similarity index 100% rename from src/base/collection/collection.js rename to packages/fineui/src/base/collection/collection.js diff --git a/src/base/combination/bubble.js b/packages/fineui/src/base/combination/bubble.js similarity index 100% rename from src/base/combination/bubble.js rename to packages/fineui/src/base/combination/bubble.js diff --git a/src/base/combination/combo.js b/packages/fineui/src/base/combination/combo.js similarity index 100% rename from src/base/combination/combo.js rename to packages/fineui/src/base/combination/combo.js diff --git a/src/base/combination/expander.js b/packages/fineui/src/base/combination/expander.js similarity index 100% rename from src/base/combination/expander.js rename to packages/fineui/src/base/combination/expander.js diff --git a/src/base/combination/group.button.js b/packages/fineui/src/base/combination/group.button.js similarity index 100% rename from src/base/combination/group.button.js rename to packages/fineui/src/base/combination/group.button.js diff --git a/src/base/combination/group.combo.js b/packages/fineui/src/base/combination/group.combo.js similarity index 100% rename from src/base/combination/group.combo.js rename to packages/fineui/src/base/combination/group.combo.js diff --git a/src/base/combination/group.virtual.js b/packages/fineui/src/base/combination/group.virtual.js similarity index 100% rename from src/base/combination/group.virtual.js rename to packages/fineui/src/base/combination/group.virtual.js diff --git a/src/base/combination/index.js b/packages/fineui/src/base/combination/index.js similarity index 100% rename from src/base/combination/index.js rename to packages/fineui/src/base/combination/index.js diff --git a/src/base/combination/loader.js b/packages/fineui/src/base/combination/loader.js similarity index 100% rename from src/base/combination/loader.js rename to packages/fineui/src/base/combination/loader.js diff --git a/src/base/combination/navigation.js b/packages/fineui/src/base/combination/navigation.js similarity index 100% rename from src/base/combination/navigation.js rename to packages/fineui/src/base/combination/navigation.js diff --git a/src/base/combination/searcher.js b/packages/fineui/src/base/combination/searcher.js similarity index 100% rename from src/base/combination/searcher.js rename to packages/fineui/src/base/combination/searcher.js diff --git a/src/base/combination/switcher.js b/packages/fineui/src/base/combination/switcher.js similarity index 100% rename from src/base/combination/switcher.js rename to packages/fineui/src/base/combination/switcher.js diff --git a/src/base/combination/tab.js b/packages/fineui/src/base/combination/tab.js similarity index 100% rename from src/base/combination/tab.js rename to packages/fineui/src/base/combination/tab.js diff --git a/src/base/combination/tree.button.js b/packages/fineui/src/base/combination/tree.button.js similarity index 100% rename from src/base/combination/tree.button.js rename to packages/fineui/src/base/combination/tree.button.js diff --git a/src/base/context.js b/packages/fineui/src/base/context.js similarity index 100% rename from src/base/context.js rename to packages/fineui/src/base/context.js diff --git a/src/base/el.js b/packages/fineui/src/base/el.js similarity index 100% rename from src/base/el.js rename to packages/fineui/src/base/el.js diff --git a/src/base/foundation/__test__/message.test.js b/packages/fineui/src/base/foundation/__test__/message.test.js similarity index 100% rename from src/base/foundation/__test__/message.test.js rename to packages/fineui/src/base/foundation/__test__/message.test.js diff --git a/src/base/foundation/message.js b/packages/fineui/src/base/foundation/message.js similarity index 100% rename from src/base/foundation/message.js rename to packages/fineui/src/base/foundation/message.js diff --git a/src/base/grid/__test__/grid.test.js b/packages/fineui/src/base/grid/__test__/grid.test.js similarity index 100% rename from src/base/grid/__test__/grid.test.js rename to packages/fineui/src/base/grid/__test__/grid.test.js diff --git a/src/base/grid/grid.js b/packages/fineui/src/base/grid/grid.js similarity index 100% rename from src/base/grid/grid.js rename to packages/fineui/src/base/grid/grid.js diff --git a/src/base/index.js b/packages/fineui/src/base/index.js similarity index 100% rename from src/base/index.js rename to packages/fineui/src/base/index.js diff --git a/src/base/layer/__test__/layer.popover.test.js b/packages/fineui/src/base/layer/__test__/layer.popover.test.js similarity index 100% rename from src/base/layer/__test__/layer.popover.test.js rename to packages/fineui/src/base/layer/__test__/layer.popover.test.js diff --git a/src/base/layer/index.js b/packages/fineui/src/base/layer/index.js similarity index 100% rename from src/base/layer/index.js rename to packages/fineui/src/base/layer/index.js diff --git a/src/base/layer/layer.drawer.js b/packages/fineui/src/base/layer/layer.drawer.js similarity index 100% rename from src/base/layer/layer.drawer.js rename to packages/fineui/src/base/layer/layer.drawer.js diff --git a/src/base/layer/layer.popover.js b/packages/fineui/src/base/layer/layer.popover.js similarity index 100% rename from src/base/layer/layer.popover.js rename to packages/fineui/src/base/layer/layer.popover.js diff --git a/src/base/layer/layer.popup.js b/packages/fineui/src/base/layer/layer.popup.js similarity index 100% rename from src/base/layer/layer.popup.js rename to packages/fineui/src/base/layer/layer.popup.js diff --git a/src/base/layer/layer.searcher.js b/packages/fineui/src/base/layer/layer.searcher.js similarity index 100% rename from src/base/layer/layer.searcher.js rename to packages/fineui/src/base/layer/layer.searcher.js diff --git a/src/base/list/__test__/listview.test.js b/packages/fineui/src/base/list/__test__/listview.test.js similarity index 100% rename from src/base/list/__test__/listview.test.js rename to packages/fineui/src/base/list/__test__/listview.test.js diff --git a/src/base/list/index.js b/packages/fineui/src/base/list/index.js similarity index 100% rename from src/base/list/index.js rename to packages/fineui/src/base/list/index.js diff --git a/src/base/list/listview.js b/packages/fineui/src/base/list/listview.js similarity index 100% rename from src/base/list/listview.js rename to packages/fineui/src/base/list/listview.js diff --git a/src/base/list/virtualgrouplist.js b/packages/fineui/src/base/list/virtualgrouplist.js similarity index 100% rename from src/base/list/virtualgrouplist.js rename to packages/fineui/src/base/list/virtualgrouplist.js diff --git a/src/base/list/virtuallist.js b/packages/fineui/src/base/list/virtuallist.js similarity index 100% rename from src/base/list/virtuallist.js rename to packages/fineui/src/base/list/virtuallist.js diff --git a/packages/fineui/src/base/pager/pager.js b/packages/fineui/src/base/pager/pager.js new file mode 100644 index 000000000..19f47066f --- /dev/null +++ b/packages/fineui/src/base/pager/pager.js @@ -0,0 +1,418 @@ +import { + HorizontalLayout, + Widget, + shortcut, + extend, + emptyFn, + result, + isKey, + createWidget, + map, + stripEL, + formatEL, + Controller, + Events, + MIN, + MAX +} from "@/core"; +import { Label } from "../single"; +import { ButtonGroup } from "../combination"; + +/** + * 分页控件 + * + * Created by GUY on 2015/8/31. + * @class Pager + * @extends Widget + */ + +@shortcut() +export class Pager extends Widget { + static xtype = "bi.pager"; + static EVENT_CHANGE = "EVENT_CHANGE"; + static EVENT_AFTER_POPULATE = "EVENT_AFTER_POPULATE"; + + _defaultConfig() { + return extend(super._defaultConfig(...arguments), { + baseCls: "bi-pager", + behaviors: {}, + layouts: [ + { + type: HorizontalLayout.xtype, + hgap: 10, + vgap: 0 + } + ], + + dynamicShow: true, // 是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态 + // dynamicShow为false时以下两个有用 + dynamicShowFirstLast: false, // 是否动态显示首页、尾页 + dynamicShowPrevNext: false, // 是否动态显示上一页、下一页 + pages: false, // 总页数 + curr: () => 1, // 初始化当前页 + groups: 0, // 连续显示分页数 + jump: emptyFn, // 分页的回调函数 + first: false, // 是否显示首页 + last: false, // 是否显示尾页 + prev: "上一页", + next: "下一页", + + firstPage: 1, + lastPage: () => + // 在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法 + 1, + hasPrev: emptyFn, // pages不可用时有效 + hasNext: emptyFn // pages不可用时有效 + }); + } + + render() { + this.currPage = result(this.options, "curr"); + // 翻页太灵敏 + // this._lock = false; + // this._debouce = debounce(function () { + // self._lock = false; + // }, 300); + this._populate(); + } + + _populate() { + const o = this.options, + view = [], + dict = {}; + const { + dynamicShow, + dynamicShowPrevNext, + hasPrev, + dynamicShowFirstLast, + hasNext, + behaviors, + layouts, + jump + } = this.options; + this.empty(); + const pages = result(o, "pages"); + const curr = result(this, "currPage"); + let groups = result(o, "groups"); + let first = result(o, "first"); + let last = result(o, "last"); + const prev = result(o, "prev"); + const next = result(o, "next"); + + if (pages === false) { + groups = 0; + first = false; + last = false; + } else { + groups > pages && (groups = pages); + } + + // 计算当前组 + dict.index = Math.ceil( + (curr + (groups > 1 && groups !== pages ? 1 : 0)) / + (groups === 0 ? 1 : groups) + ); + + // 当前页非首页,则输出上一页 + if ( + ((!dynamicShow && !dynamicShowPrevNext) || curr > 1) && + prev !== false + ) { + if (isKey(prev)) { + view.push({ + text: prev, + value: "prev", + disabled: + pages === false + ? hasPrev(curr) === false + : !(curr > 1 && prev !== false) + }); + } else { + view.push({ + el: extend( + { + disabled: + pages === false + ? hasPrev(curr) === false + : !(curr > 1 && prev !== false) + }, + prev + ) + }); + } + } + + // 当前组非首组,则输出首页 + if ( + ((!dynamicShow && !dynamicShowFirstLast) || + (dict.index > 1 && groups !== 0)) && + first + ) { + view.push({ + text: first, + value: "first", + disabled: !(dict.index > 1 && groups !== 0) + }); + if (dict.index > 1 && groups !== 0 && groups !== pages - 1) { + view.push({ + type: Label.xtype, + cls: "page-ellipsis", + text: "\u2026" + }); + } + } + + // 输出当前页组 + dict.poor = Math.floor((groups - 1) / 2); + dict.start = dict.index > 1 ? curr - dict.poor : 1; + dict.end = + dict.index > 1 + ? (function () { + const max = curr + (groups - dict.poor - 1); + + return max > pages ? pages : max; + })() + : groups; + if (dict.end - dict.start < groups - 1) { + // 最后一组状态 + dict.start = dict.end - groups + 1; + } + let s = dict.start, + e = dict.end; + if ( + first && + last && + dict.index > 1 && + groups !== 0 && + pages > groups && + dict.end < pages && + groups !== 0 + ) { + s++; + e--; + } + for (; s <= e; s++) { + if (s === curr) { + view.push({ + text: s, + value: s, + selected: true + }); + } else { + view.push({ + text: s, + value: s + }); + } + } + + // 总页数大于连续分页数,且当前组最大页小于总页,输出尾页 + if ( + ((!dynamicShow && !dynamicShowFirstLast) || + (pages > groups && dict.end < pages && groups !== 0)) && + last + ) { + if ( + pages > groups && + dict.end < pages && + groups !== 0 && + groups !== pages - 1 + ) { + view.push({ + type: Label.xtype, + cls: "page-ellipsis", + text: "\u2026" + }); + } + view.push({ + text: last, + value: "last", + disabled: !(pages > groups && dict.end < pages && groups !== 0) + }); + } + + // 当前页不为尾页时,输出下一页 + dict.flow = !prev && groups === 0; + if ( + (!dynamicShow && !dynamicShowPrevNext && next) || + (curr !== pages && next) || + dict.flow + ) { + view.push( + (function () { + if (isKey(next)) { + if (pages === false) { + return { + text: next, + value: "next", + disabled: hasNext(curr) === false + }; + } + + return dict.flow && curr === pages + ? { text: next, value: "next", disabled: true } + : { + text: next, + value: "next", + disabled: !( + (curr !== pages && next) || + dict.flow + ) + }; + } + + return { + el: extend( + { + disabled: + pages === false + ? hasNext(curr) === false + : !( + (curr !== pages && next) || + dict.flow + ) + }, + next + ) + }; + })() + ); + } + + this.button_group = createWidget({ + type: ButtonGroup.xtype, + element: this, + items: map(view, (idx, v) => { + v = extend( + { + cls: "bi-list-item-select bi-border-radius", + height: 23, + hgap: v.el ? 0 : 10, + stopPropagation: true + }, + stripEL(v) + ); + + return formatEL(v); + }), + behaviors, + layouts + }); + this.button_group.on( + Controller.EVENT_CHANGE, + (type, value, obj, ...args) => { + // if (self._lock === true) { + // return; + // } + // self._lock = true; + // self._debouce(); + if (type === Events.CLICK) { + const v = this.button_group.getValue()[0]; + switch (v) { + case "first": + this.currPage = 1; + break; + case "last": + this.currPage = pages; + break; + case "prev": + this.currPage--; + break; + case "next": + this.currPage++; + break; + default: + this.currPage = v; + break; + } + jump.apply(this, [ + { + pages, + curr: this.currPage + } + ]); + this._populate(); + this.fireEvent(Pager.EVENT_CHANGE, obj); + } + this.fireEvent( + Controller.EVENT_CHANGE, + type, + value, + obj, + ...args + ); + } + ); + this.fireEvent(Pager.EVENT_AFTER_POPULATE); + } + + getCurrentPage() { + return this.currPage; + } + + setAllPages(pages) { + this.options.pages = pages; + this._populate(); + } + + hasPrev(v) { + v || (v = 1); + const { pages, hasPrev } = this.options; + + return pages === false ? hasPrev(v) : v > 1; + } + + hasNext(v) { + v || (v = 1); + const { pages, hasNext } = this.options; + + return pages === false ? hasNext(v) : v < pages; + } + + setValue(v) { + const o = this.options; + const { pages } = this.options; + v = v || 0; + v = v < 1 ? 1 : v; + if (pages === false) { + const lastPage = result(o, "lastPage"); + let firstPage = 1; + this.currPage = + v > lastPage + ? lastPage + : ((firstPage = result(o, "firstPage")), + v < firstPage ? firstPage : v); + } else { + v = v > pages ? pages : v; + this.currPage = v; + } + this._populate(); + } + + getValue() { + const val = this.button_group.getValue()[0]; + switch (val) { + case "prev": + return -1; + case "next": + return 1; + case "first": + return MIN; + case "last": + return MAX; + default: + return val; + } + } + + attr(key, value) { + super.attr(...arguments); + if (key === "curr") { + this.currPage = result(this.options, "curr"); + } + } + + populate() { + this._populate(); + } +} diff --git a/src/base/single/0.single.js b/packages/fineui/src/base/single/0.single.js similarity index 100% rename from src/base/single/0.single.js rename to packages/fineui/src/base/single/0.single.js diff --git a/src/base/single/1.text.js b/packages/fineui/src/base/single/1.text.js similarity index 100% rename from src/base/single/1.text.js rename to packages/fineui/src/base/single/1.text.js diff --git a/src/base/single/__test__/text.test.js b/packages/fineui/src/base/single/__test__/text.test.js similarity index 100% rename from src/base/single/__test__/text.test.js rename to packages/fineui/src/base/single/__test__/text.test.js diff --git a/src/base/single/a/__test__/a.test.js b/packages/fineui/src/base/single/a/__test__/a.test.js similarity index 100% rename from src/base/single/a/__test__/a.test.js rename to packages/fineui/src/base/single/a/__test__/a.test.js diff --git a/src/base/single/a/a.js b/packages/fineui/src/base/single/a/a.js similarity index 100% rename from src/base/single/a/a.js rename to packages/fineui/src/base/single/a/a.js diff --git a/src/base/single/bar/bar.loading.js b/packages/fineui/src/base/single/bar/bar.loading.js similarity index 100% rename from src/base/single/bar/bar.loading.js rename to packages/fineui/src/base/single/bar/bar.loading.js diff --git a/src/base/single/button/button.basic.js b/packages/fineui/src/base/single/button/button.basic.js similarity index 100% rename from src/base/single/button/button.basic.js rename to packages/fineui/src/base/single/button/button.basic.js diff --git a/src/base/single/button/button.node.js b/packages/fineui/src/base/single/button/button.node.js similarity index 100% rename from src/base/single/button/button.node.js rename to packages/fineui/src/base/single/button/button.node.js diff --git a/src/base/single/button/buttons/__test__/button.test.js b/packages/fineui/src/base/single/button/buttons/__test__/button.test.js similarity index 100% rename from src/base/single/button/buttons/__test__/button.test.js rename to packages/fineui/src/base/single/button/buttons/__test__/button.test.js diff --git a/src/base/single/button/buttons/button.icon.js b/packages/fineui/src/base/single/button/buttons/button.icon.js similarity index 100% rename from src/base/single/button/buttons/button.icon.js rename to packages/fineui/src/base/single/button/buttons/button.icon.js diff --git a/src/base/single/button/buttons/button.image.js b/packages/fineui/src/base/single/button/buttons/button.image.js similarity index 100% rename from src/base/single/button/buttons/button.image.js rename to packages/fineui/src/base/single/button/buttons/button.image.js diff --git a/src/base/single/button/buttons/button.js b/packages/fineui/src/base/single/button/buttons/button.js similarity index 100% rename from src/base/single/button/buttons/button.js rename to packages/fineui/src/base/single/button/buttons/button.js diff --git a/src/base/single/button/buttons/button.text.js b/packages/fineui/src/base/single/button/buttons/button.text.js similarity index 100% rename from src/base/single/button/buttons/button.text.js rename to packages/fineui/src/base/single/button/buttons/button.text.js diff --git a/src/base/single/button/index.js b/packages/fineui/src/base/single/button/index.js similarity index 100% rename from src/base/single/button/index.js rename to packages/fineui/src/base/single/button/index.js diff --git a/src/base/single/button/listitem/blankiconicontextitem.js b/packages/fineui/src/base/single/button/listitem/blankiconicontextitem.js similarity index 100% rename from src/base/single/button/listitem/blankiconicontextitem.js rename to packages/fineui/src/base/single/button/listitem/blankiconicontextitem.js diff --git a/src/base/single/button/listitem/blankicontexticonitem.js b/packages/fineui/src/base/single/button/listitem/blankicontexticonitem.js similarity index 100% rename from src/base/single/button/listitem/blankicontexticonitem.js rename to packages/fineui/src/base/single/button/listitem/blankicontexticonitem.js diff --git a/src/base/single/button/listitem/blankicontextitem.js b/packages/fineui/src/base/single/button/listitem/blankicontextitem.js similarity index 100% rename from src/base/single/button/listitem/blankicontextitem.js rename to packages/fineui/src/base/single/button/listitem/blankicontextitem.js diff --git a/src/base/single/button/listitem/icontexticonitem.js b/packages/fineui/src/base/single/button/listitem/icontexticonitem.js similarity index 100% rename from src/base/single/button/listitem/icontexticonitem.js rename to packages/fineui/src/base/single/button/listitem/icontexticonitem.js diff --git a/src/base/single/button/listitem/icontextitem.js b/packages/fineui/src/base/single/button/listitem/icontextitem.js similarity index 100% rename from src/base/single/button/listitem/icontextitem.js rename to packages/fineui/src/base/single/button/listitem/icontextitem.js diff --git a/src/base/single/button/listitem/texticonitem.js b/packages/fineui/src/base/single/button/listitem/texticonitem.js similarity index 100% rename from src/base/single/button/listitem/texticonitem.js rename to packages/fineui/src/base/single/button/listitem/texticonitem.js diff --git a/src/base/single/button/listitem/textitem.js b/packages/fineui/src/base/single/button/listitem/textitem.js similarity index 100% rename from src/base/single/button/listitem/textitem.js rename to packages/fineui/src/base/single/button/listitem/textitem.js diff --git a/src/base/single/button/node/__test__/icontexticonnode.test.js b/packages/fineui/src/base/single/button/node/__test__/icontexticonnode.test.js similarity index 100% rename from src/base/single/button/node/__test__/icontexticonnode.test.js rename to packages/fineui/src/base/single/button/node/__test__/icontexticonnode.test.js diff --git a/src/base/single/button/node/__test__/icontextnode.test.js b/packages/fineui/src/base/single/button/node/__test__/icontextnode.test.js similarity index 100% rename from src/base/single/button/node/__test__/icontextnode.test.js rename to packages/fineui/src/base/single/button/node/__test__/icontextnode.test.js diff --git a/src/base/single/button/node/__test__/texticonnode.test.js b/packages/fineui/src/base/single/button/node/__test__/texticonnode.test.js similarity index 100% rename from src/base/single/button/node/__test__/texticonnode.test.js rename to packages/fineui/src/base/single/button/node/__test__/texticonnode.test.js diff --git a/src/base/single/button/node/__test__/textnode.test.js b/packages/fineui/src/base/single/button/node/__test__/textnode.test.js similarity index 100% rename from src/base/single/button/node/__test__/textnode.test.js rename to packages/fineui/src/base/single/button/node/__test__/textnode.test.js diff --git a/src/base/single/button/node/icontexticonnode.js b/packages/fineui/src/base/single/button/node/icontexticonnode.js similarity index 100% rename from src/base/single/button/node/icontexticonnode.js rename to packages/fineui/src/base/single/button/node/icontexticonnode.js diff --git a/src/base/single/button/node/icontextnode.js b/packages/fineui/src/base/single/button/node/icontextnode.js similarity index 100% rename from src/base/single/button/node/icontextnode.js rename to packages/fineui/src/base/single/button/node/icontextnode.js diff --git a/src/base/single/button/node/texticonnode.js b/packages/fineui/src/base/single/button/node/texticonnode.js similarity index 100% rename from src/base/single/button/node/texticonnode.js rename to packages/fineui/src/base/single/button/node/texticonnode.js diff --git a/src/base/single/button/node/textnode.js b/packages/fineui/src/base/single/button/node/textnode.js similarity index 100% rename from src/base/single/button/node/textnode.js rename to packages/fineui/src/base/single/button/node/textnode.js diff --git a/src/base/single/editor/editor.js b/packages/fineui/src/base/single/editor/editor.js similarity index 100% rename from src/base/single/editor/editor.js rename to packages/fineui/src/base/single/editor/editor.js diff --git a/src/base/single/editor/editor.multifile.js b/packages/fineui/src/base/single/editor/editor.multifile.js similarity index 100% rename from src/base/single/editor/editor.multifile.js rename to packages/fineui/src/base/single/editor/editor.multifile.js diff --git a/src/base/single/editor/editor.textarea.js b/packages/fineui/src/base/single/editor/editor.textarea.js similarity index 100% rename from src/base/single/editor/editor.textarea.js rename to packages/fineui/src/base/single/editor/editor.textarea.js diff --git a/src/base/single/editor/index.js b/packages/fineui/src/base/single/editor/index.js similarity index 100% rename from src/base/single/editor/index.js rename to packages/fineui/src/base/single/editor/index.js diff --git a/src/base/single/html/__test__/html.test.js b/packages/fineui/src/base/single/html/__test__/html.test.js similarity index 100% rename from src/base/single/html/__test__/html.test.js rename to packages/fineui/src/base/single/html/__test__/html.test.js diff --git a/src/base/single/html/html.js b/packages/fineui/src/base/single/html/html.js similarity index 100% rename from src/base/single/html/html.js rename to packages/fineui/src/base/single/html/html.js diff --git a/src/base/single/icon/icon.js b/packages/fineui/src/base/single/icon/icon.js similarity index 100% rename from src/base/single/icon/icon.js rename to packages/fineui/src/base/single/icon/icon.js diff --git a/src/base/single/iframe/__test__/iframe.test.js b/packages/fineui/src/base/single/iframe/__test__/iframe.test.js similarity index 100% rename from src/base/single/iframe/__test__/iframe.test.js rename to packages/fineui/src/base/single/iframe/__test__/iframe.test.js diff --git a/src/base/single/iframe/iframe.js b/packages/fineui/src/base/single/iframe/iframe.js similarity index 100% rename from src/base/single/iframe/iframe.js rename to packages/fineui/src/base/single/iframe/iframe.js diff --git a/src/base/single/img/__test__/img.test.js b/packages/fineui/src/base/single/img/__test__/img.test.js similarity index 100% rename from src/base/single/img/__test__/img.test.js rename to packages/fineui/src/base/single/img/__test__/img.test.js diff --git a/src/base/single/img/img.js b/packages/fineui/src/base/single/img/img.js similarity index 100% rename from src/base/single/img/img.js rename to packages/fineui/src/base/single/img/img.js diff --git a/src/base/single/index.js b/packages/fineui/src/base/single/index.js similarity index 100% rename from src/base/single/index.js rename to packages/fineui/src/base/single/index.js diff --git a/src/base/single/input/checkbox/checkbox.image.js b/packages/fineui/src/base/single/input/checkbox/checkbox.image.js similarity index 100% rename from src/base/single/input/checkbox/checkbox.image.js rename to packages/fineui/src/base/single/input/checkbox/checkbox.image.js diff --git a/src/base/single/input/checkbox/checkbox.js b/packages/fineui/src/base/single/input/checkbox/checkbox.js similarity index 100% rename from src/base/single/input/checkbox/checkbox.js rename to packages/fineui/src/base/single/input/checkbox/checkbox.js diff --git a/src/base/single/input/file.js b/packages/fineui/src/base/single/input/file.js similarity index 100% rename from src/base/single/input/file.js rename to packages/fineui/src/base/single/input/file.js diff --git a/src/base/single/input/index.js b/packages/fineui/src/base/single/input/index.js similarity index 100% rename from src/base/single/input/index.js rename to packages/fineui/src/base/single/input/index.js diff --git a/src/base/single/input/input.js b/packages/fineui/src/base/single/input/input.js similarity index 100% rename from src/base/single/input/input.js rename to packages/fineui/src/base/single/input/input.js diff --git a/src/base/single/input/radio/radio.image.js b/packages/fineui/src/base/single/input/radio/radio.image.js similarity index 100% rename from src/base/single/input/radio/radio.image.js rename to packages/fineui/src/base/single/input/radio/radio.image.js diff --git a/src/base/single/input/radio/radio.js b/packages/fineui/src/base/single/input/radio/radio.js similarity index 100% rename from src/base/single/input/radio/radio.js rename to packages/fineui/src/base/single/input/radio/radio.js diff --git a/src/base/single/instruction/instruction.js b/packages/fineui/src/base/single/instruction/instruction.js similarity index 100% rename from src/base/single/instruction/instruction.js rename to packages/fineui/src/base/single/instruction/instruction.js diff --git a/src/base/single/label/abstract.label.js b/packages/fineui/src/base/single/label/abstract.label.js similarity index 100% rename from src/base/single/label/abstract.label.js rename to packages/fineui/src/base/single/label/abstract.label.js diff --git a/src/base/single/label/html.label.js b/packages/fineui/src/base/single/label/html.label.js similarity index 100% rename from src/base/single/label/html.label.js rename to packages/fineui/src/base/single/label/html.label.js diff --git a/src/base/single/label/icon.label.js b/packages/fineui/src/base/single/label/icon.label.js similarity index 100% rename from src/base/single/label/icon.label.js rename to packages/fineui/src/base/single/label/icon.label.js diff --git a/src/base/single/label/index.js b/packages/fineui/src/base/single/label/index.js similarity index 100% rename from src/base/single/label/index.js rename to packages/fineui/src/base/single/label/index.js diff --git a/src/base/single/label/label.js b/packages/fineui/src/base/single/label/label.js similarity index 100% rename from src/base/single/label/label.js rename to packages/fineui/src/base/single/label/label.js diff --git a/src/base/single/link/__test__/link.test.js b/packages/fineui/src/base/single/link/__test__/link.test.js similarity index 100% rename from src/base/single/link/__test__/link.test.js rename to packages/fineui/src/base/single/link/__test__/link.test.js diff --git a/src/base/single/link/link.js b/packages/fineui/src/base/single/link/link.js similarity index 100% rename from src/base/single/link/link.js rename to packages/fineui/src/base/single/link/link.js diff --git a/src/base/single/text.pure.js b/packages/fineui/src/base/single/text.pure.js similarity index 100% rename from src/base/single/text.pure.js rename to packages/fineui/src/base/single/text.pure.js diff --git a/src/base/single/tip/0.tip.js b/packages/fineui/src/base/single/tip/0.tip.js similarity index 100% rename from src/base/single/tip/0.tip.js rename to packages/fineui/src/base/single/tip/0.tip.js diff --git a/src/base/single/tip/index.js b/packages/fineui/src/base/single/tip/index.js similarity index 100% rename from src/base/single/tip/index.js rename to packages/fineui/src/base/single/tip/index.js diff --git a/src/base/single/tip/tip.toast.js b/packages/fineui/src/base/single/tip/tip.toast.js similarity index 100% rename from src/base/single/tip/tip.toast.js rename to packages/fineui/src/base/single/tip/tip.toast.js diff --git a/src/base/single/tip/tip.tooltip.js b/packages/fineui/src/base/single/tip/tip.tooltip.js similarity index 100% rename from src/base/single/tip/tip.tooltip.js rename to packages/fineui/src/base/single/tip/tip.tooltip.js diff --git a/src/base/single/trigger/trigger.js b/packages/fineui/src/base/single/trigger/trigger.js similarity index 100% rename from src/base/single/trigger/trigger.js rename to packages/fineui/src/base/single/trigger/trigger.js diff --git a/src/base/tree/customtree.js b/packages/fineui/src/base/tree/customtree.js similarity index 100% rename from src/base/tree/customtree.js rename to packages/fineui/src/base/tree/customtree.js diff --git a/src/bundle.js b/packages/fineui/src/bundle.js similarity index 100% rename from src/bundle.js rename to packages/fineui/src/bundle.js diff --git a/src/case/button/icon/icon.change.js b/packages/fineui/src/case/button/icon/icon.change.js similarity index 100% rename from src/case/button/icon/icon.change.js rename to packages/fineui/src/case/button/icon/icon.change.js diff --git a/src/case/button/icon/icon.trigger.js b/packages/fineui/src/case/button/icon/icon.trigger.js similarity index 100% rename from src/case/button/icon/icon.trigger.js rename to packages/fineui/src/case/button/icon/icon.trigger.js diff --git a/src/case/button/icon/iconhalf/icon.half.image.js b/packages/fineui/src/case/button/icon/iconhalf/icon.half.image.js similarity index 100% rename from src/case/button/icon/iconhalf/icon.half.image.js rename to packages/fineui/src/case/button/icon/iconhalf/icon.half.image.js diff --git a/src/case/button/icon/iconhalf/icon.half.js b/packages/fineui/src/case/button/icon/iconhalf/icon.half.js similarity index 100% rename from src/case/button/icon/iconhalf/icon.half.js rename to packages/fineui/src/case/button/icon/iconhalf/icon.half.js diff --git a/src/case/button/index.js b/packages/fineui/src/case/button/index.js similarity index 100% rename from src/case/button/index.js rename to packages/fineui/src/case/button/index.js diff --git a/src/case/button/item.multiselect.js b/packages/fineui/src/case/button/item.multiselect.js similarity index 100% rename from src/case/button/item.multiselect.js rename to packages/fineui/src/case/button/item.multiselect.js diff --git a/src/case/button/item.singleselect.icontext.js b/packages/fineui/src/case/button/item.singleselect.icontext.js similarity index 100% rename from src/case/button/item.singleselect.icontext.js rename to packages/fineui/src/case/button/item.singleselect.icontext.js diff --git a/src/case/button/item.singleselect.js b/packages/fineui/src/case/button/item.singleselect.js similarity index 100% rename from src/case/button/item.singleselect.js rename to packages/fineui/src/case/button/item.singleselect.js diff --git a/src/case/button/item.singleselect.radio.js b/packages/fineui/src/case/button/item.singleselect.radio.js similarity index 100% rename from src/case/button/item.singleselect.radio.js rename to packages/fineui/src/case/button/item.singleselect.radio.js diff --git a/src/case/button/node/__test__/node.arrow.test.js b/packages/fineui/src/case/button/node/__test__/node.arrow.test.js similarity index 100% rename from src/case/button/node/__test__/node.arrow.test.js rename to packages/fineui/src/case/button/node/__test__/node.arrow.test.js diff --git a/src/case/button/node/__test__/node.first.plus.test.js b/packages/fineui/src/case/button/node/__test__/node.first.plus.test.js similarity index 100% rename from src/case/button/node/__test__/node.first.plus.test.js rename to packages/fineui/src/case/button/node/__test__/node.first.plus.test.js diff --git a/src/case/button/node/__test__/node.icon.arrow.test.js b/packages/fineui/src/case/button/node/__test__/node.icon.arrow.test.js similarity index 100% rename from src/case/button/node/__test__/node.icon.arrow.test.js rename to packages/fineui/src/case/button/node/__test__/node.icon.arrow.test.js diff --git a/src/case/button/node/__test__/node.last.plus.test.js b/packages/fineui/src/case/button/node/__test__/node.last.plus.test.js similarity index 100% rename from src/case/button/node/__test__/node.last.plus.test.js rename to packages/fineui/src/case/button/node/__test__/node.last.plus.test.js diff --git a/src/case/button/node/__test__/node.mid.plus.test.js b/packages/fineui/src/case/button/node/__test__/node.mid.plus.test.js similarity index 100% rename from src/case/button/node/__test__/node.mid.plus.test.js rename to packages/fineui/src/case/button/node/__test__/node.mid.plus.test.js diff --git a/src/case/button/node/__test__/node.multilayer.icon.arrow.test.js b/packages/fineui/src/case/button/node/__test__/node.multilayer.icon.arrow.test.js similarity index 100% rename from src/case/button/node/__test__/node.multilayer.icon.arrow.test.js rename to packages/fineui/src/case/button/node/__test__/node.multilayer.icon.arrow.test.js diff --git a/src/case/button/node/__test__/node.plus.test.js b/packages/fineui/src/case/button/node/__test__/node.plus.test.js similarity index 100% rename from src/case/button/node/__test__/node.plus.test.js rename to packages/fineui/src/case/button/node/__test__/node.plus.test.js diff --git a/src/case/button/node/node.arrow.js b/packages/fineui/src/case/button/node/node.arrow.js similarity index 100% rename from src/case/button/node/node.arrow.js rename to packages/fineui/src/case/button/node/node.arrow.js diff --git a/src/case/button/node/node.icon.arrow.js b/packages/fineui/src/case/button/node/node.icon.arrow.js similarity index 100% rename from src/case/button/node/node.icon.arrow.js rename to packages/fineui/src/case/button/node/node.icon.arrow.js diff --git a/src/case/button/node/node.multilayer.icon.arrow.js b/packages/fineui/src/case/button/node/node.multilayer.icon.arrow.js similarity index 100% rename from src/case/button/node/node.multilayer.icon.arrow.js rename to packages/fineui/src/case/button/node/node.multilayer.icon.arrow.js diff --git a/src/case/button/node/node.plus.js b/packages/fineui/src/case/button/node/node.plus.js similarity index 100% rename from src/case/button/node/node.plus.js rename to packages/fineui/src/case/button/node/node.plus.js diff --git a/src/case/button/node/siwtcher.tree.node.js b/packages/fineui/src/case/button/node/siwtcher.tree.node.js similarity index 100% rename from src/case/button/node/siwtcher.tree.node.js rename to packages/fineui/src/case/button/node/siwtcher.tree.node.js diff --git a/src/case/button/node/treenode.js b/packages/fineui/src/case/button/node/treenode.js similarity index 100% rename from src/case/button/node/treenode.js rename to packages/fineui/src/case/button/node/treenode.js diff --git a/src/case/button/switch.js b/packages/fineui/src/case/button/switch.js similarity index 100% rename from src/case/button/switch.js rename to packages/fineui/src/case/button/switch.js diff --git a/src/case/button/treeitem/__test__/item.treeleaf.test.js b/packages/fineui/src/case/button/treeitem/__test__/item.treeleaf.test.js similarity index 100% rename from src/case/button/treeitem/__test__/item.treeleaf.test.js rename to packages/fineui/src/case/button/treeitem/__test__/item.treeleaf.test.js diff --git a/src/case/button/treeitem/item.icon.treeleaf.js b/packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js similarity index 100% rename from src/case/button/treeitem/item.icon.treeleaf.js rename to packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js diff --git a/src/case/button/treeitem/item.multilayer.icon.treeleaf.js b/packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js similarity index 100% rename from src/case/button/treeitem/item.multilayer.icon.treeleaf.js rename to packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js diff --git a/src/case/button/treeitem/treeitem.js b/packages/fineui/src/case/button/treeitem/treeitem.js similarity index 100% rename from src/case/button/treeitem/treeitem.js rename to packages/fineui/src/case/button/treeitem/treeitem.js diff --git a/src/case/calendar/calendar.date.item.js b/packages/fineui/src/case/calendar/calendar.date.item.js similarity index 100% rename from src/case/calendar/calendar.date.item.js rename to packages/fineui/src/case/calendar/calendar.date.item.js diff --git a/src/case/calendar/calendar.js b/packages/fineui/src/case/calendar/calendar.js similarity index 100% rename from src/case/calendar/calendar.js rename to packages/fineui/src/case/calendar/calendar.js diff --git a/src/case/calendar/calendar.year.js b/packages/fineui/src/case/calendar/calendar.year.js similarity index 100% rename from src/case/calendar/calendar.year.js rename to packages/fineui/src/case/calendar/calendar.year.js diff --git a/src/case/calendar/index.js b/packages/fineui/src/case/calendar/index.js similarity index 100% rename from src/case/calendar/index.js rename to packages/fineui/src/case/calendar/index.js diff --git a/src/case/checkbox/check.arrownode.js b/packages/fineui/src/case/checkbox/check.arrownode.js similarity index 100% rename from src/case/checkbox/check.arrownode.js rename to packages/fineui/src/case/checkbox/check.arrownode.js diff --git a/src/case/checkbox/check.checkingmarknode.js b/packages/fineui/src/case/checkbox/check.checkingmarknode.js similarity index 100% rename from src/case/checkbox/check.checkingmarknode.js rename to packages/fineui/src/case/checkbox/check.checkingmarknode.js diff --git a/src/case/checkbox/check.first.treenode.js b/packages/fineui/src/case/checkbox/check.first.treenode.js similarity index 100% rename from src/case/checkbox/check.first.treenode.js rename to packages/fineui/src/case/checkbox/check.first.treenode.js diff --git a/src/case/checkbox/check.last.treenode.js b/packages/fineui/src/case/checkbox/check.last.treenode.js similarity index 100% rename from src/case/checkbox/check.last.treenode.js rename to packages/fineui/src/case/checkbox/check.last.treenode.js diff --git a/src/case/checkbox/check.mid.treenode.js b/packages/fineui/src/case/checkbox/check.mid.treenode.js similarity index 100% rename from src/case/checkbox/check.mid.treenode.js rename to packages/fineui/src/case/checkbox/check.mid.treenode.js diff --git a/src/case/checkbox/check.treenode.js b/packages/fineui/src/case/checkbox/check.treenode.js similarity index 100% rename from src/case/checkbox/check.treenode.js rename to packages/fineui/src/case/checkbox/check.treenode.js diff --git a/src/case/checkbox/index.js b/packages/fineui/src/case/checkbox/index.js similarity index 100% rename from src/case/checkbox/index.js rename to packages/fineui/src/case/checkbox/index.js diff --git a/src/case/colorchooser/__test__/colorchooser.test.js b/packages/fineui/src/case/colorchooser/__test__/colorchooser.test.js similarity index 100% rename from src/case/colorchooser/__test__/colorchooser.test.js rename to packages/fineui/src/case/colorchooser/__test__/colorchooser.test.js diff --git a/src/case/colorchooser/colorchooser.custom.js b/packages/fineui/src/case/colorchooser/colorchooser.custom.js similarity index 100% rename from src/case/colorchooser/colorchooser.custom.js rename to packages/fineui/src/case/colorchooser/colorchooser.custom.js diff --git a/src/case/colorchooser/colorchooser.js b/packages/fineui/src/case/colorchooser/colorchooser.js similarity index 100% rename from src/case/colorchooser/colorchooser.js rename to packages/fineui/src/case/colorchooser/colorchooser.js diff --git a/src/case/colorchooser/colorchooser.popup.hex.js b/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js similarity index 100% rename from src/case/colorchooser/colorchooser.popup.hex.js rename to packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js diff --git a/src/case/colorchooser/colorchooser.popup.hex.simple.js b/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.simple.js similarity index 100% rename from src/case/colorchooser/colorchooser.popup.hex.simple.js rename to packages/fineui/src/case/colorchooser/colorchooser.popup.hex.simple.js diff --git a/src/case/colorchooser/colorchooser.popup.js b/packages/fineui/src/case/colorchooser/colorchooser.popup.js similarity index 100% rename from src/case/colorchooser/colorchooser.popup.js rename to packages/fineui/src/case/colorchooser/colorchooser.popup.js diff --git a/src/case/colorchooser/colorchooser.popup.simple.js b/packages/fineui/src/case/colorchooser/colorchooser.popup.simple.js similarity index 100% rename from src/case/colorchooser/colorchooser.popup.simple.js rename to packages/fineui/src/case/colorchooser/colorchooser.popup.simple.js diff --git a/src/case/colorchooser/colorchooser.simple.js b/packages/fineui/src/case/colorchooser/colorchooser.simple.js similarity index 100% rename from src/case/colorchooser/colorchooser.simple.js rename to packages/fineui/src/case/colorchooser/colorchooser.simple.js diff --git a/src/case/colorchooser/colorchooser.trigger.js b/packages/fineui/src/case/colorchooser/colorchooser.trigger.js similarity index 100% rename from src/case/colorchooser/colorchooser.trigger.js rename to packages/fineui/src/case/colorchooser/colorchooser.trigger.js diff --git a/src/case/colorchooser/colorchooser.trigger.long.js b/packages/fineui/src/case/colorchooser/colorchooser.trigger.long.js similarity index 100% rename from src/case/colorchooser/colorchooser.trigger.long.js rename to packages/fineui/src/case/colorchooser/colorchooser.trigger.long.js diff --git a/src/case/colorchooser/colorpicker/button/button.colorpicker.js b/packages/fineui/src/case/colorchooser/colorpicker/button/button.colorpicker.js similarity index 100% rename from src/case/colorchooser/colorpicker/button/button.colorpicker.js rename to packages/fineui/src/case/colorchooser/colorpicker/button/button.colorpicker.js diff --git a/src/case/colorchooser/colorpicker/button/button.colorshow.js b/packages/fineui/src/case/colorchooser/colorpicker/button/button.colorshow.js similarity index 100% rename from src/case/colorchooser/colorpicker/button/button.colorshow.js rename to packages/fineui/src/case/colorchooser/colorpicker/button/button.colorshow.js diff --git a/src/case/colorchooser/colorpicker/button/index.js b/packages/fineui/src/case/colorchooser/colorpicker/button/index.js similarity index 100% rename from src/case/colorchooser/colorpicker/button/index.js rename to packages/fineui/src/case/colorchooser/colorpicker/button/index.js diff --git a/src/case/colorchooser/colorpicker/colorpicker.hex.js b/packages/fineui/src/case/colorchooser/colorpicker/colorpicker.hex.js similarity index 100% rename from src/case/colorchooser/colorpicker/colorpicker.hex.js rename to packages/fineui/src/case/colorchooser/colorpicker/colorpicker.hex.js diff --git a/src/case/colorchooser/colorpicker/colorpicker.js b/packages/fineui/src/case/colorchooser/colorpicker/colorpicker.js similarity index 100% rename from src/case/colorchooser/colorpicker/colorpicker.js rename to packages/fineui/src/case/colorchooser/colorpicker/colorpicker.js diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js b/packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js similarity index 100% rename from src/case/colorchooser/colorpicker/editor.colorpicker.hex.js rename to packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js b/packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js similarity index 100% rename from src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js rename to packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.js b/packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.js similarity index 100% rename from src/case/colorchooser/colorpicker/editor.colorpicker.js rename to packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.js diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js b/packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js similarity index 100% rename from src/case/colorchooser/colorpicker/editor.colorpicker.simple.js rename to packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js diff --git a/src/case/colorchooser/colorpicker/index.js b/packages/fineui/src/case/colorchooser/colorpicker/index.js similarity index 100% rename from src/case/colorchooser/colorpicker/index.js rename to packages/fineui/src/case/colorchooser/colorpicker/index.js diff --git a/src/case/colorchooser/farbtastic/__test__/farbtastic.test.js b/packages/fineui/src/case/colorchooser/farbtastic/__test__/farbtastic.test.js similarity index 100% rename from src/case/colorchooser/farbtastic/__test__/farbtastic.test.js rename to packages/fineui/src/case/colorchooser/farbtastic/__test__/farbtastic.test.js diff --git a/src/case/colorchooser/farbtastic/farbtastic.js b/packages/fineui/src/case/colorchooser/farbtastic/farbtastic.js similarity index 100% rename from src/case/colorchooser/farbtastic/farbtastic.js rename to packages/fineui/src/case/colorchooser/farbtastic/farbtastic.js diff --git a/src/case/colorchooser/index.js b/packages/fineui/src/case/colorchooser/index.js similarity index 100% rename from src/case/colorchooser/index.js rename to packages/fineui/src/case/colorchooser/index.js diff --git a/src/case/combo/bubblecombo/__test__/combo.bubble.test.js b/packages/fineui/src/case/combo/bubblecombo/__test__/combo.bubble.test.js similarity index 100% rename from src/case/combo/bubblecombo/__test__/combo.bubble.test.js rename to packages/fineui/src/case/combo/bubblecombo/__test__/combo.bubble.test.js diff --git a/src/case/combo/bubblecombo/combo.bubble.js b/packages/fineui/src/case/combo/bubblecombo/combo.bubble.js similarity index 100% rename from src/case/combo/bubblecombo/combo.bubble.js rename to packages/fineui/src/case/combo/bubblecombo/combo.bubble.js diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/packages/fineui/src/case/combo/bubblecombo/popup.bubble.js similarity index 100% rename from src/case/combo/bubblecombo/popup.bubble.js rename to packages/fineui/src/case/combo/bubblecombo/popup.bubble.js diff --git a/src/case/combo/editoriconcheckcombo/__test__/combo.editiconcheck.test.js b/packages/fineui/src/case/combo/editoriconcheckcombo/__test__/combo.editiconcheck.test.js similarity index 100% rename from src/case/combo/editoriconcheckcombo/__test__/combo.editiconcheck.test.js rename to packages/fineui/src/case/combo/editoriconcheckcombo/__test__/combo.editiconcheck.test.js diff --git a/src/case/combo/editoriconcheckcombo/combo.editiconcheck.js b/packages/fineui/src/case/combo/editoriconcheckcombo/combo.editiconcheck.js similarity index 100% rename from src/case/combo/editoriconcheckcombo/combo.editiconcheck.js rename to packages/fineui/src/case/combo/editoriconcheckcombo/combo.editiconcheck.js diff --git a/src/case/combo/iconcombo/combo.icon.js b/packages/fineui/src/case/combo/iconcombo/combo.icon.js similarity index 100% rename from src/case/combo/iconcombo/combo.icon.js rename to packages/fineui/src/case/combo/iconcombo/combo.icon.js diff --git a/src/case/combo/iconcombo/popup.iconcombo.js b/packages/fineui/src/case/combo/iconcombo/popup.iconcombo.js similarity index 100% rename from src/case/combo/iconcombo/popup.iconcombo.js rename to packages/fineui/src/case/combo/iconcombo/popup.iconcombo.js diff --git a/src/case/combo/iconcombo/trigger.iconcombo.js b/packages/fineui/src/case/combo/iconcombo/trigger.iconcombo.js similarity index 100% rename from src/case/combo/iconcombo/trigger.iconcombo.js rename to packages/fineui/src/case/combo/iconcombo/trigger.iconcombo.js diff --git a/src/case/combo/icontextvaluecombo/__test__/combo.icontextvalue.test.js b/packages/fineui/src/case/combo/icontextvaluecombo/__test__/combo.icontextvalue.test.js similarity index 100% rename from src/case/combo/icontextvaluecombo/__test__/combo.icontextvalue.test.js rename to packages/fineui/src/case/combo/icontextvaluecombo/__test__/combo.icontextvalue.test.js diff --git a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js b/packages/fineui/src/case/combo/icontextvaluecombo/combo.icontextvalue.js similarity index 100% rename from src/case/combo/icontextvaluecombo/combo.icontextvalue.js rename to packages/fineui/src/case/combo/icontextvaluecombo/combo.icontextvalue.js diff --git a/src/case/combo/icontextvaluecombo/popup.icontextvalue.js b/packages/fineui/src/case/combo/icontextvaluecombo/popup.icontextvalue.js similarity index 100% rename from src/case/combo/icontextvaluecombo/popup.icontextvalue.js rename to packages/fineui/src/case/combo/icontextvaluecombo/popup.icontextvalue.js diff --git a/src/case/combo/index.js b/packages/fineui/src/case/combo/index.js similarity index 100% rename from src/case/combo/index.js rename to packages/fineui/src/case/combo/index.js diff --git a/src/case/combo/searchtextvaluecombo/__test__/combo.searchtextvaluecombo.test.js b/packages/fineui/src/case/combo/searchtextvaluecombo/__test__/combo.searchtextvaluecombo.test.js similarity index 100% rename from src/case/combo/searchtextvaluecombo/__test__/combo.searchtextvaluecombo.test.js rename to packages/fineui/src/case/combo/searchtextvaluecombo/__test__/combo.searchtextvaluecombo.test.js diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/packages/fineui/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js similarity index 100% rename from src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js rename to packages/fineui/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js diff --git a/src/case/combo/searchtextvaluecombo/popup.searchtextvalue.js b/packages/fineui/src/case/combo/searchtextvaluecombo/popup.searchtextvalue.js similarity index 100% rename from src/case/combo/searchtextvaluecombo/popup.searchtextvalue.js rename to packages/fineui/src/case/combo/searchtextvaluecombo/popup.searchtextvalue.js diff --git a/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js b/packages/fineui/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js similarity index 100% rename from src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js rename to packages/fineui/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js diff --git a/src/case/combo/textvaluecheckcombo/__test__/combo.textvaluecheck.test.js b/packages/fineui/src/case/combo/textvaluecheckcombo/__test__/combo.textvaluecheck.test.js similarity index 100% rename from src/case/combo/textvaluecheckcombo/__test__/combo.textvaluecheck.test.js rename to packages/fineui/src/case/combo/textvaluecheckcombo/__test__/combo.textvaluecheck.test.js diff --git a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js b/packages/fineui/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js similarity index 100% rename from src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js rename to packages/fineui/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js diff --git a/src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js b/packages/fineui/src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js similarity index 100% rename from src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js rename to packages/fineui/src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js diff --git a/src/case/combo/textvaluecombo/__test__/combo.textvalue.test.js b/packages/fineui/src/case/combo/textvaluecombo/__test__/combo.textvalue.test.js similarity index 100% rename from src/case/combo/textvaluecombo/__test__/combo.textvalue.test.js rename to packages/fineui/src/case/combo/textvaluecombo/__test__/combo.textvalue.test.js diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/packages/fineui/src/case/combo/textvaluecombo/combo.textvalue.js similarity index 100% rename from src/case/combo/textvaluecombo/combo.textvalue.js rename to packages/fineui/src/case/combo/textvaluecombo/combo.textvalue.js diff --git a/src/case/combo/textvaluecombo/combo.textvaluesmall.js b/packages/fineui/src/case/combo/textvaluecombo/combo.textvaluesmall.js similarity index 100% rename from src/case/combo/textvaluecombo/combo.textvaluesmall.js rename to packages/fineui/src/case/combo/textvaluecombo/combo.textvaluesmall.js diff --git a/src/case/combo/textvaluecombo/popup.textvalue.js b/packages/fineui/src/case/combo/textvaluecombo/popup.textvalue.js similarity index 100% rename from src/case/combo/textvaluecombo/popup.textvalue.js rename to packages/fineui/src/case/combo/textvaluecombo/popup.textvalue.js diff --git a/src/case/editor/__test__/editor.clear.test.js b/packages/fineui/src/case/editor/__test__/editor.clear.test.js similarity index 100% rename from src/case/editor/__test__/editor.clear.test.js rename to packages/fineui/src/case/editor/__test__/editor.clear.test.js diff --git a/src/case/editor/__test__/editor.sign.test.js b/packages/fineui/src/case/editor/__test__/editor.sign.test.js similarity index 100% rename from src/case/editor/__test__/editor.sign.test.js rename to packages/fineui/src/case/editor/__test__/editor.sign.test.js diff --git a/src/case/editor/__test__/editor.state.simple.test.js b/packages/fineui/src/case/editor/__test__/editor.state.simple.test.js similarity index 100% rename from src/case/editor/__test__/editor.state.simple.test.js rename to packages/fineui/src/case/editor/__test__/editor.state.simple.test.js diff --git a/src/case/editor/__test__/editor.state.test.js b/packages/fineui/src/case/editor/__test__/editor.state.test.js similarity index 100% rename from src/case/editor/__test__/editor.state.test.js rename to packages/fineui/src/case/editor/__test__/editor.state.test.js diff --git a/src/case/editor/editor.clear.js b/packages/fineui/src/case/editor/editor.clear.js similarity index 100% rename from src/case/editor/editor.clear.js rename to packages/fineui/src/case/editor/editor.clear.js diff --git a/src/case/editor/editor.defaulttext.js b/packages/fineui/src/case/editor/editor.defaulttext.js similarity index 100% rename from src/case/editor/editor.defaulttext.js rename to packages/fineui/src/case/editor/editor.defaulttext.js diff --git a/src/case/editor/editor.shelter.js b/packages/fineui/src/case/editor/editor.shelter.js similarity index 100% rename from src/case/editor/editor.shelter.js rename to packages/fineui/src/case/editor/editor.shelter.js diff --git a/src/case/editor/editor.sign.js b/packages/fineui/src/case/editor/editor.sign.js similarity index 100% rename from src/case/editor/editor.sign.js rename to packages/fineui/src/case/editor/editor.sign.js diff --git a/src/case/editor/editor.state.js b/packages/fineui/src/case/editor/editor.state.js similarity index 100% rename from src/case/editor/editor.state.js rename to packages/fineui/src/case/editor/editor.state.js diff --git a/src/case/editor/editor.state.simple.js b/packages/fineui/src/case/editor/editor.state.simple.js similarity index 100% rename from src/case/editor/editor.state.simple.js rename to packages/fineui/src/case/editor/editor.state.simple.js diff --git a/src/case/editor/index.js b/packages/fineui/src/case/editor/index.js similarity index 100% rename from src/case/editor/index.js rename to packages/fineui/src/case/editor/index.js diff --git a/src/case/index.js b/packages/fineui/src/case/index.js similarity index 100% rename from src/case/index.js rename to packages/fineui/src/case/index.js diff --git a/src/case/layer/index.js b/packages/fineui/src/case/layer/index.js similarity index 100% rename from src/case/layer/index.js rename to packages/fineui/src/case/layer/index.js diff --git a/src/case/layer/layer.multipopup.js b/packages/fineui/src/case/layer/layer.multipopup.js similarity index 100% rename from src/case/layer/layer.multipopup.js rename to packages/fineui/src/case/layer/layer.multipopup.js diff --git a/src/case/layer/layer.panel.js b/packages/fineui/src/case/layer/layer.panel.js similarity index 100% rename from src/case/layer/layer.panel.js rename to packages/fineui/src/case/layer/layer.panel.js diff --git a/src/case/layer/pane.list.js b/packages/fineui/src/case/layer/pane.list.js similarity index 100% rename from src/case/layer/pane.list.js rename to packages/fineui/src/case/layer/pane.list.js diff --git a/src/case/layer/panel.js b/packages/fineui/src/case/layer/panel.js similarity index 100% rename from src/case/layer/panel.js rename to packages/fineui/src/case/layer/panel.js diff --git a/src/case/linearsegment/button.linear.segment.js b/packages/fineui/src/case/linearsegment/button.linear.segment.js similarity index 100% rename from src/case/linearsegment/button.linear.segment.js rename to packages/fineui/src/case/linearsegment/button.linear.segment.js diff --git a/src/case/linearsegment/index.js b/packages/fineui/src/case/linearsegment/index.js similarity index 100% rename from src/case/linearsegment/index.js rename to packages/fineui/src/case/linearsegment/index.js diff --git a/src/case/linearsegment/linear.segment.js b/packages/fineui/src/case/linearsegment/linear.segment.js similarity index 100% rename from src/case/linearsegment/linear.segment.js rename to packages/fineui/src/case/linearsegment/linear.segment.js diff --git a/src/case/list/list.select.js b/packages/fineui/src/case/list/list.select.js similarity index 100% rename from src/case/list/list.select.js rename to packages/fineui/src/case/list/list.select.js diff --git a/src/case/loader/__test__/loader.lazy.test.js b/packages/fineui/src/case/loader/__test__/loader.lazy.test.js similarity index 100% rename from src/case/loader/__test__/loader.lazy.test.js rename to packages/fineui/src/case/loader/__test__/loader.lazy.test.js diff --git a/src/case/loader/__test__/loader.list.test.js b/packages/fineui/src/case/loader/__test__/loader.list.test.js similarity index 100% rename from src/case/loader/__test__/loader.list.test.js rename to packages/fineui/src/case/loader/__test__/loader.list.test.js diff --git a/src/case/loader/index.js b/packages/fineui/src/case/loader/index.js similarity index 100% rename from src/case/loader/index.js rename to packages/fineui/src/case/loader/index.js diff --git a/src/case/loader/loader.lazy.js b/packages/fineui/src/case/loader/loader.lazy.js similarity index 100% rename from src/case/loader/loader.lazy.js rename to packages/fineui/src/case/loader/loader.lazy.js diff --git a/src/case/loader/loader.list.js b/packages/fineui/src/case/loader/loader.list.js similarity index 100% rename from src/case/loader/loader.list.js rename to packages/fineui/src/case/loader/loader.list.js diff --git a/src/case/loader/sort.list.js b/packages/fineui/src/case/loader/sort.list.js similarity index 100% rename from src/case/loader/sort.list.js rename to packages/fineui/src/case/loader/sort.list.js diff --git a/src/case/pager/__test__/pager.test.js b/packages/fineui/src/case/pager/__test__/pager.test.js similarity index 100% rename from src/case/pager/__test__/pager.test.js rename to packages/fineui/src/case/pager/__test__/pager.test.js diff --git a/src/case/pager/index.js b/packages/fineui/src/case/pager/index.js similarity index 100% rename from src/case/pager/index.js rename to packages/fineui/src/case/pager/index.js diff --git a/src/case/pager/pager.all.count.js b/packages/fineui/src/case/pager/pager.all.count.js similarity index 100% rename from src/case/pager/pager.all.count.js rename to packages/fineui/src/case/pager/pager.all.count.js diff --git a/src/case/pager/pager.detail.js b/packages/fineui/src/case/pager/pager.detail.js similarity index 100% rename from src/case/pager/pager.detail.js rename to packages/fineui/src/case/pager/pager.detail.js diff --git a/src/case/pager/pager.direction.js b/packages/fineui/src/case/pager/pager.direction.js similarity index 100% rename from src/case/pager/pager.direction.js rename to packages/fineui/src/case/pager/pager.direction.js diff --git a/src/case/segment/__test__/segment.test.js b/packages/fineui/src/case/segment/__test__/segment.test.js similarity index 100% rename from src/case/segment/__test__/segment.test.js rename to packages/fineui/src/case/segment/__test__/segment.test.js diff --git a/src/case/segment/button.segment.js b/packages/fineui/src/case/segment/button.segment.js similarity index 100% rename from src/case/segment/button.segment.js rename to packages/fineui/src/case/segment/button.segment.js diff --git a/src/case/segment/index.js b/packages/fineui/src/case/segment/index.js similarity index 100% rename from src/case/segment/index.js rename to packages/fineui/src/case/segment/index.js diff --git a/src/case/segment/segment.js b/packages/fineui/src/case/segment/segment.js similarity index 100% rename from src/case/segment/segment.js rename to packages/fineui/src/case/segment/segment.js diff --git a/src/case/toolbar/toolbar.multiselect.js b/packages/fineui/src/case/toolbar/toolbar.multiselect.js similarity index 100% rename from src/case/toolbar/toolbar.multiselect.js rename to packages/fineui/src/case/toolbar/toolbar.multiselect.js diff --git a/src/case/tree/index.js b/packages/fineui/src/case/tree/index.js similarity index 100% rename from src/case/tree/index.js rename to packages/fineui/src/case/tree/index.js diff --git a/src/case/tree/tree.level.js b/packages/fineui/src/case/tree/tree.level.js similarity index 100% rename from src/case/tree/tree.level.js rename to packages/fineui/src/case/tree/tree.level.js diff --git a/src/case/tree/treeexpander/tree.expander.js b/packages/fineui/src/case/tree/treeexpander/tree.expander.js similarity index 100% rename from src/case/tree/treeexpander/tree.expander.js rename to packages/fineui/src/case/tree/treeexpander/tree.expander.js diff --git a/src/case/tree/treeexpander/tree.expander.popup.js b/packages/fineui/src/case/tree/treeexpander/tree.expander.popup.js similarity index 100% rename from src/case/tree/treeexpander/tree.expander.popup.js rename to packages/fineui/src/case/tree/treeexpander/tree.expander.popup.js diff --git a/src/case/trigger/index.js b/packages/fineui/src/case/trigger/index.js similarity index 100% rename from src/case/trigger/index.js rename to packages/fineui/src/case/trigger/index.js diff --git a/src/case/trigger/trigger.editor.js b/packages/fineui/src/case/trigger/trigger.editor.js similarity index 100% rename from src/case/trigger/trigger.editor.js rename to packages/fineui/src/case/trigger/trigger.editor.js diff --git a/src/case/trigger/trigger.icon.js b/packages/fineui/src/case/trigger/trigger.icon.js similarity index 100% rename from src/case/trigger/trigger.icon.js rename to packages/fineui/src/case/trigger/trigger.icon.js diff --git a/src/case/trigger/trigger.icon.text.js b/packages/fineui/src/case/trigger/trigger.icon.text.js similarity index 100% rename from src/case/trigger/trigger.icon.text.js rename to packages/fineui/src/case/trigger/trigger.icon.text.js diff --git a/src/case/trigger/trigger.icon.text.select.js b/packages/fineui/src/case/trigger/trigger.icon.text.select.js similarity index 100% rename from src/case/trigger/trigger.icon.text.select.js rename to packages/fineui/src/case/trigger/trigger.icon.text.select.js diff --git a/src/case/trigger/trigger.text.js b/packages/fineui/src/case/trigger/trigger.text.js similarity index 100% rename from src/case/trigger/trigger.text.js rename to packages/fineui/src/case/trigger/trigger.text.js diff --git a/src/case/trigger/trigger.text.select.js b/packages/fineui/src/case/trigger/trigger.text.select.js similarity index 100% rename from src/case/trigger/trigger.text.select.js rename to packages/fineui/src/case/trigger/trigger.text.select.js diff --git a/src/case/trigger/trigger.text.select.small.js b/packages/fineui/src/case/trigger/trigger.text.select.small.js similarity index 100% rename from src/case/trigger/trigger.text.select.small.js rename to packages/fineui/src/case/trigger/trigger.text.select.small.js diff --git a/src/case/trigger/trigger.text.small.js b/packages/fineui/src/case/trigger/trigger.text.small.js similarity index 100% rename from src/case/trigger/trigger.text.small.js rename to packages/fineui/src/case/trigger/trigger.text.small.js diff --git a/src/case/ztree/asynctree.js b/packages/fineui/src/case/ztree/asynctree.js similarity index 100% rename from src/case/ztree/asynctree.js rename to packages/fineui/src/case/ztree/asynctree.js diff --git a/src/case/ztree/index.js b/packages/fineui/src/case/ztree/index.js similarity index 100% rename from src/case/ztree/index.js rename to packages/fineui/src/case/ztree/index.js diff --git a/src/case/ztree/jquery.ztree.core-3.5.js b/packages/fineui/src/case/ztree/jquery.ztree.core-3.5.js similarity index 100% rename from src/case/ztree/jquery.ztree.core-3.5.js rename to packages/fineui/src/case/ztree/jquery.ztree.core-3.5.js diff --git a/src/case/ztree/jquery.ztree.excheck-3.5.js b/packages/fineui/src/case/ztree/jquery.ztree.excheck-3.5.js similarity index 100% rename from src/case/ztree/jquery.ztree.excheck-3.5.js rename to packages/fineui/src/case/ztree/jquery.ztree.excheck-3.5.js diff --git a/src/case/ztree/list/listasynctree.js b/packages/fineui/src/case/ztree/list/listasynctree.js similarity index 100% rename from src/case/ztree/list/listasynctree.js rename to packages/fineui/src/case/ztree/list/listasynctree.js diff --git a/src/case/ztree/list/listparttree.js b/packages/fineui/src/case/ztree/list/listparttree.js similarity index 100% rename from src/case/ztree/list/listparttree.js rename to packages/fineui/src/case/ztree/list/listparttree.js diff --git a/src/case/ztree/list/listtreeview.js b/packages/fineui/src/case/ztree/list/listtreeview.js similarity index 100% rename from src/case/ztree/list/listtreeview.js rename to packages/fineui/src/case/ztree/list/listtreeview.js diff --git a/src/case/ztree/parttree.js b/packages/fineui/src/case/ztree/parttree.js similarity index 100% rename from src/case/ztree/parttree.js rename to packages/fineui/src/case/ztree/parttree.js diff --git a/src/case/ztree/tree.display.js b/packages/fineui/src/case/ztree/tree.display.js similarity index 100% rename from src/case/ztree/tree.display.js rename to packages/fineui/src/case/ztree/tree.display.js diff --git a/src/case/ztree/tree.list.display.js b/packages/fineui/src/case/ztree/tree.list.display.js similarity index 100% rename from src/case/ztree/tree.list.display.js rename to packages/fineui/src/case/ztree/tree.list.display.js diff --git a/src/case/ztree/tree.simple.js b/packages/fineui/src/case/ztree/tree.simple.js similarity index 100% rename from src/case/ztree/tree.simple.js rename to packages/fineui/src/case/ztree/tree.simple.js diff --git a/src/case/ztree/treerender.page.service.js b/packages/fineui/src/case/ztree/treerender.page.service.js similarity index 100% rename from src/case/ztree/treerender.page.service.js rename to packages/fineui/src/case/ztree/treerender.page.service.js diff --git a/src/case/ztree/treerender.scroll.service.js b/packages/fineui/src/case/ztree/treerender.scroll.service.js similarity index 100% rename from src/case/ztree/treerender.scroll.service.js rename to packages/fineui/src/case/ztree/treerender.scroll.service.js diff --git a/packages/fineui/src/case/ztree/treeview.js b/packages/fineui/src/case/ztree/treeview.js new file mode 100644 index 000000000..aa2f6e202 --- /dev/null +++ b/packages/fineui/src/case/ztree/treeview.js @@ -0,0 +1,619 @@ +import { + cjkEncodeDO, + Controller, + createWidget, + emptyFn, + Events, + extend, + UUID, + isNotNull, + jsonEncode, + delay, + each, + replaceAll, + isUndefined, + isNotEmptyArray, + deepClone, + map, + Tree, + isNull, + shortcut, + VerticalLayout, + Layout, + DefaultLayout, + some, + Widget, + STYLE_CONSTANTS +} from "@/core"; +import { Msg, Pane, LoadingBar, Text } from "@/base"; +import $ from "jquery"; +import "./jquery.ztree.core-3.5"; + +@shortcut() +export class TreeView extends Pane { + static xtype = "bi.tree_view"; + static REQ_TYPE_INIT_DATA = 1; + static REQ_TYPE_ADJUST_DATA = 2; + static REQ_TYPE_SELECT_DATA = 3; + static REQ_TYPE_GET_SELECTED_DATA = 4; + static EVENT_CHANGE = "EVENT_CHANGE"; + static EVENT_INIT = Events.INIT; + static EVENT_AFTERINIT = Events.AFTERINIT; + + _defaultConfig() { + return extend(super._defaultConfig(...arguments), { + _baseCls: "bi-tree", + paras: { + selectedValues: {}, + }, + itemsCreator: emptyFn, + showLine: true, + }); + } + + _init() { + super._init(...arguments); + const o = this.options; + this._stop = false; + + this._createTree(); + this.tip = createWidget({ + type: LoadingBar.xtype, + invisible: true, + handler: () => this._loadMore(), + }); + createWidget({ + type: VerticalLayout.xtype, + scrollable: true, + scrolly: false, + element: this, + items: [this.tip], + }); + if (isNotNull(o.value)) { + this.setSelectedValue(o.value); + } + } + + _createTree() { + this.id = `bi-tree${UUID()}`; + if (this.nodes) { + this.nodes.destroy(); + } + if (this.tree) { + this.tree.destroy(); + } + this.tree = createWidget({ + type: Layout.xtype, + element: ``, + }); + createWidget({ + type: DefaultLayout.xtype, + element: this, + items: [this.tree], + }); + } + + // 选择节点触发方法 + _selectTreeNode(treeId, treeNode) { + this.fireEvent(Controller.EVENT_CHANGE, Events.CLICK, treeNode, this); + this.fireEvent(TreeView.EVENT_CHANGE, treeNode, this); + } + + // 配置属性 + _configSetting() { + const paras = this.options.paras; + const self = this; + const o = this.options; + const setting = { + async: { + enable: true, + url: getUrl, + autoParam: ["id", "name"], // 节点展开异步请求自动提交id和name + otherParam: cjkEncodeDO(paras), // 静态参数 + }, + check: { + enable: true, + }, + data: { + key: { + title: "title", + name: "text", // 节点的name属性替换成text + }, + simpleData: { + enable: true, // 可以穿id,pid属性的对象数组 + }, + }, + view: { + showIcon: false, + expandSpeed: "", + nameIsHTML: true, // 节点可以用html标签代替 + dblClickExpand: false, + showLine: o.showLine, + }, + callback: { + beforeExpand, + onAsyncSuccess, + onAsyncError, + beforeCheck, + onCheck, + onExpand, + onCollapse, + onClick, + }, + }; + const className = "dark", + perTime = 100; + + function onClick(event, treeId, treeNode) { + // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 + let checked = treeNode.checked; + const status = treeNode.getCheckStatus(); + if (status.half === true && status.checked === true) { + checked = false; + } + // 更新此node的check状态, 影响父子关联,并调用beforeCheck和onCheck回调 + self.nodes.checkNode(treeNode, !checked, true, true); + } + + function getUrl(treeId, treeNode) { + const parentNode = self._getParentValues(treeNode); + treeNode.times = treeNode.times || 1; + const param = `id=${treeNode.id}×=${treeNode.times++}&parentValues= ${_global.encodeURIComponent( + jsonEncode(parentNode) + )}&checkState=${_global.encodeURIComponent(jsonEncode(treeNode.getCheckStatus()))}`; + + return `&${param}`; + } + + function beforeExpand(treeId, treeNode) { + if (!treeNode.isAjaxing) { + if (!treeNode.children) { + treeNode.times = 1; + ajaxGetNodes(treeNode, "refresh"); + } + + return true; + } + Msg.toast("Please Wait。", { + level: "warning", + }); // 不展开节点,也不触发onExpand事件 + + return false; + } + + function onAsyncSuccess(event, treeId, treeNode, msg) { + treeNode.halfCheck = false; + if (!msg || msg.length === 0 || /^[\s,\S]*<\/html>$/gi.test(msg) || self._stop) { + return; + } + const zTree = self.nodes; + const totalCount = treeNode.count || 0; + + // 尝试去获取下一组节点,若获取值为空数组,表示获取完成 + // TODO by GUY + if (treeNode.children.length > totalCount) { + treeNode.count = treeNode.children.length; + delay(() => { + ajaxGetNodes(treeNode); + }, perTime); + } else { + // treeNode.icon = ""; + zTree.updateNode(treeNode); + zTree.selectNode(treeNode.children[0]); + // className = (className === "dark" ? "":"dark"); + } + } + + function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) { + const zTree = self.nodes; + Msg.toast("Error!", "warning"); + // treeNode.icon = ""; + // zTree.updateNode(treeNode); + } + + function ajaxGetNodes(treeNode, reloadType) { + const zTree = self.nodes; + if (reloadType === "refresh") { + zTree.updateNode(treeNode); // 刷新一下当前节点,如果treeNode.xxx被改了的话 + } + zTree.reAsyncChildNodes(treeNode, reloadType, true); // 强制加载子节点,reloadType === refresh为先清空再加载,否则为追加到现有子节点之后 + } + + function beforeCheck(treeId, treeNode) { + if (treeNode.disabled) { + return false; + } + // 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下 + const status = treeNode.getCheckStatus(); + treeNode.halfCheck = false; + if (treeNode.checked === true) { + // 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy + // 所有的半选状态都需要取消halfCheck=true的情况 + function track(children) { + each(children, (i, ch) => { + if (ch.halfCheck === true) { + ch.halfCheck = false; + track(ch.children); + } + }); + } + + track(treeNode.children); + const treeObj = self.nodes; + const nodes = treeObj.getSelectedNodes(); + $.each(nodes, (index, node) => { + node.halfCheck = false; + }); + } + // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 + if (status.half === true && status.checked === true) { + treeNode.checked = false; + } + } + + function onCheck(event, treeId, treeNode) { + if (treeNode.disabled) { + return false; + } + self._selectTreeNode(treeId, treeNode); + } + + function onExpand(event, treeId, treeNode) { + treeNode.halfCheck = false; + } + + function onCollapse(event, treeId, treeNode) {} + + return setting; + } + + _getParentValues(treeNode) { + if (!treeNode.getParentNode()) { + return []; + } + const parentNode = treeNode.getParentNode(); + let result = this._getParentValues(parentNode); + result = result.concat([this._getNodeValue(parentNode)]); + + return result; + } + + _getNodeValue(node) { + // 去除标红 + return isUndefined(node.value) ? replaceAll(node.text.replace(/<[^>]+>/g, ""), " ", " ") : node.value; + } + + // 获取半选框值 + _getHalfSelectedValues(map, node) { + const self = this; + const checkState = node.getCheckStatus(); + // 将未选的去掉 + if (checkState.checked === false && checkState.half === false) { + return; + } + // 如果节点已展开,并且是半选 + if (isNotEmptyArray(node.children) && checkState.half === true) { + const children = node.children; + each(children, (i, ch) => { + self._getHalfSelectedValues(map, ch); + }); + + return; + } + const parent = node.parentValues || self._getParentValues(node); + const path = parent.concat(this._getNodeValue(node)); + // 当前节点是全选的,因为上面的判断已经排除了不选和半选 + if (isNotEmptyArray(node.children) || checkState.half === false) { + this._buildTree(map, path); + + return; + } + // 剩下的就是半选不展开的节点,因为不知道里面是什么情况,所以借助selectedValues(这个是完整的选中情况) + const storeValues = deepClone(this.options.paras.selectedValues); + const treeNode = this._getTree(storeValues, path); + this._addTreeNode(map, parent, this._getNodeValue(node), treeNode); + } + + // 获取的是以values最后一个节点为根的子树 + _getTree(map, values) { + let cur = map; + some(values, (i, value) => { + if (cur[value] == null) { + return true; + } + cur = cur[value]; + }); + + return cur; + } + + // 以values为path一路向里补充map, 并在末尾节点添加key: value节点 + _addTreeNode(map, values, key, value) { + let cur = map; + each(values, (i, value) => { + if (cur[value] == null) { + cur[value] = {}; + } + cur = cur[value]; + }); + cur[key] = value; + } + + // 构造树节点 + _buildTree(map, values) { + let cur = map; + each(values, (i, value) => { + if (cur[value] == null) { + cur[value] = {}; + } + cur = cur[value]; + }); + } + + // 获取选中的值 + _getSelectedValues() { + const self = this; + const hashMap = {}; + const rootNoots = this.nodes.getNodes(); + track(rootNoots); // 可以看到这个方法没有递归调用,所以在_getHalfSelectedValues中需要关心全选的节点 + function track(nodes) { + each(nodes, (i, node) => { + const checkState = node.getCheckStatus(); + if (checkState.checked === true || checkState.half === true) { + if (checkState.half === true) { + self._getHalfSelectedValues(hashMap, node); + } else { + const parentValues = node.parentValues || self._getParentValues(node); + const values = parentValues.concat([self._getNodeValue(node)]); + self._buildTree(hashMap, values); + } + } + }); + } + + return hashMap; + } + + // 处理节点 + _dealWidthNodes(nodes) { + const self = this, + o = this.options; + const ns = Tree.arrayFormat(nodes); + + return map(ns, (i, n) => { + const newNode = extend({}, n); + newNode.isParent = newNode.isParent || newNode.parent; + // n.value = BI.isUndefined(n.value) ? n.text : n.value; + // n.text = BI.isUndefined(n.text) ? n.value : n.text; + // if (n.text === null) { + // n.text = ""; + // } + if (isNull(newNode.title)) { + newNode.title = newNode.text; + } + if (newNode.disabled) { + newNode.title = newNode.warningTitle || newNode.title; + } + const text = createWidget( + extend( + { + cls: "tree-node-text", + tagName: "span", + whiteSpace: "nowrap", + root: true, + keyword: o.paras.keyword, + }, + newNode, + { + type: Text.xtype, + text: replaceAll(newNode.text, "\n", " "), + } + ) + ); + const fragment = Widget._renderEngine.createElement("
"); + fragment.append(text.element[0]); + newNode.text = fragment.html(); + // // 处理标红 + // if (BI.isNotNull(n.text)) { + // if (BI.isKey(o.paras.keyword)) { + // n.text = $("
").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html(); + // } else { + // n.text = BI.htmlEncode(BI.Text.formatText(n.text + "")); + // } + // } + + return newNode; + }); + } + + _loadMore() { + const self = this, + o = this.options; + this.tip.setLoading(); + const op = extend({}, o.paras, { + times: ++this.times, + }); + o.itemsCreator(op, res => { + if (self._stop === true) { + return; + } + const hasNext = !!res.hasNext, + nodes = res.items || []; + + if (!hasNext) { + self.tip.setEnd(); + } else { + self.tip.setLoaded(); + } + if (nodes.length > 0) { + self.nodes.addNodes(null, self._dealWidthNodes(nodes)); + } + }); + } + + // 生成树内部方法 + _initTree(setting) { + const self = this, + o = this.options; + self.fireEvent(Events.INIT); + this.times = 1; + const tree = this.tree; + tree.empty(); + this.loading(); + this.tip.setVisible(false); + + function callback(nodes) { + if (self._stop === true) { + return; + } + self.nodes = $.fn.zTree.init(tree.element, setting, nodes); + } + + const op = extend({}, o.paras, { + times: 1, + }); + + o.itemsCreator(op, res => { + if (self._stop === true) { + return; + } + const hasNext = !!res.hasNext, + nodes = res.items || []; + if (nodes.length > 0) { + callback(self._dealWidthNodes(nodes)); + } + self.setTipVisible(nodes.length <= 0); + self.loaded(); + if (!hasNext) { + self.tip.invisible(); + } else { + self.tip.setLoaded(); + } + op.times === 1 && self.fireEvent(Events.AFTERINIT); + }); + } + + // 构造树结构, + initTree(nodes, setting) { + const defaultSetting = { + async: { + enable: false, + }, + check: { + enable: false, + }, + data: { + key: { + title: "title", + name: "text", + }, + simpleData: { + enable: true, + }, + }, + view: { + showIcon: false, + expandSpeed: "", + nameIsHTML: true, + }, + callback: {}, + }; + this.nodes = $.fn.zTree.init(this.tree.element, setting || defaultSetting, nodes); + } + + start() { + this._stop = false; + } + + stop() { + this._stop = true; + } + + // 生成树方法 + stroke(config) { + delete this.options.keyword; + extend(this.options.paras, config); + const setting = this._configSetting(); + this._createTree(); + this.start(); + this._initTree(setting); + } + + populate() { + this.stroke(...arguments); + } + + hasChecked() { + const treeObj = this.nodes; + + return treeObj.getCheckedNodes(true).length > 0; + } + + checkAll(checked) { + function setNode(children) { + each(children, (i, child) => { + child.halfCheck = false; + setNode(child.children); + }); + } + + if (!this.nodes) { + return; + } + + each(this.nodes.getNodes(), (i, node) => { + node.halfCheck = false; + setNode(node.children); + }); + this.nodes.checkAllNodes(checked); + } + + expandAll(flag) { + this.nodes && this.nodes.expandAll(flag); + } + + // 设置树节点的状态 + setValue(value, param) { + this.checkAll(false); + this.updateValue(value, param); + this.refresh(); + } + + setSelectedValue(value) { + this.options.paras.selectedValues = deepClone(value || {}); + } + + updateValue(values, param) { + if (!this.nodes) { + return; + } + param || (param = "value"); + const treeObj = this.nodes; + each(values, (v, op) => { + const nodes = treeObj.getNodesByParam(param, v, null); + each(nodes, (j, node) => { + extend(node, { checked: true }, op); + treeObj.updateNode(node); + }); + }); + } + + refresh() { + this.nodes && this.nodes.refresh(); + } + + getValue() { + if (!this.nodes) { + return null; + } + + return this._getSelectedValues(); + } + + destroyed() { + this.stop(); + this.nodes && this.nodes.destroy(); + } +} diff --git a/src/component/allvaluechooser/__test__/combo.allvaluechooser.test.js b/packages/fineui/src/component/allvaluechooser/__test__/combo.allvaluechooser.test.js similarity index 100% rename from src/component/allvaluechooser/__test__/combo.allvaluechooser.test.js rename to packages/fineui/src/component/allvaluechooser/__test__/combo.allvaluechooser.test.js diff --git a/src/component/allvaluechooser/abstract.allvaluechooser.js b/packages/fineui/src/component/allvaluechooser/abstract.allvaluechooser.js similarity index 100% rename from src/component/allvaluechooser/abstract.allvaluechooser.js rename to packages/fineui/src/component/allvaluechooser/abstract.allvaluechooser.js diff --git a/src/component/allvaluechooser/combo.allvaluechooser.js b/packages/fineui/src/component/allvaluechooser/combo.allvaluechooser.js similarity index 100% rename from src/component/allvaluechooser/combo.allvaluechooser.js rename to packages/fineui/src/component/allvaluechooser/combo.allvaluechooser.js diff --git a/src/component/allvaluechooser/index.js b/packages/fineui/src/component/allvaluechooser/index.js similarity index 100% rename from src/component/allvaluechooser/index.js rename to packages/fineui/src/component/allvaluechooser/index.js diff --git a/src/component/allvaluechooser/pane.allvaluechooser.js b/packages/fineui/src/component/allvaluechooser/pane.allvaluechooser.js similarity index 100% rename from src/component/allvaluechooser/pane.allvaluechooser.js rename to packages/fineui/src/component/allvaluechooser/pane.allvaluechooser.js diff --git a/src/component/allvaluemultitextvaluecombo/__test__/allvalue.multitextvalue.combo.test.js b/packages/fineui/src/component/allvaluemultitextvaluecombo/__test__/allvalue.multitextvalue.combo.test.js similarity index 100% rename from src/component/allvaluemultitextvaluecombo/__test__/allvalue.multitextvalue.combo.test.js rename to packages/fineui/src/component/allvaluemultitextvaluecombo/__test__/allvalue.multitextvalue.combo.test.js diff --git a/src/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.js b/packages/fineui/src/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.js similarity index 100% rename from src/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.js rename to packages/fineui/src/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.js diff --git a/src/component/form/form.field.js b/packages/fineui/src/component/form/form.field.js similarity index 100% rename from src/component/form/form.field.js rename to packages/fineui/src/component/form/form.field.js diff --git a/src/component/form/form.js b/packages/fineui/src/component/form/form.js similarity index 100% rename from src/component/form/form.js rename to packages/fineui/src/component/form/form.js diff --git a/src/component/form/index.js b/packages/fineui/src/component/form/index.js similarity index 100% rename from src/component/form/index.js rename to packages/fineui/src/component/form/index.js diff --git a/packages/fineui/src/component/index.js b/packages/fineui/src/component/index.js new file mode 100644 index 000000000..6ce49c20b --- /dev/null +++ b/packages/fineui/src/component/index.js @@ -0,0 +1,21 @@ +export * from "./allvaluechooser"; +export * from "./form"; +export * from "./valuechooser"; +export * from "./treevaluechooser"; +export { AllValueMultiTextValueCombo } from "./allvaluemultitextvaluecombo/allvalue.multitextvalue.combo"; + +// Object.assign(BI, { +// ...allvaluechooser, +// ...form, +// ...valueChooser, +// ......treeValueChooser, +// AllValueMultiTextValueCombo, +// }); + +// export * from "./allvaluechooser"; +// export * from "./form"; +// export * from "./valuechooser"; +// export * from "./treevaluechooser"; +// export { +// AllValueMultiTextValueCombo +// }; diff --git a/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js b/packages/fineui/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js similarity index 100% rename from src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js rename to packages/fineui/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js diff --git a/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js b/packages/fineui/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js similarity index 100% rename from src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js rename to packages/fineui/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js diff --git a/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js b/packages/fineui/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js similarity index 100% rename from src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js rename to packages/fineui/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js diff --git a/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js b/packages/fineui/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js similarity index 100% rename from src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js rename to packages/fineui/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js similarity index 100% rename from src/component/treevaluechooser/abstract.treevaluechooser.js rename to packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.list.js b/packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.list.js similarity index 100% rename from src/component/treevaluechooser/abstract.treevaluechooser.list.js rename to packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.list.js diff --git a/src/component/treevaluechooser/combo.listtreevaluechooser.js b/packages/fineui/src/component/treevaluechooser/combo.listtreevaluechooser.js similarity index 100% rename from src/component/treevaluechooser/combo.listtreevaluechooser.js rename to packages/fineui/src/component/treevaluechooser/combo.listtreevaluechooser.js diff --git a/src/component/treevaluechooser/combo.treevaluechooser.insert.js b/packages/fineui/src/component/treevaluechooser/combo.treevaluechooser.insert.js similarity index 100% rename from src/component/treevaluechooser/combo.treevaluechooser.insert.js rename to packages/fineui/src/component/treevaluechooser/combo.treevaluechooser.insert.js diff --git a/src/component/treevaluechooser/combo.treevaluechooser.js b/packages/fineui/src/component/treevaluechooser/combo.treevaluechooser.js similarity index 100% rename from src/component/treevaluechooser/combo.treevaluechooser.js rename to packages/fineui/src/component/treevaluechooser/combo.treevaluechooser.js diff --git a/src/component/treevaluechooser/index.js b/packages/fineui/src/component/treevaluechooser/index.js similarity index 100% rename from src/component/treevaluechooser/index.js rename to packages/fineui/src/component/treevaluechooser/index.js diff --git a/src/component/treevaluechooser/pane.treevaluechooser.js b/packages/fineui/src/component/treevaluechooser/pane.treevaluechooser.js similarity index 100% rename from src/component/treevaluechooser/pane.treevaluechooser.js rename to packages/fineui/src/component/treevaluechooser/pane.treevaluechooser.js diff --git a/src/component/valuechooser/__test__/combo.valuechooser.insert.test.js b/packages/fineui/src/component/valuechooser/__test__/combo.valuechooser.insert.test.js similarity index 100% rename from src/component/valuechooser/__test__/combo.valuechooser.insert.test.js rename to packages/fineui/src/component/valuechooser/__test__/combo.valuechooser.insert.test.js diff --git a/src/component/valuechooser/__test__/combo.valuechooser.test.js b/packages/fineui/src/component/valuechooser/__test__/combo.valuechooser.test.js similarity index 100% rename from src/component/valuechooser/__test__/combo.valuechooser.test.js rename to packages/fineui/src/component/valuechooser/__test__/combo.valuechooser.test.js diff --git a/src/component/valuechooser/__test__/pane.valuechooser.test.js b/packages/fineui/src/component/valuechooser/__test__/pane.valuechooser.test.js similarity index 100% rename from src/component/valuechooser/__test__/pane.valuechooser.test.js rename to packages/fineui/src/component/valuechooser/__test__/pane.valuechooser.test.js diff --git a/src/component/valuechooser/abstract.valuechooser.js b/packages/fineui/src/component/valuechooser/abstract.valuechooser.js similarity index 100% rename from src/component/valuechooser/abstract.valuechooser.js rename to packages/fineui/src/component/valuechooser/abstract.valuechooser.js diff --git a/src/component/valuechooser/combo.valuechooser.insert.js b/packages/fineui/src/component/valuechooser/combo.valuechooser.insert.js similarity index 100% rename from src/component/valuechooser/combo.valuechooser.insert.js rename to packages/fineui/src/component/valuechooser/combo.valuechooser.insert.js diff --git a/src/component/valuechooser/combo.valuechooser.js b/packages/fineui/src/component/valuechooser/combo.valuechooser.js similarity index 100% rename from src/component/valuechooser/combo.valuechooser.js rename to packages/fineui/src/component/valuechooser/combo.valuechooser.js diff --git a/src/component/valuechooser/combo.valuechooser.nobar.js b/packages/fineui/src/component/valuechooser/combo.valuechooser.nobar.js similarity index 100% rename from src/component/valuechooser/combo.valuechooser.nobar.js rename to packages/fineui/src/component/valuechooser/combo.valuechooser.nobar.js diff --git a/src/component/valuechooser/index.js b/packages/fineui/src/component/valuechooser/index.js similarity index 100% rename from src/component/valuechooser/index.js rename to packages/fineui/src/component/valuechooser/index.js diff --git a/src/component/valuechooser/pane.valuechooser.js b/packages/fineui/src/component/valuechooser/pane.valuechooser.js similarity index 100% rename from src/component/valuechooser/pane.valuechooser.js rename to packages/fineui/src/component/valuechooser/pane.valuechooser.js diff --git a/src/core/0.foundation.js b/packages/fineui/src/core/0.foundation.js similarity index 100% rename from src/core/0.foundation.js rename to packages/fineui/src/core/0.foundation.js diff --git a/src/core/1.lodash.js b/packages/fineui/src/core/1.lodash.js similarity index 100% rename from src/core/1.lodash.js rename to packages/fineui/src/core/1.lodash.js diff --git a/packages/fineui/src/core/2.base.js b/packages/fineui/src/core/2.base.js new file mode 100644 index 000000000..59e1817f1 --- /dev/null +++ b/packages/fineui/src/core/2.base.js @@ -0,0 +1,1637 @@ +/** + * 基本函数 + * Create By GUY 2014\11\17 + * + */ +import _ from "./1.lodash"; +import { Widget } from "./4.widget"; +import { createWidget } from "./5.inject"; +import { prepares, _global } from "./0.foundation"; +import { CRYPT_TYPE, aesDecrypt, aesEncrypt } from "./structure/aes"; +import { Date as DateEnum } from "./func/date"; + + +/** + * todo: 理论这么写,逻辑没问题,摇个人把这个 BI 干掉 + */ +const BI = { _ }; + +function traverse(func, context) { + return function (value, key, obj) { + return func.call(context, key, value, obj); + }; +} +function _apply(name) { + return function () { + return BI._[name](...arguments); + }; +} +function _applyFunc(name) { + return function () { + const args = Array.prototype.slice.call(arguments, 0); + args[1] = BI._.isFunction(args[1]) + ? traverse(args[1], args[2]) + : args[1]; + + return BI._[name](...args); + }; +} + +export function assert(v, is) { + if (isFunction(is)) { + if (!is(v)) { + throw new Error(`${v} error`); + } else { + return true; + } + } + if (!isArray(is)) { + is = [is]; + } + if (!deepContains(is, v)) { + throw new Error(`${v} error`); + } + + return true; +} + +export function warn(message) { + console.warn(message); +} + +export function UUID() { + const f = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "a", + "b", + "c", + "d", + "e", + "f" + ]; + let str = ""; + for (let i = 0; i < 16; i++) { + const r = _global.parseInt(f.length * Math.random(), 10); + str += f[r]; + } + + return str; +} + +export function isWidget(widget) { + return widget instanceof Widget; +} + +export function createWidgets(items, options, context) { + if (!isArray(items)) { + throw new Error("items必须是数组", items); + } + if (isWidget(options)) { + context = options; + options = {}; + } else { + options || (options = {}); + } + + return map(flatten(items), (i, item) => + createWidget(item, deepClone(options), context) + ); +} + +export function createItems(data, innerAttr, outerAttr) { + innerAttr = isArray(innerAttr) + ? innerAttr + : makeArray(flatten(data).length, innerAttr || {}); + outerAttr = isArray(outerAttr) + ? outerAttr + : makeArray(flatten(data).length, outerAttr || {}); + + return map(data, (i, item) => { + if (isArray(item)) { + return createItems(item, innerAttr, outerAttr); + } + if (item instanceof Widget) { + return extend({}, innerAttr.shift(), outerAttr.shift(), { + type: null, + el: item, + }); + } + if (innerAttr[0] instanceof Widget) { + outerAttr.shift(); + + return extend({}, item, { + el: innerAttr.shift(), + }); + } + if (item.el instanceof Widget) { + innerAttr.shift(); + + return extend({}, outerAttr.shift(), { type: null }, item); + } + if (item.el) { + return extend({}, outerAttr.shift(), item, { + el: extend({}, innerAttr.shift(), item.el), + }); + } + + return extend({}, outerAttr.shift(), { + el: extend({}, innerAttr.shift(), item), + }); + }); +} + +// 用容器包装items +export function packageItems(items, layouts) { + for (let i = layouts.length - 1; i >= 0; i--) { + items = map(items, (k, it) => + extend({}, layouts[i], { + items: [ + extend({}, layouts[i].el, { + el: it, + }) + ], + }) + ); + } + + return items; +} + +export function formatEL(obj) { + if (obj && !obj.type && obj.el) { + return obj; + } + + return { + el: obj, + }; +} + +// 剥开EL +export function stripEL(obj) { + return (obj.type && obj) || obj.el || obj; +} + +export function trans2Element(widgets) { + return map(widgets, (i, wi) => wi.element); +} + +// 集合相关方法 +BI._.each( + [ + "where", + "findWhere", + "invoke", + "pluck", + "shuffle", + "sample", + "toArray", + "size" + ], + name => { + BI[name] = _apply(name); + } +); +BI._.each( + [ + "get", + "set", + "each", + "map", + "reduce", + "reduceRight", + "find", + "filter", + "reject", + "every", + "all", + "some", + "any", + "max", + "min", + "sortBy", + "groupBy", + "indexBy", + "countBy", + "partition", + "clamp" + ], + name => { + if (name === "any") { + BI[name] = _applyFunc("some"); + } else { + BI[name] = _applyFunc(name); + } + } +); +export const where = BI.where; +export const findWhere = BI.findWhere; +export const invoke = BI.invoke; +export const pluck = BI.pluck; +export const shuffle = BI.shuffle; +export const sample = BI.sample; +export const toArray = BI.toArray; +export const size = BI.size; +export const get = BI.get; +export const set = BI.set; +export const each = BI.each; +export const map = BI.map; +export const reduce = BI.reduce; +export const reduceRight = BI.reduceRight; +export const find = BI.find; +export const filter = BI.filter; +export const reject = BI.reject; +export const every = BI.every; +export const all = BI.all; +export const some = BI.some; +export const any = BI.any; +export const max = BI.max; +export const min = BI.min; +export const sortBy = BI.sortBy; +export const groupBy = BI.groupBy; +export const indexBy = BI.indexBy; +export const countBy = BI.countBy; +export const partition = BI.partition; +export const clamp = BI.clamp; + +// 数数 +export function count(from, to, predicate) { + let t; + if (predicate) { + for (t = from; t < to; t++) { + predicate(t); + } + } + + return to - from; +} + +// 倒数 +export function inverse(from, to, predicate) { + return count(to, from, predicate); +} + +export function firstKey(obj) { + let res = undefined; + any(obj, (key, value) => { + res = key; + + return true; + }); + + return res; +} + +export function lastKey(obj) { + let res = undefined; + each(obj, (key, value) => { + res = key; + + return true; + }); + + return res; +} + +export function firstObject(obj) { + let res = undefined; + any(obj, (key, value) => { + res = value; + + return true; + }); + + return res; +} + +export function lastObject(obj) { + let res = undefined; + each(obj, (key, value) => { + res = value; + + return true; + }); + + return res; +} + +export function concat(obj1, obj2) { + if (isKey(obj1)) { + return map([].slice.apply(arguments), (idx, v) => v).join(""); + } + if (isArray(obj1)) { + return BI._.concat.apply([], arguments); + } + if (isObject(obj1)) { + return extend.apply({}, arguments); + } +} + +export function backEach(obj, predicate, context) { + predicate = iteratee(predicate, context); + for (let index = obj.length - 1; index >= 0; index--) { + predicate(index, obj[index], obj); + } + + return false; +} + +export function backAny(obj, predicate, context) { + predicate = iteratee(predicate, context); + for (let index = obj.length - 1; index >= 0; index--) { + if (predicate(index, obj[index], obj)) { + return true; + } + } + + return false; +} + +export function backEvery(obj, predicate, context) { + predicate = iteratee(predicate, context); + for (let index = obj.length - 1; index >= 0; index--) { + if (!predicate(index, obj[index], obj)) { + return false; + } + } + + return true; +} + +export function backFindKey(obj, predicate, context) { + predicate = iteratee(predicate, context); + const objKeys = keys(obj); + let key; + for (let i = objKeys.length - 1; i >= 0; i--) { + key = objKeys[i]; + if (predicate(obj[key], key, obj)) { + return key; + } + } +} + +export function backFind(obj, predicate, context) { + let key; + if (isArray(obj)) { + key = findLastIndex(obj, predicate, context); + } else { + key = backFindKey(obj, predicate, context); + } + if (key !== void 0 && key !== -1) { + return obj[key]; + } +} + +export function remove(obj, target, context) { + const targetIsFunction = isFunction(target); + target = targetIsFunction || isArray(target) ? target : [target]; + let i; + if (isArray(obj)) { + for (i = 0; i < obj.length; i++) { + if ( + (targetIsFunction && + (target === obj[i] || + target.apply(context, [i, obj[i]]) === true)) || + (!targetIsFunction && contains(target, obj[i])) + ) { + obj.splice(i--, 1); + } + } + } else { + each(obj, (i, v) => { + if ( + (targetIsFunction && + (target === obj[i] || + target.apply(context, [i, obj[i]]) === true)) || + (!targetIsFunction && contains(target, obj[i])) + ) { + delete obj[i]; + } + }); + } +} + +export function removeAt(obj, index) { + index = isArray(index) ? index : [index]; + const objIsArray = isArray(obj); + let i; + for (i = 0; i < index.length; i++) { + if (objIsArray) { + obj[index[i]] = "$deleteIndex"; + } else { + delete obj[index[i]]; + } + } + if (objIsArray) { + remove(obj, "$deleteIndex"); + } +} + +export function string2Array(str) { + return str.split("&-&"); +} + +export function array2String(array) { + return array.join("&-&"); +} + +export function abc2Int(string) { + let idx = 0; + const start = "A", + str = string.toUpperCase(); + for (let i = 0, len = str.length; i < len; ++i) { + idx = str.charAt(i).charCodeAt(0) - start.charCodeAt(0) + 26 * idx + 1; + if ( + idx > + (2147483646 - str.charAt(i).charCodeAt(0) + start.charCodeAt(0)) / + 26 + ) { + return 0; + } + } + + return idx; +} + +export function int2Abc(num) { + const DIGITS = [ + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z" + ]; + let idx = num, + str = ""; + if (num === 0) { + return ""; + } + while (idx !== 0) { + let t = idx % 26; + if (t === 0) { + t = 26; + } + str = DIGITS[t - 1] + str; + idx = (idx - t) / 26; + } + + return str; +} + +// 数组相关的方法 +BI._.each( + [ + "first", + "initial", + "last", + "rest", + "compact", + "flatten", + "without", + "union", + "intersection", + "difference", + "zip", + "unzip", + "object", + "indexOf", + "lastIndexOf", + "sortedIndex", + "range", + "take", + "takeRight", + "uniqBy" + ], + name => { + BI[name] = _apply(name); + } +); +BI._.each(["findIndex", "findLastIndex"], name => { + BI[name] = _applyFunc(name); +}); +export const first = BI.first; +export const initial = BI.initial; +export const last = BI.last; +export const rest = BI.rest; +export const compact = BI.compact; +export const flatten = BI.flatten; +export const without = BI.without; +export const union = BI.union; +export const intersection = BI.intersection; +export const difference = BI.difference; +export const zip = BI.zip; +export const unzip = BI.unzip; +export const object = BI.object; +export const indexOf = BI.indexOf; +export const lastIndexOf = BI.lastIndexOf; +export const sortedIndex = BI.sortedIndex; +export const range = BI.range; +export const take = BI.take; +export const takeRight = BI.takeRight; +export const uniqBy = BI.uniqBy; +export const findIndex = BI.findIndex; +export const findLastIndex = BI.findLastIndex; + +// 构建一个长度为length的数组 +export function makeArray(length, value) { + const res = []; + for (let i = 0; i < length; i++) { + if (isNull(value)) { + res.push(i); + } else { + res.push(deepClone(value)); + } + } + + return res; +} + +export function makeObject(array, value) { + const map = {}; + for (let i = 0; i < array.length; i++) { + if (isNull(value)) { + map[array[i]] = array[i]; + } else if (isFunction(value)) { + map[array[i]] = value(i, array[i]); + } else { + map[array[i]] = deepClone(value); + } + } + + return map; +} + +export function makeArrayByArray(array, value) { + const res = []; + if (!array) { + return res; + } + for (let i = 0, len = array.length; i < len; i++) { + if (isArray(array[i])) { + res.push(makeArrayByArray(array[i], value)); + } else { + res.push(deepClone(value)); + } + } + + return res; +} + +export function uniq(array, isSorted, iteratee, context) { + if (array === null) { + return []; + } + if (!isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; + } + iteratee && (iteratee = traverse(iteratee, context)); + + return BI._uniq.call(BI._, array, isSorted, iteratee, context); +} + +// 对象相关方法 +BI._.each( + [ + "keys", + "allKeys", + "values", + "pairs", + "invert", + "create", + "functions", + "extend", + "extendOwn", + "defaults", + "clone", + "property", + "propertyOf", + "matcher", + "isEqual", + "isMatch", + "isEmpty", + "isElement", + "isNumber", + "isString", + "isArray", + "isObject", + "isPlainObject", + "isArguments", + "isFunction", + "isFinite", + "isBoolean", + "isDate", + "isRegExp", + "isError", + "isNaN", + "isUndefined", + "zipObject", + "cloneDeep", + "pickBy" + ], + name => { + BI[name] = _apply(name); + } +); +export const keys = BI.keys; +export const allKeys = BI.allKeys; +export const values = BI.values; +export const pairs = BI.pairs; +export const invert = BI.invert; +export const create = BI.create; +export const functions = BI.functions; +export const extend = BI.extend; +export const extendOwn = BI.extendOwn; +export const defaults = BI.defaults; +export const clone = BI.clone; +export const property = BI.property; +export const propertyOf = BI.propertyOf; +export const matcher = BI.matcher; +export const isEqual = BI.isEqual; +export const isMatch = BI.isMatch; +export const isEmpty = BI.isEmpty; +export const isElement = BI.isElement; +export const isNumber = BI.isNumber; +export const isString = BI.isString; +export const isArray = BI.isArray; +export const isObject = BI.isObject; +export const isPlainObject = BI.isPlainObject; +export const isArguments = BI.isArguments; +export const isFunction = BI.isFunction; +export const isFinite = BI.isFinite; +export const isBoolean = BI.isBoolean; +export const isDate = BI.isDate; +export const isRegExp = BI.isRegExp; +export const isError = BI.isError; +export const isNaN = BI.isNaN; +export const isUndefined = BI.isUndefined; +export const zipObject = BI.zipObject; +export const cloneDeep = BI.cloneDeep; +export const pickBy = BI.pickBy; + +BI._.each(["mapObject", "findKey", "pick", "omit", "tap"], name => { + BI[name] = _applyFunc(name); +}); +export const mapObject = BI.mapObject; +export const findKey = BI.findKey; +export const pick = BI.pick; +export const omit = BI.omit; +export const tap = BI.tap; + +export function inherit(sp, overrides) { + function sb() { + return sp.apply(this, arguments); + } + function F() {} + const spp = sp.prototype; + F.prototype = spp; + sb.prototype = new F(); + sb.superclass = spp; + extend(sb.prototype, overrides, { + superclass: sp, + }); + + return sb; +} + +export function init() { + // 先把准备环境准备好 + while (prepares && prepares.length > 0) { + prepares.shift()(); + } + while ( + _global.___fineuiExposedFunction && + _global.___fineuiExposedFunction.length > 0 + ) { + _global.___fineuiExposedFunction.shift()(); + } + BI.initialized = true; +} + +export function has(obj, keys) { + if (isArray(keys)) { + if (keys.length === 0) { + return false; + } + + return every(keys, (i, key) => BI._.has(obj, key)); + } + + return BI._.has(...arguments); +} + +export function freeze(value) { + // 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError + // 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回 + if (Object.freeze && isObject(value)) { + return Object.freeze(value); + } + + return value; +} + +// 数字和字符串可以作为key +export function isKey(key) { + return isNumber(key) || (isString(key) && key.length > 0); +} + +// 忽略大小写的等于 +export function isCapitalEqual(a, b) { + a = isNull(a) ? a : `${a}`.toLowerCase(); + b = isNull(b) ? b : `${b}`.toLowerCase(); + + return isEqual(a, b); +} + +export function isWidthOrHeight(w) { + if (typeof w === "number") { + return w >= 0; + } else if (typeof w === "string") { + return ( + /^\d{1,3}(\.\d)?%$/.test(w) || + w === "auto" || + /^\d+(\.\d+)?px$/.test(w) || + /^calc/.test(w) + ); + } +} + +export function isNotNull(obj) { + return !isNull(obj); +} + +export function isNull(obj) { + return typeof obj === "undefined" || obj === null; +} + +export function isEmptyArray(arr) { + return isArray(arr) && isEmpty(arr); +} + +export function isNotEmptyArray(arr) { + return isArray(arr) && !isEmpty(arr); +} + +export function isEmptyObject(obj) { + return isEqual(obj, {}); +} + +export function isNotEmptyObject(obj) { + return isPlainObject(obj) && !isEmptyObject(obj); +} + +export function isWindow(obj) { + return obj !== null && obj === obj.window; +} + +export function isPromise(obj) { + return !!obj && (isObject(obj) || isFunction(obj)) && isFunction(obj.then); +} + +export const deepClone = BI._.cloneDeep; +export const deepExtend = BI._.merge; + +export function isDeepMatch(object, attrs) { + const attrsKeys = keys(attrs), + length = attrsKeys.length; + if (object === null) { + return !length; + } + const obj = Object(object); + for (let i = 0; i < length; i++) { + const key = attrsKeys[i]; + if (!isEqual(attrs[key], obj[key]) || !(key in obj)) { + return false; + } + } + + return true; +} + +export function contains(obj, target, fromIndex) { + if (!BI._.isArrayLike(obj)) obj = values(obj); + + return ( + indexOf(obj, target, typeof fromIndex === "number" && fromIndex) >= 0 + ); +} + +export function deepContains(obj, copy) { + if (isObject(copy)) { + return any(obj, (i, v) => isEqual(v, copy)); + } + + return contains(obj, copy); +} + +export function deepIndexOf(obj, target) { + for (let i = 0; i < obj.length; i++) { + if (isEqual(target, obj[i])) { + return i; + } + } + + return -1; +} + +export function deepRemove(obj, target) { + let done = false; + let i; + if (isArray(obj)) { + for (i = 0; i < obj.length; i++) { + if (isEqual(target, obj[i])) { + obj.splice(i--, 1); + done = true; + } + } + } else { + each(obj, (i, v) => { + if (isEqual(target, obj[i])) { + delete obj[i]; + done = true; + } + }); + } + + return done; +} + +export function deepWithout(obj, target) { + if (isArray(obj)) { + const result = []; + for (let i = 0; i < obj.length; i++) { + if (!isEqual(target, obj[i])) { + result.push(obj[i]); + } + } + + return result; + } + const result = {}; + each(obj, (i, v) => { + if (!isEqual(target, obj[i])) { + result[i] = v; + } + }); + + return result; +} + +export function deepUnique(array) { + const result = []; + each(array, (i, item) => { + if (!deepContains(result, item)) { + result.push(item); + } + }); + + return result; +} + +// 比较两个对象得出不一样的key值 +export function deepDiff(object, other) { + object || (object = {}); + other || (other = {}); + const result = []; + const used = []; + for (const b in object) { + if (has(object, b)) { + if (!isEqual(object[b], other[b])) { + result.push(b); + } + used.push(b); + } + } + for (const b in other) { + if (has(other, b) && !contains(used, b)) { + result.push(b); + } + } + + return result; +} + +// 通用方法 +BI._.each( + [ + "uniqueId", + "result", + "chain", + "iteratee", + "unescape", + "before", + "after", + "chunk" + ], + name => { + BI[name] = (...args) => BI._[name](...args); + } +); +export const uniqueId = BI.uniqueId; +export const result = BI.result; +export const chain = BI.chain; +export const iteratee = BI.iteratee; +export const unescape = BI.unescape; +export const before = BI.before; +export const after = BI.after; +export const chunk = BI.chunk; + +// 事件相关方法 +BI._.each( + [ + "bind", + "once", + "partial", + "debounce", + "throttle", + "delay", + "defer", + "wrap" + ], + name => { + BI[name] = (...args) => BI._[name](...args); + } +); +export const bind = BI.bind; +export const once = BI.once; +export const partial = BI.partial; +export const debounce = BI.debounce; +export const throttle = BI.throttle; +export const delay = BI.delay; +export const defer = BI.defer; +export const wrap = BI.wrap; + +export const nextTick = (function () { + const callbacks = []; + let pending = false; + let timerFunc = void 0; + + function nextTickHandler() { + pending = false; + const copies = callbacks.slice(0); + callbacks.length = 0; + for (let i = 0; i < copies.length; i++) { + copies[i](); + } + } + + if (typeof Promise !== "undefined") { + const p = Promise.resolve(); + timerFunc = function timerFunc() { + p.then(nextTickHandler); + }; + } else if (typeof MutationObserver !== "undefined") { + let counter = 1; + const observer = new MutationObserver(nextTickHandler); + const textNode = document.createTextNode(String(counter)); + observer.observe(textNode, { + characterData: true, + }); + timerFunc = function timerFunc() { + counter = (counter + 1) % 2; + textNode.data = String(counter); + }; + } else if (typeof setImmediate !== "undefined") { + timerFunc = function timerFunc() { + setImmediate(nextTickHandler); + }; + } else { + // Fallback to setTimeout. + timerFunc = function timerFunc() { + setTimeout(nextTickHandler, 0); + }; + } + + return function queueNextTick(cb) { + let _resolve = void 0; + const args = [].slice.call(arguments, 1); + callbacks.push(() => { + if (cb) { + try { + cb(...args); + } catch (e) { + console.error(e); + } + } else if (_resolve) { + _resolve(...args); + } + }); + if (!pending) { + pending = true; + timerFunc(); + } + // $flow-disable-line + if (!cb && typeof Promise !== "undefined") { + return new Promise((resolve, reject) => { + _resolve = resolve; + }); + } + }; +}()); + +// 数字相关方法 +BI._.each(["random"], name => { + BI[name] = _apply(name); +}); +export const random = BI.random; + +export function parseInt(number) { + let radix = 10; + if (/^0x/g.test(number)) { + radix = 16; + } + try { + return _global.parseInt(number, radix); + } catch (e) { + throw new Error(`${number}parse int error`); + } +} + +export function parseSafeInt(value) { + const MAX_SAFE_INTEGER = 9007199254740991; + + return value + ? clamp(parseInt(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : value === 0 + ? value + : 0; +} + +export function parseFloat(number) { + try { + return _global.parseFloat(number); + } catch (e) { + throw new Error(`${number}parse float error`); + } +} + +export function isNaturalNumber(number) { + return /^\d+$/.test(number); +} + +export function isPositiveInteger(number) { + return /^\+?[1-9][0-9]*$/.test(number); +} + +export function isNegativeInteger(number) { + return /^-[1-9][0-9]*$/.test(number); +} + +export function isInteger(number) { + return /^-?\d+$/.test(number); +} + +export function isNumeric(number) { + return ( + !_global.isNaN(_global.parseFloat(number)) && _global.isFinite(number) + ); +} + +export function isFloat(number) { + return /^([+-]?)\d*\.\d+$/.test(number); +} + +export function isOdd(number) { + if (!isInteger(number)) { + return false; + } + + return (number & 1) === 1; +} + +export function isEven(number) { + if (!isInteger(number)) { + return false; + } + + return (number & 1) === 0; +} + +export function sum(array, iteratee, context) { + let sum = 0; + each(array, (i, item) => { + if (iteratee) { + sum += Number(iteratee.apply(context, [i, item])); + } else { + sum += Number(item); + } + }); + + return sum; +} + +export function average(array, iteratee, context) { + const sumResult = sum(array, iteratee, context); + + return sumResult / array.length; +} + +export function trim(...args) { + return BI._.trim(...args); +} + +export function toUpperCase(string) { + return `${string}`.toLocaleUpperCase(); +} + +export function toLowerCase(string) { + return `${string}`.toLocaleLowerCase(); +} + +export function isEndWithBlank(string) { + return /(\s|\u00A0)$/.test(string); +} + +export function isLiteral(exp) { + return /^\s?(true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/.test(exp); +} + +export function stripQuotes(str) { + const a = str.charCodeAt(0); + const b = str.charCodeAt(str.length - 1); + + return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str; +} + +// background-color => backgroundColor +export function camelize(str) { + return str.replace(/-(.)/g, (_, character) => character.toUpperCase()); +} + +// backgroundColor => background-color +export function hyphenate(str) { + return str.replace(/([A-Z])/g, "-$1").toLowerCase(); +} + +export function isNotEmptyString(str) { + return isString(str) && !isEmpty(str); +} + +export function isEmptyString(str) { + return isString(str) && isEmpty(str); +} + +/** + * 通用解密方法 + * @param type 解密方式 + * @param text 文本 + * @param key 种子 + * @return {*} + */ +export function encrypt(type, text, key) { + switch (type) { + case CRYPT_TYPE.AES: + default: + return aesEncrypt(text, key); + } +} + +/** + * 通用解密方法 + * @param type 解密方式 + * @param text 文本 + * @param key 种子 + * @return {*} + */ +export function decrypt(type, text, key) { + switch (type) { + case CRYPT_TYPE.AES: + default: + return aesDecrypt(text, key); + } +} + +/** + * 对字符串中的'和\做编码处理 + * @static + * @param {String} string 要做编码处理的字符串 + * @return {String} 编码后的字符串 + */ +export function escape(string) { + return string.replace(/('|\\)/g, "\\$1"); +} + +/** + * 让字符串通过指定字符做补齐的函数 + * + * var s = BI.leftPad('123', 5, '0');//s的值为:'00123' + * + * @static + * @param {String} val 原始值 + * @param {Number} size 总共需要的位数 + * @param {String} ch 用于补齐的字符 + * @return {String} 补齐后的字符串 + */ +export function leftPad(val, size, ch) { + let result = String(val); + if (!ch) { + ch = " "; + } + while (result.length < size) { + result = ch + result; + } + + return result.toString(); +} + +/** + * 对字符串做替换的函数 + * + * var cls = 'my-class', text = 'Some text'; + * var res = BI.format('
{1}
', cls, text); + * //res的值为:'
Some text
'; + * + * @static + * @param {String} format 要做替换的字符串,替换字符串1,替换字符串2... + * @return {String} 做了替换后的字符串 + */ +export function format(format) { + const args = Array.prototype.slice.call(arguments, 1); + + return format.replace(/\{(\d+)\}/g, (m, i) => args[i]); +} + +/** + * 是否是闰年 + * @param year + * @returns {boolean} + */ +export function isLeapYear(year) { + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; +} + +/** + * 检测是否在有效期 + * + * @param YY 年 + * @param MM 月 + * @param DD 日 + * @param minDate '1900-01-01' + * @param maxDate '2099-12-31' + * @returns {Array} 若无效返回无效状态,数组第一位为无效属性,第二位缺省为超下限,1为超上限 + */ +export function checkDateVoid(YY, MM, DD, minDate, maxDate) { + let back = []; + YY = YY | 0; + MM = MM | 0; + DD = DD | 0; + minDate = isString(minDate) ? minDate.match(/\d+/g) : minDate; + maxDate = isString(maxDate) ? maxDate.match(/\d+/g) : maxDate; + if (YY < minDate[0]) { + back = ["y"]; + } else if (YY > maxDate[0]) { + back = ["y", 1]; + } else if (YY >= minDate[0] && YY <= maxDate[0]) { + if (YY === minDate[0]) { + if (MM < minDate[1]) { + back = ["m"]; + } else if (MM === minDate[1]) { + if (DD < minDate[2]) { + back = ["d"]; + } + } + } + if (YY === maxDate[0]) { + if (MM > maxDate[1]) { + back = ["m", 1]; + } else if (MM === maxDate[1]) { + if (DD > maxDate[2]) { + back = ["d", 1]; + } + } + } + } + + return back; +} + +export function checkDateLegal(str) { + const ar = str.match(/\d+/g); + const YY = ar[0] | 0, + MM = ar[1] | 0, + DD = ar[2] | 0; + if (ar.length <= 1) { + return true; + } + if (ar.length <= 2) { + return MM >= 1 && MM <= 12; + } + const MD = DateEnum._MD.slice(0); + MD[1] = isLeapYear(YY) ? 29 : 28; + + return MM >= 1 && MM <= 12 && DD <= MD[MM - 1]; +} + +/** 解析日期时间字符串 + * + * @param str + * @param fmt + * @returns {Date|Date} + * 年月日缺省值为当前日期, 时分秒缺省值为0 + */ +export function parseDateTime(str, fmt) { + const today = getDate(); + let y; + let m; + let d; + // wei : 对于fmt为‘YYYYMM’或者‘YYYYMMdd’的格式,str的值为类似'201111'的形式,因为年月之间没有分隔符,所以正则表达式分割无效,导致bug7376。 + const a = str.split(/\W+/); + if (fmt.toLowerCase() === "%y%x" || fmt.toLowerCase() === "%y%x%d") { + const yearlength = 4; + const otherlength = 2; + a[0] = str.substring(0, yearlength); + a[1] = str.substring(yearlength, yearlength + otherlength); + a[2] = str.substring( + yearlength + otherlength, + yearlength + otherlength * 2 + ); + } + const b = fmt.match(/%./g); + let i = 0, + j = 0; + let hr = 0; + let min = 0; + let sec = 0; + for (i = 0; i < a.length; ++i) { + switch (b[i]) { + case "%d": + case "%e": + d = _global.parseInt(a[i], 10); + break; + + case "%X": + m = _global.parseInt(a[i], 10) - 1; + break; + case "%x": + m = _global.parseInt(a[i], 10) - 1; + break; + + case "%Y": + case "%y": + y = _global.parseInt(a[i], 10); + y < 100 && (y += y > 29 ? 1900 : 2000); + break; + + case "%b": + case "%B": + for (j = 0; j < 12; ++j) { + if ( + BI.getMonthName(j) + .substr(0, a[i].length) + .toLowerCase() === a[i].toLowerCase() + ) { + m = j; + break; + } + } + break; + + case "%H": + case "%I": + case "%k": + case "%l": + hr = _global.parseInt(a[i], 10); + break; + + case "%P": + case "%p": + if (/pm/i.test(a[i]) && hr < 12) { + hr += 12; + } else if (/am/i.test(a[i]) && hr >= 12) { + hr -= 12; + } + break; + case "%Q": + case "%q": + m = (_global.parseInt(a[i], 10) - 1) * 3; + break; + case "%M": + min = _global.parseInt(a[i], 10); + break; + case "%S": + sec = _global.parseInt(a[i], 10); + break; + default: + } + } + // if (!a[i]) { + // continue; + // } + if (_global.isNaN(y)) { + y = today.getFullYear(); + } + if (_global.isNaN(m)) { + m = today.getMonth(); + } + if (_global.isNaN(d)) { + d = today.getDate(); + } + if (_global.isNaN(hr)) { + hr = today.getHours(); + } + if (_global.isNaN(min)) { + min = today.getMinutes(); + } + if (_global.isNaN(sec)) { + sec = today.getSeconds(); + } + if (y !== 0) { + return getDate(y, m, d, hr, min, sec); + } + y = 0; + m = -1; + d = 0; + for (i = 0; i < a.length; ++i) { + if (a[i].search(/[a-zA-Z]+/) !== -1) { + let t = -1; + for (j = 0; j < 12; ++j) { + if ( + BI.getMonthName(j).substr(0, a[i].length).toLowerCase() === + a[i].toLowerCase() + ) { + t = j; + break; + } + } + if (t !== -1) { + if (m !== -1) { + d = m + 1; + } + m = t; + } + } else if (_global.parseInt(a[i], 10) <= 12 && m === -1) { + m = a[i] - 1; + } else if (_global.parseInt(a[i], 10) > 31 && y === 0) { + y = _global.parseInt(a[i], 10); + y < 100 && (y += y > 29 ? 1900 : 2000); + } else if (d === 0) { + d = a[i]; + } + } + if (y === 0) { + y = today.getFullYear(); + } + if (m === -1) { + m = today.getMonth(); + } + if (m !== -1 && d !== 0) { + return getDate(y, m, d, hr, min, sec); + } + + return today; +} + +export function getDate(...args) { + const length = args.length; + let dt; + switch (length) { + // new Date() + case 0: + dt = new Date(); + break; + // new Date(long) + case 1: + dt = new Date(args[0]); + break; + // new Date(year, month) + case 2: + dt = new Date(args[0], args[1]); + break; + // new Date(year, month, day) + case 3: + dt = new Date(args[0], args[1], args[2]); + break; + // new Date(year, month, day, hour) + case 4: + dt = new Date(args[0], args[1], args[2], args[3]); + break; + // new Date(year, month, day, hour, minute) + case 5: + dt = new Date(args[0], args[1], args[2], args[3], args[4]); + break; + // new Date(year, month, day, hour, minute, second) + case 6: + dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]); + break; + // new Date(year, month, day, hour, minute, second, millisecond) + case 7: + dt = new Date( + args[0], + args[1], + args[2], + args[3], + args[4], + args[5], + args[6] + ); + break; + default: + dt = new Date(); + break; + } + if ( + isNotNull(BI.timeZone) && + (arguments.length === 0 || + (arguments.length === 1 && isNumber(arguments[0]))) + ) { + const localTime = dt.getTime(); + // BI-33791 1901年以前的东8区标准是GMT+0805, 统一无论是什么时间,都以整的0800这样的为基准 + const localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数 + const utc = localTime + localOffset; // utc即GMT时间标准时区 + + return new Date(utc + BI.timeZone); // + Pool.timeZone.offset); + } + + return dt; +} + +export function getTime() { + const length = arguments.length; + const args = arguments; + let dt; + switch (length) { + // new Date() + case 0: + dt = new Date(); + break; + // new Date(long) + case 1: + dt = new Date(args[0]); + break; + // new Date(year, month) + case 2: + dt = new Date(args[0], args[1]); + break; + // new Date(year, month, day) + case 3: + dt = new Date(args[0], args[1], args[2]); + break; + // new Date(year, month, day, hour) + case 4: + dt = new Date(args[0], args[1], args[2], args[3]); + break; + // new Date(year, month, day, hour, minute) + case 5: + dt = new Date(args[0], args[1], args[2], args[3], args[4]); + break; + // new Date(year, month, day, hour, minute, second) + case 6: + dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]); + break; + // new Date(year, month, day, hour, minute, second, millisecond) + case 7: + dt = new Date( + args[0], + args[1], + args[2], + args[3], + args[4], + args[5], + args[6] + ); + break; + default: + dt = new Date(); + break; + } + if (isNotNull(BI.timeZone)) { + // BI-33791 1901年以前的东8区标准是GMT+0805, 统一无论是什么时间,都以整的0800这样的为基准 + return ( + dt.getTime() - BI.timeZone - new Date().getTimezoneOffset() * 60000 + ); + } + + return dt.getTime(); +} + diff --git a/src/core/3.ob.js b/packages/fineui/src/core/3.ob.js similarity index 100% rename from src/core/3.ob.js rename to packages/fineui/src/core/3.ob.js diff --git a/packages/fineui/src/core/4.widget.js b/packages/fineui/src/core/4.widget.js new file mode 100644 index 000000000..2e5fae77d --- /dev/null +++ b/packages/fineui/src/core/4.widget.js @@ -0,0 +1,1192 @@ +/** + * Widget超类 + * @class Widget + * @extends OB + * + * @cfg {JSON} options 配置属性 + */ + +import $ from "jquery"; +import { + isFunction, + isArray, + each, + extend, + isPlainObject, + isNull, + uniqueId, + isWidget, + isWidthOrHeight, + isKey, + remove, + any, + isNotNull +} from "./2.base"; +import { OB } from "./3.ob"; +import { Providers, _lazyCreateWidget } from "./5.inject"; +import { DOM } from "./utils"; +import { Events, emptyFn, pixFormat } from "./constant"; +import { Plugin } from "./6.plugin"; +import { _global } from "./0.foundation"; +import { SystemProvider } from "./system"; + +const cancelAnimationFrame = + _global.cancelAnimationFrame || + _global.webkitCancelAnimationFrame || + _global.mozCancelAnimationFrame || + _global.oCancelAnimationFrame || + _global.msCancelAnimationFrame || + _global.clearTimeout; + +const requestAnimationFrame = + _global.requestAnimationFrame || + _global.webkitRequestAnimationFrame || + _global.mozRequestAnimationFrame || + _global.oRequestAnimationFrame || + _global.msRequestAnimationFrame || + _global.setTimeout; + +function callLifeHook(self, life) { + let hooks = [], + hook; + hook = self[life]; + if (hook) { + hooks = hooks.concat(isArray(hook) ? hook : [hook]); + } + hook = self.options[life]; + if (hook) { + hooks = hooks.concat(isArray(hook) ? hook : [hook]); + } + each(hooks, (i, hook) => { + hook.call(self); + }); +} + +export class Widget extends OB { + _defaultConfig() { + return extend(super._defaultConfig(), { + root: false, + tagName: "div", + attributes: null, + data: null, + key: null, + + tag: null, + disabled: false, + invisible: false, + animation: "", + animationDuring: 0, + invalid: false, + baseCls: "", + extraCls: "", + cls: "", + css: null + + // vdom: false + }); + } + + _constructor() {} + + // 覆盖父类的_constructor方法,widget不走ob的生命周期 + _constructed() { + if (this.setup) { + pushTarget(this); + const delegate = this.setup(this.options); + if (isPlainObject(delegate)) { + // 如果setup返回一个json,即对外暴露的方法 + extend(this, delegate); + } else { + this.render = delegate; + } + popTarget(); + } + } + + _lazyConstructor() { + if (!this.__constructed) { + this.__constructed = true; + this._init(); + this._initRef(); + } + } + + // // 生命周期函数 + // beforeInit = null; + + // beforeRender = null; + + // beforeCreate = null + + // created = null + + // render = null + + // beforeMount = null + + // mounted = null + // // 不想重写mounted时用 + // _mounted = null + + // shouldUpdate = null + + // update = null + + // beforeUpdate = null + + // updated = null + + // beforeDestroy = null + + // destroyed = null + // // 不想重写destroyed时用 + // _destroyed = null + + _init() { + super._init(...arguments); + this._initVisual(); + this._initState(); + this._initRender(); + } + + _initRender() { + let initCallbackCalled = false; + let renderCallbackCalled = false; + + const init = () => { + // 加个保险 + if (initCallbackCalled === true) { + _global.console && + console.error( + "组件: 请检查beforeInit内部的写法,callback只能执行一次" + ); + + return; + } + initCallbackCalled = true; + + const render = () => { + // 加个保险 + if (renderCallbackCalled === true) { + _global.console && + console.error( + "组件: 请检查beforeRender内部的写法,callback只能执行一次" + ); + + return; + } + renderCallbackCalled = true; + this._render(); + this.__afterRender(); + }; + + if (this.options.beforeRender || this.beforeRender) { + this.__async = true; + const beforeRenderResult = ( + this.options.beforeRender || this.beforeRender + ).call(this, render); + if (beforeRenderResult instanceof Promise) { + beforeRenderResult.then(render).catch((e) => { + _global.console && console.error(e); + render(); + }); + } + } else { + this._render(); + this.__afterRender(); + } + }; + + if (this.options.beforeInit || this.beforeInit) { + this.__asking = true; + const beforeInitResult = ( + this.options.beforeInit || this.beforeInit + ).call(this, init); + if (beforeInitResult instanceof Promise) { + beforeInitResult.then(init).catch((e) => { + _global.console && console.error(e); + init(); + }); + } + } else { + init(); + } + } + + __afterRender() { + pushTarget(this); + const async = this.__async; + this.__async = false; + if (async && this._isMounted) { + callLifeHook(this, "beforeMount"); + this._mount(); + callLifeHook(this, "mounted"); + this.fireEvent(Events.MOUNT); + } else { + this._mount(); + } + popTarget(); + } + + _render() { + this.__asking = false; + pushTarget(this); + callLifeHook(this, "beforeCreate"); + this._initElement(); + this._initEffects(); + callLifeHook(this, "created"); + popTarget(); + } + + _initCurrent() { + const o = this.options; + this._initElementWidth(); + this._initElementHeight(); + if (o._baseCls || o.baseCls || o.extraCls) { + this.element.addClass( + `${o._baseCls || ""} ${o.baseCls || ""} ${o.extraCls || ""}` + ); + } + if (o.cls) { + if (isFunction(o.cls)) { + let cls = this.__watch(o.cls, (context, newValue) => { + this.element.removeClass(cls).addClass((cls = newValue)); + }); + this.element.addClass(cls); + } else { + this.element.addClass(o.cls); + } + } + // if (o.key != null) { + // this.element.attr("key", o.key); + // } + if (o.attributes) { + this.element.attr(o.attributes); + } + if (o.data) { + this.element.data(o.data); + } + if (o.css) { + if (isFunction(o.css)) { + let css = this.__watch(o.css, (context, newValue) => { + for (const k in css) { + if (isNull(newValue[k])) { + newValue[k] = ""; + } + } + this.element.css((css = newValue)); + }); + this.element.css(css); + } else { + this.element.css(o.css); + } + } + } + + __watch(getter, handler, options) { + if (_global.Fix) { + this._watchers = this._watchers || []; + const watcher = new Fix.Watcher( + null, + () => getter.call(this, this), + (handler && + ((v) => { + handler.call(this, this, v); + })) || + emptyFn, + extend({ deep: true }, options) + ); + this._watchers.push(() => { + watcher.teardown(); + }); + + return watcher.value; + } else { + return getter(); + } + } + + /** + * 初始化根节点 + * @private + */ + _initRoot() { + const o = this.options; + this.widgetName = o.widgetName || uniqueId("widget"); + this._isRoot = o.root; + this._children = {}; + if (isWidget(o.element)) { + this.element = this.options.element.element; + this._parent = o.element; + this._parent._children && + this._parent.addWidget(this.widgetName, this); + } else if (o.element) { + this.element = Widget._renderEngine.createElement(this); + this._isRoot = true; + } else { + this.element = Widget._renderEngine.createElement(this); + } + this.element._isWidget = true; + // const widgets = this.element.data("__widgets") || []; + // widgets.push(this); + // this.element.data("__widgets", widgets); + this._initCurrent(); + } + + _initElementWidth() { + const o = this.options; + if (isWidthOrHeight(o.width)) { + this.element.css("width", pixFormat(o.width)); + } + } + + _initElementHeight() { + const o = this.options; + if (isWidthOrHeight(o.height)) { + this.element.css("height", pixFormat(o.height)); + } + } + + _initVisual() { + const o = this.options; + if (o.invisible) { + const invisible = (o.invisible = isFunction(o.invisible) + ? this.__watch(o.invisible, (context, newValue) => { + this.setVisible(!newValue); + }) + : o.invisible); + if (invisible) { + // 用display属性做显示和隐藏,否则jquery会在显示时将display设为block会覆盖掉display:flex属性 + this.__setElementVisible(false); + } + } + } + + _initEffects() { + const o = this.options; + if (o.disabled || o.invalid) { + if (this.options.disabled) { + const disabled = (o.disabled = isFunction(o.disabled) + ? this.__watch(o.disabled, (context, newValue) => { + this.setEnable(!newValue); + }) + : o.disabled); + if (disabled) { + this.setEnable(false); + } + } + if (this.options.invalid) { + const invalid = (o.invalid = isFunction(o.invalid) + ? this.__watch(o.invalid, (context, newValue) => { + this.setValid(!newValue); + }) + : o.invalid); + if (invalid) { + this.setValid(false); + } + } + } + if (o.effect) { + if (isArray(o.effect)) { + if (isArray(o.effect[0])) { + each(o.effect, (i, effect) => { + this.__watch(effect[0], effect[1]); + }); + } else { + this.__watch(o.effect[0], o.effect[1]); + } + } else { + this.__watch(o.effect); + } + } + } + + _initState() { + this._isMounted = false; + this._isDestroyed = false; + } + + __initWatch() { + // initWatch拦截的方法 + } + + _initElement() { + this.__isMounting = true; + // 当开启worker模式时,可以通过$render来实现另一种效果 + const workerMode = + Providers.getProvider(SystemProvider.xtype).getWorkerMode(); + const render = isFunction(this.options.render) + ? this.options.render + : workerMode + ? this.$render || this.render + : this.render; + let els = render && render.call(this); + els = this.options.configRender + ? this.options.configRender.call(this, els) + : els; + els = Plugin.getRender(this.options.type, els); + if (isPlainObject(els)) { + els = [els]; + } + this.__initWatch(); + if (isArray(els)) { + each(els, (i, el) => { + if (el) { + _lazyCreateWidget(el, { + element: this + }); + } + }); + } + } + + _setParent(parent) { + this._parent = parent; + } + + /** + * + * @param force 是否强制挂载子节点 + * @param deep 子节点是否也是按照当前force处理 + * @param lifeHook 生命周期钩子触不触发,默认触发 + * @param predicate 递归每个widget的回调 + * @param layer 组件层级 + * @returns {boolean} + * @private + */ + _mount(force, deep, lifeHook, predicate, layer) { + if ( + !force && + (this._isMounted || + !this.isVisible() || + this.__asking === true || + !( + this._isRoot === true || + (this._parent && this._parent._isMounted === true) + )) + ) { + return false; + } + layer = layer || 0; + lifeHook !== false && + !this.__async && + callLifeHook(this, "beforeMount"); + this._isMounted = true; + this.__isMounting = false; + for (const key in this._children) { + const child = this._children[key]; + child._mount && + child._mount( + deep ? force : false, + deep, + lifeHook, + predicate, + layer + 1 + ); + } + if (this._parent) { + if (!this._parent.isEnabled()) { + this._setEnable(false); + } + if (!this._parent.isValid()) { + this._setValid(false); + } + } + this._mountChildren && this._mountChildren(); + if (layer === 0) { + // mounted里面会执行scrollTo之类的方法,如果放宏任务里会闪 + // setTimeout(function () { + this.__afterMount(lifeHook, predicate); + // }, 0); + } + + return true; + } + + __afterMount(lifeHook, predicate) { + if (this._isMounted) { + for (const key in this._children) { + const child = this._children[key]; + child.__afterMount && child.__afterMount(lifeHook, predicate); + } + if (lifeHook !== false && !this.__async) { + callLifeHook(this, "_mounted"); + callLifeHook(this, "mounted"); + this.fireEvent(Events.MOUNT); + } + predicate && predicate(this); + } + } + + // _mountChildren = null; + + _update(nextProps, shouldUpdate) { + callLifeHook(this, "beforeUpdate"); + let res; + if (shouldUpdate) { + res = this.update && this.update(nextProps, shouldUpdate); + } + callLifeHook(this, "updated"); + + return res; + } + + isMounted() { + return this._isMounted; + } + + isDestroyed() { + return this._isDestroyed; + } + + setWidth(w) { + this.options.width = w; + this._initElementWidth(); + } + + setHeight(h) { + this.options.height = h; + this._initElementHeight(); + } + + _setEnable(enable) { + if (enable === true) { + this.options._disabled = false; + } else if (enable === false) { + this.options._disabled = true; + } + // 递归将所有子组件使能 + each(this._children, (i, child) => { + !child._manualSetEnable && + child._setEnable && + child._setEnable(enable); + }); + } + + _setValid(valid) { + if (valid === true) { + this.options._invalid = false; + } else if (valid === false) { + this.options._invalid = true; + } + // 递归将所有子组件使有效 + each(this._children, (i, child) => { + !child._manualSetValid && child._setValid && child._setValid(valid); + }); + } + + _setVisible(visible) { + if (visible === true) { + this.options.invisible = false; + } else if (visible === false) { + this.options.invisible = true; + } + } + + setEnable(enable) { + this._manualSetEnable = true; + this.options.disabled = !enable; + this._setEnable(enable); + if (enable === true) { + this.element.removeClass("base-disabled disabled"); + } else if (enable === false) { + this.element.addClass("base-disabled disabled"); + } + } + + __setElementVisible(visible) { + this.element.css("display", visible ? "" : "none"); + } + + _innerSetVisible(visible) { + const o = this.options; + const lastVisible = !o.invisible; + this._setVisible(visible); + if (visible === true) { + // 用this.element.show()会把display属性改成block + this.__setElementVisible(true); + this._mount(); + if (o.animation && !lastVisible) { + this.element + .removeClass(`${o.animation}-leave`) + .removeClass(`${o.animation}-leave-active`) + .addClass(`${o.animation}-enter`); + if (this._requestAnimationFrame) { + cancelAnimationFrame(this._requestAnimationFrame); + } + this._requestAnimationFrame = () => { + this.element.addClass(`${o.animation}-enter-active`); + }; + requestAnimationFrame(this._requestAnimationFrame); + if (this._animationDuring) { + clearTimeout(this._animationDuring); + } + this._animationDuring = setTimeout(() => { + this.element + .removeClass(`${o.animation}-enter`) + .removeClass(`${o.animation}-enter-active`); + }, o.animationDuring); + } + } else if (visible === false) { + if (o.animation && lastVisible) { + this.element + .removeClass(`${o.animation}-enter`) + .removeClass(`${o.animation}-enter-active`) + .addClass(`${o.animation}-leave`); + if (this._requestAnimationFrame) { + cancelAnimationFrame(this._requestAnimationFrame); + } + this._requestAnimationFrame = () => { + this.element.addClass(`${o.animation}-leave-active`); + }; + requestAnimationFrame(this._requestAnimationFrame); + if (this._animationDuring) { + clearTimeout(this._animationDuring); + } + this._animationDuring = setTimeout(() => { + this.element + .removeClass(`${o.animation}-leave`) + .removeClass(`${o.animation}-leave-active`); + this.__setElementVisible(false); + }, o.animationDuring); + } else { + this.__setElementVisible(false); + } + } + } + + setVisible(visible) { + this._innerSetVisible(visible); + this.fireEvent(Events.VIEW, visible); + } + + setValid(valid) { + this._manualSetValid = true; + this.options.invalid = !valid; + this._setValid(valid); + if (valid === true) { + this.element.removeClass("base-invalid invalid"); + } else if (valid === false) { + this.element.addClass("base-invalid invalid"); + } + } + + doBehavior() { + const args = arguments; + // 递归将所有子组件使有效 + each(this._children, (i, child) => { + child.doBehavior && child.doBehavior(...args); + }); + } + + getWidth() { + return this.options.width; + } + + getHeight() { + return this.options.height; + } + + addWidget(name, widget) { + const self = this; + if (name instanceof Widget) { + widget = name; + name = widget.getName(); + } + if (isKey(name)) { + name = `${name}`; + } + name = name || widget.getName() || uniqueId("widget"); + if (this._children[name]) { + throw new Error("组件:组件名已存在,不能进行添加"); + } + widget._setParent && widget._setParent(this); + widget.on(Events.DESTROY, function () { + // TODO: self待删 + remove(self._children, this); + }); + + return (this._children[name] = widget); + } + + getWidgetByName(name) { + if (!isKey(name) || name === this.getName()) { + return this; + } + name = `${name}`; + let widget = void 0; + const other = {}; + any(this._children, (i, wi) => { + if (i === name) { + widget = wi; + + return true; + } + other[i] = wi; + }); + if (!widget) { + any(other, (i, wi) => (widget = wi.getWidgetByName(i))); + } + + return widget; + } + + removeWidget(nameOrWidget) { + if (isWidget(nameOrWidget)) { + remove(this._children, nameOrWidget); + } else { + delete this._children[nameOrWidget]; + } + } + + hasWidget(name) { + return isNotNull(this._children[name]); + } + + getName() { + return this.widgetName; + } + + setTag(tag) { + this.options.tag = tag; + } + + getTag() { + return this.options.tag; + } + + attr(key, value) { + if (isPlainObject(key)) { + each(key, (k, v) => this.attr(k, v)); + + return; + } + if (isNotNull(value)) { + this.options[key] = value; + } + + return this.options[key]; + } + + css(name, value) { + return this.element.css(name, value); + } + + getText() {} + + setText(text) {} + + getValue() {} + + setValue(value) {} + + isEnabled() { + return this.options.disabled === true ? false : !this.options._disabled; + } + + isValid() { + return this.options.invalid === true ? false : !this.options._invalid; + } + + isVisible() { + return !this.options.invisible; + } + + disable() { + this.setEnable(false); + } + + enable() { + this.setEnable(true); + } + + valid() { + this.setValid(true); + } + + invalid() { + this.setValid(false); + } + + invisible() { + this.setVisible(false); + } + + visible() { + this.setVisible(true); + } + + __d() { + each(this._children, (i, widget) => { + widget && widget._unMount && widget._unMount(); + }); + this._children = {}; + } + + // 主要是因为_destroy已经提供了protected方法 + __destroy() { + callLifeHook(this, "beforeDestroy"); + this.beforeDestroy = null; + this.__d(); + this._parent = null; + this._isMounted = false; + callLifeHook(this, "_destroyed"); + callLifeHook(this, "destroyed"); + this.destroyed = null; + this._isDestroyed = true; + // this._purgeRef(); // 清除ref的时机还是要仔细考虑一下 + } + + _unMount() { + this._assetMounted(); + this.__destroy(); + this.fireEvent(Events.UNMOUNT); + this.purgeListeners(); + } + + _assetMounted() { + if (!this.isVisible()) { + this._setVisible(true); + this._mount(false, false, false); + this._setVisible(false); + } + } + + _empty() { + this._assetMounted(); + each(this._children, (i, widget) => { + widget && widget._unMount && widget._unMount(); + }); + this._children = {}; + this.element.empty(); + } + + isolate() { + if (this._parent) { + this._parent.removeWidget(this); + } + DOM.hang([this]); + } + + empty() { + this._empty(); + } + + // 默认的reset方法就是干掉重来 + reset() { + // 还在异步状态的不需要执行reset + if (this.__async === true || this.__asking === true) { + return; + } + // if (this.options.vdom) { + // const vnode = this._renderVNode(); + // patchVNode(this.vnode, vnode); + // this.vnode = vnode; + // return; + // } + // this._isMounted = false; + // this.purgeListeners(); + + // 去掉组件绑定的watcher + each(this._watchers, (i, unwatches) => { + unwatches = isArray(unwatches) ? unwatches : [unwatches]; + each(unwatches, (j, unwatch) => { + unwatch(); + }); + }); + this._watchers && (this._watchers = []); + this._assetMounted(); + this.__d(); + this.element.empty(); + this.element.unbind(); + this._initCurrent(); + this._init(); + // this._initRef(); + } + + _destroy() { + this._assetMounted(); + this.__destroy(); + this.element.destroy(); + this.purgeListeners(); + } + + destroy() { + const o = this.options; + this._assetMounted(); + this.__destroy(); + if (o.animation) { + this._innerSetVisible(false); + setTimeout(() => this.element.destroy(), o.animationDuring); + } else { + this.element.destroy(); + } + this.fireEvent(Events.UNMOUNT); + this.fireEvent(Events.DESTROY); + this._purgeRef(); + this.purgeListeners(); + } +} + +let context = null, + current = null; +const contextStack = [], + currentStack = []; + +Widget.pushContext = function (_context) { + if (context) contextStack.push(context); + Widget.context = context = _context; +}; + +Widget.popContext = function () { + Widget.context = context = contextStack.pop(); +}; + +Widget.execWithContext = function (context, execFunc) { + Widget.pushContext(context); + try { + execFunc(); + } catch (e) { + throw e; + } finally { + Widget.popContext(); + } +}; + +function pushTarget(_current) { + if (current) currentStack.push(current); + Widget.current = current = _current; +} + +function popTarget() { + Widget.current = current = currentStack.pop(); +} + +export function useStore(_store) { + if (current && current.store) { + return current.store; + } + if (current && current.$storeDelegate) { + return current.$storeDelegate; + } + if (current) { + const currentStore = current._store; + const delegate = {}; + let origin; + if (_global.Proxy) { + const proxy = new Proxy(delegate, { + get(target, key) { + return Reflect.get(origin, key); + }, + set(target, key, value) { + return Reflect.set(origin, key, value); + } + }); + current._store = function () { + origin = (_store || currentStore).apply(this, arguments); + delegate.$delegate = origin; + + return origin; + }; + current.$storeDelegate = proxy; + + return current.$storeDelegate; + } + current._store = function () { + const st = (_store || currentStore).apply(this, arguments); + extend(delegate, st); + + return st; + }; + current.$storeDelegate = delegate; + + return current.$storeDelegate; + } +} + +export function useContext(inject) { + // 通过组件找最近的store + let vm = Widget.findStore(Widget.current || Widget.context); + if (vm) { + if (inject) { + if (vm.$$computed && inject in vm.$$computed) { + return vm; + } + if (vm.$$state && inject in vm.$$state) { + return vm; + } + if (vm.$$model && inject in vm.$$model) { + return vm; + } + while (vm) { + if (vm.$$context && inject in vm.$$context) { + return vm; + } + vm = vm._parent; + } + + return null; + } + } + + return vm; +} + +export function watch(vm, watch, handler) { + // 必须要保证组件当前环境存在 + if (Widget.current) { + if (vm instanceof BI.Model) { + const watchers = []; + if (isKey(watch)) { + const k = watch; + watch = {}; + watch[k] = handler; + } + for (const key in watch) { + const innerHandler = watch[key]; + if (isArray(handler)) { + for (let i = 0; i < handler.length; i++) { + watchers.push( + Fix.watch(vm.model, key, innerHandler, { + store: vm + }) + ); + } + } else { + watchers.push( + Fix.watch(vm.model, key, innerHandler, { + store: vm + }) + ); + } + } + // vm中一定有_widget + Widget.current._watchers || (Widget.current._watchers = []); + Widget.current._watchers = + Widget.current._watchers.concat(watchers); + + return; + } + handler = watch; + watch = vm; + Widget.current.$watchDelayCallbacks || + (Widget.current.$watchDelayCallbacks = []); + Widget.current.$watchDelayCallbacks.push([watch, handler]); + } +} + +export function onBeforeMount(beforeMount) { + if (current) { + if (current.__isMounting) { + beforeMount(); + + return; + } + if (!current.beforeMount) { + current.beforeMount = []; + } else if (!isArray(current.beforeMount)) { + current.beforeMount = [current.beforeMount]; + } + current.beforeMount.push(beforeMount); + } +} + +export function onMounted(mounted) { + if (current) { + if (current._isMounted && !this.__async) { + mounted(); + + return; + } + if (!current.mounted) { + current.mounted = []; + } else if (!isArray(current.mounted)) { + current.mounted = [current.mounted]; + } + current.mounted.push(mounted); + } +} + +export function onBeforeUnmount(beforeDestroy) { + if (current) { + if (!current.beforeDestroy) { + current.beforeDestroy = []; + } else if (!isArray(current.beforeDestroy)) { + current.beforeDestroy = [current.beforeDestroy]; + } + current.beforeDestroy.push(beforeDestroy); + } +} + +export function onUnmounted(destroyed) { + if (current) { + if (!current.destroyed) { + current.destroyed = []; + } else if (!isArray(current.destroyed)) { + current.destroyed = [current.destroyed]; + } + current.destroyed.push(destroyed); + } +} + +Widget.registerRenderEngine = function (engine) { + Widget._renderEngine = engine; +}; +Widget.registerRenderEngine({ + createElement(widget) { + if (isWidget(widget)) { + const o = widget.options; + if (o.element) { + return $(o.element); + } + if (o.tagName) { + return $(document.createElement(o.tagName)); + } + + return $(document.createDocumentFragment()); + } + + return $(widget); + }, + createFragment() { + return document.createDocumentFragment(); + } +}); + +export function mount(widget, container, predicate, hydrate) { + if (hydrate === true) { + // 将widget的element元素都挂载好,并建立相互关系 + widget.element.data("__widgets", [widget]); + const res = widget._mount(true, false, false, function (w) { + each(w._children, (i, child) => { + let ws = child.element.data("__widgets"); + if (!ws) { + ws = []; + } + ws.push(child); + child.element.data("__widgets", ws); + }); + predicate && predicate.apply(this, arguments); + }); + // 将新的dom树属性(事件等)patch到已存在的dom上 + const c = Widget._renderEngine.createElement; + DOM.patchProps(widget.element, c(c(container).children()[0])); + + const triggerLifeHook = (w) => { + w.beforeMount && w.beforeMount(); + w.mounted && w.mounted(); + each(w._children, (i, child) => { + triggerLifeHook(child); + }); + }; + // 最后触发组件树生命周期函数 + triggerLifeHook(widget); + + return res; + } + if (container) { + Widget._renderEngine.createElement(container).append(widget.element); + } + + return widget._mount(true, false, false, predicate); +} diff --git a/packages/fineui/src/core/5.inject.js b/packages/fineui/src/core/5.inject.js new file mode 100644 index 000000000..282ba270c --- /dev/null +++ b/packages/fineui/src/core/5.inject.js @@ -0,0 +1,528 @@ +import { isFunction, isNull, isNotNull, isArray, each, isWidget, extend, init, isEmpty, remove } from "./2.base"; +import { OB } from "./3.ob"; +import { Widget } from "./4.widget"; +import { Plugin } from "./6.plugin"; +import { aspect } from "./structure"; +import { Events } from "./constant"; +import { _global } from "./0.foundation"; +import { SystemProvider } from "./system"; + +const moduleInjection = {}, moduleInjectionMap = { + components: {}, + constants: {}, + stores: {}, + services: {}, + models: {}, + providers: {}, +}; + +export function module(xtype, cls) { + if (isNotNull(moduleInjection[xtype])) { + _global.console && console.error(`module: [${xtype}] 已经注册过了`); + } else { + if (isFunction(cls)) { + cls = cls(); + } + for (const k in moduleInjectionMap) { + if (cls[k]) { + for (const key in cls[k]) { + if (!moduleInjectionMap[k]) { + continue; + } + if (!moduleInjectionMap[k][key]) { + moduleInjectionMap[k][key] = []; + } + moduleInjectionMap[k][key].push({ + version: cls[k][key], + moduleId: xtype, + }); + } + } + } + moduleInjection[xtype] = cls; + } + + return () => Modules.getModule(xtype); +} + +const constantInjection = {}; +export function constant(xtype, cls) { + if (isNotNull(constantInjection[xtype])) { + _global.console && console.error(`constant: [${xtype}]已经注册过了`); + } else { + constantInjection[xtype] = cls; + } + + return () => Constants.getConstant(xtype); +} + +const modelInjection = {}; +export function model(xtype, cls) { + if (isNotNull(modelInjection[xtype])) { + _global.console && console.error(`model: [${xtype}] 已经注册过了`); + } else { + modelInjection[xtype] = cls; + } + + return config => Models.getModel(xtype, config); +} + +const storeInjection = {}; +export function store(xtype, cls) { + if (isNotNull(storeInjection[xtype])) { + _global.console && console.error(`store: [${xtype}] 已经注册过了`); + } else { + storeInjection[xtype] = cls; + } + + return config => Stores.getStore(xtype, config); +} + +const serviceInjection = {}; +export function service(xtype, cls) { + if ((serviceInjection[xtype])) { + _global.console && console.error(`service: [${xtype}] 已经注册过了`); + } + + serviceInjection[xtype] = cls; + + return config => Services.getService(xtype, config); +} + +const providerInjection = {}; +export function provider(xtype, cls) { + if ((providerInjection[xtype])) { + _global.console && console.error(`provider: [${xtype}] 已经注册过了`); + } else { + providerInjection[xtype] = cls; + } + + return config => Providers.getProvider(xtype, config); +} + +const configFunctions = OB.configFunctions = {}; +const runConfigFunction = (type, configFn) => { + if (!type || !configFunctions[type]) { + return false; + } + + let queue = []; + if (configFn) { + queue = configFunctions[type].filter(conf => conf.fn === configFn); + configFunctions[type] = configFunctions[type].filter(conf => conf.fn !== configFn); + } else { + queue = configFunctions[type]; + delete configFunctions[type]; + } + + const dependencies = Providers.getProvider(SystemProvider.xtype).getDependencies(); + const modules = moduleInjectionMap.components[type] + || moduleInjectionMap.constants[type] + || moduleInjectionMap.services[type] + || moduleInjectionMap.stores[type] + || moduleInjectionMap.models[type] + || moduleInjectionMap.providers[type]; + for (let i = 0; i < queue.length; i++) { + const conf = queue[i]; + const version = conf.opt.version; + const fn = conf.fn; + if (modules && version) { + let findVersion = false; + let module; + for (let j = 0; j < modules.length; j++) { + module = modules[j]; + if (module && dependencies[module.moduleId] && module.version === version) { + const minVersion = dependencies[module.moduleId].minVersion, + maxVersion = dependencies[module.moduleId].maxVersion; + if (minVersion && (moduleInjection[module.moduleId].version || version) < minVersion) { + findVersion = true; + break; + } + if (maxVersion && (moduleInjection[module.moduleId].version || version) > maxVersion) { + findVersion = true; + break; + } + } + } + if (findVersion === true) { + _global.console && console.error(`moduleId: [${module.moduleId}] 接口: [${type}] 接口版本: [${version}] 已过期,版本要求为:`, dependencies[module.moduleId], "=>", moduleInjection[module.moduleId]); + continue; + } + } + if (constantInjection[type]) { + constantInjection[type] = fn(constantInjection[type]); + continue; + } + if (providerInjection[type]) { + if (!providers[type]) { + providers[type] = new providerInjection[type](); + } + if (providerInstance[type]) { + delete providerInstance[type]; + } + fn(providers[type]); + continue; + } + Plugin.configWidget(type, fn, conf.opt); + } +}; + +export function config(type, configFn, opt) { + if (isFunction(type)) { + opt = configFn; + configFn = type; + type = SystemProvider.xtype; + } + opt = opt || {}; + + // 系统配置直接执行 + if (SystemProvider.xtype === type) { + if (!providers[type]) { + providers[type] = new providerInjection[type](); + } + // 如果config被重新配置的话,需要删除掉之前的实例 + if (providerInstance[type]) { + delete providerInstance[type]; + } + + return configFn(providers[type]); + } + + if (!configFunctions[type]) { + configFunctions[type] = []; + } + configFunctions[type].push({ + fn: configFn, + opt, + }); + + if (opt.immediately) { + return runConfigFunction(type, configFn); + } +} + +export function getReference(type, fn) { + return Plugin.registerObject(type, fn); +} + +const actions = {}; +const globalAction = []; +export function action(type, actionFn) { + if (isFunction(type)) { + globalAction.push(type); + + return () => { + remove(globalAction, idx => globalAction.indexOf(actionFn) === idx); + }; + } + if (!actions[type]) { + actions[type] = []; + } + actions[type].push(actionFn); + + return () => { + remove(actions[type], idx => actions[type].indexOf(actionFn) === idx); + if (actions[type].length === 0) { + delete actions[type]; + } + }; +} + +const points = {}; +export function point(type, action, pointFn, after) { + if (!points[type]) { + points[type] = {}; + } + if (!points[type][action]) { + points[type][action] = {}; + } + if (!points[type][action][after ? "after" : "before"]) { + points[type][action][after ? "after" : "before"] = []; + } + points[type][action][after ? "after" : "before"].push(pointFn); +} + +export const Modules = { + getModule (type) { + if (!moduleInjection[type]) { + _global.console && console.error(`module: [${type}] 未定义`); + } + + return moduleInjection[type]; + }, + getAllModules () { + return moduleInjection; + }, +}; + +export const Constants = { + getConstant (type) { + if (isNull(constantInjection[type])) { + _global.console && console.error(`constant: [${type}] 未定义`); + } + runConfigFunction(type); + + return isFunction(constantInjection[type]) ? constantInjection[type]() : constantInjection[type]; + }, +}; + +function callPoint(inst, types) { + types = isArray(types) ? types : [types]; + each(types, (idx, type) => { + if (points[type]) { + for (const action in points[type]) { + const bfns = points[type][action].before; + if (bfns) { + aspect.before(inst, action, (function (bfns) { + return function () { + for (let i = 0, len = bfns.length; i < len; i++) { + try { + bfns[i].apply(inst, arguments); + } catch (e) { + _global.console && console.error(e); + } + } + }; + }(bfns))); + } + const afns = points[type][action].after; + if (afns) { + aspect.after(inst, action, (function (afns) { + return function () { + for (let i = 0, len = afns.length; i < len; i++) { + try { + afns[i].apply(inst, arguments); + } catch (e) { + _global.console && console.error(e); + } + } + }; + }(afns))); + } + } + } + }); +} + +export const Models = { + getModel (type, config) { + if (!modelInjection[type]) { + _global.console && console.error(`model: [${type}] 未定义`); + } + runConfigFunction(type); + const inst = new modelInjection[type](config); + inst._constructor && inst._constructor(config); + inst.mixins && callPoint(inst, inst.mixins); + callPoint(inst, type); + + return inst; + }, +}; + +const stores = {}; +export const Stores = { + getStore (type, config) { + if (!storeInjection[type]) { + _global.console && console.error(`store: [${type}] 未定义`); + } + if (stores[type]) { + return stores[type]; + } + const inst = stores[type] = new storeInjection[type](config); + inst._constructor && inst._constructor(config, () => { + delete stores[type]; + }); + callPoint(inst, type); + + return inst; + }, +}; + +const services = {}; +export const Services = { + getService: (type, config) => { + if (!serviceInjection[type]) { + _global.console && console.error(`service: [${type}] 未定义`); + } + if (services[type]) { + return services[type]; + } + services[type] = new serviceInjection[type](config); + callPoint(services[type], type); + + return services[type]; + }, +}; + +const providers = {}, + providerInstance = {}; +export const Providers = { + getProvider: (type, config) => { + if (!providerInjection[type]) { + _global.console && console.error(`provider: [${type}] 未定义`); + } + runConfigFunction(type); + if (!providers[type]) { + providers[type] = new providerInjection[type](); + } + if (!providerInstance[type] && providers[type].$get) { + providerInstance[type] = new (providers[type].$get())(config); + } + + return providerInstance[type]; + }, +}; + +export const Actions = { + runAction (type, event, config) { + each(actions[type], (i, act) => { + try { + act(event, config); + } catch (e) { + _global.console && console.error(e); + } + }); + }, + runGlobalAction () { + const args = [].slice.call(arguments); + each(globalAction, (i, act) => { + try { + act(...args); + } catch (e) { + _global.console && console.error(e); + } + }); + }, +}; + +const kv = {}; +export function shortcut(xtype, cls) { + if (isNotNull(kv[xtype])) { + _global.console && console.error(`组件: [${xtype}] 已经注册过了`); + } + if (cls) { + cls.xtype = xtype; + } + kv[xtype] = cls; +} + +export const component = shortcut; + +// 根据配置属性生成widget +const createRealWidget = (config, context, lazy) => { + const Cls = isFunction(config.type) ? config.type : kv[config.type]; + + if (!Cls) { + throw new Error(`组件: [${config.type}] 未定义`); + } + let pushed = false; + const widget = new Cls(); + widget._context = Widget.context || context; + if (!Widget.context && context) { + pushed = true; + Widget.pushContext(context); + } + callPoint(widget, config.type); + widget._initProps(config); + widget._initRoot(); + widget._constructed(); + // if (!lazy || config.element || config.root) { + widget._lazyConstructor(); + // } + pushed && Widget.popContext(); + + return widget; +}; + +export function createWidget(item, options, context, lazy) { + item || (item = {}); + if (isWidget(options)) { + context = options; + options = {}; + } else { + options || (options = {}); + } + + let el, w; + if (item.type || options.type) { + el = extend({}, options, item); + } else if (item.el && (item.el.type || options.type)) { + el = extend({}, options, item.el); + } + let elType; + if (el) { + elType = (el.type && el.type.xtype) || el.type; + runConfigFunction(elType); + } + + // 先把准备环境准备好 + init(); + + if (isEmpty(item) && isEmpty(options)) { + return createWidget({ + type: "bi.layout", + }); + } + if (isWidget(item)) { + return item; + } + if (el) { + w = Plugin.getWidget(elType, el); + const wType = (w.type && w.type.xtype) || w.type; + if (wType === elType) { + if (Plugin.hasObject(elType)) { + if (!w.listeners || isArray(w.listeners)) { + w.listeners = (w.listeners || []).concat([{ + eventName: Events.MOUNT, + action: () => { + Plugin.getObject(elType, this); + }, + }]); + } else { + w.listeners[Events.MOUNT] = [ + () => { + Plugin.getObject(elType, this); + } + ].concat(w.listeners[Events.MOUNT] || []); + } + } + + return createRealWidget(w, context, lazy); + } + + return createWidget(w, options, context, lazy); + } + if (isWidget(item.el)) { + return item.el; + } + throw new Error("组件:无法根据item创建组件", item); +} + +export function _lazyCreateWidget (item, options, context) { + return createWidget(item, options, context, true); +} + +export function createElement() { + const widget = createWidget.apply(this, arguments); + + return widget.element; +} + +export function getResource(type, config) { + if (isNotNull(constantInjection[type])) { + return Constants.getConstant(type); + } + if (modelInjection[type]) { + return Models.getModel(type, config); + } + if (storeInjection[type]) { + return Stores.getStore(type, config); + } + if (serviceInjection[type]) { + return Services.getService(type, config); + } + if (providerInjection[type]) { + return Providers.getProvider(type, config); + } + throw new Error(`未知类型: [${type}] 未定义`); +} diff --git a/src/core/6.plugin.js b/packages/fineui/src/core/6.plugin.js similarity index 100% rename from src/core/6.plugin.js rename to packages/fineui/src/core/6.plugin.js diff --git a/src/core/__test__/alias.test.js b/packages/fineui/src/core/__test__/alias.test.js similarity index 100% rename from src/core/__test__/alias.test.js rename to packages/fineui/src/core/__test__/alias.test.js diff --git a/src/core/__test__/base.test.js b/packages/fineui/src/core/__test__/base.test.js similarity index 100% rename from src/core/__test__/base.test.js rename to packages/fineui/src/core/__test__/base.test.js diff --git a/src/core/__test__/context.test.js b/packages/fineui/src/core/__test__/context.test.js similarity index 100% rename from src/core/__test__/context.test.js rename to packages/fineui/src/core/__test__/context.test.js diff --git a/src/core/__test__/widget.test.js b/packages/fineui/src/core/__test__/widget.test.js similarity index 100% rename from src/core/__test__/widget.test.js rename to packages/fineui/src/core/__test__/widget.test.js diff --git a/src/core/action/action.js b/packages/fineui/src/core/action/action.js similarity index 100% rename from src/core/action/action.js rename to packages/fineui/src/core/action/action.js diff --git a/src/core/action/action.show.js b/packages/fineui/src/core/action/action.show.js similarity index 100% rename from src/core/action/action.show.js rename to packages/fineui/src/core/action/action.show.js diff --git a/src/core/action/index.js b/packages/fineui/src/core/action/index.js similarity index 100% rename from src/core/action/index.js rename to packages/fineui/src/core/action/index.js diff --git a/src/core/behavior/0.behavior.js b/packages/fineui/src/core/behavior/0.behavior.js similarity index 100% rename from src/core/behavior/0.behavior.js rename to packages/fineui/src/core/behavior/0.behavior.js diff --git a/src/core/behavior/behavior.highlight.js b/packages/fineui/src/core/behavior/behavior.highlight.js similarity index 100% rename from src/core/behavior/behavior.highlight.js rename to packages/fineui/src/core/behavior/behavior.highlight.js diff --git a/src/core/behavior/behavior.redmark.js b/packages/fineui/src/core/behavior/behavior.redmark.js similarity index 100% rename from src/core/behavior/behavior.redmark.js rename to packages/fineui/src/core/behavior/behavior.redmark.js diff --git a/src/core/behavior/index.js b/packages/fineui/src/core/behavior/index.js similarity index 100% rename from src/core/behavior/index.js rename to packages/fineui/src/core/behavior/index.js diff --git a/src/core/constant/events.js b/packages/fineui/src/core/constant/events.js similarity index 100% rename from src/core/constant/events.js rename to packages/fineui/src/core/constant/events.js diff --git a/src/core/constant/index.js b/packages/fineui/src/core/constant/index.js similarity index 100% rename from src/core/constant/index.js rename to packages/fineui/src/core/constant/index.js diff --git a/src/core/constant/var.js b/packages/fineui/src/core/constant/var.js similarity index 100% rename from src/core/constant/var.js rename to packages/fineui/src/core/constant/var.js diff --git a/src/core/controller/0.controller.js b/packages/fineui/src/core/controller/0.controller.js similarity index 100% rename from src/core/controller/0.controller.js rename to packages/fineui/src/core/controller/0.controller.js diff --git a/src/core/controller/controller.broadcast.js b/packages/fineui/src/core/controller/controller.broadcast.js similarity index 100% rename from src/core/controller/controller.broadcast.js rename to packages/fineui/src/core/controller/controller.broadcast.js diff --git a/src/core/controller/controller.bubbles.js b/packages/fineui/src/core/controller/controller.bubbles.js similarity index 100% rename from src/core/controller/controller.bubbles.js rename to packages/fineui/src/core/controller/controller.bubbles.js diff --git a/src/core/controller/controller.drawer.js b/packages/fineui/src/core/controller/controller.drawer.js similarity index 100% rename from src/core/controller/controller.drawer.js rename to packages/fineui/src/core/controller/controller.drawer.js diff --git a/packages/fineui/src/core/controller/controller.layer.js b/packages/fineui/src/core/controller/controller.layer.js new file mode 100644 index 000000000..7364a3ee2 --- /dev/null +++ b/packages/fineui/src/core/controller/controller.layer.js @@ -0,0 +1,201 @@ +/** + * 弹出层面板控制器, z-index在10w层级 + * + * Created by GUY on 2015/6/24. + */ +import { Controller } from "./0.controller"; +import { isNull, isNotNull, each, keys, isWidget, isNotEmptyString, extend, bind, uniqueId } from "../2.base"; +import { Widget } from "../4.widget"; +import { createWidget } from "../5.inject"; +import { zIndex_layer } from "../constant"; +import { DOM } from "../utils"; +// import { Resizers } from "../../base/0.base"; + +export class LayerController extends Controller { + constructor() { + super(); + this._constructor(); + } + + props = { + render: "body", + } + + init() { + this.layerManager = {}; + this.layouts = {}; + this.zindex = zIndex_layer; + } + + _initResizer() { + // this.resizer = Resizers.add(`layerController${uniqueId()}`, bind(this._resize, this)); + } + + _resize() { + each(this.layouts, (i, layer) => { + if (layer.element.is(":visible")) { + layer.element.trigger("__resize__"); + } + }); + } + + make(name, container, op, context) { + if (isWidget(container)) { + op = op || {}; + op.container = container; + } else { + context = op; + op = container; + } + + return this.create(name, null, op, context); + } + + create(name, from, op, context) { + isNull(this.resizer) && this._initResizer(); + if (this.has(name)) { + return this.get(name); + } + op || (op = {}); + const offset = op.offset || {}; + let w = from; + if (isWidget(from)) { + w = from.element; + } + if (isNotEmptyString(w)) { + w = Widget._renderEngine.createElement(w); + } + if (this.has(name)) { + return this.get(name); + } + const widget = createWidget((op.render || {}), extend({ + type: "bi.layout", + }, op), context); + const layout = createWidget({ + type: "bi.absolute", + invisible: true, + items: [ + { + el: widget, + left: 0, + right: 0, + top: 0, + bottom: 0, + } + ], + }, context); + createWidget({ + type: "bi.absolute", + element: op.container || this.options.render, + items: [ + { + el: layout, + left: offset.left || 0, + right: offset.right || 0, + top: offset.top || 0, + bottom: offset.bottom || 0, + } + ], + }); + if (w) { + layout.element.addClass("bi-popup-view"); + + function getComputedPosition() { + const css = { + left: w.offset().left + (offset.left || 0), + top: w.offset().top + (offset.top || 0), + width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "", + height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || "", + }; + + const { top, left, scaleY, scaleX } = DOM.getPositionRelativeContainingBlockRect(layout.element[0]); + + css.top = (css.top - top) / scaleY; + css.left = (css.left - left) / scaleX; + + return css; + } + + + layout.element.css(getComputedPosition()); + layout.element.on("__resize__", () => { + w.is(":visible") && + layout.element.css(getComputedPosition()); + }); + } + this.add(name, widget, layout); + + return widget; + } + + show(name, callback) { + if (!this.has(name)) { + return this; + } + this._getLayout(name).visible(); + this._getLayout(name).element.css("z-index", this.zindex++).show(0, callback).trigger("__resize__"); + + return this; + } + + hide(name, callback) { + if (!this.has(name)) { + return this; + } + this._getLayout(name).invisible(); + this._getLayout(name).element.hide(0, callback); + + return this; + } + + isVisible(name) { + return this.has(name) && this._getLayout(name).isVisible(); + } + + add(name, layer, layout) { + if (this.has(name)) { + throw new Error("不能创建同名的Layer"); + } + layout.setVisible(false); + this.layerManager[name] = layer; + this.layouts[name] = layout; + layout.element.css("z-index", this.zindex++); + + return this; + } + + _getLayout(name) { + return this.layouts[name]; + } + + get(name) { + return this.layerManager[name]; + } + + has(name) { + return isNotNull(this.layerManager[name]); + } + + remove(name) { + if (!this.has(name)) { + return this; + } + this.layerManager[name].destroy(); + this.layouts[name].destroy(); + delete this.layerManager[name]; + delete this.layouts[name]; + + return this; + } + + removeAll() { + each(keys(this.layerManager), (index, name) => { + this.layerManager[name].destroy(); + this.layouts[name].destroy(); + }); + this.layerManager = {}; + this.layouts = {}; + + return this; + } +} diff --git a/src/core/controller/controller.masker.js b/packages/fineui/src/core/controller/controller.masker.js similarity index 100% rename from src/core/controller/controller.masker.js rename to packages/fineui/src/core/controller/controller.masker.js diff --git a/src/core/controller/controller.popover.js b/packages/fineui/src/core/controller/controller.popover.js similarity index 100% rename from src/core/controller/controller.popover.js rename to packages/fineui/src/core/controller/controller.popover.js diff --git a/src/core/controller/controller.resizer.js b/packages/fineui/src/core/controller/controller.resizer.js similarity index 100% rename from src/core/controller/controller.resizer.js rename to packages/fineui/src/core/controller/controller.resizer.js diff --git a/src/core/controller/controller.tooltips.js b/packages/fineui/src/core/controller/controller.tooltips.js similarity index 100% rename from src/core/controller/controller.tooltips.js rename to packages/fineui/src/core/controller/controller.tooltips.js diff --git a/src/core/controller/index.js b/packages/fineui/src/core/controller/index.js similarity index 100% rename from src/core/controller/index.js rename to packages/fineui/src/core/controller/index.js diff --git a/src/core/controller/popper.js b/packages/fineui/src/core/controller/popper.js similarity index 100% rename from src/core/controller/popper.js rename to packages/fineui/src/core/controller/popper.js diff --git a/src/core/decorator.js b/packages/fineui/src/core/decorator.js similarity index 100% rename from src/core/decorator.js rename to packages/fineui/src/core/decorator.js diff --git a/src/core/element/element.js b/packages/fineui/src/core/element/element.js similarity index 100% rename from src/core/element/element.js rename to packages/fineui/src/core/element/element.js diff --git a/src/core/element/index.js b/packages/fineui/src/core/element/index.js similarity index 100% rename from src/core/element/index.js rename to packages/fineui/src/core/element/index.js diff --git a/src/core/element/plugins/attr.js b/packages/fineui/src/core/element/plugins/attr.js similarity index 100% rename from src/core/element/plugins/attr.js rename to packages/fineui/src/core/element/plugins/attr.js diff --git a/src/core/element/plugins/class.js b/packages/fineui/src/core/element/plugins/class.js similarity index 100% rename from src/core/element/plugins/class.js rename to packages/fineui/src/core/element/plugins/class.js diff --git a/src/core/element/plugins/css.js b/packages/fineui/src/core/element/plugins/css.js similarity index 100% rename from src/core/element/plugins/css.js rename to packages/fineui/src/core/element/plugins/css.js diff --git a/src/core/element/plugins/data.js b/packages/fineui/src/core/element/plugins/data.js similarity index 100% rename from src/core/element/plugins/data.js rename to packages/fineui/src/core/element/plugins/data.js diff --git a/src/core/element/plugins/empty.js b/packages/fineui/src/core/element/plugins/empty.js similarity index 100% rename from src/core/element/plugins/empty.js rename to packages/fineui/src/core/element/plugins/empty.js diff --git a/src/core/element/plugins/event.js b/packages/fineui/src/core/element/plugins/event.js similarity index 100% rename from src/core/element/plugins/event.js rename to packages/fineui/src/core/element/plugins/event.js diff --git a/src/core/element/plugins/html.js b/packages/fineui/src/core/element/plugins/html.js similarity index 100% rename from src/core/element/plugins/html.js rename to packages/fineui/src/core/element/plugins/html.js diff --git a/src/core/element/plugins/index.js b/packages/fineui/src/core/element/plugins/index.js similarity index 100% rename from src/core/element/plugins/index.js rename to packages/fineui/src/core/element/plugins/index.js diff --git a/src/core/element/plugins/keywordMark.js b/packages/fineui/src/core/element/plugins/keywordMark.js similarity index 100% rename from src/core/element/plugins/keywordMark.js rename to packages/fineui/src/core/element/plugins/keywordMark.js diff --git a/src/core/element/plugins/renderToHtml.js b/packages/fineui/src/core/element/plugins/renderToHtml.js similarity index 100% rename from src/core/element/plugins/renderToHtml.js rename to packages/fineui/src/core/element/plugins/renderToHtml.js diff --git a/src/core/element/plugins/renderToString.js b/packages/fineui/src/core/element/plugins/renderToString.js similarity index 100% rename from src/core/element/plugins/renderToString.js rename to packages/fineui/src/core/element/plugins/renderToString.js diff --git a/src/core/element/plugins/text.js b/packages/fineui/src/core/element/plugins/text.js similarity index 100% rename from src/core/element/plugins/text.js rename to packages/fineui/src/core/element/plugins/text.js diff --git a/src/core/element/plugins/val.js b/packages/fineui/src/core/element/plugins/val.js similarity index 100% rename from src/core/element/plugins/val.js rename to packages/fineui/src/core/element/plugins/val.js diff --git a/src/core/func/__test__/date.test.js b/packages/fineui/src/core/func/__test__/date.test.js similarity index 100% rename from src/core/func/__test__/date.test.js rename to packages/fineui/src/core/func/__test__/date.test.js diff --git a/src/core/func/__test__/function.test.js b/packages/fineui/src/core/func/__test__/function.test.js similarity index 100% rename from src/core/func/__test__/function.test.js rename to packages/fineui/src/core/func/__test__/function.test.js diff --git a/src/core/func/__test__/string.test.js b/packages/fineui/src/core/func/__test__/string.test.js similarity index 100% rename from src/core/func/__test__/string.test.js rename to packages/fineui/src/core/func/__test__/string.test.js diff --git a/src/core/func/alias.js b/packages/fineui/src/core/func/alias.js similarity index 100% rename from src/core/func/alias.js rename to packages/fineui/src/core/func/alias.js diff --git a/src/core/func/array.js b/packages/fineui/src/core/func/array.js similarity index 100% rename from src/core/func/array.js rename to packages/fineui/src/core/func/array.js diff --git a/src/core/func/date.js b/packages/fineui/src/core/func/date.js similarity index 100% rename from src/core/func/date.js rename to packages/fineui/src/core/func/date.js diff --git a/src/core/func/function.js b/packages/fineui/src/core/func/function.js similarity index 100% rename from src/core/func/function.js rename to packages/fineui/src/core/func/function.js diff --git a/src/core/func/index.js b/packages/fineui/src/core/func/index.js similarity index 100% rename from src/core/func/index.js rename to packages/fineui/src/core/func/index.js diff --git a/src/core/func/number.js b/packages/fineui/src/core/func/number.js similarity index 100% rename from src/core/func/number.js rename to packages/fineui/src/core/func/number.js diff --git a/src/core/func/string.js b/packages/fineui/src/core/func/string.js similarity index 100% rename from src/core/func/string.js rename to packages/fineui/src/core/func/string.js diff --git a/src/core/h.js b/packages/fineui/src/core/h.js similarity index 100% rename from src/core/h.js rename to packages/fineui/src/core/h.js diff --git a/packages/fineui/src/core/index.js b/packages/fineui/src/core/index.js new file mode 100644 index 000000000..b754913f6 --- /dev/null +++ b/packages/fineui/src/core/index.js @@ -0,0 +1,41 @@ +export * from './system'; +export { Plugin } from './6.plugin'; +export { StyleLoaderManager } from './loader/loader.style'; +export { ShowListener } from './listener/listener.show'; +export { useInWorker } from './worker'; +export { Element } from './element'; + +export { Controller } from './controller/0.controller'; +export { BroadcastController } from './controller/controller.broadcast'; +export { BubblesController } from './controller/controller.bubbles'; +export { DrawerController } from './controller/controller.drawer'; +export { LayerController } from './controller/controller.layer'; +export { MaskersController } from './controller/controller.masker'; +export { PopoverController } from './controller/controller.popover'; +export { ResizeController } from './controller/controller.resizer'; +export { TooltipsController } from './controller/controller.tooltips'; + +export * from './4.widget'; +export * from './2.base'; +export * from './3.ob'; + +export * from './5.inject'; +export * from './6.plugin'; + +export * from './action'; +// export * from "./behavior"; +// export * from "./controller"; +export * from './func'; +export * from './structure'; +export * from './h'; +export * from './constant'; +export * from './logic'; +export * from './wrapper'; +export * from './platform/web'; +export * from './utils'; + +export { shortcut, provider, store, model, mixin, mixins } from './decorator'; + +import _ from './1.lodash'; + +export { _ }; diff --git a/src/core/listener/listener.show.js b/packages/fineui/src/core/listener/listener.show.js similarity index 100% rename from src/core/listener/listener.show.js rename to packages/fineui/src/core/listener/listener.show.js diff --git a/src/core/loader/loader.style.js b/packages/fineui/src/core/loader/loader.style.js similarity index 100% rename from src/core/loader/loader.style.js rename to packages/fineui/src/core/loader/loader.style.js diff --git a/src/core/logic/index.js b/packages/fineui/src/core/logic/index.js similarity index 100% rename from src/core/logic/index.js rename to packages/fineui/src/core/logic/index.js diff --git a/src/core/logic/logic.js b/packages/fineui/src/core/logic/logic.js similarity index 100% rename from src/core/logic/logic.js rename to packages/fineui/src/core/logic/logic.js diff --git a/src/core/logic/logic.layout.js b/packages/fineui/src/core/logic/logic.layout.js similarity index 100% rename from src/core/logic/logic.layout.js rename to packages/fineui/src/core/logic/logic.layout.js diff --git a/src/core/platform/index.js b/packages/fineui/src/core/platform/index.js similarity index 100% rename from src/core/platform/index.js rename to packages/fineui/src/core/platform/index.js diff --git a/src/core/platform/web/config.js b/packages/fineui/src/core/platform/web/config.js similarity index 100% rename from src/core/platform/web/config.js rename to packages/fineui/src/core/platform/web/config.js diff --git a/src/core/platform/web/detectElementResize.js b/packages/fineui/src/core/platform/web/detectElementResize.js similarity index 100% rename from src/core/platform/web/detectElementResize.js rename to packages/fineui/src/core/platform/web/detectElementResize.js diff --git a/src/core/platform/web/function.js b/packages/fineui/src/core/platform/web/function.js similarity index 100% rename from src/core/platform/web/function.js rename to packages/fineui/src/core/platform/web/function.js diff --git a/src/core/platform/web/index.js b/packages/fineui/src/core/platform/web/index.js similarity index 100% rename from src/core/platform/web/index.js rename to packages/fineui/src/core/platform/web/index.js diff --git a/src/core/platform/web/jquery/__test__/fn.test.js b/packages/fineui/src/core/platform/web/jquery/__test__/fn.test.js similarity index 100% rename from src/core/platform/web/jquery/__test__/fn.test.js rename to packages/fineui/src/core/platform/web/jquery/__test__/fn.test.js diff --git a/src/core/platform/web/jquery/_jquery.js b/packages/fineui/src/core/platform/web/jquery/_jquery.js similarity index 100% rename from src/core/platform/web/jquery/_jquery.js rename to packages/fineui/src/core/platform/web/jquery/_jquery.js diff --git a/src/core/platform/web/jquery/event.js b/packages/fineui/src/core/platform/web/jquery/event.js similarity index 100% rename from src/core/platform/web/jquery/event.js rename to packages/fineui/src/core/platform/web/jquery/event.js diff --git a/src/core/platform/web/jquery/fn.js b/packages/fineui/src/core/platform/web/jquery/fn.js similarity index 100% rename from src/core/platform/web/jquery/fn.js rename to packages/fineui/src/core/platform/web/jquery/fn.js diff --git a/src/core/platform/web/jquery/index.js b/packages/fineui/src/core/platform/web/jquery/index.js similarity index 100% rename from src/core/platform/web/jquery/index.js rename to packages/fineui/src/core/platform/web/jquery/index.js diff --git a/src/core/platform/web/jquery/jquery.mousewheel.js b/packages/fineui/src/core/platform/web/jquery/jquery.mousewheel.js similarity index 100% rename from src/core/platform/web/jquery/jquery.mousewheel.js rename to packages/fineui/src/core/platform/web/jquery/jquery.mousewheel.js diff --git a/src/core/platform/web/load.js b/packages/fineui/src/core/platform/web/load.js similarity index 100% rename from src/core/platform/web/load.js rename to packages/fineui/src/core/platform/web/load.js diff --git a/src/core/structure/aes.js b/packages/fineui/src/core/structure/aes.js similarity index 100% rename from src/core/structure/aes.js rename to packages/fineui/src/core/structure/aes.js diff --git a/src/core/structure/aspect.js b/packages/fineui/src/core/structure/aspect.js similarity index 100% rename from src/core/structure/aspect.js rename to packages/fineui/src/core/structure/aspect.js diff --git a/src/core/structure/base64.js b/packages/fineui/src/core/structure/base64.js similarity index 100% rename from src/core/structure/base64.js rename to packages/fineui/src/core/structure/base64.js diff --git a/src/core/structure/cache.js b/packages/fineui/src/core/structure/cache.js similarity index 100% rename from src/core/structure/cache.js rename to packages/fineui/src/core/structure/cache.js diff --git a/src/core/structure/cellSizeAndPositionManager.js b/packages/fineui/src/core/structure/cellSizeAndPositionManager.js similarity index 100% rename from src/core/structure/cellSizeAndPositionManager.js rename to packages/fineui/src/core/structure/cellSizeAndPositionManager.js diff --git a/src/core/structure/heap.js b/packages/fineui/src/core/structure/heap.js similarity index 100% rename from src/core/structure/heap.js rename to packages/fineui/src/core/structure/heap.js diff --git a/src/core/structure/index.js b/packages/fineui/src/core/structure/index.js similarity index 100% rename from src/core/structure/index.js rename to packages/fineui/src/core/structure/index.js diff --git a/src/core/structure/linkedHashMap.js b/packages/fineui/src/core/structure/linkedHashMap.js similarity index 100% rename from src/core/structure/linkedHashMap.js rename to packages/fineui/src/core/structure/linkedHashMap.js diff --git a/src/core/structure/lru.js b/packages/fineui/src/core/structure/lru.js similarity index 100% rename from src/core/structure/lru.js rename to packages/fineui/src/core/structure/lru.js diff --git a/src/core/structure/prefixIntervalTree.js b/packages/fineui/src/core/structure/prefixIntervalTree.js similarity index 100% rename from src/core/structure/prefixIntervalTree.js rename to packages/fineui/src/core/structure/prefixIntervalTree.js diff --git a/src/core/structure/queue.js b/packages/fineui/src/core/structure/queue.js similarity index 100% rename from src/core/structure/queue.js rename to packages/fineui/src/core/structure/queue.js diff --git a/src/core/structure/sectionManager.js b/packages/fineui/src/core/structure/sectionManager.js similarity index 100% rename from src/core/structure/sectionManager.js rename to packages/fineui/src/core/structure/sectionManager.js diff --git a/src/core/structure/tree.js b/packages/fineui/src/core/structure/tree.js similarity index 100% rename from src/core/structure/tree.js rename to packages/fineui/src/core/structure/tree.js diff --git a/src/core/structure/vector.js b/packages/fineui/src/core/structure/vector.js similarity index 100% rename from src/core/structure/vector.js rename to packages/fineui/src/core/structure/vector.js diff --git a/packages/fineui/src/core/system.js b/packages/fineui/src/core/system.js new file mode 100644 index 000000000..e4c316633 --- /dev/null +++ b/packages/fineui/src/core/system.js @@ -0,0 +1,154 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2021/6/30 + */ +import { prepares } from "./0.foundation"; +import { deepExtend, extend } from "./2.base"; +import { OB } from "./3.ob"; +import { Providers } from "./5.inject"; +import { provider } from "./decorator"; +import { isIE as checkIE } from "./platform/web"; + +// 系统参数常量 +const system = { + dependencies: {}, + layoutOptimize: false, + responsiveMode: false, + workerMode: false, + size: { + // 尺寸 + // 通用尺寸 + TOOL_BAR_HEIGHT: 24, + LIST_ITEM_HEIGHT: 24, + TRIGGER_HEIGHT: 24, + TOAST_TOP: 10, + H_GAP_SIZE: "M", + V_GAP_SIZE: "S", + }, + loadingCreator(config) { + const loadingSize = (config ? config.loadingSize : "small") || "small"; + + const isIE = checkIE(); + + function getSize(v) { + return Math.ceil(v / (loadingSize === "small" ? 2 : 1)); + } + + return { + type: "bi.horizontal", + cls: `bi-loading-widget${isIE ? " wave-loading hack" : ""}`, + height: getSize(60), + width: getSize(60), + hgap: getSize(10), + vgap: 2.5, + items: isIE ? [] : [{ + type: "bi.layout", + cls: "animate-rect rect1", + height: getSize(50), + width: getSize(5), + }, { + type: "bi.layout", + cls: "animate-rect rect2", + height: getSize(50), + width: getSize(5), + }, { + type: "bi.layout", + cls: "animate-rect rect3", + height: getSize(50), + width: getSize(5), + }], + }; + }, +}; + +// 具体尺寸还没定,先写着 +const sizeMap = { + S: 10, + M: 20, + L: 24, +}; + +class SystemProviderOB extends OB { + getSize () { + const size = system.size; + const H_GAP_SIZE = sizeMap[size.H_GAP_SIZE]; + const V_GAP_SIZE = sizeMap[size.V_GAP_SIZE]; + + return extend({}, size, { + H_GAP_SIZE, + V_GAP_SIZE, + }); + } + + getResponsiveMode () { + return system.responsiveMode; + } + + getWorkerMode () { + return system.workerMode; + } + + getLayoutOptimize () { + return system.layoutOptimize; + } + + getDependencies () { + return system.dependencies; + } + + getLoading(config) { + return system.loadingCreator(config); + } +} + +@provider() +export class SystemProvider { + static xtype = "bi.provider.system"; + + SYSTEM = system; + + setSize(opt) { + deepExtend(system, { size: opt }); + } + + setResponsiveMode(mode) { + system.responsiveMode = !!mode; + } + + setWorkerMode(mode) { + system.workerMode = !!mode; + } + + setLayoutOptimize(layoutOptimize) { + system.layoutOptimize = layoutOptimize; + } + + addDependency(moduleId, minVersion, maxVersion) { + system.dependencies[moduleId] = { + min: minVersion, + max: maxVersion, + }; + } + + addDependencies(moduleConfig) { + extend(system.dependencies, moduleConfig); + } + + setLoadingCreator = function(creator) { + system.loadingCreator = creator; + }; + + $get() { + return SystemProviderOB; + } +} + +export const SIZE_CONSANTS = {}; +// 不再增加线型的配置了,之后不维护前置版本直接删掉,都用实线连接线 +export const STYLE_CONSTANTS = {}; + +prepares.push(() => { + extend(SIZE_CONSANTS, Providers.getProvider(SystemProvider.xtype).getSize()); + STYLE_CONSTANTS.LINK_LINE_TYPE = SIZE_CONSANTS.LIST_ITEM_HEIGHT === 24 ? "dashed" : "solid"; +}); diff --git a/src/core/utils/__test__/aes.test.js b/packages/fineui/src/core/utils/__test__/aes.test.js similarity index 100% rename from src/core/utils/__test__/aes.test.js rename to packages/fineui/src/core/utils/__test__/aes.test.js diff --git a/src/core/utils/chinesePY.js b/packages/fineui/src/core/utils/chinesePY.js similarity index 100% rename from src/core/utils/chinesePY.js rename to packages/fineui/src/core/utils/chinesePY.js diff --git a/src/core/utils/color.js b/packages/fineui/src/core/utils/color.js similarity index 100% rename from src/core/utils/color.js rename to packages/fineui/src/core/utils/color.js diff --git a/packages/fineui/src/core/utils/dom.js b/packages/fineui/src/core/utils/dom.js new file mode 100644 index 000000000..2b8fb0790 --- /dev/null +++ b/packages/fineui/src/core/utils/dom.js @@ -0,0 +1,788 @@ +/** + * 对DOM操作的通用函数 + */ +import { Widget } from "../4.widget" +import { each, isEmpty, isNull } from "../2.base"; +import $ from "jquery"; + +export function ready(fn) { + Widget._renderEngine.createElement(document).ready(fn); +} + +export function patchProps(fromElement, toElement) { + const elemData = $._data(fromElement[0]); + const events = elemData.events; + each(events, (eventKey, event) => { + each(event, (i, handler) => { + toElement.on(eventKey + (handler.namespace ? (`.${handler.namespace}`) : ""), handler); + }); + }); + const fromChildren = fromElement.children(), toChildren = toElement.children(); + if (fromChildren.length !== toChildren.length) { + throw new Error("不匹配"); + } + each(fromChildren, (i, child) => { + patchProps($(child), $(toChildren[i])); + }); + each(fromElement.data("__widgets"), (i, widget) => { + widget.element = toElement; + }); +} + +/** + * 把dom数组或元素悬挂起来,使其不对html产生影响 + * @param dom + */ +export function hang(doms) { + if (isEmpty(doms)) { + return; + } + const frag = Widget._renderEngine.createFragment(); + each(doms, (i, dom) => { + dom instanceof Widget && (dom = dom.element); + dom instanceof $ && dom[0] && frag.appendChild(dom[0]); + }); + + return frag; +} + +export function isExist(obj) { + return Widget._renderEngine.createElement("body").find(obj.element).length > 0; +} + +// 预加载图片 +export function preloadImages(srcArray, onload) { + let count = 0; + const images = []; + + function complete() { + count++; + if (count >= srcArray.length) { + onload(); + } + } + + each(srcArray, (i, src) => { + images[i] = new Image(); + images[i].src = src; + images[i].onload = function () { + complete(); + }; + images[i].onerror = function () { + complete(); + }; + }); +} + +export function getTextSizeWidth(text, fontSize = 12) { + const span = Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body"); + + fontSize = `${fontSize}px`; + + span.css("font-size", fontSize).text(text); + + const width = span.width(); + span.remove(); + + return width; +} + +export function getTextSizeHeight(text, fontSize = 12) { + const span = Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body"); + + fontSize = `${fontSize}px`; + + span.css("font-size", fontSize).text(text); + + const height = span.height(); + span.remove(); + + return height; +} + +// 获取滚动条的宽度,页面display: none时候获取到的为0 +let _scrollWidth = null; + +export function getScrollWidth() { + if (isNull(_scrollWidth) || _scrollWidth === 0) { + const ul = Widget._renderEngine.createElement("
").width(50).height(50) + .css({ + position: "absolute", + top: "-9999px", + overflow: "scroll", + }) + .appendTo("body"); + _scrollWidth = ul[0].offsetWidth - ul[0].clientWidth; + ul.destroy(); + } + + return _scrollWidth; +} + +export function getImage(param, fillStyle, backgroundColor) { + const canvas = document.createElement("canvas"); + const ratio = 2; + Widget._renderEngine.createElement("body").append(canvas); + + const ctx = canvas.getContext("2d"); + ctx.font = "12px Helvetica Neue,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Heiti,黑体,sans-serif"; + const w = ctx.measureText(param).width + 4; + canvas.width = w * ratio; + canvas.height = 16 * ratio; + ctx.font = `${12 * ratio}px Helvetica Neue,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Heiti,黑体,sans-serif`; + ctx.fillStyle = fillStyle || "#3685f2"; + ctx.textBaseline = "middle"; + // ctx.fillStyle = "#EAF2FD"; + ctx.fillText(param, 2 * ratio, 9 * ratio); + Widget._renderEngine.createElement(canvas).destroy(); + const backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; + + // IE可以放大缩小所以要固定最大最小宽高 + return { + width: w, + height: 16, + src: canvas.toDataURL("image/png"), + style: `background-color: ${backColor};vertical-align: middle; margin: 0 1px; width:${w}px;height: 16px; max-width:${w}px;max-height: 16px; min-width:${w}px;min-height: 16px`, + param, + }; +} + +export function getLeftPosition(combo, popup, extraWidth, container) { + const el = combo.element; + const popupEl = popup.element; + const elRect = el[0].getBoundingClientRect(); + const popupElRect = popupEl[0].getBoundingClientRect(); + const containerRect = container ? container.getBoundingClientRect() : { left: 0 }; + + return { + left: elRect.left - containerRect.left - popupElRect.width - (extraWidth || 0), + }; +} + +export function getInnerLeftPosition(combo, popup, extraWidth) { + return { + left: combo.element.offset().left + (extraWidth || 0), + }; +} + +export function getRightPosition(combo, popup, extraWidth, container) { + const el = combo.element; + const elRect = el[0].getBoundingClientRect(); + const containerRect = container ? container.getBoundingClientRect() : { left: 0 }; + + return { + left: elRect.left + elRect.width - containerRect.left + (extraWidth || 0), + }; +} + +export function getInnerRightPosition(combo, popup, extraWidth) { + const el = combo.element, viewBounds = popup.element.bounds(); + + return { + left: el.offset().left + el.outerWidth() - viewBounds.width - (extraWidth || 0), + }; +} + +export function getTopPosition(combo, popup, extraHeight, container) { + const el = combo.element; + const popupEl = popup.element; + const elRect = el[0].getBoundingClientRect(); + const popupElRect = popupEl[0].getBoundingClientRect(); + const containerRect = container ? container.getBoundingClientRect() : { top: 0 }; + + return { + top: elRect.top - containerRect.top - popupElRect.height - (extraHeight || 0), + }; +} + +export function getBottomPosition(combo, popup, extraHeight, container) { + const el = combo.element; + const elRect = el[0].getBoundingClientRect(); + const containerRect = container ? container.getBoundingClientRect() : { top: 0 }; + + return { + top: elRect.top - containerRect.top + elRect.height + (extraHeight || 0), + }; +} + +export function isLeftSpaceEnough(combo, popup, extraWidth) { + return getLeftPosition(combo, popup, extraWidth).left >= 0; +} + +export function isInnerLeftSpaceEnough(combo, popup, extraWidth) { + const viewBounds = popup.element.bounds(), + windowBounds = Widget._renderEngine.createElement("body").bounds(); + + return getInnerLeftPosition(combo, popup, extraWidth).left + viewBounds.width <= windowBounds.width; +} + +export function isRightSpaceEnough(combo, popup, extraWidth) { + const viewBounds = popup.element[0].getBoundingClientRect(), + viewportBounds = document.documentElement.getBoundingClientRect(); + + return getRightPosition(combo, popup, extraWidth).left + viewBounds.width <= viewportBounds.width; +} + +export function isInnerRightSpaceEnough(combo, popup, extraWidth) { + return getInnerRightPosition(combo, popup, extraWidth).left >= 0; +} + +export function isTopSpaceEnough(combo, popup, extraHeight) { + return getTopPosition(combo, popup, extraHeight).top >= 0; +} + +export function isBottomSpaceEnough(combo, popup, extraHeight) { + const viewBounds = popup.element[0].getBoundingClientRect(), + viewportBounds = document.documentElement.getBoundingClientRect(); + + return getBottomPosition(combo, popup, extraHeight).top + viewBounds.height <= viewportBounds.height; +} + +export function isRightSpaceLarger(combo) { + const comboBounds = combo.element[0].getBoundingClientRect(), + viewportBounds = document.documentElement.getBoundingClientRect(); + + return viewportBounds.width - comboBounds.right >= comboBounds.left; +} + +export function isBottomSpaceLarger(combo) { + const comboBounds = combo.element[0].getBoundingClientRect(), + viewportBounds = document.documentElement.getBoundingClientRect(); + + return viewportBounds.height - comboBounds.bottom >= comboBounds.top; +} + +export function _getLeftAlignPosition(combo, popup, extraWidth, container) { + const comboRect = combo.element[0].getBoundingClientRect(), + popupRect = popup.element[0].getBoundingClientRect(), + viewportRect = document.documentElement.getBoundingClientRect(), + containerRect = container ? container.getBoundingClientRect() : { left: 0 }; + let left = comboRect.left - containerRect.left + extraWidth; + + if (comboRect.left + popupRect.width > viewportRect.width) { + left = viewportRect.width - popupRect.width - containerRect.left; + } + + return left; +} + +export function getLeftAlignPosition(combo, popup, extraWidth, container) { + let left = _getLeftAlignPosition(combo, popup, extraWidth, container); + let dir = ""; + // 如果放不下,优先使用RightAlign, 如果RightAlign也放不下, 再使用left=0 + const containerRect = container ? container.getBoundingClientRect() : { left: 0 }; + if (left + containerRect.left < 0) { + left = _getRightAlignPosition(combo, popup, extraWidth); + dir = "left"; + } + if (left + containerRect.left < 0) { + left = 0 - containerRect.left; + } + + return { + left, + dir: dir || "right", + }; +} + +export function getLeftAdaptPosition(combo, popup, extraWidth, container) { + if (isLeftSpaceEnough(combo, popup, extraWidth, container)) { + return getLeftPosition(combo, popup, extraWidth, container); + } + + return { + left: 0, + }; +} + +export function _getRightAlignPosition(combo, popup, extraWidth, container) { + const comboBounds = combo.element[0].getBoundingClientRect(), + viewBounds = popup.element[0].getBoundingClientRect(), + containerRect = container ? container.getBoundingClientRect() : { left: 0 }; + + return comboBounds.left + comboBounds.width - viewBounds.width - extraWidth - containerRect.left; +} + +export function getRightAlignPosition(combo, popup, extraWidth, container) { + let left = _getRightAlignPosition(combo, popup, extraWidth, container); + let dir = ""; + // 如果放不下,优先使用LeftAlign, 如果LeftAlign也放不下, 再使用left=0 + if (left < 0) { + left = _getLeftAlignPosition(combo, popup, extraWidth, container); + dir = "right"; + } + if (left < 0) { + left = 0; + } + + return { + left, + dir: dir || "left", + }; +} + +export function getRightAdaptPosition(combo, popup, extraWidth, container) { + if (isRightSpaceEnough(combo, popup, extraWidth, container)) { + return getRightPosition(combo, popup, extraWidth, container); + } + + return { + left: document.documentElement.getBoundingClientRect().width - popup.element[0].getBoundingClientRect().width - container.getBoundingClientRect().left, + }; +} + +export function getTopAlignPosition(combo, popup, extraHeight, needAdaptHeight, container) { + const comboBounds = combo.element[0].getBoundingClientRect(), + popupBounds = popup.element[0].getBoundingClientRect(), + viewportBounds = document.documentElement.getBoundingClientRect(), + containerBounds = container ? container.getBoundingClientRect() : { top: 0 }; + let top, adaptHeight, dir; + if (isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { + top = comboBounds.top - containerBounds.top + extraHeight; + } else if (needAdaptHeight) { + top = comboBounds.top - containerBounds.top + extraHeight; + adaptHeight = viewportBounds.height - comboBounds.top; + } else if (isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { + // 下方空间不足且不允许调整高度的情况下,优先使用上对齐 + top = comboBounds.top + comboBounds.height - popupBounds.height - containerBounds.top - extraHeight; + dir = "top"; + } else { + top = viewportBounds.height - popupBounds.height; + if (top < extraHeight) { + adaptHeight = viewportBounds.height - extraHeight; + } + } + if (top < extraHeight) { + top = extraHeight; + } + + return adaptHeight ? { + top, + adaptHeight, + dir: dir || "bottom", + } : { + top, + dir: dir || "bottom", + }; +} + +export function getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight, positionRelativeElement) { + const comboBounds = combo.element[0].getBoundingClientRect(), + popupBounds = popup.element[0].getBoundingClientRect(), + positionRelativeElementRect = positionRelativeElement.getBoundingClientRect(), + viewportBounds = document.documentElement.getBoundingClientRect(); + if (isTopSpaceEnough(combo, popup, extraHeight)) { + return getTopPosition(combo, popup, extraHeight); + } + if (needAdaptHeight) { + return { + top: 0 - positionRelativeElementRect.top, + adaptHeight: comboBounds.top - extraHeight, + }; + } + if (popupBounds.height + extraHeight > viewportBounds.height) { + return { + top: 0 - positionRelativeElementRect.top, + adaptHeight: viewportBounds.height - extraHeight, + }; + } + + return { + top: 0 - positionRelativeElementRect.top, + }; +} + +export function getBottomAlignPosition(combo, popup, extraHeight, needAdaptHeight, container) { + const comboBounds = combo.element[0].getBoundingClientRect(), + popupBounds = popup.element[0].getBoundingClientRect(), + windowBounds = Widget._renderEngine.createElement("body").bounds(), + containerBounds = container ? container.getBoundingClientRect() : { top: 0 }; + let top, adaptHeight, dir; + if (isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { + top = comboBounds.top + comboBounds.height - containerBounds.top - popupBounds.height; + } else if (needAdaptHeight) { + top = 0 - containerBounds.top; + adaptHeight = comboBounds.top + comboBounds.height - extraHeight; + } else if (isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { + // 上方空间不足且不允许调整高度的情况下,优先使用下对齐 + top = comboBounds.top - containerBounds.top + extraHeight; + dir = "bottom"; + } else { + top = 0; + if (popupBounds.height + extraHeight > windowBounds.height) { + adaptHeight = windowBounds.height - extraHeight; + } + } + if (top + containerBounds.top < 0) { + top = 0; + } + + return adaptHeight ? { + top, + adaptHeight, + dir: dir || "top", + } : { + top, + dir: dir || "top", + }; +} + +export function getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight, positionRelativeElement) { + const comboBounds = combo.element[0].getBoundingClientRect(), + popupBounds = popup.element[0].getBoundingClientRect(), + viewportBounds = document.documentElement.getBoundingClientRect(), + positionRelativeElementRect = positionRelativeElement.getBoundingClientRect(); + if (isBottomSpaceEnough(combo, popup, extraHeight)) { + return getBottomPosition(combo, popup, extraHeight, positionRelativeElement); + } + if (needAdaptHeight) { + return { + top: comboBounds.top + comboBounds.height + extraHeight - positionRelativeElementRect.top, + adaptHeight: viewportBounds.height - comboBounds.top - comboBounds.height - extraHeight, + }; + } + if (popupBounds.height + extraHeight > viewportBounds.height) { + return { + top: extraHeight - positionRelativeElementRect.top, + adaptHeight: viewportBounds.height - extraHeight, + }; + } + + return { + top: viewportBounds.height - popupBounds.height - extraHeight - positionRelativeElementRect.top, + }; +} + +export function getCenterAdaptPosition(combo, popup, positionRelativeElement) { + const comboRect = combo.element[0].getBoundingClientRect(), + popupRect = popup.element[0].getBoundingClientRect(), + positionRelativeElementRect = positionRelativeElement.getBoundingClientRect(), + viewportBounds = document.documentElement.getBoundingClientRect(); + let left; + if (comboRect.left + comboRect.width / 2 + popupRect.width / 2 > viewportBounds.width) { + left = viewportBounds.width - popupRect.width - positionRelativeElementRect.left; + } else { + left = comboRect.left + (comboRect.width - popupRect.width) / 2 - positionRelativeElementRect.left; + } + if (left + positionRelativeElementRect.left < 0) { + left = 0; + } + + return { + left, + }; +} + +export function getMiddleAdaptPosition(combo, popup, positionRelativeElement) { + const comboRect = combo.element[0].getBoundingClientRect(), + popupRect = popup.element[0].getBoundingClientRect(), + positionRelativeElementRect = positionRelativeElement.getBoundingClientRect(), + viewportBounds = document.documentElement.getBoundingClientRect(); + + let top; + if (comboRect.top + comboRect.height / 2 + popupRect.height / 2 > viewportBounds.height) { + top = viewportBounds.height - popupRect.height - positionRelativeElementRect.top; + } else { + top = comboRect.top + (comboRect.height - popupRect.height) / 2 - positionRelativeElementRect.top; + } + if (top + positionRelativeElementRect.top < 0) { + top = 0; + } + + return { + top, + }; +} + +export function getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, container) { + extraWidth || (extraWidth = 0); + extraHeight || (extraHeight = 0); + let i, direct; + const leftRight = [], topBottom = [], innerLeftRight = []; + let isNeedAdaptHeight = false, tbFirst = false, lrFirst = false; + let left, top, pos, firstDir = directions[0]; + for (i = 0; i < directions.length; i++) { + direct = directions[i]; + switch (direct) { + case "left": + leftRight.push(direct); + break; + case "right": + leftRight.push(direct); + break; + case "top": + topBottom.push(direct); + break; + case "bottom": + topBottom.push(direct); + break; + case "innerLeft": + innerLeftRight.push(direct); + break; + case "innerRight": + innerLeftRight.push(direct); + break; + default: + break; + } + } + for (i = 0; i < directions.length; i++) { + let tW, tH; + direct = directions[i]; + switch (direct) { + case "left": + if (!isNeedAdaptHeight) { + tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? 0 : extraHeight; + if (isLeftSpaceEnough(combo, popup, tW)) { + left = getLeftPosition(combo, popup, tW, container).left; + if (topBottom[0] === "bottom") { + pos = getTopAlignPosition(combo, popup, tH, needAdaptHeight, container); + } else { + pos = getBottomAlignPosition(combo, popup, tH, needAdaptHeight, container); + } + pos.dir = `left,${pos.dir}`; + if (tbFirst) { + pos.change = "left"; + } + pos.left = left; + + return pos; + } + } + lrFirst = true; + break; + case "right": + if (!isNeedAdaptHeight) { + tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? extraWidth : extraHeight; + if (isRightSpaceEnough(combo, popup, tW)) { + left = getRightPosition(combo, popup, tW, container).left; + if (topBottom[0] === "bottom") { + pos = getTopAlignPosition(combo, popup, tH, needAdaptHeight, container); + } else { + pos = getBottomAlignPosition(combo, popup, tH, needAdaptHeight, container); + } + pos.dir = `right,${pos.dir}`; + if (tbFirst) { + pos.change = "right"; + } + pos.left = left; + + return pos; + } + } + lrFirst = true; + break; + case "top": + tW = lrFirst ? extraHeight : extraWidth, tH = lrFirst ? extraWidth : extraHeight; + if (isTopSpaceEnough(combo, popup, tH)) { + top = getTopPosition(combo, popup, tH, container).top; + if (leftRight[0] === "right") { + pos = getLeftAlignPosition(combo, popup, tW, container); + } else { + pos = getRightAlignPosition(combo, popup, tW, container); + } + pos.dir = `top,${pos.dir}`; + if (lrFirst) { + pos.change = "top"; + } + pos.top = top; + + return pos; + } + if (needAdaptHeight) { + isNeedAdaptHeight = true; + } + tbFirst = true; + break; + case "bottom": + tW = lrFirst ? extraHeight : extraWidth, tH = lrFirst ? extraWidth : extraHeight; + if (isBottomSpaceEnough(combo, popup, tH)) { + top = getBottomPosition(combo, popup, tH, container).top; + if (leftRight[0] === "right") { + pos = getLeftAlignPosition(combo, popup, tW, container); + } else { + pos = getRightAlignPosition(combo, popup, tW, container); + } + pos.dir = `bottom,${pos.dir}`; + if (lrFirst) { + pos.change = "bottom"; + } + pos.top = top; + + return pos; + } + if (needAdaptHeight) { + isNeedAdaptHeight = true; + } + tbFirst = true; + break; + case "innerLeft": + if (!isNeedAdaptHeight) { + tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? 0 : extraHeight; + if (isInnerLeftSpaceEnough(combo, popup, tW)) { + left = getInnerLeftPosition(combo, popup, tW).left; + if (topBottom[0] === "bottom") { + pos = getTopAlignPosition(combo, popup, tH, needAdaptHeight); + } else { + pos = getBottomAlignPosition(combo, popup, tH, needAdaptHeight); + } + pos.dir = `innerLeft,${pos.dir}`; + if (tbFirst) { + pos.change = "innerLeft"; + } + pos.left = left; + + return pos; + } + } + lrFirst = true; + break; + case "innerRight": + if (!isNeedAdaptHeight) { + tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? extraWidth : extraHeight; + if (isInnerRightSpaceEnough(combo, popup, tW)) { + left = getInnerRightPosition(combo, popup, tW).left; + if (topBottom[0] === "bottom") { + pos = getTopAlignPosition(combo, popup, tH, needAdaptHeight); + } else { + pos = getBottomAlignPosition(combo, popup, tH, needAdaptHeight); + } + pos.dir = `innerLeft,${pos.dir}`; + if (tbFirst) { + pos.change = "innerRight"; + } + pos.left = left; + + return pos; + } + } + break; + default: + break; + } + } + + // 此处为四个方向放不下时挑空间最大的方向去放置, 也就是说我设置了弹出方向为"bottom,left", + // 最后发现实际弹出方向可能是"top,left",那么此时外界获取popup的方向应该是"top,left" + switch (directions[0]) { + case "left": + case "right": + if (isRightSpaceLarger(combo)) { + left = getRightAdaptPosition(combo, popup, extraWidth, container).left; + firstDir = "right"; + } else { + left = getLeftAdaptPosition(combo, popup, extraWidth, container).left; + firstDir = "left"; + } + if (topBottom[0] === "bottom") { + pos = getTopAlignPosition(combo, popup, extraHeight, needAdaptHeight); + pos.left = left; + pos.dir = `${firstDir},${pos.dir}`; + + return pos; + } + pos = getBottomAlignPosition(combo, popup, extraHeight, needAdaptHeight); + pos.left = left; + pos.dir = `${firstDir},${pos.dir}`; + + return pos; + default : + if (isBottomSpaceLarger(combo)) { + top = getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight, container).top; + firstDir = "bottom"; + } else { + top = getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight, container).top; + firstDir = "top"; + } + if (leftRight[0] === "right") { + pos = getLeftAlignPosition(combo, popup, extraWidth, container); + pos.top = top; + pos.dir = `${firstDir},${pos.dir}`; + + return pos; + } + pos = getRightAlignPosition(combo, popup, extraWidth, container); + pos.top = top; + pos.dir = `${firstDir},${pos.dir}`; + + return pos; + } +} + + +export function getComboPosition(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, offsetStyle, positionRelativeElement) { + extraWidth || (extraWidth = 0); + extraHeight || (extraHeight = 0); + const viewportBounds = document.documentElement.getBoundingClientRect(); + const maxHeight = Math.min(popup.attr("maxHeight") || viewportBounds.height, viewportBounds.height); + popup.resetHeight && popup.resetHeight(maxHeight); + const position = getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions || ["bottom", "top", "right", "left"], positionRelativeElement); + switch (offsetStyle) { + case "center": + if (position.change) { + const p = getMiddleAdaptPosition(combo, popup, positionRelativeElement); + position.top = p.top; + } else { + const p = getCenterAdaptPosition(combo, popup, positionRelativeElement); + position.left = p.left; + } + break; + case "middle": + if (position.change) { + const p = getCenterAdaptPosition(combo, popup, positionRelativeElement); + position.left = p.left; + } else { + const p = getMiddleAdaptPosition(combo, popup, positionRelativeElement); + position.top = p.top; + } + break; + default: + break; + } + if (needAdaptHeight === true) { + popup.resetHeight && popup.resetHeight(Math.min(viewportBounds.height - position.top - (positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0), maxHeight)); + } + + return position; +} + +/** + * 获取position:fixed相对定位的元素 + */ +export function getPositionRelativeContainingBlock(element) { + if (["html", "body", "#document"].indexOf((element.nodeName || "").toLowerCase()) >= 0) { + // $FlowFixMe[incompatible-return]: assume body is always available + return element.ownerDocument.body; + } + + function isExcept(node) { + const _computedStyle = getComputedStyle(node); + const transform = _computedStyle.transform; + const perspective = _computedStyle.perspective; + const filter = _computedStyle.filter; + const willChange = _computedStyle["will-change"]; + + return [transform, perspective, filter].some(value => value !== "none") || (willChange === "transform"); + } + + if (isExcept(element)) { + return element; + } + + return getPositionRelativeContainingBlock(element.parentNode); +} + +/** + * 获取position:fixed相对定位的元素的clientRect + */ +export function getPositionRelativeContainingBlockRect(element) { + const positionRelativeElement = getPositionRelativeContainingBlock(element); + const rect = positionRelativeElement.getBoundingClientRect(); + const { top, right, bottom, left, width, height, x, y } = positionRelativeElement.getBoundingClientRect(); + + return { + top, right, bottom, left, width, height, x, y, + scaleX: rect.width / positionRelativeElement.offsetWidth, + scaleY: rect.height / positionRelativeElement.offsetHeight, + }; +} diff --git a/src/core/utils/events/eventlistener.js b/packages/fineui/src/core/utils/events/eventlistener.js similarity index 100% rename from src/core/utils/events/eventlistener.js rename to packages/fineui/src/core/utils/events/eventlistener.js diff --git a/src/core/utils/events/index.js b/packages/fineui/src/core/utils/events/index.js similarity index 100% rename from src/core/utils/events/index.js rename to packages/fineui/src/core/utils/events/index.js diff --git a/src/core/utils/events/mousemovetracker.js b/packages/fineui/src/core/utils/events/mousemovetracker.js similarity index 100% rename from src/core/utils/events/mousemovetracker.js rename to packages/fineui/src/core/utils/events/mousemovetracker.js diff --git a/src/core/utils/events/wheelhandler.js b/packages/fineui/src/core/utils/events/wheelhandler.js similarity index 100% rename from src/core/utils/events/wheelhandler.js rename to packages/fineui/src/core/utils/events/wheelhandler.js diff --git a/src/core/utils/i18n.js b/packages/fineui/src/core/utils/i18n.js similarity index 100% rename from src/core/utils/i18n.js rename to packages/fineui/src/core/utils/i18n.js diff --git a/src/core/utils/index.js b/packages/fineui/src/core/utils/index.js similarity index 100% rename from src/core/utils/index.js rename to packages/fineui/src/core/utils/index.js diff --git a/packages/fineui/src/core/version.js b/packages/fineui/src/core/version.js new file mode 100644 index 000000000..6900e8235 --- /dev/null +++ b/packages/fineui/src/core/version.js @@ -0,0 +1,2 @@ +// BI.version = "2.0"; +export const version = "2.0" \ No newline at end of file diff --git a/src/core/worker.js b/packages/fineui/src/core/worker.js similarity index 100% rename from src/core/worker.js rename to packages/fineui/src/core/worker.js diff --git a/src/core/wrapper/index.js b/packages/fineui/src/core/wrapper/index.js similarity index 100% rename from src/core/wrapper/index.js rename to packages/fineui/src/core/wrapper/index.js diff --git a/packages/fineui/src/core/wrapper/layout.js b/packages/fineui/src/core/wrapper/layout.js new file mode 100644 index 000000000..288d586eb --- /dev/null +++ b/packages/fineui/src/core/wrapper/layout.js @@ -0,0 +1,821 @@ +import { isNull, isFunction, each, stripEL, keys, isArray, contains, isKey, isOdd, isWidget, isNotNull, has } from "../2.base"; +import { Widget } from "../4.widget"; +import { _lazyCreateWidget, Providers } from "../5.inject"; +import { shortcut } from "../decorator"; +import { pixFormat, Events } from "../constant"; +import { SystemProvider } from "../system"; + +/** + * 布局容器类 + * + * @cfg {JSON} options 配置属性 + * @cfg {Boolean} [options.scrollable=false] 子组件超出容器边界之后是否会出现滚动条 + * @cfg {Boolean} [options.scrollx=false] 子组件超出容器边界之后是否会出现横向滚动条 + * @cfg {Boolean} [options.scrolly=false] 子组件超出容器边界之后是否会出现纵向滚动条 + */ +@shortcut() +export class Layout extends Widget { + static xtype = "bi.layout"; + + props() { + return { + scrollable: null, // true, false, null + scrollx: false, // true, false + scrolly: false, // true, false + items: [], + innerHgap: 0, + innerVgap: 0, + }; + } + + render() { + const o = this.options; + this._init4Margin(); + this._init4Scroll(); + if (isFunction(o.columnSize)) { + const columnSizeFn = o.columnSize; + o.columnSize = this.__watch(columnSizeFn, (context, newValue) => { + o.columnSize = newValue; + this.resize(); + }); + } + if (isFunction(o.rowSize)) { + const rowSizeFn = o.rowSize; + o.rowSize = this.__watch(rowSizeFn, (context, newValue) => { + o.rowSize = newValue; + this.resize(); + }); + } + } + + _init4Margin() { + if (this.options.top) { + this.element.css("top", pixFormat(this.options.top)); + } + if (this.options.left) { + this.element.css("left", pixFormat(this.options.left)); + } + if (this.options.bottom) { + this.element.css("bottom", pixFormat(this.options.bottom)); + } + if (this.options.right) { + this.element.css("right", pixFormat(this.options.right)); + } + } + + _init4Scroll() { + switch (this.options.scrollable) { + case true: + case "xy": + this.element.css("overflow", "auto"); + + return; + case false: + this.element.css("overflow", "hidden"); + + return; + case "x": + this.element.css({ + "overflow-x": "auto", + "overflow-y": "hidden", + }); + + return; + case "y": + this.element.css({ + "overflow-x": "hidden", + "overflow-y": "auto", + }); + + return; + default : + break; + } + if (this.options.scrollx) { + this.element.css({ + "overflow-x": "auto", + "overflow-y": "hidden", + }); + + return; + } + if (this.options.scrolly) { + this.element.css({ + "overflow-x": "hidden", + "overflow-y": "auto", + }); + } + } + + appendFragment(frag) { + this.element.append(frag); + } + + _mountChildren() { + const frag = Widget._renderEngine.createFragment(); + let hasChild = false; + for (const key in this._children) { + const child = this._children[key]; + if (child.element !== this.element) { + frag.appendChild(child.element[0]); + hasChild = true; + } + } + if (hasChild === true) { + this.appendFragment(frag); + } + } + + _getChildName(index) { + return `${index}`; + } + + _addElement(i, item, context, widget) { + let w; + if (widget) { + return widget; + } + if (!this.hasWidget(this._getChildName(i))) { + w = _lazyCreateWidget(item, context); + w.on(Events.DESTROY, () => { + each(this._children, (name, child) => { + if (child === w) { + delete this._children[name]; + this.removeItemAt(name | 0); + } + }); + }); + this.addWidget(this._getChildName(i), w); + } else { + w = this.getWidgetByName(this._getChildName(i)); + } + + return w; + } + + _newElement(i, item, context) { + const w = _lazyCreateWidget(item, context); + w.on(Events.DESTROY, () => { + each(this._children, (name, child) => { + if (child === w) { + delete this._children[name]; + this.removeItemAt(name | 0); + } + }); + }); + + return this._addElement(i, item, context, w); + } + + _getOptions(item) { + if (item instanceof Widget) { + item = item.options; + } + item = stripEL(item); + if (item instanceof Widget) { + item = item.options; + } + + return item; + } + + _compare(item1, item2) { + // 不比较函数 + const eq = (a, b, aStack, bStack) => { + if (a === b) { + return a !== 0 || 1 / a === 1 / b; + } + if (isNull(a) || isNull(b)) { + return a === b; + } + const className = Object.prototype.toString.call(a); + switch (className) { + case "[object RegExp]": + case "[object String]": + return `${a}` === `${b}`; + case "[object Number]": + if (+a !== +a) { + return +b !== +b; + } + + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case "[object Date]": + case "[object Boolean]": + return +a === +b; + default: + } + + const areArrays = className === "[object Array]"; + if (!areArrays) { + if (isFunction(a) && isFunction(b)) { + return true; + } + a = this._getOptions(a); + b = this._getOptions(b); + } + + aStack = aStack || []; + bStack = bStack || []; + let length = aStack.length; + while (length--) { + if (aStack[length] === a) { + return bStack[length] === b; + } + } + + aStack.push(a); + bStack.push(b); + + if (areArrays) { + length = a.length; + if (length !== b.length) { + return false; + } + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) { + return false; + } + } + } else { + const aKeys = keys(a); + let key; + length = aKeys.length; + if (keys(b).length !== length) { + return false; + } + while (length--) { + key = aKeys[length]; + if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) { + return false; + } + } + } + aStack.pop(); + bStack.pop(); + + return true; + }; + + return eq(item1, item2); + } + + _getWrapper() { + return this.element; + } + + // 不依赖于this.options.items进行更新 + _updateItemAt(oldIndex, newIndex, item) { + const del = this._children[this._getChildName(oldIndex)]; + const w = this._newElement(newIndex, item); + // 需要有个地方临时存一下新建的组件,否则如果直接使用newIndex的话,newIndex位置的元素可能会被用到 + this._children[`${this._getChildName(newIndex)}-temp`] = w; + const nextSibling = del.element.next(); + if (nextSibling.length > 0) { + Widget._renderEngine.createElement(nextSibling).before(w.element); + } else { + w.element.appendTo(this._getWrapper()); + } + del._destroy(); + w._mount(); + + return true; + } + + _addItemAt(index, item) { + for (let i = this.options.items.length; i > index; i--) { + this._children[this._getChildName(i)] = this._children[this._getChildName(i - 1)]; + } + delete this._children[this._getChildName(index)]; + this.options.items.splice(index, 0, item); + } + + _removeItemAt(index) { + for (let i = index; i < this.options.items.length - 1; i++) { + this._children[this._getChildName(i)] = this._children[this._getChildName(i + 1)]; + } + delete this._children[this._getChildName(this.options.items.length - 1)]; + this.options.items.splice(index, 1); + } + + _clearGap(w) { + w.element.css({ + "margin-top": "", + "margin-bottom": "", + "margin-left": "", + "margin-right": "", + }); + } + + _optimiseGap(gap) { + return (gap > 0 && gap < 1) ? `${(gap * 100).toFixed(1)}%` : pixFormat(gap); + } + + _optimiseItemLgap(item) { + if (Providers.getProvider(SystemProvider.xtype).getLayoutOptimize()) { + return ((!item.type && item.el) ? ((item._lgap || 0) + (item.lgap || 0)) : item._lgap) || 0; + } + + return (item._lgap || 0) + (item.lgap || 0); + } + _optimiseItemRgap(item) { + if (Providers.getProvider(SystemProvider.xtype).getLayoutOptimize()) { + return ((!item.type && item.el) ? ((item._rgap || 0) + (item.rgap || 0)) : item._rgap) || 0; + } + + return (item._rgap || 0) + (item.rgap || 0); + } + _optimiseItemTgap(item) { + if (Providers.getProvider(SystemProvider.xtype).getLayoutOptimize()) { + return ((!item.type && item.el) ? ((item._tgap || 0) + (item.tgap || 0)) : item._tgap) || 0; + } + + return (item._tgap || 0) + (item.tgap || 0); + } + _optimiseItemBgap(item) { + if (Providers.getProvider(SystemProvider.xtype).getLayoutOptimize()) { + return ((!item.type && item.el) ? ((item._bgap || 0) + (item.bgap || 0)) : item._bgap) || 0; + } + + return (item._bgap || 0) + (item.bgap || 0); + } + _optimiseItemHgap(item) { + if (Providers.getProvider(SystemProvider.xtype).getLayoutOptimize()) { + return ((!item.type && item.el) ? ((item._hgap || 0) + (item.hgap || 0)) : item._hgap) || 0; + } + + return (item._hgap || 0) + (item.hgap || 0); + } + _optimiseItemVgap(item) { + if (Providers.getProvider(SystemProvider.xtype).getLayoutOptimize()) { + return ((!item.type && item.el) ? ((item._vgap || 0) + (item.vgap || 0)) : item._vgap) || 0; + } + + return (item._vgap || 0) + (item.vgap || 0); + } + + _handleGap(w, item, hIndex, vIndex) { + const o = this.options; + let innerLgap, innerRgap, innerTgap, innerBgap; + if (isNull(vIndex)) { + innerTgap = innerBgap = o.innerVgap; + innerLgap = hIndex === 0 ? o.innerHgap : 0; + innerRgap = hIndex === o.items.length - 1 ? o.innerHgap : 0; + } else { + innerLgap = innerRgap = o.innerHgap; + innerTgap = vIndex === 0 ? o.innerVgap : 0; + innerBgap = vIndex === o.items.length - 1 ? o.innerVgap : 0; + } + if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + const top = ((isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + w.element.css({ + "margin-top": this._optimiseGap(top), + }); + } + if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + const left = ((isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + w.element.css({ + "margin-left": this._optimiseGap(left), + }); + } + if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + const right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + w.element.css({ + "margin-right": this._optimiseGap(right), + }); + } + if (o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + const bottom = o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + w.element.css({ + "margin-bottom": this._optimiseGap(bottom), + }); + } + } + + // 横向换纵向 + _handleReverseGap(w, item, index) { + const o = this.options; + const innerLgap = o.innerHgap; + const innerRgap = o.innerHgap; + const innerTgap = index === 0 ? o.innerVgap : 0; + const innerBgap = index === o.items.length - 1 ? o.innerVgap : 0; + if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + const top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + w.element.css({ + "margin-top": this._optimiseGap(top), + }); + } + if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + const left = o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + w.element.css({ + "margin-left": this._optimiseGap(left), + }); + } + if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + const right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + w.element.css({ + "margin-right": this._optimiseGap(right), + }); + } + // 这里的代码是关键 + if (o.vgap + o.hgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + const bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + w.element.css({ + "margin-bottom": this._optimiseGap(bottom), + }); + } + } + + /** + * 添加一个子组件到容器中 + * @param {JSON/Widget} item 子组件 + */ + addItem(item) { + return this.addItemAt(this.options.items.length, item); + } + + prependItem(item) { + return this.addItemAt(0, item); + } + + addItemAt(index, item) { + if (index < 0 || index > this.options.items.length) { + return; + } + this._addItemAt(index, item); + const w = this._addElement(index, item); + // addItemAt 还是用之前的找上个兄弟节点向后插入的方式 + if (index > 0) { + this._children[this._getChildName(index - 1)].element.after(w.element); + } else { + w.element.prependTo(this._getWrapper()); + } + w._mount(); + + return w; + } + + removeItemAt(indexes) { + indexes = isArray(indexes) ? indexes : [indexes]; + const deleted = []; + const newItems = [], newChildren = {}; + for (let i = 0, len = this.options.items.length; i < len; i++) { + const child = this._children[this._getChildName(i)]; + if (contains(indexes, i)) { + child && deleted.push(child); + } else { + newChildren[this._getChildName(newItems.length)] = child; + newItems.push(this.options.items[i]); + } + } + this.options.items = newItems; + this._children = newChildren; + each(deleted, (i, c) => { + c._destroy(); + }); + } + + shouldUpdateItem(index, item) { + const child = this._children[this._getChildName(index)]; + if (!child || !child.shouldUpdate) { + return null; + } + + return child.shouldUpdate(this._getOptions(item)); + } + + addItems(items, context) { + const o = this.options; + const fragment = Widget._renderEngine.createFragment(); + const added = []; + each(items, (i, item) => { + const w = this._addElement(o.items.length, item, context); + this._children[this._getChildName(o.items.length)] = w; + o.items.push(item); + added.push(w); + fragment.appendChild(w.element[0]); + }); + if (this._isMounted) { + this._getWrapper().append(fragment); + each(added, (i, w) => { + w._mount(); + }); + } + } + + prependItems(items, context) { + items = items || []; + const fragment = Widget._renderEngine.createFragment(); + const added = []; + for (let i = items.length - 1; i >= 0; i--) { + this._addItemAt(0, items[i]); + const w = this._addElement(0, items[i], context); + this._children[this._getChildName(0)] = w; + this.options.items.unshift(items[i]); + added.push(w); + fragment.appendChild(w.element[0]); + } + if (this._isMounted) { + this._getWrapper().prepend(fragment); + each(added, (i, w) => { + w._mount(); + }); + } + } + + getValue() { + let value = [], child; + each(this.options.items, i => { + child = this._children[this._getChildName(i)]; + if (child) { + let v = child.getValue(); + v = isArray(v) ? v : [v]; + value = value.concat(v); + } + }); + + return value; + } + + setValue(v) { + let child; + each(this.options.items, i => { + child = this._children[this._getChildName(i)]; + child && child.setValue(v); + }); + } + + setText(v) { + let child; + each(this.options.items, i => { + child = this._children[this._getChildName(i)]; + child && child.setText(v); + }); + } + + patchItem(oldVnode, vnode, oldIndex, newIndex) { + const shouldUpdate = this.shouldUpdateItem(oldIndex, vnode); + const child = this._children[this._getChildName(oldIndex)]; + if (shouldUpdate) { + this._children[`${this._getChildName(newIndex)}-temp`] = child; + + return child._update(this._getOptions(vnode), shouldUpdate); + } + if (shouldUpdate === null && !this._compare(oldVnode, vnode)) { + // if (child.update) { + // return child.update(this._getOptions(vnode)); + // } + return this._updateItemAt(oldIndex, newIndex, vnode); + } + } + + updateChildren(oldCh, newCh, context) { + let oldStartIdx = 0, newStartIdx = 0; + let oldEndIdx = oldCh.length - 1; + let oldStartVnode = oldCh[0]; + let oldEndVnode = oldCh[oldEndIdx]; + let newEndIdx = newCh.length - 1; + let newStartVnode = newCh[0]; + let newEndVnode = newCh[newEndIdx]; + let before; + let updated; + const children = {}; + + const sameVnode = (vnode1, vnode2, oldIndex, newIndex) => { + vnode1 = this._getOptions(vnode1); + vnode2 = this._getOptions(vnode2); + if (isKey(vnode1.key)) { + return vnode1.key === vnode2.key; + } + if (oldIndex >= 0) { + return oldIndex === newIndex; + } + }; + + const addNode = (vnode, index, context) => { + const opt = this._getOptions(vnode); + const key = isNull(opt.key) ? index : opt.key; + children[key] = this._newElement(index, vnode, context); + + return children[key]; + }; + + const addVnodes = (before, vnodes, startIdx, endIdx, context) => { + for (; startIdx <= endIdx; ++startIdx) { + const node = addNode(vnodes[startIdx], startIdx, context); + insertBefore(node, before, false, startIdx); + } + }; + + const removeVnodes = (vnodes, startIdx, endIdx) => { + for (; startIdx <= endIdx; ++startIdx) { + const ch = vnodes[startIdx]; + if (isNotNull(ch)) { + const node = this._getOptions(ch); + const key = isNull(node.key) ? startIdx : node.key; + children[key]._destroy(); + } + } + }; + + const insertBefore = (insert, before, isNext, index) => { + insert = this._getOptions(insert); + before = before && this._getOptions(before); + const insertKey = isKey(insert.key) ? insert.key : index; + if (before && children[before.key]) { + const beforeKey = isKey(before.key) ? before.key : index; + let next; + if (isNext) { + next = children[beforeKey].element.next(); + } else { + next = children[beforeKey].element; + } + if (next.length > 0) { + next.before(children[insertKey].element); + } else { + this._getWrapper().append(children[insertKey].element); + } + } else { + this._getWrapper().append(children[insertKey].element); + } + }; + + const findOldVnode = (vnodes, vNode, beginIdx, endIdx) => { + let i, found, findIndex; + for (i = beginIdx; i <= endIdx; ++i) { + if (vnodes[i] && sameVnode(vnodes[i], vNode)) { + found = vnodes[i]; + findIndex = i; + } + } + + return [found, findIndex]; + }; + + each(oldCh, (i, child) => { + child = this._getOptions(child); + const key = isNull(child.key) ? i : child.key; + if (isKey(key)) { + children[key] = this._children[this._getChildName(i)]; + } + }); + + while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { + if (isNull(oldStartVnode)) { + oldStartVnode = oldCh[++oldStartIdx]; + } else if (isNull(oldEndVnode)) { + oldEndVnode = oldCh[--oldEndIdx]; + } else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) { + const willUpdate = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx); + updated = willUpdate || updated; + children[isNull(oldStartVnode.key) ? oldStartIdx : oldStartVnode.key] = willUpdate ? this._children[`${this._getChildName(newStartIdx)}-temp`] : this._children[this._getChildName(oldStartIdx)]; + oldStartVnode = oldCh[++oldStartIdx]; + newStartVnode = newCh[++newStartIdx]; + } else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) { + const willUpdate = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx); + updated = willUpdate || updated; + children[isNull(oldEndVnode.key) ? oldEndIdx : oldEndVnode.key] = willUpdate ? this._children[`${this._getChildName(newEndIdx)}-temp`] : this._children[this._getChildName(oldEndIdx)]; + oldEndVnode = oldCh[--oldEndIdx]; + newEndVnode = newCh[--newEndIdx]; + } else if (sameVnode(oldStartVnode, newEndVnode)) { + const willUpdate = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx, newStartIdx); + updated = willUpdate || updated; + children[isNull(oldStartVnode.key) ? oldStartIdx : oldStartVnode.key] = willUpdate ? this._children[`${this._getChildName(newStartIdx)}-temp`] : this._children[this._getChildName(oldStartIdx)]; + insertBefore(oldStartVnode, oldEndVnode, true); + oldStartVnode = oldCh[++oldStartIdx]; + newEndVnode = newCh[--newEndIdx]; + } else if (sameVnode(oldEndVnode, newStartVnode)) { + const willUpdate = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx, newEndIdx); + updated = willUpdate || updated; + children[isNull(oldEndVnode) ? oldEndIdx : oldEndVnode.key] = willUpdate ? this._children[`${this._getChildName(newEndIdx)}-temp`] : this._children[this._getChildName(oldEndIdx)]; + insertBefore(oldEndVnode, oldStartVnode); + oldEndVnode = oldCh[--oldEndIdx]; + newStartVnode = newCh[++newStartIdx]; + } else { + const sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); + if (isNull(sameOldVnode[0])) { // 不存在就把新的放到左边 + const node = addNode(newStartVnode, newStartIdx, context); + insertBefore(node, oldStartVnode); + } else { // 如果新节点在旧节点区间中存在就复用一下 + const sameOldIndex = sameOldVnode[1]; + const willUpdate = this.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx); + updated = willUpdate || updated; + children[isNull(sameOldVnode[0].key) ? newStartIdx : sameOldVnode[0].key] = willUpdate ? this._children[`${this._getChildName(newStartIdx)}-temp`] : this._children[this._getChildName(sameOldIndex)]; + oldCh[sameOldIndex] = undefined; + insertBefore(sameOldVnode[0], oldStartVnode); + } + newStartVnode = newCh[++newStartIdx]; + } + } + if (oldStartIdx > oldEndIdx) { + before = isNull(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1]; + addVnodes(before, newCh, newStartIdx, newEndIdx, context); + } else if (newStartIdx > newEndIdx) { + removeVnodes(oldCh, oldStartIdx, oldEndIdx); + } + + this._children = {}; + each(newCh, (i, child) => { + const node = this._getOptions(child); + const key = isNull(node.key) ? i : node.key; + children[key]._setParent && children[key]._setParent(this); + children[key]._mount(); + this._children[this._getChildName(i)] = children[key]; + }); + + return updated; + } + + forceUpdate(opt) { + if (this._isMounted) { + each(this._children, (i, c) => { + c.destroy(); + }); + this._children = {}; + this._isMounted = false; + } + this.options.items = opt.items; + this.stroke(opt.items); + this._mount(); + } + + update(opt) { + const o = this.options; + const items = opt.items || []; + const context = opt.context; + const oldItems = o.items; + this.options.items = items; + + return this.updateChildren(oldItems, items, context); + } + + stroke(items, options) { + options = options || {}; + each(items, (i, item) => { + item && this._addElement(i, item, options.context); + }); + } + + getRowColumnCls(rowIndex, colIndex, lastRowIndex, lastColIndex) { + let cls = ""; + if (rowIndex === 0) { + cls += " first-row"; + } else if (rowIndex === lastRowIndex) { + cls += " last-row"; + } + if (colIndex === 0) { + cls += " first-col"; + } else if (colIndex === lastColIndex) { + cls += " last-col"; + } + isOdd(rowIndex + 1) ? (cls += " odd-row") : (cls += " even-row"); + isOdd(colIndex + 1) ? (cls += " odd-col") : (cls += " even-col"); + cls += " center-element"; + + return cls; + } + + removeWidget(nameOrWidget) { + let removeIndex; + if (isWidget(nameOrWidget)) { + each(this._children, (name, child) => { + if (child === nameOrWidget) { + removeIndex = name; + } + }); + } else { + removeIndex = nameOrWidget; + } + if (removeIndex) { + this._removeItemAt(removeIndex | 0); + } + } + + empty() { + super.empty(...arguments); + this.options.items = []; + } + + destroy() { + super.destroy(...arguments); + this.options.items = []; + } + + populate(items, options) { + items = items || []; + options = options || {}; + if (this._isMounted) { + this.update({ + items, + context: options.context, + }); + + return; + } + this.options.items = items; + this.stroke(items, options); + } + + resize() { + this.stroke(this.options.items); + } +} diff --git a/src/core/wrapper/layout/adapt/absolute.center.js b/packages/fineui/src/core/wrapper/layout/adapt/absolute.center.js similarity index 100% rename from src/core/wrapper/layout/adapt/absolute.center.js rename to packages/fineui/src/core/wrapper/layout/adapt/absolute.center.js diff --git a/src/core/wrapper/layout/adapt/absolute.horizontal.js b/packages/fineui/src/core/wrapper/layout/adapt/absolute.horizontal.js similarity index 100% rename from src/core/wrapper/layout/adapt/absolute.horizontal.js rename to packages/fineui/src/core/wrapper/layout/adapt/absolute.horizontal.js diff --git a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js b/packages/fineui/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js similarity index 100% rename from src/core/wrapper/layout/adapt/absolute.leftrightvertical.js rename to packages/fineui/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js diff --git a/src/core/wrapper/layout/adapt/absolute.vertical.js b/packages/fineui/src/core/wrapper/layout/adapt/absolute.vertical.js similarity index 100% rename from src/core/wrapper/layout/adapt/absolute.vertical.js rename to packages/fineui/src/core/wrapper/layout/adapt/absolute.vertical.js diff --git a/src/core/wrapper/layout/adapt/adapt.center.js b/packages/fineui/src/core/wrapper/layout/adapt/adapt.center.js similarity index 100% rename from src/core/wrapper/layout/adapt/adapt.center.js rename to packages/fineui/src/core/wrapper/layout/adapt/adapt.center.js diff --git a/src/core/wrapper/layout/adapt/adapt.horizontal.js b/packages/fineui/src/core/wrapper/layout/adapt/adapt.horizontal.js similarity index 100% rename from src/core/wrapper/layout/adapt/adapt.horizontal.js rename to packages/fineui/src/core/wrapper/layout/adapt/adapt.horizontal.js diff --git a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js b/packages/fineui/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js similarity index 100% rename from src/core/wrapper/layout/adapt/adapt.leftrightvertical.js rename to packages/fineui/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/packages/fineui/src/core/wrapper/layout/adapt/adapt.table.js similarity index 100% rename from src/core/wrapper/layout/adapt/adapt.table.js rename to packages/fineui/src/core/wrapper/layout/adapt/adapt.table.js diff --git a/src/core/wrapper/layout/adapt/adapt.vertical.js b/packages/fineui/src/core/wrapper/layout/adapt/adapt.vertical.js similarity index 100% rename from src/core/wrapper/layout/adapt/adapt.vertical.js rename to packages/fineui/src/core/wrapper/layout/adapt/adapt.vertical.js diff --git a/src/core/wrapper/layout/adapt/auto.horizontal.js b/packages/fineui/src/core/wrapper/layout/adapt/auto.horizontal.js similarity index 100% rename from src/core/wrapper/layout/adapt/auto.horizontal.js rename to packages/fineui/src/core/wrapper/layout/adapt/auto.horizontal.js diff --git a/src/core/wrapper/layout/adapt/index.js b/packages/fineui/src/core/wrapper/layout/adapt/index.js similarity index 100% rename from src/core/wrapper/layout/adapt/index.js rename to packages/fineui/src/core/wrapper/layout/adapt/index.js diff --git a/src/core/wrapper/layout/adapt/inline.center.js b/packages/fineui/src/core/wrapper/layout/adapt/inline.center.js similarity index 100% rename from src/core/wrapper/layout/adapt/inline.center.js rename to packages/fineui/src/core/wrapper/layout/adapt/inline.center.js diff --git a/src/core/wrapper/layout/adapt/inline.horizontal.js b/packages/fineui/src/core/wrapper/layout/adapt/inline.horizontal.js similarity index 100% rename from src/core/wrapper/layout/adapt/inline.horizontal.js rename to packages/fineui/src/core/wrapper/layout/adapt/inline.horizontal.js diff --git a/src/core/wrapper/layout/adapt/inline.vertical.js b/packages/fineui/src/core/wrapper/layout/adapt/inline.vertical.js similarity index 100% rename from src/core/wrapper/layout/adapt/inline.vertical.js rename to packages/fineui/src/core/wrapper/layout/adapt/inline.vertical.js diff --git a/src/core/wrapper/layout/fill/auto.vtape.js b/packages/fineui/src/core/wrapper/layout/fill/auto.vtape.js similarity index 100% rename from src/core/wrapper/layout/fill/auto.vtape.js rename to packages/fineui/src/core/wrapper/layout/fill/auto.vtape.js diff --git a/src/core/wrapper/layout/fill/fill.horizontal.js b/packages/fineui/src/core/wrapper/layout/fill/fill.horizontal.js similarity index 100% rename from src/core/wrapper/layout/fill/fill.horizontal.js rename to packages/fineui/src/core/wrapper/layout/fill/fill.horizontal.js diff --git a/src/core/wrapper/layout/fill/fill.vertical.js b/packages/fineui/src/core/wrapper/layout/fill/fill.vertical.js similarity index 100% rename from src/core/wrapper/layout/fill/fill.vertical.js rename to packages/fineui/src/core/wrapper/layout/fill/fill.vertical.js diff --git a/src/core/wrapper/layout/fill/float.fill.horizontal.js b/packages/fineui/src/core/wrapper/layout/fill/float.fill.horizontal.js similarity index 100% rename from src/core/wrapper/layout/fill/float.fill.horizontal.js rename to packages/fineui/src/core/wrapper/layout/fill/float.fill.horizontal.js diff --git a/src/core/wrapper/layout/fill/index.js b/packages/fineui/src/core/wrapper/layout/fill/index.js similarity index 100% rename from src/core/wrapper/layout/fill/index.js rename to packages/fineui/src/core/wrapper/layout/fill/index.js diff --git a/src/core/wrapper/layout/flex/flex.center.js b/packages/fineui/src/core/wrapper/layout/flex/flex.center.js similarity index 100% rename from src/core/wrapper/layout/flex/flex.center.js rename to packages/fineui/src/core/wrapper/layout/flex/flex.center.js diff --git a/src/core/wrapper/layout/flex/flex.horizontal.center.js b/packages/fineui/src/core/wrapper/layout/flex/flex.horizontal.center.js similarity index 100% rename from src/core/wrapper/layout/flex/flex.horizontal.center.js rename to packages/fineui/src/core/wrapper/layout/flex/flex.horizontal.center.js diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/packages/fineui/src/core/wrapper/layout/flex/flex.horizontal.js similarity index 100% rename from src/core/wrapper/layout/flex/flex.horizontal.js rename to packages/fineui/src/core/wrapper/layout/flex/flex.horizontal.js diff --git a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js b/packages/fineui/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js similarity index 100% rename from src/core/wrapper/layout/flex/flex.leftrightvertical.center.js rename to packages/fineui/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js diff --git a/src/core/wrapper/layout/flex/flex.vertical.center.js b/packages/fineui/src/core/wrapper/layout/flex/flex.vertical.center.js similarity index 100% rename from src/core/wrapper/layout/flex/flex.vertical.center.js rename to packages/fineui/src/core/wrapper/layout/flex/flex.vertical.center.js diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/packages/fineui/src/core/wrapper/layout/flex/flex.vertical.js similarity index 100% rename from src/core/wrapper/layout/flex/flex.vertical.js rename to packages/fineui/src/core/wrapper/layout/flex/flex.vertical.js diff --git a/src/core/wrapper/layout/flex/index.js b/packages/fineui/src/core/wrapper/layout/flex/index.js similarity index 100% rename from src/core/wrapper/layout/flex/index.js rename to packages/fineui/src/core/wrapper/layout/flex/index.js diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js b/packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js similarity index 100% rename from src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js rename to packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js b/packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js similarity index 100% rename from src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js rename to packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js b/packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js similarity index 100% rename from src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js rename to packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js b/packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js similarity index 100% rename from src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js rename to packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js b/packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js similarity index 100% rename from src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js rename to packages/fineui/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js diff --git a/src/core/wrapper/layout/flex/wrapper/index.js b/packages/fineui/src/core/wrapper/layout/flex/wrapper/index.js similarity index 100% rename from src/core/wrapper/layout/flex/wrapper/index.js rename to packages/fineui/src/core/wrapper/layout/flex/wrapper/index.js diff --git a/src/core/wrapper/layout/float/float.absolute.center.js b/packages/fineui/src/core/wrapper/layout/float/float.absolute.center.js similarity index 100% rename from src/core/wrapper/layout/float/float.absolute.center.js rename to packages/fineui/src/core/wrapper/layout/float/float.absolute.center.js diff --git a/src/core/wrapper/layout/float/float.absolute.horizontal.js b/packages/fineui/src/core/wrapper/layout/float/float.absolute.horizontal.js similarity index 100% rename from src/core/wrapper/layout/float/float.absolute.horizontal.js rename to packages/fineui/src/core/wrapper/layout/float/float.absolute.horizontal.js diff --git a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js b/packages/fineui/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js similarity index 100% rename from src/core/wrapper/layout/float/float.absolute.leftrightvertical.js rename to packages/fineui/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js diff --git a/src/core/wrapper/layout/float/float.absolute.vertical.js b/packages/fineui/src/core/wrapper/layout/float/float.absolute.vertical.js similarity index 100% rename from src/core/wrapper/layout/float/float.absolute.vertical.js rename to packages/fineui/src/core/wrapper/layout/float/float.absolute.vertical.js diff --git a/src/core/wrapper/layout/float/float.horizontal.js b/packages/fineui/src/core/wrapper/layout/float/float.horizontal.js similarity index 100% rename from src/core/wrapper/layout/float/float.horizontal.js rename to packages/fineui/src/core/wrapper/layout/float/float.horizontal.js diff --git a/src/core/wrapper/layout/float/index.js b/packages/fineui/src/core/wrapper/layout/float/index.js similarity index 100% rename from src/core/wrapper/layout/float/index.js rename to packages/fineui/src/core/wrapper/layout/float/index.js diff --git a/src/core/wrapper/layout/index.js b/packages/fineui/src/core/wrapper/layout/index.js similarity index 100% rename from src/core/wrapper/layout/index.js rename to packages/fineui/src/core/wrapper/layout/index.js diff --git a/src/core/wrapper/layout/layout.absolute.js b/packages/fineui/src/core/wrapper/layout/layout.absolute.js similarity index 100% rename from src/core/wrapper/layout/layout.absolute.js rename to packages/fineui/src/core/wrapper/layout/layout.absolute.js diff --git a/src/core/wrapper/layout/layout.adaptive.js b/packages/fineui/src/core/wrapper/layout/layout.adaptive.js similarity index 100% rename from src/core/wrapper/layout/layout.adaptive.js rename to packages/fineui/src/core/wrapper/layout/layout.adaptive.js diff --git a/src/core/wrapper/layout/layout.border.js b/packages/fineui/src/core/wrapper/layout/layout.border.js similarity index 100% rename from src/core/wrapper/layout/layout.border.js rename to packages/fineui/src/core/wrapper/layout/layout.border.js diff --git a/src/core/wrapper/layout/layout.card.js b/packages/fineui/src/core/wrapper/layout/layout.card.js similarity index 100% rename from src/core/wrapper/layout/layout.card.js rename to packages/fineui/src/core/wrapper/layout/layout.card.js diff --git a/src/core/wrapper/layout/layout.default.js b/packages/fineui/src/core/wrapper/layout/layout.default.js similarity index 100% rename from src/core/wrapper/layout/layout.default.js rename to packages/fineui/src/core/wrapper/layout/layout.default.js diff --git a/src/core/wrapper/layout/layout.division.js b/packages/fineui/src/core/wrapper/layout/layout.division.js similarity index 100% rename from src/core/wrapper/layout/layout.division.js rename to packages/fineui/src/core/wrapper/layout/layout.division.js diff --git a/src/core/wrapper/layout/layout.flow.js b/packages/fineui/src/core/wrapper/layout/layout.flow.js similarity index 100% rename from src/core/wrapper/layout/layout.flow.js rename to packages/fineui/src/core/wrapper/layout/layout.flow.js diff --git a/src/core/wrapper/layout/layout.grid.js b/packages/fineui/src/core/wrapper/layout/layout.grid.js similarity index 100% rename from src/core/wrapper/layout/layout.grid.js rename to packages/fineui/src/core/wrapper/layout/layout.grid.js diff --git a/src/core/wrapper/layout/layout.horizontal.js b/packages/fineui/src/core/wrapper/layout/layout.horizontal.js similarity index 100% rename from src/core/wrapper/layout/layout.horizontal.js rename to packages/fineui/src/core/wrapper/layout/layout.horizontal.js diff --git a/src/core/wrapper/layout/layout.inline.js b/packages/fineui/src/core/wrapper/layout/layout.inline.js similarity index 100% rename from src/core/wrapper/layout/layout.inline.js rename to packages/fineui/src/core/wrapper/layout/layout.inline.js diff --git a/src/core/wrapper/layout/layout.lattice.js b/packages/fineui/src/core/wrapper/layout/layout.lattice.js similarity index 100% rename from src/core/wrapper/layout/layout.lattice.js rename to packages/fineui/src/core/wrapper/layout/layout.lattice.js diff --git a/src/core/wrapper/layout/layout.table.js b/packages/fineui/src/core/wrapper/layout/layout.table.js similarity index 100% rename from src/core/wrapper/layout/layout.table.js rename to packages/fineui/src/core/wrapper/layout/layout.table.js diff --git a/src/core/wrapper/layout/layout.tape.js b/packages/fineui/src/core/wrapper/layout/layout.tape.js similarity index 100% rename from src/core/wrapper/layout/layout.tape.js rename to packages/fineui/src/core/wrapper/layout/layout.tape.js diff --git a/src/core/wrapper/layout/layout.td.js b/packages/fineui/src/core/wrapper/layout/layout.td.js similarity index 100% rename from src/core/wrapper/layout/layout.td.js rename to packages/fineui/src/core/wrapper/layout/layout.td.js diff --git a/src/core/wrapper/layout/layout.vertical.js b/packages/fineui/src/core/wrapper/layout/layout.vertical.js similarity index 100% rename from src/core/wrapper/layout/layout.vertical.js rename to packages/fineui/src/core/wrapper/layout/layout.vertical.js diff --git a/src/core/wrapper/layout/layout.window.js b/packages/fineui/src/core/wrapper/layout/layout.window.js similarity index 100% rename from src/core/wrapper/layout/layout.window.js rename to packages/fineui/src/core/wrapper/layout/layout.window.js diff --git a/src/core/wrapper/layout/middle/index.js b/packages/fineui/src/core/wrapper/layout/middle/index.js similarity index 100% rename from src/core/wrapper/layout/middle/index.js rename to packages/fineui/src/core/wrapper/layout/middle/index.js diff --git a/src/core/wrapper/layout/middle/middle.center.js b/packages/fineui/src/core/wrapper/layout/middle/middle.center.js similarity index 100% rename from src/core/wrapper/layout/middle/middle.center.js rename to packages/fineui/src/core/wrapper/layout/middle/middle.center.js diff --git a/src/core/wrapper/layout/middle/middle.float.center.js b/packages/fineui/src/core/wrapper/layout/middle/middle.float.center.js similarity index 100% rename from src/core/wrapper/layout/middle/middle.float.center.js rename to packages/fineui/src/core/wrapper/layout/middle/middle.float.center.js diff --git a/src/core/wrapper/layout/middle/middle.horizontal.js b/packages/fineui/src/core/wrapper/layout/middle/middle.horizontal.js similarity index 100% rename from src/core/wrapper/layout/middle/middle.horizontal.js rename to packages/fineui/src/core/wrapper/layout/middle/middle.horizontal.js diff --git a/src/core/wrapper/layout/middle/middle.vertical.js b/packages/fineui/src/core/wrapper/layout/middle/middle.vertical.js similarity index 100% rename from src/core/wrapper/layout/middle/middle.vertical.js rename to packages/fineui/src/core/wrapper/layout/middle/middle.vertical.js diff --git a/src/core/wrapper/layout/responsive/index.js b/packages/fineui/src/core/wrapper/layout/responsive/index.js similarity index 100% rename from src/core/wrapper/layout/responsive/index.js rename to packages/fineui/src/core/wrapper/layout/responsive/index.js diff --git a/src/core/wrapper/layout/responsive/responsive.flex.horizontal.js b/packages/fineui/src/core/wrapper/layout/responsive/responsive.flex.horizontal.js similarity index 100% rename from src/core/wrapper/layout/responsive/responsive.flex.horizontal.js rename to packages/fineui/src/core/wrapper/layout/responsive/responsive.flex.horizontal.js diff --git a/src/core/wrapper/layout/responsive/responsive.flex.wrapper.horizontal.js b/packages/fineui/src/core/wrapper/layout/responsive/responsive.flex.wrapper.horizontal.js similarity index 100% rename from src/core/wrapper/layout/responsive/responsive.flex.wrapper.horizontal.js rename to packages/fineui/src/core/wrapper/layout/responsive/responsive.flex.wrapper.horizontal.js diff --git a/src/core/wrapper/layout/responsive/responsive.inline.js b/packages/fineui/src/core/wrapper/layout/responsive/responsive.inline.js similarity index 100% rename from src/core/wrapper/layout/responsive/responsive.inline.js rename to packages/fineui/src/core/wrapper/layout/responsive/responsive.inline.js diff --git a/src/core/wrapper/layout/sticky/index.js b/packages/fineui/src/core/wrapper/layout/sticky/index.js similarity index 100% rename from src/core/wrapper/layout/sticky/index.js rename to packages/fineui/src/core/wrapper/layout/sticky/index.js diff --git a/src/core/wrapper/layout/sticky/sticky.horizontal.js b/packages/fineui/src/core/wrapper/layout/sticky/sticky.horizontal.js similarity index 100% rename from src/core/wrapper/layout/sticky/sticky.horizontal.js rename to packages/fineui/src/core/wrapper/layout/sticky/sticky.horizontal.js diff --git a/src/core/wrapper/layout/sticky/sticky.vertical.js b/packages/fineui/src/core/wrapper/layout/sticky/sticky.vertical.js similarity index 100% rename from src/core/wrapper/layout/sticky/sticky.vertical.js rename to packages/fineui/src/core/wrapper/layout/sticky/sticky.vertical.js diff --git a/src/fix/fix.compact.js b/packages/fineui/src/fix/fix.compact.js similarity index 100% rename from src/fix/fix.compact.js rename to packages/fineui/src/fix/fix.compact.js diff --git a/src/fix/fix.js b/packages/fineui/src/fix/fix.js similarity index 100% rename from src/fix/fix.js rename to packages/fineui/src/fix/fix.js diff --git a/src/fix/index.js b/packages/fineui/src/fix/index.js similarity index 100% rename from src/fix/index.js rename to packages/fineui/src/fix/index.js diff --git a/packages/fineui/src/index.js b/packages/fineui/src/index.js new file mode 100644 index 000000000..65b0a003d --- /dev/null +++ b/packages/fineui/src/index.js @@ -0,0 +1,17 @@ +// sideEffects +import "./polyfill"; +import "./core/platform/web/jquery"; +import "./core/system"; + +import _jquery from "jquery"; + +export * from "./core"; +export * from "./base"; +export * from "./case"; +export * from "./widget"; +export * from "./component"; +export * from "./fix"; +export * from "./router"; + +export const jQuery = _jquery; +export const $ = _jquery; diff --git a/src/less/base/colorchooser/colorchooser.popup.less b/packages/fineui/src/less/base/colorchooser/colorchooser.popup.less similarity index 100% rename from src/less/base/colorchooser/colorchooser.popup.less rename to packages/fineui/src/less/base/colorchooser/colorchooser.popup.less diff --git a/src/less/base/colorchooser/colorchooser.trigger.less b/packages/fineui/src/less/base/colorchooser/colorchooser.trigger.less similarity index 100% rename from src/less/base/colorchooser/colorchooser.trigger.less rename to packages/fineui/src/less/base/colorchooser/colorchooser.trigger.less diff --git a/src/less/base/colorchooser/colorpicker/button.colorpicker.less b/packages/fineui/src/less/base/colorchooser/colorpicker/button.colorpicker.less similarity index 100% rename from src/less/base/colorchooser/colorpicker/button.colorpicker.less rename to packages/fineui/src/less/base/colorchooser/colorpicker/button.colorpicker.less diff --git a/src/less/base/colorchooser/colorpicker/button.colorshow.less b/packages/fineui/src/less/base/colorchooser/colorpicker/button.colorshow.less similarity index 100% rename from src/less/base/colorchooser/colorpicker/button.colorshow.less rename to packages/fineui/src/less/base/colorchooser/colorpicker/button.colorshow.less diff --git a/src/less/base/colorchooser/colorpicker/editor.colorpicker.less b/packages/fineui/src/less/base/colorchooser/colorpicker/editor.colorpicker.less similarity index 100% rename from src/less/base/colorchooser/colorpicker/editor.colorpicker.less rename to packages/fineui/src/less/base/colorchooser/colorpicker/editor.colorpicker.less diff --git a/src/less/base/colorchooser/farbtastic/farbtastic.less b/packages/fineui/src/less/base/colorchooser/farbtastic/farbtastic.less similarity index 100% rename from src/less/base/colorchooser/farbtastic/farbtastic.less rename to packages/fineui/src/less/base/colorchooser/farbtastic/farbtastic.less diff --git a/src/less/base/combo/combo.bubble.less b/packages/fineui/src/less/base/combo/combo.bubble.less similarity index 100% rename from src/less/base/combo/combo.bubble.less rename to packages/fineui/src/less/base/combo/combo.bubble.less diff --git a/src/less/base/combo/combo.less b/packages/fineui/src/less/base/combo/combo.less similarity index 100% rename from src/less/base/combo/combo.less rename to packages/fineui/src/less/base/combo/combo.less diff --git a/src/less/base/combo/combo.searchtextvalue.less b/packages/fineui/src/less/base/combo/combo.searchtextvalue.less similarity index 100% rename from src/less/base/combo/combo.searchtextvalue.less rename to packages/fineui/src/less/base/combo/combo.searchtextvalue.less diff --git a/src/less/base/combo/combo.textvalue.icon.less b/packages/fineui/src/less/base/combo/combo.textvalue.icon.less similarity index 100% rename from src/less/base/combo/combo.textvalue.icon.less rename to packages/fineui/src/less/base/combo/combo.textvalue.icon.less diff --git a/src/less/base/combo/combo.textvalue.less b/packages/fineui/src/less/base/combo/combo.textvalue.less similarity index 100% rename from src/less/base/combo/combo.textvalue.less rename to packages/fineui/src/less/base/combo/combo.textvalue.less diff --git a/src/less/base/combo/combo.textvaluecheck.less b/packages/fineui/src/less/base/combo/combo.textvaluecheck.less similarity index 100% rename from src/less/base/combo/combo.textvaluecheck.less rename to packages/fineui/src/less/base/combo/combo.textvaluecheck.less diff --git a/src/less/base/combo/combo.textvaluedownlist.less b/packages/fineui/src/less/base/combo/combo.textvaluedownlist.less similarity index 100% rename from src/less/base/combo/combo.textvaluedownlist.less rename to packages/fineui/src/less/base/combo/combo.textvaluedownlist.less diff --git a/src/less/base/combo/popup.bubble.bar.less b/packages/fineui/src/less/base/combo/popup.bubble.bar.less similarity index 100% rename from src/less/base/combo/popup.bubble.bar.less rename to packages/fineui/src/less/base/combo/popup.bubble.bar.less diff --git a/src/less/base/combo/popup.bubble.less b/packages/fineui/src/less/base/combo/popup.bubble.less similarity index 100% rename from src/less/base/combo/popup.bubble.less rename to packages/fineui/src/less/base/combo/popup.bubble.less diff --git a/src/less/base/editor/editor.search.less b/packages/fineui/src/less/base/editor/editor.search.less similarity index 100% rename from src/less/base/editor/editor.search.less rename to packages/fineui/src/less/base/editor/editor.search.less diff --git a/src/less/base/editor/editor.search.small.less b/packages/fineui/src/less/base/editor/editor.search.small.less similarity index 100% rename from src/less/base/editor/editor.search.small.less rename to packages/fineui/src/less/base/editor/editor.search.small.less diff --git a/src/less/base/foundation/bi.message.less b/packages/fineui/src/less/base/foundation/bi.message.less similarity index 100% rename from src/less/base/foundation/bi.message.less rename to packages/fineui/src/less/base/foundation/bi.message.less diff --git a/src/less/base/layer/layer.multiselect.less b/packages/fineui/src/less/base/layer/layer.multiselect.less similarity index 100% rename from src/less/base/layer/layer.multiselect.less rename to packages/fineui/src/less/base/layer/layer.multiselect.less diff --git a/src/less/base/layer/panel.less b/packages/fineui/src/less/base/layer/panel.less similarity index 100% rename from src/less/base/layer/panel.less rename to packages/fineui/src/less/base/layer/panel.less diff --git a/src/less/base/loader/sort.list.less b/packages/fineui/src/less/base/loader/sort.list.less similarity index 100% rename from src/less/base/loader/sort.list.less rename to packages/fineui/src/less/base/loader/sort.list.less diff --git a/src/less/base/pager/pager.all.count.less b/packages/fineui/src/less/base/pager/pager.all.count.less similarity index 100% rename from src/less/base/pager/pager.all.count.less rename to packages/fineui/src/less/base/pager/pager.all.count.less diff --git a/src/less/base/pager/pager.direction.less b/packages/fineui/src/less/base/pager/pager.direction.less similarity index 100% rename from src/less/base/pager/pager.direction.less rename to packages/fineui/src/less/base/pager/pager.direction.less diff --git a/src/less/base/pager/pager.less b/packages/fineui/src/less/base/pager/pager.less similarity index 100% rename from src/less/base/pager/pager.less rename to packages/fineui/src/less/base/pager/pager.less diff --git a/src/less/base/pane.less b/packages/fineui/src/less/base/pane.less similarity index 100% rename from src/less/base/pane.less rename to packages/fineui/src/less/base/pane.less diff --git a/src/less/base/segment/button.segment.less b/packages/fineui/src/less/base/segment/button.segment.less similarity index 100% rename from src/less/base/segment/button.segment.less rename to packages/fineui/src/less/base/segment/button.segment.less diff --git a/src/less/base/segment/segment.less b/packages/fineui/src/less/base/segment/segment.less similarity index 100% rename from src/less/base/segment/segment.less rename to packages/fineui/src/less/base/segment/segment.less diff --git a/src/less/base/single/button/button.half.less b/packages/fineui/src/less/base/single/button/button.half.less similarity index 100% rename from src/less/base/single/button/button.half.less rename to packages/fineui/src/less/base/single/button/button.half.less diff --git a/src/less/base/single/button/button.less b/packages/fineui/src/less/base/single/button/button.less similarity index 100% rename from src/less/base/single/button/button.less rename to packages/fineui/src/less/base/single/button/button.less diff --git a/src/less/base/single/button/switch.less b/packages/fineui/src/less/base/single/button/switch.less similarity index 100% rename from src/less/base/single/button/switch.less rename to packages/fineui/src/less/base/single/button/switch.less diff --git a/src/less/base/single/editor/editor.multifile.less b/packages/fineui/src/less/base/single/editor/editor.multifile.less similarity index 100% rename from src/less/base/single/editor/editor.multifile.less rename to packages/fineui/src/less/base/single/editor/editor.multifile.less diff --git a/src/less/base/single/editor/editor.textarea.less b/packages/fineui/src/less/base/single/editor/editor.textarea.less similarity index 100% rename from src/less/base/single/editor/editor.textarea.less rename to packages/fineui/src/less/base/single/editor/editor.textarea.less diff --git a/src/less/base/single/html.less b/packages/fineui/src/less/base/single/html.less similarity index 100% rename from src/less/base/single/html.less rename to packages/fineui/src/less/base/single/html.less diff --git a/src/less/base/single/input/checkbox.less b/packages/fineui/src/less/base/single/input/checkbox.less similarity index 100% rename from src/less/base/single/input/checkbox.less rename to packages/fineui/src/less/base/single/input/checkbox.less diff --git a/src/less/base/single/input/file.less b/packages/fineui/src/less/base/single/input/file.less similarity index 100% rename from src/less/base/single/input/file.less rename to packages/fineui/src/less/base/single/input/file.less diff --git a/src/less/base/single/input/input.less b/packages/fineui/src/less/base/single/input/input.less similarity index 100% rename from src/less/base/single/input/input.less rename to packages/fineui/src/less/base/single/input/input.less diff --git a/src/less/base/single/input/radio.less b/packages/fineui/src/less/base/single/input/radio.less similarity index 100% rename from src/less/base/single/input/radio.less rename to packages/fineui/src/less/base/single/input/radio.less diff --git a/src/less/base/single/instruction.less b/packages/fineui/src/less/base/single/instruction.less similarity index 100% rename from src/less/base/single/instruction.less rename to packages/fineui/src/less/base/single/instruction.less diff --git a/src/less/base/single/label.less b/packages/fineui/src/less/base/single/label.less similarity index 100% rename from src/less/base/single/label.less rename to packages/fineui/src/less/base/single/label.less diff --git a/src/less/base/single/text.less b/packages/fineui/src/less/base/single/text.less similarity index 100% rename from src/less/base/single/text.less rename to packages/fineui/src/less/base/single/text.less diff --git a/src/less/base/single/tip/tip.bubble.less b/packages/fineui/src/less/base/single/tip/tip.bubble.less similarity index 100% rename from src/less/base/single/tip/tip.bubble.less rename to packages/fineui/src/less/base/single/tip/tip.bubble.less diff --git a/src/less/base/single/tip/tip.less b/packages/fineui/src/less/base/single/tip/tip.less similarity index 100% rename from src/less/base/single/tip/tip.less rename to packages/fineui/src/less/base/single/tip/tip.less diff --git a/src/less/base/single/tip/tip.toast.less b/packages/fineui/src/less/base/single/tip/tip.toast.less similarity index 100% rename from src/less/base/single/tip/tip.toast.less rename to packages/fineui/src/less/base/single/tip/tip.toast.less diff --git a/src/less/base/single/tip/tip.tooltip.less b/packages/fineui/src/less/base/single/tip/tip.tooltip.less similarity index 100% rename from src/less/base/single/tip/tip.tooltip.less rename to packages/fineui/src/less/base/single/tip/tip.tooltip.less diff --git a/src/less/base/tree/tree.branch.less b/packages/fineui/src/less/base/tree/tree.branch.less similarity index 100% rename from src/less/base/tree/tree.branch.less rename to packages/fineui/src/less/base/tree/tree.branch.less diff --git a/src/less/base/tree/tree.display.less b/packages/fineui/src/less/base/tree/tree.display.less similarity index 100% rename from src/less/base/tree/tree.display.less rename to packages/fineui/src/less/base/tree/tree.display.less diff --git a/src/less/base/tree/tree.expander.less b/packages/fineui/src/less/base/tree/tree.expander.less similarity index 100% rename from src/less/base/tree/tree.expander.less rename to packages/fineui/src/less/base/tree/tree.expander.less diff --git a/src/less/base/tree/tree.list.display.less b/packages/fineui/src/less/base/tree/tree.list.display.less similarity index 100% rename from src/less/base/tree/tree.list.display.less rename to packages/fineui/src/less/base/tree/tree.list.display.less diff --git a/src/less/base/tree/ztree.less b/packages/fineui/src/less/base/tree/ztree.less similarity index 100% rename from src/less/base/tree/ztree.less rename to packages/fineui/src/less/base/tree/ztree.less diff --git a/src/less/base/trigger/trigger.less b/packages/fineui/src/less/base/trigger/trigger.less similarity index 100% rename from src/less/base/trigger/trigger.less rename to packages/fineui/src/less/base/trigger/trigger.less diff --git a/src/less/base/trigger/trigger.searchtextvalue.less b/packages/fineui/src/less/base/trigger/trigger.searchtextvalue.less similarity index 100% rename from src/less/base/trigger/trigger.searchtextvalue.less rename to packages/fineui/src/less/base/trigger/trigger.searchtextvalue.less diff --git a/src/less/base/trigger/trigger.selecttext.less b/packages/fineui/src/less/base/trigger/trigger.selecttext.less similarity index 100% rename from src/less/base/trigger/trigger.selecttext.less rename to packages/fineui/src/less/base/trigger/trigger.selecttext.less diff --git a/src/less/base/trigger/trigger.selecttextsmall.less b/packages/fineui/src/less/base/trigger/trigger.selecttextsmall.less similarity index 100% rename from src/less/base/trigger/trigger.selecttextsmall.less rename to packages/fineui/src/less/base/trigger/trigger.selecttextsmall.less diff --git a/src/less/base/trigger/trigger.text.less b/packages/fineui/src/less/base/trigger/trigger.text.less similarity index 100% rename from src/less/base/trigger/trigger.text.less rename to packages/fineui/src/less/base/trigger/trigger.text.less diff --git a/src/less/base/view/drawer.less b/packages/fineui/src/less/base/view/drawer.less similarity index 100% rename from src/less/base/view/drawer.less rename to packages/fineui/src/less/base/view/drawer.less diff --git a/src/less/base/view/popover.less b/packages/fineui/src/less/base/view/popover.less similarity index 100% rename from src/less/base/view/popover.less rename to packages/fineui/src/less/base/view/popover.less diff --git a/src/less/base/view/popupview.less b/packages/fineui/src/less/base/view/popupview.less similarity index 100% rename from src/less/base/view/popupview.less rename to packages/fineui/src/less/base/view/popupview.less diff --git a/src/less/box-model.less b/packages/fineui/src/less/box-model.less similarity index 100% rename from src/less/box-model.less rename to packages/fineui/src/less/box-model.less diff --git a/src/less/case/tree/tree.item.less b/packages/fineui/src/less/case/tree/tree.item.less similarity index 100% rename from src/less/case/tree/tree.item.less rename to packages/fineui/src/less/case/tree/tree.item.less diff --git a/src/less/component/form/form.less b/packages/fineui/src/less/component/form/form.less similarity index 100% rename from src/less/component/form/form.less rename to packages/fineui/src/less/component/form/form.less diff --git a/src/less/core/normalize.less b/packages/fineui/src/less/core/normalize.less similarity index 100% rename from src/less/core/normalize.less rename to packages/fineui/src/less/core/normalize.less diff --git a/src/less/core/normalize2.less b/packages/fineui/src/less/core/normalize2.less similarity index 100% rename from src/less/core/normalize2.less rename to packages/fineui/src/less/core/normalize2.less diff --git a/src/less/core/utils/animation.less b/packages/fineui/src/less/core/utils/animation.less similarity index 100% rename from src/less/core/utils/animation.less rename to packages/fineui/src/less/core/utils/animation.less diff --git a/src/less/core/utils/common.less b/packages/fineui/src/less/core/utils/common.less similarity index 100% rename from src/less/core/utils/common.less rename to packages/fineui/src/less/core/utils/common.less diff --git a/src/less/core/utils/cursor.less b/packages/fineui/src/less/core/utils/cursor.less similarity index 100% rename from src/less/core/utils/cursor.less rename to packages/fineui/src/less/core/utils/cursor.less diff --git a/src/less/core/utils/list-item.less b/packages/fineui/src/less/core/utils/list-item.less similarity index 100% rename from src/less/core/utils/list-item.less rename to packages/fineui/src/less/core/utils/list-item.less diff --git a/src/less/core/utils/motion/fade.less b/packages/fineui/src/less/core/utils/motion/fade.less similarity index 100% rename from src/less/core/utils/motion/fade.less rename to packages/fineui/src/less/core/utils/motion/fade.less diff --git a/src/less/core/utils/motion/move.less b/packages/fineui/src/less/core/utils/motion/move.less similarity index 100% rename from src/less/core/utils/motion/move.less rename to packages/fineui/src/less/core/utils/motion/move.less diff --git a/src/less/core/utils/motion/slide.less b/packages/fineui/src/less/core/utils/motion/slide.less similarity index 100% rename from src/less/core/utils/motion/slide.less rename to packages/fineui/src/less/core/utils/motion/slide.less diff --git a/src/less/core/utils/motion/zoom.less b/packages/fineui/src/less/core/utils/motion/zoom.less similarity index 100% rename from src/less/core/utils/motion/zoom.less rename to packages/fineui/src/less/core/utils/motion/zoom.less diff --git a/src/less/core/utils/position.less b/packages/fineui/src/less/core/utils/position.less similarity index 100% rename from src/less/core/utils/position.less rename to packages/fineui/src/less/core/utils/position.less diff --git a/src/less/core/utils/size.less b/packages/fineui/src/less/core/utils/size.less similarity index 100% rename from src/less/core/utils/size.less rename to packages/fineui/src/less/core/utils/size.less diff --git a/src/less/core/utils/sizing.less b/packages/fineui/src/less/core/utils/sizing.less similarity index 100% rename from src/less/core/utils/sizing.less rename to packages/fineui/src/less/core/utils/sizing.less diff --git a/src/less/core/utils/typographic.less b/packages/fineui/src/less/core/utils/typographic.less similarity index 100% rename from src/less/core/utils/typographic.less rename to packages/fineui/src/less/core/utils/typographic.less diff --git a/src/less/core/wrapper/flex.horizontal.less b/packages/fineui/src/less/core/wrapper/flex.horizontal.less similarity index 100% rename from src/less/core/wrapper/flex.horizontal.less rename to packages/fineui/src/less/core/wrapper/flex.horizontal.less diff --git a/src/less/core/wrapper/flex.vertical.less b/packages/fineui/src/less/core/wrapper/flex.vertical.less similarity index 100% rename from src/less/core/wrapper/flex.vertical.less rename to packages/fineui/src/less/core/wrapper/flex.vertical.less diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/packages/fineui/src/less/core/wrapper/flex.wrapper.horizontal.less similarity index 100% rename from src/less/core/wrapper/flex.wrapper.horizontal.less rename to packages/fineui/src/less/core/wrapper/flex.wrapper.horizontal.less diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/packages/fineui/src/less/core/wrapper/flex.wrapper.vertical.less similarity index 100% rename from src/less/core/wrapper/flex.wrapper.vertical.less rename to packages/fineui/src/less/core/wrapper/flex.wrapper.vertical.less diff --git a/src/less/core/wrapper/float.absolute.less b/packages/fineui/src/less/core/wrapper/float.absolute.less similarity index 100% rename from src/less/core/wrapper/float.absolute.less rename to packages/fineui/src/less/core/wrapper/float.absolute.less diff --git a/src/less/core/wrapper/inline.less b/packages/fineui/src/less/core/wrapper/inline.less similarity index 100% rename from src/less/core/wrapper/inline.less rename to packages/fineui/src/less/core/wrapper/inline.less diff --git a/src/less/core/wrapper/inline.old.less b/packages/fineui/src/less/core/wrapper/inline.old.less similarity index 100% rename from src/less/core/wrapper/inline.old.less rename to packages/fineui/src/less/core/wrapper/inline.old.less diff --git a/src/less/core/wrapper/table.less b/packages/fineui/src/less/core/wrapper/table.less similarity index 100% rename from src/less/core/wrapper/table.less rename to packages/fineui/src/less/core/wrapper/table.less diff --git a/src/less/image.less b/packages/fineui/src/less/image.less similarity index 100% rename from src/less/image.less rename to packages/fineui/src/less/image.less diff --git a/src/less/index.less b/packages/fineui/src/less/index.less similarity index 100% rename from src/less/index.less rename to packages/fineui/src/less/index.less diff --git a/src/less/lib/background.less b/packages/fineui/src/less/lib/background.less similarity index 100% rename from src/less/lib/background.less rename to packages/fineui/src/less/lib/background.less diff --git a/src/less/lib/colors.less b/packages/fineui/src/less/lib/colors.less similarity index 100% rename from src/less/lib/colors.less rename to packages/fineui/src/less/lib/colors.less diff --git a/src/less/lib/constant.less b/packages/fineui/src/less/lib/constant.less similarity index 100% rename from src/less/lib/constant.less rename to packages/fineui/src/less/lib/constant.less diff --git a/src/less/lib/font.less b/packages/fineui/src/less/lib/font.less similarity index 100% rename from src/less/lib/font.less rename to packages/fineui/src/less/lib/font.less diff --git a/src/less/lib/icon.less b/packages/fineui/src/less/lib/icon.less similarity index 100% rename from src/less/lib/icon.less rename to packages/fineui/src/less/lib/icon.less diff --git a/src/less/lib/theme-modern.less b/packages/fineui/src/less/lib/theme-modern.less similarity index 100% rename from src/less/lib/theme-modern.less rename to packages/fineui/src/less/lib/theme-modern.less diff --git a/src/less/lib/theme.less b/packages/fineui/src/less/lib/theme.less similarity index 100% rename from src/less/lib/theme.less rename to packages/fineui/src/less/lib/theme.less diff --git a/src/less/motion.less b/packages/fineui/src/less/motion.less similarity index 100% rename from src/less/motion.less rename to packages/fineui/src/less/motion.less diff --git a/src/less/position.less b/packages/fineui/src/less/position.less similarity index 100% rename from src/less/position.less rename to packages/fineui/src/less/position.less diff --git a/src/less/resource/app.less b/packages/fineui/src/less/resource/app.less similarity index 100% rename from src/less/resource/app.less rename to packages/fineui/src/less/resource/app.less diff --git a/src/less/resource/background.less b/packages/fineui/src/less/resource/background.less similarity index 100% rename from src/less/resource/background.less rename to packages/fineui/src/less/resource/background.less diff --git a/src/less/resource/font.less b/packages/fineui/src/less/resource/font.less similarity index 100% rename from src/less/resource/font.less rename to packages/fineui/src/less/resource/font.less diff --git a/src/less/resource/icon.less b/packages/fineui/src/less/resource/icon.less similarity index 100% rename from src/less/resource/icon.less rename to packages/fineui/src/less/resource/icon.less diff --git a/src/less/theme/dark.less b/packages/fineui/src/less/theme/dark.less similarity index 100% rename from src/less/theme/dark.less rename to packages/fineui/src/less/theme/dark.less diff --git a/src/less/theme/default.less b/packages/fineui/src/less/theme/default.less similarity index 100% rename from src/less/theme/default.less rename to packages/fineui/src/less/theme/default.less diff --git a/src/less/theme/light.less b/packages/fineui/src/less/theme/light.less similarity index 100% rename from src/less/theme/light.less rename to packages/fineui/src/less/theme/light.less diff --git a/src/less/typographic.less b/packages/fineui/src/less/typographic.less similarity index 100% rename from src/less/typographic.less rename to packages/fineui/src/less/typographic.less diff --git a/src/less/var.less b/packages/fineui/src/less/var.less similarity index 100% rename from src/less/var.less rename to packages/fineui/src/less/var.less diff --git a/src/less/visual.less b/packages/fineui/src/less/visual.less similarity index 100% rename from src/less/visual.less rename to packages/fineui/src/less/visual.less diff --git a/src/less/widget/date/trigger.date.less b/packages/fineui/src/less/widget/date/trigger.date.less similarity index 100% rename from src/less/widget/date/trigger.date.less rename to packages/fineui/src/less/widget/date/trigger.date.less diff --git a/src/less/widget/downlist/popup.downlist.less b/packages/fineui/src/less/widget/downlist/popup.downlist.less similarity index 100% rename from src/less/widget/downlist/popup.downlist.less rename to packages/fineui/src/less/widget/downlist/popup.downlist.less diff --git a/src/less/widget/dynamicdatecombo/dynamicdatepopup.less b/packages/fineui/src/less/widget/dynamicdatecombo/dynamicdatepopup.less similarity index 100% rename from src/less/widget/dynamicdatecombo/dynamicdatepopup.less rename to packages/fineui/src/less/widget/dynamicdatecombo/dynamicdatepopup.less diff --git a/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less b/packages/fineui/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less similarity index 100% rename from src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less rename to packages/fineui/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less diff --git a/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less b/packages/fineui/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less similarity index 100% rename from src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less rename to packages/fineui/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less diff --git a/src/less/widget/intervalslider/intervalslider.label.less b/packages/fineui/src/less/widget/intervalslider/intervalslider.label.less similarity index 100% rename from src/less/widget/intervalslider/intervalslider.label.less rename to packages/fineui/src/less/widget/intervalslider/intervalslider.label.less diff --git a/src/less/widget/intervalslider/intervalslider.less b/packages/fineui/src/less/widget/intervalslider/intervalslider.less similarity index 100% rename from src/less/widget/intervalslider/intervalslider.less rename to packages/fineui/src/less/widget/intervalslider/intervalslider.less diff --git a/src/less/widget/month/trigger.month.less b/packages/fineui/src/less/widget/month/trigger.month.less similarity index 100% rename from src/less/widget/month/trigger.month.less rename to packages/fineui/src/less/widget/month/trigger.month.less diff --git a/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less b/packages/fineui/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less similarity index 100% rename from src/less/widget/multilayerselecttree/multilayerselecttree.combo.less rename to packages/fineui/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less diff --git a/src/less/widget/multilayerselecttree/multilayerselecttree.leveltree.less b/packages/fineui/src/less/widget/multilayerselecttree/multilayerselecttree.leveltree.less similarity index 100% rename from src/less/widget/multilayerselecttree/multilayerselecttree.leveltree.less rename to packages/fineui/src/less/widget/multilayerselecttree/multilayerselecttree.leveltree.less diff --git a/src/less/widget/multilayersingletree/multilayersingletree.combo.less b/packages/fineui/src/less/widget/multilayersingletree/multilayersingletree.combo.less similarity index 100% rename from src/less/widget/multilayersingletree/multilayersingletree.combo.less rename to packages/fineui/src/less/widget/multilayersingletree/multilayersingletree.combo.less diff --git a/src/less/widget/multilayersingletree/multilayersingletree.leveltree.less b/packages/fineui/src/less/widget/multilayersingletree/multilayersingletree.leveltree.less similarity index 100% rename from src/less/widget/multilayersingletree/multilayersingletree.leveltree.less rename to packages/fineui/src/less/widget/multilayersingletree/multilayersingletree.leveltree.less diff --git a/src/less/widget/multiselect/check/multiselect.check.pane.less b/packages/fineui/src/less/widget/multiselect/check/multiselect.check.pane.less similarity index 100% rename from src/less/widget/multiselect/check/multiselect.check.pane.less rename to packages/fineui/src/less/widget/multiselect/check/multiselect.check.pane.less diff --git a/src/less/widget/multiselect/multiselect.combo.less b/packages/fineui/src/less/widget/multiselect/multiselect.combo.less similarity index 100% rename from src/less/widget/multiselect/multiselect.combo.less rename to packages/fineui/src/less/widget/multiselect/multiselect.combo.less diff --git a/src/less/widget/multiselect/multiselect.insert.combo.less b/packages/fineui/src/less/widget/multiselect/multiselect.insert.combo.less similarity index 100% rename from src/less/widget/multiselect/multiselect.insert.combo.less rename to packages/fineui/src/less/widget/multiselect/multiselect.insert.combo.less diff --git a/src/less/widget/multiselect/search/multiselect.search.pane.less b/packages/fineui/src/less/widget/multiselect/search/multiselect.search.pane.less similarity index 100% rename from src/less/widget/multiselect/search/multiselect.search.pane.less rename to packages/fineui/src/less/widget/multiselect/search/multiselect.search.pane.less diff --git a/src/less/widget/multiselect/trigger/button.checkselected.less b/packages/fineui/src/less/widget/multiselect/trigger/button.checkselected.less similarity index 100% rename from src/less/widget/multiselect/trigger/button.checkselected.less rename to packages/fineui/src/less/widget/multiselect/trigger/button.checkselected.less diff --git a/src/less/widget/multistringlist/multistringlist.insert.less b/packages/fineui/src/less/widget/multistringlist/multistringlist.insert.less similarity index 100% rename from src/less/widget/multistringlist/multistringlist.insert.less rename to packages/fineui/src/less/widget/multistringlist/multistringlist.insert.less diff --git a/src/less/widget/multistringlist/multistringlist.less b/packages/fineui/src/less/widget/multistringlist/multistringlist.less similarity index 100% rename from src/less/widget/multistringlist/multistringlist.less rename to packages/fineui/src/less/widget/multistringlist/multistringlist.less diff --git a/src/less/widget/multitree/check/multi.tree.check.pane.less b/packages/fineui/src/less/widget/multitree/check/multi.tree.check.pane.less similarity index 100% rename from src/less/widget/multitree/check/multi.tree.check.pane.less rename to packages/fineui/src/less/widget/multitree/check/multi.tree.check.pane.less diff --git a/src/less/widget/multitree/multi.tree.combo.less b/packages/fineui/src/less/widget/multitree/multi.tree.combo.less similarity index 100% rename from src/less/widget/multitree/multi.tree.combo.less rename to packages/fineui/src/less/widget/multitree/multi.tree.combo.less diff --git a/src/less/widget/multitree/popup.multi.tree.less b/packages/fineui/src/less/widget/multitree/popup.multi.tree.less similarity index 100% rename from src/less/widget/multitree/popup.multi.tree.less rename to packages/fineui/src/less/widget/multitree/popup.multi.tree.less diff --git a/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less b/packages/fineui/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less similarity index 100% rename from src/less/widget/multitree/trigger/multi.tree.button.checkselected.less rename to packages/fineui/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less diff --git a/src/less/widget/numbereditor/number.editor.less b/packages/fineui/src/less/widget/numbereditor/number.editor.less similarity index 100% rename from src/less/widget/numbereditor/number.editor.less rename to packages/fineui/src/less/widget/numbereditor/number.editor.less diff --git a/src/less/widget/numberinterval/numberinterval.less b/packages/fineui/src/less/widget/numberinterval/numberinterval.less similarity index 100% rename from src/less/widget/numberinterval/numberinterval.less rename to packages/fineui/src/less/widget/numberinterval/numberinterval.less diff --git a/src/less/widget/quarter/trigger.quarter.less b/packages/fineui/src/less/widget/quarter/trigger.quarter.less similarity index 100% rename from src/less/widget/quarter/trigger.quarter.less rename to packages/fineui/src/less/widget/quarter/trigger.quarter.less diff --git a/src/less/widget/searchmultiselect/searchmultiselect.less b/packages/fineui/src/less/widget/searchmultiselect/searchmultiselect.less similarity index 100% rename from src/less/widget/searchmultiselect/searchmultiselect.less rename to packages/fineui/src/less/widget/searchmultiselect/searchmultiselect.less diff --git a/src/less/widget/singleselect/search/singleselect.search.pane.less b/packages/fineui/src/less/widget/singleselect/search/singleselect.search.pane.less similarity index 100% rename from src/less/widget/singleselect/search/singleselect.search.pane.less rename to packages/fineui/src/less/widget/singleselect/search/singleselect.search.pane.less diff --git a/src/less/widget/singleselect/singleselect.combo.less b/packages/fineui/src/less/widget/singleselect/singleselect.combo.less similarity index 100% rename from src/less/widget/singleselect/singleselect.combo.less rename to packages/fineui/src/less/widget/singleselect/singleselect.combo.less diff --git a/src/less/widget/singleslider/singlelider.label.less b/packages/fineui/src/less/widget/singleslider/singlelider.label.less similarity index 100% rename from src/less/widget/singleslider/singlelider.label.less rename to packages/fineui/src/less/widget/singleslider/singlelider.label.less diff --git a/src/less/widget/singleslider/singlelider.normal.less b/packages/fineui/src/less/widget/singleslider/singlelider.normal.less similarity index 100% rename from src/less/widget/singleslider/singlelider.normal.less rename to packages/fineui/src/less/widget/singleslider/singlelider.normal.less diff --git a/src/less/widget/singleslider/singleslider.less b/packages/fineui/src/less/widget/singleslider/singleslider.less similarity index 100% rename from src/less/widget/singleslider/singleslider.less rename to packages/fineui/src/less/widget/singleslider/singleslider.less diff --git a/src/less/widget/singleslider/slider/widget.slider.less b/packages/fineui/src/less/widget/singleslider/slider/widget.slider.less similarity index 100% rename from src/less/widget/singleslider/slider/widget.slider.less rename to packages/fineui/src/less/widget/singleslider/slider/widget.slider.less diff --git a/src/less/widget/singleslider/track/widget.track.less b/packages/fineui/src/less/widget/singleslider/track/widget.track.less similarity index 100% rename from src/less/widget/singleslider/track/widget.track.less rename to packages/fineui/src/less/widget/singleslider/track/widget.track.less diff --git a/src/less/widget/timecombo/timecombo.less b/packages/fineui/src/less/widget/timecombo/timecombo.less similarity index 100% rename from src/less/widget/timecombo/timecombo.less rename to packages/fineui/src/less/widget/timecombo/timecombo.less diff --git a/src/less/widget/timeinterval/dateinterval.less b/packages/fineui/src/less/widget/timeinterval/dateinterval.less similarity index 100% rename from src/less/widget/timeinterval/dateinterval.less rename to packages/fineui/src/less/widget/timeinterval/dateinterval.less diff --git a/src/less/widget/timeinterval/timeinterval.less b/packages/fineui/src/less/widget/timeinterval/timeinterval.less similarity index 100% rename from src/less/widget/timeinterval/timeinterval.less rename to packages/fineui/src/less/widget/timeinterval/timeinterval.less diff --git a/src/less/widget/year/popup.year.less b/packages/fineui/src/less/widget/year/popup.year.less similarity index 100% rename from src/less/widget/year/popup.year.less rename to packages/fineui/src/less/widget/year/popup.year.less diff --git a/src/less/widget/year/trigger.year.less b/packages/fineui/src/less/widget/year/trigger.year.less similarity index 100% rename from src/less/widget/year/trigger.year.less rename to packages/fineui/src/less/widget/year/trigger.year.less diff --git a/src/less/widget/yearinterval/yearinterval.less b/packages/fineui/src/less/widget/yearinterval/yearinterval.less similarity index 100% rename from src/less/widget/yearinterval/yearinterval.less rename to packages/fineui/src/less/widget/yearinterval/yearinterval.less diff --git a/src/less/widget/yearmonth/popup.yearmonth.less b/packages/fineui/src/less/widget/yearmonth/popup.yearmonth.less similarity index 100% rename from src/less/widget/yearmonth/popup.yearmonth.less rename to packages/fineui/src/less/widget/yearmonth/popup.yearmonth.less diff --git a/src/less/widget/yearmonthinterval/yearmonthinterval.less b/packages/fineui/src/less/widget/yearmonthinterval/yearmonthinterval.less similarity index 100% rename from src/less/widget/yearmonthinterval/yearmonthinterval.less rename to packages/fineui/src/less/widget/yearmonthinterval/yearmonthinterval.less diff --git a/src/less/widget/yearquarter/popup.yearquarter.less b/packages/fineui/src/less/widget/yearquarter/popup.yearquarter.less similarity index 100% rename from src/less/widget/yearquarter/popup.yearquarter.less rename to packages/fineui/src/less/widget/yearquarter/popup.yearquarter.less diff --git a/src/less/widget/yearquarterinterval/yearquarterinterval.less b/packages/fineui/src/less/widget/yearquarterinterval/yearquarterinterval.less similarity index 100% rename from src/less/widget/yearquarterinterval/yearquarterinterval.less rename to packages/fineui/src/less/widget/yearquarterinterval/yearquarterinterval.less diff --git a/src/polyfill/event.js b/packages/fineui/src/polyfill/event.js similarity index 100% rename from src/polyfill/event.js rename to packages/fineui/src/polyfill/event.js diff --git a/src/polyfill/index.js b/packages/fineui/src/polyfill/index.js similarity index 100% rename from src/polyfill/index.js rename to packages/fineui/src/polyfill/index.js diff --git a/src/polyfill/number.js b/packages/fineui/src/polyfill/number.js similarity index 100% rename from src/polyfill/number.js rename to packages/fineui/src/polyfill/number.js diff --git a/src/polyfill/sort.js b/packages/fineui/src/polyfill/sort.js similarity index 100% rename from src/polyfill/sort.js rename to packages/fineui/src/polyfill/sort.js diff --git a/src/router/0.router.js b/packages/fineui/src/router/0.router.js similarity index 100% rename from src/router/0.router.js rename to packages/fineui/src/router/0.router.js diff --git a/src/router/index.js b/packages/fineui/src/router/index.js similarity index 100% rename from src/router/index.js rename to packages/fineui/src/router/index.js diff --git a/packages/fineui/src/router/router.js b/packages/fineui/src/router/router.js new file mode 100644 index 000000000..f58c8402b --- /dev/null +++ b/packages/fineui/src/router/router.js @@ -0,0 +1,3143 @@ +import { nextTick, shortcut, Widget, isNotNull, each } from '@/core'; +import { Tab } from '@/base'; +import { Router } from './0.router'; +import { Fix } from '../fix'; + +function assert(condition, message) { + if (!condition) { + throw new Error(`[vue-router] ${message}`); + } +} + +function warn(condition, message) { + if (!condition) { + typeof console !== 'undefined' && console.warn(`[vue-router] ${message}`); + } +} + +function extend(a, b) { + for (const key in b) { + a[key] = b[key]; + } + + return a; +} + +/* */ + +const encodeReserveRE = /[!'()*]/g; +const encodeReserveReplacer = function (c) { + return `%${c.charCodeAt(0).toString(16)}`; +}; +const commaRE = /%2C/g; + +// fixed encodeURIComponent which is more conformant to RFC3986: +// - escapes [!'()*] +// - preserve commas +const encode = function (str) { + return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ','); +}; + +function decode(str) { + try { + return decodeURIComponent(str); + } catch (err) { + { + warn(false, `Error decoding "${str}". Leaving it intact.`); + } + } + + return str; +} + +function resolveQuery(query, extraQuery, _parseQuery) { + if (extraQuery === void 0) extraQuery = {}; + + const parse = _parseQuery || parseQuery; + let parsedQuery; + try { + parsedQuery = parse(query || ''); + } catch (e) { + warn(false, e.message); + parsedQuery = {}; + } + for (const key in extraQuery) { + const value = extraQuery[key]; + parsedQuery[key] = Array.isArray(value) ? value.map(castQueryParamValue) : castQueryParamValue(value); + } + + return parsedQuery; +} + +var castQueryParamValue = function (value) { + return value == null || typeof value === 'object' ? value : String(value); +}; + +function parseQuery(query) { + const res = {}; + + query = query.trim().replace(/^(\?|#|&)/, ''); + + if (!query) { + return res; + } + + query.split('&').forEach(param => { + const parts = param.replace(/\+/g, ' ').split('='); + const key = decode(parts.shift()); + const val = parts.length > 0 ? decode(parts.join('=')) : null; + + if (res[key] === undefined) { + res[key] = val; + } else if (Array.isArray(res[key])) { + res[key].push(val); + } else { + res[key] = [res[key], val]; + } + }); + + return res; +} + +function stringifyQuery(obj) { + const res = obj + ? Object.keys(obj) + .map(key => { + const val = obj[key]; + + if (val === undefined) { + return ''; + } + + if (val === null) { + return encode(key); + } + + if (Array.isArray(val)) { + const result = []; + val.forEach(val2 => { + if (val2 === undefined) { + return; + } + if (val2 === null) { + result.push(encode(key)); + } else { + result.push(`${encode(key)}=${encode(val2)}`); + } + }); + + return result.join('&'); + } + + return `${encode(key)}=${encode(val)}`; + }) + .filter(x => x.length > 0) + .join('&') + : null; + + return res ? `?${res}` : ''; +} + +/* */ + +const trailingSlashRE = /\/?$/; + +function createRoute(record, location, redirectedFrom, router) { + const stringifyQuery = router && router.options.stringifyQuery; + + let query = location.query || {}; + try { + query = clone(query); + } catch (e) {} + + const route = { + name: location.name || (record && record.name), + meta: (record && record.meta) || {}, + path: location.path || '/', + hash: location.hash || '', + query, + params: location.params || {}, + fullPath: getFullPath(location, stringifyQuery), + matched: record ? formatMatch(record) : [], + }; + if (redirectedFrom) { + route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery); + } + + return Object.freeze(route); +} + +function clone(value) { + if (Array.isArray(value)) { + return value.map(clone); + } else if (value && typeof value === 'object') { + const res = {}; + for (const key in value) { + res[key] = clone(value[key]); + } + + return res; + } else { + return value; + } +} + +// the starting route that represents the initial state +const START = createRoute(null, { + path: '/', +}); + +function formatMatch(record) { + const res = []; + while (record) { + res.unshift(record); + record = record.parent; + } + + return res; +} + +function getFullPath(ref, _stringifyQuery) { + const path = ref.path; + let query = ref.query; + if (query === void 0) query = {}; + let hash = ref.hash; + if (hash === void 0) hash = ''; + + const stringify = _stringifyQuery || stringifyQuery; + + return (path || '/') + stringify(query) + hash; +} + +function isSameRoute(a, b, onlyPath) { + if (b === START) { + return a === b; + } else if (!b) { + return false; + } else if (a.path && b.path) { + return ( + a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && + (onlyPath || (a.hash === b.hash && isObjectEqual(a.query, b.query))) + ); + } else if (a.name && b.name) { + return ( + a.name === b.name && + (onlyPath || (a.hash === b.hash && isObjectEqual(a.query, b.query) && isObjectEqual(a.params, b.params))) + ); + } else { + return false; + } +} + +function isObjectEqual(a, b) { + if (a === void 0) a = {}; + if (b === void 0) b = {}; + + // handle null value #1566 + if (!a || !b) { + return a === b; + } + const aKeys = Object.keys(a).sort(); + const bKeys = Object.keys(b).sort(); + if (aKeys.length !== bKeys.length) { + return false; + } + + return aKeys.every((key, i) => { + const aVal = a[key]; + const bKey = bKeys[i]; + if (bKey !== key) { + return false; + } + const bVal = b[key]; + // query values can be null and undefined + if (aVal == null || bVal == null) { + return aVal === bVal; + } + // check nested equality + if (typeof aVal === 'object' && typeof bVal === 'object') { + return isObjectEqual(aVal, bVal); + } + + return String(aVal) === String(bVal); + }); +} + +function isIncludedRoute(current, target) { + return ( + current.path.replace(trailingSlashRE, '/').indexOf(target.path.replace(trailingSlashRE, '/')) === 0 && + (!target.hash || current.hash === target.hash) && + queryIncludes(current.query, target.query) + ); +} + +function queryIncludes(current, target) { + for (const key in target) { + if (!(key in current)) { + return false; + } + } + + return true; +} + +function handleRouteEntered(route) { + for (let i = 0; i < route.matched.length; i++) { + const record = route.matched[i]; + for (const name in record.instances) { + const instance = record.instances[name]; + const cbs = record.enteredCbs[name]; + if (!instance || !cbs) { + continue; + } + delete record.enteredCbs[name]; + for (let i$1 = 0; i$1 < cbs.length; i$1++) { + if (!instance._isBeingDestroyed) { + cbs[i$1](instance); + } + } + } + } +} + +// var View = { +// name: 'RouterView', +// functional: true, +// props: { +// name: { +// type: String, +// default: 'default' +// } +// }, +// render: function render (_, ref) { +// var props = ref.props; +// var children = ref.children; +// var parent = ref.parent; +// var data = ref.data; + +// // used by devtools to display a router-view badge +// data.routerView = true; + +// // directly use parent context's createElement() function +// // so that components rendered by router-view can resolve named slots +// var h = parent.$createElement; +// var name = props.name; +// var route = parent.$route; +// var cache = parent._routerViewCache || (parent._routerViewCache = {}); + +// // determine current view depth, also check to see if the tree +// // has been toggled inactive but kept-alive. +// var depth = 0; +// var inactive = false; +// while (parent && parent._routerRoot !== parent) { +// var vnodeData = parent.$vnode ? parent.$vnode.data : {}; +// if (vnodeData.routerView) { +// depth++; +// } +// if (vnodeData.keepAlive && parent._directInactive && parent._inactive) { +// inactive = true; +// } +// parent = parent.$parent; +// } +// data.routerViewDepth = depth; + +// // render previous view if the tree is inactive and kept-alive +// if (inactive) { +// var cachedData = cache[name]; +// var cachedComponent = cachedData && cachedData.component; +// if (cachedComponent) { +// // #2301 +// // pass props +// if (cachedData.configProps) { +// fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps); +// } +// return h(cachedComponent, data, children) +// } else { +// // render previous empty view +// return h() +// } +// } + +// var matched = route.matched[depth]; +// var component = matched && matched.components[name]; + +// // render empty node if no matched route or no config component +// if (!matched || !component) { +// cache[name] = null; +// return h() +// } + +// // cache component +// cache[name] = { component: component }; + +// // attach instance registration hook +// // this will be called in the instance's injected lifecycle hooks +// data.registerRouteInstance = function (vm, val) { +// // val could be undefined for unregistration +// var current = matched.instances[name]; +// if ( +// (val && current !== vm) || +// (!val && current === vm) +// ) { +// matched.instances[name] = val; +// } +// } + +// // also register instance in prepatch hook +// // in case the same component instance is reused across different routes +// ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) { +// matched.instances[name] = vnode.componentInstance; +// }; + +// // register instance in init hook +// // in case kept-alive component be actived when routes changed +// data.hook.init = function (vnode) { +// if (vnode.data.keepAlive && +// vnode.componentInstance && +// vnode.componentInstance !== matched.instances[name] +// ) { +// matched.instances[name] = vnode.componentInstance; +// } + +// // if the route transition has already been confirmed then we weren't +// // able to call the cbs during confirmation as the component was not +// // registered yet, so we call it here. +// handleRouteEntered(route); +// }; + +// var configProps = matched.props && matched.props[name]; +// // save route and configProps in cache +// if (configProps) { +// extend(cache[name], { +// route: route, +// configProps: configProps +// }); +// fillPropsinData(component, data, route, configProps); +// } + +// return h(component, data, children) +// } +// }; + +// function fillPropsinData (component, data, route, configProps) { +// // resolve props +// var propsToPass = data.props = resolveProps(route, configProps); +// if (propsToPass) { +// // clone to prevent mutation +// propsToPass = data.props = extend({}, propsToPass); +// // pass non-declared props as attrs +// var attrs = data.attrs = data.attrs || {}; +// for (var key in propsToPass) { +// if (!component.props || !(key in component.props)) { +// attrs[key] = propsToPass[key]; +// delete propsToPass[key]; +// } +// } +// } +// } + +// function resolveProps (route, config) { +// switch (typeof config) { +// case 'undefined': +// return +// case 'object': +// return config +// case 'function': +// return config(route) +// case 'boolean': +// return config ? route.params : undefined +// default: +// { +// warn( +// false, +// "props in \"" + (route.path) + "\" is a " + (typeof config) + ", " + +// "expecting an object, function or boolean." +// ); +// } +// } +// } + +/* */ + +function resolvePath(relative, base, append) { + const firstChar = relative.charAt(0); + if (firstChar === '/') { + return relative; + } + + if (firstChar === '?' || firstChar === '#') { + return base + relative; + } + + const stack = base.split('/'); + + // remove trailing segment if: + // - not appending + // - appending to trailing slash (last segment is empty) + if (!append || !stack[stack.length - 1]) { + stack.pop(); + } + + // resolve relative path + const segments = relative.replace(/^\//, '').split('/'); + for (let i = 0; i < segments.length; i++) { + const segment = segments[i]; + if (segment === '..') { + stack.pop(); + } else if (segment !== '.') { + stack.push(segment); + } + } + + // ensure leading slash + if (stack[0] !== '') { + stack.unshift(''); + } + + return stack.join('/'); +} + +function parsePath(path) { + let hash = ''; + let query = ''; + + const hashIndex = path.indexOf('#'); + if (hashIndex >= 0) { + hash = path.slice(hashIndex); + path = path.slice(0, hashIndex); + } + + const queryIndex = path.indexOf('?'); + if (queryIndex >= 0) { + query = path.slice(queryIndex + 1); + path = path.slice(0, queryIndex); + } + + return { + path, + query, + hash, + }; +} + +function cleanPath(path) { + return path.replace(/\/\//g, '/'); +} + +const isarray = + Array.isArray || + function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; + }; + +/** + * Expose `pathToRegexp`. + */ +const pathToRegexp_1 = pathToRegexp; +const parse_1 = parse; +const compile_1 = compile; +const tokensToFunction_1 = tokensToFunction; +const tokensToRegExp_1 = tokensToRegExp; + +/** + * The main path matching regexp utility. + * + * @type {RegExp} + */ +const PATH_REGEXP = new RegExp( + [ + // Match escaped characters that would otherwise appear in future matches. + // This allows the user to escape special characters that won't transform. + '(\\\\.)', + // Match Express-style parameters and un-named parameters with a prefix + // and optional suffixes. Matches appear as: + // + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] + // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] + '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))', + ].join('|'), + 'g' +); + +/** + * Parse a string for the raw tokens. + * + * @param {string} str + * @param {Object=} options + * @return {!Array} + */ +function parse(str, options) { + const tokens = []; + let key = 0; + let index = 0; + let path = ''; + const defaultDelimiter = (options && options.delimiter) || '/'; + let res; + + while ((res = PATH_REGEXP.exec(str)) != null) { + const m = res[0]; + const escaped = res[1]; + const offset = res.index; + path += str.slice(index, offset); + index = offset + m.length; + + // Ignore already escaped sequences. + if (escaped) { + path += escaped[1]; + continue; + } + + const next = str[index]; + const prefix = res[2]; + const name = res[3]; + const capture = res[4]; + const group = res[5]; + const modifier = res[6]; + const asterisk = res[7]; + + // Push the current path onto the tokens. + if (path) { + tokens.push(path); + path = ''; + } + + const partial = prefix != null && next != null && next !== prefix; + const repeat = modifier === '+' || modifier === '*'; + const optional = modifier === '?' || modifier === '*'; + const delimiter = res[2] || defaultDelimiter; + const pattern = capture || group; + + tokens.push({ + name: name || key++, + prefix: prefix || '', + delimiter, + optional, + repeat, + partial, + asterisk: !!asterisk, + pattern: pattern ? escapeGroup(pattern) : asterisk ? '.*' : `[^${escapeString(delimiter)}]+?`, + }); + } + + // Match any characters still remaining. + if (index < str.length) { + path += str.substr(index); + } + + // If the path exists, push it onto the end. + if (path) { + tokens.push(path); + } + + return tokens; +} + +/** + * Compile a string to a template function for the path. + * + * @param {string} str + * @param {Object=} options + * @return {!function(Object=, Object=)} + */ +function compile(str, options) { + return tokensToFunction(parse(str, options), options); +} + +/** + * Prettier encoding of URI path segments. + * + * @param {string} + * @return {string} + */ +function encodeURIComponentPretty(str) { + return encodeURI(str).replace(/[\/?#]/g, c => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); +} + +/** + * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. + * + * @param {string} + * @return {string} + */ +function encodeAsterisk(str) { + return encodeURI(str).replace(/[?#]/g, c => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); +} + +/** + * Expose a method for transforming tokens into the path function. + */ +function tokensToFunction(tokens, options) { + // Compile all the tokens into regexps. + const matches = new Array(tokens.length); + + // Compile all the patterns before compilation. + for (let i = 0; i < tokens.length; i++) { + if (typeof tokens[i] === 'object') { + matches[i] = new RegExp(`^(?:${tokens[i].pattern})$`, flags(options)); + } + } + + return function (obj, opts) { + let path = ''; + const data = obj || {}; + const options = opts || {}; + const encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; + + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + + if (typeof token === 'string') { + path += token; + + continue; + } + + const value = data[token.name]; + var segment; + + if (value == null) { + if (token.optional) { + // Prepend partial segment prefixes. + if (token.partial) { + path += token.prefix; + } + + continue; + } else { + throw new TypeError(`Expected "${token.name}" to be defined`); + } + } + + if (isarray(value)) { + if (!token.repeat) { + throw new TypeError( + `Expected "${token.name}" to not repeat, but received \`${JSON.stringify(value)}\`` + ); + } + + if (value.length === 0) { + if (token.optional) { + continue; + } else { + throw new TypeError(`Expected "${token.name}" to not be empty`); + } + } + + for (let j = 0; j < value.length; j++) { + segment = encode(value[j]); + + if (!matches[i].test(segment)) { + throw new TypeError( + `Expected all "${token.name}" to match "${token.pattern}", but received \`${JSON.stringify( + segment + )}\`` + ); + } + + path += (j === 0 ? token.prefix : token.delimiter) + segment; + } + + continue; + } + + segment = token.asterisk ? encodeAsterisk(value) : encode(value); + + if (!matches[i].test(segment)) { + throw new TypeError(`Expected "${token.name}" to match "${token.pattern}", but received "${segment}"`); + } + + path += token.prefix + segment; + } + + return path; + }; +} + +/** + * Escape a regular expression string. + * + * @param {string} str + * @return {string} + */ +function escapeString(str) { + return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1'); +} + +/** + * Escape the capturing group by escaping special characters and meaning. + * + * @param {string} group + * @return {string} + */ +function escapeGroup(group) { + return group.replace(/([=!:$\/()])/g, '\\$1'); +} + +/** + * Attach the keys as a property of the regexp. + * + * @param {!RegExp} re + * @param {Array} keys + * @return {!RegExp} + */ +function attachKeys(re, keys) { + re.keys = keys; + + return re; +} + +/** + * Get the flags for a regexp from the options. + * + * @param {Object} options + * @return {string} + */ +function flags(options) { + return options && options.sensitive ? '' : 'i'; +} + +/** + * Pull out keys from a regexp. + * + * @param {!RegExp} path + * @param {!Array} keys + * @return {!RegExp} + */ +function regexpToRegexp(path, keys) { + // Use a negative lookahead to match only capturing groups. + const groups = path.source.match(/\((?!\?)/g); + + if (groups) { + for (let i = 0; i < groups.length; i++) { + keys.push({ + name: i, + prefix: null, + delimiter: null, + optional: false, + repeat: false, + partial: false, + asterisk: false, + pattern: null, + }); + } + } + + return attachKeys(path, keys); +} + +/** + * Transform an array into a regexp. + * + * @param {!Array} path + * @param {Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function arrayToRegexp(path, keys, options) { + const parts = []; + + for (let i = 0; i < path.length; i++) { + parts.push(pathToRegexp(path[i], keys, options).source); + } + + const regexp = new RegExp(`(?:${parts.join('|')})`, flags(options)); + + return attachKeys(regexp, keys); +} + +/** + * Create a path regexp from string input. + * + * @param {string} path + * @param {!Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function stringToRegexp(path, keys, options) { + return tokensToRegExp(parse(path, options), keys, options); +} + +/** + * Expose a function for taking tokens and returning a RegExp. + * + * @param {!Array} tokens + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ +function tokensToRegExp(tokens, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options); + keys = []; + } + + options = options || {}; + + const strict = options.strict; + const end = options.end !== false; + let route = ''; + + // Iterate over the tokens and create our regexp string. + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + + if (typeof token === 'string') { + route += escapeString(token); + } else { + const prefix = escapeString(token.prefix); + let capture = `(?:${token.pattern})`; + + keys.push(token); + + if (token.repeat) { + capture += `(?:${prefix}${capture})*`; + } + + if (token.optional) { + if (!token.partial) { + capture = `(?:${prefix}(${capture}))?`; + } else { + capture = `${prefix}(${capture})?`; + } + } else { + capture = `${prefix}(${capture})`; + } + + route += capture; + } + } + + const delimiter = escapeString(options.delimiter || '/'); + const endsWithDelimiter = route.slice(-delimiter.length) === delimiter; + + // In non-strict mode we allow a slash at the end of match. If the path to + // match already ends with a slash, we remove it for consistency. The slash + // is valid at the end of a path match, not in the middle. This is important + // in non-ending mode, where "/test/" shouldn't match "/test//route". + if (!strict) { + route = `${endsWithDelimiter ? route.slice(0, -delimiter.length) : route}(?:${delimiter}(?=$))?`; + } + + if (end) { + route += '$'; + } else { + // In non-ending mode, we need the capturing groups to match as much as + // possible by using a positive lookahead to the end or next path segment. + route += strict && endsWithDelimiter ? '' : `(?=${delimiter}|$)`; + } + + return attachKeys(new RegExp(`^${route}`, flags(options)), keys); +} + +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + * + * @param {(string|RegExp|Array)} path + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ +function pathToRegexp(path, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options); + keys = []; + } + + options = options || {}; + + if (path instanceof RegExp) { + return regexpToRegexp(path, /** @type {!Array} */ (keys)); + } + + if (isarray(path)) { + return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options); + } + + return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options); +} +pathToRegexp_1.parse = parse_1; +pathToRegexp_1.compile = compile_1; +pathToRegexp_1.tokensToFunction = tokensToFunction_1; +pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; + +/* */ + +// $flow-disable-line +const regexpCompileCache = Object.create(null); + +function fillParams(path, params, routeMsg) { + params = params || {}; + try { + const filler = regexpCompileCache[path] || (regexpCompileCache[path] = pathToRegexp_1.compile(path)); + + // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }} + // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string + if (typeof params.pathMatch === 'string') { + params[0] = params.pathMatch; + } + + return filler(params, { pretty: true }); + } catch (e) { + { + // Fix #3072 no warn if `pathMatch` is string + warn(typeof params.pathMatch === 'string', `missing param for ${routeMsg}: ${e.message}`); + } + + return ''; + } finally { + // delete the 0 if it was added + delete params[0]; + } +} + +/* */ + +function normalizeLocation(raw, current, append, router) { + let next = typeof raw === 'string' ? { path: raw } : raw; + // named target + if (next._normalized) { + return next; + } else if (next.name) { + next = extend({}, raw); + const params = next.params; + if (params && typeof params === 'object') { + next.params = extend({}, params); + } + + return next; + } + + // relative params + if (!next.path && next.params && current) { + next = extend({}, next); + next._normalized = true; + const params$1 = extend(extend({}, current.params), next.params); + if (current.name) { + next.name = current.name; + next.params = params$1; + } else if (current.matched.length) { + const rawPath = current.matched[current.matched.length - 1].path; + next.path = fillParams(rawPath, params$1, `path ${current.path}`); + } else { + warn(false, 'relative params navigation requires a current route.'); + } + + return next; + } + + const parsedPath = parsePath(next.path || ''); + const basePath = (current && current.path) || '/'; + const path = parsedPath.path ? resolvePath(parsedPath.path, basePath, append || next.append) : basePath; + + const query = resolveQuery(parsedPath.query, next.query, router && router.options.parseQuery); + + let hash = next.hash || parsedPath.hash; + if (hash && hash.charAt(0) !== '#') { + hash = `#${hash}`; + } + + return { + _normalized: true, + path, + query, + hash, + }; +} + +// var toTypes = [String, Object]; +// var eventTypes = [String, Array]; + +// var noop = function () {}; + +// var warnedCustomSlot; +// var warnedTagProp; +// var warnedEventProp; + +// var Link = { +// name: 'RouterLink', +// props: { +// to: { +// type: toTypes, +// required: true +// }, +// tag: { +// type: String, +// default: 'a' +// }, +// custom: Boolean, +// exact: Boolean, +// exactPath: Boolean, +// append: Boolean, +// replace: Boolean, +// activeClass: String, +// exactActiveClass: String, +// ariaCurrentValue: { +// type: String, +// default: 'page' +// }, +// event: { +// type: eventTypes, +// default: 'click' +// } +// }, +// render: function render (h) { +// var this$1 = this; + +// var router = this.$router; +// var current = this.$route; +// var ref = router.resolve( +// this.to, +// current, +// this.append +// ); +// var location = ref.location; +// var route = ref.route; +// var href = ref.href; + +// var classes = {}; +// var globalActiveClass = router.options.linkActiveClass; +// var globalExactActiveClass = router.options.linkExactActiveClass; +// // Support global empty active class +// var activeClassFallback = +// globalActiveClass == null ? 'router-link-active' : globalActiveClass; +// var exactActiveClassFallback = +// globalExactActiveClass == null +// ? 'router-link-exact-active' +// : globalExactActiveClass; +// var activeClass = +// this.activeClass == null ? activeClassFallback : this.activeClass; +// var exactActiveClass = +// this.exactActiveClass == null +// ? exactActiveClassFallback +// : this.exactActiveClass; + +// var compareTarget = route.redirectedFrom +// ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router) +// : route; + +// classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath); +// classes[activeClass] = this.exact || this.exactPath +// ? classes[exactActiveClass] +// : isIncludedRoute(current, compareTarget); + +// var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null; + +// var handler = function (e) { +// if (guardEvent(e)) { +// if (this$1.replace) { +// router.replace(location, noop); +// } else { +// router.push(location, noop); +// } +// } +// }; + +// var on = { click: guardEvent }; +// if (Array.isArray(this.event)) { +// this.event.forEach(function (e) { +// on[e] = handler; +// }); +// } else { +// on[this.event] = handler; +// } + +// var data = { class: classes }; + +// var scopedSlot = +// !this.$scopedSlots.$hasNormal && +// this.$scopedSlots.default && +// this.$scopedSlots.default({ +// href: href, +// route: route, +// navigate: handler, +// isActive: classes[activeClass], +// isExactActive: classes[exactActiveClass] +// }); + +// if (scopedSlot) { +// if (!this.custom) { +// !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an element. Use the custom prop to remove this warning:\n\n'); +// warnedCustomSlot = true; +// } +// if (scopedSlot.length === 1) { +// return scopedSlot[0] +// } else if (scopedSlot.length > 1 || !scopedSlot.length) { +// { +// warn( +// false, +// (" with to=\"" + (this.to) + "\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.") +// ); +// } +// return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot) +// } +// } + +// { +// if ('tag' in this.$options.propsData && !warnedTagProp) { +// warn( +// false, +// "'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link." +// ); +// warnedTagProp = true; +// } +// if ('event' in this.$options.propsData && !warnedEventProp) { +// warn( +// false, +// "'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link." +// ); +// warnedEventProp = true; +// } +// } + +// if (this.tag === 'a') { +// data.on = on; +// data.attrs = { href: href, 'aria-current': ariaCurrentValue }; +// } else { +// // find the first child and apply listener and href +// var a = findAnchor(this.$slots.default); +// if (a) { +// // in case the is a static node +// a.isStatic = false; +// var aData = (a.data = extend({}, a.data)); +// aData.on = aData.on || {}; +// // transform existing events in both objects into arrays so we can push later +// for (var event in aData.on) { +// var handler$1 = aData.on[event]; +// if (event in on) { +// aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1]; +// } +// } +// // append new listeners for router-link +// for (var event$1 in on) { +// if (event$1 in aData.on) { +// // on[event] is always a function +// aData.on[event$1].push(on[event$1]); +// } else { +// aData.on[event$1] = handler; +// } +// } + +// var aAttrs = (a.data.attrs = extend({}, a.data.attrs)); +// aAttrs.href = href; +// aAttrs['aria-current'] = ariaCurrentValue; +// } else { +// // doesn't have child, apply listener to self +// data.on = on; +// } +// } + +// return h(this.tag, data, this.$slots.default) +// } +// }; + +function guardEvent(e) { + // don't redirect with control keys + if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { + return; + } + // don't redirect when preventDefault called + if (e.defaultPrevented) { + return; + } + // don't redirect on right click + if (e.button !== undefined && e.button !== 0) { + return; + } + // don't redirect if `target="_blank"` + if (e.currentTarget && e.currentTarget.getAttribute) { + const target = e.currentTarget.getAttribute('target'); + if (/\b_blank\b/i.test(target)) { + return; + } + } + // this may be a Weex event which doesn't have this method + if (e.preventDefault) { + e.preventDefault(); + } + + return true; +} + +function findAnchor(children) { + if (children) { + let child; + for (let i = 0; i < children.length; i++) { + child = children[i]; + if (child.tag === 'a') { + return child; + } + if (child.children && (child = findAnchor(child.children))) { + return child; + } + } + } +} + +// var _Vue; + +// function install (Vue) { +// if (install.installed && _Vue === Vue) { return } +// install.installed = true; + +// _Vue = Vue; + +// var isDef = function (v) { return v !== undefined; }; + +// var registerInstance = function (vm, callVal) { +// var i = vm.$options._parentVnode; +// if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) { +// i(vm, callVal); +// } +// }; + +// Vue.mixin({ +// beforeCreate: function beforeCreate () { +// if (isDef(this.$options.router)) { +// this._routerRoot = this; +// this._router = this.$options.router; +// this._router.init(this); +// Vue.util.defineReactive(this, '_route', this._router.history.current); +// } else { +// this._routerRoot = (this.$parent && this.$parent._routerRoot) || this; +// } +// registerInstance(this, this); +// }, +// destroyed: function destroyed () { +// registerInstance(this); +// } +// }); + +// Object.defineProperty(Vue.prototype, '$router', { +// get: function get () { return this._routerRoot._router } +// }); + +// Object.defineProperty(Vue.prototype, '$route', { +// get: function get () { return this._routerRoot._route } +// }); + +// Vue.component('RouterView', View); +// Vue.component('RouterLink', Link); + +// var strats = Vue.config.optionMergeStrategies; +// // use the same hook merging strategy for route hooks +// strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created; +// } + +/* */ + +const inBrowser = typeof window !== 'undefined'; + +/* */ + +function createRouteMap(routes, oldPathList, oldPathMap, oldNameMap, parentRoute) { + // the path list is used to control path matching priority + const pathList = oldPathList || []; + // $flow-disable-line + const pathMap = oldPathMap || Object.create(null); + // $flow-disable-line + const nameMap = oldNameMap || Object.create(null); + + routes.forEach(route => { + addRouteRecord(pathList, pathMap, nameMap, route, parentRoute); + }); + + // ensure wildcard routes are always at the end + for (let i = 0, l = pathList.length; i < l; i++) { + if (pathList[i] === '*') { + pathList.push(pathList.splice(i, 1)[0]); + l--; + i--; + } + } + + { + // warn if routes do not include leading slashes + const found = pathList + // check for missing leading slash + .filter(path => path && path.charAt(0) !== '*' && path.charAt(0) !== '/'); + + if (found.length > 0) { + const pathNames = found.map(path => `- ${path}`).join('\n'); + warn( + false, + `Non-nested routes must include a leading slash character. Fix the following routes: \n${pathNames}` + ); + } + } + + return { + pathList, + pathMap, + nameMap, + }; +} + +function addRouteRecord(pathList, pathMap, nameMap, route, parent, matchAs) { + const path = route.path; + const name = route.name; + { + assert(path != null, '"path" is required in a route configuration.'); + assert( + typeof route.component !== 'string', + `route config "component" for path: ${String(path || name)} cannot be a ` + + 'string id. Use an actual component instead.' + ); + + warn( + // eslint-disable-next-line no-control-regex + !/[^\u0000-\u007F]+/.test(path), + `Route with path "${path}" contains unencoded characters, make sure ` + + 'your path is correctly encoded before passing it to the router. Use ' + + 'encodeURI to encode static segments of your path.' + ); + } + + const pathToRegexpOptions = route.pathToRegexpOptions || {}; + const normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict); + + if (typeof route.caseSensitive === 'boolean') { + pathToRegexpOptions.sensitive = route.caseSensitive; + } + + const record = { + path: normalizedPath, + regex: compileRouteRegex(normalizedPath, pathToRegexpOptions), + components: route.components || { default: route.component }, + alias: route.alias ? (typeof route.alias === 'string' ? [route.alias] : route.alias) : [], + instances: {}, + enteredCbs: {}, + name, + parent, + matchAs, + redirect: route.redirect, + beforeEnter: route.beforeEnter, + meta: route.meta || {}, + props: route.props == null ? {} : route.components ? route.props : { default: route.props }, + }; + + if (route.children) { + // Warn if route is named, does not redirect and has a default child route. + // If users navigate to this route by name, the default child will + // not be rendered (GH Issue #629) + { + if (route.name && !route.redirect && route.children.some(child => /^\/?$/.test(child.path))) { + warn( + false, + `Named Route '${route.name}' has a default child route. ` + + `When navigating to this named route (:to="{name: '${route.name}'"), ` + + 'the default child route will not be rendered. Remove the name from ' + + 'this route and use the name of the default child route for named ' + + 'links instead.' + ); + } + } + route.children.forEach(child => { + const childMatchAs = matchAs ? cleanPath(`${matchAs}/${child.path}`) : undefined; + addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs); + }); + } + + if (!pathMap[record.path]) { + pathList.push(record.path); + pathMap[record.path] = record; + } + + if (route.alias !== undefined) { + const aliases = Array.isArray(route.alias) ? route.alias : [route.alias]; + for (let i = 0; i < aliases.length; ++i) { + const alias = aliases[i]; + if (alias === path) { + warn( + false, + `Found an alias with the same value as the path: "${path}". You have to remove that alias. It will be ignored in development.` + ); + // skip in dev to make it work + continue; + } + + const aliasRoute = { + path: alias, + children: route.children, + }; + addRouteRecord( + pathList, + pathMap, + nameMap, + aliasRoute, + parent, + record.path || '/' // matchAs + ); + } + } + + if (name) { + if (!nameMap[name]) { + nameMap[name] = record; + } else if (!matchAs) { + warn(false, `${'Duplicate named routes definition: ' + '{ name: "'}${name}", path: "${record.path}" }`); + } + } +} + +function compileRouteRegex(path, pathToRegexpOptions) { + const regex = pathToRegexp_1(path, [], pathToRegexpOptions); + { + const keys = Object.create(null); + regex.keys.forEach(key => { + warn(!keys[key.name], `Duplicate param keys in route with path: "${path}"`); + keys[key.name] = true; + }); + } + + return regex; +} + +function normalizePath(path, parent, strict) { + if (!strict) { + path = path.replace(/\/$/, ''); + } + if (path[0] === '/') { + return path; + } + if (parent == null) { + return path; + } + + return cleanPath(`${parent.path}/${path}`); +} + +/* */ + +function createMatcher(routes, router) { + const ref = createRouteMap(routes); + const pathList = ref.pathList; + const pathMap = ref.pathMap; + const nameMap = ref.nameMap; + + function addRoutes(routes) { + createRouteMap(routes, pathList, pathMap, nameMap); + } + + function addRoute(parentOrRoute, route) { + const parent = typeof parentOrRoute !== 'object' ? nameMap[parentOrRoute] : undefined; + // $flow-disable-line + createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent); + + // add aliases of parent + if (parent && parent.alias.length) { + createRouteMap( + // $flow-disable-line route is defined if parent is + parent.alias.map(alias => { + return { path: alias, children: [route] }; + }), + pathList, + pathMap, + nameMap, + parent + ); + } + } + + function getRoutes() { + return pathList.map(path => pathMap[path]); + } + + function match(raw, currentRoute, redirectedFrom) { + const location = normalizeLocation(raw, currentRoute, false, router); + const name = location.name; + + if (name) { + const record = nameMap[name]; + { + warn(record, `Route with name '${name}' does not exist`); + } + if (!record) { + return _createRoute(null, location); + } + const paramNames = record.regex.keys.filter(key => !key.optional).map(key => key.name); + + if (typeof location.params !== 'object') { + location.params = {}; + } + + if (currentRoute && typeof currentRoute.params === 'object') { + for (const key in currentRoute.params) { + if (!(key in location.params) && paramNames.indexOf(key) > -1) { + location.params[key] = currentRoute.params[key]; + } + } + } + + location.path = fillParams(record.path, location.params, `named route "${name}"`); + + return _createRoute(record, location, redirectedFrom); + } else if (location.path) { + location.params = {}; + for (let i = 0; i < pathList.length; i++) { + const path = pathList[i]; + const record$1 = pathMap[path]; + if (matchRoute(record$1.regex, location.path, location.params)) { + return _createRoute(record$1, location, redirectedFrom); + } + } + } + // no match + return _createRoute(null, location); + } + + function redirect(record, location) { + const originalRedirect = record.redirect; + let redirect = + typeof originalRedirect === 'function' + ? originalRedirect(createRoute(record, location, null, router)) + : originalRedirect; + + if (typeof redirect === 'string') { + redirect = { path: redirect }; + } + + if (!redirect || typeof redirect !== 'object') { + { + warn(false, `invalid redirect option: ${JSON.stringify(redirect)}`); + } + + return _createRoute(null, location); + } + + const re = redirect; + const name = re.name; + const path = re.path; + let query = location.query; + let hash = location.hash; + let params = location.params; + query = re.hasOwnProperty('query') ? re.query : query; + hash = re.hasOwnProperty('hash') ? re.hash : hash; + params = re.hasOwnProperty('params') ? re.params : params; + + if (name) { + // resolved named direct + const targetRecord = nameMap[name]; + { + assert(targetRecord, `redirect failed: named route "${name}" not found.`); + } + + return match( + { + _normalized: true, + name, + query, + hash, + params, + }, + undefined, + location + ); + } else if (path) { + // 1. resolve relative redirect + const rawPath = resolveRecordPath(path, record); + // 2. resolve params + const resolvedPath = fillParams(rawPath, params, `redirect route with path "${rawPath}"`); + // 3. rematch with existing query and hash + return match( + { + _normalized: true, + path: resolvedPath, + query, + hash, + }, + undefined, + location + ); + } else { + { + warn(false, `invalid redirect option: ${JSON.stringify(redirect)}`); + } + + return _createRoute(null, location); + } + } + + function alias(record, location, matchAs) { + const aliasedPath = fillParams(matchAs, location.params, `aliased route with path "${matchAs}"`); + const aliasedMatch = match({ + _normalized: true, + path: aliasedPath, + }); + if (aliasedMatch) { + const matched = aliasedMatch.matched; + const aliasedRecord = matched[matched.length - 1]; + location.params = aliasedMatch.params; + + return _createRoute(aliasedRecord, location); + } + + return _createRoute(null, location); + } + + function _createRoute(record, location, redirectedFrom) { + if (record && record.redirect) { + return redirect(record, redirectedFrom || location); + } + if (record && record.matchAs) { + return alias(record, location, record.matchAs); + } + + return createRoute(record, location, redirectedFrom, router); + } + + return { + match, + addRoute, + getRoutes, + addRoutes, + }; +} + +function matchRoute(regex, path, params) { + const m = path.match(regex); + + if (!m) { + return false; + } else if (!params) { + return true; + } + + for (let i = 1, len = m.length; i < len; ++i) { + const key = regex.keys[i - 1]; + if (key) { + // Fix #1994: using * with props: true generates a param named 0 + params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i]; + } + } + + return true; +} + +function resolveRecordPath(path, record) { + return resolvePath(path, record.parent ? record.parent.path : '/', true); +} + +/* */ + +// use User Timing api (if present) for more accurate key precision +const Time = inBrowser && window.performance && window.performance.now ? window.performance : Date; + +function genStateKey() { + return Time.now().toFixed(3); +} + +let _key = genStateKey(); + +function getStateKey() { + return _key; +} + +function setStateKey(key) { + return (_key = key); +} + +/* */ + +const positionStore = Object.create(null); + +function setupScroll() { + // Prevent browser scroll behavior on History popstate + if ('scrollRestoration' in window.history) { + window.history.scrollRestoration = 'manual'; + } + // Fix for #1585 for Firefox + // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678 + // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with + // window.location.protocol + '//' + window.location.host + // location.host contains the port and location.hostname doesn't + const protocolAndPath = `${window.location.protocol}//${window.location.host}`; + const absolutePath = window.location.href.replace(protocolAndPath, ''); + // preserve existing history state as it could be overriden by the user + const stateCopy = extend({}, window.history.state); + stateCopy.key = getStateKey(); + window.history.replaceState(stateCopy, '', absolutePath); + window.addEventListener('popstate', handlePopState); + + return function () { + window.removeEventListener('popstate', handlePopState); + }; +} + +function handleScroll(router, to, from, isPop) { + if (!router.app) { + return; + } + + const behavior = router.options.scrollBehavior; + if (!behavior) { + return; + } + + { + assert(typeof behavior === 'function', 'scrollBehavior must be a function'); + } + + // wait until re-render finishes before scrolling + nextTick(() => { + const position = getScrollPosition(); + const shouldScroll = behavior.call(router, to, from, isPop ? position : null); + + if (!shouldScroll) { + return; + } + + if (typeof shouldScroll.then === 'function') { + shouldScroll + .then(shouldScroll => { + scrollToPosition(shouldScroll, position); + }) + .catch(err => { + { + assert(false, err.toString()); + } + }); + } else { + scrollToPosition(shouldScroll, position); + } + }); +} + +function saveScrollPosition() { + const key = getStateKey(); + if (key) { + positionStore[key] = { + x: window.pageXOffset, + y: window.pageYOffset, + }; + } +} + +function handlePopState(e) { + saveScrollPosition(); + if (e.state && e.state.key) { + setStateKey(e.state.key); + } +} + +function getScrollPosition() { + const key = getStateKey(); + if (key) { + return positionStore[key]; + } +} + +function getElementPosition(el, offset) { + const docEl = document.documentElement; + const docRect = docEl.getBoundingClientRect(); + const elRect = el.getBoundingClientRect(); + + return { + x: elRect.left - docRect.left - offset.x, + y: elRect.top - docRect.top - offset.y, + }; +} + +function isValidPosition(obj) { + return isNumber(obj.x) || isNumber(obj.y); +} + +function normalizePosition(obj) { + return { + x: isNumber(obj.x) ? obj.x : window.pageXOffset, + y: isNumber(obj.y) ? obj.y : window.pageYOffset, + }; +} + +function normalizeOffset(obj) { + return { + x: isNumber(obj.x) ? obj.x : 0, + y: isNumber(obj.y) ? obj.y : 0, + }; +} + +function isNumber(v) { + return typeof v === 'number'; +} + +const hashStartsWithNumberRE = /^#\d/; + +function scrollToPosition(shouldScroll, position) { + const isObject = typeof shouldScroll === 'object'; + if (isObject && typeof shouldScroll.selector === 'string') { + // getElementById would still fail if the selector contains a more complicated query like #main[data-attr] + // but at the same time, it doesn't make much sense to select an element with an id and an extra selector + const el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line + ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line + : document.querySelector(shouldScroll.selector); + + if (el) { + let offset = shouldScroll.offset && typeof shouldScroll.offset === 'object' ? shouldScroll.offset : {}; + offset = normalizeOffset(offset); + position = getElementPosition(el, offset); + } else if (isValidPosition(shouldScroll)) { + position = normalizePosition(shouldScroll); + } + } else if (isObject && isValidPosition(shouldScroll)) { + position = normalizePosition(shouldScroll); + } + + if (position) { + // $flow-disable-line + if ('scrollBehavior' in document.documentElement.style) { + window.scrollTo({ + left: position.x, + top: position.y, + // $flow-disable-line + behavior: shouldScroll.behavior, + }); + } else { + window.scrollTo(position.x, position.y); + } + } +} + +/* */ + +const supportsPushState = + inBrowser && + (function () { + const ua = window.navigator.userAgent; + + if ( + (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && + ua.indexOf('Mobile Safari') !== -1 && + ua.indexOf('Chrome') === -1 && + ua.indexOf('Windows Phone') === -1 + ) { + return false; + } + + return window.history && typeof window.history.pushState === 'function'; + })(); + +function pushState(url, replace) { + saveScrollPosition(); + // try...catch the pushState call to get around Safari + // DOM Exception 18 where it limits to 100 pushState calls + const history = window.history; + try { + if (replace) { + // preserve existing history state as it could be overriden by the user + const stateCopy = extend({}, history.state); + stateCopy.key = getStateKey(); + history.replaceState(stateCopy, '', url); + } else { + history.pushState({ key: setStateKey(genStateKey()) }, '', url); + } + } catch (e) { + window.location[replace ? 'replace' : 'assign'](url); + } +} + +function replaceState(url) { + pushState(url, true); +} + +/* */ + +function runQueue(queue, fn, cb) { + var step = function (index) { + if (index >= queue.length) { + cb(); + } else { + if (queue[index]) { + fn(queue[index], () => { + step(index + 1); + }); + } else { + step(index + 1); + } + } + }; + step(0); +} + +// When changing thing, also edit router.d.ts +const NavigationFailureType = { + redirected: 2, + aborted: 4, + cancelled: 8, + duplicated: 16, +}; + +function createNavigationRedirectedError(from, to) { + return createRouterError( + from, + to, + NavigationFailureType.redirected, + `Redirected when going from "${from.fullPath}" to "${stringifyRoute(to)}" via a navigation guard.` + ); +} + +function createNavigationDuplicatedError(from, to) { + const error = createRouterError( + from, + to, + NavigationFailureType.duplicated, + `Avoided redundant navigation to current location: "${from.fullPath}".` + ); + // backwards compatible with the first introduction of Errors + error.name = 'NavigationDuplicated'; + + return error; +} + +function createNavigationCancelledError(from, to) { + return createRouterError( + from, + to, + NavigationFailureType.cancelled, + `Navigation cancelled from "${from.fullPath}" to "${to.fullPath}" with a new navigation.` + ); +} + +function createNavigationAbortedError(from, to) { + return createRouterError( + from, + to, + NavigationFailureType.aborted, + `Navigation aborted from "${from.fullPath}" to "${to.fullPath}" via a navigation guard.` + ); +} + +function createRouterError(from, to, type, message) { + const error = new Error(message); + error._isRouter = true; + error.from = from; + error.to = to; + error.type = type; + + return error; +} + +const propertiesToLog = ['params', 'query', 'hash']; + +function stringifyRoute(to) { + if (typeof to === 'string') { + return to; + } + if ('path' in to) { + return to.path; + } + const location = {}; + propertiesToLog.forEach(key => { + if (key in to) { + location[key] = to[key]; + } + }); + + return JSON.stringify(location, null, 2); +} + +function isError(err) { + return Object.prototype.toString.call(err).indexOf('Error') > -1; +} + +function isNavigationFailure(err, errorType) { + return isError(err) && err._isRouter && (errorType == null || err.type === errorType); +} + +/* */ + +function resolveAsyncComponents(matched) { + return function (to, from, next) { + let hasAsync = false; + let pending = 0; + let error = null; + + flatMapComponents(matched, (def, _, match, key) => { + // if it's a function and doesn't have cid attached, + // assume it's an async component resolve function. + // we are not using Vue's default async resolving mechanism because + // we want to halt the navigation until the incoming component has been + // resolved. + if (typeof def === 'function' && def.cid === undefined) { + hasAsync = true; + pending++; + + const resolve = once(resolvedDef => { + if (isESModule(resolvedDef)) { + resolvedDef = resolvedDef.default; + } + // save resolved on async factory in case it's used elsewhere + def.resolved = resolvedDef; + match.components[key] = resolvedDef; + pending--; + if (pending <= 0) { + next(); + } + }); + + const reject = once(reason => { + const msg = `Failed to resolve async component ${key}: ${reason}`; + warn(false, msg); + if (!error) { + error = isError(reason) ? reason : new Error(msg); + next(error); + } + }); + + let res; + try { + res = def(resolve, reject); + } catch (e) { + reject(e); + } + if (res) { + if (typeof res.then === 'function') { + res.then(resolve, reject); + } else { + // new syntax in Vue 2.3 + const comp = res.component; + if (comp && typeof comp.then === 'function') { + comp.then(resolve, reject); + } + } + } + } + }); + + if (!hasAsync) { + next(); + } + }; +} + +function flatMapComponents(matched, fn) { + return flatten( + matched.map(m => Object.keys(m.components).map(key => fn(m.components[key], m.instances[key], m, key))) + ); +} + +function flatten(arr) { + return Array.prototype.concat.apply([], arr); +} + +const hasSymbol = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + +function isESModule(obj) { + return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module'); +} + +// in Webpack 2, require.ensure now also returns a Promise +// so the resolve/reject functions may get called an extra time +// if the user uses an arrow function shorthand that happens to +// return that Promise. +function once(fn) { + let called = false; + + return function () { + let args = [], + len = arguments.length; + while (len--) args[len] = arguments[len]; + + if (called) { + return; + } + called = true; + + return fn.apply(this, args); + }; +} + +/* */ + +const History = function History(router, base) { + this.router = router; + this.base = normalizeBase(base); + // start with a route object that stands for "nowhere" + this.current = START; + this.pending = null; + this.ready = false; + this.readyCbs = []; + this.readyErrorCbs = []; + this.errorCbs = []; + this.listeners = []; +}; + +History.prototype.listen = function listen(cb) { + this.cb = cb; +}; + +History.prototype.onReady = function onReady(cb, errorCb) { + if (this.ready) { + cb(); + } else { + this.readyCbs.push(cb); + if (errorCb) { + this.readyErrorCbs.push(errorCb); + } + } +}; + +History.prototype.onError = function onError(errorCb) { + this.errorCbs.push(errorCb); +}; + +History.prototype.transitionTo = function transitionTo(location, onComplete, onAbort) { + const this$1 = this; + + let route; + // catch redirect option https://github.com/vuejs/vue-router/issues/3201 + try { + route = this.router.match(location, this.current); + } catch (e) { + this.errorCbs.forEach(cb => { + cb(e); + }); + // Exception should still be thrown + throw e; + } + const prev = this.current; + this.confirmTransition( + route, + () => { + this$1.updateRoute(route); + onComplete && onComplete(route); + this$1.ensureURL(); + this$1.router.afterHooks.forEach(hook => { + hook && hook(route, prev); + }); + + // fire ready cbs once + if (!this$1.ready) { + this$1.ready = true; + this$1.readyCbs.forEach(cb => { + cb(route); + }); + } + }, + err => { + if (onAbort) { + onAbort(err); + } + if (err && !this$1.ready) { + // Initial redirection should not mark the history as ready yet + // because it's triggered by the redirection instead + // https://github.com/vuejs/vue-router/issues/3225 + // https://github.com/vuejs/vue-router/issues/3331 + if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) { + this$1.ready = true; + this$1.readyErrorCbs.forEach(cb => { + cb(err); + }); + } + } + } + ); +}; + +History.prototype.confirmTransition = function confirmTransition(route, onComplete, onAbort) { + const this$1 = this; + + const current = this.current; + this.pending = route; + const abort = function (err) { + // changed after adding errors with + // https://github.com/vuejs/vue-router/pull/3047 before that change, + // redirect and aborted navigation would produce an err == null + if (!isNavigationFailure(err) && isError(err)) { + if (this$1.errorCbs.length) { + this$1.errorCbs.forEach(cb => { + cb(err); + }); + } else { + warn(false, 'uncaught error during route navigation:'); + console.error(err); + } + } + onAbort && onAbort(err); + }; + const lastRouteIndex = route.matched.length - 1; + const lastCurrentIndex = current.matched.length - 1; + if ( + isSameRoute(route, current) && + // in the case the route map has been dynamically appended to + lastRouteIndex === lastCurrentIndex && + route.matched[lastRouteIndex] === current.matched[lastCurrentIndex] + ) { + this.ensureURL(); + + return; + } + + const ref = resolveQueue(this.current.matched, route.matched); + const updated = ref.updated; + const deactivated = ref.deactivated; + const activated = ref.activated; + + const queue = [].concat( + // in-component leave guards + extractLeaveGuards(deactivated), + // global before hooks + this.router.beforeHooks, + // in-component update hooks + extractUpdateHooks(updated), + // in-config enter guards + activated.map(m => m.beforeEnter), + // async components + resolveAsyncComponents(activated) + ); + + const iterator = function (hook, next) { + if (this$1.pending !== route) { + return abort(createNavigationCancelledError(current, route)); + } + try { + hook(route, current, to => { + if (to === false) { + // next(false) -> abort navigation, ensure current URL + this$1.ensureURL(true); + abort(createNavigationAbortedError(current, route)); + } else if (isError(to)) { + this$1.ensureURL(true); + abort(to); + } else if ( + typeof to === 'string' || + (typeof to === 'object' && (typeof to.path === 'string' || typeof to.name === 'string')) + ) { + // next('/') or next({ path: '/' }) -> redirect + abort(createNavigationRedirectedError(current, route)); + if (typeof to === 'object' && to.replace) { + this$1.replace(to); + } else { + this$1.push(to); + } + } else { + // confirm transition and pass on the value + next(to); + } + }); + } catch (e) { + abort(e); + } + }; + + runQueue(queue, iterator, () => { + // wait until async components are resolved before + // extracting in-component enter guards + const enterGuards = extractEnterGuards(activated); + const queue = enterGuards.concat(this$1.router.resolveHooks); + runQueue(queue, iterator, () => { + if (this$1.pending !== route) { + return abort(createNavigationCancelledError(current, route)); + } + this$1.pending = null; + onComplete(route); + if (this$1.router.app) { + nextTick(() => { + handleRouteEntered(route); + }); + } + }); + }); +}; + +History.prototype.updateRoute = function updateRoute(route) { + this.current = route; + this.cb && this.cb(route); +}; + +History.prototype.setupListeners = function setupListeners() { + // Default implementation is empty +}; + +History.prototype.teardown = function teardown() { + // clean up event listeners + // https://github.com/vuejs/vue-router/issues/2341 + this.listeners.forEach(cleanupListener => { + cleanupListener(); + }); + this.listeners = []; + + // reset current history route + // https://github.com/vuejs/vue-router/issues/3294 + this.current = START; + this.pending = null; +}; + +function normalizeBase(base) { + if (!base) { + if (inBrowser) { + // respect tag + const baseEl = document.querySelector('base'); + base = (baseEl && baseEl.getAttribute('href')) || '/'; + // strip full URL origin + base = base.replace(/^https?:\/\/[^\/]+/, ''); + } else { + base = '/'; + } + } + // make sure there's the starting slash + if (base.charAt(0) !== '/') { + base = `/${base}`; + } + // remove trailing slash + return base.replace(/\/$/, ''); +} + +function resolveQueue(current, next) { + let i; + const max = Math.max(current.length, next.length); + for (i = 0; i < max; i++) { + if (current[i] !== next[i]) { + break; + } + } + + return { + updated: next.slice(0, i), + activated: next.slice(i), + deactivated: current.slice(i), + }; +} + +function extractGuards(records, name, bind, reverse) { + const guards = flatMapComponents(records, (def, instance, match, key) => { + const guard = extractGuard(def, name); + if (guard) { + return Array.isArray(guard) + ? guard.map(guard => bind(guard, instance, match, key)) + : bind(guard, instance, match, key); + } + }); + + return flatten(reverse ? guards.reverse() : guards); +} + +function extractGuard(def, key) { + if (typeof def !== 'function') { + // extend now so that global mixins are applied. + // def = _Vue.extend(def); + } + + return def[key]; +} + +function extractLeaveGuards(deactivated) { + return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true); +} + +function extractUpdateHooks(updated) { + return extractGuards(updated, 'beforeRouteUpdate', bindGuard); +} + +function bindGuard(guard, instance) { + if (instance) { + return function boundRouteGuard() { + return guard.apply(instance, arguments); + }; + } +} + +function extractEnterGuards(activated) { + return extractGuards(activated, 'beforeRouteEnter', (guard, _, match, key) => bindEnterGuard(guard, match, key)); +} + +function bindEnterGuard(guard, match, key) { + return function routeEnterGuard(to, from, next) { + return guard(to, from, cb => { + if (typeof cb === 'function') { + if (!match.enteredCbs[key]) { + match.enteredCbs[key] = []; + } + match.enteredCbs[key].push(cb); + } + next(cb); + }); + }; +} + +/* */ + +const HTML5History = /* @__PURE__*/ (function (History) { + function HTML5History(router, base) { + History.call(this, router, base); + + this._startLocation = getLocation(this.base); + } + + if (History) HTML5History.__proto__ = History; + HTML5History.prototype = Object.create(History && History.prototype); + HTML5History.prototype.constructor = HTML5History; + + HTML5History.prototype.setupListeners = function setupListeners() { + const this$1 = this; + + if (this.listeners.length > 0) { + return; + } + + const router = this.router; + const expectScroll = router.options.scrollBehavior; + const supportsScroll = supportsPushState && expectScroll; + + if (supportsScroll) { + this.listeners.push(setupScroll()); + } + + const handleRoutingEvent = function () { + const current = this$1.current; + + // Avoiding first `popstate` event dispatched in some browsers but first + // history route not updated since async guard at the same time. + const location = getLocation(this$1.base); + if (this$1.current === START && location === this$1._startLocation) { + return; + } + + this$1.transitionTo(location, route => { + if (supportsScroll) { + handleScroll(router, route, current, true); + } + }); + }; + window.addEventListener('popstate', handleRoutingEvent); + this.listeners.push(() => { + window.removeEventListener('popstate', handleRoutingEvent); + }); + }; + + HTML5History.prototype.go = function go(n) { + window.history.go(n); + }; + + HTML5History.prototype.push = function push(location, onComplete, onAbort) { + const this$1 = this; + + const ref = this; + const fromRoute = ref.current; + this.transitionTo( + location, + route => { + pushState(cleanPath(this$1.base + route.fullPath)); + handleScroll(this$1.router, route, fromRoute, false); + onComplete && onComplete(route); + }, + onAbort + ); + }; + + HTML5History.prototype.replace = function replace(location, onComplete, onAbort) { + const this$1 = this; + + const ref = this; + const fromRoute = ref.current; + this.transitionTo( + location, + route => { + replaceState(cleanPath(this$1.base + route.fullPath)); + handleScroll(this$1.router, route, fromRoute, false); + onComplete && onComplete(route); + }, + onAbort + ); + }; + + HTML5History.prototype.ensureURL = function ensureURL(push) { + if (getLocation(this.base) !== this.current.fullPath) { + const current = cleanPath(this.base + this.current.fullPath); + push ? pushState(current) : replaceState(current); + } + }; + + HTML5History.prototype.getCurrentLocation = function getCurrentLocation() { + return getLocation(this.base); + }; + + return HTML5History; +})(History); + +function getLocation(base) { + let path = window.location.pathname; + const pathLowerCase = path.toLowerCase(); + const baseLowerCase = base.toLowerCase(); + // base="/a" shouldn't turn path="/app" into "/a/pp" + // https://github.com/vuejs/vue-router/issues/3555 + // so we ensure the trailing slash in the base + if (base && (pathLowerCase === baseLowerCase || pathLowerCase.indexOf(cleanPath(`${baseLowerCase}/`)) === 0)) { + path = path.slice(base.length); + } + + return (path || '/') + window.location.search + window.location.hash; +} + +/* */ + +const HashHistory = /* @__PURE__*/ (function (History) { + function HashHistory(router, base, fallback) { + History.call(this, router, base); + // check history fallback deeplinking + if (fallback && checkFallback(this.base)) { + return; + } + ensureSlash(); + } + + if (History) HashHistory.__proto__ = History; + HashHistory.prototype = Object.create(History && History.prototype); + HashHistory.prototype.constructor = HashHistory; + + // this is delayed until the app mounts + // to avoid the hashchange listener being fired too early + HashHistory.prototype.setupListeners = function setupListeners() { + const this$1 = this; + + if (this.listeners.length > 0) { + return; + } + + const router = this.router; + const expectScroll = router.options.scrollBehavior; + const supportsScroll = supportsPushState && expectScroll; + + if (supportsScroll) { + this.listeners.push(setupScroll()); + } + + const handleRoutingEvent = function () { + const current = this$1.current; + if (!ensureSlash()) { + return; + } + this$1.transitionTo(getHash(), route => { + if (supportsScroll) { + handleScroll(this$1.router, route, current, true); + } + if (!supportsPushState) { + replaceHash(route.fullPath); + } + }); + }; + const eventType = supportsPushState ? 'popstate' : 'hashchange'; + window.addEventListener(eventType, handleRoutingEvent); + this.listeners.push(() => { + window.removeEventListener(eventType, handleRoutingEvent); + }); + }; + + HashHistory.prototype.push = function push(location, onComplete, onAbort) { + const this$1 = this; + + const ref = this; + const fromRoute = ref.current; + this.transitionTo( + location, + route => { + pushHash(route.fullPath); + handleScroll(this$1.router, route, fromRoute, false); + onComplete && onComplete(route); + }, + onAbort + ); + }; + + HashHistory.prototype.replace = function replace(location, onComplete, onAbort) { + const this$1 = this; + + const ref = this; + const fromRoute = ref.current; + this.transitionTo( + location, + route => { + replaceHash(route.fullPath); + handleScroll(this$1.router, route, fromRoute, false); + onComplete && onComplete(route); + }, + onAbort + ); + }; + + HashHistory.prototype.go = function go(n) { + window.history.go(n); + }; + + HashHistory.prototype.ensureURL = function ensureURL(push) { + const current = this.current.fullPath; + if (getHash() !== current) { + push ? pushHash(current) : replaceHash(current); + } + }; + + HashHistory.prototype.getCurrentLocation = function getCurrentLocation() { + return getHash(); + }; + + return HashHistory; +})(History); + +function checkFallback(base) { + const location = getLocation(base); + if (!/^\/#/.test(location)) { + window.location.replace(cleanPath(`${base}/#${location}`)); + + return true; + } +} + +function ensureSlash() { + const path = getHash(); + if (path.charAt(0) === '/') { + return true; + } + replaceHash(`/${path}`); + + return false; +} + +function getHash() { + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + let href = window.location.href; + const index = href.indexOf('#'); + // empty path + if (index < 0) { + return ''; + } + + href = href.slice(index + 1); + + return href; +} + +function getUrl(path) { + const href = window.location.href; + const i = href.indexOf('#'); + const base = i >= 0 ? href.slice(0, i) : href; + + return `${base}#${path}`; +} + +function pushHash(path) { + if (supportsPushState) { + pushState(getUrl(path)); + } else { + window.location.hash = path; + } +} + +function replaceHash(path) { + if (supportsPushState) { + replaceState(getUrl(path)); + } else { + window.location.replace(getUrl(path)); + } +} + +/* */ + +const AbstractHistory = /* @__PURE__*/ (function (History) { + function AbstractHistory(router, base) { + History.call(this, router, base); + this.stack = []; + this.index = -1; + } + + if (History) AbstractHistory.__proto__ = History; + AbstractHistory.prototype = Object.create(History && History.prototype); + AbstractHistory.prototype.constructor = AbstractHistory; + + AbstractHistory.prototype.push = function push(location, onComplete, onAbort) { + const this$1 = this; + + this.transitionTo( + location, + route => { + this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route); + this$1.index++; + onComplete && onComplete(route); + }, + onAbort + ); + }; + + AbstractHistory.prototype.replace = function replace(location, onComplete, onAbort) { + const this$1 = this; + + this.transitionTo( + location, + route => { + this$1.stack = this$1.stack.slice(0, this$1.index).concat(route); + onComplete && onComplete(route); + }, + onAbort + ); + }; + + AbstractHistory.prototype.go = function go(n) { + const this$1 = this; + + const targetIndex = this.index + n; + if (targetIndex < 0 || targetIndex >= this.stack.length) { + return; + } + const route = this.stack[targetIndex]; + this.confirmTransition( + route, + () => { + const prev = this$1.current; + this$1.index = targetIndex; + this$1.updateRoute(route); + this$1.router.afterHooks.forEach(hook => { + hook && hook(route, prev); + }); + }, + err => { + if (isNavigationFailure(err, NavigationFailureType.duplicated)) { + this$1.index = targetIndex; + } + } + ); + }; + + AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation() { + const current = this.stack[this.stack.length - 1]; + + return current ? current.fullPath : '/'; + }; + + AbstractHistory.prototype.ensureURL = function ensureURL() { + // noop + }; + + return AbstractHistory; +})(History); + +/* */ + +const VueRouter = function VueRouter(options) { + if (options === void 0) options = {}; + + this.app = null; + this.apps = []; + this.options = options; + this.beforeHooks = []; + this.resolveHooks = []; + this.afterHooks = []; + this.matcher = createMatcher(options.routes || [], this); + + let mode = options.mode || 'hash'; + this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false; + if (this.fallback) { + mode = 'hash'; + } + if (!inBrowser) { + mode = 'abstract'; + } + this.mode = mode; + + switch (mode) { + case 'history': + this.history = new HTML5History(this, options.base); + break; + case 'hash': + this.history = new HashHistory(this, options.base, this.fallback); + break; + case 'abstract': + this.history = new AbstractHistory(this, options.base); + break; + default: { + assert(false, `invalid mode: ${mode}`); + } + } +}; + +const prototypeAccessors = { currentRoute: { configurable: true } }; + +VueRouter.prototype.match = function match(raw, current, redirectedFrom) { + return this.matcher.match(raw, current, redirectedFrom); +}; + +prototypeAccessors.currentRoute.get = function () { + return this.history && this.history.current; +}; + +VueRouter.prototype.init = function init(app /* Vue component instance */) { + const this$1 = this; + + this.apps.push(app); + + // set up app destroyed handler + // https://github.com/vuejs/vue-router/issues/2639 + app.once('hook:destroyed', () => { + // clean out app from this.apps array once destroyed + const index = this$1.apps.indexOf(app); + if (index > -1) { + this$1.apps.splice(index, 1); + } + // ensure we still have a main app or null if no apps + // we do not release the router so it can be reused + if (this$1.app === app) { + this$1.app = this$1.apps[0] || null; + } + + if (!this$1.app) { + this$1.history.teardown(); + } + }); + + // main app previously initialized + // return as we don't need to set up new history listener + if (this.app) { + return; + } + + this.app = app; + + const history = this.history; + + if (history instanceof HTML5History || history instanceof HashHistory) { + const handleInitialScroll = function (routeOrError) { + const from = history.current; + const expectScroll = this$1.options.scrollBehavior; + const supportsScroll = supportsPushState && expectScroll; + + if (supportsScroll && 'fullPath' in routeOrError) { + handleScroll(this$1, routeOrError, from, false); + } + }; + const setupListeners = function (routeOrError) { + history.setupListeners(); + handleInitialScroll(routeOrError); + }; + history.transitionTo(history.getCurrentLocation(), setupListeners, setupListeners); + } + + history.listen(route => { + this$1.apps.forEach(app => { + app._router.history.current = route; + }); + }); +}; + +VueRouter.prototype.beforeEach = function beforeEach(fn) { + return registerHook(this.beforeHooks, fn); +}; + +VueRouter.prototype.beforeResolve = function beforeResolve(fn) { + return registerHook(this.resolveHooks, fn); +}; + +VueRouter.prototype.afterEach = function afterEach(fn) { + return registerHook(this.afterHooks, fn); +}; + +VueRouter.prototype.onReady = function onReady(cb, errorCb) { + this.history.onReady(cb, errorCb); +}; + +VueRouter.prototype.onError = function onError(errorCb) { + this.history.onError(errorCb); +}; + +VueRouter.prototype.push = function push(location, onComplete, onAbort) { + const this$1 = this; + + // $flow-disable-line + if (!onComplete && !onAbort && typeof Promise !== 'undefined') { + return new Promise((resolve, reject) => { + this$1.history.push(location, resolve, reject); + }); + } else { + this.history.push(location, onComplete, onAbort); + } +}; + +VueRouter.prototype.replace = function replace(location, onComplete, onAbort) { + const this$1 = this; + + // $flow-disable-line + if (!onComplete && !onAbort && typeof Promise !== 'undefined') { + return new Promise((resolve, reject) => { + this$1.history.replace(location, resolve, reject); + }); + } else { + this.history.replace(location, onComplete, onAbort); + } +}; + +VueRouter.prototype.go = function go(n) { + this.history.go(n); +}; + +VueRouter.prototype.back = function back() { + this.go(-1); +}; + +VueRouter.prototype.forward = function forward() { + this.go(1); +}; + +VueRouter.prototype.getMatchedComponents = function getMatchedComponents(to) { + const route = to ? (to.matched ? to : this.resolve(to).route) : this.currentRoute; + if (!route) { + return []; + } + + return [].concat.apply( + [], + route.matched.map(m => Object.keys(m.components).map(key => m.components[key])) + ); +}; + +VueRouter.prototype.resolve = function resolve(to, current, append) { + current = current || this.history.current; + const location = normalizeLocation(to, current, append, this); + const route = this.match(location, current); + const fullPath = route.redirectedFrom || route.fullPath; + const base = this.history.base; + const href = createHref(base, fullPath, this.mode); + + return { + location, + route, + href, + // for backwards compat + normalizedTo: location, + resolved: route, + }; +}; + +VueRouter.prototype.getRoutes = function getRoutes() { + return this.matcher.getRoutes(); +}; + +VueRouter.prototype.addRoute = function addRoute(parentOrRoute, route) { + this.matcher.addRoute(parentOrRoute, route); + if (this.history.current !== START) { + this.history.transitionTo(this.history.getCurrentLocation()); + } +}; + +Object.defineProperties(VueRouter.prototype, prototypeAccessors); + +function registerHook(list, fn) { + list.push(fn); + + return function () { + const i = list.indexOf(fn); + if (i > -1) { + list.splice(i, 1); + } + }; +} + +function createHref(base, fullPath, mode) { + const path = mode === 'hash' ? `#${fullPath}` : fullPath; + + return base ? cleanPath(`${base}/${path}`) : path; +} + +// VueRouter.install = install; +VueRouter.version = '3.5.2'; +VueRouter.isNavigationFailure = isNavigationFailure; +VueRouter.NavigationFailureType = NavigationFailureType; +VueRouter.START_LOCATION = START; + +let $router; +const cbs = []; +@shortcut() +export class RouterWidget extends Widget { + static xtype = 'bi.router'; + + init() { + this.$router = + this._router = + Router.$router = + $router = + new VueRouter({ + mode: this.options.mode, + routes: this.options.routes, + base: this.options.base, + }); + Fix.defineReactiveProperty(Router.$router.history, 'current'); + this.$router.beforeEach((to, from, next) => { + if (to.matched.length === 0) { + // 如果上级也未匹配到路由则跳转主页面,如果上级能匹配到则转上级路由 + from.path ? next({ path: from.path }) : next('/'); + } else { + // 如果匹配到正确跳转 + next(); + } + }); + this.$router.afterEach(() => { + cbs.forEach(cb => { + cb(); + }); + }); + this.$router.init(this); + } +} + +@shortcut() +export class RouterView extends Widget { + static xtype = 'bi.router_view'; + + props = { + baseCls: 'bi-router-view', + deps: 0, + name: 'default', + }; + created() { + const self = this, + o = this.options; + cbs.push( + (this._callbackListener = function () { + const current = $router.history.current; + // 匹配的路径名(/component/:id) + let matchedPath = current.matched[o.deps] && current.matched[o.deps].path; + const component = current.matched[o.deps] && current.matched[o.deps].components[o.name]; + + if (isNotNull(component)) { + if (matchedPath) { + each(current.params, (key, value) => { + // 把 :id 替换成具体的值(/component/demo.td) + matchedPath = matchedPath.replace(`:${key}`, value); + }); + } + self.tab.setSelect(matchedPath || '/'); + } + }) + ); + // "bi.router_view"是由"bi.tab"实现的,cardCreator是一个异步过程,在"bi.router_view"创建之前,cbs里不会有创建子组件的方法,在初始化路由时,没法直接渲染到子组件,所以这里手动加了一次调用 + this._callbackListener(); + } + + render() { + const self = this, + o = this.options; + + return { + type: Tab.xtype, + ref(_ref) { + self.tab = _ref; + }, + single: o.single, // 是不是单页面 + keepAlives: o.keepAlives, + logic: { + dynamic: false, + }, + showIndex: false, + cardCreator(v) { + return $router.history.current.matched[o.deps].components[o.name]; + }, + }; + } + + destroyed() { + // BI.remove方法会把第二个参数当迭代器执行导致方法多执行一遍 + cbs.splice(cbs.indexOf(this._callbackListener), 1); + } +} + +Router.isSameRoute = isSameRoute; diff --git a/src/third/sort.gb2312.js b/packages/fineui/src/third/sort.gb2312.js similarity index 100% rename from src/third/sort.gb2312.js rename to packages/fineui/src/third/sort.gb2312.js diff --git a/src/widget/collapse/collapse.js b/packages/fineui/src/widget/collapse/collapse.js similarity index 100% rename from src/widget/collapse/collapse.js rename to packages/fineui/src/widget/collapse/collapse.js diff --git a/src/widget/date/calendar/combo.month.date.js b/packages/fineui/src/widget/date/calendar/combo.month.date.js similarity index 100% rename from src/widget/date/calendar/combo.month.date.js rename to packages/fineui/src/widget/date/calendar/combo.month.date.js diff --git a/src/widget/date/calendar/combo.year.date.js b/packages/fineui/src/widget/date/calendar/combo.year.date.js similarity index 100% rename from src/widget/date/calendar/combo.year.date.js rename to packages/fineui/src/widget/date/calendar/combo.year.date.js diff --git a/src/widget/date/calendar/index.js b/packages/fineui/src/widget/date/calendar/index.js similarity index 100% rename from src/widget/date/calendar/index.js rename to packages/fineui/src/widget/date/calendar/index.js diff --git a/src/widget/date/calendar/picker.date.js b/packages/fineui/src/widget/date/calendar/picker.date.js similarity index 100% rename from src/widget/date/calendar/picker.date.js rename to packages/fineui/src/widget/date/calendar/picker.date.js diff --git a/src/widget/date/calendar/picker.year.js b/packages/fineui/src/widget/date/calendar/picker.year.js similarity index 100% rename from src/widget/date/calendar/picker.year.js rename to packages/fineui/src/widget/date/calendar/picker.year.js diff --git a/src/widget/date/calendar/popup.calendar.date.js b/packages/fineui/src/widget/date/calendar/popup.calendar.date.js similarity index 100% rename from src/widget/date/calendar/popup.calendar.date.js rename to packages/fineui/src/widget/date/calendar/popup.calendar.date.js diff --git a/src/widget/date/calendar/popup.month.js b/packages/fineui/src/widget/date/calendar/popup.month.js similarity index 100% rename from src/widget/date/calendar/popup.month.js rename to packages/fineui/src/widget/date/calendar/popup.month.js diff --git a/src/widget/date/calendar/popup.year.js b/packages/fineui/src/widget/date/calendar/popup.year.js similarity index 100% rename from src/widget/date/calendar/popup.year.js rename to packages/fineui/src/widget/date/calendar/popup.year.js diff --git a/src/widget/date/calendar/trigger.triangle.date.js b/packages/fineui/src/widget/date/calendar/trigger.triangle.date.js similarity index 100% rename from src/widget/date/calendar/trigger.triangle.date.js rename to packages/fineui/src/widget/date/calendar/trigger.triangle.date.js diff --git a/src/widget/date/index.js b/packages/fineui/src/widget/date/index.js similarity index 100% rename from src/widget/date/index.js rename to packages/fineui/src/widget/date/index.js diff --git a/src/widget/datepane/__test__/datepane.test.js b/packages/fineui/src/widget/datepane/__test__/datepane.test.js similarity index 100% rename from src/widget/datepane/__test__/datepane.test.js rename to packages/fineui/src/widget/datepane/__test__/datepane.test.js diff --git a/src/widget/datepane/card.static.datepane.js b/packages/fineui/src/widget/datepane/card.static.datepane.js similarity index 100% rename from src/widget/datepane/card.static.datepane.js rename to packages/fineui/src/widget/datepane/card.static.datepane.js diff --git a/src/widget/datepane/datepane.js b/packages/fineui/src/widget/datepane/datepane.js similarity index 100% rename from src/widget/datepane/datepane.js rename to packages/fineui/src/widget/datepane/datepane.js diff --git a/src/widget/datepane/index.js b/packages/fineui/src/widget/datepane/index.js similarity index 100% rename from src/widget/datepane/index.js rename to packages/fineui/src/widget/datepane/index.js diff --git a/src/widget/datetime/__test__/datetime.test.js b/packages/fineui/src/widget/datetime/__test__/datetime.test.js similarity index 100% rename from src/widget/datetime/__test__/datetime.test.js rename to packages/fineui/src/widget/datetime/__test__/datetime.test.js diff --git a/src/widget/datetime/datetime.combo.js b/packages/fineui/src/widget/datetime/datetime.combo.js similarity index 100% rename from src/widget/datetime/datetime.combo.js rename to packages/fineui/src/widget/datetime/datetime.combo.js diff --git a/src/widget/datetime/datetime.popup.js b/packages/fineui/src/widget/datetime/datetime.popup.js similarity index 100% rename from src/widget/datetime/datetime.popup.js rename to packages/fineui/src/widget/datetime/datetime.popup.js diff --git a/src/widget/datetime/datetime.trigger.js b/packages/fineui/src/widget/datetime/datetime.trigger.js similarity index 100% rename from src/widget/datetime/datetime.trigger.js rename to packages/fineui/src/widget/datetime/datetime.trigger.js diff --git a/src/widget/datetime/index.js b/packages/fineui/src/widget/datetime/index.js similarity index 100% rename from src/widget/datetime/index.js rename to packages/fineui/src/widget/datetime/index.js diff --git a/src/widget/datetimepane/__test__/datetimepane.test.js b/packages/fineui/src/widget/datetimepane/__test__/datetimepane.test.js similarity index 100% rename from src/widget/datetimepane/__test__/datetimepane.test.js rename to packages/fineui/src/widget/datetimepane/__test__/datetimepane.test.js diff --git a/src/widget/datetimepane/card.static.datetimepane.js b/packages/fineui/src/widget/datetimepane/card.static.datetimepane.js similarity index 100% rename from src/widget/datetimepane/card.static.datetimepane.js rename to packages/fineui/src/widget/datetimepane/card.static.datetimepane.js diff --git a/src/widget/datetimepane/datetimepane.js b/packages/fineui/src/widget/datetimepane/datetimepane.js similarity index 100% rename from src/widget/datetimepane/datetimepane.js rename to packages/fineui/src/widget/datetimepane/datetimepane.js diff --git a/src/widget/datetimepane/index.js b/packages/fineui/src/widget/datetimepane/index.js similarity index 100% rename from src/widget/datetimepane/index.js rename to packages/fineui/src/widget/datetimepane/index.js diff --git a/src/widget/downlist/__test__/downlist.test.js b/packages/fineui/src/widget/downlist/__test__/downlist.test.js similarity index 100% rename from src/widget/downlist/__test__/downlist.test.js rename to packages/fineui/src/widget/downlist/__test__/downlist.test.js diff --git a/src/widget/downlist/combo.downlist.js b/packages/fineui/src/widget/downlist/combo.downlist.js similarity index 100% rename from src/widget/downlist/combo.downlist.js rename to packages/fineui/src/widget/downlist/combo.downlist.js diff --git a/src/widget/downlist/group.downlist.js b/packages/fineui/src/widget/downlist/group.downlist.js similarity index 100% rename from src/widget/downlist/group.downlist.js rename to packages/fineui/src/widget/downlist/group.downlist.js diff --git a/src/widget/downlist/index.js b/packages/fineui/src/widget/downlist/index.js similarity index 100% rename from src/widget/downlist/index.js rename to packages/fineui/src/widget/downlist/index.js diff --git a/src/widget/downlist/item.downlist.js b/packages/fineui/src/widget/downlist/item.downlist.js similarity index 100% rename from src/widget/downlist/item.downlist.js rename to packages/fineui/src/widget/downlist/item.downlist.js diff --git a/src/widget/downlist/item.downlistgroup.js b/packages/fineui/src/widget/downlist/item.downlistgroup.js similarity index 100% rename from src/widget/downlist/item.downlistgroup.js rename to packages/fineui/src/widget/downlist/item.downlistgroup.js diff --git a/src/widget/downlist/popup.downlist.js b/packages/fineui/src/widget/downlist/popup.downlist.js similarity index 100% rename from src/widget/downlist/popup.downlist.js rename to packages/fineui/src/widget/downlist/popup.downlist.js diff --git a/src/widget/dynamicdate/__test__/dynamicdate.test.js b/packages/fineui/src/widget/dynamicdate/__test__/dynamicdate.test.js similarity index 100% rename from src/widget/dynamicdate/__test__/dynamicdate.test.js rename to packages/fineui/src/widget/dynamicdate/__test__/dynamicdate.test.js diff --git a/src/widget/dynamicdate/dynamicdate.caculate.js b/packages/fineui/src/widget/dynamicdate/dynamicdate.caculate.js similarity index 100% rename from src/widget/dynamicdate/dynamicdate.caculate.js rename to packages/fineui/src/widget/dynamicdate/dynamicdate.caculate.js diff --git a/src/widget/dynamicdate/dynamicdate.card.js b/packages/fineui/src/widget/dynamicdate/dynamicdate.card.js similarity index 100% rename from src/widget/dynamicdate/dynamicdate.card.js rename to packages/fineui/src/widget/dynamicdate/dynamicdate.card.js diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/packages/fineui/src/widget/dynamicdate/dynamicdate.combo.js similarity index 100% rename from src/widget/dynamicdate/dynamicdate.combo.js rename to packages/fineui/src/widget/dynamicdate/dynamicdate.combo.js diff --git a/src/widget/dynamicdate/dynamicdate.param.item.js b/packages/fineui/src/widget/dynamicdate/dynamicdate.param.item.js similarity index 100% rename from src/widget/dynamicdate/dynamicdate.param.item.js rename to packages/fineui/src/widget/dynamicdate/dynamicdate.param.item.js diff --git a/src/widget/dynamicdate/dynamicdate.popup.js b/packages/fineui/src/widget/dynamicdate/dynamicdate.popup.js similarity index 100% rename from src/widget/dynamicdate/dynamicdate.popup.js rename to packages/fineui/src/widget/dynamicdate/dynamicdate.popup.js diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/packages/fineui/src/widget/dynamicdate/dynamicdate.trigger.js similarity index 100% rename from src/widget/dynamicdate/dynamicdate.trigger.js rename to packages/fineui/src/widget/dynamicdate/dynamicdate.trigger.js diff --git a/src/widget/dynamicdate/index.js b/packages/fineui/src/widget/dynamicdate/index.js similarity index 100% rename from src/widget/dynamicdate/index.js rename to packages/fineui/src/widget/dynamicdate/index.js diff --git a/src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js b/packages/fineui/src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js similarity index 100% rename from src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js rename to packages/fineui/src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js similarity index 100% rename from src/widget/dynamicdatetime/dynamicdatetime.combo.js rename to packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js diff --git a/src/widget/dynamicdatetime/dynamicdatetime.popup.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js similarity index 100% rename from src/widget/dynamicdatetime/dynamicdatetime.popup.js rename to packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js diff --git a/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js similarity index 100% rename from src/widget/dynamicdatetime/dynamicdatetime.timeselect.js rename to packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js diff --git a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.trigger.js similarity index 100% rename from src/widget/dynamicdatetime/dynamicdatetime.trigger.js rename to packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.trigger.js diff --git a/src/widget/dynamicdatetime/index.js b/packages/fineui/src/widget/dynamicdatetime/index.js similarity index 100% rename from src/widget/dynamicdatetime/index.js rename to packages/fineui/src/widget/dynamicdatetime/index.js diff --git a/src/widget/editor/__test__/editor.search.test.js b/packages/fineui/src/widget/editor/__test__/editor.search.test.js similarity index 100% rename from src/widget/editor/__test__/editor.search.test.js rename to packages/fineui/src/widget/editor/__test__/editor.search.test.js diff --git a/src/widget/editor/__test__/editor.text.test.js b/packages/fineui/src/widget/editor/__test__/editor.text.test.js similarity index 100% rename from src/widget/editor/__test__/editor.text.test.js rename to packages/fineui/src/widget/editor/__test__/editor.text.test.js diff --git a/src/widget/editor/editor.search.js b/packages/fineui/src/widget/editor/editor.search.js similarity index 100% rename from src/widget/editor/editor.search.js rename to packages/fineui/src/widget/editor/editor.search.js diff --git a/src/widget/editor/editor.search.small.js b/packages/fineui/src/widget/editor/editor.search.small.js similarity index 100% rename from src/widget/editor/editor.search.small.js rename to packages/fineui/src/widget/editor/editor.search.small.js diff --git a/src/widget/editor/editor.text.js b/packages/fineui/src/widget/editor/editor.text.js similarity index 100% rename from src/widget/editor/editor.text.js rename to packages/fineui/src/widget/editor/editor.text.js diff --git a/src/widget/editor/editor.text.small.js b/packages/fineui/src/widget/editor/editor.text.small.js similarity index 100% rename from src/widget/editor/editor.text.small.js rename to packages/fineui/src/widget/editor/editor.text.small.js diff --git a/src/widget/editor/index.js b/packages/fineui/src/widget/editor/index.js similarity index 100% rename from src/widget/editor/index.js rename to packages/fineui/src/widget/editor/index.js diff --git a/packages/fineui/src/widget/index.js b/packages/fineui/src/widget/index.js new file mode 100644 index 000000000..b378d16ad --- /dev/null +++ b/packages/fineui/src/widget/index.js @@ -0,0 +1,40 @@ +export { Collapse } from "./collapse/collapse"; +export { SelectTreeExpander } from "./selecttree/selecttree.expander"; +export { SelectTreeCombo } from "./selecttree/selecttree.combo"; +export { SingleTreeCombo } from "./singletree/singletree.combo"; +export { MultiTreeCombo } from "./multitree/multi.tree.combo"; +export { MultiTreeInsertCombo } from "./multitree/multi.tree.insert.combo"; +export { MultiTreeListCombo } from "./multitree/multi.tree.list.combo"; +export { NumberEditor } from "./numbereditor/number.editor"; +export { NumberInterval } from "./numberinterval/numberinterval"; +export { YearMonthInterval } from "./yearmonthinterval/yearmonthinterval"; +export { YearQuarterInterval } from "./yearquarterinterval/yearquarterinterval"; +export { YearInterval } from "./yearinterval/yearinterval"; + +export * from "./date/calendar"; +export * from "./dynamicdate"; +export * from "./datepane"; +export * from "./datetime"; +export * from "./datetimepane"; +export * from "./dynamicdatetime"; +export * from "./time"; +export * from "./timeinterval"; +export * from "./editor"; +export * from "./yearmonth"; +export * from "./multiselect"; +export * from "./multiselectlist"; +export * from "./downlist"; +export * from "./singleslider"; +export * from "./intervalslider"; +export * from "./year"; +export * from "./multilayersingletree"; +export * from "./multilayerselecttree"; +export * from "./searchmultitextvaluecombo"; +export * from "./singleselect"; +export * from "./multilayerdownlist"; +export * from "./yearquarter"; +export * from "./textvaluedownlistcombo"; +export * from "./searchmultitextvaluecombo"; +export * from "./multiselecttree/multiselecttree"; +export * from "./selecttree/selecttree.popup"; +export * from "./singletree/singletree.popup"; diff --git a/src/widget/intervalslider/__test__/accuratecalculation.test.js b/packages/fineui/src/widget/intervalslider/__test__/accuratecalculation.test.js similarity index 100% rename from src/widget/intervalslider/__test__/accuratecalculation.test.js rename to packages/fineui/src/widget/intervalslider/__test__/accuratecalculation.test.js diff --git a/src/widget/intervalslider/__test__/intervalslider.test.js b/packages/fineui/src/widget/intervalslider/__test__/intervalslider.test.js similarity index 100% rename from src/widget/intervalslider/__test__/intervalslider.test.js rename to packages/fineui/src/widget/intervalslider/__test__/intervalslider.test.js diff --git a/src/widget/intervalslider/index.js b/packages/fineui/src/widget/intervalslider/index.js similarity index 100% rename from src/widget/intervalslider/index.js rename to packages/fineui/src/widget/intervalslider/index.js diff --git a/src/widget/intervalslider/intervalslider.js b/packages/fineui/src/widget/intervalslider/intervalslider.js similarity index 100% rename from src/widget/intervalslider/intervalslider.js rename to packages/fineui/src/widget/intervalslider/intervalslider.js diff --git a/src/widget/intervalslider/model.accuratecalculation.js b/packages/fineui/src/widget/intervalslider/model.accuratecalculation.js similarity index 100% rename from src/widget/intervalslider/model.accuratecalculation.js rename to packages/fineui/src/widget/intervalslider/model.accuratecalculation.js diff --git a/src/widget/multilayerdownlist/__test__/downlist.test.js b/packages/fineui/src/widget/multilayerdownlist/__test__/downlist.test.js similarity index 100% rename from src/widget/multilayerdownlist/__test__/downlist.test.js rename to packages/fineui/src/widget/multilayerdownlist/__test__/downlist.test.js diff --git a/src/widget/multilayerdownlist/combo.downlist.js b/packages/fineui/src/widget/multilayerdownlist/combo.downlist.js similarity index 100% rename from src/widget/multilayerdownlist/combo.downlist.js rename to packages/fineui/src/widget/multilayerdownlist/combo.downlist.js diff --git a/src/widget/multilayerdownlist/index.js b/packages/fineui/src/widget/multilayerdownlist/index.js similarity index 100% rename from src/widget/multilayerdownlist/index.js rename to packages/fineui/src/widget/multilayerdownlist/index.js diff --git a/src/widget/multilayerdownlist/popup.downlist.js b/packages/fineui/src/widget/multilayerdownlist/popup.downlist.js similarity index 100% rename from src/widget/multilayerdownlist/popup.downlist.js rename to packages/fineui/src/widget/multilayerdownlist/popup.downlist.js diff --git a/src/widget/multilayerselecttree/__test__/multilayerselecttree.combo.test.js b/packages/fineui/src/widget/multilayerselecttree/__test__/multilayerselecttree.combo.test.js similarity index 100% rename from src/widget/multilayerselecttree/__test__/multilayerselecttree.combo.test.js rename to packages/fineui/src/widget/multilayerselecttree/__test__/multilayerselecttree.combo.test.js diff --git a/src/widget/multilayerselecttree/index.js b/packages/fineui/src/widget/multilayerselecttree/index.js similarity index 100% rename from src/widget/multilayerselecttree/index.js rename to packages/fineui/src/widget/multilayerselecttree/index.js diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.combo.js similarity index 100% rename from src/widget/multilayerselecttree/multilayerselecttree.combo.js rename to packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.combo.js diff --git a/src/widget/multilayerselecttree/multilayerselecttree.insert.search.pane.js b/packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.insert.search.pane.js similarity index 100% rename from src/widget/multilayerselecttree/multilayerselecttree.insert.search.pane.js rename to packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.insert.search.pane.js diff --git a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js b/packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js similarity index 100% rename from src/widget/multilayerselecttree/multilayerselecttree.leveltree.js rename to packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js diff --git a/src/widget/multilayerselecttree/multilayerselecttree.popup.js b/packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.popup.js similarity index 100% rename from src/widget/multilayerselecttree/multilayerselecttree.popup.js rename to packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.popup.js diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.trigger.js similarity index 100% rename from src/widget/multilayerselecttree/multilayerselecttree.trigger.js rename to packages/fineui/src/widget/multilayerselecttree/multilayerselecttree.trigger.js diff --git a/src/widget/multilayersingletree/__test__/multilayersingletree.combo.test.js b/packages/fineui/src/widget/multilayersingletree/__test__/multilayersingletree.combo.test.js similarity index 100% rename from src/widget/multilayersingletree/__test__/multilayersingletree.combo.test.js rename to packages/fineui/src/widget/multilayersingletree/__test__/multilayersingletree.combo.test.js diff --git a/src/widget/multilayersingletree/index.js b/packages/fineui/src/widget/multilayersingletree/index.js similarity index 100% rename from src/widget/multilayersingletree/index.js rename to packages/fineui/src/widget/multilayersingletree/index.js diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/packages/fineui/src/widget/multilayersingletree/multilayersingletree.combo.js similarity index 100% rename from src/widget/multilayersingletree/multilayersingletree.combo.js rename to packages/fineui/src/widget/multilayersingletree/multilayersingletree.combo.js diff --git a/src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js b/packages/fineui/src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js similarity index 100% rename from src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js rename to packages/fineui/src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js diff --git a/src/widget/multilayersingletree/multilayersingletree.leveltree.js b/packages/fineui/src/widget/multilayersingletree/multilayersingletree.leveltree.js similarity index 100% rename from src/widget/multilayersingletree/multilayersingletree.leveltree.js rename to packages/fineui/src/widget/multilayersingletree/multilayersingletree.leveltree.js diff --git a/src/widget/multilayersingletree/multilayersingletree.popup.js b/packages/fineui/src/widget/multilayersingletree/multilayersingletree.popup.js similarity index 100% rename from src/widget/multilayersingletree/multilayersingletree.popup.js rename to packages/fineui/src/widget/multilayersingletree/multilayersingletree.popup.js diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/packages/fineui/src/widget/multilayersingletree/multilayersingletree.trigger.js similarity index 100% rename from src/widget/multilayersingletree/multilayersingletree.trigger.js rename to packages/fineui/src/widget/multilayersingletree/multilayersingletree.trigger.js diff --git a/src/widget/multiselect/__test__/multiselect.loader.nobar.test.js b/packages/fineui/src/widget/multiselect/__test__/multiselect.loader.nobar.test.js similarity index 100% rename from src/widget/multiselect/__test__/multiselect.loader.nobar.test.js rename to packages/fineui/src/widget/multiselect/__test__/multiselect.loader.nobar.test.js diff --git a/src/widget/multiselect/__test__/multiselect.loader.test.js b/packages/fineui/src/widget/multiselect/__test__/multiselect.loader.test.js similarity index 100% rename from src/widget/multiselect/__test__/multiselect.loader.test.js rename to packages/fineui/src/widget/multiselect/__test__/multiselect.loader.test.js diff --git a/src/widget/multiselect/__test__/multiselectcombo.test.js b/packages/fineui/src/widget/multiselect/__test__/multiselectcombo.test.js similarity index 100% rename from src/widget/multiselect/__test__/multiselectcombo.test.js rename to packages/fineui/src/widget/multiselect/__test__/multiselectcombo.test.js diff --git a/src/widget/multiselect/__test__/multiselectinsert.combo.test.js b/packages/fineui/src/widget/multiselect/__test__/multiselectinsert.combo.test.js similarity index 100% rename from src/widget/multiselect/__test__/multiselectinsert.combo.test.js rename to packages/fineui/src/widget/multiselect/__test__/multiselectinsert.combo.test.js diff --git a/src/widget/multiselect/check/multiselect.check.pane.js b/packages/fineui/src/widget/multiselect/check/multiselect.check.pane.js similarity index 100% rename from src/widget/multiselect/check/multiselect.check.pane.js rename to packages/fineui/src/widget/multiselect/check/multiselect.check.pane.js diff --git a/src/widget/multiselect/check/multiselect.display.js b/packages/fineui/src/widget/multiselect/check/multiselect.display.js similarity index 100% rename from src/widget/multiselect/check/multiselect.display.js rename to packages/fineui/src/widget/multiselect/check/multiselect.display.js diff --git a/src/widget/multiselect/index.js b/packages/fineui/src/widget/multiselect/index.js similarity index 100% rename from src/widget/multiselect/index.js rename to packages/fineui/src/widget/multiselect/index.js diff --git a/src/widget/multiselect/loader.js b/packages/fineui/src/widget/multiselect/loader.js similarity index 100% rename from src/widget/multiselect/loader.js rename to packages/fineui/src/widget/multiselect/loader.js diff --git a/src/widget/multiselect/multiselect.combo.js b/packages/fineui/src/widget/multiselect/multiselect.combo.js similarity index 100% rename from src/widget/multiselect/multiselect.combo.js rename to packages/fineui/src/widget/multiselect/multiselect.combo.js diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/packages/fineui/src/widget/multiselect/multiselect.combo.nobar.js similarity index 100% rename from src/widget/multiselect/multiselect.combo.nobar.js rename to packages/fineui/src/widget/multiselect/multiselect.combo.nobar.js diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/packages/fineui/src/widget/multiselect/multiselect.insert.combo.js similarity index 100% rename from src/widget/multiselect/multiselect.insert.combo.js rename to packages/fineui/src/widget/multiselect/multiselect.insert.combo.js diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/packages/fineui/src/widget/multiselect/multiselect.insert.combo.nobar.js similarity index 100% rename from src/widget/multiselect/multiselect.insert.combo.nobar.js rename to packages/fineui/src/widget/multiselect/multiselect.insert.combo.nobar.js diff --git a/src/widget/multiselect/multiselect.insert.trigger.js b/packages/fineui/src/widget/multiselect/multiselect.insert.trigger.js similarity index 100% rename from src/widget/multiselect/multiselect.insert.trigger.js rename to packages/fineui/src/widget/multiselect/multiselect.insert.trigger.js diff --git a/src/widget/multiselect/multiselect.loader.js b/packages/fineui/src/widget/multiselect/multiselect.loader.js similarity index 100% rename from src/widget/multiselect/multiselect.loader.js rename to packages/fineui/src/widget/multiselect/multiselect.loader.js diff --git a/src/widget/multiselect/multiselect.loader.nobar.js b/packages/fineui/src/widget/multiselect/multiselect.loader.nobar.js similarity index 100% rename from src/widget/multiselect/multiselect.loader.nobar.js rename to packages/fineui/src/widget/multiselect/multiselect.loader.nobar.js diff --git a/src/widget/multiselect/multiselect.popup.view.js b/packages/fineui/src/widget/multiselect/multiselect.popup.view.js similarity index 100% rename from src/widget/multiselect/multiselect.popup.view.js rename to packages/fineui/src/widget/multiselect/multiselect.popup.view.js diff --git a/src/widget/multiselect/multiselect.popup.view.nobar.js b/packages/fineui/src/widget/multiselect/multiselect.popup.view.nobar.js similarity index 100% rename from src/widget/multiselect/multiselect.popup.view.nobar.js rename to packages/fineui/src/widget/multiselect/multiselect.popup.view.nobar.js diff --git a/src/widget/multiselect/multiselect.trigger.js b/packages/fineui/src/widget/multiselect/multiselect.trigger.js similarity index 100% rename from src/widget/multiselect/multiselect.trigger.js rename to packages/fineui/src/widget/multiselect/multiselect.trigger.js diff --git a/src/widget/multiselect/search/multiselect.search.insert.pane.js b/packages/fineui/src/widget/multiselect/search/multiselect.search.insert.pane.js similarity index 100% rename from src/widget/multiselect/search/multiselect.search.insert.pane.js rename to packages/fineui/src/widget/multiselect/search/multiselect.search.insert.pane.js diff --git a/src/widget/multiselect/search/multiselect.search.loader.js b/packages/fineui/src/widget/multiselect/search/multiselect.search.loader.js similarity index 100% rename from src/widget/multiselect/search/multiselect.search.loader.js rename to packages/fineui/src/widget/multiselect/search/multiselect.search.loader.js diff --git a/src/widget/multiselect/search/multiselect.search.pane.js b/packages/fineui/src/widget/multiselect/search/multiselect.search.pane.js similarity index 100% rename from src/widget/multiselect/search/multiselect.search.pane.js rename to packages/fineui/src/widget/multiselect/search/multiselect.search.pane.js diff --git a/src/widget/multiselect/trigger/button.checkselected.js b/packages/fineui/src/widget/multiselect/trigger/button.checkselected.js similarity index 100% rename from src/widget/multiselect/trigger/button.checkselected.js rename to packages/fineui/src/widget/multiselect/trigger/button.checkselected.js diff --git a/src/widget/multiselect/trigger/editor.multiselect.js b/packages/fineui/src/widget/multiselect/trigger/editor.multiselect.js similarity index 100% rename from src/widget/multiselect/trigger/editor.multiselect.js rename to packages/fineui/src/widget/multiselect/trigger/editor.multiselect.js diff --git a/src/widget/multiselect/trigger/editor/editor.patch.js b/packages/fineui/src/widget/multiselect/trigger/editor/editor.patch.js similarity index 100% rename from src/widget/multiselect/trigger/editor/editor.patch.js rename to packages/fineui/src/widget/multiselect/trigger/editor/editor.patch.js diff --git a/src/widget/multiselect/trigger/searcher.multiselect.insert.js b/packages/fineui/src/widget/multiselect/trigger/searcher.multiselect.insert.js similarity index 100% rename from src/widget/multiselect/trigger/searcher.multiselect.insert.js rename to packages/fineui/src/widget/multiselect/trigger/searcher.multiselect.insert.js diff --git a/src/widget/multiselect/trigger/searcher.multiselect.js b/packages/fineui/src/widget/multiselect/trigger/searcher.multiselect.js similarity index 100% rename from src/widget/multiselect/trigger/searcher.multiselect.js rename to packages/fineui/src/widget/multiselect/trigger/searcher.multiselect.js diff --git a/src/widget/multiselect/trigger/switcher.checkselected.js b/packages/fineui/src/widget/multiselect/trigger/switcher.checkselected.js similarity index 100% rename from src/widget/multiselect/trigger/switcher.checkselected.js rename to packages/fineui/src/widget/multiselect/trigger/switcher.checkselected.js diff --git a/src/widget/multiselectlist/__test__/multiselect.insert.nobar.test.js b/packages/fineui/src/widget/multiselectlist/__test__/multiselect.insert.nobar.test.js similarity index 100% rename from src/widget/multiselectlist/__test__/multiselect.insert.nobar.test.js rename to packages/fineui/src/widget/multiselectlist/__test__/multiselect.insert.nobar.test.js diff --git a/src/widget/multiselectlist/__test__/multiselectlist.insert.test.js b/packages/fineui/src/widget/multiselectlist/__test__/multiselectlist.insert.test.js similarity index 100% rename from src/widget/multiselectlist/__test__/multiselectlist.insert.test.js rename to packages/fineui/src/widget/multiselectlist/__test__/multiselectlist.insert.test.js diff --git a/src/widget/multiselectlist/index.js b/packages/fineui/src/widget/multiselectlist/index.js similarity index 100% rename from src/widget/multiselectlist/index.js rename to packages/fineui/src/widget/multiselectlist/index.js diff --git a/src/widget/multiselectlist/multiselectlist.insert.js b/packages/fineui/src/widget/multiselectlist/multiselectlist.insert.js similarity index 100% rename from src/widget/multiselectlist/multiselectlist.insert.js rename to packages/fineui/src/widget/multiselectlist/multiselectlist.insert.js diff --git a/src/widget/multiselectlist/multiselectlist.insert.nobar.js b/packages/fineui/src/widget/multiselectlist/multiselectlist.insert.nobar.js similarity index 100% rename from src/widget/multiselectlist/multiselectlist.insert.nobar.js rename to packages/fineui/src/widget/multiselectlist/multiselectlist.insert.nobar.js diff --git a/src/widget/multiselectlist/multiselectlist.js b/packages/fineui/src/widget/multiselectlist/multiselectlist.js similarity index 100% rename from src/widget/multiselectlist/multiselectlist.js rename to packages/fineui/src/widget/multiselectlist/multiselectlist.js diff --git a/src/widget/multiselecttree/multiselecttree.js b/packages/fineui/src/widget/multiselecttree/multiselecttree.js similarity index 100% rename from src/widget/multiselecttree/multiselecttree.js rename to packages/fineui/src/widget/multiselecttree/multiselecttree.js diff --git a/src/widget/multiselecttree/multiselecttree.popup.js b/packages/fineui/src/widget/multiselecttree/multiselecttree.popup.js similarity index 100% rename from src/widget/multiselecttree/multiselecttree.popup.js rename to packages/fineui/src/widget/multiselecttree/multiselecttree.popup.js diff --git a/src/widget/multitree/check/multi.tree.check.pane.js b/packages/fineui/src/widget/multitree/check/multi.tree.check.pane.js similarity index 100% rename from src/widget/multitree/check/multi.tree.check.pane.js rename to packages/fineui/src/widget/multitree/check/multi.tree.check.pane.js diff --git a/src/widget/multitree/multi.tree.combo.js b/packages/fineui/src/widget/multitree/multi.tree.combo.js similarity index 100% rename from src/widget/multitree/multi.tree.combo.js rename to packages/fineui/src/widget/multitree/multi.tree.combo.js diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/packages/fineui/src/widget/multitree/multi.tree.insert.combo.js similarity index 100% rename from src/widget/multitree/multi.tree.insert.combo.js rename to packages/fineui/src/widget/multitree/multi.tree.insert.combo.js diff --git a/src/widget/multitree/multi.tree.list.combo.js b/packages/fineui/src/widget/multitree/multi.tree.list.combo.js similarity index 100% rename from src/widget/multitree/multi.tree.list.combo.js rename to packages/fineui/src/widget/multitree/multi.tree.list.combo.js diff --git a/src/widget/multitree/multi.tree.popup.js b/packages/fineui/src/widget/multitree/multi.tree.popup.js similarity index 100% rename from src/widget/multitree/multi.tree.popup.js rename to packages/fineui/src/widget/multitree/multi.tree.popup.js diff --git a/src/widget/multitree/trigger/multi.tree.button.checkselected.js b/packages/fineui/src/widget/multitree/trigger/multi.tree.button.checkselected.js similarity index 100% rename from src/widget/multitree/trigger/multi.tree.button.checkselected.js rename to packages/fineui/src/widget/multitree/trigger/multi.tree.button.checkselected.js diff --git a/src/widget/multitree/trigger/multi.tree.search.insert.pane.js b/packages/fineui/src/widget/multitree/trigger/multi.tree.search.insert.pane.js similarity index 100% rename from src/widget/multitree/trigger/multi.tree.search.insert.pane.js rename to packages/fineui/src/widget/multitree/trigger/multi.tree.search.insert.pane.js diff --git a/src/widget/multitree/trigger/multi.tree.search.pane.js b/packages/fineui/src/widget/multitree/trigger/multi.tree.search.pane.js similarity index 100% rename from src/widget/multitree/trigger/multi.tree.search.pane.js rename to packages/fineui/src/widget/multitree/trigger/multi.tree.search.pane.js diff --git a/src/widget/multitree/trigger/searcher.list.multi.tree.js b/packages/fineui/src/widget/multitree/trigger/searcher.list.multi.tree.js similarity index 100% rename from src/widget/multitree/trigger/searcher.list.multi.tree.js rename to packages/fineui/src/widget/multitree/trigger/searcher.list.multi.tree.js diff --git a/src/widget/multitree/trigger/searcher.multi.tree.js b/packages/fineui/src/widget/multitree/trigger/searcher.multi.tree.js similarity index 100% rename from src/widget/multitree/trigger/searcher.multi.tree.js rename to packages/fineui/src/widget/multitree/trigger/searcher.multi.tree.js diff --git a/src/widget/numbereditor/number.editor.js b/packages/fineui/src/widget/numbereditor/number.editor.js similarity index 100% rename from src/widget/numbereditor/number.editor.js rename to packages/fineui/src/widget/numbereditor/number.editor.js diff --git a/src/widget/numberinterval/__test__/numberinterval.test.js b/packages/fineui/src/widget/numberinterval/__test__/numberinterval.test.js similarity index 100% rename from src/widget/numberinterval/__test__/numberinterval.test.js rename to packages/fineui/src/widget/numberinterval/__test__/numberinterval.test.js diff --git a/src/widget/numberinterval/numberinterval.js b/packages/fineui/src/widget/numberinterval/numberinterval.js similarity index 100% rename from src/widget/numberinterval/numberinterval.js rename to packages/fineui/src/widget/numberinterval/numberinterval.js diff --git a/src/widget/numberinterval/singleeditor/single.editor.js b/packages/fineui/src/widget/numberinterval/singleeditor/single.editor.js similarity index 100% rename from src/widget/numberinterval/singleeditor/single.editor.js rename to packages/fineui/src/widget/numberinterval/singleeditor/single.editor.js diff --git a/src/widget/searchmultitextvaluecombo/__test__/multitextvalue.combo.search.test.js b/packages/fineui/src/widget/searchmultitextvaluecombo/__test__/multitextvalue.combo.search.test.js similarity index 100% rename from src/widget/searchmultitextvaluecombo/__test__/multitextvalue.combo.search.test.js rename to packages/fineui/src/widget/searchmultitextvaluecombo/__test__/multitextvalue.combo.search.test.js diff --git a/src/widget/searchmultitextvaluecombo/index.js b/packages/fineui/src/widget/searchmultitextvaluecombo/index.js similarity index 100% rename from src/widget/searchmultitextvaluecombo/index.js rename to packages/fineui/src/widget/searchmultitextvaluecombo/index.js diff --git a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js b/packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js similarity index 100% rename from src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js rename to packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js diff --git a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.trigger.search.js b/packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.combo.trigger.search.js similarity index 100% rename from src/widget/searchmultitextvaluecombo/multitextvalue.combo.trigger.search.js rename to packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.combo.trigger.search.js diff --git a/src/widget/searchmultitextvaluecombo/multitextvalue.loader.search.js b/packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.loader.search.js similarity index 100% rename from src/widget/searchmultitextvaluecombo/multitextvalue.loader.search.js rename to packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.loader.search.js diff --git a/src/widget/searchmultitextvaluecombo/multitextvalue.popup.view.search.js b/packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.popup.view.search.js similarity index 100% rename from src/widget/searchmultitextvaluecombo/multitextvalue.popup.view.search.js rename to packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.popup.view.search.js diff --git a/src/widget/searchmultitextvaluecombo/trigger/searcher.multitextvalue.js b/packages/fineui/src/widget/searchmultitextvaluecombo/trigger/searcher.multitextvalue.js similarity index 100% rename from src/widget/searchmultitextvaluecombo/trigger/searcher.multitextvalue.js rename to packages/fineui/src/widget/searchmultitextvaluecombo/trigger/searcher.multitextvalue.js diff --git a/src/widget/selecttree/__test__/selecttree.combo.test.js b/packages/fineui/src/widget/selecttree/__test__/selecttree.combo.test.js similarity index 100% rename from src/widget/selecttree/__test__/selecttree.combo.test.js rename to packages/fineui/src/widget/selecttree/__test__/selecttree.combo.test.js diff --git a/src/widget/selecttree/selecttree.combo.js b/packages/fineui/src/widget/selecttree/selecttree.combo.js similarity index 100% rename from src/widget/selecttree/selecttree.combo.js rename to packages/fineui/src/widget/selecttree/selecttree.combo.js diff --git a/src/widget/selecttree/selecttree.expander.js b/packages/fineui/src/widget/selecttree/selecttree.expander.js similarity index 100% rename from src/widget/selecttree/selecttree.expander.js rename to packages/fineui/src/widget/selecttree/selecttree.expander.js diff --git a/src/widget/selecttree/selecttree.popup.js b/packages/fineui/src/widget/selecttree/selecttree.popup.js similarity index 100% rename from src/widget/selecttree/selecttree.popup.js rename to packages/fineui/src/widget/selecttree/selecttree.popup.js diff --git a/src/widget/singleselect/__test__/singleselect.combo.test.js b/packages/fineui/src/widget/singleselect/__test__/singleselect.combo.test.js similarity index 100% rename from src/widget/singleselect/__test__/singleselect.combo.test.js rename to packages/fineui/src/widget/singleselect/__test__/singleselect.combo.test.js diff --git a/src/widget/singleselect/__test__/singleselect.insert.combo.test.js b/packages/fineui/src/widget/singleselect/__test__/singleselect.insert.combo.test.js similarity index 100% rename from src/widget/singleselect/__test__/singleselect.insert.combo.test.js rename to packages/fineui/src/widget/singleselect/__test__/singleselect.insert.combo.test.js diff --git a/src/widget/singleselect/index.js b/packages/fineui/src/widget/singleselect/index.js similarity index 100% rename from src/widget/singleselect/index.js rename to packages/fineui/src/widget/singleselect/index.js diff --git a/src/widget/singleselect/search/index.js b/packages/fineui/src/widget/singleselect/search/index.js similarity index 100% rename from src/widget/singleselect/search/index.js rename to packages/fineui/src/widget/singleselect/search/index.js diff --git a/src/widget/singleselect/search/singleselect.search.loader.js b/packages/fineui/src/widget/singleselect/search/singleselect.search.loader.js similarity index 100% rename from src/widget/singleselect/search/singleselect.search.loader.js rename to packages/fineui/src/widget/singleselect/search/singleselect.search.loader.js diff --git a/src/widget/singleselect/search/singleselect.search.pane.insert.js b/packages/fineui/src/widget/singleselect/search/singleselect.search.pane.insert.js similarity index 100% rename from src/widget/singleselect/search/singleselect.search.pane.insert.js rename to packages/fineui/src/widget/singleselect/search/singleselect.search.pane.insert.js diff --git a/src/widget/singleselect/search/singleselect.search.pane.js b/packages/fineui/src/widget/singleselect/search/singleselect.search.pane.js similarity index 100% rename from src/widget/singleselect/search/singleselect.search.pane.js rename to packages/fineui/src/widget/singleselect/search/singleselect.search.pane.js diff --git a/src/widget/singleselect/singleselect.combo.js b/packages/fineui/src/widget/singleselect/singleselect.combo.js similarity index 100% rename from src/widget/singleselect/singleselect.combo.js rename to packages/fineui/src/widget/singleselect/singleselect.combo.js diff --git a/src/widget/singleselect/singleselect.insert.combo.js b/packages/fineui/src/widget/singleselect/singleselect.insert.combo.js similarity index 100% rename from src/widget/singleselect/singleselect.insert.combo.js rename to packages/fineui/src/widget/singleselect/singleselect.insert.combo.js diff --git a/src/widget/singleselect/singleselect.list.js b/packages/fineui/src/widget/singleselect/singleselect.list.js similarity index 100% rename from src/widget/singleselect/singleselect.list.js rename to packages/fineui/src/widget/singleselect/singleselect.list.js diff --git a/src/widget/singleselect/singleselect.loader.js b/packages/fineui/src/widget/singleselect/singleselect.loader.js similarity index 100% rename from src/widget/singleselect/singleselect.loader.js rename to packages/fineui/src/widget/singleselect/singleselect.loader.js diff --git a/src/widget/singleselect/singleselect.popup.view.js b/packages/fineui/src/widget/singleselect/singleselect.popup.view.js similarity index 100% rename from src/widget/singleselect/singleselect.popup.view.js rename to packages/fineui/src/widget/singleselect/singleselect.popup.view.js diff --git a/src/widget/singleselect/singleselect.trigger.js b/packages/fineui/src/widget/singleselect/singleselect.trigger.js similarity index 100% rename from src/widget/singleselect/singleselect.trigger.js rename to packages/fineui/src/widget/singleselect/singleselect.trigger.js diff --git a/src/widget/singleselect/singleselectlist.insert.js b/packages/fineui/src/widget/singleselect/singleselectlist.insert.js similarity index 100% rename from src/widget/singleselect/singleselectlist.insert.js rename to packages/fineui/src/widget/singleselect/singleselectlist.insert.js diff --git a/src/widget/singleselect/trigger/editor.singleselect.js b/packages/fineui/src/widget/singleselect/trigger/editor.singleselect.js similarity index 100% rename from src/widget/singleselect/trigger/editor.singleselect.js rename to packages/fineui/src/widget/singleselect/trigger/editor.singleselect.js diff --git a/src/widget/singleselect/trigger/index.js b/packages/fineui/src/widget/singleselect/trigger/index.js similarity index 100% rename from src/widget/singleselect/trigger/index.js rename to packages/fineui/src/widget/singleselect/trigger/index.js diff --git a/src/widget/singleselect/trigger/searcher.singleselect.js b/packages/fineui/src/widget/singleselect/trigger/searcher.singleselect.js similarity index 100% rename from src/widget/singleselect/trigger/searcher.singleselect.js rename to packages/fineui/src/widget/singleselect/trigger/searcher.singleselect.js diff --git a/src/widget/singleslider/__test__/singleslider.test.js b/packages/fineui/src/widget/singleslider/__test__/singleslider.test.js similarity index 100% rename from src/widget/singleslider/__test__/singleslider.test.js rename to packages/fineui/src/widget/singleslider/__test__/singleslider.test.js diff --git a/src/widget/singleslider/button/editor.sign.text.js b/packages/fineui/src/widget/singleslider/button/editor.sign.text.js similarity index 100% rename from src/widget/singleslider/button/editor.sign.text.js rename to packages/fineui/src/widget/singleslider/button/editor.sign.text.js diff --git a/src/widget/singleslider/button/iconbutton.slider.js b/packages/fineui/src/widget/singleslider/button/iconbutton.slider.js similarity index 100% rename from src/widget/singleslider/button/iconbutton.slider.js rename to packages/fineui/src/widget/singleslider/button/iconbutton.slider.js diff --git a/src/widget/singleslider/index.js b/packages/fineui/src/widget/singleslider/index.js similarity index 100% rename from src/widget/singleslider/index.js rename to packages/fineui/src/widget/singleslider/index.js diff --git a/src/widget/singleslider/singleslider.js b/packages/fineui/src/widget/singleslider/singleslider.js similarity index 100% rename from src/widget/singleslider/singleslider.js rename to packages/fineui/src/widget/singleslider/singleslider.js diff --git a/src/widget/singleslider/singleslider.label.js b/packages/fineui/src/widget/singleslider/singleslider.label.js similarity index 100% rename from src/widget/singleslider/singleslider.label.js rename to packages/fineui/src/widget/singleslider/singleslider.label.js diff --git a/src/widget/singleslider/singleslider.normal.js b/packages/fineui/src/widget/singleslider/singleslider.normal.js similarity index 100% rename from src/widget/singleslider/singleslider.normal.js rename to packages/fineui/src/widget/singleslider/singleslider.normal.js diff --git a/src/widget/singletree/__test__/singletree.combo.test.js b/packages/fineui/src/widget/singletree/__test__/singletree.combo.test.js similarity index 100% rename from src/widget/singletree/__test__/singletree.combo.test.js rename to packages/fineui/src/widget/singletree/__test__/singletree.combo.test.js diff --git a/src/widget/singletree/singletree.combo.js b/packages/fineui/src/widget/singletree/singletree.combo.js similarity index 100% rename from src/widget/singletree/singletree.combo.js rename to packages/fineui/src/widget/singletree/singletree.combo.js diff --git a/src/widget/singletree/singletree.popup.js b/packages/fineui/src/widget/singletree/singletree.popup.js similarity index 100% rename from src/widget/singletree/singletree.popup.js rename to packages/fineui/src/widget/singletree/singletree.popup.js diff --git a/src/widget/singletree/singletree.trigger.js b/packages/fineui/src/widget/singletree/singletree.trigger.js similarity index 100% rename from src/widget/singletree/singletree.trigger.js rename to packages/fineui/src/widget/singletree/singletree.trigger.js diff --git a/src/widget/textvaluedownlistcombo/__test__/combo.textvaluedownlist.test.js b/packages/fineui/src/widget/textvaluedownlistcombo/__test__/combo.textvaluedownlist.test.js similarity index 100% rename from src/widget/textvaluedownlistcombo/__test__/combo.textvaluedownlist.test.js rename to packages/fineui/src/widget/textvaluedownlistcombo/__test__/combo.textvaluedownlist.test.js diff --git a/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js b/packages/fineui/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js similarity index 100% rename from src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js rename to packages/fineui/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js diff --git a/src/widget/textvaluedownlistcombo/index.js b/packages/fineui/src/widget/textvaluedownlistcombo/index.js similarity index 100% rename from src/widget/textvaluedownlistcombo/index.js rename to packages/fineui/src/widget/textvaluedownlistcombo/index.js diff --git a/src/widget/textvaluedownlistcombo/trigger.textvaluedownlist.js b/packages/fineui/src/widget/textvaluedownlistcombo/trigger.textvaluedownlist.js similarity index 100% rename from src/widget/textvaluedownlistcombo/trigger.textvaluedownlist.js rename to packages/fineui/src/widget/textvaluedownlistcombo/trigger.textvaluedownlist.js diff --git a/src/widget/time/__test__/time.combo.test.js b/packages/fineui/src/widget/time/__test__/time.combo.test.js similarity index 100% rename from src/widget/time/__test__/time.combo.test.js rename to packages/fineui/src/widget/time/__test__/time.combo.test.js diff --git a/src/widget/time/datetime.popup.js b/packages/fineui/src/widget/time/datetime.popup.js similarity index 100% rename from src/widget/time/datetime.popup.js rename to packages/fineui/src/widget/time/datetime.popup.js diff --git a/src/widget/time/index.js b/packages/fineui/src/widget/time/index.js similarity index 100% rename from src/widget/time/index.js rename to packages/fineui/src/widget/time/index.js diff --git a/src/widget/time/time.combo.js b/packages/fineui/src/widget/time/time.combo.js similarity index 100% rename from src/widget/time/time.combo.js rename to packages/fineui/src/widget/time/time.combo.js diff --git a/src/widget/time/time.trigger.js b/packages/fineui/src/widget/time/time.trigger.js similarity index 100% rename from src/widget/time/time.trigger.js rename to packages/fineui/src/widget/time/time.trigger.js diff --git a/src/widget/timeinterval/__test__/timeinterval.test.js b/packages/fineui/src/widget/timeinterval/__test__/timeinterval.test.js similarity index 100% rename from src/widget/timeinterval/__test__/timeinterval.test.js rename to packages/fineui/src/widget/timeinterval/__test__/timeinterval.test.js diff --git a/src/widget/timeinterval/dateinterval.js b/packages/fineui/src/widget/timeinterval/dateinterval.js similarity index 100% rename from src/widget/timeinterval/dateinterval.js rename to packages/fineui/src/widget/timeinterval/dateinterval.js diff --git a/src/widget/timeinterval/index.js b/packages/fineui/src/widget/timeinterval/index.js similarity index 100% rename from src/widget/timeinterval/index.js rename to packages/fineui/src/widget/timeinterval/index.js diff --git a/src/widget/timeinterval/timeinterval.js b/packages/fineui/src/widget/timeinterval/timeinterval.js similarity index 100% rename from src/widget/timeinterval/timeinterval.js rename to packages/fineui/src/widget/timeinterval/timeinterval.js diff --git a/src/widget/timeinterval/timeperiods.js b/packages/fineui/src/widget/timeinterval/timeperiods.js similarity index 100% rename from src/widget/timeinterval/timeperiods.js rename to packages/fineui/src/widget/timeinterval/timeperiods.js diff --git a/src/widget/year/__test__/combo.year.test.js b/packages/fineui/src/widget/year/__test__/combo.year.test.js similarity index 100% rename from src/widget/year/__test__/combo.year.test.js rename to packages/fineui/src/widget/year/__test__/combo.year.test.js diff --git a/src/widget/year/card.dynamic.year.js b/packages/fineui/src/widget/year/card.dynamic.year.js similarity index 100% rename from src/widget/year/card.dynamic.year.js rename to packages/fineui/src/widget/year/card.dynamic.year.js diff --git a/src/widget/year/card.year.js b/packages/fineui/src/widget/year/card.year.js similarity index 100% rename from src/widget/year/card.year.js rename to packages/fineui/src/widget/year/card.year.js diff --git a/src/widget/year/combo.year.js b/packages/fineui/src/widget/year/combo.year.js similarity index 100% rename from src/widget/year/combo.year.js rename to packages/fineui/src/widget/year/combo.year.js diff --git a/src/widget/year/index.js b/packages/fineui/src/widget/year/index.js similarity index 100% rename from src/widget/year/index.js rename to packages/fineui/src/widget/year/index.js diff --git a/src/widget/year/popup.year.js b/packages/fineui/src/widget/year/popup.year.js similarity index 100% rename from src/widget/year/popup.year.js rename to packages/fineui/src/widget/year/popup.year.js diff --git a/src/widget/year/trigger.year.js b/packages/fineui/src/widget/year/trigger.year.js similarity index 100% rename from src/widget/year/trigger.year.js rename to packages/fineui/src/widget/year/trigger.year.js diff --git a/src/widget/yearinterval/yearinterval.js b/packages/fineui/src/widget/yearinterval/yearinterval.js similarity index 100% rename from src/widget/yearinterval/yearinterval.js rename to packages/fineui/src/widget/yearinterval/yearinterval.js diff --git a/src/widget/yearmonth/__test__/combo.yearmonth.test.js b/packages/fineui/src/widget/yearmonth/__test__/combo.yearmonth.test.js similarity index 100% rename from src/widget/yearmonth/__test__/combo.yearmonth.test.js rename to packages/fineui/src/widget/yearmonth/__test__/combo.yearmonth.test.js diff --git a/src/widget/yearmonth/card.dynamic.yearmonth.js b/packages/fineui/src/widget/yearmonth/card.dynamic.yearmonth.js similarity index 100% rename from src/widget/yearmonth/card.dynamic.yearmonth.js rename to packages/fineui/src/widget/yearmonth/card.dynamic.yearmonth.js diff --git a/src/widget/yearmonth/card.static.yearmonth.js b/packages/fineui/src/widget/yearmonth/card.static.yearmonth.js similarity index 100% rename from src/widget/yearmonth/card.static.yearmonth.js rename to packages/fineui/src/widget/yearmonth/card.static.yearmonth.js diff --git a/src/widget/yearmonth/combo.yearmonth.js b/packages/fineui/src/widget/yearmonth/combo.yearmonth.js similarity index 100% rename from src/widget/yearmonth/combo.yearmonth.js rename to packages/fineui/src/widget/yearmonth/combo.yearmonth.js diff --git a/src/widget/yearmonth/index.js b/packages/fineui/src/widget/yearmonth/index.js similarity index 100% rename from src/widget/yearmonth/index.js rename to packages/fineui/src/widget/yearmonth/index.js diff --git a/src/widget/yearmonth/popup.yearmonth.js b/packages/fineui/src/widget/yearmonth/popup.yearmonth.js similarity index 100% rename from src/widget/yearmonth/popup.yearmonth.js rename to packages/fineui/src/widget/yearmonth/popup.yearmonth.js diff --git a/src/widget/yearmonth/trigger.yearmonth.js b/packages/fineui/src/widget/yearmonth/trigger.yearmonth.js similarity index 100% rename from src/widget/yearmonth/trigger.yearmonth.js rename to packages/fineui/src/widget/yearmonth/trigger.yearmonth.js diff --git a/src/widget/yearmonthinterval/__test__/yearmonthinterval.test.js b/packages/fineui/src/widget/yearmonthinterval/__test__/yearmonthinterval.test.js similarity index 100% rename from src/widget/yearmonthinterval/__test__/yearmonthinterval.test.js rename to packages/fineui/src/widget/yearmonthinterval/__test__/yearmonthinterval.test.js diff --git a/src/widget/yearmonthinterval/yearmonthinterval.js b/packages/fineui/src/widget/yearmonthinterval/yearmonthinterval.js similarity index 100% rename from src/widget/yearmonthinterval/yearmonthinterval.js rename to packages/fineui/src/widget/yearmonthinterval/yearmonthinterval.js diff --git a/src/widget/yearquarter/__test__/combo.yearquarter.test.js b/packages/fineui/src/widget/yearquarter/__test__/combo.yearquarter.test.js similarity index 100% rename from src/widget/yearquarter/__test__/combo.yearquarter.test.js rename to packages/fineui/src/widget/yearquarter/__test__/combo.yearquarter.test.js diff --git a/src/widget/yearquarter/card.dynamic.yearquarter.js b/packages/fineui/src/widget/yearquarter/card.dynamic.yearquarter.js similarity index 100% rename from src/widget/yearquarter/card.dynamic.yearquarter.js rename to packages/fineui/src/widget/yearquarter/card.dynamic.yearquarter.js diff --git a/src/widget/yearquarter/card.static.yearquarter.js b/packages/fineui/src/widget/yearquarter/card.static.yearquarter.js similarity index 100% rename from src/widget/yearquarter/card.static.yearquarter.js rename to packages/fineui/src/widget/yearquarter/card.static.yearquarter.js diff --git a/src/widget/yearquarter/combo.yearquarter.js b/packages/fineui/src/widget/yearquarter/combo.yearquarter.js similarity index 100% rename from src/widget/yearquarter/combo.yearquarter.js rename to packages/fineui/src/widget/yearquarter/combo.yearquarter.js diff --git a/src/widget/yearquarter/index.js b/packages/fineui/src/widget/yearquarter/index.js similarity index 100% rename from src/widget/yearquarter/index.js rename to packages/fineui/src/widget/yearquarter/index.js diff --git a/src/widget/yearquarter/popup.yearquarter.js b/packages/fineui/src/widget/yearquarter/popup.yearquarter.js similarity index 100% rename from src/widget/yearquarter/popup.yearquarter.js rename to packages/fineui/src/widget/yearquarter/popup.yearquarter.js diff --git a/src/widget/yearquarter/trigger.yearquarter.js b/packages/fineui/src/widget/yearquarter/trigger.yearquarter.js similarity index 100% rename from src/widget/yearquarter/trigger.yearquarter.js rename to packages/fineui/src/widget/yearquarter/trigger.yearquarter.js diff --git a/src/widget/yearquarterinterval/yearquarterinterval.js b/packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js similarity index 100% rename from src/widget/yearquarterinterval/yearquarterinterval.js rename to packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js diff --git a/packages/fineui/tsconfig.json b/packages/fineui/tsconfig.json new file mode 100644 index 000000000..c4d27c622 --- /dev/null +++ b/packages/fineui/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "sourceMap": true, + "target": "es2017", + "module": "es2015", + "moduleResolution": "node", + "lib": ["es2017", "dom"], + "declaration": true, + "experimentalDecorators": true, + "outDir": "./type/lib", + "baseUrl": ".", + // "strict": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "emitDeclarationOnly": true, + "paths": { + "@": ["src"] + } + }, + "include": ["typescript/*.ts", "typescript/**/*.ts", "types/*.d.ts", "src/*.js", "src/**/*.js"] +} diff --git a/types/globals.d.ts b/packages/fineui/types/globals.d.ts similarity index 100% rename from types/globals.d.ts rename to packages/fineui/types/globals.d.ts diff --git a/typescript/base/a/a.ts b/packages/fineui/typescript/base/a/a.ts similarity index 100% rename from typescript/base/a/a.ts rename to packages/fineui/typescript/base/a/a.ts diff --git a/typescript/base/base.ts b/packages/fineui/typescript/base/base.ts similarity index 100% rename from typescript/base/base.ts rename to packages/fineui/typescript/base/base.ts diff --git a/typescript/base/combination/combo.ts b/packages/fineui/typescript/base/combination/combo.ts similarity index 100% rename from typescript/base/combination/combo.ts rename to packages/fineui/typescript/base/combination/combo.ts diff --git a/typescript/base/combination/expander.ts b/packages/fineui/typescript/base/combination/expander.ts similarity index 100% rename from typescript/base/combination/expander.ts rename to packages/fineui/typescript/base/combination/expander.ts diff --git a/typescript/base/combination/group.button.ts b/packages/fineui/typescript/base/combination/group.button.ts similarity index 100% rename from typescript/base/combination/group.button.ts rename to packages/fineui/typescript/base/combination/group.button.ts diff --git a/typescript/base/combination/group.virtual.ts b/packages/fineui/typescript/base/combination/group.virtual.ts similarity index 100% rename from typescript/base/combination/group.virtual.ts rename to packages/fineui/typescript/base/combination/group.virtual.ts diff --git a/typescript/base/combination/loader.ts b/packages/fineui/typescript/base/combination/loader.ts similarity index 100% rename from typescript/base/combination/loader.ts rename to packages/fineui/typescript/base/combination/loader.ts diff --git a/typescript/base/combination/searcher.ts b/packages/fineui/typescript/base/combination/searcher.ts similarity index 100% rename from typescript/base/combination/searcher.ts rename to packages/fineui/typescript/base/combination/searcher.ts diff --git a/typescript/base/combination/switcher.ts b/packages/fineui/typescript/base/combination/switcher.ts similarity index 100% rename from typescript/base/combination/switcher.ts rename to packages/fineui/typescript/base/combination/switcher.ts diff --git a/typescript/base/combination/tab.ts b/packages/fineui/typescript/base/combination/tab.ts similarity index 100% rename from typescript/base/combination/tab.ts rename to packages/fineui/typescript/base/combination/tab.ts diff --git a/typescript/base/combination/tree.button.ts b/packages/fineui/typescript/base/combination/tree.button.ts similarity index 100% rename from typescript/base/combination/tree.button.ts rename to packages/fineui/typescript/base/combination/tree.button.ts diff --git a/typescript/base/foundation/message.ts b/packages/fineui/typescript/base/foundation/message.ts similarity index 100% rename from typescript/base/foundation/message.ts rename to packages/fineui/typescript/base/foundation/message.ts diff --git a/typescript/base/layer/layer.popover.ts b/packages/fineui/typescript/base/layer/layer.popover.ts similarity index 100% rename from typescript/base/layer/layer.popover.ts rename to packages/fineui/typescript/base/layer/layer.popover.ts diff --git a/typescript/base/layer/layer.popup.ts b/packages/fineui/typescript/base/layer/layer.popup.ts similarity index 100% rename from typescript/base/layer/layer.popup.ts rename to packages/fineui/typescript/base/layer/layer.popup.ts diff --git a/typescript/base/list/listview.ts b/packages/fineui/typescript/base/list/listview.ts similarity index 100% rename from typescript/base/list/listview.ts rename to packages/fineui/typescript/base/list/listview.ts diff --git a/typescript/base/list/virtualgrouplist.ts b/packages/fineui/typescript/base/list/virtualgrouplist.ts similarity index 100% rename from typescript/base/list/virtualgrouplist.ts rename to packages/fineui/typescript/base/list/virtualgrouplist.ts diff --git a/typescript/base/list/virtuallist.ts b/packages/fineui/typescript/base/list/virtuallist.ts similarity index 100% rename from typescript/base/list/virtuallist.ts rename to packages/fineui/typescript/base/list/virtuallist.ts diff --git a/typescript/base/pager/pager.ts b/packages/fineui/typescript/base/pager/pager.ts similarity index 100% rename from typescript/base/pager/pager.ts rename to packages/fineui/typescript/base/pager/pager.ts diff --git a/typescript/base/pane.ts b/packages/fineui/typescript/base/pane.ts similarity index 100% rename from typescript/base/pane.ts rename to packages/fineui/typescript/base/pane.ts diff --git a/typescript/base/single/button/button.basic.ts b/packages/fineui/typescript/base/single/button/button.basic.ts similarity index 100% rename from typescript/base/single/button/button.basic.ts rename to packages/fineui/typescript/base/single/button/button.basic.ts diff --git a/typescript/base/single/button/button.node.ts b/packages/fineui/typescript/base/single/button/button.node.ts similarity index 100% rename from typescript/base/single/button/button.node.ts rename to packages/fineui/typescript/base/single/button/button.node.ts diff --git a/typescript/base/single/button/buttons/button.icon.ts b/packages/fineui/typescript/base/single/button/buttons/button.icon.ts similarity index 100% rename from typescript/base/single/button/buttons/button.icon.ts rename to packages/fineui/typescript/base/single/button/buttons/button.icon.ts diff --git a/typescript/base/single/button/buttons/button.image.ts b/packages/fineui/typescript/base/single/button/buttons/button.image.ts similarity index 100% rename from typescript/base/single/button/buttons/button.image.ts rename to packages/fineui/typescript/base/single/button/buttons/button.image.ts diff --git a/typescript/base/single/button/buttons/button.text.ts b/packages/fineui/typescript/base/single/button/buttons/button.text.ts similarity index 100% rename from typescript/base/single/button/buttons/button.text.ts rename to packages/fineui/typescript/base/single/button/buttons/button.text.ts diff --git a/typescript/base/single/button/buttons/button.ts b/packages/fineui/typescript/base/single/button/buttons/button.ts similarity index 100% rename from typescript/base/single/button/buttons/button.ts rename to packages/fineui/typescript/base/single/button/buttons/button.ts diff --git a/typescript/base/single/button/listitem/blankicontextitem.ts b/packages/fineui/typescript/base/single/button/listitem/blankicontextitem.ts similarity index 100% rename from typescript/base/single/button/listitem/blankicontextitem.ts rename to packages/fineui/typescript/base/single/button/listitem/blankicontextitem.ts diff --git a/typescript/base/single/button/listitem/icontexticonitem.ts b/packages/fineui/typescript/base/single/button/listitem/icontexticonitem.ts similarity index 100% rename from typescript/base/single/button/listitem/icontexticonitem.ts rename to packages/fineui/typescript/base/single/button/listitem/icontexticonitem.ts diff --git a/typescript/base/single/button/listitem/icontextitem.ts b/packages/fineui/typescript/base/single/button/listitem/icontextitem.ts similarity index 100% rename from typescript/base/single/button/listitem/icontextitem.ts rename to packages/fineui/typescript/base/single/button/listitem/icontextitem.ts diff --git a/typescript/base/single/button/node/textnode.ts b/packages/fineui/typescript/base/single/button/node/textnode.ts similarity index 100% rename from typescript/base/single/button/node/textnode.ts rename to packages/fineui/typescript/base/single/button/node/textnode.ts diff --git a/typescript/base/single/editor/editor.textarea.ts b/packages/fineui/typescript/base/single/editor/editor.textarea.ts similarity index 100% rename from typescript/base/single/editor/editor.textarea.ts rename to packages/fineui/typescript/base/single/editor/editor.textarea.ts diff --git a/typescript/base/single/editor/editor.ts b/packages/fineui/typescript/base/single/editor/editor.ts similarity index 100% rename from typescript/base/single/editor/editor.ts rename to packages/fineui/typescript/base/single/editor/editor.ts diff --git a/typescript/base/single/html/html.ts b/packages/fineui/typescript/base/single/html/html.ts similarity index 100% rename from typescript/base/single/html/html.ts rename to packages/fineui/typescript/base/single/html/html.ts diff --git a/typescript/base/single/icon/icon.ts b/packages/fineui/typescript/base/single/icon/icon.ts similarity index 100% rename from typescript/base/single/icon/icon.ts rename to packages/fineui/typescript/base/single/icon/icon.ts diff --git a/typescript/base/single/iframe/iframe.ts b/packages/fineui/typescript/base/single/iframe/iframe.ts similarity index 100% rename from typescript/base/single/iframe/iframe.ts rename to packages/fineui/typescript/base/single/iframe/iframe.ts diff --git a/typescript/base/single/img/img.ts b/packages/fineui/typescript/base/single/img/img.ts similarity index 100% rename from typescript/base/single/img/img.ts rename to packages/fineui/typescript/base/single/img/img.ts diff --git a/typescript/base/single/input/checkbox.ts b/packages/fineui/typescript/base/single/input/checkbox.ts similarity index 100% rename from typescript/base/single/input/checkbox.ts rename to packages/fineui/typescript/base/single/input/checkbox.ts diff --git a/typescript/base/single/input/input.ts b/packages/fineui/typescript/base/single/input/input.ts similarity index 100% rename from typescript/base/single/input/input.ts rename to packages/fineui/typescript/base/single/input/input.ts diff --git a/typescript/base/single/input/radio/radio.ts b/packages/fineui/typescript/base/single/input/radio/radio.ts similarity index 100% rename from typescript/base/single/input/radio/radio.ts rename to packages/fineui/typescript/base/single/input/radio/radio.ts diff --git a/typescript/base/single/label/abstract.label.ts b/packages/fineui/typescript/base/single/label/abstract.label.ts similarity index 100% rename from typescript/base/single/label/abstract.label.ts rename to packages/fineui/typescript/base/single/label/abstract.label.ts diff --git a/typescript/base/single/label/html.label.ts b/packages/fineui/typescript/base/single/label/html.label.ts similarity index 100% rename from typescript/base/single/label/html.label.ts rename to packages/fineui/typescript/base/single/label/html.label.ts diff --git a/typescript/base/single/label/icon.label.ts b/packages/fineui/typescript/base/single/label/icon.label.ts similarity index 100% rename from typescript/base/single/label/icon.label.ts rename to packages/fineui/typescript/base/single/label/icon.label.ts diff --git a/typescript/base/single/label/label.ts b/packages/fineui/typescript/base/single/label/label.ts similarity index 100% rename from typescript/base/single/label/label.ts rename to packages/fineui/typescript/base/single/label/label.ts diff --git a/typescript/base/single/single.ts b/packages/fineui/typescript/base/single/single.ts similarity index 100% rename from typescript/base/single/single.ts rename to packages/fineui/typescript/base/single/single.ts diff --git a/typescript/base/single/text.ts b/packages/fineui/typescript/base/single/text.ts similarity index 100% rename from typescript/base/single/text.ts rename to packages/fineui/typescript/base/single/text.ts diff --git a/typescript/base/single/trigger/trigger.ts b/packages/fineui/typescript/base/single/trigger/trigger.ts similarity index 100% rename from typescript/base/single/trigger/trigger.ts rename to packages/fineui/typescript/base/single/trigger/trigger.ts diff --git a/typescript/base/tree/customtree.ts b/packages/fineui/typescript/base/tree/customtree.ts similarity index 100% rename from typescript/base/tree/customtree.ts rename to packages/fineui/typescript/base/tree/customtree.ts diff --git a/typescript/base/tree/ztree/asynctree.ts b/packages/fineui/typescript/base/tree/ztree/asynctree.ts similarity index 100% rename from typescript/base/tree/ztree/asynctree.ts rename to packages/fineui/typescript/base/tree/ztree/asynctree.ts diff --git a/typescript/base/tree/ztree/list/listasynctree.ts b/packages/fineui/typescript/base/tree/ztree/list/listasynctree.ts similarity index 100% rename from typescript/base/tree/ztree/list/listasynctree.ts rename to packages/fineui/typescript/base/tree/ztree/list/listasynctree.ts diff --git a/typescript/base/tree/ztree/list/listtreeview.ts b/packages/fineui/typescript/base/tree/ztree/list/listtreeview.ts similarity index 100% rename from typescript/base/tree/ztree/list/listtreeview.ts rename to packages/fineui/typescript/base/tree/ztree/list/listtreeview.ts diff --git a/typescript/base/tree/ztree/treeview.ts b/packages/fineui/typescript/base/tree/ztree/treeview.ts similarity index 100% rename from typescript/base/tree/ztree/treeview.ts rename to packages/fineui/typescript/base/tree/ztree/treeview.ts diff --git a/typescript/bundle.ts b/packages/fineui/typescript/bundle.ts similarity index 100% rename from typescript/bundle.ts rename to packages/fineui/typescript/bundle.ts diff --git a/typescript/case/button/icon/icon.change.ts b/packages/fineui/typescript/case/button/icon/icon.change.ts similarity index 100% rename from typescript/case/button/icon/icon.change.ts rename to packages/fineui/typescript/case/button/icon/icon.change.ts diff --git a/typescript/case/button/icon/icon.trigger.ts b/packages/fineui/typescript/case/button/icon/icon.trigger.ts similarity index 100% rename from typescript/case/button/icon/icon.trigger.ts rename to packages/fineui/typescript/case/button/icon/icon.trigger.ts diff --git a/typescript/case/button/icon/iconhalf/icon.half.image.ts b/packages/fineui/typescript/case/button/icon/iconhalf/icon.half.image.ts similarity index 100% rename from typescript/case/button/icon/iconhalf/icon.half.image.ts rename to packages/fineui/typescript/case/button/icon/iconhalf/icon.half.image.ts diff --git a/typescript/case/button/icon/iconhalf/icon.half.ts b/packages/fineui/typescript/case/button/icon/iconhalf/icon.half.ts similarity index 100% rename from typescript/case/button/icon/iconhalf/icon.half.ts rename to packages/fineui/typescript/case/button/icon/iconhalf/icon.half.ts diff --git a/typescript/case/button/item.multiselect.ts b/packages/fineui/typescript/case/button/item.multiselect.ts similarity index 100% rename from typescript/case/button/item.multiselect.ts rename to packages/fineui/typescript/case/button/item.multiselect.ts diff --git a/typescript/case/button/item.singleselect.radio.ts b/packages/fineui/typescript/case/button/item.singleselect.radio.ts similarity index 100% rename from typescript/case/button/item.singleselect.radio.ts rename to packages/fineui/typescript/case/button/item.singleselect.radio.ts diff --git a/typescript/case/button/item.singleselect.ts b/packages/fineui/typescript/case/button/item.singleselect.ts similarity index 100% rename from typescript/case/button/item.singleselect.ts rename to packages/fineui/typescript/case/button/item.singleselect.ts diff --git a/typescript/case/button/node/node.icon.arrow.ts b/packages/fineui/typescript/case/button/node/node.icon.arrow.ts similarity index 100% rename from typescript/case/button/node/node.icon.arrow.ts rename to packages/fineui/typescript/case/button/node/node.icon.arrow.ts diff --git a/typescript/case/button/switch.ts b/packages/fineui/typescript/case/button/switch.ts similarity index 100% rename from typescript/case/button/switch.ts rename to packages/fineui/typescript/case/button/switch.ts diff --git a/typescript/case/button/treeitem/item.first.treeleaf.ts b/packages/fineui/typescript/case/button/treeitem/item.first.treeleaf.ts similarity index 100% rename from typescript/case/button/treeitem/item.first.treeleaf.ts rename to packages/fineui/typescript/case/button/treeitem/item.first.treeleaf.ts diff --git a/typescript/case/button/treeitem/item.last.treeleaf.ts b/packages/fineui/typescript/case/button/treeitem/item.last.treeleaf.ts similarity index 100% rename from typescript/case/button/treeitem/item.last.treeleaf.ts rename to packages/fineui/typescript/case/button/treeitem/item.last.treeleaf.ts diff --git a/typescript/case/button/treeitem/item.mid.treeleaf.ts b/packages/fineui/typescript/case/button/treeitem/item.mid.treeleaf.ts similarity index 100% rename from typescript/case/button/treeitem/item.mid.treeleaf.ts rename to packages/fineui/typescript/case/button/treeitem/item.mid.treeleaf.ts diff --git a/typescript/case/checkbox/check.arrownode.ts b/packages/fineui/typescript/case/checkbox/check.arrownode.ts similarity index 100% rename from typescript/case/checkbox/check.arrownode.ts rename to packages/fineui/typescript/case/checkbox/check.arrownode.ts diff --git a/typescript/case/colorchooser/colorchooser.popup.hex.ts b/packages/fineui/typescript/case/colorchooser/colorchooser.popup.hex.ts similarity index 100% rename from typescript/case/colorchooser/colorchooser.popup.hex.ts rename to packages/fineui/typescript/case/colorchooser/colorchooser.popup.hex.ts diff --git a/typescript/case/colorchooser/colorchooser.simple.ts b/packages/fineui/typescript/case/colorchooser/colorchooser.simple.ts similarity index 100% rename from typescript/case/colorchooser/colorchooser.simple.ts rename to packages/fineui/typescript/case/colorchooser/colorchooser.simple.ts diff --git a/typescript/case/colorchooser/colorchooser.ts b/packages/fineui/typescript/case/colorchooser/colorchooser.ts similarity index 100% rename from typescript/case/colorchooser/colorchooser.ts rename to packages/fineui/typescript/case/colorchooser/colorchooser.ts diff --git a/typescript/case/combo/bubblecombo/combo.bubble.ts b/packages/fineui/typescript/case/combo/bubblecombo/combo.bubble.ts similarity index 100% rename from typescript/case/combo/bubblecombo/combo.bubble.ts rename to packages/fineui/typescript/case/combo/bubblecombo/combo.bubble.ts diff --git a/typescript/case/combo/bubblecombo/popup.bubble.ts b/packages/fineui/typescript/case/combo/bubblecombo/popup.bubble.ts similarity index 100% rename from typescript/case/combo/bubblecombo/popup.bubble.ts rename to packages/fineui/typescript/case/combo/bubblecombo/popup.bubble.ts diff --git a/typescript/case/combo/combo.textvalue.ts b/packages/fineui/typescript/case/combo/combo.textvalue.ts similarity index 100% rename from typescript/case/combo/combo.textvalue.ts rename to packages/fineui/typescript/case/combo/combo.textvalue.ts diff --git a/typescript/case/combo/combo.textvaluesmall.ts b/packages/fineui/typescript/case/combo/combo.textvaluesmall.ts similarity index 100% rename from typescript/case/combo/combo.textvaluesmall.ts rename to packages/fineui/typescript/case/combo/combo.textvaluesmall.ts diff --git a/typescript/case/combo/editoriconcheckcombo/combo.editiconcheck.ts b/packages/fineui/typescript/case/combo/editoriconcheckcombo/combo.editiconcheck.ts similarity index 100% rename from typescript/case/combo/editoriconcheckcombo/combo.editiconcheck.ts rename to packages/fineui/typescript/case/combo/editoriconcheckcombo/combo.editiconcheck.ts diff --git a/typescript/case/combo/iconcombo/combo.icon.ts b/packages/fineui/typescript/case/combo/iconcombo/combo.icon.ts similarity index 100% rename from typescript/case/combo/iconcombo/combo.icon.ts rename to packages/fineui/typescript/case/combo/iconcombo/combo.icon.ts diff --git a/typescript/case/combo/icontextvaluecombo/combo.icontextvalue.ts b/packages/fineui/typescript/case/combo/icontextvaluecombo/combo.icontextvalue.ts similarity index 100% rename from typescript/case/combo/icontextvaluecombo/combo.icontextvalue.ts rename to packages/fineui/typescript/case/combo/icontextvaluecombo/combo.icontextvalue.ts diff --git a/typescript/case/combo/popup.textvalue.ts b/packages/fineui/typescript/case/combo/popup.textvalue.ts similarity index 100% rename from typescript/case/combo/popup.textvalue.ts rename to packages/fineui/typescript/case/combo/popup.textvalue.ts diff --git a/typescript/case/combo/searchtextvaluecombo/combo.searchtextvalue.ts b/packages/fineui/typescript/case/combo/searchtextvaluecombo/combo.searchtextvalue.ts similarity index 100% rename from typescript/case/combo/searchtextvaluecombo/combo.searchtextvalue.ts rename to packages/fineui/typescript/case/combo/searchtextvaluecombo/combo.searchtextvalue.ts diff --git a/typescript/case/combo/textvaluecheckcombo/combo.textvaluecheck.ts b/packages/fineui/typescript/case/combo/textvaluecheckcombo/combo.textvaluecheck.ts similarity index 100% rename from typescript/case/combo/textvaluecheckcombo/combo.textvaluecheck.ts rename to packages/fineui/typescript/case/combo/textvaluecheckcombo/combo.textvaluecheck.ts diff --git a/typescript/case/combo/textvaluecheckcombo/popup.textvaluecheck.ts b/packages/fineui/typescript/case/combo/textvaluecheckcombo/popup.textvaluecheck.ts similarity index 100% rename from typescript/case/combo/textvaluecheckcombo/popup.textvaluecheck.ts rename to packages/fineui/typescript/case/combo/textvaluecheckcombo/popup.textvaluecheck.ts diff --git a/typescript/case/editor/editor.shelter.ts b/packages/fineui/typescript/case/editor/editor.shelter.ts similarity index 100% rename from typescript/case/editor/editor.shelter.ts rename to packages/fineui/typescript/case/editor/editor.shelter.ts diff --git a/typescript/case/editor/editor.sign.ts b/packages/fineui/typescript/case/editor/editor.sign.ts similarity index 100% rename from typescript/case/editor/editor.sign.ts rename to packages/fineui/typescript/case/editor/editor.sign.ts diff --git a/typescript/case/editor/editor.state.ts b/packages/fineui/typescript/case/editor/editor.state.ts similarity index 100% rename from typescript/case/editor/editor.state.ts rename to packages/fineui/typescript/case/editor/editor.state.ts diff --git a/typescript/case/layer/layer.multipopup.ts b/packages/fineui/typescript/case/layer/layer.multipopup.ts similarity index 100% rename from typescript/case/layer/layer.multipopup.ts rename to packages/fineui/typescript/case/layer/layer.multipopup.ts diff --git a/typescript/case/layer/pane.list.ts b/packages/fineui/typescript/case/layer/pane.list.ts similarity index 100% rename from typescript/case/layer/pane.list.ts rename to packages/fineui/typescript/case/layer/pane.list.ts diff --git a/typescript/case/linersegment/linear.segment.ts b/packages/fineui/typescript/case/linersegment/linear.segment.ts similarity index 100% rename from typescript/case/linersegment/linear.segment.ts rename to packages/fineui/typescript/case/linersegment/linear.segment.ts diff --git a/typescript/case/list/list.select.ts b/packages/fineui/typescript/case/list/list.select.ts similarity index 100% rename from typescript/case/list/list.select.ts rename to packages/fineui/typescript/case/list/list.select.ts diff --git a/typescript/case/pager/pager.all.count.ts b/packages/fineui/typescript/case/pager/pager.all.count.ts similarity index 100% rename from typescript/case/pager/pager.all.count.ts rename to packages/fineui/typescript/case/pager/pager.all.count.ts diff --git a/typescript/case/pager/pager.direction.ts b/packages/fineui/typescript/case/pager/pager.direction.ts similarity index 100% rename from typescript/case/pager/pager.direction.ts rename to packages/fineui/typescript/case/pager/pager.direction.ts diff --git a/typescript/case/segment/segment.ts b/packages/fineui/typescript/case/segment/segment.ts similarity index 100% rename from typescript/case/segment/segment.ts rename to packages/fineui/typescript/case/segment/segment.ts diff --git a/typescript/case/toolbar/toolbar.multiselect.ts b/packages/fineui/typescript/case/toolbar/toolbar.multiselect.ts similarity index 100% rename from typescript/case/toolbar/toolbar.multiselect.ts rename to packages/fineui/typescript/case/toolbar/toolbar.multiselect.ts diff --git a/typescript/case/trigger/trigger.text.select.ts b/packages/fineui/typescript/case/trigger/trigger.text.select.ts similarity index 100% rename from typescript/case/trigger/trigger.text.select.ts rename to packages/fineui/typescript/case/trigger/trigger.text.select.ts diff --git a/typescript/case/trigger/trigger.text.ts b/packages/fineui/typescript/case/trigger/trigger.text.ts similarity index 100% rename from typescript/case/trigger/trigger.text.ts rename to packages/fineui/typescript/case/trigger/trigger.text.ts diff --git a/typescript/component/allvaluechooser/abstract.allvaluechooser.ts b/packages/fineui/typescript/component/allvaluechooser/abstract.allvaluechooser.ts similarity index 100% rename from typescript/component/allvaluechooser/abstract.allvaluechooser.ts rename to packages/fineui/typescript/component/allvaluechooser/abstract.allvaluechooser.ts diff --git a/typescript/component/allvaluechooser/combo.allvaluechooser.ts b/packages/fineui/typescript/component/allvaluechooser/combo.allvaluechooser.ts similarity index 100% rename from typescript/component/allvaluechooser/combo.allvaluechooser.ts rename to packages/fineui/typescript/component/allvaluechooser/combo.allvaluechooser.ts diff --git a/typescript/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.ts b/packages/fineui/typescript/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.ts similarity index 100% rename from typescript/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.ts rename to packages/fineui/typescript/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.ts diff --git a/typescript/component/form/form.ts b/packages/fineui/typescript/component/form/form.ts similarity index 100% rename from typescript/component/form/form.ts rename to packages/fineui/typescript/component/form/form.ts diff --git a/typescript/component/treevaluechooser/abstract.treevaluechooser.list.ts b/packages/fineui/typescript/component/treevaluechooser/abstract.treevaluechooser.list.ts similarity index 100% rename from typescript/component/treevaluechooser/abstract.treevaluechooser.list.ts rename to packages/fineui/typescript/component/treevaluechooser/abstract.treevaluechooser.list.ts diff --git a/typescript/component/treevaluechooser/abstract.treevaluechooser.ts b/packages/fineui/typescript/component/treevaluechooser/abstract.treevaluechooser.ts similarity index 100% rename from typescript/component/treevaluechooser/abstract.treevaluechooser.ts rename to packages/fineui/typescript/component/treevaluechooser/abstract.treevaluechooser.ts diff --git a/typescript/component/treevaluechooser/combo.listtreevaluechooser.ts b/packages/fineui/typescript/component/treevaluechooser/combo.listtreevaluechooser.ts similarity index 100% rename from typescript/component/treevaluechooser/combo.listtreevaluechooser.ts rename to packages/fineui/typescript/component/treevaluechooser/combo.listtreevaluechooser.ts diff --git a/typescript/component/treevaluechooser/combo.treevaluechooser.insert.ts b/packages/fineui/typescript/component/treevaluechooser/combo.treevaluechooser.insert.ts similarity index 100% rename from typescript/component/treevaluechooser/combo.treevaluechooser.insert.ts rename to packages/fineui/typescript/component/treevaluechooser/combo.treevaluechooser.insert.ts diff --git a/typescript/component/treevaluechooser/combo.treevaluechooser.ts b/packages/fineui/typescript/component/treevaluechooser/combo.treevaluechooser.ts similarity index 100% rename from typescript/component/treevaluechooser/combo.treevaluechooser.ts rename to packages/fineui/typescript/component/treevaluechooser/combo.treevaluechooser.ts diff --git a/typescript/component/treevaluechooser/pane.treevaluechooser.ts b/packages/fineui/typescript/component/treevaluechooser/pane.treevaluechooser.ts similarity index 100% rename from typescript/component/treevaluechooser/pane.treevaluechooser.ts rename to packages/fineui/typescript/component/treevaluechooser/pane.treevaluechooser.ts diff --git a/typescript/core/action/action.show.ts b/packages/fineui/typescript/core/action/action.show.ts similarity index 100% rename from typescript/core/action/action.show.ts rename to packages/fineui/typescript/core/action/action.show.ts diff --git a/typescript/core/action/action.ts b/packages/fineui/typescript/core/action/action.ts similarity index 100% rename from typescript/core/action/action.ts rename to packages/fineui/typescript/core/action/action.ts diff --git a/typescript/core/base.ts b/packages/fineui/typescript/core/base.ts similarity index 100% rename from typescript/core/base.ts rename to packages/fineui/typescript/core/base.ts diff --git a/typescript/core/behavior/behavior.highlight.ts b/packages/fineui/typescript/core/behavior/behavior.highlight.ts similarity index 100% rename from typescript/core/behavior/behavior.highlight.ts rename to packages/fineui/typescript/core/behavior/behavior.highlight.ts diff --git a/typescript/core/behavior/behavior.redmark.ts b/packages/fineui/typescript/core/behavior/behavior.redmark.ts similarity index 100% rename from typescript/core/behavior/behavior.redmark.ts rename to packages/fineui/typescript/core/behavior/behavior.redmark.ts diff --git a/typescript/core/behavior/behavior.ts b/packages/fineui/typescript/core/behavior/behavior.ts similarity index 100% rename from typescript/core/behavior/behavior.ts rename to packages/fineui/typescript/core/behavior/behavior.ts diff --git a/typescript/core/controller/controller.broadcast.ts b/packages/fineui/typescript/core/controller/controller.broadcast.ts similarity index 100% rename from typescript/core/controller/controller.broadcast.ts rename to packages/fineui/typescript/core/controller/controller.broadcast.ts diff --git a/typescript/core/controller/controller.layer.ts b/packages/fineui/typescript/core/controller/controller.layer.ts similarity index 100% rename from typescript/core/controller/controller.layer.ts rename to packages/fineui/typescript/core/controller/controller.layer.ts diff --git a/typescript/core/controller/controller.ts b/packages/fineui/typescript/core/controller/controller.ts similarity index 100% rename from typescript/core/controller/controller.ts rename to packages/fineui/typescript/core/controller/controller.ts diff --git a/typescript/core/decorator/decorator.ts b/packages/fineui/typescript/core/decorator/decorator.ts similarity index 100% rename from typescript/core/decorator/decorator.ts rename to packages/fineui/typescript/core/decorator/decorator.ts diff --git a/typescript/core/func/array.ts b/packages/fineui/typescript/core/func/array.ts similarity index 100% rename from typescript/core/func/array.ts rename to packages/fineui/typescript/core/func/array.ts diff --git a/typescript/core/func/date.ts b/packages/fineui/typescript/core/func/date.ts similarity index 100% rename from typescript/core/func/date.ts rename to packages/fineui/typescript/core/func/date.ts diff --git a/typescript/core/func/function.ts b/packages/fineui/typescript/core/func/function.ts similarity index 100% rename from typescript/core/func/function.ts rename to packages/fineui/typescript/core/func/function.ts diff --git a/typescript/core/func/index.ts b/packages/fineui/typescript/core/func/index.ts similarity index 100% rename from typescript/core/func/index.ts rename to packages/fineui/typescript/core/func/index.ts diff --git a/typescript/core/func/number.ts b/packages/fineui/typescript/core/func/number.ts similarity index 100% rename from typescript/core/func/number.ts rename to packages/fineui/typescript/core/func/number.ts diff --git a/typescript/core/func/string.ts b/packages/fineui/typescript/core/func/string.ts similarity index 100% rename from typescript/core/func/string.ts rename to packages/fineui/typescript/core/func/string.ts diff --git a/typescript/core/i18n.ts b/packages/fineui/typescript/core/i18n.ts similarity index 100% rename from typescript/core/i18n.ts rename to packages/fineui/typescript/core/i18n.ts diff --git a/typescript/core/inject.ts b/packages/fineui/typescript/core/inject.ts similarity index 100% rename from typescript/core/inject.ts rename to packages/fineui/typescript/core/inject.ts diff --git a/typescript/core/ob.ts b/packages/fineui/typescript/core/ob.ts similarity index 100% rename from typescript/core/ob.ts rename to packages/fineui/typescript/core/ob.ts diff --git a/typescript/core/platform/web/detectElementResize.ts b/packages/fineui/typescript/core/platform/web/detectElementResize.ts similarity index 100% rename from typescript/core/platform/web/detectElementResize.ts rename to packages/fineui/typescript/core/platform/web/detectElementResize.ts diff --git a/typescript/core/platform/web/dom.ts b/packages/fineui/typescript/core/platform/web/dom.ts similarity index 100% rename from typescript/core/platform/web/dom.ts rename to packages/fineui/typescript/core/platform/web/dom.ts diff --git a/typescript/core/platform/web/eventListener.ts b/packages/fineui/typescript/core/platform/web/eventListener.ts similarity index 100% rename from typescript/core/platform/web/eventListener.ts rename to packages/fineui/typescript/core/platform/web/eventListener.ts diff --git a/typescript/core/platform/web/function.ts b/packages/fineui/typescript/core/platform/web/function.ts similarity index 100% rename from typescript/core/platform/web/function.ts rename to packages/fineui/typescript/core/platform/web/function.ts diff --git a/typescript/core/platform/web/index.ts b/packages/fineui/typescript/core/platform/web/index.ts similarity index 100% rename from typescript/core/platform/web/index.ts rename to packages/fineui/typescript/core/platform/web/index.ts diff --git a/typescript/core/platform/web/load.ts b/packages/fineui/typescript/core/platform/web/load.ts similarity index 100% rename from typescript/core/platform/web/load.ts rename to packages/fineui/typescript/core/platform/web/load.ts diff --git a/typescript/core/plugin.ts b/packages/fineui/typescript/core/plugin.ts similarity index 100% rename from typescript/core/plugin.ts rename to packages/fineui/typescript/core/plugin.ts diff --git a/typescript/core/utils/aes.ts b/packages/fineui/typescript/core/utils/aes.ts similarity index 100% rename from typescript/core/utils/aes.ts rename to packages/fineui/typescript/core/utils/aes.ts diff --git a/typescript/core/utils/aspect.ts b/packages/fineui/typescript/core/utils/aspect.ts similarity index 100% rename from typescript/core/utils/aspect.ts rename to packages/fineui/typescript/core/utils/aspect.ts diff --git a/typescript/core/utils/base64.ts b/packages/fineui/typescript/core/utils/base64.ts similarity index 100% rename from typescript/core/utils/base64.ts rename to packages/fineui/typescript/core/utils/base64.ts diff --git a/typescript/core/utils/cache.ts b/packages/fineui/typescript/core/utils/cache.ts similarity index 100% rename from typescript/core/utils/cache.ts rename to packages/fineui/typescript/core/utils/cache.ts diff --git a/typescript/core/utils/cellSizeAndPositionManager.ts b/packages/fineui/typescript/core/utils/cellSizeAndPositionManager.ts similarity index 100% rename from typescript/core/utils/cellSizeAndPositionManager.ts rename to packages/fineui/typescript/core/utils/cellSizeAndPositionManager.ts diff --git a/typescript/core/utils/chinesePY.ts b/packages/fineui/typescript/core/utils/chinesePY.ts similarity index 100% rename from typescript/core/utils/chinesePY.ts rename to packages/fineui/typescript/core/utils/chinesePY.ts diff --git a/typescript/core/utils/events/mousemovetracker.ts b/packages/fineui/typescript/core/utils/events/mousemovetracker.ts similarity index 100% rename from typescript/core/utils/events/mousemovetracker.ts rename to packages/fineui/typescript/core/utils/events/mousemovetracker.ts diff --git a/typescript/core/utils/events/wheelhandler.ts b/packages/fineui/typescript/core/utils/events/wheelhandler.ts similarity index 100% rename from typescript/core/utils/events/wheelhandler.ts rename to packages/fineui/typescript/core/utils/events/wheelhandler.ts diff --git a/typescript/core/utils/heap.ts b/packages/fineui/typescript/core/utils/heap.ts similarity index 100% rename from typescript/core/utils/heap.ts rename to packages/fineui/typescript/core/utils/heap.ts diff --git a/typescript/core/utils/index.ts b/packages/fineui/typescript/core/utils/index.ts similarity index 100% rename from typescript/core/utils/index.ts rename to packages/fineui/typescript/core/utils/index.ts diff --git a/typescript/core/utils/linkedHashMap.ts b/packages/fineui/typescript/core/utils/linkedHashMap.ts similarity index 100% rename from typescript/core/utils/linkedHashMap.ts rename to packages/fineui/typescript/core/utils/linkedHashMap.ts diff --git a/typescript/core/utils/lru.ts b/packages/fineui/typescript/core/utils/lru.ts similarity index 100% rename from typescript/core/utils/lru.ts rename to packages/fineui/typescript/core/utils/lru.ts diff --git a/typescript/core/utils/prefixIntervalTree.ts b/packages/fineui/typescript/core/utils/prefixIntervalTree.ts similarity index 100% rename from typescript/core/utils/prefixIntervalTree.ts rename to packages/fineui/typescript/core/utils/prefixIntervalTree.ts diff --git a/typescript/core/utils/queue.ts b/packages/fineui/typescript/core/utils/queue.ts similarity index 100% rename from typescript/core/utils/queue.ts rename to packages/fineui/typescript/core/utils/queue.ts diff --git a/typescript/core/utils/sectionManager.ts b/packages/fineui/typescript/core/utils/sectionManager.ts similarity index 100% rename from typescript/core/utils/sectionManager.ts rename to packages/fineui/typescript/core/utils/sectionManager.ts diff --git a/typescript/core/utils/tree.ts b/packages/fineui/typescript/core/utils/tree.ts similarity index 100% rename from typescript/core/utils/tree.ts rename to packages/fineui/typescript/core/utils/tree.ts diff --git a/typescript/core/utils/vector.ts b/packages/fineui/typescript/core/utils/vector.ts similarity index 100% rename from typescript/core/utils/vector.ts rename to packages/fineui/typescript/core/utils/vector.ts diff --git a/typescript/core/var.ts b/packages/fineui/typescript/core/var.ts similarity index 100% rename from typescript/core/var.ts rename to packages/fineui/typescript/core/var.ts diff --git a/typescript/core/widget.ts b/packages/fineui/typescript/core/widget.ts similarity index 100% rename from typescript/core/widget.ts rename to packages/fineui/typescript/core/widget.ts diff --git a/typescript/core/worker/action/worker.action.ts b/packages/fineui/typescript/core/worker/action/worker.action.ts similarity index 100% rename from typescript/core/worker/action/worker.action.ts rename to packages/fineui/typescript/core/worker/action/worker.action.ts diff --git a/typescript/core/worker/controller/worker.controller.ts b/packages/fineui/typescript/core/worker/controller/worker.controller.ts similarity index 100% rename from typescript/core/worker/controller/worker.controller.ts rename to packages/fineui/typescript/core/worker/controller/worker.controller.ts diff --git a/typescript/core/worker/controller/worker.main_thread.controller.ts b/packages/fineui/typescript/core/worker/controller/worker.main_thread.controller.ts similarity index 100% rename from typescript/core/worker/controller/worker.main_thread.controller.ts rename to packages/fineui/typescript/core/worker/controller/worker.main_thread.controller.ts diff --git a/typescript/core/worker/controller/worker.worker_thread.controller.ts b/packages/fineui/typescript/core/worker/controller/worker.worker_thread.controller.ts similarity index 100% rename from typescript/core/worker/controller/worker.worker_thread.controller.ts rename to packages/fineui/typescript/core/worker/controller/worker.worker_thread.controller.ts diff --git a/typescript/core/worker/worker.channel.ts b/packages/fineui/typescript/core/worker/worker.channel.ts similarity index 100% rename from typescript/core/worker/worker.channel.ts rename to packages/fineui/typescript/core/worker/worker.channel.ts diff --git a/typescript/core/worker/worker.core.ts b/packages/fineui/typescript/core/worker/worker.core.ts similarity index 100% rename from typescript/core/worker/worker.core.ts rename to packages/fineui/typescript/core/worker/worker.core.ts diff --git a/typescript/core/worker/worker.main_thread.ts b/packages/fineui/typescript/core/worker/worker.main_thread.ts similarity index 100% rename from typescript/core/worker/worker.main_thread.ts rename to packages/fineui/typescript/core/worker/worker.main_thread.ts diff --git a/typescript/core/worker/worker.worker_thread.ts b/packages/fineui/typescript/core/worker/worker.worker_thread.ts similarity index 100% rename from typescript/core/worker/worker.worker_thread.ts rename to packages/fineui/typescript/core/worker/worker.worker_thread.ts diff --git a/typescript/core/worker/workers.ts b/packages/fineui/typescript/core/worker/workers.ts similarity index 100% rename from typescript/core/worker/workers.ts rename to packages/fineui/typescript/core/worker/workers.ts diff --git a/typescript/core/wrapper/layout.ts b/packages/fineui/typescript/core/wrapper/layout.ts similarity index 100% rename from typescript/core/wrapper/layout.ts rename to packages/fineui/typescript/core/wrapper/layout.ts diff --git a/typescript/core/wrapper/layout/adapt/absolute.center.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/absolute.center.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/absolute.center.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/absolute.center.ts diff --git a/typescript/core/wrapper/layout/adapt/adapt.center.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/adapt.center.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/adapt.center.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/adapt.center.ts diff --git a/typescript/core/wrapper/layout/adapt/adapt.horizontal.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/adapt.horizontal.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/adapt.horizontal.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/adapt.horizontal.ts diff --git a/typescript/core/wrapper/layout/adapt/adapt.leftrightvertical.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/adapt.leftrightvertical.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/adapt.leftrightvertical.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/adapt.leftrightvertical.ts diff --git a/typescript/core/wrapper/layout/adapt/adapt.leftvertical.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/adapt.leftvertical.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/adapt.leftvertical.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/adapt.leftvertical.ts diff --git a/typescript/core/wrapper/layout/adapt/adapt.table.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/adapt.table.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/adapt.table.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/adapt.table.ts diff --git a/typescript/core/wrapper/layout/adapt/adapt.vertical.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/adapt.vertical.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/adapt.vertical.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/adapt.vertical.ts diff --git a/typescript/core/wrapper/layout/adapt/auto.horizontal.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/auto.horizontal.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/auto.horizontal.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/auto.horizontal.ts diff --git a/typescript/core/wrapper/layout/adapt/float.horizontal.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/float.horizontal.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/float.horizontal.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/float.horizontal.ts diff --git a/typescript/core/wrapper/layout/adapt/inline.vertical.ts b/packages/fineui/typescript/core/wrapper/layout/adapt/inline.vertical.ts similarity index 100% rename from typescript/core/wrapper/layout/adapt/inline.vertical.ts rename to packages/fineui/typescript/core/wrapper/layout/adapt/inline.vertical.ts diff --git a/typescript/core/wrapper/layout/fill/fill.horizontal.ts b/packages/fineui/typescript/core/wrapper/layout/fill/fill.horizontal.ts similarity index 100% rename from typescript/core/wrapper/layout/fill/fill.horizontal.ts rename to packages/fineui/typescript/core/wrapper/layout/fill/fill.horizontal.ts diff --git a/typescript/core/wrapper/layout/fill/fill.vertical.ts b/packages/fineui/typescript/core/wrapper/layout/fill/fill.vertical.ts similarity index 100% rename from typescript/core/wrapper/layout/fill/fill.vertical.ts rename to packages/fineui/typescript/core/wrapper/layout/fill/fill.vertical.ts diff --git a/typescript/core/wrapper/layout/layout.absolute.ts b/packages/fineui/typescript/core/wrapper/layout/layout.absolute.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.absolute.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.absolute.ts diff --git a/typescript/core/wrapper/layout/layout.adaptive.ts b/packages/fineui/typescript/core/wrapper/layout/layout.adaptive.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.adaptive.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.adaptive.ts diff --git a/typescript/core/wrapper/layout/layout.card.ts b/packages/fineui/typescript/core/wrapper/layout/layout.card.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.card.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.card.ts diff --git a/typescript/core/wrapper/layout/layout.default.ts b/packages/fineui/typescript/core/wrapper/layout/layout.default.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.default.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.default.ts diff --git a/typescript/core/wrapper/layout/layout.flow.ts b/packages/fineui/typescript/core/wrapper/layout/layout.flow.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.flow.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.flow.ts diff --git a/typescript/core/wrapper/layout/layout.grid.ts b/packages/fineui/typescript/core/wrapper/layout/layout.grid.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.grid.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.grid.ts diff --git a/typescript/core/wrapper/layout/layout.horizontal.ts b/packages/fineui/typescript/core/wrapper/layout/layout.horizontal.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.horizontal.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.horizontal.ts diff --git a/typescript/core/wrapper/layout/layout.table.ts b/packages/fineui/typescript/core/wrapper/layout/layout.table.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.table.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.table.ts diff --git a/typescript/core/wrapper/layout/layout.tape.ts b/packages/fineui/typescript/core/wrapper/layout/layout.tape.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.tape.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.tape.ts diff --git a/typescript/core/wrapper/layout/layout.td.ts b/packages/fineui/typescript/core/wrapper/layout/layout.td.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.td.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.td.ts diff --git a/typescript/core/wrapper/layout/layout.vertical.ts b/packages/fineui/typescript/core/wrapper/layout/layout.vertical.ts similarity index 100% rename from typescript/core/wrapper/layout/layout.vertical.ts rename to packages/fineui/typescript/core/wrapper/layout/layout.vertical.ts diff --git a/typescript/core/wrapper/layout/middle/middle.center.ts b/packages/fineui/typescript/core/wrapper/layout/middle/middle.center.ts similarity index 100% rename from typescript/core/wrapper/layout/middle/middle.center.ts rename to packages/fineui/typescript/core/wrapper/layout/middle/middle.center.ts diff --git a/typescript/core/wrapper/layout/middle/middle.float.center.ts b/packages/fineui/typescript/core/wrapper/layout/middle/middle.float.center.ts similarity index 100% rename from typescript/core/wrapper/layout/middle/middle.float.center.ts rename to packages/fineui/typescript/core/wrapper/layout/middle/middle.float.center.ts diff --git a/typescript/core/wrapper/layout/sticky/sticky.horizontal.ts b/packages/fineui/typescript/core/wrapper/layout/sticky/sticky.horizontal.ts similarity index 100% rename from typescript/core/wrapper/layout/sticky/sticky.horizontal.ts rename to packages/fineui/typescript/core/wrapper/layout/sticky/sticky.horizontal.ts diff --git a/typescript/core/wrapper/layout/sticky/sticky.vertical.ts b/packages/fineui/typescript/core/wrapper/layout/sticky/sticky.vertical.ts similarity index 100% rename from typescript/core/wrapper/layout/sticky/sticky.vertical.ts rename to packages/fineui/typescript/core/wrapper/layout/sticky/sticky.vertical.ts diff --git a/typescript/index.ts b/packages/fineui/typescript/index.ts similarity index 100% rename from typescript/index.ts rename to packages/fineui/typescript/index.ts diff --git a/typescript/router/router.ts b/packages/fineui/typescript/router/router.ts similarity index 100% rename from typescript/router/router.ts rename to packages/fineui/typescript/router/router.ts diff --git a/typescript/shims-tsx.ts b/packages/fineui/typescript/shims-tsx.ts similarity index 100% rename from typescript/shims-tsx.ts rename to packages/fineui/typescript/shims-tsx.ts diff --git a/typescript/widget/collapse/collapse.ts b/packages/fineui/typescript/widget/collapse/collapse.ts similarity index 100% rename from typescript/widget/collapse/collapse.ts rename to packages/fineui/typescript/widget/collapse/collapse.ts diff --git a/typescript/widget/date/calendar/popup.calendar.date.ts b/packages/fineui/typescript/widget/date/calendar/popup.calendar.date.ts similarity index 100% rename from typescript/widget/date/calendar/popup.calendar.date.ts rename to packages/fineui/typescript/widget/date/calendar/popup.calendar.date.ts diff --git a/typescript/widget/datepane/datepane.ts b/packages/fineui/typescript/widget/datepane/datepane.ts similarity index 100% rename from typescript/widget/datepane/datepane.ts rename to packages/fineui/typescript/widget/datepane/datepane.ts diff --git a/typescript/widget/datetime/datetime.combo.ts b/packages/fineui/typescript/widget/datetime/datetime.combo.ts similarity index 100% rename from typescript/widget/datetime/datetime.combo.ts rename to packages/fineui/typescript/widget/datetime/datetime.combo.ts diff --git a/typescript/widget/datetimepane/datetimepane.ts b/packages/fineui/typescript/widget/datetimepane/datetimepane.ts similarity index 100% rename from typescript/widget/datetimepane/datetimepane.ts rename to packages/fineui/typescript/widget/datetimepane/datetimepane.ts diff --git a/typescript/widget/downlist/combo.downlist.ts b/packages/fineui/typescript/widget/downlist/combo.downlist.ts similarity index 100% rename from typescript/widget/downlist/combo.downlist.ts rename to packages/fineui/typescript/widget/downlist/combo.downlist.ts diff --git a/typescript/widget/downlist/item.downlistgroup.ts b/packages/fineui/typescript/widget/downlist/item.downlistgroup.ts similarity index 100% rename from typescript/widget/downlist/item.downlistgroup.ts rename to packages/fineui/typescript/widget/downlist/item.downlistgroup.ts diff --git a/typescript/widget/downlist/popup.downlist.ts b/packages/fineui/typescript/widget/downlist/popup.downlist.ts similarity index 100% rename from typescript/widget/downlist/popup.downlist.ts rename to packages/fineui/typescript/widget/downlist/popup.downlist.ts diff --git a/typescript/widget/dynamicdate/dynamicdate.combo.ts b/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts similarity index 100% rename from typescript/widget/dynamicdate/dynamicdate.combo.ts rename to packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts diff --git a/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts b/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts similarity index 100% rename from typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts rename to packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts diff --git a/typescript/widget/editor/editor.multifile.ts b/packages/fineui/typescript/widget/editor/editor.multifile.ts similarity index 100% rename from typescript/widget/editor/editor.multifile.ts rename to packages/fineui/typescript/widget/editor/editor.multifile.ts diff --git a/typescript/widget/editor/editor.search.ts b/packages/fineui/typescript/widget/editor/editor.search.ts similarity index 100% rename from typescript/widget/editor/editor.search.ts rename to packages/fineui/typescript/widget/editor/editor.search.ts diff --git a/typescript/widget/editor/editor.text.small.ts b/packages/fineui/typescript/widget/editor/editor.text.small.ts similarity index 100% rename from typescript/widget/editor/editor.text.small.ts rename to packages/fineui/typescript/widget/editor/editor.text.small.ts diff --git a/typescript/widget/editor/editor.text.ts b/packages/fineui/typescript/widget/editor/editor.text.ts similarity index 100% rename from typescript/widget/editor/editor.text.ts rename to packages/fineui/typescript/widget/editor/editor.text.ts diff --git a/typescript/widget/intervalslider/intervalslider.ts b/packages/fineui/typescript/widget/intervalslider/intervalslider.ts similarity index 100% rename from typescript/widget/intervalslider/intervalslider.ts rename to packages/fineui/typescript/widget/intervalslider/intervalslider.ts diff --git a/typescript/widget/multilayerdownlist/multilayerdownlist.combo.ts b/packages/fineui/typescript/widget/multilayerdownlist/multilayerdownlist.combo.ts similarity index 100% rename from typescript/widget/multilayerdownlist/multilayerdownlist.combo.ts rename to packages/fineui/typescript/widget/multilayerdownlist/multilayerdownlist.combo.ts diff --git a/typescript/widget/multilayerdownlist/multilayerdownlist.popup.ts b/packages/fineui/typescript/widget/multilayerdownlist/multilayerdownlist.popup.ts similarity index 100% rename from typescript/widget/multilayerdownlist/multilayerdownlist.popup.ts rename to packages/fineui/typescript/widget/multilayerdownlist/multilayerdownlist.popup.ts diff --git a/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts b/packages/fineui/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts similarity index 100% rename from typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts rename to packages/fineui/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts diff --git a/typescript/widget/multilayerselecttree/multilayerselecttree.leveltree.ts b/packages/fineui/typescript/widget/multilayerselecttree/multilayerselecttree.leveltree.ts similarity index 100% rename from typescript/widget/multilayerselecttree/multilayerselecttree.leveltree.ts rename to packages/fineui/typescript/widget/multilayerselecttree/multilayerselecttree.leveltree.ts diff --git a/typescript/widget/multilayerselecttree/multilayerselecttree.popup.ts b/packages/fineui/typescript/widget/multilayerselecttree/multilayerselecttree.popup.ts similarity index 100% rename from typescript/widget/multilayerselecttree/multilayerselecttree.popup.ts rename to packages/fineui/typescript/widget/multilayerselecttree/multilayerselecttree.popup.ts diff --git a/typescript/widget/multilayersingletree/multilayersingletree.combo.ts b/packages/fineui/typescript/widget/multilayersingletree/multilayersingletree.combo.ts similarity index 100% rename from typescript/widget/multilayersingletree/multilayersingletree.combo.ts rename to packages/fineui/typescript/widget/multilayersingletree/multilayersingletree.combo.ts diff --git a/typescript/widget/multilayersingletree/multilayersingletree.leveltree.ts b/packages/fineui/typescript/widget/multilayersingletree/multilayersingletree.leveltree.ts similarity index 100% rename from typescript/widget/multilayersingletree/multilayersingletree.leveltree.ts rename to packages/fineui/typescript/widget/multilayersingletree/multilayersingletree.leveltree.ts diff --git a/typescript/widget/multilayersingletree/multilayersingletree.popup.ts b/packages/fineui/typescript/widget/multilayersingletree/multilayersingletree.popup.ts similarity index 100% rename from typescript/widget/multilayersingletree/multilayersingletree.popup.ts rename to packages/fineui/typescript/widget/multilayersingletree/multilayersingletree.popup.ts diff --git a/typescript/widget/multiselect/multiselect.combo.ts b/packages/fineui/typescript/widget/multiselect/multiselect.combo.ts similarity index 100% rename from typescript/widget/multiselect/multiselect.combo.ts rename to packages/fineui/typescript/widget/multiselect/multiselect.combo.ts diff --git a/typescript/widget/multiselect/multiselect.insert.combo.ts b/packages/fineui/typescript/widget/multiselect/multiselect.insert.combo.ts similarity index 100% rename from typescript/widget/multiselect/multiselect.insert.combo.ts rename to packages/fineui/typescript/widget/multiselect/multiselect.insert.combo.ts diff --git a/typescript/widget/multiselectlist/multiselectlist.insert.ts b/packages/fineui/typescript/widget/multiselectlist/multiselectlist.insert.ts similarity index 100% rename from typescript/widget/multiselectlist/multiselectlist.insert.ts rename to packages/fineui/typescript/widget/multiselectlist/multiselectlist.insert.ts diff --git a/typescript/widget/multiselecttree/multiselecttree.ts b/packages/fineui/typescript/widget/multiselecttree/multiselecttree.ts similarity index 100% rename from typescript/widget/multiselecttree/multiselecttree.ts rename to packages/fineui/typescript/widget/multiselecttree/multiselecttree.ts diff --git a/typescript/widget/multitree/multi.tree.combo.ts b/packages/fineui/typescript/widget/multitree/multi.tree.combo.ts similarity index 100% rename from typescript/widget/multitree/multi.tree.combo.ts rename to packages/fineui/typescript/widget/multitree/multi.tree.combo.ts diff --git a/typescript/widget/multitree/multi.tree.insert.combo.ts b/packages/fineui/typescript/widget/multitree/multi.tree.insert.combo.ts similarity index 100% rename from typescript/widget/multitree/multi.tree.insert.combo.ts rename to packages/fineui/typescript/widget/multitree/multi.tree.insert.combo.ts diff --git a/typescript/widget/multitree/multi.tree.list.combo.ts b/packages/fineui/typescript/widget/multitree/multi.tree.list.combo.ts similarity index 100% rename from typescript/widget/multitree/multi.tree.list.combo.ts rename to packages/fineui/typescript/widget/multitree/multi.tree.list.combo.ts diff --git a/typescript/widget/multitree/multi.tree.popup.ts b/packages/fineui/typescript/widget/multitree/multi.tree.popup.ts similarity index 100% rename from typescript/widget/multitree/multi.tree.popup.ts rename to packages/fineui/typescript/widget/multitree/multi.tree.popup.ts diff --git a/typescript/widget/numbereditor/numbereditor.ts b/packages/fineui/typescript/widget/numbereditor/numbereditor.ts similarity index 100% rename from typescript/widget/numbereditor/numbereditor.ts rename to packages/fineui/typescript/widget/numbereditor/numbereditor.ts diff --git a/typescript/widget/numberinterval/numberinterval.ts b/packages/fineui/typescript/widget/numberinterval/numberinterval.ts similarity index 100% rename from typescript/widget/numberinterval/numberinterval.ts rename to packages/fineui/typescript/widget/numberinterval/numberinterval.ts diff --git a/typescript/widget/selecttree/selecttree.expander.ts b/packages/fineui/typescript/widget/selecttree/selecttree.expander.ts similarity index 100% rename from typescript/widget/selecttree/selecttree.expander.ts rename to packages/fineui/typescript/widget/selecttree/selecttree.expander.ts diff --git a/typescript/widget/singleselect/singleselect.combo.ts b/packages/fineui/typescript/widget/singleselect/singleselect.combo.ts similarity index 100% rename from typescript/widget/singleselect/singleselect.combo.ts rename to packages/fineui/typescript/widget/singleselect/singleselect.combo.ts diff --git a/typescript/widget/singleselect/singleselect.insert.combo.ts b/packages/fineui/typescript/widget/singleselect/singleselect.insert.combo.ts similarity index 100% rename from typescript/widget/singleselect/singleselect.insert.combo.ts rename to packages/fineui/typescript/widget/singleselect/singleselect.insert.combo.ts diff --git a/typescript/widget/singleselect/singleselectlist.insert.ts b/packages/fineui/typescript/widget/singleselect/singleselectlist.insert.ts similarity index 100% rename from typescript/widget/singleselect/singleselectlist.insert.ts rename to packages/fineui/typescript/widget/singleselect/singleselectlist.insert.ts diff --git a/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts b/packages/fineui/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts similarity index 100% rename from typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts rename to packages/fineui/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts diff --git a/typescript/widget/time/time.combo.ts b/packages/fineui/typescript/widget/time/time.combo.ts similarity index 100% rename from typescript/widget/time/time.combo.ts rename to packages/fineui/typescript/widget/time/time.combo.ts diff --git a/typescript/widget/timeinterval/dateinterval.ts b/packages/fineui/typescript/widget/timeinterval/dateinterval.ts similarity index 100% rename from typescript/widget/timeinterval/dateinterval.ts rename to packages/fineui/typescript/widget/timeinterval/dateinterval.ts diff --git a/typescript/widget/timeinterval/timeinterval.ts b/packages/fineui/typescript/widget/timeinterval/timeinterval.ts similarity index 100% rename from typescript/widget/timeinterval/timeinterval.ts rename to packages/fineui/typescript/widget/timeinterval/timeinterval.ts diff --git a/typescript/widget/year/combo.year.ts b/packages/fineui/typescript/widget/year/combo.year.ts similarity index 100% rename from typescript/widget/year/combo.year.ts rename to packages/fineui/typescript/widget/year/combo.year.ts diff --git a/typescript/widget/year/popup.year.ts b/packages/fineui/typescript/widget/year/popup.year.ts similarity index 100% rename from typescript/widget/year/popup.year.ts rename to packages/fineui/typescript/widget/year/popup.year.ts diff --git a/typescript/widget/yearmonth/combo.yearmonth.ts b/packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts similarity index 100% rename from typescript/widget/yearmonth/combo.yearmonth.ts rename to packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts diff --git a/typescript/widget/yearmonth/popup.yearmonth.ts b/packages/fineui/typescript/widget/yearmonth/popup.yearmonth.ts similarity index 100% rename from typescript/widget/yearmonth/popup.yearmonth.ts rename to packages/fineui/typescript/widget/yearmonth/popup.yearmonth.ts diff --git a/typescript/widget/yearmonthinterval/yearmonthinterval.ts b/packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts similarity index 100% rename from typescript/widget/yearmonthinterval/yearmonthinterval.ts rename to packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts diff --git a/typescript/widget/yearquarter/combo.yearquarter.ts b/packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts similarity index 100% rename from typescript/widget/yearquarter/combo.yearquarter.ts rename to packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts diff --git a/packages/fineui/webpack.prod.js b/packages/fineui/webpack.prod.js new file mode 100644 index 000000000..074fea17a --- /dev/null +++ b/packages/fineui/webpack.prod.js @@ -0,0 +1,77 @@ +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const path = require('path'); + +module.exports = { + mode: 'production', + entry: './src/index.js', + devServer: { + port: 3000, + liveReload: true, + }, + devtool: 'hidden-source-map', + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + }, + }, + { + test: /\.(css|less)$/, + use: [ + MiniCssExtractPlugin.loader, + { + loader: 'css-loader', + options: { + url: false, + }, + }, + { + loader: 'postcss-loader', + options: { + plugins: [autoprefixer], + }, + }, + { + loader: 'less-loader', + options: { + relativeUrls: false, + modifyVars: lessVariables, + }, + }, + ], + }, + ], + }, + resolve: { + extensions: ['.js', '.ts'], + alias: { + '@': path.resolve(__dirname, '../src'), + }, + }, + plugins: [ + new MiniCssExtractPlugin({ + path: dirs.DEST, + filename: '[name].css', + }), + new ForkTsCheckerWebpackPlugin({}), + new OptimizeCssAssetsPlugin({ + assetNameRegExp: /\.css$/g, + cssProcessor: require('cssnano'), + cssProcessorPluginOptions: { + preset: [ + 'default', + { + discardComments: { + removeAll: true, + }, + normalizeUnicode: false, + }, + ], + }, + canPrint: true, + }), + ], +}; diff --git a/plugins/webpack-fui-worker-plugin/constants.js b/plugins/webpack-fui-worker-plugin/constants.js deleted file mode 100644 index 7b80ac3dc..000000000 --- a/plugins/webpack-fui-worker-plugin/constants.js +++ /dev/null @@ -1,9 +0,0 @@ -const WorkerPluginName = 'FuiWorkerPlugin'; -const WorkerLoaderName = 'FuiWorkerWorkerLoader'; -const FileNamePrefix = 'worker-'; - -module.exports = { - WorkerPluginName, - WorkerLoaderName, - FileNamePrefix, -}; diff --git a/plugins/webpack-fui-worker-plugin/index.js b/plugins/webpack-fui-worker-plugin/index.js deleted file mode 100644 index 2fa9b3ed0..000000000 --- a/plugins/webpack-fui-worker-plugin/index.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * worker-plugin - */ - -const path = require('path'); -const webpack = require('webpack'); -const { WorkerPluginName } = require('./constants'); -const ModuleFilenameHelpers = require('webpack/lib/ModuleFilenameHelpers'); - -class FuiWorkerPlugin { - constructor(options = {}) { - this.options = options; - } - - apply(compiler) { - // 为主线程构建添加 __WORKER__ 环境变量, 构建中区分不同线程源码, 实现代码拆减 - compiler.hooks.afterPlugins.tap(WorkerPluginName, compiler => { - new webpack.DefinePlugin({ - // __WORKER__ 表示当前所在线程是否是 worker 线程 - // 主线程构建中为 false - __WORKER__: false, - }).apply(compiler); - }); - - // 添加自定义的worker entry-loader - compiler.hooks.afterResolvers.tap(WorkerPluginName, compiler => { - /** - * https://webpack.js.org/configuration/resolve/#resolveloader - * 使用 resolveloader 添加自定义的 worker loader - */ - if (!compiler.options.resolveLoader) { - compiler.options.resolveLoader = { - alias: {}, - }; - } - if (!compiler.options.resolveLoader.alias) { - compiler.options.resolveLoader.alias = {}; - } - - // 动态添加 worker 的 worker-loader, 命名为 "fui-worker" - compiler.options.resolveLoader.alias['fui-worker'] = path.resolve(__dirname, './worker-loader.js'); - }); - - // 将FuiWorkerPlugin的参数传递给fui-worker loader - compiler.hooks.compilation.tap(WorkerPluginName, compilation => { - compilation.hooks.normalModuleLoader.tap(WorkerPluginName, (context, module) => { - // 仅提供给fui-worker - const fuiLoader = module.loaders.find(loader => loader.loader.indexOf('fui-worker') !== -1); - - if (fuiLoader) { - const resource = module.resource; - - if (!resource) return; - - // fui-worker通过options读取 - context.options = context.options || {}; - - const index = resource.indexOf('?'); - - if (ModuleFilenameHelpers.matchObject( - this.options, - index < 0 ? resource : resource.substr(0, index) - )) { - for (const key of Object.keys(this.options)) { - // 忽略关键属性 - if (key === "include" || key === "exclude" || key === "test") { - continue; - } - - context.options[key] = this.options[key]; - } - } - } - }) - }) - } -} - -module.exports = FuiWorkerPlugin; diff --git a/plugins/webpack-fui-worker-plugin/worker-loader.js b/plugins/webpack-fui-worker-plugin/worker-loader.js deleted file mode 100644 index d07756e01..000000000 --- a/plugins/webpack-fui-worker-plugin/worker-loader.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * fui-worker worker-loader - */ - -const webpack = require('webpack'); -const loaderUtils = require('loader-utils'); -const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin'); -const { WorkerLoaderName, FileNamePrefix } = require('./constants'); -const { resolve } = require('path'); - -// 正常 loader 处理逻辑 -function loader() { - const callback = this.async(); - this.cacheable(false); - - // 过滤掉当前的 worker-loader, 保留 worker 侧构建需要的其他 loader(babel-loader/ts-loader 等) - const otherLoaders = this.loaders.filter((loader, index) => { - if (index === this.loaderIndex) { - return false; - } - - return true; - }); - /** - * 拼接构建需要的 loader 字符串, 用于指定 childCompiler 的构建 loader - * 比如: /path/to/babel-loader/lib/index.js!/path/to/ts-loader/index.js! - */ - const loaderPath = otherLoaders.reduce((pre, loader) => `${pre}${loader.path}!`, ''); - - /** - * worker 独立构建的 entry - * 构建 loader + worker 源码入口文件路径 - * - * https://webpack.js.org/concepts/loaders/#inline - * `!!` 实现在 childCompiler 中忽略其他所有 loader, 只保留主构建的 loader - * 不然 worker 入口在 childCompiler 中会继续由 worker-loader 处理, 造成死循环 - */ - const workerEntry = `!!${loaderPath}${this.resourcePath}`; - - // 把资源纳入构建流程的依赖, 实现 dev 模式下的 watch - this.addDependency(workerEntry); - - // 生成的 service 独立 bundle 名称 - const entryFileName = `${FileNamePrefix}index`; - - // 获取传递给 loader 的 options - const options = Object.assign(loaderUtils.getOptions(this) || {}, this.options); - - // 创建 childCompiler, 用于实现 worker 构建为独立 js 资源 - const childCompiler = this._compilation.createChildCompiler(WorkerLoaderName, { - globalObject: 'this', - }); - childCompiler.context = this._compiler.context; - - // 指定独立构建的 entry 和生成 js 资源名称 - new SingleEntryPlugin(this.context, workerEntry, entryFileName).apply(childCompiler); - - // 设置 worker 侧的环境变量 - new webpack.DefinePlugin({ - __WORKER__: true, - }).apply(childCompiler); - - // 添加 window 全局对象, 映射为 worker 线程全局对象 self - // 如果在 worker 源码中添加, 可能没有前置到所有引用模块前 - new webpack.BannerPlugin({ - banner: 'self.window = self;', - raw: true, - entryOnly: true, - }).apply(childCompiler); - - // 去除源码中的less css引用 - const regExp = /\.(css|less)$/; - - new webpack.NormalModuleReplacementPlugin( - regExp, - result => { - if (regExp.test(result.request)) { - result.request = resolve(__dirname, './empty.js'); - } - - if (regExp.test(result.resource)) { - result.resource = resolve(__dirname, './empty.js'); - } - }, - ).apply(childCompiler); - - const subCache = `subcache ${__dirname} ${workerEntry}`; - childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => { - if (compilation.cache) { - if (!compilation.cache[subCache]) compilation.cache[subCache] = {}; - compilation.cache = compilation.cache[subCache]; - } - }); - - childCompiler.runAsChild((error, entries, compilation) => { - if (!error && compilation.errors && compilation.errors.length) { - // eslint-disable-next-line no-param-reassign - error = compilation.errors[0]; - } - - // compatible with Array (v4) and Set (v5) prototypes - const entry = entries && entries[0] && entries[0].files.values().next().value; - if (!error && !entry) { - // eslint-disable-next-line no-param-reassign - error = Error(`${WorkerLoaderName}, no entry for ${workerEntry}`); - } - - if (error) { - return callback(error); - } - - // 支持blob url形式 - return options.inline - ? callback( - null, - // 插入代码的转译和压缩由主构建配置的 babel/ts loader 处理, 不需要 worker-worker 来处理 - // 添加 @ts-nocheck 避免 ts-check 报错 - // 修复export const 下 const不会被转译的问题 - // safari浏览器下blob需指定type - `// @ts-nocheck - export default window.URL.createObjectURL(new Blob([${JSON.stringify(compilation.assets[entry].source())}], { type: 'text/javascript' })); - ` - ) - : callback( - null, - `// @ts-nocheck - export default __webpack_public_path__ + ${JSON.stringify(entry)}; - ` - ) - }); - - return; -} - -module.exports = loader; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 000000000..f6bd75b75 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,5045 @@ +lockfileVersion: 5.4 + +importers: + + .: + specifiers: + '@babel/cli': ^7.21.0 + '@babel/core': ^7.21.0 + '@babel/runtime': ^7.21.0 + '@fui/babel-preset-fineui': ^3.0.1 + babel-loader: ^9.1.2 + babel-plugin-module-resolver: ^5.0.0 + css-loader: ^6.7.3 + html-webpack-plugin: ^5.5.0 + less: ^4.1.3 + less-loader: ^11.1.0 + npm-run-all: ^4.1.5 + style-loader: ^3.3.1 + typescript: ^4.9.5 + webpack: ^5.75.0 + webpack-bundle-analyzer: ^4.8.0 + webpack-cli: ^5.0.1 + webpack-dev-server: ^4.11.1 + devDependencies: + '@babel/cli': 7.21.0_@babel+core@7.21.0 + '@babel/core': 7.21.0 + '@babel/runtime': 7.21.0 + '@fui/babel-preset-fineui': 3.0.1_wrscgf77uttxqznv3myecs4fba + babel-loader: 9.1.2_tkx7iv5lytdmlhrwm4n6r336ei + babel-plugin-module-resolver: 5.0.0 + css-loader: 6.7.3_webpack@5.76.0 + html-webpack-plugin: 5.5.0_webpack@5.76.0 + less: 4.1.3 + less-loader: 11.1.0_less@4.1.3+webpack@5.76.0 + npm-run-all: 4.1.5 + style-loader: 3.3.1_webpack@5.76.0 + typescript: 4.9.5 + webpack: 5.76.0_webpack-cli@5.0.1 + webpack-bundle-analyzer: 4.8.0 + webpack-cli: 5.0.1_jkfmkh54fty5hi5ax7xfrvyyji + webpack-dev-server: 4.11.1_66fuqojgvlon52mqukkfkspvqe + + packages/demo: + specifiers: + '@fui/core': workspace:^2.0.20230208163847 + dependencies: + '@fui/core': link:../fineui + + packages/fineui: + specifiers: + '@babel/core': ^7.21.0 + '@juggle/resize-observer': ^3.4.0 + '@popperjs/core': 2.11.6 + '@types/yargs': 17.0.13 + jquery: 3.6.3 + yargs: 17.6.2 + dependencies: + '@babel/core': 7.21.0 + '@juggle/resize-observer': 3.4.0 + '@popperjs/core': 2.11.6 + '@types/yargs': 17.0.13 + jquery: 3.6.3 + yargs: 17.6.2 + +packages: + + /@ampproject/remapping/2.2.0: + resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.1.1 + '@jridgewell/trace-mapping': 0.3.17 + + /@babel/cli/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-xi7CxyS8XjSyiwUGCfwf+brtJxjW1/ZTcBUkP10xawIEXLX5HzLn+3aXkgxozcP2UhRhtKTmQurw9Uaes7jZrA==} + engines: {node: '>=6.9.0'} + hasBin: true + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@jridgewell/trace-mapping': 0.3.17 + commander: 4.1.1 + convert-source-map: 1.9.0 + fs-readdir-recursive: 1.1.0 + glob: 7.2.3 + make-dir: 2.1.0 + slash: 2.0.0 + optionalDependencies: + '@nicolo-ribaudo/chokidar-2': 2.1.8-no-fsevents.3 + chokidar: 3.5.3 + dev: true + + /@babel/code-frame/7.18.6: + resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.18.6 + + /@babel/compat-data/7.21.0: + resolution: {integrity: sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==} + engines: {node: '>=6.9.0'} + + /@babel/core/7.21.0: + resolution: {integrity: sha512-PuxUbxcW6ZYe656yL3EAhpy7qXKq0DmYsrJLpbB8XrsCP9Nm+XCg9XFMb5vIDliPD7+U/+M+QJlH17XOcB7eXA==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.0 + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.21.1 + '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.0 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helpers': 7.21.0 + '@babel/parser': 7.21.2 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.2 + '@babel/types': 7.21.2 + convert-source-map: 1.9.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + + /@babel/generator/7.21.1: + resolution: {integrity: sha512-1lT45bAYlQhFn/BHivJs43AiW2rg3/UbLyShGfF3C0KmHvO5fSghWd5kBJy30kpRRucGzXStvnnCFniCR2kXAA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + '@jridgewell/gen-mapping': 0.3.2 + '@jridgewell/trace-mapping': 0.3.17 + jsesc: 2.5.2 + + /@babel/helper-annotate-as-pure/7.18.6: + resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + dev: true + + /@babel/helper-builder-binary-assignment-operator-visitor/7.18.9: + resolution: {integrity: sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-explode-assignable-expression': 7.18.6 + '@babel/types': 7.21.2 + dev: true + + /@babel/helper-compilation-targets/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.21.0 + '@babel/core': 7.21.0 + '@babel/helper-validator-option': 7.21.0 + browserslist: 4.21.5 + lru-cache: 5.1.1 + semver: 6.3.0 + + /@babel/helper-create-class-features-plugin/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-Q8wNiMIdwsv5la5SPxNYzzkPnjgC0Sy0i7jLkVOCdllu/xcVNkr3TeZzbHBJrj+XXRqzX5uCyCoV9eu6xUG7KQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.21.0 + '@babel/helper-member-expression-to-functions': 7.21.0 + '@babel/helper-optimise-call-expression': 7.18.6 + '@babel/helper-replace-supers': 7.20.7 + '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 + '@babel/helper-split-export-declaration': 7.18.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-create-regexp-features-plugin/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-N+LaFW/auRSWdx7SHD/HiARwXQju1vXTW4fKr4u5SgBUTm51OKEjKgj+cs00ggW3kEvNqwErnlwuq7Y3xBe4eg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-annotate-as-pure': 7.18.6 + regexpu-core: 5.3.1 + dev: true + + /@babel/helper-define-map/7.18.6: + resolution: {integrity: sha512-XSOjXUDG7KODvtURN1p29hGHa4RFgqBQELuBowUOBt3alf2Ny/oNFJygS4yCXwM0vMoqLDjE1O7wSmocUmQ3Kg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-function-name': 7.21.0 + '@babel/types': 7.21.2 + dev: true + + /@babel/helper-define-polyfill-provider/0.3.3_@babel+core@7.21.0: + resolution: {integrity: sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==} + peerDependencies: + '@babel/core': ^7.4.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + debug: 4.3.4 + lodash.debounce: 4.0.8 + resolve: 1.22.1 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-environment-visitor/7.18.9: + resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} + engines: {node: '>=6.9.0'} + + /@babel/helper-explode-assignable-expression/7.18.6: + resolution: {integrity: sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + dev: true + + /@babel/helper-function-name/7.21.0: + resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.20.7 + '@babel/types': 7.21.2 + + /@babel/helper-hoist-variables/7.18.6: + resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + + /@babel/helper-member-expression-to-functions/7.21.0: + resolution: {integrity: sha512-Muu8cdZwNN6mRRNG6lAYErJ5X3bRevgYR2O8wN0yn7jJSnGDu6eG59RfT29JHxGUovyfrh6Pj0XzmR7drNVL3Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + dev: true + + /@babel/helper-module-imports/7.18.6: + resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + + /@babel/helper-module-transforms/7.21.2: + resolution: {integrity: sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-simple-access': 7.20.2 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.2 + '@babel/types': 7.21.2 + transitivePeerDependencies: + - supports-color + + /@babel/helper-optimise-call-expression/7.18.6: + resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + dev: true + + /@babel/helper-plugin-utils/7.20.2: + resolution: {integrity: sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-remap-async-to-generator/7.18.9_@babel+core@7.21.0: + resolution: {integrity: sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-wrap-function': 7.20.5 + '@babel/types': 7.21.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-replace-supers/7.20.7: + resolution: {integrity: sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-member-expression-to-functions': 7.21.0 + '@babel/helper-optimise-call-expression': 7.18.6 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.2 + '@babel/types': 7.21.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-simple-access/7.20.2: + resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + + /@babel/helper-skip-transparent-expression-wrappers/7.20.0: + resolution: {integrity: sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + dev: true + + /@babel/helper-split-export-declaration/7.18.6: + resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.2 + + /@babel/helper-string-parser/7.19.4: + resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} + engines: {node: '>=6.9.0'} + + /@babel/helper-validator-identifier/7.19.1: + resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + engines: {node: '>=6.9.0'} + + /@babel/helper-validator-option/7.21.0: + resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} + engines: {node: '>=6.9.0'} + + /@babel/helper-wrap-function/7.20.5: + resolution: {integrity: sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-function-name': 7.21.0 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.2 + '@babel/types': 7.21.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helpers/7.21.0: + resolution: {integrity: sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.2 + '@babel/types': 7.21.2 + transitivePeerDependencies: + - supports-color + + /@babel/highlight/7.18.6: + resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.19.1 + chalk: 2.4.2 + js-tokens: 4.0.0 + + /@babel/parser/7.21.2: + resolution: {integrity: sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.21.2 + + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.13.0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 + '@babel/plugin-proposal-optional-chaining': 7.21.0_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-async-generator-functions/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-remap-async-to-generator': 7.18.9_@babel+core@7.21.0 + '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-class-properties/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-class-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-class-properties/7.5.0_@babel+core@7.21.0: + resolution: {integrity: sha512-9L/JfPCT+kShiiTTzcnBJ8cOwdKVmlC1RcCf9F0F9tERVrM4iWtWnXtjWCRqNm2la2BxO1MPArWNsU9zsSJWSQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-class-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-class-static-block/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.12.0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-class-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-class-static-block': 7.14.5_@babel+core@7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-decorators/7.4.4_@babel+core@7.21.0: + resolution: {integrity: sha512-z7MpQz3XC/iQJWXH9y+MaWcLPNSMY9RQSthrLzak8R8hCj0fuyNk+Dzi9kfNe/JxxlWQ2g7wkABbgWjW36MTcw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-class-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-decorators': 7.21.0_@babel+core@7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-dynamic-import/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-export-namespace-from/7.18.9_@babel+core@7.21.0: + resolution: {integrity: sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-export-namespace-from': 7.8.3_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-json-strings/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-logical-assignment-operators/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-nullish-coalescing-operator/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-numeric-separator/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-object-rest-spread/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.21.0 + '@babel/core': 7.21.0 + '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.21.0 + '@babel/plugin-transform-parameters': 7.20.7_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-optional-catch-binding/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-optional-chaining/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 + '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.21.0 + dev: true + + /@babel/plugin-proposal-private-methods/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-class-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-private-property-in-object/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-create-class-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-private-property-in-object': 7.14.5_@babel+core@7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-unicode-property-regex/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==} + engines: {node: '>=4'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-regexp-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.21.0: + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.21.0: + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-class-static-block/7.14.5_@babel+core@7.21.0: + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-decorators/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-tIoPpGBR8UuM4++ccWN3gifhVvQu7ZizuR1fklhRJrd5ewgbkUS+0KVFeWWxELtn18NTLoW32XV7zyOgIAiz+w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-dynamic-import/7.8.3_@babel+core@7.21.0: + resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-export-namespace-from/7.8.3_@babel+core@7.21.0: + resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.21.0: + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.21.0: + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.21.0: + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.21.0: + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.21.0: + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.21.0: + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.21.0: + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-private-property-in-object/7.14.5_@babel+core@7.21.0: + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.21.0: + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-typescript/7.20.0_@babel+core@7.21.0: + resolution: {integrity: sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-arrow-functions/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-async-to-generator/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-remap-async-to-generator': 7.18.9_@babel+core@7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-block-scoped-functions/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-block-scoping/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-classes/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.0 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.21.0 + '@babel/helper-optimise-call-expression': 7.18.6 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-replace-supers': 7.20.7 + '@babel/helper-split-export-declaration': 7.18.6 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-classes/7.5.5_@babel+core@7.21.0: + resolution: {integrity: sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-define-map': 7.18.6 + '@babel/helper-function-name': 7.21.0 + '@babel/helper-optimise-call-expression': 7.18.6 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-replace-supers': 7.20.7 + '@babel/helper-split-export-declaration': 7.18.6 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-computed-properties/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/template': 7.20.7 + dev: true + + /@babel/plugin-transform-destructuring/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-Xwg403sRrZb81IVB79ZPqNQME23yhugYVqgTxAhT99h485F4f+GMELFhhOsscDUB7HCswepKeCKLn/GZvUKoBA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-dotall-regex/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-regexp-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-duplicate-keys/7.18.9_@babel+core@7.21.0: + resolution: {integrity: sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-exponentiation-operator/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.18.9 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-for-of/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-LlUYlydgDkKpIY7mcBWvyPPmMcOphEyYA27Ef4xpbh1IiDNLr0kZsos2nf92vz3IccvJI25QUwp86Eo5s6HmBQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-function-name/7.18.9_@babel+core@7.21.0: + resolution: {integrity: sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.0 + '@babel/helper-function-name': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-literals/7.18.9_@babel+core@7.21.0: + resolution: {integrity: sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-member-expression-literals/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-modules-amd/7.20.11_@babel+core@7.21.0: + resolution: {integrity: sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helper-plugin-utils': 7.20.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-modules-commonjs/7.21.2_@babel+core@7.21.0: + resolution: {integrity: sha512-Cln+Yy04Gxua7iPdj6nOV96smLGjpElir5YwzF0LBPKoPlLDNJePNlrGGaybAJkd0zKRnOVXOgizSqPYMNYkzA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-simple-access': 7.20.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-modules-commonjs/7.6.0_@babel+core@7.21.0: + resolution: {integrity: sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-simple-access': 7.20.2 + babel-plugin-dynamic-import-node: 2.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-modules-systemjs/7.20.11_@babel+core@7.21.0: + resolution: {integrity: sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-validator-identifier': 7.19.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-modules-umd/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helper-plugin-utils': 7.20.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-named-capturing-groups-regex/7.20.5_@babel+core@7.21.0: + resolution: {integrity: sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-regexp-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-new-target/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-object-super/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-replace-supers': 7.20.7 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-parameters/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-property-literals/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-proto-to-assign/7.5.5_@babel+core@7.21.0: + resolution: {integrity: sha512-1vlFiFiIfKXBVm2SJtPr65x7NUAv4Sa3qhBbH4TnSXaUTDQnOSf+W8vNq3BNliaI28kwT8aD3rMTTsEryJpDZw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + lodash: 4.17.21 + dev: true + + /@babel/plugin-transform-react-display-name/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-TV4sQ+T013n61uMoygyMRm+xf04Bd5oqFpv2jAEQwSZ8NwQA7zeRPg1LMVg2PWi3zWBz+CLKD+v5bcpZ/BS0aA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-react-jsx-development/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/plugin-transform-react-jsx': 7.21.0_@babel+core@7.21.0 + dev: true + + /@babel/plugin-transform-react-jsx/7.13.12_@babel+core@7.21.0: + resolution: {integrity: sha512-jcEI2UqIcpCqB5U5DRxIl0tQEProI2gcu+g8VTIqxLO5Iidojb4d77q+fwGseCvd8af/lJ9masp4QWzBXFE2xA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.21.0 + '@babel/types': 7.21.2 + dev: true + + /@babel/plugin-transform-react-jsx/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-6OAWljMvQrZjR2DaNhVfRz6dkCAVV+ymcLUmaf8bccGOHn2v5rHJK3tTpij0BuhdYWP4LLaqj5lwcdlpAAPuvg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.21.0 + '@babel/types': 7.21.2 + dev: true + + /@babel/plugin-transform-react-pure-annotations/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-regenerator/7.20.5_@babel+core@7.21.0: + resolution: {integrity: sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + regenerator-transform: 0.15.1 + dev: true + + /@babel/plugin-transform-reserved-words/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-runtime/7.19.6_@babel+core@7.21.0: + resolution: {integrity: sha512-PRH37lz4JU156lYFW1p8OxE5i7d6Sl/zV58ooyr+q1J1lnQPyg5tIiXlIwNVhJaY4W3TmOtdc8jqdXQcB1v5Yw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-plugin-utils': 7.20.2 + babel-plugin-polyfill-corejs2: 0.3.3_@babel+core@7.21.0 + babel-plugin-polyfill-corejs3: 0.6.0_@babel+core@7.21.0 + babel-plugin-polyfill-regenerator: 0.4.1_@babel+core@7.21.0 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-shorthand-properties/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-spread/7.20.7_@babel+core@7.21.0: + resolution: {integrity: sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 + dev: true + + /@babel/plugin-transform-sticky-regex/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-template-literals/7.18.9_@babel+core@7.21.0: + resolution: {integrity: sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-typeof-symbol/7.18.9_@babel+core@7.21.0: + resolution: {integrity: sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-typescript/7.21.0_@babel+core@7.21.0: + resolution: {integrity: sha512-xo///XTPp3mDzTtrqXoBlK9eiAYW3wv9JXglcn/u1bi60RW11dEUxIgA8cbnDhutS1zacjMRmAwxE0gMklLnZg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-class-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-unicode-escapes/7.18.10_@babel+core@7.21.0: + resolution: {integrity: sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-transform-unicode-regex/7.18.6_@babel+core@7.21.0: + resolution: {integrity: sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-create-regexp-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/preset-env/7.16.11_@babel+core@7.21.0: + resolution: {integrity: sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.21.0 + '@babel/core': 7.21.0 + '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-validator-option': 7.21.0 + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-proposal-async-generator-functions': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-proposal-class-static-block': 7.21.0_@babel+core@7.21.0 + '@babel/plugin-proposal-dynamic-import': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-proposal-export-namespace-from': 7.18.9_@babel+core@7.21.0 + '@babel/plugin-proposal-json-strings': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-proposal-logical-assignment-operators': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-proposal-numeric-separator': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-proposal-object-rest-spread': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-proposal-optional-catch-binding': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-proposal-optional-chaining': 7.21.0_@babel+core@7.21.0 + '@babel/plugin-proposal-private-methods': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-proposal-private-property-in-object': 7.21.0_@babel+core@7.21.0 + '@babel/plugin-proposal-unicode-property-regex': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.21.0 + '@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.21.0 + '@babel/plugin-syntax-class-static-block': 7.14.5_@babel+core@7.21.0 + '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.21.0 + '@babel/plugin-syntax-export-namespace-from': 7.8.3_@babel+core@7.21.0 + '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.21.0 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.21.0 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.21.0 + '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.21.0 + '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.21.0 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.21.0 + '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.21.0 + '@babel/plugin-syntax-private-property-in-object': 7.14.5_@babel+core@7.21.0 + '@babel/plugin-syntax-top-level-await': 7.14.5_@babel+core@7.21.0 + '@babel/plugin-transform-arrow-functions': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-transform-async-to-generator': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-transform-block-scoped-functions': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-block-scoping': 7.21.0_@babel+core@7.21.0 + '@babel/plugin-transform-classes': 7.21.0_@babel+core@7.21.0 + '@babel/plugin-transform-computed-properties': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-transform-destructuring': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-transform-dotall-regex': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-duplicate-keys': 7.18.9_@babel+core@7.21.0 + '@babel/plugin-transform-exponentiation-operator': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-for-of': 7.21.0_@babel+core@7.21.0 + '@babel/plugin-transform-function-name': 7.18.9_@babel+core@7.21.0 + '@babel/plugin-transform-literals': 7.18.9_@babel+core@7.21.0 + '@babel/plugin-transform-member-expression-literals': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-modules-amd': 7.20.11_@babel+core@7.21.0 + '@babel/plugin-transform-modules-commonjs': 7.21.2_@babel+core@7.21.0 + '@babel/plugin-transform-modules-systemjs': 7.20.11_@babel+core@7.21.0 + '@babel/plugin-transform-modules-umd': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-named-capturing-groups-regex': 7.20.5_@babel+core@7.21.0 + '@babel/plugin-transform-new-target': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-object-super': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-parameters': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-transform-property-literals': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-regenerator': 7.20.5_@babel+core@7.21.0 + '@babel/plugin-transform-reserved-words': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-shorthand-properties': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-spread': 7.20.7_@babel+core@7.21.0 + '@babel/plugin-transform-sticky-regex': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-template-literals': 7.18.9_@babel+core@7.21.0 + '@babel/plugin-transform-typeof-symbol': 7.18.9_@babel+core@7.21.0 + '@babel/plugin-transform-unicode-escapes': 7.18.10_@babel+core@7.21.0 + '@babel/plugin-transform-unicode-regex': 7.18.6_@babel+core@7.21.0 + '@babel/preset-modules': 0.1.5_@babel+core@7.21.0 + '@babel/types': 7.21.2 + babel-plugin-polyfill-corejs2: 0.3.3_@babel+core@7.21.0 + babel-plugin-polyfill-corejs3: 0.5.3_@babel+core@7.21.0 + babel-plugin-polyfill-regenerator: 0.3.1_@babel+core@7.21.0 + core-js-compat: 3.29.0 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/preset-modules/0.1.5_@babel+core@7.21.0: + resolution: {integrity: sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-proposal-unicode-property-regex': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-dotall-regex': 7.18.6_@babel+core@7.21.0 + '@babel/types': 7.21.2 + esutils: 2.0.3 + dev: true + + /@babel/preset-react/7.13.13_@babel+core@7.21.0: + resolution: {integrity: sha512-gx+tDLIE06sRjKJkVtpZ/t3mzCDOnPG+ggHZG9lffUbX8+wC739x20YQc9V35Do6ZAxaUc/HhVHIiOzz5MvDmA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-validator-option': 7.21.0 + '@babel/plugin-transform-react-display-name': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-react-jsx': 7.13.12_@babel+core@7.21.0 + '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.21.0 + '@babel/plugin-transform-react-pure-annotations': 7.18.6_@babel+core@7.21.0 + dev: true + + /@babel/preset-typescript/7.3.3_@babel+core@7.21.0: + resolution: {integrity: sha512-mzMVuIP4lqtn4du2ynEfdO0+RYcslwrZiJHXu4MGaC1ctJiW2fyaeDrtjJGs7R/KebZ1sgowcIoWf4uRpEfKEg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/plugin-transform-typescript': 7.21.0_@babel+core@7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/regjsgen/0.8.0: + resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} + dev: true + + /@babel/runtime/7.21.0: + resolution: {integrity: sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.13.11 + dev: true + + /@babel/template/7.20.7: + resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/parser': 7.21.2 + '@babel/types': 7.21.2 + + /@babel/traverse/7.21.2: + resolution: {integrity: sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.21.1 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.21.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.21.2 + '@babel/types': 7.21.2 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + /@babel/types/7.21.2: + resolution: {integrity: sha512-3wRZSs7jiFaB8AjxiiD+VqN5DTG2iRvJGQ+qYFrs/654lg6kGTQWIOFjlBo5RaXuAZjBmP3+OQH4dmhqiiyYxw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + + /@discoveryjs/json-ext/0.5.7: + resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} + engines: {node: '>=10.0.0'} + dev: true + + /@fui/babel-preset-fineui/3.0.1_wrscgf77uttxqznv3myecs4fba: + resolution: {integrity: sha512-gEb/w9UhdDQdIJ5WYPuekj4D/a1Y4bqD0XEMpfJEfceeOqXvzFaXL+GAa7N9YFkVz1QWq5eURxTRw/QA8M9ICQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/runtime': ^7.20.1 + dependencies: + '@babel/core': 7.21.0 + '@babel/plugin-proposal-class-properties': 7.5.0_@babel+core@7.21.0 + '@babel/plugin-proposal-decorators': 7.4.4_@babel+core@7.21.0 + '@babel/plugin-transform-classes': 7.5.5_@babel+core@7.21.0 + '@babel/plugin-transform-modules-commonjs': 7.6.0_@babel+core@7.21.0 + '@babel/plugin-transform-proto-to-assign': 7.5.5_@babel+core@7.21.0 + '@babel/plugin-transform-react-jsx': 7.13.12_@babel+core@7.21.0 + '@babel/plugin-transform-runtime': 7.19.6_@babel+core@7.21.0 + '@babel/preset-env': 7.16.11_@babel+core@7.21.0 + '@babel/preset-react': 7.13.13_@babel+core@7.21.0 + '@babel/preset-typescript': 7.3.3_@babel+core@7.21.0 + '@babel/runtime': 7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@jridgewell/gen-mapping/0.1.1: + resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + + /@jridgewell/gen-mapping/0.3.2: + resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/trace-mapping': 0.3.17 + + /@jridgewell/resolve-uri/3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + engines: {node: '>=6.0.0'} + + /@jridgewell/set-array/1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + + /@jridgewell/source-map/0.3.2: + resolution: {integrity: sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==} + dependencies: + '@jridgewell/gen-mapping': 0.3.2 + '@jridgewell/trace-mapping': 0.3.17 + dev: true + + /@jridgewell/sourcemap-codec/1.4.14: + resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + + /@jridgewell/trace-mapping/0.3.17: + resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + + /@juggle/resize-observer/3.4.0: + resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} + dev: false + + /@leichtgewicht/ip-codec/2.0.4: + resolution: {integrity: sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==} + dev: true + + /@nicolo-ribaudo/chokidar-2/2.1.8-no-fsevents.3: + resolution: {integrity: sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==} + requiresBuild: true + dev: true + optional: true + + /@polka/url/1.0.0-next.21: + resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} + dev: true + + /@popperjs/core/2.11.6: + resolution: {integrity: sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==} + dev: false + + /@types/body-parser/1.19.2: + resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} + dependencies: + '@types/connect': 3.4.35 + '@types/node': 18.15.0 + dev: true + + /@types/bonjour/3.5.10: + resolution: {integrity: sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==} + dependencies: + '@types/node': 18.15.0 + dev: true + + /@types/connect-history-api-fallback/1.3.5: + resolution: {integrity: sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==} + dependencies: + '@types/express-serve-static-core': 4.17.33 + '@types/node': 18.15.0 + dev: true + + /@types/connect/3.4.35: + resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} + dependencies: + '@types/node': 18.15.0 + dev: true + + /@types/eslint-scope/3.7.4: + resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} + dependencies: + '@types/eslint': 8.21.1 + '@types/estree': 0.0.51 + dev: true + + /@types/eslint/8.21.1: + resolution: {integrity: sha512-rc9K8ZpVjNcLs8Fp0dkozd5Pt2Apk1glO4Vgz8ix1u6yFByxfqo5Yavpy65o+93TAe24jr7v+eSBtFLvOQtCRQ==} + dependencies: + '@types/estree': 0.0.51 + '@types/json-schema': 7.0.11 + dev: true + + /@types/estree/0.0.51: + resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==} + dev: true + + /@types/express-serve-static-core/4.17.33: + resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} + dependencies: + '@types/node': 18.15.0 + '@types/qs': 6.9.7 + '@types/range-parser': 1.2.4 + dev: true + + /@types/express/4.17.17: + resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==} + dependencies: + '@types/body-parser': 1.19.2 + '@types/express-serve-static-core': 4.17.33 + '@types/qs': 6.9.7 + '@types/serve-static': 1.15.1 + dev: true + + /@types/html-minifier-terser/6.1.0: + resolution: {integrity: sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==} + dev: true + + /@types/http-proxy/1.17.10: + resolution: {integrity: sha512-Qs5aULi+zV1bwKAg5z1PWnDXWmsn+LxIvUGv6E2+OOMYhclZMO+OXd9pYVf2gLykf2I7IV2u7oTHwChPNsvJ7g==} + dependencies: + '@types/node': 18.15.0 + dev: true + + /@types/json-schema/7.0.11: + resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} + dev: true + + /@types/mime/3.0.1: + resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} + dev: true + + /@types/node/18.15.0: + resolution: {integrity: sha512-z6nr0TTEOBGkzLGmbypWOGnpSpSIBorEhC4L+4HeQ2iezKCi4f77kyslRwvHeNitymGQ+oFyIWGP96l/DPSV9w==} + dev: true + + /@types/qs/6.9.7: + resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} + dev: true + + /@types/range-parser/1.2.4: + resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} + dev: true + + /@types/retry/0.12.0: + resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} + dev: true + + /@types/serve-index/1.9.1: + resolution: {integrity: sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==} + dependencies: + '@types/express': 4.17.17 + dev: true + + /@types/serve-static/1.15.1: + resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} + dependencies: + '@types/mime': 3.0.1 + '@types/node': 18.15.0 + dev: true + + /@types/sockjs/0.3.33: + resolution: {integrity: sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==} + dependencies: + '@types/node': 18.15.0 + dev: true + + /@types/ws/8.5.4: + resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} + dependencies: + '@types/node': 18.15.0 + dev: true + + /@types/yargs-parser/21.0.0: + resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} + dev: false + + /@types/yargs/17.0.13: + resolution: {integrity: sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==} + dependencies: + '@types/yargs-parser': 21.0.0 + dev: false + + /@webassemblyjs/ast/1.11.1: + resolution: {integrity: sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==} + dependencies: + '@webassemblyjs/helper-numbers': 1.11.1 + '@webassemblyjs/helper-wasm-bytecode': 1.11.1 + dev: true + + /@webassemblyjs/floating-point-hex-parser/1.11.1: + resolution: {integrity: sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==} + dev: true + + /@webassemblyjs/helper-api-error/1.11.1: + resolution: {integrity: sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==} + dev: true + + /@webassemblyjs/helper-buffer/1.11.1: + resolution: {integrity: sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==} + dev: true + + /@webassemblyjs/helper-numbers/1.11.1: + resolution: {integrity: sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==} + dependencies: + '@webassemblyjs/floating-point-hex-parser': 1.11.1 + '@webassemblyjs/helper-api-error': 1.11.1 + '@xtuc/long': 4.2.2 + dev: true + + /@webassemblyjs/helper-wasm-bytecode/1.11.1: + resolution: {integrity: sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==} + dev: true + + /@webassemblyjs/helper-wasm-section/1.11.1: + resolution: {integrity: sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==} + dependencies: + '@webassemblyjs/ast': 1.11.1 + '@webassemblyjs/helper-buffer': 1.11.1 + '@webassemblyjs/helper-wasm-bytecode': 1.11.1 + '@webassemblyjs/wasm-gen': 1.11.1 + dev: true + + /@webassemblyjs/ieee754/1.11.1: + resolution: {integrity: sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==} + dependencies: + '@xtuc/ieee754': 1.2.0 + dev: true + + /@webassemblyjs/leb128/1.11.1: + resolution: {integrity: sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==} + dependencies: + '@xtuc/long': 4.2.2 + dev: true + + /@webassemblyjs/utf8/1.11.1: + resolution: {integrity: sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==} + dev: true + + /@webassemblyjs/wasm-edit/1.11.1: + resolution: {integrity: sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==} + dependencies: + '@webassemblyjs/ast': 1.11.1 + '@webassemblyjs/helper-buffer': 1.11.1 + '@webassemblyjs/helper-wasm-bytecode': 1.11.1 + '@webassemblyjs/helper-wasm-section': 1.11.1 + '@webassemblyjs/wasm-gen': 1.11.1 + '@webassemblyjs/wasm-opt': 1.11.1 + '@webassemblyjs/wasm-parser': 1.11.1 + '@webassemblyjs/wast-printer': 1.11.1 + dev: true + + /@webassemblyjs/wasm-gen/1.11.1: + resolution: {integrity: sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==} + dependencies: + '@webassemblyjs/ast': 1.11.1 + '@webassemblyjs/helper-wasm-bytecode': 1.11.1 + '@webassemblyjs/ieee754': 1.11.1 + '@webassemblyjs/leb128': 1.11.1 + '@webassemblyjs/utf8': 1.11.1 + dev: true + + /@webassemblyjs/wasm-opt/1.11.1: + resolution: {integrity: sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==} + dependencies: + '@webassemblyjs/ast': 1.11.1 + '@webassemblyjs/helper-buffer': 1.11.1 + '@webassemblyjs/wasm-gen': 1.11.1 + '@webassemblyjs/wasm-parser': 1.11.1 + dev: true + + /@webassemblyjs/wasm-parser/1.11.1: + resolution: {integrity: sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==} + dependencies: + '@webassemblyjs/ast': 1.11.1 + '@webassemblyjs/helper-api-error': 1.11.1 + '@webassemblyjs/helper-wasm-bytecode': 1.11.1 + '@webassemblyjs/ieee754': 1.11.1 + '@webassemblyjs/leb128': 1.11.1 + '@webassemblyjs/utf8': 1.11.1 + dev: true + + /@webassemblyjs/wast-printer/1.11.1: + resolution: {integrity: sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==} + dependencies: + '@webassemblyjs/ast': 1.11.1 + '@xtuc/long': 4.2.2 + dev: true + + /@webpack-cli/configtest/2.0.1_66fuqojgvlon52mqukkfkspvqe: + resolution: {integrity: sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + dependencies: + webpack: 5.76.0_webpack-cli@5.0.1 + webpack-cli: 5.0.1_jkfmkh54fty5hi5ax7xfrvyyji + dev: true + + /@webpack-cli/info/2.0.1_66fuqojgvlon52mqukkfkspvqe: + resolution: {integrity: sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + dependencies: + webpack: 5.76.0_webpack-cli@5.0.1 + webpack-cli: 5.0.1_jkfmkh54fty5hi5ax7xfrvyyji + dev: true + + /@webpack-cli/serve/2.0.1_nekbz7mv5jjnaufwg2vs32i4fu: + resolution: {integrity: sha512-0G7tNyS+yW8TdgHwZKlDWYXFA6OJQnoLCQvYKkQP0Q2X205PSQ6RNUj0M+1OB/9gRQaUZ/ccYfaxd0nhaWKfjw==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + webpack-dev-server: '*' + peerDependenciesMeta: + webpack-dev-server: + optional: true + dependencies: + webpack: 5.76.0_webpack-cli@5.0.1 + webpack-cli: 5.0.1_jkfmkh54fty5hi5ax7xfrvyyji + webpack-dev-server: 4.11.1_66fuqojgvlon52mqukkfkspvqe + dev: true + + /@xtuc/ieee754/1.2.0: + resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} + dev: true + + /@xtuc/long/4.2.2: + resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} + dev: true + + /accepts/1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: true + + /acorn-import-assertions/1.8.0_acorn@8.8.2: + resolution: {integrity: sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==} + peerDependencies: + acorn: ^8 + dependencies: + acorn: 8.8.2 + dev: true + + /acorn-walk/8.2.0: + resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} + engines: {node: '>=0.4.0'} + dev: true + + /acorn/8.8.2: + resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /ajv-formats/2.1.1: + resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} + peerDependenciesMeta: + ajv: + optional: true + dependencies: + ajv: 8.12.0 + dev: true + + /ajv-keywords/3.5.2_ajv@6.12.6: + resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==} + peerDependencies: + ajv: ^6.9.1 + dependencies: + ajv: 6.12.6 + dev: true + + /ajv-keywords/5.1.0_ajv@8.12.0: + resolution: {integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==} + peerDependencies: + ajv: ^8.8.2 + dependencies: + ajv: 8.12.0 + fast-deep-equal: 3.1.3 + dev: true + + /ajv/6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: true + + /ajv/8.12.0: + resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + dev: true + + /ansi-html-community/0.0.8: + resolution: {integrity: sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==} + engines: {'0': node >= 0.8.0} + hasBin: true + dev: true + + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + /ansi-styles/3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + + /anymatch/3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + + /array-flatten/1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + dev: true + + /array-flatten/2.1.2: + resolution: {integrity: sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==} + dev: true + + /available-typed-arrays/1.0.5: + resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} + engines: {node: '>= 0.4'} + dev: true + + /babel-loader/9.1.2_tkx7iv5lytdmlhrwm4n6r336ei: + resolution: {integrity: sha512-mN14niXW43tddohGl8HPu5yfQq70iUThvFL/4QzESA7GcZoC0eVOhvWdQ8+3UlSjaDE9MVtsW9mxDY07W7VpVA==} + engines: {node: '>= 14.15.0'} + peerDependencies: + '@babel/core': ^7.12.0 + webpack: '>=5' + dependencies: + '@babel/core': 7.21.0 + find-cache-dir: 3.3.2 + schema-utils: 4.0.0 + webpack: 5.76.0_webpack-cli@5.0.1 + dev: true + + /babel-plugin-dynamic-import-node/2.3.3: + resolution: {integrity: sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==} + dependencies: + object.assign: 4.1.4 + dev: true + + /babel-plugin-module-resolver/5.0.0: + resolution: {integrity: sha512-g0u+/ChLSJ5+PzYwLwP8Rp8Rcfowz58TJNCe+L/ui4rpzE/mg//JVX0EWBUYoxaextqnwuGHzfGp2hh0PPV25Q==} + engines: {node: '>= 16'} + dependencies: + find-babel-config: 2.0.0 + glob: 8.1.0 + pkg-up: 3.1.0 + reselect: 4.1.7 + resolve: 1.22.1 + dev: true + + /babel-plugin-polyfill-corejs2/0.3.3_@babel+core@7.21.0: + resolution: {integrity: sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.21.0 + '@babel/core': 7.21.0 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.21.0 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-corejs3/0.5.3_@babel+core@7.21.0: + resolution: {integrity: sha512-zKsXDh0XjnrUEW0mxIHLfjBfnXSMr5Q/goMe/fxpQnLm07mcOZiIZHBNWCMx60HmdvjxfXcalac0tfFg0wqxyw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.21.0 + core-js-compat: 3.29.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-corejs3/0.6.0_@babel+core@7.21.0: + resolution: {integrity: sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.21.0 + core-js-compat: 3.29.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-regenerator/0.3.1_@babel+core@7.21.0: + resolution: {integrity: sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-regenerator/0.4.1_@babel+core@7.21.0: + resolution: {integrity: sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.0 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.21.0 + transitivePeerDependencies: + - supports-color + dev: true + + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /batch/0.6.1: + resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} + dev: true + + /binary-extensions/2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + engines: {node: '>=8'} + dev: true + + /body-parser/1.20.1: + resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.1 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /bonjour-service/1.1.0: + resolution: {integrity: sha512-LVRinRB3k1/K0XzZ2p58COnWvkQknIY6sf0zF2rpErvcJXpMBttEPQSxK+HEXSS9VmpZlDoDnQWv8ftJT20B0Q==} + dependencies: + array-flatten: 2.1.2 + dns-equal: 1.0.0 + fast-deep-equal: 3.1.3 + multicast-dns: 7.2.5 + dev: true + + /boolbase/1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + dev: true + + /brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /brace-expansion/2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + + /braces/3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /browserslist/4.21.5: + resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001464 + electron-to-chromium: 1.4.327 + node-releases: 2.0.10 + update-browserslist-db: 1.0.10_browserslist@4.21.5 + + /buffer-from/1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true + + /bytes/3.0.0: + resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==} + engines: {node: '>= 0.8'} + dev: true + + /bytes/3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: true + + /call-bind/1.0.2: + resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} + dependencies: + function-bind: 1.1.1 + get-intrinsic: 1.2.0 + dev: true + + /camel-case/4.1.2: + resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} + dependencies: + pascal-case: 3.1.2 + tslib: 2.5.0 + dev: true + + /caniuse-lite/1.0.30001464: + resolution: {integrity: sha512-oww27MtUmusatpRpCGSOneQk2/l5czXANDSFvsc7VuOQ86s3ANhZetpwXNf1zY/zdfP63Xvjz325DAdAoES13g==} + + /chalk/2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + + /chalk/4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /chokidar/3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + engines: {node: '>= 8.10.0'} + requiresBuild: true + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /chrome-trace-event/1.0.3: + resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==} + engines: {node: '>=6.0'} + dev: true + + /clean-css/5.3.2: + resolution: {integrity: sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==} + engines: {node: '>= 10.0'} + dependencies: + source-map: 0.6.1 + dev: true + + /cliui/8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: false + + /clone-deep/4.0.1: + resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} + engines: {node: '>=6'} + dependencies: + is-plain-object: 2.0.4 + kind-of: 6.0.3 + shallow-clone: 3.0.1 + dev: true + + /color-convert/1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + + /color-name/1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + /colorette/2.0.19: + resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==} + dev: true + + /commander/2.20.3: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + dev: true + + /commander/4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + dev: true + + /commander/7.2.0: + resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} + engines: {node: '>= 10'} + dev: true + + /commander/8.3.0: + resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} + engines: {node: '>= 12'} + dev: true + + /commander/9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + dev: true + + /commondir/1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + dev: true + + /compressible/2.0.18: + resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + + /compression/1.7.4: + resolution: {integrity: sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==} + engines: {node: '>= 0.8.0'} + dependencies: + accepts: 1.3.8 + bytes: 3.0.0 + compressible: 2.0.18 + debug: 2.6.9 + on-headers: 1.0.2 + safe-buffer: 5.1.2 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /concat-map/0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /connect-history-api-fallback/2.0.0: + resolution: {integrity: sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==} + engines: {node: '>=0.8'} + dev: true + + /content-disposition/0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /content-type/1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + dev: true + + /convert-source-map/1.9.0: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + + /cookie-signature/1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + dev: true + + /cookie/0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: true + + /copy-anything/2.0.6: + resolution: {integrity: sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==} + dependencies: + is-what: 3.14.1 + dev: true + + /core-js-compat/3.29.0: + resolution: {integrity: sha512-ScMn3uZNAFhK2DGoEfErguoiAHhV2Ju+oJo/jK08p7B3f3UhocUrCCkTvnZaiS+edl5nlIoiBXKcwMc6elv4KQ==} + dependencies: + browserslist: 4.21.5 + dev: true + + /core-util-is/1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + dev: true + + /cross-spawn/6.0.5: + resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} + engines: {node: '>=4.8'} + dependencies: + nice-try: 1.0.5 + path-key: 2.0.1 + semver: 5.7.1 + shebang-command: 1.2.0 + which: 1.3.1 + dev: true + + /cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /css-loader/6.7.3_webpack@5.76.0: + resolution: {integrity: sha512-qhOH1KlBMnZP8FzRO6YCH9UHXQhVMcEGLyNdb7Hv2cpcmJbW0YrddO+tG1ab5nT41KpHIYGsbeHqxB9xPu1pKQ==} + engines: {node: '>= 12.13.0'} + peerDependencies: + webpack: ^5.0.0 + dependencies: + icss-utils: 5.1.0_postcss@8.4.21 + postcss: 8.4.21 + postcss-modules-extract-imports: 3.0.0_postcss@8.4.21 + postcss-modules-local-by-default: 4.0.0_postcss@8.4.21 + postcss-modules-scope: 3.0.0_postcss@8.4.21 + postcss-modules-values: 4.0.0_postcss@8.4.21 + postcss-value-parser: 4.2.0 + semver: 7.3.8 + webpack: 5.76.0_webpack-cli@5.0.1 + dev: true + + /css-select/4.3.0: + resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} + dependencies: + boolbase: 1.0.0 + css-what: 6.1.0 + domhandler: 4.3.1 + domutils: 2.8.0 + nth-check: 2.1.1 + dev: true + + /css-what/6.1.0: + resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} + engines: {node: '>= 6'} + dev: true + + /cssesc/3.0.0: + resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /debug/2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + + /debug/3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + optional: true + + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + + /default-gateway/6.0.3: + resolution: {integrity: sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==} + engines: {node: '>= 10'} + dependencies: + execa: 5.1.1 + dev: true + + /define-lazy-prop/2.0.0: + resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} + engines: {node: '>=8'} + dev: true + + /define-properties/1.2.0: + resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} + engines: {node: '>= 0.4'} + dependencies: + has-property-descriptors: 1.0.0 + object-keys: 1.1.1 + dev: true + + /depd/1.1.2: + resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} + engines: {node: '>= 0.6'} + dev: true + + /depd/2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: true + + /destroy/1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dev: true + + /detect-node/2.1.0: + resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==} + dev: true + + /dns-equal/1.0.0: + resolution: {integrity: sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg==} + dev: true + + /dns-packet/5.4.0: + resolution: {integrity: sha512-EgqGeaBB8hLiHLZtp/IbaDQTL8pZ0+IvwzSHA6d7VyMDM+B9hgddEMa9xjK5oYnw0ci0JQ6g2XCD7/f6cafU6g==} + engines: {node: '>=6'} + dependencies: + '@leichtgewicht/ip-codec': 2.0.4 + dev: true + + /dom-converter/0.2.0: + resolution: {integrity: sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==} + dependencies: + utila: 0.4.0 + dev: true + + /dom-serializer/1.4.1: + resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} + dependencies: + domelementtype: 2.3.0 + domhandler: 4.3.1 + entities: 2.2.0 + dev: true + + /domelementtype/2.3.0: + resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} + dev: true + + /domhandler/4.3.1: + resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} + engines: {node: '>= 4'} + dependencies: + domelementtype: 2.3.0 + dev: true + + /domutils/2.8.0: + resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} + dependencies: + dom-serializer: 1.4.1 + domelementtype: 2.3.0 + domhandler: 4.3.1 + dev: true + + /dot-case/3.0.4: + resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} + dependencies: + no-case: 3.0.4 + tslib: 2.5.0 + dev: true + + /duplexer/0.1.2: + resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} + dev: true + + /ee-first/1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + dev: true + + /electron-to-chromium/1.4.327: + resolution: {integrity: sha512-DIk2H4g/3ZhjgiABJjVdQvUdMlSABOsjeCm6gmUzIdKxAuFrGiJ8QXMm3i09grZdDBMC/d8MELMrdwYRC0+YHg==} + + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: false + + /encodeurl/1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + dev: true + + /enhanced-resolve/5.12.0: + resolution: {integrity: sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==} + engines: {node: '>=10.13.0'} + dependencies: + graceful-fs: 4.2.10 + tapable: 2.2.1 + dev: true + + /entities/2.2.0: + resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} + dev: true + + /envinfo/7.8.1: + resolution: {integrity: sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /errno/0.1.8: + resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} + hasBin: true + requiresBuild: true + dependencies: + prr: 1.0.1 + dev: true + optional: true + + /error-ex/1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: true + + /es-abstract/1.21.1: + resolution: {integrity: sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + es-set-tostringtag: 2.0.1 + es-to-primitive: 1.2.1 + function-bind: 1.1.1 + function.prototype.name: 1.1.5 + get-intrinsic: 1.2.0 + get-symbol-description: 1.0.0 + globalthis: 1.0.3 + gopd: 1.0.1 + has: 1.0.3 + has-property-descriptors: 1.0.0 + has-proto: 1.0.1 + has-symbols: 1.0.3 + internal-slot: 1.0.5 + is-array-buffer: 3.0.2 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-typed-array: 1.1.10 + is-weakref: 1.0.2 + object-inspect: 1.12.3 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + safe-regex-test: 1.0.0 + string.prototype.trimend: 1.0.6 + string.prototype.trimstart: 1.0.6 + typed-array-length: 1.0.4 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.9 + dev: true + + /es-module-lexer/0.9.3: + resolution: {integrity: sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==} + dev: true + + /es-set-tostringtag/2.0.1: + resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.0 + has: 1.0.3 + has-tostringtag: 1.0.0 + dev: true + + /es-to-primitive/1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: true + + /escalade/3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + + /escape-html/1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + dev: true + + /escape-string-regexp/1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + + /eslint-scope/5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + dev: true + + /esrecurse/4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse/4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} + dev: true + + /estraverse/5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: true + + /esutils/2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + + /etag/1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + dev: true + + /eventemitter3/4.0.7: + resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} + dev: true + + /events/3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + dev: true + + /execa/5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: true + + /express/4.18.2: + resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.1 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /fast-deep-equal/3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: true + + /fast-json-stable-stringify/2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fastest-levenshtein/1.0.16: + resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} + engines: {node: '>= 4.9.1'} + dev: true + + /faye-websocket/0.11.4: + resolution: {integrity: sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==} + engines: {node: '>=0.8.0'} + dependencies: + websocket-driver: 0.7.4 + dev: true + + /fill-range/7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /finalhandler/1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /find-babel-config/2.0.0: + resolution: {integrity: sha512-dOKT7jvF3hGzlW60Gc3ONox/0rRZ/tz7WCil0bqA1In/3I8f1BctpXahRnEKDySZqci7u+dqq93sZST9fOJpFw==} + engines: {node: '>=16.0.0'} + dependencies: + json5: 2.2.3 + path-exists: 4.0.0 + dev: true + + /find-cache-dir/3.3.2: + resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} + engines: {node: '>=8'} + dependencies: + commondir: 1.0.1 + make-dir: 3.1.0 + pkg-dir: 4.2.0 + dev: true + + /find-up/3.0.0: + resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + engines: {node: '>=6'} + dependencies: + locate-path: 3.0.0 + dev: true + + /find-up/4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: true + + /follow-redirects/1.15.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: true + + /for-each/0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.7 + dev: true + + /forwarded/0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + dev: true + + /fresh/0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + dev: true + + /fs-monkey/1.0.3: + resolution: {integrity: sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==} + dev: true + + /fs-readdir-recursive/1.1.0: + resolution: {integrity: sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==} + dev: true + + /fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /fsevents/2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind/1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + + /function.prototype.name/1.1.5: + resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.1 + functions-have-names: 1.2.3 + dev: true + + /functions-have-names/1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: true + + /gensync/1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + /get-caller-file/2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: false + + /get-intrinsic/1.2.0: + resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.3 + dev: true + + /get-stream/6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true + + /get-symbol-description/1.0.0: + resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + dev: true + + /glob-parent/5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob-to-regexp/0.4.1: + resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} + dev: true + + /glob/7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /glob/8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + dev: true + + /globals/11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + + /globalthis/1.0.3: + resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.0 + dev: true + + /gopd/1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.0 + dev: true + + /graceful-fs/4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true + + /gzip-size/6.0.0: + resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} + engines: {node: '>=10'} + dependencies: + duplexer: 0.1.2 + dev: true + + /handle-thing/2.0.1: + resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==} + dev: true + + /has-bigints/1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: true + + /has-flag/3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has-property-descriptors/1.0.0: + resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + dependencies: + get-intrinsic: 1.2.0 + dev: true + + /has-proto/1.0.1: + resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} + engines: {node: '>= 0.4'} + dev: true + + /has-symbols/1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /has-tostringtag/1.0.0: + resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /has/1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + + /he/1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + dev: true + + /hosted-git-info/2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: true + + /hpack.js/2.1.6: + resolution: {integrity: sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==} + dependencies: + inherits: 2.0.4 + obuf: 1.1.2 + readable-stream: 2.3.8 + wbuf: 1.7.3 + dev: true + + /html-entities/2.3.3: + resolution: {integrity: sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==} + dev: true + + /html-minifier-terser/6.1.0: + resolution: {integrity: sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==} + engines: {node: '>=12'} + hasBin: true + dependencies: + camel-case: 4.1.2 + clean-css: 5.3.2 + commander: 8.3.0 + he: 1.2.0 + param-case: 3.0.4 + relateurl: 0.2.7 + terser: 5.16.6 + dev: true + + /html-webpack-plugin/5.5.0_webpack@5.76.0: + resolution: {integrity: sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw==} + engines: {node: '>=10.13.0'} + peerDependencies: + webpack: ^5.20.0 + dependencies: + '@types/html-minifier-terser': 6.1.0 + html-minifier-terser: 6.1.0 + lodash: 4.17.21 + pretty-error: 4.0.0 + tapable: 2.2.1 + webpack: 5.76.0_webpack-cli@5.0.1 + dev: true + + /htmlparser2/6.1.0: + resolution: {integrity: sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==} + dependencies: + domelementtype: 2.3.0 + domhandler: 4.3.1 + domutils: 2.8.0 + entities: 2.2.0 + dev: true + + /http-deceiver/1.2.7: + resolution: {integrity: sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==} + dev: true + + /http-errors/1.6.3: + resolution: {integrity: sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==} + engines: {node: '>= 0.6'} + dependencies: + depd: 1.1.2 + inherits: 2.0.3 + setprototypeof: 1.1.0 + statuses: 1.5.0 + dev: true + + /http-errors/2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: true + + /http-parser-js/0.5.8: + resolution: {integrity: sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==} + dev: true + + /http-proxy-middleware/2.0.6_@types+express@4.17.17: + resolution: {integrity: sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@types/express': ^4.17.13 + peerDependenciesMeta: + '@types/express': + optional: true + dependencies: + '@types/express': 4.17.17 + '@types/http-proxy': 1.17.10 + http-proxy: 1.18.1 + is-glob: 4.0.3 + is-plain-obj: 3.0.0 + micromatch: 4.0.5 + transitivePeerDependencies: + - debug + dev: true + + /http-proxy/1.18.1: + resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.7 + follow-redirects: 1.15.2 + requires-port: 1.0.0 + transitivePeerDependencies: + - debug + dev: true + + /human-signals/2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + dev: true + + /iconv-lite/0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /iconv-lite/0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + optional: true + + /icss-utils/5.1.0_postcss@8.4.21: + resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + dependencies: + postcss: 8.4.21 + dev: true + + /image-size/0.5.5: + resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==} + engines: {node: '>=0.10.0'} + hasBin: true + requiresBuild: true + dev: true + optional: true + + /import-local/3.1.0: + resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} + engines: {node: '>=8'} + hasBin: true + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + dev: true + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits/2.0.3: + resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} + dev: true + + /inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /internal-slot/1.0.5: + resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.0 + has: 1.0.3 + side-channel: 1.0.4 + dev: true + + /interpret/3.1.1: + resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} + engines: {node: '>=10.13.0'} + dev: true + + /ipaddr.js/1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + dev: true + + /ipaddr.js/2.0.1: + resolution: {integrity: sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==} + engines: {node: '>= 10'} + dev: true + + /is-array-buffer/3.0.2: + resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + is-typed-array: 1.1.10 + dev: true + + /is-arrayish/0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true + + /is-bigint/1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + dev: true + + /is-binary-path/2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + dependencies: + binary-extensions: 2.2.0 + dev: true + + /is-boolean-object/1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-callable/1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: true + + /is-core-module/2.11.0: + resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} + dependencies: + has: 1.0.3 + dev: true + + /is-date-object/1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-docker/2.2.1: + resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} + engines: {node: '>=8'} + hasBin: true + dev: true + + /is-extglob/2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + dev: true + + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: false + + /is-glob/4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-negative-zero/2.0.2: + resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} + engines: {node: '>= 0.4'} + dev: true + + /is-number-object/1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-number/7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /is-plain-obj/3.0.0: + resolution: {integrity: sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==} + engines: {node: '>=10'} + dev: true + + /is-plain-object/2.0.4: + resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} + engines: {node: '>=0.10.0'} + dependencies: + isobject: 3.0.1 + dev: true + + /is-regex/1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-shared-array-buffer/1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + dependencies: + call-bind: 1.0.2 + dev: true + + /is-stream/2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: true + + /is-string/1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-symbol/1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /is-typed-array/1.1.10: + resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + dev: true + + /is-weakref/1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.2 + dev: true + + /is-what/3.14.1: + resolution: {integrity: sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==} + dev: true + + /is-wsl/2.2.0: + resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} + engines: {node: '>=8'} + dependencies: + is-docker: 2.2.1 + dev: true + + /isarray/1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + dev: true + + /isexe/2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /isobject/3.0.1: + resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} + engines: {node: '>=0.10.0'} + dev: true + + /jest-worker/27.5.1: + resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} + engines: {node: '>= 10.13.0'} + dependencies: + '@types/node': 18.15.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + dev: true + + /jquery/3.6.3: + resolution: {integrity: sha512-bZ5Sy3YzKo9Fyc8wH2iIQK4JImJ6R0GWI9kL1/k7Z91ZBNgkRXE6U0JfHIizZbort8ZunhSI3jw9I6253ahKfg==} + dev: false + + /js-tokens/4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + /jsesc/0.5.0: + resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} + hasBin: true + dev: true + + /jsesc/2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + + /json-parse-better-errors/1.0.2: + resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} + dev: true + + /json-parse-even-better-errors/2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + dev: true + + /json-schema-traverse/0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: true + + /json-schema-traverse/1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + dev: true + + /json5/2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + /kind-of/6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + dev: true + + /klona/2.0.6: + resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==} + engines: {node: '>= 8'} + dev: true + + /less-loader/11.1.0_less@4.1.3+webpack@5.76.0: + resolution: {integrity: sha512-C+uDBV7kS7W5fJlUjq5mPBeBVhYpTIm5gB09APT9o3n/ILeaXVsiSFTbZpTJCJwQ/Crczfn3DmfQFwxYusWFug==} + engines: {node: '>= 14.15.0'} + peerDependencies: + less: ^3.5.0 || ^4.0.0 + webpack: ^5.0.0 + dependencies: + klona: 2.0.6 + less: 4.1.3 + webpack: 5.76.0_webpack-cli@5.0.1 + dev: true + + /less/4.1.3: + resolution: {integrity: sha512-w16Xk/Ta9Hhyei0Gpz9m7VS8F28nieJaL/VyShID7cYvP6IL5oHeL6p4TXSDJqZE/lNv0oJ2pGVjJsRkfwm5FA==} + engines: {node: '>=6'} + hasBin: true + dependencies: + copy-anything: 2.0.6 + parse-node-version: 1.0.1 + tslib: 2.5.0 + optionalDependencies: + errno: 0.1.8 + graceful-fs: 4.2.10 + image-size: 0.5.5 + make-dir: 2.1.0 + mime: 1.6.0 + needle: 3.2.0 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + + /load-json-file/4.0.0: + resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} + engines: {node: '>=4'} + dependencies: + graceful-fs: 4.2.10 + parse-json: 4.0.0 + pify: 3.0.0 + strip-bom: 3.0.0 + dev: true + + /loader-runner/4.3.0: + resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} + engines: {node: '>=6.11.5'} + dev: true + + /locate-path/3.0.0: + resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + engines: {node: '>=6'} + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + dev: true + + /locate-path/5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + dependencies: + p-locate: 4.1.0 + dev: true + + /lodash.debounce/4.0.8: + resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} + dev: true + + /lodash/4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: true + + /lower-case/2.0.2: + resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} + dependencies: + tslib: 2.5.0 + dev: true + + /lru-cache/5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + dependencies: + yallist: 3.1.1 + + /lru-cache/6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: true + + /make-dir/2.1.0: + resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} + engines: {node: '>=6'} + dependencies: + pify: 4.0.1 + semver: 5.7.1 + dev: true + + /make-dir/3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.0 + dev: true + + /media-typer/0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + dev: true + + /memfs/3.4.13: + resolution: {integrity: sha512-omTM41g3Skpvx5dSYeZIbXKcXoAVc/AoMNwn9TKx++L/gaen/+4TTttmu8ZSch5vfVJ8uJvGbroTsIlslRg6lg==} + engines: {node: '>= 4.0.0'} + dependencies: + fs-monkey: 1.0.3 + dev: true + + /memorystream/0.3.1: + resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} + engines: {node: '>= 0.10.0'} + dev: true + + /merge-descriptors/1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + dev: true + + /merge-stream/2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: true + + /methods/1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + dev: true + + /micromatch/4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /mime-db/1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: true + + /mime-types/2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + + /mime/1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /mimic-fn/2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + + /minimalistic-assert/1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + dev: true + + /minimatch/3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimatch/5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + + /mrmime/1.0.1: + resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==} + engines: {node: '>=10'} + dev: true + + /ms/2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: true + + /ms/2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + + /ms/2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + + /multicast-dns/7.2.5: + resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} + hasBin: true + dependencies: + dns-packet: 5.4.0 + thunky: 1.1.0 + dev: true + + /nanoid/3.3.4: + resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + + /needle/3.2.0: + resolution: {integrity: sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==} + engines: {node: '>= 4.4.x'} + hasBin: true + requiresBuild: true + dependencies: + debug: 3.2.7 + iconv-lite: 0.6.3 + sax: 1.2.4 + transitivePeerDependencies: + - supports-color + dev: true + optional: true + + /negotiator/0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: true + + /neo-async/2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + dev: true + + /nice-try/1.0.5: + resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} + dev: true + + /no-case/3.0.4: + resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} + dependencies: + lower-case: 2.0.2 + tslib: 2.5.0 + dev: true + + /node-forge/1.3.1: + resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} + engines: {node: '>= 6.13.0'} + dev: true + + /node-releases/2.0.10: + resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} + + /normalize-package-data/2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.1 + semver: 5.7.1 + validate-npm-package-license: 3.0.4 + dev: true + + /normalize-path/3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + dev: true + + /npm-run-all/4.1.5: + resolution: {integrity: sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==} + engines: {node: '>= 4'} + hasBin: true + dependencies: + ansi-styles: 3.2.1 + chalk: 2.4.2 + cross-spawn: 6.0.5 + memorystream: 0.3.1 + minimatch: 3.1.2 + pidtree: 0.3.1 + read-pkg: 3.0.0 + shell-quote: 1.8.0 + string.prototype.padend: 3.1.4 + dev: true + + /npm-run-path/4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 + dev: true + + /nth-check/2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + dependencies: + boolbase: 1.0.0 + dev: true + + /object-inspect/1.12.3: + resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} + dev: true + + /object-keys/1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: true + + /object.assign/4.1.4: + resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /obuf/1.1.2: + resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} + dev: true + + /on-finished/2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: true + + /on-headers/1.0.2: + resolution: {integrity: sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==} + engines: {node: '>= 0.8'} + dev: true + + /once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /onetime/5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + + /open/8.4.2: + resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} + engines: {node: '>=12'} + dependencies: + define-lazy-prop: 2.0.0 + is-docker: 2.2.1 + is-wsl: 2.2.0 + dev: true + + /opener/1.5.2: + resolution: {integrity: sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==} + hasBin: true + dev: true + + /p-limit/2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + dependencies: + p-try: 2.2.0 + dev: true + + /p-locate/3.0.0: + resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + engines: {node: '>=6'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-locate/4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-retry/4.6.2: + resolution: {integrity: sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==} + engines: {node: '>=8'} + dependencies: + '@types/retry': 0.12.0 + retry: 0.13.1 + dev: true + + /p-try/2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + dev: true + + /param-case/3.0.4: + resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} + dependencies: + dot-case: 3.0.4 + tslib: 2.5.0 + dev: true + + /parse-json/4.0.0: + resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} + engines: {node: '>=4'} + dependencies: + error-ex: 1.3.2 + json-parse-better-errors: 1.0.2 + dev: true + + /parse-node-version/1.0.1: + resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} + engines: {node: '>= 0.10'} + dev: true + + /parseurl/1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: true + + /pascal-case/3.1.2: + resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} + dependencies: + no-case: 3.0.4 + tslib: 2.5.0 + dev: true + + /path-exists/3.0.0: + resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} + engines: {node: '>=4'} + dev: true + + /path-exists/4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /path-key/2.0.1: + resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} + engines: {node: '>=4'} + dev: true + + /path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-parse/1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /path-to-regexp/0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + dev: true + + /path-type/3.0.0: + resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} + engines: {node: '>=4'} + dependencies: + pify: 3.0.0 + dev: true + + /picocolors/1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + /picomatch/2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /pidtree/0.3.1: + resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==} + engines: {node: '>=0.10'} + hasBin: true + dev: true + + /pify/3.0.0: + resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} + engines: {node: '>=4'} + dev: true + + /pify/4.0.1: + resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} + engines: {node: '>=6'} + dev: true + + /pkg-dir/4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + dev: true + + /pkg-up/3.1.0: + resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} + engines: {node: '>=8'} + dependencies: + find-up: 3.0.0 + dev: true + + /postcss-modules-extract-imports/3.0.0_postcss@8.4.21: + resolution: {integrity: sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + dependencies: + postcss: 8.4.21 + dev: true + + /postcss-modules-local-by-default/4.0.0_postcss@8.4.21: + resolution: {integrity: sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + dependencies: + icss-utils: 5.1.0_postcss@8.4.21 + postcss: 8.4.21 + postcss-selector-parser: 6.0.11 + postcss-value-parser: 4.2.0 + dev: true + + /postcss-modules-scope/3.0.0_postcss@8.4.21: + resolution: {integrity: sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + dependencies: + postcss: 8.4.21 + postcss-selector-parser: 6.0.11 + dev: true + + /postcss-modules-values/4.0.0_postcss@8.4.21: + resolution: {integrity: sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + dependencies: + icss-utils: 5.1.0_postcss@8.4.21 + postcss: 8.4.21 + dev: true + + /postcss-selector-parser/6.0.11: + resolution: {integrity: sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==} + engines: {node: '>=4'} + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + dev: true + + /postcss-value-parser/4.2.0: + resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + dev: true + + /postcss/8.4.21: + resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.4 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + + /pretty-error/4.0.0: + resolution: {integrity: sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==} + dependencies: + lodash: 4.17.21 + renderkid: 3.0.0 + dev: true + + /process-nextick-args/2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + dev: true + + /proxy-addr/2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + dev: true + + /prr/1.0.1: + resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} + dev: true + optional: true + + /punycode/2.3.0: + resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + engines: {node: '>=6'} + dev: true + + /qs/6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + + /randombytes/2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /range-parser/1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: true + + /raw-body/2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + + /read-pkg/3.0.0: + resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==} + engines: {node: '>=4'} + dependencies: + load-json-file: 4.0.0 + normalize-package-data: 2.5.0 + path-type: 3.0.0 + dev: true + + /readable-stream/2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: true + + /readable-stream/3.6.1: + resolution: {integrity: sha512-+rQmrWMYGA90yenhTYsLWAsLsqVC8osOw6PKE1HDYiO0gdPeKe/xDHNzIAIn4C91YQ6oenEhfYqqc1883qHbjQ==} + engines: {node: '>= 6'} + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + dev: true + + /readdirp/3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + dependencies: + picomatch: 2.3.1 + dev: true + + /rechoir/0.8.0: + resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} + engines: {node: '>= 10.13.0'} + dependencies: + resolve: 1.22.1 + dev: true + + /regenerate-unicode-properties/10.1.0: + resolution: {integrity: sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==} + engines: {node: '>=4'} + dependencies: + regenerate: 1.4.2 + dev: true + + /regenerate/1.4.2: + resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==} + dev: true + + /regenerator-runtime/0.13.11: + resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} + dev: true + + /regenerator-transform/0.15.1: + resolution: {integrity: sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==} + dependencies: + '@babel/runtime': 7.21.0 + dev: true + + /regexp.prototype.flags/1.4.3: + resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + functions-have-names: 1.2.3 + dev: true + + /regexpu-core/5.3.1: + resolution: {integrity: sha512-nCOzW2V/X15XpLsK2rlgdwrysrBq+AauCn+omItIz4R1pIcmeot5zvjdmOBRLzEH/CkC6IxMJVmxDe3QcMuNVQ==} + engines: {node: '>=4'} + dependencies: + '@babel/regjsgen': 0.8.0 + regenerate: 1.4.2 + regenerate-unicode-properties: 10.1.0 + regjsparser: 0.9.1 + unicode-match-property-ecmascript: 2.0.0 + unicode-match-property-value-ecmascript: 2.1.0 + dev: true + + /regjsparser/0.9.1: + resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==} + hasBin: true + dependencies: + jsesc: 0.5.0 + dev: true + + /relateurl/0.2.7: + resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==} + engines: {node: '>= 0.10'} + dev: true + + /renderkid/3.0.0: + resolution: {integrity: sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==} + dependencies: + css-select: 4.3.0 + dom-converter: 0.2.0 + htmlparser2: 6.1.0 + lodash: 4.17.21 + strip-ansi: 6.0.1 + dev: true + + /require-directory/2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: false + + /require-from-string/2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + dev: true + + /requires-port/1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + dev: true + + /reselect/4.1.7: + resolution: {integrity: sha512-Zu1xbUt3/OPwsXL46hvOOoQrap2azE7ZQbokq61BQfiXvhewsKDwhMeZjTX9sX0nvw1t/U5Audyn1I9P/m9z0A==} + dev: true + + /resolve-cwd/3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + dependencies: + resolve-from: 5.0.0 + dev: true + + /resolve-from/5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + dev: true + + /resolve/1.22.1: + resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /retry/0.13.1: + resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} + engines: {node: '>= 4'} + dev: true + + /rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /safe-buffer/5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true + + /safe-buffer/5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: true + + /safe-regex-test/1.0.0: + resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + is-regex: 1.1.4 + dev: true + + /safer-buffer/2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true + + /sax/1.2.4: + resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} + dev: true + optional: true + + /schema-utils/3.1.1: + resolution: {integrity: sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==} + engines: {node: '>= 10.13.0'} + dependencies: + '@types/json-schema': 7.0.11 + ajv: 6.12.6 + ajv-keywords: 3.5.2_ajv@6.12.6 + dev: true + + /schema-utils/4.0.0: + resolution: {integrity: sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==} + engines: {node: '>= 12.13.0'} + dependencies: + '@types/json-schema': 7.0.11 + ajv: 8.12.0 + ajv-formats: 2.1.1 + ajv-keywords: 5.1.0_ajv@8.12.0 + dev: true + + /select-hose/2.0.0: + resolution: {integrity: sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==} + dev: true + + /selfsigned/2.1.1: + resolution: {integrity: sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==} + engines: {node: '>=10'} + dependencies: + node-forge: 1.3.1 + dev: true + + /semver/5.7.1: + resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} + hasBin: true + dev: true + + /semver/6.3.0: + resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + hasBin: true + + /semver/7.3.8: + resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /send/0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /serialize-javascript/6.0.1: + resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} + dependencies: + randombytes: 2.1.0 + dev: true + + /serve-index/1.9.1: + resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} + engines: {node: '>= 0.8.0'} + dependencies: + accepts: 1.3.8 + batch: 0.6.1 + debug: 2.6.9 + escape-html: 1.0.3 + http-errors: 1.6.3 + mime-types: 2.1.35 + parseurl: 1.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /serve-static/1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + dev: true + + /setprototypeof/1.1.0: + resolution: {integrity: sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==} + dev: true + + /setprototypeof/1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: true + + /shallow-clone/3.0.1: + resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} + engines: {node: '>=8'} + dependencies: + kind-of: 6.0.3 + dev: true + + /shebang-command/1.2.0: + resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} + engines: {node: '>=0.10.0'} + dependencies: + shebang-regex: 1.0.0 + dev: true + + /shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex/1.0.0: + resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} + engines: {node: '>=0.10.0'} + dev: true + + /shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /shell-quote/1.8.0: + resolution: {integrity: sha512-QHsz8GgQIGKlRi24yFc6a6lN69Idnx634w49ay6+jA5yFh7a1UY+4Rp6HPx/L/1zcEDPEij8cIsiqR6bQsE5VQ==} + dev: true + + /side-channel/1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + object-inspect: 1.12.3 + dev: true + + /signal-exit/3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true + + /sirv/1.0.19: + resolution: {integrity: sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==} + engines: {node: '>= 10'} + dependencies: + '@polka/url': 1.0.0-next.21 + mrmime: 1.0.1 + totalist: 1.1.0 + dev: true + + /slash/2.0.0: + resolution: {integrity: sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==} + engines: {node: '>=6'} + dev: true + + /sockjs/0.3.24: + resolution: {integrity: sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==} + dependencies: + faye-websocket: 0.11.4 + uuid: 8.3.2 + websocket-driver: 0.7.4 + dev: true + + /source-map-js/1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + dev: true + + /source-map-support/0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + + /source-map/0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: true + + /spdx-correct/3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.12 + dev: true + + /spdx-exceptions/2.3.0: + resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} + dev: true + + /spdx-expression-parse/3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + dependencies: + spdx-exceptions: 2.3.0 + spdx-license-ids: 3.0.12 + dev: true + + /spdx-license-ids/3.0.12: + resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} + dev: true + + /spdy-transport/3.0.0: + resolution: {integrity: sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==} + dependencies: + debug: 4.3.4 + detect-node: 2.1.0 + hpack.js: 2.1.6 + obuf: 1.1.2 + readable-stream: 3.6.1 + wbuf: 1.7.3 + transitivePeerDependencies: + - supports-color + dev: true + + /spdy/4.0.2: + resolution: {integrity: sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==} + engines: {node: '>=6.0.0'} + dependencies: + debug: 4.3.4 + handle-thing: 2.0.1 + http-deceiver: 1.2.7 + select-hose: 2.0.0 + spdy-transport: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /statuses/1.5.0: + resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} + engines: {node: '>= 0.6'} + dev: true + + /statuses/2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: true + + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: false + + /string.prototype.padend/3.1.4: + resolution: {integrity: sha512-67otBXoksdjsnXXRUq+KMVTdlVRZ2af422Y0aTyTjVaoQkGr3mxl2Bc5emi7dOQ3OGVVQQskmLEWwFXwommpNw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.1 + dev: true + + /string.prototype.trimend/1.0.6: + resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.1 + dev: true + + /string.prototype.trimstart/1.0.6: + resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.1 + dev: true + + /string_decoder/1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + dependencies: + safe-buffer: 5.1.2 + dev: true + + /string_decoder/1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + + /strip-bom/3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + dev: true + + /strip-final-newline/2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + dev: true + + /style-loader/3.3.1_webpack@5.76.0: + resolution: {integrity: sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==} + engines: {node: '>= 12.13.0'} + peerDependencies: + webpack: ^5.0.0 + dependencies: + webpack: 5.76.0_webpack-cli@5.0.1 + dev: true + + /supports-color/5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-color/8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag/1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /tapable/2.2.1: + resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} + engines: {node: '>=6'} + dev: true + + /terser-webpack-plugin/5.3.7_webpack@5.76.0: + resolution: {integrity: sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + dependencies: + '@jridgewell/trace-mapping': 0.3.17 + jest-worker: 27.5.1 + schema-utils: 3.1.1 + serialize-javascript: 6.0.1 + terser: 5.16.6 + webpack: 5.76.0_webpack-cli@5.0.1 + dev: true + + /terser/5.16.6: + resolution: {integrity: sha512-IBZ+ZQIA9sMaXmRZCUMDjNH0D5AQQfdn4WUjHL0+1lF4TP1IHRJbrhb6fNaXWikrYQTSkb7SLxkeXAiy1p7mbg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + '@jridgewell/source-map': 0.3.2 + acorn: 8.8.2 + commander: 2.20.3 + source-map-support: 0.5.21 + dev: true + + /thunky/1.1.0: + resolution: {integrity: sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==} + dev: true + + /to-fast-properties/2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + + /to-regex-range/5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /toidentifier/1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: true + + /totalist/1.1.0: + resolution: {integrity: sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==} + engines: {node: '>=6'} + dev: true + + /tslib/2.5.0: + resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} + dev: true + + /type-is/1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + dev: true + + /typed-array-length/1.0.4: + resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} + dependencies: + call-bind: 1.0.2 + for-each: 0.3.3 + is-typed-array: 1.1.10 + dev: true + + /typescript/4.9.5: + resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + + /unbox-primitive/1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.2 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: true + + /unicode-canonical-property-names-ecmascript/2.0.0: + resolution: {integrity: sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==} + engines: {node: '>=4'} + dev: true + + /unicode-match-property-ecmascript/2.0.0: + resolution: {integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==} + engines: {node: '>=4'} + dependencies: + unicode-canonical-property-names-ecmascript: 2.0.0 + unicode-property-aliases-ecmascript: 2.1.0 + dev: true + + /unicode-match-property-value-ecmascript/2.1.0: + resolution: {integrity: sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==} + engines: {node: '>=4'} + dev: true + + /unicode-property-aliases-ecmascript/2.1.0: + resolution: {integrity: sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==} + engines: {node: '>=4'} + dev: true + + /unpipe/1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + dev: true + + /update-browserslist-db/1.0.10_browserslist@4.21.5: + resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.5 + escalade: 3.1.1 + picocolors: 1.0.0 + + /uri-js/4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.3.0 + dev: true + + /util-deprecate/1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + dev: true + + /utila/0.4.0: + resolution: {integrity: sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==} + dev: true + + /utils-merge/1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + dev: true + + /uuid/8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: true + + /validate-npm-package-license/3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + dev: true + + /vary/1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + dev: true + + /watchpack/2.4.0: + resolution: {integrity: sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==} + engines: {node: '>=10.13.0'} + dependencies: + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.10 + dev: true + + /wbuf/1.7.3: + resolution: {integrity: sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==} + dependencies: + minimalistic-assert: 1.0.1 + dev: true + + /webpack-bundle-analyzer/4.8.0: + resolution: {integrity: sha512-ZzoSBePshOKhr+hd8u6oCkZVwpVaXgpw23ScGLFpR6SjYI7+7iIWYarjN6OEYOfRt8o7ZyZZQk0DuMizJ+LEIg==} + engines: {node: '>= 10.13.0'} + hasBin: true + dependencies: + '@discoveryjs/json-ext': 0.5.7 + acorn: 8.8.2 + acorn-walk: 8.2.0 + chalk: 4.1.2 + commander: 7.2.0 + gzip-size: 6.0.0 + lodash: 4.17.21 + opener: 1.5.2 + sirv: 1.0.19 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /webpack-cli/5.0.1_jkfmkh54fty5hi5ax7xfrvyyji: + resolution: {integrity: sha512-S3KVAyfwUqr0Mo/ur3NzIp6jnerNpo7GUO6so51mxLi1spqsA17YcMXy0WOIJtBSnj748lthxC6XLbNKh/ZC+A==} + engines: {node: '>=14.15.0'} + hasBin: true + peerDependencies: + '@webpack-cli/generators': '*' + webpack: 5.x.x + webpack-bundle-analyzer: '*' + webpack-dev-server: '*' + peerDependenciesMeta: + '@webpack-cli/generators': + optional: true + webpack-bundle-analyzer: + optional: true + webpack-dev-server: + optional: true + dependencies: + '@discoveryjs/json-ext': 0.5.7 + '@webpack-cli/configtest': 2.0.1_66fuqojgvlon52mqukkfkspvqe + '@webpack-cli/info': 2.0.1_66fuqojgvlon52mqukkfkspvqe + '@webpack-cli/serve': 2.0.1_nekbz7mv5jjnaufwg2vs32i4fu + colorette: 2.0.19 + commander: 9.5.0 + cross-spawn: 7.0.3 + envinfo: 7.8.1 + fastest-levenshtein: 1.0.16 + import-local: 3.1.0 + interpret: 3.1.1 + rechoir: 0.8.0 + webpack: 5.76.0_webpack-cli@5.0.1 + webpack-bundle-analyzer: 4.8.0 + webpack-dev-server: 4.11.1_66fuqojgvlon52mqukkfkspvqe + webpack-merge: 5.8.0 + dev: true + + /webpack-dev-middleware/5.3.3_webpack@5.76.0: + resolution: {integrity: sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA==} + engines: {node: '>= 12.13.0'} + peerDependencies: + webpack: ^4.0.0 || ^5.0.0 + dependencies: + colorette: 2.0.19 + memfs: 3.4.13 + mime-types: 2.1.35 + range-parser: 1.2.1 + schema-utils: 4.0.0 + webpack: 5.76.0_webpack-cli@5.0.1 + dev: true + + /webpack-dev-server/4.11.1_66fuqojgvlon52mqukkfkspvqe: + resolution: {integrity: sha512-lILVz9tAUy1zGFwieuaQtYiadImb5M3d+H+L1zDYalYoDl0cksAB1UNyuE5MMWJrG6zR1tXkCP2fitl7yoUJiw==} + engines: {node: '>= 12.13.0'} + hasBin: true + peerDependencies: + webpack: ^4.37.0 || ^5.0.0 + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true + dependencies: + '@types/bonjour': 3.5.10 + '@types/connect-history-api-fallback': 1.3.5 + '@types/express': 4.17.17 + '@types/serve-index': 1.9.1 + '@types/serve-static': 1.15.1 + '@types/sockjs': 0.3.33 + '@types/ws': 8.5.4 + ansi-html-community: 0.0.8 + bonjour-service: 1.1.0 + chokidar: 3.5.3 + colorette: 2.0.19 + compression: 1.7.4 + connect-history-api-fallback: 2.0.0 + default-gateway: 6.0.3 + express: 4.18.2 + graceful-fs: 4.2.10 + html-entities: 2.3.3 + http-proxy-middleware: 2.0.6_@types+express@4.17.17 + ipaddr.js: 2.0.1 + open: 8.4.2 + p-retry: 4.6.2 + rimraf: 3.0.2 + schema-utils: 4.0.0 + selfsigned: 2.1.1 + serve-index: 1.9.1 + sockjs: 0.3.24 + spdy: 4.0.2 + webpack: 5.76.0_webpack-cli@5.0.1 + webpack-cli: 5.0.1_jkfmkh54fty5hi5ax7xfrvyyji + webpack-dev-middleware: 5.3.3_webpack@5.76.0 + ws: 8.12.1 + transitivePeerDependencies: + - bufferutil + - debug + - supports-color + - utf-8-validate + dev: true + + /webpack-merge/5.8.0: + resolution: {integrity: sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==} + engines: {node: '>=10.0.0'} + dependencies: + clone-deep: 4.0.1 + wildcard: 2.0.0 + dev: true + + /webpack-sources/3.2.3: + resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} + engines: {node: '>=10.13.0'} + dev: true + + /webpack/5.76.0_webpack-cli@5.0.1: + resolution: {integrity: sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==} + engines: {node: '>=10.13.0'} + hasBin: true + peerDependencies: + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true + dependencies: + '@types/eslint-scope': 3.7.4 + '@types/estree': 0.0.51 + '@webassemblyjs/ast': 1.11.1 + '@webassemblyjs/wasm-edit': 1.11.1 + '@webassemblyjs/wasm-parser': 1.11.1 + acorn: 8.8.2 + acorn-import-assertions: 1.8.0_acorn@8.8.2 + browserslist: 4.21.5 + chrome-trace-event: 1.0.3 + enhanced-resolve: 5.12.0 + es-module-lexer: 0.9.3 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.10 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.1.1 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.7_webpack@5.76.0 + watchpack: 2.4.0 + webpack-cli: 5.0.1_jkfmkh54fty5hi5ax7xfrvyyji + webpack-sources: 3.2.3 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + dev: true + + /websocket-driver/0.7.4: + resolution: {integrity: sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==} + engines: {node: '>=0.8.0'} + dependencies: + http-parser-js: 0.5.8 + safe-buffer: 5.2.1 + websocket-extensions: 0.1.4 + dev: true + + /websocket-extensions/0.1.4: + resolution: {integrity: sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==} + engines: {node: '>=0.8.0'} + dev: true + + /which-boxed-primitive/1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: true + + /which-typed-array/1.1.9: + resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + is-typed-array: 1.1.10 + dev: true + + /which/1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /wildcard/2.0.0: + resolution: {integrity: sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==} + dev: true + + /wrap-ansi/7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: false + + /wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /ws/7.5.9: + resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /ws/8.12.1: + resolution: {integrity: sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /y18n/5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: false + + /yallist/3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + /yallist/4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true + + /yargs-parser/21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: false + + /yargs/17.6.2: + resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: false diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 000000000..ee102735a --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - "packages/*" diff --git a/private/less/app.less b/private/less/app.less deleted file mode 100644 index dd4d62029..000000000 --- a/private/less/app.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../src/less/resource/app.less"; -@import "var.less"; diff --git a/private/less/background.less b/private/less/background.less deleted file mode 100644 index 0897148ea..000000000 --- a/private/less/background.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../src/less/resource/background.less"; -@import "var.less"; diff --git a/private/less/font.less b/private/less/font.less deleted file mode 100644 index d7399c46e..000000000 --- a/private/less/font.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../src/less/resource/font.less"; -@import "var.less"; diff --git a/private/less/icon.less b/private/less/icon.less deleted file mode 100644 index 8aa44a2ae..000000000 --- a/private/less/icon.less +++ /dev/null @@ -1,5 +0,0 @@ -@import "../../src/less/resource/icon.less"; -@import "var.less"; - - - diff --git a/private/less/var.less b/private/less/var.less deleted file mode 100644 index c427442d3..000000000 --- a/private/less/var.less +++ /dev/null @@ -1,4 +0,0 @@ -@webUrl: './'; -@fontUrl: '@{webUrl}font/'; //图片的基本地址 -@imageUrl: '@{webUrl}images/1x/'; //图片的基本地址 -@image2xUrl: '@{webUrl}images/2x/'; //2倍图片的基本地址 diff --git a/public/js/index.js b/public/js/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/less/app.less b/public/less/app.less deleted file mode 100644 index dd4d62029..000000000 --- a/public/less/app.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../src/less/resource/app.less"; -@import "var.less"; diff --git a/public/less/background.less b/public/less/background.less deleted file mode 100644 index 0897148ea..000000000 --- a/public/less/background.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../src/less/resource/background.less"; -@import "var.less"; diff --git a/public/less/font.less b/public/less/font.less deleted file mode 100644 index d7399c46e..000000000 --- a/public/less/font.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../src/less/resource/font.less"; -@import "var.less"; diff --git a/public/less/icon.less b/public/less/icon.less deleted file mode 100644 index 8aa44a2ae..000000000 --- a/public/less/icon.less +++ /dev/null @@ -1,5 +0,0 @@ -@import "../../src/less/resource/icon.less"; -@import "var.less"; - - - diff --git a/public/less/var.less b/public/less/var.less deleted file mode 100644 index 88ff90275..000000000 --- a/public/less/var.less +++ /dev/null @@ -1,4 +0,0 @@ -@webUrl: 'https://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/'; -@fontUrl: '@{webUrl}font/'; //图片的基本地址 -@imageUrl: '@{webUrl}images/1x/'; //图片的基本地址 -@image2xUrl: '@{webUrl}images/2x/'; //2倍图片的基本地址 diff --git a/publish.bat b/publish.bat deleted file mode 100644 index c174aa424..000000000 --- a/publish.bat +++ /dev/null @@ -1 +0,0 @@ -npm run publishToPrivate \ No newline at end of file diff --git a/publish.sh b/publish.sh deleted file mode 100644 index c174aa424..000000000 --- a/publish.sh +++ /dev/null @@ -1 +0,0 @@ -npm run publishToPrivate \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index fe5699412..000000000 --- a/rollup.config.js +++ /dev/null @@ -1,65 +0,0 @@ -const babel = require("@rollup/plugin-babel"); -const alias = require("@rollup/plugin-alias"); -const resolve = require("@rollup/plugin-node-resolve"); -const commonjs = require("@rollup/plugin-commonjs"); -const sizes = require("rollup-plugin-sizes"); -const path = require("path"); - -module.exports = [ - { - input: path.resolve(__dirname, "src/index.js"), - output: [ - { - file: "dist/fineui.esm.js", - format: "esm", - sourcemap: true, - } - ], - plugins: [ - alias({ - entries: [ - { find: "@", replacement: path.resolve(__dirname, "src") } - ] - }), - resolve(), - babel({ - babelHelpers: "inline", - plugins: [ - ["@babel/plugin-proposal-decorators", { legacy: true }] - ] - }), - commonjs() - ] - }, - { - input: path.resolve(__dirname, "src/bundle.js"), - output: [ - { - file: "dist/fineui.min.js", - sourcemap: true, - format: "umd" - } - ], - plugins: [ - alias({ - entries: [ - { find: "@", replacement: path.resolve(__dirname, "src") } - ] - }), - resolve(), - babel({ - babelHelpers: "inline", - plugins: [ - ["@babel/plugin-proposal-decorators", { legacy: true }] - ] - }), - // babel({ - // babelHelpers: "runtime", - // presets: [babelConfig] - // }), - commonjs(), - sizes(), - // terser() - ] - } -]; diff --git a/script/code.static.js b/script/code.static.js new file mode 100644 index 000000000..526f97788 --- /dev/null +++ b/script/code.static.js @@ -0,0 +1,89 @@ +/** + * @file 各模块文件数量统计脚本(从 BI 搬过来的) + */ +let fs = require('fs'); +let path = require('path'); + +const rootPath = path.resolve(__dirname, '../packages'); +// 获取所有的模块名 +const modules = fs.readdirSync(rootPath); +const result = []; + +let jsFileCount = 0; +let tsFileCount = 0; +let tsxFileCount = 0; + +const file = async filePath => { + if ( + filePath.endsWith('.js') && + filePath.indexOf('/dist/') < 0 && + filePath.indexOf('/webpack/') < 0 && + filePath.indexOf('/webui-bi/private/') < 0 + ) { + console.log(jsFileCount + ':' + path.normalize(filePath)); + jsFileCount++; + } + if (filePath.endsWith('.ts')) { + tsFileCount++; + } + if (filePath.endsWith('.tsx')) { + tsxFileCount++; + } +}; + +const reset = () => { + jsFileCount = 0; + tsFileCount = 0; + tsxFileCount = 0; +}; + +// 递归所有文件夹统计 +const codeStat = async (pt, lineFun) => { + let files = fs.readdirSync(pt); + files + .map(file => { + return `${pt}/${file}`; + }) + .forEach(file => { + let stat = fs.statSync(file); + if (stat.isDirectory()) { + if ( + file.indexOf('__test__') > -1 || + file.indexOf('__point__') > -1 || + file.indexOf('third') > -1 || + file.indexOf('__e2e__') > -1 || + file.indexOf('__integration__') > -1 || + file.indexOf('node_modules') > -1 + ) { + return; + } + codeStat(file, lineFun); + return; + } + if (file.indexOf('.DS_Store') > -1) { + return; + } + lineFun(file); + }); +}; + +const statisticFile = () => { + modules.forEach(i => { + codeStat(`${rootPath}/${i}/src`, file); + result.push({ + name: i, + jsFileCount, + tsFileCount, + tsxFileCount, + allFileCount: jsFileCount + tsFileCount + tsxFileCount, + }); + reset(); + }); + + console.table(result); +}; + +statisticFile(); +module.exports = { + statisticFile, +}; diff --git a/script/lib/fui.component.json b/script/lib/fui.component.json new file mode 100644 index 000000000..fd25ca2dc --- /dev/null +++ b/script/lib/fui.component.json @@ -0,0 +1,398 @@ +{ + "bi.pane": "Pane", + "bi.button": "Button", + "bi.horizontal": "HorizontalLayout", + "bi.horizontal_adapt": "HorizontalAdaptLayout", + "bi.popup_view": "PopupView", + "bi.collection_view": "CollectionView", + "bi.grid_view": "GridView", + "bi.list_view": "ListView", + "bi.bubble": "Bubble", + "bi.virtual_list": "VirtualList", + "bi.combo": "Combo", + "bi.expander": "Expander", + "bi.button_group": "ButtonGroup", + "bi.combo_group": "ComboGroup", + "bi.virtual_group": "VirtualGroup", + "bi.loader": "Loader", + "bi.navigation": "Navigation", + "bi.searcher": "Searcher", + "bi.switcher": "Switcher", + "bi.tab": "Tab", + "bi.button_tree": "ButtonTree", + "bi.context": "Context", + "bi.el": "EL", + "bi.bar_popover": "BarPopover", + "bi.searcher_view": "SearcherView", + "bi.single": "Single", + "bi.text": "Text", + "bi.a": "A", + "bi.loading_bar": "LoadingBar", + "bi.basic_button": "BasicButton", + "bi.node_button": "NodeButton", + "bi.icon_button": "IconButton", + "bi.image_button": "ImageButton", + "bi.text_button": "TextButton", + "bi.blank_icon_icon_text_item": "BlankIconIconTextItem", + "bi.blank_icon_text_icon_item": "BlankIconTextIconItem", + "bi.blank_icon_text_item": "BlankIconTextItem", + "bi.icon_text_icon_item": "IconTextIconItem", + "bi.icon_text_item": "IconTextItem", + "bi.text_icon_item": "TextIconItem", + "bi.text_item": "TextItem", + "bi.icon_text_icon_node": "IconTextIconNode", + "bi.icon_text_node": "IconTextNode", + "bi.text_icon_node": "TextIconNode", + "bi.text_node": "TextNode", + "bi.editor": "Editor", + "bi.multifile_editor": "MultifileEditor", + "bi.textarea_editor": "TextAreaEditor", + "bi.html": "Html", + "bi.icon": "Icon", + "bi.iframe": "Iframe", + "bi.img": "Img", + "bi.image_checkbox": "ImageCheckbox", + "bi.checkbox": "Checkbox", + "bi.file": "File", + "bi.input": "Input", + "bi.image_radio": "ImageRadio", + "bi.radio": "Radio", + "bi.instruction": "Instruction", + "bi.html_label": "HtmlLabel", + "bi.icon_label": "IconLabel", + "bi.label": "Label", + "bi.link": "Link", + "bi.pure_text": "PureText", + "bi.custom_tree": "CustomTree", + "bi.icon_change_button": "IconChangeButton", + "bi.trigger_icon_button": "TriggerIconButton", + "bi.half_icon_button": "HalfIconButton", + "bi.half_button": "HalfButton", + "bi.multi_select_item": "MultiSelectItem", + "bi.single_select_icon_text_item": "SingleSelectIconTextItem", + "bi.single_select_item": "SingleSelectItem", + "bi.single_select_radio_item": "SingleSelectRadioItem", + "bi.arrow_group_node": "ArrowNode", + "bi.icon_arrow_node": "IconArrowNode", + "bi.multilayer_icon_arrow_node": "MultiLayerIconArrowNode", + "bi.plus_group_node": "PlusGroupNode", + "bi.tree_node_switcher": "TreeNodeSwitcher", + "bi.tree_node": "BasicTreeNode", + "bi.first_plus_group_node": "FirstPlusGroupNode", + "bi.mid_plus_group_node": "MidPlusGroupNode", + "bi.last_plus_group_node": "LastPlusGroupNode", + "bi.switch": "Switch", + "bi.icon_tree_leaf_item": "IconTreeLeafItem", + "bi.multilayer_icon_tree_leaf_item": "MultiLayerIconTreeLeafItem", + "bi.tree_item": "BasicTreeItem", + "bi.first_tree_leaf_item": "FirstTreeLeafItem", + "bi.mid_tree_leaf_item": "MidTreeLeafItem", + "bi.last_tree_leaf_item": "LastTreeLeafItem", + "bi.root_tree_leaf_item": "RootTreeLeafItem", + "bi.calendar": "Calendar", + "bi.year_calendar": "YearCalendar", + "bi.arrow_group_node_checkbox": "ArrowTreeGroupNodeCheckbox", + "bi.checking_mark_node": "CheckingMarkNode", + "bi.first_tree_node_checkbox": "FirstTreeNodeCheckbox", + "bi.last_tree_node_checkbox": "LastTreeNodeCheckbox", + "bi.mid_tree_node_checkbox": "MidTreeNodeCheckbox", + "bi.tree_node_checkbox": "TreeNodeCheckbox", + "bi.custom_color_chooser": "CustomColorChooser", + "bi.color_chooser": "ColorChooser", + "bi.hex_color_chooser_popup": "HexColorChooserPopup", + "bi.simple_hex_color_chooser_popup": "SimpleHexColorChooserPopup", + "bi.color_chooser_popup": "ColorChooserPopup", + "bi.simple_color_chooser_popup": "SimpleColorChooserPopup", + "bi.simple_color_chooser": "SimpleColorChooser", + "bi.color_chooser_trigger": "ColorChooserTrigger", + "bi.long_color_chooser_trigger": "LongColorChooserTrigger", + "bi.color_picker_button": "ColorPickerButton", + "bi.color_picker_show_button": "ColorChooserShowButton", + "bi.hex_color_picker": "HexColorPicker", + "bi.color_picker": "ColorPicker", + "bi.hex_color_picker_editor": "HexColorPickerEditor", + "bi.simple_hex_color_picker_editor": "SimpleHexColorPickerEditor", + "bi.color_picker_editor": "ColorPickerEditor", + "bi.simple_color_picker_editor": "SimpleColorPickerEditor", + "bi.farbtastic": "Farbtastic", + "bi.bubble_combo": "BubbleCombo", + "bi.bubble_popup_view": "BubblePopupView", + "bi.bubble_bar_popup_view": "BubblePopupBarView", + "bi.text_bubble_bar_popup_view": "TextBubblePopupBarView", + "bi.editor_icon_check_combo": "EditorIconCheckCombo", + "bi.icon_combo": "IconCombo", + "bi.icon_combo_popup": "IconComboPopup", + "bi.icon_combo_trigger": "IconComboTrigger", + "bi.icon_text_value_combo": "IconTextValueCombo", + "bi.icon_text_value_combo_popup": "IconTextValueComboPopup", + "bi.search_text_value_combo": "SearchTextValueCombo", + "bi.search_text_value_combo_popup": "SearchTextValueComboPopup", + "bi.search_text_value_trigger": "SearchTextValueTrigger", + "bi.text_value_check_combo": "TextValueCheckCombo", + "bi.text_value_check_combo_popup": "TextValueCheckComboPopup", + "bi.text_value_combo": "TextValueCombo", + "bi.small_text_value_combo": "SmallTextValueCombo", + "bi.text_value_combo_popup": "TextValueComboPopup", + "bi.clear_editor": "ClearEditor", + "bi.default_text_editor": "DefaultTextEditor", + "bi.shelter_editor": "ShelterEditor", + "bi.sign_editor": "SignEditor", + "bi.state_editor": "StateEditor", + "bi.simple_state_editor": "SimpleStateEditor", + "bi.multi_popup_view": "MultiPopupView", + "bi.popup_panel": "PopupPanel", + "bi.list_pane": "ListPane", + "bi.panel": "Panel", + "bi.linear_segment_button": "LinearSegmentButton", + "bi.linear_segment": "LinearSegment", + "bi.select_list": "SelectList", + "bi.lazy_loader": "LazyLoader", + "bi.list_loader": "ListLoader", + "bi.sort_list": "SortList", + "bi.all_count_pager": "AllCountPager", + "bi.detail_pager": "DetailPager", + "bi.direction_pager": "DirectionPager", + "bi.segment_button": "SegmentButton", + "bi.segment": "Segment", + "bi.multi_select_bar": "MultiSelectBar", + "bi.level_tree": "LevelTree", + "bi.tree_expander": "TreeExpander", + "bi.tree_expander.popup": "TreeExpanderPopup", + "bi.editor_trigger": "EditorTrigger", + "bi.icon_trigger": "IconTrigger", + "bi.icon_text_trigger": "IconTextTrigger", + "bi.select_icon_text_trigger": "SelectIconTextTrigger", + "bi.text_trigger": "TextTrigger", + "bi.select_text_trigger": "SelectTextTrigger", + "bi.small_select_text_trigger": "SmallSelectTextTrigger", + "bi.small_text_trigger": "SmallTextTrigger", + "bi.async_tree": "Asynctree", + "bi.list_async_tree": "Listasynctree", + "bi.list_part_tree": "ListPartTree", + "bi.list_tree_view": "Listtreeview", + "bi.part_tree": "PartTree", + "bi.display_tree": "DisplayTree", + "bi.list_display_tree": "ListDisplayTree", + "bi.simple_tree": "SimpleTreeView", + "bi.tree_view": "TreeView", + "bi.all_value_chooser_combo": "AllValueChooserCombo", + "bi.all_value_chooser_pane": "AllValueChooserPane", + "bi.all_value_multi_text_value_combo": "AllValueMultiTextValueCombo", + "bi.form_field": "FormField", + "bi.custom_form": "Form", + "bi.list_tree_value_chooser_insert_combo": "ListTreeValueChooserInsertCombo", + "bi.tree_value_chooser_insert_combo": "TreeValueChooserInsertCombo", + "bi.tree_value_chooser_combo": "TreeValueChooserCombo", + "bi.tree_value_chooser_pane": "TreeValueChooserPane", + "bi.value_chooser_insert_combo": "ValueChooserInsertCombo", + "bi.value_chooser_combo": "ValueChooserCombo", + "bi.value_chooser_no_bar_combo": "ValueChooserNoBarCombo", + "bi.value_chooser_pane": "ValueChooserPane", + "bi.absolute_horizontal_adapt": "AbsoluteHorizontalLayout", + "bi.absolute_left_right_vertical_adapt": "AbsoluteLeftRightVerticalAdaptLayout", + "bi.absolute_right_vertical_adapt": "AbsoluteRightVerticalAdaptLayout", + "bi.absolute_vertical_adapt": "AbsoluteVerticalLayout", + "bi.center_adapt": "CenterAdaptLayout", + "bi.left_right_vertical_adapt": "LeftRightVerticalAdaptLayout", + "bi.left_vertical_adapt": "LeftVerticalAdaptLayout", + "bi.right_vertical_adapt": "RightVerticalAdaptLayout", + "bi.table_adapt": "TableAdaptLayout", + "bi.vertical_adapt": "VerticalAdaptLayout", + "bi.horizontal_auto": "HorizontalAutoLayout", + "bi.inline_center_adapt": "InlineCenterAdaptLayout", + "bi.inline_horizontal_adapt": "InlineHorizontalAdaptLayout", + "bi.inline_vertical_adapt": "InlineVerticalAdaptLayout", + "bi.vtape_auto": "AutoVerticalTapeLayout", + "bi.horizontal_float_fill": "FloatHorizontalFillLayout", + "bi.flex_center_adapt": "FlexCenterLayout", + "bi.flex_horizontal_adapt": "FlexHorizontalCenter", + "bi.flex_horizontal_center_adapt": "FlexHorizontalCenterAdapt", + "bi.flex_horizontal": "FlexHorizontalLayout", + "bi.flex_left_right_vertical_adapt": "FlexLeftRightVerticalAdaptLayout", + "bi.flex_vertical_adapt": "FlexVerticalCenter", + "bi.flex_vertical_center_adapt": "FlexVerticalCenterAdapt", + "bi.flex_vertical": "FlexVerticalLayout", + "bi.flex_scrollable_center_adapt": "FlexWrapperCenterLayout", + "bi.flex_scrollable_horizontal_adapt": "FlexWrapperHorizontalCenter", + "bi.flex_scrollable_horizontal_center_adapt": "FlexWrapperHorizontalCenterAdapt", + "bi.flex_scrollable_horizontal": "FlexWrapperHorizontalLayout", + "bi.flex_scrollable_vertical_adapt": "FlexWrapperVerticalCenter", + "bi.flex_scrollable_vertical_center_adapt": "FlexWrapperVerticalCenterAdapt", + "bi.flex_scrollable_vertical": "FlexWrapperVerticalLayout", + "bi.absolute_center_float": "FloatAbsoluteCenterLayout", + "bi.absolute_horizontal_float": "FloatAbsoluteHorizontalLayout", + "bi.absolute_left_right_vertical_float": "FloatAbsoluteLeftRightVerticalAdaptLayout", + "bi.absolute_right_vertical_float": "FloatAbsoluteRightVerticalAdaptLayout", + "bi.absolute_vertical_float": "FloatAbsoluteVerticalLayout", + "bi.horizontal_float": "FloatHorizontalLayout", + "bi.absolute": "AbsoluteLayout", + "bi.adaptive": "AdaptiveLayout", + "bi.border": "BorderLayout", + "bi.card": "CardLayout", + "bi.default": "DefaultLayout", + "bi.division": "DivisionLayout", + "bi.left": "FloatLeftLayout", + "bi.right": "FloatRightLayout", + "bi.grid": "GridLayout", + "bi.inline": "InlineLayout", + "bi.lattice": "LatticeLayout", + "bi.table": "TableLayout", + "bi.htape": "HTapeLayout", + "bi.vtape": "VTapeLayout", + "bi.td": "TdLayout", + "bi.vertical": "VerticalLayout", + "bi.window": "WindowLayout", + "bi.center": "CenterLayout", + "bi.float_center": "FloatCenterLayout", + "bi.horizontal_center": "HorizontalCenterLayout", + "bi.vertical_center": "VerticalCenterLayout", + "bi.responsive_flex_horizontal": "ResponsiveFlexHorizontalLayout", + "bi.responsive_flex_scrollable_horizontal": "ResponsiveFlexWrapperHorizontalLayout", + "bi.responsive_inline": "ResponsiveInlineLayout", + "bi.horizontal_sticky": "HorizontalStickyLayout", + "bi.vertical_sticky": "VerticalStickyLayout", + "bi.layout": "Layout", + "bi.router": "RouterWidget", + "bi.router_view": "RouterView", + "bi.collapse": "Collapse", + "bi.month_date_combo": "MonthDateCombo", + "bi.year_date_combo": "YearDateCombo", + "bi.date_picker": "DatePicker", + "bi.year_picker": "YearPicker", + "bi.date_calendar_popup": "DateCalendarPopup", + "bi.month_popup": "MonthPopup", + "bi.year_popup": "YearPopup", + "bi.date_triangle_trigger": "DateTriangleTrigger", + "bi.static_date_pane_card": "StaticDatePaneCard", + "bi.dynamic_date_pane": "DynamicDatePane", + "bi.date_time_combo": "DateTimeCombo", + "bi.date_time_popup": "DateTimePopup", + "bi.date_time_trigger": "DateTimeTrigger", + "bi.static_date_time_pane_card": "StaticDateTimePaneCard", + "bi.dynamic_date_time_pane": "DynamicDateTimePane", + "bi.down_list_combo": "DownListCombo", + "bi.down_list_group": "DownListGroup", + "bi.down_list_item": "DownListItem", + "bi.down_list_group_item": "DownListGroupItem", + "bi.down_list_popup": "DownListPopup", + "bi.dynamic_date_card": "DynamicDateCard", + "bi.dynamic_date_combo": "DynamicDateCombo", + "bi.dynamic_date_param_item": "DynamicDateParamItem", + "bi.dynamic_date_popup": "DynamicDatePopup", + "bi.dynamic_date_trigger": "DynamicDateTrigger", + "bi.dynamic_date_time_combo": "DynamicDateTimeCombo", + "bi.dynamic_date_time_popup": "DynamicDateTimePopup", + "bi.dynamic_date_time_select": "DynamicDateTimeSelect", + "bi.dynamic_date_time_trigger": "DynamicDateTimeTrigger", + "bi.search_editor": "SearchEditor", + "bi.small_search_editor": "SmallSearchEditor", + "bi.text_editor": "TextEditor", + "bi.small_text_editor": "SmallTextEditor", + "bi.interval_slider": "IntervalSlider", + "bi.multi_layer_down_list_combo": "MultiLayerDownListCombo", + "bi.multi_layer_down_list_popup": "MultiLayerDownListPopup", + "bi.multilayer_select_tree_combo": "MultiLayerSelectTreeCombo", + "bi.multilayer_select_tree_insert_search_pane": "MultiLayerSelectTreeInsertSearchPane", + "bi.multilayer_select_level_tree": "MultiLayerSelectLevelTree", + "bi.multilayer_select_tree_popup": "MultiLayerSelectTreePopup", + "bi.multilayer_select_tree_trigger": "MultiLayerSelectTreeTrigger", + "bi.multilayer_single_tree_combo": "MultiLayerSingleTreeCombo", + "bi.multilayer_single_tree_insert_search_pane": "MultiLayerSingleTreeInsertSearchPane", + "bi.multilayer_single_level_tree": "MultiLayerSingleLevelTree", + "bi.multilayer_single_tree_popup": "MultiLayerSingleTreePopup", + "bi.multilayer_single_tree_trigger": "MultiLayerSingleTreeTrigger", + "bi.multi_select_check_pane": "MultiSelectCheckPane", + "bi.display_selected_list": "DisplaySelectedList", + "bi.multi_select_inner_loader": "MultiSelectInnerLoader", + "bi.multi_select_combo": "MultiSelectCombo", + "bi.multi_select_no_bar_combo": "MultiSelectNoBarCombo", + "bi.multi_select_insert_combo": "MultiSelectInsertCombo", + "bi.multi_select_insert_no_bar_combo": "MultiSelectInsertNoBarCombo", + "bi.multi_select_insert_trigger": "MultiSelectInsertTrigger", + "bi.multi_select_loader": "MultiSelectLoader", + "bi.multi_select_no_bar_loader": "MultiSelectNoBarLoader", + "bi.multi_select_popup_view": "MultiSelectPopupView", + "bi.multi_select_no_bar_popup_view": "MultiSelectNoBarPopupView", + "bi.multi_select_trigger": "MultiSelectTrigger", + "bi.multi_select_search_insert_pane": "MultiSelectSearchInsertPane", + "bi.multi_select_search_loader": "MultiSelectSearchLoader", + "bi.multi_select_search_pane": "MultiSelectSearchPane", + "bi.multi_select_check_selected_button": "MultiSelectCheckSelectedButton", + "bi.select_patch_editor": "SelectPatchEditor", + "bi.multi_select_editor": "MultiSelectEditor", + "bi.multi_select_insert_searcher": "MultiSelectInsertSearcher", + "bi.multi_select_searcher": "MultiSelectSearcher", + "bi.multi_select_check_selected_switcher": "MultiSelectCheckSelectedSwitcher", + "bi.multi_select_insert_list": "MultiSelectInsertList", + "bi.multi_select_insert_no_bar_list": "MultiSelectInsertNoBarList", + "bi.multi_select_list": "MultiSelectList", + "bi.multi_select_tree": "MultiSelectTree", + "bi.multi_select_tree_popup": "MultiSelectTreePopup", + "bi.multi_tree_check_pane": "MultiTreeCheckPane", + "bi.multi_tree_combo": "MultiTreeCombo", + "bi.multi_tree_insert_combo": "MultiTreeInsertCombo", + "bi.multi_tree_list_combo": "MultiTreeListCombo", + "bi.multi_tree_popup_view": "MultiTreePopup", + "bi.multi_tree_check_selected_button": "MultiTreeCheckSelectedButton", + "bi.multi_tree_search_insert_pane": "MultiTreeSearchInsertPane", + "bi.multi_tree_search_pane": "MultiTreeSearchPane", + "bi.multi_list_tree_searcher": "MultiListTreeSearcher", + "bi.multi_tree_searcher": "MultiTreeSearcher", + "bi.number_editor": "NumberEditor", + "bi.number_interval": "NumberInterval", + "bi.number_interval_single_editor": "NumberIntervalSingleEidtor", + "bi.search_multi_text_value_combo": "SearchMultiTextValueCombo", + "bi.search_multi_select_trigger": "SearchMultiSelectTrigger", + "bi.search_multi_select_loader": "SearchMultiSelectLoader", + "bi.search_multi_select_popup_view": "SearchMultiSelectPopupView", + "bi.search_multi_select_searcher": "SearchMultiSelectSearcher", + "bi.select_tree_combo": "SelectTreeCombo", + "bi.select_tree_expander": "SelectTreeExpander", + "bi.select_level_tree": "SelectTreePopup", + "bi.single_select_search_loader": "SingleSelectSearchLoader", + "bi.single_select_search_insert_pane": "SingleSelectSearchInsertPane", + "bi.single_select_search_pane": "SingleSelectSearchPane", + "bi.single_select_combo": "SingleSelectCombo", + "bi.single_select_insert_combo": "SingleSelectInsertCombo", + "bi.single_select_list": "SingleSelectList", + "bi.single_select_loader": "SingleSelectLoader", + "bi.single_select_popup_view": "SingleSelectPopupView", + "bi.single_select_trigger": "SingleSelectTrigger", + "bi.single_select_insert_list": "SingleSelectInsertList", + "bi.single_select_editor": "SingleSelectEditor", + "bi.single_select_searcher": "SingleSelectSearcher", + "bi.sign_text_editor": "SignTextEditor", + "bi.single_slider_button": "SliderIconButton", + "bi.single_slider": "SingleSlider", + "bi.single_slider_label": "SingleSliderLabel", + "bi.single_slider_normal": "SingleSliderNormal", + "bi.single_tree_combo": "SingleTreeCombo", + "bi.single_level_tree": "SingleTreePopup", + "bi.single_tree_trigger": "SingleTreeTrigger", + "bi.text_value_down_list_combo": "TextValueDownListCombo", + "bi.down_list_select_text_trigger": "DownListSelectTextTrigger", + "bi.time_popup": "TimePopup", + "bi.time_combo": "TimeCombo", + "bi.time_trigger": "TimeTrigger", + "bi.date_interval": "DateInterval", + "bi.time_interval": "TimeInterval", + "bi.time_periods": "TimePeriods", + "bi.dynamic_year_card": "DynamicYearCard", + "bi.static_year_card": "StaticYearCard", + "bi.dynamic_year_combo": "DynamicYearCombo", + "bi.dynamic_year_popup": "DynamicYearPopup", + "bi.dynamic_year_trigger": "DynamicYearTrigger", + "bi.year_interval": "YearInterval", + "bi.dynamic_year_month_card": "DynamicYearMonthCard", + "bi.static_year_month_card": "StaticYearMonthCard", + "bi.dynamic_year_month_combo": "DynamicYearMonthCombo", + "bi.dynamic_year_month_popup": "DynamicYearMonthPopup", + "bi.dynamic_year_month_trigger": "DynamicYearMonthTrigger", + "bi.year_month_interval": "YearMonthInterval", + "bi.dynamic_year_quarter_card": "DynamicYearQuarterCard", + "bi.static_year_quarter_card": "StaticYearQuarterCard", + "bi.dynamic_year_quarter_combo": "DynamicYearQuarterCombo", + "bi.dynamic_year_quarter_popup": "DynamicYearQuarterPopup", + "bi.dynamic_year_quarter_trigger": "DynamicYearQuarterTrigger", + "bi.year_quarter_interval": "YearQuarterInterval" +} diff --git a/script/lib/fui.export.txt b/script/lib/fui.export.txt new file mode 100644 index 000000000..b4fa01d49 --- /dev/null +++ b/script/lib/fui.export.txt @@ -0,0 +1,789 @@ +$ +$import +A +AbsoluteCenterLayout +AbsoluteHorizontalLayout +AbsoluteLayout +AbsoluteLeftRightVerticalAdaptLayout +AbsoluteRightVerticalAdaptLayout +AbsoluteVerticalLayout +AbstractLabel +AccurateCalculationModel +Action +ActionFactory +Actions +AdaptiveLayout +AllCountPager +AllValueMultiTextValueCombo +ArrowNode +ArrowTreeGroupNodeCheckbox +Asynctree +AutoVerticalTapeLayout +Axis +BarPopover +BasicButton +BasicTreeItem +BasicTreeNode +Behavior +BehaviorFactory +BlankIconIconTextItem +BlankIconTextIconItem +BlankIconTextItem +BlankSplitChar +BorderLayout +BroadcastController +Broadcasts +Bubble +BubbleCombo +BubblePopupBarView +BubblePopupView +Bubbles +BubblesController +Button +ButtonGroup +ButtonTree +CRYPT_TYPE +Cache +Calendar +CalendarDateItem +CardLayout +CellSizeAndPositionManager +CenterAdaptLayout +CenterLayout +Checkbox +CheckingMarkNode +ClearEditor +Collapse +CollectionView +ColorChooser +ColorChooserPopup +ColorChooserShowButton +ColorChooserTrigger +ColorPicker +ColorPickerButton +ColorPickerEditor +Combo +ComboGroup +Constants +Controller +CustomColorChooser +CustomTree +DOM +Date +DateCalendarPopup +DateInterval +DatePicker +DateTimeCombo +DateTimePopup +DateTimeTrigger +DateTriangleTrigger +DefaultLayout +DefaultTextEditor +DetailPager +Direction +DirectionPager +DisplayTree +DivisionLayout +DownListCombo +DownListGroup +DownListGroupItem +DownListItem +DownListPopup +DownListSelectTextTrigger +Drawer +DrawerController +Drawers +DynamicDateCard +DynamicDateCombo +DynamicDateHelper +DynamicDatePane +DynamicDateParamItem +DynamicDatePopup +DynamicDateTimeCombo +DynamicDateTimePane +DynamicDateTimePopup +DynamicDateTimeSelect +DynamicDateTimeTrigger +DynamicDateTrigger +DynamicYearCard +DynamicYearCombo +DynamicYearMonthCard +DynamicYearMonthCombo +DynamicYearMonthPopup +DynamicYearMonthTrigger +DynamicYearPopup +DynamicYearQuarterCard +DynamicYearQuarterCombo +DynamicYearQuarterPopup +DynamicYearQuarterTrigger +DynamicYearTrigger +EVENT_BLUR +EVENT_RESPONSE_TIME +Editor +EditorIconCheckCombo +EditorTrigger +Element +EventListener +Events +Expander +Farbtastic +File +FirstPlusGroupNode +FirstTreeLeafItem +FirstTreeNodeCheckbox +Fix +FlexCenterLayout +FlexHorizontalCenter +FlexHorizontalCenterAdapt +FlexHorizontalLayout +FlexLeftRightVerticalAdaptLayout +FlexVerticalCenter +FlexVerticalCenterAdapt +FlexVerticalLayout +FlexWrapperCenterLayout +FlexWrapperHorizontalCenter +FlexWrapperHorizontalCenterAdapt +FlexWrapperHorizontalLayout +FlexWrapperVerticalCenter +FlexWrapperVerticalCenterAdapt +FlexWrapperVerticalLayout +FloatAbsoluteCenterLayout +FloatAbsoluteHorizontalLayout +FloatAbsoluteLeftRightVerticalAdaptLayout +FloatAbsoluteRightVerticalAdaptLayout +FloatAbsoluteVerticalLayout +FloatCenterLayout +FloatHorizontalFillLayout +FloatHorizontalLayout +FloatLeftLayout +FloatRightLayout +Fragment +Func +GridLayout +GridView +HTapeLayout +HalfButton +HalfIconButton +Heap +HexColorChooserPopup +HexColorPicker +HexColorPickerEditor +HighlightBehavior +HorizontalAdaptLayout +HorizontalAlign +HorizontalAutoLayout +HorizontalCenterLayout +HorizontalFillLayout +HorizontalFillLayoutLogic +HorizontalLayout +HorizontalLayoutLogic +HorizontalStickyLayout +Html +HtmlLabel +Icon +IconArrowNode +IconButton +IconChangeButton +IconCombo +IconComboPopup +IconComboTrigger +IconLabel +IconTextIconItem +IconTextIconNode +IconTextItem +IconTextNode +IconTextTrigger +IconTextValueCombo +IconTextValueComboPopup +IconTreeLeafItem +IconTrigger +Iframe +ImageButton +ImageCheckbox +ImageRadio +Img +InlineCenterAdaptLayout +InlineHorizontalAdaptLayout +InlineLayout +InlineVerticalAdaptLayout +Input +Instruction +IntervalSlider +Key +KeyCode +LRU +Label +LastPlusGroupNode +LastTreeLeafItem +LastTreeNodeCheckbox +LatticeLayout +LayerController +Layers +Layout +LazyLoader +LeftRightVerticalAdaptLayout +LeftVerticalAdaptLayout +LevelTree +LinearSegment +LinearSegmentButton +Link +LinkHashMap +ListDisplayTree +ListLoader +ListPane +ListPartTree +ListView +Listasynctree +Listtreeview +Loader +LoadingBar +Logic +LogicFactory +LongColorChooserTrigger +MAX +MIN +Maskers +MaskersController +MidPlusGroupNode +MidTreeLeafItem +MidTreeNodeCheckbox +Model +Models +Modules +MonthDateCombo +MonthPopup +MouseMoveTracker +Msg +MultiLayerDownListCombo +MultiLayerDownListPopup +MultiLayerIconArrowNode +MultiLayerIconTreeLeafItem +MultiLayerSelectLevelTree +MultiLayerSelectTreeCombo +MultiLayerSingleLevelTree +MultiLayerSingleTreeCombo +MultiLayerSingleTreeInsertSearchPane +MultiLayerSingleTreePopup +MultiLayerSingleTreeTrigger +MultiPopupView +MultiSelectBar +MultiSelectCheckSelectedSwitcher +MultiSelectCombo +MultiSelectEditor +MultiSelectInsertCombo +MultiSelectInsertList +MultiSelectInsertNoBarCombo +MultiSelectInsertNoBarList +MultiSelectItem +MultiSelectList +MultiSelectNoBarCombo +MultiSelectPopupView +MultiSelectSearchPane +MultiSelectSearcher +MultiSelectTrigger +MultiTreeCombo +MultiTreeInsertCombo +MultiTreeListCombo +MultifileEditor +Navigation +Node +NodeButton +NumberEditor +NumberInterval +OB +Pager +Pane +Panel +PartTree +Plugin +PlusGroupNode +Popover +PopoverController +Popovers +PopupPanel +PopupView +PrefixIntervalTree +Providers +PureText +Queue +Radio +RedMarkBehavior +Region +ResizeController +ResizeDetector +Resizers +ResponsiveFlexHorizontalLayout +ResponsiveFlexWrapperHorizontalLayout +ResponsiveInlineLayout +RightVerticalAdaptLayout +RootTreeLeafItem +Router +RouterView +RouterWidget +SIZE_CONSANTS +STYLE_CONSTANTS +ScalingCellSizeAndPositionManager +SearchEditor +SearchMultiSelectLoader +SearchMultiSelectPopupView +SearchMultiSelectSearcher +SearchMultiSelectTrigger +SearchMultiTextValueCombo +SearchTextValueCombo +SearchTextValueComboPopup +SearchTextValueTrigger +Searcher +SearcherView +SectionManager +Segment +SegmentButton +SelectIconTextTrigger +SelectList +SelectPatchEditor +SelectTextTrigger +SelectTreeCombo +SelectTreeExpander +Selection +Services +ShelterEditor +ShowAction +ShowListener +SignEditor +SignTextEditor +SimpleColorChooser +SimpleColorChooserPopup +SimpleColorPickerEditor +SimpleHexColorChooserPopup +SimpleHexColorPickerEditor +SimpleStateEditor +SimpleTreeView +Single +SingleSelectCombo +SingleSelectEditor +SingleSelectIconTextItem +SingleSelectInsertCombo +SingleSelectInsertList +SingleSelectItem +SingleSelectList +SingleSelectLoader +SingleSelectPopupView +SingleSelectRadioItem +SingleSelectSearchInsertPane +SingleSelectSearchLoader +SingleSelectSearchPane +SingleSelectSearcher +SingleSelectTrigger +SingleSlider +SingleSliderLabel +SingleSliderNormal +SingleTreeCombo +SliderIconButton +SmallSearchEditor +SmallSelectTextTrigger +SmallTextEditor +SmallTextTrigger +SmallTextValueCombo +SortList +StartOfWeek +StateEditor +StaticDatePaneCard +StaticDateTimePaneCard +StaticYearCard +StaticYearMonthCard +StaticYearQuarterCard +Status +Stores +StyleLoaderManager +StyleLoaders +Switch +Switcher +SystemProvider +Tab +TableAdaptLayout +TableLayout +TableLayoutLogic +TdLayout +Text +TextAreaEditor +TextBubblePopupBarView +TextButton +TextEditor +TextIconItem +TextIconNode +TextItem +TextNode +TextTrigger +TextValueCheckCombo +TextValueCheckComboPopup +TextValueCombo +TextValueComboPopup +TextValueDownListCombo +TimeCombo +TimeInterval +TimePeriods +TimePopup +TimeTrigger +Tip +Toast +Tooltip +Tooltips +TooltipsController +Tree +TreeExpander +TreeExpanderPopup +TreeNodeCheckbox +TreeNodeSwitcher +TreeRenderPageService +TreeRenderScrollService +TreeView +Trigger +TriggerIconButton +UUID +VTapeLayout +Vector +VerticalAdaptLayout +VerticalAlign +VerticalCenterLayout +VerticalFillLayout +VerticalLayout +VerticalLayoutLogic +VerticalStickyLayout +VirtualGroup +VirtualGroupList +VirtualList +WheelHandler +Widget +WindowLayout +YearCalendar +YearDateCombo +YearInterval +YearMonthInterval +YearPicker +YearPopup +YearQuarterInterval +_ +_lazyCreateWidget +abc2Int +action +add +addI18n +addI18nFormatter +aesDecrypt +aesEncrypt +after +afterFunc +all +allIndexOf +allKeys +allvaluechooser +any +appendQuery +array2String +aspect +assert +average +backAny +backEach +backEvery +backFind +backFindKey +before +beforeFunc +bind +camelize +chain +changeI18n +checkDateLegal +checkDateVoid +chunk +cjkDecode +cjkEncode +cjkEncodeDO +clamp +clone +cloneDeep +compact +component +concat +config +constant +contains +contentFormat +count +countBy +create +createDistinctName +createElement +createItems +createWidget +createWidgets +date2Str +debounce +decode +decodeURIComponent +decrypt +deepClone +deepContains +deepDiff +deepExtend +deepIndexOf +deepRemove +deepUnique +deepWithout +defaults +defer +delay +difference +div +each +empty +emptyFn +emptyStr +encode +encodeURIComponent +encrypt +endWith +escape +every +extend +extendOwn +filter +find +findIndex +findKey +findLastIndex +findWhere +first +firstKey +firstObject +flatten +form +format +formatEL +freeze +functions +get +getDate +getDayOfYear +getEncodeURL +getFullDayName +getGBWidth +getIEVersion +getLastDateOfMont +getLastDateOfMonth +getMinimumFontSize +getMonthDays +getMonthName +getOffsetDate +getOffsetMonth +getOffsetQuarter +getQuarter +getQuarterEndDate +getQuarterName +getQuarterStartDate +getQuarterStartMonth +getQuery +getReference +getResource +getSafariVersion +getSearchResult +getShortDayName +getSortedResult +getTime +getTimezone +getWeekEndDate +getWeekNumber +getWeekStartDate +groupBy +h +has +history +htmlDecode +htmlEncode +hyphenate +i18nText +indexBy +indexOf +inherit +init +initial +int2Abc +intersection +inverse +invert +invoke +isArguments +isArray +isBoolean +isCapitalEqual +isChrome +isDate +isDeepMatch +isEdge +isElement +isEmpty +isEmptyArray +isEmptyObject +isEmptyString +isEndWithBlank +isEqual +isError +isEven +isFinite +isFireFox +isFloat +isFunction +isIE +isIE9Below +isInteger +isKey +isKhtml +isLeapYear +isLiteral +isMac +isMatch +isNaN +isNaturalNumber +isNegativeInteger +isNotEmptyArray +isNotEmptyObject +isNotEmptyString +isNotNull +isNull +isNumber +isNumeric +isObject +isOdd +isOpera +isPlainObject +isPositiveInteger +isPromise +isRegExp +isSafari +isString +isSupportCss3 +isUndefined +isWidget +isWidthOrHeight +isWindow +isWindows +iteratee +jQuery +jsonDecode +jsonEncode +keys +last +lastIndexOf +lastKey +lastObject +leftPad +makeArray +makeArrayByArray +makeFirstPY +makeObject +map +mapObject +matcher +max +min +model +module +mount +mul +nextTick +object +object2Date +object2Number +object2Time +omit +onBeforeMount +onBeforeUnmount +onMounted +onUnmounted +once +packageItems +pairs +parseDateTime +parseFloat +parseFmt +parseInt +parseSafeInt +partial +partition +perfectStart +pick +pickBy +pixFormat +pixRatio +pixUnit +pluck +point +print +property +propertyOf +provider +pushArray +pushDistinct +pushDistinctArray +random +range +reduce +reduceRight +reject +remove +removeAt +replaceAll +rest +result +sample +service +set +shortcut +shuffle +size +some +sortBy +sortedIndex +specialCharsMap +startWith +store +str2Date +string2Array +stripEL +stripQuotes +sub +sum +take +takeRight +tap +throttle +toArray +toLowerCase +toPix +toUpperCase +trans2Element +treeValueChooser +trim +unescape +union +uniq +uniqBy +uniqueId +unzip +useContext +useInWorker +useStore +valueChooser +values +warn +watch +where +without +wrap +zIndex_layer +zIndex_masker +zIndex_popover +zIndex_popup +zIndex_tip +zip +zipObject \ No newline at end of file diff --git a/script/lib/utils.js b/script/lib/utils.js new file mode 100644 index 000000000..35b103acf --- /dev/null +++ b/script/lib/utils.js @@ -0,0 +1,24 @@ +const fs = require("fs"); +const path = require("path"); + +const defaultConfig = { + handler: () => {}, + filter: filePath => filePath.endsWith(".js"), +}; + +function tranvase(filePath, config) { + const { handler, filter } = Object.assign(defaultConfig, config); + if (fs.statSync(filePath).isDirectory()) { + fs.readdirSync(filePath).forEach(fileName => { + tranvase(path.resolve(filePath, fileName), config); + }); + } else if (filter(filePath)) { + handler(filePath); + } +} + +function getFuiExports() {} + +function getFuiComponent() {} + +module.exports = { tranvase, getFuiComponent, getFuiExports }; diff --git a/script/rename.js b/script/rename.js new file mode 100644 index 000000000..ec5d4691f --- /dev/null +++ b/script/rename.js @@ -0,0 +1,17 @@ +/** + * 将 FineUI 模块名从 fineui 改成 @fui/core + */ +const { tranvase } = require("./lib/utils"); +const fs = require("fs"); + +const config = { + handler: filePath => { + let content = fs.readFileSync(filePath).toString(); + content = content.replace(/(?<=from ["|'])fineui(?=["|'])/g, str => { + return "@fui/core"; + }); + fs.writeFileSync(filePath, content); + }, +}; + +tranvase(process.argv[2], config); diff --git a/server.js b/server.js deleted file mode 100644 index a9fd0cede..000000000 --- a/server.js +++ /dev/null @@ -1,13 +0,0 @@ -/*eslint no-console:0 */ -'use strict'; -const express = require('express'); -const open = require('open'); -const fs=require("fs"); -const app = express(); -const port = 3000; - -app.use(express.static("./")); -app.listen(port, function() { - console.log("server start"); - open('http://localhost:' + port + '/index.html'); -}); diff --git a/src/base/0.base.js b/src/base/0.base.js deleted file mode 100644 index d79ca192d..000000000 --- a/src/base/0.base.js +++ /dev/null @@ -1,23 +0,0 @@ -import { - BroadcastController, - BubblesController, - DrawerController, - LayerController, - MaskersController, - PopoverController, - ResizeController, - TooltipsController, - StyleLoaderManager -} from "../core"; - -const Resizers = new ResizeController(); -const Layers = new LayerController(); -const Maskers = new MaskersController(); -const Bubbles = new BubblesController(); -const Tooltips = new TooltipsController(); -const Popovers = new PopoverController(); -const Drawers = new DrawerController(); -const Broadcasts = new BroadcastController(); -const StyleLoaders = new StyleLoaderManager(); - -export { Resizers, Layers, Maskers, Bubbles, Tooltips, Popovers, Drawers, Broadcasts, StyleLoaders }; diff --git a/src/base/1.pane.js b/src/base/1.pane.js deleted file mode 100644 index 3342edb75..000000000 --- a/src/base/1.pane.js +++ /dev/null @@ -1,160 +0,0 @@ -import { - AbsoluteCenterLayout, - CenterAdaptLayout, - HorizontalAdaptLayout, - VerticalLayout, - Widget, - shortcut, - isNotEmptyString, - extend, - isNull, - isEmpty, - createWidget, - Providers, - i18nText, - emptyFn -} from "@/core"; -import { Label, Text } from "./single"; -import { Layers } from "@/base/0.base"; - -/** - * 当没有元素时有提示信息的view - * - * Created by GUY on 2015/9/8. - * @class Pane - * @extends Widget - * @abstract - */ - -@shortcut() -export class Pane extends Widget { - static xtype = "bi.pane"; - static EVENT_LOADED = "EVENT_LOADED"; - static EVENT_LOADING = "EVENT_LOADING"; - - _defaultConfig() { - return extend(super._defaultConfig(), { - _baseCls: "bi-pane", - tipText: i18nText("BI-No_Selected_Item"), - loadingText: "", - loadingSize: "small", - overlap: true, - onLoaded: emptyFn, - }); - } - - _assertTip() { - if (!this._tipText) { - createWidget({ - type: AbsoluteCenterLayout.xtype, - element: this, - items: [ - { - type: Label.xtype, - ref: _ref => { - this._tipText = _ref; - }, - cls: "bi-tips", - text: this.options.tipText, - height: 25, - } - ], - }); - } - } - - loading() { - const o = this.options; - const loadingAnimation = createWidget( - Providers.getProvider("bi.provider.system").getLoading({ - loadingSize: o.loadingSize, - context: this, - }) - ); - // pane在同步方式下由items决定tipText的显示与否 - // loading的异步情况下由loaded后对面板的populate的时机决定 - this.setTipVisible(false); - if (o.overlap === true) { - if (!Layers.has(`${this.getName()}-loading`)) { - createWidget({ - type: CenterAdaptLayout.xtype, - cls: "loading-container", - items: this._getLoadingTipItems(loadingAnimation), - element: Layers.make(`${this.getName()}-loading`, this), - }); - } - Layers.show(`${this.getName()}-loading`); - } else if (isNull(this._loading)) { - loadingAnimation.element.css("zIndex", 1); - createWidget({ - type: CenterAdaptLayout.xtype, - element: this, - cls: "loading-container", - items: this._getLoadingTipItems(loadingAnimation), - }); - } - this.fireEvent(Pane.EVENT_LOADING); - this.element.addClass("loading-status"); - } - - _getSize(v) { - return Math.ceil(v / (this.options.loadingSize === "small" ? 2 : 1)); - } - - _getLoadingTipItems(loadingTip) { - const o = this.options; - const loadingTipItems = [ - { - type: HorizontalAdaptLayout.xtype, - items: [loadingTip], - } - ]; - isNotEmptyString(o.loadingText) && - loadingTipItems.push({ - type: Text.xtype, - text: o.loadingText, - tgap: this._getSize(10), - }); - - return [ - { - type: VerticalLayout.xtype, - ref: _ref => { - this._loading = _ref; - }, - items: loadingTipItems, - } - ]; - } - - loaded() { - Layers.remove(`${this.getName()}-loading`); - this._loading && this._loading.destroy(); - this.options.onLoaded(); - this.fireEvent(Pane.EVENT_LOADED); - this.element.removeClass("loading-status"); - } - - check() { - this.setTipVisible(isEmpty(this.options.items)); - } - - setTipVisible(b) { - if (b === true) { - this._assertTip(); - this._tipText && this._tipText.setVisible(true); - } else { - this._tipText && this._tipText.setVisible(false); - } - } - - setTipText(text) { - this._assertTip(); - this._tipText.setText(text); - } - - populate(items) { - this.options.items = items || []; - this.check(); - } -} diff --git a/src/base/pager/pager.js b/src/base/pager/pager.js deleted file mode 100644 index c775e4ac9..000000000 --- a/src/base/pager/pager.js +++ /dev/null @@ -1,346 +0,0 @@ -import { - HorizontalLayout, - Widget, - shortcut, - extend, - emptyFn, - result, - isKey, - createWidget, - map, - stripEL, - formatEL, - Controller, - Events, - MIN, - MAX -} from "@/core"; -import { Label } from "../single"; -import { ButtonGroup } from "../combination"; - -/** - * 分页控件 - * - * Created by GUY on 2015/8/31. - * @class Pager - * @extends Widget - */ - -@shortcut() -export class Pager extends Widget { - _defaultConfig() { - return extend(super._defaultConfig(...arguments), { - baseCls: "bi-pager", - behaviors: {}, - layouts: [ - { - type: HorizontalLayout.xtype, - hgap: 10, - vgap: 0, - } - ], - - dynamicShow: true, // 是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态 - // dynamicShow为false时以下两个有用 - dynamicShowFirstLast: false, // 是否动态显示首页、尾页 - dynamicShowPrevNext: false, // 是否动态显示上一页、下一页 - pages: false, // 总页数 - curr: () => 1, // 初始化当前页 - groups: 0, // 连续显示分页数 - jump: emptyFn, // 分页的回调函数 - first: false, // 是否显示首页 - last: false, // 是否显示尾页 - prev: "上一页", - next: "下一页", - - firstPage: 1, - lastPage: () => - // 在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法 - 1, - hasPrev: emptyFn, // pages不可用时有效 - hasNext: emptyFn, // pages不可用时有效 - }); - } - - static xtype = "bi.pager"; - static EVENT_CHANGE = "EVENT_CHANGE"; - static EVENT_AFTER_POPULATE = "EVENT_AFTER_POPULATE"; - render() { - this.currPage = result(this.options, "curr"); - // 翻页太灵敏 - // this._lock = false; - // this._debouce = debounce(function () { - // self._lock = false; - // }, 300); - this._populate(); - } - - _populate() { - const o = this.options, - view = [], - dict = {}; - const { dynamicShow, dynamicShowPrevNext, hasPrev, dynamicShowFirstLast, hasNext, behaviors, layouts, jump } = - this.options; - this.empty(); - const pages = result(o, "pages"); - const curr = result(this, "currPage"); - let groups = result(o, "groups"); - let first = result(o, "first"); - let last = result(o, "last"); - const prev = result(o, "prev"); - const next = result(o, "next"); - - if (pages === false) { - groups = 0; - first = false; - last = false; - } else { - groups > pages && (groups = pages); - } - - // 计算当前组 - dict.index = Math.ceil((curr + (groups > 1 && groups !== pages ? 1 : 0)) / (groups === 0 ? 1 : groups)); - - // 当前页非首页,则输出上一页 - if (((!dynamicShow && !dynamicShowPrevNext) || curr > 1) && prev !== false) { - if (isKey(prev)) { - view.push({ - text: prev, - value: "prev", - disabled: pages === false ? hasPrev(curr) === false : !(curr > 1 && prev !== false), - }); - } else { - view.push({ - el: extend( - { - disabled: pages === false ? hasPrev(curr) === false : !(curr > 1 && prev !== false), - }, - prev - ), - }); - } - } - - // 当前组非首组,则输出首页 - if (((!dynamicShow && !dynamicShowFirstLast) || (dict.index > 1 && groups !== 0)) && first) { - view.push({ - text: first, - value: "first", - disabled: !(dict.index > 1 && groups !== 0), - }); - if (dict.index > 1 && groups !== 0 && groups !== pages - 1) { - view.push({ - type: Label.xtype, - cls: "page-ellipsis", - text: "\u2026", - }); - } - } - - // 输出当前页组 - dict.poor = Math.floor((groups - 1) / 2); - dict.start = dict.index > 1 ? curr - dict.poor : 1; - dict.end = - dict.index > 1 - ? (function () { - const max = curr + (groups - dict.poor - 1); - - return max > pages ? pages : max; - }()) - : groups; - if (dict.end - dict.start < groups - 1) { - // 最后一组状态 - dict.start = dict.end - groups + 1; - } - let s = dict.start, - e = dict.end; - if (first && last && dict.index > 1 && groups !== 0 && pages > groups && dict.end < pages && groups !== 0) { - s++; - e--; - } - for (; s <= e; s++) { - if (s === curr) { - view.push({ - text: s, - value: s, - selected: true, - }); - } else { - view.push({ - text: s, - value: s, - }); - } - } - - // 总页数大于连续分页数,且当前组最大页小于总页,输出尾页 - if (((!dynamicShow && !dynamicShowFirstLast) || (pages > groups && dict.end < pages && groups !== 0)) && last) { - if (pages > groups && dict.end < pages && groups !== 0 && groups !== pages - 1) { - view.push({ - type: Label.xtype, - cls: "page-ellipsis", - text: "\u2026", - }); - } - view.push({ - text: last, - value: "last", - disabled: !(pages > groups && dict.end < pages && groups !== 0), - }); - } - - // 当前页不为尾页时,输出下一页 - dict.flow = !prev && groups === 0; - if ((!dynamicShow && !dynamicShowPrevNext && next) || (curr !== pages && next) || dict.flow) { - view.push( - (function () { - if (isKey(next)) { - if (pages === false) { - return { text: next, value: "next", disabled: hasNext(curr) === false }; - } - - return dict.flow && curr === pages - ? { text: next, value: "next", disabled: true } - : { text: next, value: "next", disabled: !((curr !== pages && next) || dict.flow) }; - } - - return { - el: extend( - { - disabled: - pages === false - ? hasNext(curr) === false - : !((curr !== pages && next) || dict.flow), - }, - next - ), - }; - })() - ); - } - - this.button_group = createWidget({ - type: ButtonGroup.xtype, - element: this, - items: map(view, (idx, v) => { - v = extend( - { - cls: "bi-list-item-select bi-border-radius", - height: 23, - hgap: v.el ? 0 : 10, - stopPropagation: true, - }, - stripEL(v) - ); - - return formatEL(v); - }), - behaviors, - layouts, - }); - this.button_group.on(Controller.EVENT_CHANGE, (type, value, obj, ...args) => { - // if (self._lock === true) { - // return; - // } - // self._lock = true; - // self._debouce(); - if (type === Events.CLICK) { - const v = this.button_group.getValue()[0]; - switch (v) { - case "first": - this.currPage = 1; - break; - case "last": - this.currPage = pages; - break; - case "prev": - this.currPage--; - break; - case "next": - this.currPage++; - break; - default: - this.currPage = v; - break; - } - jump.apply(this, [ - { - pages, - curr: this.currPage, - } - ]); - this._populate(); - this.fireEvent(Pager.EVENT_CHANGE, obj); - } - this.fireEvent(Controller.EVENT_CHANGE, type, value, obj, ...args); - }); - this.fireEvent(Pager.EVENT_AFTER_POPULATE); - } - - getCurrentPage() { - return this.currPage; - } - - setAllPages(pages) { - this.options.pages = pages; - this._populate(); - } - - hasPrev(v) { - v || (v = 1); - const { pages, hasPrev } = this.options; - - return pages === false ? hasPrev(v) : v > 1; - } - - hasNext(v) { - v || (v = 1); - const { pages, hasNext } = this.options; - - return pages === false ? hasNext(v) : v < pages; - } - - setValue(v) { - const o = this.options; - const { pages } = this.options; - v = v || 0; - v = v < 1 ? 1 : v; - if (pages === false) { - const lastPage = result(o, "lastPage"); - let firstPage = 1; - this.currPage = - v > lastPage ? lastPage : ((firstPage = result(o, "firstPage")), v < firstPage ? firstPage : v); - } else { - v = v > pages ? pages : v; - this.currPage = v; - } - this._populate(); - } - - getValue() { - const val = this.button_group.getValue()[0]; - switch (val) { - case "prev": - return -1; - case "next": - return 1; - case "first": - return MIN; - case "last": - return MAX; - default: - return val; - } - } - - attr(key, value) { - super.attr(...arguments); - if (key === "curr") { - this.currPage = result(this.options, "curr"); - } - } - - populate() { - this._populate(); - } -} diff --git a/src/case/ztree/treeview.js b/src/case/ztree/treeview.js deleted file mode 100644 index 080821f0f..000000000 --- a/src/case/ztree/treeview.js +++ /dev/null @@ -1,618 +0,0 @@ -import { - cjkEncodeDO, - Controller, - createWidget, - emptyFn, - Events, - extend, - UUID, - isNotNull, - jsonEncode, - delay, - each, - replaceAll, - isUndefined, - isNotEmptyArray, - deepClone, - map, - Tree, - isNull, - shortcut, - VerticalLayout, - Layout, - DefaultLayout, - some, - Widget, - STYLE_CONSTANTS -} from "@/core"; -import { Msg, Pane, LoadingBar, Text } from "@/base"; -import $ from "jquery"; - -@shortcut() -export class TreeView extends Pane { - static xtype = "bi.tree_view"; - static REQ_TYPE_INIT_DATA = 1; - static REQ_TYPE_ADJUST_DATA = 2; - static REQ_TYPE_SELECT_DATA = 3; - static REQ_TYPE_GET_SELECTED_DATA = 4; - static EVENT_CHANGE = "EVENT_CHANGE"; - static EVENT_INIT = Events.INIT; - static EVENT_AFTERINIT = Events.AFTERINIT; - - _defaultConfig() { - return extend(super._defaultConfig(...arguments), { - _baseCls: "bi-tree", - paras: { - selectedValues: {}, - }, - itemsCreator: emptyFn, - showLine: true, - }); - } - - _init() { - super._init(...arguments); - const o = this.options; - this._stop = false; - - this._createTree(); - this.tip = createWidget({ - type: LoadingBar.xtype, - invisible: true, - handler: () => this._loadMore(), - }); - createWidget({ - type: VerticalLayout.xtype, - scrollable: true, - scrolly: false, - element: this, - items: [this.tip], - }); - if (isNotNull(o.value)) { - this.setSelectedValue(o.value); - } - } - - _createTree() { - this.id = `bi-tree${UUID()}`; - if (this.nodes) { - this.nodes.destroy(); - } - if (this.tree) { - this.tree.destroy(); - } - this.tree = createWidget({ - type: Layout.xtype, - element: ``, - }); - createWidget({ - type: DefaultLayout.xtype, - element: this, - items: [this.tree], - }); - } - - // 选择节点触发方法 - _selectTreeNode(treeId, treeNode) { - this.fireEvent(Controller.EVENT_CHANGE, Events.CLICK, treeNode, this); - this.fireEvent(TreeView.EVENT_CHANGE, treeNode, this); - } - - // 配置属性 - _configSetting() { - const paras = this.options.paras; - const self = this; - const o = this.options; - const setting = { - async: { - enable: true, - url: getUrl, - autoParam: ["id", "name"], // 节点展开异步请求自动提交id和name - otherParam: cjkEncodeDO(paras), // 静态参数 - }, - check: { - enable: true, - }, - data: { - key: { - title: "title", - name: "text", // 节点的name属性替换成text - }, - simpleData: { - enable: true, // 可以穿id,pid属性的对象数组 - }, - }, - view: { - showIcon: false, - expandSpeed: "", - nameIsHTML: true, // 节点可以用html标签代替 - dblClickExpand: false, - showLine: o.showLine, - }, - callback: { - beforeExpand, - onAsyncSuccess, - onAsyncError, - beforeCheck, - onCheck, - onExpand, - onCollapse, - onClick, - }, - }; - const className = "dark", - perTime = 100; - - function onClick(event, treeId, treeNode) { - // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 - let checked = treeNode.checked; - const status = treeNode.getCheckStatus(); - if (status.half === true && status.checked === true) { - checked = false; - } - // 更新此node的check状态, 影响父子关联,并调用beforeCheck和onCheck回调 - self.nodes.checkNode(treeNode, !checked, true, true); - } - - function getUrl(treeId, treeNode) { - const parentNode = self._getParentValues(treeNode); - treeNode.times = treeNode.times || 1; - const param = `id=${treeNode.id}×=${treeNode.times++}&parentValues= ${_global.encodeURIComponent( - jsonEncode(parentNode) - )}&checkState=${_global.encodeURIComponent(jsonEncode(treeNode.getCheckStatus()))}`; - - return `&${param}`; - } - - function beforeExpand(treeId, treeNode) { - if (!treeNode.isAjaxing) { - if (!treeNode.children) { - treeNode.times = 1; - ajaxGetNodes(treeNode, "refresh"); - } - - return true; - } - Msg.toast("Please Wait。", { - level: "warning", - }); // 不展开节点,也不触发onExpand事件 - - return false; - } - - function onAsyncSuccess(event, treeId, treeNode, msg) { - treeNode.halfCheck = false; - if (!msg || msg.length === 0 || /^[\s,\S]*<\/html>$/gi.test(msg) || self._stop) { - return; - } - const zTree = self.nodes; - const totalCount = treeNode.count || 0; - - // 尝试去获取下一组节点,若获取值为空数组,表示获取完成 - // TODO by GUY - if (treeNode.children.length > totalCount) { - treeNode.count = treeNode.children.length; - delay(() => { - ajaxGetNodes(treeNode); - }, perTime); - } else { - // treeNode.icon = ""; - zTree.updateNode(treeNode); - zTree.selectNode(treeNode.children[0]); - // className = (className === "dark" ? "":"dark"); - } - } - - function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) { - const zTree = self.nodes; - Msg.toast("Error!", "warning"); - // treeNode.icon = ""; - // zTree.updateNode(treeNode); - } - - function ajaxGetNodes(treeNode, reloadType) { - const zTree = self.nodes; - if (reloadType === "refresh") { - zTree.updateNode(treeNode); // 刷新一下当前节点,如果treeNode.xxx被改了的话 - } - zTree.reAsyncChildNodes(treeNode, reloadType, true); // 强制加载子节点,reloadType === refresh为先清空再加载,否则为追加到现有子节点之后 - } - - function beforeCheck(treeId, treeNode) { - if (treeNode.disabled) { - return false; - } - // 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下 - const status = treeNode.getCheckStatus(); - treeNode.halfCheck = false; - if (treeNode.checked === true) { - // 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy - // 所有的半选状态都需要取消halfCheck=true的情况 - function track(children) { - each(children, (i, ch) => { - if (ch.halfCheck === true) { - ch.halfCheck = false; - track(ch.children); - } - }); - } - - track(treeNode.children); - const treeObj = self.nodes; - const nodes = treeObj.getSelectedNodes(); - $.each(nodes, (index, node) => { - node.halfCheck = false; - }); - } - // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 - if (status.half === true && status.checked === true) { - treeNode.checked = false; - } - } - - function onCheck(event, treeId, treeNode) { - if (treeNode.disabled) { - return false; - } - self._selectTreeNode(treeId, treeNode); - } - - function onExpand(event, treeId, treeNode) { - treeNode.halfCheck = false; - } - - function onCollapse(event, treeId, treeNode) {} - - return setting; - } - - _getParentValues(treeNode) { - if (!treeNode.getParentNode()) { - return []; - } - const parentNode = treeNode.getParentNode(); - let result = this._getParentValues(parentNode); - result = result.concat([this._getNodeValue(parentNode)]); - - return result; - } - - _getNodeValue(node) { - // 去除标红 - return isUndefined(node.value) ? replaceAll(node.text.replace(/<[^>]+>/g, ""), " ", " ") : node.value; - } - - // 获取半选框值 - _getHalfSelectedValues(map, node) { - const self = this; - const checkState = node.getCheckStatus(); - // 将未选的去掉 - if (checkState.checked === false && checkState.half === false) { - return; - } - // 如果节点已展开,并且是半选 - if (isNotEmptyArray(node.children) && checkState.half === true) { - const children = node.children; - each(children, (i, ch) => { - self._getHalfSelectedValues(map, ch); - }); - - return; - } - const parent = node.parentValues || self._getParentValues(node); - const path = parent.concat(this._getNodeValue(node)); - // 当前节点是全选的,因为上面的判断已经排除了不选和半选 - if (isNotEmptyArray(node.children) || checkState.half === false) { - this._buildTree(map, path); - - return; - } - // 剩下的就是半选不展开的节点,因为不知道里面是什么情况,所以借助selectedValues(这个是完整的选中情况) - const storeValues = deepClone(this.options.paras.selectedValues); - const treeNode = this._getTree(storeValues, path); - this._addTreeNode(map, parent, this._getNodeValue(node), treeNode); - } - - // 获取的是以values最后一个节点为根的子树 - _getTree(map, values) { - let cur = map; - some(values, (i, value) => { - if (cur[value] == null) { - return true; - } - cur = cur[value]; - }); - - return cur; - } - - // 以values为path一路向里补充map, 并在末尾节点添加key: value节点 - _addTreeNode(map, values, key, value) { - let cur = map; - each(values, (i, value) => { - if (cur[value] == null) { - cur[value] = {}; - } - cur = cur[value]; - }); - cur[key] = value; - } - - // 构造树节点 - _buildTree(map, values) { - let cur = map; - each(values, (i, value) => { - if (cur[value] == null) { - cur[value] = {}; - } - cur = cur[value]; - }); - } - - // 获取选中的值 - _getSelectedValues() { - const self = this; - const hashMap = {}; - const rootNoots = this.nodes.getNodes(); - track(rootNoots); // 可以看到这个方法没有递归调用,所以在_getHalfSelectedValues中需要关心全选的节点 - function track(nodes) { - each(nodes, (i, node) => { - const checkState = node.getCheckStatus(); - if (checkState.checked === true || checkState.half === true) { - if (checkState.half === true) { - self._getHalfSelectedValues(hashMap, node); - } else { - const parentValues = node.parentValues || self._getParentValues(node); - const values = parentValues.concat([self._getNodeValue(node)]); - self._buildTree(hashMap, values); - } - } - }); - } - - return hashMap; - } - - // 处理节点 - _dealWidthNodes(nodes) { - const self = this, - o = this.options; - const ns = Tree.arrayFormat(nodes); - - return map(ns, (i, n) => { - const newNode = extend({}, n); - newNode.isParent = newNode.isParent || newNode.parent; - // n.value = BI.isUndefined(n.value) ? n.text : n.value; - // n.text = BI.isUndefined(n.text) ? n.value : n.text; - // if (n.text === null) { - // n.text = ""; - // } - if (isNull(newNode.title)) { - newNode.title = newNode.text; - } - if (newNode.disabled) { - newNode.title = newNode.warningTitle || newNode.title; - } - const text = createWidget( - extend( - { - cls: "tree-node-text", - tagName: "span", - whiteSpace: "nowrap", - root: true, - keyword: o.paras.keyword, - }, - newNode, - { - type: Text.xtype, - text: replaceAll(newNode.text, "\n", " "), - } - ) - ); - const fragment = Widget._renderEngine.createElement("
"); - fragment.append(text.element[0]); - newNode.text = fragment.html(); - // // 处理标红 - // if (BI.isNotNull(n.text)) { - // if (BI.isKey(o.paras.keyword)) { - // n.text = $("
").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html(); - // } else { - // n.text = BI.htmlEncode(BI.Text.formatText(n.text + "")); - // } - // } - - return newNode; - }); - } - - _loadMore() { - const self = this, - o = this.options; - this.tip.setLoading(); - const op = extend({}, o.paras, { - times: ++this.times, - }); - o.itemsCreator(op, res => { - if (self._stop === true) { - return; - } - const hasNext = !!res.hasNext, - nodes = res.items || []; - - if (!hasNext) { - self.tip.setEnd(); - } else { - self.tip.setLoaded(); - } - if (nodes.length > 0) { - self.nodes.addNodes(null, self._dealWidthNodes(nodes)); - } - }); - } - - // 生成树内部方法 - _initTree(setting) { - const self = this, - o = this.options; - self.fireEvent(Events.INIT); - this.times = 1; - const tree = this.tree; - tree.empty(); - this.loading(); - this.tip.setVisible(false); - - function callback(nodes) { - if (self._stop === true) { - return; - } - self.nodes = $.fn.zTree.init(tree.element, setting, nodes); - } - - const op = extend({}, o.paras, { - times: 1, - }); - - o.itemsCreator(op, res => { - if (self._stop === true) { - return; - } - const hasNext = !!res.hasNext, - nodes = res.items || []; - if (nodes.length > 0) { - callback(self._dealWidthNodes(nodes)); - } - self.setTipVisible(nodes.length <= 0); - self.loaded(); - if (!hasNext) { - self.tip.invisible(); - } else { - self.tip.setLoaded(); - } - op.times === 1 && self.fireEvent(Events.AFTERINIT); - }); - } - - // 构造树结构, - initTree(nodes, setting) { - const defaultSetting = { - async: { - enable: false, - }, - check: { - enable: false, - }, - data: { - key: { - title: "title", - name: "text", - }, - simpleData: { - enable: true, - }, - }, - view: { - showIcon: false, - expandSpeed: "", - nameIsHTML: true, - }, - callback: {}, - }; - this.nodes = $.fn.zTree.init(this.tree.element, setting || defaultSetting, nodes); - } - - start() { - this._stop = false; - } - - stop() { - this._stop = true; - } - - // 生成树方法 - stroke(config) { - delete this.options.keyword; - extend(this.options.paras, config); - const setting = this._configSetting(); - this._createTree(); - this.start(); - this._initTree(setting); - } - - populate() { - this.stroke(...arguments); - } - - hasChecked() { - const treeObj = this.nodes; - - return treeObj.getCheckedNodes(true).length > 0; - } - - checkAll(checked) { - function setNode(children) { - each(children, (i, child) => { - child.halfCheck = false; - setNode(child.children); - }); - } - - if (!this.nodes) { - return; - } - - each(this.nodes.getNodes(), (i, node) => { - node.halfCheck = false; - setNode(node.children); - }); - this.nodes.checkAllNodes(checked); - } - - expandAll(flag) { - this.nodes && this.nodes.expandAll(flag); - } - - // 设置树节点的状态 - setValue(value, param) { - this.checkAll(false); - this.updateValue(value, param); - this.refresh(); - } - - setSelectedValue(value) { - this.options.paras.selectedValues = deepClone(value || {}); - } - - updateValue(values, param) { - if (!this.nodes) { - return; - } - param || (param = "value"); - const treeObj = this.nodes; - each(values, (v, op) => { - const nodes = treeObj.getNodesByParam(param, v, null); - each(nodes, (j, node) => { - extend(node, { checked: true }, op); - treeObj.updateNode(node); - }); - }); - } - - refresh() { - this.nodes && this.nodes.refresh(); - } - - getValue() { - if (!this.nodes) { - return null; - } - - return this._getSelectedValues(); - } - - destroyed() { - this.stop(); - this.nodes && this.nodes.destroy(); - } -} diff --git a/src/component/index.js b/src/component/index.js deleted file mode 100644 index 97b0ba2c6..000000000 --- a/src/component/index.js +++ /dev/null @@ -1,21 +0,0 @@ -export * as allvaluechooser from "./allvaluechooser"; -export * as form from "./form"; -export * as valueChooser from "./valuechooser"; -export * as treeValueChooser from "./treevaluechooser"; -export { AllValueMultiTextValueCombo } from "./allvaluemultitextvaluecombo/allvalue.multitextvalue.combo"; - -// Object.assign(BI, { -// ...allvaluechooser, -// ...form, -// ...valueChooser, -// ......treeValueChooser, -// AllValueMultiTextValueCombo, -// }); - -// export * from "./allvaluechooser"; -// export * from "./form"; -// export * from "./valuechooser"; -// export * from "./treevaluechooser"; -// export { -// AllValueMultiTextValueCombo -// }; diff --git a/src/core/2.base.js b/src/core/2.base.js deleted file mode 100644 index dce352030..000000000 --- a/src/core/2.base.js +++ /dev/null @@ -1,1636 +0,0 @@ -/** - * 基本函数 - * Create By GUY 2014\11\17 - * - */ -import _ from "./1.lodash"; -import { Widget } from "./4.widget"; -import { createWidget } from "./5.inject"; -import { prepares, _global } from "./0.foundation"; -import { CRYPT_TYPE, aesDecrypt, aesEncrypt } from "./structure/aes"; - - -/** - * todo: 理论这么写,逻辑没问题,摇个人把这个 BI 干掉 - */ -const BI = { _ }; - -function traverse(func, context) { - return function (value, key, obj) { - return func.call(context, key, value, obj); - }; -} -function _apply(name) { - return function () { - return BI._[name](...arguments); - }; -} -function _applyFunc(name) { - return function () { - const args = Array.prototype.slice.call(arguments, 0); - args[1] = BI._.isFunction(args[1]) - ? traverse(args[1], args[2]) - : args[1]; - - return BI._[name](...args); - }; -} - -export function assert(v, is) { - if (isFunction(is)) { - if (!is(v)) { - throw new Error(`${v} error`); - } else { - return true; - } - } - if (!isArray(is)) { - is = [is]; - } - if (!deepContains(is, v)) { - throw new Error(`${v} error`); - } - - return true; -} - -export function warn(message) { - console.warn(message); -} - -export function UUID() { - const f = [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "a", - "b", - "c", - "d", - "e", - "f" - ]; - let str = ""; - for (let i = 0; i < 16; i++) { - const r = _global.parseInt(f.length * Math.random(), 10); - str += f[r]; - } - - return str; -} - -export function isWidget(widget) { - return widget instanceof Widget; -} - -export function createWidgets(items, options, context) { - if (!isArray(items)) { - throw new Error("items必须是数组", items); - } - if (isWidget(options)) { - context = options; - options = {}; - } else { - options || (options = {}); - } - - return map(flatten(items), (i, item) => - createWidget(item, deepClone(options), context) - ); -} - -export function createItems(data, innerAttr, outerAttr) { - innerAttr = isArray(innerAttr) - ? innerAttr - : makeArray(flatten(data).length, innerAttr || {}); - outerAttr = isArray(outerAttr) - ? outerAttr - : makeArray(flatten(data).length, outerAttr || {}); - - return map(data, (i, item) => { - if (isArray(item)) { - return createItems(item, innerAttr, outerAttr); - } - if (item instanceof Widget) { - return extend({}, innerAttr.shift(), outerAttr.shift(), { - type: null, - el: item, - }); - } - if (innerAttr[0] instanceof Widget) { - outerAttr.shift(); - - return extend({}, item, { - el: innerAttr.shift(), - }); - } - if (item.el instanceof Widget) { - innerAttr.shift(); - - return extend({}, outerAttr.shift(), { type: null }, item); - } - if (item.el) { - return extend({}, outerAttr.shift(), item, { - el: extend({}, innerAttr.shift(), item.el), - }); - } - - return extend({}, outerAttr.shift(), { - el: extend({}, innerAttr.shift(), item), - }); - }); -} - -// 用容器包装items -export function packageItems(items, layouts) { - for (let i = layouts.length - 1; i >= 0; i--) { - items = map(items, (k, it) => - extend({}, layouts[i], { - items: [ - extend({}, layouts[i].el, { - el: it, - }) - ], - }) - ); - } - - return items; -} - -export function formatEL(obj) { - if (obj && !obj.type && obj.el) { - return obj; - } - - return { - el: obj, - }; -} - -// 剥开EL -export function stripEL(obj) { - return (obj.type && obj) || obj.el || obj; -} - -export function trans2Element(widgets) { - return map(widgets, (i, wi) => wi.element); -} - -// 集合相关方法 -BI._.each( - [ - "where", - "findWhere", - "invoke", - "pluck", - "shuffle", - "sample", - "toArray", - "size" - ], - name => { - BI[name] = _apply(name); - } -); -BI._.each( - [ - "get", - "set", - "each", - "map", - "reduce", - "reduceRight", - "find", - "filter", - "reject", - "every", - "all", - "some", - "any", - "max", - "min", - "sortBy", - "groupBy", - "indexBy", - "countBy", - "partition", - "clamp" - ], - name => { - if (name === "any") { - BI[name] = _applyFunc("some"); - } else { - BI[name] = _applyFunc(name); - } - } -); -export const where = BI.where; -export const findWhere = BI.findWhere; -export const invoke = BI.invoke; -export const pluck = BI.pluck; -export const shuffle = BI.shuffle; -export const sample = BI.sample; -export const toArray = BI.toArray; -export const size = BI.size; -export const get = BI.get; -export const set = BI.set; -export const each = BI.each; -export const map = BI.map; -export const reduce = BI.reduce; -export const reduceRight = BI.reduceRight; -export const find = BI.find; -export const filter = BI.filter; -export const reject = BI.reject; -export const every = BI.every; -export const all = BI.all; -export const some = BI.some; -export const any = BI.any; -export const max = BI.max; -export const min = BI.min; -export const sortBy = BI.sortBy; -export const groupBy = BI.groupBy; -export const indexBy = BI.indexBy; -export const countBy = BI.countBy; -export const partition = BI.partition; -export const clamp = BI.clamp; - -// 数数 -export function count(from, to, predicate) { - let t; - if (predicate) { - for (t = from; t < to; t++) { - predicate(t); - } - } - - return to - from; -} - -// 倒数 -export function inverse(from, to, predicate) { - return count(to, from, predicate); -} - -export function firstKey(obj) { - let res = undefined; - any(obj, (key, value) => { - res = key; - - return true; - }); - - return res; -} - -export function lastKey(obj) { - let res = undefined; - each(obj, (key, value) => { - res = key; - - return true; - }); - - return res; -} - -export function firstObject(obj) { - let res = undefined; - any(obj, (key, value) => { - res = value; - - return true; - }); - - return res; -} - -export function lastObject(obj) { - let res = undefined; - each(obj, (key, value) => { - res = value; - - return true; - }); - - return res; -} - -export function concat(obj1, obj2) { - if (isKey(obj1)) { - return map([].slice.apply(arguments), (idx, v) => v).join(""); - } - if (isArray(obj1)) { - return BI._.concat.apply([], arguments); - } - if (isObject(obj1)) { - return extend.apply({}, arguments); - } -} - -export function backEach(obj, predicate, context) { - predicate = iteratee(predicate, context); - for (let index = obj.length - 1; index >= 0; index--) { - predicate(index, obj[index], obj); - } - - return false; -} - -export function backAny(obj, predicate, context) { - predicate = iteratee(predicate, context); - for (let index = obj.length - 1; index >= 0; index--) { - if (predicate(index, obj[index], obj)) { - return true; - } - } - - return false; -} - -export function backEvery(obj, predicate, context) { - predicate = iteratee(predicate, context); - for (let index = obj.length - 1; index >= 0; index--) { - if (!predicate(index, obj[index], obj)) { - return false; - } - } - - return true; -} - -export function backFindKey(obj, predicate, context) { - predicate = iteratee(predicate, context); - const objKeys = keys(obj); - let key; - for (let i = objKeys.length - 1; i >= 0; i--) { - key = objKeys[i]; - if (predicate(obj[key], key, obj)) { - return key; - } - } -} - -export function backFind(obj, predicate, context) { - let key; - if (isArray(obj)) { - key = findLastIndex(obj, predicate, context); - } else { - key = backFindKey(obj, predicate, context); - } - if (key !== void 0 && key !== -1) { - return obj[key]; - } -} - -export function remove(obj, target, context) { - const targetIsFunction = isFunction(target); - target = targetIsFunction || isArray(target) ? target : [target]; - let i; - if (isArray(obj)) { - for (i = 0; i < obj.length; i++) { - if ( - (targetIsFunction && - (target === obj[i] || - target.apply(context, [i, obj[i]]) === true)) || - (!targetIsFunction && contains(target, obj[i])) - ) { - obj.splice(i--, 1); - } - } - } else { - each(obj, (i, v) => { - if ( - (targetIsFunction && - (target === obj[i] || - target.apply(context, [i, obj[i]]) === true)) || - (!targetIsFunction && contains(target, obj[i])) - ) { - delete obj[i]; - } - }); - } -} - -export function removeAt(obj, index) { - index = isArray(index) ? index : [index]; - const objIsArray = isArray(obj); - let i; - for (i = 0; i < index.length; i++) { - if (objIsArray) { - obj[index[i]] = "$deleteIndex"; - } else { - delete obj[index[i]]; - } - } - if (objIsArray) { - remove(obj, "$deleteIndex"); - } -} - -export function string2Array(str) { - return str.split("&-&"); -} - -export function array2String(array) { - return array.join("&-&"); -} - -export function abc2Int(string) { - let idx = 0; - const start = "A", - str = string.toUpperCase(); - for (let i = 0, len = str.length; i < len; ++i) { - idx = str.charAt(i).charCodeAt(0) - start.charCodeAt(0) + 26 * idx + 1; - if ( - idx > - (2147483646 - str.charAt(i).charCodeAt(0) + start.charCodeAt(0)) / - 26 - ) { - return 0; - } - } - - return idx; -} - -export function int2Abc(num) { - const DIGITS = [ - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z" - ]; - let idx = num, - str = ""; - if (num === 0) { - return ""; - } - while (idx !== 0) { - let t = idx % 26; - if (t === 0) { - t = 26; - } - str = DIGITS[t - 1] + str; - idx = (idx - t) / 26; - } - - return str; -} - -// 数组相关的方法 -BI._.each( - [ - "first", - "initial", - "last", - "rest", - "compact", - "flatten", - "without", - "union", - "intersection", - "difference", - "zip", - "unzip", - "object", - "indexOf", - "lastIndexOf", - "sortedIndex", - "range", - "take", - "takeRight", - "uniqBy" - ], - name => { - BI[name] = _apply(name); - } -); -BI._.each(["findIndex", "findLastIndex"], name => { - BI[name] = _applyFunc(name); -}); -export const first = BI.first; -export const initial = BI.initial; -export const last = BI.last; -export const rest = BI.rest; -export const compact = BI.compact; -export const flatten = BI.flatten; -export const without = BI.without; -export const union = BI.union; -export const intersection = BI.intersection; -export const difference = BI.difference; -export const zip = BI.zip; -export const unzip = BI.unzip; -export const object = BI.object; -export const indexOf = BI.indexOf; -export const lastIndexOf = BI.lastIndexOf; -export const sortedIndex = BI.sortedIndex; -export const range = BI.range; -export const take = BI.take; -export const takeRight = BI.takeRight; -export const uniqBy = BI.uniqBy; -export const findIndex = BI.findIndex; -export const findLastIndex = BI.findLastIndex; - -// 构建一个长度为length的数组 -export function makeArray(length, value) { - const res = []; - for (let i = 0; i < length; i++) { - if (isNull(value)) { - res.push(i); - } else { - res.push(deepClone(value)); - } - } - - return res; -} - -export function makeObject(array, value) { - const map = {}; - for (let i = 0; i < array.length; i++) { - if (isNull(value)) { - map[array[i]] = array[i]; - } else if (isFunction(value)) { - map[array[i]] = value(i, array[i]); - } else { - map[array[i]] = deepClone(value); - } - } - - return map; -} - -export function makeArrayByArray(array, value) { - const res = []; - if (!array) { - return res; - } - for (let i = 0, len = array.length; i < len; i++) { - if (isArray(array[i])) { - res.push(makeArrayByArray(array[i], value)); - } else { - res.push(deepClone(value)); - } - } - - return res; -} - -export function uniq(array, isSorted, iteratee, context) { - if (array === null) { - return []; - } - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - iteratee && (iteratee = traverse(iteratee, context)); - - return BI._uniq.call(BI._, array, isSorted, iteratee, context); -} - -// 对象相关方法 -BI._.each( - [ - "keys", - "allKeys", - "values", - "pairs", - "invert", - "create", - "functions", - "extend", - "extendOwn", - "defaults", - "clone", - "property", - "propertyOf", - "matcher", - "isEqual", - "isMatch", - "isEmpty", - "isElement", - "isNumber", - "isString", - "isArray", - "isObject", - "isPlainObject", - "isArguments", - "isFunction", - "isFinite", - "isBoolean", - "isDate", - "isRegExp", - "isError", - "isNaN", - "isUndefined", - "zipObject", - "cloneDeep", - "pickBy" - ], - name => { - BI[name] = _apply(name); - } -); -export const keys = BI.keys; -export const allKeys = BI.allKeys; -export const values = BI.values; -export const pairs = BI.pairs; -export const invert = BI.invert; -export const create = BI.create; -export const functions = BI.functions; -export const extend = BI.extend; -export const extendOwn = BI.extendOwn; -export const defaults = BI.defaults; -export const clone = BI.clone; -export const property = BI.property; -export const propertyOf = BI.propertyOf; -export const matcher = BI.matcher; -export const isEqual = BI.isEqual; -export const isMatch = BI.isMatch; -export const isEmpty = BI.isEmpty; -export const isElement = BI.isElement; -export const isNumber = BI.isNumber; -export const isString = BI.isString; -export const isArray = BI.isArray; -export const isObject = BI.isObject; -export const isPlainObject = BI.isPlainObject; -export const isArguments = BI.isArguments; -export const isFunction = BI.isFunction; -export const isFinite = BI.isFinite; -export const isBoolean = BI.isBoolean; -export const isDate = BI.isDate; -export const isRegExp = BI.isRegExp; -export const isError = BI.isError; -export const isNaN = BI.isNaN; -export const isUndefined = BI.isUndefined; -export const zipObject = BI.zipObject; -export const cloneDeep = BI.cloneDeep; -export const pickBy = BI.pickBy; - -BI._.each(["mapObject", "findKey", "pick", "omit", "tap"], name => { - BI[name] = _applyFunc(name); -}); -export const mapObject = BI.mapObject; -export const findKey = BI.findKey; -export const pick = BI.pick; -export const omit = BI.omit; -export const tap = BI.tap; - -export function inherit(sp, overrides) { - function sb() { - return sp.apply(this, arguments); - } - function F() {} - const spp = sp.prototype; - F.prototype = spp; - sb.prototype = new F(); - sb.superclass = spp; - extend(sb.prototype, overrides, { - superclass: sp, - }); - - return sb; -} - -export function init() { - // 先把准备环境准备好 - while (prepares && prepares.length > 0) { - prepares.shift()(); - } - while ( - _global.___fineuiExposedFunction && - _global.___fineuiExposedFunction.length > 0 - ) { - _global.___fineuiExposedFunction.shift()(); - } - BI.initialized = true; -} - -export function has(obj, keys) { - if (isArray(keys)) { - if (keys.length === 0) { - return false; - } - - return every(keys, (i, key) => BI._.has(obj, key)); - } - - return BI._.has(...arguments); -} - -export function freeze(value) { - // 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError - // 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回 - if (Object.freeze && isObject(value)) { - return Object.freeze(value); - } - - return value; -} - -// 数字和字符串可以作为key -export function isKey(key) { - return isNumber(key) || (isString(key) && key.length > 0); -} - -// 忽略大小写的等于 -export function isCapitalEqual(a, b) { - a = isNull(a) ? a : `${a}`.toLowerCase(); - b = isNull(b) ? b : `${b}`.toLowerCase(); - - return isEqual(a, b); -} - -export function isWidthOrHeight(w) { - if (typeof w === "number") { - return w >= 0; - } else if (typeof w === "string") { - return ( - /^\d{1,3}(\.\d)?%$/.test(w) || - w === "auto" || - /^\d+(\.\d+)?px$/.test(w) || - /^calc/.test(w) - ); - } -} - -export function isNotNull(obj) { - return !isNull(obj); -} - -export function isNull(obj) { - return typeof obj === "undefined" || obj === null; -} - -export function isEmptyArray(arr) { - return isArray(arr) && isEmpty(arr); -} - -export function isNotEmptyArray(arr) { - return isArray(arr) && !isEmpty(arr); -} - -export function isEmptyObject(obj) { - return isEqual(obj, {}); -} - -export function isNotEmptyObject(obj) { - return isPlainObject(obj) && !isEmptyObject(obj); -} - -export function isWindow(obj) { - return obj !== null && obj === obj.window; -} - -export function isPromise(obj) { - return !!obj && (isObject(obj) || isFunction(obj)) && isFunction(obj.then); -} - -export const deepClone = BI._.cloneDeep; -export const deepExtend = BI._.merge; - -export function isDeepMatch(object, attrs) { - const attrsKeys = keys(attrs), - length = attrsKeys.length; - if (object === null) { - return !length; - } - const obj = Object(object); - for (let i = 0; i < length; i++) { - const key = attrsKeys[i]; - if (!isEqual(attrs[key], obj[key]) || !(key in obj)) { - return false; - } - } - - return true; -} - -export function contains(obj, target, fromIndex) { - if (!BI._.isArrayLike(obj)) obj = values(obj); - - return ( - indexOf(obj, target, typeof fromIndex === "number" && fromIndex) >= 0 - ); -} - -export function deepContains(obj, copy) { - if (isObject(copy)) { - return any(obj, (i, v) => isEqual(v, copy)); - } - - return contains(obj, copy); -} - -export function deepIndexOf(obj, target) { - for (let i = 0; i < obj.length; i++) { - if (isEqual(target, obj[i])) { - return i; - } - } - - return -1; -} - -export function deepRemove(obj, target) { - let done = false; - let i; - if (isArray(obj)) { - for (i = 0; i < obj.length; i++) { - if (isEqual(target, obj[i])) { - obj.splice(i--, 1); - done = true; - } - } - } else { - each(obj, (i, v) => { - if (isEqual(target, obj[i])) { - delete obj[i]; - done = true; - } - }); - } - - return done; -} - -export function deepWithout(obj, target) { - if (isArray(obj)) { - const result = []; - for (let i = 0; i < obj.length; i++) { - if (!isEqual(target, obj[i])) { - result.push(obj[i]); - } - } - - return result; - } - const result = {}; - each(obj, (i, v) => { - if (!isEqual(target, obj[i])) { - result[i] = v; - } - }); - - return result; -} - -export function deepUnique(array) { - const result = []; - each(array, (i, item) => { - if (!deepContains(result, item)) { - result.push(item); - } - }); - - return result; -} - -// 比较两个对象得出不一样的key值 -export function deepDiff(object, other) { - object || (object = {}); - other || (other = {}); - const result = []; - const used = []; - for (const b in object) { - if (has(object, b)) { - if (!isEqual(object[b], other[b])) { - result.push(b); - } - used.push(b); - } - } - for (const b in other) { - if (has(other, b) && !contains(used, b)) { - result.push(b); - } - } - - return result; -} - -// 通用方法 -BI._.each( - [ - "uniqueId", - "result", - "chain", - "iteratee", - "unescape", - "before", - "after", - "chunk" - ], - name => { - BI[name] = (...args) => BI._[name](...args); - } -); -export const uniqueId = BI.uniqueId; -export const result = BI.result; -export const chain = BI.chain; -export const iteratee = BI.iteratee; -export const unescape = BI.unescape; -export const before = BI.before; -export const after = BI.after; -export const chunk = BI.chunk; - -// 事件相关方法 -BI._.each( - [ - "bind", - "once", - "partial", - "debounce", - "throttle", - "delay", - "defer", - "wrap" - ], - name => { - BI[name] = (...args) => BI._[name](...args); - } -); -export const bind = BI.bind; -export const once = BI.once; -export const partial = BI.partial; -export const debounce = BI.debounce; -export const throttle = BI.throttle; -export const delay = BI.delay; -export const defer = BI.defer; -export const wrap = BI.wrap; - -export const nextTick = (function () { - const callbacks = []; - let pending = false; - let timerFunc = void 0; - - function nextTickHandler() { - pending = false; - const copies = callbacks.slice(0); - callbacks.length = 0; - for (let i = 0; i < copies.length; i++) { - copies[i](); - } - } - - if (typeof Promise !== "undefined") { - const p = Promise.resolve(); - timerFunc = function timerFunc() { - p.then(nextTickHandler); - }; - } else if (typeof MutationObserver !== "undefined") { - let counter = 1; - const observer = new MutationObserver(nextTickHandler); - const textNode = document.createTextNode(String(counter)); - observer.observe(textNode, { - characterData: true, - }); - timerFunc = function timerFunc() { - counter = (counter + 1) % 2; - textNode.data = String(counter); - }; - } else if (typeof setImmediate !== "undefined") { - timerFunc = function timerFunc() { - setImmediate(nextTickHandler); - }; - } else { - // Fallback to setTimeout. - timerFunc = function timerFunc() { - setTimeout(nextTickHandler, 0); - }; - } - - return function queueNextTick(cb) { - let _resolve = void 0; - const args = [].slice.call(arguments, 1); - callbacks.push(() => { - if (cb) { - try { - cb(...args); - } catch (e) { - console.error(e); - } - } else if (_resolve) { - _resolve(...args); - } - }); - if (!pending) { - pending = true; - timerFunc(); - } - // $flow-disable-line - if (!cb && typeof Promise !== "undefined") { - return new Promise((resolve, reject) => { - _resolve = resolve; - }); - } - }; -}()); - -// 数字相关方法 -BI._.each(["random"], name => { - BI[name] = _apply(name); -}); -export const random = BI.random; - -export function parseInt(number) { - let radix = 10; - if (/^0x/g.test(number)) { - radix = 16; - } - try { - return _global.parseInt(number, radix); - } catch (e) { - throw new Error(`${number}parse int error`); - } -} - -export function parseSafeInt(value) { - const MAX_SAFE_INTEGER = 9007199254740991; - - return value - ? clamp(parseInt(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) - : value === 0 - ? value - : 0; -} - -export function parseFloat(number) { - try { - return _global.parseFloat(number); - } catch (e) { - throw new Error(`${number}parse float error`); - } -} - -export function isNaturalNumber(number) { - return /^\d+$/.test(number); -} - -export function isPositiveInteger(number) { - return /^\+?[1-9][0-9]*$/.test(number); -} - -export function isNegativeInteger(number) { - return /^-[1-9][0-9]*$/.test(number); -} - -export function isInteger(number) { - return /^-?\d+$/.test(number); -} - -export function isNumeric(number) { - return ( - !_global.isNaN(_global.parseFloat(number)) && _global.isFinite(number) - ); -} - -export function isFloat(number) { - return /^([+-]?)\d*\.\d+$/.test(number); -} - -export function isOdd(number) { - if (!isInteger(number)) { - return false; - } - - return (number & 1) === 1; -} - -export function isEven(number) { - if (!isInteger(number)) { - return false; - } - - return (number & 1) === 0; -} - -export function sum(array, iteratee, context) { - let sum = 0; - each(array, (i, item) => { - if (iteratee) { - sum += Number(iteratee.apply(context, [i, item])); - } else { - sum += Number(item); - } - }); - - return sum; -} - -export function average(array, iteratee, context) { - const sumResult = sum(array, iteratee, context); - - return sumResult / array.length; -} - -export function trim(...args) { - return BI._.trim(...args); -} - -export function toUpperCase(string) { - return `${string}`.toLocaleUpperCase(); -} - -export function toLowerCase(string) { - return `${string}`.toLocaleLowerCase(); -} - -export function isEndWithBlank(string) { - return /(\s|\u00A0)$/.test(string); -} - -export function isLiteral(exp) { - return /^\s?(true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/.test(exp); -} - -export function stripQuotes(str) { - const a = str.charCodeAt(0); - const b = str.charCodeAt(str.length - 1); - - return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str; -} - -// background-color => backgroundColor -export function camelize(str) { - return str.replace(/-(.)/g, (_, character) => character.toUpperCase()); -} - -// backgroundColor => background-color -export function hyphenate(str) { - return str.replace(/([A-Z])/g, "-$1").toLowerCase(); -} - -export function isNotEmptyString(str) { - return isString(str) && !isEmpty(str); -} - -export function isEmptyString(str) { - return isString(str) && isEmpty(str); -} - -/** - * 通用解密方法 - * @param type 解密方式 - * @param text 文本 - * @param key 种子 - * @return {*} - */ -export function encrypt(type, text, key) { - switch (type) { - case CRYPT_TYPE.AES: - default: - return aesEncrypt(text, key); - } -} - -/** - * 通用解密方法 - * @param type 解密方式 - * @param text 文本 - * @param key 种子 - * @return {*} - */ -export function decrypt(type, text, key) { - switch (type) { - case CRYPT_TYPE.AES: - default: - return aesDecrypt(text, key); - } -} - -/** - * 对字符串中的'和\做编码处理 - * @static - * @param {String} string 要做编码处理的字符串 - * @return {String} 编码后的字符串 - */ -export function escape(string) { - return string.replace(/('|\\)/g, "\\$1"); -} - -/** - * 让字符串通过指定字符做补齐的函数 - * - * var s = BI.leftPad('123', 5, '0');//s的值为:'00123' - * - * @static - * @param {String} val 原始值 - * @param {Number} size 总共需要的位数 - * @param {String} ch 用于补齐的字符 - * @return {String} 补齐后的字符串 - */ -export function leftPad(val, size, ch) { - let result = String(val); - if (!ch) { - ch = " "; - } - while (result.length < size) { - result = ch + result; - } - - return result.toString(); -} - -/** - * 对字符串做替换的函数 - * - * var cls = 'my-class', text = 'Some text'; - * var res = BI.format('
{1}
', cls, text); - * //res的值为:'
Some text
'; - * - * @static - * @param {String} format 要做替换的字符串,替换字符串1,替换字符串2... - * @return {String} 做了替换后的字符串 - */ -export function format(format) { - const args = Array.prototype.slice.call(arguments, 1); - - return format.replace(/\{(\d+)\}/g, (m, i) => args[i]); -} - -/** - * 是否是闰年 - * @param year - * @returns {boolean} - */ -export function isLeapYear(year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; -} - -/** - * 检测是否在有效期 - * - * @param YY 年 - * @param MM 月 - * @param DD 日 - * @param minDate '1900-01-01' - * @param maxDate '2099-12-31' - * @returns {Array} 若无效返回无效状态,数组第一位为无效属性,第二位缺省为超下限,1为超上限 - */ -export function checkDateVoid(YY, MM, DD, minDate, maxDate) { - let back = []; - YY = YY | 0; - MM = MM | 0; - DD = DD | 0; - minDate = isString(minDate) ? minDate.match(/\d+/g) : minDate; - maxDate = isString(maxDate) ? maxDate.match(/\d+/g) : maxDate; - if (YY < minDate[0]) { - back = ["y"]; - } else if (YY > maxDate[0]) { - back = ["y", 1]; - } else if (YY >= minDate[0] && YY <= maxDate[0]) { - if (YY === minDate[0]) { - if (MM < minDate[1]) { - back = ["m"]; - } else if (MM === minDate[1]) { - if (DD < minDate[2]) { - back = ["d"]; - } - } - } - if (YY === maxDate[0]) { - if (MM > maxDate[1]) { - back = ["m", 1]; - } else if (MM === maxDate[1]) { - if (DD > maxDate[2]) { - back = ["d", 1]; - } - } - } - } - - return back; -} - -export function checkDateLegal(str) { - const ar = str.match(/\d+/g); - const YY = ar[0] | 0, - MM = ar[1] | 0, - DD = ar[2] | 0; - if (ar.length <= 1) { - return true; - } - if (ar.length <= 2) { - return MM >= 1 && MM <= 12; - } - const MD = BI.Date._MD.slice(0); - MD[1] = isLeapYear(YY) ? 29 : 28; - - return MM >= 1 && MM <= 12 && DD <= MD[MM - 1]; -} - -/** 解析日期时间字符串 - * - * @param str - * @param fmt - * @returns {Date|Date} - * 年月日缺省值为当前日期, 时分秒缺省值为0 - */ -export function parseDateTime(str, fmt) { - const today = BI.getDate(); - let y; - let m; - let d; - // wei : 对于fmt为‘YYYYMM’或者‘YYYYMMdd’的格式,str的值为类似'201111'的形式,因为年月之间没有分隔符,所以正则表达式分割无效,导致bug7376。 - const a = str.split(/\W+/); - if (fmt.toLowerCase() === "%y%x" || fmt.toLowerCase() === "%y%x%d") { - const yearlength = 4; - const otherlength = 2; - a[0] = str.substring(0, yearlength); - a[1] = str.substring(yearlength, yearlength + otherlength); - a[2] = str.substring( - yearlength + otherlength, - yearlength + otherlength * 2 - ); - } - const b = fmt.match(/%./g); - let i = 0, - j = 0; - let hr = 0; - let min = 0; - let sec = 0; - for (i = 0; i < a.length; ++i) { - switch (b[i]) { - case "%d": - case "%e": - d = _global.parseInt(a[i], 10); - break; - - case "%X": - m = _global.parseInt(a[i], 10) - 1; - break; - case "%x": - m = _global.parseInt(a[i], 10) - 1; - break; - - case "%Y": - case "%y": - y = _global.parseInt(a[i], 10); - y < 100 && (y += y > 29 ? 1900 : 2000); - break; - - case "%b": - case "%B": - for (j = 0; j < 12; ++j) { - if ( - BI.getMonthName(j) - .substr(0, a[i].length) - .toLowerCase() === a[i].toLowerCase() - ) { - m = j; - break; - } - } - break; - - case "%H": - case "%I": - case "%k": - case "%l": - hr = _global.parseInt(a[i], 10); - break; - - case "%P": - case "%p": - if (/pm/i.test(a[i]) && hr < 12) { - hr += 12; - } else if (/am/i.test(a[i]) && hr >= 12) { - hr -= 12; - } - break; - case "%Q": - case "%q": - m = (_global.parseInt(a[i], 10) - 1) * 3; - break; - case "%M": - min = _global.parseInt(a[i], 10); - break; - case "%S": - sec = _global.parseInt(a[i], 10); - break; - default: - } - } - // if (!a[i]) { - // continue; - // } - if (_global.isNaN(y)) { - y = today.getFullYear(); - } - if (_global.isNaN(m)) { - m = today.getMonth(); - } - if (_global.isNaN(d)) { - d = today.getDate(); - } - if (_global.isNaN(hr)) { - hr = today.getHours(); - } - if (_global.isNaN(min)) { - min = today.getMinutes(); - } - if (_global.isNaN(sec)) { - sec = today.getSeconds(); - } - if (y !== 0) { - return BI.getDate(y, m, d, hr, min, sec); - } - y = 0; - m = -1; - d = 0; - for (i = 0; i < a.length; ++i) { - if (a[i].search(/[a-zA-Z]+/) !== -1) { - let t = -1; - for (j = 0; j < 12; ++j) { - if ( - BI.getMonthName(j).substr(0, a[i].length).toLowerCase() === - a[i].toLowerCase() - ) { - t = j; - break; - } - } - if (t !== -1) { - if (m !== -1) { - d = m + 1; - } - m = t; - } - } else if (_global.parseInt(a[i], 10) <= 12 && m === -1) { - m = a[i] - 1; - } else if (_global.parseInt(a[i], 10) > 31 && y === 0) { - y = _global.parseInt(a[i], 10); - y < 100 && (y += y > 29 ? 1900 : 2000); - } else if (d === 0) { - d = a[i]; - } - } - if (y === 0) { - y = today.getFullYear(); - } - if (m === -1) { - m = today.getMonth(); - } - if (m !== -1 && d !== 0) { - return BI.getDate(y, m, d, hr, min, sec); - } - - return today; -} - -export function getDate(...args) { - const length = args.length; - let dt; - switch (length) { - // new Date() - case 0: - dt = new Date(); - break; - // new Date(long) - case 1: - dt = new Date(args[0]); - break; - // new Date(year, month) - case 2: - dt = new Date(args[0], args[1]); - break; - // new Date(year, month, day) - case 3: - dt = new Date(args[0], args[1], args[2]); - break; - // new Date(year, month, day, hour) - case 4: - dt = new Date(args[0], args[1], args[2], args[3]); - break; - // new Date(year, month, day, hour, minute) - case 5: - dt = new Date(args[0], args[1], args[2], args[3], args[4]); - break; - // new Date(year, month, day, hour, minute, second) - case 6: - dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]); - break; - // new Date(year, month, day, hour, minute, second, millisecond) - case 7: - dt = new Date( - args[0], - args[1], - args[2], - args[3], - args[4], - args[5], - args[6] - ); - break; - default: - dt = new Date(); - break; - } - if ( - isNotNull(BI.timeZone) && - (arguments.length === 0 || - (arguments.length === 1 && isNumber(arguments[0]))) - ) { - const localTime = dt.getTime(); - // BI-33791 1901年以前的东8区标准是GMT+0805, 统一无论是什么时间,都以整的0800这样的为基准 - const localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数 - const utc = localTime + localOffset; // utc即GMT时间标准时区 - - return new Date(utc + BI.timeZone); // + Pool.timeZone.offset); - } - - return dt; -} - -export function getTime() { - const length = arguments.length; - const args = arguments; - let dt; - switch (length) { - // new Date() - case 0: - dt = new Date(); - break; - // new Date(long) - case 1: - dt = new Date(args[0]); - break; - // new Date(year, month) - case 2: - dt = new Date(args[0], args[1]); - break; - // new Date(year, month, day) - case 3: - dt = new Date(args[0], args[1], args[2]); - break; - // new Date(year, month, day, hour) - case 4: - dt = new Date(args[0], args[1], args[2], args[3]); - break; - // new Date(year, month, day, hour, minute) - case 5: - dt = new Date(args[0], args[1], args[2], args[3], args[4]); - break; - // new Date(year, month, day, hour, minute, second) - case 6: - dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]); - break; - // new Date(year, month, day, hour, minute, second, millisecond) - case 7: - dt = new Date( - args[0], - args[1], - args[2], - args[3], - args[4], - args[5], - args[6] - ); - break; - default: - dt = new Date(); - break; - } - if (isNotNull(BI.timeZone)) { - // BI-33791 1901年以前的东8区标准是GMT+0805, 统一无论是什么时间,都以整的0800这样的为基准 - return ( - dt.getTime() - BI.timeZone - new Date().getTimezoneOffset() * 60000 - ); - } - - return dt.getTime(); -} - diff --git a/src/core/4.widget.js b/src/core/4.widget.js deleted file mode 100644 index 63e831577..000000000 --- a/src/core/4.widget.js +++ /dev/null @@ -1,1191 +0,0 @@ -/** - * Widget超类 - * @class Widget - * @extends OB - * - * @cfg {JSON} options 配置属性 - */ - -import $ from "jquery"; -import { - isFunction, - isArray, - each, - extend, - isPlainObject, - isNull, - uniqueId, - isWidget, - isWidthOrHeight, - isKey, - remove, - any, - isNotNull -} from "./2.base"; -import { OB } from "./3.ob"; -import { Providers, _lazyCreateWidget } from "./5.inject"; -import { DOM } from "./utils"; -import { Events, emptyFn, pixFormat } from "./constant"; -import { Plugin } from "./6.plugin"; -import { _global } from "./0.foundation"; - -const cancelAnimationFrame = - _global.cancelAnimationFrame || - _global.webkitCancelAnimationFrame || - _global.mozCancelAnimationFrame || - _global.oCancelAnimationFrame || - _global.msCancelAnimationFrame || - _global.clearTimeout; - -const requestAnimationFrame = - _global.requestAnimationFrame || - _global.webkitRequestAnimationFrame || - _global.mozRequestAnimationFrame || - _global.oRequestAnimationFrame || - _global.msRequestAnimationFrame || - _global.setTimeout; - -function callLifeHook(self, life) { - let hooks = [], - hook; - hook = self[life]; - if (hook) { - hooks = hooks.concat(isArray(hook) ? hook : [hook]); - } - hook = self.options[life]; - if (hook) { - hooks = hooks.concat(isArray(hook) ? hook : [hook]); - } - each(hooks, (i, hook) => { - hook.call(self); - }); -} - -export class Widget extends OB { - _defaultConfig() { - return extend(super._defaultConfig(), { - root: false, - tagName: "div", - attributes: null, - data: null, - key: null, - - tag: null, - disabled: false, - invisible: false, - animation: "", - animationDuring: 0, - invalid: false, - baseCls: "", - extraCls: "", - cls: "", - css: null - - // vdom: false - }); - } - - _constructor() {} - - // 覆盖父类的_constructor方法,widget不走ob的生命周期 - _constructed() { - if (this.setup) { - pushTarget(this); - const delegate = this.setup(this.options); - if (isPlainObject(delegate)) { - // 如果setup返回一个json,即对外暴露的方法 - extend(this, delegate); - } else { - this.render = delegate; - } - popTarget(); - } - } - - _lazyConstructor() { - if (!this.__constructed) { - this.__constructed = true; - this._init(); - this._initRef(); - } - } - - // // 生命周期函数 - // beforeInit = null; - - // beforeRender = null; - - // beforeCreate = null - - // created = null - - // render = null - - // beforeMount = null - - // mounted = null - // // 不想重写mounted时用 - // _mounted = null - - // shouldUpdate = null - - // update = null - - // beforeUpdate = null - - // updated = null - - // beforeDestroy = null - - // destroyed = null - // // 不想重写destroyed时用 - // _destroyed = null - - _init() { - super._init(...arguments); - this._initVisual(); - this._initState(); - this._initRender(); - } - - _initRender() { - let initCallbackCalled = false; - let renderCallbackCalled = false; - - const init = () => { - // 加个保险 - if (initCallbackCalled === true) { - _global.console && - console.error( - "组件: 请检查beforeInit内部的写法,callback只能执行一次" - ); - - return; - } - initCallbackCalled = true; - - const render = () => { - // 加个保险 - if (renderCallbackCalled === true) { - _global.console && - console.error( - "组件: 请检查beforeRender内部的写法,callback只能执行一次" - ); - - return; - } - renderCallbackCalled = true; - this._render(); - this.__afterRender(); - }; - - if (this.options.beforeRender || this.beforeRender) { - this.__async = true; - const beforeRenderResult = ( - this.options.beforeRender || this.beforeRender - ).call(this, render); - if (beforeRenderResult instanceof Promise) { - beforeRenderResult.then(render).catch((e) => { - _global.console && console.error(e); - render(); - }); - } - } else { - this._render(); - this.__afterRender(); - } - }; - - if (this.options.beforeInit || this.beforeInit) { - this.__asking = true; - const beforeInitResult = ( - this.options.beforeInit || this.beforeInit - ).call(this, init); - if (beforeInitResult instanceof Promise) { - beforeInitResult.then(init).catch((e) => { - _global.console && console.error(e); - init(); - }); - } - } else { - init(); - } - } - - __afterRender() { - pushTarget(this); - const async = this.__async; - this.__async = false; - if (async && this._isMounted) { - callLifeHook(this, "beforeMount"); - this._mount(); - callLifeHook(this, "mounted"); - this.fireEvent(Events.MOUNT); - } else { - this._mount(); - } - popTarget(); - } - - _render() { - this.__asking = false; - pushTarget(this); - callLifeHook(this, "beforeCreate"); - this._initElement(); - this._initEffects(); - callLifeHook(this, "created"); - popTarget(); - } - - _initCurrent() { - const o = this.options; - this._initElementWidth(); - this._initElementHeight(); - if (o._baseCls || o.baseCls || o.extraCls) { - this.element.addClass( - `${o._baseCls || ""} ${o.baseCls || ""} ${o.extraCls || ""}` - ); - } - if (o.cls) { - if (isFunction(o.cls)) { - let cls = this.__watch(o.cls, (context, newValue) => { - this.element.removeClass(cls).addClass((cls = newValue)); - }); - this.element.addClass(cls); - } else { - this.element.addClass(o.cls); - } - } - // if (o.key != null) { - // this.element.attr("key", o.key); - // } - if (o.attributes) { - this.element.attr(o.attributes); - } - if (o.data) { - this.element.data(o.data); - } - if (o.css) { - if (isFunction(o.css)) { - let css = this.__watch(o.css, (context, newValue) => { - for (const k in css) { - if (isNull(newValue[k])) { - newValue[k] = ""; - } - } - this.element.css((css = newValue)); - }); - this.element.css(css); - } else { - this.element.css(o.css); - } - } - } - - __watch(getter, handler, options) { - if (_global.Fix) { - this._watchers = this._watchers || []; - const watcher = new Fix.Watcher( - null, - () => getter.call(this, this), - (handler && - ((v) => { - handler.call(this, this, v); - })) || - emptyFn, - extend({ deep: true }, options) - ); - this._watchers.push(() => { - watcher.teardown(); - }); - - return watcher.value; - } else { - return getter(); - } - } - - /** - * 初始化根节点 - * @private - */ - _initRoot() { - const o = this.options; - this.widgetName = o.widgetName || uniqueId("widget"); - this._isRoot = o.root; - this._children = {}; - if (isWidget(o.element)) { - this.element = this.options.element.element; - this._parent = o.element; - this._parent._children && - this._parent.addWidget(this.widgetName, this); - } else if (o.element) { - this.element = Widget._renderEngine.createElement(this); - this._isRoot = true; - } else { - this.element = Widget._renderEngine.createElement(this); - } - this.element._isWidget = true; - // const widgets = this.element.data("__widgets") || []; - // widgets.push(this); - // this.element.data("__widgets", widgets); - this._initCurrent(); - } - - _initElementWidth() { - const o = this.options; - if (isWidthOrHeight(o.width)) { - this.element.css("width", pixFormat(o.width)); - } - } - - _initElementHeight() { - const o = this.options; - if (isWidthOrHeight(o.height)) { - this.element.css("height", pixFormat(o.height)); - } - } - - _initVisual() { - const o = this.options; - if (o.invisible) { - const invisible = (o.invisible = isFunction(o.invisible) - ? this.__watch(o.invisible, (context, newValue) => { - this.setVisible(!newValue); - }) - : o.invisible); - if (invisible) { - // 用display属性做显示和隐藏,否则jquery会在显示时将display设为block会覆盖掉display:flex属性 - this.__setElementVisible(false); - } - } - } - - _initEffects() { - const o = this.options; - if (o.disabled || o.invalid) { - if (this.options.disabled) { - const disabled = (o.disabled = isFunction(o.disabled) - ? this.__watch(o.disabled, (context, newValue) => { - this.setEnable(!newValue); - }) - : o.disabled); - if (disabled) { - this.setEnable(false); - } - } - if (this.options.invalid) { - const invalid = (o.invalid = isFunction(o.invalid) - ? this.__watch(o.invalid, (context, newValue) => { - this.setValid(!newValue); - }) - : o.invalid); - if (invalid) { - this.setValid(false); - } - } - } - if (o.effect) { - if (isArray(o.effect)) { - if (isArray(o.effect[0])) { - each(o.effect, (i, effect) => { - this.__watch(effect[0], effect[1]); - }); - } else { - this.__watch(o.effect[0], o.effect[1]); - } - } else { - this.__watch(o.effect); - } - } - } - - _initState() { - this._isMounted = false; - this._isDestroyed = false; - } - - __initWatch() { - // initWatch拦截的方法 - } - - _initElement() { - this.__isMounting = true; - // 当开启worker模式时,可以通过$render来实现另一种效果 - const workerMode = - Providers.getProvider("bi.provider.system").getWorkerMode(); - const render = isFunction(this.options.render) - ? this.options.render - : workerMode - ? this.$render || this.render - : this.render; - let els = render && render.call(this); - els = this.options.configRender - ? this.options.configRender.call(this, els) - : els; - els = Plugin.getRender(this.options.type, els); - if (isPlainObject(els)) { - els = [els]; - } - this.__initWatch(); - if (isArray(els)) { - each(els, (i, el) => { - if (el) { - _lazyCreateWidget(el, { - element: this - }); - } - }); - } - } - - _setParent(parent) { - this._parent = parent; - } - - /** - * - * @param force 是否强制挂载子节点 - * @param deep 子节点是否也是按照当前force处理 - * @param lifeHook 生命周期钩子触不触发,默认触发 - * @param predicate 递归每个widget的回调 - * @param layer 组件层级 - * @returns {boolean} - * @private - */ - _mount(force, deep, lifeHook, predicate, layer) { - if ( - !force && - (this._isMounted || - !this.isVisible() || - this.__asking === true || - !( - this._isRoot === true || - (this._parent && this._parent._isMounted === true) - )) - ) { - return false; - } - layer = layer || 0; - lifeHook !== false && - !this.__async && - callLifeHook(this, "beforeMount"); - this._isMounted = true; - this.__isMounting = false; - for (const key in this._children) { - const child = this._children[key]; - child._mount && - child._mount( - deep ? force : false, - deep, - lifeHook, - predicate, - layer + 1 - ); - } - if (this._parent) { - if (!this._parent.isEnabled()) { - this._setEnable(false); - } - if (!this._parent.isValid()) { - this._setValid(false); - } - } - this._mountChildren && this._mountChildren(); - if (layer === 0) { - // mounted里面会执行scrollTo之类的方法,如果放宏任务里会闪 - // setTimeout(function () { - this.__afterMount(lifeHook, predicate); - // }, 0); - } - - return true; - } - - __afterMount(lifeHook, predicate) { - if (this._isMounted) { - for (const key in this._children) { - const child = this._children[key]; - child.__afterMount && child.__afterMount(lifeHook, predicate); - } - if (lifeHook !== false && !this.__async) { - callLifeHook(this, "_mounted"); - callLifeHook(this, "mounted"); - this.fireEvent(Events.MOUNT); - } - predicate && predicate(this); - } - } - - // _mountChildren = null; - - _update(nextProps, shouldUpdate) { - callLifeHook(this, "beforeUpdate"); - let res; - if (shouldUpdate) { - res = this.update && this.update(nextProps, shouldUpdate); - } - callLifeHook(this, "updated"); - - return res; - } - - isMounted() { - return this._isMounted; - } - - isDestroyed() { - return this._isDestroyed; - } - - setWidth(w) { - this.options.width = w; - this._initElementWidth(); - } - - setHeight(h) { - this.options.height = h; - this._initElementHeight(); - } - - _setEnable(enable) { - if (enable === true) { - this.options._disabled = false; - } else if (enable === false) { - this.options._disabled = true; - } - // 递归将所有子组件使能 - each(this._children, (i, child) => { - !child._manualSetEnable && - child._setEnable && - child._setEnable(enable); - }); - } - - _setValid(valid) { - if (valid === true) { - this.options._invalid = false; - } else if (valid === false) { - this.options._invalid = true; - } - // 递归将所有子组件使有效 - each(this._children, (i, child) => { - !child._manualSetValid && child._setValid && child._setValid(valid); - }); - } - - _setVisible(visible) { - if (visible === true) { - this.options.invisible = false; - } else if (visible === false) { - this.options.invisible = true; - } - } - - setEnable(enable) { - this._manualSetEnable = true; - this.options.disabled = !enable; - this._setEnable(enable); - if (enable === true) { - this.element.removeClass("base-disabled disabled"); - } else if (enable === false) { - this.element.addClass("base-disabled disabled"); - } - } - - __setElementVisible(visible) { - this.element.css("display", visible ? "" : "none"); - } - - _innerSetVisible(visible) { - const o = this.options; - const lastVisible = !o.invisible; - this._setVisible(visible); - if (visible === true) { - // 用this.element.show()会把display属性改成block - this.__setElementVisible(true); - this._mount(); - if (o.animation && !lastVisible) { - this.element - .removeClass(`${o.animation}-leave`) - .removeClass(`${o.animation}-leave-active`) - .addClass(`${o.animation}-enter`); - if (this._requestAnimationFrame) { - cancelAnimationFrame(this._requestAnimationFrame); - } - this._requestAnimationFrame = () => { - this.element.addClass(`${o.animation}-enter-active`); - }; - requestAnimationFrame(this._requestAnimationFrame); - if (this._animationDuring) { - clearTimeout(this._animationDuring); - } - this._animationDuring = setTimeout(() => { - this.element - .removeClass(`${o.animation}-enter`) - .removeClass(`${o.animation}-enter-active`); - }, o.animationDuring); - } - } else if (visible === false) { - if (o.animation && lastVisible) { - this.element - .removeClass(`${o.animation}-enter`) - .removeClass(`${o.animation}-enter-active`) - .addClass(`${o.animation}-leave`); - if (this._requestAnimationFrame) { - cancelAnimationFrame(this._requestAnimationFrame); - } - this._requestAnimationFrame = () => { - this.element.addClass(`${o.animation}-leave-active`); - }; - requestAnimationFrame(this._requestAnimationFrame); - if (this._animationDuring) { - clearTimeout(this._animationDuring); - } - this._animationDuring = setTimeout(() => { - this.element - .removeClass(`${o.animation}-leave`) - .removeClass(`${o.animation}-leave-active`); - this.__setElementVisible(false); - }, o.animationDuring); - } else { - this.__setElementVisible(false); - } - } - } - - setVisible(visible) { - this._innerSetVisible(visible); - this.fireEvent(Events.VIEW, visible); - } - - setValid(valid) { - this._manualSetValid = true; - this.options.invalid = !valid; - this._setValid(valid); - if (valid === true) { - this.element.removeClass("base-invalid invalid"); - } else if (valid === false) { - this.element.addClass("base-invalid invalid"); - } - } - - doBehavior() { - const args = arguments; - // 递归将所有子组件使有效 - each(this._children, (i, child) => { - child.doBehavior && child.doBehavior(...args); - }); - } - - getWidth() { - return this.options.width; - } - - getHeight() { - return this.options.height; - } - - addWidget(name, widget) { - const self = this; - if (name instanceof Widget) { - widget = name; - name = widget.getName(); - } - if (isKey(name)) { - name = `${name}`; - } - name = name || widget.getName() || uniqueId("widget"); - if (this._children[name]) { - throw new Error("组件:组件名已存在,不能进行添加"); - } - widget._setParent && widget._setParent(this); - widget.on(Events.DESTROY, function () { - // TODO: self待删 - remove(self._children, this); - }); - - return (this._children[name] = widget); - } - - getWidgetByName(name) { - if (!isKey(name) || name === this.getName()) { - return this; - } - name = `${name}`; - let widget = void 0; - const other = {}; - any(this._children, (i, wi) => { - if (i === name) { - widget = wi; - - return true; - } - other[i] = wi; - }); - if (!widget) { - any(other, (i, wi) => (widget = wi.getWidgetByName(i))); - } - - return widget; - } - - removeWidget(nameOrWidget) { - if (isWidget(nameOrWidget)) { - remove(this._children, nameOrWidget); - } else { - delete this._children[nameOrWidget]; - } - } - - hasWidget(name) { - return isNotNull(this._children[name]); - } - - getName() { - return this.widgetName; - } - - setTag(tag) { - this.options.tag = tag; - } - - getTag() { - return this.options.tag; - } - - attr(key, value) { - if (isPlainObject(key)) { - each(key, (k, v) => this.attr(k, v)); - - return; - } - if (isNotNull(value)) { - this.options[key] = value; - } - - return this.options[key]; - } - - css(name, value) { - return this.element.css(name, value); - } - - getText() {} - - setText(text) {} - - getValue() {} - - setValue(value) {} - - isEnabled() { - return this.options.disabled === true ? false : !this.options._disabled; - } - - isValid() { - return this.options.invalid === true ? false : !this.options._invalid; - } - - isVisible() { - return !this.options.invisible; - } - - disable() { - this.setEnable(false); - } - - enable() { - this.setEnable(true); - } - - valid() { - this.setValid(true); - } - - invalid() { - this.setValid(false); - } - - invisible() { - this.setVisible(false); - } - - visible() { - this.setVisible(true); - } - - __d() { - each(this._children, (i, widget) => { - widget && widget._unMount && widget._unMount(); - }); - this._children = {}; - } - - // 主要是因为_destroy已经提供了protected方法 - __destroy() { - callLifeHook(this, "beforeDestroy"); - this.beforeDestroy = null; - this.__d(); - this._parent = null; - this._isMounted = false; - callLifeHook(this, "_destroyed"); - callLifeHook(this, "destroyed"); - this.destroyed = null; - this._isDestroyed = true; - // this._purgeRef(); // 清除ref的时机还是要仔细考虑一下 - } - - _unMount() { - this._assetMounted(); - this.__destroy(); - this.fireEvent(Events.UNMOUNT); - this.purgeListeners(); - } - - _assetMounted() { - if (!this.isVisible()) { - this._setVisible(true); - this._mount(false, false, false); - this._setVisible(false); - } - } - - _empty() { - this._assetMounted(); - each(this._children, (i, widget) => { - widget && widget._unMount && widget._unMount(); - }); - this._children = {}; - this.element.empty(); - } - - isolate() { - if (this._parent) { - this._parent.removeWidget(this); - } - DOM.hang([this]); - } - - empty() { - this._empty(); - } - - // 默认的reset方法就是干掉重来 - reset() { - // 还在异步状态的不需要执行reset - if (this.__async === true || this.__asking === true) { - return; - } - // if (this.options.vdom) { - // const vnode = this._renderVNode(); - // patchVNode(this.vnode, vnode); - // this.vnode = vnode; - // return; - // } - // this._isMounted = false; - // this.purgeListeners(); - - // 去掉组件绑定的watcher - each(this._watchers, (i, unwatches) => { - unwatches = isArray(unwatches) ? unwatches : [unwatches]; - each(unwatches, (j, unwatch) => { - unwatch(); - }); - }); - this._watchers && (this._watchers = []); - this._assetMounted(); - this.__d(); - this.element.empty(); - this.element.unbind(); - this._initCurrent(); - this._init(); - // this._initRef(); - } - - _destroy() { - this._assetMounted(); - this.__destroy(); - this.element.destroy(); - this.purgeListeners(); - } - - destroy() { - const o = this.options; - this._assetMounted(); - this.__destroy(); - if (o.animation) { - this._innerSetVisible(false); - setTimeout(() => this.element.destroy(), o.animationDuring); - } else { - this.element.destroy(); - } - this.fireEvent(Events.UNMOUNT); - this.fireEvent(Events.DESTROY); - this._purgeRef(); - this.purgeListeners(); - } -} - -let context = null, - current = null; -const contextStack = [], - currentStack = []; - -Widget.pushContext = function (_context) { - if (context) contextStack.push(context); - Widget.context = context = _context; -}; - -Widget.popContext = function () { - Widget.context = context = contextStack.pop(); -}; - -Widget.execWithContext = function (context, execFunc) { - Widget.pushContext(context); - try { - execFunc(); - } catch (e) { - throw e; - } finally { - Widget.popContext(); - } -}; - -function pushTarget(_current) { - if (current) currentStack.push(current); - Widget.current = current = _current; -} - -function popTarget() { - Widget.current = current = currentStack.pop(); -} - -export function useStore(_store) { - if (current && current.store) { - return current.store; - } - if (current && current.$storeDelegate) { - return current.$storeDelegate; - } - if (current) { - const currentStore = current._store; - const delegate = {}; - let origin; - if (_global.Proxy) { - const proxy = new Proxy(delegate, { - get(target, key) { - return Reflect.get(origin, key); - }, - set(target, key, value) { - return Reflect.set(origin, key, value); - } - }); - current._store = function () { - origin = (_store || currentStore).apply(this, arguments); - delegate.$delegate = origin; - - return origin; - }; - current.$storeDelegate = proxy; - - return current.$storeDelegate; - } - current._store = function () { - const st = (_store || currentStore).apply(this, arguments); - extend(delegate, st); - - return st; - }; - current.$storeDelegate = delegate; - - return current.$storeDelegate; - } -} - -export function useContext(inject) { - // 通过组件找最近的store - let vm = Widget.findStore(Widget.current || Widget.context); - if (vm) { - if (inject) { - if (vm.$$computed && inject in vm.$$computed) { - return vm; - } - if (vm.$$state && inject in vm.$$state) { - return vm; - } - if (vm.$$model && inject in vm.$$model) { - return vm; - } - while (vm) { - if (vm.$$context && inject in vm.$$context) { - return vm; - } - vm = vm._parent; - } - - return null; - } - } - - return vm; -} - -export function watch(vm, watch, handler) { - // 必须要保证组件当前环境存在 - if (Widget.current) { - if (vm instanceof BI.Model) { - const watchers = []; - if (isKey(watch)) { - const k = watch; - watch = {}; - watch[k] = handler; - } - for (const key in watch) { - const innerHandler = watch[key]; - if (isArray(handler)) { - for (let i = 0; i < handler.length; i++) { - watchers.push( - Fix.watch(vm.model, key, innerHandler, { - store: vm - }) - ); - } - } else { - watchers.push( - Fix.watch(vm.model, key, innerHandler, { - store: vm - }) - ); - } - } - // vm中一定有_widget - Widget.current._watchers || (Widget.current._watchers = []); - Widget.current._watchers = - Widget.current._watchers.concat(watchers); - - return; - } - handler = watch; - watch = vm; - Widget.current.$watchDelayCallbacks || - (Widget.current.$watchDelayCallbacks = []); - Widget.current.$watchDelayCallbacks.push([watch, handler]); - } -} - -export function onBeforeMount(beforeMount) { - if (current) { - if (current.__isMounting) { - beforeMount(); - - return; - } - if (!current.beforeMount) { - current.beforeMount = []; - } else if (!isArray(current.beforeMount)) { - current.beforeMount = [current.beforeMount]; - } - current.beforeMount.push(beforeMount); - } -} - -export function onMounted(mounted) { - if (current) { - if (current._isMounted && !this.__async) { - mounted(); - - return; - } - if (!current.mounted) { - current.mounted = []; - } else if (!isArray(current.mounted)) { - current.mounted = [current.mounted]; - } - current.mounted.push(mounted); - } -} - -export function onBeforeUnmount(beforeDestroy) { - if (current) { - if (!current.beforeDestroy) { - current.beforeDestroy = []; - } else if (!isArray(current.beforeDestroy)) { - current.beforeDestroy = [current.beforeDestroy]; - } - current.beforeDestroy.push(beforeDestroy); - } -} - -export function onUnmounted(destroyed) { - if (current) { - if (!current.destroyed) { - current.destroyed = []; - } else if (!isArray(current.destroyed)) { - current.destroyed = [current.destroyed]; - } - current.destroyed.push(destroyed); - } -} - -Widget.registerRenderEngine = function (engine) { - Widget._renderEngine = engine; -}; -Widget.registerRenderEngine({ - createElement(widget) { - if (isWidget(widget)) { - const o = widget.options; - if (o.element) { - return $(o.element); - } - if (o.tagName) { - return $(document.createElement(o.tagName)); - } - - return $(document.createDocumentFragment()); - } - - return $(widget); - }, - createFragment() { - return document.createDocumentFragment(); - } -}); - -export function mount(widget, container, predicate, hydrate) { - if (hydrate === true) { - // 将widget的element元素都挂载好,并建立相互关系 - widget.element.data("__widgets", [widget]); - const res = widget._mount(true, false, false, function (w) { - each(w._children, (i, child) => { - let ws = child.element.data("__widgets"); - if (!ws) { - ws = []; - } - ws.push(child); - child.element.data("__widgets", ws); - }); - predicate && predicate.apply(this, arguments); - }); - // 将新的dom树属性(事件等)patch到已存在的dom上 - const c = Widget._renderEngine.createElement; - DOM.patchProps(widget.element, c(c(container).children()[0])); - - const triggerLifeHook = (w) => { - w.beforeMount && w.beforeMount(); - w.mounted && w.mounted(); - each(w._children, (i, child) => { - triggerLifeHook(child); - }); - }; - // 最后触发组件树生命周期函数 - triggerLifeHook(widget); - - return res; - } - if (container) { - Widget._renderEngine.createElement(container).append(widget.element); - } - - return widget._mount(true, false, false, predicate); -} diff --git a/src/core/5.inject.js b/src/core/5.inject.js deleted file mode 100644 index 7cad97339..000000000 --- a/src/core/5.inject.js +++ /dev/null @@ -1,527 +0,0 @@ -import { isFunction, isNull, isNotNull, isArray, each, isWidget, extend, init, isEmpty, remove } from "./2.base"; -import { OB } from "./3.ob"; -import { Widget } from "./4.widget"; -import { Plugin } from "./6.plugin"; -import { aspect } from "./structure"; -import { Events } from "./constant"; -import { _global } from "./0.foundation"; - -const moduleInjection = {}, moduleInjectionMap = { - components: {}, - constants: {}, - stores: {}, - services: {}, - models: {}, - providers: {}, -}; - -export function module(xtype, cls) { - if (isNotNull(moduleInjection[xtype])) { - _global.console && console.error(`module: [${xtype}] 已经注册过了`); - } else { - if (isFunction(cls)) { - cls = cls(); - } - for (const k in moduleInjectionMap) { - if (cls[k]) { - for (const key in cls[k]) { - if (!moduleInjectionMap[k]) { - continue; - } - if (!moduleInjectionMap[k][key]) { - moduleInjectionMap[k][key] = []; - } - moduleInjectionMap[k][key].push({ - version: cls[k][key], - moduleId: xtype, - }); - } - } - } - moduleInjection[xtype] = cls; - } - - return () => Modules.getModule(xtype); -} - -const constantInjection = {}; -export function constant(xtype, cls) { - if (isNotNull(constantInjection[xtype])) { - _global.console && console.error(`constant: [${xtype}]已经注册过了`); - } else { - constantInjection[xtype] = cls; - } - - return () => Constants.getConstant(xtype); -} - -const modelInjection = {}; -export function model(xtype, cls) { - if (isNotNull(modelInjection[xtype])) { - _global.console && console.error(`model: [${xtype}] 已经注册过了`); - } else { - modelInjection[xtype] = cls; - } - - return config => Models.getModel(xtype, config); -} - -const storeInjection = {}; -export function store(xtype, cls) { - if (isNotNull(storeInjection[xtype])) { - _global.console && console.error(`store: [${xtype}] 已经注册过了`); - } else { - storeInjection[xtype] = cls; - } - - return config => Stores.getStore(xtype, config); -} - -const serviceInjection = {}; -export function service(xtype, cls) { - if ((serviceInjection[xtype])) { - _global.console && console.error(`service: [${xtype}] 已经注册过了`); - } - - serviceInjection[xtype] = cls; - - return config => Services.getService(xtype, config); -} - -const providerInjection = {}; -export function provider(xtype, cls) { - if ((providerInjection[xtype])) { - _global.console && console.error(`provider: [${xtype}] 已经注册过了`); - } else { - providerInjection[xtype] = cls; - } - - return config => Providers.getProvider(xtype, config); -} - -const configFunctions = OB.configFunctions = {}; -const runConfigFunction = (type, configFn) => { - if (!type || !configFunctions[type]) { - return false; - } - - let queue = []; - if (configFn) { - queue = configFunctions[type].filter(conf => conf.fn === configFn); - configFunctions[type] = configFunctions[type].filter(conf => conf.fn !== configFn); - } else { - queue = configFunctions[type]; - delete configFunctions[type]; - } - - const dependencies = Providers.getProvider("bi.provider.system").getDependencies(); - const modules = moduleInjectionMap.components[type] - || moduleInjectionMap.constants[type] - || moduleInjectionMap.services[type] - || moduleInjectionMap.stores[type] - || moduleInjectionMap.models[type] - || moduleInjectionMap.providers[type]; - for (let i = 0; i < queue.length; i++) { - const conf = queue[i]; - const version = conf.opt.version; - const fn = conf.fn; - if (modules && version) { - let findVersion = false; - let module; - for (let j = 0; j < modules.length; j++) { - module = modules[j]; - if (module && dependencies[module.moduleId] && module.version === version) { - const minVersion = dependencies[module.moduleId].minVersion, - maxVersion = dependencies[module.moduleId].maxVersion; - if (minVersion && (moduleInjection[module.moduleId].version || version) < minVersion) { - findVersion = true; - break; - } - if (maxVersion && (moduleInjection[module.moduleId].version || version) > maxVersion) { - findVersion = true; - break; - } - } - } - if (findVersion === true) { - _global.console && console.error(`moduleId: [${module.moduleId}] 接口: [${type}] 接口版本: [${version}] 已过期,版本要求为:`, dependencies[module.moduleId], "=>", moduleInjection[module.moduleId]); - continue; - } - } - if (constantInjection[type]) { - constantInjection[type] = fn(constantInjection[type]); - continue; - } - if (providerInjection[type]) { - if (!providers[type]) { - providers[type] = new providerInjection[type](); - } - if (providerInstance[type]) { - delete providerInstance[type]; - } - fn(providers[type]); - continue; - } - Plugin.configWidget(type, fn, conf.opt); - } -}; - -export function config(type, configFn, opt) { - if (isFunction(type)) { - opt = configFn; - configFn = type; - type = "bi.provider.system"; - } - opt = opt || {}; - - // 系统配置直接执行 - if ("bi.provider.system" === type) { - if (!providers[type]) { - providers[type] = new providerInjection[type](); - } - // 如果config被重新配置的话,需要删除掉之前的实例 - if (providerInstance[type]) { - delete providerInstance[type]; - } - - return configFn(providers[type]); - } - - if (!configFunctions[type]) { - configFunctions[type] = []; - } - configFunctions[type].push({ - fn: configFn, - opt, - }); - - if (opt.immediately) { - return runConfigFunction(type, configFn); - } -} - -export function getReference(type, fn) { - return Plugin.registerObject(type, fn); -} - -const actions = {}; -const globalAction = []; -export function action(type, actionFn) { - if (isFunction(type)) { - globalAction.push(type); - - return () => { - remove(globalAction, idx => globalAction.indexOf(actionFn) === idx); - }; - } - if (!actions[type]) { - actions[type] = []; - } - actions[type].push(actionFn); - - return () => { - remove(actions[type], idx => actions[type].indexOf(actionFn) === idx); - if (actions[type].length === 0) { - delete actions[type]; - } - }; -} - -const points = {}; -export function point(type, action, pointFn, after) { - if (!points[type]) { - points[type] = {}; - } - if (!points[type][action]) { - points[type][action] = {}; - } - if (!points[type][action][after ? "after" : "before"]) { - points[type][action][after ? "after" : "before"] = []; - } - points[type][action][after ? "after" : "before"].push(pointFn); -} - -export const Modules = { - getModule (type) { - if (!moduleInjection[type]) { - _global.console && console.error(`module: [${type}] 未定义`); - } - - return moduleInjection[type]; - }, - getAllModules () { - return moduleInjection; - }, -}; - -export const Constants = { - getConstant (type) { - if (isNull(constantInjection[type])) { - _global.console && console.error(`constant: [${type}] 未定义`); - } - runConfigFunction(type); - - return isFunction(constantInjection[type]) ? constantInjection[type]() : constantInjection[type]; - }, -}; - -function callPoint(inst, types) { - types = isArray(types) ? types : [types]; - each(types, (idx, type) => { - if (points[type]) { - for (const action in points[type]) { - const bfns = points[type][action].before; - if (bfns) { - aspect.before(inst, action, (function (bfns) { - return function () { - for (let i = 0, len = bfns.length; i < len; i++) { - try { - bfns[i].apply(inst, arguments); - } catch (e) { - _global.console && console.error(e); - } - } - }; - }(bfns))); - } - const afns = points[type][action].after; - if (afns) { - aspect.after(inst, action, (function (afns) { - return function () { - for (let i = 0, len = afns.length; i < len; i++) { - try { - afns[i].apply(inst, arguments); - } catch (e) { - _global.console && console.error(e); - } - } - }; - }(afns))); - } - } - } - }); -} - -export const Models = { - getModel (type, config) { - if (!modelInjection[type]) { - _global.console && console.error(`model: [${type}] 未定义`); - } - runConfigFunction(type); - const inst = new modelInjection[type](config); - inst._constructor && inst._constructor(config); - inst.mixins && callPoint(inst, inst.mixins); - callPoint(inst, type); - - return inst; - }, -}; - -const stores = {}; -export const Stores = { - getStore (type, config) { - if (!storeInjection[type]) { - _global.console && console.error(`store: [${type}] 未定义`); - } - if (stores[type]) { - return stores[type]; - } - const inst = stores[type] = new storeInjection[type](config); - inst._constructor && inst._constructor(config, () => { - delete stores[type]; - }); - callPoint(inst, type); - - return inst; - }, -}; - -const services = {}; -export const Services = { - getService: (type, config) => { - if (!serviceInjection[type]) { - _global.console && console.error(`service: [${type}] 未定义`); - } - if (services[type]) { - return services[type]; - } - services[type] = new serviceInjection[type](config); - callPoint(services[type], type); - - return services[type]; - }, -}; - -const providers = {}, - providerInstance = {}; -export const Providers = { - getProvider: (type, config) => { - if (!providerInjection[type]) { - _global.console && console.error(`provider: [${type}] 未定义`); - } - runConfigFunction(type); - if (!providers[type]) { - providers[type] = new providerInjection[type](); - } - if (!providerInstance[type] && providers[type].$get) { - providerInstance[type] = new (providers[type].$get())(config); - } - - return providerInstance[type]; - }, -}; - -export const Actions = { - runAction (type, event, config) { - each(actions[type], (i, act) => { - try { - act(event, config); - } catch (e) { - _global.console && console.error(e); - } - }); - }, - runGlobalAction () { - const args = [].slice.call(arguments); - each(globalAction, (i, act) => { - try { - act(...args); - } catch (e) { - _global.console && console.error(e); - } - }); - }, -}; - -const kv = {}; -export function shortcut(xtype, cls) { - if (isNotNull(kv[xtype])) { - _global.console && console.error(`组件: [${xtype}] 已经注册过了`); - } - if (cls) { - cls.xtype = xtype; - } - kv[xtype] = cls; -} - -export const component = shortcut; - -// 根据配置属性生成widget -const createRealWidget = (config, context, lazy) => { - const Cls = isFunction(config.type) ? config.type : kv[config.type]; - - if (!Cls) { - throw new Error(`组件: [${config.type}] 未定义`); - } - let pushed = false; - const widget = new Cls(); - widget._context = Widget.context || context; - if (!Widget.context && context) { - pushed = true; - Widget.pushContext(context); - } - callPoint(widget, config.type); - widget._initProps(config); - widget._initRoot(); - widget._constructed(); - // if (!lazy || config.element || config.root) { - widget._lazyConstructor(); - // } - pushed && Widget.popContext(); - - return widget; -}; - -export function createWidget(item, options, context, lazy) { - item || (item = {}); - if (isWidget(options)) { - context = options; - options = {}; - } else { - options || (options = {}); - } - - let el, w; - if (item.type || options.type) { - el = extend({}, options, item); - } else if (item.el && (item.el.type || options.type)) { - el = extend({}, options, item.el); - } - let elType; - if (el) { - elType = (el.type && el.type.xtype) || el.type; - runConfigFunction(elType); - } - - // 先把准备环境准备好 - init(); - - if (isEmpty(item) && isEmpty(options)) { - return createWidget({ - type: "bi.layout", - }); - } - if (isWidget(item)) { - return item; - } - if (el) { - w = Plugin.getWidget(elType, el); - const wType = (w.type && w.type.xtype) || w.type; - if (wType === elType) { - if (Plugin.hasObject(elType)) { - if (!w.listeners || isArray(w.listeners)) { - w.listeners = (w.listeners || []).concat([{ - eventName: Events.MOUNT, - action: () => { - Plugin.getObject(elType, this); - }, - }]); - } else { - w.listeners[Events.MOUNT] = [ - () => { - Plugin.getObject(elType, this); - } - ].concat(w.listeners[Events.MOUNT] || []); - } - } - - return createRealWidget(w, context, lazy); - } - - return createWidget(w, options, context, lazy); - } - if (isWidget(item.el)) { - return item.el; - } - throw new Error("组件:无法根据item创建组件", item); -} - -export function _lazyCreateWidget (item, options, context) { - return createWidget(item, options, context, true); -} - -export function createElement() { - const widget = createWidget.apply(this, arguments); - - return widget.element; -} - -export function getResource(type, config) { - if (isNotNull(constantInjection[type])) { - return Constants.getConstant(type); - } - if (modelInjection[type]) { - return Models.getModel(type, config); - } - if (storeInjection[type]) { - return Stores.getStore(type, config); - } - if (serviceInjection[type]) { - return Services.getService(type, config); - } - if (providerInjection[type]) { - return Providers.getProvider(type, config); - } - throw new Error(`未知类型: [${type}] 未定义`); -} diff --git a/src/core/controller/controller.layer.js b/src/core/controller/controller.layer.js deleted file mode 100644 index 2d24cd770..000000000 --- a/src/core/controller/controller.layer.js +++ /dev/null @@ -1,200 +0,0 @@ -/** - * 弹出层面板控制器, z-index在10w层级 - * - * Created by GUY on 2015/6/24. - */ -import { Controller } from "./0.controller"; -import { isNull, isNotNull, each, keys, isWidget, isNotEmptyString, extend, bind, uniqueId } from "../2.base"; -import { Widget } from "../4.widget"; -import { createWidget } from "../5.inject"; -import { zIndex_layer } from "../constant"; -import { DOM } from "../utils"; - -export class LayerController extends Controller { - constructor() { - super(); - this._constructor(); - } - - props = { - render: "body", - } - - init() { - this.layerManager = {}; - this.layouts = {}; - this.zindex = zIndex_layer; - } - - _initResizer() { - this.resizer = BI.Resizers.add(`layerController${uniqueId()}`, bind(this._resize, this)); - } - - _resize() { - each(this.layouts, (i, layer) => { - if (layer.element.is(":visible")) { - layer.element.trigger("__resize__"); - } - }); - } - - make(name, container, op, context) { - if (isWidget(container)) { - op = op || {}; - op.container = container; - } else { - context = op; - op = container; - } - - return this.create(name, null, op, context); - } - - create(name, from, op, context) { - isNull(this.resizer) && this._initResizer(); - if (this.has(name)) { - return this.get(name); - } - op || (op = {}); - const offset = op.offset || {}; - let w = from; - if (isWidget(from)) { - w = from.element; - } - if (isNotEmptyString(w)) { - w = Widget._renderEngine.createElement(w); - } - if (this.has(name)) { - return this.get(name); - } - const widget = createWidget((op.render || {}), extend({ - type: "bi.layout", - }, op), context); - const layout = createWidget({ - type: "bi.absolute", - invisible: true, - items: [ - { - el: widget, - left: 0, - right: 0, - top: 0, - bottom: 0, - } - ], - }, context); - createWidget({ - type: "bi.absolute", - element: op.container || this.options.render, - items: [ - { - el: layout, - left: offset.left || 0, - right: offset.right || 0, - top: offset.top || 0, - bottom: offset.bottom || 0, - } - ], - }); - if (w) { - layout.element.addClass("bi-popup-view"); - - function getComputedPosition() { - const css = { - left: w.offset().left + (offset.left || 0), - top: w.offset().top + (offset.top || 0), - width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "", - height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || "", - }; - - const { top, left, scaleY, scaleX } = DOM.getPositionRelativeContainingBlockRect(layout.element[0]); - - css.top = (css.top - top) / scaleY; - css.left = (css.left - left) / scaleX; - - return css; - } - - - layout.element.css(getComputedPosition()); - layout.element.on("__resize__", () => { - w.is(":visible") && - layout.element.css(getComputedPosition()); - }); - } - this.add(name, widget, layout); - - return widget; - } - - show(name, callback) { - if (!this.has(name)) { - return this; - } - this._getLayout(name).visible(); - this._getLayout(name).element.css("z-index", this.zindex++).show(0, callback).trigger("__resize__"); - - return this; - } - - hide(name, callback) { - if (!this.has(name)) { - return this; - } - this._getLayout(name).invisible(); - this._getLayout(name).element.hide(0, callback); - - return this; - } - - isVisible(name) { - return this.has(name) && this._getLayout(name).isVisible(); - } - - add(name, layer, layout) { - if (this.has(name)) { - throw new Error("不能创建同名的Layer"); - } - layout.setVisible(false); - this.layerManager[name] = layer; - this.layouts[name] = layout; - layout.element.css("z-index", this.zindex++); - - return this; - } - - _getLayout(name) { - return this.layouts[name]; - } - - get(name) { - return this.layerManager[name]; - } - - has(name) { - return isNotNull(this.layerManager[name]); - } - - remove(name) { - if (!this.has(name)) { - return this; - } - this.layerManager[name].destroy(); - this.layouts[name].destroy(); - delete this.layerManager[name]; - delete this.layouts[name]; - - return this; - } - - removeAll() { - each(keys(this.layerManager), (index, name) => { - this.layerManager[name].destroy(); - this.layouts[name].destroy(); - }); - this.layerManager = {}; - this.layouts = {}; - - return this; - } -} diff --git a/src/core/index.js b/src/core/index.js deleted file mode 100644 index 134ab617d..000000000 --- a/src/core/index.js +++ /dev/null @@ -1,43 +0,0 @@ -export { Plugin } from "./6.plugin"; -export { StyleLoaderManager } from "./loader/loader.style"; -export { ShowListener } from "./listener/listener.show"; -export { useInWorker } from "./worker"; -export { Element } from "./element"; - -export { Controller } from "./controller/0.controller"; -export { BroadcastController } from "./controller/controller.broadcast"; -export { BubblesController } from "./controller/controller.bubbles"; -export { DrawerController } from "./controller/controller.drawer"; -export { LayerController } from "./controller/controller.layer"; -export { MaskersController } from "./controller/controller.masker"; -export { PopoverController } from "./controller/controller.popover"; -export { ResizeController } from "./controller/controller.resizer"; -export { TooltipsController } from "./controller/controller.tooltips"; - -export * from "./2.base"; -export * from "./3.ob"; -export * from "./4.widget"; - -export * from "./5.inject"; -export * from "./6.plugin"; -export * from "./system"; -export * from "./action"; -// export * from "./behavior"; -// export * from "./controller"; -export * from "./func"; -export * from "./structure"; -export * from "./h"; -export * from "./constant"; -export * from "./logic"; -export * from "./wrapper"; -export * from "./platform/web"; -export * from "./utils"; - - -export { shortcut, provider } from "./decorator"; - -import _ from "./1.lodash"; - -export { - _ -}; diff --git a/src/core/system.js b/src/core/system.js deleted file mode 100644 index 9ec00cc69..000000000 --- a/src/core/system.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @author windy - * @version 2.0 - * Created by windy on 2021/6/30 - */ -import { prepares } from "./0.foundation"; -import { deepExtend, extend } from "./2.base"; -import { OB } from "./3.ob"; -import { Providers } from "./5.inject"; -import { provider } from "./decorator"; -import { isIE as checkIE } from "./platform/web"; - -// 系统参数常量 -const system = { - dependencies: {}, - layoutOptimize: false, - responsiveMode: false, - workerMode: false, - size: { - // 尺寸 - // 通用尺寸 - TOOL_BAR_HEIGHT: 24, - LIST_ITEM_HEIGHT: 24, - TRIGGER_HEIGHT: 24, - TOAST_TOP: 10, - H_GAP_SIZE: "M", - V_GAP_SIZE: "S", - }, - loadingCreator(config) { - const loadingSize = (config ? config.loadingSize : "small") || "small"; - - const isIE = checkIE(); - - function getSize(v) { - return Math.ceil(v / (loadingSize === "small" ? 2 : 1)); - } - - return { - type: "bi.horizontal", - cls: `bi-loading-widget${isIE ? " wave-loading hack" : ""}`, - height: getSize(60), - width: getSize(60), - hgap: getSize(10), - vgap: 2.5, - items: isIE ? [] : [{ - type: "bi.layout", - cls: "animate-rect rect1", - height: getSize(50), - width: getSize(5), - }, { - type: "bi.layout", - cls: "animate-rect rect2", - height: getSize(50), - width: getSize(5), - }, { - type: "bi.layout", - cls: "animate-rect rect3", - height: getSize(50), - width: getSize(5), - }], - }; - }, -}; - -// 具体尺寸还没定,先写着 -const sizeMap = { - S: 10, - M: 20, - L: 24, -}; - -class SystemProviderOB extends OB { - getSize () { - const size = system.size; - const H_GAP_SIZE = sizeMap[size.H_GAP_SIZE]; - const V_GAP_SIZE = sizeMap[size.V_GAP_SIZE]; - - return extend({}, size, { - H_GAP_SIZE, - V_GAP_SIZE, - }); - } - - getResponsiveMode () { - return system.responsiveMode; - } - - getWorkerMode () { - return system.workerMode; - } - - getLayoutOptimize () { - return system.layoutOptimize; - } - - getDependencies () { - return system.dependencies; - } - - getLoading(config) { - return system.loadingCreator(config); - } -} - -@provider() -export class SystemProvider { - static xtype = "bi.provider.system"; - - SYSTEM = system; - - setSize(opt) { - deepExtend(system, { size: opt }); - } - - setResponsiveMode(mode) { - system.responsiveMode = !!mode; - } - - setWorkerMode(mode) { - system.workerMode = !!mode; - } - - setLayoutOptimize(layoutOptimize) { - system.layoutOptimize = layoutOptimize; - } - - addDependency(moduleId, minVersion, maxVersion) { - system.dependencies[moduleId] = { - min: minVersion, - max: maxVersion, - }; - } - - addDependencies(moduleConfig) { - extend(system.dependencies, moduleConfig); - } - - setLoadingCreator = function(creator) { - system.loadingCreator = creator; - }; - - $get() { - return SystemProviderOB; - } -} - -export const SIZE_CONSANTS = {}; -// 不再增加线型的配置了,之后不维护前置版本直接删掉,都用实线连接线 -export const STYLE_CONSTANTS = {}; - -prepares.push(() => { - extend(SIZE_CONSANTS, Providers.getProvider("bi.provider.system").getSize()); - STYLE_CONSTANTS.LINK_LINE_TYPE = SIZE_CONSANTS.LIST_ITEM_HEIGHT === 24 ? "dashed" : "solid"; -}); diff --git a/src/core/utils/dom.js b/src/core/utils/dom.js deleted file mode 100644 index 390a0100b..000000000 --- a/src/core/utils/dom.js +++ /dev/null @@ -1,787 +0,0 @@ -/** - * 对DOM操作的通用函数 - */ -import { each, isEmpty, isNull } from "../2.base"; -import $ from "jquery"; - -export function ready(fn) { - BI.Widget._renderEngine.createElement(document).ready(fn); -} - -export function patchProps(fromElement, toElement) { - const elemData = $._data(fromElement[0]); - const events = elemData.events; - each(events, (eventKey, event) => { - each(event, (i, handler) => { - toElement.on(eventKey + (handler.namespace ? (`.${handler.namespace}`) : ""), handler); - }); - }); - const fromChildren = fromElement.children(), toChildren = toElement.children(); - if (fromChildren.length !== toChildren.length) { - throw new Error("不匹配"); - } - each(fromChildren, (i, child) => { - patchProps($(child), $(toChildren[i])); - }); - each(fromElement.data("__widgets"), (i, widget) => { - widget.element = toElement; - }); -} - -/** - * 把dom数组或元素悬挂起来,使其不对html产生影响 - * @param dom - */ -export function hang(doms) { - if (isEmpty(doms)) { - return; - } - const frag = BI.Widget._renderEngine.createFragment(); - each(doms, (i, dom) => { - dom instanceof BI.Widget && (dom = dom.element); - dom instanceof $ && dom[0] && frag.appendChild(dom[0]); - }); - - return frag; -} - -export function isExist(obj) { - return BI.Widget._renderEngine.createElement("body").find(obj.element).length > 0; -} - -// 预加载图片 -export function preloadImages(srcArray, onload) { - let count = 0; - const images = []; - - function complete() { - count++; - if (count >= srcArray.length) { - onload(); - } - } - - each(srcArray, (i, src) => { - images[i] = new Image(); - images[i].src = src; - images[i].onload = function () { - complete(); - }; - images[i].onerror = function () { - complete(); - }; - }); -} - -export function getTextSizeWidth(text, fontSize = 12) { - const span = BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body"); - - fontSize = `${fontSize}px`; - - span.css("font-size", fontSize).text(text); - - const width = span.width(); - span.remove(); - - return width; -} - -export function getTextSizeHeight(text, fontSize = 12) { - const span = BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body"); - - fontSize = `${fontSize}px`; - - span.css("font-size", fontSize).text(text); - - const height = span.height(); - span.remove(); - - return height; -} - -// 获取滚动条的宽度,页面display: none时候获取到的为0 -let _scrollWidth = null; - -export function getScrollWidth() { - if (isNull(_scrollWidth) || _scrollWidth === 0) { - const ul = BI.Widget._renderEngine.createElement("
").width(50).height(50) - .css({ - position: "absolute", - top: "-9999px", - overflow: "scroll", - }) - .appendTo("body"); - _scrollWidth = ul[0].offsetWidth - ul[0].clientWidth; - ul.destroy(); - } - - return _scrollWidth; -} - -export function getImage(param, fillStyle, backgroundColor) { - const canvas = document.createElement("canvas"); - const ratio = 2; - BI.Widget._renderEngine.createElement("body").append(canvas); - - const ctx = canvas.getContext("2d"); - ctx.font = "12px Helvetica Neue,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Heiti,黑体,sans-serif"; - const w = ctx.measureText(param).width + 4; - canvas.width = w * ratio; - canvas.height = 16 * ratio; - ctx.font = `${12 * ratio}px Helvetica Neue,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Heiti,黑体,sans-serif`; - ctx.fillStyle = fillStyle || "#3685f2"; - ctx.textBaseline = "middle"; - // ctx.fillStyle = "#EAF2FD"; - ctx.fillText(param, 2 * ratio, 9 * ratio); - BI.Widget._renderEngine.createElement(canvas).destroy(); - const backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; - - // IE可以放大缩小所以要固定最大最小宽高 - return { - width: w, - height: 16, - src: canvas.toDataURL("image/png"), - style: `background-color: ${backColor};vertical-align: middle; margin: 0 1px; width:${w}px;height: 16px; max-width:${w}px;max-height: 16px; min-width:${w}px;min-height: 16px`, - param, - }; -} - -export function getLeftPosition(combo, popup, extraWidth, container) { - const el = combo.element; - const popupEl = popup.element; - const elRect = el[0].getBoundingClientRect(); - const popupElRect = popupEl[0].getBoundingClientRect(); - const containerRect = container ? container.getBoundingClientRect() : { left: 0 }; - - return { - left: elRect.left - containerRect.left - popupElRect.width - (extraWidth || 0), - }; -} - -export function getInnerLeftPosition(combo, popup, extraWidth) { - return { - left: combo.element.offset().left + (extraWidth || 0), - }; -} - -export function getRightPosition(combo, popup, extraWidth, container) { - const el = combo.element; - const elRect = el[0].getBoundingClientRect(); - const containerRect = container ? container.getBoundingClientRect() : { left: 0 }; - - return { - left: elRect.left + elRect.width - containerRect.left + (extraWidth || 0), - }; -} - -export function getInnerRightPosition(combo, popup, extraWidth) { - const el = combo.element, viewBounds = popup.element.bounds(); - - return { - left: el.offset().left + el.outerWidth() - viewBounds.width - (extraWidth || 0), - }; -} - -export function getTopPosition(combo, popup, extraHeight, container) { - const el = combo.element; - const popupEl = popup.element; - const elRect = el[0].getBoundingClientRect(); - const popupElRect = popupEl[0].getBoundingClientRect(); - const containerRect = container ? container.getBoundingClientRect() : { top: 0 }; - - return { - top: elRect.top - containerRect.top - popupElRect.height - (extraHeight || 0), - }; -} - -export function getBottomPosition(combo, popup, extraHeight, container) { - const el = combo.element; - const elRect = el[0].getBoundingClientRect(); - const containerRect = container ? container.getBoundingClientRect() : { top: 0 }; - - return { - top: elRect.top - containerRect.top + elRect.height + (extraHeight || 0), - }; -} - -export function isLeftSpaceEnough(combo, popup, extraWidth) { - return getLeftPosition(combo, popup, extraWidth).left >= 0; -} - -export function isInnerLeftSpaceEnough(combo, popup, extraWidth) { - const viewBounds = popup.element.bounds(), - windowBounds = BI.Widget._renderEngine.createElement("body").bounds(); - - return getInnerLeftPosition(combo, popup, extraWidth).left + viewBounds.width <= windowBounds.width; -} - -export function isRightSpaceEnough(combo, popup, extraWidth) { - const viewBounds = popup.element[0].getBoundingClientRect(), - viewportBounds = document.documentElement.getBoundingClientRect(); - - return getRightPosition(combo, popup, extraWidth).left + viewBounds.width <= viewportBounds.width; -} - -export function isInnerRightSpaceEnough(combo, popup, extraWidth) { - return getInnerRightPosition(combo, popup, extraWidth).left >= 0; -} - -export function isTopSpaceEnough(combo, popup, extraHeight) { - return getTopPosition(combo, popup, extraHeight).top >= 0; -} - -export function isBottomSpaceEnough(combo, popup, extraHeight) { - const viewBounds = popup.element[0].getBoundingClientRect(), - viewportBounds = document.documentElement.getBoundingClientRect(); - - return getBottomPosition(combo, popup, extraHeight).top + viewBounds.height <= viewportBounds.height; -} - -export function isRightSpaceLarger(combo) { - const comboBounds = combo.element[0].getBoundingClientRect(), - viewportBounds = document.documentElement.getBoundingClientRect(); - - return viewportBounds.width - comboBounds.right >= comboBounds.left; -} - -export function isBottomSpaceLarger(combo) { - const comboBounds = combo.element[0].getBoundingClientRect(), - viewportBounds = document.documentElement.getBoundingClientRect(); - - return viewportBounds.height - comboBounds.bottom >= comboBounds.top; -} - -export function _getLeftAlignPosition(combo, popup, extraWidth, container) { - const comboRect = combo.element[0].getBoundingClientRect(), - popupRect = popup.element[0].getBoundingClientRect(), - viewportRect = document.documentElement.getBoundingClientRect(), - containerRect = container ? container.getBoundingClientRect() : { left: 0 }; - let left = comboRect.left - containerRect.left + extraWidth; - - if (comboRect.left + popupRect.width > viewportRect.width) { - left = viewportRect.width - popupRect.width - containerRect.left; - } - - return left; -} - -export function getLeftAlignPosition(combo, popup, extraWidth, container) { - let left = _getLeftAlignPosition(combo, popup, extraWidth, container); - let dir = ""; - // 如果放不下,优先使用RightAlign, 如果RightAlign也放不下, 再使用left=0 - const containerRect = container ? container.getBoundingClientRect() : { left: 0 }; - if (left + containerRect.left < 0) { - left = _getRightAlignPosition(combo, popup, extraWidth); - dir = "left"; - } - if (left + containerRect.left < 0) { - left = 0 - containerRect.left; - } - - return { - left, - dir: dir || "right", - }; -} - -export function getLeftAdaptPosition(combo, popup, extraWidth, container) { - if (isLeftSpaceEnough(combo, popup, extraWidth, container)) { - return getLeftPosition(combo, popup, extraWidth, container); - } - - return { - left: 0, - }; -} - -export function _getRightAlignPosition(combo, popup, extraWidth, container) { - const comboBounds = combo.element[0].getBoundingClientRect(), - viewBounds = popup.element[0].getBoundingClientRect(), - containerRect = container ? container.getBoundingClientRect() : { left: 0 }; - - return comboBounds.left + comboBounds.width - viewBounds.width - extraWidth - containerRect.left; -} - -export function getRightAlignPosition(combo, popup, extraWidth, container) { - let left = _getRightAlignPosition(combo, popup, extraWidth, container); - let dir = ""; - // 如果放不下,优先使用LeftAlign, 如果LeftAlign也放不下, 再使用left=0 - if (left < 0) { - left = _getLeftAlignPosition(combo, popup, extraWidth, container); - dir = "right"; - } - if (left < 0) { - left = 0; - } - - return { - left, - dir: dir || "left", - }; -} - -export function getRightAdaptPosition(combo, popup, extraWidth, container) { - if (isRightSpaceEnough(combo, popup, extraWidth, container)) { - return getRightPosition(combo, popup, extraWidth, container); - } - - return { - left: document.documentElement.getBoundingClientRect().width - popup.element[0].getBoundingClientRect().width - container.getBoundingClientRect().left, - }; -} - -export function getTopAlignPosition(combo, popup, extraHeight, needAdaptHeight, container) { - const comboBounds = combo.element[0].getBoundingClientRect(), - popupBounds = popup.element[0].getBoundingClientRect(), - viewportBounds = document.documentElement.getBoundingClientRect(), - containerBounds = container ? container.getBoundingClientRect() : { top: 0 }; - let top, adaptHeight, dir; - if (isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { - top = comboBounds.top - containerBounds.top + extraHeight; - } else if (needAdaptHeight) { - top = comboBounds.top - containerBounds.top + extraHeight; - adaptHeight = viewportBounds.height - comboBounds.top; - } else if (isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { - // 下方空间不足且不允许调整高度的情况下,优先使用上对齐 - top = comboBounds.top + comboBounds.height - popupBounds.height - containerBounds.top - extraHeight; - dir = "top"; - } else { - top = viewportBounds.height - popupBounds.height; - if (top < extraHeight) { - adaptHeight = viewportBounds.height - extraHeight; - } - } - if (top < extraHeight) { - top = extraHeight; - } - - return adaptHeight ? { - top, - adaptHeight, - dir: dir || "bottom", - } : { - top, - dir: dir || "bottom", - }; -} - -export function getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight, positionRelativeElement) { - const comboBounds = combo.element[0].getBoundingClientRect(), - popupBounds = popup.element[0].getBoundingClientRect(), - positionRelativeElementRect = positionRelativeElement.getBoundingClientRect(), - viewportBounds = document.documentElement.getBoundingClientRect(); - if (isTopSpaceEnough(combo, popup, extraHeight)) { - return getTopPosition(combo, popup, extraHeight); - } - if (needAdaptHeight) { - return { - top: 0 - positionRelativeElementRect.top, - adaptHeight: comboBounds.top - extraHeight, - }; - } - if (popupBounds.height + extraHeight > viewportBounds.height) { - return { - top: 0 - positionRelativeElementRect.top, - adaptHeight: viewportBounds.height - extraHeight, - }; - } - - return { - top: 0 - positionRelativeElementRect.top, - }; -} - -export function getBottomAlignPosition(combo, popup, extraHeight, needAdaptHeight, container) { - const comboBounds = combo.element[0].getBoundingClientRect(), - popupBounds = popup.element[0].getBoundingClientRect(), - windowBounds = BI.Widget._renderEngine.createElement("body").bounds(), - containerBounds = container ? container.getBoundingClientRect() : { top: 0 }; - let top, adaptHeight, dir; - if (isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { - top = comboBounds.top + comboBounds.height - containerBounds.top - popupBounds.height; - } else if (needAdaptHeight) { - top = 0 - containerBounds.top; - adaptHeight = comboBounds.top + comboBounds.height - extraHeight; - } else if (isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { - // 上方空间不足且不允许调整高度的情况下,优先使用下对齐 - top = comboBounds.top - containerBounds.top + extraHeight; - dir = "bottom"; - } else { - top = 0; - if (popupBounds.height + extraHeight > windowBounds.height) { - adaptHeight = windowBounds.height - extraHeight; - } - } - if (top + containerBounds.top < 0) { - top = 0; - } - - return adaptHeight ? { - top, - adaptHeight, - dir: dir || "top", - } : { - top, - dir: dir || "top", - }; -} - -export function getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight, positionRelativeElement) { - const comboBounds = combo.element[0].getBoundingClientRect(), - popupBounds = popup.element[0].getBoundingClientRect(), - viewportBounds = document.documentElement.getBoundingClientRect(), - positionRelativeElementRect = positionRelativeElement.getBoundingClientRect(); - if (isBottomSpaceEnough(combo, popup, extraHeight)) { - return getBottomPosition(combo, popup, extraHeight, positionRelativeElement); - } - if (needAdaptHeight) { - return { - top: comboBounds.top + comboBounds.height + extraHeight - positionRelativeElementRect.top, - adaptHeight: viewportBounds.height - comboBounds.top - comboBounds.height - extraHeight, - }; - } - if (popupBounds.height + extraHeight > viewportBounds.height) { - return { - top: extraHeight - positionRelativeElementRect.top, - adaptHeight: viewportBounds.height - extraHeight, - }; - } - - return { - top: viewportBounds.height - popupBounds.height - extraHeight - positionRelativeElementRect.top, - }; -} - -export function getCenterAdaptPosition(combo, popup, positionRelativeElement) { - const comboRect = combo.element[0].getBoundingClientRect(), - popupRect = popup.element[0].getBoundingClientRect(), - positionRelativeElementRect = positionRelativeElement.getBoundingClientRect(), - viewportBounds = document.documentElement.getBoundingClientRect(); - let left; - if (comboRect.left + comboRect.width / 2 + popupRect.width / 2 > viewportBounds.width) { - left = viewportBounds.width - popupRect.width - positionRelativeElementRect.left; - } else { - left = comboRect.left + (comboRect.width - popupRect.width) / 2 - positionRelativeElementRect.left; - } - if (left + positionRelativeElementRect.left < 0) { - left = 0; - } - - return { - left, - }; -} - -export function getMiddleAdaptPosition(combo, popup, positionRelativeElement) { - const comboRect = combo.element[0].getBoundingClientRect(), - popupRect = popup.element[0].getBoundingClientRect(), - positionRelativeElementRect = positionRelativeElement.getBoundingClientRect(), - viewportBounds = document.documentElement.getBoundingClientRect(); - - let top; - if (comboRect.top + comboRect.height / 2 + popupRect.height / 2 > viewportBounds.height) { - top = viewportBounds.height - popupRect.height - positionRelativeElementRect.top; - } else { - top = comboRect.top + (comboRect.height - popupRect.height) / 2 - positionRelativeElementRect.top; - } - if (top + positionRelativeElementRect.top < 0) { - top = 0; - } - - return { - top, - }; -} - -export function getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, container) { - extraWidth || (extraWidth = 0); - extraHeight || (extraHeight = 0); - let i, direct; - const leftRight = [], topBottom = [], innerLeftRight = []; - let isNeedAdaptHeight = false, tbFirst = false, lrFirst = false; - let left, top, pos, firstDir = directions[0]; - for (i = 0; i < directions.length; i++) { - direct = directions[i]; - switch (direct) { - case "left": - leftRight.push(direct); - break; - case "right": - leftRight.push(direct); - break; - case "top": - topBottom.push(direct); - break; - case "bottom": - topBottom.push(direct); - break; - case "innerLeft": - innerLeftRight.push(direct); - break; - case "innerRight": - innerLeftRight.push(direct); - break; - default: - break; - } - } - for (i = 0; i < directions.length; i++) { - let tW, tH; - direct = directions[i]; - switch (direct) { - case "left": - if (!isNeedAdaptHeight) { - tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? 0 : extraHeight; - if (isLeftSpaceEnough(combo, popup, tW)) { - left = getLeftPosition(combo, popup, tW, container).left; - if (topBottom[0] === "bottom") { - pos = getTopAlignPosition(combo, popup, tH, needAdaptHeight, container); - } else { - pos = getBottomAlignPosition(combo, popup, tH, needAdaptHeight, container); - } - pos.dir = `left,${pos.dir}`; - if (tbFirst) { - pos.change = "left"; - } - pos.left = left; - - return pos; - } - } - lrFirst = true; - break; - case "right": - if (!isNeedAdaptHeight) { - tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? extraWidth : extraHeight; - if (isRightSpaceEnough(combo, popup, tW)) { - left = getRightPosition(combo, popup, tW, container).left; - if (topBottom[0] === "bottom") { - pos = getTopAlignPosition(combo, popup, tH, needAdaptHeight, container); - } else { - pos = getBottomAlignPosition(combo, popup, tH, needAdaptHeight, container); - } - pos.dir = `right,${pos.dir}`; - if (tbFirst) { - pos.change = "right"; - } - pos.left = left; - - return pos; - } - } - lrFirst = true; - break; - case "top": - tW = lrFirst ? extraHeight : extraWidth, tH = lrFirst ? extraWidth : extraHeight; - if (isTopSpaceEnough(combo, popup, tH)) { - top = getTopPosition(combo, popup, tH, container).top; - if (leftRight[0] === "right") { - pos = getLeftAlignPosition(combo, popup, tW, container); - } else { - pos = getRightAlignPosition(combo, popup, tW, container); - } - pos.dir = `top,${pos.dir}`; - if (lrFirst) { - pos.change = "top"; - } - pos.top = top; - - return pos; - } - if (needAdaptHeight) { - isNeedAdaptHeight = true; - } - tbFirst = true; - break; - case "bottom": - tW = lrFirst ? extraHeight : extraWidth, tH = lrFirst ? extraWidth : extraHeight; - if (isBottomSpaceEnough(combo, popup, tH)) { - top = getBottomPosition(combo, popup, tH, container).top; - if (leftRight[0] === "right") { - pos = getLeftAlignPosition(combo, popup, tW, container); - } else { - pos = getRightAlignPosition(combo, popup, tW, container); - } - pos.dir = `bottom,${pos.dir}`; - if (lrFirst) { - pos.change = "bottom"; - } - pos.top = top; - - return pos; - } - if (needAdaptHeight) { - isNeedAdaptHeight = true; - } - tbFirst = true; - break; - case "innerLeft": - if (!isNeedAdaptHeight) { - tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? 0 : extraHeight; - if (isInnerLeftSpaceEnough(combo, popup, tW)) { - left = getInnerLeftPosition(combo, popup, tW).left; - if (topBottom[0] === "bottom") { - pos = getTopAlignPosition(combo, popup, tH, needAdaptHeight); - } else { - pos = getBottomAlignPosition(combo, popup, tH, needAdaptHeight); - } - pos.dir = `innerLeft,${pos.dir}`; - if (tbFirst) { - pos.change = "innerLeft"; - } - pos.left = left; - - return pos; - } - } - lrFirst = true; - break; - case "innerRight": - if (!isNeedAdaptHeight) { - tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? extraWidth : extraHeight; - if (isInnerRightSpaceEnough(combo, popup, tW)) { - left = getInnerRightPosition(combo, popup, tW).left; - if (topBottom[0] === "bottom") { - pos = getTopAlignPosition(combo, popup, tH, needAdaptHeight); - } else { - pos = getBottomAlignPosition(combo, popup, tH, needAdaptHeight); - } - pos.dir = `innerLeft,${pos.dir}`; - if (tbFirst) { - pos.change = "innerRight"; - } - pos.left = left; - - return pos; - } - } - break; - default: - break; - } - } - - // 此处为四个方向放不下时挑空间最大的方向去放置, 也就是说我设置了弹出方向为"bottom,left", - // 最后发现实际弹出方向可能是"top,left",那么此时外界获取popup的方向应该是"top,left" - switch (directions[0]) { - case "left": - case "right": - if (isRightSpaceLarger(combo)) { - left = getRightAdaptPosition(combo, popup, extraWidth, container).left; - firstDir = "right"; - } else { - left = getLeftAdaptPosition(combo, popup, extraWidth, container).left; - firstDir = "left"; - } - if (topBottom[0] === "bottom") { - pos = getTopAlignPosition(combo, popup, extraHeight, needAdaptHeight); - pos.left = left; - pos.dir = `${firstDir},${pos.dir}`; - - return pos; - } - pos = getBottomAlignPosition(combo, popup, extraHeight, needAdaptHeight); - pos.left = left; - pos.dir = `${firstDir},${pos.dir}`; - - return pos; - default : - if (isBottomSpaceLarger(combo)) { - top = getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight, container).top; - firstDir = "bottom"; - } else { - top = getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight, container).top; - firstDir = "top"; - } - if (leftRight[0] === "right") { - pos = getLeftAlignPosition(combo, popup, extraWidth, container); - pos.top = top; - pos.dir = `${firstDir},${pos.dir}`; - - return pos; - } - pos = getRightAlignPosition(combo, popup, extraWidth, container); - pos.top = top; - pos.dir = `${firstDir},${pos.dir}`; - - return pos; - } -} - - -export function getComboPosition(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, offsetStyle, positionRelativeElement) { - extraWidth || (extraWidth = 0); - extraHeight || (extraHeight = 0); - const viewportBounds = document.documentElement.getBoundingClientRect(); - const maxHeight = Math.min(popup.attr("maxHeight") || viewportBounds.height, viewportBounds.height); - popup.resetHeight && popup.resetHeight(maxHeight); - const position = getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions || ["bottom", "top", "right", "left"], positionRelativeElement); - switch (offsetStyle) { - case "center": - if (position.change) { - const p = getMiddleAdaptPosition(combo, popup, positionRelativeElement); - position.top = p.top; - } else { - const p = getCenterAdaptPosition(combo, popup, positionRelativeElement); - position.left = p.left; - } - break; - case "middle": - if (position.change) { - const p = getCenterAdaptPosition(combo, popup, positionRelativeElement); - position.left = p.left; - } else { - const p = getMiddleAdaptPosition(combo, popup, positionRelativeElement); - position.top = p.top; - } - break; - default: - break; - } - if (needAdaptHeight === true) { - popup.resetHeight && popup.resetHeight(Math.min(viewportBounds.height - position.top - (positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0), maxHeight)); - } - - return position; -} - -/** - * 获取position:fixed相对定位的元素 - */ -export function getPositionRelativeContainingBlock(element) { - if (["html", "body", "#document"].indexOf((element.nodeName || "").toLowerCase()) >= 0) { - // $FlowFixMe[incompatible-return]: assume body is always available - return element.ownerDocument.body; - } - - function isExcept(node) { - const _computedStyle = getComputedStyle(node); - const transform = _computedStyle.transform; - const perspective = _computedStyle.perspective; - const filter = _computedStyle.filter; - const willChange = _computedStyle["will-change"]; - - return [transform, perspective, filter].some(value => value !== "none") || (willChange === "transform"); - } - - if (isExcept(element)) { - return element; - } - - return getPositionRelativeContainingBlock(element.parentNode); -} - -/** - * 获取position:fixed相对定位的元素的clientRect - */ -export function getPositionRelativeContainingBlockRect(element) { - const positionRelativeElement = getPositionRelativeContainingBlock(element); - const rect = positionRelativeElement.getBoundingClientRect(); - const { top, right, bottom, left, width, height, x, y } = positionRelativeElement.getBoundingClientRect(); - - return { - top, right, bottom, left, width, height, x, y, - scaleX: rect.width / positionRelativeElement.offsetWidth, - scaleY: rect.height / positionRelativeElement.offsetHeight, - }; -} diff --git a/src/core/version.js b/src/core/version.js deleted file mode 100644 index 88665e6e3..000000000 --- a/src/core/version.js +++ /dev/null @@ -1 +0,0 @@ -BI.version = "2.0"; diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js deleted file mode 100644 index 66fa3f17e..000000000 --- a/src/core/wrapper/layout.js +++ /dev/null @@ -1,820 +0,0 @@ -import { isNull, isFunction, each, stripEL, keys, isArray, contains, isKey, isOdd, isWidget, isNotNull, has } from "../2.base"; -import { Widget } from "../4.widget"; -import { _lazyCreateWidget, Providers } from "../5.inject"; -import { shortcut } from "../decorator"; -import { pixFormat, Events } from "../constant"; - -/** - * 布局容器类 - * - * @cfg {JSON} options 配置属性 - * @cfg {Boolean} [options.scrollable=false] 子组件超出容器边界之后是否会出现滚动条 - * @cfg {Boolean} [options.scrollx=false] 子组件超出容器边界之后是否会出现横向滚动条 - * @cfg {Boolean} [options.scrolly=false] 子组件超出容器边界之后是否会出现纵向滚动条 - */ -@shortcut() -export class Layout extends Widget { - static xtype = "bi.layout"; - - props() { - return { - scrollable: null, // true, false, null - scrollx: false, // true, false - scrolly: false, // true, false - items: [], - innerHgap: 0, - innerVgap: 0, - }; - } - - render() { - const o = this.options; - this._init4Margin(); - this._init4Scroll(); - if (isFunction(o.columnSize)) { - const columnSizeFn = o.columnSize; - o.columnSize = this.__watch(columnSizeFn, (context, newValue) => { - o.columnSize = newValue; - this.resize(); - }); - } - if (isFunction(o.rowSize)) { - const rowSizeFn = o.rowSize; - o.rowSize = this.__watch(rowSizeFn, (context, newValue) => { - o.rowSize = newValue; - this.resize(); - }); - } - } - - _init4Margin() { - if (this.options.top) { - this.element.css("top", pixFormat(this.options.top)); - } - if (this.options.left) { - this.element.css("left", pixFormat(this.options.left)); - } - if (this.options.bottom) { - this.element.css("bottom", pixFormat(this.options.bottom)); - } - if (this.options.right) { - this.element.css("right", pixFormat(this.options.right)); - } - } - - _init4Scroll() { - switch (this.options.scrollable) { - case true: - case "xy": - this.element.css("overflow", "auto"); - - return; - case false: - this.element.css("overflow", "hidden"); - - return; - case "x": - this.element.css({ - "overflow-x": "auto", - "overflow-y": "hidden", - }); - - return; - case "y": - this.element.css({ - "overflow-x": "hidden", - "overflow-y": "auto", - }); - - return; - default : - break; - } - if (this.options.scrollx) { - this.element.css({ - "overflow-x": "auto", - "overflow-y": "hidden", - }); - - return; - } - if (this.options.scrolly) { - this.element.css({ - "overflow-x": "hidden", - "overflow-y": "auto", - }); - } - } - - appendFragment(frag) { - this.element.append(frag); - } - - _mountChildren() { - const frag = Widget._renderEngine.createFragment(); - let hasChild = false; - for (const key in this._children) { - const child = this._children[key]; - if (child.element !== this.element) { - frag.appendChild(child.element[0]); - hasChild = true; - } - } - if (hasChild === true) { - this.appendFragment(frag); - } - } - - _getChildName(index) { - return `${index}`; - } - - _addElement(i, item, context, widget) { - let w; - if (widget) { - return widget; - } - if (!this.hasWidget(this._getChildName(i))) { - w = _lazyCreateWidget(item, context); - w.on(Events.DESTROY, () => { - each(this._children, (name, child) => { - if (child === w) { - delete this._children[name]; - this.removeItemAt(name | 0); - } - }); - }); - this.addWidget(this._getChildName(i), w); - } else { - w = this.getWidgetByName(this._getChildName(i)); - } - - return w; - } - - _newElement(i, item, context) { - const w = _lazyCreateWidget(item, context); - w.on(Events.DESTROY, () => { - each(this._children, (name, child) => { - if (child === w) { - delete this._children[name]; - this.removeItemAt(name | 0); - } - }); - }); - - return this._addElement(i, item, context, w); - } - - _getOptions(item) { - if (item instanceof Widget) { - item = item.options; - } - item = stripEL(item); - if (item instanceof Widget) { - item = item.options; - } - - return item; - } - - _compare(item1, item2) { - // 不比较函数 - const eq = (a, b, aStack, bStack) => { - if (a === b) { - return a !== 0 || 1 / a === 1 / b; - } - if (isNull(a) || isNull(b)) { - return a === b; - } - const className = Object.prototype.toString.call(a); - switch (className) { - case "[object RegExp]": - case "[object String]": - return `${a}` === `${b}`; - case "[object Number]": - if (+a !== +a) { - return +b !== +b; - } - - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case "[object Date]": - case "[object Boolean]": - return +a === +b; - default: - } - - const areArrays = className === "[object Array]"; - if (!areArrays) { - if (isFunction(a) && isFunction(b)) { - return true; - } - a = this._getOptions(a); - b = this._getOptions(b); - } - - aStack = aStack || []; - bStack = bStack || []; - let length = aStack.length; - while (length--) { - if (aStack[length] === a) { - return bStack[length] === b; - } - } - - aStack.push(a); - bStack.push(b); - - if (areArrays) { - length = a.length; - if (length !== b.length) { - return false; - } - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) { - return false; - } - } - } else { - const aKeys = keys(a); - let key; - length = aKeys.length; - if (keys(b).length !== length) { - return false; - } - while (length--) { - key = aKeys[length]; - if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) { - return false; - } - } - } - aStack.pop(); - bStack.pop(); - - return true; - }; - - return eq(item1, item2); - } - - _getWrapper() { - return this.element; - } - - // 不依赖于this.options.items进行更新 - _updateItemAt(oldIndex, newIndex, item) { - const del = this._children[this._getChildName(oldIndex)]; - const w = this._newElement(newIndex, item); - // 需要有个地方临时存一下新建的组件,否则如果直接使用newIndex的话,newIndex位置的元素可能会被用到 - this._children[`${this._getChildName(newIndex)}-temp`] = w; - const nextSibling = del.element.next(); - if (nextSibling.length > 0) { - Widget._renderEngine.createElement(nextSibling).before(w.element); - } else { - w.element.appendTo(this._getWrapper()); - } - del._destroy(); - w._mount(); - - return true; - } - - _addItemAt(index, item) { - for (let i = this.options.items.length; i > index; i--) { - this._children[this._getChildName(i)] = this._children[this._getChildName(i - 1)]; - } - delete this._children[this._getChildName(index)]; - this.options.items.splice(index, 0, item); - } - - _removeItemAt(index) { - for (let i = index; i < this.options.items.length - 1; i++) { - this._children[this._getChildName(i)] = this._children[this._getChildName(i + 1)]; - } - delete this._children[this._getChildName(this.options.items.length - 1)]; - this.options.items.splice(index, 1); - } - - _clearGap(w) { - w.element.css({ - "margin-top": "", - "margin-bottom": "", - "margin-left": "", - "margin-right": "", - }); - } - - _optimiseGap(gap) { - return (gap > 0 && gap < 1) ? `${(gap * 100).toFixed(1)}%` : pixFormat(gap); - } - - _optimiseItemLgap(item) { - if (Providers.getProvider("bi.provider.system").getLayoutOptimize()) { - return ((!item.type && item.el) ? ((item._lgap || 0) + (item.lgap || 0)) : item._lgap) || 0; - } - - return (item._lgap || 0) + (item.lgap || 0); - } - _optimiseItemRgap(item) { - if (Providers.getProvider("bi.provider.system").getLayoutOptimize()) { - return ((!item.type && item.el) ? ((item._rgap || 0) + (item.rgap || 0)) : item._rgap) || 0; - } - - return (item._rgap || 0) + (item.rgap || 0); - } - _optimiseItemTgap(item) { - if (Providers.getProvider("bi.provider.system").getLayoutOptimize()) { - return ((!item.type && item.el) ? ((item._tgap || 0) + (item.tgap || 0)) : item._tgap) || 0; - } - - return (item._tgap || 0) + (item.tgap || 0); - } - _optimiseItemBgap(item) { - if (Providers.getProvider("bi.provider.system").getLayoutOptimize()) { - return ((!item.type && item.el) ? ((item._bgap || 0) + (item.bgap || 0)) : item._bgap) || 0; - } - - return (item._bgap || 0) + (item.bgap || 0); - } - _optimiseItemHgap(item) { - if (Providers.getProvider("bi.provider.system").getLayoutOptimize()) { - return ((!item.type && item.el) ? ((item._hgap || 0) + (item.hgap || 0)) : item._hgap) || 0; - } - - return (item._hgap || 0) + (item.hgap || 0); - } - _optimiseItemVgap(item) { - if (Providers.getProvider("bi.provider.system").getLayoutOptimize()) { - return ((!item.type && item.el) ? ((item._vgap || 0) + (item.vgap || 0)) : item._vgap) || 0; - } - - return (item._vgap || 0) + (item.vgap || 0); - } - - _handleGap(w, item, hIndex, vIndex) { - const o = this.options; - let innerLgap, innerRgap, innerTgap, innerBgap; - if (isNull(vIndex)) { - innerTgap = innerBgap = o.innerVgap; - innerLgap = hIndex === 0 ? o.innerHgap : 0; - innerRgap = hIndex === o.items.length - 1 ? o.innerHgap : 0; - } else { - innerLgap = innerRgap = o.innerHgap; - innerTgap = vIndex === 0 ? o.innerVgap : 0; - innerBgap = vIndex === o.items.length - 1 ? o.innerVgap : 0; - } - if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - const top = ((isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); - w.element.css({ - "margin-top": this._optimiseGap(top), - }); - } - if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - const left = ((isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); - w.element.css({ - "margin-left": this._optimiseGap(left), - }); - } - if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - const right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); - w.element.css({ - "margin-right": this._optimiseGap(right), - }); - } - if (o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - const bottom = o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); - w.element.css({ - "margin-bottom": this._optimiseGap(bottom), - }); - } - } - - // 横向换纵向 - _handleReverseGap(w, item, index) { - const o = this.options; - const innerLgap = o.innerHgap; - const innerRgap = o.innerHgap; - const innerTgap = index === 0 ? o.innerVgap : 0; - const innerBgap = index === o.items.length - 1 ? o.innerVgap : 0; - if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - const top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); - w.element.css({ - "margin-top": this._optimiseGap(top), - }); - } - if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - const left = o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); - w.element.css({ - "margin-left": this._optimiseGap(left), - }); - } - if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - const right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); - w.element.css({ - "margin-right": this._optimiseGap(right), - }); - } - // 这里的代码是关键 - if (o.vgap + o.hgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - const bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); - w.element.css({ - "margin-bottom": this._optimiseGap(bottom), - }); - } - } - - /** - * 添加一个子组件到容器中 - * @param {JSON/Widget} item 子组件 - */ - addItem(item) { - return this.addItemAt(this.options.items.length, item); - } - - prependItem(item) { - return this.addItemAt(0, item); - } - - addItemAt(index, item) { - if (index < 0 || index > this.options.items.length) { - return; - } - this._addItemAt(index, item); - const w = this._addElement(index, item); - // addItemAt 还是用之前的找上个兄弟节点向后插入的方式 - if (index > 0) { - this._children[this._getChildName(index - 1)].element.after(w.element); - } else { - w.element.prependTo(this._getWrapper()); - } - w._mount(); - - return w; - } - - removeItemAt(indexes) { - indexes = isArray(indexes) ? indexes : [indexes]; - const deleted = []; - const newItems = [], newChildren = {}; - for (let i = 0, len = this.options.items.length; i < len; i++) { - const child = this._children[this._getChildName(i)]; - if (contains(indexes, i)) { - child && deleted.push(child); - } else { - newChildren[this._getChildName(newItems.length)] = child; - newItems.push(this.options.items[i]); - } - } - this.options.items = newItems; - this._children = newChildren; - each(deleted, (i, c) => { - c._destroy(); - }); - } - - shouldUpdateItem(index, item) { - const child = this._children[this._getChildName(index)]; - if (!child || !child.shouldUpdate) { - return null; - } - - return child.shouldUpdate(this._getOptions(item)); - } - - addItems(items, context) { - const o = this.options; - const fragment = Widget._renderEngine.createFragment(); - const added = []; - each(items, (i, item) => { - const w = this._addElement(o.items.length, item, context); - this._children[this._getChildName(o.items.length)] = w; - o.items.push(item); - added.push(w); - fragment.appendChild(w.element[0]); - }); - if (this._isMounted) { - this._getWrapper().append(fragment); - each(added, (i, w) => { - w._mount(); - }); - } - } - - prependItems(items, context) { - items = items || []; - const fragment = Widget._renderEngine.createFragment(); - const added = []; - for (let i = items.length - 1; i >= 0; i--) { - this._addItemAt(0, items[i]); - const w = this._addElement(0, items[i], context); - this._children[this._getChildName(0)] = w; - this.options.items.unshift(items[i]); - added.push(w); - fragment.appendChild(w.element[0]); - } - if (this._isMounted) { - this._getWrapper().prepend(fragment); - each(added, (i, w) => { - w._mount(); - }); - } - } - - getValue() { - let value = [], child; - each(this.options.items, i => { - child = this._children[this._getChildName(i)]; - if (child) { - let v = child.getValue(); - v = isArray(v) ? v : [v]; - value = value.concat(v); - } - }); - - return value; - } - - setValue(v) { - let child; - each(this.options.items, i => { - child = this._children[this._getChildName(i)]; - child && child.setValue(v); - }); - } - - setText(v) { - let child; - each(this.options.items, i => { - child = this._children[this._getChildName(i)]; - child && child.setText(v); - }); - } - - patchItem(oldVnode, vnode, oldIndex, newIndex) { - const shouldUpdate = this.shouldUpdateItem(oldIndex, vnode); - const child = this._children[this._getChildName(oldIndex)]; - if (shouldUpdate) { - this._children[`${this._getChildName(newIndex)}-temp`] = child; - - return child._update(this._getOptions(vnode), shouldUpdate); - } - if (shouldUpdate === null && !this._compare(oldVnode, vnode)) { - // if (child.update) { - // return child.update(this._getOptions(vnode)); - // } - return this._updateItemAt(oldIndex, newIndex, vnode); - } - } - - updateChildren(oldCh, newCh, context) { - let oldStartIdx = 0, newStartIdx = 0; - let oldEndIdx = oldCh.length - 1; - let oldStartVnode = oldCh[0]; - let oldEndVnode = oldCh[oldEndIdx]; - let newEndIdx = newCh.length - 1; - let newStartVnode = newCh[0]; - let newEndVnode = newCh[newEndIdx]; - let before; - let updated; - const children = {}; - - const sameVnode = (vnode1, vnode2, oldIndex, newIndex) => { - vnode1 = this._getOptions(vnode1); - vnode2 = this._getOptions(vnode2); - if (isKey(vnode1.key)) { - return vnode1.key === vnode2.key; - } - if (oldIndex >= 0) { - return oldIndex === newIndex; - } - }; - - const addNode = (vnode, index, context) => { - const opt = this._getOptions(vnode); - const key = isNull(opt.key) ? index : opt.key; - children[key] = this._newElement(index, vnode, context); - - return children[key]; - }; - - const addVnodes = (before, vnodes, startIdx, endIdx, context) => { - for (; startIdx <= endIdx; ++startIdx) { - const node = addNode(vnodes[startIdx], startIdx, context); - insertBefore(node, before, false, startIdx); - } - }; - - const removeVnodes = (vnodes, startIdx, endIdx) => { - for (; startIdx <= endIdx; ++startIdx) { - const ch = vnodes[startIdx]; - if (isNotNull(ch)) { - const node = this._getOptions(ch); - const key = isNull(node.key) ? startIdx : node.key; - children[key]._destroy(); - } - } - }; - - const insertBefore = (insert, before, isNext, index) => { - insert = this._getOptions(insert); - before = before && this._getOptions(before); - const insertKey = isKey(insert.key) ? insert.key : index; - if (before && children[before.key]) { - const beforeKey = isKey(before.key) ? before.key : index; - let next; - if (isNext) { - next = children[beforeKey].element.next(); - } else { - next = children[beforeKey].element; - } - if (next.length > 0) { - next.before(children[insertKey].element); - } else { - this._getWrapper().append(children[insertKey].element); - } - } else { - this._getWrapper().append(children[insertKey].element); - } - }; - - const findOldVnode = (vnodes, vNode, beginIdx, endIdx) => { - let i, found, findIndex; - for (i = beginIdx; i <= endIdx; ++i) { - if (vnodes[i] && sameVnode(vnodes[i], vNode)) { - found = vnodes[i]; - findIndex = i; - } - } - - return [found, findIndex]; - }; - - each(oldCh, (i, child) => { - child = this._getOptions(child); - const key = isNull(child.key) ? i : child.key; - if (isKey(key)) { - children[key] = this._children[this._getChildName(i)]; - } - }); - - while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { - if (isNull(oldStartVnode)) { - oldStartVnode = oldCh[++oldStartIdx]; - } else if (isNull(oldEndVnode)) { - oldEndVnode = oldCh[--oldEndIdx]; - } else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) { - const willUpdate = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx); - updated = willUpdate || updated; - children[isNull(oldStartVnode.key) ? oldStartIdx : oldStartVnode.key] = willUpdate ? this._children[`${this._getChildName(newStartIdx)}-temp`] : this._children[this._getChildName(oldStartIdx)]; - oldStartVnode = oldCh[++oldStartIdx]; - newStartVnode = newCh[++newStartIdx]; - } else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) { - const willUpdate = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx); - updated = willUpdate || updated; - children[isNull(oldEndVnode.key) ? oldEndIdx : oldEndVnode.key] = willUpdate ? this._children[`${this._getChildName(newEndIdx)}-temp`] : this._children[this._getChildName(oldEndIdx)]; - oldEndVnode = oldCh[--oldEndIdx]; - newEndVnode = newCh[--newEndIdx]; - } else if (sameVnode(oldStartVnode, newEndVnode)) { - const willUpdate = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx, newStartIdx); - updated = willUpdate || updated; - children[isNull(oldStartVnode.key) ? oldStartIdx : oldStartVnode.key] = willUpdate ? this._children[`${this._getChildName(newStartIdx)}-temp`] : this._children[this._getChildName(oldStartIdx)]; - insertBefore(oldStartVnode, oldEndVnode, true); - oldStartVnode = oldCh[++oldStartIdx]; - newEndVnode = newCh[--newEndIdx]; - } else if (sameVnode(oldEndVnode, newStartVnode)) { - const willUpdate = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx, newEndIdx); - updated = willUpdate || updated; - children[isNull(oldEndVnode) ? oldEndIdx : oldEndVnode.key] = willUpdate ? this._children[`${this._getChildName(newEndIdx)}-temp`] : this._children[this._getChildName(oldEndIdx)]; - insertBefore(oldEndVnode, oldStartVnode); - oldEndVnode = oldCh[--oldEndIdx]; - newStartVnode = newCh[++newStartIdx]; - } else { - const sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); - if (isNull(sameOldVnode[0])) { // 不存在就把新的放到左边 - const node = addNode(newStartVnode, newStartIdx, context); - insertBefore(node, oldStartVnode); - } else { // 如果新节点在旧节点区间中存在就复用一下 - const sameOldIndex = sameOldVnode[1]; - const willUpdate = this.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx); - updated = willUpdate || updated; - children[isNull(sameOldVnode[0].key) ? newStartIdx : sameOldVnode[0].key] = willUpdate ? this._children[`${this._getChildName(newStartIdx)}-temp`] : this._children[this._getChildName(sameOldIndex)]; - oldCh[sameOldIndex] = undefined; - insertBefore(sameOldVnode[0], oldStartVnode); - } - newStartVnode = newCh[++newStartIdx]; - } - } - if (oldStartIdx > oldEndIdx) { - before = isNull(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1]; - addVnodes(before, newCh, newStartIdx, newEndIdx, context); - } else if (newStartIdx > newEndIdx) { - removeVnodes(oldCh, oldStartIdx, oldEndIdx); - } - - this._children = {}; - each(newCh, (i, child) => { - const node = this._getOptions(child); - const key = isNull(node.key) ? i : node.key; - children[key]._setParent && children[key]._setParent(this); - children[key]._mount(); - this._children[this._getChildName(i)] = children[key]; - }); - - return updated; - } - - forceUpdate(opt) { - if (this._isMounted) { - each(this._children, (i, c) => { - c.destroy(); - }); - this._children = {}; - this._isMounted = false; - } - this.options.items = opt.items; - this.stroke(opt.items); - this._mount(); - } - - update(opt) { - const o = this.options; - const items = opt.items || []; - const context = opt.context; - const oldItems = o.items; - this.options.items = items; - - return this.updateChildren(oldItems, items, context); - } - - stroke(items, options) { - options = options || {}; - each(items, (i, item) => { - item && this._addElement(i, item, options.context); - }); - } - - getRowColumnCls(rowIndex, colIndex, lastRowIndex, lastColIndex) { - let cls = ""; - if (rowIndex === 0) { - cls += " first-row"; - } else if (rowIndex === lastRowIndex) { - cls += " last-row"; - } - if (colIndex === 0) { - cls += " first-col"; - } else if (colIndex === lastColIndex) { - cls += " last-col"; - } - isOdd(rowIndex + 1) ? (cls += " odd-row") : (cls += " even-row"); - isOdd(colIndex + 1) ? (cls += " odd-col") : (cls += " even-col"); - cls += " center-element"; - - return cls; - } - - removeWidget(nameOrWidget) { - let removeIndex; - if (isWidget(nameOrWidget)) { - each(this._children, (name, child) => { - if (child === nameOrWidget) { - removeIndex = name; - } - }); - } else { - removeIndex = nameOrWidget; - } - if (removeIndex) { - this._removeItemAt(removeIndex | 0); - } - } - - empty() { - super.empty(...arguments); - this.options.items = []; - } - - destroy() { - super.destroy(...arguments); - this.options.items = []; - } - - populate(items, options) { - items = items || []; - options = options || {}; - if (this._isMounted) { - this.update({ - items, - context: options.context, - }); - - return; - } - this.options.items = items; - this.stroke(items, options); - } - - resize() { - this.stroke(this.options.items); - } -} diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 5858f7041..000000000 --- a/src/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// sideEffects -import "./polyfill"; -import "./core/platform/web/jquery"; - -import _jquery from "jquery"; - -export * from "./core"; -export * from "./base"; -export * from "./case"; -export * from "./widget"; -export * from "./component"; -export * from "./fix"; -export * from "./router"; - -export const jQuery = _jquery; -export const $ = _jquery; diff --git a/src/router/router.js b/src/router/router.js deleted file mode 100644 index 554fe5e0c..000000000 --- a/src/router/router.js +++ /dev/null @@ -1,3378 +0,0 @@ -import { nextTick, shortcut, Widget } from "@/core"; -import { Router } from "./0.router"; -import { Fix } from "../fix"; - -function assert(condition, message) { - if (!condition) { - throw new Error(`[vue-router] ${message}`); - } -} - -function warn(condition, message) { - if (!condition) { - typeof console !== "undefined" && - console.warn(`[vue-router] ${message}`); - } -} - -function extend(a, b) { - for (const key in b) { - a[key] = b[key]; - } - - return a; -} - -/* */ - -const encodeReserveRE = /[!'()*]/g; -const encodeReserveReplacer = function (c) { - return `%${c.charCodeAt(0).toString(16)}`; -}; -const commaRE = /%2C/g; - -// fixed encodeURIComponent which is more conformant to RFC3986: -// - escapes [!'()*] -// - preserve commas -const encode = function (str) { - return encodeURIComponent(str) - .replace(encodeReserveRE, encodeReserveReplacer) - .replace(commaRE, ","); -}; - -function decode(str) { - try { - return decodeURIComponent(str); - } catch (err) { - { - warn(false, `Error decoding "${str}". Leaving it intact.`); - } - } - - return str; -} - -function resolveQuery(query, extraQuery, _parseQuery) { - if (extraQuery === void 0) extraQuery = {}; - - const parse = _parseQuery || parseQuery; - let parsedQuery; - try { - parsedQuery = parse(query || ""); - } catch (e) { - warn(false, e.message); - parsedQuery = {}; - } - for (const key in extraQuery) { - const value = extraQuery[key]; - parsedQuery[key] = Array.isArray(value) - ? value.map(castQueryParamValue) - : castQueryParamValue(value); - } - - return parsedQuery; -} - -var castQueryParamValue = function (value) { - return value == null || typeof value === "object" ? value : String(value); -}; - -function parseQuery(query) { - const res = {}; - - query = query.trim().replace(/^(\?|#|&)/, ""); - - if (!query) { - return res; - } - - query.split("&").forEach((param) => { - const parts = param.replace(/\+/g, " ").split("="); - const key = decode(parts.shift()); - const val = parts.length > 0 ? decode(parts.join("=")) : null; - - if (res[key] === undefined) { - res[key] = val; - } else if (Array.isArray(res[key])) { - res[key].push(val); - } else { - res[key] = [res[key], val]; - } - }); - - return res; -} - -function stringifyQuery(obj) { - const res = obj - ? Object.keys(obj) - .map((key) => { - const val = obj[key]; - - if (val === undefined) { - return ""; - } - - if (val === null) { - return encode(key); - } - - if (Array.isArray(val)) { - const result = []; - val.forEach((val2) => { - if (val2 === undefined) { - return; - } - if (val2 === null) { - result.push(encode(key)); - } else { - result.push(`${encode(key)}=${encode(val2)}`); - } - }); - - return result.join("&"); - } - - return `${encode(key)}=${encode(val)}`; - }) - .filter((x) => x.length > 0) - .join("&") - : null; - - return res ? `?${res}` : ""; -} - -/* */ - -const trailingSlashRE = /\/?$/; - -function createRoute(record, location, redirectedFrom, router) { - const stringifyQuery = router && router.options.stringifyQuery; - - let query = location.query || {}; - try { - query = clone(query); - } catch (e) {} - - const route = { - name: location.name || (record && record.name), - meta: (record && record.meta) || {}, - path: location.path || "/", - hash: location.hash || "", - query, - params: location.params || {}, - fullPath: getFullPath(location, stringifyQuery), - matched: record ? formatMatch(record) : [] - }; - if (redirectedFrom) { - route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery); - } - - return Object.freeze(route); -} - -function clone(value) { - if (Array.isArray(value)) { - return value.map(clone); - } else if (value && typeof value === "object") { - const res = {}; - for (const key in value) { - res[key] = clone(value[key]); - } - - return res; - } else { - return value; - } -} - -// the starting route that represents the initial state -const START = createRoute(null, { - path: "/" -}); - -function formatMatch(record) { - const res = []; - while (record) { - res.unshift(record); - record = record.parent; - } - - return res; -} - -function getFullPath(ref, _stringifyQuery) { - const path = ref.path; - let query = ref.query; - if (query === void 0) query = {}; - let hash = ref.hash; - if (hash === void 0) hash = ""; - - const stringify = _stringifyQuery || stringifyQuery; - - return (path || "/") + stringify(query) + hash; -} - -function isSameRoute(a, b, onlyPath) { - if (b === START) { - return a === b; - } else if (!b) { - return false; - } else if (a.path && b.path) { - return ( - a.path.replace(trailingSlashRE, "") === - b.path.replace(trailingSlashRE, "") && - (onlyPath || (a.hash === b.hash && isObjectEqual(a.query, b.query))) - ); - } else if (a.name && b.name) { - return ( - a.name === b.name && - (onlyPath || - (a.hash === b.hash && - isObjectEqual(a.query, b.query) && - isObjectEqual(a.params, b.params))) - ); - } else { - return false; - } -} - -function isObjectEqual(a, b) { - if (a === void 0) a = {}; - if (b === void 0) b = {}; - - // handle null value #1566 - if (!a || !b) { - return a === b; - } - const aKeys = Object.keys(a).sort(); - const bKeys = Object.keys(b).sort(); - if (aKeys.length !== bKeys.length) { - return false; - } - - return aKeys.every((key, i) => { - const aVal = a[key]; - const bKey = bKeys[i]; - if (bKey !== key) { - return false; - } - const bVal = b[key]; - // query values can be null and undefined - if (aVal == null || bVal == null) { - return aVal === bVal; - } - // check nested equality - if (typeof aVal === "object" && typeof bVal === "object") { - return isObjectEqual(aVal, bVal); - } - - return String(aVal) === String(bVal); - }); -} - -function isIncludedRoute(current, target) { - return ( - current.path - .replace(trailingSlashRE, "/") - .indexOf(target.path.replace(trailingSlashRE, "/")) === 0 && - (!target.hash || current.hash === target.hash) && - queryIncludes(current.query, target.query) - ); -} - -function queryIncludes(current, target) { - for (const key in target) { - if (!(key in current)) { - return false; - } - } - - return true; -} - -function handleRouteEntered(route) { - for (let i = 0; i < route.matched.length; i++) { - const record = route.matched[i]; - for (const name in record.instances) { - const instance = record.instances[name]; - const cbs = record.enteredCbs[name]; - if (!instance || !cbs) { - continue; - } - delete record.enteredCbs[name]; - for (let i$1 = 0; i$1 < cbs.length; i$1++) { - if (!instance._isBeingDestroyed) { - cbs[i$1](instance); - } - } - } - } -} - -// var View = { -// name: 'RouterView', -// functional: true, -// props: { -// name: { -// type: String, -// default: 'default' -// } -// }, -// render: function render (_, ref) { -// var props = ref.props; -// var children = ref.children; -// var parent = ref.parent; -// var data = ref.data; - -// // used by devtools to display a router-view badge -// data.routerView = true; - -// // directly use parent context's createElement() function -// // so that components rendered by router-view can resolve named slots -// var h = parent.$createElement; -// var name = props.name; -// var route = parent.$route; -// var cache = parent._routerViewCache || (parent._routerViewCache = {}); - -// // determine current view depth, also check to see if the tree -// // has been toggled inactive but kept-alive. -// var depth = 0; -// var inactive = false; -// while (parent && parent._routerRoot !== parent) { -// var vnodeData = parent.$vnode ? parent.$vnode.data : {}; -// if (vnodeData.routerView) { -// depth++; -// } -// if (vnodeData.keepAlive && parent._directInactive && parent._inactive) { -// inactive = true; -// } -// parent = parent.$parent; -// } -// data.routerViewDepth = depth; - -// // render previous view if the tree is inactive and kept-alive -// if (inactive) { -// var cachedData = cache[name]; -// var cachedComponent = cachedData && cachedData.component; -// if (cachedComponent) { -// // #2301 -// // pass props -// if (cachedData.configProps) { -// fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps); -// } -// return h(cachedComponent, data, children) -// } else { -// // render previous empty view -// return h() -// } -// } - -// var matched = route.matched[depth]; -// var component = matched && matched.components[name]; - -// // render empty node if no matched route or no config component -// if (!matched || !component) { -// cache[name] = null; -// return h() -// } - -// // cache component -// cache[name] = { component: component }; - -// // attach instance registration hook -// // this will be called in the instance's injected lifecycle hooks -// data.registerRouteInstance = function (vm, val) { -// // val could be undefined for unregistration -// var current = matched.instances[name]; -// if ( -// (val && current !== vm) || -// (!val && current === vm) -// ) { -// matched.instances[name] = val; -// } -// } - -// // also register instance in prepatch hook -// // in case the same component instance is reused across different routes -// ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) { -// matched.instances[name] = vnode.componentInstance; -// }; - -// // register instance in init hook -// // in case kept-alive component be actived when routes changed -// data.hook.init = function (vnode) { -// if (vnode.data.keepAlive && -// vnode.componentInstance && -// vnode.componentInstance !== matched.instances[name] -// ) { -// matched.instances[name] = vnode.componentInstance; -// } - -// // if the route transition has already been confirmed then we weren't -// // able to call the cbs during confirmation as the component was not -// // registered yet, so we call it here. -// handleRouteEntered(route); -// }; - -// var configProps = matched.props && matched.props[name]; -// // save route and configProps in cache -// if (configProps) { -// extend(cache[name], { -// route: route, -// configProps: configProps -// }); -// fillPropsinData(component, data, route, configProps); -// } - -// return h(component, data, children) -// } -// }; - -// function fillPropsinData (component, data, route, configProps) { -// // resolve props -// var propsToPass = data.props = resolveProps(route, configProps); -// if (propsToPass) { -// // clone to prevent mutation -// propsToPass = data.props = extend({}, propsToPass); -// // pass non-declared props as attrs -// var attrs = data.attrs = data.attrs || {}; -// for (var key in propsToPass) { -// if (!component.props || !(key in component.props)) { -// attrs[key] = propsToPass[key]; -// delete propsToPass[key]; -// } -// } -// } -// } - -// function resolveProps (route, config) { -// switch (typeof config) { -// case 'undefined': -// return -// case 'object': -// return config -// case 'function': -// return config(route) -// case 'boolean': -// return config ? route.params : undefined -// default: -// { -// warn( -// false, -// "props in \"" + (route.path) + "\" is a " + (typeof config) + ", " + -// "expecting an object, function or boolean." -// ); -// } -// } -// } - -/* */ - -function resolvePath(relative, base, append) { - const firstChar = relative.charAt(0); - if (firstChar === "/") { - return relative; - } - - if (firstChar === "?" || firstChar === "#") { - return base + relative; - } - - const stack = base.split("/"); - - // remove trailing segment if: - // - not appending - // - appending to trailing slash (last segment is empty) - if (!append || !stack[stack.length - 1]) { - stack.pop(); - } - - // resolve relative path - const segments = relative.replace(/^\//, "").split("/"); - for (let i = 0; i < segments.length; i++) { - const segment = segments[i]; - if (segment === "..") { - stack.pop(); - } else if (segment !== ".") { - stack.push(segment); - } - } - - // ensure leading slash - if (stack[0] !== "") { - stack.unshift(""); - } - - return stack.join("/"); -} - -function parsePath(path) { - let hash = ""; - let query = ""; - - const hashIndex = path.indexOf("#"); - if (hashIndex >= 0) { - hash = path.slice(hashIndex); - path = path.slice(0, hashIndex); - } - - const queryIndex = path.indexOf("?"); - if (queryIndex >= 0) { - query = path.slice(queryIndex + 1); - path = path.slice(0, queryIndex); - } - - return { - path, - query, - hash - }; -} - -function cleanPath(path) { - return path.replace(/\/\//g, "/"); -} - -const isarray = - Array.isArray || - function (arr) { - return Object.prototype.toString.call(arr) == "[object Array]"; - }; - -/** - * Expose `pathToRegexp`. - */ -const pathToRegexp_1 = pathToRegexp; -const parse_1 = parse; -const compile_1 = compile; -const tokensToFunction_1 = tokensToFunction; -const tokensToRegExp_1 = tokensToRegExp; - -/** - * The main path matching regexp utility. - * - * @type {RegExp} - */ -const PATH_REGEXP = new RegExp( - [ - // Match escaped characters that would otherwise appear in future matches. - // This allows the user to escape special characters that won't transform. - "(\\\\.)", - // Match Express-style parameters and un-named parameters with a prefix - // and optional suffixes. Matches appear as: - // - // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] - // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] - // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] - "([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))" - ].join("|"), - "g" -); - -/** - * Parse a string for the raw tokens. - * - * @param {string} str - * @param {Object=} options - * @return {!Array} - */ -function parse(str, options) { - const tokens = []; - let key = 0; - let index = 0; - let path = ""; - const defaultDelimiter = (options && options.delimiter) || "/"; - let res; - - while ((res = PATH_REGEXP.exec(str)) != null) { - const m = res[0]; - const escaped = res[1]; - const offset = res.index; - path += str.slice(index, offset); - index = offset + m.length; - - // Ignore already escaped sequences. - if (escaped) { - path += escaped[1]; - continue; - } - - const next = str[index]; - const prefix = res[2]; - const name = res[3]; - const capture = res[4]; - const group = res[5]; - const modifier = res[6]; - const asterisk = res[7]; - - // Push the current path onto the tokens. - if (path) { - tokens.push(path); - path = ""; - } - - const partial = prefix != null && next != null && next !== prefix; - const repeat = modifier === "+" || modifier === "*"; - const optional = modifier === "?" || modifier === "*"; - const delimiter = res[2] || defaultDelimiter; - const pattern = capture || group; - - tokens.push({ - name: name || key++, - prefix: prefix || "", - delimiter, - optional, - repeat, - partial, - asterisk: !!asterisk, - pattern: pattern - ? escapeGroup(pattern) - : asterisk - ? ".*" - : `[^${escapeString(delimiter)}]+?` - }); - } - - // Match any characters still remaining. - if (index < str.length) { - path += str.substr(index); - } - - // If the path exists, push it onto the end. - if (path) { - tokens.push(path); - } - - return tokens; -} - -/** - * Compile a string to a template function for the path. - * - * @param {string} str - * @param {Object=} options - * @return {!function(Object=, Object=)} - */ -function compile(str, options) { - return tokensToFunction(parse(str, options), options); -} - -/** - * Prettier encoding of URI path segments. - * - * @param {string} - * @return {string} - */ -function encodeURIComponentPretty(str) { - return encodeURI(str).replace( - /[\/?#]/g, - (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}` - ); -} - -/** - * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. - * - * @param {string} - * @return {string} - */ -function encodeAsterisk(str) { - return encodeURI(str).replace( - /[?#]/g, - (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}` - ); -} - -/** - * Expose a method for transforming tokens into the path function. - */ -function tokensToFunction(tokens, options) { - // Compile all the tokens into regexps. - const matches = new Array(tokens.length); - - // Compile all the patterns before compilation. - for (let i = 0; i < tokens.length; i++) { - if (typeof tokens[i] === "object") { - matches[i] = new RegExp( - `^(?:${tokens[i].pattern})$`, - flags(options) - ); - } - } - - return function (obj, opts) { - let path = ""; - const data = obj || {}; - const options = opts || {}; - const encode = options.pretty - ? encodeURIComponentPretty - : encodeURIComponent; - - for (let i = 0; i < tokens.length; i++) { - const token = tokens[i]; - - if (typeof token === "string") { - path += token; - - continue; - } - - const value = data[token.name]; - var segment; - - if (value == null) { - if (token.optional) { - // Prepend partial segment prefixes. - if (token.partial) { - path += token.prefix; - } - - continue; - } else { - throw new TypeError( - `Expected "${token.name}" to be defined` - ); - } - } - - if (isarray(value)) { - if (!token.repeat) { - throw new TypeError( - `Expected "${ - token.name - }" to not repeat, but received \`${JSON.stringify( - value - )}\`` - ); - } - - if (value.length === 0) { - if (token.optional) { - continue; - } else { - throw new TypeError( - `Expected "${token.name}" to not be empty` - ); - } - } - - for (let j = 0; j < value.length; j++) { - segment = encode(value[j]); - - if (!matches[i].test(segment)) { - throw new TypeError( - `Expected all "${token.name}" to match "${ - token.pattern - }", but received \`${JSON.stringify(segment)}\`` - ); - } - - path += - (j === 0 ? token.prefix : token.delimiter) + segment; - } - - continue; - } - - segment = token.asterisk ? encodeAsterisk(value) : encode(value); - - if (!matches[i].test(segment)) { - throw new TypeError( - `Expected "${token.name}" to match "${token.pattern}", but received "${segment}"` - ); - } - - path += token.prefix + segment; - } - - return path; - }; -} - -/** - * Escape a regular expression string. - * - * @param {string} str - * @return {string} - */ -function escapeString(str) { - return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, "\\$1"); -} - -/** - * Escape the capturing group by escaping special characters and meaning. - * - * @param {string} group - * @return {string} - */ -function escapeGroup(group) { - return group.replace(/([=!:$\/()])/g, "\\$1"); -} - -/** - * Attach the keys as a property of the regexp. - * - * @param {!RegExp} re - * @param {Array} keys - * @return {!RegExp} - */ -function attachKeys(re, keys) { - re.keys = keys; - - return re; -} - -/** - * Get the flags for a regexp from the options. - * - * @param {Object} options - * @return {string} - */ -function flags(options) { - return options && options.sensitive ? "" : "i"; -} - -/** - * Pull out keys from a regexp. - * - * @param {!RegExp} path - * @param {!Array} keys - * @return {!RegExp} - */ -function regexpToRegexp(path, keys) { - // Use a negative lookahead to match only capturing groups. - const groups = path.source.match(/\((?!\?)/g); - - if (groups) { - for (let i = 0; i < groups.length; i++) { - keys.push({ - name: i, - prefix: null, - delimiter: null, - optional: false, - repeat: false, - partial: false, - asterisk: false, - pattern: null - }); - } - } - - return attachKeys(path, keys); -} - -/** - * Transform an array into a regexp. - * - * @param {!Array} path - * @param {Array} keys - * @param {!Object} options - * @return {!RegExp} - */ -function arrayToRegexp(path, keys, options) { - const parts = []; - - for (let i = 0; i < path.length; i++) { - parts.push(pathToRegexp(path[i], keys, options).source); - } - - const regexp = new RegExp(`(?:${parts.join("|")})`, flags(options)); - - return attachKeys(regexp, keys); -} - -/** - * Create a path regexp from string input. - * - * @param {string} path - * @param {!Array} keys - * @param {!Object} options - * @return {!RegExp} - */ -function stringToRegexp(path, keys, options) { - return tokensToRegExp(parse(path, options), keys, options); -} - -/** - * Expose a function for taking tokens and returning a RegExp. - * - * @param {!Array} tokens - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} - */ -function tokensToRegExp(tokens, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options); - keys = []; - } - - options = options || {}; - - const strict = options.strict; - const end = options.end !== false; - let route = ""; - - // Iterate over the tokens and create our regexp string. - for (let i = 0; i < tokens.length; i++) { - const token = tokens[i]; - - if (typeof token === "string") { - route += escapeString(token); - } else { - const prefix = escapeString(token.prefix); - let capture = `(?:${token.pattern})`; - - keys.push(token); - - if (token.repeat) { - capture += `(?:${prefix}${capture})*`; - } - - if (token.optional) { - if (!token.partial) { - capture = `(?:${prefix}(${capture}))?`; - } else { - capture = `${prefix}(${capture})?`; - } - } else { - capture = `${prefix}(${capture})`; - } - - route += capture; - } - } - - const delimiter = escapeString(options.delimiter || "/"); - const endsWithDelimiter = route.slice(-delimiter.length) === delimiter; - - // In non-strict mode we allow a slash at the end of match. If the path to - // match already ends with a slash, we remove it for consistency. The slash - // is valid at the end of a path match, not in the middle. This is important - // in non-ending mode, where "/test/" shouldn't match "/test//route". - if (!strict) { - route = `${ - endsWithDelimiter ? route.slice(0, -delimiter.length) : route - }(?:${delimiter}(?=$))?`; - } - - if (end) { - route += "$"; - } else { - // In non-ending mode, we need the capturing groups to match as much as - // possible by using a positive lookahead to the end or next path segment. - route += strict && endsWithDelimiter ? "" : `(?=${delimiter}|$)`; - } - - return attachKeys(new RegExp(`^${route}`, flags(options)), keys); -} - -/** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - * - * @param {(string|RegExp|Array)} path - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} - */ -function pathToRegexp(path, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options); - keys = []; - } - - options = options || {}; - - if (path instanceof RegExp) { - return regexpToRegexp(path, /** @type {!Array} */ (keys)); - } - - if (isarray(path)) { - return arrayToRegexp( - /** @type {!Array} */ (path), - /** @type {!Array} */ (keys), - options - ); - } - - return stringToRegexp( - /** @type {string} */ (path), - /** @type {!Array} */ (keys), - options - ); -} -pathToRegexp_1.parse = parse_1; -pathToRegexp_1.compile = compile_1; -pathToRegexp_1.tokensToFunction = tokensToFunction_1; -pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; - -/* */ - -// $flow-disable-line -const regexpCompileCache = Object.create(null); - -function fillParams(path, params, routeMsg) { - params = params || {}; - try { - const filler = - regexpCompileCache[path] || - (regexpCompileCache[path] = pathToRegexp_1.compile(path)); - - // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }} - // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string - if (typeof params.pathMatch === "string") { - params[0] = params.pathMatch; - } - - return filler(params, { pretty: true }); - } catch (e) { - { - // Fix #3072 no warn if `pathMatch` is string - warn( - typeof params.pathMatch === "string", - `missing param for ${routeMsg}: ${e.message}` - ); - } - - return ""; - } finally { - // delete the 0 if it was added - delete params[0]; - } -} - -/* */ - -function normalizeLocation(raw, current, append, router) { - let next = typeof raw === "string" ? { path: raw } : raw; - // named target - if (next._normalized) { - return next; - } else if (next.name) { - next = extend({}, raw); - const params = next.params; - if (params && typeof params === "object") { - next.params = extend({}, params); - } - - return next; - } - - // relative params - if (!next.path && next.params && current) { - next = extend({}, next); - next._normalized = true; - const params$1 = extend(extend({}, current.params), next.params); - if (current.name) { - next.name = current.name; - next.params = params$1; - } else if (current.matched.length) { - const rawPath = current.matched[current.matched.length - 1].path; - next.path = fillParams(rawPath, params$1, `path ${current.path}`); - } else { - warn(false, "relative params navigation requires a current route."); - } - - return next; - } - - const parsedPath = parsePath(next.path || ""); - const basePath = (current && current.path) || "/"; - const path = parsedPath.path - ? resolvePath(parsedPath.path, basePath, append || next.append) - : basePath; - - const query = resolveQuery( - parsedPath.query, - next.query, - router && router.options.parseQuery - ); - - let hash = next.hash || parsedPath.hash; - if (hash && hash.charAt(0) !== "#") { - hash = `#${hash}`; - } - - return { - _normalized: true, - path, - query, - hash - }; -} - -// var toTypes = [String, Object]; -// var eventTypes = [String, Array]; - -// var noop = function () {}; - -// var warnedCustomSlot; -// var warnedTagProp; -// var warnedEventProp; - -// var Link = { -// name: 'RouterLink', -// props: { -// to: { -// type: toTypes, -// required: true -// }, -// tag: { -// type: String, -// default: 'a' -// }, -// custom: Boolean, -// exact: Boolean, -// exactPath: Boolean, -// append: Boolean, -// replace: Boolean, -// activeClass: String, -// exactActiveClass: String, -// ariaCurrentValue: { -// type: String, -// default: 'page' -// }, -// event: { -// type: eventTypes, -// default: 'click' -// } -// }, -// render: function render (h) { -// var this$1 = this; - -// var router = this.$router; -// var current = this.$route; -// var ref = router.resolve( -// this.to, -// current, -// this.append -// ); -// var location = ref.location; -// var route = ref.route; -// var href = ref.href; - -// var classes = {}; -// var globalActiveClass = router.options.linkActiveClass; -// var globalExactActiveClass = router.options.linkExactActiveClass; -// // Support global empty active class -// var activeClassFallback = -// globalActiveClass == null ? 'router-link-active' : globalActiveClass; -// var exactActiveClassFallback = -// globalExactActiveClass == null -// ? 'router-link-exact-active' -// : globalExactActiveClass; -// var activeClass = -// this.activeClass == null ? activeClassFallback : this.activeClass; -// var exactActiveClass = -// this.exactActiveClass == null -// ? exactActiveClassFallback -// : this.exactActiveClass; - -// var compareTarget = route.redirectedFrom -// ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router) -// : route; - -// classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath); -// classes[activeClass] = this.exact || this.exactPath -// ? classes[exactActiveClass] -// : isIncludedRoute(current, compareTarget); - -// var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null; - -// var handler = function (e) { -// if (guardEvent(e)) { -// if (this$1.replace) { -// router.replace(location, noop); -// } else { -// router.push(location, noop); -// } -// } -// }; - -// var on = { click: guardEvent }; -// if (Array.isArray(this.event)) { -// this.event.forEach(function (e) { -// on[e] = handler; -// }); -// } else { -// on[this.event] = handler; -// } - -// var data = { class: classes }; - -// var scopedSlot = -// !this.$scopedSlots.$hasNormal && -// this.$scopedSlots.default && -// this.$scopedSlots.default({ -// href: href, -// route: route, -// navigate: handler, -// isActive: classes[activeClass], -// isExactActive: classes[exactActiveClass] -// }); - -// if (scopedSlot) { -// if (!this.custom) { -// !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an element. Use the custom prop to remove this warning:\n\n'); -// warnedCustomSlot = true; -// } -// if (scopedSlot.length === 1) { -// return scopedSlot[0] -// } else if (scopedSlot.length > 1 || !scopedSlot.length) { -// { -// warn( -// false, -// (" with to=\"" + (this.to) + "\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.") -// ); -// } -// return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot) -// } -// } - -// { -// if ('tag' in this.$options.propsData && !warnedTagProp) { -// warn( -// false, -// "'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link." -// ); -// warnedTagProp = true; -// } -// if ('event' in this.$options.propsData && !warnedEventProp) { -// warn( -// false, -// "'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link." -// ); -// warnedEventProp = true; -// } -// } - -// if (this.tag === 'a') { -// data.on = on; -// data.attrs = { href: href, 'aria-current': ariaCurrentValue }; -// } else { -// // find the first child and apply listener and href -// var a = findAnchor(this.$slots.default); -// if (a) { -// // in case the is a static node -// a.isStatic = false; -// var aData = (a.data = extend({}, a.data)); -// aData.on = aData.on || {}; -// // transform existing events in both objects into arrays so we can push later -// for (var event in aData.on) { -// var handler$1 = aData.on[event]; -// if (event in on) { -// aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1]; -// } -// } -// // append new listeners for router-link -// for (var event$1 in on) { -// if (event$1 in aData.on) { -// // on[event] is always a function -// aData.on[event$1].push(on[event$1]); -// } else { -// aData.on[event$1] = handler; -// } -// } - -// var aAttrs = (a.data.attrs = extend({}, a.data.attrs)); -// aAttrs.href = href; -// aAttrs['aria-current'] = ariaCurrentValue; -// } else { -// // doesn't have child, apply listener to self -// data.on = on; -// } -// } - -// return h(this.tag, data, this.$slots.default) -// } -// }; - -function guardEvent(e) { - // don't redirect with control keys - if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { - return; - } - // don't redirect when preventDefault called - if (e.defaultPrevented) { - return; - } - // don't redirect on right click - if (e.button !== undefined && e.button !== 0) { - return; - } - // don't redirect if `target="_blank"` - if (e.currentTarget && e.currentTarget.getAttribute) { - const target = e.currentTarget.getAttribute("target"); - if (/\b_blank\b/i.test(target)) { - return; - } - } - // this may be a Weex event which doesn't have this method - if (e.preventDefault) { - e.preventDefault(); - } - - return true; -} - -function findAnchor(children) { - if (children) { - let child; - for (let i = 0; i < children.length; i++) { - child = children[i]; - if (child.tag === "a") { - return child; - } - if (child.children && (child = findAnchor(child.children))) { - return child; - } - } - } -} - -// var _Vue; - -// function install (Vue) { -// if (install.installed && _Vue === Vue) { return } -// install.installed = true; - -// _Vue = Vue; - -// var isDef = function (v) { return v !== undefined; }; - -// var registerInstance = function (vm, callVal) { -// var i = vm.$options._parentVnode; -// if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) { -// i(vm, callVal); -// } -// }; - -// Vue.mixin({ -// beforeCreate: function beforeCreate () { -// if (isDef(this.$options.router)) { -// this._routerRoot = this; -// this._router = this.$options.router; -// this._router.init(this); -// Vue.util.defineReactive(this, '_route', this._router.history.current); -// } else { -// this._routerRoot = (this.$parent && this.$parent._routerRoot) || this; -// } -// registerInstance(this, this); -// }, -// destroyed: function destroyed () { -// registerInstance(this); -// } -// }); - -// Object.defineProperty(Vue.prototype, '$router', { -// get: function get () { return this._routerRoot._router } -// }); - -// Object.defineProperty(Vue.prototype, '$route', { -// get: function get () { return this._routerRoot._route } -// }); - -// Vue.component('RouterView', View); -// Vue.component('RouterLink', Link); - -// var strats = Vue.config.optionMergeStrategies; -// // use the same hook merging strategy for route hooks -// strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created; -// } - -/* */ - -const inBrowser = typeof window !== "undefined"; - -/* */ - -function createRouteMap( - routes, - oldPathList, - oldPathMap, - oldNameMap, - parentRoute -) { - // the path list is used to control path matching priority - const pathList = oldPathList || []; - // $flow-disable-line - const pathMap = oldPathMap || Object.create(null); - // $flow-disable-line - const nameMap = oldNameMap || Object.create(null); - - routes.forEach((route) => { - addRouteRecord(pathList, pathMap, nameMap, route, parentRoute); - }); - - // ensure wildcard routes are always at the end - for (let i = 0, l = pathList.length; i < l; i++) { - if (pathList[i] === "*") { - pathList.push(pathList.splice(i, 1)[0]); - l--; - i--; - } - } - - { - // warn if routes do not include leading slashes - const found = pathList - // check for missing leading slash - .filter( - (path) => - path && path.charAt(0) !== "*" && path.charAt(0) !== "/" - ); - - if (found.length > 0) { - const pathNames = found.map((path) => `- ${path}`).join("\n"); - warn( - false, - `Non-nested routes must include a leading slash character. Fix the following routes: \n${pathNames}` - ); - } - } - - return { - pathList, - pathMap, - nameMap - }; -} - -function addRouteRecord(pathList, pathMap, nameMap, route, parent, matchAs) { - const path = route.path; - const name = route.name; - { - assert(path != null, '"path" is required in a route configuration.'); - assert( - typeof route.component !== "string", - `route config "component" for path: ${String( - path || name - )} cannot be a ` + "string id. Use an actual component instead." - ); - - warn( - // eslint-disable-next-line no-control-regex - !/[^\u0000-\u007F]+/.test(path), - `Route with path "${path}" contains unencoded characters, make sure ` + - "your path is correctly encoded before passing it to the router. Use " + - "encodeURI to encode static segments of your path." - ); - } - - const pathToRegexpOptions = route.pathToRegexpOptions || {}; - const normalizedPath = normalizePath( - path, - parent, - pathToRegexpOptions.strict - ); - - if (typeof route.caseSensitive === "boolean") { - pathToRegexpOptions.sensitive = route.caseSensitive; - } - - const record = { - path: normalizedPath, - regex: compileRouteRegex(normalizedPath, pathToRegexpOptions), - components: route.components || { default: route.component }, - alias: route.alias - ? typeof route.alias === "string" - ? [route.alias] - : route.alias - : [], - instances: {}, - enteredCbs: {}, - name, - parent, - matchAs, - redirect: route.redirect, - beforeEnter: route.beforeEnter, - meta: route.meta || {}, - props: - route.props == null - ? {} - : route.components - ? route.props - : { default: route.props } - }; - - if (route.children) { - // Warn if route is named, does not redirect and has a default child route. - // If users navigate to this route by name, the default child will - // not be rendered (GH Issue #629) - { - if ( - route.name && - !route.redirect && - route.children.some((child) => /^\/?$/.test(child.path)) - ) { - warn( - false, - `Named Route '${route.name}' has a default child route. ` + - `When navigating to this named route (:to="{name: '${route.name}'"), ` + - "the default child route will not be rendered. Remove the name from " + - "this route and use the name of the default child route for named " + - "links instead." - ); - } - } - route.children.forEach((child) => { - const childMatchAs = matchAs - ? cleanPath(`${matchAs}/${child.path}`) - : undefined; - addRouteRecord( - pathList, - pathMap, - nameMap, - child, - record, - childMatchAs - ); - }); - } - - if (!pathMap[record.path]) { - pathList.push(record.path); - pathMap[record.path] = record; - } - - if (route.alias !== undefined) { - const aliases = Array.isArray(route.alias) - ? route.alias - : [route.alias]; - for (let i = 0; i < aliases.length; ++i) { - const alias = aliases[i]; - if (alias === path) { - warn( - false, - `Found an alias with the same value as the path: "${path}". You have to remove that alias. It will be ignored in development.` - ); - // skip in dev to make it work - continue; - } - - const aliasRoute = { - path: alias, - children: route.children - }; - addRouteRecord( - pathList, - pathMap, - nameMap, - aliasRoute, - parent, - record.path || "/" // matchAs - ); - } - } - - if (name) { - if (!nameMap[name]) { - nameMap[name] = record; - } else if (!matchAs) { - warn( - false, - `${ - "Duplicate named routes definition: " + '{ name: "' - }${name}", path: "${record.path}" }` - ); - } - } -} - -function compileRouteRegex(path, pathToRegexpOptions) { - const regex = pathToRegexp_1(path, [], pathToRegexpOptions); - { - const keys = Object.create(null); - regex.keys.forEach((key) => { - warn( - !keys[key.name], - `Duplicate param keys in route with path: "${path}"` - ); - keys[key.name] = true; - }); - } - - return regex; -} - -function normalizePath(path, parent, strict) { - if (!strict) { - path = path.replace(/\/$/, ""); - } - if (path[0] === "/") { - return path; - } - if (parent == null) { - return path; - } - - return cleanPath(`${parent.path}/${path}`); -} - -/* */ - -function createMatcher(routes, router) { - const ref = createRouteMap(routes); - const pathList = ref.pathList; - const pathMap = ref.pathMap; - const nameMap = ref.nameMap; - - function addRoutes(routes) { - createRouteMap(routes, pathList, pathMap, nameMap); - } - - function addRoute(parentOrRoute, route) { - const parent = - typeof parentOrRoute !== "object" - ? nameMap[parentOrRoute] - : undefined; - // $flow-disable-line - createRouteMap( - [route || parentOrRoute], - pathList, - pathMap, - nameMap, - parent - ); - - // add aliases of parent - if (parent && parent.alias.length) { - createRouteMap( - // $flow-disable-line route is defined if parent is - parent.alias.map((alias) => { - return { path: alias, children: [route] }; - }), - pathList, - pathMap, - nameMap, - parent - ); - } - } - - function getRoutes() { - return pathList.map((path) => pathMap[path]); - } - - function match(raw, currentRoute, redirectedFrom) { - const location = normalizeLocation(raw, currentRoute, false, router); - const name = location.name; - - if (name) { - const record = nameMap[name]; - { - warn(record, `Route with name '${name}' does not exist`); - } - if (!record) { - return _createRoute(null, location); - } - const paramNames = record.regex.keys - .filter((key) => !key.optional) - .map((key) => key.name); - - if (typeof location.params !== "object") { - location.params = {}; - } - - if (currentRoute && typeof currentRoute.params === "object") { - for (const key in currentRoute.params) { - if ( - !(key in location.params) && - paramNames.indexOf(key) > -1 - ) { - location.params[key] = currentRoute.params[key]; - } - } - } - - location.path = fillParams( - record.path, - location.params, - `named route "${name}"` - ); - - return _createRoute(record, location, redirectedFrom); - } else if (location.path) { - location.params = {}; - for (let i = 0; i < pathList.length; i++) { - const path = pathList[i]; - const record$1 = pathMap[path]; - if ( - matchRoute(record$1.regex, location.path, location.params) - ) { - return _createRoute(record$1, location, redirectedFrom); - } - } - } - // no match - return _createRoute(null, location); - } - - function redirect(record, location) { - const originalRedirect = record.redirect; - let redirect = - typeof originalRedirect === "function" - ? originalRedirect(createRoute(record, location, null, router)) - : originalRedirect; - - if (typeof redirect === "string") { - redirect = { path: redirect }; - } - - if (!redirect || typeof redirect !== "object") { - { - warn( - false, - `invalid redirect option: ${JSON.stringify(redirect)}` - ); - } - - return _createRoute(null, location); - } - - const re = redirect; - const name = re.name; - const path = re.path; - let query = location.query; - let hash = location.hash; - let params = location.params; - query = re.hasOwnProperty("query") ? re.query : query; - hash = re.hasOwnProperty("hash") ? re.hash : hash; - params = re.hasOwnProperty("params") ? re.params : params; - - if (name) { - // resolved named direct - const targetRecord = nameMap[name]; - { - assert( - targetRecord, - `redirect failed: named route "${name}" not found.` - ); - } - - return match( - { - _normalized: true, - name, - query, - hash, - params - }, - undefined, - location - ); - } else if (path) { - // 1. resolve relative redirect - const rawPath = resolveRecordPath(path, record); - // 2. resolve params - const resolvedPath = fillParams( - rawPath, - params, - `redirect route with path "${rawPath}"` - ); - // 3. rematch with existing query and hash - return match( - { - _normalized: true, - path: resolvedPath, - query, - hash - }, - undefined, - location - ); - } else { - { - warn( - false, - `invalid redirect option: ${JSON.stringify(redirect)}` - ); - } - - return _createRoute(null, location); - } - } - - function alias(record, location, matchAs) { - const aliasedPath = fillParams( - matchAs, - location.params, - `aliased route with path "${matchAs}"` - ); - const aliasedMatch = match({ - _normalized: true, - path: aliasedPath - }); - if (aliasedMatch) { - const matched = aliasedMatch.matched; - const aliasedRecord = matched[matched.length - 1]; - location.params = aliasedMatch.params; - - return _createRoute(aliasedRecord, location); - } - - return _createRoute(null, location); - } - - function _createRoute(record, location, redirectedFrom) { - if (record && record.redirect) { - return redirect(record, redirectedFrom || location); - } - if (record && record.matchAs) { - return alias(record, location, record.matchAs); - } - - return createRoute(record, location, redirectedFrom, router); - } - - return { - match, - addRoute, - getRoutes, - addRoutes - }; -} - -function matchRoute(regex, path, params) { - const m = path.match(regex); - - if (!m) { - return false; - } else if (!params) { - return true; - } - - for (let i = 1, len = m.length; i < len; ++i) { - const key = regex.keys[i - 1]; - if (key) { - // Fix #1994: using * with props: true generates a param named 0 - params[key.name || "pathMatch"] = - typeof m[i] === "string" ? decode(m[i]) : m[i]; - } - } - - return true; -} - -function resolveRecordPath(path, record) { - return resolvePath(path, record.parent ? record.parent.path : "/", true); -} - -/* */ - -// use User Timing api (if present) for more accurate key precision -const Time = - inBrowser && window.performance && window.performance.now - ? window.performance - : Date; - -function genStateKey() { - return Time.now().toFixed(3); -} - -let _key = genStateKey(); - -function getStateKey() { - return _key; -} - -function setStateKey(key) { - return (_key = key); -} - -/* */ - -const positionStore = Object.create(null); - -function setupScroll() { - // Prevent browser scroll behavior on History popstate - if ("scrollRestoration" in window.history) { - window.history.scrollRestoration = "manual"; - } - // Fix for #1585 for Firefox - // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678 - // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with - // window.location.protocol + '//' + window.location.host - // location.host contains the port and location.hostname doesn't - const protocolAndPath = `${window.location.protocol}//${window.location.host}`; - const absolutePath = window.location.href.replace(protocolAndPath, ""); - // preserve existing history state as it could be overriden by the user - const stateCopy = extend({}, window.history.state); - stateCopy.key = getStateKey(); - window.history.replaceState(stateCopy, "", absolutePath); - window.addEventListener("popstate", handlePopState); - - return function () { - window.removeEventListener("popstate", handlePopState); - }; -} - -function handleScroll(router, to, from, isPop) { - if (!router.app) { - return; - } - - const behavior = router.options.scrollBehavior; - if (!behavior) { - return; - } - - { - assert( - typeof behavior === "function", - "scrollBehavior must be a function" - ); - } - - // wait until re-render finishes before scrolling - nextTick(() => { - const position = getScrollPosition(); - const shouldScroll = behavior.call( - router, - to, - from, - isPop ? position : null - ); - - if (!shouldScroll) { - return; - } - - if (typeof shouldScroll.then === "function") { - shouldScroll - .then((shouldScroll) => { - scrollToPosition(shouldScroll, position); - }) - .catch((err) => { - { - assert(false, err.toString()); - } - }); - } else { - scrollToPosition(shouldScroll, position); - } - }); -} - -function saveScrollPosition() { - const key = getStateKey(); - if (key) { - positionStore[key] = { - x: window.pageXOffset, - y: window.pageYOffset - }; - } -} - -function handlePopState(e) { - saveScrollPosition(); - if (e.state && e.state.key) { - setStateKey(e.state.key); - } -} - -function getScrollPosition() { - const key = getStateKey(); - if (key) { - return positionStore[key]; - } -} - -function getElementPosition(el, offset) { - const docEl = document.documentElement; - const docRect = docEl.getBoundingClientRect(); - const elRect = el.getBoundingClientRect(); - - return { - x: elRect.left - docRect.left - offset.x, - y: elRect.top - docRect.top - offset.y - }; -} - -function isValidPosition(obj) { - return isNumber(obj.x) || isNumber(obj.y); -} - -function normalizePosition(obj) { - return { - x: isNumber(obj.x) ? obj.x : window.pageXOffset, - y: isNumber(obj.y) ? obj.y : window.pageYOffset - }; -} - -function normalizeOffset(obj) { - return { - x: isNumber(obj.x) ? obj.x : 0, - y: isNumber(obj.y) ? obj.y : 0 - }; -} - -function isNumber(v) { - return typeof v === "number"; -} - -const hashStartsWithNumberRE = /^#\d/; - -function scrollToPosition(shouldScroll, position) { - const isObject = typeof shouldScroll === "object"; - if (isObject && typeof shouldScroll.selector === "string") { - // getElementById would still fail if the selector contains a more complicated query like #main[data-attr] - // but at the same time, it doesn't make much sense to select an element with an id and an extra selector - const el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line - ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line - : document.querySelector(shouldScroll.selector); - - if (el) { - let offset = - shouldScroll.offset && typeof shouldScroll.offset === "object" - ? shouldScroll.offset - : {}; - offset = normalizeOffset(offset); - position = getElementPosition(el, offset); - } else if (isValidPosition(shouldScroll)) { - position = normalizePosition(shouldScroll); - } - } else if (isObject && isValidPosition(shouldScroll)) { - position = normalizePosition(shouldScroll); - } - - if (position) { - // $flow-disable-line - if ("scrollBehavior" in document.documentElement.style) { - window.scrollTo({ - left: position.x, - top: position.y, - // $flow-disable-line - behavior: shouldScroll.behavior - }); - } else { - window.scrollTo(position.x, position.y); - } - } -} - -/* */ - -const supportsPushState = - inBrowser && - (function () { - const ua = window.navigator.userAgent; - - if ( - (ua.indexOf("Android 2.") !== -1 || - ua.indexOf("Android 4.0") !== -1) && - ua.indexOf("Mobile Safari") !== -1 && - ua.indexOf("Chrome") === -1 && - ua.indexOf("Windows Phone") === -1 - ) { - return false; - } - - return window.history && typeof window.history.pushState === "function"; - })(); - -function pushState(url, replace) { - saveScrollPosition(); - // try...catch the pushState call to get around Safari - // DOM Exception 18 where it limits to 100 pushState calls - const history = window.history; - try { - if (replace) { - // preserve existing history state as it could be overriden by the user - const stateCopy = extend({}, history.state); - stateCopy.key = getStateKey(); - history.replaceState(stateCopy, "", url); - } else { - history.pushState({ key: setStateKey(genStateKey()) }, "", url); - } - } catch (e) { - window.location[replace ? "replace" : "assign"](url); - } -} - -function replaceState(url) { - pushState(url, true); -} - -/* */ - -function runQueue(queue, fn, cb) { - var step = function (index) { - if (index >= queue.length) { - cb(); - } else { - if (queue[index]) { - fn(queue[index], () => { - step(index + 1); - }); - } else { - step(index + 1); - } - } - }; - step(0); -} - -// When changing thing, also edit router.d.ts -const NavigationFailureType = { - redirected: 2, - aborted: 4, - cancelled: 8, - duplicated: 16 -}; - -function createNavigationRedirectedError(from, to) { - return createRouterError( - from, - to, - NavigationFailureType.redirected, - `Redirected when going from "${from.fullPath}" to "${stringifyRoute( - to - )}" via a navigation guard.` - ); -} - -function createNavigationDuplicatedError(from, to) { - const error = createRouterError( - from, - to, - NavigationFailureType.duplicated, - `Avoided redundant navigation to current location: "${from.fullPath}".` - ); - // backwards compatible with the first introduction of Errors - error.name = "NavigationDuplicated"; - - return error; -} - -function createNavigationCancelledError(from, to) { - return createRouterError( - from, - to, - NavigationFailureType.cancelled, - `Navigation cancelled from "${from.fullPath}" to "${to.fullPath}" with a new navigation.` - ); -} - -function createNavigationAbortedError(from, to) { - return createRouterError( - from, - to, - NavigationFailureType.aborted, - `Navigation aborted from "${from.fullPath}" to "${to.fullPath}" via a navigation guard.` - ); -} - -function createRouterError(from, to, type, message) { - const error = new Error(message); - error._isRouter = true; - error.from = from; - error.to = to; - error.type = type; - - return error; -} - -const propertiesToLog = ["params", "query", "hash"]; - -function stringifyRoute(to) { - if (typeof to === "string") { - return to; - } - if ("path" in to) { - return to.path; - } - const location = {}; - propertiesToLog.forEach((key) => { - if (key in to) { - location[key] = to[key]; - } - }); - - return JSON.stringify(location, null, 2); -} - -function isError(err) { - return Object.prototype.toString.call(err).indexOf("Error") > -1; -} - -function isNavigationFailure(err, errorType) { - return ( - isError(err) && - err._isRouter && - (errorType == null || err.type === errorType) - ); -} - -/* */ - -function resolveAsyncComponents(matched) { - return function (to, from, next) { - let hasAsync = false; - let pending = 0; - let error = null; - - flatMapComponents(matched, (def, _, match, key) => { - // if it's a function and doesn't have cid attached, - // assume it's an async component resolve function. - // we are not using Vue's default async resolving mechanism because - // we want to halt the navigation until the incoming component has been - // resolved. - if (typeof def === "function" && def.cid === undefined) { - hasAsync = true; - pending++; - - const resolve = once((resolvedDef) => { - if (isESModule(resolvedDef)) { - resolvedDef = resolvedDef.default; - } - // save resolved on async factory in case it's used elsewhere - def.resolved = resolvedDef; - match.components[key] = resolvedDef; - pending--; - if (pending <= 0) { - next(); - } - }); - - const reject = once((reason) => { - const msg = `Failed to resolve async component ${key}: ${reason}`; - warn(false, msg); - if (!error) { - error = isError(reason) ? reason : new Error(msg); - next(error); - } - }); - - let res; - try { - res = def(resolve, reject); - } catch (e) { - reject(e); - } - if (res) { - if (typeof res.then === "function") { - res.then(resolve, reject); - } else { - // new syntax in Vue 2.3 - const comp = res.component; - if (comp && typeof comp.then === "function") { - comp.then(resolve, reject); - } - } - } - } - }); - - if (!hasAsync) { - next(); - } - }; -} - -function flatMapComponents(matched, fn) { - return flatten( - matched.map((m) => - Object.keys(m.components).map((key) => - fn(m.components[key], m.instances[key], m, key) - ) - ) - ); -} - -function flatten(arr) { - return Array.prototype.concat.apply([], arr); -} - -const hasSymbol = - typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol"; - -function isESModule(obj) { - return ( - obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === "Module") - ); -} - -// in Webpack 2, require.ensure now also returns a Promise -// so the resolve/reject functions may get called an extra time -// if the user uses an arrow function shorthand that happens to -// return that Promise. -function once(fn) { - let called = false; - - return function () { - let args = [], - len = arguments.length; - while (len--) args[len] = arguments[len]; - - if (called) { - return; - } - called = true; - - return fn.apply(this, args); - }; -} - -/* */ - -const History = function History(router, base) { - this.router = router; - this.base = normalizeBase(base); - // start with a route object that stands for "nowhere" - this.current = START; - this.pending = null; - this.ready = false; - this.readyCbs = []; - this.readyErrorCbs = []; - this.errorCbs = []; - this.listeners = []; -}; - -History.prototype.listen = function listen(cb) { - this.cb = cb; -}; - -History.prototype.onReady = function onReady(cb, errorCb) { - if (this.ready) { - cb(); - } else { - this.readyCbs.push(cb); - if (errorCb) { - this.readyErrorCbs.push(errorCb); - } - } -}; - -History.prototype.onError = function onError(errorCb) { - this.errorCbs.push(errorCb); -}; - -History.prototype.transitionTo = function transitionTo( - location, - onComplete, - onAbort -) { - const this$1 = this; - - let route; - // catch redirect option https://github.com/vuejs/vue-router/issues/3201 - try { - route = this.router.match(location, this.current); - } catch (e) { - this.errorCbs.forEach((cb) => { - cb(e); - }); - // Exception should still be thrown - throw e; - } - const prev = this.current; - this.confirmTransition( - route, - () => { - this$1.updateRoute(route); - onComplete && onComplete(route); - this$1.ensureURL(); - this$1.router.afterHooks.forEach((hook) => { - hook && hook(route, prev); - }); - - // fire ready cbs once - if (!this$1.ready) { - this$1.ready = true; - this$1.readyCbs.forEach((cb) => { - cb(route); - }); - } - }, - (err) => { - if (onAbort) { - onAbort(err); - } - if (err && !this$1.ready) { - // Initial redirection should not mark the history as ready yet - // because it's triggered by the redirection instead - // https://github.com/vuejs/vue-router/issues/3225 - // https://github.com/vuejs/vue-router/issues/3331 - if ( - !isNavigationFailure( - err, - NavigationFailureType.redirected - ) || - prev !== START - ) { - this$1.ready = true; - this$1.readyErrorCbs.forEach((cb) => { - cb(err); - }); - } - } - } - ); -}; - -History.prototype.confirmTransition = function confirmTransition( - route, - onComplete, - onAbort -) { - const this$1 = this; - - const current = this.current; - this.pending = route; - const abort = function (err) { - // changed after adding errors with - // https://github.com/vuejs/vue-router/pull/3047 before that change, - // redirect and aborted navigation would produce an err == null - if (!isNavigationFailure(err) && isError(err)) { - if (this$1.errorCbs.length) { - this$1.errorCbs.forEach((cb) => { - cb(err); - }); - } else { - warn(false, "uncaught error during route navigation:"); - console.error(err); - } - } - onAbort && onAbort(err); - }; - const lastRouteIndex = route.matched.length - 1; - const lastCurrentIndex = current.matched.length - 1; - if ( - isSameRoute(route, current) && - // in the case the route map has been dynamically appended to - lastRouteIndex === lastCurrentIndex && - route.matched[lastRouteIndex] === current.matched[lastCurrentIndex] - ) { - this.ensureURL(); - - return; - } - - const ref = resolveQueue(this.current.matched, route.matched); - const updated = ref.updated; - const deactivated = ref.deactivated; - const activated = ref.activated; - - const queue = [].concat( - // in-component leave guards - extractLeaveGuards(deactivated), - // global before hooks - this.router.beforeHooks, - // in-component update hooks - extractUpdateHooks(updated), - // in-config enter guards - activated.map((m) => m.beforeEnter), - // async components - resolveAsyncComponents(activated) - ); - - const iterator = function (hook, next) { - if (this$1.pending !== route) { - return abort(createNavigationCancelledError(current, route)); - } - try { - hook(route, current, (to) => { - if (to === false) { - // next(false) -> abort navigation, ensure current URL - this$1.ensureURL(true); - abort(createNavigationAbortedError(current, route)); - } else if (isError(to)) { - this$1.ensureURL(true); - abort(to); - } else if ( - typeof to === "string" || - (typeof to === "object" && - (typeof to.path === "string" || - typeof to.name === "string")) - ) { - // next('/') or next({ path: '/' }) -> redirect - abort(createNavigationRedirectedError(current, route)); - if (typeof to === "object" && to.replace) { - this$1.replace(to); - } else { - this$1.push(to); - } - } else { - // confirm transition and pass on the value - next(to); - } - }); - } catch (e) { - abort(e); - } - }; - - runQueue(queue, iterator, () => { - // wait until async components are resolved before - // extracting in-component enter guards - const enterGuards = extractEnterGuards(activated); - const queue = enterGuards.concat(this$1.router.resolveHooks); - runQueue(queue, iterator, () => { - if (this$1.pending !== route) { - return abort(createNavigationCancelledError(current, route)); - } - this$1.pending = null; - onComplete(route); - if (this$1.router.app) { - nextTick(() => { - handleRouteEntered(route); - }); - } - }); - }); -}; - -History.prototype.updateRoute = function updateRoute(route) { - this.current = route; - this.cb && this.cb(route); -}; - -History.prototype.setupListeners = function setupListeners() { - // Default implementation is empty -}; - -History.prototype.teardown = function teardown() { - // clean up event listeners - // https://github.com/vuejs/vue-router/issues/2341 - this.listeners.forEach((cleanupListener) => { - cleanupListener(); - }); - this.listeners = []; - - // reset current history route - // https://github.com/vuejs/vue-router/issues/3294 - this.current = START; - this.pending = null; -}; - -function normalizeBase(base) { - if (!base) { - if (inBrowser) { - // respect tag - const baseEl = document.querySelector("base"); - base = (baseEl && baseEl.getAttribute("href")) || "/"; - // strip full URL origin - base = base.replace(/^https?:\/\/[^\/]+/, ""); - } else { - base = "/"; - } - } - // make sure there's the starting slash - if (base.charAt(0) !== "/") { - base = `/${base}`; - } - // remove trailing slash - return base.replace(/\/$/, ""); -} - -function resolveQueue(current, next) { - let i; - const max = Math.max(current.length, next.length); - for (i = 0; i < max; i++) { - if (current[i] !== next[i]) { - break; - } - } - - return { - updated: next.slice(0, i), - activated: next.slice(i), - deactivated: current.slice(i) - }; -} - -function extractGuards(records, name, bind, reverse) { - const guards = flatMapComponents(records, (def, instance, match, key) => { - const guard = extractGuard(def, name); - if (guard) { - return Array.isArray(guard) - ? guard.map((guard) => bind(guard, instance, match, key)) - : bind(guard, instance, match, key); - } - }); - - return flatten(reverse ? guards.reverse() : guards); -} - -function extractGuard(def, key) { - if (typeof def !== "function") { - // extend now so that global mixins are applied. - // def = _Vue.extend(def); - } - - return def[key]; -} - -function extractLeaveGuards(deactivated) { - return extractGuards(deactivated, "beforeRouteLeave", bindGuard, true); -} - -function extractUpdateHooks(updated) { - return extractGuards(updated, "beforeRouteUpdate", bindGuard); -} - -function bindGuard(guard, instance) { - if (instance) { - return function boundRouteGuard() { - return guard.apply(instance, arguments); - }; - } -} - -function extractEnterGuards(activated) { - return extractGuards( - activated, - "beforeRouteEnter", - (guard, _, match, key) => bindEnterGuard(guard, match, key) - ); -} - -function bindEnterGuard(guard, match, key) { - return function routeEnterGuard(to, from, next) { - return guard(to, from, (cb) => { - if (typeof cb === "function") { - if (!match.enteredCbs[key]) { - match.enteredCbs[key] = []; - } - match.enteredCbs[key].push(cb); - } - next(cb); - }); - }; -} - -/* */ - -const HTML5History = /* @__PURE__*/ (function (History) { - function HTML5History(router, base) { - History.call(this, router, base); - - this._startLocation = getLocation(this.base); - } - - if (History) HTML5History.__proto__ = History; - HTML5History.prototype = Object.create(History && History.prototype); - HTML5History.prototype.constructor = HTML5History; - - HTML5History.prototype.setupListeners = function setupListeners() { - const this$1 = this; - - if (this.listeners.length > 0) { - return; - } - - const router = this.router; - const expectScroll = router.options.scrollBehavior; - const supportsScroll = supportsPushState && expectScroll; - - if (supportsScroll) { - this.listeners.push(setupScroll()); - } - - const handleRoutingEvent = function () { - const current = this$1.current; - - // Avoiding first `popstate` event dispatched in some browsers but first - // history route not updated since async guard at the same time. - const location = getLocation(this$1.base); - if ( - this$1.current === START && - location === this$1._startLocation - ) { - return; - } - - this$1.transitionTo(location, (route) => { - if (supportsScroll) { - handleScroll(router, route, current, true); - } - }); - }; - window.addEventListener("popstate", handleRoutingEvent); - this.listeners.push(() => { - window.removeEventListener("popstate", handleRoutingEvent); - }); - }; - - HTML5History.prototype.go = function go(n) { - window.history.go(n); - }; - - HTML5History.prototype.push = function push(location, onComplete, onAbort) { - const this$1 = this; - - const ref = this; - const fromRoute = ref.current; - this.transitionTo( - location, - (route) => { - pushState(cleanPath(this$1.base + route.fullPath)); - handleScroll(this$1.router, route, fromRoute, false); - onComplete && onComplete(route); - }, - onAbort - ); - }; - - HTML5History.prototype.replace = function replace( - location, - onComplete, - onAbort - ) { - const this$1 = this; - - const ref = this; - const fromRoute = ref.current; - this.transitionTo( - location, - (route) => { - replaceState(cleanPath(this$1.base + route.fullPath)); - handleScroll(this$1.router, route, fromRoute, false); - onComplete && onComplete(route); - }, - onAbort - ); - }; - - HTML5History.prototype.ensureURL = function ensureURL(push) { - if (getLocation(this.base) !== this.current.fullPath) { - const current = cleanPath(this.base + this.current.fullPath); - push ? pushState(current) : replaceState(current); - } - }; - - HTML5History.prototype.getCurrentLocation = function getCurrentLocation() { - return getLocation(this.base); - }; - - return HTML5History; -})(History); - -function getLocation(base) { - let path = window.location.pathname; - const pathLowerCase = path.toLowerCase(); - const baseLowerCase = base.toLowerCase(); - // base="/a" shouldn't turn path="/app" into "/a/pp" - // https://github.com/vuejs/vue-router/issues/3555 - // so we ensure the trailing slash in the base - if ( - base && - (pathLowerCase === baseLowerCase || - pathLowerCase.indexOf(cleanPath(`${baseLowerCase}/`)) === 0) - ) { - path = path.slice(base.length); - } - - return (path || "/") + window.location.search + window.location.hash; -} - -/* */ - -const HashHistory = /* @__PURE__*/ (function (History) { - function HashHistory(router, base, fallback) { - History.call(this, router, base); - // check history fallback deeplinking - if (fallback && checkFallback(this.base)) { - return; - } - ensureSlash(); - } - - if (History) HashHistory.__proto__ = History; - HashHistory.prototype = Object.create(History && History.prototype); - HashHistory.prototype.constructor = HashHistory; - - // this is delayed until the app mounts - // to avoid the hashchange listener being fired too early - HashHistory.prototype.setupListeners = function setupListeners() { - const this$1 = this; - - if (this.listeners.length > 0) { - return; - } - - const router = this.router; - const expectScroll = router.options.scrollBehavior; - const supportsScroll = supportsPushState && expectScroll; - - if (supportsScroll) { - this.listeners.push(setupScroll()); - } - - const handleRoutingEvent = function () { - const current = this$1.current; - if (!ensureSlash()) { - return; - } - this$1.transitionTo(getHash(), (route) => { - if (supportsScroll) { - handleScroll(this$1.router, route, current, true); - } - if (!supportsPushState) { - replaceHash(route.fullPath); - } - }); - }; - const eventType = supportsPushState ? "popstate" : "hashchange"; - window.addEventListener(eventType, handleRoutingEvent); - this.listeners.push(() => { - window.removeEventListener(eventType, handleRoutingEvent); - }); - }; - - HashHistory.prototype.push = function push(location, onComplete, onAbort) { - const this$1 = this; - - const ref = this; - const fromRoute = ref.current; - this.transitionTo( - location, - (route) => { - pushHash(route.fullPath); - handleScroll(this$1.router, route, fromRoute, false); - onComplete && onComplete(route); - }, - onAbort - ); - }; - - HashHistory.prototype.replace = function replace( - location, - onComplete, - onAbort - ) { - const this$1 = this; - - const ref = this; - const fromRoute = ref.current; - this.transitionTo( - location, - (route) => { - replaceHash(route.fullPath); - handleScroll(this$1.router, route, fromRoute, false); - onComplete && onComplete(route); - }, - onAbort - ); - }; - - HashHistory.prototype.go = function go(n) { - window.history.go(n); - }; - - HashHistory.prototype.ensureURL = function ensureURL(push) { - const current = this.current.fullPath; - if (getHash() !== current) { - push ? pushHash(current) : replaceHash(current); - } - }; - - HashHistory.prototype.getCurrentLocation = function getCurrentLocation() { - return getHash(); - }; - - return HashHistory; -})(History); - -function checkFallback(base) { - const location = getLocation(base); - if (!/^\/#/.test(location)) { - window.location.replace(cleanPath(`${base}/#${location}`)); - - return true; - } -} - -function ensureSlash() { - const path = getHash(); - if (path.charAt(0) === "/") { - return true; - } - replaceHash(`/${path}`); - - return false; -} - -function getHash() { - // We can't use window.location.hash here because it's not - // consistent across browsers - Firefox will pre-decode it! - let href = window.location.href; - const index = href.indexOf("#"); - // empty path - if (index < 0) { - return ""; - } - - href = href.slice(index + 1); - - return href; -} - -function getUrl(path) { - const href = window.location.href; - const i = href.indexOf("#"); - const base = i >= 0 ? href.slice(0, i) : href; - - return `${base}#${path}`; -} - -function pushHash(path) { - if (supportsPushState) { - pushState(getUrl(path)); - } else { - window.location.hash = path; - } -} - -function replaceHash(path) { - if (supportsPushState) { - replaceState(getUrl(path)); - } else { - window.location.replace(getUrl(path)); - } -} - -/* */ - -const AbstractHistory = /* @__PURE__*/ (function (History) { - function AbstractHistory(router, base) { - History.call(this, router, base); - this.stack = []; - this.index = -1; - } - - if (History) AbstractHistory.__proto__ = History; - AbstractHistory.prototype = Object.create(History && History.prototype); - AbstractHistory.prototype.constructor = AbstractHistory; - - AbstractHistory.prototype.push = function push( - location, - onComplete, - onAbort - ) { - const this$1 = this; - - this.transitionTo( - location, - (route) => { - this$1.stack = this$1.stack - .slice(0, this$1.index + 1) - .concat(route); - this$1.index++; - onComplete && onComplete(route); - }, - onAbort - ); - }; - - AbstractHistory.prototype.replace = function replace( - location, - onComplete, - onAbort - ) { - const this$1 = this; - - this.transitionTo( - location, - (route) => { - this$1.stack = this$1.stack - .slice(0, this$1.index) - .concat(route); - onComplete && onComplete(route); - }, - onAbort - ); - }; - - AbstractHistory.prototype.go = function go(n) { - const this$1 = this; - - const targetIndex = this.index + n; - if (targetIndex < 0 || targetIndex >= this.stack.length) { - return; - } - const route = this.stack[targetIndex]; - this.confirmTransition( - route, - () => { - const prev = this$1.current; - this$1.index = targetIndex; - this$1.updateRoute(route); - this$1.router.afterHooks.forEach((hook) => { - hook && hook(route, prev); - }); - }, - (err) => { - if ( - isNavigationFailure(err, NavigationFailureType.duplicated) - ) { - this$1.index = targetIndex; - } - } - ); - }; - - AbstractHistory.prototype.getCurrentLocation = - function getCurrentLocation() { - const current = this.stack[this.stack.length - 1]; - - return current ? current.fullPath : "/"; - }; - - AbstractHistory.prototype.ensureURL = function ensureURL() { - // noop - }; - - return AbstractHistory; -})(History); - -/* */ - -const VueRouter = function VueRouter(options) { - if (options === void 0) options = {}; - - this.app = null; - this.apps = []; - this.options = options; - this.beforeHooks = []; - this.resolveHooks = []; - this.afterHooks = []; - this.matcher = createMatcher(options.routes || [], this); - - let mode = options.mode || "hash"; - this.fallback = - mode === "history" && !supportsPushState && options.fallback !== false; - if (this.fallback) { - mode = "hash"; - } - if (!inBrowser) { - mode = "abstract"; - } - this.mode = mode; - - switch (mode) { - case "history": - this.history = new HTML5History(this, options.base); - break; - case "hash": - this.history = new HashHistory(this, options.base, this.fallback); - break; - case "abstract": - this.history = new AbstractHistory(this, options.base); - break; - default: { - assert(false, `invalid mode: ${mode}`); - } - } -}; - -const prototypeAccessors = { currentRoute: { configurable: true } }; - -VueRouter.prototype.match = function match(raw, current, redirectedFrom) { - return this.matcher.match(raw, current, redirectedFrom); -}; - -prototypeAccessors.currentRoute.get = function () { - return this.history && this.history.current; -}; - -VueRouter.prototype.init = function init(app /* Vue component instance */) { - const this$1 = this; - - this.apps.push(app); - - // set up app destroyed handler - // https://github.com/vuejs/vue-router/issues/2639 - app.once("hook:destroyed", () => { - // clean out app from this.apps array once destroyed - const index = this$1.apps.indexOf(app); - if (index > -1) { - this$1.apps.splice(index, 1); - } - // ensure we still have a main app or null if no apps - // we do not release the router so it can be reused - if (this$1.app === app) { - this$1.app = this$1.apps[0] || null; - } - - if (!this$1.app) { - this$1.history.teardown(); - } - }); - - // main app previously initialized - // return as we don't need to set up new history listener - if (this.app) { - return; - } - - this.app = app; - - const history = this.history; - - if (history instanceof HTML5History || history instanceof HashHistory) { - const handleInitialScroll = function (routeOrError) { - const from = history.current; - const expectScroll = this$1.options.scrollBehavior; - const supportsScroll = supportsPushState && expectScroll; - - if (supportsScroll && "fullPath" in routeOrError) { - handleScroll(this$1, routeOrError, from, false); - } - }; - const setupListeners = function (routeOrError) { - history.setupListeners(); - handleInitialScroll(routeOrError); - }; - history.transitionTo( - history.getCurrentLocation(), - setupListeners, - setupListeners - ); - } - - history.listen((route) => { - this$1.apps.forEach((app) => { - app._router.history.current = route; - }); - }); -}; - -VueRouter.prototype.beforeEach = function beforeEach(fn) { - return registerHook(this.beforeHooks, fn); -}; - -VueRouter.prototype.beforeResolve = function beforeResolve(fn) { - return registerHook(this.resolveHooks, fn); -}; - -VueRouter.prototype.afterEach = function afterEach(fn) { - return registerHook(this.afterHooks, fn); -}; - -VueRouter.prototype.onReady = function onReady(cb, errorCb) { - this.history.onReady(cb, errorCb); -}; - -VueRouter.prototype.onError = function onError(errorCb) { - this.history.onError(errorCb); -}; - -VueRouter.prototype.push = function push(location, onComplete, onAbort) { - const this$1 = this; - - // $flow-disable-line - if (!onComplete && !onAbort && typeof Promise !== "undefined") { - return new Promise((resolve, reject) => { - this$1.history.push(location, resolve, reject); - }); - } else { - this.history.push(location, onComplete, onAbort); - } -}; - -VueRouter.prototype.replace = function replace(location, onComplete, onAbort) { - const this$1 = this; - - // $flow-disable-line - if (!onComplete && !onAbort && typeof Promise !== "undefined") { - return new Promise((resolve, reject) => { - this$1.history.replace(location, resolve, reject); - }); - } else { - this.history.replace(location, onComplete, onAbort); - } -}; - -VueRouter.prototype.go = function go(n) { - this.history.go(n); -}; - -VueRouter.prototype.back = function back() { - this.go(-1); -}; - -VueRouter.prototype.forward = function forward() { - this.go(1); -}; - -VueRouter.prototype.getMatchedComponents = function getMatchedComponents(to) { - const route = to - ? to.matched - ? to - : this.resolve(to).route - : this.currentRoute; - if (!route) { - return []; - } - - return [].concat.apply( - [], - route.matched.map((m) => - Object.keys(m.components).map((key) => m.components[key]) - ) - ); -}; - -VueRouter.prototype.resolve = function resolve(to, current, append) { - current = current || this.history.current; - const location = normalizeLocation(to, current, append, this); - const route = this.match(location, current); - const fullPath = route.redirectedFrom || route.fullPath; - const base = this.history.base; - const href = createHref(base, fullPath, this.mode); - - return { - location, - route, - href, - // for backwards compat - normalizedTo: location, - resolved: route - }; -}; - -VueRouter.prototype.getRoutes = function getRoutes() { - return this.matcher.getRoutes(); -}; - -VueRouter.prototype.addRoute = function addRoute(parentOrRoute, route) { - this.matcher.addRoute(parentOrRoute, route); - if (this.history.current !== START) { - this.history.transitionTo(this.history.getCurrentLocation()); - } -}; - -Object.defineProperties(VueRouter.prototype, prototypeAccessors); - -function registerHook(list, fn) { - list.push(fn); - - return function () { - const i = list.indexOf(fn); - if (i > -1) { - list.splice(i, 1); - } - }; -} - -function createHref(base, fullPath, mode) { - const path = mode === "hash" ? `#${fullPath}` : fullPath; - - return base ? cleanPath(`${base}/${path}`) : path; -} - -// VueRouter.install = install; -VueRouter.version = "3.5.2"; -VueRouter.isNavigationFailure = isNavigationFailure; -VueRouter.NavigationFailureType = NavigationFailureType; -VueRouter.START_LOCATION = START; - -let $router; -const cbs = []; -@shortcut() -export class RouterWidget extends Widget { - static xtype = "bi.router"; - - init() { - this.$router = - this._router = - Router.$router = - $router = - new VueRouter({ - mode: this.options.mode, - routes: this.options.routes, - base: this.options.base - }); - Fix.defineReactiveProperty(Router.$router.history, "current"); - this.$router.beforeEach((to, from, next) => { - if (to.matched.length === 0) { - // 如果上级也未匹配到路由则跳转主页面,如果上级能匹配到则转上级路由 - from.path ? next({ path: from.path }) : next("/"); - } else { - // 如果匹配到正确跳转 - next(); - } - }); - this.$router.afterEach(() => { - cbs.forEach((cb) => { - cb(); - }); - }); - this.$router.init(this); - } -} - -@shortcut() -export class RouterView extends Widget { - static xtype = "bi.router_view"; - - props = { - baseCls: "bi-router-view", - deps: 0, - name: "default" - }; - created() { - const self = this, - o = this.options; - cbs.push( - (this._callbackListener = function () { - const current = $router.history.current; - // 匹配的路径名(/component/:id) - let matchedPath = - current.matched[o.deps] && current.matched[o.deps].path; - const component = - current.matched[o.deps] && - current.matched[o.deps].components[o.name]; - - if (BI.isNotNull(component)) { - if (matchedPath) { - BI.each(current.params, (key, value) => { - // 把 :id 替换成具体的值(/component/demo.td) - matchedPath = matchedPath.replace(`:${key}`, value); - }); - } - self.tab.setSelect(matchedPath || "/"); - } - }) - ); - // "bi.router_view"是由"bi.tab"实现的,cardCreator是一个异步过程,在"bi.router_view"创建之前,cbs里不会有创建子组件的方法,在初始化路由时,没法直接渲染到子组件,所以这里手动加了一次调用 - this._callbackListener(); - } - - render() { - const self = this, - o = this.options; - - return { - type: "bi.tab", - ref(_ref) { - self.tab = _ref; - }, - single: o.single, // 是不是单页面 - keepAlives: o.keepAlives, - logic: { - dynamic: false - }, - showIndex: false, - cardCreator(v) { - return $router.history.current.matched[o.deps].components[ - o.name - ]; - } - }; - } - - destroyed() { - // BI.remove方法会把第二个参数当迭代器执行导致方法多执行一遍 - cbs.splice(cbs.indexOf(this._callbackListener), 1); - } -} - -Router.isSameRoute = isSameRoute; diff --git a/src/widget/index.js b/src/widget/index.js deleted file mode 100644 index 2cdd59ea2..000000000 --- a/src/widget/index.js +++ /dev/null @@ -1,37 +0,0 @@ -export { Collapse } from "./collapse/collapse"; -export { SelectTreeExpander } from "./selecttree/selecttree.expander"; -export { SelectTreeCombo } from "./selecttree/selecttree.combo"; -export { SingleTreeCombo } from "./singletree/singletree.combo"; -export { MultiTreeCombo } from "./multitree/multi.tree.combo"; -export { MultiTreeInsertCombo } from "./multitree/multi.tree.insert.combo"; -export { MultiTreeListCombo } from "./multitree/multi.tree.list.combo"; -export { NumberEditor } from "./numbereditor/number.editor"; -export { NumberInterval } from "./numberinterval/numberinterval"; -export { YearMonthInterval } from "./yearmonthinterval/yearmonthinterval"; -export { YearQuarterInterval } from "./yearquarterinterval/yearquarterinterval"; -export { YearInterval } from "./yearinterval/yearinterval"; - -export * from "./date/calendar"; -export * from "./dynamicdate"; -export * from "./datepane"; -export * from "./datetime"; -export * from "./datetimepane"; -export * from "./dynamicdatetime"; -export * from "./time"; -export * from "./timeinterval"; -export * from "./editor"; -export * from "./yearmonth"; -export * from "./multiselect"; -export * from "./multiselectlist"; -export * from "./downlist"; -export * from "./singleslider"; -export * from "./intervalslider"; -export * from "./year"; -export * from "./multilayersingletree"; -export * from "./multilayerselecttree"; -export * from "./searchmultitextvaluecombo"; -export * from "./singleselect"; -export * from "./multilayerdownlist"; -export * from "./yearquarter"; -export * from "./textvaluedownlistcombo"; -export * from "./searchmultitextvaluecombo"; diff --git a/template/index.html b/template/index.html deleted file mode 100644 index f37fddb06..000000000 --- a/template/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - Demo - - - - - - -
- - - - diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 5ee3e9369..000000000 --- a/tsconfig.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "compilerOptions": { - "sourceMap": true, - "target": "es2017", - "module": "es2015", - "moduleResolution": "node", - "lib": [ - "es2017", - "dom" - ], - "declaration": true, - "experimentalDecorators": true, - "outDir": "./dist/lib", - "baseUrl": ".", - // "strict": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "emitDeclarationOnly": true, - "allowJs": true, - "paths": { - "@/*": ["./src/*"] - } - }, - "include": [ - "typescript/*.ts", - "typescript/**/*.ts", - "types/*.d.ts", - "src/*.js", - "src/**/*.js", - "examples/*.js", - "examples/**/*.js", - "demo/*/*/*/*/*.js", - "demo/*/*/*/*.js", - "demo/*/*/*.js", - "demo/*/*.js", - ], - "exclude": [ - "src/router/router.js", - "src/core/0.foundation.js", - ] -} \ No newline at end of file diff --git a/ui/js/index.js b/ui/js/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/ui/less/app.less b/ui/less/app.less deleted file mode 100644 index 27e4631e7..000000000 --- a/ui/less/app.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../src/less/resource/app.less"; -@import "var.less"; diff --git a/ui/less/background.less b/ui/less/background.less deleted file mode 100644 index a6cbde36b..000000000 --- a/ui/less/background.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../src/less/resource/background.less"; -@import "var.less"; diff --git a/ui/less/font.less b/ui/less/font.less deleted file mode 100644 index d7399c46e..000000000 --- a/ui/less/font.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../src/less/resource/font.less"; -@import "var.less"; diff --git a/ui/less/icon.less b/ui/less/icon.less deleted file mode 100644 index 8aa44a2ae..000000000 --- a/ui/less/icon.less +++ /dev/null @@ -1,5 +0,0 @@ -@import "../../src/less/resource/icon.less"; -@import "var.less"; - - - diff --git a/ui/less/var.less b/ui/less/var.less deleted file mode 100644 index c89fa87cc..000000000 --- a/ui/less/var.less +++ /dev/null @@ -1,5 +0,0 @@ -@webUrl: 'resources?path=/com/fr/web/ui/'; - -@fontUrl: '@{webUrl}font/'; //图片的基本地址 -@imageUrl: '@{webUrl}images/1x/'; //图片的基本地址 -@image2xUrl: '@{webUrl}images/2x/'; //2倍图片的基本地址 diff --git a/webpack/attachments.js b/webpack/attachments.js deleted file mode 100644 index 542b3fa10..000000000 --- a/webpack/attachments.js +++ /dev/null @@ -1,274 +0,0 @@ -const { sync, uniq } = require("./utils"); - -const fixJs = "./dist/fix/fix.js"; -const fixProxyJs = './dist/fix/fix.proxy.js'; -const fixCompact = "./dist/fix/fix.compact.js"; -const workerCompact = './dist/fix/worker.compact.js'; -const lodashJs = "src/core/1.lodash.js"; -const jqueryJs = "src/core/platform/web/jquery/_jquery.js"; -const popperJs = "src/core/controller/popper.js"; - -const runtimePolyfill = ["core-js/stable"]; - -const basicAttachmentMap = { - polyfill: sync([ - "src/core/0.foundation.js", - "src/polyfill/index.js", - ]).concat(runtimePolyfill), - core: sync([ - "src/less/core/**/*.less", - "src/less/theme/**/*.less", - // lodashJs, - // jqueryJs, - // popperJs, - "src/core/conflict.js", - "src/bundle.js", - // "src/core/**/*.js", - // "src/data/**/*.js", - ]), - // 最基础的控件 - base: sync([ - "src/less/base/**/*.less", - // "src/third/**/*.js", - // "src/base/**/*.js", - ]), - // 实现好的一些基础实例 - "case": sync([ - // "src/case/**/*.js", - "src/less/case/**/*.less", - ]), - widget: sync([ - "src/less/widget/**/*.less", - "src/less/component/**/*.less", - // "src/widget/**/*.js", - // "src/component/**/*.js", - ]), - router: sync([ - "src/router/index.js", - ]), - core_without_platform: sync([ - "src/core/0.foundation.js", - lodashJs, - "src/core/index.js", - // "src/data/**/*.js", - ], [ - "src/core/platform/index.js", - "src/core/controller/index.js", - ]), - core_without_normalize: sync( - ["src/less/core/**/*.less", "src/less/theme/**/*.less"], ["src/less/core/normalize.less", "src/less/core/normalize2.less"] - ), - core_without_conflict: sync([ - "src/less/core/**/*.less", - "src/less/theme/**/*.less", - lodashJs, - "src/core/index.js", - // "src/data/**/*.js", - ], [ - "src/core/conflict.js", - ]), - resource: sync(["src/less/resource/**/*.less"]), - font: sync(["public/less/font.less"]), - ts: ['./typescript/bundle.ts'], - ui: sync([ - 'ui/less/app.less', - 'ui/less/*.less', - 'ui/js/index.js', - ]), - config: sync(["demo/version.js", "i18n/i18n.cn.js"]), - utils: sync([ - "src/core/0.foundation.js", - lodashJs, - "src/core/constant/index.js", - "src/core/func/index.js", - "src/core/2.base.js", - "src/core/3.ob.js", - "src/core/5.inject.js", - "src/core/utils/index.js", - "i18n/i18n.cn.js", - "_mobile/date.i18n.cn.js", - // "src/data/**/*.js", - ]), - fix: [fixJs], - fixProxy: [fixProxyJs], - less: sync([ - "src/less/core/**/*.less", - "src/less/theme/**/*.less", - "src/less/base/**/*.less", - "src/less/case/**/*.less", - "src/less/widget/**/*.less", - "src/less/component/**/*.less", - ]), -}; - -const bundle = [].concat( - basicAttachmentMap.polyfill, - basicAttachmentMap.core, - basicAttachmentMap.fix, - basicAttachmentMap.base, - basicAttachmentMap.case, - basicAttachmentMap.widget, - sync(["public/less/app.less", "public/less/**/*.less"]), - [fixCompact, workerCompact], - basicAttachmentMap.router, - sync(["public/js/index.js", "public/js/index.js", "i18n/i18n.cn.js"]), - basicAttachmentMap.ts, -); - -const bundleCss = [].concat( - basicAttachmentMap.less, - sync(["public/less/app.less", "public/less/**/*.less"]), -); - -// const bundleModern = [].concat( -// sync(["src/less/modern.less"]), -// sync(["public/modern/app.less", "public/modern/**/*.less"]), -// ); - -const coreJs = [].concat( - basicAttachmentMap.polyfill, - basicAttachmentMap.core, - basicAttachmentMap.fix, - basicAttachmentMap.base, - basicAttachmentMap.case, - basicAttachmentMap.widget, - ['./dist/fix/fix.compact.js'], - basicAttachmentMap.router, - basicAttachmentMap.ts, -); - -const resource = sync(["private/less/app.less", "private/less/**/*.less"]); - -const config = sync(["public/js/index.js", "public/js/index.js", "i18n/i18n.cn.js"]); - -const bundleWithoutNormalize = [].concat( - basicAttachmentMap.core_without_normalize, - sync([ - "src/less/base/**/*.less", - "src/less/case/**/*.less", - "src/less/widget/**/*.less", - "src/less/component/**/*.less", - "public/less/**/*.less", - // ts的less - ], [ - "public/less/app.less", - ]), -); - -const fineuiWithoutNormalize = [].concat( - basicAttachmentMap.core_without_normalize, - sync([ - "src/less/base/**/*.less", - "src/less/case/**/*.less", - "src/less/widget/**/*.less", - "src/less/component/**/*.less", - 'ui/less/app.less', - 'ui/less/**/*.less', - ]), -); - -const fineui = [].concat( - basicAttachmentMap.polyfill, - basicAttachmentMap.core, - basicAttachmentMap.fix, - basicAttachmentMap.base, - basicAttachmentMap.case, - basicAttachmentMap.widget, - basicAttachmentMap.router, - [fixCompact, workerCompact], - basicAttachmentMap.ui, - basicAttachmentMap.ts, -); - -const fineuiWithoutConflict = [].concat( - basicAttachmentMap.polyfill, - basicAttachmentMap.core_without_conflict, - basicAttachmentMap.fix, - basicAttachmentMap.base, - basicAttachmentMap.case, - basicAttachmentMap.widget, - basicAttachmentMap.router, - [fixCompact, workerCompact], - basicAttachmentMap.ui, - basicAttachmentMap.ts, -); - -// const fineuiModern = [].concat( -// sync(["src/less/modern.less"]), -// sync([ -// 'ui/modern/app.less', -// 'ui/modern/**/*.less', -// ]), -// ); - -const fineuiProxy = [].concat( - basicAttachmentMap.polyfill, - basicAttachmentMap.core, - basicAttachmentMap.fixProxy, - basicAttachmentMap.base, - basicAttachmentMap.case, - basicAttachmentMap.widget, - basicAttachmentMap.router, - [fixCompact, workerCompact], - basicAttachmentMap.ui, - basicAttachmentMap.ts, -); - -const fineuiWithoutJqueryAndPolyfillJs = [].concat( - runtimePolyfill, - sync([ - "src/core/0.foundation.js", - lodashJs, - "src/core/index.js", - // "src/data/**/*.js", - ], [ - "src/core/platform/index.js", - ]), - basicAttachmentMap.fix, - sync([ - "src/base/index.js", - "src/case/index.js", - ], [ - "src/base/single/input/file.js", - "src/case/ztree/index.js", - ]), - basicAttachmentMap.widget, - sync([fixCompact, workerCompact, "ui/js/index.js"]), - basicAttachmentMap.ts, -); - -const demo = [].concat( - basicAttachmentMap.polyfill, - basicAttachmentMap.core, - basicAttachmentMap.fix, - basicAttachmentMap.config, - basicAttachmentMap.base, - basicAttachmentMap.case, - basicAttachmentMap.widget, - basicAttachmentMap.router, - sync(["public/less/app.less", "public/less/**/*.less"]), - [fixCompact, workerCompact], - basicAttachmentMap.ts, - sync(["demo/less/*.less", "demo/less/**/*.less", "demo/app.js", "demo/js/index.js", "demo/config.js"]), -); - -module.exports = { - fix: fixJs, - fixProxy: fixProxyJs, - lodash: lodashJs, - font: basicAttachmentMap.font, - bundle: uniq(bundle), - fineuiWithoutNormalize: uniq(fineuiWithoutNormalize), - fineuiWithoutConflict: uniq(fineuiWithoutConflict), - bundleWithoutNormalize: uniq(bundleWithoutNormalize), - fineui: uniq(fineui), - fineuiProxy: uniq(fineuiProxy), - fineuiWithoutJqueryAndPolyfillJs: uniq(fineuiWithoutJqueryAndPolyfillJs), - utils: uniq(basicAttachmentMap.utils), - demo: uniq(demo), - coreWithoutPlatform: uniq(basicAttachmentMap.core_without_platform), - coreJs: uniq(coreJs), - resource: uniq((resource)), - config: uniq(config), - bundleCss: uniq(bundleCss), -}; diff --git a/webpack/components.js b/webpack/components.js deleted file mode 100644 index ea6530f9a..000000000 --- a/webpack/components.js +++ /dev/null @@ -1,37 +0,0 @@ -const basicAttachmentMap = { - single: ["src/base/single/index.js"], - layer: ["src/base/layer/index.js"], - pane: ["src/base/1.pane.js"], - button_group: ["src/base/combination/group.button.js"], - buttons: ["src/case/button/index.js"], - checkboxes: ["src/case/checkbox/index.js"], - combos: ["src/case/combo/index.js"], - editors: ["src/case/editor/index.js"], - triggers: ["src/case/trigger/index.js"], - calendar: ["src/case/calendar/index.js"], - color_chooser: ["src/case/colorchooser/index.js"], - segment: ["src/case/segment/index.js"], - linear_segment: ["src/case/linearsegment/index.js"], - date: ["src/widget/date/index.js"], - down_list: ["src/widget/downlist/index.js"], - text_value_down_list_combo: ["src/widget/textvaluedownlistcombo/index.js"], -}; - -module.exports = { - single: basicAttachmentMap.single, - layer: basicAttachmentMap.layer, - pane: basicAttachmentMap.pane, - button_group: basicAttachmentMap.button_group, - buttons: basicAttachmentMap.buttons, - checkboxes: basicAttachmentMap.checkboxes, - combos: basicAttachmentMap.combos, - editors: basicAttachmentMap.editors, - triggers: basicAttachmentMap.triggers, - calendar: basicAttachmentMap.calendar, - color_chooser: basicAttachmentMap.color_chooser, - segment: basicAttachmentMap.segment, - linear_segment: basicAttachmentMap.linear_segment, - date: basicAttachmentMap.date, - down_list: basicAttachmentMap.down_list, - text_value_down_list_combo: basicAttachmentMap.text_value_down_list_combo, -}; diff --git a/webpack/dirs.js b/webpack/dirs.js deleted file mode 100644 index 512645e97..000000000 --- a/webpack/dirs.js +++ /dev/null @@ -1,16 +0,0 @@ -const path = require("path"); -module.exports = { - DEST: path.resolve(__dirname, "../dist"), - NODE_MODULES: path.resolve(__dirname, "../node_modules"), - PRIVATE: path.resolve(__dirname, "../private"), - BABEL_CONFIG: path.resolve(__dirname, "../babel.config.js"), - TYPESCRIPT: path.resolve(__dirname, "../typescript"), - ROUTER: path.resolve(__dirname, "../src/router"), - SRC: path.resolve(__dirname, "../src"), - DEMO: path.resolve(__dirname, "../demo"), - PUBLIC: path.resolve(__dirname, "../public"), - I18N: path.resolve(__dirname, "../i18n"), - UI: path.resolve(__dirname, "../ui"), - MOBILE: path.resolve(__dirname, "../_mobile"), - FIX: path.resolve(__dirname, "../dist/fix"), -}; diff --git a/webpack/utils.js b/webpack/utils.js deleted file mode 100644 index 7ed3de515..000000000 --- a/webpack/utils.js +++ /dev/null @@ -1,24 +0,0 @@ -const path = require('path'); -const glob = require('glob'); - -// const glob = require('fast-glob'); - -function uniq(names) { - return [...new Set(names)]; -} - -const globalExcludes = [ - "**/*/__test__/*.js", -]; - -function sync(patterns, excludes = []) { - const ignore = globalExcludes.concat(excludes).map(pattern => path.join(__dirname, "../", pattern).replace(/\\/g, '/')); - - return patterns.map(pattern => glob.sync(path.join(__dirname, "../", pattern).replace(/\\/g, '/'), { ignore })).flat(); -} - - -module.exports = { - sync, - uniq, -}; diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js deleted file mode 100644 index eb9cb71d6..000000000 --- a/webpack/webpack.common.js +++ /dev/null @@ -1,119 +0,0 @@ -const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const autoprefixer = require('autoprefixer'); -const path = require('path'); -const fs = require('fs'); - -const dirs = require('./dirs'); - -const attachments = require('./attachments'); - -let lessVariables = {}; - -if (process.env.LESS_CONFIG_PATH) { - const lessConfigPath = path.isAbsolute(process.env.LESS_CONFIG_PATH) - ? process.env.LESS_CONFIG_PATH - : path.resolve(__dirname, '../', process.env.LESS_CONFIG_PATH); - - lessVariables = fs.existsSync(lessConfigPath) - ? require(lessConfigPath) || {} - : {}; -} - -module.exports = { - entry: { - demo: attachments.demo, - // 用于启动dev模式时,工程引用调试 - fineui: attachments.fineui, - "fineui.proxy": attachments.fineuiProxy, - }, - externals: { - lodash: '_', - underscore: '_', - }, - resolve: { - mainFields: ['module', 'main'], - extensions: ['.js', '.ts'], - alias: { - "@": path.resolve(__dirname, '../src'), - }, - }, - module: { - rules: [ - { - test: /\.(jsx?|tsx?)$/i, - include: [ - dirs.NODE_MODULES, - dirs.PRIVATE, - dirs.PUBLIC, - dirs.MOBILE, - dirs.DEMO, - dirs.I18N, - dirs.UI, - dirs.FIX, - dirs.TYPESCRIPT, - dirs.SRC, - ], - exclude: /node_modules(\/|\\)core-js/, - use: [ - { - loader: 'babel-loader', - options: { - configFile: dirs.BABEL_CONFIG, - }, - }, - ], - }, - // { - // test: /\.js$/, - // include: [path.resolve(__dirname, '../', attachments.lodash)], - // use: [ - // { - // loader: 'script-loader', - // }, - // ], - // }, - { - test: path.resolve(__dirname, '../', attachments.fix), - use: [ - { - loader: 'expose-loader', - options: 'Fix', - }, - ], - }, { - test: path.resolve(__dirname, '../', attachments.fixProxy), - use: [ - { - loader: 'expose-loader', - options: 'Fix', - }, - ], - }, - { - test: /\.(css|less)$/, - use: [ - MiniCssExtractPlugin.loader, - { - loader: 'css-loader', - options: { - url: false, - }, - }, - { - loader: 'postcss-loader', - options: { - plugins: [autoprefixer], - }, - }, - { - loader: 'less-loader', - options: { - relativeUrls: false, - modifyVars: lessVariables, - }, - }, - ], - }, - ], - }, -}; diff --git a/webpack/webpack.css.js b/webpack/webpack.css.js deleted file mode 100644 index 0028f7a26..000000000 --- a/webpack/webpack.css.js +++ /dev/null @@ -1,20 +0,0 @@ -const merge = require("webpack-merge"); - -const dirs = require("./dirs"); - -const common = require("./webpack.prod.js"); -common.entry = {}; - -const attachments = require("./attachments"); - -module.exports = merge.smart(common, { - mode: "production", - entry: { - [`2.0/${process.env.LESS_FILE_NAME}.min`]: attachments.bundleCss, - }, - - output: { - path: dirs.DEST, - filename: "[name].js", - }, -}); diff --git a/webpack/webpack.dev.js b/webpack/webpack.dev.js deleted file mode 100644 index 9e5a21432..000000000 --- a/webpack/webpack.dev.js +++ /dev/null @@ -1,79 +0,0 @@ -const merge = require("webpack-merge"); -const path = require("path"); -const MiniCssExtractPlugin = require("mini-css-extract-plugin"); -const HtmlWebpackPlugin = require("html-webpack-plugin"); -const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); -const OptimizeCssAssetsPlugin = require("optimize-css-assets-webpack-plugin"); - -const dirs = require("./dirs"); - -const common = require("./webpack.common.js"); - -const ModuleDependencyWarning = require("webpack/lib/ModuleDependencyWarning"); - -class IgnoreNotFoundExportPlugin { - apply(compiler) { - const messageRegExp = /export '.*'( \(reexported as '.*'\))? was not found in/; - function doneHook(stats) { - stats.compilation.warnings = stats.compilation.warnings.filter(warn => { - if (warn instanceof ModuleDependencyWarning && messageRegExp.test(warn.message)) { - return false; - } - - return true; - }); - } - if (compiler.hooks) { - compiler.hooks.done.tap("IgnoreNotFoundExportPlugin", doneHook); - } else { - compiler.plugin("done", doneHook); - } - } -} - -module.exports = merge(common, { - devtool: "inline-source-map", - output: { - path: dirs.DEST, - filename: "[name].js", - publicPath: '/', - }, - devServer: { - contentBase: path.join(__dirname, ".."), - port: 9001, - liveReload: true, - historyApiFallback: { - rewrites: [ - { from: /.*/, to: '/index.html' }, - ], - }, - }, - plugins: [ - new MiniCssExtractPlugin({ - path: dirs.DEST, - filename: "[name].css", - }), - new HtmlWebpackPlugin({ - template: path.resolve(__dirname, "../template/index.html"), - chunks: ["demo"], - chunksSortMode: "manual", - }), - new ForkTsCheckerWebpackPlugin({ - watch: ["./typescript"], - }), - new OptimizeCssAssetsPlugin({ - assetNameRegExp: /\.css$/g, - cssProcessor: require("cssnano"), - cssProcessorPluginOptions: { - preset: ["default", { - discardComments: { - removeAll: true, - }, - normalizeUnicode: false, - }], - }, - canPrint: true, - }), - new IgnoreNotFoundExportPlugin(), - ], -}); diff --git a/webpack/webpack.prod.js b/webpack/webpack.prod.js deleted file mode 100644 index a48a8c17f..000000000 --- a/webpack/webpack.prod.js +++ /dev/null @@ -1,127 +0,0 @@ -const webpack = require("webpack"); -const merge = require("webpack-merge"); -const MiniCssExtractPlugin = require("mini-css-extract-plugin"); -const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); -const OptimizeCssAssetsPlugin = require("optimize-css-assets-webpack-plugin"); -const TerserJsPlugin = require("terser-webpack-plugin"); - -const dirs = require("./dirs"); - -const common = require("./webpack.common.js"); - -const attachments = require("./attachments"); -const components = require("./components"); - -const childProcess = require('child_process'); - -function git(command) { - return childProcess - .execSync(`git ${command}`) - .toString() - .trim(); -} - -module.exports = merge.smart(common, { - mode: "production", - entry: { - font: attachments.font, - "fineui.min": attachments.fineui, - "fineui_without_normalize.min": attachments.fineuiWithoutNormalize, - "fineui_without_conflict.min": attachments.fineuiWithoutConflict, - "fineui.proxy.min": attachments.fineuiProxy, - "core_without_platform": attachments.coreWithoutPlatform, - utils: attachments.utils, - "utils.min": attachments.utils, - "fineui_without_jquery_polyfill": attachments.fineuiWithoutJqueryAndPolyfillJs, - "fineui_without_jquery_polyfill.min": attachments.fineuiWithoutJqueryAndPolyfillJs, - "2.0/fineui": attachments.bundle, - "2.0/fineui.min": attachments.bundle, - "2.0/fineui_without_normalize": attachments.bundleWithoutNormalize, - "2.0/fineui_without_normalize.min": attachments.bundleWithoutNormalize, - "2.0/core_without_platform": attachments.coreWithoutPlatform, - "2.0/core_without_platform.min": attachments.coreWithoutPlatform, - core: attachments.coreJs, - resource: attachments.resource, - "lib/single": components.single, - "lib/layers": components.layer, - "lib/pane": components.pane, - "lib/button_group": components.button_group, - "lib/buttons": components.buttons, - "lib/checkboxes": components.checkboxes, - "lib/combos": components.combos, - "lib/editors": components.editors, - "lib/triggers": components.triggers, - "lib/calendar": components.calendar, - "lib/color_chooser": components.color_chooser, - "lib/segment": components.segment, - "lib/linear_segment": components.linear_segment, - "lib/date": components.date, - "lib/down_list": components.down_list, - "lib/text_value_down_list_combo": components.text_value_down_list_combo, - }, - optimization: { - minimizer: [ - new TerserJsPlugin({ - include: /\.min/, - parallel: true, - sourceMap: true, - terserOptions: { - output: { - comments: false - } - } - }), - new webpack.BannerPlugin({ - banner: `time: ${new Date().toLocaleString()}; branch: ${git( - 'name-rev --name-only HEAD' - )} commit: ${git( - 'rev-parse HEAD' - )}` - }) - ] - }, - - devtool: "hidden-source-map", - - output: { - path: dirs.DEST, - filename: "[name].js" - }, - - plugins: [ - new MiniCssExtractPlugin({ - path: dirs.DEST, - filename: "[name].css" - }), - new ForkTsCheckerWebpackPlugin({}), - new OptimizeCssAssetsPlugin({ - assetNameRegExp: /\.css$/g, - cssProcessor: require("cssnano"), - cssProcessorPluginOptions: { - preset: ["default", { - discardComments: { - removeAll: true - }, - normalizeUnicode: false - }] - }, - canPrint: true - }) - ], - - module: { - rules: [ - { - test: /\.(css|less)$/, - use: [ - { - loader: "postcss-loader", - options: { - plugins: [] - } - } - ] - } - ] - } -});