@_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
|
@@ -9,7 +9,7 @@ import { Search } from '../Search';
|
|
|
9
9
|
import { useTableSearchLocaleStore } from './tableSearchLocaleStore';
|
|
10
10
|
const EXPAND_BOUNDARIES = 4;
|
|
11
11
|
const TableSearch = (props) => {
|
|
12
|
-
const { onSearch, onReset, exportMenuItems, btnConfig: PBtnText, expandBoundaries = EXPAND_BOUNDARIES,
|
|
12
|
+
const { onSearch, onReset, exportMenuItems, btnConfig: PBtnText, expandBoundaries = EXPAND_BOUNDARIES, schemas, onExport, additionalButtons, defaultExpand = true, renderActionBtnArea, ...searchProps } = props;
|
|
13
13
|
const formRef = useRef(undefined);
|
|
14
14
|
const [isExpanded, setIsExpanded] = useState(defaultExpand);
|
|
15
15
|
const handleSearch = () => {
|
|
@@ -68,35 +68,34 @@ const TableSearch = (props) => {
|
|
|
68
68
|
PBtnText?.expandIcon,
|
|
69
69
|
locale,
|
|
70
70
|
]);
|
|
71
|
-
const {
|
|
72
|
-
const
|
|
71
|
+
const { permanentSchemas, alternativeSchemas } = useMemo(() => {
|
|
72
|
+
const alternativeSchemas = [];
|
|
73
73
|
const tmp = [];
|
|
74
|
-
for (let index = 0; index <
|
|
75
|
-
const item =
|
|
74
|
+
for (let index = 0; index < schemas.length; index++) {
|
|
75
|
+
const item = schemas[index];
|
|
76
76
|
if (item.isPermanent) {
|
|
77
77
|
tmp.push(item);
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
|
-
|
|
80
|
+
alternativeSchemas.push(item);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
if (tmp.length < expandBoundaries) {
|
|
84
84
|
const candidates = expandBoundaries - tmp.length;
|
|
85
85
|
for (let index = 0; index < candidates; index++) {
|
|
86
|
-
tmp.push(
|
|
86
|
+
tmp.push(alternativeSchemas[index]);
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
alternativeSchemas.splice(0, candidates);
|
|
89
89
|
}
|
|
90
|
-
return {
|
|
91
|
-
}, [expandBoundaries,
|
|
92
|
-
const showExpandedBtn =
|
|
93
|
-
let
|
|
94
|
-
// 有展开
|
|
90
|
+
return { alternativeSchemas, permanentSchemas: tmp };
|
|
91
|
+
}, [expandBoundaries, schemas]);
|
|
92
|
+
const showExpandedBtn = schemas.length > expandBoundaries;
|
|
93
|
+
let SSchemas;
|
|
95
94
|
if (showExpandedBtn) {
|
|
96
|
-
|
|
97
|
-
?
|
|
95
|
+
SSchemas = isExpanded
|
|
96
|
+
? schemas
|
|
98
97
|
: [
|
|
99
|
-
...
|
|
98
|
+
...permanentSchemas,
|
|
100
99
|
{
|
|
101
100
|
type: 'group',
|
|
102
101
|
fieldProps: {
|
|
@@ -104,16 +103,16 @@ const TableSearch = (props) => {
|
|
|
104
103
|
display: 'none',
|
|
105
104
|
},
|
|
106
105
|
},
|
|
107
|
-
|
|
108
|
-
childrens:
|
|
106
|
+
key: 'gropu1',
|
|
107
|
+
childrens: alternativeSchemas,
|
|
109
108
|
},
|
|
110
109
|
];
|
|
111
110
|
}
|
|
112
111
|
else {
|
|
113
|
-
|
|
112
|
+
SSchemas = schemas;
|
|
114
113
|
}
|
|
115
|
-
return (_jsxs(Search, { getForm: (form) => {
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
return (_jsx("div", { className: "tc-ui-table-search", children: _jsxs(Search, { getForm: (form) => {
|
|
115
|
+
formRef.current = form;
|
|
116
|
+
}, schemas: SSchemas, ...searchProps, children: [showExpandedBtn && (_jsx(Button, { variant: "default", size: "sm", onClick: handleExpand, rightIcon: _jsx("span", { className: cn('transition-transform duration-200', isExpanded && 'rotate-180'), children: btnConfig.expandIcon }), children: isExpanded ? btnConfig.collapseBtn : btnConfig.expandBtn }, "expandedBtn")), _jsx(Button, { variant: "primary", size: "sm", onClick: handleSearch, children: btnConfig.searchBtn }), _jsx(Button, { variant: "default", size: "sm", onClick: handleReset, children: btnConfig.resetBtn }), renderActionBtnArea ? (renderActionBtnArea()) : (_jsx(Dropdown, { items: defaultExportItems, placement: "bottom-end", children: _jsx(Button, { variant: "default", size: "sm", rightIcon: _jsx(ChevronDown, { className: "h-4 w-4" }), children: btnConfig.exportBtn }) })), additionalButtons] }) }));
|
|
118
117
|
};
|
|
119
118
|
export default TableSearch;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
+
import { defaultEnglishResources, defaultLanguageResources } from '../../../../common/i18n';
|
|
2
|
+
const tableSearchDefaultLocale = defaultLanguageResources.components.tableSearch;
|
|
3
|
+
const tableSearchDefaultEnglishLocale = defaultEnglishResources.components.tableSearch;
|
|
1
4
|
export const zhCNLocale = {
|
|
2
|
-
|
|
3
|
-
search: '查询',
|
|
4
|
-
export: '导出Excel',
|
|
5
|
-
expand: '展开',
|
|
6
|
-
collapse: '收起',
|
|
7
|
-
exportCurrentPage: '当前页',
|
|
8
|
-
exportCurrentQuery: '当前查询条件',
|
|
5
|
+
...tableSearchDefaultLocale,
|
|
9
6
|
};
|
|
10
7
|
export const enUSLocale = {
|
|
11
|
-
|
|
12
|
-
search: 'Search',
|
|
13
|
-
export: 'Export Excel',
|
|
14
|
-
expand: 'Expand',
|
|
15
|
-
collapse: 'Collapse',
|
|
16
|
-
exportCurrentPage: 'Current Page',
|
|
17
|
-
exportCurrentQuery: 'Current Filters',
|
|
8
|
+
...tableSearchDefaultEnglishLocale,
|
|
18
9
|
};
|
|
19
10
|
export const defaultLocale = zhCNLocale;
|
|
20
11
|
export const btnConfig = defaultLocale;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ChangeEvent, TextareaHTMLAttributes } from "react";
|
|
2
|
+
export type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "onChange" | "defaultValue"> & {
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange?: (v: string, e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
maxLength?: number;
|
|
7
|
+
showCount?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
textareaClassName?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const Textarea: import("react").ForwardRefExoticComponent<Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue" | "onChange"> & {
|
|
12
|
+
value?: string;
|
|
13
|
+
onChange?: (v: string, e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
maxLength?: number;
|
|
16
|
+
showCount?: boolean;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
textareaClassName?: string;
|
|
19
|
+
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
20
|
+
export { Textarea };
|
|
21
|
+
//# sourceMappingURL=Textarea.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
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, textareaClassName, 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
|
+
if (maxLength && newValue.length > maxLength) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!isControlledRef.current) {
|
|
17
|
+
setInternalValue(newValue);
|
|
18
|
+
}
|
|
19
|
+
onChange?.(newValue, e);
|
|
20
|
+
}, [maxLength, isControlledRef, onChange, setInternalValue]);
|
|
21
|
+
return (_jsxs("div", { className: cn("tc-ui-textarea relative w-fit", className), 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
|
|
22
|
+
? "cursor-not-allowed bg-muted border-border text-muted-foreground"
|
|
23
|
+
: "bg-background", !disabled && !hasValue && !isFocused && "border-border", !disabled && (hasValue || isFocused) && "border-foreground", textareaClassName), onFocus: (e) => {
|
|
24
|
+
if (!disabled) {
|
|
25
|
+
setIsFocused(true);
|
|
26
|
+
props.onFocus?.(e);
|
|
27
|
+
}
|
|
28
|
+
}, onBlur: (e) => {
|
|
29
|
+
if (!disabled) {
|
|
30
|
+
setIsFocused(false);
|
|
31
|
+
props.onBlur?.(e);
|
|
32
|
+
}
|
|
33
|
+
}, disabled: disabled, ...props }), showCount && (_jsxs("div", { className: cn('text-end', "text-xs text-muted-foreground", "pointer-events-none"), children: [currentLength, "/", maxLength] }))] }));
|
|
34
|
+
});
|
|
35
|
+
Textarea.displayName = "Textarea";
|
|
36
|
+
export { Textarea };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Textarea';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface TooltipProps {
|
|
2
|
+
content: React.ReactNode;
|
|
3
|
+
children: React.ReactElement;
|
|
4
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Tooltip({ content, children, placement, visible, className, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
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(() => {
|
|
31
|
+
if (!triggerRef.current || !tooltipRef.current)
|
|
32
|
+
return;
|
|
33
|
+
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
34
|
+
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
35
|
+
const padding = 8;
|
|
36
|
+
let top = 0;
|
|
37
|
+
let left = 0;
|
|
38
|
+
switch (placement) {
|
|
39
|
+
case "top":
|
|
40
|
+
top = triggerRect.top - tooltipRect.height - padding;
|
|
41
|
+
left =
|
|
42
|
+
triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;
|
|
43
|
+
break;
|
|
44
|
+
case "bottom":
|
|
45
|
+
top = triggerRect.bottom + padding;
|
|
46
|
+
left =
|
|
47
|
+
triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;
|
|
48
|
+
break;
|
|
49
|
+
case "left":
|
|
50
|
+
top = triggerRect.top;
|
|
51
|
+
left = triggerRect.left - tooltipRect.width - padding;
|
|
52
|
+
break;
|
|
53
|
+
case "right":
|
|
54
|
+
top = triggerRect.top;
|
|
55
|
+
left = triggerRect.right + padding;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
setPosition({ top, left });
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (!isVisible) {
|
|
62
|
+
const top = -100, left = -100;
|
|
63
|
+
setPosition({ top, left });
|
|
64
|
+
}
|
|
65
|
+
}, [isVisible, placement]);
|
|
66
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: triggerRef, onMouseEnter: showTooltip, onMouseLeave: hideTooltip, className: "tc-ui-tooltip inline-block", children: children }), isVisible &&
|
|
67
|
+
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: {
|
|
68
|
+
top: `${position.top}px`,
|
|
69
|
+
left: `${position.left}px`,
|
|
70
|
+
}, children: content }), document.body)] }));
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Tooltip';
|
|
@@ -5,20 +5,14 @@ export interface TreeNode {
|
|
|
5
5
|
children?: TreeNode[];
|
|
6
6
|
}
|
|
7
7
|
export interface TreeSelectProps {
|
|
8
|
-
/** 树形数据 */
|
|
9
8
|
data: TreeNode[];
|
|
10
|
-
/** 已选中的节点 ID 数组 */
|
|
11
9
|
value?: (string | number)[];
|
|
12
|
-
/** 选中状态改变回调,返回选中的 keys 和半选的 keys */
|
|
13
10
|
onChange?: (keys: {
|
|
14
11
|
checked: (string | number)[];
|
|
15
12
|
indeterminate: (string | number)[];
|
|
16
13
|
}) => void;
|
|
17
|
-
/** 节点文本字段名 */
|
|
18
14
|
labelField?: 'name' | 'desctext';
|
|
19
|
-
/** 是否可以选择 */
|
|
20
15
|
checkable?: boolean;
|
|
21
|
-
/** 自定义类名 */
|
|
22
16
|
className?: string;
|
|
23
17
|
}
|
|
24
18
|
export declare function TreeSelect({ data, value, onChange, labelField, checkable, className, }: TreeSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '
|
|
3
|
-
import {
|
|
2
|
+
import { cn } from '../../lib/utils';
|
|
3
|
+
import { ChevronDown, ChevronRight } from 'lucide-react';
|
|
4
4
|
import { useCallback, useMemo, useState } from 'react';
|
|
5
|
+
import { Button } from '../Button';
|
|
6
|
+
import { Checkbox } from '../Checkbox';
|
|
5
7
|
export function TreeSelect({ data, value = [], onChange, labelField = 'name', checkable = true, className, }) {
|
|
6
8
|
const [expandedKeys, setExpandedKeys] = useState(new Set());
|
|
7
9
|
const { nodeMap, parentMap } = useMemo(() => {
|
|
@@ -19,7 +21,6 @@ export function TreeSelect({ data, value = [], onChange, labelField = 'name', ch
|
|
|
19
21
|
traverse(data, null);
|
|
20
22
|
return { nodeMap: nodeM, parentMap: parentM };
|
|
21
23
|
}, [data]);
|
|
22
|
-
// 获取节点的所有子节点 ID
|
|
23
24
|
const getDescendantIds = useCallback((node) => {
|
|
24
25
|
const ids = [];
|
|
25
26
|
const traverse = (n) => {
|
|
@@ -53,7 +54,6 @@ export function TreeSelect({ data, value = [], onChange, labelField = 'name', ch
|
|
|
53
54
|
};
|
|
54
55
|
checkedSet.forEach((id) => traverseUp(id));
|
|
55
56
|
}, [nodeMap, parentMap]);
|
|
56
|
-
// 切换展开/折叠
|
|
57
57
|
const toggleExpand = useCallback((nodeId) => {
|
|
58
58
|
setExpandedKeys((prev) => {
|
|
59
59
|
const newSet = new Set(prev);
|
|
@@ -91,7 +91,6 @@ export function TreeSelect({ data, value = [], onChange, labelField = 'name', ch
|
|
|
91
91
|
traverse(data);
|
|
92
92
|
return indeterminateKeys;
|
|
93
93
|
}, [data]);
|
|
94
|
-
// 切换选中状态
|
|
95
94
|
const toggleCheck = useCallback((node) => {
|
|
96
95
|
if (!checkable || !onChange)
|
|
97
96
|
return;
|
|
@@ -110,7 +109,6 @@ export function TreeSelect({ data, value = [], onChange, labelField = 'name', ch
|
|
|
110
109
|
const indeterminateKeys = getIndeterminateKeys(nextChecked);
|
|
111
110
|
onChange({ checked: Array.from(nextChecked), indeterminate: indeterminateKeys });
|
|
112
111
|
}, [value, onChange, checkable, getDescendantIds, updateParentSelection, getIndeterminateKeys]);
|
|
113
|
-
// 判断节点是否选中
|
|
114
112
|
const isNodeChecked = useCallback((nodeId) => {
|
|
115
113
|
return value.includes(nodeId);
|
|
116
114
|
}, [value]);
|
|
@@ -129,23 +127,18 @@ export function TreeSelect({ data, value = [], onChange, labelField = 'name', ch
|
|
|
129
127
|
const { total, checked } = getDescendantCount(node);
|
|
130
128
|
return checked > 0 && checked < total;
|
|
131
129
|
}, [value]);
|
|
132
|
-
// 渲染树节点
|
|
133
130
|
function renderTreeNode(node, level = 0) {
|
|
134
131
|
const hasChildren = node.children && node.children.length > 0;
|
|
135
132
|
const isExpanded = expandedKeys.has(node.id);
|
|
136
133
|
const isChecked = isNodeChecked(node.id);
|
|
137
134
|
const isIndeterminate = isNodeIndeterminate(node);
|
|
138
|
-
return (_jsxs("div", { children: [_jsxs("div", { className: cn('flex items-center gap-2 py-2 px-2 hover:bg-muted/50 rounded-md cursor-pointer transition-colors', 'group'), style: { paddingLeft: `${level * 20 + 8}px` }, children: [hasChildren ? (_jsx("
|
|
135
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: cn('flex items-center gap-2 py-2 px-2 hover:bg-muted/50 rounded-md cursor-pointer transition-colors', 'group'), style: { paddingLeft: `${level * 20 + 8}px` }, children: [hasChildren ? (_jsx(Button, { variant: "text", type: "button", onClick: (e) => {
|
|
139
136
|
e.stopPropagation();
|
|
140
137
|
toggleExpand(node.id);
|
|
141
|
-
}, className: "flex-shrink-0 p-0.5 hover:bg-muted rounded", children: isExpanded ? _jsx(ChevronDown, { className: "h-4 w-4" }) : _jsx(ChevronRight, { className: "h-4 w-4" }) })) : (_jsx("span", { className: "w-5" })), checkable && (_jsx(
|
|
138
|
+
}, className: "flex-shrink-0 p-0.5 hover:bg-muted rounded", children: isExpanded ? _jsx(ChevronDown, { className: "h-4 w-4" }) : _jsx(ChevronRight, { className: "h-4 w-4" }) })) : (_jsx("span", { className: "w-5" })), checkable && (_jsx(Checkbox, { className: "flex-shrink-0", checked: isChecked, indeterminate: isIndeterminate, "aria-label": `Select ${node.name}`, onChange: (_, e) => {
|
|
142
139
|
e.stopPropagation();
|
|
143
140
|
toggleCheck(node);
|
|
144
|
-
}, className:
|
|
145
|
-
? 'bg-black border-black'
|
|
146
|
-
: isIndeterminate
|
|
147
|
-
? 'bg-gray-400 border-gray-400'
|
|
148
|
-
: 'border-border hover:border-foreground'), children: (isChecked || isIndeterminate) && _jsx(Check, { className: "h-3 w-3 text-white", strokeWidth: 3 }) })), _jsx("span", { className: "flex-1 text-sm select-none", onClick: () => {
|
|
141
|
+
} })), _jsx("span", { className: "flex-1 text-sm select-none", onClick: () => {
|
|
149
142
|
if (hasChildren) {
|
|
150
143
|
toggleExpand(node.id);
|
|
151
144
|
}
|
|
@@ -154,9 +147,8 @@ export function TreeSelect({ data, value = [], onChange, labelField = 'name', ch
|
|
|
154
147
|
}
|
|
155
148
|
}, children: labelField === 'desctext' ? node.desctext || node.name : node.name })] }), hasChildren && isExpanded && _jsx("div", { children: node.children.map((child) => renderTreeNode(child, level + 1)) })] }, node.id));
|
|
156
149
|
}
|
|
157
|
-
// 如果没有数据
|
|
158
150
|
if (!data || data.length === 0) {
|
|
159
|
-
return _jsx("div", { className: cn('p-8 text-center text-sm text-muted-foreground', className), children: "No data" });
|
|
151
|
+
return _jsx("div", { className: cn('tc-ui-tree-select p-8 text-center text-sm text-muted-foreground', className), children: "No data" });
|
|
160
152
|
}
|
|
161
|
-
return (_jsx("div", { className: cn('border border-border rounded-lg p-2 max-h-[400px] overflow-y-auto', className), children: data.map((node) => renderTreeNode(node)) }));
|
|
153
|
+
return (_jsx("div", { className: cn('tc-ui-tree-select border border-border rounded-lg p-2 max-h-[400px] overflow-y-auto', className), children: data.map((node) => renderTreeNode(node)) }));
|
|
162
154
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TreeSelect';
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useI18n } from '../../i18n';
|
|
2
3
|
import { Camera, X } from 'lucide-react';
|
|
3
4
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { Button } from '../Button';
|
|
4
6
|
import { FileUpload } from './Upload';
|
|
5
7
|
export function ImageUpload({ accept = '.jpg,.png', maxCount = 1, value, onChange, beforeChange }) {
|
|
8
|
+
const t = useI18n();
|
|
6
9
|
const inputRef = useRef(null);
|
|
7
10
|
const [internalUrls, setInternalUrls] = useState([]);
|
|
11
|
+
const internalUrlsRef = useRef([]);
|
|
8
12
|
const urls = value ?? internalUrls;
|
|
9
13
|
const setUrls = onChange ?? setInternalUrls;
|
|
10
14
|
const mAccept = useMemo(() => {
|
|
@@ -49,15 +53,23 @@ export function ImageUpload({ accept = '.jpg,.png', maxCount = 1, value, onChang
|
|
|
49
53
|
URL.revokeObjectURL(urlToRemove);
|
|
50
54
|
setUrls(urls.filter((_, i) => i !== index));
|
|
51
55
|
};
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (onChange) {
|
|
58
|
+
internalUrlsRef.current = [];
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const removedUrls = internalUrlsRef.current.filter((url) => !internalUrls.includes(url));
|
|
62
|
+
removedUrls.forEach((url) => URL.revokeObjectURL(url));
|
|
63
|
+
internalUrlsRef.current = internalUrls;
|
|
64
|
+
}, [onChange, internalUrls]);
|
|
52
65
|
useEffect(() => {
|
|
53
66
|
return () => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
67
|
+
internalUrlsRef.current.forEach((url) => URL.revokeObjectURL(url));
|
|
68
|
+
internalUrlsRef.current = [];
|
|
57
69
|
};
|
|
58
|
-
}, [
|
|
59
|
-
return (_jsxs("div", { className: "flex flex-wrap gap-3", children: [urls.map((url, index) => (_jsxs("div", { className: "relative w-24 h-24 rounded-lg overflow-hidden border border-gray-200 group cursor-pointer", children: [_jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), _jsx("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors flex items-center justify-center", children: _jsx("
|
|
70
|
+
}, []);
|
|
71
|
+
return (_jsxs("div", { className: "tc-ui-image-upload flex flex-wrap gap-3", children: [urls.map((url, index) => (_jsxs("div", { className: "relative w-24 h-24 rounded-lg overflow-hidden border border-gray-200 group cursor-pointer", children: [_jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), _jsx("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors flex items-center justify-center", children: _jsx(Button, { variant: "text", type: "button", onClick: (e) => {
|
|
60
72
|
e.stopPropagation();
|
|
61
73
|
handleRemove(index);
|
|
62
|
-
}, className: "opacity-0 group-hover:opacity-100 transition-opacity p-1.5 rounded-full bg-red-500 hover:bg-red-600 text-white", "aria-label":
|
|
74
|
+
}, className: "opacity-0 group-hover:opacity-100 transition-opacity p-1.5 rounded-full bg-red-500 hover:bg-red-600 text-white", "aria-label": t('components.upload.deleteImage'), title: t('components.upload.deleteImage'), children: _jsx(X, { size: 16 }) }) })] }, index))), urls.length < maxCount && (_jsx(FileUpload, { inputRef: inputRef, accept: mAccept, multiple: maxCount > 1, onChange: handleFileChange, labelClassName: "w-24 h-24 p-0 border-0 cursor-pointer", selectLabel: _jsxs("div", { className: "w-full h-full rounded-[8px] bg-[#F5F5F5] border border-gray-200 flex flex-col items-center justify-center gap-1 hover:bg-gray-50 transition-colors", children: [_jsx(Camera, { className: "text-gray-500", size: 24 }), _jsx("span", { className: "text-xs text-gray-500", children: t('components.upload.upload') })] }) }))] }));
|
|
63
75
|
}
|
|
@@ -1,40 +1,13 @@
|
|
|
1
1
|
import type { ChangeEvent, ReactNode, RefObject } from 'react';
|
|
2
2
|
export interface FileUploadProps {
|
|
3
|
-
/**
|
|
4
|
-
* 文件 input 的 ref,用于父组件重置 value 等
|
|
5
|
-
*/
|
|
6
3
|
inputRef?: RefObject<HTMLInputElement | null>;
|
|
7
|
-
/**
|
|
8
|
-
* input 的 accept 属性,默认接收任意文件
|
|
9
|
-
*/
|
|
10
4
|
accept?: string;
|
|
11
|
-
/**
|
|
12
|
-
* 是否支持多选
|
|
13
|
-
*/
|
|
14
5
|
multiple?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* 选择文件时的回调
|
|
17
|
-
*/
|
|
18
6
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
-
/**
|
|
20
|
-
* 选择文件按钮文案
|
|
21
|
-
*/
|
|
22
7
|
selectLabel: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* label 的自定义 className
|
|
25
|
-
*/
|
|
26
8
|
labelClassName?: string;
|
|
27
|
-
/**
|
|
28
|
-
* 是否展示清空按钮
|
|
29
|
-
*/
|
|
30
9
|
showClear?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 清空按钮点击回调
|
|
33
|
-
*/
|
|
34
10
|
onClear?: () => void;
|
|
35
|
-
/**
|
|
36
|
-
* 清空按钮文案
|
|
37
|
-
*/
|
|
38
11
|
clearLabel?: ReactNode;
|
|
39
12
|
}
|
|
40
13
|
export declare function FileUpload({ inputRef, accept, multiple, onChange, selectLabel, labelClassName, showClear, onClear, clearLabel, }: FileUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '../Button';
|
|
3
|
+
import { Input } from '../Input';
|
|
3
4
|
export function FileUpload({ inputRef, accept = '*', multiple, onChange, selectLabel, labelClassName, showClear, onClear, clearLabel, }) {
|
|
4
|
-
return (_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("label", { className: labelClassName ?? 'flex items-center gap-2 px-4 py-2 border rounded-lg cursor-pointer bg-
|
|
5
|
+
return (_jsxs("div", { className: "tc-ui-file-upload flex items-center gap-3", children: [_jsxs("label", { className: labelClassName ?? 'flex items-center gap-2 px-4 py-2 border rounded-lg cursor-pointer bg-background', children: [_jsx(Input, { ref: inputRef, type: "file", accept: accept, multiple: multiple, className: "hidden", onChange: (_, e) => onChange?.(e) }), selectLabel] }), showClear && onClear && (_jsx(Button, { size: "sm", variant: "link", onClick: onClear, children: clearLabel }))] }));
|
|
5
6
|
}
|
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import { useI18n } from '../../i18n';
|
|
3
|
+
import { useBreadcrumb } from '../../hooks/useBreadcrumb';
|
|
4
|
+
import { useLanguage } from '../../hooks/useLanguage';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
6
|
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
7
7
|
import { forwardRef } from 'react';
|
|
8
8
|
import { useNavigate } from 'react-router-dom';
|
|
9
|
-
|
|
9
|
+
import { Button } from '../Button';
|
|
10
|
+
const Breadcrumb = forwardRef(({ className, ...props }, ref) => _jsx("nav", { ref: ref, "aria-label": "breadcrumb", className: cn('tc-ui-breadcrumb', className), ...props }));
|
|
10
11
|
Breadcrumb.displayName = 'Breadcrumb';
|
|
11
|
-
const BreadcrumbList = forwardRef(({ className, ...props }, ref) => (_jsx("ol", { ref: ref, className: cn('flex items-center gap-3 flex-wrap', className), ...props })));
|
|
12
|
+
const BreadcrumbList = forwardRef(({ className, ...props }, ref) => (_jsx("ol", { ref: ref, className: cn('tc-ui-breadcrumb-list flex items-center gap-3 flex-wrap', className), ...props })));
|
|
12
13
|
BreadcrumbList.displayName = 'BreadcrumbList';
|
|
13
|
-
const BreadcrumbItem = forwardRef(({ className, ...props }, ref) => _jsx("li", { ref: ref, className: cn('inline-flex items-center', className), ...props }));
|
|
14
|
+
const BreadcrumbItem = forwardRef(({ className, ...props }, ref) => _jsx("li", { ref: ref, className: cn('tc-ui-breadcrumb-item inline-flex items-center', className), ...props }));
|
|
14
15
|
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
15
16
|
const BreadcrumbLink = forwardRef(({ className, ...props }, ref) => {
|
|
16
|
-
return _jsx("a", { ref: ref, className: cn('transition-colors hover:text-foreground', className), ...props });
|
|
17
|
+
return _jsx("a", { ref: ref, className: cn('tc-ui-breadcrumb-link transition-colors hover:text-foreground', className), ...props });
|
|
17
18
|
});
|
|
18
19
|
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
19
20
|
const BreadcrumbPage = forwardRef(({ className, active, onClose, closable = true, children, ...props }, ref) => {
|
|
20
|
-
|
|
21
|
+
const t = useI18n();
|
|
22
|
+
return (_jsxs("span", { ref: ref, role: "link", "aria-disabled": "true", "aria-current": "page", className: cn('tc-ui-breadcrumb-page inline-flex items-center gap-2 px-4 py-2 rounded-lg border transition-all duration-200 text-sm', active
|
|
21
23
|
? 'bg-breadcrumb-active-bg text-breadcrumb-active-text border-breadcrumb-active-bg shadow-sm'
|
|
22
|
-
: 'bg-
|
|
24
|
+
: 'bg-background text-breadcrumb-text border-breadcrumb-border hover:border-gray-400', className), ...props, children: [_jsx("span", { className: "font-normal", children: children }), onClose && closable && (_jsx(Button, { variant: "text", type: "button", onClick: (e) => {
|
|
23
25
|
e.stopPropagation();
|
|
24
26
|
onClose();
|
|
25
|
-
}, className: "inline-flex items-center justify-center hover:opacity-70 transition-opacity", "aria-label":
|
|
27
|
+
}, className: "inline-flex items-center justify-center hover:opacity-70 transition-opacity", "aria-label": t('components.breadcrumb.close'), children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsxs("g", { clipPath: "url(#clip0_228_519)", children: [_jsx("circle", { cx: "8", cy: "8", r: "6.66667", stroke: "currentColor", strokeWidth: "1" }), _jsx("path", { d: "M9.66669 6.33302L6.33337 9.66634M6.33336 6.33301L9.66668 9.66633", stroke: "currentColor", strokeWidth: "1", strokeLinecap: "round" })] }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_228_519", children: _jsx("rect", { width: "16", height: "16", fill: "white" }) }) })] }) }))] }));
|
|
26
28
|
});
|
|
27
29
|
BreadcrumbPage.displayName = 'BreadcrumbPage';
|
|
28
|
-
const BreadcrumbSeparator = ({ children, className, ...props }) => (_jsx("li", { role: "presentation", "aria-hidden": "true", className: cn('[&>svg]:size-3.5', className), ...props, children: children ?? _jsx(ChevronRight, {}) }));
|
|
30
|
+
const BreadcrumbSeparator = ({ children, className, ...props }) => (_jsx("li", { role: "presentation", "aria-hidden": "true", className: cn('tc-ui-breadcrumb-separator [&>svg]:size-3.5', className), ...props, children: children ?? _jsx(ChevronRight, {}) }));
|
|
29
31
|
BreadcrumbSeparator.displayName = 'BreadcrumbSeparator';
|
|
30
|
-
const BreadcrumbEllipsis = ({ className, ...props }) => (_jsxs("span", { role: "presentation", "aria-hidden": "true", "aria-label": "More", className: cn('flex h-9 w-9 items-center justify-center', className), ...props, children: [_jsx(MoreHorizontal, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
32
|
+
const BreadcrumbEllipsis = ({ className, ...props }) => (_jsxs("span", { role: "presentation", "aria-hidden": "true", "aria-label": "More", className: cn('tc-ui-breadcrumb-ellipsis flex h-9 w-9 items-center justify-center', className), ...props, children: [_jsx(MoreHorizontal, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
31
33
|
BreadcrumbEllipsis.displayName = 'BreadcrumbEllipsis';
|
|
32
34
|
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, };
|
|
33
35
|
export function SimpleBreadcrumb({ className }) {
|
|
@@ -44,18 +46,13 @@ export function SimpleBreadcrumb({ className }) {
|
|
|
44
46
|
const handleBreadcrumbClose = (id) => {
|
|
45
47
|
const itemToRemove = items.find((item) => item.id === id);
|
|
46
48
|
const isActive = itemToRemove?.active;
|
|
47
|
-
// 先计算剩余的面包屑项(在删除之前)
|
|
48
49
|
const remainingItems = items.filter((item) => item.id !== id);
|
|
49
|
-
// 立即删除该项,确保状态及时更新
|
|
50
50
|
removeItem(id);
|
|
51
|
-
// 如果删除的是当前激活的项,需要跳转
|
|
52
51
|
if (isActive) {
|
|
53
52
|
if (remainingItems.length > 0) {
|
|
54
|
-
// 有剩余项,跳转到最后一个
|
|
55
53
|
const targetItem = remainingItems.at(-1);
|
|
56
54
|
const targetPath = targetItem.path;
|
|
57
55
|
if (targetPath) {
|
|
58
|
-
// 使用 setTimeout 确保删除操作先完成
|
|
59
56
|
setTimeout(() => {
|
|
60
57
|
navigate(targetPath);
|
|
61
58
|
setActiveItem(targetItem.id);
|
|
@@ -63,10 +60,7 @@ export function SimpleBreadcrumb({ className }) {
|
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
else {
|
|
66
|
-
// 获取首页路径(第一个权限页面)
|
|
67
63
|
setTimeout(() => {
|
|
68
|
-
// todo
|
|
69
|
-
// navigate(useUserStore.getState().userPagePermissions[0]?.menuUrl || '/')
|
|
70
64
|
}, 0);
|
|
71
65
|
}
|
|
72
66
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './breadcrumb';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
export type DropdownPlacement = "bottom-end" | "bottom-start" | "left-start" | "top-end" | "top-start" | "right-start" | "right-end";
|
|
3
|
+
export type DropdownPosition = {
|
|
4
|
+
top: number;
|
|
5
|
+
left?: number;
|
|
6
|
+
right?: number;
|
|
7
|
+
width?: number;
|
|
8
|
+
};
|
|
9
|
+
export type DropdownPositioningContext = {
|
|
10
|
+
anchorRect: DOMRect;
|
|
11
|
+
contentRect?: DOMRect;
|
|
12
|
+
containerRect?: DOMRect;
|
|
13
|
+
viewportWidth: number;
|
|
14
|
+
viewportHeight: number;
|
|
15
|
+
placement: DropdownPlacement;
|
|
16
|
+
offset: number;
|
|
17
|
+
matchAnchorWidth: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type DropdownPositioningStrategy = (context: DropdownPositioningContext) => DropdownPosition;
|
|
20
|
+
export type UseDropdownPositioningOptions = {
|
|
21
|
+
open: boolean;
|
|
22
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
23
|
+
contentRef: RefObject<HTMLElement | null>;
|
|
24
|
+
placement?: DropdownPlacement;
|
|
25
|
+
offset?: number;
|
|
26
|
+
matchAnchorWidth?: boolean;
|
|
27
|
+
strategy?: DropdownPositioningStrategy;
|
|
28
|
+
estimateSize?: () => {
|
|
29
|
+
width?: number;
|
|
30
|
+
height?: number;
|
|
31
|
+
};
|
|
32
|
+
watchDeps?: readonly unknown[];
|
|
33
|
+
containerRef?: RefObject<HTMLElement | null>;
|
|
34
|
+
positionMode?: "fixed" | "absolute";
|
|
35
|
+
};
|
|
36
|
+
export type UseDropdownPositioningResult = {
|
|
37
|
+
position: DropdownPosition;
|
|
38
|
+
ready: boolean;
|
|
39
|
+
updatePosition: () => void;
|
|
40
|
+
};
|
|
41
|
+
export declare const getDefaultDropdownPosition: DropdownPositioningStrategy;
|
|
42
|
+
export declare function useDropdownPositioning({ open, anchorRef, contentRef, placement, offset, matchAnchorWidth, strategy, estimateSize, watchDeps, containerRef, positionMode, }: UseDropdownPositioningOptions): UseDropdownPositioningResult;
|
|
43
|
+
//# sourceMappingURL=useDropdownPositioning.d.ts.map
|