@_tc/template-core 0.0.1-bate.46 → 0.0.1-bate.48
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/.skills/tc-component-usage-skills/SKILL.md +132 -0
- package/.skills/tc-component-usage-skills/reference/component-api.md +801 -0
- package/.skills/tc-component-usage-skills/reference/examples.md +435 -0
- package/.skills/tc-component-usage-skills/reference/patterns.md +392 -0
- package/.skills/tc-component-usage-skills/reference/template-core-frontend.md +104 -0
- package/.skills/tc-generator/SKILL.md +70 -0
- package/.skills/tc-generator/reference/example.md +357 -0
- package/.skills/tc-generator/reference/model-schema.md +328 -0
- package/.skills/tc-generator/reference/project-template/app/controller/product.js +73 -0
- package/.skills/tc-generator/reference/project-template/app/router/product.js +9 -0
- package/.skills/tc-generator/reference/project-template/config/config.default.js +7 -0
- package/.skills/tc-generator/reference/project-template/index.js +17 -0
- package/.skills/tc-generator/reference/project-template/model/product/mode.js +179 -0
- package/.skills/tc-generator/reference/project-template/model/product/project/default.js +5 -0
- package/.skills/tc-generator/reference/project-template/package.json +25 -0
- package/.skills/tc-generator/reference/runtime-extensions.md +190 -0
- package/README.md +1723 -0
- package/cjs/_virtual/_rolldown/runtime.js +1 -37
- package/cjs/app/controller/base.js +1 -29
- package/cjs/app/controller/project.js +1 -60
- package/cjs/app/controller/view.js +1 -24
- package/cjs/app/extend/$fetch.js +1 -0
- package/cjs/app/extend/db.js +20 -8
- package/cjs/app/extend/generateErrorMessage.js +1 -16
- package/cjs/app/extend/logger.js +1 -35
- package/cjs/app/extend/parsingParamsOnUrl.js +1 -22
- package/cjs/app/extend/render-view.js +1 -24
- package/cjs/app/middleware/api-params-verify.js +1 -72
- package/cjs/app/middleware/api-sign-verify.js +1 -23
- package/cjs/app/middleware/error-handle.js +1 -38
- package/cjs/app/middleware/project-handler.js +1 -21
- package/cjs/app/middleware.js +1 -32
- package/cjs/app/router/project.js +1 -10
- package/cjs/app/router/view.js +1 -9
- package/cjs/app/router-schema/project.js +1 -16
- package/cjs/app/service/base.js +1 -17
- package/cjs/app/service/project.js +1 -38
- package/cjs/app/type.js +0 -1
- package/cjs/app/typings.js +0 -1
- package/cjs/app/view/entry.tpl +27 -28
- package/cjs/bundler/buildBE.js +1 -0
- package/cjs/bundler/defaultAlias.js +1 -5
- package/cjs/bundler/dev.js +1 -20
- package/cjs/bundler/index.js +1 -19
- package/cjs/bundler/prod.js +1 -21
- package/cjs/bundler/state.js +1 -0
- package/cjs/bundler/utils.js +1 -262
- package/cjs/config/config.default.js +1 -0
- package/cjs/index.js +1 -23
- package/cjs/packages/common/LRUCache.js +1 -4
- package/cjs/packages/common/array/index.js +1 -43
- package/cjs/packages/common/cache/LRUCache.js +1 -45
- package/cjs/packages/common/cache/index.js +1 -4
- package/cjs/packages/common/guards/index.js +1 -34
- package/cjs/packages/common/http/index.js +1 -0
- package/cjs/packages/common/i18n/default.js +1 -95
- package/cjs/packages/common/i18n/en-US.js +1 -95
- package/cjs/packages/common/i18n/index.js +1 -178
- package/cjs/packages/common/i18n/locales.js +1 -17
- package/cjs/packages/common/i18n/types.js +0 -1
- package/cjs/packages/common/index.js +1 -65
- package/cjs/packages/common/log/index.js +2 -160
- package/cjs/packages/common/number/index.js +1 -14
- package/cjs/packages/common/object/filterEmpty.js +1 -32
- package/cjs/packages/common/object/filtereEmpty.js +1 -5
- package/cjs/packages/common/object/index.js +1 -26
- package/cjs/packages/common/string/index.js +1 -17
- package/cjs/packages/common/types/index.js +0 -1
- package/cjs/packages/core/env.js +1 -27
- package/cjs/packages/core/index.js +1 -110
- package/cjs/packages/core/loader/config.js +1 -43
- package/cjs/packages/core/loader/controller.js +1 -33
- package/cjs/packages/core/loader/extend.js +1 -31
- package/cjs/packages/core/loader/middleware.js +1 -30
- package/cjs/packages/core/loader/model.js +1 -111
- package/cjs/packages/core/loader/router-schema.js +1 -36
- package/cjs/packages/core/loader/router.js +1 -62
- package/cjs/packages/core/loader/service.js +1 -30
- package/cjs/packages/core/paths.js +1 -12
- package/cjs/packages/core/types.js +0 -1
- package/cjs/packages/utils/getAllFilesInFolder.js +1 -14
- package/cjs/packages/utils/getAllFnReturnValue.js +0 -1
- package/cjs/packages/utils/index.js +1 -11
- package/cjs/packages/utils/loadFile.js +1 -55
- package/cjs/packages/utils/path.js +1 -31
- package/cjs/packages/utils/runFileFn.js +1 -51
- package/cjs/scripts/vite-build/build.js +3 -0
- package/cjs/scripts/vite-build/collect.js +1 -0
- package/cjs/scripts/vite-build/constants.js +1 -0
- package/cjs/scripts/vite-build/dts.js +1 -0
- package/cjs/scripts/vite-build/index.js +1 -0
- package/cjs/scripts/vite-build/normalize.js +1 -0
- package/cjs/scripts/vite-build/plugins.js +1 -0
- package/cjs/scripts/vite-build/resolve.js +1 -0
- package/cjs/scripts/vite-build/types.js +0 -0
- package/cjs/scripts/vite-build/utils.js +1 -0
- package/esm/_virtual/_rolldown/runtime.js +4 -29
- package/esm/app/controller/base.js +14 -16
- package/esm/app/controller/project.js +39 -46
- package/esm/app/controller/view.js +23 -19
- package/esm/app/extend/$fetch.js +15 -0
- package/esm/app/extend/db.js +138 -4
- package/esm/app/extend/generateErrorMessage.js +4 -12
- package/esm/app/extend/logger.js +9 -17
- package/esm/app/extend/parsingParamsOnUrl.js +11 -18
- package/esm/app/extend/render-view.js +18 -16
- package/esm/app/middleware/api-params-verify.js +36 -50
- package/esm/app/middleware/api-sign-verify.js +10 -16
- package/esm/app/middleware/error-handle.js +17 -30
- package/esm/app/middleware/project-handler.js +11 -16
- package/esm/app/middleware.js +12 -19
- package/esm/app/router/project.js +4 -6
- package/esm/app/router/view.js +4 -5
- package/esm/app/router-schema/project.js +2 -2
- package/esm/app/service/base.js +6 -7
- package/esm/app/service/project.js +18 -32
- package/esm/app/view/entry.tpl +27 -28
- package/esm/bundler/buildBE.js +54 -0
- package/esm/bundler/defaultAlias.js +2 -2
- package/esm/bundler/dev.js +8 -14
- package/esm/bundler/index.js +11 -9
- package/esm/bundler/prod.js +9 -14
- package/esm/bundler/state.js +10 -0
- package/esm/bundler/utils.js +115 -164
- package/esm/config/config.default.js +9 -0
- package/esm/index.js +12 -15
- package/esm/packages/common/LRUCache.js +2 -2
- package/esm/packages/common/array/index.js +21 -31
- package/esm/packages/common/cache/LRUCache.js +21 -25
- package/esm/packages/common/cache/index.js +2 -2
- package/esm/packages/common/guards/index.js +5 -23
- package/esm/packages/common/http/index.js +256 -0
- package/esm/packages/common/i18n/default.js +2 -7
- package/esm/packages/common/i18n/en-US.js +2 -7
- package/esm/packages/common/i18n/index.js +73 -144
- package/esm/packages/common/i18n/locales.js +6 -8
- package/esm/packages/common/index.js +14 -13
- package/esm/packages/common/log/index.js +69 -122
- package/esm/packages/common/number/index.js +7 -8
- package/esm/packages/common/object/filterEmpty.js +16 -22
- package/esm/packages/common/object/filtereEmpty.js +2 -2
- package/esm/packages/common/object/index.js +14 -17
- package/esm/packages/common/string/index.js +2 -11
- package/esm/packages/core/env.js +22 -24
- package/esm/packages/core/index.js +36 -92
- package/esm/packages/core/loader/config.js +21 -35
- package/esm/packages/core/loader/controller.js +8 -27
- package/esm/packages/core/loader/extend.js +19 -21
- package/esm/packages/core/loader/middleware.js +9 -22
- package/esm/packages/core/loader/model.js +50 -91
- package/esm/packages/core/loader/router-schema.js +13 -29
- package/esm/packages/core/loader/router.js +27 -51
- package/esm/packages/core/loader/service.js +8 -24
- package/esm/packages/core/paths.js +5 -5
- package/esm/packages/utils/getAllFilesInFolder.js +6 -8
- package/esm/packages/utils/index.js +5 -5
- package/esm/packages/utils/loadFile.js +28 -43
- package/esm/packages/utils/path.js +10 -22
- package/esm/packages/utils/runFileFn.js +32 -37
- package/esm/scripts/vite-build/build.js +141 -0
- package/esm/scripts/vite-build/collect.js +79 -0
- package/esm/scripts/vite-build/constants.js +34 -0
- package/esm/scripts/vite-build/dts.js +132 -0
- package/esm/scripts/vite-build/index.js +3 -0
- package/esm/scripts/vite-build/normalize.js +78 -0
- package/esm/scripts/vite-build/plugins.js +106 -0
- package/esm/scripts/vite-build/resolve.js +46 -0
- package/esm/scripts/vite-build/types.js +0 -0
- package/esm/scripts/vite-build/utils.js +24 -0
- package/fe/bundler/defaultAlias.js +4 -0
- package/fe/frontend/apps/dash/Dashboard.d.ts +6 -0
- package/fe/frontend/apps/dash/Dashboard.js +164 -0
- package/fe/frontend/apps/dash/dash.entry.js +54 -0
- package/fe/frontend/apps/dash/types.d.ts +25 -0
- package/fe/frontend/apps/dash/types.js +0 -0
- package/fe/frontend/apps/ui-components/index.js +16 -0
- package/fe/frontend/apps/ui-components/ui-components.entry.d.ts +2 -0
- package/fe/frontend/apps/ui-components/ui-components.entry.js +8 -0
- package/fe/frontend/extended/SchemaForm/data.d.ts +1 -1
- package/fe/frontend/extended/SchemaForm/data.js +7 -7
- package/fe/frontend/{widgets → src}/api/baseInfo.d.ts +2 -2
- package/fe/frontend/src/api/baseInfo.js +14 -0
- package/fe/frontend/src/common/CRUD/CRUD.d.ts +3 -0
- package/fe/frontend/src/common/CRUD/CRUD.js +2 -0
- package/fe/frontend/src/common/CRUD/index.d.ts +2 -0
- package/fe/frontend/src/common/CRUD/index.js +2 -0
- package/fe/frontend/src/common/auth/index.js +21 -0
- package/fe/frontend/{widgets/defaultPages/Schema/utils → src/common}/fetchErrorShow.d.ts +1 -1
- package/fe/frontend/src/common/fetchErrorShow.js +11 -0
- package/fe/frontend/src/common/generateMenuData.d.ts +4 -0
- package/fe/frontend/src/common/generateMenuData.js +16 -0
- package/fe/frontend/{widgets → src}/common/importComponent.d.ts +1 -1
- package/fe/frontend/src/common/importComponent.js +23 -0
- package/fe/frontend/src/common/language.d.ts +3 -0
- package/fe/frontend/src/common/language.js +12 -0
- package/fe/frontend/{widgets → src}/common/logFn/index.d.ts +1 -0
- package/fe/frontend/src/common/logFn/index.js +14 -0
- package/fe/frontend/{widgets → src}/common/menu.d.ts +1 -1
- package/fe/frontend/src/common/menu.js +97 -0
- package/fe/frontend/src/common/request.d.ts +37 -0
- package/fe/frontend/src/common/request.js +183 -0
- package/fe/frontend/{components → src/components}/AsyncSelect/AsyncSelect.d.ts +3 -3
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.js +35 -0
- package/fe/frontend/src/components/AsyncSelect/index.d.ts +4 -0
- package/fe/frontend/src/components/AsyncSelect/index.js +5 -0
- package/fe/frontend/{widgets → src}/components/BasePage/HeaderView.d.ts +1 -0
- package/fe/frontend/src/components/BasePage/HeaderView.js +55 -0
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.d.ts +14 -0
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.js +44 -0
- package/fe/frontend/src/components/LanguageSwitch/index.d.ts +4 -0
- package/fe/frontend/src/components/LanguageSwitch/index.js +5 -0
- package/fe/frontend/{widgets → src}/components/Router/index.d.ts +2 -2
- package/fe/frontend/src/components/Router/index.js +21 -0
- package/fe/frontend/src/components/Router/type.js +0 -0
- package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.d.ts +15 -0
- package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.js +83 -0
- package/fe/frontend/src/components/ThemeSwitch/index.d.ts +4 -0
- package/fe/frontend/src/components/ThemeSwitch/index.js +5 -0
- package/fe/frontend/src/components/index.d.ts +11 -0
- package/fe/frontend/src/components/index.js +7 -0
- package/fe/frontend/src/defaultPages/Iframe/index.js +15 -0
- package/fe/frontend/src/defaultPages/NotFoundPage/index.d.ts +3 -0
- package/fe/frontend/src/defaultPages/NotFoundPage/index.js +28 -0
- package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/components/CallCom/DetailPanel.d.ts +1 -1
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.js +102 -0
- package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/components/CallCom/PopFrom.d.ts +1 -1
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.js +119 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.d.ts +44 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.js +10 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.d.ts +4 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.js +9 -0
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.js +62 -0
- package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/components/SchemaTable/index.d.ts +2 -2
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.js +200 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/eventInfo.js +9 -0
- package/fe/frontend/src/defaultPages/SchemaPage/data/index.js +4 -0
- package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/hooks/useComConfig.d.ts +1 -1
- package/fe/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.js +17 -0
- package/fe/frontend/src/defaultPages/SchemaPage/index.css +112 -0
- package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/index.d.ts +1 -0
- package/fe/frontend/src/defaultPages/SchemaPage/index.js +90 -0
- package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/schemaType.d.ts +7 -6
- package/fe/frontend/src/defaultPages/SchemaPage/schemaType.js +7 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/permissions.js +6 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.d.ts +3 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.js +66 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.d.ts +11 -0
- package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.js +122 -0
- package/fe/frontend/{widgets → src}/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +2 -2
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +55 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPage/index.js +21 -0
- package/fe/frontend/src/defaultPages/SidebarSlotPageTmp.js +21 -0
- package/fe/frontend/src/defaultPages/SlotPage/index.js +22 -0
- package/fe/frontend/src/exportStore.d.ts +17 -0
- package/fe/frontend/src/exportStore.js +5 -0
- package/fe/frontend/src/hooks/useCurrentMenuData.js +30 -0
- package/fe/frontend/src/hooks/useRouterParams.js +16 -0
- package/fe/frontend/src/index.d.ts +21 -0
- package/fe/frontend/src/index.js +19 -0
- package/fe/frontend/src/language/en-US.d.ts +89 -0
- package/fe/frontend/src/language/en-US.js +89 -0
- package/fe/frontend/src/language/index.d.ts +73 -0
- package/fe/frontend/src/language/index.js +79 -0
- package/fe/frontend/src/language/zh-CN.d.ts +89 -0
- package/fe/frontend/src/language/zh-CN.js +89 -0
- package/fe/frontend/src/main.css +96 -0
- package/fe/frontend/src/main.d.ts +27 -0
- package/fe/frontend/src/main.js +60 -0
- package/fe/frontend/src/stores/apiFreezer.d.ts +93 -0
- package/fe/frontend/src/stores/apiFreezer.js +53 -0
- package/fe/frontend/{widgets/store → src/stores}/mode.d.ts +3 -3
- package/fe/frontend/src/stores/mode.js +36 -0
- package/fe/frontend/{widgets/defaultPages/Schema → src}/stores/schemaEventBus.d.ts +1 -1
- package/fe/frontend/src/stores/schemaEventBus.js +53 -0
- package/fe/frontend/{widgets/defaultPages/Schema → src}/stores/schemaStore.d.ts +5 -5
- package/fe/frontend/src/stores/schemaStore.js +28 -0
- package/fe/frontend/{typing → src/typing}/scalability.d.ts +3 -3
- package/fe/frontend/src/typing/scalability.js +0 -0
- package/fe/frontend/src/typing/window.d.ts +9 -0
- package/fe/frontend/src/typing/window.js +0 -0
- package/fe/model/types/data/button.d.ts +4 -4
- package/fe/model/types/data/component.d.ts +32 -47
- package/fe/model/types/data/schema.d.ts +6 -6
- package/fe/model/types/data/search.d.ts +1 -1
- package/fe/model/types/model.d.ts +19 -12
- package/fe/packages/common/cache/LRUCache.js +43 -47
- package/fe/packages/common/guards/index.js +8 -24
- package/fe/packages/common/http/index.d.ts +90 -0
- package/fe/packages/common/http/index.js +300 -0
- package/fe/packages/common/i18n/default.js +91 -88
- package/fe/packages/common/i18n/en-US.js +91 -88
- package/fe/packages/common/i18n/index.d.ts +3 -3
- package/fe/packages/common/i18n/index.js +142 -153
- package/fe/packages/common/i18n/locales.d.ts +3 -3
- package/fe/packages/common/i18n/locales.js +10 -9
- package/fe/packages/common/index.d.ts +1 -0
- package/fe/packages/common/object/filterEmpty.js +25 -30
- package/fe/packages/react/hooks/useBreadcrumb.d.ts +10 -0
- package/fe/packages/react/hooks/useBreadcrumb.js +5 -0
- package/fe/packages/react/hooks/useExecuteOnce.js +47 -0
- package/fe/packages/react/hooks/useInit.js +11 -0
- package/fe/packages/react/hooks/useLanguage.d.ts +2 -0
- package/fe/packages/react/hooks/useLanguage.js +8 -0
- package/fe/packages/react/hooks/usePagination.js +30 -0
- package/fe/packages/{ui/react → react}/hooks/useRefState.d.ts +1 -1
- package/fe/packages/react/hooks/useRefState.js +35 -0
- package/fe/packages/react/hooks/useWatch.js +60 -0
- package/fe/packages/react/hooks/useWatch.test.js +24 -0
- package/fe/packages/react/ui/assets/table/no-result.js +4 -0
- package/fe/packages/{ui/react → react/ui}/components/Button/Button.d.ts +1 -1
- package/fe/packages/react/ui/components/Button/Button.js +88 -0
- package/fe/packages/react/ui/components/Button/SubmitButton.d.ts +13 -0
- package/fe/packages/react/ui/components/Button/SubmitButton.js +30 -0
- package/fe/packages/react/ui/components/Button/index.d.ts +4 -0
- package/fe/packages/react/ui/components/Button/index.js +3 -0
- package/fe/packages/react/ui/components/Card/Card.d.ts +15 -0
- package/fe/packages/react/ui/components/Card/Card.js +31 -0
- package/fe/packages/react/ui/components/Card/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Card/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/Checkbox/Checkbox.d.ts +1 -1
- package/fe/packages/react/ui/components/Checkbox/Checkbox.js +52 -0
- package/fe/packages/react/ui/components/Checkbox/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Checkbox/index.js +2 -0
- package/fe/packages/react/ui/components/ConfirmDialog/ConfirmDialog.js +41 -0
- package/fe/packages/react/ui/components/ConfirmDialog/index.d.ts +2 -0
- package/fe/packages/react/ui/components/ConfirmDialog/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/DataTable/ActionBtn.d.ts +1 -1
- package/fe/packages/react/ui/components/DataTable/ActionBtn.js +116 -0
- package/fe/packages/{ui/react → react/ui}/components/DataTable/index.d.ts +9 -7
- package/fe/packages/react/ui/components/DataTable/index.js +235 -0
- package/fe/packages/{ui/react → react/ui}/components/Date/Calendar.d.ts +2 -2
- package/fe/packages/react/ui/components/Date/Calendar.js +351 -0
- package/fe/packages/react/ui/components/Date/Date.js +210 -0
- package/fe/packages/react/ui/components/Date/DateTestPage.js +340 -0
- package/fe/packages/react/ui/components/Date/LocaleContext.js +11 -0
- package/fe/packages/{ui/react → react/ui}/components/Date/LocaleProvider.d.ts +2 -2
- package/fe/packages/react/ui/components/Date/LocaleProvider.js +31 -0
- package/fe/packages/react/ui/components/Date/TimePicker.js +136 -0
- package/fe/packages/react/ui/components/Date/data.js +7 -0
- package/fe/packages/{ui/react → react/ui}/components/Date/dateLocaleStore.d.ts +1 -1
- package/fe/packages/react/ui/components/Date/dateLocaleStore.js +14 -0
- package/fe/packages/react/ui/components/Date/dropdownPositioning.d.ts +3 -0
- package/fe/packages/react/ui/components/Date/dropdownPositioning.js +12 -0
- package/fe/packages/react/ui/components/Date/index.d.ts +6 -0
- package/fe/packages/react/ui/components/Date/index.js +6 -0
- package/fe/packages/react/ui/components/Date/locales.js +25 -0
- package/fe/packages/{ui/react → react/ui}/components/Drawer/Drawer.d.ts +1 -1
- package/fe/packages/react/ui/components/Drawer/Drawer.js +151 -0
- package/fe/packages/react/ui/components/Drawer/index.d.ts +3 -0
- package/fe/packages/react/ui/components/Drawer/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/Dropdown/Dropdown.d.ts +3 -2
- package/fe/packages/react/ui/components/Dropdown/Dropdown.js +105 -0
- package/fe/packages/react/ui/components/Dropdown/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Dropdown/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/Form/Form.d.ts +2 -2
- package/fe/packages/react/ui/components/Form/Form.js +15 -0
- package/fe/packages/{ui/react → react/ui}/components/Form/FormItem.d.ts +3 -3
- package/fe/packages/react/ui/components/Form/FormItem.js +60 -0
- package/fe/packages/{ui/react → react/ui}/components/Form/SchemaForm/data.d.ts +8 -8
- package/fe/packages/react/ui/components/Form/SchemaForm/data.js +16 -0
- package/fe/packages/react/ui/components/Form/SchemaForm/defaultComponentsMap.d.ts +4 -0
- package/fe/packages/react/ui/components/Form/SchemaForm/defaultComponentsMap.js +4 -0
- package/fe/packages/{ui/react → react/ui}/components/Form/SchemaForm/index.d.ts +9 -9
- package/fe/packages/react/ui/components/Form/SchemaForm/index.js +119 -0
- package/fe/packages/react/ui/components/Form/index.d.ts +5 -0
- package/fe/packages/react/ui/components/Form/index.js +5 -0
- package/fe/packages/react/ui/components/Form/useForm.d.ts +3 -0
- package/fe/packages/react/ui/components/Form/useForm.js +2 -0
- package/fe/packages/react/ui/components/ImagePreview/ImagePreview.js +307 -0
- package/fe/packages/{ui/react → react/ui}/components/ImagePreview/PreviewImage.d.ts +2 -2
- package/fe/packages/react/ui/components/ImagePreview/PreviewImage.js +56 -0
- package/fe/packages/react/ui/components/ImagePreview/index.d.ts +3 -0
- package/fe/packages/react/ui/components/ImagePreview/index.js +3 -0
- package/fe/packages/{ui/react → react/ui}/components/Input/Input.d.ts +1 -1
- package/fe/packages/react/ui/components/Input/Input.js +88 -0
- package/fe/packages/react/ui/components/Input/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Input/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/InputNumber/InputNumber.d.ts +2 -2
- package/fe/packages/react/ui/components/InputNumber/InputNumber.js +207 -0
- package/fe/packages/react/ui/components/InputNumber/index.d.ts +2 -0
- package/fe/packages/react/ui/components/InputNumber/index.js +2 -0
- package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.js +45 -0
- package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.test.js +59 -0
- package/fe/packages/{ui/react → react/ui}/components/Label/Label.d.ts +1 -1
- package/fe/packages/react/ui/components/Label/Label.js +58 -0
- package/fe/packages/react/ui/components/Label/index.d.ts +3 -0
- package/fe/packages/react/ui/components/Label/index.js +2 -0
- package/fe/packages/react/ui/components/Layout/Layout.d.ts +11 -0
- package/fe/packages/react/ui/components/Layout/Layout.js +33 -0
- package/fe/packages/react/ui/components/Layout/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Layout/index.js +2 -0
- package/fe/packages/react/ui/components/Loading/Loading.d.ts +25 -0
- package/fe/packages/react/ui/components/Loading/Loading.js +48 -0
- package/fe/packages/react/ui/components/Loading/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Loading/index.js +2 -0
- package/fe/packages/react/ui/components/Menu/Menu.js +147 -0
- package/fe/packages/react/ui/components/Menu/MenuContext.js +88 -0
- package/fe/packages/react/ui/components/Menu/MenuItem.js +78 -0
- package/fe/packages/react/ui/components/Menu/SubMenu.js +207 -0
- package/fe/packages/react/ui/components/Menu/index.d.ts +9 -0
- package/fe/packages/react/ui/components/Menu/index.js +5 -0
- package/fe/packages/{ui/react → react/ui}/components/Menu/menuTypes.d.ts +1 -1
- package/fe/packages/react/ui/components/Menu/menuTypes.js +0 -0
- package/fe/packages/react/ui/components/Menu/utils.js +8 -0
- package/fe/packages/{ui/react → react/ui}/components/Message/Message.d.ts +1 -1
- package/fe/packages/react/ui/components/Message/Message.js +76 -0
- package/fe/packages/{ui/react → react/ui}/components/Message/MessageManager.d.ts +2 -2
- package/fe/packages/react/ui/components/Message/MessageManager.js +104 -0
- package/fe/packages/react/ui/components/Message/data.js +4 -0
- package/fe/packages/react/ui/components/Message/index.d.ts +3 -0
- package/fe/packages/react/ui/components/Message/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/Modal/Modal.d.ts +1 -1
- package/fe/packages/react/ui/components/Modal/Modal.js +59 -0
- package/fe/packages/{ui/react → react/ui}/components/Modal/ModalManager.d.ts +5 -5
- package/fe/packages/react/ui/components/Modal/ModalManager.js +106 -0
- package/fe/packages/react/ui/components/Modal/index.d.ts +4 -0
- package/fe/packages/react/ui/components/Modal/index.js +3 -0
- package/fe/packages/react/ui/components/Notification/Notification.d.ts +14 -0
- package/fe/packages/react/ui/components/Notification/Notification.js +56 -0
- package/fe/packages/react/ui/components/Notification/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Notification/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/Overlay/Overlay.d.ts +1 -1
- package/fe/packages/react/ui/components/Overlay/Overlay.js +61 -0
- package/fe/packages/react/ui/components/Overlay/index.d.ts +3 -0
- package/fe/packages/react/ui/components/Overlay/index.js +2 -0
- package/fe/packages/react/ui/components/Pagination/Pagination.js +115 -0
- package/fe/packages/react/ui/components/Pagination/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Pagination/index.js +2 -0
- package/fe/packages/react/ui/components/Popup/Popup.js +86 -0
- package/fe/packages/react/ui/components/Popup/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Popup/index.js +2 -0
- package/fe/packages/react/ui/components/Radio/Radio.d.ts +9 -0
- package/fe/packages/react/ui/components/Radio/Radio.js +36 -0
- package/fe/packages/react/ui/components/Radio/RadioGroup.d.ts +19 -0
- package/fe/packages/react/ui/components/Radio/RadioGroup.js +33 -0
- package/fe/packages/react/ui/components/Radio/index.d.ts +3 -0
- package/fe/packages/react/ui/components/Radio/index.js +3 -0
- package/fe/packages/{ui/react → react/ui}/components/Search/Search.d.ts +4 -4
- package/fe/packages/react/ui/components/Search/Search.js +24 -0
- package/fe/packages/react/ui/components/Search/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Search/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/Select/Select.d.ts +1 -1
- package/fe/packages/react/ui/components/Select/Select.js +276 -0
- package/fe/packages/react/ui/components/Select/dropdownPositioning.d.ts +3 -0
- package/fe/packages/react/ui/components/Select/dropdownPositioning.js +16 -0
- package/fe/packages/react/ui/components/Select/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Select/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/Skeleton/Skeleton.d.ts +1 -1
- package/fe/packages/react/ui/components/Skeleton/Skeleton.js +101 -0
- package/fe/packages/react/ui/components/Skeleton/index.d.ts +3 -0
- package/fe/packages/react/ui/components/Skeleton/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/Switch/Switch.d.ts +1 -1
- package/fe/packages/react/ui/components/Switch/Switch.js +28 -0
- package/fe/packages/react/ui/components/Switch/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Switch/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/TableSearch/TableSearch.d.ts +6 -6
- package/fe/packages/react/ui/components/TableSearch/TableSearch.js +146 -0
- package/fe/packages/react/ui/components/TableSearch/index.d.ts +3 -0
- package/fe/packages/react/ui/components/TableSearch/index.js +2 -0
- package/fe/packages/react/ui/components/TableSearch/lang.js +14 -0
- package/fe/packages/{ui/react → react/ui}/components/TableSearch/tableSearchLocaleStore.d.ts +1 -1
- package/fe/packages/react/ui/components/TableSearch/tableSearchLocaleStore.js +10 -0
- package/fe/packages/react/ui/components/Tabs/Tabs.d.ts +16 -0
- package/fe/packages/react/ui/components/Tabs/Tabs.js +33 -0
- package/fe/packages/react/ui/components/Tabs/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Tabs/index.js +2 -0
- package/fe/packages/react/ui/components/Textarea/Textarea.js +58 -0
- package/fe/packages/react/ui/components/Textarea/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Textarea/index.js +2 -0
- package/fe/packages/react/ui/components/Tooltip/Tooltip.js +77 -0
- package/fe/packages/react/ui/components/Tooltip/index.d.ts +2 -0
- package/fe/packages/react/ui/components/Tooltip/index.js +2 -0
- package/fe/packages/react/ui/components/TreeSelect/TreeSelect.js +190 -0
- package/fe/packages/react/ui/components/TreeSelect/index.d.ts +2 -0
- package/fe/packages/react/ui/components/TreeSelect/index.js +2 -0
- package/fe/packages/react/ui/components/Upload/ImageUpload.js +101 -0
- package/fe/packages/{ui/react → react/ui}/components/Upload/Upload.d.ts +1 -1
- package/fe/packages/react/ui/components/Upload/Upload.js +29 -0
- package/fe/packages/react/ui/components/Upload/index.d.ts +3 -0
- package/fe/packages/react/ui/components/Upload/index.js +3 -0
- package/fe/packages/react/ui/components/breadcrumb/breadcrumb.js +155 -0
- package/fe/packages/react/ui/components/breadcrumb/index.d.ts +2 -0
- package/fe/packages/react/ui/components/breadcrumb/index.js +2 -0
- package/fe/packages/react/ui/components/hooks/useDropdownPositioning.js +121 -0
- package/fe/packages/react/ui/components/hooks/useInputController.js +39 -0
- package/fe/packages/react/ui/components/index.d.ts +36 -0
- package/fe/packages/react/ui/components/index.js +81 -0
- package/fe/packages/react/ui/components/table/index.d.ts +2 -0
- package/fe/packages/react/ui/components/table/index.js +2 -0
- package/fe/packages/{ui/react → react/ui}/components/table/table.d.ts +16 -3
- package/fe/packages/react/ui/components/table/table.js +166 -0
- package/fe/packages/react/ui/components/testPage/MenuTestPage.js +397 -0
- package/fe/packages/react/ui/components/testPage/index.js +1612 -0
- package/fe/packages/{ui/react → react/ui}/i18n/I18nProvider.d.ts +2 -2
- package/fe/packages/react/ui/i18n/I18nProvider.js +38 -0
- package/fe/packages/react/ui/i18n/index.d.ts +4 -0
- package/fe/packages/react/ui/i18n/index.js +7 -0
- package/fe/packages/react/ui/i18n/useI18n.d.ts +13 -0
- package/fe/packages/react/ui/i18n/useI18n.js +25 -0
- package/fe/packages/{ui/react → react/ui}/index.css +70 -9
- package/fe/packages/react/ui/index.d.ts +5 -0
- package/fe/packages/react/ui/index.js +58 -0
- package/fe/packages/{ui/react → react/ui}/lib/createStoreHook.d.ts +1 -1
- package/fe/packages/react/ui/lib/createStoreHook.js +9 -0
- package/fe/packages/{ui/react → react/ui}/lib/export.d.ts +1 -1
- package/fe/packages/react/ui/lib/export.js +112 -0
- package/fe/packages/react/ui/lib/utils.js +64 -0
- package/fe/packages/{ui/react → react/ui}/stores/breadcrumb.d.ts +1 -1
- package/fe/packages/react/ui/stores/breadcrumb.js +52 -0
- package/fe/packages/react/ui/stores/language.d.ts +4 -0
- package/fe/packages/react/ui/stores/language.js +4 -0
- package/fe/packages/react/ui/types/index.js +0 -0
- package/fe/typings/type.d.ts +1 -0
- package/model/index.d.ts +1 -1
- package/model/types/data/button.d.ts +4 -4
- package/model/types/data/component.d.ts +32 -47
- package/model/types/data/schema.d.ts +6 -6
- package/model/types/data/search.d.ts +1 -1
- package/model/types/index.d.ts +2 -1
- package/model/types/model.d.ts +19 -12
- package/package.json +37 -39
- package/types/app/controller/project.d.ts +14 -2
- package/types/app/controller/view.d.ts +1 -1
- package/types/app/extend/$fetch.d.ts +8 -0
- package/types/app/extend/db.d.ts +54 -1
- package/types/app/extend/render-view.d.ts +3 -0
- package/types/app/middleware/api-params-verify.d.ts +1 -1
- package/types/app/middleware/project-handler.d.ts +2 -2
- package/types/app/router/project.d.ts +1 -1
- package/types/app/service/base.d.ts +3 -4
- package/types/app/service/project.d.ts +7 -2
- package/types/app/type.d.ts +5 -3
- package/types/app/typings.d.ts +4 -2
- package/types/bundler/buildBE.d.ts +13 -0
- package/types/bundler/index.d.ts +4 -1
- package/types/bundler/state.d.ts +18 -0
- package/types/bundler/utils.d.ts +5 -0
- package/types/config/config.default.d.ts +33 -2
- package/types/index.d.ts +6 -5
- package/{fe/frontend/widgets/common/CRUD/CRUD.d.ts → types/packages/common/http/index.d.ts} +29 -10
- package/types/packages/common/i18n/default.d.ts +5 -0
- package/types/packages/common/i18n/en-US.d.ts +5 -0
- package/types/packages/common/i18n/index.d.ts +24 -0
- package/types/packages/common/i18n/types.d.ts +24 -0
- package/types/packages/common/index.d.ts +1 -0
- package/types/packages/core/index.d.ts +3 -3
- package/types/packages/core/loader/config.d.ts +6 -0
- package/types/packages/core/loader/controller.d.ts +14 -0
- package/types/packages/core/loader/extend.d.ts +6 -1
- package/types/packages/core/loader/middleware.d.ts +8 -0
- package/types/packages/core/loader/model.d.ts +22 -0
- package/types/packages/core/loader/router-schema.d.ts +15 -0
- package/types/packages/core/loader/router.d.ts +5 -0
- package/types/packages/core/loader/service.d.ts +14 -0
- package/types/packages/core/paths.d.ts +10 -7
- package/types/packages/core/types.d.ts +66 -3
- package/types/packages/utils/getAllFilesInFolder.d.ts +5 -0
- package/types/packages/utils/loadFile.d.ts +6 -0
- package/types/packages/utils/path.d.ts +18 -0
- package/types/scripts/vite-build/build.d.ts +24 -0
- package/types/scripts/vite-build/collect.d.ts +57 -0
- package/types/scripts/vite-build/constants.d.ts +6 -0
- package/types/scripts/vite-build/dts.d.ts +53 -0
- package/types/scripts/vite-build/index.d.ts +2 -0
- package/types/scripts/vite-build/normalize.d.ts +66 -0
- package/types/scripts/vite-build/plugins.d.ts +67 -0
- package/types/scripts/vite-build/resolve.d.ts +61 -0
- package/types/scripts/vite-build/types.d.ts +174 -0
- package/types/scripts/vite-build/utils.d.ts +35 -0
- package/types/typings/type.d.ts +1 -0
- package/cjs/app/README.md +0 -286
- package/cjs/app/data/signKey.js +0 -23
- package/esm/app/README.md +0 -286
- package/esm/app/data/signKey.js +0 -10
- package/fe/frontend/components/AsyncSelect/AsyncSelect.js +0 -32
- package/fe/frontend/components/AsyncSelect/index.d.ts +0 -4
- package/fe/frontend/components/AsyncSelect/index.js +0 -3
- package/fe/frontend/dash/Dashboard.d.ts +0 -7
- package/fe/frontend/dash/Dashboard.js +0 -73
- package/fe/frontend/dash/dash.entry.js +0 -93
- package/fe/frontend/dash/types.d.ts +0 -17
- package/fe/frontend/dash/types.js +0 -1
- package/fe/frontend/index.d.ts +0 -5
- package/fe/frontend/index.js +0 -2
- package/fe/frontend/main.css +0 -5
- package/fe/frontend/main.d.ts +0 -11
- package/fe/frontend/main.js +0 -19
- package/fe/frontend/testPage/index.js +0 -6
- package/fe/frontend/testPage/testPage.entry.d.ts +0 -2
- package/fe/frontend/testPage/testPage.entry.js +0 -3
- package/fe/frontend/typing/scalability.js +0 -1
- package/fe/frontend/typing/window.d.ts +0 -7
- package/fe/frontend/typing/window.js +0 -1
- package/fe/frontend/widgets/api/baseInfo.js +0 -15
- package/fe/frontend/widgets/common/CRUD/CRUD.js +0 -208
- package/fe/frontend/widgets/common/CRUD/index.d.ts +0 -2
- package/fe/frontend/widgets/common/CRUD/index.js +0 -1
- package/fe/frontend/widgets/common/auth/index.js +0 -20
- package/fe/frontend/widgets/common/generateMenuData.d.ts +0 -4
- package/fe/frontend/widgets/common/generateMenuData.js +0 -14
- package/fe/frontend/widgets/common/importComponent.js +0 -8
- package/fe/frontend/widgets/common/language.d.ts +0 -2
- package/fe/frontend/widgets/common/language.js +0 -9
- package/fe/frontend/widgets/common/logFn/index.js +0 -8
- package/fe/frontend/widgets/common/menu.js +0 -101
- package/fe/frontend/widgets/common/request.d.ts +0 -36
- package/fe/frontend/widgets/common/request.js +0 -133
- package/fe/frontend/widgets/components/BasePage/HeaderView.js +0 -16
- package/fe/frontend/widgets/components/Router/index.js +0 -11
- package/fe/frontend/widgets/components/Router/type.js +0 -1
- package/fe/frontend/widgets/defaultPages/Iframe/index.js +0 -14
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/DetailPanel.js +0 -94
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/PopFrom.js +0 -124
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.d.ts +0 -3
- package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.js +0 -6
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaSearch/index.js +0 -63
- package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.js +0 -188
- package/fe/frontend/widgets/defaultPages/Schema/data/eventInfo.js +0 -6
- package/fe/frontend/widgets/defaultPages/Schema/data/index.js +0 -1
- package/fe/frontend/widgets/defaultPages/Schema/hooks/useComConfig.js +0 -14
- package/fe/frontend/widgets/defaultPages/Schema/index.js +0 -74
- package/fe/frontend/widgets/defaultPages/Schema/schemaType.js +0 -4
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.js +0 -70
- package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.js +0 -26
- package/fe/frontend/widgets/defaultPages/Schema/utils/fetchErrorShow.js +0 -8
- package/fe/frontend/widgets/defaultPages/Schema/utils/permissions.js +0 -3
- package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.d.ts +0 -3
- package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.js +0 -115
- package/fe/frontend/widgets/defaultPages/Schema/utils/validator.d.ts +0 -7
- package/fe/frontend/widgets/defaultPages/Schema/utils/validator.js +0 -36
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +0 -38
- package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.js +0 -16
- package/fe/frontend/widgets/defaultPages/SidebarSlotPageTmp.js +0 -17
- package/fe/frontend/widgets/defaultPages/SlotPage/index.js +0 -26
- package/fe/frontend/widgets/defaultPages/Todo.d.ts +0 -3
- package/fe/frontend/widgets/defaultPages/Todo.js +0 -5
- package/fe/frontend/widgets/hooks/useCurrentMenuData.js +0 -28
- package/fe/frontend/widgets/hooks/useRouterParams.js +0 -11
- package/fe/frontend/widgets/store/mode.js +0 -37
- package/fe/model/types/data/button.js +0 -16
- package/fe/model/types/data/component.js +0 -11
- package/fe/model/types/data/fetchInfo.js +0 -1
- package/fe/model/types/data/schema.js +0 -1
- package/fe/model/types/data/search.js +0 -1
- package/fe/model/types/menuType.js +0 -1
- package/fe/model/types/model.js +0 -1
- package/fe/packages/common/array/index.js +0 -40
- package/fe/packages/common/cache/index.js +0 -1
- package/fe/packages/common/i18n/types.js +0 -1
- package/fe/packages/common/index.js +0 -9
- package/fe/packages/common/log/index.js +0 -176
- package/fe/packages/common/number/index.js +0 -10
- package/fe/packages/common/object/index.js +0 -25
- package/fe/packages/common/string/index.js +0 -17
- package/fe/packages/common/types/index.js +0 -1
- package/fe/packages/ui/react/components/Button/Button.js +0 -72
- package/fe/packages/ui/react/components/Button/SumbitButton.d.ts +0 -13
- package/fe/packages/ui/react/components/Button/SumbitButton.js +0 -25
- package/fe/packages/ui/react/components/Button/index.d.ts +0 -4
- package/fe/packages/ui/react/components/Button/index.js +0 -2
- package/fe/packages/ui/react/components/Checkbox/Checkbox.js +0 -39
- package/fe/packages/ui/react/components/Checkbox/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Checkbox/index.js +0 -1
- package/fe/packages/ui/react/components/ConfirmDialog/ConfirmDialog.js +0 -11
- package/fe/packages/ui/react/components/ConfirmDialog/index.d.ts +0 -2
- package/fe/packages/ui/react/components/ConfirmDialog/index.js +0 -1
- package/fe/packages/ui/react/components/DataTable/ActionBtn.js +0 -94
- package/fe/packages/ui/react/components/DataTable/index.js +0 -155
- package/fe/packages/ui/react/components/Date/Calendar.js +0 -216
- package/fe/packages/ui/react/components/Date/Date.js +0 -201
- package/fe/packages/ui/react/components/Date/DateTestPage.js +0 -29
- package/fe/packages/ui/react/components/Date/LocaleContext.js +0 -8
- package/fe/packages/ui/react/components/Date/LocaleProvider.js +0 -24
- package/fe/packages/ui/react/components/Date/TimePicker.js +0 -78
- package/fe/packages/ui/react/components/Date/data.js +0 -4
- package/fe/packages/ui/react/components/Date/dateLocaleStore.js +0 -14
- package/fe/packages/ui/react/components/Date/dropdownPositioning.d.ts +0 -3
- package/fe/packages/ui/react/components/Date/dropdownPositioning.js +0 -12
- package/fe/packages/ui/react/components/Date/index.d.ts +0 -6
- package/fe/packages/ui/react/components/Date/index.js +0 -5
- package/fe/packages/ui/react/components/Date/locales.js +0 -21
- package/fe/packages/ui/react/components/Drawer/Drawer.js +0 -100
- package/fe/packages/ui/react/components/Drawer/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Drawer/index.js +0 -1
- package/fe/packages/ui/react/components/Dropdown/Dropdown.js +0 -28
- package/fe/packages/ui/react/components/Dropdown/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Dropdown/index.js +0 -1
- package/fe/packages/ui/react/components/Form/Form.js +0 -8
- package/fe/packages/ui/react/components/Form/FormItem.js +0 -43
- package/fe/packages/ui/react/components/Form/SchemaForm/data.js +0 -18
- package/fe/packages/ui/react/components/Form/SchemaForm/index.js +0 -79
- package/fe/packages/ui/react/components/Form/index.d.ts +0 -5
- package/fe/packages/ui/react/components/Form/index.js +0 -4
- package/fe/packages/ui/react/components/Form/useForm.d.ts +0 -3
- package/fe/packages/ui/react/components/Form/useForm.js +0 -1
- package/fe/packages/ui/react/components/ImagePreview/ImagePreview.js +0 -169
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.js +0 -28
- package/fe/packages/ui/react/components/ImagePreview/index.d.ts +0 -3
- package/fe/packages/ui/react/components/ImagePreview/index.js +0 -2
- package/fe/packages/ui/react/components/Input/Input.js +0 -61
- package/fe/packages/ui/react/components/Input/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Input/index.js +0 -1
- package/fe/packages/ui/react/components/InputNumber/InputNumber.js +0 -144
- package/fe/packages/ui/react/components/InputNumber/index.d.ts +0 -2
- package/fe/packages/ui/react/components/InputNumber/index.js +0 -1
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.js +0 -63
- package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.js +0 -27
- package/fe/packages/ui/react/components/Label/Label.js +0 -35
- package/fe/packages/ui/react/components/Label/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Label/index.js +0 -2
- package/fe/packages/ui/react/components/Menu/Menu.js +0 -102
- package/fe/packages/ui/react/components/Menu/MenuContext.js +0 -97
- package/fe/packages/ui/react/components/Menu/MenuItem.js +0 -33
- package/fe/packages/ui/react/components/Menu/SubMenu.js +0 -169
- package/fe/packages/ui/react/components/Menu/index.d.ts +0 -9
- package/fe/packages/ui/react/components/Menu/index.js +0 -5
- package/fe/packages/ui/react/components/Menu/menuTypes.js +0 -1
- package/fe/packages/ui/react/components/Menu/utils.js +0 -7
- package/fe/packages/ui/react/components/Message/Message.js +0 -58
- package/fe/packages/ui/react/components/Message/MessageManager.js +0 -90
- package/fe/packages/ui/react/components/Message/data.js +0 -1
- package/fe/packages/ui/react/components/Message/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Message/index.js +0 -1
- package/fe/packages/ui/react/components/Modal/Modal.js +0 -14
- package/fe/packages/ui/react/components/Modal/ModalManager.js +0 -90
- package/fe/packages/ui/react/components/Modal/index.d.ts +0 -4
- package/fe/packages/ui/react/components/Modal/index.js +0 -2
- package/fe/packages/ui/react/components/Overlay/Overlay.js +0 -53
- package/fe/packages/ui/react/components/Overlay/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Overlay/index.js +0 -1
- package/fe/packages/ui/react/components/Pagination/Pagination.js +0 -88
- package/fe/packages/ui/react/components/Pagination/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Pagination/index.js +0 -1
- package/fe/packages/ui/react/components/Popup/Popup.js +0 -81
- package/fe/packages/ui/react/components/Popup/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Popup/index.js +0 -1
- package/fe/packages/ui/react/components/Search/Search.js +0 -12
- package/fe/packages/ui/react/components/Search/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Search/index.js +0 -1
- package/fe/packages/ui/react/components/Select/Select.js +0 -123
- package/fe/packages/ui/react/components/Select/dropdownPositioning.d.ts +0 -3
- package/fe/packages/ui/react/components/Select/dropdownPositioning.js +0 -13
- package/fe/packages/ui/react/components/Select/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Select/index.js +0 -1
- package/fe/packages/ui/react/components/Skeleton/Skeleton.js +0 -31
- package/fe/packages/ui/react/components/Skeleton/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Skeleton/index.js +0 -1
- package/fe/packages/ui/react/components/Switch/Switch.js +0 -22
- package/fe/packages/ui/react/components/Switch/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Switch/index.js +0 -1
- package/fe/packages/ui/react/components/TableSearch/TableSearch.js +0 -121
- package/fe/packages/ui/react/components/TableSearch/index.d.ts +0 -2
- package/fe/packages/ui/react/components/TableSearch/index.js +0 -1
- package/fe/packages/ui/react/components/TableSearch/lang.js +0 -14
- package/fe/packages/ui/react/components/TableSearch/tableSearchLocaleStore.js +0 -11
- package/fe/packages/ui/react/components/Textarea/Textarea.js +0 -37
- package/fe/packages/ui/react/components/Textarea/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Textarea/index.js +0 -1
- package/fe/packages/ui/react/components/Tooltip/Tooltip.js +0 -79
- package/fe/packages/ui/react/components/Tooltip/index.d.ts +0 -2
- package/fe/packages/ui/react/components/Tooltip/index.js +0 -1
- package/fe/packages/ui/react/components/TreeSelect/TreeSelect.js +0 -160
- package/fe/packages/ui/react/components/TreeSelect/index.d.ts +0 -2
- package/fe/packages/ui/react/components/TreeSelect/index.js +0 -1
- package/fe/packages/ui/react/components/Upload/ImageUpload.js +0 -75
- package/fe/packages/ui/react/components/Upload/Upload.js +0 -6
- package/fe/packages/ui/react/components/Upload/index.d.ts +0 -3
- package/fe/packages/ui/react/components/Upload/index.js +0 -2
- package/fe/packages/ui/react/components/breadcrumb/breadcrumb.js +0 -81
- package/fe/packages/ui/react/components/breadcrumb/index.d.ts +0 -2
- package/fe/packages/ui/react/components/breadcrumb/index.js +0 -1
- package/fe/packages/ui/react/components/hooks/useDropdownPositioning.js +0 -137
- package/fe/packages/ui/react/components/hooks/useInputController.js +0 -45
- package/fe/packages/ui/react/components/index.d.ts +0 -30
- package/fe/packages/ui/react/components/index.js +0 -29
- package/fe/packages/ui/react/components/table/index.d.ts +0 -2
- package/fe/packages/ui/react/components/table/index.js +0 -1
- package/fe/packages/ui/react/components/table/table.js +0 -20
- package/fe/packages/ui/react/components/testPage/MenuTestPage.js +0 -104
- package/fe/packages/ui/react/components/testPage/index.js +0 -314
- package/fe/packages/ui/react/hooks/useBreadcrumb.d.ts +0 -10
- package/fe/packages/ui/react/hooks/useBreadcrumb.js +0 -2
- package/fe/packages/ui/react/hooks/useExecuteOnce.js +0 -57
- package/fe/packages/ui/react/hooks/useInit.js +0 -9
- package/fe/packages/ui/react/hooks/useLanguage.d.ts +0 -2
- package/fe/packages/ui/react/hooks/useLanguage.js +0 -4
- package/fe/packages/ui/react/hooks/usePagination.js +0 -27
- package/fe/packages/ui/react/hooks/useRefState.js +0 -29
- package/fe/packages/ui/react/hooks/useWatch.js +0 -87
- package/fe/packages/ui/react/hooks/useWatch.test.js +0 -22
- package/fe/packages/ui/react/i18n/I18nProvider.js +0 -25
- package/fe/packages/ui/react/i18n/index.d.ts +0 -4
- package/fe/packages/ui/react/i18n/index.js +0 -3
- package/fe/packages/ui/react/i18n/useI18n.d.ts +0 -13
- package/fe/packages/ui/react/i18n/useI18n.js +0 -18
- package/fe/packages/ui/react/index.d.ts +0 -5
- package/fe/packages/ui/react/index.js +0 -6
- package/fe/packages/ui/react/lib/createStoreHook.js +0 -6
- package/fe/packages/ui/react/lib/export.js +0 -138
- package/fe/packages/ui/react/lib/utils.js +0 -70
- package/fe/packages/ui/react/stores/breadcrumb.js +0 -66
- package/fe/packages/ui/react/stores/language.d.ts +0 -4
- package/fe/packages/ui/react/stores/language.js +0 -2
- package/fe/packages/ui/react/types/index.js +0 -1
- package/fe/typings/type.js +0 -1
- package/types/app/data/signKey.d.ts +0 -1
- /package/fe/frontend/{dash → apps/dash}/dash.entry.d.ts +0 -0
- /package/fe/frontend/{testPage → apps/ui-components}/index.d.ts +0 -0
- /package/fe/frontend/{widgets → src}/common/auth/index.d.ts +0 -0
- /package/fe/frontend/{widgets → src}/components/Router/type.d.ts +0 -0
- /package/fe/frontend/{widgets → src}/defaultPages/Iframe/index.d.ts +0 -0
- /package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/components/SchemaSearch/index.d.ts +0 -0
- /package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/data/eventInfo.d.ts +0 -0
- /package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/data/index.d.ts +0 -0
- /package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/utils/permissions.d.ts +0 -0
- /package/fe/frontend/{widgets → src}/defaultPages/SidebarSlotPage/index.d.ts +0 -0
- /package/fe/frontend/{widgets → src}/defaultPages/SidebarSlotPageTmp.d.ts +0 -0
- /package/fe/frontend/{widgets → src}/defaultPages/SlotPage/index.d.ts +0 -0
- /package/fe/frontend/{widgets → src}/hooks/useCurrentMenuData.d.ts +0 -0
- /package/fe/frontend/{widgets → src}/hooks/useRouterParams.d.ts +0 -0
- /package/fe/packages/{ui/react → react}/hooks/useExecuteOnce.d.ts +0 -0
- /package/fe/packages/{ui/react → react}/hooks/useInit.d.ts +0 -0
- /package/fe/packages/{ui/react → react}/hooks/usePagination.d.ts +0 -0
- /package/fe/packages/{ui/react → react}/hooks/useWatch.d.ts +0 -0
- /package/fe/packages/{ui/react → react}/hooks/useWatch.test.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/assets/table/no-result.svg +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/ConfirmDialog/ConfirmDialog.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Date/Date.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Date/DateTestPage.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Date/LocaleContext.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Date/TimePicker.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Date/data.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Date/locales.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/ImagePreview/ImagePreview.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/InputNumber/inputNumberUtils.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/InputNumber/inputNumberUtils.test.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Menu/Menu.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Menu/MenuContext.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Menu/MenuItem.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Menu/SubMenu.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Menu/utils.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Message/data.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Pagination/Pagination.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Popup/Popup.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/TableSearch/lang.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Textarea/Textarea.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Tooltip/Tooltip.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/TreeSelect/TreeSelect.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/Upload/ImageUpload.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/breadcrumb/breadcrumb.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/hooks/useDropdownPositioning.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/hooks/useInputController.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/testPage/MenuTestPage.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/components/testPage/index.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/lib/utils.d.ts +0 -0
- /package/fe/packages/{ui/react → react/ui}/types/index.d.ts +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import "./data.js";
|
|
2
|
+
import { Message } from "./Message.js";
|
|
3
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createRoot } from "react-dom/client";
|
|
5
|
+
//#region packages/react/ui/components/Message/MessageManager.tsx
|
|
6
|
+
var MessageManagerClass = class {
|
|
7
|
+
messages = /* @__PURE__ */ new Map();
|
|
8
|
+
container = null;
|
|
9
|
+
offScreenContainer = null;
|
|
10
|
+
root = null;
|
|
11
|
+
offScreenRoot = null;
|
|
12
|
+
maxCount = 5;
|
|
13
|
+
init() {
|
|
14
|
+
if (typeof document === "undefined" || this.container) return;
|
|
15
|
+
this.container = document.createElement("div");
|
|
16
|
+
this.container.id = "message-container";
|
|
17
|
+
this.container.className = "fixed top-4 left-1/2 z-[10000] flex flex-col items-center gap-2 pointer-events-none";
|
|
18
|
+
this.container.style.transform = "translateX(-50%)";
|
|
19
|
+
document.body.appendChild(this.container);
|
|
20
|
+
this.offScreenContainer = document.createElement("div");
|
|
21
|
+
this.offScreenContainer.id = "message-offscreen-container";
|
|
22
|
+
this.offScreenContainer.className = "fixed -left-[9999px] top-0 z-[10000] flex flex-col items-center gap-2 pointer-events-none";
|
|
23
|
+
this.offScreenContainer.setAttribute("aria-hidden", "true");
|
|
24
|
+
document.body.appendChild(this.offScreenContainer);
|
|
25
|
+
this.root = createRoot(this.container);
|
|
26
|
+
this.offScreenRoot = createRoot(this.offScreenContainer);
|
|
27
|
+
this.render();
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
if (!this.root || !this.offScreenRoot) return;
|
|
31
|
+
const messages = Array.from(this.messages.values());
|
|
32
|
+
const totalCount = messages.length;
|
|
33
|
+
const displayMessages = totalCount > this.maxCount ? messages.slice(-this.maxCount) : messages;
|
|
34
|
+
const offScreenMessages = totalCount > this.maxCount ? messages.slice(0, -this.maxCount) : [];
|
|
35
|
+
const now = Date.now();
|
|
36
|
+
this.root.render(/* @__PURE__ */ jsx(Fragment, { children: displayMessages.map((message) => /* @__PURE__ */ jsx(Message, {
|
|
37
|
+
...message,
|
|
38
|
+
duration: message.expirationTime - now,
|
|
39
|
+
content: message.content,
|
|
40
|
+
onClose: () => {
|
|
41
|
+
message.onClose?.();
|
|
42
|
+
this.close(message.id);
|
|
43
|
+
}
|
|
44
|
+
}, message.id)) }));
|
|
45
|
+
this.offScreenRoot.render(/* @__PURE__ */ jsx(Fragment, { children: offScreenMessages.map((message) => /* @__PURE__ */ jsx(Message, {
|
|
46
|
+
...message,
|
|
47
|
+
duration: message.expirationTime - now,
|
|
48
|
+
content: message.content,
|
|
49
|
+
onClose: () => {
|
|
50
|
+
message.onClose?.();
|
|
51
|
+
this.close(message.id);
|
|
52
|
+
}
|
|
53
|
+
}, message.id)) }));
|
|
54
|
+
}
|
|
55
|
+
show(config, type = "info") {
|
|
56
|
+
this.init();
|
|
57
|
+
const now = Date.now();
|
|
58
|
+
const id = `message-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
59
|
+
const messageConfig = {
|
|
60
|
+
...config,
|
|
61
|
+
expirationTime: now + (config.duration ?? 3e3),
|
|
62
|
+
id,
|
|
63
|
+
type
|
|
64
|
+
};
|
|
65
|
+
this.messages.set(id, messageConfig);
|
|
66
|
+
this.render();
|
|
67
|
+
return id;
|
|
68
|
+
}
|
|
69
|
+
close(id) {
|
|
70
|
+
this.messages.delete(id);
|
|
71
|
+
this.render();
|
|
72
|
+
}
|
|
73
|
+
closeAll() {
|
|
74
|
+
this.messages.clear();
|
|
75
|
+
this.render();
|
|
76
|
+
}
|
|
77
|
+
setMaxCount(count) {
|
|
78
|
+
this.maxCount = count;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var messageManager = new MessageManagerClass();
|
|
82
|
+
var message = {
|
|
83
|
+
success: (content, config) => messageManager.show({
|
|
84
|
+
content,
|
|
85
|
+
...config
|
|
86
|
+
}, "success"),
|
|
87
|
+
error: (content, config) => messageManager.show({
|
|
88
|
+
content,
|
|
89
|
+
...config
|
|
90
|
+
}, "error"),
|
|
91
|
+
warning: (content, config) => messageManager.show({
|
|
92
|
+
content,
|
|
93
|
+
...config
|
|
94
|
+
}, "warning"),
|
|
95
|
+
info: (content, config) => messageManager.show({
|
|
96
|
+
content,
|
|
97
|
+
...config
|
|
98
|
+
}, "info"),
|
|
99
|
+
close: (id) => messageManager.close(id),
|
|
100
|
+
closeAll: () => messageManager.closeAll(),
|
|
101
|
+
setMaxCount: (count) => messageManager.setMaxCount(count)
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
export { message, messageManager };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useI18n } from "../../i18n/useI18n.js";
|
|
2
|
+
import "../../i18n/index.js";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { Button } from "../Button/Button.js";
|
|
5
|
+
import "../Button/index.js";
|
|
6
|
+
import { Overlay } from "../Overlay/Overlay.js";
|
|
7
|
+
import "../Overlay/index.js";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { X } from "lucide-react";
|
|
10
|
+
//#region packages/react/ui/components/Modal/Modal.tsx
|
|
11
|
+
function Modal({ open = false, onClose, title, children, footer, className, contentClassName, mask = true, maskClosable = true, lockScroll = true, closable = true, width = 520, centered = true, renderNode, keyboard = true, zIndex = 1e3 }) {
|
|
12
|
+
const t = useI18n();
|
|
13
|
+
const handleContentClick = (e) => {
|
|
14
|
+
e.stopPropagation();
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ jsx(Overlay, {
|
|
17
|
+
open,
|
|
18
|
+
onClose,
|
|
19
|
+
mask,
|
|
20
|
+
maskClosable,
|
|
21
|
+
lockScroll,
|
|
22
|
+
keyboard,
|
|
23
|
+
closable,
|
|
24
|
+
renderNode,
|
|
25
|
+
zIndex,
|
|
26
|
+
className: cn("tc-ui-modal flex items-center justify-center"),
|
|
27
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: cn("relative rounded-2xl border border-border/70 bg-popover text-popover-foreground", "shadow-[0_22px_70px_hsl(var(--background)/0.58),inset_0_1px_0_hsl(var(--foreground)/0.06)]", "flex flex-col max-h-[90vh]", "max-w-[calc(100vw-2rem)]", "transition-all duration-200", open ? "scale-100 opacity-100" : "scale-95 opacity-0", centered ? "my-auto" : "mt-[10vh]", className),
|
|
29
|
+
style: { width: typeof width === "number" ? `${width}px` : width },
|
|
30
|
+
onClick: handleContentClick,
|
|
31
|
+
children: [
|
|
32
|
+
(title || closable) && /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "flex items-center justify-between border-b border-border/60 px-4 py-3",
|
|
34
|
+
children: [title && /* @__PURE__ */ jsx("div", {
|
|
35
|
+
className: "text-sm font-semibold leading-5 text-foreground",
|
|
36
|
+
children: title
|
|
37
|
+
}), closable && /* @__PURE__ */ jsx(Button, {
|
|
38
|
+
variant: "text",
|
|
39
|
+
type: "button",
|
|
40
|
+
onClick: onClose,
|
|
41
|
+
"aria-label": t("components.modal.close"),
|
|
42
|
+
className: cn("ml-auto h-7 w-7 rounded-md p-0", "text-muted-foreground hover:text-foreground", "hover:bg-foreground/8", "transition-colors", "focus:outline-none focus:ring-2 focus:ring-ring/40 focus:ring-offset-0"),
|
|
43
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
44
|
+
})]
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: cn("flex-1 overflow-auto px-4 py-4", contentClassName),
|
|
48
|
+
children
|
|
49
|
+
}),
|
|
50
|
+
footer && /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "border-t border-border/60 px-4 py-3",
|
|
52
|
+
children: footer
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { Modal };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactNode } from
|
|
2
|
-
import { type
|
|
3
|
-
import { type ModalProps } from
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type SubmitButtonProps } from "../Button";
|
|
3
|
+
import { type ModalProps } from "./Modal";
|
|
4
4
|
type ModalConfig = Omit<ModalProps, 'open' | 'onClose' | 'children'> & {
|
|
5
5
|
id: string;
|
|
6
6
|
onClose?: () => void;
|
|
@@ -31,7 +31,7 @@ export declare const openConfirmModal: (pConfig: Pick<OpenModalConfig, "content"
|
|
|
31
31
|
/** 取消按钮文本 */
|
|
32
32
|
cancelText?: string;
|
|
33
33
|
/** 确认回调 */
|
|
34
|
-
onOk?:
|
|
34
|
+
onOk?: SubmitButtonProps["onClick"];
|
|
35
35
|
/** 取消回调 */
|
|
36
36
|
onCancel?: () => void;
|
|
37
37
|
}) => string;
|
|
@@ -48,7 +48,7 @@ export declare const modal: {
|
|
|
48
48
|
/** 取消按钮文本 */
|
|
49
49
|
cancelText?: string;
|
|
50
50
|
/** 确认回调 */
|
|
51
|
-
onOk?:
|
|
51
|
+
onOk?: SubmitButtonProps["onClick"];
|
|
52
52
|
/** 取消回调 */
|
|
53
53
|
onCancel?: () => void;
|
|
54
54
|
}) => string;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { t } from "../../../../common/i18n/index.js";
|
|
2
|
+
import "../../i18n/index.js";
|
|
3
|
+
import { Button } from "../Button/Button.js";
|
|
4
|
+
import { AsynchronousButton } from "../Button/SubmitButton.js";
|
|
5
|
+
import "../Button/index.js";
|
|
6
|
+
import { Modal } from "./Modal.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { createRoot } from "react-dom/client";
|
|
9
|
+
//#region packages/react/ui/components/Modal/ModalManager.tsx
|
|
10
|
+
var ModalManagerClass = class {
|
|
11
|
+
modals = /* @__PURE__ */ new Map();
|
|
12
|
+
listeners = /* @__PURE__ */ new Set();
|
|
13
|
+
container = null;
|
|
14
|
+
root = null;
|
|
15
|
+
init() {
|
|
16
|
+
if (typeof document === "undefined" || this.container) return;
|
|
17
|
+
this.container = document.createElement("div");
|
|
18
|
+
this.container.id = "modal-container";
|
|
19
|
+
document.body.appendChild(this.container);
|
|
20
|
+
this.root = createRoot(this.container);
|
|
21
|
+
this.render();
|
|
22
|
+
}
|
|
23
|
+
notify() {
|
|
24
|
+
this.listeners.forEach((listener) => listener());
|
|
25
|
+
this.render();
|
|
26
|
+
}
|
|
27
|
+
subscribe(listener) {
|
|
28
|
+
this.listeners.add(listener);
|
|
29
|
+
return () => {
|
|
30
|
+
this.listeners.delete(listener);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
open(config) {
|
|
34
|
+
this.init();
|
|
35
|
+
const id = `modal-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
36
|
+
const modalConfig = {
|
|
37
|
+
...config,
|
|
38
|
+
id,
|
|
39
|
+
onClose: () => {
|
|
40
|
+
config.onClose?.();
|
|
41
|
+
this.close(id);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
this.modals.set(id, modalConfig);
|
|
45
|
+
this.notify();
|
|
46
|
+
return id;
|
|
47
|
+
}
|
|
48
|
+
close(id) {
|
|
49
|
+
this.modals.delete(id);
|
|
50
|
+
this.notify();
|
|
51
|
+
}
|
|
52
|
+
closeAll() {
|
|
53
|
+
this.modals.clear();
|
|
54
|
+
this.notify();
|
|
55
|
+
}
|
|
56
|
+
getModals() {
|
|
57
|
+
return Array.from(this.modals.values());
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
if (!this.root) return;
|
|
61
|
+
const modals = this.getModals();
|
|
62
|
+
this.root.render(/* @__PURE__ */ jsx(Fragment, { children: modals.map((modal) => /* @__PURE__ */ jsx(Modal, {
|
|
63
|
+
...modal,
|
|
64
|
+
open: true,
|
|
65
|
+
children: modal.content
|
|
66
|
+
}, modal.id)) }));
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var openConfirmModal = (pConfig) => {
|
|
70
|
+
const { onOk, onCancel, okText = t("components.modal.okText"), cancelText = t("components.modal.cancelText"), ...props } = pConfig;
|
|
71
|
+
const config = {
|
|
72
|
+
title: t("components.modal.confirmTitle"),
|
|
73
|
+
footer: /* @__PURE__ */ jsxs("div", {
|
|
74
|
+
className: "flex justify-end gap-3",
|
|
75
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
76
|
+
onClick: () => {
|
|
77
|
+
onCancel?.();
|
|
78
|
+
modalManager.close(currentModalId);
|
|
79
|
+
},
|
|
80
|
+
className: "min-w-[100px] bg-background border-[hsl(var(--theme-primary))] text-[hsl(var(--theme-primary))] hover:bg-[hsl(var(--theme-primary))]/5",
|
|
81
|
+
children: cancelText
|
|
82
|
+
}), /* @__PURE__ */ jsx(AsynchronousButton, {
|
|
83
|
+
variant: "primary",
|
|
84
|
+
onClick: async (e) => {
|
|
85
|
+
const result = await onOk?.(e);
|
|
86
|
+
if (typeof result === "boolean" && !result) return;
|
|
87
|
+
modalManager.close(currentModalId);
|
|
88
|
+
},
|
|
89
|
+
className: "min-w-[100px] bg-[hsl(var(--theme-primary))] hover:bg-[hsl(var(--theme-primary))]/90 border-[hsl(var(--theme-primary))] text-[hsl(var(--theme-primary-foreground))]",
|
|
90
|
+
children: okText
|
|
91
|
+
})]
|
|
92
|
+
}),
|
|
93
|
+
...props
|
|
94
|
+
};
|
|
95
|
+
const currentModalId = modalManager.open(config);
|
|
96
|
+
return currentModalId;
|
|
97
|
+
};
|
|
98
|
+
var modalManager = new ModalManagerClass();
|
|
99
|
+
var modal = {
|
|
100
|
+
open: (config) => modalManager.open(config),
|
|
101
|
+
confirm: openConfirmModal,
|
|
102
|
+
close: (id) => modalManager.close(id),
|
|
103
|
+
closeAll: () => modalManager.closeAll()
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { modal, modalManager, openConfirmModal };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type NotificationProps = {
|
|
4
|
+
type?: NotificationType;
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
message?: ReactNode;
|
|
7
|
+
duration?: number;
|
|
8
|
+
closable?: boolean;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const Notification: import("react").ForwardRefExoticComponent<NotificationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Notification };
|
|
14
|
+
//# sourceMappingURL=Notification.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { forwardRef, useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
//#region packages/react/ui/components/Notification/Notification.tsx
|
|
6
|
+
var typeStyles = {
|
|
7
|
+
info: "text-chart-3",
|
|
8
|
+
success: "text-chart-4",
|
|
9
|
+
warning: "text-chart-5",
|
|
10
|
+
error: "text-destructive"
|
|
11
|
+
};
|
|
12
|
+
var Notification = forwardRef(({ type = "info", title, message, duration, closable = true, onClose, className }, ref) => {
|
|
13
|
+
const [visible, setVisible] = useState(true);
|
|
14
|
+
const handleClose = useCallback(() => {
|
|
15
|
+
setVisible(false);
|
|
16
|
+
onClose?.();
|
|
17
|
+
}, [onClose]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (duration && duration > 0) {
|
|
20
|
+
const timer = setTimeout(handleClose, duration);
|
|
21
|
+
return () => clearTimeout(timer);
|
|
22
|
+
}
|
|
23
|
+
}, [duration, handleClose]);
|
|
24
|
+
if (!visible) return null;
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
26
|
+
ref,
|
|
27
|
+
role: "alert",
|
|
28
|
+
className: cn("tc-ui-notification flex items-start gap-3 rounded-xl border border-border/60 bg-popover p-4 text-popover-foreground shadow-[var(--shadow-floating)]", className),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: cn("mt-1 h-2 w-2 shrink-0 rounded-full bg-current", typeStyles[type]),
|
|
32
|
+
"aria-hidden": "true"
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsxs("div", {
|
|
35
|
+
className: "flex-1 min-w-0",
|
|
36
|
+
children: [title && /* @__PURE__ */ jsx("div", {
|
|
37
|
+
className: "font-medium text-sm text-popover-foreground",
|
|
38
|
+
children: title
|
|
39
|
+
}), message && /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "text-sm text-muted-foreground mt-1",
|
|
41
|
+
children: message
|
|
42
|
+
})]
|
|
43
|
+
}),
|
|
44
|
+
closable && /* @__PURE__ */ jsx("button", {
|
|
45
|
+
type: "button",
|
|
46
|
+
onClick: handleClose,
|
|
47
|
+
className: "shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-foreground/8 hover:text-popover-foreground active:bg-foreground/12 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme/30",
|
|
48
|
+
"aria-label": "Close notification",
|
|
49
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
Notification.displayName = "Notification";
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Notification };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
//#region packages/react/ui/components/Overlay/Overlay.tsx
|
|
6
|
+
var bodyScrollLockCount = 0;
|
|
7
|
+
var originalBodyOverflow = "";
|
|
8
|
+
var canUseDocument = () => typeof document !== "undefined";
|
|
9
|
+
var lockBodyScroll = () => {
|
|
10
|
+
if (!canUseDocument()) return () => {};
|
|
11
|
+
if (bodyScrollLockCount === 0) {
|
|
12
|
+
originalBodyOverflow = document.body.style.overflow;
|
|
13
|
+
document.body.style.overflow = "hidden";
|
|
14
|
+
}
|
|
15
|
+
bodyScrollLockCount += 1;
|
|
16
|
+
return () => {
|
|
17
|
+
bodyScrollLockCount = Math.max(0, bodyScrollLockCount - 1);
|
|
18
|
+
if (bodyScrollLockCount === 0) {
|
|
19
|
+
document.body.style.overflow = originalBodyOverflow;
|
|
20
|
+
originalBodyOverflow = "";
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
function Overlay({ open = false, visible = open, children, className, style, zIndex = 1e3, mask = true, maskClosable = true, lockScroll = true, keyboard = true, closable = true, onClose, onClick, renderNode }) {
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!open || !keyboard || !canUseDocument()) return;
|
|
27
|
+
const handleEscape = (e) => {
|
|
28
|
+
if (e.key === "Escape" && closable) onClose?.();
|
|
29
|
+
};
|
|
30
|
+
document.addEventListener("keydown", handleEscape);
|
|
31
|
+
return () => {
|
|
32
|
+
document.removeEventListener("keydown", handleEscape);
|
|
33
|
+
};
|
|
34
|
+
}, [
|
|
35
|
+
open,
|
|
36
|
+
closable,
|
|
37
|
+
onClose,
|
|
38
|
+
keyboard
|
|
39
|
+
]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!open || !lockScroll) return;
|
|
42
|
+
return lockBodyScroll();
|
|
43
|
+
}, [lockScroll, open]);
|
|
44
|
+
const handleMaskClick = (e) => {
|
|
45
|
+
onClick?.(e);
|
|
46
|
+
if (maskClosable && e.target === e.currentTarget) onClose?.();
|
|
47
|
+
};
|
|
48
|
+
if (!open || !canUseDocument()) return null;
|
|
49
|
+
const parent = typeof renderNode === "function" ? renderNode() : renderNode ?? document.body;
|
|
50
|
+
return createPortal(/* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: cn("tc-ui-overlay fixed inset-0 z-[1000]", mask && "bg-black/50 backdrop-blur-sm", "transition-opacity duration-200", visible ? "opacity-100" : "opacity-0", className),
|
|
52
|
+
style: {
|
|
53
|
+
zIndex,
|
|
54
|
+
...style
|
|
55
|
+
},
|
|
56
|
+
onClick: handleMaskClick,
|
|
57
|
+
children
|
|
58
|
+
}), parent);
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { Overlay, canUseDocument };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { Button } from "../Button/Button.js";
|
|
3
|
+
import "../Button/index.js";
|
|
4
|
+
import { Select } from "../Select/Select.js";
|
|
5
|
+
import "../Select/index.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
8
|
+
//#region packages/react/ui/components/Pagination/Pagination.tsx
|
|
9
|
+
function Pagination({ current, pageSize, total, onChange, onPageSizeChange, pageSizeOptions = [
|
|
10
|
+
10,
|
|
11
|
+
20,
|
|
12
|
+
50,
|
|
13
|
+
100
|
|
14
|
+
], className }) {
|
|
15
|
+
const totalPages = Math.ceil(total / pageSize);
|
|
16
|
+
const releaseFocus = (event) => {
|
|
17
|
+
event.currentTarget.blur();
|
|
18
|
+
};
|
|
19
|
+
const getPageNumbers = () => {
|
|
20
|
+
const pages = [];
|
|
21
|
+
if (totalPages <= 7) for (let i = 1; i <= totalPages; i++) pages.push(i);
|
|
22
|
+
else if (current <= 4) {
|
|
23
|
+
for (let i = 1; i <= 5; i++) pages.push(i);
|
|
24
|
+
pages.push("...");
|
|
25
|
+
pages.push(totalPages);
|
|
26
|
+
} else if (current >= totalPages - 3) {
|
|
27
|
+
pages.push(1);
|
|
28
|
+
pages.push("...");
|
|
29
|
+
for (let i = totalPages - 4; i <= totalPages; i++) pages.push(i);
|
|
30
|
+
} else {
|
|
31
|
+
pages.push(1);
|
|
32
|
+
pages.push("...");
|
|
33
|
+
for (let i = current - 1; i <= current + 1; i++) pages.push(i);
|
|
34
|
+
pages.push("...");
|
|
35
|
+
pages.push(totalPages);
|
|
36
|
+
}
|
|
37
|
+
return pages;
|
|
38
|
+
};
|
|
39
|
+
const handlePrevious = (event) => {
|
|
40
|
+
releaseFocus(event);
|
|
41
|
+
if (current > 1) onChange(current - 1);
|
|
42
|
+
};
|
|
43
|
+
const handleNext = (event) => {
|
|
44
|
+
releaseFocus(event);
|
|
45
|
+
if (current < totalPages) onChange(current + 1);
|
|
46
|
+
};
|
|
47
|
+
const handlePageClick = (page, event) => {
|
|
48
|
+
releaseFocus(event);
|
|
49
|
+
if (typeof page === "number" && page !== current) onChange(page);
|
|
50
|
+
};
|
|
51
|
+
const handlePageSizeChange = (newPageSize) => {
|
|
52
|
+
if (newPageSize !== void 0 && typeof newPageSize === "number" && newPageSize !== pageSize && onPageSizeChange) {
|
|
53
|
+
onPageSizeChange(newPageSize);
|
|
54
|
+
if (current !== 1) onChange(1);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
if (totalPages === 0) return null;
|
|
58
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
59
|
+
className: cn("tc-ui-pagination flex items-center gap-4", className),
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: "text-sm text-muted-foreground",
|
|
63
|
+
children: ["Total ", total]
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", {
|
|
66
|
+
className: "flex flex-1 items-center justify-center gap-1.5",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Button, {
|
|
69
|
+
onClick: handlePrevious,
|
|
70
|
+
disabled: current === 1,
|
|
71
|
+
size: "sm",
|
|
72
|
+
className: cn("inline-flex items-center justify-center", "h-8 w-8 rounded-md px-0", "text-sm font-medium", "border border-border/70 bg-background", "transition-colors duration-150", "focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-0", current === 1 ? "cursor-not-allowed text-muted-foreground/45" : "cursor-pointer text-muted-foreground hover:bg-foreground/8 hover:text-foreground"),
|
|
73
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
|
|
74
|
+
}),
|
|
75
|
+
getPageNumbers().map((page, index) => {
|
|
76
|
+
if (page === "...") return /* @__PURE__ */ jsx("span", {
|
|
77
|
+
className: "px-2 text-muted-foreground",
|
|
78
|
+
children: "..."
|
|
79
|
+
}, `ellipsis-${index}`);
|
|
80
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
81
|
+
onClick: (event) => handlePageClick(page, event),
|
|
82
|
+
size: "sm",
|
|
83
|
+
"aria-current": page === current ? "page" : void 0,
|
|
84
|
+
className: cn("inline-flex items-center justify-center", "h-8 min-w-8 rounded-md px-2.5", "text-sm font-medium", "border transition-colors duration-150", "focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-0", page === current ? "border-theme/45 bg-theme/12 text-foreground cursor-default" : "bg-background border-border/70 text-muted-foreground hover:bg-foreground/8 hover:text-foreground cursor-pointer"),
|
|
85
|
+
children: page
|
|
86
|
+
}, page);
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ jsx(Button, {
|
|
89
|
+
onClick: handleNext,
|
|
90
|
+
size: "sm",
|
|
91
|
+
disabled: current === totalPages,
|
|
92
|
+
className: cn("inline-flex items-center justify-center", "h-8 w-8 rounded-md px-0", "text-sm font-medium", "border border-border/70 bg-background", "transition-colors duration-150", "focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-0", current === totalPages ? "cursor-not-allowed text-muted-foreground/45" : "cursor-pointer text-muted-foreground hover:bg-foreground/8 hover:text-foreground"),
|
|
93
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
onPageSizeChange && /* @__PURE__ */ jsx("div", {
|
|
98
|
+
className: "flex items-center gap-2",
|
|
99
|
+
children: /* @__PURE__ */ jsx(Select, {
|
|
100
|
+
value: pageSize,
|
|
101
|
+
onChange: handlePageSizeChange,
|
|
102
|
+
options: pageSizeOptions.map((size) => ({
|
|
103
|
+
label: `${size}`,
|
|
104
|
+
value: size
|
|
105
|
+
})),
|
|
106
|
+
className: "w-20 [&>div]:bg-muted [&>div]:border-border [&>div]:shadow-sm [&>div]:py-2 [&>div]:px-3 [&>div]:h-8",
|
|
107
|
+
clearable: false,
|
|
108
|
+
searchable: false
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { Pagination };
|