@_tc/template-core 0.0.1-bate.46 → 0.0.1-bate.47
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 +1610 -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/buildFB.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 +16 -14
- 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/buildFB.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/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/buildFB.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 +59 -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
|
@@ -1,33 +1,40 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LeftMenuType, TopMenuType } from "./menuType";
|
|
2
2
|
type MTopMenuType = {
|
|
3
3
|
/**
|
|
4
4
|
* 默认为 left
|
|
5
5
|
*/
|
|
6
|
-
menuLayout:
|
|
6
|
+
menuLayout: 'top';
|
|
7
7
|
menu: TopMenuType[];
|
|
8
8
|
};
|
|
9
9
|
type MLeftMenuType = {
|
|
10
10
|
/**
|
|
11
11
|
* 默认为 left
|
|
12
12
|
*/
|
|
13
|
-
menuLayout?:
|
|
13
|
+
menuLayout?: 'left';
|
|
14
14
|
menu: LeftMenuType[];
|
|
15
15
|
};
|
|
16
|
-
export type
|
|
17
|
-
export
|
|
16
|
+
export type MBMenuType = MTopMenuType | MLeftMenuType;
|
|
17
|
+
export interface ModelModeMap {
|
|
18
|
+
MB: MBMenuType;
|
|
19
|
+
}
|
|
20
|
+
export type ModelMode = Extract<keyof ModelModeMap, string>;
|
|
21
|
+
type ModelBaseDataType<M extends ModelMode> = {
|
|
18
22
|
/**
|
|
19
23
|
* - 使用哪一块的模型数据 内置 MB
|
|
20
24
|
* - MB = 管理后台
|
|
21
25
|
*/
|
|
22
|
-
mode:
|
|
26
|
+
mode: M;
|
|
23
27
|
key?: string;
|
|
24
|
-
name
|
|
25
|
-
desc
|
|
26
|
-
icon
|
|
28
|
+
name?: string;
|
|
29
|
+
desc?: string;
|
|
30
|
+
icon?: string;
|
|
27
31
|
/**
|
|
28
|
-
* 首页(项目配置)
|
|
32
|
+
* 首页(项目配置) 不配置 会自动找寻第一个可用路由地址
|
|
29
33
|
*/
|
|
30
|
-
homePage
|
|
31
|
-
}
|
|
34
|
+
homePage?: string;
|
|
35
|
+
};
|
|
36
|
+
export type ModelDataType<M extends ModelMode = ModelMode> = {
|
|
37
|
+
[K in M]: ModelBaseDataType<K> & ModelModeMap[K];
|
|
38
|
+
}[M];
|
|
32
39
|
export {};
|
|
33
40
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1,47 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.data.delete(k);
|
|
45
|
-
this.data.set(k, v);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
//#region packages/common/cache/LRUCache.ts
|
|
2
|
+
var LRUCache = class {
|
|
3
|
+
limit;
|
|
4
|
+
data;
|
|
5
|
+
constructor(limit) {
|
|
6
|
+
if (!Number.isInteger(limit) || limit <= 0) throw new Error("LRUCache limit must be a positive integer");
|
|
7
|
+
this.limit = limit;
|
|
8
|
+
this.data = /* @__PURE__ */ new Map();
|
|
9
|
+
}
|
|
10
|
+
get size() {
|
|
11
|
+
return this.data.size;
|
|
12
|
+
}
|
|
13
|
+
has(k) {
|
|
14
|
+
return this.data.has(k);
|
|
15
|
+
}
|
|
16
|
+
get(k) {
|
|
17
|
+
if (!this.data.has(k)) return void 0;
|
|
18
|
+
const value = this.data.get(k);
|
|
19
|
+
this.updateSorting(k, value);
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
set(k, v) {
|
|
23
|
+
if (this.data.has(k)) {
|
|
24
|
+
this.updateSorting(k, v);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (this.data.size >= this.limit) this.deleteFirstKey();
|
|
28
|
+
this.data.set(k, v);
|
|
29
|
+
}
|
|
30
|
+
push(k, v) {
|
|
31
|
+
this.set(k, v);
|
|
32
|
+
}
|
|
33
|
+
deleteFirstKey() {
|
|
34
|
+
const firstKey = this.data.keys().next().value;
|
|
35
|
+
if (firstKey !== void 0) this.data.delete(firstKey);
|
|
36
|
+
}
|
|
37
|
+
updateSorting(k, v) {
|
|
38
|
+
this.data.delete(k);
|
|
39
|
+
this.data.set(k, v);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { LRUCache };
|
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
export const isNumber = (value) => {
|
|
11
|
-
return typeof value === "number" && Number.isFinite(value);
|
|
12
|
-
};
|
|
13
|
-
export const isBoolean = (value) => {
|
|
14
|
-
return typeof value === "boolean";
|
|
15
|
-
};
|
|
16
|
-
export const isFunction = (value) => {
|
|
17
|
-
return typeof value === "function";
|
|
18
|
-
};
|
|
19
|
-
export const isPlainObject = (value) => {
|
|
20
|
-
if (value === null || typeof value !== "object")
|
|
21
|
-
return false;
|
|
22
|
-
const prototype = Object.getPrototypeOf(value);
|
|
23
|
-
return prototype === Object.prototype || prototype === null;
|
|
24
|
-
};
|
|
1
|
+
//#region packages/common/guards/index.ts
|
|
2
|
+
var isPlainObject = (value) => {
|
|
3
|
+
if (value === null || typeof value !== "object") return false;
|
|
4
|
+
const prototype = Object.getPrototypeOf(value);
|
|
5
|
+
return prototype === Object.prototype || prototype === null;
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { isPlainObject };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
2
|
+
export type HttpHeaders = Record<string, string>;
|
|
3
|
+
export type RequestCredentials = 'omit' | 'same-origin' | 'include';
|
|
4
|
+
export type RequestCache = 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
|
|
5
|
+
export type RequestRedirect = 'error' | 'follow' | 'manual';
|
|
6
|
+
export type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
7
|
+
export interface HeadersLike {
|
|
8
|
+
forEach(callback: (value: string, key: string) => void): void;
|
|
9
|
+
has(name: string): boolean;
|
|
10
|
+
set(name: string, value: string): void;
|
|
11
|
+
}
|
|
12
|
+
export interface ProgressEventLike {
|
|
13
|
+
loaded?: number;
|
|
14
|
+
total?: number;
|
|
15
|
+
lengthComputable?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type RequestBodyLike = string | ArrayBuffer | ArrayBufferView | object;
|
|
18
|
+
export interface RequestConfig<D = unknown> {
|
|
19
|
+
url?: string;
|
|
20
|
+
method?: HttpMethod;
|
|
21
|
+
baseURL?: string;
|
|
22
|
+
headers?: HttpHeaders;
|
|
23
|
+
params?: Record<string, string | number | boolean | undefined | null>;
|
|
24
|
+
data?: D;
|
|
25
|
+
timeout?: number;
|
|
26
|
+
signal?: unknown;
|
|
27
|
+
credentials?: RequestCredentials;
|
|
28
|
+
cache?: RequestCache;
|
|
29
|
+
redirect?: RequestRedirect;
|
|
30
|
+
referrer?: string;
|
|
31
|
+
referrerPolicy?: ReferrerPolicy;
|
|
32
|
+
transformRequest?: ((data: D, headers: HeadersLike) => D | RequestBodyLike) | ((data: D, headers: HeadersLike) => D | RequestBodyLike)[];
|
|
33
|
+
transformResponse?: ((data: unknown) => unknown) | ((data: unknown) => unknown)[];
|
|
34
|
+
validateStatus?: (status: number) => boolean;
|
|
35
|
+
onUploadProgress?: (progress: ProgressEventLike) => void;
|
|
36
|
+
onDownloadProgress?: (progress: ProgressEventLike) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface ResponseConfig<T = unknown, D = unknown> {
|
|
39
|
+
data: T;
|
|
40
|
+
status: number;
|
|
41
|
+
statusText: string;
|
|
42
|
+
headers: HttpHeaders;
|
|
43
|
+
config: RequestConfig<D>;
|
|
44
|
+
request?: unknown;
|
|
45
|
+
}
|
|
46
|
+
export interface AxiosError<T = unknown, D = unknown> extends Error {
|
|
47
|
+
config: RequestConfig<D>;
|
|
48
|
+
code?: string;
|
|
49
|
+
request?: unknown;
|
|
50
|
+
response?: ResponseConfig<T, D>;
|
|
51
|
+
isAxiosError: boolean;
|
|
52
|
+
}
|
|
53
|
+
interface InterceptorHandler<V> {
|
|
54
|
+
fulfilled?: (value: V) => V | Promise<V>;
|
|
55
|
+
rejected?: (error: unknown) => unknown;
|
|
56
|
+
id: number;
|
|
57
|
+
}
|
|
58
|
+
declare class InterceptorManager<V> {
|
|
59
|
+
private handlers;
|
|
60
|
+
private nextId;
|
|
61
|
+
use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: (error: unknown) => unknown): number;
|
|
62
|
+
eject(id: number): void;
|
|
63
|
+
clear(): void;
|
|
64
|
+
getHandlers(): InterceptorHandler<V>[];
|
|
65
|
+
}
|
|
66
|
+
export declare class FetchAxios {
|
|
67
|
+
defaults: RequestConfig;
|
|
68
|
+
interceptors: {
|
|
69
|
+
request: InterceptorManager<RequestConfig<unknown>>;
|
|
70
|
+
response: InterceptorManager<ResponseConfig<unknown, unknown>>;
|
|
71
|
+
};
|
|
72
|
+
constructor(config?: RequestConfig);
|
|
73
|
+
private request;
|
|
74
|
+
private applyRequestInterceptors;
|
|
75
|
+
private applyResponseInterceptors;
|
|
76
|
+
private applyResponseErrorInterceptors;
|
|
77
|
+
private _doRequest;
|
|
78
|
+
private createError;
|
|
79
|
+
get<T = unknown, D = unknown>(url: string, config?: RequestConfig<D>): Promise<ResponseConfig<T, D>>;
|
|
80
|
+
post<T = unknown, D = unknown>(url: string, data?: D, config?: RequestConfig<D>): Promise<ResponseConfig<T, D>>;
|
|
81
|
+
put<T = unknown, D = unknown>(url: string, data?: D, config?: RequestConfig<D>): Promise<ResponseConfig<T, D>>;
|
|
82
|
+
patch<T = unknown, D = unknown>(url: string, data?: D, config?: RequestConfig<D>): Promise<ResponseConfig<T, D>>;
|
|
83
|
+
delete<T = unknown, D = unknown>(url: string, config?: RequestConfig<D>): Promise<ResponseConfig<T, D>>;
|
|
84
|
+
head<T = unknown, D = unknown>(url: string, config?: RequestConfig<D>): Promise<ResponseConfig<T, D>>;
|
|
85
|
+
options<T = unknown, D = unknown>(url: string, config?: RequestConfig<D>): Promise<ResponseConfig<T, D>>;
|
|
86
|
+
}
|
|
87
|
+
export declare const axios: FetchAxios;
|
|
88
|
+
export declare const createInstance: (defaultConfig: RequestConfig) => FetchAxios;
|
|
89
|
+
export default FetchAxios;
|
|
90
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
//#region packages/common/http/index.ts
|
|
2
|
+
var getGlobalValue = (key) => {
|
|
3
|
+
return globalThis[key];
|
|
4
|
+
};
|
|
5
|
+
var getTimerGlobal = () => {
|
|
6
|
+
return globalThis;
|
|
7
|
+
};
|
|
8
|
+
var FallbackHeaders = class {
|
|
9
|
+
headers = /* @__PURE__ */ new Map();
|
|
10
|
+
constructor(init = {}) {
|
|
11
|
+
Object.entries(init).forEach(([key, value]) => {
|
|
12
|
+
this.set(key, value);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
forEach(callback) {
|
|
16
|
+
this.headers.forEach((value, key) => {
|
|
17
|
+
callback(value, key);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
has(name) {
|
|
21
|
+
return this.headers.has(this.normalizeName(name));
|
|
22
|
+
}
|
|
23
|
+
set(name, value) {
|
|
24
|
+
this.headers.set(this.normalizeName(name), value);
|
|
25
|
+
}
|
|
26
|
+
toRecord() {
|
|
27
|
+
return Object.fromEntries(this.headers);
|
|
28
|
+
}
|
|
29
|
+
normalizeName(name) {
|
|
30
|
+
return name.toLowerCase();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var InterceptorManager = class {
|
|
34
|
+
handlers = [];
|
|
35
|
+
nextId = 0;
|
|
36
|
+
use(onFulfilled, onRejected) {
|
|
37
|
+
const id = this.nextId++;
|
|
38
|
+
this.handlers.push({
|
|
39
|
+
id,
|
|
40
|
+
fulfilled: onFulfilled,
|
|
41
|
+
rejected: onRejected
|
|
42
|
+
});
|
|
43
|
+
return id;
|
|
44
|
+
}
|
|
45
|
+
eject(id) {
|
|
46
|
+
const idx = this.handlers.findIndex((handler) => handler.id === id);
|
|
47
|
+
if (idx !== -1) this.handlers.splice(idx, 1);
|
|
48
|
+
}
|
|
49
|
+
clear() {
|
|
50
|
+
this.handlers = [];
|
|
51
|
+
}
|
|
52
|
+
getHandlers() {
|
|
53
|
+
return [...this.handlers];
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
function createHeaders(headers) {
|
|
57
|
+
const HeadersRef = getGlobalValue("Headers");
|
|
58
|
+
if (HeadersRef) return new HeadersRef(headers);
|
|
59
|
+
return new FallbackHeaders(headers);
|
|
60
|
+
}
|
|
61
|
+
function toFetchHeaders(headers) {
|
|
62
|
+
return headers instanceof FallbackHeaders ? headers.toRecord() : headers;
|
|
63
|
+
}
|
|
64
|
+
function serializeParams(params) {
|
|
65
|
+
const URLSearchParamsRef = getGlobalValue("URLSearchParams");
|
|
66
|
+
if (URLSearchParamsRef) {
|
|
67
|
+
const searchParams = new URLSearchParamsRef();
|
|
68
|
+
for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== null) searchParams.append(key, String(value));
|
|
69
|
+
return searchParams.toString();
|
|
70
|
+
}
|
|
71
|
+
return Object.entries(params).filter((entry) => entry[1] !== void 0 && entry[1] !== null).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`).join("&");
|
|
72
|
+
}
|
|
73
|
+
function buildURL(url, baseURL, params) {
|
|
74
|
+
let fullUrl = baseURL ? `${baseURL.replace(/\/+$/, "")}/${url.replace(/^\/+/, "")}` : url;
|
|
75
|
+
if (params) {
|
|
76
|
+
const query = serializeParams(params);
|
|
77
|
+
if (query) fullUrl += (fullUrl.includes("?") ? "&" : "?") + query;
|
|
78
|
+
}
|
|
79
|
+
return fullUrl;
|
|
80
|
+
}
|
|
81
|
+
function parseHeaders(rawHeaders) {
|
|
82
|
+
const headers = {};
|
|
83
|
+
rawHeaders.forEach((value, key) => {
|
|
84
|
+
headers[key] = value;
|
|
85
|
+
});
|
|
86
|
+
return headers;
|
|
87
|
+
}
|
|
88
|
+
function mergeConfig(primary, secondary) {
|
|
89
|
+
return {
|
|
90
|
+
...secondary,
|
|
91
|
+
...primary,
|
|
92
|
+
headers: {
|
|
93
|
+
...secondary?.headers,
|
|
94
|
+
...primary.headers
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function isObject(value) {
|
|
99
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
100
|
+
}
|
|
101
|
+
function isRuntimeInstance(value, ctorName) {
|
|
102
|
+
const RuntimeCtor = getGlobalValue(ctorName);
|
|
103
|
+
return typeof RuntimeCtor === "function" && value instanceof RuntimeCtor;
|
|
104
|
+
}
|
|
105
|
+
function isBodyLike(value) {
|
|
106
|
+
if (typeof value === "string") return true;
|
|
107
|
+
if (value instanceof ArrayBuffer) return true;
|
|
108
|
+
if (ArrayBuffer.isView(value)) return true;
|
|
109
|
+
return isRuntimeInstance(value, "Blob") || isRuntimeInstance(value, "FormData") || isRuntimeInstance(value, "URLSearchParams") || isRuntimeInstance(value, "ReadableStream");
|
|
110
|
+
}
|
|
111
|
+
function applyTransformers(value, transformers) {
|
|
112
|
+
if (!transformers?.length) return value;
|
|
113
|
+
return transformers.reduce((acc, fn) => fn(acc), value);
|
|
114
|
+
}
|
|
115
|
+
function applyRequestTransformers(value, headers, transformers) {
|
|
116
|
+
if (!transformers) return value;
|
|
117
|
+
return (Array.isArray(transformers) ? transformers : [transformers]).reduce((acc, fn) => fn(acc, headers), value);
|
|
118
|
+
}
|
|
119
|
+
function getFetch() {
|
|
120
|
+
const fetchRef = getGlobalValue("fetch");
|
|
121
|
+
if (!fetchRef) throw new Error("FetchAxios requires globalThis.fetch. Use Node.js 18+ or provide a fetch polyfill.");
|
|
122
|
+
return fetchRef;
|
|
123
|
+
}
|
|
124
|
+
function createAbortController() {
|
|
125
|
+
const AbortControllerRef = getGlobalValue("AbortController");
|
|
126
|
+
if (!AbortControllerRef) return void 0;
|
|
127
|
+
return new AbortControllerRef();
|
|
128
|
+
}
|
|
129
|
+
var FetchAxios = class {
|
|
130
|
+
defaults;
|
|
131
|
+
interceptors = {
|
|
132
|
+
request: new InterceptorManager(),
|
|
133
|
+
response: new InterceptorManager()
|
|
134
|
+
};
|
|
135
|
+
constructor(config = {}) {
|
|
136
|
+
this.defaults = config;
|
|
137
|
+
}
|
|
138
|
+
async request(config) {
|
|
139
|
+
const merged = mergeConfig(this.defaults, config);
|
|
140
|
+
try {
|
|
141
|
+
const currentConfig = await this.applyRequestInterceptors(merged);
|
|
142
|
+
const response = await this._doRequest(currentConfig);
|
|
143
|
+
return this.applyResponseInterceptors(response);
|
|
144
|
+
} catch (err) {
|
|
145
|
+
return this.applyResponseErrorInterceptors(err);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
async applyRequestInterceptors(config) {
|
|
149
|
+
let currentConfig = config;
|
|
150
|
+
const handlers = this.interceptors.request.getHandlers().reverse();
|
|
151
|
+
for (const handler of handlers) {
|
|
152
|
+
if (!handler.fulfilled) continue;
|
|
153
|
+
try {
|
|
154
|
+
currentConfig = await handler.fulfilled(currentConfig);
|
|
155
|
+
} catch (err) {
|
|
156
|
+
if (!handler.rejected) throw err;
|
|
157
|
+
currentConfig = await handler.rejected(err);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return currentConfig;
|
|
161
|
+
}
|
|
162
|
+
async applyResponseInterceptors(response) {
|
|
163
|
+
let currentResponse = response;
|
|
164
|
+
for (const handler of this.interceptors.response.getHandlers()) {
|
|
165
|
+
if (!handler.fulfilled) continue;
|
|
166
|
+
currentResponse = await handler.fulfilled(currentResponse);
|
|
167
|
+
}
|
|
168
|
+
return currentResponse;
|
|
169
|
+
}
|
|
170
|
+
async applyResponseErrorInterceptors(error) {
|
|
171
|
+
let currentError = error;
|
|
172
|
+
for (const handler of this.interceptors.response.getHandlers()) {
|
|
173
|
+
if (!handler.rejected) continue;
|
|
174
|
+
try {
|
|
175
|
+
return await handler.rejected(currentError);
|
|
176
|
+
} catch (err) {
|
|
177
|
+
currentError = err;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
throw currentError;
|
|
181
|
+
}
|
|
182
|
+
async _doRequest(config) {
|
|
183
|
+
const { method = "GET", baseURL, headers: rawHeaders = {}, params, data, timeout, credentials, cache, redirect, referrer, referrerPolicy, transformRequest, transformResponse, validateStatus } = config;
|
|
184
|
+
const url = buildURL(config.url ?? "", baseURL, params);
|
|
185
|
+
const requestHeaders = createHeaders(rawHeaders);
|
|
186
|
+
let requestData = data;
|
|
187
|
+
if (transformRequest && (method === "POST" || method === "PUT" || method === "PATCH")) {
|
|
188
|
+
requestData = applyRequestTransformers(data, requestHeaders, transformRequest);
|
|
189
|
+
if ((isObject(requestData) || Array.isArray(requestData)) && !requestHeaders.has("Content-Type")) requestHeaders.set("Content-Type", "application/json");
|
|
190
|
+
}
|
|
191
|
+
const init = {
|
|
192
|
+
method,
|
|
193
|
+
headers: toFetchHeaders(requestHeaders),
|
|
194
|
+
credentials: credentials ?? "same-origin",
|
|
195
|
+
cache,
|
|
196
|
+
redirect,
|
|
197
|
+
referrer,
|
|
198
|
+
referrerPolicy
|
|
199
|
+
};
|
|
200
|
+
if (requestData !== void 0 && method !== "GET" && method !== "HEAD") init.body = isBodyLike(requestData) ? requestData : JSON.stringify(requestData);
|
|
201
|
+
const controller = config.signal ? void 0 : createAbortController();
|
|
202
|
+
init.signal = config.signal ?? controller?.signal;
|
|
203
|
+
let timeoutId;
|
|
204
|
+
if (timeout) {
|
|
205
|
+
if (!controller && !config.signal) throw this.createError(/* @__PURE__ */ new Error("FetchAxios timeout requires globalThis.AbortController."), "ERR_ABORT_CONTROLLER_UNAVAILABLE", config);
|
|
206
|
+
const timer = getTimerGlobal();
|
|
207
|
+
if (!timer.setTimeout || !timer.clearTimeout) throw this.createError(/* @__PURE__ */ new Error("FetchAxios timeout requires globalThis.setTimeout and globalThis.clearTimeout."), "ERR_TIMER_UNAVAILABLE", config);
|
|
208
|
+
timeoutId = timer.setTimeout(() => controller?.abort(), timeout);
|
|
209
|
+
}
|
|
210
|
+
let response;
|
|
211
|
+
try {
|
|
212
|
+
response = await getFetch()(url, init);
|
|
213
|
+
} catch (err) {
|
|
214
|
+
if (timeoutId) getTimerGlobal().clearTimeout?.(timeoutId);
|
|
215
|
+
throw this.createError(err instanceof Error ? err : new Error(String(err)), "ECONNABORTED", config);
|
|
216
|
+
}
|
|
217
|
+
if (timeoutId) getTimerGlobal().clearTimeout?.(timeoutId);
|
|
218
|
+
const responseHeaders = parseHeaders(response.headers);
|
|
219
|
+
const responseConfig = {
|
|
220
|
+
data: null,
|
|
221
|
+
status: response.status,
|
|
222
|
+
statusText: response.statusText,
|
|
223
|
+
headers: responseHeaders,
|
|
224
|
+
config
|
|
225
|
+
};
|
|
226
|
+
if (!validateStatus || validateStatus(response.status)) {
|
|
227
|
+
const rawData = await response.text();
|
|
228
|
+
const parsed = rawData ? JSON.parse(rawData) : null;
|
|
229
|
+
responseConfig.data = transformResponse ? applyTransformers(parsed, Array.isArray(transformResponse) ? transformResponse : [transformResponse]) : parsed;
|
|
230
|
+
return responseConfig;
|
|
231
|
+
}
|
|
232
|
+
const rawData = response.body ? await response.text() : null;
|
|
233
|
+
responseConfig.data = rawData ? JSON.parse(rawData) : null;
|
|
234
|
+
throw this.createError(/* @__PURE__ */ new Error(`Request failed with status ${response.status}`), void 0, config, responseConfig);
|
|
235
|
+
}
|
|
236
|
+
createError(message, code, config, response) {
|
|
237
|
+
const error = message;
|
|
238
|
+
error.config = config;
|
|
239
|
+
error.code = code;
|
|
240
|
+
error.response = response;
|
|
241
|
+
error.isAxiosError = true;
|
|
242
|
+
return error;
|
|
243
|
+
}
|
|
244
|
+
get(url, config) {
|
|
245
|
+
return this.request({
|
|
246
|
+
...config,
|
|
247
|
+
url,
|
|
248
|
+
method: "GET"
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
post(url, data, config) {
|
|
252
|
+
return this.request({
|
|
253
|
+
...config,
|
|
254
|
+
url,
|
|
255
|
+
method: "POST",
|
|
256
|
+
data
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
put(url, data, config) {
|
|
260
|
+
return this.request({
|
|
261
|
+
...config,
|
|
262
|
+
url,
|
|
263
|
+
method: "PUT",
|
|
264
|
+
data
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
patch(url, data, config) {
|
|
268
|
+
return this.request({
|
|
269
|
+
...config,
|
|
270
|
+
url,
|
|
271
|
+
method: "PATCH",
|
|
272
|
+
data
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
delete(url, config) {
|
|
276
|
+
return this.request({
|
|
277
|
+
...config,
|
|
278
|
+
url,
|
|
279
|
+
method: "DELETE"
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
head(url, config) {
|
|
283
|
+
return this.request({
|
|
284
|
+
...config,
|
|
285
|
+
url,
|
|
286
|
+
method: "HEAD"
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
options(url, config) {
|
|
290
|
+
return this.request({
|
|
291
|
+
...config,
|
|
292
|
+
url,
|
|
293
|
+
method: "OPTIONS"
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
var axios = new FetchAxios();
|
|
298
|
+
var createInstance = (defaultConfig) => new FetchAxios(defaultConfig);
|
|
299
|
+
//#endregion
|
|
300
|
+
export { axios, createInstance, FetchAxios as default };
|