@_tc/template-core 0.1.16 → 0.2.0-bate.0
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 +9 -2
- package/.skills/tc-component-usage-skills/reference/component-api.md +6 -3
- package/.skills/tc-component-usage-skills/reference/patterns.md +3 -3
- package/.skills/tc-component-usage-skills/reference/template-core-frontend.md +3 -1
- package/.skills/tc-generator/SKILL.md +1 -1
- package/.skills/tc-generator/reference/example.md +4 -0
- package/.skills/tc-generator/reference/project-template/config/config.default.js +4 -0
- package/.skills/tc-generator/reference/project-template/model/product/project/default.js +2 -0
- package/.skills/tc-generator/reference/runtime-extensions.md +110 -0
- package/AGENT_README.md +632 -0
- package/README.md +443 -37
- package/cjs/app/controller/project.js +1 -1
- package/cjs/app/controller/view.js +1 -1
- package/cjs/app/extend/crypto.js +1 -0
- package/cjs/app/extend/render-view.js +1 -1
- package/cjs/app/middleware.js +1 -1
- package/cjs/app/middlewares/api-params-verify.js +1 -0
- package/cjs/app/middlewares/api-sign-verify.js +1 -0
- package/cjs/app/{middleware → middlewares}/error-handle.js +1 -1
- 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 -1
- package/cjs/app/view/entry.tpl +19 -0
- package/cjs/bundler/buildBE.js +1 -0
- package/cjs/bundler/defaultRouteGuard.js +1 -0
- package/cjs/bundler/index.js +1 -1
- package/cjs/bundler/utils.js +3 -1
- package/cjs/config/config.default.js +1 -1
- package/cjs/packages/core/env.js +1 -1
- package/cjs/packages/core/index.js +1 -1
- package/cjs/packages/core/loader/middleware.js +1 -1
- package/cjs/packages/core/loader/router.js +1 -1
- 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/app/controller/project.js +7 -2
- package/esm/app/controller/view.js +21 -18
- package/esm/app/extend/crypto.js +31 -0
- package/esm/app/extend/render-view.js +5 -3
- package/esm/app/middleware.js +7 -2
- package/esm/app/{middleware → middlewares}/api-params-verify.js +2 -2
- package/esm/app/{middleware → middlewares}/api-sign-verify.js +2 -2
- package/esm/app/{middleware → middlewares}/error-handle.js +2 -2
- 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 +2 -2
- package/esm/app/view/entry.tpl +19 -0
- package/esm/bundler/buildBE.js +54 -0
- package/esm/bundler/defaultRouteGuard.js +4 -0
- package/esm/bundler/index.js +11 -14
- package/esm/bundler/utils.js +103 -60
- package/esm/config/config.default.js +4 -0
- package/esm/packages/core/env.js +1 -1
- package/esm/packages/core/index.js +37 -33
- package/esm/packages/core/loader/middleware.js +1 -1
- package/esm/packages/core/loader/router.js +5 -2
- 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/frontend/apps/dash/Dashboard.d.ts +0 -1
- package/fe/frontend/apps/dash/Dashboard.js +178 -169
- package/fe/frontend/apps/dash/dash.entry.d.ts +0 -1
- package/fe/frontend/apps/dash/dash.entry.js +58 -78
- package/fe/frontend/apps/dash/types.d.ts +16 -14
- package/fe/frontend/apps/dash/types.js +0 -1
- package/fe/frontend/apps/ui-components/index.d.ts +0 -1
- package/fe/frontend/apps/ui-components/index.js +7 -7
- package/fe/frontend/apps/ui-components/ui-components.entry.d.ts +0 -1
- package/fe/frontend/apps/ui-components/ui-components.entry.js +7 -5
- package/fe/frontend/extended/SchemaForm/data.d.ts +1 -5
- package/fe/frontend/extended/SchemaForm/data.js +7 -7
- package/fe/frontend/src/api/baseInfo.d.ts +1 -2
- package/fe/frontend/src/api/baseInfo.js +12 -13
- package/fe/frontend/src/common/CRUD/CRUD.d.ts +2 -3
- package/fe/frontend/src/common/CRUD/CRUD.js +2 -2
- package/fe/frontend/src/common/CRUD/index.d.ts +1 -2
- package/fe/frontend/src/common/CRUD/index.js +2 -1
- package/fe/frontend/src/common/auth/index.d.ts +6 -2
- package/fe/frontend/src/common/auth/index.js +23 -16
- package/fe/frontend/src/common/fetchErrorShow.d.ts +1 -2
- package/fe/frontend/src/common/fetchErrorShow.js +10 -8
- package/fe/frontend/src/common/generateMenuData.d.ts +2 -3
- package/fe/frontend/src/common/generateMenuData.js +15 -12
- package/fe/frontend/src/common/importComponent.d.ts +1 -2
- package/fe/frontend/src/common/importComponent.js +21 -9
- package/fe/frontend/src/common/language.d.ts +1 -2
- package/fe/frontend/src/common/language.js +11 -10
- package/fe/frontend/src/common/logFn/index.d.ts +0 -1
- package/fe/frontend/src/common/logFn/index.js +11 -8
- package/fe/frontend/src/common/menu.d.ts +1 -14
- package/fe/frontend/src/common/menu.js +94 -98
- package/fe/frontend/src/common/request.d.ts +2 -6
- package/fe/frontend/src/common/request.js +159 -195
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +3 -4
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.js +35 -31
- package/fe/frontend/src/components/AsyncSelect/index.d.ts +2 -3
- package/fe/frontend/src/components/AsyncSelect/index.js +5 -3
- package/fe/frontend/src/components/BasePage/HeaderView.d.ts +1 -2
- package/fe/frontend/src/components/BasePage/HeaderView.js +53 -17
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.d.ts +14 -5
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.js +80 -31
- package/fe/frontend/src/components/LanguageSwitch/index.d.ts +2 -3
- package/fe/frontend/src/components/LanguageSwitch/index.js +5 -3
- package/fe/frontend/src/components/Router/index.d.ts +2 -3
- package/fe/frontend/src/components/Router/index.js +20 -10
- package/fe/frontend/src/components/Router/type.d.ts +0 -1
- package/fe/frontend/src/components/Router/type.js +0 -1
- package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.d.ts +0 -1
- package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.js +83 -55
- package/fe/frontend/src/components/ThemeSwitch/index.d.ts +2 -3
- package/fe/frontend/src/components/ThemeSwitch/index.js +5 -3
- package/fe/frontend/src/components/index.d.ts +10 -11
- package/fe/frontend/src/components/index.js +7 -10
- package/fe/frontend/src/defaultPages/Iframe/index.d.ts +0 -1
- package/fe/frontend/src/defaultPages/Iframe/index.js +14 -7
- package/fe/frontend/src/defaultPages/NotFoundPage/index.d.ts +0 -1
- package/fe/frontend/src/defaultPages/NotFoundPage/index.js +27 -6
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.d.ts +1 -2
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.js +97 -90
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.d.ts +1 -2
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.js +116 -127
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.d.ts +2 -18
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.js +9 -6
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.d.ts +1 -2
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.js +8 -5
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.d.ts +0 -1
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.js +60 -61
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.d.ts +2 -3
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.js +199 -186
- package/fe/frontend/src/defaultPages/SchemaPage/data/eventInfo.d.ts +0 -1
- package/fe/frontend/src/defaultPages/SchemaPage/data/eventInfo.js +8 -5
- package/fe/frontend/src/defaultPages/SchemaPage/data/index.d.ts +0 -1
- package/fe/frontend/src/defaultPages/SchemaPage/data/index.js +4 -1
- package/fe/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.d.ts +1 -2
- package/fe/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.js +16 -13
- package/fe/frontend/src/defaultPages/SchemaPage/index.css +1 -26
- package/fe/frontend/src/defaultPages/SchemaPage/index.d.ts +1 -2
- package/fe/frontend/src/defaultPages/SchemaPage/index.js +89 -76
- package/fe/frontend/src/defaultPages/SchemaPage/schemaType.d.ts +4 -14
- package/fe/frontend/src/defaultPages/SchemaPage/schemaType.js +7 -4
- package/fe/frontend/src/defaultPages/SchemaPage/utils/permissions.d.ts +0 -1
- package/fe/frontend/src/defaultPages/SchemaPage/utils/permissions.js +6 -3
- package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.d.ts +1 -2
- package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.js +63 -112
- package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.d.ts +1 -5
- package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.js +116 -165
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +2 -3
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +54 -37
- package/fe/frontend/src/defaultPages/SidebarSlotPage/index.d.ts +0 -1
- package/fe/frontend/src/defaultPages/SidebarSlotPage/index.js +20 -16
- package/fe/frontend/src/defaultPages/SidebarSlotPageTmp.d.ts +0 -1
- package/fe/frontend/src/defaultPages/SidebarSlotPageTmp.js +20 -16
- package/fe/frontend/src/defaultPages/SlotPage/index.d.ts +0 -1
- package/fe/frontend/src/defaultPages/SlotPage/index.js +21 -26
- package/fe/frontend/src/exportStore.d.ts +4 -17
- package/fe/frontend/src/exportStore.js +5 -16
- package/fe/frontend/src/hooks/useCurrentMenuData.d.ts +1 -10
- package/fe/frontend/src/hooks/useCurrentMenuData.js +28 -26
- package/fe/frontend/src/hooks/useRouterParams.d.ts +0 -1
- package/fe/frontend/src/hooks/useRouterParams.js +15 -10
- package/fe/frontend/src/index.d.ts +13 -21
- package/fe/frontend/src/index.js +20 -18
- package/fe/frontend/src/language/en-US.d.ts +0 -1
- package/fe/frontend/src/language/en-US.js +89 -88
- package/fe/frontend/src/language/index.d.ts +1 -2
- package/fe/frontend/src/language/index.js +77 -74
- package/fe/frontend/src/language/zh-CN.d.ts +0 -1
- package/fe/frontend/src/language/zh-CN.js +89 -88
- package/fe/frontend/src/main.css +1 -1
- package/fe/frontend/src/main.d.ts +13 -20
- package/fe/frontend/src/main.js +75 -70
- package/fe/frontend/src/stores/apiFreezer.d.ts +1 -68
- package/fe/frontend/src/stores/apiFreezer.js +50 -46
- package/fe/frontend/src/stores/mode.d.ts +2 -6
- package/fe/frontend/src/stores/mode.js +35 -36
- package/fe/frontend/src/stores/schemaEventBus.d.ts +1 -21
- package/fe/frontend/src/stores/schemaEventBus.js +52 -69
- package/fe/frontend/src/stores/schemaStore.d.ts +5 -20
- package/fe/frontend/src/stores/schemaStore.js +27 -25
- package/fe/frontend/src/typing/scalability.d.ts +3 -35
- package/fe/frontend/src/typing/scalability.js +0 -1
- package/fe/frontend/src/typing/window.d.ts +0 -1
- package/fe/frontend/src/typing/window.js +0 -1
- package/fe/model/types/data/button.d.ts +2 -12
- package/fe/model/types/data/component.d.ts +4 -14
- package/fe/model/types/data/fetchInfo.d.ts +0 -13
- package/fe/model/types/data/schema.d.ts +6 -58
- package/fe/model/types/data/search.d.ts +1 -2
- package/{model → fe/model}/types/index.d.ts +2 -3
- package/fe/model/types/menuType.d.ts +0 -30
- package/fe/model/types/model.d.ts +1 -15
- package/fe/packages/common/LRUCache.d.ts +1 -0
- package/fe/packages/common/array/index.d.ts +0 -1
- package/fe/packages/common/cache/LRUCache.d.ts +0 -1
- package/fe/packages/common/cache/LRUCache.js +43 -47
- package/fe/packages/common/cache/index.d.ts +0 -1
- package/fe/packages/common/guards/index.d.ts +0 -1
- package/fe/packages/common/guards/index.js +8 -24
- package/fe/packages/common/http/index.d.ts +0 -1
- package/fe/packages/common/http/index.js +272 -282
- package/fe/packages/common/i18n/default.d.ts +0 -6
- package/fe/packages/common/i18n/default.js +91 -88
- package/fe/packages/common/i18n/en-US.d.ts +0 -6
- package/fe/packages/common/i18n/en-US.js +91 -88
- package/fe/packages/common/i18n/index.d.ts +3 -28
- package/fe/packages/common/i18n/index.js +142 -153
- package/fe/packages/common/i18n/locales.d.ts +3 -4
- package/fe/packages/common/i18n/locales.js +10 -9
- package/fe/packages/common/i18n/types.d.ts +0 -25
- package/fe/packages/common/index.d.ts +0 -1
- package/fe/packages/common/log/index.d.ts +0 -1
- package/fe/packages/common/number/index.d.ts +0 -1
- package/fe/packages/common/object/filterEmpty.d.ts +0 -1
- package/fe/packages/common/object/filterEmpty.js +25 -30
- package/fe/packages/common/object/filtereEmpty.d.ts +1 -0
- package/fe/packages/common/object/index.d.ts +0 -1
- package/fe/packages/common/string/index.d.ts +0 -1
- package/fe/packages/common/types/index.d.ts +0 -1
- package/fe/packages/{ui/react → react}/hooks/useBreadcrumb.d.ts +3 -4
- 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/{ui/react → react}/hooks/useInit.d.ts +0 -1
- 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/{ui/react → react}/hooks/usePagination.d.ts +0 -1
- package/fe/packages/react/hooks/usePagination.js +30 -0
- package/fe/packages/{ui/react → react}/hooks/useRefState.d.ts +1 -14
- package/fe/packages/react/hooks/useRefState.js +35 -0
- package/fe/packages/{ui/react → react}/hooks/useWatch.d.ts +0 -9
- 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/{ui/react → react/ui}/components/Button/Button.d.ts +1 -35
- package/fe/packages/react/ui/components/Button/Button.js +88 -0
- package/fe/packages/{ui/react → react/ui}/components/Button/SubmitButton.d.ts +2 -7
- 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/{ui/react → react/ui}/components/Card/Card.d.ts +1 -6
- 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/{ui/react → react/ui}/components/Checkbox/Checkbox.d.ts +1 -2
- 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/{ui/react → react/ui}/components/ConfirmDialog/ConfirmDialog.d.ts +0 -9
- 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/{ui/react → react/ui}/components/DataTable/ActionBtn.d.ts +1 -2
- package/fe/packages/react/ui/components/DataTable/ActionBtn.js +116 -0
- package/fe/packages/{ui/react → react/ui}/components/DataTable/index.d.ts +8 -28
- package/fe/packages/react/ui/components/DataTable/index.js +235 -0
- package/fe/packages/{ui/react → react/ui}/components/Date/Calendar.d.ts +2 -16
- package/fe/packages/react/ui/components/Date/Calendar.js +351 -0
- package/fe/packages/{ui/react → react/ui}/components/Date/Date.d.ts +0 -12
- package/fe/packages/react/ui/components/Date/Date.js +210 -0
- package/fe/packages/{ui/react → react/ui}/components/Date/DateTestPage.d.ts +0 -1
- 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/{ui/react → react/ui}/components/Date/TimePicker.d.ts +0 -1
- package/fe/packages/react/ui/components/Date/TimePicker.js +136 -0
- package/fe/packages/{ui/react → react/ui}/components/Date/data.d.ts +0 -1
- package/fe/packages/react/ui/components/Date/data.js +7 -0
- package/fe/packages/{ui/react → react/ui}/components/Date/dateLocaleStore.d.ts +1 -8
- 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/{ui/react → react/ui}/components/Date/locales.d.ts +0 -20
- package/fe/packages/react/ui/components/Date/locales.js +25 -0
- package/fe/packages/{ui/react → react/ui}/components/Drawer/Drawer.d.ts +1 -8
- 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/{ui/react → react/ui}/components/Dropdown/Dropdown.d.ts +2 -4
- 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/{ui/react → react/ui}/components/Form/Form.d.ts +2 -9
- package/fe/packages/react/ui/components/Form/Form.js +15 -0
- package/fe/packages/{ui/react → react/ui}/components/Form/FormItem.d.ts +3 -25
- package/fe/packages/react/ui/components/Form/FormItem.js +60 -0
- package/fe/packages/{ui/react → react/ui}/components/Form/SchemaForm/data.d.ts +8 -9
- 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/{ui/react → react/ui}/components/Form/SchemaForm/index.d.ts +9 -103
- 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/{ui/react → react/ui}/components/ImagePreview/ImagePreview.d.ts +0 -1
- package/fe/packages/react/ui/components/ImagePreview/ImagePreview.js +307 -0
- package/fe/packages/{ui/react → react/ui}/components/ImagePreview/PreviewImage.d.ts +2 -6
- 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/{ui/react → react/ui}/components/Input/Input.d.ts +1 -24
- 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/{ui/react → react/ui}/components/InputNumber/InputNumber.d.ts +2 -5
- 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/{ui/react → react/ui}/components/InputNumber/inputNumberUtils.d.ts +0 -1
- 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/{ui/react → react/ui}/components/Label/Label.d.ts +1 -31
- 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/{ui/react → react/ui}/components/Layout/Layout.d.ts +1 -2
- 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/{ui/react → react/ui}/components/Loading/Loading.d.ts +1 -13
- 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/{ui/react → react/ui}/components/Menu/Menu.d.ts +0 -1
- package/fe/packages/react/ui/components/Menu/Menu.js +147 -0
- package/fe/packages/{ui/react → react/ui}/components/Menu/MenuContext.d.ts +0 -1
- package/fe/packages/react/ui/components/Menu/MenuContext.js +88 -0
- package/fe/packages/{ui/react → react/ui}/components/Menu/MenuItem.d.ts +0 -1
- 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/{ui/react → react/ui}/components/Menu/menuTypes.d.ts +1 -3
- package/fe/packages/react/ui/components/Menu/menuTypes.js +0 -0
- package/fe/packages/{ui/react → react/ui}/components/Menu/utils.d.ts +0 -1
- package/fe/packages/react/ui/components/Menu/utils.js +8 -0
- package/fe/packages/{ui/react → react/ui}/components/Message/Message.d.ts +1 -9
- package/fe/packages/react/ui/components/Message/Message.js +76 -0
- package/fe/packages/{ui/react → react/ui}/components/Message/MessageManager.d.ts +2 -3
- package/fe/packages/react/ui/components/Message/MessageManager.js +104 -0
- package/fe/packages/{ui/react → react/ui}/components/Message/data.d.ts +0 -1
- 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/{ui/react → react/ui}/components/Modal/Modal.d.ts +1 -8
- package/fe/packages/react/ui/components/Modal/Modal.js +59 -0
- package/fe/packages/{ui/react → react/ui}/components/Modal/ModalManager.d.ts +3 -16
- 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/{ui/react → react/ui}/components/Notification/Notification.d.ts +1 -2
- 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/{ui/react → react/ui}/components/Overlay/Overlay.d.ts +1 -5
- 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/{ui/react → react/ui}/components/Pagination/Pagination.d.ts +0 -8
- 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/{ui/react → react/ui}/components/Popup/Popup.d.ts +0 -1
- 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/{ui/react → react/ui}/components/Radio/Radio.d.ts +1 -2
- package/fe/packages/react/ui/components/Radio/Radio.js +36 -0
- package/fe/packages/{ui/react → react/ui}/components/Radio/RadioGroup.d.ts +1 -2
- 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/{ui/react → react/ui}/components/Search/Search.d.ts +4 -8
- 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/{ui/react → react/ui}/components/Select/Select.d.ts +2 -7
- 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/{ui/react → react/ui}/components/Switch/Switch.d.ts +1 -2
- 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/{ui/react → react/ui}/components/TableSearch/lang.d.ts +0 -1
- package/fe/packages/react/ui/components/TableSearch/lang.js +14 -0
- package/fe/packages/{ui/react → react/ui}/components/TableSearch/tableSearchLocaleStore.d.ts +1 -2
- package/fe/packages/react/ui/components/TableSearch/tableSearchLocaleStore.js +10 -0
- package/fe/packages/{ui/react → react/ui}/components/Tabs/Tabs.d.ts +1 -2
- 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/{ui/react → react/ui}/components/Textarea/Textarea.d.ts +0 -47
- 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/{ui/react → react/ui}/components/Tooltip/Tooltip.d.ts +0 -17
- 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/{ui/react → react/ui}/components/TreeSelect/TreeSelect.d.ts +0 -7
- 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/{ui/react → react/ui}/components/Upload/ImageUpload.d.ts +0 -1
- 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/{ui/react → react/ui}/components/breadcrumb/breadcrumb.d.ts +0 -1
- 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/{ui/react → react/ui}/components/hooks/useDropdownPositioning.d.ts +0 -7
- package/fe/packages/react/ui/components/hooks/useDropdownPositioning.js +121 -0
- package/fe/packages/{ui/react → react/ui}/components/hooks/useInputController.d.ts +0 -4
- 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/{ui/react → react/ui}/components/table/table.d.ts +1 -2
- package/fe/packages/react/ui/components/table/table.js +166 -0
- package/fe/packages/{ui/react → react/ui}/components/testPage/MenuTestPage.d.ts +0 -1
- package/fe/packages/react/ui/components/testPage/MenuTestPage.js +397 -0
- package/fe/packages/{ui/react → react/ui}/components/testPage/index.d.ts +0 -1
- 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.d.ts +4 -0
- package/fe/packages/react/ui/index.js +58 -0
- package/fe/packages/{ui/react → react/ui}/lib/createStoreHook.d.ts +1 -2
- 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/{ui/react → react/ui}/stores/breadcrumb.d.ts +1 -2
- 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/{ui/react → react/ui}/types/index.d.ts +0 -1
- package/fe/packages/react/ui/types/index.js +0 -0
- package/fe/typings/type.d.ts +0 -1
- 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/{index.d.ts → model/index.d.ts} +1 -2
- package/model/{types → model/types}/data/button.d.ts +2 -12
- package/model/{types → model/types}/data/component.d.ts +4 -14
- package/model/model/types/data/fetchInfo.d.ts +7 -0
- package/model/model/types/data/schema.d.ts +46 -0
- package/model/{types → model/types}/data/search.d.ts +1 -2
- package/model/model/types/index.d.ts +2 -0
- package/model/{types → model/types}/menuType.d.ts +0 -30
- package/model/{types → model/types}/model.d.ts +1 -15
- package/model/packages/common/array/index.d.ts +6 -0
- package/model/packages/common/cache/LRUCache.d.ts +12 -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/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 +24 -9
- package/types/app/controller/view.d.ts +2 -1
- package/types/app/extend/crypto.d.ts +64 -0
- package/types/app/extend/render-view.d.ts +2 -1
- 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 +1 -1
- package/types/app/type.d.ts +30 -1
- package/types/app/typings.d.ts +3 -0
- package/types/bundler/buildBE.d.ts +13 -0
- package/types/bundler/defaultRouteGuard.d.ts +2 -0
- package/types/bundler/index.d.ts +3 -1
- package/types/config/config.default.d.ts +27 -1
- package/types/index.d.ts +2 -1
- package/types/packages/core/loader/config.d.ts +1 -1
- package/types/packages/core/loader/middleware.d.ts +1 -1
- package/types/packages/core/types.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/cjs/app/middleware/api-params-verify.js +0 -1
- package/cjs/app/middleware/api-sign-verify.js +0 -1
- package/cjs/app/middleware/project-handler.js +0 -1
- package/esm/app/middleware/project-handler.js +0 -15
- package/fe/model/types/data/button.js +0 -16
- package/fe/model/types/data/component.js +0 -11
- package/fe/model/types/data/schema.js +0 -1
- package/fe/model/types/data/search.js +0 -1
- package/fe/model/types/menuType.js +0 -1
- package/fe/model/types/model.js +0 -1
- package/fe/packages/common/array/index.js +0 -40
- package/fe/packages/common/i18n/types.js +0 -1
- package/fe/packages/common/log/index.js +0 -176
- package/fe/packages/common/number/index.js +0 -10
- package/fe/packages/common/object/index.js +0 -25
- package/fe/packages/common/string/index.js +0 -17
- package/fe/packages/common/types/index.js +0 -1
- package/fe/packages/ui/react/components/Button/Button.js +0 -73
- package/fe/packages/ui/react/components/Button/SubmitButton.js +0 -25
- package/fe/packages/ui/react/components/Button/index.d.ts +0 -4
- package/fe/packages/ui/react/components/Button/index.js +0 -2
- package/fe/packages/ui/react/components/Card/Card.js +0 -12
- package/fe/packages/ui/react/components/Card/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Card/index.js +0 -1
- package/fe/packages/ui/react/components/Checkbox/Checkbox.js +0 -39
- package/fe/packages/ui/react/components/Checkbox/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Checkbox/index.js +0 -1
- package/fe/packages/ui/react/components/ConfirmDialog/ConfirmDialog.js +0 -11
- package/fe/packages/ui/react/components/ConfirmDialog/index.d.ts +0 -2
- package/fe/packages/ui/react/components/ConfirmDialog/index.js +0 -1
- package/fe/packages/ui/react/components/DataTable/ActionBtn.js +0 -96
- package/fe/packages/ui/react/components/DataTable/index.js +0 -191
- package/fe/packages/ui/react/components/Date/Calendar.js +0 -216
- package/fe/packages/ui/react/components/Date/Date.js +0 -201
- package/fe/packages/ui/react/components/Date/DateTestPage.js +0 -29
- package/fe/packages/ui/react/components/Date/LocaleContext.d.ts +0 -6
- package/fe/packages/ui/react/components/Date/LocaleContext.js +0 -8
- package/fe/packages/ui/react/components/Date/LocaleProvider.d.ts +0 -19
- package/fe/packages/ui/react/components/Date/LocaleProvider.js +0 -24
- package/fe/packages/ui/react/components/Date/TimePicker.js +0 -78
- package/fe/packages/ui/react/components/Date/data.js +0 -4
- package/fe/packages/ui/react/components/Date/dateLocaleStore.js +0 -14
- package/fe/packages/ui/react/components/Date/dropdownPositioning.d.ts +0 -3
- package/fe/packages/ui/react/components/Date/dropdownPositioning.js +0 -12
- package/fe/packages/ui/react/components/Date/index.d.ts +0 -6
- package/fe/packages/ui/react/components/Date/index.js +0 -5
- package/fe/packages/ui/react/components/Date/locales.js +0 -21
- package/fe/packages/ui/react/components/Drawer/Drawer.js +0 -109
- package/fe/packages/ui/react/components/Drawer/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Drawer/index.js +0 -1
- package/fe/packages/ui/react/components/Dropdown/Dropdown.js +0 -89
- package/fe/packages/ui/react/components/Dropdown/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Dropdown/index.js +0 -1
- package/fe/packages/ui/react/components/Form/Form.js +0 -8
- package/fe/packages/ui/react/components/Form/FormItem.js +0 -43
- package/fe/packages/ui/react/components/Form/SchemaForm/data.js +0 -18
- package/fe/packages/ui/react/components/Form/SchemaForm/index.js +0 -79
- package/fe/packages/ui/react/components/Form/index.d.ts +0 -5
- package/fe/packages/ui/react/components/Form/index.js +0 -4
- package/fe/packages/ui/react/components/Form/useForm.d.ts +0 -3
- package/fe/packages/ui/react/components/Form/useForm.js +0 -1
- package/fe/packages/ui/react/components/ImagePreview/ImagePreview.js +0 -171
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.js +0 -28
- package/fe/packages/ui/react/components/ImagePreview/index.d.ts +0 -3
- package/fe/packages/ui/react/components/ImagePreview/index.js +0 -2
- package/fe/packages/ui/react/components/Input/Input.js +0 -61
- package/fe/packages/ui/react/components/Input/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Input/index.js +0 -1
- package/fe/packages/ui/react/components/InputNumber/InputNumber.js +0 -144
- package/fe/packages/ui/react/components/InputNumber/index.d.ts +0 -2
- package/fe/packages/ui/react/components/InputNumber/index.js +0 -1
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.js +0 -63
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.d.ts +0 -2
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.js +0 -27
- package/fe/packages/ui/react/components/Label/Label.js +0 -35
- package/fe/packages/ui/react/components/Label/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Label/index.js +0 -2
- package/fe/packages/ui/react/components/Layout/Layout.js +0 -8
- package/fe/packages/ui/react/components/Layout/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Layout/index.js +0 -1
- package/fe/packages/ui/react/components/Loading/Loading.js +0 -21
- package/fe/packages/ui/react/components/Loading/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Loading/index.js +0 -1
- package/fe/packages/ui/react/components/Menu/Menu.js +0 -110
- package/fe/packages/ui/react/components/Menu/MenuContext.js +0 -97
- package/fe/packages/ui/react/components/Menu/MenuItem.js +0 -33
- package/fe/packages/ui/react/components/Menu/SubMenu.d.ts +0 -10
- package/fe/packages/ui/react/components/Menu/SubMenu.js +0 -169
- package/fe/packages/ui/react/components/Menu/index.d.ts +0 -9
- package/fe/packages/ui/react/components/Menu/index.js +0 -5
- package/fe/packages/ui/react/components/Menu/menuTypes.js +0 -1
- package/fe/packages/ui/react/components/Menu/utils.js +0 -7
- package/fe/packages/ui/react/components/Message/Message.js +0 -58
- package/fe/packages/ui/react/components/Message/MessageManager.js +0 -90
- package/fe/packages/ui/react/components/Message/data.js +0 -1
- package/fe/packages/ui/react/components/Message/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Message/index.js +0 -1
- package/fe/packages/ui/react/components/Modal/Modal.js +0 -14
- package/fe/packages/ui/react/components/Modal/ModalManager.js +0 -90
- package/fe/packages/ui/react/components/Modal/index.d.ts +0 -4
- package/fe/packages/ui/react/components/Modal/index.js +0 -2
- package/fe/packages/ui/react/components/Notification/Notification.js +0 -29
- package/fe/packages/ui/react/components/Notification/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Notification/index.js +0 -1
- package/fe/packages/ui/react/components/Overlay/Overlay.js +0 -53
- package/fe/packages/ui/react/components/Overlay/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Overlay/index.js +0 -1
- package/fe/packages/ui/react/components/Pagination/Pagination.js +0 -96
- package/fe/packages/ui/react/components/Pagination/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Pagination/index.js +0 -1
- package/fe/packages/ui/react/components/Popup/Popup.js +0 -81
- package/fe/packages/ui/react/components/Popup/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Popup/index.js +0 -1
- package/fe/packages/ui/react/components/Radio/Radio.js +0 -20
- package/fe/packages/ui/react/components/Radio/RadioGroup.js +0 -21
- package/fe/packages/ui/react/components/Radio/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Radio/index.js +0 -2
- package/fe/packages/ui/react/components/Search/Search.js +0 -8
- package/fe/packages/ui/react/components/Search/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Search/index.js +0 -1
- package/fe/packages/ui/react/components/Select/Select.js +0 -220
- package/fe/packages/ui/react/components/Select/dropdownPositioning.d.ts +0 -3
- package/fe/packages/ui/react/components/Select/dropdownPositioning.js +0 -13
- package/fe/packages/ui/react/components/Select/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Select/index.js +0 -1
- package/fe/packages/ui/react/components/Skeleton/Skeleton.d.ts +0 -28
- package/fe/packages/ui/react/components/Skeleton/Skeleton.js +0 -31
- package/fe/packages/ui/react/components/Skeleton/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Skeleton/index.js +0 -1
- package/fe/packages/ui/react/components/Switch/Switch.js +0 -22
- package/fe/packages/ui/react/components/Switch/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Switch/index.js +0 -1
- package/fe/packages/ui/react/components/TableSearch/TableSearch.d.ts +0 -68
- package/fe/packages/ui/react/components/TableSearch/TableSearch.js +0 -121
- package/fe/packages/ui/react/components/TableSearch/index.d.ts +0 -3
- package/fe/packages/ui/react/components/TableSearch/index.js +0 -1
- package/fe/packages/ui/react/components/TableSearch/lang.js +0 -14
- package/fe/packages/ui/react/components/TableSearch/tableSearchLocaleStore.js +0 -11
- package/fe/packages/ui/react/components/Tabs/Tabs.js +0 -19
- package/fe/packages/ui/react/components/Tabs/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Tabs/index.js +0 -1
- package/fe/packages/ui/react/components/Textarea/Textarea.js +0 -37
- package/fe/packages/ui/react/components/Textarea/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Textarea/index.js +0 -1
- package/fe/packages/ui/react/components/Tooltip/Tooltip.js +0 -79
- package/fe/packages/ui/react/components/Tooltip/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Tooltip/index.js +0 -1
- package/fe/packages/ui/react/components/TreeSelect/TreeSelect.js +0 -160
- package/fe/packages/ui/react/components/TreeSelect/index.d.ts +0 -2
- package/fe/packages/ui/react/components/TreeSelect/index.js +0 -1
- package/fe/packages/ui/react/components/Upload/ImageUpload.js +0 -75
- package/fe/packages/ui/react/components/Upload/Upload.d.ts +0 -41
- package/fe/packages/ui/react/components/Upload/Upload.js +0 -7
- package/fe/packages/ui/react/components/Upload/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Upload/index.js +0 -2
- package/fe/packages/ui/react/components/breadcrumb/breadcrumb.js +0 -81
- package/fe/packages/ui/react/components/breadcrumb/index.d.ts +0 -2
- package/fe/packages/ui/react/components/breadcrumb/index.js +0 -1
- package/fe/packages/ui/react/components/hooks/useDropdownPositioning.js +0 -137
- package/fe/packages/ui/react/components/hooks/useInputController.js +0 -44
- package/fe/packages/ui/react/components/index.d.ts +0 -36
- package/fe/packages/ui/react/components/index.js +0 -35
- package/fe/packages/ui/react/components/table/index.d.ts +0 -2
- package/fe/packages/ui/react/components/table/index.js +0 -1
- package/fe/packages/ui/react/components/table/table.js +0 -116
- package/fe/packages/ui/react/components/testPage/MenuTestPage.js +0 -104
- package/fe/packages/ui/react/components/testPage/index.js +0 -475
- package/fe/packages/ui/react/hooks/useBreadcrumb.js +0 -2
- package/fe/packages/ui/react/hooks/useExecuteOnce.d.ts +0 -30
- package/fe/packages/ui/react/hooks/useExecuteOnce.js +0 -57
- package/fe/packages/ui/react/hooks/useInit.js +0 -9
- package/fe/packages/ui/react/hooks/useLanguage.d.ts +0 -2
- package/fe/packages/ui/react/hooks/useLanguage.js +0 -4
- package/fe/packages/ui/react/hooks/usePagination.js +0 -27
- package/fe/packages/ui/react/hooks/useRefState.js +0 -29
- package/fe/packages/ui/react/hooks/useWatch.js +0 -87
- package/fe/packages/ui/react/hooks/useWatch.test.d.ts +0 -2
- package/fe/packages/ui/react/hooks/useWatch.test.js +0 -22
- package/fe/packages/ui/react/i18n/I18nProvider.d.ts +0 -31
- package/fe/packages/ui/react/i18n/I18nProvider.js +0 -25
- package/fe/packages/ui/react/i18n/index.d.ts +0 -4
- package/fe/packages/ui/react/i18n/index.js +0 -3
- package/fe/packages/ui/react/i18n/useI18n.d.ts +0 -13
- package/fe/packages/ui/react/i18n/useI18n.js +0 -18
- package/fe/packages/ui/react/index.d.ts +0 -5
- package/fe/packages/ui/react/index.js +0 -6
- package/fe/packages/ui/react/lib/createStoreHook.js +0 -6
- package/fe/packages/ui/react/lib/export.d.ts +0 -66
- package/fe/packages/ui/react/lib/export.js +0 -138
- package/fe/packages/ui/react/lib/utils.d.ts +0 -34
- package/fe/packages/ui/react/lib/utils.js +0 -70
- package/fe/packages/ui/react/stores/breadcrumb.js +0 -66
- package/fe/packages/ui/react/stores/language.d.ts +0 -4
- package/fe/packages/ui/react/stores/language.js +0 -2
- package/fe/packages/ui/react/types/index.js +0 -1
- package/fe/typings/type.js +0 -1
- package/model/test.d.ts +0 -2
- package/model/types/data/fetchInfo.d.ts +0 -20
- package/model/types/data/schema.d.ts +0 -98
- package/types/app/middleware/project-handler.d.ts +0 -4
- /package/fe/packages/{ui/react → react/ui}/assets/table/no-result.svg +0 -0
- /package/fe/packages/{ui/react → react/ui}/index.css +0 -0
- /package/{fe/model/types/data/fetchInfo.js → model/model/test.d.ts} +0 -0
- /package/{fe/packages/common/cache/index.js → model/packages/common/cache/index.d.ts} +0 -0
- /package/{fe/packages/common/index.js → model/packages/common/index.d.ts} +0 -0
- /package/types/app/{middleware → middlewares}/api-params-verify.d.ts +0 -0
- /package/types/app/{middleware → middlewares}/api-sign-verify.d.ts +0 -0
- /package/types/app/{middleware → middlewares}/error-handle.d.ts +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useCallback, useRef, useState } from 'react';
|
|
2
|
-
import useInit from './useInit';
|
|
3
|
-
export default function usePagination(params) {
|
|
4
|
-
const initValue = {
|
|
5
|
-
...(params?.defaultValue ?? { current: 1, size: 10, total: 0 }),
|
|
6
|
-
onChange: () => { },
|
|
7
|
-
};
|
|
8
|
-
const paginationData = useRef({ ...initValue });
|
|
9
|
-
const [, changeView] = useState(0);
|
|
10
|
-
const updata = useCallback((params) => {
|
|
11
|
-
if (typeof params.current !== 'undefined') {
|
|
12
|
-
paginationData.current.current = params.current;
|
|
13
|
-
}
|
|
14
|
-
if (typeof params.size !== 'undefined') {
|
|
15
|
-
paginationData.current.size = params.size;
|
|
16
|
-
}
|
|
17
|
-
if (typeof params.total !== 'undefined') {
|
|
18
|
-
paginationData.current.total = params.total;
|
|
19
|
-
}
|
|
20
|
-
if ([params.size, params.current, params.total].some((i) => typeof i !== 'undefined'))
|
|
21
|
-
changeView((e) => e + 1);
|
|
22
|
-
}, []);
|
|
23
|
-
useInit(() => {
|
|
24
|
-
paginationData.current.onChange = updata;
|
|
25
|
-
});
|
|
26
|
-
return paginationData;
|
|
27
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useState as RUS, useCallback, useLayoutEffect, useRef } from 'react';
|
|
2
|
-
import useInit from './useInit';
|
|
3
|
-
export default function useRefState(initialState) {
|
|
4
|
-
const [v, setValue] = RUS(initialState);
|
|
5
|
-
const data = useRef({ data: undefined });
|
|
6
|
-
const callbackRef = useRef(null);
|
|
7
|
-
const [callbackVersion, setCallbackVersion] = RUS(0);
|
|
8
|
-
useInit(() => {
|
|
9
|
-
data.current.data = v;
|
|
10
|
-
});
|
|
11
|
-
const setData = useCallback((action, callback) => {
|
|
12
|
-
const value = typeof action === 'function' ? action(data.current.data) : action;
|
|
13
|
-
setValue(value);
|
|
14
|
-
data.current.data = value;
|
|
15
|
-
if (callback) {
|
|
16
|
-
callbackRef.current = callback;
|
|
17
|
-
setCallbackVersion((version) => version + 1);
|
|
18
|
-
}
|
|
19
|
-
}, [setCallbackVersion, setValue]);
|
|
20
|
-
useLayoutEffect(() => {
|
|
21
|
-
if (callbackRef.current) {
|
|
22
|
-
const callback = callbackRef.current;
|
|
23
|
-
callbackRef.current = null;
|
|
24
|
-
callback(data.current.data);
|
|
25
|
-
}
|
|
26
|
-
}, [callbackVersion]);
|
|
27
|
-
return [v, setData, data];
|
|
28
|
-
// as [ExtractFNType<S>, SetState<S>];
|
|
29
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
-
export const identityCompare = (value, prevValue) => Object.is(value, prevValue);
|
|
3
|
-
export const shallowCompare = (value, prevValue) => {
|
|
4
|
-
if (Object.is(value, prevValue)) {
|
|
5
|
-
return true;
|
|
6
|
-
}
|
|
7
|
-
if (Array.isArray(value) && Array.isArray(prevValue)) {
|
|
8
|
-
if (value.length !== prevValue.length) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
return value.every((item, index) => Object.is(item, prevValue[index]));
|
|
12
|
-
}
|
|
13
|
-
if (value &&
|
|
14
|
-
prevValue &&
|
|
15
|
-
typeof value === 'object' &&
|
|
16
|
-
typeof prevValue === 'object') {
|
|
17
|
-
const valuePrototype = Object.getPrototypeOf(value);
|
|
18
|
-
const prevValuePrototype = Object.getPrototypeOf(prevValue);
|
|
19
|
-
if (valuePrototype !== prevValuePrototype ||
|
|
20
|
-
(valuePrototype !== Object.prototype && valuePrototype !== null)) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
const valueKeys = Object.keys(value);
|
|
24
|
-
const prevValueKeys = Object.keys(prevValue);
|
|
25
|
-
if (valueKeys.length !== prevValueKeys.length) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
return valueKeys.every((key) => Object.prototype.hasOwnProperty.call(prevValue, key) &&
|
|
29
|
-
Object.is(value[key], prevValue[key]));
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
};
|
|
33
|
-
export const defaultCompare = (value, prevValue) => {
|
|
34
|
-
if (Array.isArray(value) && Array.isArray(prevValue)) {
|
|
35
|
-
return shallowCompare(value, prevValue);
|
|
36
|
-
}
|
|
37
|
-
return identityCompare(value, prevValue);
|
|
38
|
-
};
|
|
39
|
-
const getCompare = (compare) => {
|
|
40
|
-
if (compare === 'identity') {
|
|
41
|
-
return identityCompare;
|
|
42
|
-
}
|
|
43
|
-
if (compare === 'shallow') {
|
|
44
|
-
return shallowCompare;
|
|
45
|
-
}
|
|
46
|
-
return compare ?? defaultCompare;
|
|
47
|
-
};
|
|
48
|
-
const useStableWatchValue = (value, compare) => {
|
|
49
|
-
const valueRef = useRef(value);
|
|
50
|
-
if (!compare(value, valueRef.current)) {
|
|
51
|
-
valueRef.current = value;
|
|
52
|
-
}
|
|
53
|
-
return valueRef.current;
|
|
54
|
-
};
|
|
55
|
-
export function useWatch(source, selectorOrCallback, callbackOrOptions, options) {
|
|
56
|
-
const hasSelector = typeof callbackOrOptions === 'function';
|
|
57
|
-
const selector = hasSelector ? selectorOrCallback : null;
|
|
58
|
-
const callback = hasSelector
|
|
59
|
-
? callbackOrOptions
|
|
60
|
-
: selectorOrCallback;
|
|
61
|
-
const watchOptions = hasSelector ? options : callbackOrOptions;
|
|
62
|
-
const nextValue = selector ? selector(source) : source;
|
|
63
|
-
const stableValue = useStableWatchValue(nextValue, getCompare(watchOptions?.compare));
|
|
64
|
-
const isInit = useRef(false);
|
|
65
|
-
const valueRef = useRef(stableValue);
|
|
66
|
-
const callbackRef = useRef(callback);
|
|
67
|
-
const optionsRef = useRef(watchOptions);
|
|
68
|
-
callbackRef.current = callback;
|
|
69
|
-
optionsRef.current = watchOptions;
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
if (!isInit.current) {
|
|
72
|
-
isInit.current = true;
|
|
73
|
-
valueRef.current = stableValue;
|
|
74
|
-
if (optionsRef.current?.immediate) {
|
|
75
|
-
return callbackRef.current(stableValue, undefined);
|
|
76
|
-
}
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const prevValue = valueRef.current;
|
|
80
|
-
if (Object.is(stableValue, prevValue)) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
valueRef.current = stableValue;
|
|
84
|
-
return callbackRef.current(stableValue, prevValue);
|
|
85
|
-
}, [stableValue]);
|
|
86
|
-
}
|
|
87
|
-
export default useWatch;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { defaultCompare, identityCompare, shallowCompare } from './useWatch';
|
|
4
|
-
test('defaultCompare treats inline arrays with the same items as equal', () => {
|
|
5
|
-
assert.equal(defaultCompare([1, 'a'], [1, 'a']), true);
|
|
6
|
-
});
|
|
7
|
-
test('defaultCompare detects changed array items', () => {
|
|
8
|
-
assert.equal(defaultCompare([1, 'a'], [1, 'b']), false);
|
|
9
|
-
});
|
|
10
|
-
test('defaultCompare uses identity for object values', () => {
|
|
11
|
-
assert.equal(defaultCompare({ current: 1 }, { current: 1 }), false);
|
|
12
|
-
});
|
|
13
|
-
test('identityCompare detects changed array references', () => {
|
|
14
|
-
assert.equal(identityCompare([1, 2], [1, 2]), false);
|
|
15
|
-
});
|
|
16
|
-
test('shallowCompare supports selector array results', () => {
|
|
17
|
-
assert.equal(shallowCompare([1, 10], [1, 10]), true);
|
|
18
|
-
assert.equal(shallowCompare([1, 10], [2, 10]), false);
|
|
19
|
-
});
|
|
20
|
-
test('shallowCompare does not treat non-plain objects as equal by empty keys', () => {
|
|
21
|
-
assert.equal(shallowCompare(new Date(0), new Date(0)), false);
|
|
22
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { I18nLanguage, I18nResources } from '../../../common/i18n';
|
|
2
|
-
import { type ReactNode } from 'react';
|
|
3
|
-
export interface I18nProviderProps {
|
|
4
|
-
/**
|
|
5
|
-
* 外部控制的显示语言。
|
|
6
|
-
*/
|
|
7
|
-
language?: I18nLanguage;
|
|
8
|
-
/**
|
|
9
|
-
* 未命中当前语言文案时的兜底语言。
|
|
10
|
-
*/
|
|
11
|
-
fallbackLanguage?: I18nLanguage;
|
|
12
|
-
/**
|
|
13
|
-
* 业务侧注入的多语言资源。
|
|
14
|
-
*/
|
|
15
|
-
resources?: I18nResources;
|
|
16
|
-
/**
|
|
17
|
-
* 是否把传入 resources 和现有 resources 合并。默认 true。
|
|
18
|
-
*/
|
|
19
|
-
mergeResources?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* 是否把 language 写入 localStorage。默认 true。
|
|
22
|
-
*/
|
|
23
|
-
persist?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* localStorage key。
|
|
26
|
-
*/
|
|
27
|
-
storageKey?: string;
|
|
28
|
-
children: ReactNode;
|
|
29
|
-
}
|
|
30
|
-
export declare function I18nProvider({ language, fallbackLanguage, resources, mergeResources, persist, storageKey, children, }: I18nProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
//# sourceMappingURL=I18nProvider.d.ts.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { defaultLanguage, languageLocalKey } from '../../../common/i18n';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import { useI18nStore } from './useI18n';
|
|
5
|
-
export function I18nProvider({ language = defaultLanguage, fallbackLanguage = defaultLanguage, resources, mergeResources = true, persist = true, storageKey = languageLocalKey, children, }) {
|
|
6
|
-
const configureI18n = useI18nStore((state) => state.configureI18n);
|
|
7
|
-
const setLanguage = useI18nStore((state) => state.setLanguage);
|
|
8
|
-
const setFallbackLanguage = useI18nStore((state) => state.setFallbackLanguage);
|
|
9
|
-
const setResources = useI18nStore((state) => state.setResources);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
configureI18n({ persist, storageKey });
|
|
12
|
-
}, [configureI18n, persist, storageKey]);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
setLanguage(language);
|
|
15
|
-
}, [language, setLanguage]);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
setFallbackLanguage(fallbackLanguage);
|
|
18
|
-
}, [fallbackLanguage, setFallbackLanguage]);
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (!resources)
|
|
21
|
-
return;
|
|
22
|
-
setResources(resources, { merge: mergeResources });
|
|
23
|
-
}, [mergeResources, resources, setResources]);
|
|
24
|
-
return _jsx(_Fragment, { children: children });
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { I18nInterpolationValues, I18nTranslateOptions } from '../../../common/i18n';
|
|
2
|
-
export declare const useI18nStore: import("..").StoreHook<{
|
|
3
|
-
getState: () => import("..").I18nStore;
|
|
4
|
-
getInitialState: () => import("..").I18nStore;
|
|
5
|
-
setState: (partial: Partial<import("..").I18nStore> | ((state: import("..").I18nStore) => Partial<import("..").I18nStore>)) => void;
|
|
6
|
-
subscribe: (listener: import("..").I18nStoreListener) => () => void;
|
|
7
|
-
}>;
|
|
8
|
-
/**
|
|
9
|
-
* React 组件内使用的翻译 hook。
|
|
10
|
-
* 会订阅 language、fallbackLanguage、resources,语言或资源变化时触发组件更新。
|
|
11
|
-
*/
|
|
12
|
-
export declare function useI18n(): <T = string>(key: string, fillingData?: I18nInterpolationValues, options?: I18nTranslateOptions) => string | T;
|
|
13
|
-
//# sourceMappingURL=useI18n.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { i18nStore, translate } from '../../../common/i18n';
|
|
2
|
-
import { useCallback } from 'react';
|
|
3
|
-
import { createStoreHook } from '../lib/createStoreHook';
|
|
4
|
-
export const useI18nStore = createStoreHook(i18nStore);
|
|
5
|
-
/**
|
|
6
|
-
* React 组件内使用的翻译 hook。
|
|
7
|
-
* 会订阅 language、fallbackLanguage、resources,语言或资源变化时触发组件更新。
|
|
8
|
-
*/
|
|
9
|
-
export function useI18n() {
|
|
10
|
-
const language = useI18nStore((state) => state.language);
|
|
11
|
-
const fallbackLanguage = useI18nStore((state) => state.fallbackLanguage);
|
|
12
|
-
const resources = useI18nStore((state) => state.resources);
|
|
13
|
-
return useCallback((key, fillingData, options) => translate({
|
|
14
|
-
language,
|
|
15
|
-
fallbackLanguage,
|
|
16
|
-
resources,
|
|
17
|
-
}, key, fillingData, options), [fallbackLanguage, language, resources]);
|
|
18
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 导出 Excel 工具方法
|
|
3
|
-
*
|
|
4
|
-
* 功能:
|
|
5
|
-
* - 支持导出「当前页」或「当前查询条件下的全部页数据」
|
|
6
|
-
* - 通过 DataTable 的 columns 控制导出列及顺序
|
|
7
|
-
*
|
|
8
|
-
* 使用方式(示例):
|
|
9
|
-
* ```ts
|
|
10
|
-
* await exportToExcel({
|
|
11
|
-
* fetchData: (pageNum, pageSize) => getWithdrawList({ ...searchParams, pageNum, pageSize }),
|
|
12
|
-
* columns, // 直接复用 DataTable 的 columns
|
|
13
|
-
* exportType: 'all', // 'all' 导出全部页;'current' 仅导出当前页
|
|
14
|
-
* currentPage,
|
|
15
|
-
* pageSize,
|
|
16
|
-
* total,
|
|
17
|
-
* currentPageData: tableData, // 可选,导出当前页时直接使用现有数据,避免重复请求
|
|
18
|
-
* fileName: '提币记录',
|
|
19
|
-
* })
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
import { type TableColumnDef } from '../components';
|
|
23
|
-
export declare const ExportType: {
|
|
24
|
-
/**
|
|
25
|
-
* 当前查询条件下所有页
|
|
26
|
-
*/
|
|
27
|
-
readonly all: 0;
|
|
28
|
-
/**
|
|
29
|
-
* 当前页
|
|
30
|
-
*/
|
|
31
|
-
readonly current: 1;
|
|
32
|
-
};
|
|
33
|
-
export type ExportType = (typeof ExportType)[keyof typeof ExportType];
|
|
34
|
-
interface ExportExcelParams<T> {
|
|
35
|
-
/** 获取数据方法 */
|
|
36
|
-
fetchData: (pageNum: number, pageSize: number, searchParams?: Record<string, any>) => Promise<{
|
|
37
|
-
records: T[];
|
|
38
|
-
total: number;
|
|
39
|
-
}>;
|
|
40
|
-
/** 直接复用 DataTable 的 columns 配置 会自动过滤 操作栏*/
|
|
41
|
-
columns: TableColumnDef<T>[];
|
|
42
|
-
/** 导出类型:all=当前查询条件下所有页;current=当前页 */
|
|
43
|
-
exportType: ExportType;
|
|
44
|
-
/** 当前页码(导出当前页时使用)默认 1 */
|
|
45
|
-
currentPage?: number;
|
|
46
|
-
/** 每页条数,默认 2000 */
|
|
47
|
-
pageSize?: number;
|
|
48
|
-
/**
|
|
49
|
-
* 最大导出条数,超过则停止继续请求
|
|
50
|
-
* @default 10000
|
|
51
|
-
*/
|
|
52
|
-
maxCount?: number;
|
|
53
|
-
/**
|
|
54
|
-
* 当前页已有数据
|
|
55
|
-
* - 当 exportType === 'current' 且传入该字段时,将直接使用该数据,不会再次请求接口
|
|
56
|
-
*/
|
|
57
|
-
currentPageData?: T[];
|
|
58
|
-
/** 文件名(不含扩展名),默认:export-YYYYMMDDHHmmss */
|
|
59
|
-
fileName?: string;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* 通用导出 Excel 方法
|
|
63
|
-
*/
|
|
64
|
-
export declare function exportToExcel<T>(options: ExportExcelParams<T>): Promise<void>;
|
|
65
|
-
export {};
|
|
66
|
-
//# sourceMappingURL=export.d.ts.map
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 导出 Excel 工具方法
|
|
3
|
-
*
|
|
4
|
-
* 功能:
|
|
5
|
-
* - 支持导出「当前页」或「当前查询条件下的全部页数据」
|
|
6
|
-
* - 通过 DataTable 的 columns 控制导出列及顺序
|
|
7
|
-
*
|
|
8
|
-
* 使用方式(示例):
|
|
9
|
-
* ```ts
|
|
10
|
-
* await exportToExcel({
|
|
11
|
-
* fetchData: (pageNum, pageSize) => getWithdrawList({ ...searchParams, pageNum, pageSize }),
|
|
12
|
-
* columns, // 直接复用 DataTable 的 columns
|
|
13
|
-
* exportType: 'all', // 'all' 导出全部页;'current' 仅导出当前页
|
|
14
|
-
* currentPage,
|
|
15
|
-
* pageSize,
|
|
16
|
-
* total,
|
|
17
|
-
* currentPageData: tableData, // 可选,导出当前页时直接使用现有数据,避免重复请求
|
|
18
|
-
* fileName: '提币记录',
|
|
19
|
-
* })
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
import { message } from '../components';
|
|
23
|
-
import * as XLSX from 'xlsx';
|
|
24
|
-
const getTextFromReactNode = (node) => {
|
|
25
|
-
if (node == null || typeof node !== 'object') {
|
|
26
|
-
return node;
|
|
27
|
-
}
|
|
28
|
-
if ('props' in node && node.props && typeof node.props === 'object' && 'children' in node.props) {
|
|
29
|
-
const children = node.props.children;
|
|
30
|
-
if (Array.isArray(children)) {
|
|
31
|
-
return children.map((child) => getTextFromReactNode(child)).flat();
|
|
32
|
-
}
|
|
33
|
-
return getTextFromReactNode(children);
|
|
34
|
-
}
|
|
35
|
-
return String(node);
|
|
36
|
-
};
|
|
37
|
-
export const ExportType = {
|
|
38
|
-
/**
|
|
39
|
-
* 当前查询条件下所有页
|
|
40
|
-
*/
|
|
41
|
-
all: 0,
|
|
42
|
-
/**
|
|
43
|
-
* 当前页
|
|
44
|
-
*/
|
|
45
|
-
current: 1,
|
|
46
|
-
};
|
|
47
|
-
/** 读取嵌套字段值,支持 a.b.c 形式 */
|
|
48
|
-
const getValue = (row, dataIndex) => {
|
|
49
|
-
const key = String(dataIndex);
|
|
50
|
-
if (!key.includes('.'))
|
|
51
|
-
return row?.[key];
|
|
52
|
-
return key.split('.').reduce((acc, cur) => (acc == null ? acc : acc[cur]), row);
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* 通用导出 Excel 方法
|
|
56
|
-
*/
|
|
57
|
-
export async function exportToExcel(options) {
|
|
58
|
-
const { fetchData, exportType, currentPage = 1, pageSize = 2000, maxCount = 10000, currentPageData, fileName, } = options;
|
|
59
|
-
const defaultSearchParams = { export: true };
|
|
60
|
-
const cols = options.columns;
|
|
61
|
-
const fieldConfigs = cols
|
|
62
|
-
// 过滤掉操作列
|
|
63
|
-
.filter((col) => !col.isAction && col.key !== 'action')
|
|
64
|
-
.map((col) => ({
|
|
65
|
-
title: col.title,
|
|
66
|
-
dataIndex: (col.dataIndex || col.key),
|
|
67
|
-
render: col.renderExport ?? col.render,
|
|
68
|
-
}));
|
|
69
|
-
if (!fieldConfigs.length) {
|
|
70
|
-
console.warn('[exportToExcel] 导出列配置为空,已终止导出');
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const infoMessageId = message.info('导出中...', { duration: 999999999 });
|
|
74
|
-
try {
|
|
75
|
-
let allData = [];
|
|
76
|
-
if (exportType === ExportType.current) {
|
|
77
|
-
// 优先使用已存在的当前页数据,避免重复请求
|
|
78
|
-
if (currentPageData && currentPageData.length) {
|
|
79
|
-
allData = currentPageData;
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
const res = await fetchData(currentPage, pageSize, defaultSearchParams);
|
|
83
|
-
allData = res.records || [];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
// 导出所有页:按页拉取,直到数据不足一整页或达到最大条数
|
|
88
|
-
const list = [];
|
|
89
|
-
for (let page = 1;; page += 1) {
|
|
90
|
-
const res = await fetchData(page, pageSize, defaultSearchParams);
|
|
91
|
-
const records = res.records || [];
|
|
92
|
-
if (!records.length)
|
|
93
|
-
break;
|
|
94
|
-
list.push(...records);
|
|
95
|
-
// 达到最大条数后直接截断并停止
|
|
96
|
-
if (list.length >= maxCount) {
|
|
97
|
-
list.length = maxCount;
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
// 本页数据不足 pageSize,说明已到最后一页
|
|
101
|
-
if (records.length < pageSize)
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
allData = list;
|
|
105
|
-
}
|
|
106
|
-
if (!allData.length) {
|
|
107
|
-
message.warning?.('暂无可导出的数据');
|
|
108
|
-
message.close(infoMessageId);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
// 构建表头
|
|
112
|
-
const header = fieldConfigs.map((f) => f.title);
|
|
113
|
-
// 构建数据行
|
|
114
|
-
const dataRows = allData.map((row, index) => fieldConfigs.map((f) => {
|
|
115
|
-
const v = f.render ? f.render(getValue(row, f.dataIndex), row, index) : getValue(row, f.dataIndex);
|
|
116
|
-
// 如果v是ReactNode
|
|
117
|
-
// 需要获取最深层的text
|
|
118
|
-
if (v && typeof v === 'object' && 'props' in v && 'children' in v.props) {
|
|
119
|
-
return getTextFromReactNode(v);
|
|
120
|
-
}
|
|
121
|
-
return v;
|
|
122
|
-
}));
|
|
123
|
-
const worksheet = XLSX.utils.aoa_to_sheet([header, ...dataRows]);
|
|
124
|
-
const workbook = XLSX.utils.book_new();
|
|
125
|
-
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
|
126
|
-
const now = new Date();
|
|
127
|
-
const pad = (n) => (n < 10 ? `0${n}` : String(n));
|
|
128
|
-
const defaultName = `export-${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
|
129
|
-
XLSX.writeFile(workbook, `${fileName || defaultName}.xlsx`);
|
|
130
|
-
message.close(infoMessageId);
|
|
131
|
-
message.success?.('导出成功');
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
console.error('[exportToExcel] 导出失败:', error);
|
|
135
|
-
message.close(infoMessageId);
|
|
136
|
-
message.error?.('导出失败,请稍后重试');
|
|
137
|
-
}
|
|
138
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { type ClassValue } from "clsx";
|
|
2
|
-
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
-
/**
|
|
4
|
-
* 日期时间格式化工具
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* 格式化日期时间
|
|
8
|
-
* @param date 日期字符串或 Date 对象
|
|
9
|
-
* @param format 格式化模板,默认 'YYYY-MM-DD HH:mm:ss'
|
|
10
|
-
* @returns 格式化后的字符串
|
|
11
|
-
*/
|
|
12
|
-
export declare function formatDateTime(date: string | Date | null | undefined | number, format?: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* 格式化日期
|
|
15
|
-
* @param date 日期字符串或 Date 对象
|
|
16
|
-
* @returns 格式化后的字符串 YYYY-MM-DD
|
|
17
|
-
*/
|
|
18
|
-
export declare function formatDate(date: string | Date | null | undefined): string;
|
|
19
|
-
/**
|
|
20
|
-
* 格式化时间
|
|
21
|
-
* @param date 日期字符串或 Date 对象
|
|
22
|
-
* @returns 格式化后的字符串 HH:mm:ss
|
|
23
|
-
*/
|
|
24
|
-
export declare function formatTime(date: string | Date | null | undefined): string;
|
|
25
|
-
/**
|
|
26
|
-
* 生成开始结束时间
|
|
27
|
-
* @param dates 日期字符串或 Date 对象数组
|
|
28
|
-
* @returns 开始结束时间对象 { start: string; end: string }
|
|
29
|
-
*/
|
|
30
|
-
export declare function generateStartEndTime(dates: string[] | Date[] | null | undefined): {
|
|
31
|
-
start: string;
|
|
32
|
-
end: string;
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { clsx } from "clsx";
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
export function cn(...inputs) {
|
|
4
|
-
return twMerge(clsx(inputs));
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* 日期时间格式化工具
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* 格式化日期时间
|
|
11
|
-
* @param date 日期字符串或 Date 对象
|
|
12
|
-
* @param format 格式化模板,默认 'YYYY-MM-DD HH:mm:ss'
|
|
13
|
-
* @returns 格式化后的字符串
|
|
14
|
-
*/
|
|
15
|
-
export function formatDateTime(date, format = "YYYY-MM-DD HH:mm:ss") {
|
|
16
|
-
if (!date)
|
|
17
|
-
return "-";
|
|
18
|
-
let d = new Date(date);
|
|
19
|
-
// 接口返回的时间戳为 秒
|
|
20
|
-
const tmpY = d.getFullYear();
|
|
21
|
-
if (typeof date === "number" && tmpY === 1970) {
|
|
22
|
-
d = new Date(date * 1000);
|
|
23
|
-
}
|
|
24
|
-
if (isNaN(d.getTime()))
|
|
25
|
-
return "-";
|
|
26
|
-
const year = d.getFullYear();
|
|
27
|
-
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
28
|
-
const day = String(d.getDate()).padStart(2, "0");
|
|
29
|
-
const hours = String(d.getHours()).padStart(2, "0");
|
|
30
|
-
const minutes = String(d.getMinutes()).padStart(2, "0");
|
|
31
|
-
const seconds = String(d.getSeconds()).padStart(2, "0");
|
|
32
|
-
return format
|
|
33
|
-
.replace("YYYY", String(year))
|
|
34
|
-
.replace("MM", month)
|
|
35
|
-
.replace("DD", day)
|
|
36
|
-
.replace("HH", hours)
|
|
37
|
-
.replace("mm", minutes)
|
|
38
|
-
.replace("ss", seconds);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* 格式化日期
|
|
42
|
-
* @param date 日期字符串或 Date 对象
|
|
43
|
-
* @returns 格式化后的字符串 YYYY-MM-DD
|
|
44
|
-
*/
|
|
45
|
-
export function formatDate(date) {
|
|
46
|
-
return formatDateTime(date, "YYYY-MM-DD");
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 格式化时间
|
|
50
|
-
* @param date 日期字符串或 Date 对象
|
|
51
|
-
* @returns 格式化后的字符串 HH:mm:ss
|
|
52
|
-
*/
|
|
53
|
-
export function formatTime(date) {
|
|
54
|
-
return formatDateTime(date, "HH:mm:ss");
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* 生成开始结束时间
|
|
58
|
-
* @param dates 日期字符串或 Date 对象数组
|
|
59
|
-
* @returns 开始结束时间对象 { start: string; end: string }
|
|
60
|
-
*/
|
|
61
|
-
export function generateStartEndTime(dates) {
|
|
62
|
-
if (!dates)
|
|
63
|
-
return { start: "", end: "" };
|
|
64
|
-
const start = dates[0];
|
|
65
|
-
const end = dates[dates.length - 1];
|
|
66
|
-
return {
|
|
67
|
-
start: formatDateTime(start, "YYYY-MM-DD 00:00:00"),
|
|
68
|
-
end: formatDateTime(end, "YYYY-MM-DD 23:59:59"),
|
|
69
|
-
};
|
|
70
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { create } from 'zustand';
|
|
2
|
-
const BREADCRUMB_STORAGE_KEY = 'app-breadcrumb';
|
|
3
|
-
const loadBreadcrumbFromStorage = () => {
|
|
4
|
-
try {
|
|
5
|
-
const stored = localStorage.getItem(BREADCRUMB_STORAGE_KEY);
|
|
6
|
-
if (stored) {
|
|
7
|
-
const items = JSON.parse(stored);
|
|
8
|
-
return items.map((item) => ({
|
|
9
|
-
id: item.id,
|
|
10
|
-
label: item.label || item.name || '',
|
|
11
|
-
desctext: item.desctext,
|
|
12
|
-
path: item.path,
|
|
13
|
-
active: item.active,
|
|
14
|
-
closable: item.closable,
|
|
15
|
-
}));
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
// ignore
|
|
20
|
-
}
|
|
21
|
-
return [];
|
|
22
|
-
};
|
|
23
|
-
const saveBreadcrumbToStorage = (items) => {
|
|
24
|
-
try {
|
|
25
|
-
localStorage.setItem(BREADCRUMB_STORAGE_KEY, JSON.stringify(items));
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
// ignore
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
export const breadcrumbStore = create((set) => ({
|
|
32
|
-
items: loadBreadcrumbFromStorage(),
|
|
33
|
-
setItems: (items) => {
|
|
34
|
-
set({ items });
|
|
35
|
-
},
|
|
36
|
-
addItem: (item) => {
|
|
37
|
-
set((state) => {
|
|
38
|
-
if (state.items.some((i) => i.id === item.id)) {
|
|
39
|
-
return state;
|
|
40
|
-
}
|
|
41
|
-
return { items: [...state.items, item] };
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
removeItem: (id) => {
|
|
45
|
-
set((state) => ({
|
|
46
|
-
items: state.items.filter((item) => item.id !== id || item.closable === false),
|
|
47
|
-
}));
|
|
48
|
-
},
|
|
49
|
-
clearItems: () => {
|
|
50
|
-
set((state) => ({
|
|
51
|
-
items: state.items.filter((item) => item.closable === false),
|
|
52
|
-
}));
|
|
53
|
-
},
|
|
54
|
-
setActiveItem: (id) => {
|
|
55
|
-
set((state) => ({
|
|
56
|
-
items: state.items.map((item) => ({
|
|
57
|
-
...item,
|
|
58
|
-
active: item.id === id,
|
|
59
|
-
})),
|
|
60
|
-
}));
|
|
61
|
-
},
|
|
62
|
-
}));
|
|
63
|
-
breadcrumbStore.subscribe((state) => {
|
|
64
|
-
saveBreadcrumbToStorage(state.items);
|
|
65
|
-
});
|
|
66
|
-
export const useBreadcrumbStore = breadcrumbStore;
|