@_tc/template-core 0.0.1-bate.36 → 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 +2 -184
- 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 +12 -1
- 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
|
@@ -28,11 +28,15 @@ export declare namespace FrameworkAugment {
|
|
|
28
28
|
}
|
|
29
29
|
export type ICTX = Parameters<Router.IMiddleware<any, {}>>[0];
|
|
30
30
|
export interface KoaAppExtensions {
|
|
31
|
-
baseDir: string;
|
|
32
31
|
frameBaseDir: string;
|
|
32
|
+
framePath: string;
|
|
33
|
+
baseDir: string;
|
|
33
34
|
businessPath: string;
|
|
34
35
|
paths: AppPathInfo[];
|
|
35
|
-
|
|
36
|
+
hooks: {
|
|
37
|
+
inited?: () => void;
|
|
38
|
+
initing?: () => void;
|
|
39
|
+
};
|
|
36
40
|
envs: EnvReturn;
|
|
37
41
|
config: FrameworkAugment.AppConfigAugmented;
|
|
38
42
|
extends: FrameworkAugment.IExtendsAugmented;
|
|
@@ -41,7 +45,7 @@ export interface KoaAppExtensions {
|
|
|
41
45
|
middlewares: FrameworkAugment.IMiddlewaresAugmented;
|
|
42
46
|
model: unknown[];
|
|
43
47
|
routerSchema: Record<string, unknown>;
|
|
44
|
-
currentUseRouter:
|
|
48
|
+
currentUseRouter: KoaRouter[];
|
|
45
49
|
options: AppOptions;
|
|
46
50
|
logger?: {
|
|
47
51
|
info: (...args: unknown[]) => void;
|
|
@@ -62,12 +66,17 @@ export interface StartOptions {
|
|
|
62
66
|
name?: string;
|
|
63
67
|
homePage?: string;
|
|
64
68
|
frameBaseDir?: string;
|
|
69
|
+
baseDir?: string;
|
|
70
|
+
pageBasePage?: string;
|
|
65
71
|
}
|
|
66
72
|
export interface AppOptions extends StartOptions {
|
|
67
73
|
overwriteOriginalLogs?: boolean;
|
|
68
74
|
[key: string]: unknown;
|
|
69
75
|
}
|
|
70
76
|
export type KoaApp = Koa & KoaAppExtensions;
|
|
77
|
+
export type KoaRouter = Router & {
|
|
78
|
+
level?: number;
|
|
79
|
+
};
|
|
71
80
|
export type KoaMiddleware = Koa.Middleware;
|
|
72
81
|
export type { EnvType, EnvKeys } from "./env";
|
|
73
82
|
export type ProcessingFileCallbackFN = <T extends Record<string, unknown>>(fileName: string, filePath: string, isDir: boolean, tempData: T) => T | undefined;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from './Button';
|
|
3
|
-
import { Modal } from './Modal';
|
|
4
|
-
export function ConfirmDialog({ open, title = '提示', content, okText = '确认', cancelText = '取消', loading = false, onOk, onCancel, }) {
|
|
5
|
-
const handleOk = async () => {
|
|
6
|
-
await onOk();
|
|
7
|
-
};
|
|
8
|
-
return (_jsx(Modal, { open: open, onClose: onCancel, title: title, width: 450, footer: _jsxs("div", { className: "flex justify-end gap-3", children: [_jsx(Button, { onClick: onCancel, className: "min-w-[100px] bg-white border-[hsl(var(--theme-primary))] text-[hsl(var(--theme-primary))] hover:bg-[hsl(var(--theme-primary))]/5", children: cancelText }), _jsx(Button, { variant: "primary", loading: loading, onClick: handleOk, className: "min-w-[100px] bg-[hsl(var(--theme-primary))] hover:bg-[hsl(var(--theme-primary))]/90 border-[hsl(var(--theme-primary))] text-[hsl(var(--theme-primary-foreground))]", children: okText })] }), children: _jsx("div", { className: "py-4 text-base text-foreground", children: content }) }));
|
|
9
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
export interface DropdownItem {
|
|
3
|
-
key: string;
|
|
4
|
-
label: ReactNode;
|
|
5
|
-
icon?: ReactNode;
|
|
6
|
-
danger?: boolean;
|
|
7
|
-
onClick?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export interface DropdownProps {
|
|
10
|
-
items: DropdownItem[];
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
className?: string;
|
|
13
|
-
placement?: 'bottom-end' | 'bottom-start';
|
|
14
|
-
}
|
|
15
|
-
export declare function Dropdown({ items, children, className, placement }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../lib/utils';
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { createPortal } from 'react-dom';
|
|
5
|
-
export function Dropdown({ items, children, className, placement = 'bottom-end' }) {
|
|
6
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
-
const [position, setPosition] = useState({ top: 0, left: 0, width: 0 });
|
|
8
|
-
const triggerRef = useRef(null);
|
|
9
|
-
const dropdownRef = useRef(null);
|
|
10
|
-
// 计算下拉菜单位置
|
|
11
|
-
const updatePosition = () => {
|
|
12
|
-
if (triggerRef.current) {
|
|
13
|
-
const rect = triggerRef.current.getBoundingClientRect();
|
|
14
|
-
setPosition({
|
|
15
|
-
top: rect.bottom + window.scrollY,
|
|
16
|
-
left: placement === 'bottom-end' ? rect.right + window.scrollX : rect.left + window.scrollX,
|
|
17
|
-
width: rect.width,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
// 点击外部关闭
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (!isOpen)
|
|
24
|
-
return;
|
|
25
|
-
const handleClickOutside = (event) => {
|
|
26
|
-
if (triggerRef.current &&
|
|
27
|
-
!triggerRef.current.contains(event.target) &&
|
|
28
|
-
dropdownRef.current &&
|
|
29
|
-
!dropdownRef.current.contains(event.target)) {
|
|
30
|
-
setIsOpen(false);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
34
|
-
return () => {
|
|
35
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
36
|
-
};
|
|
37
|
-
}, [isOpen]);
|
|
38
|
-
const handleToggle = () => {
|
|
39
|
-
if (!isOpen) {
|
|
40
|
-
updatePosition();
|
|
41
|
-
}
|
|
42
|
-
setIsOpen(!isOpen);
|
|
43
|
-
};
|
|
44
|
-
const handleItemClick = (item) => {
|
|
45
|
-
item.onClick?.();
|
|
46
|
-
setIsOpen(false);
|
|
47
|
-
};
|
|
48
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: triggerRef, className: cn('relative inline-block', className), children: _jsx("div", { onClick: handleToggle, children: children }) }), isOpen &&
|
|
49
|
-
createPortal(_jsx("div", { ref: dropdownRef, className: cn('fixed z-[9999] mt-2 min-w-[120px]', 'bg-white rounded-lg shadow-lg border border-gray-200', 'py-1', 'animate-in fade-in-0 zoom-in-95'), style: {
|
|
50
|
-
top: `${position.top}px`,
|
|
51
|
-
left: placement === 'bottom-end' ? 'auto' : `${position.left}px`,
|
|
52
|
-
right: placement === 'bottom-end' ? `${window.innerWidth - position.left}px` : 'auto',
|
|
53
|
-
}, children: items.map((item) => (_jsxs("button", { onClick: () => handleItemClick(item), className: cn('w-full px-4 py-2.5 text-sm text-left', 'flex items-center gap-2', 'transition-colors', item.danger ? 'text-red-600 hover:bg-red-50' : 'text-gray-700 hover:bg-gray-50'), children: [item.icon && _jsx("span", { className: "flex-shrink-0", children: item.icon }), _jsx("span", { children: item.label })] }, item.key))) }), document.body)] }));
|
|
54
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type DatePickerProps } from '../../Date';
|
|
3
|
-
import { type InputProps } from '../../Input';
|
|
4
|
-
import { type SelectProps } from '../../Select';
|
|
5
|
-
import { type SwitchProps } from '../../Switch';
|
|
6
|
-
import { type TextareaProps } from '../../Textarea';
|
|
7
|
-
export declare const componentsMap: {
|
|
8
|
-
input: React.LazyExoticComponent<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "value"> & {
|
|
9
|
-
value?: string;
|
|
10
|
-
onChange?: (v: string, e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
-
defaultValue?: string;
|
|
12
|
-
allowClear?: boolean | {
|
|
13
|
-
clearIcon: React.ReactNode;
|
|
14
|
-
};
|
|
15
|
-
addonAfter?: React.ReactNode;
|
|
16
|
-
} & React.RefAttributes<HTMLInputElement>>>;
|
|
17
|
-
select: React.LazyExoticComponent<React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLDivElement>>>;
|
|
18
|
-
textarea: React.LazyExoticComponent<React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "defaultValue" | "onChange" | "value"> & {
|
|
19
|
-
value?: string;
|
|
20
|
-
onChange?: (v: string, e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
21
|
-
defaultValue?: string;
|
|
22
|
-
maxLength?: number;
|
|
23
|
-
showCount?: boolean;
|
|
24
|
-
placeholder?: string;
|
|
25
|
-
} & React.RefAttributes<HTMLTextAreaElement>>>;
|
|
26
|
-
switch: React.LazyExoticComponent<React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>>;
|
|
27
|
-
date: React.LazyExoticComponent<React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLDivElement>>>;
|
|
28
|
-
};
|
|
29
|
-
type TextareaField = {
|
|
30
|
-
type?: 'textarea';
|
|
31
|
-
fieldProps?: TextareaProps;
|
|
32
|
-
};
|
|
33
|
-
type InputField = {
|
|
34
|
-
type?: 'input';
|
|
35
|
-
fieldProps?: InputProps;
|
|
36
|
-
};
|
|
37
|
-
type SelectField = {
|
|
38
|
-
type?: 'select';
|
|
39
|
-
fieldProps?: SelectProps;
|
|
40
|
-
};
|
|
41
|
-
type SwitchField = {
|
|
42
|
-
type?: 'switch';
|
|
43
|
-
fieldProps?: SwitchProps;
|
|
44
|
-
};
|
|
45
|
-
type DateField = {
|
|
46
|
-
type?: 'date';
|
|
47
|
-
fieldProps?: DatePickerProps;
|
|
48
|
-
};
|
|
49
|
-
export type FieldProps = TextareaField | InputField | SelectField | SwitchField | DateField;
|
|
50
|
-
export {};
|
|
51
|
-
//# sourceMappingURL=data.d.ts.map
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import type { MOmit } from '../../../types';
|
|
2
|
-
import { type FormInstance } from 'rc-field-form';
|
|
3
|
-
import type { Rule } from 'rc-field-form/es/interface';
|
|
4
|
-
import { type ReactNode } from 'react';
|
|
5
|
-
import { type FormProps } from '..';
|
|
6
|
-
import { Button } from '../../Button';
|
|
7
|
-
import type { LabelLayout } from '../../Label';
|
|
8
|
-
import { componentsMap, type FieldProps } from './data';
|
|
9
|
-
export type FormFieldType = keyof typeof componentsMap;
|
|
10
|
-
type BaseField<T> = {
|
|
11
|
-
[K in keyof T]: {
|
|
12
|
-
/**
|
|
13
|
-
* 字段名
|
|
14
|
-
*/
|
|
15
|
-
name: K | number | (K | number)[];
|
|
16
|
-
/**
|
|
17
|
-
* 标签文本
|
|
18
|
-
*/
|
|
19
|
-
label?: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* 验证规则
|
|
22
|
-
*/
|
|
23
|
-
rules?: Rule[];
|
|
24
|
-
/**
|
|
25
|
-
* 是否必填(仅用于显示,实际验证通过 rules 配置)
|
|
26
|
-
*/
|
|
27
|
-
required?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* 表单项类名
|
|
30
|
-
*/
|
|
31
|
-
className?: string;
|
|
32
|
-
/**
|
|
33
|
-
* 标签类名
|
|
34
|
-
*/
|
|
35
|
-
labelClassName?: string;
|
|
36
|
-
/**
|
|
37
|
-
* 错误信息类名
|
|
38
|
-
*/
|
|
39
|
-
errorClassName?: string;
|
|
40
|
-
/**
|
|
41
|
-
* 是否显示错误信息
|
|
42
|
-
*/
|
|
43
|
-
showError?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* 自定义渲染函数
|
|
46
|
-
*/
|
|
47
|
-
render?: (value: T[K], onChange: (value: T[K]) => void, meta: {
|
|
48
|
-
errors: string[];
|
|
49
|
-
warnings: string[];
|
|
50
|
-
}) => ReactNode;
|
|
51
|
-
/**
|
|
52
|
-
* field label 布局方向
|
|
53
|
-
*/
|
|
54
|
-
layout?: Required<LabelLayout>['layout'];
|
|
55
|
-
/**
|
|
56
|
-
* 插入到控件后边
|
|
57
|
-
*/
|
|
58
|
-
affterNode?: ReactNode;
|
|
59
|
-
};
|
|
60
|
-
}[keyof T];
|
|
61
|
-
type GroupField<T> = {
|
|
62
|
-
type: 'group';
|
|
63
|
-
childrens: FormFieldScheme<T>[];
|
|
64
|
-
fieldProps: React.HTMLAttributes<HTMLDivElement>;
|
|
65
|
-
} & BaseField<T>;
|
|
66
|
-
type NotGroupField<T> = FieldProps & BaseField<T>;
|
|
67
|
-
export type FormFieldScheme<T> = GroupField<T> | NotGroupField<T>;
|
|
68
|
-
export interface SchemeFormProps<T = object> extends MOmit<FormProps<T>, 'initialValues' | 'children' | 'preserve'> {
|
|
69
|
-
/**
|
|
70
|
-
* 表单实例
|
|
71
|
-
*/
|
|
72
|
-
form?: FormInstance<T>;
|
|
73
|
-
/**
|
|
74
|
-
* 获取当前使用的form实例
|
|
75
|
-
*/
|
|
76
|
-
getForm?: (formInstance: FormInstance<T>) => void;
|
|
77
|
-
/**
|
|
78
|
-
* 表单配置方案
|
|
79
|
-
*/
|
|
80
|
-
schemes: FormFieldScheme<T>[];
|
|
81
|
-
/**
|
|
82
|
-
* 表单类名
|
|
83
|
-
*/
|
|
84
|
-
className?: string;
|
|
85
|
-
/**
|
|
86
|
-
* 提交回调
|
|
87
|
-
*/
|
|
88
|
-
onFinish?: (values: T) => void;
|
|
89
|
-
/**
|
|
90
|
-
* 提交失败回调
|
|
91
|
-
*/
|
|
92
|
-
onFinishFailed?: (errorInfo: any) => void;
|
|
93
|
-
/**
|
|
94
|
-
* 初始值
|
|
95
|
-
*/
|
|
96
|
-
initialValues?: T;
|
|
97
|
-
/**
|
|
98
|
-
* form 布局方向
|
|
99
|
-
*
|
|
100
|
-
* tips: horizontal 需自行实现提交按钮
|
|
101
|
-
*/
|
|
102
|
-
layout?: Required<LabelLayout>['layout'];
|
|
103
|
-
/**
|
|
104
|
-
* 统一配置 field layout
|
|
105
|
-
*/
|
|
106
|
-
fieldLayout?: Required<LabelLayout>['layout'];
|
|
107
|
-
/**
|
|
108
|
-
* - 是否显示提交和取消按钮
|
|
109
|
-
* - 或自定义按钮
|
|
110
|
-
* - tips button type submit 可直接触发提交
|
|
111
|
-
* @default true
|
|
112
|
-
*/
|
|
113
|
-
footerButtons?: boolean | ReactNode;
|
|
114
|
-
/**
|
|
115
|
-
* 提交按钮文本
|
|
116
|
-
* @default '提交'
|
|
117
|
-
*/
|
|
118
|
-
submitText?: ReactNode;
|
|
119
|
-
/**
|
|
120
|
-
* 取消按钮文本
|
|
121
|
-
* @default '取消'
|
|
122
|
-
*/
|
|
123
|
-
cancelText?: ReactNode;
|
|
124
|
-
/**
|
|
125
|
-
* 取消按钮回调
|
|
126
|
-
*/
|
|
127
|
-
onCancel?: () => void;
|
|
128
|
-
/**
|
|
129
|
-
* 按钮容器类名
|
|
130
|
-
*/
|
|
131
|
-
buttonClassName?: string;
|
|
132
|
-
/**
|
|
133
|
-
* 提交按钮属性
|
|
134
|
-
*/
|
|
135
|
-
submitButtonProps?: Omit<React.ComponentProps<typeof Button>, 'type' | 'onClick' | 'children'>;
|
|
136
|
-
/**
|
|
137
|
-
* 取消按钮属性
|
|
138
|
-
*/
|
|
139
|
-
cancelButtonProps?: Omit<React.ComponentProps<typeof Button>, 'onClick' | 'children'>;
|
|
140
|
-
/**
|
|
141
|
-
* 移除字段时保留值
|
|
142
|
-
*
|
|
143
|
-
* @default false
|
|
144
|
-
*/
|
|
145
|
-
preserve?: boolean;
|
|
146
|
-
}
|
|
147
|
-
export declare const SchemeForm: {
|
|
148
|
-
<T extends object>({ form, getForm, schemes, className, onFinish, onFinishFailed, initialValues, footerButtons, submitText, cancelText, onCancel, buttonClassName, submitButtonProps, layout, fieldLayout, cancelButtonProps, ...formProps }: SchemeFormProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
149
|
-
displayName: string;
|
|
150
|
-
};
|
|
151
|
-
export default SchemeForm;
|
|
152
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../../../lib/utils';
|
|
3
|
-
import { Suspense, useEffect, useMemo } from 'react';
|
|
4
|
-
import { Form, FormItem, useForm } from '..';
|
|
5
|
-
import { Button } from '../../Button';
|
|
6
|
-
import { Skeleton } from '../../Skeleton';
|
|
7
|
-
import { componentsMap } from './data';
|
|
8
|
-
const renderField = (scheme) => {
|
|
9
|
-
return (value, onChange, meta) => {
|
|
10
|
-
// 如果提供了自定义渲染函数,优先使用
|
|
11
|
-
if (scheme.render) {
|
|
12
|
-
return scheme.render(value, onChange, meta);
|
|
13
|
-
}
|
|
14
|
-
const { type = 'input' } = scheme;
|
|
15
|
-
const Component = componentsMap[type];
|
|
16
|
-
const { fieldProps } = scheme;
|
|
17
|
-
return (_jsxs(Suspense, { fallback: _jsx(Skeleton, { mode: "componentsloading", rows: 2 }), children: [_jsx(Component, { value: value, onChange: onChange, ...fieldProps }), scheme.affterNode] }));
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export const SchemeForm = ({ form, getForm, schemes, className, onFinish, onFinishFailed, initialValues, footerButtons = true, submitText = '提交', cancelText = '取消', onCancel, buttonClassName, submitButtonProps, layout = 'vertical', fieldLayout = 'vertical', cancelButtonProps,
|
|
21
|
-
// preserve = false,
|
|
22
|
-
...formProps }) => {
|
|
23
|
-
const [f] = useForm();
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
getForm?.(f);
|
|
26
|
-
}, []);
|
|
27
|
-
const usedForm = form ?? f;
|
|
28
|
-
const handleCancel = () => {
|
|
29
|
-
if (onCancel) {
|
|
30
|
-
onCancel();
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
// 如果没有提供 onCancel,默认重置表单
|
|
34
|
-
usedForm?.resetFields();
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const { formClassName, fieldClassName, isHorizontal } = useMemo(() => {
|
|
38
|
-
return {
|
|
39
|
-
formClassName: cn(layout === 'horizontal' ? 'flex gap-4 items-start flex-wrap' : ''),
|
|
40
|
-
fieldClassName: cn('min-w-[255px]', layout === 'horizontal' ? '' : 'mb-5'),
|
|
41
|
-
isHorizontal: layout === 'horizontal',
|
|
42
|
-
};
|
|
43
|
-
}, [layout]);
|
|
44
|
-
const renderSchemes = (schemes) => {
|
|
45
|
-
return schemes.map((scheme, index) => {
|
|
46
|
-
const { type = 'input' } = scheme;
|
|
47
|
-
if (type !== 'group') {
|
|
48
|
-
const { name, label, rules, required, className: itemClassName, labelClassName, errorClassName, showError, layout: schemeFieldLayout, } = scheme;
|
|
49
|
-
const fLayout = schemeFieldLayout ?? fieldLayout;
|
|
50
|
-
const fRequired = required ??
|
|
51
|
-
rules?.some((r) => {
|
|
52
|
-
const rData = typeof r === 'function' ? r(usedForm) : r;
|
|
53
|
-
return rData.required;
|
|
54
|
-
});
|
|
55
|
-
const fiKey = (Array.isArray(name) ? `field-${index}-${name.join('_')}` : name);
|
|
56
|
-
return (_jsx(FormItem, { name: name, label: label, rules: rules, layout: fLayout, required: fRequired, className: cn(fieldClassName, itemClassName), labelClassName: labelClassName, errorClassName: errorClassName, showError: showError, children: renderField(scheme) }, fiKey));
|
|
57
|
-
}
|
|
58
|
-
else if (type === 'group') {
|
|
59
|
-
const s = scheme;
|
|
60
|
-
const fiKey = (Array.isArray(name) ? `field-group-${index}-${name.join('_')}` : name);
|
|
61
|
-
return (_jsx("div", { className: "field-group-container", ...s.fieldProps, children: renderSchemes(s.childrens) }, fiKey));
|
|
62
|
-
}
|
|
63
|
-
return null;
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
return (_jsxs(Form, { form: usedForm, onFinish: onFinish, onFinishFailed: onFinishFailed, initialValues: initialValues, className: cn(formClassName, className), ...formProps, children: [renderSchemes(schemes), footerButtons && !isHorizontal ? (typeof footerButtons === 'boolean' ? (_jsxs("div", { className: cn('flex items-center gap-4', buttonClassName), children: [_jsx(Button, { type: "button", onClick: handleCancel, ...cancelButtonProps, children: cancelText }), _jsx(Button, { type: "submit", variant: "primary", ...submitButtonProps, children: submitText })] })) : (footerButtons)) : undefined] }));
|
|
67
|
-
};
|
|
68
|
-
SchemeForm.displayName = 'SchemeForm';
|
|
69
|
-
export default SchemeForm;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { ChangeEvent, TextareaHTMLAttributes } from 'react';
|
|
2
|
-
export type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'onChange' | 'defaultValue'> & {
|
|
3
|
-
value?: string;
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param v textarea value
|
|
7
|
-
* @param e changeEvent
|
|
8
|
-
*/
|
|
9
|
-
onChange?: (v: string, e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
10
|
-
/**
|
|
11
|
-
* 只有初始化时会使用
|
|
12
|
-
* 如果会改变请使用value
|
|
13
|
-
*/
|
|
14
|
-
defaultValue?: string;
|
|
15
|
-
/**
|
|
16
|
-
* 最大字符数限制
|
|
17
|
-
* @default 500
|
|
18
|
-
*/
|
|
19
|
-
maxLength?: number;
|
|
20
|
-
/**
|
|
21
|
-
* 是否显示字符计数器
|
|
22
|
-
* @default true
|
|
23
|
-
*/
|
|
24
|
-
showCount?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 占位符文本
|
|
27
|
-
*/
|
|
28
|
-
placeholder?: string;
|
|
29
|
-
};
|
|
30
|
-
declare const Textarea: import("react").ForwardRefExoticComponent<Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "defaultValue" | "onChange" | "value"> & {
|
|
31
|
-
value?: string;
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @param v textarea value
|
|
35
|
-
* @param e changeEvent
|
|
36
|
-
*/
|
|
37
|
-
onChange?: (v: string, e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
38
|
-
/**
|
|
39
|
-
* 只有初始化时会使用
|
|
40
|
-
* 如果会改变请使用value
|
|
41
|
-
*/
|
|
42
|
-
defaultValue?: string;
|
|
43
|
-
/**
|
|
44
|
-
* 最大字符数限制
|
|
45
|
-
* @default 500
|
|
46
|
-
*/
|
|
47
|
-
maxLength?: number;
|
|
48
|
-
/**
|
|
49
|
-
* 是否显示字符计数器
|
|
50
|
-
* @default true
|
|
51
|
-
*/
|
|
52
|
-
showCount?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* 占位符文本
|
|
55
|
-
*/
|
|
56
|
-
placeholder?: string;
|
|
57
|
-
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
58
|
-
export { Textarea };
|
|
59
|
-
//# sourceMappingURL=Textarea.d.ts.map
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../lib/utils';
|
|
3
|
-
import { forwardRef, useCallback } from 'react';
|
|
4
|
-
import { useInputController } from './hooks/useInputController';
|
|
5
|
-
const Textarea = forwardRef(({ className, value: controlledValue, onChange, defaultValue, maxLength = 500, showCount = true, placeholder, disabled, ...props }, ref) => {
|
|
6
|
-
const { isFocused, setIsFocused, setInternalValue, setRefs, value, hasValue, isControlledRef, currentLength, } = useInputController({
|
|
7
|
-
controlledValue,
|
|
8
|
-
defaultValue,
|
|
9
|
-
ref,
|
|
10
|
-
});
|
|
11
|
-
const handleChange = useCallback((e) => {
|
|
12
|
-
const newValue = e.target.value;
|
|
13
|
-
// 如果设置了 maxLength,限制输入长度
|
|
14
|
-
if (maxLength && newValue.length > maxLength) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
if (!isControlledRef.current) {
|
|
18
|
-
setInternalValue(newValue);
|
|
19
|
-
}
|
|
20
|
-
onChange?.(newValue, e);
|
|
21
|
-
}, [maxLength, isControlledRef, onChange, setInternalValue]);
|
|
22
|
-
return (_jsxs("div", { className: "relative w-full", children: [_jsx("textarea", { ref: setRefs, value: value, onChange: handleChange, maxLength: maxLength, placeholder: placeholder, className: cn('flex w-full rounded-lg px-4 py-3 text-sm', 'border transition-colors duration-200', 'placeholder:text-muted-foreground', 'focus:outline-none', 'resize-none', showCount && 'pb-10', disabled ? 'cursor-not-allowed bg-muted border-border text-muted-foreground' : 'bg-background', !disabled && !hasValue && !isFocused && 'border-border', !disabled && (hasValue || isFocused) && 'border-foreground', className), onFocus: (e) => {
|
|
23
|
-
if (!disabled) {
|
|
24
|
-
setIsFocused(true);
|
|
25
|
-
props.onFocus?.(e);
|
|
26
|
-
}
|
|
27
|
-
}, onBlur: (e) => {
|
|
28
|
-
if (!disabled) {
|
|
29
|
-
setIsFocused(false);
|
|
30
|
-
props.onBlur?.(e);
|
|
31
|
-
}
|
|
32
|
-
}, disabled: disabled, ...props }), showCount && (_jsxs("div", { className: cn('absolute bottom-3 right-4 text-xs text-muted-foreground', 'pointer-events-none'), children: [currentLength, "/", maxLength] }))] }));
|
|
33
|
-
});
|
|
34
|
-
Textarea.displayName = 'Textarea';
|
|
35
|
-
export { Textarea };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export interface TooltipProps {
|
|
2
|
-
/**
|
|
3
|
-
* 提示内容
|
|
4
|
-
*/
|
|
5
|
-
content: React.ReactNode;
|
|
6
|
-
/**
|
|
7
|
-
* 触发元素
|
|
8
|
-
*/
|
|
9
|
-
children: React.ReactElement;
|
|
10
|
-
/**
|
|
11
|
-
* 提示位置
|
|
12
|
-
* @default 'right'
|
|
13
|
-
*/
|
|
14
|
-
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
15
|
-
/**
|
|
16
|
-
* 是否显示
|
|
17
|
-
*/
|
|
18
|
-
visible?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* 类名
|
|
21
|
-
*/
|
|
22
|
-
className?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare function Tooltip({ content, children, placement, visible, className }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../lib/utils';
|
|
3
|
-
import { useState, useRef, useEffect } from 'react';
|
|
4
|
-
import { createPortal } from 'react-dom';
|
|
5
|
-
export function Tooltip({ content, children, placement = 'right', visible, className }) {
|
|
6
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
7
|
-
const [position, setPosition] = useState({ top: 0, left: 0 });
|
|
8
|
-
const triggerRef = useRef(null);
|
|
9
|
-
const tooltipRef = useRef(null);
|
|
10
|
-
const showTooltip = () => {
|
|
11
|
-
if (visible !== undefined) {
|
|
12
|
-
setIsVisible(visible);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
setIsVisible(true);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const hideTooltip = () => {
|
|
19
|
-
if (visible === undefined) {
|
|
20
|
-
setIsVisible(false);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (visible !== undefined) {
|
|
25
|
-
setIsVisible(visible);
|
|
26
|
-
}
|
|
27
|
-
}, [visible]);
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
if (isVisible && triggerRef.current && tooltipRef.current) {
|
|
30
|
-
// 使用 requestAnimationFrame 确保 DOM 已更新
|
|
31
|
-
requestAnimationFrame(() => {
|
|
32
|
-
if (!triggerRef.current || !tooltipRef.current)
|
|
33
|
-
return;
|
|
34
|
-
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
35
|
-
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
36
|
-
const scrollY = window.scrollY;
|
|
37
|
-
const scrollX = window.scrollX;
|
|
38
|
-
const viewportWidth = window.innerWidth;
|
|
39
|
-
const viewportHeight = window.innerHeight;
|
|
40
|
-
const padding = 8;
|
|
41
|
-
let top = 0;
|
|
42
|
-
let left = 0;
|
|
43
|
-
switch (placement) {
|
|
44
|
-
case 'top':
|
|
45
|
-
top = triggerRect.top + scrollY - tooltipRect.height - padding;
|
|
46
|
-
left = triggerRect.left + scrollX + triggerRect.width / 2 - tooltipRect.width / 2;
|
|
47
|
-
// 如果超出左边界,对齐到左边界
|
|
48
|
-
if (left < scrollX + padding) {
|
|
49
|
-
left = scrollX + padding;
|
|
50
|
-
}
|
|
51
|
-
// 如果超出右边界,对齐到右边界
|
|
52
|
-
if (left + tooltipRect.width > scrollX + viewportWidth - padding) {
|
|
53
|
-
left = scrollX + viewportWidth - tooltipRect.width - padding;
|
|
54
|
-
}
|
|
55
|
-
// 如果上方空间不够,改为下方显示
|
|
56
|
-
if (top < scrollY + padding) {
|
|
57
|
-
top = triggerRect.bottom + scrollY + padding;
|
|
58
|
-
}
|
|
59
|
-
break;
|
|
60
|
-
case 'bottom':
|
|
61
|
-
top = triggerRect.bottom + scrollY + padding;
|
|
62
|
-
left = triggerRect.left + scrollX + triggerRect.width / 2 - tooltipRect.width / 2;
|
|
63
|
-
// 如果超出左边界,对齐到左边界
|
|
64
|
-
if (left < scrollX + padding) {
|
|
65
|
-
left = scrollX + padding;
|
|
66
|
-
}
|
|
67
|
-
// 如果超出右边界,对齐到右边界
|
|
68
|
-
if (left + tooltipRect.width > scrollX + viewportWidth - padding) {
|
|
69
|
-
left = scrollX + viewportWidth - tooltipRect.width - padding;
|
|
70
|
-
}
|
|
71
|
-
// 如果下方空间不够,改为上方显示
|
|
72
|
-
if (top + tooltipRect.height > scrollY + viewportHeight - padding) {
|
|
73
|
-
top = triggerRect.top + scrollY - tooltipRect.height - padding;
|
|
74
|
-
}
|
|
75
|
-
break;
|
|
76
|
-
case 'left':
|
|
77
|
-
top = triggerRect.top + scrollY + triggerRect.height / 2 - tooltipRect.height / 2;
|
|
78
|
-
left = triggerRect.left + scrollX - tooltipRect.width - padding;
|
|
79
|
-
// 如果超出上边界,对齐到上边界
|
|
80
|
-
if (top < scrollY + padding) {
|
|
81
|
-
top = scrollY + padding;
|
|
82
|
-
}
|
|
83
|
-
// 如果超出下边界,对齐到下边界
|
|
84
|
-
if (top + tooltipRect.height > scrollY + viewportHeight - padding) {
|
|
85
|
-
top = scrollY + viewportHeight - tooltipRect.height - padding;
|
|
86
|
-
}
|
|
87
|
-
// 如果左侧空间不够,改为右侧显示
|
|
88
|
-
if (left < scrollX + padding) {
|
|
89
|
-
left = triggerRect.right + scrollX + padding;
|
|
90
|
-
}
|
|
91
|
-
break;
|
|
92
|
-
case 'right':
|
|
93
|
-
top = triggerRect.top + scrollY + triggerRect.height / 2 - tooltipRect.height / 2;
|
|
94
|
-
left = triggerRect.right + scrollX + padding;
|
|
95
|
-
// 如果超出上边界,对齐到上边界
|
|
96
|
-
if (top < scrollY + padding) {
|
|
97
|
-
top = scrollY + padding;
|
|
98
|
-
}
|
|
99
|
-
// 如果超出下边界,对齐到下边界
|
|
100
|
-
if (top + tooltipRect.height > scrollY + viewportHeight - padding) {
|
|
101
|
-
top = scrollY + viewportHeight - tooltipRect.height - padding;
|
|
102
|
-
}
|
|
103
|
-
// 如果右侧空间不够,改为左侧显示
|
|
104
|
-
if (left + tooltipRect.width > scrollX + viewportWidth - padding) {
|
|
105
|
-
left = triggerRect.left + scrollX - tooltipRect.width - padding;
|
|
106
|
-
}
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
setPosition({ top, left });
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}, [isVisible, placement]);
|
|
113
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: triggerRef, onMouseEnter: showTooltip, onMouseLeave: hideTooltip, className: "inline-block", children: children }), isVisible &&
|
|
114
|
-
createPortal(_jsx("div", { ref: tooltipRef, className: cn('fixed z-[9999] px-3 py-2', 'bg-gray-800 text-white text-xs rounded', 'shadow-lg', 'pointer-events-none', 'max-w-xs', className), style: {
|
|
115
|
-
top: `${position.top}px`,
|
|
116
|
-
left: `${position.left}px`,
|
|
117
|
-
}, children: content }), document.body)] }));
|
|
118
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../lib/utils';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
const Table = React.forwardRef(({ className, containerClassName, ...props }, ref) => (_jsx("div", { className: cn('relative w-full overflow-auto rounded-[20px]', containerClassName), children: _jsx("table", { ref: ref, className: cn('w-full caption-bottom text-sm', className), ...props }) })));
|
|
5
|
-
Table.displayName = 'Table';
|
|
6
|
-
const TableHeader = React.forwardRef(({ className, ...props }, ref) => _jsx("thead", { ref: ref, className: cn('bg-table-header', className), ...props }));
|
|
7
|
-
TableHeader.displayName = 'TableHeader';
|
|
8
|
-
const TableBody = React.forwardRef(({ className, ...props }, ref) => (_jsx("tbody", { ref: ref, className: cn('[&_tr:last-child]:border-0', className), ...props })));
|
|
9
|
-
TableBody.displayName = 'TableBody';
|
|
10
|
-
const TableFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("tfoot", { ref: ref, className: cn('border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', className), ...props })));
|
|
11
|
-
TableFooter.displayName = 'TableFooter';
|
|
12
|
-
const TableRow = React.forwardRef(({ className, ...props }, ref) => (_jsx("tr", { ref: ref, className: cn('border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted', className), ...props })));
|
|
13
|
-
TableRow.displayName = 'TableRow';
|
|
14
|
-
const TableHead = React.forwardRef(({ className, isAction, ...props }, ref) => (_jsx("th", { ref: ref, className: cn('h-12 px-4 text-left align-middle text-xs font-normal', 'text-table-head-text', isAction && 'bg-table-action text-table-action-text w-[85px] text-center', className), ...props })));
|
|
15
|
-
TableHead.displayName = 'TableHead';
|
|
16
|
-
const TableCell = React.forwardRef(({ className, isAction, ...props }, ref) => (_jsx("td", { ref: ref, className: cn('p-4 align-middle text-sm font-normal', 'text-table-cell-text', isAction && 'bg-table-action text-table-action-text w-[85px] text-center', className), ...props })));
|
|
17
|
-
TableCell.displayName = 'TableCell';
|
|
18
|
-
const TableCaption = React.forwardRef(({ className, ...props }, ref) => (_jsx("caption", { ref: ref, className: cn('mt-4 text-sm text-muted-foreground', className), ...props })));
|
|
19
|
-
TableCaption.displayName = 'TableCaption';
|
|
20
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|