@_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
|
@@ -13,7 +13,6 @@ koa_router = require_runtime.__toESM(koa_router, 1);
|
|
|
13
13
|
* 解析 xx/app/router/下的所有文件 加载到 koa-router上
|
|
14
14
|
*/
|
|
15
15
|
var router_default = (app) => {
|
|
16
|
-
const router = new koa_router.default();
|
|
17
16
|
let routerGuard;
|
|
18
17
|
try {
|
|
19
18
|
const businessPath = require_packages_core_paths.getAppPath(app, "business");
|
|
@@ -21,8 +20,12 @@ var router_default = (app) => {
|
|
|
21
20
|
} catch (error) {
|
|
22
21
|
console.info("-- [router-guard] -- not router-guard.js file");
|
|
23
22
|
}
|
|
23
|
+
const routers = [];
|
|
24
24
|
require_packages_core_paths.getAppPaths(app).forEach((currentPath) => {
|
|
25
25
|
require_packages_utils_loadFile.loadFileFn(currentPath, "router", { preProcessingFileCallback: (filePath) => {
|
|
26
|
+
const router = new koa_router.default();
|
|
27
|
+
router.level = 0;
|
|
28
|
+
routers.push(router);
|
|
26
29
|
/**
|
|
27
30
|
* module.export = (app,router) => {
|
|
28
31
|
* router.get('/xxx/xxxx', app.controller)
|
|
@@ -31,7 +34,9 @@ var router_default = (app) => {
|
|
|
31
34
|
require_packages_utils_runFileFn.runFileFn(require(require_packages_utils_path.resolve(filePath)))(app, router);
|
|
32
35
|
} });
|
|
33
36
|
});
|
|
34
|
-
|
|
37
|
+
const BaseRouters = new koa_router.default();
|
|
38
|
+
BaseRouters.level = 99;
|
|
39
|
+
BaseRouters.get("(.*)", async (ctx, _next) => {
|
|
35
40
|
console.info("\x1B[31m%s\x1B[0m", `-- notFound path: ${ctx.path} --`);
|
|
36
41
|
ctx.status = 302;
|
|
37
42
|
const executionResults = routerGuard?.(ctx);
|
|
@@ -41,9 +46,13 @@ var router_default = (app) => {
|
|
|
41
46
|
ctx.body = "notFound";
|
|
42
47
|
}
|
|
43
48
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
routers.push(BaseRouters);
|
|
50
|
+
routers.sort((r, nr) => (r.level ?? 0) < (nr.level ?? 0) ? -1 : 1);
|
|
51
|
+
routers.forEach((r) => {
|
|
52
|
+
app.use(r.routes());
|
|
53
|
+
app.use(r.allowedMethods());
|
|
54
|
+
});
|
|
55
|
+
app.currentUseRouter = routers;
|
|
47
56
|
};
|
|
48
57
|
//#endregion
|
|
49
58
|
module.exports = router_default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region app/controller/base.ts
|
|
2
|
-
var
|
|
2
|
+
var getBaseController = (app) => class BaseController {
|
|
3
3
|
app;
|
|
4
4
|
config;
|
|
5
5
|
constructor() {
|
|
@@ -20,9 +20,9 @@ var base_default = (app) => class BaseController {
|
|
|
20
20
|
ctx.body = {
|
|
21
21
|
data,
|
|
22
22
|
code,
|
|
23
|
-
message
|
|
23
|
+
message: message ?? "ok"
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
//#endregion
|
|
28
|
-
export {
|
|
28
|
+
export { getBaseController as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getBaseController from "./base.js";
|
|
2
2
|
//#region app/controller/project.ts
|
|
3
3
|
var getProjectController = (app) => {
|
|
4
|
-
const BaseController =
|
|
4
|
+
const BaseController = getBaseController(app);
|
|
5
5
|
return class ProjectController extends BaseController {
|
|
6
6
|
getModelList = async (ctx) => {
|
|
7
7
|
const dtoModelList = (await this.service.project.getModelList()).reduce((preList, item) => {
|
|
@@ -31,7 +31,7 @@ var getProjectController = (app) => {
|
|
|
31
31
|
this.success(ctx, dtoModelList);
|
|
32
32
|
};
|
|
33
33
|
getProjectList = async (ctx) => {
|
|
34
|
-
const {
|
|
34
|
+
const { projk: projectKey } = ctx.query;
|
|
35
35
|
const dtoProject = (await this.service.project.getList(projectKey))?.map((project) => {
|
|
36
36
|
const { modelKey, key, name, desc, homePage } = project;
|
|
37
37
|
return {
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
//#region app/controller/view.ts
|
|
2
2
|
var getViewController = (app) => class ViewController {
|
|
3
3
|
async renderPage(ctx) {
|
|
4
|
-
app.extends.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
app.extends.logger.log(" - render page: " + ctx.params.page);
|
|
5
|
+
try {
|
|
6
|
+
app.extends.renderView(`dist/${ctx.params.page}.entry.tpl`, ctx, {
|
|
7
|
+
projKey: ctx.query.projk,
|
|
8
|
+
name: app.options?.name,
|
|
9
|
+
env: app.envs.get(),
|
|
10
|
+
basePath: `${app.options.pageBasePage}${ctx.params.page}`,
|
|
11
|
+
options: JSON.stringify(app.options)
|
|
12
|
+
});
|
|
13
|
+
} catch (error) {
|
|
14
|
+
app.extends.generateErrorMessage("template not found", {
|
|
15
|
+
status: 404,
|
|
16
|
+
showError: true,
|
|
17
|
+
code: 0
|
|
18
|
+
});
|
|
19
|
+
}
|
|
11
20
|
}
|
|
12
21
|
};
|
|
13
22
|
//#endregion
|
|
@@ -12,7 +12,16 @@ var validateFN = (key, data, schema) => {
|
|
|
12
12
|
var api_params_verify_default = (app) => async (ctx, next) => {
|
|
13
13
|
const { path, method } = ctx;
|
|
14
14
|
if (path.indexOf("/api") < 0) return next();
|
|
15
|
-
const
|
|
15
|
+
const currentUseRouter = app.currentUseRouter;
|
|
16
|
+
let route;
|
|
17
|
+
for (const r of currentUseRouter) {
|
|
18
|
+
const data = r.match(path, "get");
|
|
19
|
+
if (data) {
|
|
20
|
+
route = data;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const routePath = route?.path[0]?.path;
|
|
16
25
|
if (routePath) {
|
|
17
26
|
const params = app.extends.parsingParamsOnUrl(routePath, path);
|
|
18
27
|
const { body, query, headers } = ctx.request;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//#region app/middleware/error-handle.ts
|
|
2
|
+
var redirectInfo = {};
|
|
2
3
|
var error_handle_default = (app) => async (ctx, next) => {
|
|
3
4
|
try {
|
|
4
5
|
await next();
|
|
@@ -8,9 +9,14 @@ var error_handle_default = (app) => async (ctx, next) => {
|
|
|
8
9
|
app.extends.logger?.error("-- [excption] --", error);
|
|
9
10
|
app.extends.logger?.error("-- [excption] info --", status, message, detail);
|
|
10
11
|
if (message?.includes("template not found")) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const url = ctx.req.url;
|
|
13
|
+
if (redirectInfo[url] !== void 0) redirectInfo[url] += 1;
|
|
14
|
+
else redirectInfo[url] = 0;
|
|
15
|
+
if (redirectInfo[url] < app.config.notFoundRedirectCount) {
|
|
16
|
+
ctx.status = 302;
|
|
17
|
+
ctx.redirect(app.options?.homePage ?? "/");
|
|
18
|
+
return;
|
|
19
|
+
} else redirectInfo[url] = 0;
|
|
14
20
|
}
|
|
15
21
|
if (returnError) {
|
|
16
22
|
ctx.status = status;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region app/middleware/project-handler.ts
|
|
2
2
|
var project_handler_default = () => async (ctx, next) => {
|
|
3
|
-
const key = ctx.headers.
|
|
3
|
+
const key = ctx.headers.projk;
|
|
4
4
|
const { path } = ctx;
|
|
5
5
|
if (path.indexOf("/api/proj/") !== -1) {
|
|
6
6
|
if (!key || ["undefined", "null"].includes(key)) {
|
package/esm/app/router/view.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
//#region app/router/view.ts
|
|
2
2
|
var view_default = (app, router) => {
|
|
3
|
-
|
|
3
|
+
const { pageBasePage } = app.options;
|
|
4
|
+
router.level = 2;
|
|
5
|
+
router.get([`${pageBasePage}:page`, `${pageBasePage}:page/:r(.*)`], app.controller.view.renderPage.bind(app.controller.view));
|
|
4
6
|
};
|
|
5
7
|
//#endregion
|
|
6
8
|
export { view_default as default };
|
package/esm/bundler/dev.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { logGreen, logRed } from "../packages/common/log/index.js";
|
|
1
2
|
import { VBuildFE, entries, watchFiles } from "./utils.js";
|
|
2
3
|
//#region bundler/dev.ts
|
|
3
4
|
var init = async () => {
|
|
4
5
|
const input = entries();
|
|
5
|
-
|
|
6
|
+
logGreen(input);
|
|
6
7
|
if (!Object.keys(input).length) {
|
|
7
|
-
|
|
8
|
+
logRed("no entry found");
|
|
8
9
|
process.exit(1);
|
|
9
10
|
}
|
|
10
|
-
await VBuildFE(input);
|
|
11
|
+
await VBuildFE(input, "dev");
|
|
11
12
|
};
|
|
12
13
|
async function dev() {
|
|
13
14
|
await init();
|
package/esm/bundler/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { logRed } from "../packages/common/log/index.js";
|
|
1
2
|
import { dev } from "./dev.js";
|
|
2
3
|
import { prod } from "./prod.js";
|
|
3
4
|
//#region bundler/index.ts
|
|
@@ -9,7 +10,7 @@ var buildFE = (mode) => {
|
|
|
9
10
|
case "prod":
|
|
10
11
|
prod();
|
|
11
12
|
break;
|
|
12
|
-
default:
|
|
13
|
+
default: logRed("Usage: npx tsx scripts/index.ts [dev|prod]");
|
|
13
14
|
}
|
|
14
15
|
};
|
|
15
16
|
//#endregion
|
package/esm/bundler/prod.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import { logGreen, logRed } from "../packages/common/log/index.js";
|
|
1
2
|
import { VBuildFE, entries } from "./utils.js";
|
|
2
3
|
//#region bundler/prod.ts
|
|
3
4
|
async function prod() {
|
|
4
5
|
const input = entries();
|
|
5
6
|
if (!Object.keys(input).length) {
|
|
6
|
-
|
|
7
|
+
logRed("no entry found");
|
|
7
8
|
process.exit(1);
|
|
8
9
|
}
|
|
9
10
|
try {
|
|
10
11
|
await VBuildFE(input);
|
|
11
|
-
|
|
12
|
+
logGreen("build done");
|
|
12
13
|
} catch (err) {
|
|
13
|
-
|
|
14
|
+
logRed(String(err));
|
|
14
15
|
process.exit(1);
|
|
15
16
|
}
|
|
16
17
|
}
|
package/esm/bundler/utils.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { resolve as resolve$1 } from "../packages/utils/path.js";
|
|
2
2
|
import "../packages/utils/index.js";
|
|
3
|
+
import { colorize, logJoinColorized, logRed, logWhite, logYellow } from "../packages/common/log/index.js";
|
|
3
4
|
import path from "path";
|
|
4
5
|
import * as glob from "glob";
|
|
5
|
-
import { build } from "vite";
|
|
6
|
-
import { copyFileSync, existsSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "fs";
|
|
7
6
|
import tailwindcss from "@tailwindcss/vite";
|
|
7
|
+
import { copyFileSync, existsSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "fs";
|
|
8
|
+
import { build } from "vite";
|
|
8
9
|
//#region bundler/utils.ts
|
|
9
10
|
var base = process.cwd();
|
|
10
11
|
var framePath = path.resolve(__dirname, "../../");
|
|
@@ -18,8 +19,8 @@ var runFEPath = path.resolve(runPath, "./frontend");
|
|
|
18
19
|
* 生成入口
|
|
19
20
|
*/
|
|
20
21
|
function entries() {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
logWhite("frameFEPath: " + frameFEPath);
|
|
23
|
+
logWhite("runFEPath: " + runFEPath);
|
|
23
24
|
/**
|
|
24
25
|
* 所有包含 entry 的文件
|
|
25
26
|
*/
|
|
@@ -72,12 +73,11 @@ var watchFiles = async (callback) => {
|
|
|
72
73
|
watcher.on("change", async (filePath) => {
|
|
73
74
|
if (building) return;
|
|
74
75
|
building = true;
|
|
75
|
-
|
|
76
|
+
logYellow(`changed: ${filePath}`);
|
|
76
77
|
await callback?.();
|
|
77
|
-
console.log("rebuild done");
|
|
78
78
|
building = false;
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
logYellow(`watching ${runFEPath}/...`);
|
|
81
81
|
};
|
|
82
82
|
/**
|
|
83
83
|
*
|
|
@@ -122,26 +122,55 @@ function flattenHtmlPlugin(suffix = ".html") {
|
|
|
122
122
|
* ------------------
|
|
123
123
|
*/
|
|
124
124
|
const endFiles = glob.sync("**/*" + suffix, { cwd: feDir });
|
|
125
|
-
for (const f of endFiles)
|
|
125
|
+
for (const f of endFiles) logYellow("final file path -----> " + f);
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
129
|
+
/**
|
|
130
|
+
* 处理别名目录兜底
|
|
131
|
+
* 如果 alias 指向的路径不存在,则使用 ./defaultAlias 兜底文件
|
|
132
|
+
*/
|
|
133
|
+
function resolveAliasWithFallback(aliasList) {
|
|
134
|
+
const aliasExtensions = [
|
|
135
|
+
"",
|
|
136
|
+
".ts",
|
|
137
|
+
".tsx",
|
|
138
|
+
".js",
|
|
139
|
+
".jsx"
|
|
140
|
+
];
|
|
141
|
+
return aliasList.reduce((o, [aliasName, aliasPath]) => {
|
|
142
|
+
const businessFilePath = aliasExtensions.map((ext) => path.resolve(runFEPath, aliasPath + ext)).find((filePath) => existsSync(filePath));
|
|
143
|
+
let filePath = path.resolve(__dirname, "./defaultAlias");
|
|
144
|
+
if (businessFilePath) filePath = businessFilePath;
|
|
145
|
+
o[aliasName] = filePath;
|
|
146
|
+
return o;
|
|
147
|
+
}, {});
|
|
148
|
+
}
|
|
149
|
+
var VBuildFE = async (input, OperatingEnv) => {
|
|
150
|
+
try {
|
|
151
|
+
await build({
|
|
152
|
+
configFile: false,
|
|
153
|
+
base: "/dist",
|
|
154
|
+
plugins: [
|
|
155
|
+
(await import("@vitejs/plugin-react")).default(),
|
|
156
|
+
flattenHtmlPlugin(".tpl"),
|
|
157
|
+
tailwindcss()
|
|
158
|
+
],
|
|
159
|
+
build: {
|
|
160
|
+
outDir: outDir(),
|
|
161
|
+
emptyOutDir: true,
|
|
162
|
+
sourcemap: OperatingEnv === "dev" ? "inline" : "hidden",
|
|
163
|
+
rollupOptions: { input }
|
|
164
|
+
},
|
|
165
|
+
resolve: { alias: {
|
|
166
|
+
"@tc/ui-react": path.resolve(__dirname, "../../fe/packages/ui/react/"),
|
|
167
|
+
...resolveAliasWithFallback([["$business/SchemaForm/data", "./extended/SchemaForm/data"]])
|
|
168
|
+
} }
|
|
169
|
+
});
|
|
170
|
+
logJoinColorized(colorize("builded", "green"), colorize(" -> ", "white"), colorize("time: ", "cyan"), colorize(/* @__PURE__ */ new Date(), "pink"));
|
|
171
|
+
} catch (error) {
|
|
172
|
+
logRed(error);
|
|
173
|
+
}
|
|
145
174
|
};
|
|
146
175
|
//#endregion
|
|
147
176
|
export { VBuildFE, entries, outDir, watchFiles };
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getBaseController from "./app/controller/base.js";
|
|
2
2
|
import bese_default from "./app/service/bese.js";
|
|
3
3
|
import { resolve } from "./packages/utils/path.js";
|
|
4
4
|
import "./packages/utils/index.js";
|
|
@@ -12,7 +12,7 @@ var serverStart = (options) => {
|
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
14
|
var baseFn = {
|
|
15
|
-
baseControllerFn:
|
|
15
|
+
baseControllerFn: getBaseController,
|
|
16
16
|
baseServiceFn: bese_default
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { isNonNullable } from "../guards/index.js";
|
|
2
|
+
//#region packages/common/array/index.ts
|
|
3
|
+
function toArray(value) {
|
|
4
|
+
if (value === null || value === void 0) return [];
|
|
5
|
+
return Array.isArray(value) ? [...value] : [value];
|
|
6
|
+
}
|
|
7
|
+
var compact = (items) => {
|
|
8
|
+
return items.filter(isNonNullable);
|
|
9
|
+
};
|
|
10
|
+
var uniqueBy = (items, getKey) => {
|
|
11
|
+
const keys = /* @__PURE__ */ new Set();
|
|
12
|
+
const result = [];
|
|
13
|
+
for (const item of items) {
|
|
14
|
+
const key = getKey(item);
|
|
15
|
+
if (keys.has(key)) continue;
|
|
16
|
+
keys.add(key);
|
|
17
|
+
result.push(item);
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var groupBy = (items, getKey) => {
|
|
22
|
+
const result = {};
|
|
23
|
+
for (const item of items) {
|
|
24
|
+
const key = getKey(item);
|
|
25
|
+
result[key] = result[key] ?? [];
|
|
26
|
+
result[key].push(item);
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
30
|
+
var chunk = (items, size) => {
|
|
31
|
+
if (!Number.isInteger(size) || size <= 0) throw new RangeError("chunk size must be a positive integer");
|
|
32
|
+
const result = [];
|
|
33
|
+
for (let index = 0; index < items.length; index += size) result.push(items.slice(index, index + size));
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { chunk, compact, groupBy, toArray, uniqueBy };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region packages/common/cache/LRUCache.ts
|
|
2
|
+
var LRUCache = class {
|
|
3
|
+
limit;
|
|
4
|
+
data;
|
|
5
|
+
constructor(limit) {
|
|
6
|
+
if (!Number.isInteger(limit) || limit <= 0) throw new Error("LRUCache limit must be a positive integer");
|
|
7
|
+
this.limit = limit;
|
|
8
|
+
this.data = /* @__PURE__ */ new Map();
|
|
9
|
+
}
|
|
10
|
+
get size() {
|
|
11
|
+
return this.data.size;
|
|
12
|
+
}
|
|
13
|
+
has(k) {
|
|
14
|
+
return this.data.has(k);
|
|
15
|
+
}
|
|
16
|
+
get(k) {
|
|
17
|
+
if (!this.data.has(k)) return void 0;
|
|
18
|
+
const value = this.data.get(k);
|
|
19
|
+
this.updateSorting(k, value);
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
set(k, v) {
|
|
23
|
+
if (this.data.has(k)) {
|
|
24
|
+
this.updateSorting(k, v);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (this.data.size >= this.limit) this.deleteFirstKey();
|
|
28
|
+
this.data.set(k, v);
|
|
29
|
+
}
|
|
30
|
+
push(k, v) {
|
|
31
|
+
this.set(k, v);
|
|
32
|
+
}
|
|
33
|
+
deleteFirstKey() {
|
|
34
|
+
const firstKey = this.data.keys().next().value;
|
|
35
|
+
if (firstKey !== void 0) this.data.delete(firstKey);
|
|
36
|
+
}
|
|
37
|
+
updateSorting(k, v) {
|
|
38
|
+
this.data.delete(k);
|
|
39
|
+
this.data.set(k, v);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { LRUCache };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region packages/common/guards/index.ts
|
|
2
|
+
var isNil = (value) => {
|
|
3
|
+
return value === null || value === void 0;
|
|
4
|
+
};
|
|
5
|
+
var isNonNullable = (value) => {
|
|
6
|
+
return value !== null && value !== void 0;
|
|
7
|
+
};
|
|
8
|
+
var isString = (value) => {
|
|
9
|
+
return typeof value === "string";
|
|
10
|
+
};
|
|
11
|
+
var isNumber = (value) => {
|
|
12
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
13
|
+
};
|
|
14
|
+
var isBoolean = (value) => {
|
|
15
|
+
return typeof value === "boolean";
|
|
16
|
+
};
|
|
17
|
+
var isFunction = (value) => {
|
|
18
|
+
return typeof value === "function";
|
|
19
|
+
};
|
|
20
|
+
var isPlainObject = (value) => {
|
|
21
|
+
if (value === null || typeof value !== "object") return false;
|
|
22
|
+
const prototype = Object.getPrototypeOf(value);
|
|
23
|
+
return prototype === Object.prototype || prototype === null;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { isBoolean, isFunction, isNil, isNonNullable, isNumber, isPlainObject, isString };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//#region packages/common/i18n/default.ts
|
|
2
|
+
/**
|
|
3
|
+
* UI 组件库默认中文语言资源。
|
|
4
|
+
*
|
|
5
|
+
* 这里只放组件内置文案,业务项目可以通过 I18nProvider.resources 覆盖或追加。
|
|
6
|
+
*/
|
|
7
|
+
var defaultLanguageResources = {
|
|
8
|
+
common: {
|
|
9
|
+
tip: "提示",
|
|
10
|
+
confirm: "确认",
|
|
11
|
+
cancel: "取消",
|
|
12
|
+
close: "关闭",
|
|
13
|
+
submit: "提交",
|
|
14
|
+
reset: "重置"
|
|
15
|
+
},
|
|
16
|
+
components: {
|
|
17
|
+
breadcrumb: { close: "关闭" },
|
|
18
|
+
confirmDialog: {
|
|
19
|
+
title: "提示",
|
|
20
|
+
okText: "确认",
|
|
21
|
+
cancelText: "取消"
|
|
22
|
+
},
|
|
23
|
+
dataTable: { noData: "暂无数据" },
|
|
24
|
+
date: {
|
|
25
|
+
placeholder: "请选择日期",
|
|
26
|
+
placeholderDateTime: "请选择日期时间",
|
|
27
|
+
placeholderRange: "选择日期范围",
|
|
28
|
+
placeholderDateTimeRange: "选择日期时间范围",
|
|
29
|
+
weekDays: [
|
|
30
|
+
"日",
|
|
31
|
+
"一",
|
|
32
|
+
"二",
|
|
33
|
+
"三",
|
|
34
|
+
"四",
|
|
35
|
+
"五",
|
|
36
|
+
"六"
|
|
37
|
+
],
|
|
38
|
+
selectTime: "选择时间",
|
|
39
|
+
startTime: "开始时间",
|
|
40
|
+
endTime: "结束时间",
|
|
41
|
+
confirm: "确认",
|
|
42
|
+
monthFormat: "yyyy年 M月",
|
|
43
|
+
quickRanges: "快速选择",
|
|
44
|
+
quickRangeToday: "今天",
|
|
45
|
+
quickRangeYesterday: "昨天",
|
|
46
|
+
quickRangeLast7Days: "近7天",
|
|
47
|
+
quickRangeLast30Days: "近30天",
|
|
48
|
+
quickRangeThisMonth: "本月",
|
|
49
|
+
quickRangeLastYear: "最近一年",
|
|
50
|
+
clear: "清除"
|
|
51
|
+
},
|
|
52
|
+
form: {
|
|
53
|
+
submit: "提交",
|
|
54
|
+
cancel: "取消"
|
|
55
|
+
},
|
|
56
|
+
imagePreview: {
|
|
57
|
+
closePreview: "关闭预览",
|
|
58
|
+
previousImage: "上一张",
|
|
59
|
+
nextImage: "下一张",
|
|
60
|
+
zoomOut: "缩小",
|
|
61
|
+
zoomIn: "放大",
|
|
62
|
+
reset: "重置",
|
|
63
|
+
rotateLeft: "左旋转",
|
|
64
|
+
rotateRight: "右旋转",
|
|
65
|
+
flipHorizontal: "左右镜像",
|
|
66
|
+
flipVertical: "上下镜像",
|
|
67
|
+
previewImage: "预览第{index}张"
|
|
68
|
+
},
|
|
69
|
+
modal: {
|
|
70
|
+
close: "关闭",
|
|
71
|
+
confirmTitle: "提示",
|
|
72
|
+
okText: "确认",
|
|
73
|
+
cancelText: "取消"
|
|
74
|
+
},
|
|
75
|
+
message: { close: "关闭" },
|
|
76
|
+
select: { empty: "暂无选项" },
|
|
77
|
+
tableSearch: {
|
|
78
|
+
reset: "重置",
|
|
79
|
+
search: "查询",
|
|
80
|
+
export: "导出Excel",
|
|
81
|
+
expand: "展开",
|
|
82
|
+
collapse: "收起",
|
|
83
|
+
exportCurrentPage: "当前页",
|
|
84
|
+
exportCurrentQuery: "当前查询条件"
|
|
85
|
+
},
|
|
86
|
+
upload: {
|
|
87
|
+
deleteImage: "删除图片",
|
|
88
|
+
upload: "上传"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { defaultLanguageResources };
|