@_tc/template-core 0.0.1-bate.9 → 0.0.2
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/README.md +1108 -0
- package/cjs/_virtual/_rolldown/runtime.js +1 -0
- package/cjs/app/controller/base.js +1 -21
- package/cjs/app/controller/project.js +1 -50
- package/cjs/app/controller/view.js +1 -14
- package/cjs/app/data/signKey.js +1 -4
- package/cjs/app/extend/$fetch.js +1 -0
- package/cjs/app/extend/db.js +1 -12
- package/cjs/app/extend/generateErrorMessage.js +1 -14
- package/cjs/app/extend/logger.js +1 -72
- package/cjs/app/extend/parsingParamsOnUrl.js +1 -22
- package/cjs/app/extend/render-view.js +1 -21
- package/cjs/app/middleware/api-params-verify.js +1 -63
- package/cjs/app/middleware/api-sign-verify.js +1 -28
- package/cjs/app/middleware/error-handle.js +1 -33
- package/cjs/app/middleware/project-handler.js +1 -21
- package/cjs/app/middleware.js +1 -60
- package/cjs/app/router/project.js +1 -8
- package/cjs/app/router/view.js +1 -5
- package/cjs/app/router-schema/project.js +1 -33
- package/cjs/app/service/base.js +1 -0
- package/cjs/app/service/project.js +1 -42
- package/cjs/app/type.js +1 -2
- package/cjs/app/typings.js +1 -2
- package/cjs/bundler/defaultAlias.js +1 -0
- package/cjs/bundler/dev.js +1 -68
- package/cjs/bundler/index.js +1 -18
- package/cjs/bundler/prod.js +1 -19
- package/cjs/bundler/state.js +1 -0
- package/cjs/bundler/utils.js +1 -127
- package/cjs/index.js +1 -21
- 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 +1 -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 +1 -0
- package/cjs/packages/core/env.js +1 -25
- package/cjs/packages/core/index.js +1 -116
- package/cjs/packages/core/loader/config.js +1 -45
- package/cjs/packages/core/loader/controller.js +1 -40
- package/cjs/packages/core/loader/extend.js +1 -41
- package/cjs/packages/core/loader/middleware.js +1 -38
- package/cjs/packages/core/loader/model.js +1 -132
- package/cjs/packages/core/loader/router-schema.js +1 -35
- package/cjs/packages/core/loader/router.js +1 -62
- package/cjs/packages/core/loader/service.js +1 -30
- package/cjs/packages/core/paths.js +1 -10
- package/cjs/packages/core/types.js +1 -2
- package/cjs/packages/utils/getAllFilesInFolder.js +1 -45
- package/cjs/packages/utils/getAllFnReturnValue.js +1 -6
- package/cjs/packages/utils/index.js +1 -20
- package/cjs/packages/utils/loadFile.js +1 -65
- package/cjs/packages/utils/path.js +1 -64
- package/cjs/packages/utils/runFileFn.js +1 -5
- package/esm/_virtual/_rolldown/runtime.js +20 -0
- package/esm/app/controller/base.js +26 -21
- package/esm/app/controller/project.js +52 -42
- package/esm/app/controller/view.js +23 -12
- package/esm/app/data/signKey.js +8 -1
- package/esm/app/extend/$fetch.js +15 -0
- package/esm/app/extend/db.js +5 -8
- package/esm/app/extend/generateErrorMessage.js +6 -11
- package/esm/app/extend/logger.js +25 -36
- package/esm/app/extend/parsingParamsOnUrl.js +13 -19
- package/esm/app/extend/render-view.js +18 -15
- package/esm/app/middleware/api-params-verify.js +55 -57
- package/esm/app/middleware/api-sign-verify.js +17 -22
- package/esm/app/middleware/error-handle.js +23 -30
- package/esm/app/middleware/project-handler.js +14 -18
- package/esm/app/middleware.js +17 -54
- package/esm/app/router/project.js +6 -5
- package/esm/app/router/view.js +6 -2
- package/esm/app/router-schema/project.js +14 -30
- package/esm/app/service/base.js +14 -0
- package/esm/app/service/project.js +23 -34
- package/esm/app/type.js +0 -1
- package/esm/app/typings.js +0 -1
- package/esm/bundler/defaultAlias.js +4 -0
- package/esm/bundler/dev.js +11 -28
- package/esm/bundler/index.js +17 -13
- package/esm/bundler/prod.js +13 -15
- package/esm/bundler/state.js +10 -0
- package/esm/bundler/utils.js +191 -82
- package/esm/index.js +15 -12
- 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/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 -23
- package/esm/packages/core/index.js +51 -108
- package/esm/packages/core/loader/config.js +26 -42
- package/esm/packages/core/loader/controller.js +12 -37
- package/esm/packages/core/loader/extend.js +22 -38
- package/esm/packages/core/loader/middleware.js +15 -35
- package/esm/packages/core/loader/model.js +65 -124
- package/esm/packages/core/loader/router-schema.js +18 -32
- package/esm/packages/core/loader/router.js +35 -56
- package/esm/packages/core/loader/service.js +12 -27
- package/esm/packages/core/paths.js +7 -4
- package/esm/packages/core/types.js +0 -1
- package/esm/packages/utils/getAllFilesInFolder.js +8 -7
- package/esm/packages/utils/getAllFnReturnValue.js +0 -6
- package/esm/packages/utils/index.js +5 -4
- package/esm/packages/utils/loadFile.js +33 -62
- package/esm/packages/utils/path.js +14 -25
- package/esm/packages/utils/runFileFn.js +45 -1
- package/fe/frontend/apps/dash/Dashboard.d.ts +6 -0
- package/fe/frontend/apps/dash/Dashboard.js +75 -0
- package/fe/frontend/apps/dash/dash.entry.d.ts +2 -0
- package/fe/frontend/apps/dash/dash.entry.js +80 -0
- package/fe/frontend/apps/dash/types.d.ts +17 -0
- package/fe/frontend/apps/testPage/index.d.ts +3 -0
- package/fe/frontend/apps/testPage/index.js +6 -0
- package/fe/frontend/apps/testPage/testPage.entry.d.ts +2 -0
- package/fe/frontend/apps/testPage/testPage.entry.js +6 -0
- package/fe/frontend/extended/SchemaForm/data.d.ts +13 -0
- package/fe/frontend/extended/SchemaForm/data.js +8 -0
- package/fe/frontend/src/api/baseInfo.d.ts +31 -0
- package/fe/frontend/src/api/baseInfo.js +15 -0
- package/fe/frontend/src/common/CRUD/CRUD.d.ts +3 -0
- package/fe/frontend/src/common/CRUD/CRUD.js +2 -0
- package/fe/frontend/src/common/CRUD/index.d.ts +2 -0
- package/fe/frontend/src/common/CRUD/index.js +1 -0
- package/fe/frontend/src/common/auth/index.d.ts +7 -0
- package/fe/frontend/src/common/auth/index.js +20 -0
- package/fe/frontend/src/common/fetchErrorShow.d.ts +3 -0
- package/fe/frontend/src/common/fetchErrorShow.js +8 -0
- package/fe/frontend/src/common/generateMenuData.d.ts +4 -0
- package/fe/frontend/src/common/generateMenuData.js +12 -0
- package/fe/frontend/src/common/importComponent.d.ts +5 -0
- package/fe/frontend/src/common/importComponent.js +8 -0
- package/fe/frontend/src/common/language.d.ts +2 -0
- package/fe/frontend/src/common/language.js +9 -0
- package/fe/frontend/src/common/logFn/index.d.ts +5 -0
- package/fe/frontend/src/common/logFn/index.js +9 -0
- package/fe/frontend/src/common/menu.d.ts +34 -0
- package/fe/frontend/src/common/menu.js +101 -0
- package/fe/frontend/src/common/request.d.ts +37 -0
- package/fe/frontend/src/common/request.js +217 -0
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +8 -0
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.js +32 -0
- package/fe/frontend/src/components/AsyncSelect/index.d.ts +4 -0
- package/fe/frontend/src/components/AsyncSelect/index.js +3 -0
- package/fe/frontend/src/components/BasePage/HeaderView.d.ts +9 -0
- package/fe/frontend/src/components/BasePage/HeaderView.js +14 -0
- package/fe/frontend/src/components/Router/index.d.ts +9 -0
- package/fe/frontend/src/components/Router/index.js +11 -0
- package/fe/frontend/src/components/Router/type.d.ts +2 -0
- package/fe/frontend/src/components/Router/type.js +1 -0
- package/fe/frontend/src/defaultPages/Iframe/index.d.ts +3 -0
- package/fe/frontend/src/defaultPages/Iframe/index.js +14 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.d.ts +7 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.js +94 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.d.ts +13 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.js +124 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.d.ts +44 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.js +7 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.d.ts +4 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.js +6 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.js +63 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.d.ts +11 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.js +188 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/eventInfo.d.ts +8 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/eventInfo.js +6 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/index.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/index.js +1 -0
- package/fe/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.d.ts +10 -0
- package/fe/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.js +14 -0
- package/fe/frontend/src/defaultPages/SchemaPage/index.css +167 -0
- package/fe/frontend/src/defaultPages/SchemaPage/index.d.ts +4 -0
- package/fe/frontend/src/defaultPages/SchemaPage/index.js +75 -0
- package/fe/frontend/src/defaultPages/SchemaPage/schemaType.d.ts +51 -0
- package/fe/frontend/src/defaultPages/SchemaPage/schemaType.js +4 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/permissions.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/permissions.js +3 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.js +115 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.d.ts +7 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.js +36 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +10 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +38 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPage/index.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPage/index.js +16 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPageTmp.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPageTmp.js +17 -0
- package/fe/frontend/src/defaultPages/SlotPage/index.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SlotPage/index.js +26 -0
- package/fe/frontend/src/exportStore.d.ts +17 -0
- package/fe/frontend/src/exportStore.js +16 -0
- package/fe/frontend/src/hooks/useCurrentMenuData.d.ts +19 -0
- package/fe/frontend/src/hooks/useCurrentMenuData.js +28 -0
- package/fe/frontend/src/hooks/useRouterParams.d.ts +5 -0
- package/fe/frontend/src/hooks/useRouterParams.js +11 -0
- package/fe/frontend/src/index.d.ts +16 -0
- package/fe/frontend/src/index.js +13 -0
- package/fe/frontend/src/main.css +96 -0
- package/fe/frontend/src/main.d.ts +27 -0
- package/fe/frontend/src/main.js +72 -0
- package/fe/frontend/src/stores/apiFreezer.d.ts +93 -0
- package/fe/frontend/src/stores/apiFreezer.js +49 -0
- package/fe/frontend/src/stores/mode.d.ts +19 -0
- package/fe/frontend/src/stores/mode.js +37 -0
- package/fe/frontend/src/stores/schemaEventBus.d.ts +42 -0
- package/fe/frontend/src/stores/schemaEventBus.js +70 -0
- package/fe/frontend/src/stores/schemaStore.d.ts +47 -0
- package/fe/frontend/src/stores/schemaStore.js +26 -0
- package/fe/frontend/src/typing/scalability.d.ts +47 -0
- package/fe/frontend/src/typing/scalability.js +1 -0
- package/fe/frontend/src/typing/window.d.ts +7 -0
- package/fe/frontend/src/typing/window.js +1 -0
- package/fe/model/types/data/button.d.ts +32 -0
- package/fe/model/types/data/button.js +16 -0
- package/fe/model/types/data/component.d.ts +40 -0
- package/fe/model/types/data/component.js +11 -0
- package/fe/model/types/data/fetchInfo.d.ts +20 -0
- package/fe/model/types/data/fetchInfo.js +1 -0
- package/fe/model/types/data/schema.d.ts +98 -0
- package/fe/model/types/data/schema.js +1 -0
- package/fe/model/types/data/search.d.ts +7 -0
- package/fe/model/types/data/search.js +1 -0
- package/fe/model/types/menuType.d.ts +73 -0
- package/fe/model/types/menuType.js +1 -0
- package/fe/model/types/model.d.ts +33 -0
- package/fe/model/types/model.js +1 -0
- package/fe/packages/common/array/index.d.ts +7 -0
- package/fe/packages/common/array/index.js +40 -0
- package/fe/packages/common/cache/LRUCache.d.ts +13 -0
- package/fe/packages/common/cache/LRUCache.js +47 -0
- package/fe/packages/common/cache/index.d.ts +2 -0
- package/fe/packages/common/cache/index.js +1 -0
- package/fe/packages/common/guards/index.d.ts +9 -0
- package/fe/packages/common/guards/index.js +24 -0
- package/fe/packages/common/http/index.d.ts +90 -0
- package/fe/packages/common/http/index.js +310 -0
- package/fe/packages/common/i18n/default.d.ts +92 -0
- package/fe/packages/common/i18n/default.js +90 -0
- package/fe/packages/common/i18n/en-US.d.ts +92 -0
- package/fe/packages/common/i18n/en-US.js +90 -0
- package/fe/packages/common/i18n/index.d.ts +43 -0
- package/fe/packages/common/i18n/index.js +173 -0
- package/fe/packages/common/i18n/locales.d.ts +8 -0
- package/fe/packages/common/i18n/locales.js +10 -0
- package/fe/packages/common/i18n/types.d.ts +71 -0
- package/fe/packages/common/i18n/types.js +1 -0
- package/fe/packages/common/index.d.ts +11 -0
- package/fe/packages/common/index.js +10 -0
- package/fe/packages/common/log/index.d.ts +33 -0
- package/fe/packages/common/log/index.js +176 -0
- package/fe/packages/common/number/index.d.ts +3 -0
- package/fe/packages/common/number/index.js +10 -0
- package/fe/packages/common/object/filterEmpty.d.ts +3 -0
- package/fe/packages/common/object/filterEmpty.js +33 -0
- package/fe/packages/common/object/index.d.ts +5 -0
- package/fe/packages/common/object/index.js +25 -0
- package/fe/packages/common/string/index.d.ts +4 -0
- package/fe/packages/common/string/index.js +17 -0
- package/fe/packages/common/types/index.d.ts +4 -0
- package/fe/packages/common/types/index.js +1 -0
- package/fe/packages/ui/react/components/Button/Button.d.ts +29 -10
- package/fe/packages/ui/react/components/Button/Button.js +53 -23
- package/fe/packages/ui/react/components/Button/SumbitButton.d.ts +2 -2
- package/fe/packages/ui/react/components/Button/SumbitButton.js +3 -10
- package/fe/packages/ui/react/components/Button/index.d.ts +1 -1
- package/fe/packages/ui/react/components/Checkbox/Checkbox.d.ts +1 -1
- package/fe/packages/ui/react/components/Checkbox/Checkbox.js +5 -3
- package/fe/packages/ui/react/components/ConfirmDialog/ConfirmDialog.js +11 -0
- package/fe/packages/ui/react/components/ConfirmDialog/index.d.ts +2 -0
- package/fe/packages/ui/react/components/ConfirmDialog/index.js +1 -0
- package/fe/packages/ui/react/components/DataTable/ActionBtn.d.ts +3 -1
- package/fe/packages/ui/react/components/DataTable/ActionBtn.js +87 -4
- package/fe/packages/ui/react/components/DataTable/{data-table.d.ts → index.d.ts} +12 -4
- package/fe/packages/ui/react/components/DataTable/index.js +187 -0
- package/fe/packages/ui/react/components/Date/Calendar.js +4 -3
- package/fe/packages/ui/react/components/Date/Date.d.ts +5 -3
- package/fe/packages/ui/react/components/Date/Date.js +71 -48
- package/fe/packages/ui/react/components/Date/TimePicker.js +3 -1
- package/fe/packages/ui/react/components/Date/dropdownPositioning.d.ts +3 -0
- package/fe/packages/ui/react/components/Date/dropdownPositioning.js +12 -0
- package/fe/packages/ui/react/components/Date/locales.d.ts +1 -0
- package/fe/packages/ui/react/components/Date/locales.js +7 -38
- package/fe/packages/ui/react/components/Drawer/Drawer.d.ts +29 -0
- package/fe/packages/ui/react/components/Drawer/Drawer.js +100 -0
- package/fe/packages/ui/react/components/Drawer/index.d.ts +3 -0
- package/fe/packages/ui/react/components/Drawer/index.js +1 -0
- package/fe/packages/ui/react/components/Dropdown/Dropdown.d.ts +26 -0
- package/fe/packages/ui/react/components/Dropdown/Dropdown.js +49 -0
- package/fe/packages/ui/react/components/Dropdown/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Dropdown/index.js +1 -0
- package/fe/packages/ui/react/components/Form/Form.js +1 -1
- package/fe/packages/ui/react/components/Form/FormItem.js +1 -1
- package/fe/packages/ui/react/components/Form/SchemaForm/data.d.ts +40 -0
- package/fe/packages/ui/react/components/Form/SchemaForm/data.js +18 -0
- package/fe/packages/ui/react/components/Form/{SchemeForm → SchemaForm}/index.d.ts +15 -14
- package/fe/packages/ui/react/components/Form/SchemaForm/index.js +79 -0
- package/fe/packages/ui/react/components/Form/index.d.ts +1 -1
- package/fe/packages/ui/react/components/Form/index.js +1 -1
- package/fe/packages/ui/react/components/ImagePreview/ImagePreview.js +15 -12
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.js +5 -2
- package/fe/packages/ui/react/components/Input/Input.d.ts +5 -1
- package/fe/packages/ui/react/components/Input/Input.js +5 -4
- package/fe/packages/ui/react/components/InputNumber/InputNumber.d.ts +28 -0
- package/fe/packages/ui/react/components/InputNumber/InputNumber.js +144 -0
- package/fe/packages/ui/react/components/InputNumber/index.d.ts +2 -0
- package/fe/packages/ui/react/components/InputNumber/index.js +1 -0
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.d.ts +30 -0
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.js +63 -0
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.d.ts +2 -0
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.js +27 -0
- package/fe/packages/ui/react/components/Label/Label.js +2 -2
- package/fe/packages/ui/react/components/Menu/Menu.d.ts +18 -0
- package/fe/packages/ui/react/components/Menu/Menu.js +102 -0
- package/fe/packages/ui/react/components/Menu/MenuContext.d.ts +39 -0
- package/fe/packages/ui/react/components/Menu/MenuContext.js +97 -0
- package/fe/packages/ui/react/components/Menu/MenuItem.d.ts +3 -0
- package/fe/packages/ui/react/components/Menu/MenuItem.js +33 -0
- package/fe/packages/ui/react/components/Menu/SubMenu.d.ts +10 -0
- package/fe/packages/ui/react/components/Menu/SubMenu.js +169 -0
- package/fe/packages/ui/react/components/Menu/index.d.ts +9 -0
- package/fe/packages/ui/react/components/Menu/index.js +5 -0
- package/fe/packages/ui/react/components/Menu/menuTypes.d.ts +59 -0
- package/fe/packages/ui/react/components/Menu/menuTypes.js +1 -0
- package/fe/packages/ui/react/components/Menu/utils.d.ts +2 -0
- package/fe/packages/ui/react/components/Menu/utils.js +7 -0
- package/fe/packages/ui/react/components/Message/Message.js +4 -1
- package/fe/packages/ui/react/components/Modal/Modal.d.ts +3 -1
- package/fe/packages/ui/react/components/Modal/Modal.js +6 -43
- package/fe/packages/ui/react/components/Modal/ModalManager.js +4 -3
- package/fe/packages/ui/react/components/Overlay/Overlay.d.ts +23 -0
- package/fe/packages/ui/react/components/Overlay/Overlay.js +53 -0
- package/fe/packages/ui/react/components/Overlay/index.d.ts +3 -0
- package/fe/packages/ui/react/components/Overlay/index.js +1 -0
- package/fe/packages/ui/react/components/{Pagination.js → Pagination/Pagination.js} +4 -4
- package/fe/packages/ui/react/components/Pagination/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Pagination/index.js +1 -0
- package/fe/packages/ui/react/components/Popup/Popup.d.ts +26 -0
- package/fe/packages/ui/react/components/Popup/Popup.js +81 -0
- package/fe/packages/ui/react/components/Popup/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Popup/index.js +1 -0
- package/fe/packages/ui/react/components/Search/Search.d.ts +2 -2
- package/fe/packages/ui/react/components/Search/Search.js +3 -3
- package/fe/packages/ui/react/components/Select/Select.d.ts +5 -0
- package/fe/packages/ui/react/components/Select/Select.js +52 -109
- package/fe/packages/ui/react/components/Select/dropdownPositioning.d.ts +3 -0
- package/fe/packages/ui/react/components/Select/dropdownPositioning.js +13 -0
- package/fe/packages/ui/react/components/Skeleton/Skeleton.js +2 -2
- package/fe/packages/ui/react/components/Switch/Switch.js +3 -1
- package/fe/packages/ui/react/components/TableSearch/TableSearch.d.ts +5 -4
- package/fe/packages/ui/react/components/TableSearch/TableSearch.js +23 -21
- package/fe/packages/ui/react/components/TableSearch/lang.js +5 -14
- package/fe/packages/ui/react/components/{Textarea.d.ts → Textarea/Textarea.d.ts} +11 -3
- package/fe/packages/ui/react/components/Textarea/Textarea.js +37 -0
- package/fe/packages/ui/react/components/Textarea/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Textarea/index.js +1 -0
- package/fe/packages/ui/react/components/{Tooltip.d.ts → Tooltip/Tooltip.d.ts} +2 -2
- package/fe/packages/ui/react/components/Tooltip/Tooltip.js +79 -0
- package/fe/packages/ui/react/components/Tooltip/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Tooltip/index.js +1 -0
- package/fe/packages/ui/react/components/{TreeSelect.js → TreeSelect/TreeSelect.js} +9 -11
- package/fe/packages/ui/react/components/TreeSelect/index.d.ts +2 -0
- package/fe/packages/ui/react/components/TreeSelect/index.js +1 -0
- package/fe/packages/ui/react/components/Upload/ImageUpload.js +18 -6
- package/fe/packages/ui/react/components/Upload/Upload.js +2 -1
- package/fe/packages/ui/react/components/{breadcrumb.js → breadcrumb/breadcrumb.js} +15 -12
- package/fe/packages/ui/react/components/breadcrumb/index.d.ts +2 -0
- package/fe/packages/ui/react/components/breadcrumb/index.js +1 -0
- package/fe/packages/ui/react/components/hooks/useDropdownPositioning.d.ts +49 -0
- package/fe/packages/ui/react/components/hooks/useDropdownPositioning.js +137 -0
- package/fe/packages/ui/react/components/index.d.ts +7 -1
- package/fe/packages/ui/react/components/index.js +7 -1
- package/fe/packages/ui/react/components/table/index.d.ts +2 -0
- package/fe/packages/ui/react/components/table/index.js +1 -0
- package/fe/packages/ui/react/components/{table.d.ts → table/table.d.ts} +12 -2
- package/fe/packages/ui/react/components/table/table.js +116 -0
- package/fe/packages/ui/react/components/testPage/MenuTestPage.d.ts +2 -0
- package/fe/packages/ui/react/components/testPage/MenuTestPage.js +104 -0
- package/fe/packages/ui/react/components/testPage/index.js +300 -81
- package/fe/packages/ui/react/hooks/useExecuteOnce.d.ts +30 -0
- package/fe/packages/ui/react/hooks/useExecuteOnce.js +57 -0
- package/fe/packages/ui/react/hooks/useInit.d.ts +1 -1
- package/fe/packages/ui/react/hooks/useInit.js +1 -1
- package/fe/packages/ui/react/hooks/useLanguage.d.ts +1 -6
- package/fe/packages/ui/react/hooks/useRefState.d.ts +30 -0
- package/fe/packages/ui/react/hooks/useRefState.js +29 -0
- package/fe/packages/ui/react/hooks/useWatch.d.ts +23 -0
- package/fe/packages/ui/react/hooks/useWatch.js +87 -0
- package/fe/packages/ui/react/hooks/useWatch.test.d.ts +2 -0
- package/fe/packages/ui/react/hooks/useWatch.test.js +22 -0
- package/fe/packages/ui/react/i18n/I18nProvider.d.ts +31 -0
- package/fe/packages/ui/react/i18n/I18nProvider.js +25 -0
- package/fe/packages/ui/react/i18n/index.d.ts +4 -0
- package/fe/packages/ui/react/i18n/index.js +3 -0
- package/fe/packages/ui/react/i18n/useI18n.d.ts +13 -0
- package/fe/packages/ui/react/i18n/useI18n.js +18 -0
- package/fe/packages/ui/react/index.css +238 -0
- package/fe/packages/ui/react/index.d.ts +2 -0
- package/fe/packages/ui/react/index.js +2 -0
- package/fe/packages/ui/react/lib/createStoreHook.d.ts +9 -0
- package/fe/packages/ui/react/lib/createStoreHook.js +6 -0
- package/fe/packages/ui/react/lib/export.d.ts +2 -2
- package/fe/packages/ui/react/stores/language.d.ts +3 -12
- package/fe/packages/ui/react/stores/language.js +2 -51
- package/fe/typings/type.d.ts +5 -0
- package/fe/typings/type.js +1 -0
- package/model/index.d.ts +2 -0
- package/model/test.d.ts +2 -0
- package/model/types/data/button.d.ts +32 -0
- package/model/types/data/component.d.ts +40 -0
- package/model/types/data/fetchInfo.d.ts +20 -0
- package/model/types/data/schema.d.ts +98 -0
- package/model/types/data/search.d.ts +7 -0
- package/model/types/index.d.ts +3 -0
- package/model/types/menuType.d.ts +73 -0
- package/model/types/model.d.ts +33 -0
- package/package.json +36 -17
- package/{cjs → types}/app/controller/base.d.ts +4 -5
- package/types/app/controller/project.d.ts +22 -0
- package/{cjs → types}/app/controller/view.d.ts +1 -2
- package/types/app/extend/$fetch.d.ts +8 -0
- package/{cjs → types}/app/extend/db.d.ts +1 -1
- package/{cjs → types}/app/extend/logger.d.ts +1 -1
- package/{cjs → types}/app/extend/render-view.d.ts +1 -2
- package/{cjs → types}/app/middleware/api-params-verify.d.ts +1 -2
- package/{cjs → types}/app/middleware/api-sign-verify.d.ts +1 -2
- package/{esm/app/middleware/api-sign-verify.d.ts → types/app/middleware/error-handle.d.ts} +1 -3
- package/{cjs → types}/app/middleware/project-handler.d.ts +2 -2
- package/{cjs → types}/app/middleware.d.ts +0 -2
- package/{cjs/app/router/view.d.ts → types/app/router/project.d.ts} +1 -1
- package/types/app/router/view.d.ts +3 -0
- package/{cjs → types}/app/router-schema/project.d.ts +1 -1
- package/types/app/service/base.d.ts +9 -0
- package/types/app/service/project.d.ts +57 -0
- package/types/app/type.d.ts +5 -0
- package/{cjs → types}/app/typings.d.ts +17 -23
- package/types/bundler/defaultAlias.d.ts +3 -0
- package/types/bundler/index.d.ts +2 -0
- package/types/bundler/state.d.ts +18 -0
- package/types/bundler/utils.d.ts +9 -0
- package/types/config/config.default.d.ts +14 -0
- package/types/index.d.ts +28 -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/{cjs → types}/packages/core/index.d.ts +1 -1
- package/{cjs → types}/packages/core/loader/config.d.ts +1 -1
- package/{cjs → types}/packages/core/loader/controller.d.ts +2 -2
- package/{cjs → types}/packages/core/loader/middleware.d.ts +1 -1
- package/{esm → types}/packages/core/loader/model.d.ts +2 -3
- package/{cjs → types}/packages/core/loader/router-schema.d.ts +2 -2
- package/{cjs → types}/packages/core/loader/router.d.ts +1 -1
- package/{cjs → types}/packages/core/loader/service.d.ts +2 -2
- package/{cjs → types}/packages/core/types.d.ts +42 -3
- package/types/packages/utils/getAllFnReturnValue.d.ts +0 -0
- package/types/packages/utils/runFileFn.d.ts +7 -0
- package/types/typings/type.d.ts +4 -0
- package/cjs/app/controller/project.d.ts +0 -11
- package/cjs/app/middleware/error-handle.d.ts +0 -5
- package/cjs/app/router/project.d.ts +0 -4
- package/cjs/app/service/bese.d.ts +0 -10
- package/cjs/app/service/bese.js +0 -17
- package/cjs/app/service/project.d.ts +0 -27
- package/cjs/app/type.d.ts +0 -2
- package/cjs/bundler/index.d.ts +0 -1
- package/cjs/bundler/utils.d.ts +0 -7
- package/cjs/index.d.ts +0 -28
- package/cjs/packages/core/loader/model.d.ts +0 -36
- package/cjs/packages/utils/runFileFn.d.ts +0 -5
- package/cjs/typings/type.d.ts +0 -4
- package/cjs/typings/type.js +0 -2
- package/esm/app/controller/base.d.ts +0 -14
- package/esm/app/controller/project.d.ts +0 -12
- package/esm/app/controller/view.d.ts +0 -9
- package/esm/app/data/signKey.d.ts +0 -2
- package/esm/app/extend/db.d.ts +0 -3
- package/esm/app/extend/generateErrorMessage.d.ts +0 -8
- package/esm/app/extend/logger.d.ts +0 -12
- package/esm/app/extend/parsingParamsOnUrl.d.ts +0 -3
- package/esm/app/extend/render-view.d.ts +0 -5
- package/esm/app/middleware/api-params-verify.d.ts +0 -6
- package/esm/app/middleware/error-handle.d.ts +0 -6
- package/esm/app/middleware/project-handler.d.ts +0 -5
- package/esm/app/middleware.d.ts +0 -6
- package/esm/app/router/project.d.ts +0 -5
- package/esm/app/router/view.d.ts +0 -5
- package/esm/app/router-schema/project.d.ts +0 -4
- package/esm/app/service/bese.d.ts +0 -11
- package/esm/app/service/bese.js +0 -12
- package/esm/app/service/project.d.ts +0 -28
- package/esm/app/type.d.ts +0 -3
- package/esm/app/typings.d.ts +0 -50
- package/esm/bundler/dev.d.ts +0 -2
- package/esm/bundler/index.d.ts +0 -2
- package/esm/bundler/prod.d.ts +0 -2
- package/esm/bundler/utils.d.ts +0 -8
- package/esm/index.d.ts +0 -29
- package/esm/packages/core/env.d.ts +0 -16
- package/esm/packages/core/index.d.ts +0 -7
- package/esm/packages/core/loader/config.d.ts +0 -10
- package/esm/packages/core/loader/controller.d.ts +0 -18
- package/esm/packages/core/loader/extend.d.ts +0 -9
- package/esm/packages/core/loader/middleware.d.ts +0 -12
- package/esm/packages/core/loader/router-schema.d.ts +0 -19
- package/esm/packages/core/loader/router.d.ts +0 -9
- package/esm/packages/core/loader/service.d.ts +0 -18
- package/esm/packages/core/paths.d.ts +0 -12
- package/esm/packages/core/types.d.ts +0 -75
- package/esm/packages/utils/getAllFilesInFolder.d.ts +0 -10
- package/esm/packages/utils/getAllFnReturnValue.d.ts +0 -1
- package/esm/packages/utils/index.d.ts +0 -5
- package/esm/packages/utils/loadFile.d.ts +0 -21
- package/esm/packages/utils/path.d.ts +0 -25
- package/esm/packages/utils/runFileFn.d.ts +0 -6
- package/esm/typings/type.d.ts +0 -5
- package/fe/frontend/main.d.ts +0 -3
- package/fe/frontend/main.js +0 -6
- package/fe/packages/ui/react/components/ConfirmDialog.js +0 -9
- package/fe/packages/ui/react/components/DataTable/data-table.js +0 -141
- package/fe/packages/ui/react/components/Dropdown.d.ts +0 -16
- package/fe/packages/ui/react/components/Dropdown.js +0 -54
- package/fe/packages/ui/react/components/Form/SchemeForm/data.d.ts +0 -51
- package/fe/packages/ui/react/components/Form/SchemeForm/data.js +0 -8
- package/fe/packages/ui/react/components/Form/SchemeForm/index.js +0 -69
- package/fe/packages/ui/react/components/Textarea.js +0 -35
- package/fe/packages/ui/react/components/Tooltip.js +0 -118
- package/fe/packages/ui/react/components/table.js +0 -20
- package/fe/packages/ui/react/locales/index.d.ts +0 -8
- package/fe/packages/ui/react/locales/index.js +0 -6
- /package/{cjs/packages/utils/getAllFnReturnValue.d.ts → esm/packages/common/i18n/types.js} +0 -0
- /package/{esm/typings/type.js → fe/frontend/apps/dash/types.js} +0 -0
- /package/fe/packages/ui/react/components/{ConfirmDialog.d.ts → ConfirmDialog/ConfirmDialog.d.ts} +0 -0
- /package/fe/packages/ui/react/components/{Pagination.d.ts → Pagination/Pagination.d.ts} +0 -0
- /package/fe/packages/ui/react/components/{TreeSelect.d.ts → TreeSelect/TreeSelect.d.ts} +0 -0
- /package/fe/packages/ui/react/components/{breadcrumb.d.ts → breadcrumb/breadcrumb.d.ts} +0 -0
- /package/{cjs → types}/app/data/signKey.d.ts +0 -0
- /package/{cjs → types}/app/extend/generateErrorMessage.d.ts +0 -0
- /package/{cjs → types}/app/extend/parsingParamsOnUrl.d.ts +0 -0
- /package/{cjs → types}/bundler/dev.d.ts +0 -0
- /package/{cjs → types}/bundler/prod.d.ts +0 -0
- /package/{cjs → types}/packages/core/env.d.ts +0 -0
- /package/{cjs → types}/packages/core/loader/extend.d.ts +0 -0
- /package/{cjs → types}/packages/core/paths.d.ts +0 -0
- /package/{cjs → types}/packages/utils/getAllFilesInFolder.d.ts +0 -0
- /package/{cjs → types}/packages/utils/index.d.ts +0 -0
- /package/{cjs → types}/packages/utils/loadFile.d.ts +0 -0
- /package/{cjs → types}/packages/utils/path.d.ts +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
/**
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
immediate?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Return true when the two values should be treated as equal.
|
|
12
|
+
*
|
|
13
|
+
* @default Array values use shallow compare, other values use Object.is.
|
|
14
|
+
*/
|
|
15
|
+
compare?: WatchCompareType | WatchCompare<T>;
|
|
16
|
+
};
|
|
17
|
+
export declare const identityCompare: <T>(value: T, prevValue: T) => boolean;
|
|
18
|
+
export declare const shallowCompare: <T>(value: T, prevValue: T) => boolean;
|
|
19
|
+
export declare const defaultCompare: <T>(value: T, prevValue: T) => boolean;
|
|
20
|
+
export declare function useWatch<T>(value: T, callback: WatchCallback<T>, options?: UseWatchOptions<T>): void;
|
|
21
|
+
export declare function useWatch<TSource, TValue>(source: TSource, selector: WatchSelector<TSource, TValue>, callback: WatchCallback<TValue>, options?: UseWatchOptions<TValue>): void;
|
|
22
|
+
export default useWatch;
|
|
23
|
+
//# sourceMappingURL=useWatch.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
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;
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
/* 内容扫描 */
|
|
4
|
+
/* baseComponents */
|
|
5
|
+
@source "./**/*.{js,ts,jsx,tsx}";
|
|
6
|
+
|
|
7
|
+
/* 暗色模式变体 */
|
|
8
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
9
|
+
|
|
10
|
+
/* 主题配置 */
|
|
11
|
+
@theme {
|
|
12
|
+
/* 圆角 */
|
|
13
|
+
--radius-lg: var(--radius);
|
|
14
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
15
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
16
|
+
|
|
17
|
+
/* 颜色 */
|
|
18
|
+
--color-background: hsl(var(--background));
|
|
19
|
+
--color-foreground: hsl(var(--foreground));
|
|
20
|
+
|
|
21
|
+
--color-card: hsl(var(--card));
|
|
22
|
+
--color-card-foreground: hsl(var(--card-foreground));
|
|
23
|
+
|
|
24
|
+
--color-popover: hsl(var(--popover));
|
|
25
|
+
--color-popover-foreground: hsl(var(--popover-foreground));
|
|
26
|
+
|
|
27
|
+
--color-primary: hsl(var(--primary));
|
|
28
|
+
--color-primary-foreground: hsl(var(--primary-foreground));
|
|
29
|
+
|
|
30
|
+
--color-secondary: hsl(var(--secondary));
|
|
31
|
+
--color-secondary-foreground: hsl(var(--secondary-foreground));
|
|
32
|
+
|
|
33
|
+
--color-muted: hsl(var(--muted));
|
|
34
|
+
--color-muted-foreground: hsl(var(--muted-foreground));
|
|
35
|
+
|
|
36
|
+
--color-accent: hsl(var(--accent));
|
|
37
|
+
--color-accent-foreground: hsl(var(--accent-foreground));
|
|
38
|
+
|
|
39
|
+
--color-destructive: hsl(var(--destructive));
|
|
40
|
+
--color-destructive-foreground: hsl(var(--destructive-foreground));
|
|
41
|
+
|
|
42
|
+
--color-border: hsl(var(--border));
|
|
43
|
+
--color-input: hsl(var(--input));
|
|
44
|
+
--color-ring: hsl(var(--ring));
|
|
45
|
+
|
|
46
|
+
--color-chart-1: hsl(var(--chart-1));
|
|
47
|
+
--color-chart-2: hsl(var(--chart-2));
|
|
48
|
+
--color-chart-3: hsl(var(--chart-3));
|
|
49
|
+
--color-chart-4: hsl(var(--chart-4));
|
|
50
|
+
--color-chart-5: hsl(var(--chart-5));
|
|
51
|
+
|
|
52
|
+
/* 主题色 - 与 @layer base 中的 CSS 变量对应 */
|
|
53
|
+
--color-theme: hsl(var(--theme-primary));
|
|
54
|
+
--color-theme-foreground: hsl(var(--theme-primary-foreground));
|
|
55
|
+
--color-theme-bg: hsl(var(--theme-bg));
|
|
56
|
+
--color-theme-text: hsl(var(--theme-text));
|
|
57
|
+
|
|
58
|
+
/* 表格颜色 */
|
|
59
|
+
--color-table-header: hsl(var(--table-header-bg));
|
|
60
|
+
--color-table-header-text: hsl(var(--table-header-text));
|
|
61
|
+
--color-table-head-text: hsl(var(--table-head-text));
|
|
62
|
+
--color-table-cell-text: hsl(var(--table-cell-text));
|
|
63
|
+
--color-table-action: hsl(var(--table-action-bg));
|
|
64
|
+
--color-table-action-text: hsl(var(--table-action-text));
|
|
65
|
+
|
|
66
|
+
/* 面包屑颜色 */
|
|
67
|
+
--color-breadcrumb-text: hsl(var(--breadcrumb-text));
|
|
68
|
+
--color-breadcrumb-border: hsl(var(--breadcrumb-border));
|
|
69
|
+
--color-breadcrumb-active-text: hsl(var(--breadcrumb-active-text));
|
|
70
|
+
--color-breadcrumb-active-bg: hsl(var(--breadcrumb-active-bg));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* CSS 变量定义 */
|
|
74
|
+
:root {
|
|
75
|
+
--background: 0 0% 100%;
|
|
76
|
+
--foreground: 240 10% 3.9%;
|
|
77
|
+
--card: 0 0% 100%;
|
|
78
|
+
--card-foreground: 240 10% 3.9%;
|
|
79
|
+
--popover: 0 0% 100%;
|
|
80
|
+
--popover-foreground: 240 10% 3.9%;
|
|
81
|
+
--primary: 240 5.9% 10%;
|
|
82
|
+
--primary-foreground: 0 0% 98%;
|
|
83
|
+
--secondary: 240 4.8% 95.9%;
|
|
84
|
+
--secondary-foreground: 240 5.9% 10%;
|
|
85
|
+
--muted: 240 4.8% 95.9%;
|
|
86
|
+
--muted-foreground: 240 3.8% 46.1%;
|
|
87
|
+
--accent: 240 4.8% 95.9%;
|
|
88
|
+
--accent-foreground: 240 5.9% 10%;
|
|
89
|
+
--destructive: 0 84.2% 60.2%;
|
|
90
|
+
--destructive-foreground: 0 0% 98%;
|
|
91
|
+
--border: 240 5.9% 90%;
|
|
92
|
+
--input: 240 5.9% 90%;
|
|
93
|
+
--ring: 240 5.9% 10%;
|
|
94
|
+
--radius: 0.5rem;
|
|
95
|
+
--chart-1: 12 76% 61%;
|
|
96
|
+
--chart-2: 173 58% 39%;
|
|
97
|
+
--chart-3: 197 37% 24%;
|
|
98
|
+
--chart-4: 43 74% 66%;
|
|
99
|
+
--chart-5: 27 87% 67%;
|
|
100
|
+
|
|
101
|
+
/* 主题色 - 默认亮色中性主题 */
|
|
102
|
+
--theme-primary: 0 0% 0%;
|
|
103
|
+
--theme-primary-foreground: 0 0% 100%;
|
|
104
|
+
--theme-bg: 210 20% 98%;
|
|
105
|
+
--theme-text: 222 47% 11%;
|
|
106
|
+
|
|
107
|
+
/* 表格颜色 - 默认亮色中性主题 */
|
|
108
|
+
--table-header-bg: 220 14% 96%;
|
|
109
|
+
--table-header-text: 220 9% 46%;
|
|
110
|
+
--table-head-text: 217 19% 27%;
|
|
111
|
+
--table-cell-text: 180 4% 16%;
|
|
112
|
+
--table-action-bg: 220 13% 91%;
|
|
113
|
+
--table-action-text: 0 0% 0%;
|
|
114
|
+
|
|
115
|
+
/* 面包屑颜色 - 默认亮色中性主题 */
|
|
116
|
+
--breadcrumb-text: 220 10% 46%;
|
|
117
|
+
--breadcrumb-border: 0 0% 88%;
|
|
118
|
+
--breadcrumb-active-text: 0 0% 100%;
|
|
119
|
+
--breadcrumb-active-bg: 0 0% 0%;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* 绿色主题 */
|
|
123
|
+
[data-theme='green'] {
|
|
124
|
+
--theme-primary: 142 76% 36%;
|
|
125
|
+
--theme-primary-foreground: 0 0% 100%;
|
|
126
|
+
--theme-bg: 120 25% 93%;
|
|
127
|
+
--theme-text: 141 48% 13%;
|
|
128
|
+
|
|
129
|
+
--table-header-bg: 0 0% 88%;
|
|
130
|
+
--table-header-text: 120 4% 16%;
|
|
131
|
+
--table-head-text: 120 4% 16%;
|
|
132
|
+
--table-cell-text: 120 4% 16%;
|
|
133
|
+
--table-action-bg: 120 25% 93% / 0.8;
|
|
134
|
+
--table-action-text: 141 48% 13%;
|
|
135
|
+
|
|
136
|
+
--breadcrumb-text: 0 0% 27%;
|
|
137
|
+
--breadcrumb-border: 0 0% 88%;
|
|
138
|
+
--breadcrumb-active-text: 141 48% 13%;
|
|
139
|
+
--breadcrumb-active-bg: 140 96% 72%;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* 暗色模式 */
|
|
143
|
+
.dark {
|
|
144
|
+
--background: 240 10% 8%;
|
|
145
|
+
--foreground: 0 0% 95%;
|
|
146
|
+
--card: 240 10% 8%;
|
|
147
|
+
--card-foreground: 0 0% 95%;
|
|
148
|
+
--popover: 240 10% 8%;
|
|
149
|
+
--popover-foreground: 0 0% 95%;
|
|
150
|
+
--primary: 0 0% 95%;
|
|
151
|
+
--primary-foreground: 240 5% 15%;
|
|
152
|
+
--secondary: 240 6% 20%;
|
|
153
|
+
--secondary-foreground: 0 0% 95%;
|
|
154
|
+
--muted: 240 6% 20%;
|
|
155
|
+
--muted-foreground: 240 5% 75%;
|
|
156
|
+
--accent: 240 6% 20%;
|
|
157
|
+
--accent-foreground: 0 0% 95%;
|
|
158
|
+
--destructive: 0 70% 40%;
|
|
159
|
+
--destructive-foreground: 0 0% 98%;
|
|
160
|
+
--border: 240 6% 20%;
|
|
161
|
+
--input: 240 6% 20%;
|
|
162
|
+
--ring: 240 4.9% 83.9%;
|
|
163
|
+
--chart-1: 220 70% 50%;
|
|
164
|
+
--chart-2: 160 60% 45%;
|
|
165
|
+
--chart-3: 30 80% 55%;
|
|
166
|
+
--chart-4: 280 65% 60%;
|
|
167
|
+
--chart-5: 340 75% 55%;
|
|
168
|
+
|
|
169
|
+
/* 主题色调整 */
|
|
170
|
+
--theme-primary: 0 0% 92%;
|
|
171
|
+
--theme-primary-foreground: 240 10% 10%;
|
|
172
|
+
--theme-bg: 240 8% 12%;
|
|
173
|
+
--theme-text: 0 0% 95%;
|
|
174
|
+
|
|
175
|
+
/* 表格颜色优化 */
|
|
176
|
+
--table-header-bg: 240 5% 18%;
|
|
177
|
+
--table-header-text: 240 5% 75%;
|
|
178
|
+
--table-head-text: 240 5% 85%;
|
|
179
|
+
--table-cell-text: 0 0% 90%;
|
|
180
|
+
--table-action-bg: 240 5% 22%;
|
|
181
|
+
--table-action-text: 0 0% 95%;
|
|
182
|
+
|
|
183
|
+
/* 面包屑颜色优化 */
|
|
184
|
+
--breadcrumb-text: 240 5% 72%;
|
|
185
|
+
--breadcrumb-border: 240 4% 24%;
|
|
186
|
+
--breadcrumb-active-text: 240 10% 10%;
|
|
187
|
+
--breadcrumb-active-bg: 0 0% 92%;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.dark[data-theme='green'],
|
|
191
|
+
.dark [data-theme='green'] {
|
|
192
|
+
--theme-primary: 142 68% 46%;
|
|
193
|
+
--theme-primary-foreground: 0 0% 100%;
|
|
194
|
+
--theme-bg: 145 22% 14%;
|
|
195
|
+
--theme-text: 140 30% 92%;
|
|
196
|
+
|
|
197
|
+
--table-header-bg: 145 18% 18%;
|
|
198
|
+
--table-header-text: 142 20% 72%;
|
|
199
|
+
--table-head-text: 140 24% 88%;
|
|
200
|
+
--table-cell-text: 140 18% 90%;
|
|
201
|
+
--table-action-bg: 145 16% 22%;
|
|
202
|
+
--table-action-text: 140 24% 88%;
|
|
203
|
+
|
|
204
|
+
--breadcrumb-text: 142 16% 72%;
|
|
205
|
+
--breadcrumb-border: 145 12% 26%;
|
|
206
|
+
--breadcrumb-active-text: 0 0% 100%;
|
|
207
|
+
--breadcrumb-active-bg: 142 68% 46%;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* 中间态主题 */
|
|
211
|
+
[data-theme='gray'] {
|
|
212
|
+
--theme-primary: 220 9% 38%;
|
|
213
|
+
--theme-primary-foreground: 0 0% 100%;
|
|
214
|
+
--theme-bg: 220 16% 92%;
|
|
215
|
+
--theme-text: 222 20% 22%;
|
|
216
|
+
|
|
217
|
+
--table-header-bg: 220 12% 90%;
|
|
218
|
+
--table-header-text: 220 9% 38%;
|
|
219
|
+
--table-head-text: 220 15% 24%;
|
|
220
|
+
--table-cell-text: 220 10% 22%;
|
|
221
|
+
--table-action-bg: 220 11% 86%;
|
|
222
|
+
--table-action-text: 220 15% 24%;
|
|
223
|
+
|
|
224
|
+
--breadcrumb-text: 220 10% 40%;
|
|
225
|
+
--breadcrumb-border: 220 10% 82%;
|
|
226
|
+
--breadcrumb-active-text: 0 0% 100%;
|
|
227
|
+
--breadcrumb-active-bg: 220 9% 38%;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* 全局样式 */
|
|
231
|
+
* {
|
|
232
|
+
border-color: hsl(var(--border));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
body {
|
|
236
|
+
background-color: hsl(var(--background));
|
|
237
|
+
color: hsl(var(--foreground));
|
|
238
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ExtractState, StoreApi } from 'zustand/vanilla';
|
|
2
|
+
type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'getInitialState' | 'subscribe'>;
|
|
3
|
+
export type StoreHook<TStore extends ReadonlyStoreApi<unknown>> = {
|
|
4
|
+
(): ExtractState<TStore>;
|
|
5
|
+
<T>(selector: (state: ExtractState<TStore>) => T): T;
|
|
6
|
+
};
|
|
7
|
+
export declare function createStoreHook<TStore extends ReadonlyStoreApi<unknown>>(store: TStore): StoreHook<TStore>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=createStoreHook.d.ts.map
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* })
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
import { type
|
|
22
|
+
import { type TableColumnDef } from '../components';
|
|
23
23
|
export declare const ExportType: {
|
|
24
24
|
/**
|
|
25
25
|
* 当前查询条件下所有页
|
|
@@ -38,7 +38,7 @@ interface ExportExcelParams<T> {
|
|
|
38
38
|
total: number;
|
|
39
39
|
}>;
|
|
40
40
|
/** 直接复用 DataTable 的 columns 配置 会自动过滤 操作栏*/
|
|
41
|
-
columns:
|
|
41
|
+
columns: TableColumnDef<T>[];
|
|
42
42
|
/** 导出类型:all=当前查询条件下所有页;current=当前页 */
|
|
43
43
|
exportType: ExportType;
|
|
44
44
|
/** 当前页码(导出当前页时使用)默认 1 */
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
type State = {
|
|
5
|
-
language: Language;
|
|
6
|
-
};
|
|
7
|
-
type Actions = {
|
|
8
|
-
setLanguage: (lang: Language) => void;
|
|
9
|
-
t: typeof t;
|
|
10
|
-
};
|
|
11
|
-
export declare const useLanguages: import("zustand").UseBoundStore<import("zustand").StoreApi<State & Actions>>;
|
|
12
|
-
export {};
|
|
1
|
+
export { getLanguage, i18n, t } from '../../../common/i18n';
|
|
2
|
+
export type { I18nLanguage as Language } from '../../../common/i18n';
|
|
3
|
+
export { useI18nStore as useLanguages } from '../i18n';
|
|
13
4
|
//# sourceMappingURL=language.d.ts.map
|
|
@@ -1,51 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const getLanguage = (key, fillingData) => {
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
-
let value = translations[languageStore.getState().language];
|
|
6
|
-
const keys = key.split('.');
|
|
7
|
-
for (const k of keys) {
|
|
8
|
-
value = value?.[k];
|
|
9
|
-
}
|
|
10
|
-
if (typeof value === 'string') {
|
|
11
|
-
const tags = value.match(/\{[A-Za-z0-9_]*?\}/g);
|
|
12
|
-
if (tags && tags.length) {
|
|
13
|
-
tags.forEach((k) => {
|
|
14
|
-
const fKey = k.replace(/[{}]/g, '');
|
|
15
|
-
const v = fillingData?.[fKey];
|
|
16
|
-
if (typeof v !== 'undefined') {
|
|
17
|
-
value = value.replace(k, v);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
return value;
|
|
21
|
-
}
|
|
22
|
-
return value;
|
|
23
|
-
}
|
|
24
|
-
else if (typeof value !== 'undefined') {
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
return key;
|
|
28
|
-
};
|
|
29
|
-
export const t = getLanguage;
|
|
30
|
-
const languageStore = create((set) => ({
|
|
31
|
-
t,
|
|
32
|
-
language: (() => {
|
|
33
|
-
if (typeof window === 'undefined') {
|
|
34
|
-
return defaultLanguage;
|
|
35
|
-
}
|
|
36
|
-
const stored = window.localStorage.getItem(languageLocalKey);
|
|
37
|
-
return (Object.keys(translations).includes(stored) ? stored : defaultLanguage);
|
|
38
|
-
})(),
|
|
39
|
-
setLanguage: (lang) => {
|
|
40
|
-
set({
|
|
41
|
-
language: lang,
|
|
42
|
-
t: function (...args) {
|
|
43
|
-
return getLanguage.apply(this, args);
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
if (typeof window !== 'undefined') {
|
|
47
|
-
window.localStorage.setItem(languageLocalKey, lang);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
}));
|
|
51
|
-
export const useLanguages = languageStore;
|
|
1
|
+
export { getLanguage, i18n, t } from '../../../common/i18n';
|
|
2
|
+
export { useI18nStore as useLanguages } from '../i18n';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type MOmit<T, K extends keyof T> = Omit<T, K>;
|
|
2
|
+
export type UnionToTuple<T> = [T] extends [never] ? [] : ((t: T) => T) extends (t: infer U) => infer U ? [...UnionToTuple<Exclude<T, U>>, U] : never;
|
|
3
|
+
export type MergeType<T extends unknown[]> = T extends [infer F, ...infer R] ? F & (R extends [] ? MergeType<R> : {}) : {};
|
|
4
|
+
export type GetInstance<T extends (...args: never[]) => unknown> = T extends (...args: never[]) => infer R ? R extends new () => infer C ? C : R extends Promise<infer P> ? P extends new () => infer C2 ? C2 : never : never : never;
|
|
5
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/model/index.d.ts
ADDED
package/model/test.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ButtonProps } from '../../../fe/packages/ui/react';
|
|
2
|
+
import { ComponentNames } from './component';
|
|
3
|
+
type ButtonTemplates = {
|
|
4
|
+
/**
|
|
5
|
+
* 按钮名
|
|
6
|
+
*/
|
|
7
|
+
label?: string;
|
|
8
|
+
} & ButtonProps;
|
|
9
|
+
type ParamsValueData = 'schema::tableKey' | string | number;
|
|
10
|
+
type RemoveBtn = {
|
|
11
|
+
eventKey: 'remove';
|
|
12
|
+
/**
|
|
13
|
+
* 事件配置 (参数配置)
|
|
14
|
+
*/
|
|
15
|
+
eventOption: {
|
|
16
|
+
params: {
|
|
17
|
+
/**
|
|
18
|
+
* @example user_id: 'schema::tableKey' | '123' | 123
|
|
19
|
+
*/
|
|
20
|
+
[paramKey: string]: ParamsValueData;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type HandlerBtn = {
|
|
25
|
+
eventKey: 'callComponent';
|
|
26
|
+
eventOption: {
|
|
27
|
+
comName: ComponentNames;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type BaseButton = ButtonTemplates & (RemoveBtn | HandlerBtn);
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=button.d.ts.map
|