@_tc/template-core 0.0.1-bate.6 → 0.0.1-bate.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.skills/tc-component-usage-skills/SKILL.md +139 -0
- package/.skills/tc-component-usage-skills/reference/component-api.md +804 -0
- package/.skills/tc-component-usage-skills/reference/examples.md +435 -0
- package/.skills/tc-component-usage-skills/reference/patterns.md +392 -0
- package/.skills/tc-component-usage-skills/reference/template-core-frontend.md +106 -0
- package/.skills/tc-generator/SKILL.md +70 -0
- package/.skills/tc-generator/reference/example.md +361 -0
- package/.skills/tc-generator/reference/model-schema.md +328 -0
- package/.skills/tc-generator/reference/project-template/app/controller/product.js +73 -0
- package/.skills/tc-generator/reference/project-template/app/router/product.js +9 -0
- package/.skills/tc-generator/reference/project-template/config/config.default.js +11 -0
- package/.skills/tc-generator/reference/project-template/index.js +17 -0
- package/.skills/tc-generator/reference/project-template/model/product/mode.js +179 -0
- package/.skills/tc-generator/reference/project-template/model/product/project/default.js +7 -0
- package/.skills/tc-generator/reference/project-template/package.json +25 -0
- package/.skills/tc-generator/reference/runtime-extensions.md +300 -0
- package/AGENT_README.md +632 -0
- package/README.md +1958 -0
- package/cjs/_virtual/_rolldown/runtime.js +1 -0
- package/cjs/app/controller/base.js +1 -0
- package/cjs/app/controller/project.js +1 -0
- package/cjs/app/controller/view.js +1 -0
- package/cjs/app/extend/$fetch.js +1 -0
- package/cjs/app/extend/crypto.js +1 -0
- package/cjs/app/extend/db.js +20 -0
- package/cjs/app/extend/generateErrorMessage.js +1 -0
- package/cjs/app/extend/logger.js +1 -0
- package/cjs/app/extend/parsingParamsOnUrl.js +1 -0
- package/cjs/app/extend/render-view.js +1 -0
- package/cjs/app/middleware.js +1 -0
- package/cjs/app/middlewares/api-params-verify.js +1 -0
- package/cjs/app/middlewares/api-sign-verify.js +1 -0
- package/cjs/app/middlewares/error-handle.js +1 -0
- package/cjs/app/middlewares/project-handler.js +1 -0
- package/cjs/app/middlewares/request-parameter-parsing.js +1 -0
- package/cjs/app/router/project.js +1 -0
- package/cjs/app/router/view.js +1 -0
- package/cjs/app/router-schema/project.js +1 -0
- package/cjs/app/service/base.js +1 -0
- package/cjs/app/service/project.js +1 -0
- package/cjs/app/type.js +0 -0
- package/cjs/app/typings.js +0 -0
- package/cjs/app/view/entry.tpl +32 -0
- package/cjs/bundler/buildBE.js +1 -0
- package/cjs/bundler/defaultAlias.js +1 -0
- package/cjs/bundler/defaultRouteGuard.js +1 -0
- package/cjs/bundler/dev.js +1 -0
- package/cjs/bundler/index.js +1 -0
- package/cjs/bundler/prod.js +1 -0
- package/cjs/bundler/state.js +1 -0
- package/cjs/bundler/utils.js +3 -0
- package/cjs/config/config.default.js +1 -0
- package/cjs/index.js +1 -0
- package/cjs/packages/common/LRUCache.js +1 -0
- package/cjs/packages/common/array/index.js +1 -0
- package/cjs/packages/common/cache/LRUCache.js +1 -0
- package/cjs/packages/common/cache/index.js +1 -0
- package/cjs/packages/common/guards/index.js +1 -0
- package/cjs/packages/common/http/index.js +1 -0
- package/cjs/packages/common/i18n/default.js +1 -0
- package/cjs/packages/common/i18n/en-US.js +1 -0
- package/cjs/packages/common/i18n/index.js +1 -0
- package/cjs/packages/common/i18n/locales.js +1 -0
- package/cjs/packages/common/i18n/types.js +0 -0
- package/cjs/packages/common/index.js +1 -0
- package/cjs/packages/common/log/index.js +2 -0
- package/cjs/packages/common/number/index.js +1 -0
- package/cjs/packages/common/object/filterEmpty.js +1 -0
- package/cjs/packages/common/object/filtereEmpty.js +1 -0
- package/cjs/packages/common/object/index.js +1 -0
- package/cjs/packages/common/string/index.js +1 -0
- package/cjs/packages/common/types/index.js +0 -0
- package/cjs/packages/core/env.js +1 -0
- package/cjs/packages/core/index.js +1 -0
- package/cjs/packages/core/loader/config.js +1 -0
- package/cjs/packages/core/loader/controller.js +1 -0
- package/cjs/packages/core/loader/extend.js +1 -0
- package/cjs/packages/core/loader/middleware.js +1 -0
- package/cjs/packages/core/loader/model.js +1 -0
- package/cjs/packages/core/loader/router-schema.js +1 -0
- package/cjs/packages/core/loader/router.js +1 -0
- package/cjs/packages/core/loader/service.js +1 -0
- package/cjs/packages/core/paths.js +1 -0
- package/cjs/packages/core/types.js +0 -0
- package/cjs/packages/utils/getAllFilesInFolder.js +1 -0
- package/cjs/packages/utils/getAllFnReturnValue.js +0 -0
- package/cjs/packages/utils/index.js +1 -0
- package/cjs/packages/utils/loadFile.js +1 -0
- package/cjs/packages/utils/path.js +1 -0
- package/cjs/packages/utils/runFileFn.js +1 -0
- package/cjs/scripts/vite-build/build.js +3 -0
- package/cjs/scripts/vite-build/collect.js +1 -0
- package/cjs/scripts/vite-build/constants.js +1 -0
- package/cjs/scripts/vite-build/dts.js +1 -0
- package/cjs/scripts/vite-build/index.js +1 -0
- package/cjs/scripts/vite-build/normalize.js +1 -0
- package/cjs/scripts/vite-build/plugins.js +1 -0
- package/cjs/scripts/vite-build/resolve.js +1 -0
- package/cjs/scripts/vite-build/types.js +0 -0
- package/cjs/scripts/vite-build/utils.js +1 -0
- package/esm/_virtual/_rolldown/runtime.js +7 -0
- package/esm/app/controller/base.js +26 -0
- package/esm/app/controller/project.js +57 -0
- package/esm/app/controller/view.js +28 -0
- package/esm/app/extend/$fetch.js +15 -0
- package/esm/app/extend/crypto.js +31 -0
- package/esm/app/extend/db.js +141 -0
- package/esm/app/extend/generateErrorMessage.js +7 -0
- package/esm/app/extend/logger.js +26 -0
- package/esm/app/extend/parsingParamsOnUrl.js +14 -0
- package/esm/app/extend/render-view.js +25 -0
- package/esm/app/middleware.js +26 -0
- package/esm/app/middlewares/api-params-verify.js +56 -0
- package/esm/app/middlewares/api-sign-verify.js +16 -0
- package/esm/app/middlewares/error-handle.js +24 -0
- package/esm/app/middlewares/project-handler.js +15 -0
- package/esm/app/middlewares/request-parameter-parsing.js +18 -0
- package/esm/app/router/project.js +7 -0
- package/esm/app/router/view.js +7 -0
- package/esm/app/router-schema/project.js +15 -0
- package/esm/app/service/base.js +14 -0
- package/esm/app/service/project.js +23 -0
- package/esm/app/type.js +0 -0
- package/esm/app/typings.js +0 -0
- package/esm/app/view/entry.tpl +32 -0
- package/esm/bundler/buildBE.js +54 -0
- package/esm/bundler/defaultAlias.js +4 -0
- package/esm/bundler/defaultRouteGuard.js +4 -0
- package/esm/bundler/dev.js +12 -0
- package/esm/bundler/index.js +15 -0
- package/esm/bundler/prod.js +14 -0
- package/esm/bundler/state.js +10 -0
- package/esm/bundler/utils.js +247 -0
- package/esm/config/config.default.js +13 -0
- package/esm/index.js +16 -0
- package/esm/packages/common/LRUCache.js +2 -0
- package/esm/packages/common/array/index.js +27 -0
- package/esm/packages/common/cache/LRUCache.js +39 -0
- package/esm/packages/common/cache/index.js +2 -0
- package/esm/packages/common/guards/index.js +8 -0
- package/esm/packages/common/http/index.js +256 -0
- package/esm/packages/common/i18n/default.js +88 -0
- package/esm/packages/common/i18n/en-US.js +88 -0
- package/esm/packages/common/i18n/index.js +91 -0
- package/esm/packages/common/i18n/locales.js +9 -0
- package/esm/packages/common/i18n/types.js +0 -0
- package/esm/packages/common/index.js +14 -0
- package/esm/packages/common/log/index.js +93 -0
- package/esm/packages/common/number/index.js +10 -0
- package/esm/packages/common/object/filterEmpty.js +23 -0
- package/esm/packages/common/object/filtereEmpty.js +2 -0
- package/esm/packages/common/object/index.js +17 -0
- package/esm/packages/common/string/index.js +4 -0
- package/esm/packages/common/types/index.js +0 -0
- package/esm/packages/core/env.js +24 -0
- package/esm/packages/core/index.js +54 -0
- package/esm/packages/core/loader/config.js +28 -0
- package/esm/packages/core/loader/controller.js +13 -0
- package/esm/packages/core/loader/extend.js +28 -0
- package/esm/packages/core/loader/middleware.js +16 -0
- package/esm/packages/core/loader/model.js +68 -0
- package/esm/packages/core/loader/router-schema.js +19 -0
- package/esm/packages/core/loader/router.js +39 -0
- package/esm/packages/core/loader/service.js +13 -0
- package/esm/packages/core/paths.js +9 -0
- package/esm/packages/core/types.js +0 -0
- package/esm/packages/utils/getAllFilesInFolder.js +9 -0
- package/esm/packages/utils/getAllFnReturnValue.js +0 -0
- package/esm/packages/utils/index.js +5 -0
- package/esm/packages/utils/loadFile.js +34 -0
- package/esm/packages/utils/path.js +16 -0
- package/esm/packages/utils/runFileFn.js +45 -0
- package/esm/scripts/vite-build/build.js +141 -0
- package/esm/scripts/vite-build/collect.js +79 -0
- package/esm/scripts/vite-build/constants.js +34 -0
- package/esm/scripts/vite-build/dts.js +132 -0
- package/esm/scripts/vite-build/index.js +3 -0
- package/esm/scripts/vite-build/normalize.js +78 -0
- package/esm/scripts/vite-build/plugins.js +106 -0
- package/esm/scripts/vite-build/resolve.js +46 -0
- package/esm/scripts/vite-build/types.js +0 -0
- package/esm/scripts/vite-build/utils.js +24 -0
- package/fe/bundler/defaultAlias.js +4 -0
- package/fe/bundler/defaultRouteGuard.js +4 -0
- package/fe/frontend/apps/dash/Dashboard.d.ts +5 -0
- package/fe/frontend/apps/dash/Dashboard.js +185 -0
- package/fe/frontend/apps/dash/dash.entry.d.ts +1 -0
- package/fe/frontend/apps/dash/dash.entry.js +59 -0
- package/fe/frontend/apps/dash/types.d.ts +27 -0
- package/fe/frontend/apps/dash/types.js +0 -0
- package/fe/frontend/apps/ui-components/index.d.ts +2 -0
- package/fe/frontend/apps/ui-components/index.js +8 -0
- package/fe/frontend/apps/ui-components/ui-components.entry.d.ts +1 -0
- package/fe/frontend/apps/ui-components/ui-components.entry.js +8 -0
- package/fe/frontend/extended/SchemaForm/data.d.ts +9 -0
- package/fe/frontend/extended/SchemaForm/data.js +8 -0
- package/fe/frontend/src/api/baseInfo.d.ts +30 -0
- package/fe/frontend/src/api/baseInfo.js +14 -0
- package/fe/frontend/src/common/CRUD/CRUD.d.ts +2 -0
- package/fe/frontend/src/common/CRUD/CRUD.js +2 -0
- package/fe/frontend/src/common/CRUD/index.d.ts +1 -0
- package/fe/frontend/src/common/CRUD/index.js +2 -0
- package/fe/frontend/src/common/auth/index.d.ts +11 -0
- package/fe/frontend/src/common/auth/index.js +27 -0
- package/fe/frontend/src/common/fetchErrorShow.d.ts +2 -0
- package/fe/frontend/src/common/fetchErrorShow.js +11 -0
- package/fe/frontend/src/common/generateMenuData.d.ts +3 -0
- package/fe/frontend/src/common/generateMenuData.js +16 -0
- package/fe/frontend/src/common/importComponent.d.ts +4 -0
- package/fe/frontend/src/common/importComponent.js +23 -0
- package/fe/frontend/src/common/language.d.ts +2 -0
- package/fe/frontend/src/common/language.js +12 -0
- package/fe/frontend/src/common/logFn/index.d.ts +4 -0
- package/fe/frontend/src/common/logFn/index.js +14 -0
- package/fe/frontend/src/common/menu.d.ts +21 -0
- package/fe/frontend/src/common/menu.js +97 -0
- package/fe/frontend/src/common/request.d.ts +33 -0
- package/fe/frontend/src/common/request.js +183 -0
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +7 -0
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.js +36 -0
- package/fe/frontend/src/components/AsyncSelect/index.d.ts +3 -0
- package/fe/frontend/src/components/AsyncSelect/index.js +5 -0
- package/fe/frontend/src/components/BasePage/HeaderView.d.ts +9 -0
- package/fe/frontend/src/components/BasePage/HeaderView.js +55 -0
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.d.ts +13 -0
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.js +44 -0
- package/fe/frontend/src/components/LanguageSwitch/index.d.ts +3 -0
- package/fe/frontend/src/components/LanguageSwitch/index.js +5 -0
- package/fe/frontend/src/components/Router/index.d.ts +8 -0
- package/fe/frontend/src/components/Router/index.js +21 -0
- package/fe/frontend/src/components/Router/type.d.ts +1 -0
- package/fe/frontend/src/components/Router/type.js +0 -0
- package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.d.ts +14 -0
- package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.js +83 -0
- package/fe/frontend/src/components/ThemeSwitch/index.d.ts +3 -0
- package/fe/frontend/src/components/ThemeSwitch/index.js +5 -0
- package/fe/frontend/src/components/index.d.ts +10 -0
- package/fe/frontend/src/components/index.js +7 -0
- package/fe/frontend/src/defaultPages/Iframe/index.d.ts +2 -0
- package/fe/frontend/src/defaultPages/Iframe/index.js +15 -0
- package/fe/frontend/src/defaultPages/NotFoundPage/index.d.ts +2 -0
- package/fe/frontend/src/defaultPages/NotFoundPage/index.js +28 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.d.ts +6 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.js +102 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.d.ts +12 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.js +119 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.d.ts +28 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.js +10 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.js +9 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.d.ts +2 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.js +62 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.d.ts +10 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.js +202 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/eventInfo.d.ts +7 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/eventInfo.js +9 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/index.d.ts +2 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/index.js +4 -0
- package/fe/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.d.ts +9 -0
- package/fe/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.js +17 -0
- package/fe/frontend/src/defaultPages/SchemaPage/index.css +87 -0
- package/fe/frontend/src/defaultPages/SchemaPage/index.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SchemaPage/index.js +90 -0
- package/fe/frontend/src/defaultPages/SchemaPage/schemaType.d.ts +41 -0
- package/fe/frontend/src/defaultPages/SchemaPage/schemaType.js +7 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/permissions.d.ts +2 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/permissions.js +6 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.d.ts +2 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.js +66 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.d.ts +7 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.js +122 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +9 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +55 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPage/index.d.ts +2 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPage/index.js +21 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPageTmp.d.ts +2 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPageTmp.js +21 -0
- package/fe/frontend/src/defaultPages/SlotPage/index.d.ts +2 -0
- package/fe/frontend/src/defaultPages/SlotPage/index.js +22 -0
- package/fe/frontend/src/exportStore.d.ts +4 -0
- package/fe/frontend/src/exportStore.js +5 -0
- package/fe/frontend/src/hooks/useCurrentMenuData.d.ts +10 -0
- package/fe/frontend/src/hooks/useCurrentMenuData.js +30 -0
- package/fe/frontend/src/hooks/useRouterParams.d.ts +4 -0
- package/fe/frontend/src/hooks/useRouterParams.js +16 -0
- package/fe/frontend/src/index.d.ts +13 -0
- package/fe/frontend/src/index.js +20 -0
- package/fe/frontend/src/language/en-US.d.ts +88 -0
- package/fe/frontend/src/language/en-US.js +89 -0
- package/fe/frontend/src/language/index.d.ts +72 -0
- package/fe/frontend/src/language/index.js +79 -0
- package/fe/frontend/src/language/zh-CN.d.ts +88 -0
- package/fe/frontend/src/language/zh-CN.js +89 -0
- package/fe/frontend/src/main.css +96 -0
- package/fe/frontend/src/main.d.ts +20 -0
- package/fe/frontend/src/main.js +77 -0
- package/fe/frontend/src/stores/apiFreezer.d.ts +26 -0
- package/fe/frontend/src/stores/apiFreezer.js +53 -0
- package/fe/frontend/src/stores/mode.d.ts +15 -0
- package/fe/frontend/src/stores/mode.js +36 -0
- package/fe/frontend/src/stores/schemaEventBus.d.ts +22 -0
- package/fe/frontend/src/stores/schemaEventBus.js +53 -0
- package/fe/frontend/src/stores/schemaStore.d.ts +32 -0
- package/fe/frontend/src/stores/schemaStore.js +28 -0
- package/fe/frontend/src/typing/scalability.d.ts +15 -0
- package/fe/frontend/src/typing/scalability.js +0 -0
- package/fe/frontend/src/typing/window.d.ts +8 -0
- package/fe/frontend/src/typing/window.js +0 -0
- package/fe/model/types/data/button.d.ts +22 -0
- package/fe/model/types/data/component.d.ts +30 -0
- package/fe/model/types/data/fetchInfo.d.ts +7 -0
- package/fe/model/types/data/schema.d.ts +46 -0
- package/fe/model/types/data/search.d.ts +6 -0
- package/fe/model/types/index.d.ts +2 -0
- package/fe/model/types/menuType.d.ts +43 -0
- package/fe/model/types/model.d.ts +26 -0
- package/fe/packages/common/LRUCache.d.ts +1 -0
- package/fe/packages/common/array/index.d.ts +6 -0
- package/fe/packages/common/cache/LRUCache.d.ts +12 -0
- package/fe/packages/common/cache/LRUCache.js +43 -0
- package/fe/packages/common/cache/index.d.ts +1 -0
- package/fe/packages/common/guards/index.d.ts +8 -0
- package/fe/packages/common/guards/index.js +8 -0
- package/fe/packages/common/http/index.d.ts +89 -0
- package/fe/packages/common/http/index.js +300 -0
- package/fe/packages/common/i18n/default.d.ts +86 -0
- package/fe/packages/common/i18n/default.js +93 -0
- package/fe/packages/common/i18n/en-US.d.ts +86 -0
- package/fe/packages/common/i18n/en-US.js +93 -0
- package/fe/packages/common/i18n/index.d.ts +18 -0
- package/fe/packages/common/i18n/index.js +162 -0
- package/fe/packages/common/i18n/locales.d.ts +7 -0
- package/fe/packages/common/i18n/locales.js +11 -0
- package/fe/packages/common/i18n/types.d.ts +46 -0
- package/fe/packages/common/index.d.ts +10 -0
- package/fe/packages/common/log/index.d.ts +32 -0
- package/fe/packages/common/number/index.d.ts +2 -0
- package/fe/packages/common/object/filterEmpty.d.ts +2 -0
- package/fe/packages/common/object/filterEmpty.js +28 -0
- package/fe/packages/common/object/filtereEmpty.d.ts +1 -0
- package/fe/packages/common/object/index.d.ts +4 -0
- package/fe/packages/common/string/index.d.ts +3 -0
- package/fe/packages/common/types/index.d.ts +3 -0
- package/fe/packages/react/hooks/useBreadcrumb.d.ts +9 -0
- package/fe/packages/react/hooks/useBreadcrumb.js +5 -0
- package/fe/packages/react/hooks/useExecuteOnce.d.ts +11 -0
- package/fe/packages/react/hooks/useExecuteOnce.js +47 -0
- package/fe/packages/react/hooks/useInit.d.ts +2 -0
- package/fe/packages/react/hooks/useInit.js +11 -0
- package/fe/packages/react/hooks/useLanguage.d.ts +1 -0
- package/fe/packages/react/hooks/useLanguage.js +8 -0
- package/fe/packages/react/hooks/usePagination.d.ts +15 -0
- package/fe/packages/react/hooks/usePagination.js +30 -0
- package/fe/packages/react/hooks/useRefState.d.ts +17 -0
- package/fe/packages/react/hooks/useRefState.js +35 -0
- package/fe/packages/react/hooks/useWatch.d.ts +14 -0
- package/fe/packages/react/hooks/useWatch.js +60 -0
- package/fe/packages/react/hooks/useWatch.test.js +24 -0
- package/fe/packages/react/ui/assets/table/no-result.js +4 -0
- package/fe/packages/react/ui/assets/table/no-result.svg +5 -0
- package/fe/packages/react/ui/components/Button/Button.d.ts +24 -0
- package/fe/packages/react/ui/components/Button/Button.js +88 -0
- package/fe/packages/react/ui/components/Button/SubmitButton.d.ts +8 -0
- package/fe/packages/react/ui/components/Button/SubmitButton.js +30 -0
- package/fe/packages/react/ui/components/Button/index.d.ts +3 -0
- package/fe/packages/react/ui/components/Button/index.js +3 -0
- package/fe/packages/react/ui/components/Card/Card.d.ts +10 -0
- package/fe/packages/react/ui/components/Card/Card.js +31 -0
- package/fe/packages/react/ui/components/Card/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Card/index.js +2 -0
- package/fe/packages/react/ui/components/Checkbox/Checkbox.d.ts +16 -0
- package/fe/packages/react/ui/components/Checkbox/Checkbox.js +52 -0
- package/fe/packages/react/ui/components/Checkbox/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Checkbox/index.js +2 -0
- package/fe/packages/react/ui/components/ConfirmDialog/ConfirmDialog.d.ts +11 -0
- package/fe/packages/react/ui/components/ConfirmDialog/ConfirmDialog.js +41 -0
- package/fe/packages/react/ui/components/ConfirmDialog/index.d.ts +1 -0
- package/fe/packages/react/ui/components/ConfirmDialog/index.js +2 -0
- package/fe/packages/react/ui/components/DataTable/ActionBtn.d.ts +7 -0
- package/fe/packages/react/ui/components/DataTable/ActionBtn.js +116 -0
- package/fe/packages/react/ui/components/DataTable/index.d.ts +32 -0
- package/fe/packages/react/ui/components/DataTable/index.js +235 -0
- package/fe/packages/react/ui/components/Date/Calendar.d.ts +21 -0
- package/fe/packages/react/ui/components/Date/Calendar.js +351 -0
- package/fe/packages/react/ui/components/Date/Date.d.ts +26 -0
- package/fe/packages/react/ui/components/Date/Date.js +210 -0
- package/fe/packages/react/ui/components/Date/DateTestPage.d.ts +1 -0
- package/fe/packages/react/ui/components/Date/DateTestPage.js +340 -0
- package/fe/packages/react/ui/components/Date/LocaleContext.d.ts +1 -0
- package/fe/packages/react/ui/components/Date/LocaleContext.js +11 -0
- package/fe/packages/react/ui/components/Date/LocaleProvider.d.ts +7 -0
- package/fe/packages/react/ui/components/Date/LocaleProvider.js +31 -0
- package/fe/packages/react/ui/components/Date/TimePicker.d.ts +6 -0
- package/fe/packages/react/ui/components/Date/TimePicker.js +136 -0
- package/fe/packages/react/ui/components/Date/data.d.ts +5 -0
- package/fe/packages/react/ui/components/Date/data.js +7 -0
- package/fe/packages/react/ui/components/Date/dateLocaleStore.d.ts +9 -0
- package/fe/packages/react/ui/components/Date/dateLocaleStore.js +14 -0
- package/fe/packages/react/ui/components/Date/dropdownPositioning.d.ts +2 -0
- package/fe/packages/react/ui/components/Date/dropdownPositioning.js +12 -0
- package/fe/packages/react/ui/components/Date/index.d.ts +5 -0
- package/fe/packages/react/ui/components/Date/index.js +6 -0
- package/fe/packages/react/ui/components/Date/locales.d.ts +23 -0
- package/fe/packages/react/ui/components/Date/locales.js +25 -0
- package/fe/packages/react/ui/components/Drawer/Drawer.d.ts +22 -0
- package/fe/packages/react/ui/components/Drawer/Drawer.js +151 -0
- package/fe/packages/react/ui/components/Drawer/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Drawer/index.js +2 -0
- package/fe/packages/react/ui/components/Dropdown/Dropdown.d.ts +24 -0
- package/fe/packages/react/ui/components/Dropdown/Dropdown.js +105 -0
- package/fe/packages/react/ui/components/Dropdown/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Dropdown/index.js +2 -0
- package/fe/packages/react/ui/components/Form/Form.d.ts +11 -0
- package/fe/packages/react/ui/components/Form/Form.js +15 -0
- package/fe/packages/react/ui/components/Form/FormItem.d.ts +19 -0
- package/fe/packages/react/ui/components/Form/FormItem.js +60 -0
- package/fe/packages/react/ui/components/Form/SchemaForm/data.d.ts +39 -0
- package/fe/packages/react/ui/components/Form/SchemaForm/data.js +16 -0
- package/fe/packages/react/ui/components/Form/SchemaForm/defaultComponentsMap.d.ts +3 -0
- package/fe/packages/react/ui/components/Form/SchemaForm/defaultComponentsMap.js +4 -0
- package/fe/packages/react/ui/components/Form/SchemaForm/index.d.ts +59 -0
- package/fe/packages/react/ui/components/Form/SchemaForm/index.js +119 -0
- package/fe/packages/react/ui/components/Form/index.d.ts +4 -0
- package/fe/packages/react/ui/components/Form/index.js +5 -0
- package/fe/packages/react/ui/components/Form/useForm.d.ts +2 -0
- package/fe/packages/react/ui/components/Form/useForm.js +2 -0
- package/fe/packages/react/ui/components/ImagePreview/ImagePreview.d.ts +7 -0
- package/fe/packages/react/ui/components/ImagePreview/ImagePreview.js +307 -0
- package/fe/packages/react/ui/components/ImagePreview/PreviewImage.d.ts +7 -0
- package/fe/packages/react/ui/components/ImagePreview/PreviewImage.js +56 -0
- package/fe/packages/react/ui/components/ImagePreview/index.d.ts +2 -0
- package/fe/packages/react/ui/components/ImagePreview/index.js +3 -0
- package/fe/packages/react/ui/components/Input/Input.d.ts +22 -0
- package/fe/packages/react/ui/components/Input/Input.js +142 -0
- package/fe/packages/react/ui/components/Input/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Input/index.js +2 -0
- package/fe/packages/react/ui/components/InputNumber/InputNumber.d.ts +25 -0
- package/fe/packages/react/ui/components/InputNumber/InputNumber.js +207 -0
- package/fe/packages/react/ui/components/InputNumber/index.d.ts +1 -0
- package/fe/packages/react/ui/components/InputNumber/index.js +2 -0
- package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.d.ts +29 -0
- package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.js +45 -0
- package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.test.js +59 -0
- package/fe/packages/react/ui/components/Label/Label.d.ts +21 -0
- package/fe/packages/react/ui/components/Label/Label.js +58 -0
- package/fe/packages/react/ui/components/Label/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Label/index.js +2 -0
- package/fe/packages/react/ui/components/Layout/Layout.d.ts +10 -0
- package/fe/packages/react/ui/components/Layout/Layout.js +33 -0
- package/fe/packages/react/ui/components/Layout/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Layout/index.js +2 -0
- package/fe/packages/react/ui/components/Loading/Loading.d.ts +13 -0
- package/fe/packages/react/ui/components/Loading/Loading.js +48 -0
- package/fe/packages/react/ui/components/Loading/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Loading/index.js +2 -0
- package/fe/packages/react/ui/components/Menu/Menu.d.ts +17 -0
- package/fe/packages/react/ui/components/Menu/Menu.js +147 -0
- package/fe/packages/react/ui/components/Menu/MenuContext.d.ts +38 -0
- package/fe/packages/react/ui/components/Menu/MenuContext.js +88 -0
- package/fe/packages/react/ui/components/Menu/MenuItem.d.ts +2 -0
- package/fe/packages/react/ui/components/Menu/MenuItem.js +78 -0
- package/fe/packages/react/ui/components/Menu/SubMenu.d.ts +2 -0
- package/fe/packages/react/ui/components/Menu/SubMenu.js +207 -0
- package/fe/packages/react/ui/components/Menu/index.d.ts +8 -0
- package/fe/packages/react/ui/components/Menu/index.js +5 -0
- package/fe/packages/react/ui/components/Menu/menuTypes.d.ts +57 -0
- package/fe/packages/react/ui/components/Menu/menuTypes.js +0 -0
- package/fe/packages/react/ui/components/Menu/utils.d.ts +1 -0
- package/fe/packages/react/ui/components/Menu/utils.js +8 -0
- package/fe/packages/react/ui/components/Message/Message.d.ts +12 -0
- package/fe/packages/react/ui/components/Message/Message.js +76 -0
- package/fe/packages/react/ui/components/Message/MessageManager.d.ts +36 -0
- package/fe/packages/react/ui/components/Message/MessageManager.js +104 -0
- package/fe/packages/react/ui/components/Message/data.d.ts +1 -0
- package/fe/packages/react/ui/components/Message/data.js +4 -0
- package/fe/packages/react/ui/components/Message/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Message/index.js +2 -0
- package/fe/packages/react/ui/components/Modal/Modal.d.ts +20 -0
- package/fe/packages/react/ui/components/Modal/Modal.js +59 -0
- package/fe/packages/react/ui/components/Modal/ModalManager.d.ts +46 -0
- package/fe/packages/react/ui/components/Modal/ModalManager.js +106 -0
- package/fe/packages/react/ui/components/Modal/index.d.ts +3 -0
- package/fe/packages/react/ui/components/Modal/index.js +3 -0
- package/fe/packages/react/ui/components/Notification/Notification.d.ts +13 -0
- package/fe/packages/react/ui/components/Notification/Notification.js +56 -0
- package/fe/packages/react/ui/components/Notification/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Notification/index.js +2 -0
- package/fe/packages/react/ui/components/Overlay/Overlay.d.ts +19 -0
- package/fe/packages/react/ui/components/Overlay/Overlay.js +61 -0
- package/fe/packages/react/ui/components/Overlay/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Overlay/index.js +2 -0
- package/fe/packages/react/ui/components/Pagination/Pagination.d.ts +10 -0
- package/fe/packages/react/ui/components/Pagination/Pagination.js +115 -0
- package/fe/packages/react/ui/components/Pagination/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Pagination/index.js +2 -0
- package/fe/packages/react/ui/components/Popup/Popup.d.ts +25 -0
- package/fe/packages/react/ui/components/Popup/Popup.js +86 -0
- package/fe/packages/react/ui/components/Popup/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Popup/index.js +2 -0
- package/fe/packages/react/ui/components/Radio/Radio.d.ts +8 -0
- package/fe/packages/react/ui/components/Radio/Radio.js +36 -0
- package/fe/packages/react/ui/components/Radio/RadioGroup.d.ts +18 -0
- package/fe/packages/react/ui/components/Radio/RadioGroup.js +33 -0
- package/fe/packages/react/ui/components/Radio/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Radio/index.js +3 -0
- package/fe/packages/react/ui/components/Search/Search.d.ts +13 -0
- package/fe/packages/react/ui/components/Search/Search.js +24 -0
- package/fe/packages/react/ui/components/Search/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Search/index.js +2 -0
- package/fe/packages/react/ui/components/Select/Select.d.ts +21 -0
- package/fe/packages/react/ui/components/Select/Select.js +282 -0
- package/fe/packages/react/ui/components/Select/dropdownPositioning.d.ts +2 -0
- package/fe/packages/react/ui/components/Select/dropdownPositioning.js +16 -0
- package/fe/packages/react/ui/components/Select/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Select/index.js +2 -0
- package/fe/packages/react/ui/components/Skeleton/Skeleton.d.ts +12 -0
- package/fe/packages/react/ui/components/Skeleton/Skeleton.js +101 -0
- package/fe/packages/react/ui/components/Skeleton/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Skeleton/index.js +2 -0
- package/fe/packages/react/ui/components/Switch/Switch.d.ts +10 -0
- package/fe/packages/react/ui/components/Switch/Switch.js +28 -0
- package/fe/packages/react/ui/components/Switch/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Switch/index.js +2 -0
- package/fe/packages/react/ui/components/TableSearch/TableSearch.d.ts +30 -0
- package/fe/packages/react/ui/components/TableSearch/TableSearch.js +146 -0
- package/fe/packages/react/ui/components/TableSearch/index.d.ts +2 -0
- package/fe/packages/react/ui/components/TableSearch/index.js +2 -0
- package/fe/packages/react/ui/components/TableSearch/lang.d.ts +14 -0
- package/fe/packages/react/ui/components/TableSearch/lang.js +14 -0
- package/fe/packages/react/ui/components/TableSearch/tableSearchLocaleStore.d.ts +8 -0
- package/fe/packages/react/ui/components/TableSearch/tableSearchLocaleStore.js +10 -0
- package/fe/packages/react/ui/components/Tabs/Tabs.d.ts +15 -0
- package/fe/packages/react/ui/components/Tabs/Tabs.js +33 -0
- package/fe/packages/react/ui/components/Tabs/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Tabs/index.js +2 -0
- package/fe/packages/react/ui/components/Textarea/Textarea.d.ts +20 -0
- package/fe/packages/react/ui/components/Textarea/Textarea.js +58 -0
- package/fe/packages/react/ui/components/Textarea/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Textarea/index.js +2 -0
- package/fe/packages/react/ui/components/Tooltip/Tooltip.d.ts +8 -0
- package/fe/packages/react/ui/components/Tooltip/Tooltip.js +77 -0
- package/fe/packages/react/ui/components/Tooltip/index.d.ts +1 -0
- package/fe/packages/react/ui/components/Tooltip/index.js +2 -0
- package/fe/packages/react/ui/components/TreeSelect/TreeSelect.d.ts +18 -0
- package/fe/packages/react/ui/components/TreeSelect/TreeSelect.js +190 -0
- package/fe/packages/react/ui/components/TreeSelect/index.d.ts +1 -0
- package/fe/packages/react/ui/components/TreeSelect/index.js +2 -0
- package/fe/packages/react/ui/components/Upload/ImageUpload.d.ts +8 -0
- package/fe/packages/react/ui/components/Upload/ImageUpload.js +101 -0
- package/fe/packages/react/ui/components/Upload/Upload.d.ts +13 -0
- package/fe/packages/react/ui/components/Upload/Upload.js +29 -0
- package/fe/packages/react/ui/components/Upload/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Upload/index.js +3 -0
- package/fe/packages/react/ui/components/breadcrumb/breadcrumb.d.ts +34 -0
- package/fe/packages/react/ui/components/breadcrumb/breadcrumb.js +155 -0
- package/fe/packages/react/ui/components/breadcrumb/index.d.ts +1 -0
- package/fe/packages/react/ui/components/breadcrumb/index.js +2 -0
- package/fe/packages/react/ui/components/hooks/useDropdownPositioning.d.ts +42 -0
- package/fe/packages/react/ui/components/hooks/useDropdownPositioning.js +121 -0
- package/fe/packages/react/ui/components/hooks/useInputController.d.ts +20 -0
- package/fe/packages/react/ui/components/hooks/useInputController.js +39 -0
- package/fe/packages/react/ui/components/index.d.ts +35 -0
- package/fe/packages/react/ui/components/index.js +81 -0
- package/fe/packages/react/ui/components/table/index.d.ts +1 -0
- package/fe/packages/react/ui/components/table/index.js +2 -0
- package/fe/packages/react/ui/components/table/table.d.ts +29 -0
- package/fe/packages/react/ui/components/table/table.js +166 -0
- package/fe/packages/react/ui/components/testPage/MenuTestPage.d.ts +1 -0
- package/fe/packages/react/ui/components/testPage/MenuTestPage.js +397 -0
- package/fe/packages/react/ui/components/testPage/index.d.ts +2 -0
- package/fe/packages/react/ui/components/testPage/index.js +1638 -0
- package/fe/packages/react/ui/i18n/I18nProvider.d.ts +12 -0
- package/fe/packages/react/ui/i18n/I18nProvider.js +38 -0
- package/fe/packages/react/ui/i18n/index.d.ts +3 -0
- package/fe/packages/react/ui/i18n/index.js +7 -0
- package/fe/packages/react/ui/i18n/useI18n.d.ts +8 -0
- package/fe/packages/react/ui/i18n/useI18n.js +25 -0
- package/fe/packages/react/ui/index.css +299 -0
- package/fe/packages/react/ui/index.d.ts +4 -0
- package/fe/packages/react/ui/index.js +58 -0
- package/fe/packages/react/ui/lib/createStoreHook.d.ts +8 -0
- package/fe/packages/react/ui/lib/createStoreHook.js +9 -0
- package/fe/packages/react/ui/lib/export.d.ts +21 -0
- package/fe/packages/react/ui/lib/export.js +112 -0
- package/fe/packages/react/ui/lib/utils.d.ts +9 -0
- package/fe/packages/react/ui/lib/utils.js +64 -0
- package/fe/packages/react/ui/stores/breadcrumb.d.ts +14 -0
- package/fe/packages/react/ui/stores/breadcrumb.js +52 -0
- package/fe/packages/react/ui/stores/language.d.ts +3 -0
- package/fe/packages/react/ui/stores/language.js +4 -0
- package/fe/packages/react/ui/types/index.d.ts +1 -0
- package/fe/packages/react/ui/types/index.js +0 -0
- package/fe/typings/type.d.ts +4 -0
- package/model/frontend/extended/SchemaForm/data.d.ts +9 -0
- package/model/frontend/src/common/auth/index.d.ts +11 -0
- package/model/frontend/src/common/fetchErrorShow.d.ts +2 -0
- package/model/frontend/src/common/language.d.ts +2 -0
- package/model/frontend/src/common/logFn/index.d.ts +4 -0
- package/model/frontend/src/common/request.d.ts +33 -0
- package/model/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +7 -0
- package/model/frontend/src/components/AsyncSelect/index.d.ts +3 -0
- package/model/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.d.ts +6 -0
- package/model/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.d.ts +12 -0
- package/model/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.d.ts +28 -0
- package/model/frontend/src/defaultPages/SchemaPage/data/eventInfo.d.ts +7 -0
- package/model/frontend/src/defaultPages/SchemaPage/data/index.d.ts +2 -0
- package/model/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.d.ts +9 -0
- package/model/frontend/src/defaultPages/SchemaPage/schemaType.d.ts +41 -0
- package/model/frontend/src/defaultPages/SchemaPage/utils/permissions.d.ts +2 -0
- package/model/frontend/src/defaultPages/SchemaPage/utils/validator.d.ts +7 -0
- package/model/frontend/src/language/en-US.d.ts +88 -0
- package/model/frontend/src/language/index.d.ts +72 -0
- package/model/frontend/src/language/zh-CN.d.ts +88 -0
- package/model/frontend/src/stores/apiFreezer.d.ts +26 -0
- package/model/frontend/src/stores/schemaEventBus.d.ts +22 -0
- package/model/frontend/src/stores/schemaStore.d.ts +32 -0
- package/model/frontend/src/typing/scalability.d.ts +15 -0
- package/model/frontend/src/typing/window.d.ts +8 -0
- package/model/model/index.d.ts +1 -0
- package/model/model/test.d.ts +1 -0
- package/model/model/types/data/button.d.ts +22 -0
- package/model/model/types/data/component.d.ts +30 -0
- package/model/model/types/data/fetchInfo.d.ts +7 -0
- package/model/model/types/data/schema.d.ts +46 -0
- package/model/model/types/data/search.d.ts +6 -0
- package/model/model/types/index.d.ts +2 -0
- package/model/model/types/menuType.d.ts +43 -0
- package/model/model/types/model.d.ts +26 -0
- package/model/packages/common/array/index.d.ts +6 -0
- package/model/packages/common/cache/LRUCache.d.ts +12 -0
- package/model/packages/common/cache/index.d.ts +1 -0
- package/model/packages/common/guards/index.d.ts +8 -0
- package/model/packages/common/http/index.d.ts +89 -0
- package/model/packages/common/i18n/default.d.ts +86 -0
- package/model/packages/common/i18n/en-US.d.ts +86 -0
- package/model/packages/common/i18n/index.d.ts +18 -0
- package/model/packages/common/i18n/locales.d.ts +7 -0
- package/model/packages/common/i18n/types.d.ts +46 -0
- package/model/packages/common/index.d.ts +10 -0
- package/model/packages/common/log/index.d.ts +32 -0
- package/model/packages/common/number/index.d.ts +2 -0
- package/model/packages/common/object/filterEmpty.d.ts +2 -0
- package/model/packages/common/object/index.d.ts +4 -0
- package/model/packages/common/string/index.d.ts +3 -0
- package/model/packages/common/types/index.d.ts +3 -0
- package/model/packages/react/hooks/useBreadcrumb.d.ts +9 -0
- package/model/packages/react/hooks/useExecuteOnce.d.ts +11 -0
- package/model/packages/react/hooks/useLanguage.d.ts +1 -0
- package/model/packages/react/ui/components/Button/Button.d.ts +24 -0
- package/model/packages/react/ui/components/Button/SubmitButton.d.ts +8 -0
- package/model/packages/react/ui/components/Button/index.d.ts +3 -0
- package/model/packages/react/ui/components/Card/Card.d.ts +10 -0
- package/model/packages/react/ui/components/Card/index.d.ts +1 -0
- package/model/packages/react/ui/components/Checkbox/Checkbox.d.ts +16 -0
- package/model/packages/react/ui/components/Checkbox/index.d.ts +1 -0
- package/model/packages/react/ui/components/ConfirmDialog/ConfirmDialog.d.ts +11 -0
- package/model/packages/react/ui/components/ConfirmDialog/index.d.ts +1 -0
- package/model/packages/react/ui/components/DataTable/ActionBtn.d.ts +7 -0
- package/model/packages/react/ui/components/DataTable/index.d.ts +32 -0
- package/model/packages/react/ui/components/Date/Calendar.d.ts +21 -0
- package/model/packages/react/ui/components/Date/Date.d.ts +26 -0
- package/model/packages/react/ui/components/Date/LocaleContext.d.ts +1 -0
- package/model/packages/react/ui/components/Date/LocaleProvider.d.ts +7 -0
- package/model/packages/react/ui/components/Date/TimePicker.d.ts +6 -0
- package/model/packages/react/ui/components/Date/data.d.ts +5 -0
- package/model/packages/react/ui/components/Date/dateLocaleStore.d.ts +9 -0
- package/model/packages/react/ui/components/Date/dropdownPositioning.d.ts +2 -0
- package/model/packages/react/ui/components/Date/index.d.ts +5 -0
- package/model/packages/react/ui/components/Date/locales.d.ts +23 -0
- package/model/packages/react/ui/components/Drawer/Drawer.d.ts +22 -0
- package/model/packages/react/ui/components/Drawer/index.d.ts +2 -0
- package/model/packages/react/ui/components/Dropdown/Dropdown.d.ts +24 -0
- package/model/packages/react/ui/components/Dropdown/index.d.ts +1 -0
- package/model/packages/react/ui/components/Form/Form.d.ts +11 -0
- package/model/packages/react/ui/components/Form/FormItem.d.ts +19 -0
- package/model/packages/react/ui/components/Form/SchemaForm/data.d.ts +39 -0
- package/model/packages/react/ui/components/Form/SchemaForm/index.d.ts +59 -0
- package/model/packages/react/ui/components/Form/index.d.ts +4 -0
- package/model/packages/react/ui/components/Form/useForm.d.ts +2 -0
- package/model/packages/react/ui/components/ImagePreview/ImagePreview.d.ts +7 -0
- package/model/packages/react/ui/components/ImagePreview/PreviewImage.d.ts +7 -0
- package/model/packages/react/ui/components/ImagePreview/index.d.ts +2 -0
- package/model/packages/react/ui/components/Input/Input.d.ts +22 -0
- package/model/packages/react/ui/components/Input/index.d.ts +1 -0
- package/model/packages/react/ui/components/InputNumber/InputNumber.d.ts +25 -0
- package/model/packages/react/ui/components/InputNumber/index.d.ts +1 -0
- package/model/packages/react/ui/components/InputNumber/inputNumberUtils.d.ts +29 -0
- package/model/packages/react/ui/components/Label/Label.d.ts +21 -0
- package/model/packages/react/ui/components/Label/index.d.ts +2 -0
- package/model/packages/react/ui/components/Layout/Layout.d.ts +10 -0
- package/model/packages/react/ui/components/Layout/index.d.ts +1 -0
- package/model/packages/react/ui/components/Loading/Loading.d.ts +13 -0
- package/model/packages/react/ui/components/Loading/index.d.ts +1 -0
- package/model/packages/react/ui/components/Menu/Menu.d.ts +17 -0
- package/model/packages/react/ui/components/Menu/MenuContext.d.ts +38 -0
- package/model/packages/react/ui/components/Menu/MenuItem.d.ts +2 -0
- package/model/packages/react/ui/components/Menu/SubMenu.d.ts +2 -0
- package/model/packages/react/ui/components/Menu/index.d.ts +8 -0
- package/model/packages/react/ui/components/Menu/menuTypes.d.ts +57 -0
- package/model/packages/react/ui/components/Menu/utils.d.ts +1 -0
- package/model/packages/react/ui/components/Message/Message.d.ts +12 -0
- package/model/packages/react/ui/components/Message/MessageManager.d.ts +36 -0
- package/model/packages/react/ui/components/Message/data.d.ts +1 -0
- package/model/packages/react/ui/components/Message/index.d.ts +2 -0
- package/model/packages/react/ui/components/Modal/Modal.d.ts +20 -0
- package/model/packages/react/ui/components/Modal/ModalManager.d.ts +46 -0
- package/model/packages/react/ui/components/Modal/index.d.ts +3 -0
- package/model/packages/react/ui/components/Notification/Notification.d.ts +13 -0
- package/model/packages/react/ui/components/Notification/index.d.ts +1 -0
- package/model/packages/react/ui/components/Overlay/Overlay.d.ts +19 -0
- package/model/packages/react/ui/components/Overlay/index.d.ts +2 -0
- package/model/packages/react/ui/components/Pagination/Pagination.d.ts +10 -0
- package/model/packages/react/ui/components/Pagination/index.d.ts +1 -0
- package/model/packages/react/ui/components/Popup/Popup.d.ts +25 -0
- package/model/packages/react/ui/components/Popup/index.d.ts +1 -0
- package/model/packages/react/ui/components/Radio/Radio.d.ts +8 -0
- package/model/packages/react/ui/components/Radio/RadioGroup.d.ts +18 -0
- package/model/packages/react/ui/components/Radio/index.d.ts +2 -0
- package/model/packages/react/ui/components/Search/Search.d.ts +13 -0
- package/model/packages/react/ui/components/Search/index.d.ts +1 -0
- package/model/packages/react/ui/components/Select/Select.d.ts +21 -0
- package/model/packages/react/ui/components/Select/dropdownPositioning.d.ts +2 -0
- package/model/packages/react/ui/components/Select/index.d.ts +1 -0
- package/model/packages/react/ui/components/Skeleton/Skeleton.d.ts +12 -0
- package/model/packages/react/ui/components/Skeleton/index.d.ts +2 -0
- package/model/packages/react/ui/components/Switch/Switch.d.ts +10 -0
- package/model/packages/react/ui/components/Switch/index.d.ts +1 -0
- package/model/packages/react/ui/components/TableSearch/TableSearch.d.ts +30 -0
- package/model/packages/react/ui/components/TableSearch/index.d.ts +2 -0
- package/model/packages/react/ui/components/TableSearch/lang.d.ts +14 -0
- package/model/packages/react/ui/components/TableSearch/tableSearchLocaleStore.d.ts +8 -0
- package/model/packages/react/ui/components/Tabs/Tabs.d.ts +15 -0
- package/model/packages/react/ui/components/Tabs/index.d.ts +1 -0
- package/model/packages/react/ui/components/Textarea/Textarea.d.ts +20 -0
- package/model/packages/react/ui/components/Textarea/index.d.ts +1 -0
- package/model/packages/react/ui/components/Tooltip/Tooltip.d.ts +8 -0
- package/model/packages/react/ui/components/Tooltip/index.d.ts +1 -0
- package/model/packages/react/ui/components/TreeSelect/TreeSelect.d.ts +18 -0
- package/model/packages/react/ui/components/TreeSelect/index.d.ts +1 -0
- package/model/packages/react/ui/components/Upload/ImageUpload.d.ts +8 -0
- package/model/packages/react/ui/components/Upload/Upload.d.ts +13 -0
- package/model/packages/react/ui/components/Upload/index.d.ts +2 -0
- package/model/packages/react/ui/components/breadcrumb/breadcrumb.d.ts +34 -0
- package/model/packages/react/ui/components/breadcrumb/index.d.ts +1 -0
- package/model/packages/react/ui/components/hooks/useDropdownPositioning.d.ts +42 -0
- package/model/packages/react/ui/components/hooks/useInputController.d.ts +20 -0
- package/model/packages/react/ui/components/index.d.ts +35 -0
- package/model/packages/react/ui/components/table/index.d.ts +1 -0
- package/model/packages/react/ui/components/table/table.d.ts +29 -0
- package/model/packages/react/ui/i18n/I18nProvider.d.ts +12 -0
- package/model/packages/react/ui/i18n/index.d.ts +3 -0
- package/model/packages/react/ui/i18n/useI18n.d.ts +8 -0
- package/model/packages/react/ui/index.d.ts +4 -0
- package/model/packages/react/ui/lib/createStoreHook.d.ts +8 -0
- package/model/packages/react/ui/lib/export.d.ts +21 -0
- package/model/packages/react/ui/lib/utils.d.ts +9 -0
- package/model/packages/react/ui/stores/breadcrumb.d.ts +14 -0
- package/model/packages/react/ui/stores/language.d.ts +3 -0
- package/model/packages/react/ui/types/index.d.ts +1 -0
- package/model/typings/type.d.ts +4 -0
- package/package.json +82 -24
- package/types/app/controller/base.d.ts +12 -0
- package/types/app/controller/project.d.ts +22 -0
- package/types/app/controller/view.d.ts +8 -0
- package/types/app/extend/$fetch.d.ts +8 -0
- package/types/app/extend/crypto.d.ts +64 -0
- package/types/app/extend/db.d.ts +55 -0
- package/types/app/extend/generateErrorMessage.d.ts +7 -0
- package/types/app/extend/logger.d.ts +11 -0
- package/types/app/extend/parsingParamsOnUrl.d.ts +2 -0
- package/types/app/extend/render-view.d.ts +7 -0
- package/types/app/middleware.d.ts +3 -0
- package/types/app/middlewares/api-params-verify.d.ts +4 -0
- package/types/app/middlewares/api-sign-verify.d.ts +4 -0
- package/types/app/middlewares/error-handle.d.ts +4 -0
- package/types/app/middlewares/project-handler.d.ts +4 -0
- package/types/app/middlewares/request-parameter-parsing.d.ts +7 -0
- package/types/app/router/project.d.ts +4 -0
- package/types/app/router/view.d.ts +3 -0
- package/types/app/router-schema/project.d.ts +3 -0
- package/types/app/service/base.d.ts +9 -0
- package/types/app/service/project.d.ts +57 -0
- package/types/app/type.d.ts +34 -0
- package/types/app/typings.d.ts +46 -0
- package/types/bundler/buildBE.d.ts +13 -0
- package/types/bundler/defaultAlias.d.ts +3 -0
- package/types/bundler/defaultRouteGuard.d.ts +2 -0
- package/types/bundler/dev.d.ts +1 -0
- package/types/bundler/index.d.ts +4 -0
- package/types/bundler/prod.d.ts +1 -0
- package/types/bundler/state.d.ts +18 -0
- package/types/bundler/utils.d.ts +9 -0
- package/types/config/config.default.d.ts +71 -0
- package/types/index.d.ts +30 -0
- package/types/packages/common/LRUCache.d.ts +1 -0
- package/types/packages/common/array/index.d.ts +6 -0
- package/types/packages/common/cache/LRUCache.d.ts +12 -0
- package/types/packages/common/cache/index.d.ts +1 -0
- package/types/packages/common/guards/index.d.ts +8 -0
- package/types/packages/common/http/index.d.ts +89 -0
- package/types/packages/common/i18n/default.d.ts +91 -0
- package/types/packages/common/i18n/en-US.d.ts +91 -0
- package/types/packages/common/i18n/index.d.ts +42 -0
- package/types/packages/common/i18n/locales.d.ts +7 -0
- package/types/packages/common/i18n/types.d.ts +70 -0
- package/types/packages/common/index.d.ts +10 -0
- package/types/packages/common/log/index.d.ts +32 -0
- package/types/packages/common/number/index.d.ts +2 -0
- package/types/packages/common/object/filterEmpty.d.ts +2 -0
- package/types/packages/common/object/filtereEmpty.d.ts +1 -0
- package/types/packages/common/object/index.d.ts +4 -0
- package/types/packages/common/string/index.d.ts +3 -0
- package/types/packages/common/types/index.d.ts +3 -0
- package/types/packages/core/env.d.ts +15 -0
- package/types/packages/core/index.d.ts +6 -0
- package/types/packages/core/loader/config.d.ts +9 -0
- package/types/packages/core/loader/controller.d.ts +17 -0
- package/types/packages/core/loader/extend.d.ts +8 -0
- package/types/packages/core/loader/middleware.d.ts +11 -0
- package/types/packages/core/loader/model.d.ts +36 -0
- package/types/packages/core/loader/router-schema.d.ts +18 -0
- package/types/packages/core/loader/router.d.ts +8 -0
- package/types/packages/core/loader/service.d.ts +17 -0
- package/types/packages/core/paths.d.ts +14 -0
- package/types/packages/core/types.d.ts +145 -0
- package/types/packages/utils/getAllFilesInFolder.d.ts +9 -0
- package/types/packages/utils/getAllFnReturnValue.d.ts +0 -0
- package/types/packages/utils/index.d.ts +4 -0
- package/types/packages/utils/loadFile.d.ts +20 -0
- package/types/packages/utils/path.d.ts +24 -0
- package/types/packages/utils/runFileFn.d.ts +7 -0
- package/types/scripts/vite-build/build.d.ts +24 -0
- package/types/scripts/vite-build/collect.d.ts +57 -0
- package/types/scripts/vite-build/constants.d.ts +6 -0
- package/types/scripts/vite-build/dts.d.ts +53 -0
- package/types/scripts/vite-build/index.d.ts +2 -0
- package/types/scripts/vite-build/normalize.d.ts +66 -0
- package/types/scripts/vite-build/plugins.d.ts +67 -0
- package/types/scripts/vite-build/resolve.d.ts +61 -0
- package/types/scripts/vite-build/types.d.ts +174 -0
- package/types/scripts/vite-build/utils.d.ts +35 -0
- package/types/typings/type.d.ts +4 -0
- package/app/controller/base.d.ts +0 -14
- package/app/controller/base.d.ts.map +0 -1
- package/app/controller/base.js +0 -24
- package/app/controller/base.js.map +0 -1
- package/app/controller/project.d.ts +0 -12
- package/app/controller/project.d.ts.map +0 -1
- package/app/controller/project.js +0 -48
- package/app/controller/project.js.map +0 -1
- package/app/controller/view.d.ts +0 -9
- package/app/controller/view.d.ts.map +0 -1
- package/app/controller/view.js +0 -15
- package/app/controller/view.js.map +0 -1
- package/app/data/signKey.d.ts +0 -2
- package/app/data/signKey.d.ts.map +0 -1
- package/app/data/signKey.js +0 -5
- package/app/data/signKey.js.map +0 -1
- package/app/extend/db.d.ts +0 -3
- package/app/extend/db.d.ts.map +0 -1
- package/app/extend/db.js +0 -8
- package/app/extend/db.js.map +0 -1
- package/app/extend/generateErrorMessage.d.ts +0 -8
- package/app/extend/generateErrorMessage.d.ts.map +0 -1
- package/app/extend/generateErrorMessage.js +0 -12
- package/app/extend/generateErrorMessage.js.map +0 -1
- package/app/extend/logger.d.ts +0 -12
- package/app/extend/logger.d.ts.map +0 -1
- package/app/extend/logger.js +0 -73
- package/app/extend/logger.js.map +0 -1
- package/app/extend/parsingParamsOnUrl.d.ts +0 -3
- package/app/extend/parsingParamsOnUrl.d.ts.map +0 -1
- package/app/extend/parsingParamsOnUrl.js +0 -23
- package/app/extend/parsingParamsOnUrl.js.map +0 -1
- package/app/extend/render-view.d.ts +0 -5
- package/app/extend/render-view.d.ts.map +0 -1
- package/app/extend/render-view.js +0 -22
- package/app/extend/render-view.js.map +0 -1
- package/app/middleware/api-params-verify.d.ts +0 -6
- package/app/middleware/api-params-verify.d.ts.map +0 -1
- package/app/middleware/api-params-verify.js +0 -64
- package/app/middleware/api-params-verify.js.map +0 -1
- package/app/middleware/api-sign-verify.d.ts +0 -6
- package/app/middleware/api-sign-verify.d.ts.map +0 -1
- package/app/middleware/api-sign-verify.js +0 -29
- package/app/middleware/api-sign-verify.js.map +0 -1
- package/app/middleware/error-handle.d.ts +0 -6
- package/app/middleware/error-handle.d.ts.map +0 -1
- package/app/middleware/error-handle.js +0 -34
- package/app/middleware/error-handle.js.map +0 -1
- package/app/middleware/project-handler.d.ts +0 -5
- package/app/middleware/project-handler.d.ts.map +0 -1
- package/app/middleware/project-handler.js +0 -22
- package/app/middleware/project-handler.js.map +0 -1
- package/app/middleware.d.ts +0 -6
- package/app/middleware.d.ts.map +0 -1
- package/app/middleware.js +0 -39
- package/app/middleware.js.map +0 -1
- package/app/pages/main.d.ts +0 -3
- package/app/pages/main.d.ts.map +0 -1
- package/app/pages/main.js +0 -10
- package/app/pages/main.js.map +0 -1
- package/app/router/project.d.ts +0 -5
- package/app/router/project.d.ts.map +0 -1
- package/app/router/project.js +0 -9
- package/app/router/project.js.map +0 -1
- package/app/router/view.d.ts +0 -5
- package/app/router/view.d.ts.map +0 -1
- package/app/router/view.js +0 -6
- package/app/router/view.js.map +0 -1
- package/app/router-schema/project.d.ts +0 -4
- package/app/router-schema/project.d.ts.map +0 -1
- package/app/router-schema/project.js +0 -34
- package/app/router-schema/project.js.map +0 -1
- package/app/service/bese.d.ts +0 -11
- package/app/service/bese.d.ts.map +0 -1
- package/app/service/bese.js +0 -18
- package/app/service/bese.js.map +0 -1
- package/app/service/project.d.ts +0 -28
- package/app/service/project.d.ts.map +0 -1
- package/app/service/project.js +0 -39
- package/app/service/project.js.map +0 -1
- package/app/type.d.ts +0 -3
- package/app/type.d.ts.map +0 -1
- package/app/type.js +0 -3
- package/app/type.js.map +0 -1
- package/app/typings.d.ts +0 -50
- package/app/typings.d.ts.map +0 -1
- package/app/typings.js +0 -3
- package/app/typings.js.map +0 -1
- package/app/vite/config/base.d.ts +0 -6
- package/app/vite/config/base.js +0 -96
- package/app/vite/config/data.d.ts +0 -3
- package/app/vite/config/data.js +0 -11
- package/app/vite/config/dev.d.ts +0 -11
- package/app/vite/config/dev.js +0 -15
- package/app/vite/config/prod.d.ts +0 -17
- package/app/vite/config/prod.js +0 -34
- package/app/vite/dev.d.ts +0 -2
- package/app/vite/dev.js +0 -29
- package/app/vite/index.d.ts +0 -1
- package/app/vite/index.js +0 -13
- package/app/vite/package.json +0 -11
- package/app/vite/prod.d.ts +0 -1
- package/app/vite/prod.js +0 -82
- package/index.d.ts +0 -29
- package/index.d.ts.map +0 -1
- package/index.js +0 -22
- package/index.js.map +0 -1
- package/model/index.d.ts +0 -2
- package/model/index.d.ts.map +0 -1
- package/model/index.js +0 -7
- package/model/index.js.map +0 -1
- package/model/test.d.ts +0 -6
- package/model/test.d.ts.map +0 -1
- package/model/test.js +0 -6
- package/model/test.js.map +0 -1
- package/model/test2.d.ts +0 -6
- package/model/test2.d.ts.map +0 -1
- package/model/test2.js +0 -6
- package/model/test2.js.map +0 -1
- package/packages/core/env.d.ts +0 -16
- package/packages/core/env.d.ts.map +0 -1
- package/packages/core/env.js +0 -26
- package/packages/core/env.js.map +0 -1
- package/packages/core/index.d.ts +0 -7
- package/packages/core/index.d.ts.map +0 -1
- package/packages/core/index.js +0 -93
- package/packages/core/index.js.map +0 -1
- package/packages/core/loader/config.d.ts +0 -4
- package/packages/core/loader/config.d.ts.map +0 -1
- package/packages/core/loader/config.js +0 -32
- package/packages/core/loader/config.js.map +0 -1
- package/packages/core/loader/controller.d.ts +0 -4
- package/packages/core/loader/controller.d.ts.map +0 -1
- package/packages/core/loader/controller.js +0 -18
- package/packages/core/loader/controller.js.map +0 -1
- package/packages/core/loader/extend.d.ts +0 -4
- package/packages/core/loader/extend.d.ts.map +0 -1
- package/packages/core/loader/extend.js +0 -34
- package/packages/core/loader/extend.js.map +0 -1
- package/packages/core/loader/middleware.d.ts +0 -4
- package/packages/core/loader/middleware.d.ts.map +0 -1
- package/packages/core/loader/middleware.js +0 -16
- package/packages/core/loader/middleware.js.map +0 -1
- package/packages/core/loader/model.d.ts +0 -15
- package/packages/core/loader/model.d.ts.map +0 -1
- package/packages/core/loader/model.js +0 -90
- package/packages/core/loader/model.js.map +0 -1
- package/packages/core/loader/router-schema.d.ts +0 -4
- package/packages/core/loader/router-schema.d.ts.map +0 -1
- package/packages/core/loader/router-schema.js +0 -20
- package/packages/core/loader/router-schema.js.map +0 -1
- package/packages/core/loader/router.d.ts +0 -4
- package/packages/core/loader/router.d.ts.map +0 -1
- package/packages/core/loader/router.js +0 -46
- package/packages/core/loader/router.js.map +0 -1
- package/packages/core/loader/service.d.ts +0 -4
- package/packages/core/loader/service.d.ts.map +0 -1
- package/packages/core/loader/service.js +0 -17
- package/packages/core/loader/service.js.map +0 -1
- package/packages/core/paths.d.ts +0 -12
- package/packages/core/paths.d.ts.map +0 -1
- package/packages/core/paths.js +0 -11
- package/packages/core/paths.js.map +0 -1
- package/packages/core/types.d.ts +0 -74
- package/packages/core/types.d.ts.map +0 -1
- package/packages/core/types.js +0 -3
- package/packages/core/types.js.map +0 -1
- package/packages/ui/react/components/Button/Button.d.ts +0 -15
- package/packages/ui/react/components/Button/Button.d.ts.map +0 -1
- package/packages/ui/react/components/Button/Button.js +0 -36
- package/packages/ui/react/components/Button/Button.js.map +0 -1
- package/packages/ui/react/components/Button/SumbitButton.d.ts +0 -9
- package/packages/ui/react/components/Button/SumbitButton.d.ts.map +0 -1
- package/packages/ui/react/components/Button/SumbitButton.js +0 -32
- package/packages/ui/react/components/Button/SumbitButton.js.map +0 -1
- package/packages/ui/react/components/Button/index.d.ts +0 -4
- package/packages/ui/react/components/Button/index.d.ts.map +0 -1
- package/packages/ui/react/components/Button/index.js +0 -21
- package/packages/ui/react/components/Button/index.js.map +0 -1
- package/packages/ui/react/components/Checkbox/Checkbox.d.ts +0 -17
- package/packages/ui/react/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/packages/ui/react/components/Checkbox/Checkbox.js +0 -41
- package/packages/ui/react/components/Checkbox/Checkbox.js.map +0 -1
- package/packages/ui/react/components/Checkbox/index.d.ts +0 -2
- package/packages/ui/react/components/Checkbox/index.d.ts.map +0 -1
- package/packages/ui/react/components/Checkbox/index.js +0 -18
- package/packages/ui/react/components/Checkbox/index.js.map +0 -1
- package/packages/ui/react/components/ConfirmDialog.d.ts +0 -12
- package/packages/ui/react/components/ConfirmDialog.d.ts.map +0 -1
- package/packages/ui/react/components/ConfirmDialog.js +0 -13
- package/packages/ui/react/components/ConfirmDialog.js.map +0 -1
- package/packages/ui/react/components/DataTable/ActionBtn.d.ts +0 -6
- package/packages/ui/react/components/DataTable/ActionBtn.d.ts.map +0 -1
- package/packages/ui/react/components/DataTable/ActionBtn.js +0 -18
- package/packages/ui/react/components/DataTable/ActionBtn.js.map +0 -1
- package/packages/ui/react/components/DataTable/data-table.d.ts +0 -25
- package/packages/ui/react/components/DataTable/data-table.d.ts.map +0 -1
- package/packages/ui/react/components/DataTable/data-table.js +0 -145
- package/packages/ui/react/components/DataTable/data-table.js.map +0 -1
- package/packages/ui/react/components/Date/Calendar.d.ts +0 -22
- package/packages/ui/react/components/Date/Calendar.d.ts.map +0 -1
- package/packages/ui/react/components/Date/Calendar.js +0 -210
- package/packages/ui/react/components/Date/Calendar.js.map +0 -1
- package/packages/ui/react/components/Date/Date.d.ts +0 -26
- package/packages/ui/react/components/Date/Date.d.ts.map +0 -1
- package/packages/ui/react/components/Date/Date.js +0 -161
- package/packages/ui/react/components/Date/Date.js.map +0 -1
- package/packages/ui/react/components/Date/DateTestPage.d.ts +0 -2
- package/packages/ui/react/components/Date/DateTestPage.d.ts.map +0 -1
- package/packages/ui/react/components/Date/DateTestPage.js +0 -33
- package/packages/ui/react/components/Date/DateTestPage.js.map +0 -1
- package/packages/ui/react/components/Date/LocaleContext.d.ts +0 -2
- package/packages/ui/react/components/Date/LocaleContext.d.ts.map +0 -1
- package/packages/ui/react/components/Date/LocaleContext.js +0 -9
- package/packages/ui/react/components/Date/LocaleContext.js.map +0 -1
- package/packages/ui/react/components/Date/LocaleProvider.d.ts +0 -8
- package/packages/ui/react/components/Date/LocaleProvider.d.ts.map +0 -1
- package/packages/ui/react/components/Date/LocaleProvider.js +0 -17
- package/packages/ui/react/components/Date/LocaleProvider.js.map +0 -1
- package/packages/ui/react/components/Date/TimePicker.d.ts +0 -7
- package/packages/ui/react/components/Date/TimePicker.d.ts.map +0 -1
- package/packages/ui/react/components/Date/TimePicker.js +0 -79
- package/packages/ui/react/components/Date/TimePicker.js.map +0 -1
- package/packages/ui/react/components/Date/data.d.ts +0 -6
- package/packages/ui/react/components/Date/data.d.ts.map +0 -1
- package/packages/ui/react/components/Date/data.js +0 -8
- package/packages/ui/react/components/Date/data.js.map +0 -1
- package/packages/ui/react/components/Date/dateLocaleStore.d.ts +0 -10
- package/packages/ui/react/components/Date/dateLocaleStore.d.ts.map +0 -1
- package/packages/ui/react/components/Date/dateLocaleStore.js +0 -18
- package/packages/ui/react/components/Date/dateLocaleStore.js.map +0 -1
- package/packages/ui/react/components/Date/index.d.ts +0 -6
- package/packages/ui/react/components/Date/index.d.ts.map +0 -1
- package/packages/ui/react/components/Date/index.js +0 -24
- package/packages/ui/react/components/Date/index.js.map +0 -1
- package/packages/ui/react/components/Date/locales.d.ts +0 -23
- package/packages/ui/react/components/Date/locales.d.ts.map +0 -1
- package/packages/ui/react/components/Date/locales.js +0 -43
- package/packages/ui/react/components/Date/locales.js.map +0 -1
- package/packages/ui/react/components/Dropdown.d.ts +0 -16
- package/packages/ui/react/components/Dropdown.d.ts.map +0 -1
- package/packages/ui/react/components/Dropdown.js +0 -56
- package/packages/ui/react/components/Dropdown.js.map +0 -1
- package/packages/ui/react/components/Form/Form.d.ts +0 -12
- package/packages/ui/react/components/Form/Form.d.ts.map +0 -1
- package/packages/ui/react/components/Form/Form.js +0 -15
- package/packages/ui/react/components/Form/Form.js.map +0 -1
- package/packages/ui/react/components/Form/FormItem.d.ts +0 -20
- package/packages/ui/react/components/Form/FormItem.d.ts.map +0 -1
- package/packages/ui/react/components/Form/FormItem.js +0 -76
- package/packages/ui/react/components/Form/FormItem.js.map +0 -1
- package/packages/ui/react/components/Form/SchemeForm/data.d.ts +0 -51
- package/packages/ui/react/components/Form/SchemeForm/data.d.ts.map +0 -1
- package/packages/ui/react/components/Form/SchemeForm/data.js +0 -48
- package/packages/ui/react/components/Form/SchemeForm/data.js.map +0 -1
- package/packages/ui/react/components/Form/SchemeForm/index.d.ts +0 -59
- package/packages/ui/react/components/Form/SchemeForm/index.d.ts.map +0 -1
- package/packages/ui/react/components/Form/SchemeForm/index.js +0 -70
- package/packages/ui/react/components/Form/SchemeForm/index.js.map +0 -1
- package/packages/ui/react/components/Form/index.d.ts +0 -5
- package/packages/ui/react/components/Form/index.d.ts.map +0 -1
- package/packages/ui/react/components/Form/index.js +0 -21
- package/packages/ui/react/components/Form/index.js.map +0 -1
- package/packages/ui/react/components/Form/useForm.d.ts +0 -3
- package/packages/ui/react/components/Form/useForm.d.ts.map +0 -1
- package/packages/ui/react/components/Form/useForm.js +0 -6
- package/packages/ui/react/components/Form/useForm.js.map +0 -1
- package/packages/ui/react/components/ImagePreview/ImagePreview.d.ts +0 -8
- package/packages/ui/react/components/ImagePreview/ImagePreview.d.ts.map +0 -1
- package/packages/ui/react/components/ImagePreview/ImagePreview.js +0 -162
- package/packages/ui/react/components/ImagePreview/ImagePreview.js.map +0 -1
- package/packages/ui/react/components/ImagePreview/PreviewImage.d.ts +0 -8
- package/packages/ui/react/components/ImagePreview/PreviewImage.d.ts.map +0 -1
- package/packages/ui/react/components/ImagePreview/PreviewImage.js +0 -29
- package/packages/ui/react/components/ImagePreview/PreviewImage.js.map +0 -1
- package/packages/ui/react/components/ImagePreview/index.d.ts +0 -3
- package/packages/ui/react/components/ImagePreview/index.d.ts.map +0 -1
- package/packages/ui/react/components/ImagePreview/index.js +0 -19
- package/packages/ui/react/components/ImagePreview/index.js.map +0 -1
- package/packages/ui/react/components/Input/Input.d.ts +0 -21
- package/packages/ui/react/components/Input/Input.d.ts.map +0 -1
- package/packages/ui/react/components/Input/Input.js +0 -61
- package/packages/ui/react/components/Input/Input.js.map +0 -1
- package/packages/ui/react/components/Input/index.d.ts +0 -2
- package/packages/ui/react/components/Input/index.d.ts.map +0 -1
- package/packages/ui/react/components/Input/index.js +0 -18
- package/packages/ui/react/components/Input/index.js.map +0 -1
- package/packages/ui/react/components/Label/Label.d.ts +0 -22
- package/packages/ui/react/components/Label/Label.d.ts.map +0 -1
- package/packages/ui/react/components/Label/Label.js +0 -37
- package/packages/ui/react/components/Label/Label.js.map +0 -1
- package/packages/ui/react/components/Label/index.d.ts +0 -3
- package/packages/ui/react/components/Label/index.d.ts.map +0 -1
- package/packages/ui/react/components/Label/index.js +0 -21
- package/packages/ui/react/components/Label/index.js.map +0 -1
- package/packages/ui/react/components/Message/Message.d.ts +0 -13
- package/packages/ui/react/components/Message/Message.d.ts.map +0 -1
- package/packages/ui/react/components/Message/Message.js +0 -56
- package/packages/ui/react/components/Message/Message.js.map +0 -1
- package/packages/ui/react/components/Message/MessageManager.d.ts +0 -37
- package/packages/ui/react/components/Message/MessageManager.d.ts.map +0 -1
- package/packages/ui/react/components/Message/MessageManager.js +0 -86
- package/packages/ui/react/components/Message/MessageManager.js.map +0 -1
- package/packages/ui/react/components/Message/data.d.ts +0 -2
- package/packages/ui/react/components/Message/data.d.ts.map +0 -1
- package/packages/ui/react/components/Message/data.js +0 -5
- package/packages/ui/react/components/Message/data.js.map +0 -1
- package/packages/ui/react/components/Message/index.d.ts +0 -3
- package/packages/ui/react/components/Message/index.d.ts.map +0 -1
- package/packages/ui/react/components/Message/index.js +0 -6
- package/packages/ui/react/components/Message/index.js.map +0 -1
- package/packages/ui/react/components/Modal/Modal.d.ts +0 -19
- package/packages/ui/react/components/Modal/Modal.d.ts.map +0 -1
- package/packages/ui/react/components/Modal/Modal.js +0 -51
- package/packages/ui/react/components/Modal/Modal.js.map +0 -1
- package/packages/ui/react/components/Modal/ModalManager.d.ts +0 -47
- package/packages/ui/react/components/Modal/ModalManager.d.ts.map +0 -1
- package/packages/ui/react/components/Modal/ModalManager.js +0 -91
- package/packages/ui/react/components/Modal/ModalManager.js.map +0 -1
- package/packages/ui/react/components/Modal/index.d.ts +0 -4
- package/packages/ui/react/components/Modal/index.d.ts.map +0 -1
- package/packages/ui/react/components/Modal/index.js +0 -8
- package/packages/ui/react/components/Modal/index.js.map +0 -1
- package/packages/ui/react/components/Pagination.d.ts +0 -11
- package/packages/ui/react/components/Pagination.d.ts.map +0 -1
- package/packages/ui/react/components/Pagination.js +0 -85
- package/packages/ui/react/components/Pagination.js.map +0 -1
- package/packages/ui/react/components/Search/Search.d.ts +0 -14
- package/packages/ui/react/components/Search/Search.d.ts.map +0 -1
- package/packages/ui/react/components/Search/Search.js +0 -15
- package/packages/ui/react/components/Search/Search.js.map +0 -1
- package/packages/ui/react/components/Search/index.d.ts +0 -2
- package/packages/ui/react/components/Search/index.d.ts.map +0 -1
- package/packages/ui/react/components/Search/index.js +0 -9
- package/packages/ui/react/components/Search/index.js.map +0 -1
- package/packages/ui/react/components/Select/Select.d.ts +0 -19
- package/packages/ui/react/components/Select/Select.d.ts.map +0 -1
- package/packages/ui/react/components/Select/Select.js +0 -167
- package/packages/ui/react/components/Select/Select.js.map +0 -1
- package/packages/ui/react/components/Select/index.d.ts +0 -2
- package/packages/ui/react/components/Select/index.d.ts.map +0 -1
- package/packages/ui/react/components/Select/index.js +0 -18
- package/packages/ui/react/components/Select/index.js.map +0 -1
- package/packages/ui/react/components/Skeleton/Skeleton.d.ts +0 -13
- package/packages/ui/react/components/Skeleton/Skeleton.d.ts.map +0 -1
- package/packages/ui/react/components/Skeleton/Skeleton.js +0 -36
- package/packages/ui/react/components/Skeleton/Skeleton.js.map +0 -1
- package/packages/ui/react/components/Skeleton/index.d.ts +0 -3
- package/packages/ui/react/components/Skeleton/index.d.ts.map +0 -1
- package/packages/ui/react/components/Skeleton/index.js +0 -6
- package/packages/ui/react/components/Skeleton/index.js.map +0 -1
- package/packages/ui/react/components/Switch/Switch.d.ts +0 -11
- package/packages/ui/react/components/Switch/Switch.d.ts.map +0 -1
- package/packages/ui/react/components/Switch/Switch.js +0 -57
- package/packages/ui/react/components/Switch/Switch.js.map +0 -1
- package/packages/ui/react/components/Switch/index.d.ts +0 -2
- package/packages/ui/react/components/Switch/index.d.ts.map +0 -1
- package/packages/ui/react/components/Switch/index.js +0 -18
- package/packages/ui/react/components/Switch/index.js.map +0 -1
- package/packages/ui/react/components/TableSearch/TableSearch.d.ts +0 -30
- package/packages/ui/react/components/TableSearch/TableSearch.d.ts.map +0 -1
- package/packages/ui/react/components/TableSearch/TableSearch.js +0 -121
- package/packages/ui/react/components/TableSearch/TableSearch.js.map +0 -1
- package/packages/ui/react/components/TableSearch/index.d.ts +0 -2
- package/packages/ui/react/components/TableSearch/index.d.ts.map +0 -1
- package/packages/ui/react/components/TableSearch/index.js +0 -9
- package/packages/ui/react/components/TableSearch/index.js.map +0 -1
- package/packages/ui/react/components/TableSearch/lang.d.ts +0 -15
- package/packages/ui/react/components/TableSearch/lang.d.ts.map +0 -1
- package/packages/ui/react/components/TableSearch/lang.js +0 -28
- package/packages/ui/react/components/TableSearch/lang.js.map +0 -1
- package/packages/ui/react/components/TableSearch/tableSearchLocaleStore.d.ts +0 -9
- package/packages/ui/react/components/TableSearch/tableSearchLocaleStore.d.ts.map +0 -1
- package/packages/ui/react/components/TableSearch/tableSearchLocaleStore.js +0 -15
- package/packages/ui/react/components/TableSearch/tableSearchLocaleStore.js.map +0 -1
- package/packages/ui/react/components/Textarea.d.ts +0 -19
- package/packages/ui/react/components/Textarea.d.ts.map +0 -1
- package/packages/ui/react/components/Textarea.js +0 -38
- package/packages/ui/react/components/Textarea.js.map +0 -1
- package/packages/ui/react/components/Tooltip.d.ts +0 -9
- package/packages/ui/react/components/Tooltip.d.ts.map +0 -1
- package/packages/ui/react/components/Tooltip.js +0 -109
- package/packages/ui/react/components/Tooltip.js.map +0 -1
- package/packages/ui/react/components/TreeSelect.d.ts +0 -19
- package/packages/ui/react/components/TreeSelect.d.ts.map +0 -1
- package/packages/ui/react/components/TreeSelect.js +0 -160
- package/packages/ui/react/components/TreeSelect.js.map +0 -1
- package/packages/ui/react/components/Upload/ImageUpload.d.ts +0 -9
- package/packages/ui/react/components/Upload/ImageUpload.d.ts.map +0 -1
- package/packages/ui/react/components/Upload/ImageUpload.js +0 -67
- package/packages/ui/react/components/Upload/ImageUpload.js.map +0 -1
- package/packages/ui/react/components/Upload/Upload.d.ts +0 -14
- package/packages/ui/react/components/Upload/Upload.d.ts.map +0 -1
- package/packages/ui/react/components/Upload/Upload.js +0 -9
- package/packages/ui/react/components/Upload/Upload.js.map +0 -1
- package/packages/ui/react/components/Upload/index.d.ts +0 -3
- package/packages/ui/react/components/Upload/index.d.ts.map +0 -1
- package/packages/ui/react/components/Upload/index.js +0 -19
- package/packages/ui/react/components/Upload/index.js.map +0 -1
- package/packages/ui/react/components/breadcrumb.d.ts +0 -35
- package/packages/ui/react/components/breadcrumb.d.ts.map +0 -1
- package/packages/ui/react/components/breadcrumb.js +0 -80
- package/packages/ui/react/components/breadcrumb.js.map +0 -1
- package/packages/ui/react/components/hooks/useInputController.d.ts +0 -21
- package/packages/ui/react/components/hooks/useInputController.d.ts.map +0 -1
- package/packages/ui/react/components/hooks/useInputController.js +0 -43
- package/packages/ui/react/components/hooks/useInputController.js.map +0 -1
- package/packages/ui/react/components/index.d.ts +0 -24
- package/packages/ui/react/components/index.d.ts.map +0 -1
- package/packages/ui/react/components/index.js +0 -40
- package/packages/ui/react/components/index.js.map +0 -1
- package/packages/ui/react/components/table.d.ts +0 -17
- package/packages/ui/react/components/table.d.ts.map +0 -1
- package/packages/ui/react/components/table.js +0 -64
- package/packages/ui/react/components/table.js.map +0 -1
- package/packages/ui/react/components/testPage/index.d.ts +0 -3
- package/packages/ui/react/components/testPage/index.d.ts.map +0 -1
- package/packages/ui/react/components/testPage/index.js +0 -124
- package/packages/ui/react/components/testPage/index.js.map +0 -1
- package/packages/ui/react/hooks/useBreadcrumb.d.ts +0 -10
- package/packages/ui/react/hooks/useBreadcrumb.d.ts.map +0 -1
- package/packages/ui/react/hooks/useBreadcrumb.js +0 -6
- package/packages/ui/react/hooks/useBreadcrumb.js.map +0 -1
- package/packages/ui/react/hooks/useInit.d.ts +0 -3
- package/packages/ui/react/hooks/useInit.d.ts.map +0 -1
- package/packages/ui/react/hooks/useInit.js +0 -12
- package/packages/ui/react/hooks/useInit.js.map +0 -1
- package/packages/ui/react/hooks/useLanguage.d.ts +0 -7
- package/packages/ui/react/hooks/useLanguage.d.ts.map +0 -1
- package/packages/ui/react/hooks/useLanguage.js +0 -8
- package/packages/ui/react/hooks/useLanguage.js.map +0 -1
- package/packages/ui/react/hooks/usePagination.d.ts +0 -16
- package/packages/ui/react/hooks/usePagination.d.ts.map +0 -1
- package/packages/ui/react/hooks/usePagination.js +0 -34
- package/packages/ui/react/hooks/usePagination.js.map +0 -1
- package/packages/ui/react/index.d.ts +0 -3
- package/packages/ui/react/index.d.ts.map +0 -1
- package/packages/ui/react/index.js +0 -19
- package/packages/ui/react/index.js.map +0 -1
- package/packages/ui/react/lib/export.d.ts +0 -22
- package/packages/ui/react/lib/export.d.ts.map +0 -1
- package/packages/ui/react/lib/export.js +0 -136
- package/packages/ui/react/lib/export.js.map +0 -1
- package/packages/ui/react/lib/utils.d.ts +0 -10
- package/packages/ui/react/lib/utils.d.ts.map +0 -1
- package/packages/ui/react/lib/utils.js +0 -53
- package/packages/ui/react/lib/utils.js.map +0 -1
- package/packages/ui/react/locales/index.d.ts +0 -8
- package/packages/ui/react/locales/index.d.ts.map +0 -1
- package/packages/ui/react/locales/index.js +0 -10
- package/packages/ui/react/locales/index.js.map +0 -1
- package/packages/ui/react/stores/breadcrumb.d.ts +0 -15
- package/packages/ui/react/stores/breadcrumb.d.ts.map +0 -1
- package/packages/ui/react/stores/breadcrumb.js +0 -68
- package/packages/ui/react/stores/breadcrumb.js.map +0 -1
- package/packages/ui/react/stores/language.d.ts +0 -13
- package/packages/ui/react/stores/language.d.ts.map +0 -1
- package/packages/ui/react/stores/language.js +0 -55
- package/packages/ui/react/stores/language.js.map +0 -1
- package/packages/ui/react/types/index.d.ts +0 -2
- package/packages/ui/react/types/index.d.ts.map +0 -1
- package/packages/ui/react/types/index.js +0 -3
- package/packages/ui/react/types/index.js.map +0 -1
- package/packages/utils/getAllFilesInFolder.d.ts +0 -5
- package/packages/utils/getAllFilesInFolder.d.ts.map +0 -1
- package/packages/utils/getAllFilesInFolder.js +0 -46
- package/packages/utils/getAllFilesInFolder.js.map +0 -1
- package/packages/utils/getAllFnReturnValue.d.ts +0 -1
- package/packages/utils/getAllFnReturnValue.d.ts.map +0 -1
- package/packages/utils/getAllFnReturnValue.js +0 -2
- package/packages/utils/getAllFnReturnValue.js.map +0 -1
- package/packages/utils/index.d.ts +0 -5
- package/packages/utils/index.d.ts.map +0 -1
- package/packages/utils/index.js +0 -21
- package/packages/utils/index.js.map +0 -1
- package/packages/utils/loadFile.d.ts +0 -15
- package/packages/utils/loadFile.d.ts.map +0 -1
- package/packages/utils/loadFile.js +0 -57
- package/packages/utils/loadFile.js.map +0 -1
- package/packages/utils/path.d.ts +0 -7
- package/packages/utils/path.d.ts.map +0 -1
- package/packages/utils/path.js +0 -51
- package/packages/utils/path.js.map +0 -1
- package/packages/utils/runFileFn.d.ts +0 -6
- package/packages/utils/runFileFn.d.ts.map +0 -1
- package/packages/utils/runFileFn.js +0 -6
- package/packages/utils/runFileFn.js.map +0 -1
- package/typings/type.d.ts +0 -2
- package/typings/type.d.ts.map +0 -1
- package/typings/type.js +0 -3
- package/typings/type.js.map +0 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import "./default.js";
|
|
2
|
+
import "./en-US.js";
|
|
3
|
+
import { defaultLanguage, languageLocalKey, translations } from "./locales.js";
|
|
4
|
+
//#region packages/common/i18n/index.ts
|
|
5
|
+
var isPlainI18nDictionary = (value) => {
|
|
6
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* 深合并单个语言包。
|
|
10
|
+
* 嵌套对象递归合并,字符串、数组、数字等叶子节点直接以 patch 覆盖 base。
|
|
11
|
+
*/
|
|
12
|
+
var mergeI18nDictionary = (base = {}, patch = {}) => {
|
|
13
|
+
const next = { ...base };
|
|
14
|
+
Object.entries(patch).forEach(([key, value]) => {
|
|
15
|
+
const current = next[key];
|
|
16
|
+
if (isPlainI18nDictionary(current) && isPlainI18nDictionary(value)) {
|
|
17
|
+
next[key] = mergeI18nDictionary(current, value);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
next[key] = value;
|
|
21
|
+
});
|
|
22
|
+
return next;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* 合并多语言资源。
|
|
26
|
+
* 结构示例:{ 'zh-CN': { common: { ok: '确定' } }, 'en-US': { common: { ok: 'OK' } } }
|
|
27
|
+
*/
|
|
28
|
+
var mergeI18nResources = (base = {}, patch = {}) => {
|
|
29
|
+
const next = { ...base };
|
|
30
|
+
Object.entries(patch).forEach(([language, messages]) => {
|
|
31
|
+
if (!messages) return;
|
|
32
|
+
next[language] = mergeI18nDictionary(next[language], messages);
|
|
33
|
+
});
|
|
34
|
+
return next;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* 根据点分 key 从语言包中取值。
|
|
38
|
+
* 例如 common.submit 会读取 resources[language].common.submit。
|
|
39
|
+
*/
|
|
40
|
+
var getI18nPathValue = (dictionary, key) => {
|
|
41
|
+
if (!dictionary) return void 0;
|
|
42
|
+
return key.split(".").reduce((value, currentKey) => {
|
|
43
|
+
if (!isPlainI18nDictionary(value)) return void 0;
|
|
44
|
+
return value[currentKey];
|
|
45
|
+
}, dictionary);
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* 替换文案中的插值占位符。
|
|
49
|
+
* 例如 "Hello, {name}" + { name: "Tom" } => "Hello, Tom"。
|
|
50
|
+
*/
|
|
51
|
+
var interpolateI18nMessage = (value, data) => {
|
|
52
|
+
if (!data) return value;
|
|
53
|
+
return value.replace(/\{([A-Za-z0-9_]+)\}/g, (match, key) => {
|
|
54
|
+
const nextValue = data[key];
|
|
55
|
+
return typeof nextValue === "undefined" || nextValue === null ? match : String(nextValue);
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* 纯翻译函数:只依赖传入的 state。
|
|
60
|
+
* 优先级:指定语言 -> 兜底语言 -> options.fallback -> 原 key。
|
|
61
|
+
*/
|
|
62
|
+
var translate = (state, key, fillingData, options) => {
|
|
63
|
+
const language = options?.language || state.language;
|
|
64
|
+
const fallbackLanguage = options?.fallbackLanguage || state.fallbackLanguage;
|
|
65
|
+
const value = getI18nPathValue(state.resources[language], key) ?? getI18nPathValue(state.resources[fallbackLanguage], key) ?? options?.fallback ?? key;
|
|
66
|
+
return typeof value === "string" ? interpolateI18nMessage(value, fillingData) : value;
|
|
67
|
+
};
|
|
68
|
+
var getBrowserWindow = () => {
|
|
69
|
+
return globalThis.window;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* 初始化时优先读取本地缓存语言。
|
|
73
|
+
* SSR 环境没有 window,直接回退到默认语言。
|
|
74
|
+
*/
|
|
75
|
+
var getStoredLanguage = (storageKey) => {
|
|
76
|
+
const windowRef = getBrowserWindow();
|
|
77
|
+
if (!windowRef) return defaultLanguage;
|
|
78
|
+
return windowRef.localStorage.getItem(storageKey) || "zh-CN";
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* 持久化当前语言,用于刷新页面后保持用户选择。
|
|
82
|
+
*/
|
|
83
|
+
var persistLanguage = (storageKey, language) => {
|
|
84
|
+
const windowRef = getBrowserWindow();
|
|
85
|
+
if (!windowRef) return;
|
|
86
|
+
windowRef.localStorage.setItem(storageKey, language);
|
|
87
|
+
};
|
|
88
|
+
var createInitialState = () => ({
|
|
89
|
+
language: getStoredLanguage(languageLocalKey),
|
|
90
|
+
fallbackLanguage: defaultLanguage,
|
|
91
|
+
resources: translations,
|
|
92
|
+
storageKey: languageLocalKey,
|
|
93
|
+
persist: true
|
|
94
|
+
});
|
|
95
|
+
var createI18nStore = () => {
|
|
96
|
+
let state;
|
|
97
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
98
|
+
const setState = (partial) => {
|
|
99
|
+
const previousState = state;
|
|
100
|
+
const nextPartial = typeof partial === "function" ? partial(state) : partial;
|
|
101
|
+
state = {
|
|
102
|
+
...state,
|
|
103
|
+
...nextPartial
|
|
104
|
+
};
|
|
105
|
+
listeners.forEach((listener) => listener(state, previousState));
|
|
106
|
+
};
|
|
107
|
+
state = {
|
|
108
|
+
...createInitialState(),
|
|
109
|
+
t: (key, fillingData, options) => i18n(key, fillingData, options),
|
|
110
|
+
setLanguage: (language) => {
|
|
111
|
+
setState({ language });
|
|
112
|
+
const { persist, storageKey } = state;
|
|
113
|
+
if (persist) persistLanguage(storageKey, language);
|
|
114
|
+
},
|
|
115
|
+
setFallbackLanguage: (fallbackLanguage) => {
|
|
116
|
+
setState({ fallbackLanguage });
|
|
117
|
+
},
|
|
118
|
+
setResources: (resources, options) => {
|
|
119
|
+
setState((currentState) => ({ resources: options?.merge ? mergeI18nResources(currentState.resources, resources) : resources }));
|
|
120
|
+
},
|
|
121
|
+
addResources: (language, messages, options) => {
|
|
122
|
+
setState((currentState) => {
|
|
123
|
+
const shouldMerge = options?.merge ?? true;
|
|
124
|
+
const currentMessages = currentState.resources[language];
|
|
125
|
+
return { resources: {
|
|
126
|
+
...currentState.resources,
|
|
127
|
+
[language]: shouldMerge ? mergeI18nDictionary(currentMessages, messages) : messages
|
|
128
|
+
} };
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
configureI18n: (config) => {
|
|
132
|
+
setState(config);
|
|
133
|
+
},
|
|
134
|
+
resetI18n: () => {
|
|
135
|
+
setState(createInitialState());
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const initialStoreState = state;
|
|
139
|
+
return {
|
|
140
|
+
getState: () => state,
|
|
141
|
+
getInitialState: () => initialStoreState,
|
|
142
|
+
setState,
|
|
143
|
+
subscribe: (listener) => {
|
|
144
|
+
listeners.add(listener);
|
|
145
|
+
return () => {
|
|
146
|
+
listeners.delete(listener);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
var i18nStore = createI18nStore();
|
|
152
|
+
/**
|
|
153
|
+
* 对外使用的 i18n 函数。
|
|
154
|
+
* 每次调用都会读取最新 state,适合在非 React 代码中直接使用。
|
|
155
|
+
*/
|
|
156
|
+
var i18n = (key, fillingData, options) => {
|
|
157
|
+
return translate(i18nStore.getState(), key, fillingData, options);
|
|
158
|
+
};
|
|
159
|
+
var t = i18n;
|
|
160
|
+
var getLanguage = i18n;
|
|
161
|
+
//#endregion
|
|
162
|
+
export { getI18nPathValue, getLanguage, i18n, i18nStore, interpolateI18nMessage, isPlainI18nDictionary, mergeI18nDictionary, mergeI18nResources, t, translate };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { I18nResources } from "./types";
|
|
2
|
+
export declare const defaultLanguage: "zh-CN";
|
|
3
|
+
export declare const languageLocalKey = "tc_language";
|
|
4
|
+
export declare const translations: I18nResources;
|
|
5
|
+
export type Language = keyof typeof translations | (string & {});
|
|
6
|
+
export * from "./default";
|
|
7
|
+
export * from "./en-US";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defaultLanguageResources } from "./default.js";
|
|
2
|
+
import { defaultEnglishResources } from "./en-US.js";
|
|
3
|
+
//#region packages/common/i18n/locales.ts
|
|
4
|
+
var defaultLanguage = "zh-CN";
|
|
5
|
+
var languageLocalKey = "tc_language";
|
|
6
|
+
var translations = {
|
|
7
|
+
"zh-CN": defaultLanguageResources,
|
|
8
|
+
"en-US": defaultEnglishResources
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { defaultLanguage, languageLocalKey, translations };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type I18nLanguage = string;
|
|
2
|
+
export type I18nPrimitive = string | number | boolean | null | undefined;
|
|
3
|
+
export type I18nMessage = I18nPrimitive | I18nMessage[] | readonly I18nMessage[] | I18nDictionary;
|
|
4
|
+
export interface I18nDictionary {
|
|
5
|
+
[key: string]: I18nMessage;
|
|
6
|
+
}
|
|
7
|
+
export type I18nResources<Language extends I18nLanguage = I18nLanguage> = Partial<Record<Language, I18nDictionary>>;
|
|
8
|
+
export type I18nInterpolationValues = Record<string, I18nPrimitive>;
|
|
9
|
+
export interface I18nTranslateState {
|
|
10
|
+
language: I18nLanguage;
|
|
11
|
+
fallbackLanguage: I18nLanguage;
|
|
12
|
+
resources: I18nResources;
|
|
13
|
+
}
|
|
14
|
+
export interface I18nState extends I18nTranslateState {
|
|
15
|
+
storageKey: string;
|
|
16
|
+
persist: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface I18nTranslateOptions {
|
|
19
|
+
language?: I18nLanguage;
|
|
20
|
+
fallbackLanguage?: I18nLanguage;
|
|
21
|
+
fallback?: I18nMessage;
|
|
22
|
+
}
|
|
23
|
+
export interface I18nSetResourcesOptions {
|
|
24
|
+
merge?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface I18nAddResourcesOptions {
|
|
27
|
+
merge?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export type I18nTranslator = <T = string>(key: string, fillingData?: I18nInterpolationValues, options?: I18nTranslateOptions) => T | string;
|
|
30
|
+
export interface I18nActions {
|
|
31
|
+
setLanguage: (language: I18nLanguage) => void;
|
|
32
|
+
setFallbackLanguage: (language: I18nLanguage) => void;
|
|
33
|
+
setResources: (resources: I18nResources, options?: I18nSetResourcesOptions) => void;
|
|
34
|
+
addResources: (language: I18nLanguage, messages: I18nDictionary, options?: I18nAddResourcesOptions) => void;
|
|
35
|
+
configureI18n: (config: Partial<Pick<I18nState, 'storageKey' | 'persist'>>) => void;
|
|
36
|
+
resetI18n: () => void;
|
|
37
|
+
t: I18nTranslator;
|
|
38
|
+
}
|
|
39
|
+
export type I18nStore = I18nState & I18nActions;
|
|
40
|
+
export type I18nStoreListener = (state: I18nStore, previousState: I18nStore) => void;
|
|
41
|
+
export interface I18nStoreApi {
|
|
42
|
+
getState: () => I18nStore;
|
|
43
|
+
getInitialState: () => I18nStore;
|
|
44
|
+
setState: (partial: Partial<I18nStore> | ((state: I18nStore) => Partial<I18nStore>)) => void;
|
|
45
|
+
subscribe: (listener: I18nStoreListener) => () => void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./array";
|
|
2
|
+
export * from "./cache";
|
|
3
|
+
export * from "./guards";
|
|
4
|
+
export * from "./http";
|
|
5
|
+
export * from "./i18n";
|
|
6
|
+
export * from "./log";
|
|
7
|
+
export * from "./number";
|
|
8
|
+
export * from "./object";
|
|
9
|
+
export * from "./string";
|
|
10
|
+
export * from "./types";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const ANSI_RESET = "\u001B[0m";
|
|
2
|
+
export declare const ansiColors: {
|
|
3
|
+
readonly black: "\u001B[30m";
|
|
4
|
+
readonly red: "\u001B[31m";
|
|
5
|
+
readonly green: "\u001B[32m";
|
|
6
|
+
readonly yellow: "\u001B[33m";
|
|
7
|
+
readonly blue: "\u001B[34m";
|
|
8
|
+
readonly magenta: "\u001B[35m";
|
|
9
|
+
readonly pink: "\u001B[95m";
|
|
10
|
+
readonly cyan: "\u001B[36m";
|
|
11
|
+
readonly white: "\u001B[37m";
|
|
12
|
+
readonly gray: "\u001B[90m";
|
|
13
|
+
};
|
|
14
|
+
export type LogColor = keyof typeof ansiColors;
|
|
15
|
+
export type ColorLogOptions = {
|
|
16
|
+
color?: LogColor;
|
|
17
|
+
prefix?: string;
|
|
18
|
+
suffix?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ColorLogAffixes = Omit<ColorLogOptions, 'color'>;
|
|
21
|
+
export declare const colorize: (message: unknown, color?: LogColor) => string;
|
|
22
|
+
export declare const joinColorized: (...messages: readonly unknown[]) => string;
|
|
23
|
+
export declare const logJoinColorized: (...messages: readonly unknown[]) => void;
|
|
24
|
+
export declare function colorLog(color: LogColor, ...data: unknown[]): void;
|
|
25
|
+
export declare function colorLog(...data: unknown[]): void;
|
|
26
|
+
export declare const logColor: (color: LogColor, ...data: unknown[]) => void;
|
|
27
|
+
export declare const logColorized: (...messages: readonly unknown[]) => void;
|
|
28
|
+
export declare const logGreen: (...data: unknown[]) => void;
|
|
29
|
+
export declare const logYellow: (...data: unknown[]) => void;
|
|
30
|
+
export declare const logPink: (...data: unknown[]) => void;
|
|
31
|
+
export declare const logWhite: (...data: unknown[]) => void;
|
|
32
|
+
export declare const logRed: (...data: unknown[]) => void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isPlainObject } from "../guards/index.js";
|
|
2
|
+
//#region packages/common/object/filterEmpty.ts
|
|
3
|
+
var isEmptyValue = (value) => {
|
|
4
|
+
if (value === void 0) return true;
|
|
5
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
6
|
+
if (isPlainObject(value)) return Object.keys(value).length === 0;
|
|
7
|
+
return false;
|
|
8
|
+
};
|
|
9
|
+
var filterEmptyValue = (value) => {
|
|
10
|
+
if (Array.isArray(value)) {
|
|
11
|
+
const result = value.map((item) => filterEmptyValue(item)).filter((item) => !isEmptyValue(item));
|
|
12
|
+
return result.length > 0 ? result : void 0;
|
|
13
|
+
}
|
|
14
|
+
if (isPlainObject(value)) {
|
|
15
|
+
const result = {};
|
|
16
|
+
for (const [key, item] of Object.entries(value)) {
|
|
17
|
+
const nextValue = filterEmptyValue(item);
|
|
18
|
+
if (!isEmptyValue(nextValue)) result[key] = nextValue;
|
|
19
|
+
}
|
|
20
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
function filterEmpty(data) {
|
|
25
|
+
return filterEmptyValue(data);
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { filterEmpty };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { filterEmpty, filtereEmpty } from "./filterEmpty";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from "./filterEmpty";
|
|
2
|
+
export declare const pick: <T extends object, K extends keyof T>(target: T, keys: readonly K[]) => Pick<T, K>;
|
|
3
|
+
export declare const omit: <T extends object, K extends keyof T>(target: T, keys: readonly K[]) => Omit<T, K>;
|
|
4
|
+
export declare const mapValues: <T extends object, TResult>(target: T, mapper: <K extends keyof T>(value: T[K], key: K) => TResult) => { [K in keyof T]: TResult; };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const useBreadcrumb: import("zustand").UseBoundStore<import("zustand").StoreApi<{
|
|
2
|
+
items: import("../ui/index").BreadcrumbItemData[];
|
|
3
|
+
} & {
|
|
4
|
+
setItems: (items: import("../ui/index").BreadcrumbItemData[]) => void;
|
|
5
|
+
addItem: (item: import("../ui/index").BreadcrumbItemData) => void;
|
|
6
|
+
removeItem: (id: string | number) => void;
|
|
7
|
+
clearItems: () => void;
|
|
8
|
+
setActiveItem: (id: string | number) => void;
|
|
9
|
+
}>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const executionPhaseType: {
|
|
2
|
+
readonly mount: "mount";
|
|
3
|
+
readonly render: "render";
|
|
4
|
+
readonly unMount: "unMount";
|
|
5
|
+
};
|
|
6
|
+
type ExecutionPhaseTypeKeys = keyof typeof executionPhaseType;
|
|
7
|
+
export type ExecutionPhaseType = (typeof executionPhaseType)[ExecutionPhaseTypeKeys];
|
|
8
|
+
export default function useExecuteOnce<T>(factory: () => T, options?: {
|
|
9
|
+
executionPhase: ExecutionPhaseType[] | ExecutionPhaseType;
|
|
10
|
+
}): T | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
2
|
+
//#region packages/react/hooks/useExecuteOnce.ts
|
|
3
|
+
var executionPhaseType = {
|
|
4
|
+
mount: "mount",
|
|
5
|
+
render: "render",
|
|
6
|
+
unMount: "unMount"
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @description 在各个阶段只触发一次
|
|
11
|
+
* @demo
|
|
12
|
+
* ```
|
|
13
|
+
const count = useExecuteOnce(() => {
|
|
14
|
+
console.log('123'); // 只会在第一次render时触发
|
|
15
|
+
return 123
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
// count 123
|
|
19
|
+
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
function useExecuteOnce(factory, options) {
|
|
23
|
+
const { executionPhase: pExecutionPhase = executionPhaseType.render } = options ?? {};
|
|
24
|
+
const result = useRef(null);
|
|
25
|
+
const _executionPhase = useMemo(() => typeof pExecutionPhase === "string" ? [pExecutionPhase] : pExecutionPhase, [pExecutionPhase]);
|
|
26
|
+
const allowExecution = useRef([]);
|
|
27
|
+
const executionPhase = useRef(_executionPhase);
|
|
28
|
+
const runFN = (phase) => {
|
|
29
|
+
if (!allowExecution.current.includes(phase)) {
|
|
30
|
+
result.current = factory();
|
|
31
|
+
allowExecution.current.push(phase);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const fn = useRef(runFN);
|
|
35
|
+
executionPhase.current = _executionPhase;
|
|
36
|
+
fn.current = runFN;
|
|
37
|
+
if (executionPhase.current.includes(executionPhaseType.render)) fn.current(executionPhaseType.render);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (executionPhase.current.includes(executionPhaseType.mount)) fn.current(executionPhaseType["mount"]);
|
|
40
|
+
return () => {
|
|
41
|
+
if (executionPhase.current.includes(executionPhaseType["unMount"])) fn.current(executionPhaseType["unMount"]);
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return result.current;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { useExecuteOnce as default, executionPhaseType };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
//#region packages/react/hooks/useInit.ts
|
|
3
|
+
var useInit = (callback) => {
|
|
4
|
+
const isInit = useRef(false);
|
|
5
|
+
if (!isInit.current) {
|
|
6
|
+
callback(isInit.current);
|
|
7
|
+
isInit.current = true;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { useInit as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLanguage(): import("../ui/index").I18nStore;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type PaginationValue = {
|
|
2
|
+
current: number;
|
|
3
|
+
size: number;
|
|
4
|
+
total: number;
|
|
5
|
+
};
|
|
6
|
+
type IParams = {
|
|
7
|
+
defaultValue?: PaginationValue;
|
|
8
|
+
};
|
|
9
|
+
export default function usePagination(params?: IParams): import("react").RefObject<{
|
|
10
|
+
current: number;
|
|
11
|
+
size: number;
|
|
12
|
+
total: number;
|
|
13
|
+
onChange: (params: Partial<PaginationValue>) => void;
|
|
14
|
+
}>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import useInit from "./useInit.js";
|
|
2
|
+
import { useCallback, useRef, useState } from "react";
|
|
3
|
+
//#region packages/react/hooks/usePagination.ts
|
|
4
|
+
function usePagination(params) {
|
|
5
|
+
const paginationData = useRef({
|
|
6
|
+
...params?.defaultValue ?? {
|
|
7
|
+
current: 1,
|
|
8
|
+
size: 10,
|
|
9
|
+
total: 0
|
|
10
|
+
},
|
|
11
|
+
onChange: () => {}
|
|
12
|
+
});
|
|
13
|
+
const [, changeView] = useState(0);
|
|
14
|
+
const updata = useCallback((params) => {
|
|
15
|
+
if (typeof params.current !== "undefined") paginationData.current.current = params.current;
|
|
16
|
+
if (typeof params.size !== "undefined") paginationData.current.size = params.size;
|
|
17
|
+
if (typeof params.total !== "undefined") paginationData.current.total = params.total;
|
|
18
|
+
if ([
|
|
19
|
+
params.size,
|
|
20
|
+
params.current,
|
|
21
|
+
params.total
|
|
22
|
+
].some((i) => typeof i !== "undefined")) changeView((e) => e + 1);
|
|
23
|
+
}, []);
|
|
24
|
+
useInit(() => {
|
|
25
|
+
paginationData.current.onChange = updata;
|
|
26
|
+
});
|
|
27
|
+
return paginationData;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { usePagination as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
type SetState<S> = (value: S | ((preValue: S) => S), callback?: CallBackFN<S>) => void;
|
|
3
|
+
type CallBackFN<T> = (value: T) => void;
|
|
4
|
+
type RefState<T> = RefObject<{
|
|
5
|
+
data: T;
|
|
6
|
+
}>;
|
|
7
|
+
export default function useRefState<S>(initialState: S | (() => S)): [
|
|
8
|
+
S,
|
|
9
|
+
SetState<S>,
|
|
10
|
+
RefState<S>
|
|
11
|
+
];
|
|
12
|
+
export default function useRefState<S = undefined>(): [
|
|
13
|
+
S | undefined,
|
|
14
|
+
SetState<S | undefined>,
|
|
15
|
+
RefState<S | undefined>
|
|
16
|
+
];
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import useInit from "./useInit.js";
|
|
2
|
+
import { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
//#region packages/react/hooks/useRefState.ts
|
|
4
|
+
function useRefState(initialState) {
|
|
5
|
+
const [v, setValue] = useState(initialState);
|
|
6
|
+
const data = useRef({ data: void 0 });
|
|
7
|
+
const callbackRef = useRef(null);
|
|
8
|
+
const [callbackVersion, setCallbackVersion] = useState(0);
|
|
9
|
+
useInit(() => {
|
|
10
|
+
data.current.data = v;
|
|
11
|
+
});
|
|
12
|
+
const setData = useCallback((action, callback) => {
|
|
13
|
+
const value = typeof action === "function" ? action(data.current.data) : action;
|
|
14
|
+
setValue(value);
|
|
15
|
+
data.current.data = value;
|
|
16
|
+
if (callback) {
|
|
17
|
+
callbackRef.current = callback;
|
|
18
|
+
setCallbackVersion((version) => version + 1);
|
|
19
|
+
}
|
|
20
|
+
}, [setCallbackVersion, setValue]);
|
|
21
|
+
useLayoutEffect(() => {
|
|
22
|
+
if (callbackRef.current) {
|
|
23
|
+
const callback = callbackRef.current;
|
|
24
|
+
callbackRef.current = null;
|
|
25
|
+
callback(data.current.data);
|
|
26
|
+
}
|
|
27
|
+
}, [callbackVersion]);
|
|
28
|
+
return [
|
|
29
|
+
v,
|
|
30
|
+
setData,
|
|
31
|
+
data
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { useRefState as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type WatchCallback<T> = (value: T, prevValue: T | undefined) => void | (() => void);
|
|
2
|
+
export type WatchCompare<T> = (value: T, prevValue: T) => boolean;
|
|
3
|
+
export type WatchCompareType = 'identity' | 'shallow';
|
|
4
|
+
export type WatchSelector<TSource, TValue> = (source: TSource) => TValue;
|
|
5
|
+
export type UseWatchOptions<T> = {
|
|
6
|
+
immediate?: boolean;
|
|
7
|
+
compare?: WatchCompareType | WatchCompare<T>;
|
|
8
|
+
};
|
|
9
|
+
export declare const identityCompare: <T>(value: T, prevValue: T) => boolean;
|
|
10
|
+
export declare const shallowCompare: <T>(value: T, prevValue: T) => boolean;
|
|
11
|
+
export declare const defaultCompare: <T>(value: T, prevValue: T) => boolean;
|
|
12
|
+
export declare function useWatch<T>(value: T, callback: WatchCallback<T>, options?: UseWatchOptions<T>): void;
|
|
13
|
+
export declare function useWatch<TSource, TValue>(source: TSource, selector: WatchSelector<TSource, TValue>, callback: WatchCallback<TValue>, options?: UseWatchOptions<TValue>): void;
|
|
14
|
+
export default useWatch;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
//#region packages/react/hooks/useWatch.ts
|
|
3
|
+
var identityCompare = (value, prevValue) => Object.is(value, prevValue);
|
|
4
|
+
var shallowCompare = (value, prevValue) => {
|
|
5
|
+
if (Object.is(value, prevValue)) return true;
|
|
6
|
+
if (Array.isArray(value) && Array.isArray(prevValue)) {
|
|
7
|
+
if (value.length !== prevValue.length) return false;
|
|
8
|
+
return value.every((item, index) => Object.is(item, prevValue[index]));
|
|
9
|
+
}
|
|
10
|
+
if (value && prevValue && typeof value === "object" && typeof prevValue === "object") {
|
|
11
|
+
const valuePrototype = Object.getPrototypeOf(value);
|
|
12
|
+
if (valuePrototype !== Object.getPrototypeOf(prevValue) || valuePrototype !== Object.prototype && valuePrototype !== null) return false;
|
|
13
|
+
const valueKeys = Object.keys(value);
|
|
14
|
+
const prevValueKeys = Object.keys(prevValue);
|
|
15
|
+
if (valueKeys.length !== prevValueKeys.length) return false;
|
|
16
|
+
return valueKeys.every((key) => Object.prototype.hasOwnProperty.call(prevValue, key) && Object.is(value[key], prevValue[key]));
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
};
|
|
20
|
+
var defaultCompare = (value, prevValue) => {
|
|
21
|
+
if (Array.isArray(value) && Array.isArray(prevValue)) return shallowCompare(value, prevValue);
|
|
22
|
+
return identityCompare(value, prevValue);
|
|
23
|
+
};
|
|
24
|
+
var getCompare = (compare) => {
|
|
25
|
+
if (compare === "identity") return identityCompare;
|
|
26
|
+
if (compare === "shallow") return shallowCompare;
|
|
27
|
+
return compare ?? defaultCompare;
|
|
28
|
+
};
|
|
29
|
+
var useStableWatchValue = (value, compare) => {
|
|
30
|
+
const valueRef = useRef(value);
|
|
31
|
+
if (!compare(value, valueRef.current)) valueRef.current = value;
|
|
32
|
+
return valueRef.current;
|
|
33
|
+
};
|
|
34
|
+
function useWatch(source, selectorOrCallback, callbackOrOptions, options) {
|
|
35
|
+
const hasSelector = typeof callbackOrOptions === "function";
|
|
36
|
+
const selector = hasSelector ? selectorOrCallback : null;
|
|
37
|
+
const callback = hasSelector ? callbackOrOptions : selectorOrCallback;
|
|
38
|
+
const watchOptions = hasSelector ? options : callbackOrOptions;
|
|
39
|
+
const stableValue = useStableWatchValue(selector ? selector(source) : source, getCompare(watchOptions?.compare));
|
|
40
|
+
const isInit = useRef(false);
|
|
41
|
+
const valueRef = useRef(stableValue);
|
|
42
|
+
const callbackRef = useRef(callback);
|
|
43
|
+
const optionsRef = useRef(watchOptions);
|
|
44
|
+
callbackRef.current = callback;
|
|
45
|
+
optionsRef.current = watchOptions;
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!isInit.current) {
|
|
48
|
+
isInit.current = true;
|
|
49
|
+
valueRef.current = stableValue;
|
|
50
|
+
if (optionsRef.current?.immediate) return callbackRef.current(stableValue, void 0);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const prevValue = valueRef.current;
|
|
54
|
+
if (Object.is(stableValue, prevValue)) return;
|
|
55
|
+
valueRef.current = stableValue;
|
|
56
|
+
return callbackRef.current(stableValue, prevValue);
|
|
57
|
+
}, [stableValue]);
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { useWatch as default, useWatch, defaultCompare, identityCompare, shallowCompare };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defaultCompare, identityCompare, shallowCompare } from "./useWatch.js";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
//#region packages/react/hooks/useWatch.test.ts
|
|
5
|
+
test("defaultCompare treats inline arrays with the same items as equal", () => {
|
|
6
|
+
assert.equal(defaultCompare([1, "a"], [1, "a"]), true);
|
|
7
|
+
});
|
|
8
|
+
test("defaultCompare detects changed array items", () => {
|
|
9
|
+
assert.equal(defaultCompare([1, "a"], [1, "b"]), false);
|
|
10
|
+
});
|
|
11
|
+
test("defaultCompare uses identity for object values", () => {
|
|
12
|
+
assert.equal(defaultCompare({ current: 1 }, { current: 1 }), false);
|
|
13
|
+
});
|
|
14
|
+
test("identityCompare detects changed array references", () => {
|
|
15
|
+
assert.equal(identityCompare([1, 2], [1, 2]), false);
|
|
16
|
+
});
|
|
17
|
+
test("shallowCompare supports selector array results", () => {
|
|
18
|
+
assert.equal(shallowCompare([1, 10], [1, 10]), true);
|
|
19
|
+
assert.equal(shallowCompare([1, 10], [2, 10]), false);
|
|
20
|
+
});
|
|
21
|
+
test("shallowCompare does not treat non-plain objects as equal by empty keys", () => {
|
|
22
|
+
assert.equal(shallowCompare(/* @__PURE__ */ new Date(0), /* @__PURE__ */ new Date(0)), false);
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region packages/react/ui/assets/table/no-result.svg
|
|
2
|
+
var no_result_default = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='120'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='currentColor'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3crect%20x='3'%20y='3'%20width='18'%20height='18'%20rx='2'%20ry='2'/%3e%3cline%20x1='3'%20y1='9'%20x2='21'%20y2='9'/%3e%3cline%20x1='9'%20y1='21'%20x2='9'%20y2='9'/%3e%3c/svg%3e";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { no_result_default as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
|
|
3
|
+
<line x1="3" y1="9" x2="21" y2="9"/>
|
|
4
|
+
<line x1="9" y1="21" x2="9" y2="9"/>
|
|
5
|
+
</svg>
|