@_tc/template-core 0.0.1-bate.35 → 0.0.1-bate.37
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/cjs/app/controller/base.js +3 -3
- package/cjs/app/controller/project.js +1 -1
- package/cjs/app/controller/view.js +16 -7
- package/cjs/app/middleware/api-params-verify.js +10 -1
- package/cjs/app/middleware/error-handle.js +9 -3
- package/cjs/app/middleware/project-handler.js +1 -1
- package/cjs/app/router/view.js +3 -1
- package/cjs/app/router-schema/project.js +1 -1
- package/cjs/app/service/project.js +5 -0
- package/cjs/bundler/defaultAlias.js +5 -0
- package/cjs/bundler/dev.js +4 -3
- package/cjs/bundler/index.js +2 -1
- package/cjs/bundler/prod.js +4 -3
- package/cjs/bundler/utils.js +53 -24
- package/cjs/packages/common/LRUCache.js +4 -0
- package/cjs/packages/common/array/index.js +43 -0
- package/cjs/packages/common/cache/LRUCache.js +45 -0
- package/cjs/packages/common/cache/index.js +4 -0
- package/cjs/packages/common/guards/index.js +34 -0
- package/cjs/packages/common/i18n/default.js +95 -0
- package/cjs/packages/common/i18n/en-US.js +95 -0
- package/cjs/packages/common/i18n/index.js +178 -0
- package/cjs/packages/common/i18n/locales.js +17 -0
- package/cjs/packages/common/i18n/types.js +1 -0
- package/cjs/packages/common/index.js +65 -0
- package/cjs/packages/common/log/index.js +160 -0
- package/cjs/packages/common/number/index.js +14 -0
- package/cjs/packages/common/object/filterEmpty.js +32 -0
- package/cjs/packages/common/object/filtereEmpty.js +5 -0
- package/cjs/packages/common/object/index.js +26 -0
- package/cjs/packages/common/string/index.js +17 -0
- package/cjs/packages/common/types/index.js +1 -0
- package/cjs/packages/core/index.js +17 -12
- package/cjs/packages/core/loader/model.js +3 -3
- package/cjs/packages/core/loader/router.js +14 -5
- package/esm/app/controller/base.js +3 -3
- package/esm/app/controller/project.js +3 -3
- package/esm/app/controller/view.js +16 -7
- package/esm/app/middleware/api-params-verify.js +10 -1
- package/esm/app/middleware/error-handle.js +9 -3
- package/esm/app/middleware/project-handler.js +1 -1
- package/esm/app/router/view.js +3 -1
- package/esm/app/router-schema/project.js +1 -1
- package/esm/app/service/project.js +5 -0
- package/esm/bundler/defaultAlias.js +4 -0
- package/esm/bundler/dev.js +4 -3
- package/esm/bundler/index.js +2 -1
- package/esm/bundler/prod.js +4 -3
- package/esm/bundler/utils.js +53 -24
- package/esm/index.js +2 -2
- package/esm/packages/common/LRUCache.js +2 -0
- package/esm/packages/common/array/index.js +37 -0
- package/esm/packages/common/cache/LRUCache.js +43 -0
- package/esm/packages/common/cache/index.js +2 -0
- package/esm/packages/common/guards/index.js +26 -0
- package/esm/packages/common/i18n/default.js +93 -0
- package/esm/packages/common/i18n/en-US.js +93 -0
- package/esm/packages/common/i18n/index.js +162 -0
- package/esm/packages/common/i18n/locales.js +11 -0
- package/esm/packages/common/i18n/types.js +0 -0
- package/esm/packages/common/index.js +13 -0
- package/esm/packages/common/log/index.js +146 -0
- package/esm/packages/common/number/index.js +11 -0
- package/esm/packages/common/object/filterEmpty.js +29 -0
- package/esm/packages/common/object/filtereEmpty.js +2 -0
- package/esm/packages/common/object/index.js +20 -0
- package/esm/packages/common/string/index.js +13 -0
- package/esm/packages/common/types/index.js +0 -0
- package/esm/packages/core/index.js +17 -12
- package/esm/packages/core/loader/model.js +3 -3
- package/esm/packages/core/loader/router.js +14 -5
- package/fe/frontend/dash/Dashboard.d.ts +7 -0
- package/fe/frontend/dash/Dashboard.js +63 -0
- package/fe/frontend/dash/dash.entry.d.ts +2 -0
- package/fe/frontend/dash/dash.entry.js +62 -0
- package/fe/frontend/index.d.ts +3 -0
- package/fe/frontend/index.js +1 -0
- package/fe/frontend/main.css +5 -1
- package/fe/frontend/main.d.ts +10 -3
- package/fe/frontend/main.js +13 -4
- package/fe/frontend/testPage/testPage.entry.js +1 -2
- package/fe/frontend/typing/window.d.ts +7 -0
- package/fe/frontend/typing/window.js +1 -0
- package/fe/frontend/widgets/api/baseInfo.d.ts +31 -0
- package/fe/frontend/widgets/api/baseInfo.js +15 -0
- package/fe/frontend/widgets/common/CRUD/CRUD.d.ts +70 -0
- package/fe/frontend/widgets/common/CRUD/CRUD.js +207 -0
- package/fe/frontend/widgets/common/CRUD/index.d.ts +2 -0
- package/fe/frontend/widgets/common/CRUD/index.js +1 -0
- package/fe/frontend/widgets/common/auth/index.d.ts +7 -0
- package/fe/frontend/widgets/common/auth/index.js +20 -0
- package/fe/frontend/widgets/common/generateMenuData.d.ts +4 -0
- package/fe/frontend/widgets/common/generateMenuData.js +14 -0
- package/fe/frontend/widgets/common/importComponent.d.ts +5 -0
- package/fe/frontend/widgets/common/importComponent.js +7 -0
- package/fe/frontend/widgets/common/language.d.ts +2 -0
- package/fe/frontend/widgets/common/language.js +8 -0
- package/fe/frontend/widgets/common/logFn/index.d.ts +4 -0
- package/fe/frontend/widgets/common/logFn/index.js +8 -0
- package/fe/frontend/widgets/common/menu.d.ts +22 -0
- package/fe/frontend/widgets/common/menu.js +80 -0
- package/fe/frontend/widgets/common/request.d.ts +33 -0
- package/fe/frontend/widgets/common/request.js +127 -0
- package/fe/frontend/widgets/components/BasePage/HeaderView.d.ts +9 -0
- package/fe/frontend/widgets/components/BasePage/HeaderView.js +14 -0
- package/fe/frontend/widgets/components/Router/index.d.ts +9 -0
- package/fe/frontend/widgets/components/Router/index.js +11 -0
- package/fe/frontend/widgets/components/Router/type.d.ts +2 -0
- package/fe/frontend/widgets/components/Router/type.js +1 -0
- package/fe/frontend/widgets/defaultPages/Iframe/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Iframe/index.js +14 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/DetailPanel.d.ts +7 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/DetailPanel.js +94 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/PopFrom.d.ts +13 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/PopFrom.js +109 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.js +6 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaSearch/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaSearch/index.js +58 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.d.ts +11 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.js +176 -0
- package/fe/frontend/widgets/defaultPages/Schema/data/eventInfo.d.ts +8 -0
- package/fe/frontend/widgets/defaultPages/Schema/data/eventInfo.js +6 -0
- package/fe/frontend/widgets/defaultPages/Schema/data/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/data/index.js +1 -0
- package/fe/frontend/widgets/defaultPages/Schema/hooks/useComConfig.d.ts +10 -0
- package/fe/frontend/widgets/defaultPages/Schema/hooks/useComConfig.js +14 -0
- package/fe/frontend/widgets/defaultPages/Schema/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/index.js +67 -0
- package/fe/frontend/widgets/defaultPages/Schema/schemaType.d.ts +41 -0
- package/fe/frontend/widgets/defaultPages/Schema/schemaType.js +4 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.d.ts +23 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.js +66 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.d.ts +33 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.js +24 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/fetchErrorShow.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/fetchErrorShow.js +8 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/permissions.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/permissions.js +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.js +72 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/validator.d.ts +4 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/validator.js +31 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +10 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +31 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.js +15 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPageTmp.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPageTmp.js +17 -0
- package/fe/frontend/widgets/defaultPages/SlotPage/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/SlotPage/index.js +24 -0
- package/fe/frontend/widgets/defaultPages/Todo.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Todo.js +5 -0
- package/fe/frontend/widgets/hooks/useCurrentMenuData.d.ts +11 -0
- package/fe/frontend/widgets/hooks/useCurrentMenuData.js +20 -0
- package/fe/frontend/widgets/hooks/useRouterParams.d.ts +5 -0
- package/fe/frontend/widgets/hooks/useRouterParams.js +11 -0
- package/fe/frontend/widgets/store/mode.d.ts +16 -0
- package/fe/frontend/widgets/store/mode.js +36 -0
- package/fe/model/types/data/button.d.ts +23 -0
- package/fe/model/types/data/button.js +1 -0
- package/fe/model/types/data/component.d.ts +37 -0
- package/fe/model/types/data/component.js +1 -0
- package/fe/model/types/data/fetchInfo.d.ts +8 -0
- package/fe/model/types/data/fetchInfo.js +1 -0
- package/fe/model/types/data/schema.d.ts +47 -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 +44 -0
- package/fe/model/types/menuType.js +1 -0
- package/fe/model/types/model.d.ts +20 -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/i18n/default.d.ts +87 -0
- package/fe/packages/common/i18n/default.js +85 -0
- package/fe/packages/common/i18n/en-US.d.ts +87 -0
- package/fe/packages/common/i18n/en-US.js +85 -0
- package/fe/packages/common/i18n/index.d.ts +19 -0
- package/fe/packages/common/i18n/index.js +142 -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 +47 -0
- package/fe/packages/common/i18n/types.js +1 -0
- package/fe/packages/common/index.d.ts +10 -0
- package/fe/packages/common/index.js +9 -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 +16 -30
- package/fe/packages/ui/react/components/Button/Button.js +53 -26
- package/fe/packages/ui/react/components/Button/SumbitButton.d.ts +2 -6
- package/fe/packages/ui/react/components/Button/SumbitButton.js +3 -14
- 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.d.ts → ConfirmDialog/ConfirmDialog.d.ts} +0 -8
- 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 +85 -4
- package/fe/packages/ui/react/components/DataTable/{data-table.d.ts → index.d.ts} +10 -23
- package/fe/packages/ui/react/components/DataTable/{data-table.js → index.js} +57 -47
- package/fe/packages/ui/react/components/Date/Calendar.d.ts +0 -13
- package/fe/packages/ui/react/components/Date/Calendar.js +5 -13
- package/fe/packages/ui/react/components/Date/Date.d.ts +4 -13
- package/fe/packages/ui/react/components/Date/Date.js +70 -66
- package/fe/packages/ui/react/components/Date/LocaleContext.d.ts +0 -4
- package/fe/packages/ui/react/components/Date/LocaleContext.js +0 -4
- package/fe/packages/ui/react/components/Date/LocaleProvider.d.ts +0 -11
- package/fe/packages/ui/react/components/Date/LocaleProvider.js +0 -11
- package/fe/packages/ui/react/components/Date/TimePicker.js +3 -2
- package/fe/packages/ui/react/components/Date/dateLocaleStore.d.ts +0 -6
- 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 -19
- package/fe/packages/ui/react/components/Date/locales.js +7 -47
- package/fe/packages/ui/react/components/Drawer/Drawer.d.ts +23 -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 +24 -0
- package/fe/packages/ui/react/components/Dropdown/Dropdown.js +28 -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.d.ts +0 -6
- package/fe/packages/ui/react/components/Form/Form.js +1 -1
- package/fe/packages/ui/react/components/Form/FormItem.d.ts +0 -21
- package/fe/packages/ui/react/components/Form/FormItem.js +2 -9
- package/fe/packages/ui/react/components/Form/SchemaForm/data.d.ts +45 -0
- package/fe/packages/ui/react/components/Form/{SchemeForm → SchemaForm}/data.js +8 -1
- package/fe/packages/ui/react/components/Form/SchemaForm/index.d.ts +60 -0
- package/fe/packages/ui/react/components/Form/SchemaForm/index.js +75 -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 -20
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.d.ts +0 -3
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.js +5 -2
- package/fe/packages/ui/react/components/Input/Input.d.ts +3 -21
- package/fe/packages/ui/react/components/Input/Input.js +5 -7
- package/fe/packages/ui/react/components/InputNumber/InputNumber.d.ts +26 -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.d.ts +0 -29
- package/fe/packages/ui/react/components/Label/Label.js +2 -4
- package/fe/packages/ui/react/components/Menu/Menu.d.ts +18 -0
- package/fe/packages/ui/react/components/Menu/Menu.js +98 -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 +3 -0
- package/fe/packages/ui/react/components/Menu/SubMenu.js +124 -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 +58 -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.d.ts +0 -7
- package/fe/packages/ui/react/components/Message/Message.js +4 -4
- package/fe/packages/ui/react/components/Message/MessageManager.js +0 -8
- package/fe/packages/ui/react/components/Modal/Modal.d.ts +3 -7
- package/fe/packages/ui/react/components/Modal/Modal.js +6 -44
- package/fe/packages/ui/react/components/Modal/ModalManager.d.ts +0 -12
- package/fe/packages/ui/react/components/Modal/ModalManager.js +5 -7
- package/fe/packages/ui/react/components/Overlay/Overlay.d.ts +20 -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.d.ts → Pagination/Pagination.d.ts} +0 -7
- package/fe/packages/ui/react/components/{Pagination.js → Pagination/Pagination.js} +5 -12
- 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 +69 -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 -5
- package/fe/packages/ui/react/components/Search/Search.js +3 -3
- package/fe/packages/ui/react/components/Select/Select.d.ts +2 -2
- package/fe/packages/ui/react/components/Select/Select.js +52 -113
- 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.d.ts +0 -15
- package/fe/packages/ui/react/components/Skeleton/Skeleton.js +3 -3
- package/fe/packages/ui/react/components/Switch/Switch.js +3 -1
- package/fe/packages/ui/react/components/TableSearch/TableSearch.d.ts +5 -41
- package/fe/packages/ui/react/components/TableSearch/TableSearch.js +21 -22
- package/fe/packages/ui/react/components/TableSearch/lang.js +5 -14
- package/fe/packages/ui/react/components/Textarea/Textarea.d.ts +21 -0
- package/fe/packages/ui/react/components/Textarea/Textarea.js +36 -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/Tooltip.d.ts +9 -0
- package/fe/packages/ui/react/components/Tooltip/Tooltip.js +71 -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.d.ts → TreeSelect/TreeSelect.d.ts} +0 -6
- package/fe/packages/ui/react/components/{TreeSelect.js → TreeSelect/TreeSelect.js} +9 -17
- 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.d.ts +0 -27
- package/fe/packages/ui/react/components/Upload/Upload.js +2 -1
- package/fe/packages/ui/react/components/{breadcrumb.js → breadcrumb/breadcrumb.js} +15 -21
- 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 +43 -0
- package/fe/packages/ui/react/components/hooks/useDropdownPositioning.js +123 -0
- package/fe/packages/ui/react/components/hooks/useInputController.d.ts +0 -3
- package/fe/packages/ui/react/components/hooks/useInputController.js +0 -7
- 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/table.js +20 -0
- package/fe/packages/ui/react/components/testPage/MenuTestPage.d.ts +2 -0
- package/fe/packages/ui/react/components/testPage/MenuTestPage.js +101 -0
- package/fe/packages/ui/react/components/testPage/index.js +251 -81
- package/fe/packages/ui/react/hooks/useExecuteOnce.d.ts +12 -0
- package/fe/packages/ui/react/hooks/useExecuteOnce.js +36 -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 +18 -0
- package/fe/packages/ui/react/hooks/useRefState.js +28 -0
- package/fe/packages/ui/react/hooks/useWatch.d.ts +15 -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 +13 -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 +9 -0
- package/fe/packages/ui/react/i18n/useI18n.js +14 -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 -2
- 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 -46
- package/fe/packages/ui/react/lib/export.js +0 -40
- package/fe/packages/ui/react/lib/utils.d.ts +0 -24
- package/fe/packages/ui/react/lib/utils.js +0 -25
- package/fe/packages/ui/react/stores/breadcrumb.js +0 -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/package.json +14 -2
- package/types/app/controller/base.d.ts +3 -3
- package/types/app/router/view.d.ts +2 -3
- package/types/app/service/project.d.ts +29 -4
- package/types/app/type.d.ts +1 -0
- package/types/app/typings.d.ts +12 -21
- package/types/bundler/defaultAlias.d.ts +3 -0
- package/types/bundler/utils.d.ts +1 -1
- package/types/config/config.default.d.ts +14 -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/i18n/default.d.ts +86 -0
- package/types/packages/common/i18n/en-US.d.ts +86 -0
- package/types/packages/common/i18n/index.d.ts +18 -0
- package/types/packages/common/i18n/locales.d.ts +7 -0
- package/types/packages/common/i18n/types.d.ts +46 -0
- package/types/packages/common/index.d.ts +9 -0
- package/types/packages/common/log/index.d.ts +32 -0
- package/types/packages/common/number/index.d.ts +2 -0
- package/types/packages/common/object/filterEmpty.d.ts +2 -0
- package/types/packages/common/object/filtereEmpty.d.ts +1 -0
- package/types/packages/common/object/index.d.ts +4 -0
- package/types/packages/common/string/index.d.ts +3 -0
- package/types/packages/common/types/index.d.ts +3 -0
- package/types/packages/core/index.d.ts +1 -1
- package/types/packages/core/loader/router.d.ts +1 -1
- package/types/packages/core/types.d.ts +12 -3
- package/fe/packages/ui/react/components/ConfirmDialog.js +0 -9
- 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/index.d.ts +0 -152
- package/fe/packages/ui/react/components/Form/SchemeForm/index.js +0 -69
- package/fe/packages/ui/react/components/Textarea.d.ts +0 -59
- package/fe/packages/ui/react/components/Textarea.js +0 -35
- package/fe/packages/ui/react/components/Tooltip.d.ts +0 -25
- 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/fe/packages/ui/react/components/{breadcrumb.d.ts → breadcrumb/breadcrumb.d.ts} +0 -0
- /package/fe/packages/ui/react/components/{table.d.ts → table/table.d.ts} +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare const defaultLanguageResources: {
|
|
2
|
+
readonly common: {
|
|
3
|
+
readonly tip: "提示";
|
|
4
|
+
readonly confirm: "确认";
|
|
5
|
+
readonly cancel: "取消";
|
|
6
|
+
readonly close: "关闭";
|
|
7
|
+
readonly submit: "提交";
|
|
8
|
+
readonly reset: "重置";
|
|
9
|
+
};
|
|
10
|
+
readonly components: {
|
|
11
|
+
readonly breadcrumb: {
|
|
12
|
+
readonly close: "关闭";
|
|
13
|
+
};
|
|
14
|
+
readonly confirmDialog: {
|
|
15
|
+
readonly title: "提示";
|
|
16
|
+
readonly okText: "确认";
|
|
17
|
+
readonly cancelText: "取消";
|
|
18
|
+
};
|
|
19
|
+
readonly dataTable: {
|
|
20
|
+
readonly noData: "暂无数据";
|
|
21
|
+
};
|
|
22
|
+
readonly date: {
|
|
23
|
+
readonly placeholder: "请选择日期";
|
|
24
|
+
readonly placeholderDateTime: "请选择日期时间";
|
|
25
|
+
readonly placeholderRange: "选择日期范围";
|
|
26
|
+
readonly placeholderDateTimeRange: "选择日期时间范围";
|
|
27
|
+
readonly weekDays: readonly ["日", "一", "二", "三", "四", "五", "六"];
|
|
28
|
+
readonly selectTime: "选择时间";
|
|
29
|
+
readonly startTime: "开始时间";
|
|
30
|
+
readonly endTime: "结束时间";
|
|
31
|
+
readonly confirm: "确认";
|
|
32
|
+
readonly monthFormat: "yyyy年 M月";
|
|
33
|
+
readonly quickRanges: "快速选择";
|
|
34
|
+
readonly quickRangeToday: "今天";
|
|
35
|
+
readonly quickRangeYesterday: "昨天";
|
|
36
|
+
readonly quickRangeLast7Days: "近7天";
|
|
37
|
+
readonly quickRangeLast30Days: "近30天";
|
|
38
|
+
readonly quickRangeThisMonth: "本月";
|
|
39
|
+
readonly quickRangeLastYear: "最近一年";
|
|
40
|
+
readonly clear: "清除";
|
|
41
|
+
};
|
|
42
|
+
readonly form: {
|
|
43
|
+
readonly submit: "提交";
|
|
44
|
+
readonly cancel: "取消";
|
|
45
|
+
};
|
|
46
|
+
readonly imagePreview: {
|
|
47
|
+
readonly closePreview: "关闭预览";
|
|
48
|
+
readonly previousImage: "上一张";
|
|
49
|
+
readonly nextImage: "下一张";
|
|
50
|
+
readonly zoomOut: "缩小";
|
|
51
|
+
readonly zoomIn: "放大";
|
|
52
|
+
readonly reset: "重置";
|
|
53
|
+
readonly rotateLeft: "左旋转";
|
|
54
|
+
readonly rotateRight: "右旋转";
|
|
55
|
+
readonly flipHorizontal: "左右镜像";
|
|
56
|
+
readonly flipVertical: "上下镜像";
|
|
57
|
+
readonly previewImage: "预览第{index}张";
|
|
58
|
+
};
|
|
59
|
+
readonly modal: {
|
|
60
|
+
readonly close: "关闭";
|
|
61
|
+
readonly confirmTitle: "提示";
|
|
62
|
+
readonly okText: "确认";
|
|
63
|
+
readonly cancelText: "取消";
|
|
64
|
+
};
|
|
65
|
+
readonly message: {
|
|
66
|
+
readonly close: "关闭";
|
|
67
|
+
};
|
|
68
|
+
readonly select: {
|
|
69
|
+
readonly empty: "暂无选项";
|
|
70
|
+
};
|
|
71
|
+
readonly tableSearch: {
|
|
72
|
+
readonly reset: "重置";
|
|
73
|
+
readonly search: "查询";
|
|
74
|
+
readonly export: "导出Excel";
|
|
75
|
+
readonly expand: "展开";
|
|
76
|
+
readonly collapse: "收起";
|
|
77
|
+
readonly exportCurrentPage: "当前页";
|
|
78
|
+
readonly exportCurrentQuery: "当前查询条件";
|
|
79
|
+
};
|
|
80
|
+
readonly upload: {
|
|
81
|
+
readonly deleteImage: "删除图片";
|
|
82
|
+
readonly upload: "上传";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export type DefaultLanguageResources = typeof defaultLanguageResources;
|
|
87
|
+
//# sourceMappingURL=default.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export const defaultLanguageResources = {
|
|
2
|
+
common: {
|
|
3
|
+
tip: '提示',
|
|
4
|
+
confirm: '确认',
|
|
5
|
+
cancel: '取消',
|
|
6
|
+
close: '关闭',
|
|
7
|
+
submit: '提交',
|
|
8
|
+
reset: '重置',
|
|
9
|
+
},
|
|
10
|
+
components: {
|
|
11
|
+
breadcrumb: {
|
|
12
|
+
close: '关闭',
|
|
13
|
+
},
|
|
14
|
+
confirmDialog: {
|
|
15
|
+
title: '提示',
|
|
16
|
+
okText: '确认',
|
|
17
|
+
cancelText: '取消',
|
|
18
|
+
},
|
|
19
|
+
dataTable: {
|
|
20
|
+
noData: '暂无数据',
|
|
21
|
+
},
|
|
22
|
+
date: {
|
|
23
|
+
placeholder: '请选择日期',
|
|
24
|
+
placeholderDateTime: '请选择日期时间',
|
|
25
|
+
placeholderRange: '选择日期范围',
|
|
26
|
+
placeholderDateTimeRange: '选择日期时间范围',
|
|
27
|
+
weekDays: ['日', '一', '二', '三', '四', '五', '六'],
|
|
28
|
+
selectTime: '选择时间',
|
|
29
|
+
startTime: '开始时间',
|
|
30
|
+
endTime: '结束时间',
|
|
31
|
+
confirm: '确认',
|
|
32
|
+
monthFormat: 'yyyy年 M月',
|
|
33
|
+
quickRanges: '快速选择',
|
|
34
|
+
quickRangeToday: '今天',
|
|
35
|
+
quickRangeYesterday: '昨天',
|
|
36
|
+
quickRangeLast7Days: '近7天',
|
|
37
|
+
quickRangeLast30Days: '近30天',
|
|
38
|
+
quickRangeThisMonth: '本月',
|
|
39
|
+
quickRangeLastYear: '最近一年',
|
|
40
|
+
clear: '清除',
|
|
41
|
+
},
|
|
42
|
+
form: {
|
|
43
|
+
submit: '提交',
|
|
44
|
+
cancel: '取消',
|
|
45
|
+
},
|
|
46
|
+
imagePreview: {
|
|
47
|
+
closePreview: '关闭预览',
|
|
48
|
+
previousImage: '上一张',
|
|
49
|
+
nextImage: '下一张',
|
|
50
|
+
zoomOut: '缩小',
|
|
51
|
+
zoomIn: '放大',
|
|
52
|
+
reset: '重置',
|
|
53
|
+
rotateLeft: '左旋转',
|
|
54
|
+
rotateRight: '右旋转',
|
|
55
|
+
flipHorizontal: '左右镜像',
|
|
56
|
+
flipVertical: '上下镜像',
|
|
57
|
+
previewImage: '预览第{index}张',
|
|
58
|
+
},
|
|
59
|
+
modal: {
|
|
60
|
+
close: '关闭',
|
|
61
|
+
confirmTitle: '提示',
|
|
62
|
+
okText: '确认',
|
|
63
|
+
cancelText: '取消',
|
|
64
|
+
},
|
|
65
|
+
message: {
|
|
66
|
+
close: '关闭',
|
|
67
|
+
},
|
|
68
|
+
select: {
|
|
69
|
+
empty: '暂无选项',
|
|
70
|
+
},
|
|
71
|
+
tableSearch: {
|
|
72
|
+
reset: '重置',
|
|
73
|
+
search: '查询',
|
|
74
|
+
export: '导出Excel',
|
|
75
|
+
expand: '展开',
|
|
76
|
+
collapse: '收起',
|
|
77
|
+
exportCurrentPage: '当前页',
|
|
78
|
+
exportCurrentQuery: '当前查询条件',
|
|
79
|
+
},
|
|
80
|
+
upload: {
|
|
81
|
+
deleteImage: '删除图片',
|
|
82
|
+
upload: '上传',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare const defaultEnglishResources: {
|
|
2
|
+
readonly common: {
|
|
3
|
+
readonly tip: "Prompt";
|
|
4
|
+
readonly confirm: "Confirm";
|
|
5
|
+
readonly cancel: "Cancel";
|
|
6
|
+
readonly close: "Close";
|
|
7
|
+
readonly submit: "Submit";
|
|
8
|
+
readonly reset: "Reset";
|
|
9
|
+
};
|
|
10
|
+
readonly components: {
|
|
11
|
+
readonly breadcrumb: {
|
|
12
|
+
readonly close: "Close";
|
|
13
|
+
};
|
|
14
|
+
readonly confirmDialog: {
|
|
15
|
+
readonly title: "Prompt";
|
|
16
|
+
readonly okText: "Confirm";
|
|
17
|
+
readonly cancelText: "Cancel";
|
|
18
|
+
};
|
|
19
|
+
readonly dataTable: {
|
|
20
|
+
readonly noData: "No Data";
|
|
21
|
+
};
|
|
22
|
+
readonly date: {
|
|
23
|
+
readonly placeholder: "Select date";
|
|
24
|
+
readonly placeholderDateTime: "Select date and time";
|
|
25
|
+
readonly placeholderRange: "Select date range";
|
|
26
|
+
readonly placeholderDateTimeRange: "Select date and time range";
|
|
27
|
+
readonly weekDays: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
28
|
+
readonly selectTime: "Select time";
|
|
29
|
+
readonly startTime: "Start time";
|
|
30
|
+
readonly endTime: "End time";
|
|
31
|
+
readonly confirm: "Confirm";
|
|
32
|
+
readonly monthFormat: "MMM yyyy";
|
|
33
|
+
readonly quickRanges: "Quick ranges";
|
|
34
|
+
readonly quickRangeToday: "Today";
|
|
35
|
+
readonly quickRangeYesterday: "Yesterday";
|
|
36
|
+
readonly quickRangeLast7Days: "Last 7 days";
|
|
37
|
+
readonly quickRangeLast30Days: "Last 30 days";
|
|
38
|
+
readonly quickRangeThisMonth: "This month";
|
|
39
|
+
readonly quickRangeLastYear: "Last year";
|
|
40
|
+
readonly clear: "Clear";
|
|
41
|
+
};
|
|
42
|
+
readonly form: {
|
|
43
|
+
readonly submit: "Submit";
|
|
44
|
+
readonly cancel: "Cancel";
|
|
45
|
+
};
|
|
46
|
+
readonly imagePreview: {
|
|
47
|
+
readonly closePreview: "Close preview";
|
|
48
|
+
readonly previousImage: "Previous image";
|
|
49
|
+
readonly nextImage: "Next image";
|
|
50
|
+
readonly zoomOut: "Zoom out";
|
|
51
|
+
readonly zoomIn: "Zoom in";
|
|
52
|
+
readonly reset: "Reset";
|
|
53
|
+
readonly rotateLeft: "Rotate left";
|
|
54
|
+
readonly rotateRight: "Rotate right";
|
|
55
|
+
readonly flipHorizontal: "Flip horizontal";
|
|
56
|
+
readonly flipVertical: "Flip vertical";
|
|
57
|
+
readonly previewImage: "Preview image {index}";
|
|
58
|
+
};
|
|
59
|
+
readonly modal: {
|
|
60
|
+
readonly close: "Close";
|
|
61
|
+
readonly confirmTitle: "Prompt";
|
|
62
|
+
readonly okText: "Confirm";
|
|
63
|
+
readonly cancelText: "Cancel";
|
|
64
|
+
};
|
|
65
|
+
readonly message: {
|
|
66
|
+
readonly close: "Close";
|
|
67
|
+
};
|
|
68
|
+
readonly select: {
|
|
69
|
+
readonly empty: "No options";
|
|
70
|
+
};
|
|
71
|
+
readonly tableSearch: {
|
|
72
|
+
readonly reset: "Reset";
|
|
73
|
+
readonly search: "Search";
|
|
74
|
+
readonly export: "Export Excel";
|
|
75
|
+
readonly expand: "Expand";
|
|
76
|
+
readonly collapse: "Collapse";
|
|
77
|
+
readonly exportCurrentPage: "Current Page";
|
|
78
|
+
readonly exportCurrentQuery: "Current Filters";
|
|
79
|
+
};
|
|
80
|
+
readonly upload: {
|
|
81
|
+
readonly deleteImage: "Delete image";
|
|
82
|
+
readonly upload: "Upload";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export type DefaultEnglishResources = typeof defaultEnglishResources;
|
|
87
|
+
//# sourceMappingURL=en-US.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export const defaultEnglishResources = {
|
|
2
|
+
common: {
|
|
3
|
+
tip: 'Prompt',
|
|
4
|
+
confirm: 'Confirm',
|
|
5
|
+
cancel: 'Cancel',
|
|
6
|
+
close: 'Close',
|
|
7
|
+
submit: 'Submit',
|
|
8
|
+
reset: 'Reset',
|
|
9
|
+
},
|
|
10
|
+
components: {
|
|
11
|
+
breadcrumb: {
|
|
12
|
+
close: 'Close',
|
|
13
|
+
},
|
|
14
|
+
confirmDialog: {
|
|
15
|
+
title: 'Prompt',
|
|
16
|
+
okText: 'Confirm',
|
|
17
|
+
cancelText: 'Cancel',
|
|
18
|
+
},
|
|
19
|
+
dataTable: {
|
|
20
|
+
noData: 'No Data',
|
|
21
|
+
},
|
|
22
|
+
date: {
|
|
23
|
+
placeholder: 'Select date',
|
|
24
|
+
placeholderDateTime: 'Select date and time',
|
|
25
|
+
placeholderRange: 'Select date range',
|
|
26
|
+
placeholderDateTimeRange: 'Select date and time range',
|
|
27
|
+
weekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
28
|
+
selectTime: 'Select time',
|
|
29
|
+
startTime: 'Start time',
|
|
30
|
+
endTime: 'End time',
|
|
31
|
+
confirm: 'Confirm',
|
|
32
|
+
monthFormat: 'MMM yyyy',
|
|
33
|
+
quickRanges: 'Quick ranges',
|
|
34
|
+
quickRangeToday: 'Today',
|
|
35
|
+
quickRangeYesterday: 'Yesterday',
|
|
36
|
+
quickRangeLast7Days: 'Last 7 days',
|
|
37
|
+
quickRangeLast30Days: 'Last 30 days',
|
|
38
|
+
quickRangeThisMonth: 'This month',
|
|
39
|
+
quickRangeLastYear: 'Last year',
|
|
40
|
+
clear: 'Clear',
|
|
41
|
+
},
|
|
42
|
+
form: {
|
|
43
|
+
submit: 'Submit',
|
|
44
|
+
cancel: 'Cancel',
|
|
45
|
+
},
|
|
46
|
+
imagePreview: {
|
|
47
|
+
closePreview: 'Close preview',
|
|
48
|
+
previousImage: 'Previous image',
|
|
49
|
+
nextImage: 'Next image',
|
|
50
|
+
zoomOut: 'Zoom out',
|
|
51
|
+
zoomIn: 'Zoom in',
|
|
52
|
+
reset: 'Reset',
|
|
53
|
+
rotateLeft: 'Rotate left',
|
|
54
|
+
rotateRight: 'Rotate right',
|
|
55
|
+
flipHorizontal: 'Flip horizontal',
|
|
56
|
+
flipVertical: 'Flip vertical',
|
|
57
|
+
previewImage: 'Preview image {index}',
|
|
58
|
+
},
|
|
59
|
+
modal: {
|
|
60
|
+
close: 'Close',
|
|
61
|
+
confirmTitle: 'Prompt',
|
|
62
|
+
okText: 'Confirm',
|
|
63
|
+
cancelText: 'Cancel',
|
|
64
|
+
},
|
|
65
|
+
message: {
|
|
66
|
+
close: 'Close',
|
|
67
|
+
},
|
|
68
|
+
select: {
|
|
69
|
+
empty: 'No options',
|
|
70
|
+
},
|
|
71
|
+
tableSearch: {
|
|
72
|
+
reset: 'Reset',
|
|
73
|
+
search: 'Search',
|
|
74
|
+
export: 'Export Excel',
|
|
75
|
+
expand: 'Expand',
|
|
76
|
+
collapse: 'Collapse',
|
|
77
|
+
exportCurrentPage: 'Current Page',
|
|
78
|
+
exportCurrentQuery: 'Current Filters',
|
|
79
|
+
},
|
|
80
|
+
upload: {
|
|
81
|
+
deleteImage: 'Delete image',
|
|
82
|
+
upload: 'Upload',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { I18nDictionary, I18nInterpolationValues, I18nMessage, I18nResources, I18nStore, I18nStoreListener, I18nTranslateOptions, I18nTranslateState } from './types';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './locales';
|
|
4
|
+
export declare const isPlainI18nDictionary: (value: I18nMessage) => value is I18nDictionary;
|
|
5
|
+
export declare const mergeI18nDictionary: (base?: I18nDictionary, patch?: I18nDictionary) => I18nDictionary;
|
|
6
|
+
export declare const mergeI18nResources: (base?: I18nResources, patch?: I18nResources) => I18nResources;
|
|
7
|
+
export declare const getI18nPathValue: (dictionary: I18nDictionary | undefined, key: string) => I18nMessage | undefined;
|
|
8
|
+
export declare const interpolateI18nMessage: (value: string, data?: I18nInterpolationValues) => string;
|
|
9
|
+
export declare const translate: <T = string>(state: I18nTranslateState, key: string, fillingData?: I18nInterpolationValues, options?: I18nTranslateOptions) => T | string;
|
|
10
|
+
export declare const i18nStore: {
|
|
11
|
+
getState: () => I18nStore;
|
|
12
|
+
getInitialState: () => I18nStore;
|
|
13
|
+
setState: (partial: Partial<I18nStore> | ((state: I18nStore) => Partial<I18nStore>)) => void;
|
|
14
|
+
subscribe: (listener: I18nStoreListener) => () => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const i18n: <T = string>(key: string, fillingData?: I18nInterpolationValues, options?: I18nTranslateOptions) => string | T;
|
|
17
|
+
export declare const t: <T = string>(key: string, fillingData?: I18nInterpolationValues, options?: I18nTranslateOptions) => string | T;
|
|
18
|
+
export declare const getLanguage: <T = string>(key: string, fillingData?: I18nInterpolationValues, options?: I18nTranslateOptions) => string | T;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { defaultLanguage, languageLocalKey, translations } from './locales';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './locales';
|
|
4
|
+
export const isPlainI18nDictionary = (value) => {
|
|
5
|
+
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
6
|
+
};
|
|
7
|
+
export const mergeI18nDictionary = (base = {}, patch = {}) => {
|
|
8
|
+
const next = { ...base };
|
|
9
|
+
Object.entries(patch).forEach(([key, value]) => {
|
|
10
|
+
const current = next[key];
|
|
11
|
+
if (isPlainI18nDictionary(current) && isPlainI18nDictionary(value)) {
|
|
12
|
+
next[key] = mergeI18nDictionary(current, value);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
next[key] = value;
|
|
16
|
+
});
|
|
17
|
+
return next;
|
|
18
|
+
};
|
|
19
|
+
export const mergeI18nResources = (base = {}, patch = {}) => {
|
|
20
|
+
const next = { ...base };
|
|
21
|
+
Object.entries(patch).forEach(([language, messages]) => {
|
|
22
|
+
if (!messages)
|
|
23
|
+
return;
|
|
24
|
+
next[language] = mergeI18nDictionary(next[language], messages);
|
|
25
|
+
});
|
|
26
|
+
return next;
|
|
27
|
+
};
|
|
28
|
+
export const getI18nPathValue = (dictionary, key) => {
|
|
29
|
+
if (!dictionary)
|
|
30
|
+
return undefined;
|
|
31
|
+
return key.split('.').reduce((value, currentKey) => {
|
|
32
|
+
if (!isPlainI18nDictionary(value))
|
|
33
|
+
return undefined;
|
|
34
|
+
return value[currentKey];
|
|
35
|
+
}, dictionary);
|
|
36
|
+
};
|
|
37
|
+
export const interpolateI18nMessage = (value, data) => {
|
|
38
|
+
if (!data)
|
|
39
|
+
return value;
|
|
40
|
+
return value.replace(/\{([A-Za-z0-9_]+)\}/g, (match, key) => {
|
|
41
|
+
const nextValue = data[key];
|
|
42
|
+
return typeof nextValue === 'undefined' || nextValue === null ? match : String(nextValue);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
export const translate = (state, key, fillingData, options) => {
|
|
46
|
+
const language = options?.language || state.language;
|
|
47
|
+
const fallbackLanguage = options?.fallbackLanguage || state.fallbackLanguage;
|
|
48
|
+
const value = getI18nPathValue(state.resources[language], key) ??
|
|
49
|
+
getI18nPathValue(state.resources[fallbackLanguage], key) ??
|
|
50
|
+
options?.fallback ??
|
|
51
|
+
key;
|
|
52
|
+
return (typeof value === 'string' ? interpolateI18nMessage(value, fillingData) : value);
|
|
53
|
+
};
|
|
54
|
+
const getBrowserWindow = () => {
|
|
55
|
+
return globalThis.window;
|
|
56
|
+
};
|
|
57
|
+
const getStoredLanguage = (storageKey) => {
|
|
58
|
+
const windowRef = getBrowserWindow();
|
|
59
|
+
if (!windowRef) {
|
|
60
|
+
return defaultLanguage;
|
|
61
|
+
}
|
|
62
|
+
return windowRef.localStorage.getItem(storageKey) || defaultLanguage;
|
|
63
|
+
};
|
|
64
|
+
const persistLanguage = (storageKey, language) => {
|
|
65
|
+
const windowRef = getBrowserWindow();
|
|
66
|
+
if (!windowRef)
|
|
67
|
+
return;
|
|
68
|
+
windowRef.localStorage.setItem(storageKey, language);
|
|
69
|
+
};
|
|
70
|
+
const createInitialState = () => ({
|
|
71
|
+
language: getStoredLanguage(languageLocalKey),
|
|
72
|
+
fallbackLanguage: defaultLanguage,
|
|
73
|
+
resources: translations,
|
|
74
|
+
storageKey: languageLocalKey,
|
|
75
|
+
persist: true,
|
|
76
|
+
});
|
|
77
|
+
const createI18nStore = () => {
|
|
78
|
+
let state;
|
|
79
|
+
const listeners = new Set();
|
|
80
|
+
const setState = (partial) => {
|
|
81
|
+
const previousState = state;
|
|
82
|
+
const nextPartial = typeof partial === 'function' ? partial(state) : partial;
|
|
83
|
+
state = { ...state, ...nextPartial };
|
|
84
|
+
listeners.forEach((listener) => listener(state, previousState));
|
|
85
|
+
};
|
|
86
|
+
const initialState = createInitialState();
|
|
87
|
+
state = {
|
|
88
|
+
...initialState,
|
|
89
|
+
t: (key, fillingData, options) => i18n(key, fillingData, options),
|
|
90
|
+
setLanguage: (language) => {
|
|
91
|
+
setState({ language });
|
|
92
|
+
const { persist, storageKey } = state;
|
|
93
|
+
if (persist) {
|
|
94
|
+
persistLanguage(storageKey, language);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
setFallbackLanguage: (fallbackLanguage) => {
|
|
98
|
+
setState({ fallbackLanguage });
|
|
99
|
+
},
|
|
100
|
+
setResources: (resources, options) => {
|
|
101
|
+
setState((currentState) => ({
|
|
102
|
+
resources: options?.merge ? mergeI18nResources(currentState.resources, resources) : resources,
|
|
103
|
+
}));
|
|
104
|
+
},
|
|
105
|
+
addResources: (language, messages, options) => {
|
|
106
|
+
setState((currentState) => {
|
|
107
|
+
const shouldMerge = options?.merge ?? true;
|
|
108
|
+
const currentMessages = currentState.resources[language];
|
|
109
|
+
return {
|
|
110
|
+
resources: {
|
|
111
|
+
...currentState.resources,
|
|
112
|
+
[language]: shouldMerge ? mergeI18nDictionary(currentMessages, messages) : messages,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
configureI18n: (config) => {
|
|
118
|
+
setState(config);
|
|
119
|
+
},
|
|
120
|
+
resetI18n: () => {
|
|
121
|
+
setState(createInitialState());
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
const initialStoreState = state;
|
|
125
|
+
return {
|
|
126
|
+
getState: () => state,
|
|
127
|
+
getInitialState: () => initialStoreState,
|
|
128
|
+
setState,
|
|
129
|
+
subscribe: (listener) => {
|
|
130
|
+
listeners.add(listener);
|
|
131
|
+
return () => {
|
|
132
|
+
listeners.delete(listener);
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
export const i18nStore = createI18nStore();
|
|
138
|
+
export const i18n = (key, fillingData, options) => {
|
|
139
|
+
return translate(i18nStore.getState(), key, fillingData, options);
|
|
140
|
+
};
|
|
141
|
+
export const t = i18n;
|
|
142
|
+
export const getLanguage = i18n;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { I18nResources } from './types';
|
|
2
|
+
export declare const defaultLanguage: "zh-CN";
|
|
3
|
+
export declare const languageLocalKey = "tc_language";
|
|
4
|
+
export declare const translations: I18nResources;
|
|
5
|
+
export type Language = keyof typeof translations | (string & {});
|
|
6
|
+
export * from './default';
|
|
7
|
+
export * from './en-US';
|
|
8
|
+
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defaultLanguageResources } from './default';
|
|
2
|
+
import { defaultEnglishResources } from './en-US';
|
|
3
|
+
export const defaultLanguage = 'zh-CN';
|
|
4
|
+
export const languageLocalKey = 'tc_language';
|
|
5
|
+
export const translations = {
|
|
6
|
+
'zh-CN': defaultLanguageResources,
|
|
7
|
+
'en-US': defaultEnglishResources,
|
|
8
|
+
};
|
|
9
|
+
export * from './default';
|
|
10
|
+
export * from './en-US';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type I18nLanguage = string;
|
|
2
|
+
export type I18nPrimitive = string | number | boolean | null | undefined;
|
|
3
|
+
export type I18nMessage = I18nPrimitive | I18nMessage[] | readonly I18nMessage[] | I18nDictionary;
|
|
4
|
+
export interface I18nDictionary {
|
|
5
|
+
[key: string]: I18nMessage;
|
|
6
|
+
}
|
|
7
|
+
export type I18nResources<Language extends I18nLanguage = I18nLanguage> = Partial<Record<Language, I18nDictionary>>;
|
|
8
|
+
export type I18nInterpolationValues = Record<string, I18nPrimitive>;
|
|
9
|
+
export interface I18nTranslateState {
|
|
10
|
+
language: I18nLanguage;
|
|
11
|
+
fallbackLanguage: I18nLanguage;
|
|
12
|
+
resources: I18nResources;
|
|
13
|
+
}
|
|
14
|
+
export interface I18nState extends I18nTranslateState {
|
|
15
|
+
storageKey: string;
|
|
16
|
+
persist: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface I18nTranslateOptions {
|
|
19
|
+
language?: I18nLanguage;
|
|
20
|
+
fallbackLanguage?: I18nLanguage;
|
|
21
|
+
fallback?: I18nMessage;
|
|
22
|
+
}
|
|
23
|
+
export interface I18nSetResourcesOptions {
|
|
24
|
+
merge?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface I18nAddResourcesOptions {
|
|
27
|
+
merge?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export type I18nTranslator = <T = string>(key: string, fillingData?: I18nInterpolationValues, options?: I18nTranslateOptions) => T | string;
|
|
30
|
+
export interface I18nActions {
|
|
31
|
+
setLanguage: (language: I18nLanguage) => void;
|
|
32
|
+
setFallbackLanguage: (language: I18nLanguage) => void;
|
|
33
|
+
setResources: (resources: I18nResources, options?: I18nSetResourcesOptions) => void;
|
|
34
|
+
addResources: (language: I18nLanguage, messages: I18nDictionary, options?: I18nAddResourcesOptions) => void;
|
|
35
|
+
configureI18n: (config: Partial<Pick<I18nState, 'storageKey' | 'persist'>>) => void;
|
|
36
|
+
resetI18n: () => void;
|
|
37
|
+
t: I18nTranslator;
|
|
38
|
+
}
|
|
39
|
+
export type I18nStore = I18nState & I18nActions;
|
|
40
|
+
export type I18nStoreListener = (state: I18nStore, previousState: I18nStore) => void;
|
|
41
|
+
export interface I18nStoreApi {
|
|
42
|
+
getState: () => I18nStore;
|
|
43
|
+
getInitialState: () => I18nStore;
|
|
44
|
+
setState: (partial: Partial<I18nStore> | ((state: I18nStore) => Partial<I18nStore>)) => void;
|
|
45
|
+
subscribe: (listener: I18nStoreListener) => () => void;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./array";
|
|
2
|
+
export * from "./cache";
|
|
3
|
+
export * from "./guards";
|
|
4
|
+
export * from "./i18n";
|
|
5
|
+
export * from "./log";
|
|
6
|
+
export * from "./number";
|
|
7
|
+
export * from "./object";
|
|
8
|
+
export * from "./string";
|
|
9
|
+
export * from "./types";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const ANSI_RESET = "\u001B[0m";
|
|
2
|
+
export declare const ansiColors: {
|
|
3
|
+
readonly black: "\u001B[30m";
|
|
4
|
+
readonly red: "\u001B[31m";
|
|
5
|
+
readonly green: "\u001B[32m";
|
|
6
|
+
readonly yellow: "\u001B[33m";
|
|
7
|
+
readonly blue: "\u001B[34m";
|
|
8
|
+
readonly magenta: "\u001B[35m";
|
|
9
|
+
readonly pink: "\u001B[95m";
|
|
10
|
+
readonly cyan: "\u001B[36m";
|
|
11
|
+
readonly white: "\u001B[37m";
|
|
12
|
+
readonly gray: "\u001B[90m";
|
|
13
|
+
};
|
|
14
|
+
export type LogColor = keyof typeof ansiColors;
|
|
15
|
+
export type ColorLogOptions = {
|
|
16
|
+
color?: LogColor;
|
|
17
|
+
prefix?: string;
|
|
18
|
+
suffix?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ColorLogAffixes = Omit<ColorLogOptions, 'color'>;
|
|
21
|
+
export declare const colorize: (message: unknown, color?: LogColor) => string;
|
|
22
|
+
export declare const joinColorized: (...messages: readonly unknown[]) => string;
|
|
23
|
+
export declare const logJoinColorized: (...messages: readonly unknown[]) => void;
|
|
24
|
+
export declare function colorLog(color: LogColor, ...data: unknown[]): void;
|
|
25
|
+
export declare function colorLog(...data: unknown[]): void;
|
|
26
|
+
export declare const logColor: (color: LogColor, ...data: unknown[]) => void;
|
|
27
|
+
export declare const logColorized: (...messages: readonly unknown[]) => void;
|
|
28
|
+
export declare const logGreen: (...data: unknown[]) => void;
|
|
29
|
+
export declare const logYellow: (...data: unknown[]) => void;
|
|
30
|
+
export declare const logPink: (...data: unknown[]) => void;
|
|
31
|
+
export declare const logWhite: (...data: unknown[]) => void;
|
|
32
|
+
export declare const logRed: (...data: unknown[]) => void;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|