@_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
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_tc/template-core",
|
|
3
|
-
"version": "0.0.1-bate.
|
|
3
|
+
"version": "0.0.1-bate.37",
|
|
4
4
|
"description": "A TypeScript Koa framework template - Monorepo root",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
"require": "./fe/frontend/main.js",
|
|
21
21
|
"types": "./fe/frontend/main.d.js"
|
|
22
22
|
},
|
|
23
|
+
"./fe": {
|
|
24
|
+
"import": "./fe/frontend/index.js",
|
|
25
|
+
"require": "./fe/frontend/index.js",
|
|
26
|
+
"types": "./fe/frontend/index.d.js"
|
|
27
|
+
},
|
|
23
28
|
"./fe/rc": {
|
|
24
29
|
"import": "./fe/packages/ui/react/index.js",
|
|
25
30
|
"require": "./fe/packages/ui/react/index.js",
|
|
@@ -29,13 +34,20 @@
|
|
|
29
34
|
"import": "./fe/packages/ui/react/*",
|
|
30
35
|
"require": "./fe/packages/ui/react/*",
|
|
31
36
|
"types": "./fe/packages/ui/react/*"
|
|
32
|
-
}
|
|
37
|
+
},
|
|
38
|
+
"./fe/*": {
|
|
39
|
+
"import": "./fe/frontend/*",
|
|
40
|
+
"require": "./fe/frontend/*",
|
|
41
|
+
"types": "./fe/frontend/*"
|
|
42
|
+
},
|
|
43
|
+
"./fe/tailwind_ui.css": "./fe/frontend/main.css"
|
|
33
44
|
},
|
|
34
45
|
"dependencies": {
|
|
35
46
|
"@babel/runtime": "^7.27.6",
|
|
36
47
|
"@tailwindcss/vite": "^4.2.4",
|
|
37
48
|
"ajv": "^8.18.0",
|
|
38
49
|
"glob": "^10.3.10",
|
|
50
|
+
"immer": "^11.1.7",
|
|
39
51
|
"knex": "^3.2.3",
|
|
40
52
|
"koa-bodyparser": "^4.4.1",
|
|
41
53
|
"koa-compress": "^5.2.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
1
|
+
import type { Ctx, KoaApp } from "../type";
|
|
2
|
+
declare const getBaseController: (app: KoaApp) => {
|
|
3
3
|
new (): {
|
|
4
4
|
readonly app: KoaApp;
|
|
5
5
|
readonly config: KoaApp["config"];
|
|
@@ -9,4 +9,4 @@ declare const _default: (app: KoaApp) => {
|
|
|
9
9
|
sendData(ctx: Ctx, data?: unknown, code?: number, message?: string | null, status?: number): void;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
-
export default
|
|
12
|
+
export default getBaseController;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { KoaApp } from "../type";
|
|
2
|
-
|
|
3
|
-
declare const _default: (app: KoaApp, router: Router) => void;
|
|
1
|
+
import type { KoaApp, KoaRouter } from "../type";
|
|
2
|
+
declare const _default: (app: KoaApp, router: KoaRouter) => void;
|
|
4
3
|
export default _default;
|
|
@@ -1,16 +1,41 @@
|
|
|
1
1
|
import type { KoaApp } from "../type";
|
|
2
|
+
type LeftMenuType = {};
|
|
3
|
+
type TopMenuType = {};
|
|
2
4
|
export interface ProjectItem {
|
|
3
|
-
|
|
5
|
+
mode: string;
|
|
6
|
+
homePage: string;
|
|
7
|
+
icon: string;
|
|
4
8
|
name: string;
|
|
5
9
|
desc: string;
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
menuLayout: "top" | "left";
|
|
11
|
+
menu: [
|
|
12
|
+
{
|
|
13
|
+
key: string;
|
|
14
|
+
name: string;
|
|
15
|
+
menuType: string;
|
|
16
|
+
subMenu: (LeftMenuType | TopMenuType)[];
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
menuType: string;
|
|
20
|
+
moduleType: string;
|
|
21
|
+
key: string;
|
|
22
|
+
name: string;
|
|
23
|
+
sidebarConfig: {}[];
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
key: string;
|
|
27
|
+
modelKey: string;
|
|
8
28
|
}
|
|
9
29
|
export interface ModelItem {
|
|
10
30
|
model: {
|
|
11
|
-
|
|
31
|
+
mode: string;
|
|
32
|
+
homePage: string;
|
|
33
|
+
icon: string;
|
|
12
34
|
name: string;
|
|
13
35
|
desc: string;
|
|
36
|
+
menuLayout: string;
|
|
37
|
+
menu: (LeftMenuType | TopMenuType)[];
|
|
38
|
+
key: string;
|
|
14
39
|
};
|
|
15
40
|
project: Record<string, ProjectItem>;
|
|
16
41
|
}
|
package/types/app/type.d.ts
CHANGED
package/types/app/typings.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import type { FrameworkAugment, KoaApp, KoaAppExtensions } from "../packages/core/index";
|
|
2
|
-
import type
|
|
1
|
+
import type { FrameworkAugment, KoaApp, KoaAppExtensions, KoaRouter } from "../packages/core/index";
|
|
2
|
+
import type { DefaultAppConfig } from "../config/config.default";
|
|
3
3
|
import type getProjectController from "./controller/project";
|
|
4
4
|
import type getViewController from "./controller/view";
|
|
5
5
|
import type getDB from "./extend/db";
|
|
6
|
-
import type getLogger from "./extend/logger";
|
|
7
6
|
import type generateErrorMessage from "./extend/generateErrorMessage";
|
|
7
|
+
import type getLogger from "./extend/logger";
|
|
8
8
|
import type parsingParamsOnUrl from "./extend/parsingParamsOnUrl";
|
|
9
9
|
import renderView from "./extend/render-view";
|
|
10
|
+
import type getProjectService from "./service/project";
|
|
10
11
|
type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
|
|
11
12
|
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;
|
|
12
|
-
declare module
|
|
13
|
+
declare module '../packages/core/index' {
|
|
13
14
|
namespace FrameworkAugment {
|
|
14
15
|
interface IServiceAugmented {
|
|
15
16
|
project: GetInstance<typeof getProjectService>;
|
|
@@ -23,28 +24,18 @@ declare module "../packages/core/index" {
|
|
|
23
24
|
logger: UnwrapPromise<ReturnType<typeof getLogger>>;
|
|
24
25
|
generateErrorMessage: ReturnType<typeof generateErrorMessage>;
|
|
25
26
|
parsingParamsOnUrl: ReturnType<typeof parsingParamsOnUrl>;
|
|
26
|
-
nunjucksEnv: import(
|
|
27
|
+
nunjucksEnv: import('nunjucks').Environment;
|
|
27
28
|
renderView: ReturnType<typeof renderView>;
|
|
28
29
|
}
|
|
29
30
|
interface IMiddlewaresAugmented {
|
|
30
|
-
errorHandle: import(
|
|
31
|
-
apiSignVerify: import(
|
|
32
|
-
apiParamsVerify: import(
|
|
33
|
-
projectHandler: import(
|
|
31
|
+
errorHandle: import('koa').Middleware;
|
|
32
|
+
apiSignVerify: import('koa').Middleware;
|
|
33
|
+
apiParamsVerify: import('koa').Middleware;
|
|
34
|
+
projectHandler: import('koa').Middleware;
|
|
34
35
|
}
|
|
35
|
-
interface AppConfigAugmented {
|
|
36
|
-
frameName: string;
|
|
37
|
-
port?: number;
|
|
38
|
-
host?: string;
|
|
39
|
-
env?: string;
|
|
40
|
-
apiSignVerify?: {
|
|
41
|
-
whiteList?: string[];
|
|
42
|
-
};
|
|
43
|
-
viewsPath?: string;
|
|
44
|
-
nunjucks?: import("nunjucks").ConfigureOptions;
|
|
36
|
+
interface AppConfigAugmented extends DefaultAppConfig {
|
|
45
37
|
}
|
|
46
38
|
}
|
|
47
39
|
}
|
|
48
|
-
export type { FrameworkAugment };
|
|
49
40
|
export { KoaAppExtensions };
|
|
50
|
-
export type { KoaApp };
|
|
41
|
+
export type { FrameworkAugment, KoaApp, KoaRouter };
|
package/types/bundler/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function entries(): Record<string, string>;
|
|
2
2
|
export declare function outDir(): string;
|
|
3
3
|
export declare const watchFiles: (callback?: () => Promise<any>) => Promise<void>;
|
|
4
|
-
export declare const VBuildFE: (input: Record<string, string
|
|
4
|
+
export declare const VBuildFE: (input: Record<string, string>, OperatingEnv?: "dev" | "prod") => Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DefaultAppConfig {
|
|
2
|
+
frameName: string;
|
|
3
|
+
port?: number;
|
|
4
|
+
host?: string;
|
|
5
|
+
env?: string;
|
|
6
|
+
apiSignVerify?: {
|
|
7
|
+
whiteList?: string[];
|
|
8
|
+
};
|
|
9
|
+
viewsPath?: string;
|
|
10
|
+
nunjucks?: import("nunjucks").ConfigureOptions;
|
|
11
|
+
notFoundRedirectCount: number;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: DefaultAppConfig;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LRUCache } from "./cache/LRUCache";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function toArray<T>(value: readonly T[]): T[];
|
|
2
|
+
export declare function toArray<T>(value: T | null | undefined): T[];
|
|
3
|
+
export declare const compact: <T>(items: readonly (T | null | undefined)[]) => T[];
|
|
4
|
+
export declare const uniqueBy: <T, K extends PropertyKey>(items: readonly T[], getKey: (item: T) => K) => T[];
|
|
5
|
+
export declare const groupBy: <T, K extends PropertyKey>(items: readonly T[], getKey: (item: T) => K) => Record<K, T[]>;
|
|
6
|
+
export declare const chunk: <T>(items: readonly T[], size: number) => T[][];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class LRUCache<T> {
|
|
2
|
+
private readonly limit;
|
|
3
|
+
private readonly data;
|
|
4
|
+
constructor(limit: number);
|
|
5
|
+
get size(): number;
|
|
6
|
+
has(k: string): boolean;
|
|
7
|
+
get(k: string): NonNullable<T> | undefined;
|
|
8
|
+
set(k: string, v: T): void;
|
|
9
|
+
push(k: string, v: T): void;
|
|
10
|
+
private deleteFirstKey;
|
|
11
|
+
private updateSorting;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LRUCache";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Dictionary, Maybe } from "../types";
|
|
2
|
+
export declare const isNil: <T>(value: Maybe<T>) => value is null | undefined;
|
|
3
|
+
export declare const isNonNullable: <T>(value: T) => value is NonNullable<T>;
|
|
4
|
+
export declare const isString: (value: unknown) => value is string;
|
|
5
|
+
export declare const isNumber: (value: unknown) => value is number;
|
|
6
|
+
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
7
|
+
export declare const isFunction: <TArgs extends unknown[], TResult>(value: unknown) => value is (...args: TArgs) => TResult;
|
|
8
|
+
export declare const isPlainObject: (value: unknown) => value is Dictionary;
|
|
@@ -0,0 +1,86 @@
|
|
|
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;
|
|
@@ -0,0 +1,86 @@
|
|
|
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;
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { I18nResources } from "./types";
|
|
2
|
+
export declare const defaultLanguage: "zh-CN";
|
|
3
|
+
export declare const languageLocalKey = "tc_language";
|
|
4
|
+
export declare const translations: I18nResources;
|
|
5
|
+
export type Language = keyof typeof translations | (string & {});
|
|
6
|
+
export * from "./default";
|
|
7
|
+
export * from "./en-US";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type I18nLanguage = string;
|
|
2
|
+
export type I18nPrimitive = string | number | boolean | null | undefined;
|
|
3
|
+
export type I18nMessage = I18nPrimitive | I18nMessage[] | readonly I18nMessage[] | I18nDictionary;
|
|
4
|
+
export interface I18nDictionary {
|
|
5
|
+
[key: string]: I18nMessage;
|
|
6
|
+
}
|
|
7
|
+
export type I18nResources<Language extends I18nLanguage = I18nLanguage> = Partial<Record<Language, I18nDictionary>>;
|
|
8
|
+
export type I18nInterpolationValues = Record<string, I18nPrimitive>;
|
|
9
|
+
export interface I18nTranslateState {
|
|
10
|
+
language: I18nLanguage;
|
|
11
|
+
fallbackLanguage: I18nLanguage;
|
|
12
|
+
resources: I18nResources;
|
|
13
|
+
}
|
|
14
|
+
export interface I18nState extends I18nTranslateState {
|
|
15
|
+
storageKey: string;
|
|
16
|
+
persist: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface I18nTranslateOptions {
|
|
19
|
+
language?: I18nLanguage;
|
|
20
|
+
fallbackLanguage?: I18nLanguage;
|
|
21
|
+
fallback?: I18nMessage;
|
|
22
|
+
}
|
|
23
|
+
export interface I18nSetResourcesOptions {
|
|
24
|
+
merge?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface I18nAddResourcesOptions {
|
|
27
|
+
merge?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export type I18nTranslator = <T = string>(key: string, fillingData?: I18nInterpolationValues, options?: I18nTranslateOptions) => T | string;
|
|
30
|
+
export interface I18nActions {
|
|
31
|
+
setLanguage: (language: I18nLanguage) => void;
|
|
32
|
+
setFallbackLanguage: (language: I18nLanguage) => void;
|
|
33
|
+
setResources: (resources: I18nResources, options?: I18nSetResourcesOptions) => void;
|
|
34
|
+
addResources: (language: I18nLanguage, messages: I18nDictionary, options?: I18nAddResourcesOptions) => void;
|
|
35
|
+
configureI18n: (config: Partial<Pick<I18nState, 'storageKey' | 'persist'>>) => void;
|
|
36
|
+
resetI18n: () => void;
|
|
37
|
+
t: I18nTranslator;
|
|
38
|
+
}
|
|
39
|
+
export type I18nStore = I18nState & I18nActions;
|
|
40
|
+
export type I18nStoreListener = (state: I18nStore, previousState: I18nStore) => void;
|
|
41
|
+
export interface I18nStoreApi {
|
|
42
|
+
getState: () => I18nStore;
|
|
43
|
+
getInitialState: () => I18nStore;
|
|
44
|
+
setState: (partial: Partial<I18nStore> | ((state: I18nStore) => Partial<I18nStore>)) => void;
|
|
45
|
+
subscribe: (listener: I18nStoreListener) => () => void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const ANSI_RESET = "\u001B[0m";
|
|
2
|
+
export declare const ansiColors: {
|
|
3
|
+
readonly black: "\u001B[30m";
|
|
4
|
+
readonly red: "\u001B[31m";
|
|
5
|
+
readonly green: "\u001B[32m";
|
|
6
|
+
readonly yellow: "\u001B[33m";
|
|
7
|
+
readonly blue: "\u001B[34m";
|
|
8
|
+
readonly magenta: "\u001B[35m";
|
|
9
|
+
readonly pink: "\u001B[95m";
|
|
10
|
+
readonly cyan: "\u001B[36m";
|
|
11
|
+
readonly white: "\u001B[37m";
|
|
12
|
+
readonly gray: "\u001B[90m";
|
|
13
|
+
};
|
|
14
|
+
export type LogColor = keyof typeof ansiColors;
|
|
15
|
+
export type ColorLogOptions = {
|
|
16
|
+
color?: LogColor;
|
|
17
|
+
prefix?: string;
|
|
18
|
+
suffix?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ColorLogAffixes = Omit<ColorLogOptions, 'color'>;
|
|
21
|
+
export declare const colorize: (message: unknown, color?: LogColor) => string;
|
|
22
|
+
export declare const joinColorized: (...messages: readonly unknown[]) => string;
|
|
23
|
+
export declare const logJoinColorized: (...messages: readonly unknown[]) => void;
|
|
24
|
+
export declare function colorLog(color: LogColor, ...data: unknown[]): void;
|
|
25
|
+
export declare function colorLog(...data: unknown[]): void;
|
|
26
|
+
export declare const logColor: (color: LogColor, ...data: unknown[]) => void;
|
|
27
|
+
export declare const logColorized: (...messages: readonly unknown[]) => void;
|
|
28
|
+
export declare const logGreen: (...data: unknown[]) => void;
|
|
29
|
+
export declare const logYellow: (...data: unknown[]) => void;
|
|
30
|
+
export declare const logPink: (...data: unknown[]) => void;
|
|
31
|
+
export declare const logWhite: (...data: unknown[]) => void;
|
|
32
|
+
export declare const logRed: (...data: unknown[]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { filterEmpty, filtereEmpty } from "./filterEmpty";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from "./filterEmpty";
|
|
2
|
+
export declare const pick: <T extends object, K extends keyof T>(target: T, keys: readonly K[]) => Pick<T, K>;
|
|
3
|
+
export declare const omit: <T extends object, K extends keyof T>(target: T, keys: readonly K[]) => Omit<T, K>;
|
|
4
|
+
export declare const mapValues: <T extends object, TResult>(target: T, mapper: <K extends keyof T>(value: T[K], key: K) => TResult) => { [K in keyof T]: TResult; };
|
|
@@ -2,5 +2,5 @@ import "./types";
|
|
|
2
2
|
import "../../app/typings";
|
|
3
3
|
import type { KoaApp, StartOptions } from "./types";
|
|
4
4
|
export declare const loaderModel: (app: KoaApp) => import("./loader/model").ModelConfig;
|
|
5
|
-
export type { AppConfig, AppOptions, StartOptions, KoaMiddleware, ProcessingFileCallbackFN, IService, IController, IExtends, IMiddlewares, KoaApp, KoaAppExtensions, FrameworkAugment, } from "./types";
|
|
5
|
+
export type { AppConfig, AppOptions, StartOptions, KoaMiddleware, ProcessingFileCallbackFN, IService, IController, IExtends, IMiddlewares, KoaApp, KoaRouter, KoaAppExtensions, FrameworkAugment, } from "./types";
|
|
6
6
|
export declare const start: (options?: StartOptions) => KoaApp;
|