@_tc/template-core 0.0.1-bate.35 → 0.0.1-bate.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/app/controller/base.js +3 -3
- package/cjs/app/controller/project.js +1 -1
- package/cjs/app/controller/view.js +16 -7
- package/cjs/app/middleware/api-params-verify.js +10 -1
- package/cjs/app/middleware/error-handle.js +9 -3
- package/cjs/app/middleware/project-handler.js +1 -1
- package/cjs/app/router/view.js +3 -1
- package/cjs/app/router-schema/project.js +1 -1
- package/cjs/app/service/project.js +5 -0
- package/cjs/bundler/defaultAlias.js +5 -0
- package/cjs/bundler/dev.js +4 -3
- package/cjs/bundler/index.js +2 -1
- package/cjs/bundler/prod.js +4 -3
- package/cjs/bundler/utils.js +53 -24
- package/cjs/packages/common/LRUCache.js +4 -0
- package/cjs/packages/common/array/index.js +43 -0
- package/cjs/packages/common/cache/LRUCache.js +45 -0
- package/cjs/packages/common/cache/index.js +4 -0
- package/cjs/packages/common/guards/index.js +34 -0
- package/cjs/packages/common/i18n/default.js +95 -0
- package/cjs/packages/common/i18n/en-US.js +95 -0
- package/cjs/packages/common/i18n/index.js +178 -0
- package/cjs/packages/common/i18n/locales.js +17 -0
- package/cjs/packages/common/i18n/types.js +1 -0
- package/cjs/packages/common/index.js +65 -0
- package/cjs/packages/common/log/index.js +160 -0
- package/cjs/packages/common/number/index.js +14 -0
- package/cjs/packages/common/object/filterEmpty.js +32 -0
- package/cjs/packages/common/object/filtereEmpty.js +5 -0
- package/cjs/packages/common/object/index.js +26 -0
- package/cjs/packages/common/string/index.js +17 -0
- package/cjs/packages/common/types/index.js +1 -0
- package/cjs/packages/core/index.js +17 -12
- package/cjs/packages/core/loader/model.js +3 -3
- package/cjs/packages/core/loader/router.js +14 -5
- package/esm/app/controller/base.js +3 -3
- package/esm/app/controller/project.js +3 -3
- package/esm/app/controller/view.js +16 -7
- package/esm/app/middleware/api-params-verify.js +10 -1
- package/esm/app/middleware/error-handle.js +9 -3
- package/esm/app/middleware/project-handler.js +1 -1
- package/esm/app/router/view.js +3 -1
- package/esm/app/router-schema/project.js +1 -1
- package/esm/app/service/project.js +5 -0
- package/esm/bundler/defaultAlias.js +4 -0
- package/esm/bundler/dev.js +4 -3
- package/esm/bundler/index.js +2 -1
- package/esm/bundler/prod.js +4 -3
- package/esm/bundler/utils.js +53 -24
- package/esm/index.js +2 -2
- package/esm/packages/common/LRUCache.js +2 -0
- package/esm/packages/common/array/index.js +37 -0
- package/esm/packages/common/cache/LRUCache.js +43 -0
- package/esm/packages/common/cache/index.js +2 -0
- package/esm/packages/common/guards/index.js +26 -0
- package/esm/packages/common/i18n/default.js +93 -0
- package/esm/packages/common/i18n/en-US.js +93 -0
- package/esm/packages/common/i18n/index.js +162 -0
- package/esm/packages/common/i18n/locales.js +11 -0
- package/esm/packages/common/i18n/types.js +0 -0
- package/esm/packages/common/index.js +13 -0
- package/esm/packages/common/log/index.js +146 -0
- package/esm/packages/common/number/index.js +11 -0
- package/esm/packages/common/object/filterEmpty.js +29 -0
- package/esm/packages/common/object/filtereEmpty.js +2 -0
- package/esm/packages/common/object/index.js +20 -0
- package/esm/packages/common/string/index.js +13 -0
- package/esm/packages/common/types/index.js +0 -0
- package/esm/packages/core/index.js +17 -12
- package/esm/packages/core/loader/model.js +3 -3
- package/esm/packages/core/loader/router.js +14 -5
- package/fe/frontend/dash/Dashboard.d.ts +7 -0
- package/fe/frontend/dash/Dashboard.js +63 -0
- package/fe/frontend/dash/dash.entry.d.ts +2 -0
- package/fe/frontend/dash/dash.entry.js +62 -0
- package/fe/frontend/index.d.ts +3 -0
- package/fe/frontend/index.js +1 -0
- package/fe/frontend/main.css +5 -1
- package/fe/frontend/main.d.ts +10 -3
- package/fe/frontend/main.js +13 -4
- package/fe/frontend/testPage/testPage.entry.js +1 -2
- package/fe/frontend/typing/window.d.ts +7 -0
- package/fe/frontend/typing/window.js +1 -0
- package/fe/frontend/widgets/api/baseInfo.d.ts +31 -0
- package/fe/frontend/widgets/api/baseInfo.js +15 -0
- package/fe/frontend/widgets/common/CRUD/CRUD.d.ts +70 -0
- package/fe/frontend/widgets/common/CRUD/CRUD.js +207 -0
- package/fe/frontend/widgets/common/CRUD/index.d.ts +2 -0
- package/fe/frontend/widgets/common/CRUD/index.js +1 -0
- package/fe/frontend/widgets/common/auth/index.d.ts +7 -0
- package/fe/frontend/widgets/common/auth/index.js +20 -0
- package/fe/frontend/widgets/common/generateMenuData.d.ts +4 -0
- package/fe/frontend/widgets/common/generateMenuData.js +14 -0
- package/fe/frontend/widgets/common/importComponent.d.ts +5 -0
- package/fe/frontend/widgets/common/importComponent.js +7 -0
- package/fe/frontend/widgets/common/language.d.ts +2 -0
- package/fe/frontend/widgets/common/language.js +8 -0
- package/fe/frontend/widgets/common/logFn/index.d.ts +4 -0
- package/fe/frontend/widgets/common/logFn/index.js +8 -0
- package/fe/frontend/widgets/common/menu.d.ts +22 -0
- package/fe/frontend/widgets/common/menu.js +80 -0
- package/fe/frontend/widgets/common/request.d.ts +33 -0
- package/fe/frontend/widgets/common/request.js +127 -0
- package/fe/frontend/widgets/components/BasePage/HeaderView.d.ts +9 -0
- package/fe/frontend/widgets/components/BasePage/HeaderView.js +14 -0
- package/fe/frontend/widgets/components/Router/index.d.ts +9 -0
- package/fe/frontend/widgets/components/Router/index.js +11 -0
- package/fe/frontend/widgets/components/Router/type.d.ts +2 -0
- package/fe/frontend/widgets/components/Router/type.js +1 -0
- package/fe/frontend/widgets/defaultPages/Iframe/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Iframe/index.js +14 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/DetailPanel.d.ts +7 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/DetailPanel.js +94 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/PopFrom.d.ts +13 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/PopFrom.js +109 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.js +6 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaSearch/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaSearch/index.js +58 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.d.ts +11 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.js +176 -0
- package/fe/frontend/widgets/defaultPages/Schema/data/eventInfo.d.ts +8 -0
- package/fe/frontend/widgets/defaultPages/Schema/data/eventInfo.js +6 -0
- package/fe/frontend/widgets/defaultPages/Schema/data/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/data/index.js +1 -0
- package/fe/frontend/widgets/defaultPages/Schema/hooks/useComConfig.d.ts +10 -0
- package/fe/frontend/widgets/defaultPages/Schema/hooks/useComConfig.js +14 -0
- package/fe/frontend/widgets/defaultPages/Schema/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/index.js +67 -0
- package/fe/frontend/widgets/defaultPages/Schema/schemaType.d.ts +41 -0
- package/fe/frontend/widgets/defaultPages/Schema/schemaType.js +4 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.d.ts +23 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.js +66 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.d.ts +33 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.js +24 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/fetchErrorShow.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/fetchErrorShow.js +8 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/permissions.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/permissions.js +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.js +72 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/validator.d.ts +4 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/validator.js +31 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +10 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +31 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.js +15 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPageTmp.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPageTmp.js +17 -0
- package/fe/frontend/widgets/defaultPages/SlotPage/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/SlotPage/index.js +24 -0
- package/fe/frontend/widgets/defaultPages/Todo.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/Todo.js +5 -0
- package/fe/frontend/widgets/hooks/useCurrentMenuData.d.ts +11 -0
- package/fe/frontend/widgets/hooks/useCurrentMenuData.js +20 -0
- package/fe/frontend/widgets/hooks/useRouterParams.d.ts +5 -0
- package/fe/frontend/widgets/hooks/useRouterParams.js +11 -0
- package/fe/frontend/widgets/store/mode.d.ts +16 -0
- package/fe/frontend/widgets/store/mode.js +36 -0
- package/fe/model/types/data/button.d.ts +23 -0
- package/fe/model/types/data/button.js +1 -0
- package/fe/model/types/data/component.d.ts +37 -0
- package/fe/model/types/data/component.js +1 -0
- package/fe/model/types/data/fetchInfo.d.ts +8 -0
- package/fe/model/types/data/fetchInfo.js +1 -0
- package/fe/model/types/data/schema.d.ts +47 -0
- package/fe/model/types/data/schema.js +1 -0
- package/fe/model/types/data/search.d.ts +7 -0
- package/fe/model/types/data/search.js +1 -0
- package/fe/model/types/menuType.d.ts +44 -0
- package/fe/model/types/menuType.js +1 -0
- package/fe/model/types/model.d.ts +20 -0
- package/fe/model/types/model.js +1 -0
- package/fe/packages/common/array/index.d.ts +7 -0
- package/fe/packages/common/array/index.js +40 -0
- package/fe/packages/common/cache/LRUCache.d.ts +13 -0
- package/fe/packages/common/cache/LRUCache.js +47 -0
- package/fe/packages/common/cache/index.d.ts +2 -0
- package/fe/packages/common/cache/index.js +1 -0
- package/fe/packages/common/guards/index.d.ts +9 -0
- package/fe/packages/common/guards/index.js +24 -0
- package/fe/packages/common/i18n/default.d.ts +87 -0
- package/fe/packages/common/i18n/default.js +85 -0
- package/fe/packages/common/i18n/en-US.d.ts +87 -0
- package/fe/packages/common/i18n/en-US.js +85 -0
- package/fe/packages/common/i18n/index.d.ts +19 -0
- package/fe/packages/common/i18n/index.js +142 -0
- package/fe/packages/common/i18n/locales.d.ts +8 -0
- package/fe/packages/common/i18n/locales.js +10 -0
- package/fe/packages/common/i18n/types.d.ts +47 -0
- package/fe/packages/common/i18n/types.js +1 -0
- package/fe/packages/common/index.d.ts +10 -0
- package/fe/packages/common/index.js +9 -0
- package/fe/packages/common/log/index.d.ts +33 -0
- package/fe/packages/common/log/index.js +176 -0
- package/fe/packages/common/number/index.d.ts +3 -0
- package/fe/packages/common/number/index.js +10 -0
- package/fe/packages/common/object/filterEmpty.d.ts +3 -0
- package/fe/packages/common/object/filterEmpty.js +33 -0
- package/fe/packages/common/object/index.d.ts +5 -0
- package/fe/packages/common/object/index.js +25 -0
- package/fe/packages/common/string/index.d.ts +4 -0
- package/fe/packages/common/string/index.js +17 -0
- package/fe/packages/common/types/index.d.ts +4 -0
- package/fe/packages/common/types/index.js +1 -0
- package/fe/packages/ui/react/components/Button/Button.d.ts +16 -30
- package/fe/packages/ui/react/components/Button/Button.js +53 -26
- package/fe/packages/ui/react/components/Button/SumbitButton.d.ts +2 -6
- package/fe/packages/ui/react/components/Button/SumbitButton.js +3 -14
- package/fe/packages/ui/react/components/Button/index.d.ts +1 -1
- package/fe/packages/ui/react/components/Checkbox/Checkbox.d.ts +1 -1
- package/fe/packages/ui/react/components/Checkbox/Checkbox.js +5 -3
- package/fe/packages/ui/react/components/{ConfirmDialog.d.ts → ConfirmDialog/ConfirmDialog.d.ts} +0 -8
- package/fe/packages/ui/react/components/ConfirmDialog/ConfirmDialog.js +11 -0
- package/fe/packages/ui/react/components/ConfirmDialog/index.d.ts +2 -0
- package/fe/packages/ui/react/components/ConfirmDialog/index.js +1 -0
- package/fe/packages/ui/react/components/DataTable/ActionBtn.d.ts +3 -1
- package/fe/packages/ui/react/components/DataTable/ActionBtn.js +85 -4
- package/fe/packages/ui/react/components/DataTable/{data-table.d.ts → index.d.ts} +10 -23
- package/fe/packages/ui/react/components/DataTable/{data-table.js → index.js} +57 -47
- package/fe/packages/ui/react/components/Date/Calendar.d.ts +0 -13
- package/fe/packages/ui/react/components/Date/Calendar.js +5 -13
- package/fe/packages/ui/react/components/Date/Date.d.ts +4 -13
- package/fe/packages/ui/react/components/Date/Date.js +70 -66
- package/fe/packages/ui/react/components/Date/LocaleContext.d.ts +0 -4
- package/fe/packages/ui/react/components/Date/LocaleContext.js +0 -4
- package/fe/packages/ui/react/components/Date/LocaleProvider.d.ts +0 -11
- package/fe/packages/ui/react/components/Date/LocaleProvider.js +0 -11
- package/fe/packages/ui/react/components/Date/TimePicker.js +3 -2
- package/fe/packages/ui/react/components/Date/dateLocaleStore.d.ts +0 -6
- package/fe/packages/ui/react/components/Date/dropdownPositioning.d.ts +3 -0
- package/fe/packages/ui/react/components/Date/dropdownPositioning.js +12 -0
- package/fe/packages/ui/react/components/Date/locales.d.ts +1 -19
- package/fe/packages/ui/react/components/Date/locales.js +7 -47
- package/fe/packages/ui/react/components/Drawer/Drawer.d.ts +23 -0
- package/fe/packages/ui/react/components/Drawer/Drawer.js +100 -0
- package/fe/packages/ui/react/components/Drawer/index.d.ts +3 -0
- package/fe/packages/ui/react/components/Drawer/index.js +1 -0
- package/fe/packages/ui/react/components/Dropdown/Dropdown.d.ts +24 -0
- package/fe/packages/ui/react/components/Dropdown/Dropdown.js +28 -0
- package/fe/packages/ui/react/components/Dropdown/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Dropdown/index.js +1 -0
- package/fe/packages/ui/react/components/Form/Form.d.ts +0 -6
- package/fe/packages/ui/react/components/Form/Form.js +1 -1
- package/fe/packages/ui/react/components/Form/FormItem.d.ts +0 -21
- package/fe/packages/ui/react/components/Form/FormItem.js +2 -9
- package/fe/packages/ui/react/components/Form/SchemaForm/data.d.ts +45 -0
- package/fe/packages/ui/react/components/Form/{SchemeForm → SchemaForm}/data.js +8 -1
- package/fe/packages/ui/react/components/Form/SchemaForm/index.d.ts +60 -0
- package/fe/packages/ui/react/components/Form/SchemaForm/index.js +75 -0
- package/fe/packages/ui/react/components/Form/index.d.ts +1 -1
- package/fe/packages/ui/react/components/Form/index.js +1 -1
- package/fe/packages/ui/react/components/ImagePreview/ImagePreview.js +15 -20
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.d.ts +0 -3
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.js +5 -2
- package/fe/packages/ui/react/components/Input/Input.d.ts +3 -21
- package/fe/packages/ui/react/components/Input/Input.js +5 -7
- package/fe/packages/ui/react/components/InputNumber/InputNumber.d.ts +26 -0
- package/fe/packages/ui/react/components/InputNumber/InputNumber.js +144 -0
- package/fe/packages/ui/react/components/InputNumber/index.d.ts +2 -0
- package/fe/packages/ui/react/components/InputNumber/index.js +1 -0
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.d.ts +30 -0
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.js +63 -0
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.d.ts +2 -0
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.js +27 -0
- package/fe/packages/ui/react/components/Label/Label.d.ts +0 -29
- package/fe/packages/ui/react/components/Label/Label.js +2 -4
- package/fe/packages/ui/react/components/Menu/Menu.d.ts +18 -0
- package/fe/packages/ui/react/components/Menu/Menu.js +98 -0
- package/fe/packages/ui/react/components/Menu/MenuContext.d.ts +39 -0
- package/fe/packages/ui/react/components/Menu/MenuContext.js +97 -0
- package/fe/packages/ui/react/components/Menu/MenuItem.d.ts +3 -0
- package/fe/packages/ui/react/components/Menu/MenuItem.js +33 -0
- package/fe/packages/ui/react/components/Menu/SubMenu.d.ts +3 -0
- package/fe/packages/ui/react/components/Menu/SubMenu.js +124 -0
- package/fe/packages/ui/react/components/Menu/index.d.ts +9 -0
- package/fe/packages/ui/react/components/Menu/index.js +5 -0
- package/fe/packages/ui/react/components/Menu/menuTypes.d.ts +58 -0
- package/fe/packages/ui/react/components/Menu/menuTypes.js +1 -0
- package/fe/packages/ui/react/components/Menu/utils.d.ts +2 -0
- package/fe/packages/ui/react/components/Menu/utils.js +7 -0
- package/fe/packages/ui/react/components/Message/Message.d.ts +0 -7
- package/fe/packages/ui/react/components/Message/Message.js +4 -4
- package/fe/packages/ui/react/components/Message/MessageManager.js +0 -8
- package/fe/packages/ui/react/components/Modal/Modal.d.ts +3 -7
- package/fe/packages/ui/react/components/Modal/Modal.js +6 -44
- package/fe/packages/ui/react/components/Modal/ModalManager.d.ts +0 -12
- package/fe/packages/ui/react/components/Modal/ModalManager.js +5 -7
- package/fe/packages/ui/react/components/Overlay/Overlay.d.ts +20 -0
- package/fe/packages/ui/react/components/Overlay/Overlay.js +53 -0
- package/fe/packages/ui/react/components/Overlay/index.d.ts +3 -0
- package/fe/packages/ui/react/components/Overlay/index.js +1 -0
- package/fe/packages/ui/react/components/{Pagination.d.ts → Pagination/Pagination.d.ts} +0 -7
- package/fe/packages/ui/react/components/{Pagination.js → Pagination/Pagination.js} +5 -12
- package/fe/packages/ui/react/components/Pagination/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Pagination/index.js +1 -0
- package/fe/packages/ui/react/components/Popup/Popup.d.ts +26 -0
- package/fe/packages/ui/react/components/Popup/Popup.js +69 -0
- package/fe/packages/ui/react/components/Popup/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Popup/index.js +1 -0
- package/fe/packages/ui/react/components/Search/Search.d.ts +2 -5
- package/fe/packages/ui/react/components/Search/Search.js +3 -3
- package/fe/packages/ui/react/components/Select/Select.d.ts +2 -2
- package/fe/packages/ui/react/components/Select/Select.js +52 -113
- package/fe/packages/ui/react/components/Select/dropdownPositioning.d.ts +3 -0
- package/fe/packages/ui/react/components/Select/dropdownPositioning.js +13 -0
- package/fe/packages/ui/react/components/Skeleton/Skeleton.d.ts +0 -15
- package/fe/packages/ui/react/components/Skeleton/Skeleton.js +3 -3
- package/fe/packages/ui/react/components/Switch/Switch.js +3 -1
- package/fe/packages/ui/react/components/TableSearch/TableSearch.d.ts +5 -41
- package/fe/packages/ui/react/components/TableSearch/TableSearch.js +21 -22
- package/fe/packages/ui/react/components/TableSearch/lang.js +5 -14
- package/fe/packages/ui/react/components/Textarea/Textarea.d.ts +21 -0
- package/fe/packages/ui/react/components/Textarea/Textarea.js +36 -0
- package/fe/packages/ui/react/components/Textarea/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Textarea/index.js +1 -0
- package/fe/packages/ui/react/components/Tooltip/Tooltip.d.ts +9 -0
- package/fe/packages/ui/react/components/Tooltip/Tooltip.js +71 -0
- package/fe/packages/ui/react/components/Tooltip/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Tooltip/index.js +1 -0
- package/fe/packages/ui/react/components/{TreeSelect.d.ts → TreeSelect/TreeSelect.d.ts} +0 -6
- package/fe/packages/ui/react/components/{TreeSelect.js → TreeSelect/TreeSelect.js} +9 -17
- package/fe/packages/ui/react/components/TreeSelect/index.d.ts +2 -0
- package/fe/packages/ui/react/components/TreeSelect/index.js +1 -0
- package/fe/packages/ui/react/components/Upload/ImageUpload.js +18 -6
- package/fe/packages/ui/react/components/Upload/Upload.d.ts +0 -27
- package/fe/packages/ui/react/components/Upload/Upload.js +2 -1
- package/fe/packages/ui/react/components/{breadcrumb.js → breadcrumb/breadcrumb.js} +15 -21
- package/fe/packages/ui/react/components/breadcrumb/index.d.ts +2 -0
- package/fe/packages/ui/react/components/breadcrumb/index.js +1 -0
- package/fe/packages/ui/react/components/hooks/useDropdownPositioning.d.ts +43 -0
- package/fe/packages/ui/react/components/hooks/useDropdownPositioning.js +123 -0
- package/fe/packages/ui/react/components/hooks/useInputController.d.ts +0 -3
- package/fe/packages/ui/react/components/hooks/useInputController.js +0 -7
- package/fe/packages/ui/react/components/index.d.ts +7 -1
- package/fe/packages/ui/react/components/index.js +7 -1
- package/fe/packages/ui/react/components/table/index.d.ts +2 -0
- package/fe/packages/ui/react/components/table/index.js +1 -0
- package/fe/packages/ui/react/components/table/table.js +20 -0
- package/fe/packages/ui/react/components/testPage/MenuTestPage.d.ts +2 -0
- package/fe/packages/ui/react/components/testPage/MenuTestPage.js +101 -0
- package/fe/packages/ui/react/components/testPage/index.js +251 -81
- package/fe/packages/ui/react/hooks/useExecuteOnce.d.ts +12 -0
- package/fe/packages/ui/react/hooks/useExecuteOnce.js +36 -0
- package/fe/packages/ui/react/hooks/useInit.d.ts +1 -1
- package/fe/packages/ui/react/hooks/useInit.js +1 -1
- package/fe/packages/ui/react/hooks/useLanguage.d.ts +1 -6
- package/fe/packages/ui/react/hooks/useRefState.d.ts +18 -0
- package/fe/packages/ui/react/hooks/useRefState.js +28 -0
- package/fe/packages/ui/react/hooks/useWatch.d.ts +15 -0
- package/fe/packages/ui/react/hooks/useWatch.js +87 -0
- package/fe/packages/ui/react/hooks/useWatch.test.d.ts +2 -0
- package/fe/packages/ui/react/hooks/useWatch.test.js +22 -0
- package/fe/packages/ui/react/i18n/I18nProvider.d.ts +13 -0
- package/fe/packages/ui/react/i18n/I18nProvider.js +25 -0
- package/fe/packages/ui/react/i18n/index.d.ts +4 -0
- package/fe/packages/ui/react/i18n/index.js +3 -0
- package/fe/packages/ui/react/i18n/useI18n.d.ts +9 -0
- package/fe/packages/ui/react/i18n/useI18n.js +14 -0
- package/fe/packages/ui/react/index.css +238 -0
- package/fe/packages/ui/react/index.d.ts +2 -0
- package/fe/packages/ui/react/index.js +2 -2
- package/fe/packages/ui/react/lib/createStoreHook.d.ts +9 -0
- package/fe/packages/ui/react/lib/createStoreHook.js +6 -0
- package/fe/packages/ui/react/lib/export.d.ts +2 -46
- package/fe/packages/ui/react/lib/export.js +0 -40
- package/fe/packages/ui/react/lib/utils.d.ts +0 -24
- package/fe/packages/ui/react/lib/utils.js +0 -25
- package/fe/packages/ui/react/stores/breadcrumb.js +0 -2
- package/fe/packages/ui/react/stores/language.d.ts +3 -12
- package/fe/packages/ui/react/stores/language.js +2 -51
- package/fe/typings/type.d.ts +5 -0
- package/fe/typings/type.js +1 -0
- package/package.json +14 -2
- package/types/app/controller/base.d.ts +3 -3
- package/types/app/router/view.d.ts +2 -3
- package/types/app/service/project.d.ts +29 -4
- package/types/app/type.d.ts +1 -0
- package/types/app/typings.d.ts +12 -21
- package/types/bundler/defaultAlias.d.ts +3 -0
- package/types/bundler/utils.d.ts +1 -1
- package/types/config/config.default.d.ts +14 -0
- package/types/packages/common/LRUCache.d.ts +1 -0
- package/types/packages/common/array/index.d.ts +6 -0
- package/types/packages/common/cache/LRUCache.d.ts +12 -0
- package/types/packages/common/cache/index.d.ts +1 -0
- package/types/packages/common/guards/index.d.ts +8 -0
- package/types/packages/common/i18n/default.d.ts +86 -0
- package/types/packages/common/i18n/en-US.d.ts +86 -0
- package/types/packages/common/i18n/index.d.ts +18 -0
- package/types/packages/common/i18n/locales.d.ts +7 -0
- package/types/packages/common/i18n/types.d.ts +46 -0
- package/types/packages/common/index.d.ts +9 -0
- package/types/packages/common/log/index.d.ts +32 -0
- package/types/packages/common/number/index.d.ts +2 -0
- package/types/packages/common/object/filterEmpty.d.ts +2 -0
- package/types/packages/common/object/filtereEmpty.d.ts +1 -0
- package/types/packages/common/object/index.d.ts +4 -0
- package/types/packages/common/string/index.d.ts +3 -0
- package/types/packages/common/types/index.d.ts +3 -0
- package/types/packages/core/index.d.ts +1 -1
- package/types/packages/core/loader/router.d.ts +1 -1
- package/types/packages/core/types.d.ts +12 -3
- package/fe/packages/ui/react/components/ConfirmDialog.js +0 -9
- package/fe/packages/ui/react/components/Dropdown.d.ts +0 -16
- package/fe/packages/ui/react/components/Dropdown.js +0 -54
- package/fe/packages/ui/react/components/Form/SchemeForm/data.d.ts +0 -51
- package/fe/packages/ui/react/components/Form/SchemeForm/index.d.ts +0 -152
- package/fe/packages/ui/react/components/Form/SchemeForm/index.js +0 -69
- package/fe/packages/ui/react/components/Textarea.d.ts +0 -59
- package/fe/packages/ui/react/components/Textarea.js +0 -35
- package/fe/packages/ui/react/components/Tooltip.d.ts +0 -25
- package/fe/packages/ui/react/components/Tooltip.js +0 -118
- package/fe/packages/ui/react/components/table.js +0 -20
- package/fe/packages/ui/react/locales/index.d.ts +0 -8
- package/fe/packages/ui/react/locales/index.js +0 -6
- /package/fe/packages/ui/react/components/{breadcrumb.d.ts → breadcrumb/breadcrumb.d.ts} +0 -0
- /package/fe/packages/ui/react/components/{table.d.ts → table/table.d.ts} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import test from 'node:test';
|
|
3
|
+
import { defaultCompare, identityCompare, shallowCompare } from './useWatch';
|
|
4
|
+
test('defaultCompare treats inline arrays with the same items as equal', () => {
|
|
5
|
+
assert.equal(defaultCompare([1, 'a'], [1, 'a']), true);
|
|
6
|
+
});
|
|
7
|
+
test('defaultCompare detects changed array items', () => {
|
|
8
|
+
assert.equal(defaultCompare([1, 'a'], [1, 'b']), false);
|
|
9
|
+
});
|
|
10
|
+
test('defaultCompare uses identity for object values', () => {
|
|
11
|
+
assert.equal(defaultCompare({ current: 1 }, { current: 1 }), false);
|
|
12
|
+
});
|
|
13
|
+
test('identityCompare detects changed array references', () => {
|
|
14
|
+
assert.equal(identityCompare([1, 2], [1, 2]), false);
|
|
15
|
+
});
|
|
16
|
+
test('shallowCompare supports selector array results', () => {
|
|
17
|
+
assert.equal(shallowCompare([1, 10], [1, 10]), true);
|
|
18
|
+
assert.equal(shallowCompare([1, 10], [2, 10]), false);
|
|
19
|
+
});
|
|
20
|
+
test('shallowCompare does not treat non-plain objects as equal by empty keys', () => {
|
|
21
|
+
assert.equal(shallowCompare(new Date(0), new Date(0)), false);
|
|
22
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { I18nLanguage, I18nResources } from '../../../common/i18n';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export interface I18nProviderProps {
|
|
4
|
+
language?: I18nLanguage;
|
|
5
|
+
fallbackLanguage?: I18nLanguage;
|
|
6
|
+
resources?: I18nResources;
|
|
7
|
+
mergeResources?: boolean;
|
|
8
|
+
persist?: boolean;
|
|
9
|
+
storageKey?: string;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function I18nProvider({ language, fallbackLanguage, resources, mergeResources, persist, storageKey, children, }: I18nProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=I18nProvider.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defaultLanguage, languageLocalKey } from '../../../common/i18n';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { useI18nStore } from './useI18n';
|
|
5
|
+
export function I18nProvider({ language = defaultLanguage, fallbackLanguage = defaultLanguage, resources, mergeResources = true, persist = true, storageKey = languageLocalKey, children, }) {
|
|
6
|
+
const configureI18n = useI18nStore((state) => state.configureI18n);
|
|
7
|
+
const setLanguage = useI18nStore((state) => state.setLanguage);
|
|
8
|
+
const setFallbackLanguage = useI18nStore((state) => state.setFallbackLanguage);
|
|
9
|
+
const setResources = useI18nStore((state) => state.setResources);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
configureI18n({ persist, storageKey });
|
|
12
|
+
}, [configureI18n, persist, storageKey]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setLanguage(language);
|
|
15
|
+
}, [language, setLanguage]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setFallbackLanguage(fallbackLanguage);
|
|
18
|
+
}, [fallbackLanguage, setFallbackLanguage]);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!resources)
|
|
21
|
+
return;
|
|
22
|
+
setResources(resources, { merge: mergeResources });
|
|
23
|
+
}, [mergeResources, resources, setResources]);
|
|
24
|
+
return _jsx(_Fragment, { children: children });
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { I18nInterpolationValues, I18nTranslateOptions } from '../../../common/i18n';
|
|
2
|
+
export declare const useI18nStore: import("..").StoreHook<{
|
|
3
|
+
getState: () => import("../../../common/index.js").I18nStore;
|
|
4
|
+
getInitialState: () => import("../../../common/index.js").I18nStore;
|
|
5
|
+
setState: (partial: Partial<import("../../../common/index.js").I18nStore> | ((state: import("../../../common/index.js").I18nStore) => Partial<import("../../../common/index.js").I18nStore>)) => void;
|
|
6
|
+
subscribe: (listener: import("../../../common/index.js").I18nStoreListener) => () => void;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function useI18n(): <T = string>(key: string, fillingData?: I18nInterpolationValues, options?: I18nTranslateOptions) => string | T;
|
|
9
|
+
//# sourceMappingURL=useI18n.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { i18nStore, translate } from '../../../common/i18n';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { createStoreHook } from '../lib/createStoreHook';
|
|
4
|
+
export const useI18nStore = createStoreHook(i18nStore);
|
|
5
|
+
export function useI18n() {
|
|
6
|
+
const language = useI18nStore((state) => state.language);
|
|
7
|
+
const fallbackLanguage = useI18nStore((state) => state.fallbackLanguage);
|
|
8
|
+
const resources = useI18nStore((state) => state.resources);
|
|
9
|
+
return useCallback((key, fillingData, options) => translate({
|
|
10
|
+
language,
|
|
11
|
+
fallbackLanguage,
|
|
12
|
+
resources,
|
|
13
|
+
}, key, fillingData, options), [fallbackLanguage, language, resources]);
|
|
14
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
/* 内容扫描 */
|
|
4
|
+
/* baseComponents */
|
|
5
|
+
@source "./**/*.{js,ts,jsx,tsx}";
|
|
6
|
+
|
|
7
|
+
/* 暗色模式变体 */
|
|
8
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
9
|
+
|
|
10
|
+
/* 主题配置 */
|
|
11
|
+
@theme {
|
|
12
|
+
/* 圆角 */
|
|
13
|
+
--radius-lg: var(--radius);
|
|
14
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
15
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
16
|
+
|
|
17
|
+
/* 颜色 */
|
|
18
|
+
--color-background: hsl(var(--background));
|
|
19
|
+
--color-foreground: hsl(var(--foreground));
|
|
20
|
+
|
|
21
|
+
--color-card: hsl(var(--card));
|
|
22
|
+
--color-card-foreground: hsl(var(--card-foreground));
|
|
23
|
+
|
|
24
|
+
--color-popover: hsl(var(--popover));
|
|
25
|
+
--color-popover-foreground: hsl(var(--popover-foreground));
|
|
26
|
+
|
|
27
|
+
--color-primary: hsl(var(--primary));
|
|
28
|
+
--color-primary-foreground: hsl(var(--primary-foreground));
|
|
29
|
+
|
|
30
|
+
--color-secondary: hsl(var(--secondary));
|
|
31
|
+
--color-secondary-foreground: hsl(var(--secondary-foreground));
|
|
32
|
+
|
|
33
|
+
--color-muted: hsl(var(--muted));
|
|
34
|
+
--color-muted-foreground: hsl(var(--muted-foreground));
|
|
35
|
+
|
|
36
|
+
--color-accent: hsl(var(--accent));
|
|
37
|
+
--color-accent-foreground: hsl(var(--accent-foreground));
|
|
38
|
+
|
|
39
|
+
--color-destructive: hsl(var(--destructive));
|
|
40
|
+
--color-destructive-foreground: hsl(var(--destructive-foreground));
|
|
41
|
+
|
|
42
|
+
--color-border: hsl(var(--border));
|
|
43
|
+
--color-input: hsl(var(--input));
|
|
44
|
+
--color-ring: hsl(var(--ring));
|
|
45
|
+
|
|
46
|
+
--color-chart-1: hsl(var(--chart-1));
|
|
47
|
+
--color-chart-2: hsl(var(--chart-2));
|
|
48
|
+
--color-chart-3: hsl(var(--chart-3));
|
|
49
|
+
--color-chart-4: hsl(var(--chart-4));
|
|
50
|
+
--color-chart-5: hsl(var(--chart-5));
|
|
51
|
+
|
|
52
|
+
/* 主题色 - 与 @layer base 中的 CSS 变量对应 */
|
|
53
|
+
--color-theme: hsl(var(--theme-primary));
|
|
54
|
+
--color-theme-foreground: hsl(var(--theme-primary-foreground));
|
|
55
|
+
--color-theme-bg: hsl(var(--theme-bg));
|
|
56
|
+
--color-theme-text: hsl(var(--theme-text));
|
|
57
|
+
|
|
58
|
+
/* 表格颜色 */
|
|
59
|
+
--color-table-header: hsl(var(--table-header-bg));
|
|
60
|
+
--color-table-header-text: hsl(var(--table-header-text));
|
|
61
|
+
--color-table-head-text: hsl(var(--table-head-text));
|
|
62
|
+
--color-table-cell-text: hsl(var(--table-cell-text));
|
|
63
|
+
--color-table-action: hsl(var(--table-action-bg));
|
|
64
|
+
--color-table-action-text: hsl(var(--table-action-text));
|
|
65
|
+
|
|
66
|
+
/* 面包屑颜色 */
|
|
67
|
+
--color-breadcrumb-text: hsl(var(--breadcrumb-text));
|
|
68
|
+
--color-breadcrumb-border: hsl(var(--breadcrumb-border));
|
|
69
|
+
--color-breadcrumb-active-text: hsl(var(--breadcrumb-active-text));
|
|
70
|
+
--color-breadcrumb-active-bg: hsl(var(--breadcrumb-active-bg));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* CSS 变量定义 */
|
|
74
|
+
:root {
|
|
75
|
+
--background: 0 0% 100%;
|
|
76
|
+
--foreground: 240 10% 3.9%;
|
|
77
|
+
--card: 0 0% 100%;
|
|
78
|
+
--card-foreground: 240 10% 3.9%;
|
|
79
|
+
--popover: 0 0% 100%;
|
|
80
|
+
--popover-foreground: 240 10% 3.9%;
|
|
81
|
+
--primary: 240 5.9% 10%;
|
|
82
|
+
--primary-foreground: 0 0% 98%;
|
|
83
|
+
--secondary: 240 4.8% 95.9%;
|
|
84
|
+
--secondary-foreground: 240 5.9% 10%;
|
|
85
|
+
--muted: 240 4.8% 95.9%;
|
|
86
|
+
--muted-foreground: 240 3.8% 46.1%;
|
|
87
|
+
--accent: 240 4.8% 95.9%;
|
|
88
|
+
--accent-foreground: 240 5.9% 10%;
|
|
89
|
+
--destructive: 0 84.2% 60.2%;
|
|
90
|
+
--destructive-foreground: 0 0% 98%;
|
|
91
|
+
--border: 240 5.9% 90%;
|
|
92
|
+
--input: 240 5.9% 90%;
|
|
93
|
+
--ring: 240 5.9% 10%;
|
|
94
|
+
--radius: 0.5rem;
|
|
95
|
+
--chart-1: 12 76% 61%;
|
|
96
|
+
--chart-2: 173 58% 39%;
|
|
97
|
+
--chart-3: 197 37% 24%;
|
|
98
|
+
--chart-4: 43 74% 66%;
|
|
99
|
+
--chart-5: 27 87% 67%;
|
|
100
|
+
|
|
101
|
+
/* 主题色 - 默认亮色中性主题 */
|
|
102
|
+
--theme-primary: 0 0% 0%;
|
|
103
|
+
--theme-primary-foreground: 0 0% 100%;
|
|
104
|
+
--theme-bg: 210 20% 98%;
|
|
105
|
+
--theme-text: 222 47% 11%;
|
|
106
|
+
|
|
107
|
+
/* 表格颜色 - 默认亮色中性主题 */
|
|
108
|
+
--table-header-bg: 220 14% 96%;
|
|
109
|
+
--table-header-text: 220 9% 46%;
|
|
110
|
+
--table-head-text: 217 19% 27%;
|
|
111
|
+
--table-cell-text: 180 4% 16%;
|
|
112
|
+
--table-action-bg: 220 13% 91%;
|
|
113
|
+
--table-action-text: 0 0% 0%;
|
|
114
|
+
|
|
115
|
+
/* 面包屑颜色 - 默认亮色中性主题 */
|
|
116
|
+
--breadcrumb-text: 220 10% 46%;
|
|
117
|
+
--breadcrumb-border: 0 0% 88%;
|
|
118
|
+
--breadcrumb-active-text: 0 0% 100%;
|
|
119
|
+
--breadcrumb-active-bg: 0 0% 0%;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* 绿色主题 */
|
|
123
|
+
[data-theme='green'] {
|
|
124
|
+
--theme-primary: 142 76% 36%;
|
|
125
|
+
--theme-primary-foreground: 0 0% 100%;
|
|
126
|
+
--theme-bg: 120 25% 93%;
|
|
127
|
+
--theme-text: 141 48% 13%;
|
|
128
|
+
|
|
129
|
+
--table-header-bg: 0 0% 88%;
|
|
130
|
+
--table-header-text: 120 4% 16%;
|
|
131
|
+
--table-head-text: 120 4% 16%;
|
|
132
|
+
--table-cell-text: 120 4% 16%;
|
|
133
|
+
--table-action-bg: 120 25% 93% / 0.8;
|
|
134
|
+
--table-action-text: 141 48% 13%;
|
|
135
|
+
|
|
136
|
+
--breadcrumb-text: 0 0% 27%;
|
|
137
|
+
--breadcrumb-border: 0 0% 88%;
|
|
138
|
+
--breadcrumb-active-text: 141 48% 13%;
|
|
139
|
+
--breadcrumb-active-bg: 140 96% 72%;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* 暗色模式 */
|
|
143
|
+
.dark {
|
|
144
|
+
--background: 240 10% 8%;
|
|
145
|
+
--foreground: 0 0% 95%;
|
|
146
|
+
--card: 240 10% 8%;
|
|
147
|
+
--card-foreground: 0 0% 95%;
|
|
148
|
+
--popover: 240 10% 8%;
|
|
149
|
+
--popover-foreground: 0 0% 95%;
|
|
150
|
+
--primary: 0 0% 95%;
|
|
151
|
+
--primary-foreground: 240 5% 15%;
|
|
152
|
+
--secondary: 240 6% 20%;
|
|
153
|
+
--secondary-foreground: 0 0% 95%;
|
|
154
|
+
--muted: 240 6% 20%;
|
|
155
|
+
--muted-foreground: 240 5% 75%;
|
|
156
|
+
--accent: 240 6% 20%;
|
|
157
|
+
--accent-foreground: 0 0% 95%;
|
|
158
|
+
--destructive: 0 70% 40%;
|
|
159
|
+
--destructive-foreground: 0 0% 98%;
|
|
160
|
+
--border: 240 6% 20%;
|
|
161
|
+
--input: 240 6% 20%;
|
|
162
|
+
--ring: 240 4.9% 83.9%;
|
|
163
|
+
--chart-1: 220 70% 50%;
|
|
164
|
+
--chart-2: 160 60% 45%;
|
|
165
|
+
--chart-3: 30 80% 55%;
|
|
166
|
+
--chart-4: 280 65% 60%;
|
|
167
|
+
--chart-5: 340 75% 55%;
|
|
168
|
+
|
|
169
|
+
/* 主题色调整 */
|
|
170
|
+
--theme-primary: 0 0% 92%;
|
|
171
|
+
--theme-primary-foreground: 240 10% 10%;
|
|
172
|
+
--theme-bg: 240 8% 12%;
|
|
173
|
+
--theme-text: 0 0% 95%;
|
|
174
|
+
|
|
175
|
+
/* 表格颜色优化 */
|
|
176
|
+
--table-header-bg: 240 5% 18%;
|
|
177
|
+
--table-header-text: 240 5% 75%;
|
|
178
|
+
--table-head-text: 240 5% 85%;
|
|
179
|
+
--table-cell-text: 0 0% 90%;
|
|
180
|
+
--table-action-bg: 240 5% 22%;
|
|
181
|
+
--table-action-text: 0 0% 95%;
|
|
182
|
+
|
|
183
|
+
/* 面包屑颜色优化 */
|
|
184
|
+
--breadcrumb-text: 240 5% 72%;
|
|
185
|
+
--breadcrumb-border: 240 4% 24%;
|
|
186
|
+
--breadcrumb-active-text: 240 10% 10%;
|
|
187
|
+
--breadcrumb-active-bg: 0 0% 92%;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.dark[data-theme='green'],
|
|
191
|
+
.dark [data-theme='green'] {
|
|
192
|
+
--theme-primary: 142 68% 46%;
|
|
193
|
+
--theme-primary-foreground: 0 0% 100%;
|
|
194
|
+
--theme-bg: 145 22% 14%;
|
|
195
|
+
--theme-text: 140 30% 92%;
|
|
196
|
+
|
|
197
|
+
--table-header-bg: 145 18% 18%;
|
|
198
|
+
--table-header-text: 142 20% 72%;
|
|
199
|
+
--table-head-text: 140 24% 88%;
|
|
200
|
+
--table-cell-text: 140 18% 90%;
|
|
201
|
+
--table-action-bg: 145 16% 22%;
|
|
202
|
+
--table-action-text: 140 24% 88%;
|
|
203
|
+
|
|
204
|
+
--breadcrumb-text: 142 16% 72%;
|
|
205
|
+
--breadcrumb-border: 145 12% 26%;
|
|
206
|
+
--breadcrumb-active-text: 0 0% 100%;
|
|
207
|
+
--breadcrumb-active-bg: 142 68% 46%;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* 中间态主题 */
|
|
211
|
+
[data-theme='gray'] {
|
|
212
|
+
--theme-primary: 220 9% 38%;
|
|
213
|
+
--theme-primary-foreground: 0 0% 100%;
|
|
214
|
+
--theme-bg: 220 16% 92%;
|
|
215
|
+
--theme-text: 222 20% 22%;
|
|
216
|
+
|
|
217
|
+
--table-header-bg: 220 12% 90%;
|
|
218
|
+
--table-header-text: 220 9% 38%;
|
|
219
|
+
--table-head-text: 220 15% 24%;
|
|
220
|
+
--table-cell-text: 220 10% 22%;
|
|
221
|
+
--table-action-bg: 220 11% 86%;
|
|
222
|
+
--table-action-text: 220 15% 24%;
|
|
223
|
+
|
|
224
|
+
--breadcrumb-text: 220 10% 40%;
|
|
225
|
+
--breadcrumb-border: 220 10% 82%;
|
|
226
|
+
--breadcrumb-active-text: 0 0% 100%;
|
|
227
|
+
--breadcrumb-active-bg: 220 9% 38%;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* 全局样式 */
|
|
231
|
+
* {
|
|
232
|
+
border-color: hsl(var(--border));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
body {
|
|
236
|
+
background-color: hsl(var(--background));
|
|
237
|
+
color: hsl(var(--foreground));
|
|
238
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ExtractState, StoreApi } from 'zustand/vanilla';
|
|
2
|
+
type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'getInitialState' | 'subscribe'>;
|
|
3
|
+
export type StoreHook<TStore extends ReadonlyStoreApi<unknown>> = {
|
|
4
|
+
(): ExtractState<TStore>;
|
|
5
|
+
<T>(selector: (state: ExtractState<TStore>) => T): T;
|
|
6
|
+
};
|
|
7
|
+
export declare function createStoreHook<TStore extends ReadonlyStoreApi<unknown>>(store: TStore): StoreHook<TStore>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=createStoreHook.d.ts.map
|
|
@@ -1,66 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
* 导出 Excel 工具方法
|
|
3
|
-
*
|
|
4
|
-
* 功能:
|
|
5
|
-
* - 支持导出「当前页」或「当前查询条件下的全部页数据」
|
|
6
|
-
* - 通过 DataTable 的 columns 控制导出列及顺序
|
|
7
|
-
*
|
|
8
|
-
* 使用方式(示例):
|
|
9
|
-
* ```ts
|
|
10
|
-
* await exportToExcel({
|
|
11
|
-
* fetchData: (pageNum, pageSize) => getWithdrawList({ ...searchParams, pageNum, pageSize }),
|
|
12
|
-
* columns, // 直接复用 DataTable 的 columns
|
|
13
|
-
* exportType: 'all', // 'all' 导出全部页;'current' 仅导出当前页
|
|
14
|
-
* currentPage,
|
|
15
|
-
* pageSize,
|
|
16
|
-
* total,
|
|
17
|
-
* currentPageData: tableData, // 可选,导出当前页时直接使用现有数据,避免重复请求
|
|
18
|
-
* fileName: '提币记录',
|
|
19
|
-
* })
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
import { type ColumnDef } from '../components';
|
|
1
|
+
import { type TableColumnDef } from '../components';
|
|
23
2
|
export declare const ExportType: {
|
|
24
|
-
/**
|
|
25
|
-
* 当前查询条件下所有页
|
|
26
|
-
*/
|
|
27
3
|
readonly all: 0;
|
|
28
|
-
/**
|
|
29
|
-
* 当前页
|
|
30
|
-
*/
|
|
31
4
|
readonly current: 1;
|
|
32
5
|
};
|
|
33
6
|
export type ExportType = (typeof ExportType)[keyof typeof ExportType];
|
|
34
7
|
interface ExportExcelParams<T> {
|
|
35
|
-
/** 获取数据方法 */
|
|
36
8
|
fetchData: (pageNum: number, pageSize: number, searchParams?: Record<string, any>) => Promise<{
|
|
37
9
|
records: T[];
|
|
38
10
|
total: number;
|
|
39
11
|
}>;
|
|
40
|
-
|
|
41
|
-
columns: ColumnDef<T>[];
|
|
42
|
-
/** 导出类型:all=当前查询条件下所有页;current=当前页 */
|
|
12
|
+
columns: TableColumnDef<T>[];
|
|
43
13
|
exportType: ExportType;
|
|
44
|
-
/** 当前页码(导出当前页时使用)默认 1 */
|
|
45
14
|
currentPage?: number;
|
|
46
|
-
/** 每页条数,默认 2000 */
|
|
47
15
|
pageSize?: number;
|
|
48
|
-
/**
|
|
49
|
-
* 最大导出条数,超过则停止继续请求
|
|
50
|
-
* @default 10000
|
|
51
|
-
*/
|
|
52
16
|
maxCount?: number;
|
|
53
|
-
/**
|
|
54
|
-
* 当前页已有数据
|
|
55
|
-
* - 当 exportType === 'current' 且传入该字段时,将直接使用该数据,不会再次请求接口
|
|
56
|
-
*/
|
|
57
17
|
currentPageData?: T[];
|
|
58
|
-
/** 文件名(不含扩展名),默认:export-YYYYMMDDHHmmss */
|
|
59
18
|
fileName?: string;
|
|
60
19
|
}
|
|
61
|
-
/**
|
|
62
|
-
* 通用导出 Excel 方法
|
|
63
|
-
*/
|
|
64
20
|
export declare function exportToExcel<T>(options: ExportExcelParams<T>): Promise<void>;
|
|
65
21
|
export {};
|
|
66
22
|
//# sourceMappingURL=export.d.ts.map
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 导出 Excel 工具方法
|
|
3
|
-
*
|
|
4
|
-
* 功能:
|
|
5
|
-
* - 支持导出「当前页」或「当前查询条件下的全部页数据」
|
|
6
|
-
* - 通过 DataTable 的 columns 控制导出列及顺序
|
|
7
|
-
*
|
|
8
|
-
* 使用方式(示例):
|
|
9
|
-
* ```ts
|
|
10
|
-
* await exportToExcel({
|
|
11
|
-
* fetchData: (pageNum, pageSize) => getWithdrawList({ ...searchParams, pageNum, pageSize }),
|
|
12
|
-
* columns, // 直接复用 DataTable 的 columns
|
|
13
|
-
* exportType: 'all', // 'all' 导出全部页;'current' 仅导出当前页
|
|
14
|
-
* currentPage,
|
|
15
|
-
* pageSize,
|
|
16
|
-
* total,
|
|
17
|
-
* currentPageData: tableData, // 可选,导出当前页时直接使用现有数据,避免重复请求
|
|
18
|
-
* fileName: '提币记录',
|
|
19
|
-
* })
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
1
|
import { message } from '../components';
|
|
23
2
|
import * as XLSX from 'xlsx';
|
|
24
3
|
const getTextFromReactNode = (node) => {
|
|
@@ -35,31 +14,20 @@ const getTextFromReactNode = (node) => {
|
|
|
35
14
|
return String(node);
|
|
36
15
|
};
|
|
37
16
|
export const ExportType = {
|
|
38
|
-
/**
|
|
39
|
-
* 当前查询条件下所有页
|
|
40
|
-
*/
|
|
41
17
|
all: 0,
|
|
42
|
-
/**
|
|
43
|
-
* 当前页
|
|
44
|
-
*/
|
|
45
18
|
current: 1,
|
|
46
19
|
};
|
|
47
|
-
/** 读取嵌套字段值,支持 a.b.c 形式 */
|
|
48
20
|
const getValue = (row, dataIndex) => {
|
|
49
21
|
const key = String(dataIndex);
|
|
50
22
|
if (!key.includes('.'))
|
|
51
23
|
return row?.[key];
|
|
52
24
|
return key.split('.').reduce((acc, cur) => (acc == null ? acc : acc[cur]), row);
|
|
53
25
|
};
|
|
54
|
-
/**
|
|
55
|
-
* 通用导出 Excel 方法
|
|
56
|
-
*/
|
|
57
26
|
export async function exportToExcel(options) {
|
|
58
27
|
const { fetchData, exportType, currentPage = 1, pageSize = 2000, maxCount = 10000, currentPageData, fileName, } = options;
|
|
59
28
|
const defaultSearchParams = { export: true };
|
|
60
29
|
const cols = options.columns;
|
|
61
30
|
const fieldConfigs = cols
|
|
62
|
-
// 过滤掉操作列
|
|
63
31
|
.filter((col) => !col.isAction && col.key !== 'action')
|
|
64
32
|
.map((col) => ({
|
|
65
33
|
title: col.title,
|
|
@@ -74,7 +42,6 @@ export async function exportToExcel(options) {
|
|
|
74
42
|
try {
|
|
75
43
|
let allData = [];
|
|
76
44
|
if (exportType === ExportType.current) {
|
|
77
|
-
// 优先使用已存在的当前页数据,避免重复请求
|
|
78
45
|
if (currentPageData && currentPageData.length) {
|
|
79
46
|
allData = currentPageData;
|
|
80
47
|
}
|
|
@@ -84,7 +51,6 @@ export async function exportToExcel(options) {
|
|
|
84
51
|
}
|
|
85
52
|
}
|
|
86
53
|
else {
|
|
87
|
-
// 导出所有页:按页拉取,直到数据不足一整页或达到最大条数
|
|
88
54
|
const list = [];
|
|
89
55
|
for (let page = 1;; page += 1) {
|
|
90
56
|
const res = await fetchData(page, pageSize, defaultSearchParams);
|
|
@@ -92,12 +58,10 @@ export async function exportToExcel(options) {
|
|
|
92
58
|
if (!records.length)
|
|
93
59
|
break;
|
|
94
60
|
list.push(...records);
|
|
95
|
-
// 达到最大条数后直接截断并停止
|
|
96
61
|
if (list.length >= maxCount) {
|
|
97
62
|
list.length = maxCount;
|
|
98
63
|
break;
|
|
99
64
|
}
|
|
100
|
-
// 本页数据不足 pageSize,说明已到最后一页
|
|
101
65
|
if (records.length < pageSize)
|
|
102
66
|
break;
|
|
103
67
|
}
|
|
@@ -108,13 +72,9 @@ export async function exportToExcel(options) {
|
|
|
108
72
|
message.close(infoMessageId);
|
|
109
73
|
return;
|
|
110
74
|
}
|
|
111
|
-
// 构建表头
|
|
112
75
|
const header = fieldConfigs.map((f) => f.title);
|
|
113
|
-
// 构建数据行
|
|
114
76
|
const dataRows = allData.map((row, index) => fieldConfigs.map((f) => {
|
|
115
77
|
const v = f.render ? f.render(getValue(row, f.dataIndex), row, index) : getValue(row, f.dataIndex);
|
|
116
|
-
// 如果v是ReactNode
|
|
117
|
-
// 需要获取最深层的text
|
|
118
78
|
if (v && typeof v === 'object' && 'props' in v && 'children' in v.props) {
|
|
119
79
|
return getTextFromReactNode(v);
|
|
120
80
|
}
|
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
import { type ClassValue } from "clsx";
|
|
2
2
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
-
/**
|
|
4
|
-
* 日期时间格式化工具
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* 格式化日期时间
|
|
8
|
-
* @param date 日期字符串或 Date 对象
|
|
9
|
-
* @param format 格式化模板,默认 'YYYY-MM-DD HH:mm:ss'
|
|
10
|
-
* @returns 格式化后的字符串
|
|
11
|
-
*/
|
|
12
3
|
export declare function formatDateTime(date: string | Date | null | undefined | number, format?: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* 格式化日期
|
|
15
|
-
* @param date 日期字符串或 Date 对象
|
|
16
|
-
* @returns 格式化后的字符串 YYYY-MM-DD
|
|
17
|
-
*/
|
|
18
4
|
export declare function formatDate(date: string | Date | null | undefined): string;
|
|
19
|
-
/**
|
|
20
|
-
* 格式化时间
|
|
21
|
-
* @param date 日期字符串或 Date 对象
|
|
22
|
-
* @returns 格式化后的字符串 HH:mm:ss
|
|
23
|
-
*/
|
|
24
5
|
export declare function formatTime(date: string | Date | null | undefined): string;
|
|
25
|
-
/**
|
|
26
|
-
* 生成开始结束时间
|
|
27
|
-
* @param dates 日期字符串或 Date 对象数组
|
|
28
|
-
* @returns 开始结束时间对象 { start: string; end: string }
|
|
29
|
-
*/
|
|
30
6
|
export declare function generateStartEndTime(dates: string[] | Date[] | null | undefined): {
|
|
31
7
|
start: string;
|
|
32
8
|
end: string;
|
|
@@ -3,20 +3,10 @@ import { twMerge } from "tailwind-merge";
|
|
|
3
3
|
export function cn(...inputs) {
|
|
4
4
|
return twMerge(clsx(inputs));
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* 日期时间格式化工具
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* 格式化日期时间
|
|
11
|
-
* @param date 日期字符串或 Date 对象
|
|
12
|
-
* @param format 格式化模板,默认 'YYYY-MM-DD HH:mm:ss'
|
|
13
|
-
* @returns 格式化后的字符串
|
|
14
|
-
*/
|
|
15
6
|
export function formatDateTime(date, format = "YYYY-MM-DD HH:mm:ss") {
|
|
16
7
|
if (!date)
|
|
17
8
|
return "-";
|
|
18
9
|
let d = new Date(date);
|
|
19
|
-
// 接口返回的时间戳为 秒
|
|
20
10
|
const tmpY = d.getFullYear();
|
|
21
11
|
if (typeof date === "number" && tmpY === 1970) {
|
|
22
12
|
d = new Date(date * 1000);
|
|
@@ -37,27 +27,12 @@ export function formatDateTime(date, format = "YYYY-MM-DD HH:mm:ss") {
|
|
|
37
27
|
.replace("mm", minutes)
|
|
38
28
|
.replace("ss", seconds);
|
|
39
29
|
}
|
|
40
|
-
/**
|
|
41
|
-
* 格式化日期
|
|
42
|
-
* @param date 日期字符串或 Date 对象
|
|
43
|
-
* @returns 格式化后的字符串 YYYY-MM-DD
|
|
44
|
-
*/
|
|
45
30
|
export function formatDate(date) {
|
|
46
31
|
return formatDateTime(date, "YYYY-MM-DD");
|
|
47
32
|
}
|
|
48
|
-
/**
|
|
49
|
-
* 格式化时间
|
|
50
|
-
* @param date 日期字符串或 Date 对象
|
|
51
|
-
* @returns 格式化后的字符串 HH:mm:ss
|
|
52
|
-
*/
|
|
53
33
|
export function formatTime(date) {
|
|
54
34
|
return formatDateTime(date, "HH:mm:ss");
|
|
55
35
|
}
|
|
56
|
-
/**
|
|
57
|
-
* 生成开始结束时间
|
|
58
|
-
* @param dates 日期字符串或 Date 对象数组
|
|
59
|
-
* @returns 开始结束时间对象 { start: string; end: string }
|
|
60
|
-
*/
|
|
61
36
|
export function generateStartEndTime(dates) {
|
|
62
37
|
if (!dates)
|
|
63
38
|
return { start: "", end: "" };
|
|
@@ -16,7 +16,6 @@ const loadBreadcrumbFromStorage = () => {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
catch {
|
|
19
|
-
// ignore
|
|
20
19
|
}
|
|
21
20
|
return [];
|
|
22
21
|
};
|
|
@@ -25,7 +24,6 @@ const saveBreadcrumbToStorage = (items) => {
|
|
|
25
24
|
localStorage.setItem(BREADCRUMB_STORAGE_KEY, JSON.stringify(items));
|
|
26
25
|
}
|
|
27
26
|
catch {
|
|
28
|
-
// ignore
|
|
29
27
|
}
|
|
30
28
|
};
|
|
31
29
|
export const breadcrumbStore = create((set) => ({
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
type State = {
|
|
5
|
-
language: Language;
|
|
6
|
-
};
|
|
7
|
-
type Actions = {
|
|
8
|
-
setLanguage: (lang: Language) => void;
|
|
9
|
-
t: typeof t;
|
|
10
|
-
};
|
|
11
|
-
export declare const useLanguages: import("zustand").UseBoundStore<import("zustand").StoreApi<State & Actions>>;
|
|
12
|
-
export {};
|
|
1
|
+
export { getLanguage, i18n, t } from '../../../common/i18n';
|
|
2
|
+
export type { I18nLanguage as Language } from '../../../common/i18n';
|
|
3
|
+
export { useI18nStore as useLanguages } from '../i18n';
|
|
13
4
|
//# sourceMappingURL=language.d.ts.map
|