@_tc/template-core 0.0.1-bate.4 → 0.0.1-bate.41
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/_virtual/_rolldown/runtime.js +37 -0
- package/cjs/app/controller/base.js +29 -0
- package/cjs/app/controller/project.js +60 -0
- package/cjs/app/controller/view.js +24 -0
- package/cjs/app/data/signKey.js +23 -0
- package/cjs/app/extend/db.js +8 -0
- package/cjs/app/extend/generateErrorMessage.js +16 -0
- package/cjs/app/extend/logger.js +35 -0
- package/cjs/app/extend/parsingParamsOnUrl.js +22 -0
- package/cjs/app/extend/render-view.js +24 -0
- package/cjs/app/middleware/api-params-verify.js +72 -0
- package/cjs/app/middleware/api-sign-verify.js +23 -0
- package/cjs/app/middleware/error-handle.js +38 -0
- package/cjs/app/middleware/project-handler.js +21 -0
- package/cjs/app/middleware.js +32 -0
- package/cjs/app/router/project.js +10 -0
- package/cjs/app/router/view.js +9 -0
- package/cjs/app/router-schema/project.js +16 -0
- package/cjs/app/service/bese.js +17 -0
- package/cjs/app/service/project.js +38 -0
- package/cjs/app/type.js +1 -0
- package/cjs/app/typings.js +1 -0
- package/cjs/app/view/entry.tpl +30 -0
- package/cjs/bundler/defaultAlias.js +5 -0
- package/cjs/bundler/dev.js +20 -0
- package/cjs/bundler/index.js +19 -0
- package/cjs/bundler/prod.js +21 -0
- package/cjs/bundler/utils.js +192 -0
- package/cjs/index.js +23 -0
- 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/env.js +27 -0
- package/cjs/packages/core/index.js +110 -0
- package/cjs/packages/core/loader/config.js +43 -0
- package/cjs/packages/core/loader/controller.js +33 -0
- package/cjs/packages/core/loader/extend.js +31 -0
- package/cjs/packages/core/loader/middleware.js +30 -0
- package/cjs/packages/core/loader/model.js +111 -0
- package/cjs/packages/core/loader/router-schema.js +36 -0
- package/cjs/packages/core/loader/router.js +62 -0
- package/cjs/packages/core/loader/service.js +30 -0
- package/cjs/packages/core/paths.js +12 -0
- package/cjs/packages/core/types.js +1 -0
- package/cjs/packages/utils/getAllFilesInFolder.js +14 -0
- package/cjs/packages/utils/getAllFnReturnValue.js +1 -0
- package/cjs/packages/utils/index.js +11 -0
- package/cjs/packages/utils/loadFile.js +55 -0
- package/cjs/packages/utils/path.js +31 -0
- package/cjs/packages/utils/runFileFn.js +51 -0
- package/esm/_virtual/_rolldown/runtime.js +32 -0
- package/esm/app/controller/base.js +28 -0
- package/esm/app/controller/project.js +59 -0
- package/esm/app/controller/view.js +23 -0
- package/esm/app/data/signKey.js +10 -0
- package/esm/app/extend/db.js +7 -0
- package/esm/app/extend/generateErrorMessage.js +15 -0
- package/esm/app/extend/logger.js +34 -0
- package/esm/app/extend/parsingParamsOnUrl.js +21 -0
- package/esm/app/extend/render-view.js +21 -0
- package/esm/app/middleware/api-params-verify.js +70 -0
- package/esm/app/middleware/api-sign-verify.js +22 -0
- package/esm/app/middleware/error-handle.js +37 -0
- package/esm/app/middleware/project-handler.js +20 -0
- package/esm/app/middleware.js +28 -0
- package/esm/app/router/project.js +9 -0
- package/esm/app/router/view.js +8 -0
- package/esm/app/router-schema/project.js +15 -0
- package/esm/app/service/bese.js +15 -0
- package/esm/app/service/project.js +37 -0
- package/esm/app/type.js +0 -0
- package/esm/app/typings.js +0 -0
- package/esm/app/view/entry.tpl +30 -0
- package/esm/bundler/defaultAlias.js +4 -0
- package/esm/bundler/dev.js +18 -0
- package/esm/bundler/index.js +17 -0
- package/esm/bundler/prod.js +19 -0
- package/esm/bundler/utils.js +184 -0
- package/esm/index.js +19 -0
- 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/env.js +26 -0
- package/esm/packages/core/index.js +106 -0
- package/esm/packages/core/loader/config.js +42 -0
- package/esm/packages/core/loader/controller.js +32 -0
- package/esm/packages/core/loader/extend.js +30 -0
- package/esm/packages/core/loader/middleware.js +29 -0
- package/esm/packages/core/loader/model.js +109 -0
- package/esm/packages/core/loader/router-schema.js +35 -0
- package/esm/packages/core/loader/router.js +60 -0
- package/esm/packages/core/loader/service.js +29 -0
- package/esm/packages/core/paths.js +9 -0
- package/esm/packages/core/types.js +0 -0
- package/esm/packages/utils/getAllFilesInFolder.js +11 -0
- package/esm/packages/utils/getAllFnReturnValue.js +0 -0
- package/esm/packages/utils/index.js +5 -0
- package/esm/packages/utils/loadFile.js +49 -0
- package/esm/packages/utils/path.js +28 -0
- package/esm/packages/utils/runFileFn.js +50 -0
- package/fe/frontend/dash/Dashboard.d.ts +7 -0
- package/fe/frontend/dash/Dashboard.js +73 -0
- package/fe/frontend/dash/dash.entry.d.ts +2 -0
- package/fe/frontend/dash/dash.entry.js +80 -0
- package/fe/frontend/index.d.ts +3 -0
- package/fe/frontend/index.js +1 -0
- package/fe/frontend/main.css +5 -0
- package/fe/frontend/main.d.ts +11 -0
- package/fe/frontend/main.js +18 -0
- package/fe/frontend/testPage/index.d.ts +3 -0
- package/fe/frontend/testPage/index.js +6 -0
- package/fe/frontend/testPage/testPage.entry.d.ts +2 -0
- package/fe/frontend/testPage/testPage.entry.js +3 -0
- 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 +208 -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 +8 -0
- package/fe/frontend/widgets/common/language.d.ts +2 -0
- package/fe/frontend/widgets/common/language.js +9 -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 +34 -0
- package/fe/frontend/widgets/common/menu.js +101 -0
- package/fe/frontend/widgets/common/request.d.ts +36 -0
- package/fe/frontend/widgets/common/request.js +133 -0
- package/fe/frontend/widgets/components/BasePage/HeaderView.d.ts +9 -0
- package/fe/frontend/widgets/components/BasePage/HeaderView.js +16 -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 +124 -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 +63 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.d.ts +11 -0
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.js +188 -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 +74 -0
- package/fe/frontend/widgets/defaultPages/Schema/schemaType.d.ts +50 -0
- package/fe/frontend/widgets/defaultPages/Schema/schemaType.js +4 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.d.ts +42 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.js +70 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.d.ts +47 -0
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.js +26 -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 +115 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/validator.d.ts +7 -0
- package/fe/frontend/widgets/defaultPages/Schema/utils/validator.js +36 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +10 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +38 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.d.ts +3 -0
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.js +16 -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 +26 -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 +19 -0
- package/fe/frontend/widgets/hooks/useCurrentMenuData.js +28 -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 +19 -0
- package/fe/frontend/widgets/store/mode.js +37 -0
- package/fe/model/types/data/button.d.ts +32 -0
- package/fe/model/types/data/button.js +16 -0
- package/fe/model/types/data/component.d.ts +61 -0
- package/fe/model/types/data/component.js +11 -0
- package/fe/model/types/data/fetchInfo.d.ts +20 -0
- package/fe/model/types/data/fetchInfo.js +1 -0
- package/fe/model/types/data/schema.d.ts +98 -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 +73 -0
- package/fe/model/types/menuType.js +1 -0
- package/fe/model/types/model.d.ts +33 -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 +92 -0
- package/fe/packages/common/i18n/default.js +90 -0
- package/fe/packages/common/i18n/en-US.d.ts +92 -0
- package/fe/packages/common/i18n/en-US.js +90 -0
- package/fe/packages/common/i18n/index.d.ts +43 -0
- package/fe/packages/common/i18n/index.js +173 -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 +71 -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/assets/table/no-result.svg +5 -0
- package/fe/packages/ui/react/components/Button/Button.d.ts +58 -0
- package/fe/packages/ui/react/components/Button/Button.js +72 -0
- package/fe/packages/ui/react/components/Button/SumbitButton.d.ts +13 -0
- package/fe/packages/ui/react/components/Button/SumbitButton.js +25 -0
- package/fe/packages/ui/react/components/Button/index.d.ts +4 -0
- package/fe/packages/ui/react/components/Button/index.js +2 -0
- package/fe/packages/ui/react/components/Checkbox/Checkbox.d.ts +17 -0
- package/fe/packages/ui/react/components/Checkbox/Checkbox.js +39 -0
- package/fe/packages/ui/react/components/Checkbox/index.js +1 -0
- package/fe/packages/ui/react/components/ConfirmDialog/ConfirmDialog.d.ts +20 -0
- 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 +8 -0
- package/fe/packages/ui/react/components/DataTable/ActionBtn.js +94 -0
- package/fe/packages/ui/react/components/DataTable/index.d.ts +50 -0
- package/fe/packages/ui/react/components/DataTable/index.js +155 -0
- package/fe/packages/ui/react/components/Date/Calendar.d.ts +35 -0
- package/fe/packages/ui/react/components/Date/Calendar.js +216 -0
- package/fe/packages/ui/react/components/Date/Date.d.ts +38 -0
- package/fe/packages/ui/react/components/Date/Date.js +201 -0
- package/fe/packages/ui/react/components/Date/DateTestPage.js +29 -0
- package/fe/packages/ui/react/components/Date/LocaleContext.d.ts +6 -0
- package/fe/packages/ui/react/components/Date/LocaleContext.js +8 -0
- package/fe/packages/ui/react/components/Date/LocaleProvider.d.ts +19 -0
- package/fe/packages/ui/react/components/Date/LocaleProvider.js +24 -0
- package/fe/packages/ui/react/components/Date/TimePicker.js +78 -0
- package/fe/packages/ui/react/components/Date/data.js +4 -0
- package/fe/packages/ui/react/components/Date/dateLocaleStore.d.ts +16 -0
- package/fe/packages/ui/react/components/Date/dateLocaleStore.js +14 -0
- 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/index.js +5 -0
- package/fe/packages/ui/react/components/Date/locales.d.ts +43 -0
- package/fe/packages/ui/react/components/Date/locales.js +21 -0
- package/fe/packages/ui/react/components/Drawer/Drawer.d.ts +29 -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 +25 -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 +18 -0
- package/fe/packages/ui/react/components/Form/Form.js +8 -0
- package/fe/packages/ui/react/components/Form/FormItem.d.ts +41 -0
- package/fe/packages/ui/react/components/Form/FormItem.js +43 -0
- package/fe/packages/ui/react/components/Form/SchemaForm/data.d.ts +45 -0
- package/fe/packages/ui/react/components/Form/SchemaForm/data.js +16 -0
- package/fe/packages/ui/react/components/Form/SchemaForm/index.d.ts +153 -0
- package/fe/packages/ui/react/components/Form/SchemaForm/index.js +79 -0
- package/fe/packages/ui/react/components/Form/index.d.ts +5 -0
- package/fe/packages/ui/react/components/Form/index.js +4 -0
- package/fe/packages/ui/react/components/Form/useForm.js +1 -0
- package/fe/packages/ui/react/components/ImagePreview/ImagePreview.js +169 -0
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.d.ts +11 -0
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.js +28 -0
- package/fe/packages/ui/react/components/ImagePreview/index.js +2 -0
- package/fe/packages/ui/react/components/Input/Input.d.ts +45 -0
- package/fe/packages/ui/react/components/Input/Input.js +61 -0
- package/fe/packages/ui/react/components/Input/index.js +1 -0
- package/fe/packages/ui/react/components/InputNumber/InputNumber.d.ts +28 -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 +51 -0
- package/fe/packages/ui/react/components/Label/Label.js +35 -0
- package/fe/packages/ui/react/components/Label/index.js +2 -0
- package/fe/packages/ui/react/components/Menu/Menu.d.ts +18 -0
- package/fe/packages/ui/react/components/Menu/Menu.js +102 -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 +10 -0
- package/fe/packages/ui/react/components/Menu/SubMenu.js +169 -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 +59 -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 +20 -0
- package/fe/packages/ui/react/components/Message/Message.js +58 -0
- package/fe/packages/ui/react/components/Message/MessageManager.js +90 -0
- package/fe/packages/ui/react/components/Message/data.js +1 -0
- package/fe/packages/ui/react/components/Message/index.js +1 -0
- package/fe/packages/ui/react/components/Modal/Modal.d.ts +27 -0
- package/fe/packages/ui/react/components/Modal/Modal.js +14 -0
- package/fe/packages/ui/react/components/Modal/ModalManager.d.ts +59 -0
- package/fe/packages/ui/react/components/Modal/ModalManager.js +90 -0
- package/fe/packages/ui/react/components/Modal/index.js +2 -0
- package/fe/packages/ui/react/components/Overlay/Overlay.d.ts +23 -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/Pagination.d.ts +18 -0
- package/fe/packages/ui/react/components/Pagination/Pagination.js +88 -0
- 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 +81 -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 +17 -0
- package/fe/packages/ui/react/components/Search/Search.js +12 -0
- package/fe/packages/ui/react/components/Search/index.js +1 -0
- package/fe/packages/ui/react/components/Select/Select.d.ts +26 -0
- package/fe/packages/ui/react/components/Select/Select.js +123 -0
- 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/Select/index.js +1 -0
- package/fe/packages/ui/react/components/Skeleton/Skeleton.d.ts +28 -0
- package/fe/packages/ui/react/components/Skeleton/Skeleton.js +31 -0
- package/fe/packages/ui/react/components/Skeleton/index.js +1 -0
- package/fe/packages/ui/react/components/Switch/Switch.js +22 -0
- package/fe/packages/ui/react/components/Switch/index.js +1 -0
- package/fe/packages/ui/react/components/TableSearch/TableSearch.d.ts +68 -0
- package/fe/packages/ui/react/components/TableSearch/TableSearch.js +121 -0
- package/fe/packages/ui/react/components/TableSearch/index.js +1 -0
- package/fe/packages/ui/react/components/TableSearch/lang.js +14 -0
- package/fe/packages/ui/react/components/TableSearch/tableSearchLocaleStore.js +11 -0
- package/fe/packages/ui/react/components/Textarea/Textarea.d.ts +67 -0
- package/fe/packages/ui/react/components/Textarea/Textarea.js +37 -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 +25 -0
- package/fe/packages/ui/react/components/Tooltip/Tooltip.js +79 -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/TreeSelect.d.ts +25 -0
- package/fe/packages/ui/react/components/TreeSelect/TreeSelect.js +160 -0
- 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 +75 -0
- package/fe/packages/ui/react/components/Upload/Upload.d.ts +41 -0
- package/fe/packages/ui/react/components/Upload/Upload.js +6 -0
- package/fe/packages/ui/react/components/Upload/index.js +2 -0
- package/fe/packages/ui/react/components/breadcrumb/breadcrumb.js +81 -0
- 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 +49 -0
- package/fe/packages/ui/react/components/hooks/useDropdownPositioning.js +137 -0
- package/fe/packages/ui/react/components/hooks/useInputController.d.ts +24 -0
- package/fe/packages/ui/react/components/hooks/useInputController.js +45 -0
- package/fe/packages/ui/react/components/index.d.ts +30 -0
- package/fe/packages/ui/react/components/index.js +29 -0
- 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 +104 -0
- package/fe/packages/ui/react/components/testPage/index.js +314 -0
- package/fe/packages/ui/react/hooks/useBreadcrumb.js +2 -0
- package/fe/packages/ui/react/hooks/useExecuteOnce.d.ts +30 -0
- package/fe/packages/ui/react/hooks/useExecuteOnce.js +57 -0
- package/fe/packages/ui/react/hooks/useInit.d.ts +3 -0
- package/fe/packages/ui/react/hooks/useInit.js +9 -0
- package/fe/packages/ui/react/hooks/useLanguage.d.ts +2 -0
- package/fe/packages/ui/react/hooks/useLanguage.js +4 -0
- package/fe/packages/ui/react/hooks/usePagination.js +27 -0
- package/fe/packages/ui/react/hooks/useRefState.d.ts +30 -0
- package/fe/packages/ui/react/hooks/useRefState.js +29 -0
- package/fe/packages/ui/react/hooks/useWatch.d.ts +23 -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 +31 -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 +13 -0
- package/fe/packages/ui/react/i18n/useI18n.js +18 -0
- package/fe/packages/ui/react/index.css +238 -0
- package/fe/packages/ui/react/index.d.ts +5 -0
- package/fe/packages/ui/react/index.js +6 -0
- 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 +66 -0
- package/fe/packages/ui/react/lib/export.js +138 -0
- package/fe/packages/ui/react/lib/utils.d.ts +34 -0
- package/fe/packages/ui/react/lib/utils.js +70 -0
- package/fe/packages/ui/react/stores/breadcrumb.js +66 -0
- package/fe/packages/ui/react/stores/language.d.ts +4 -0
- package/fe/packages/ui/react/stores/language.js +2 -0
- package/fe/packages/ui/react/types/index.js +1 -0
- package/fe/typings/type.d.ts +5 -0
- package/fe/typings/type.js +1 -0
- package/model/index.d.ts +1 -1
- package/model/types/data/button.d.ts +32 -0
- package/model/types/data/component.d.ts +61 -0
- package/model/types/data/fetchInfo.d.ts +20 -0
- package/model/types/data/schema.d.ts +98 -0
- package/model/types/data/search.d.ts +7 -0
- package/model/types/index.d.ts +2 -0
- package/model/types/menuType.d.ts +73 -0
- package/model/types/model.d.ts +33 -0
- package/model/types/test.d.ts +2 -0
- package/package.json +58 -7
- package/types/app/controller/base.d.ts +12 -0
- package/types/app/controller/project.d.ts +10 -0
- package/types/app/controller/view.d.ts +7 -0
- package/types/app/data/signKey.d.ts +1 -0
- package/types/app/extend/db.d.ts +2 -0
- package/types/app/extend/generateErrorMessage.d.ts +7 -0
- package/types/app/extend/logger.d.ts +11 -0
- package/types/app/extend/parsingParamsOnUrl.d.ts +2 -0
- package/types/app/extend/render-view.d.ts +3 -0
- package/types/app/middleware/api-params-verify.d.ts +4 -0
- package/types/app/middleware/api-sign-verify.d.ts +4 -0
- package/types/app/middleware/error-handle.d.ts +4 -0
- package/types/app/middleware/project-handler.d.ts +4 -0
- package/types/app/middleware.d.ts +3 -0
- package/types/app/router/project.d.ts +4 -0
- package/types/app/router/view.d.ts +3 -0
- package/types/app/router-schema/project.d.ts +3 -0
- package/types/app/service/bese.d.ts +10 -0
- package/types/app/service/project.d.ts +52 -0
- package/types/app/type.d.ts +3 -0
- package/types/app/typings.d.ts +41 -0
- package/types/bundler/defaultAlias.d.ts +3 -0
- package/types/bundler/dev.d.ts +1 -0
- package/types/bundler/index.d.ts +1 -0
- package/types/bundler/prod.d.ts +1 -0
- package/types/bundler/utils.d.ts +4 -0
- package/types/config/config.default.d.ts +14 -0
- package/types/index.d.ts +28 -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/env.d.ts +15 -0
- package/types/packages/core/index.d.ts +6 -0
- package/types/packages/core/loader/config.d.ts +3 -0
- package/types/packages/core/loader/controller.d.ts +3 -0
- package/types/packages/core/loader/extend.d.ts +3 -0
- package/types/packages/core/loader/middleware.d.ts +3 -0
- package/types/packages/core/loader/model.d.ts +14 -0
- package/types/packages/core/loader/router-schema.d.ts +3 -0
- package/types/packages/core/loader/router.d.ts +3 -0
- package/types/packages/core/loader/service.d.ts +3 -0
- package/types/packages/core/paths.d.ts +11 -0
- package/types/packages/core/types.d.ts +82 -0
- package/types/packages/utils/getAllFilesInFolder.d.ts +4 -0
- package/types/packages/utils/getAllFnReturnValue.d.ts +0 -0
- package/types/packages/utils/index.d.ts +4 -0
- package/types/packages/utils/loadFile.d.ts +14 -0
- package/types/packages/utils/path.d.ts +6 -0
- package/types/packages/utils/runFileFn.d.ts +7 -0
- package/types/typings/type.d.ts +4 -0
- package/app/controller/base.d.ts +0 -14
- package/app/controller/base.d.ts.map +0 -1
- package/app/controller/base.js +0 -24
- package/app/controller/base.js.map +0 -1
- package/app/controller/project.d.ts +0 -12
- package/app/controller/project.d.ts.map +0 -1
- package/app/controller/project.js +0 -48
- package/app/controller/project.js.map +0 -1
- package/app/controller/view.d.ts +0 -9
- package/app/controller/view.d.ts.map +0 -1
- package/app/controller/view.js +0 -15
- package/app/controller/view.js.map +0 -1
- package/app/data/signKey.d.ts +0 -2
- package/app/data/signKey.d.ts.map +0 -1
- package/app/data/signKey.js +0 -5
- package/app/data/signKey.js.map +0 -1
- package/app/extend/db.d.ts +0 -3
- package/app/extend/db.d.ts.map +0 -1
- package/app/extend/db.js +0 -8
- package/app/extend/db.js.map +0 -1
- package/app/extend/generateErrorMessage.d.ts +0 -8
- package/app/extend/generateErrorMessage.d.ts.map +0 -1
- package/app/extend/generateErrorMessage.js +0 -12
- package/app/extend/generateErrorMessage.js.map +0 -1
- package/app/extend/logger.d.ts +0 -12
- package/app/extend/logger.d.ts.map +0 -1
- package/app/extend/logger.js +0 -73
- package/app/extend/logger.js.map +0 -1
- package/app/extend/parsingParamsOnUrl.d.ts +0 -3
- package/app/extend/parsingParamsOnUrl.d.ts.map +0 -1
- package/app/extend/parsingParamsOnUrl.js +0 -23
- package/app/extend/parsingParamsOnUrl.js.map +0 -1
- package/app/extend/render-view.d.ts +0 -5
- package/app/extend/render-view.d.ts.map +0 -1
- package/app/extend/render-view.js +0 -22
- package/app/extend/render-view.js.map +0 -1
- package/app/middleware/api-params-verify.d.ts +0 -6
- package/app/middleware/api-params-verify.d.ts.map +0 -1
- package/app/middleware/api-params-verify.js +0 -64
- package/app/middleware/api-params-verify.js.map +0 -1
- package/app/middleware/api-sign-verify.d.ts +0 -6
- package/app/middleware/api-sign-verify.d.ts.map +0 -1
- package/app/middleware/api-sign-verify.js +0 -29
- package/app/middleware/api-sign-verify.js.map +0 -1
- package/app/middleware/error-handle.d.ts +0 -6
- package/app/middleware/error-handle.d.ts.map +0 -1
- package/app/middleware/error-handle.js +0 -34
- package/app/middleware/error-handle.js.map +0 -1
- package/app/middleware/project-handler.d.ts +0 -5
- package/app/middleware/project-handler.d.ts.map +0 -1
- package/app/middleware/project-handler.js +0 -22
- package/app/middleware/project-handler.js.map +0 -1
- package/app/middleware.d.ts +0 -6
- package/app/middleware.d.ts.map +0 -1
- package/app/middleware.js +0 -39
- package/app/middleware.js.map +0 -1
- package/app/pages/main.d.ts +0 -3
- package/app/pages/main.d.ts.map +0 -1
- package/app/pages/main.js +0 -10
- package/app/pages/main.js.map +0 -1
- package/app/router/project.d.ts +0 -5
- package/app/router/project.d.ts.map +0 -1
- package/app/router/project.js +0 -9
- package/app/router/project.js.map +0 -1
- package/app/router/view.d.ts +0 -5
- package/app/router/view.d.ts.map +0 -1
- package/app/router/view.js +0 -6
- package/app/router/view.js.map +0 -1
- package/app/router-schema/project.d.ts +0 -4
- package/app/router-schema/project.d.ts.map +0 -1
- package/app/router-schema/project.js +0 -34
- package/app/router-schema/project.js.map +0 -1
- package/app/service/bese.d.ts +0 -11
- package/app/service/bese.d.ts.map +0 -1
- package/app/service/bese.js +0 -18
- package/app/service/bese.js.map +0 -1
- package/app/service/project.d.ts +0 -28
- package/app/service/project.d.ts.map +0 -1
- package/app/service/project.js +0 -39
- package/app/service/project.js.map +0 -1
- package/app/type.d.ts +0 -3
- package/app/type.d.ts.map +0 -1
- package/app/type.js +0 -3
- package/app/type.js.map +0 -1
- package/app/typings.d.ts +0 -50
- package/app/typings.d.ts.map +0 -1
- package/app/typings.js +0 -3
- package/app/typings.js.map +0 -1
- package/app/vite/config/base.d.ts +0 -6
- package/app/vite/config/base.js +0 -53
- package/app/vite/config/base.js.map +0 -1
- package/app/vite/config/data.d.ts +0 -3
- package/app/vite/config/data.js +0 -4
- package/app/vite/config/data.js.map +0 -1
- package/app/vite/config/dev.d.ts +0 -11
- package/app/vite/config/dev.js +0 -12
- package/app/vite/config/dev.js.map +0 -1
- package/app/vite/config/prod.d.ts +0 -17
- package/app/vite/config/prod.js +0 -31
- package/app/vite/config/prod.js.map +0 -1
- package/app/vite/dev.d.ts +0 -2
- package/app/vite/dev.js +0 -22
- package/app/vite/dev.js.map +0 -1
- package/app/vite/index.d.ts +0 -1
- package/app/vite/index.js +0 -9
- package/app/vite/index.js.map +0 -1
- package/app/vite/package.json +0 -11
- package/app/vite/prod.d.ts +0 -1
- package/app/vite/prod.js +0 -75
- package/app/vite/prod.js.map +0 -1
- package/index.d.ts +0 -29
- package/index.d.ts.map +0 -1
- package/index.js +0 -22
- package/index.js.map +0 -1
- package/model/index.d.ts.map +0 -1
- package/model/index.js +0 -7
- package/model/index.js.map +0 -1
- package/model/test.d.ts +0 -6
- package/model/test.d.ts.map +0 -1
- package/model/test.js +0 -6
- package/model/test.js.map +0 -1
- package/model/test2.d.ts +0 -6
- package/model/test2.d.ts.map +0 -1
- package/model/test2.js +0 -6
- package/model/test2.js.map +0 -1
- package/packages/core/env.d.ts +0 -16
- package/packages/core/env.d.ts.map +0 -1
- package/packages/core/env.js +0 -26
- package/packages/core/env.js.map +0 -1
- package/packages/core/index.d.ts +0 -7
- package/packages/core/index.d.ts.map +0 -1
- package/packages/core/index.js +0 -93
- package/packages/core/index.js.map +0 -1
- package/packages/core/loader/config.d.ts +0 -4
- package/packages/core/loader/config.d.ts.map +0 -1
- package/packages/core/loader/config.js +0 -32
- package/packages/core/loader/config.js.map +0 -1
- package/packages/core/loader/controller.d.ts +0 -4
- package/packages/core/loader/controller.d.ts.map +0 -1
- package/packages/core/loader/controller.js +0 -18
- package/packages/core/loader/controller.js.map +0 -1
- package/packages/core/loader/extend.d.ts +0 -4
- package/packages/core/loader/extend.d.ts.map +0 -1
- package/packages/core/loader/extend.js +0 -34
- package/packages/core/loader/extend.js.map +0 -1
- package/packages/core/loader/middleware.d.ts +0 -4
- package/packages/core/loader/middleware.d.ts.map +0 -1
- package/packages/core/loader/middleware.js +0 -16
- package/packages/core/loader/middleware.js.map +0 -1
- package/packages/core/loader/model.d.ts +0 -15
- package/packages/core/loader/model.d.ts.map +0 -1
- package/packages/core/loader/model.js +0 -90
- package/packages/core/loader/model.js.map +0 -1
- package/packages/core/loader/router-schema.d.ts +0 -4
- package/packages/core/loader/router-schema.d.ts.map +0 -1
- package/packages/core/loader/router-schema.js +0 -20
- package/packages/core/loader/router-schema.js.map +0 -1
- package/packages/core/loader/router.d.ts +0 -4
- package/packages/core/loader/router.d.ts.map +0 -1
- package/packages/core/loader/router.js +0 -46
- package/packages/core/loader/router.js.map +0 -1
- package/packages/core/loader/service.d.ts +0 -4
- package/packages/core/loader/service.d.ts.map +0 -1
- package/packages/core/loader/service.js +0 -17
- package/packages/core/loader/service.js.map +0 -1
- package/packages/core/paths.d.ts +0 -12
- package/packages/core/paths.d.ts.map +0 -1
- package/packages/core/paths.js +0 -11
- package/packages/core/paths.js.map +0 -1
- package/packages/core/types.d.ts +0 -74
- package/packages/core/types.d.ts.map +0 -1
- package/packages/core/types.js +0 -3
- package/packages/core/types.js.map +0 -1
- package/packages/ui/react/components/Button/Button.d.ts +0 -15
- package/packages/ui/react/components/Button/Button.d.ts.map +0 -1
- package/packages/ui/react/components/Button/Button.js +0 -36
- package/packages/ui/react/components/Button/Button.js.map +0 -1
- package/packages/ui/react/components/Button/SumbitButton.d.ts +0 -9
- package/packages/ui/react/components/Button/SumbitButton.d.ts.map +0 -1
- package/packages/ui/react/components/Button/SumbitButton.js +0 -32
- package/packages/ui/react/components/Button/SumbitButton.js.map +0 -1
- package/packages/ui/react/components/Button/index.d.ts +0 -4
- package/packages/ui/react/components/Button/index.d.ts.map +0 -1
- package/packages/ui/react/components/Button/index.js +0 -21
- package/packages/ui/react/components/Button/index.js.map +0 -1
- package/packages/ui/react/components/Checkbox/Checkbox.d.ts +0 -17
- package/packages/ui/react/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/packages/ui/react/components/Checkbox/Checkbox.js +0 -41
- package/packages/ui/react/components/Checkbox/Checkbox.js.map +0 -1
- package/packages/ui/react/components/Checkbox/index.d.ts.map +0 -1
- package/packages/ui/react/components/Checkbox/index.js +0 -18
- package/packages/ui/react/components/Checkbox/index.js.map +0 -1
- package/packages/ui/react/components/ConfirmDialog.d.ts +0 -12
- package/packages/ui/react/components/ConfirmDialog.d.ts.map +0 -1
- package/packages/ui/react/components/ConfirmDialog.js +0 -13
- package/packages/ui/react/components/ConfirmDialog.js.map +0 -1
- package/packages/ui/react/components/DataTable/ActionBtn.d.ts +0 -6
- package/packages/ui/react/components/DataTable/ActionBtn.d.ts.map +0 -1
- package/packages/ui/react/components/DataTable/ActionBtn.js +0 -18
- package/packages/ui/react/components/DataTable/ActionBtn.js.map +0 -1
- package/packages/ui/react/components/DataTable/data-table.d.ts +0 -25
- package/packages/ui/react/components/DataTable/data-table.d.ts.map +0 -1
- package/packages/ui/react/components/DataTable/data-table.js +0 -145
- package/packages/ui/react/components/DataTable/data-table.js.map +0 -1
- package/packages/ui/react/components/Date/Calendar.d.ts +0 -22
- package/packages/ui/react/components/Date/Calendar.d.ts.map +0 -1
- package/packages/ui/react/components/Date/Calendar.js +0 -210
- package/packages/ui/react/components/Date/Calendar.js.map +0 -1
- package/packages/ui/react/components/Date/Date.d.ts +0 -26
- package/packages/ui/react/components/Date/Date.d.ts.map +0 -1
- package/packages/ui/react/components/Date/Date.js +0 -161
- package/packages/ui/react/components/Date/Date.js.map +0 -1
- package/packages/ui/react/components/Date/DateTestPage.d.ts.map +0 -1
- package/packages/ui/react/components/Date/DateTestPage.js +0 -33
- package/packages/ui/react/components/Date/DateTestPage.js.map +0 -1
- package/packages/ui/react/components/Date/LocaleContext.d.ts +0 -2
- package/packages/ui/react/components/Date/LocaleContext.d.ts.map +0 -1
- package/packages/ui/react/components/Date/LocaleContext.js +0 -9
- package/packages/ui/react/components/Date/LocaleContext.js.map +0 -1
- package/packages/ui/react/components/Date/LocaleProvider.d.ts +0 -8
- package/packages/ui/react/components/Date/LocaleProvider.d.ts.map +0 -1
- package/packages/ui/react/components/Date/LocaleProvider.js +0 -17
- package/packages/ui/react/components/Date/LocaleProvider.js.map +0 -1
- package/packages/ui/react/components/Date/TimePicker.d.ts.map +0 -1
- package/packages/ui/react/components/Date/TimePicker.js +0 -79
- package/packages/ui/react/components/Date/TimePicker.js.map +0 -1
- package/packages/ui/react/components/Date/data.d.ts.map +0 -1
- package/packages/ui/react/components/Date/data.js +0 -8
- package/packages/ui/react/components/Date/data.js.map +0 -1
- package/packages/ui/react/components/Date/dateLocaleStore.d.ts +0 -10
- package/packages/ui/react/components/Date/dateLocaleStore.d.ts.map +0 -1
- package/packages/ui/react/components/Date/dateLocaleStore.js +0 -18
- package/packages/ui/react/components/Date/dateLocaleStore.js.map +0 -1
- package/packages/ui/react/components/Date/index.d.ts.map +0 -1
- package/packages/ui/react/components/Date/index.js +0 -24
- package/packages/ui/react/components/Date/index.js.map +0 -1
- package/packages/ui/react/components/Date/locales.d.ts +0 -23
- package/packages/ui/react/components/Date/locales.d.ts.map +0 -1
- package/packages/ui/react/components/Date/locales.js +0 -43
- package/packages/ui/react/components/Date/locales.js.map +0 -1
- package/packages/ui/react/components/Dropdown.d.ts +0 -16
- package/packages/ui/react/components/Dropdown.d.ts.map +0 -1
- package/packages/ui/react/components/Dropdown.js +0 -56
- package/packages/ui/react/components/Dropdown.js.map +0 -1
- package/packages/ui/react/components/Form/Form.d.ts +0 -12
- package/packages/ui/react/components/Form/Form.d.ts.map +0 -1
- package/packages/ui/react/components/Form/Form.js +0 -15
- package/packages/ui/react/components/Form/Form.js.map +0 -1
- package/packages/ui/react/components/Form/FormItem.d.ts +0 -20
- package/packages/ui/react/components/Form/FormItem.d.ts.map +0 -1
- package/packages/ui/react/components/Form/FormItem.js +0 -76
- package/packages/ui/react/components/Form/FormItem.js.map +0 -1
- package/packages/ui/react/components/Form/SchemeForm/data.d.ts +0 -51
- package/packages/ui/react/components/Form/SchemeForm/data.d.ts.map +0 -1
- package/packages/ui/react/components/Form/SchemeForm/data.js +0 -48
- package/packages/ui/react/components/Form/SchemeForm/data.js.map +0 -1
- package/packages/ui/react/components/Form/SchemeForm/index.d.ts +0 -59
- package/packages/ui/react/components/Form/SchemeForm/index.d.ts.map +0 -1
- package/packages/ui/react/components/Form/SchemeForm/index.js +0 -70
- package/packages/ui/react/components/Form/SchemeForm/index.js.map +0 -1
- package/packages/ui/react/components/Form/index.d.ts +0 -5
- package/packages/ui/react/components/Form/index.d.ts.map +0 -1
- package/packages/ui/react/components/Form/index.js +0 -21
- package/packages/ui/react/components/Form/index.js.map +0 -1
- package/packages/ui/react/components/Form/useForm.d.ts.map +0 -1
- package/packages/ui/react/components/Form/useForm.js +0 -6
- package/packages/ui/react/components/Form/useForm.js.map +0 -1
- package/packages/ui/react/components/ImagePreview/ImagePreview.d.ts.map +0 -1
- package/packages/ui/react/components/ImagePreview/ImagePreview.js +0 -162
- package/packages/ui/react/components/ImagePreview/ImagePreview.js.map +0 -1
- package/packages/ui/react/components/ImagePreview/PreviewImage.d.ts +0 -8
- package/packages/ui/react/components/ImagePreview/PreviewImage.d.ts.map +0 -1
- package/packages/ui/react/components/ImagePreview/PreviewImage.js +0 -29
- package/packages/ui/react/components/ImagePreview/PreviewImage.js.map +0 -1
- package/packages/ui/react/components/ImagePreview/index.d.ts.map +0 -1
- package/packages/ui/react/components/ImagePreview/index.js +0 -19
- package/packages/ui/react/components/ImagePreview/index.js.map +0 -1
- package/packages/ui/react/components/Input/Input.d.ts +0 -21
- package/packages/ui/react/components/Input/Input.d.ts.map +0 -1
- package/packages/ui/react/components/Input/Input.js +0 -61
- package/packages/ui/react/components/Input/Input.js.map +0 -1
- package/packages/ui/react/components/Input/index.d.ts.map +0 -1
- package/packages/ui/react/components/Input/index.js +0 -18
- package/packages/ui/react/components/Input/index.js.map +0 -1
- package/packages/ui/react/components/Label/Label.d.ts +0 -22
- package/packages/ui/react/components/Label/Label.d.ts.map +0 -1
- package/packages/ui/react/components/Label/Label.js +0 -37
- package/packages/ui/react/components/Label/Label.js.map +0 -1
- package/packages/ui/react/components/Label/index.d.ts.map +0 -1
- package/packages/ui/react/components/Label/index.js +0 -21
- package/packages/ui/react/components/Label/index.js.map +0 -1
- package/packages/ui/react/components/Message/Message.d.ts +0 -13
- package/packages/ui/react/components/Message/Message.d.ts.map +0 -1
- package/packages/ui/react/components/Message/Message.js +0 -56
- package/packages/ui/react/components/Message/Message.js.map +0 -1
- package/packages/ui/react/components/Message/MessageManager.d.ts.map +0 -1
- package/packages/ui/react/components/Message/MessageManager.js +0 -86
- package/packages/ui/react/components/Message/MessageManager.js.map +0 -1
- package/packages/ui/react/components/Message/data.d.ts.map +0 -1
- package/packages/ui/react/components/Message/data.js +0 -5
- package/packages/ui/react/components/Message/data.js.map +0 -1
- package/packages/ui/react/components/Message/index.d.ts.map +0 -1
- package/packages/ui/react/components/Message/index.js +0 -6
- package/packages/ui/react/components/Message/index.js.map +0 -1
- package/packages/ui/react/components/Modal/Modal.d.ts +0 -19
- package/packages/ui/react/components/Modal/Modal.d.ts.map +0 -1
- package/packages/ui/react/components/Modal/Modal.js +0 -51
- package/packages/ui/react/components/Modal/Modal.js.map +0 -1
- package/packages/ui/react/components/Modal/ModalManager.d.ts +0 -47
- package/packages/ui/react/components/Modal/ModalManager.d.ts.map +0 -1
- package/packages/ui/react/components/Modal/ModalManager.js +0 -91
- package/packages/ui/react/components/Modal/ModalManager.js.map +0 -1
- package/packages/ui/react/components/Modal/index.d.ts.map +0 -1
- package/packages/ui/react/components/Modal/index.js +0 -8
- package/packages/ui/react/components/Modal/index.js.map +0 -1
- package/packages/ui/react/components/Pagination.d.ts +0 -11
- package/packages/ui/react/components/Pagination.d.ts.map +0 -1
- package/packages/ui/react/components/Pagination.js +0 -85
- package/packages/ui/react/components/Pagination.js.map +0 -1
- package/packages/ui/react/components/Search/Search.d.ts +0 -14
- package/packages/ui/react/components/Search/Search.d.ts.map +0 -1
- package/packages/ui/react/components/Search/Search.js +0 -15
- package/packages/ui/react/components/Search/Search.js.map +0 -1
- package/packages/ui/react/components/Search/index.d.ts.map +0 -1
- package/packages/ui/react/components/Search/index.js +0 -9
- package/packages/ui/react/components/Search/index.js.map +0 -1
- package/packages/ui/react/components/Select/Select.d.ts +0 -19
- package/packages/ui/react/components/Select/Select.d.ts.map +0 -1
- package/packages/ui/react/components/Select/Select.js +0 -167
- package/packages/ui/react/components/Select/Select.js.map +0 -1
- package/packages/ui/react/components/Select/index.d.ts.map +0 -1
- package/packages/ui/react/components/Select/index.js +0 -18
- package/packages/ui/react/components/Select/index.js.map +0 -1
- package/packages/ui/react/components/Skeleton/Skeleton.d.ts +0 -13
- package/packages/ui/react/components/Skeleton/Skeleton.d.ts.map +0 -1
- package/packages/ui/react/components/Skeleton/Skeleton.js +0 -36
- package/packages/ui/react/components/Skeleton/Skeleton.js.map +0 -1
- package/packages/ui/react/components/Skeleton/index.d.ts.map +0 -1
- package/packages/ui/react/components/Skeleton/index.js +0 -6
- package/packages/ui/react/components/Skeleton/index.js.map +0 -1
- package/packages/ui/react/components/Switch/Switch.d.ts.map +0 -1
- package/packages/ui/react/components/Switch/Switch.js +0 -57
- package/packages/ui/react/components/Switch/Switch.js.map +0 -1
- package/packages/ui/react/components/Switch/index.d.ts.map +0 -1
- package/packages/ui/react/components/Switch/index.js +0 -18
- package/packages/ui/react/components/Switch/index.js.map +0 -1
- package/packages/ui/react/components/TableSearch/TableSearch.d.ts +0 -30
- package/packages/ui/react/components/TableSearch/TableSearch.d.ts.map +0 -1
- package/packages/ui/react/components/TableSearch/TableSearch.js +0 -121
- package/packages/ui/react/components/TableSearch/TableSearch.js.map +0 -1
- package/packages/ui/react/components/TableSearch/index.d.ts.map +0 -1
- package/packages/ui/react/components/TableSearch/index.js +0 -9
- package/packages/ui/react/components/TableSearch/index.js.map +0 -1
- package/packages/ui/react/components/TableSearch/lang.d.ts.map +0 -1
- package/packages/ui/react/components/TableSearch/lang.js +0 -28
- package/packages/ui/react/components/TableSearch/lang.js.map +0 -1
- package/packages/ui/react/components/TableSearch/tableSearchLocaleStore.d.ts.map +0 -1
- package/packages/ui/react/components/TableSearch/tableSearchLocaleStore.js +0 -15
- package/packages/ui/react/components/TableSearch/tableSearchLocaleStore.js.map +0 -1
- package/packages/ui/react/components/Textarea.d.ts +0 -19
- package/packages/ui/react/components/Textarea.d.ts.map +0 -1
- package/packages/ui/react/components/Textarea.js +0 -38
- package/packages/ui/react/components/Textarea.js.map +0 -1
- package/packages/ui/react/components/Tooltip.d.ts +0 -9
- package/packages/ui/react/components/Tooltip.d.ts.map +0 -1
- package/packages/ui/react/components/Tooltip.js +0 -109
- package/packages/ui/react/components/Tooltip.js.map +0 -1
- package/packages/ui/react/components/TreeSelect.d.ts +0 -19
- package/packages/ui/react/components/TreeSelect.d.ts.map +0 -1
- package/packages/ui/react/components/TreeSelect.js +0 -160
- package/packages/ui/react/components/TreeSelect.js.map +0 -1
- package/packages/ui/react/components/Upload/ImageUpload.d.ts.map +0 -1
- package/packages/ui/react/components/Upload/ImageUpload.js +0 -67
- package/packages/ui/react/components/Upload/ImageUpload.js.map +0 -1
- package/packages/ui/react/components/Upload/Upload.d.ts +0 -14
- package/packages/ui/react/components/Upload/Upload.d.ts.map +0 -1
- package/packages/ui/react/components/Upload/Upload.js +0 -9
- package/packages/ui/react/components/Upload/Upload.js.map +0 -1
- package/packages/ui/react/components/Upload/index.d.ts.map +0 -1
- package/packages/ui/react/components/Upload/index.js +0 -19
- package/packages/ui/react/components/Upload/index.js.map +0 -1
- package/packages/ui/react/components/breadcrumb.d.ts.map +0 -1
- package/packages/ui/react/components/breadcrumb.js +0 -80
- package/packages/ui/react/components/breadcrumb.js.map +0 -1
- package/packages/ui/react/components/hooks/useInputController.d.ts +0 -21
- package/packages/ui/react/components/hooks/useInputController.d.ts.map +0 -1
- package/packages/ui/react/components/hooks/useInputController.js +0 -43
- package/packages/ui/react/components/hooks/useInputController.js.map +0 -1
- package/packages/ui/react/components/index.d.ts +0 -24
- package/packages/ui/react/components/index.d.ts.map +0 -1
- package/packages/ui/react/components/index.js +0 -40
- package/packages/ui/react/components/index.js.map +0 -1
- package/packages/ui/react/components/table.d.ts.map +0 -1
- package/packages/ui/react/components/table.js +0 -64
- package/packages/ui/react/components/table.js.map +0 -1
- package/packages/ui/react/components/testPage/index.d.ts.map +0 -1
- package/packages/ui/react/components/testPage/index.js +0 -124
- package/packages/ui/react/components/testPage/index.js.map +0 -1
- package/packages/ui/react/hooks/useBreadcrumb.d.ts.map +0 -1
- package/packages/ui/react/hooks/useBreadcrumb.js +0 -6
- package/packages/ui/react/hooks/useBreadcrumb.js.map +0 -1
- package/packages/ui/react/hooks/useInit.d.ts +0 -3
- package/packages/ui/react/hooks/useInit.d.ts.map +0 -1
- package/packages/ui/react/hooks/useInit.js +0 -12
- package/packages/ui/react/hooks/useInit.js.map +0 -1
- package/packages/ui/react/hooks/useLanguage.d.ts +0 -7
- package/packages/ui/react/hooks/useLanguage.d.ts.map +0 -1
- package/packages/ui/react/hooks/useLanguage.js +0 -8
- package/packages/ui/react/hooks/useLanguage.js.map +0 -1
- package/packages/ui/react/hooks/usePagination.d.ts.map +0 -1
- package/packages/ui/react/hooks/usePagination.js +0 -34
- package/packages/ui/react/hooks/usePagination.js.map +0 -1
- package/packages/ui/react/index.d.ts +0 -3
- package/packages/ui/react/index.d.ts.map +0 -1
- package/packages/ui/react/index.js +0 -19
- package/packages/ui/react/index.js.map +0 -1
- package/packages/ui/react/lib/export.d.ts +0 -22
- package/packages/ui/react/lib/export.d.ts.map +0 -1
- package/packages/ui/react/lib/export.js +0 -136
- package/packages/ui/react/lib/export.js.map +0 -1
- package/packages/ui/react/lib/utils.d.ts +0 -10
- package/packages/ui/react/lib/utils.d.ts.map +0 -1
- package/packages/ui/react/lib/utils.js +0 -53
- package/packages/ui/react/lib/utils.js.map +0 -1
- package/packages/ui/react/locales/index.d.ts +0 -8
- package/packages/ui/react/locales/index.d.ts.map +0 -1
- package/packages/ui/react/locales/index.js +0 -10
- package/packages/ui/react/locales/index.js.map +0 -1
- package/packages/ui/react/stores/breadcrumb.d.ts.map +0 -1
- package/packages/ui/react/stores/breadcrumb.js +0 -68
- package/packages/ui/react/stores/breadcrumb.js.map +0 -1
- package/packages/ui/react/stores/language.d.ts +0 -13
- package/packages/ui/react/stores/language.d.ts.map +0 -1
- package/packages/ui/react/stores/language.js +0 -55
- package/packages/ui/react/stores/language.js.map +0 -1
- package/packages/ui/react/types/index.d.ts.map +0 -1
- package/packages/ui/react/types/index.js +0 -3
- package/packages/ui/react/types/index.js.map +0 -1
- package/packages/utils/getAllFilesInFolder.d.ts +0 -5
- package/packages/utils/getAllFilesInFolder.d.ts.map +0 -1
- package/packages/utils/getAllFilesInFolder.js +0 -46
- package/packages/utils/getAllFilesInFolder.js.map +0 -1
- package/packages/utils/getAllFnReturnValue.d.ts +0 -1
- package/packages/utils/getAllFnReturnValue.d.ts.map +0 -1
- package/packages/utils/getAllFnReturnValue.js +0 -2
- package/packages/utils/getAllFnReturnValue.js.map +0 -1
- package/packages/utils/index.d.ts +0 -5
- package/packages/utils/index.d.ts.map +0 -1
- package/packages/utils/index.js +0 -21
- package/packages/utils/index.js.map +0 -1
- package/packages/utils/loadFile.d.ts +0 -15
- package/packages/utils/loadFile.d.ts.map +0 -1
- package/packages/utils/loadFile.js +0 -57
- package/packages/utils/loadFile.js.map +0 -1
- package/packages/utils/path.d.ts +0 -7
- package/packages/utils/path.d.ts.map +0 -1
- package/packages/utils/path.js +0 -51
- package/packages/utils/path.js.map +0 -1
- package/packages/utils/runFileFn.d.ts +0 -6
- package/packages/utils/runFileFn.d.ts.map +0 -1
- package/packages/utils/runFileFn.js +0 -6
- package/packages/utils/runFileFn.js.map +0 -1
- package/typings/type.d.ts +0 -2
- package/typings/type.d.ts.map +0 -1
- package/typings/type.js +0 -3
- package/typings/type.js.map +0 -1
- /package/{packages → fe/packages}/ui/react/components/Checkbox/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Date/DateTestPage.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Date/TimePicker.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Date/data.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Date/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Form/useForm.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/ImagePreview/ImagePreview.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/ImagePreview/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Input/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Label/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Message/MessageManager.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Message/data.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Message/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Modal/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Search/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Select/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Skeleton/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Switch/Switch.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Switch/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/TableSearch/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/TableSearch/lang.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/TableSearch/tableSearchLocaleStore.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Upload/ImageUpload.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/Upload/index.d.ts +0 -0
- /package/{packages/ui/react/components → fe/packages/ui/react/components/breadcrumb}/breadcrumb.d.ts +0 -0
- /package/{packages/ui/react/components → fe/packages/ui/react/components/table}/table.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/components/testPage/index.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/hooks/useBreadcrumb.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/hooks/usePagination.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/stores/breadcrumb.d.ts +0 -0
- /package/{packages → fe/packages}/ui/react/types/index.d.ts +0 -0
|
@@ -1,59 +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
|
-
name: K | number | (K | number)[];
|
|
13
|
-
label?: ReactNode;
|
|
14
|
-
rules?: Rule[];
|
|
15
|
-
required?: boolean;
|
|
16
|
-
className?: string;
|
|
17
|
-
labelClassName?: string;
|
|
18
|
-
errorClassName?: string;
|
|
19
|
-
showError?: boolean;
|
|
20
|
-
render?: (value: T[K], onChange: (value: T[K]) => void, meta: {
|
|
21
|
-
errors: string[];
|
|
22
|
-
warnings: string[];
|
|
23
|
-
}) => ReactNode;
|
|
24
|
-
layout?: Required<LabelLayout>['layout'];
|
|
25
|
-
affterNode?: ReactNode;
|
|
26
|
-
};
|
|
27
|
-
}[keyof T];
|
|
28
|
-
type GroupField<T> = {
|
|
29
|
-
type: 'group';
|
|
30
|
-
childrens: FormFieldScheme<T>[];
|
|
31
|
-
fieldProps: React.HTMLAttributes<HTMLDivElement>;
|
|
32
|
-
} & BaseField<T>;
|
|
33
|
-
type NotGroupField<T> = FieldProps & BaseField<T>;
|
|
34
|
-
export type FormFieldScheme<T> = GroupField<T> | NotGroupField<T>;
|
|
35
|
-
export interface SchemeFormProps<T = object> extends MOmit<FormProps<T>, 'initialValues' | 'children' | 'preserve'> {
|
|
36
|
-
form?: FormInstance<T>;
|
|
37
|
-
getForm?: (formInstance: FormInstance<T>) => void;
|
|
38
|
-
schemes: FormFieldScheme<T>[];
|
|
39
|
-
className?: string;
|
|
40
|
-
onFinish?: (values: T) => void;
|
|
41
|
-
onFinishFailed?: (errorInfo: any) => void;
|
|
42
|
-
initialValues?: T;
|
|
43
|
-
layout?: Required<LabelLayout>['layout'];
|
|
44
|
-
fieldLayout?: Required<LabelLayout>['layout'];
|
|
45
|
-
footerButtons?: boolean | ReactNode;
|
|
46
|
-
submitText?: ReactNode;
|
|
47
|
-
cancelText?: ReactNode;
|
|
48
|
-
onCancel?: () => void;
|
|
49
|
-
buttonClassName?: string;
|
|
50
|
-
submitButtonProps?: Omit<React.ComponentProps<typeof Button>, 'type' | 'onClick' | 'children'>;
|
|
51
|
-
cancelButtonProps?: Omit<React.ComponentProps<typeof Button>, 'onClick' | 'children'>;
|
|
52
|
-
preserve?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export declare const SchemeForm: {
|
|
55
|
-
<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;
|
|
56
|
-
displayName: string;
|
|
57
|
-
};
|
|
58
|
-
export default SchemeForm;
|
|
59
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ui/react/components/Form/SchemeForm/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC/C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AA;IAKtB,UAAU,CAAC,EAAE,SAAS,CAAA;IAItB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IAIrB,eAAe,CAAC,EAAE,MAAM,CAAA;IAIxB,iBAAiB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,CAAA;IAI9F,iBAAiB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAA;IAOrF,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,UAAU;KAAI,CAAC,SAAS,MAAM,6NAmBxC,eAAe,CAAC,CAAC,CAAC;;CA4GpB,CAAA;AAID,eAAe,UAAU,CAAA"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SchemeForm = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const utils_1 = require("../../../lib/utils");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const __1 = require("..");
|
|
8
|
-
const Button_1 = require("../../Button");
|
|
9
|
-
const Skeleton_1 = require("../../Skeleton");
|
|
10
|
-
const data_1 = require("./data");
|
|
11
|
-
const renderField = (scheme) => {
|
|
12
|
-
return (value, onChange, meta) => {
|
|
13
|
-
if (scheme.render) {
|
|
14
|
-
return scheme.render(value, onChange, meta);
|
|
15
|
-
}
|
|
16
|
-
const { type = 'input' } = scheme;
|
|
17
|
-
const Component = data_1.componentsMap[type];
|
|
18
|
-
const { fieldProps } = scheme;
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { mode: "componentsloading", rows: 2 }), children: [(0, jsx_runtime_1.jsx)(Component, { value: value, onChange: onChange, ...fieldProps }), scheme.affterNode] }));
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
const SchemeForm = ({ form, getForm, schemes, className, onFinish, onFinishFailed, initialValues, footerButtons = true, submitText = '提交', cancelText = '取消', onCancel, buttonClassName, submitButtonProps, layout = 'vertical', fieldLayout = 'vertical', cancelButtonProps, ...formProps }) => {
|
|
23
|
-
const [f] = (0, __1.useForm)();
|
|
24
|
-
(0, react_1.useEffect)(() => {
|
|
25
|
-
getForm?.(f);
|
|
26
|
-
}, []);
|
|
27
|
-
const usedForm = form ?? f;
|
|
28
|
-
const handleCancel = () => {
|
|
29
|
-
if (onCancel) {
|
|
30
|
-
onCancel();
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
usedForm?.resetFields();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const { formClassName, fieldClassName, isHorizontal } = (0, react_1.useMemo)(() => {
|
|
37
|
-
return {
|
|
38
|
-
formClassName: (0, utils_1.cn)(layout === 'horizontal' ? 'flex gap-4 items-start flex-wrap' : ''),
|
|
39
|
-
fieldClassName: (0, utils_1.cn)('min-w-[255px]', layout === 'horizontal' ? '' : 'mb-5'),
|
|
40
|
-
isHorizontal: layout === 'horizontal',
|
|
41
|
-
};
|
|
42
|
-
}, [layout]);
|
|
43
|
-
const renderSchemes = (schemes) => {
|
|
44
|
-
return schemes.map((scheme, index) => {
|
|
45
|
-
const { type = 'input' } = scheme;
|
|
46
|
-
if (type !== 'group') {
|
|
47
|
-
const { name, label, rules, required, className: itemClassName, labelClassName, errorClassName, showError, layout: schemeFieldLayout, } = scheme;
|
|
48
|
-
const fLayout = schemeFieldLayout ?? fieldLayout;
|
|
49
|
-
const fRequired = required ??
|
|
50
|
-
rules?.some((r) => {
|
|
51
|
-
const rData = typeof r === 'function' ? r(usedForm) : r;
|
|
52
|
-
return rData.required;
|
|
53
|
-
});
|
|
54
|
-
const fiKey = (Array.isArray(name) ? `field-${index}-${name.join('_')}` : name);
|
|
55
|
-
return ((0, jsx_runtime_1.jsx)(__1.FormItem, { name: name, label: label, rules: rules, layout: fLayout, required: fRequired, className: (0, utils_1.cn)(fieldClassName, itemClassName), labelClassName: labelClassName, errorClassName: errorClassName, showError: showError, children: renderField(scheme) }, fiKey));
|
|
56
|
-
}
|
|
57
|
-
else if (type === 'group') {
|
|
58
|
-
const s = scheme;
|
|
59
|
-
const fiKey = (Array.isArray(name) ? `field-group-${index}-${name.join('_')}` : name);
|
|
60
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "field-group-container", ...s.fieldProps, children: renderSchemes(s.childrens) }, fiKey));
|
|
61
|
-
}
|
|
62
|
-
return null;
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)(__1.Form, { form: usedForm, onFinish: onFinish, onFinishFailed: onFinishFailed, initialValues: initialValues, className: (0, utils_1.cn)(formClassName, className), ...formProps, children: [renderSchemes(schemes), footerButtons && !isHorizontal ? (typeof footerButtons === 'boolean' ? ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)('flex items-center gap-4', buttonClassName), children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { type: "button", onClick: handleCancel, ...cancelButtonProps, children: cancelText }), (0, jsx_runtime_1.jsx)(Button_1.Button, { type: "submit", variant: "primary", ...submitButtonProps, children: submitText })] })) : (footerButtons)) : undefined] }));
|
|
66
|
-
};
|
|
67
|
-
exports.SchemeForm = SchemeForm;
|
|
68
|
-
exports.SchemeForm.displayName = 'SchemeForm';
|
|
69
|
-
exports.default = exports.SchemeForm;
|
|
70
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/ui/react/components/Form/SchemeForm/index.tsx"],"names":[],"mappings":";;;;AAAA,kDAA2C;AAI3C,iCAAoE;AACpE,0BAA4D;AAC5D,yCAAqC;AAErC,6CAAyC;AACz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cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,IAAA,UAAE,EAAC,aAAa,EAAE,SAAS,CAAC,KACnC,SAAS,aAEZ,aAAa,CAAC,OAAO,CAAC,EACtB,aAAa,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAChC,OAAO,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CACnC,iCAAK,SAAS,EAAE,IAAA,UAAE,EAAC,yBAAyB,EAAE,eAAe,CAAC,aAC5D,uBAAC,eAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,YAAY,KAAM,iBAAiB,YAC/D,UAAU,GACJ,EAET,uBAAC,eAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,KAAK,iBAAiB,YAC1D,UAAU,GACJ,IACL,CACP,CAAC,CAAC,CAAC,CACF,aAAa,CACd,CACF,CAAC,CAAC,CAAC,SAAS,IACR,CACR,CAAA;AACH,CAAC,CAAA;AA/HY,QAAA,UAAU,cA+HtB;AAED,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,kBAAe,kBAAU,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/Form/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Form"), exports);
|
|
18
|
-
__exportStar(require("./FormItem"), exports);
|
|
19
|
-
__exportStar(require("./useForm"), exports);
|
|
20
|
-
__exportStar(require("./SchemeForm"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/Form/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,6CAA0B;AAC1B,4CAAyB;AACzB,+CAA4B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/Form/useForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useForm = void 0;
|
|
4
|
-
var rc_field_form_1 = require("rc-field-form");
|
|
5
|
-
Object.defineProperty(exports, "useForm", { enumerable: true, get: function () { return rc_field_form_1.useForm; } });
|
|
6
|
-
//# sourceMappingURL=useForm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.js","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/Form/useForm.ts"],"names":[],"mappings":";;;AAAA,+CAAuC;AAA9B,wGAAA,OAAO,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImagePreview.d.ts","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/ImagePreview/ImagePreview.tsx"],"names":[],"mappings":"AA2TA,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAgB,EAAE,OAAO,EAAE,EAAE,2BAA2B,kDAI9G"}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImagePreviewController = ImagePreviewController;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const lucide_react_1 = require("lucide-react");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const react_dom_1 = require("react-dom");
|
|
8
|
-
const clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
9
|
-
function PreviewCore({ images, initialIndex, onClose }) {
|
|
10
|
-
const [index, setIndex] = (0, react_1.useState)(initialIndex);
|
|
11
|
-
const [scale, _setScale] = (0, react_1.useState)(1);
|
|
12
|
-
const scaleRef = (0, react_1.useRef)(scale);
|
|
13
|
-
const [rotation, setRotation] = (0, react_1.useState)(0);
|
|
14
|
-
const [flipX, setFlipX] = (0, react_1.useState)(false);
|
|
15
|
-
const [flipY, setFlipY] = (0, react_1.useState)(false);
|
|
16
|
-
const imgRef = (0, react_1.useRef)(null);
|
|
17
|
-
const lastScaleBeforeNatural = (0, react_1.useRef)(null);
|
|
18
|
-
const [position, setPosition] = (0, react_1.useState)({ x: 0, y: 0 });
|
|
19
|
-
const [isDragging, setIsDragging] = (0, react_1.useState)(false);
|
|
20
|
-
const dragStart = (0, react_1.useRef)({ x: 0, y: 0 });
|
|
21
|
-
const positionRef = (0, react_1.useRef)({ x: 0, y: 0 });
|
|
22
|
-
const setScale = (0, react_1.useCallback)((newValue) => {
|
|
23
|
-
let newState = newValue;
|
|
24
|
-
if (typeof newValue === 'function') {
|
|
25
|
-
newState = newValue(scaleRef.current || 1);
|
|
26
|
-
}
|
|
27
|
-
scaleRef.current = newState;
|
|
28
|
-
_setScale(newState);
|
|
29
|
-
}, []);
|
|
30
|
-
const hasImages = images.length > 0;
|
|
31
|
-
const currentIndex = (0, react_1.useMemo)(() => clamp(index, 0, Math.max(images.length - 1, 0)), [index, images.length]);
|
|
32
|
-
const currentImage = hasImages ? images[currentIndex] : '';
|
|
33
|
-
const reset = () => {
|
|
34
|
-
setScale(1);
|
|
35
|
-
setRotation(0);
|
|
36
|
-
setFlipX(false);
|
|
37
|
-
setFlipY(false);
|
|
38
|
-
setPosition({ x: 0, y: 0 });
|
|
39
|
-
positionRef.current = { x: 0, y: 0 };
|
|
40
|
-
lastScaleBeforeNatural.current = null;
|
|
41
|
-
};
|
|
42
|
-
const handleMouseDown = (0, react_1.useCallback)((e) => {
|
|
43
|
-
setIsDragging(true);
|
|
44
|
-
dragStart.current = { x: e.clientX - positionRef.current.x, y: e.clientY - positionRef.current.y };
|
|
45
|
-
}, []);
|
|
46
|
-
const handleMouseMove = (0, react_1.useCallback)((e) => {
|
|
47
|
-
if (!isDragging)
|
|
48
|
-
return;
|
|
49
|
-
const newX = e.clientX - dragStart.current.x;
|
|
50
|
-
const newY = e.clientY - dragStart.current.y;
|
|
51
|
-
positionRef.current = { x: newX, y: newY };
|
|
52
|
-
setPosition({ x: newX, y: newY });
|
|
53
|
-
}, [isDragging]);
|
|
54
|
-
const handleMouseUp = (0, react_1.useCallback)(() => {
|
|
55
|
-
setIsDragging(false);
|
|
56
|
-
}, []);
|
|
57
|
-
const toPrev = () => {
|
|
58
|
-
if (!hasImages)
|
|
59
|
-
return;
|
|
60
|
-
setIndex((prev) => (prev - 1 + images.length) % images.length);
|
|
61
|
-
reset();
|
|
62
|
-
};
|
|
63
|
-
const toNext = () => {
|
|
64
|
-
if (!hasImages)
|
|
65
|
-
return;
|
|
66
|
-
setIndex((prev) => (prev + 1) % images.length);
|
|
67
|
-
reset();
|
|
68
|
-
};
|
|
69
|
-
const zoomIn = () => setScale((prev) => clamp(prev + 0.2, 0.2, 5));
|
|
70
|
-
const zoomOut = () => setScale((prev) => clamp(prev - 0.2, 0.2, 5));
|
|
71
|
-
const rotateLeft = () => setRotation((prev) => prev - 90);
|
|
72
|
-
const rotateRight = () => setRotation((prev) => prev + 90);
|
|
73
|
-
(0, react_1.useEffect)(() => {
|
|
74
|
-
const handleKey = (e) => {
|
|
75
|
-
if (e.key === 'Escape') {
|
|
76
|
-
onClose();
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (e.key === 'ArrowLeft') {
|
|
80
|
-
if (!hasImages)
|
|
81
|
-
return;
|
|
82
|
-
setIndex((prev) => (prev - 1 + images.length) % images.length);
|
|
83
|
-
reset();
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (e.key === 'ArrowRight') {
|
|
87
|
-
if (!hasImages)
|
|
88
|
-
return;
|
|
89
|
-
setIndex((prev) => (prev + 1) % images.length);
|
|
90
|
-
reset();
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
document.addEventListener('keydown', handleKey);
|
|
94
|
-
return () => document.removeEventListener('keydown', handleKey);
|
|
95
|
-
}, [onClose, hasImages, images.length]);
|
|
96
|
-
(0, react_1.useEffect)(() => {
|
|
97
|
-
if (!imgRef.current)
|
|
98
|
-
return;
|
|
99
|
-
const transform = `translate(calc(-50% + ${position.x}px), calc(-50% + ${position.y}px)) rotate(${rotation}deg) scale(${flipX ? -scale : scale}, ${flipY ? -scale : scale})`;
|
|
100
|
-
imgRef.current.style.transform = transform;
|
|
101
|
-
}, [rotation, scale, flipX, flipY, position]);
|
|
102
|
-
if (!hasImages)
|
|
103
|
-
return null;
|
|
104
|
-
const content = ((0, jsx_runtime_1.jsxs)("div", { className: "fixed inset-0 z-[1100] bg-black/40 text-white", onClick: onClose, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClose, className: "absolute right-6 top-6 p-2 rounded-full bg-black/70 hover:bg-black/80 transition-colors z-10", "aria-label": "\u5173\u95ED\u9884\u89C8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { size: 20 }) }), images.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
105
|
-
e.stopPropagation();
|
|
106
|
-
toPrev();
|
|
107
|
-
}, className: "absolute left-4 top-1/2 -translate-y-1/2 p-3 rounded-full bg-black/70 hover:bg-black/80 transition-colors z-10", "aria-label": "\u4E0A\u4E00\u5F20", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowLeft, { size: 20 }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
108
|
-
e.stopPropagation();
|
|
109
|
-
toNext();
|
|
110
|
-
}, className: "absolute right-4 top-1/2 -translate-y-1/2 p-3 rounded-full bg-black/70 hover:bg-black/80 transition-colors z-10", "aria-label": "\u4E0B\u4E00\u5F20", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowRight, { size: 20 }) })] })), (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 flex items-center justify-center overflow-hidden", onClick: (e) => e.stopPropagation(), onWheel: (e) => {
|
|
111
|
-
e.preventDefault();
|
|
112
|
-
if (e.deltaY < 0) {
|
|
113
|
-
zoomIn();
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
zoomOut();
|
|
117
|
-
}
|
|
118
|
-
}, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, style: { cursor: isDragging ? 'grabbing' : scale > 1 ? 'grab' : 'default' }, children: (0, jsx_runtime_1.jsx)("div", { className: "relative max-h-[85vh] max-w-[90vw]", children: (0, jsx_runtime_1.jsx)("img", { ref: imgRef, src: currentImage, alt: "", draggable: false, className: " select-none max-h-[85vh] max-w-[90vw] absolute left-1/2 top-1/2 origin-center" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 flex items-center gap-2 bg-black/70 backdrop-blur px-3 py-2 rounded-lg", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
119
|
-
e.stopPropagation();
|
|
120
|
-
zoomOut();
|
|
121
|
-
}, className: "flex items-center gap-1 px-3 py-2 rounded-md hover:bg-white/15 text-sm", "aria-label": "\u7F29\u5C0F", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ZoomOut, { size: 16 }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
122
|
-
e.stopPropagation();
|
|
123
|
-
zoomIn();
|
|
124
|
-
}, className: "flex items-center gap-1 px-3 py-2 rounded-md hover:bg-white/15 text-sm", "aria-label": "\u653E\u5927", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ZoomIn, { size: 16 }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
125
|
-
e.stopPropagation();
|
|
126
|
-
if (!imgRef.current)
|
|
127
|
-
return;
|
|
128
|
-
const { naturalWidth, naturalHeight, clientWidth, clientHeight } = imgRef.current;
|
|
129
|
-
if (lastScaleBeforeNatural.current === null) {
|
|
130
|
-
const scaleToNatural = Math.max(naturalWidth / Math.max(clientWidth, 1), naturalHeight / Math.max(clientHeight, 1), 1);
|
|
131
|
-
lastScaleBeforeNatural.current = scaleRef.current;
|
|
132
|
-
setScale(scaleToNatural);
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
setScale(lastScaleBeforeNatural.current);
|
|
136
|
-
lastScaleBeforeNatural.current = null;
|
|
137
|
-
}
|
|
138
|
-
}, className: "flex items-center gap-2 px-3 py-2 rounded-md hover:bg-white/15 text-sm", "aria-label": "1:1", children: "1:1" }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
139
|
-
e.stopPropagation();
|
|
140
|
-
reset();
|
|
141
|
-
}, className: "flex items-center gap-2 px-3 py-2 rounded-md hover:bg-white/15 text-sm", "aria-label": "\u91CD\u7F6E", children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { size: 16 }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
142
|
-
e.stopPropagation();
|
|
143
|
-
rotateLeft();
|
|
144
|
-
}, className: "flex items-center gap-2 px-3 py-2 rounded-md hover:bg-white/15 text-sm", "aria-label": "\u5DE6\u65CB\u8F6C", children: (0, jsx_runtime_1.jsx)(lucide_react_1.RotateCcw, { size: 16 }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
145
|
-
e.stopPropagation();
|
|
146
|
-
rotateRight();
|
|
147
|
-
}, className: "flex items-center gap-2 px-3 py-2 rounded-md hover:bg-white/15 text-sm", "aria-label": "\u53F3\u65CB\u8F6C", children: (0, jsx_runtime_1.jsx)(lucide_react_1.RotateCw, { size: 16 }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
148
|
-
e.stopPropagation();
|
|
149
|
-
setFlipX((prev) => !prev);
|
|
150
|
-
}, className: "flex items-center gap-2 px-3 py-2 rounded-md hover:bg-white/15 text-sm", "aria-label": "\u5DE6\u53F3\u955C\u50CF", children: (0, jsx_runtime_1.jsx)(lucide_react_1.FlipHorizontal, { size: 16 }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => {
|
|
151
|
-
e.stopPropagation();
|
|
152
|
-
setFlipY((prev) => !prev);
|
|
153
|
-
}, className: "flex items-center gap-2 px-3 py-2 rounded-md hover:bg-white/15 text-sm", "aria-label": "\u4E0A\u4E0B\u955C\u50CF", children: (0, jsx_runtime_1.jsx)(lucide_react_1.FlipVertical, { size: 16 }) })] })] }));
|
|
154
|
-
return (0, react_dom_1.createPortal)(content, document.body);
|
|
155
|
-
}
|
|
156
|
-
function ImagePreviewController({ open, images, initialIndex = 0, onClose }) {
|
|
157
|
-
if (!open || images.length === 0)
|
|
158
|
-
return null;
|
|
159
|
-
const key = `${images.join('|')}-${initialIndex}`;
|
|
160
|
-
return (0, jsx_runtime_1.jsx)(PreviewCore, { images: images, initialIndex: initialIndex, onClose: onClose }, key);
|
|
161
|
-
}
|
|
162
|
-
//# sourceMappingURL=ImagePreview.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImagePreview.js","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/ImagePreview/ImagePreview.tsx"],"names":[],"mappings":";;AAkUA,wDAIC;;AAtUD,+CAWqB;AACrB,iCAAyE;AACzE,yCAAwC;AAExC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;AAQ9F,SAAS,WAAW,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAoB;IACtE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,YAAY,CAAC,CAAA;IAChD,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAA;IACtC,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAA;IAC9B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAA;IAC3C,MAAM,CAAC,KAAK,EAA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7C,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,YAAY,EAAE,CAAA;IACjD,OAAO,uBAAC,WAAW,IAAW,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,IAAjE,GAAG,CAAkE,CAAA;AAChG,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MOmit } from '../../types';
|
|
2
|
-
import { type ImagePreviewControllerProps } from './ImagePreview';
|
|
3
|
-
export type PreviewImageProps = MOmit<ImagePreviewControllerProps, 'open' | 'onClose'> & Pick<Partial<ImagePreviewControllerProps>, 'onClose'> & {
|
|
4
|
-
thumbSize?: number | string;
|
|
5
|
-
direction?: 'horizontal' | 'vertical';
|
|
6
|
-
};
|
|
7
|
-
export declare function PreviewImage(props: PreviewImageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
//# sourceMappingURL=PreviewImage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewImage.d.ts","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/ImagePreview/PreviewImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE/C,OAAO,EAA0B,KAAK,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AACzF,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,2BAA2B,EAAE,MAAM,GAAG,SAAS,CAAC,GACpF,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,EAAE,SAAS,CAAC,GAAG;IAItD,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CACtC,CAAA;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,kDAgDpD"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PreviewImage = PreviewImage;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const ImagePreview_1 = require("./ImagePreview");
|
|
7
|
-
function PreviewImage(props) {
|
|
8
|
-
const { onClose, images, thumbSize = 80, direction = 'horizontal', ...ext } = props;
|
|
9
|
-
const [open, setOpen] = (0, react_1.useState)(false);
|
|
10
|
-
const [currentIndex, setCurrentIndex] = (0, react_1.useState)(ext.initialIndex ?? 0);
|
|
11
|
-
const sizeClass = (0, react_1.useMemo)(() => {
|
|
12
|
-
const value = typeof thumbSize === 'number' ? `${thumbSize}px` : thumbSize;
|
|
13
|
-
return `w-[${value}] h-[${value}]`;
|
|
14
|
-
}, [thumbSize]);
|
|
15
|
-
const sizeStyle = (0, react_1.useMemo)(() => {
|
|
16
|
-
const value = typeof thumbSize === 'number' ? `${thumbSize}px` : thumbSize;
|
|
17
|
-
return { width: value, height: value };
|
|
18
|
-
}, [thumbSize]);
|
|
19
|
-
if (!images?.length)
|
|
20
|
-
return null;
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `flex gap-2 ${direction === 'vertical' ? 'flex-col' : ''}`, children: images.map((src, idx) => ((0, jsx_runtime_1.jsx)("button", { type: "button", className: `relative aspect-square overflow-hidden rounded border border-border ${sizeClass}`, style: sizeStyle, onClick: () => {
|
|
22
|
-
setCurrentIndex(idx);
|
|
23
|
-
setOpen(true);
|
|
24
|
-
}, "aria-label": `预览第${idx + 1}张`, children: (0, jsx_runtime_1.jsx)("img", { src: src, alt: "", className: "h-full w-full object-cover" }) }, src + idx))) }), (0, jsx_runtime_1.jsx)(ImagePreview_1.ImagePreviewController, { ...ext, images: images, initialIndex: currentIndex, open: open, onClose: () => {
|
|
25
|
-
setOpen(false);
|
|
26
|
-
onClose?.();
|
|
27
|
-
} })] }));
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=PreviewImage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewImage.js","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/ImagePreview/PreviewImage.tsx"],"names":[],"mappings":";;AAYA,oCAgDC;;AA3DD,iCAAyC;AACzC,iDAAyF;AAUzF,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,GAAG,YAAY,EAAE,GAAG,GAAG,EAAE,GAAG,KAAK,CAAA;IACnF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAA;IACvC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,CAAC,YAAY,IAAI,CAAC,CAAC,CAAA;IACvE,MAAM,SAAS,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC7B,MAAM,KAAK,GAAG,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;QAC1E,OAAO,MAAM,KAAK,QAAQ,KAAK,GAAG,CAAA;IACpC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IAEf,MAAM,SAAS,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC7B,MAAM,KAAK,GAAG,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;QAC1E,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;IACxC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IAEf,IAAI,CAAC,MAAM,EAAE,MAAM;QAAE,OAAO,IAAI,CAAA;IAEhC,OAAO,CACL,6DACE,gCAAK,SAAS,EAAE,cAAc,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,YACvE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CACxB,mCAEE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,uEAAuE,SAAS,EAAE,EAC7F,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,GAAG,EAAE;wBACZ,eAAe,CAAC,GAAG,CAAC,CAAA;wBACpB,OAAO,CAAC,IAAI,CAAC,CAAA;oBACf,CAAC,gBACW,MAAM,GAAG,GAAG,CAAC,GAAG,YAE5B,gCAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAC,EAAE,EAAC,SAAS,EAAC,4BAA4B,GAAG,IAV1D,GAAG,GAAG,GAAG,CAWP,CACV,CAAC,GACE,EAEN,uBAAC,qCAAsB,OACjB,GAAG,EACP,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EAAE;oBACZ,OAAO,CAAC,KAAK,CAAC,CAAA;oBACd,OAAO,EAAE,EAAE,CAAA;gBACb,CAAC,GACD,IACD,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/ImagePreview/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ImagePreview"), exports);
|
|
18
|
-
__exportStar(require("./PreviewImage"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/ImagePreview/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,iDAA8B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ChangeEvent, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'defaultValue'> & {
|
|
3
|
-
value?: string;
|
|
4
|
-
onChange?: (v: string, e: ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
-
defaultValue?: string;
|
|
6
|
-
allowClear?: boolean | {
|
|
7
|
-
clearIcon: ReactNode;
|
|
8
|
-
};
|
|
9
|
-
addonAfter?: ReactNode;
|
|
10
|
-
};
|
|
11
|
-
declare const Input: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "value"> & {
|
|
12
|
-
value?: string;
|
|
13
|
-
onChange?: (v: string, e: ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
-
defaultValue?: string;
|
|
15
|
-
allowClear?: boolean | {
|
|
16
|
-
clearIcon: ReactNode;
|
|
17
|
-
};
|
|
18
|
-
addonAfter?: ReactNode;
|
|
19
|
-
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
20
|
-
export { Input };
|
|
21
|
-
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAIpF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,cAAc,CAAC,GAAG;IAC5G,KAAK,CAAC,EAAE,MAAM,CAAA;IAMd,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IAKhE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,GAAG;QAAE,SAAS,EAAE,SAAS,CAAA;KAAE,CAAA;IAE/C,UAAU,CAAC,EAAE,SAAS,CAAA;CACvB,CAAA;AAED,QAAA,MAAM,KAAK;YAjBD,MAAM;eAMH,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI;mBAKjD,MAAM;iBACR,OAAO,GAAG;QAAE,SAAS,EAAE,SAAS,CAAA;KAAE;iBAElC,SAAS;oDAkIvB,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Input = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const utils_1 = require("../../lib/utils");
|
|
6
|
-
const lucide_react_1 = require("lucide-react");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const useInputController_1 = require("../hooks/useInputController");
|
|
9
|
-
const Input = (0, react_1.forwardRef)(({ className, type, value: controlledValue, onChange, defaultValue, allowClear, disabled, addonAfter, ...props }, ref) => {
|
|
10
|
-
const { setInternalValue, setIsFocused, setRefs, controllerRef, isControlledRef, isFocused, value, hasValue, } = (0, useInputController_1.useInputController)({
|
|
11
|
-
defaultValue,
|
|
12
|
-
controlledValue,
|
|
13
|
-
ref,
|
|
14
|
-
});
|
|
15
|
-
const handleChange = (0, react_1.useCallback)((e) => {
|
|
16
|
-
const newValue = e.target.value;
|
|
17
|
-
if (!isControlledRef.current) {
|
|
18
|
-
setInternalValue(newValue);
|
|
19
|
-
}
|
|
20
|
-
onChange?.(newValue, e);
|
|
21
|
-
}, [isControlledRef, onChange, setInternalValue]);
|
|
22
|
-
const handleClear = (0, react_1.useCallback)((e) => {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
e.stopPropagation();
|
|
25
|
-
if (!isControlledRef.current) {
|
|
26
|
-
setInternalValue('');
|
|
27
|
-
}
|
|
28
|
-
const syntheticEvent = {
|
|
29
|
-
target: { value: '' },
|
|
30
|
-
currentTarget: { value: '' },
|
|
31
|
-
};
|
|
32
|
-
onChange?.('', syntheticEvent);
|
|
33
|
-
controllerRef.current?.focus();
|
|
34
|
-
}, [controllerRef, isControlledRef, onChange, setInternalValue]);
|
|
35
|
-
const clearIcon = (0, react_1.useMemo)(() => {
|
|
36
|
-
if (allowClear) {
|
|
37
|
-
if (typeof allowClear === 'boolean') {
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)('w-5 h-5 rounded-full', 'bg-muted hover:bg-muted/80', 'text-foreground', 'transition-colors', 'flex items-center justify-center', 'focus:outline-none'), children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { size: 12 }) }));
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
return allowClear.clearIcon;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return undefined;
|
|
45
|
-
}, [allowClear]);
|
|
46
|
-
const showClearIcon = hasValue && clearIcon && !disabled;
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative w-full", children: [(0, jsx_runtime_1.jsx)("input", { type: type, ref: setRefs, value: value, onChange: handleChange, className: (0, utils_1.cn)('flex w-full rounded-lg px-4 py-3 text-sm', 'border transition-colors duration-200', 'placeholder:text-muted-foreground', 'focus:outline-none', showClearIcon && 'pr-10', addonAfter && 'pr-12', disabled ? 'cursor-not-allowed bg-muted border-border text-muted-foreground' : 'bg-background', !disabled && !hasValue && !isFocused && 'border-border', !disabled && (hasValue || isFocused) && 'border-theme', className), onFocus: (e) => {
|
|
48
|
-
if (!disabled) {
|
|
49
|
-
setIsFocused(true);
|
|
50
|
-
props.onFocus?.(e);
|
|
51
|
-
}
|
|
52
|
-
}, onBlur: (e) => {
|
|
53
|
-
if (!disabled) {
|
|
54
|
-
setIsFocused(false);
|
|
55
|
-
props.onBlur?.(e);
|
|
56
|
-
}
|
|
57
|
-
}, disabled: disabled, ...props }), showClearIcon && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: handleClear, className: (0, utils_1.cn)('absolute right-3 top-1/2 -translate-y-1/2'), children: clearIcon })), addonAfter && (0, jsx_runtime_1.jsx)("div", { className: "absolute right-2 top-1/2 -translate-y-1/2", children: addonAfter })] }));
|
|
58
|
-
});
|
|
59
|
-
exports.Input = Input;
|
|
60
|
-
Input.displayName = 'Input';
|
|
61
|
-
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/Input/Input.tsx"],"names":[],"mappings":";;;;AAAA,kDAA2C;AAC3C,+CAAgC;AAEhC,iCAAwD;AACxD,oEAAgE;AAoBhE,MAAM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d,YAAY,CAAC,IAAI,CAAC,CAAA;wBAClB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;oBACpB,CAAC;gBACH,CAAC,EACD,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;oBACZ,IAAI,CAAC,QAAQ,EAAE,CAAC;wBACd,YAAY,CAAC,KAAK,CAAC,CAAA;wBACnB,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAA;oBACnB,CAAC;gBACH,CAAC,EACD,QAAQ,EAAE,QAAQ,KACd,KAAK,GACT,EACD,aAAa,IAAI,CAChB,mCAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAA,UAAE,EAAC,2CAA2C,CAAC,YACnG,SAAS,GACH,CACV,EACA,UAAU,IAAI,gCAAK,SAAS,EAAC,2CAA2C,YAAE,UAAU,GAAO,IACxF,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,sBAAK;AAFd,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/Input/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Input"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/ui/react/components/Input/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
type VerticalLayout = {
|
|
3
|
-
layout?: 'vertical';
|
|
4
|
-
};
|
|
5
|
-
type HorizontalLayout = {
|
|
6
|
-
layout?: 'horizontal';
|
|
7
|
-
labelWidth?: string | number;
|
|
8
|
-
labelAlign?: 'left' | 'right' | 'center';
|
|
9
|
-
};
|
|
10
|
-
export type LabelLayout = HorizontalLayout | VerticalLayout;
|
|
11
|
-
export type LabelProps = {
|
|
12
|
-
label: ReactNode;
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
required?: boolean;
|
|
15
|
-
htmlFor?: string;
|
|
16
|
-
className?: string;
|
|
17
|
-
labelClassName?: string;
|
|
18
|
-
contentClassName?: string;
|
|
19
|
-
} & LabelLayout;
|
|
20
|
-
declare const Label: import("react").ForwardRefExoticComponent<LabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
-
export { Label };
|
|
22
|
-
//# sourceMappingURL=Label.d.ts.map
|