@aithe/aithe-ui 26.2.3 → 26.3.1
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/README.md +16 -11
- package/dist/apps/admin/app.js +12 -0
- package/dist/apps/admin/components/admin-app.js +83 -0
- package/dist/apps/admin/components/admin-layout.d.ts +0 -1
- package/dist/apps/admin/components/admin-layout.d.ts.map +1 -1
- package/dist/apps/admin/components/admin-layout.js +250 -0
- package/dist/apps/admin/datahub/auth.js +24 -0
- package/dist/apps/admin/datahub/dashboard.js +16 -0
- package/dist/apps/admin/datahub/index.js +42 -0
- package/dist/apps/admin/datahub/menu.js +16 -0
- package/dist/apps/admin/datahub/mock/auth.js +11 -0
- package/dist/apps/admin/datahub/mock/dashboard.js +10 -0
- package/dist/apps/admin/datahub/mock/menu.js +42 -0
- package/dist/apps/admin/i18n/de-DE.js +37 -0
- package/dist/apps/admin/i18n/en-US.js +37 -0
- package/dist/apps/admin/i18n/es-ES.js +38 -0
- package/dist/apps/admin/i18n/fr-FR.js +37 -0
- package/dist/apps/admin/i18n/index.js +27 -0
- package/dist/apps/admin/i18n/ja-JP.js +38 -0
- package/dist/apps/admin/i18n/ko-KR.js +37 -0
- package/dist/apps/admin/i18n/pt-BR.js +37 -0
- package/dist/apps/admin/i18n/zh-CN.js +37 -0
- package/dist/apps/admin/i18n/zh-HK.js +37 -0
- package/dist/apps/admin/i18n/zh-TW.js +37 -0
- package/dist/apps/admin/pages/dashboard-page.d.ts +1 -0
- package/dist/apps/admin/pages/dashboard-page.d.ts.map +1 -1
- package/dist/apps/admin/pages/dashboard-page.js +199 -0
- package/dist/apps/admin/pages/login-page.js +278 -0
- package/dist/apps/admin/pages/not-found-page.js +57 -0
- package/dist/apps/admin/pages/role-page.js +76 -0
- package/dist/apps/admin/pages/settings-page.js +95 -0
- package/dist/apps/admin/pages/user-page.js +76 -0
- package/dist/apps/admin/router/index.js +43 -0
- package/dist/apps/admin/standalone.js +1 -0
- package/dist/apps/admin/store/auth.js +42 -0
- package/dist/apps/api/app.js +82 -0
- package/dist/apps/api/demo-data.d.ts.map +1 -1
- package/dist/apps/api/demo-data.js +965 -0
- package/dist/apps/api/docs-viewer.js +684 -0
- package/dist/apps/api/i18n/de-DE.d.ts.map +1 -1
- package/dist/apps/api/i18n/de-DE.js +130 -0
- package/dist/apps/api/i18n/en-US.d.ts.map +1 -1
- package/dist/apps/api/i18n/en-US.js +140 -0
- package/dist/apps/api/i18n/es-ES.d.ts.map +1 -1
- package/dist/apps/api/i18n/es-ES.js +130 -0
- package/dist/apps/api/i18n/fr-FR.d.ts.map +1 -1
- package/dist/apps/api/i18n/fr-FR.js +130 -0
- package/dist/apps/api/i18n/index.js +27 -0
- package/dist/apps/api/i18n/ja-JP.d.ts.map +1 -1
- package/dist/apps/api/i18n/ja-JP.js +130 -0
- package/dist/apps/api/i18n/ko-KR.d.ts.map +1 -1
- package/dist/apps/api/i18n/ko-KR.js +130 -0
- package/dist/apps/api/i18n/pt-BR.d.ts.map +1 -1
- package/dist/apps/api/i18n/pt-BR.js +130 -0
- package/dist/apps/api/i18n/zh-CN.d.ts.map +1 -1
- package/dist/apps/api/i18n/zh-CN.js +140 -0
- package/dist/apps/api/i18n/zh-HK.d.ts.map +1 -1
- package/dist/apps/api/i18n/zh-HK.js +130 -0
- package/dist/apps/api/i18n/zh-TW.d.ts.map +1 -1
- package/dist/apps/api/i18n/zh-TW.js +130 -0
- package/dist/apps/api/pages/docs.d.ts.map +1 -1
- package/dist/apps/api/pages/docs.js +367 -0
- package/dist/apps/api/standalone.js +1 -0
- package/dist/apps/demo/app.js +273 -0
- package/dist/apps/demo/editor.d.ts.map +1 -1
- package/dist/apps/demo/editor.js +270 -0
- package/dist/apps/demo/helpers.js +7 -0
- package/dist/apps/demo/i18n/de-DE.d.ts.map +1 -1
- package/dist/apps/demo/i18n/de-DE.js +269 -0
- package/dist/apps/demo/i18n/en-US.d.ts.map +1 -1
- package/dist/apps/demo/i18n/en-US.js +281 -0
- package/dist/apps/demo/i18n/es-ES.d.ts.map +1 -1
- package/dist/apps/demo/i18n/es-ES.js +269 -0
- package/dist/apps/demo/i18n/fr-FR.d.ts.map +1 -1
- package/dist/apps/demo/i18n/fr-FR.js +269 -0
- package/dist/apps/demo/i18n/index.js +27 -0
- package/dist/apps/demo/i18n/ja-JP.d.ts.map +1 -1
- package/dist/apps/demo/i18n/ja-JP.js +269 -0
- package/dist/apps/demo/i18n/ko-KR.d.ts.map +1 -1
- package/dist/apps/demo/i18n/ko-KR.js +269 -0
- package/dist/apps/demo/i18n/pt-BR.d.ts.map +1 -1
- package/dist/apps/demo/i18n/pt-BR.js +269 -0
- package/dist/apps/demo/i18n/zh-CN.d.ts.map +1 -1
- package/dist/apps/demo/i18n/zh-CN.js +281 -0
- package/dist/apps/demo/i18n/zh-HK.d.ts.map +1 -1
- package/dist/apps/demo/i18n/zh-HK.js +269 -0
- package/dist/apps/demo/i18n/zh-TW.d.ts.map +1 -1
- package/dist/apps/demo/i18n/zh-TW.js +269 -0
- package/dist/apps/demo/pages/autoform.js +412 -0
- package/dist/apps/demo/pages/basic.js +157 -0
- package/dist/apps/demo/pages/code.js +1088 -0
- package/dist/apps/demo/pages/container.js +42 -0
- package/dist/apps/demo/pages/dashboard.js +159 -0
- package/dist/apps/demo/pages/data.d.ts.map +1 -1
- package/dist/apps/demo/pages/data.js +327 -0
- package/dist/apps/demo/pages/display.d.ts.map +1 -1
- package/dist/apps/demo/pages/display.js +295 -0
- package/dist/apps/demo/pages/feedback.js +94 -0
- package/dist/apps/demo/pages/form.js +99 -0
- package/dist/apps/demo/pages/layout.js +74 -0
- package/dist/apps/demo/pages/navigation.js +54 -0
- package/dist/apps/demo/pages/progress.js +42 -0
- package/dist/apps/demo/pages/theme.js +126 -0
- package/dist/apps/demo/standalone.js +1 -0
- package/dist/components/basic/AGENTS.md +1 -0
- package/dist/components/basic/avatar.js +168 -0
- package/dist/components/basic/badge.js +157 -0
- package/dist/components/basic/button-group.js +70 -0
- package/dist/components/basic/button.d.ts +2 -4
- package/dist/components/basic/button.d.ts.map +1 -1
- package/dist/components/basic/button.js +315 -0
- package/dist/components/basic/card.js +186 -0
- package/dist/components/basic/chip.js +103 -0
- package/dist/components/basic/divider.js +127 -0
- package/dist/components/basic/empty.js +72 -0
- package/dist/components/basic/icon.js +129 -0
- package/dist/components/basic/input.d.ts.map +1 -1
- package/dist/components/basic/input.js +314 -0
- package/dist/components/basic/tag.d.ts +7 -2
- package/dist/components/basic/tag.d.ts.map +1 -1
- package/dist/components/basic/tag.js +248 -0
- package/dist/components/basic/textarea.d.ts +0 -1
- package/dist/components/basic/textarea.d.ts.map +1 -1
- package/dist/components/basic/textarea.js +130 -0
- package/dist/components/container/callout.js +108 -0
- package/dist/components/container/details.js +117 -0
- package/dist/components/container/scroller.js +144 -0
- package/dist/components/container/split-panel.js +150 -0
- package/dist/components/data/AGENTS.md +1 -1
- package/dist/components/data/box-table.d.ts +53 -0
- package/dist/components/data/box-table.d.ts.map +1 -0
- package/dist/components/data/box-table.js +220 -0
- package/dist/components/data/dropdown.d.ts +8 -5
- package/dist/components/data/dropdown.d.ts.map +1 -1
- package/dist/components/data/dropdown.js +219 -0
- package/dist/components/data/metrics-group.js +180 -0
- package/dist/components/data/metrics.d.ts +11 -0
- package/dist/components/data/metrics.d.ts.map +1 -1
- package/dist/components/data/metrics.js +309 -0
- package/dist/components/data/pagination.js +119 -0
- package/dist/components/data/tab-pane.d.ts +58 -12
- package/dist/components/data/tab-pane.d.ts.map +1 -1
- package/dist/components/data/tab-pane.js +130 -0
- package/dist/components/data/table-column.d.ts +29 -5
- package/dist/components/data/table-column.d.ts.map +1 -1
- package/dist/components/data/table-column.js +123 -0
- package/dist/components/data/table.d.ts +134 -54
- package/dist/components/data/table.d.ts.map +1 -1
- package/dist/components/data/table.js +1210 -0
- package/dist/components/data/tabs.d.ts +60 -3
- package/dist/components/data/tabs.d.ts.map +1 -1
- package/dist/components/data/tabs.js +416 -0
- package/dist/components/data/timeline-item.js +127 -0
- package/dist/components/data/timeline.js +204 -0
- package/dist/components/data/tree-menu.d.ts +12 -2
- package/dist/components/data/tree-menu.d.ts.map +1 -1
- package/dist/components/data/tree-menu.js +482 -0
- package/dist/components/data/tree.js +269 -0
- package/dist/components/display/AGENTS.md +5 -2
- package/dist/components/display/animated-image.js +98 -0
- package/dist/components/display/brief-box.d.ts +42 -0
- package/dist/components/display/brief-box.d.ts.map +1 -0
- package/dist/components/display/brief-box.js +117 -0
- package/dist/components/display/carousel.js +223 -0
- package/dist/components/display/code-editor.d.ts.map +1 -1
- package/dist/components/display/code-editor.js +976 -0
- package/dist/components/display/comparison.js +132 -0
- package/dist/components/display/desc-item.d.ts +48 -0
- package/dist/components/display/desc-item.d.ts.map +1 -0
- package/dist/components/display/desc-item.js +150 -0
- package/dist/components/display/desc.d.ts +64 -0
- package/dist/components/display/desc.d.ts.map +1 -0
- package/dist/components/display/desc.js +363 -0
- package/dist/components/display/detail-box.d.ts +51 -0
- package/dist/components/display/detail-box.d.ts.map +1 -0
- package/dist/components/display/detail-box.js +157 -0
- package/dist/components/display/label.js +166 -0
- package/dist/components/display/markdown-editor.js +319 -0
- package/dist/components/display/markdown.d.ts.map +1 -1
- package/dist/components/display/markdown.js +193 -0
- package/dist/components/display/mini-box.d.ts +31 -0
- package/dist/components/display/mini-box.d.ts.map +1 -0
- package/dist/components/display/mini-box.js +137 -0
- package/dist/components/display/profile.d.ts +18 -0
- package/dist/components/display/profile.d.ts.map +1 -0
- package/dist/components/display/profile.js +164 -0
- package/dist/components/feedback/AGENTS.md +1 -0
- package/dist/components/feedback/alert.js +150 -0
- package/dist/components/feedback/dialog.js +228 -0
- package/dist/components/feedback/drawer.d.ts.map +1 -1
- package/dist/components/feedback/drawer.js +338 -0
- package/dist/components/feedback/loading.js +130 -0
- package/dist/components/feedback/modal.d.ts.map +1 -1
- package/dist/components/feedback/modal.js +303 -0
- package/dist/components/feedback/notification.js +170 -0
- package/dist/components/feedback/popover.d.ts +1 -1
- package/dist/components/feedback/popover.js +124 -0
- package/dist/components/feedback/toast.js +142 -0
- package/dist/components/feedback/tooltip.d.ts +1 -1
- package/dist/components/feedback/tooltip.js +153 -0
- package/dist/components/form/AGENTS.md +4 -0
- package/dist/components/form/autoform-item.js +761 -0
- package/dist/components/form/autoform.d.ts +15 -5
- package/dist/components/form/autoform.d.ts.map +1 -1
- package/dist/components/form/autoform.js +303 -0
- package/dist/components/form/checkbox-group.js +118 -0
- package/dist/components/form/checkbox.js +123 -0
- package/dist/components/form/color-picker.js +148 -0
- package/dist/components/form/combobox.d.ts.map +1 -1
- package/dist/components/form/combobox.js +282 -0
- package/dist/components/form/date-picker.js +123 -0
- package/dist/components/form/form-item.d.ts.map +1 -1
- package/dist/components/form/form-item.js +141 -0
- package/dist/components/form/form.js +94 -0
- package/dist/components/form/radio-group.js +106 -0
- package/dist/components/form/radio.js +110 -0
- package/dist/components/form/rate.js +116 -0
- package/dist/components/form/select.d.ts +1 -1
- package/dist/components/form/select.js +495 -0
- package/dist/components/form/slider.js +134 -0
- package/dist/components/form/switch.js +146 -0
- package/dist/components/form/time-picker.js +92 -0
- package/dist/components/form/transfer.js +273 -0
- package/dist/components/form/upload.js +138 -0
- package/dist/components/framework/body.js +333 -0
- package/dist/components/framework/dashboard-panel.js +519 -0
- package/dist/components/framework/dashboard.d.ts.map +1 -1
- package/dist/components/framework/dashboard.js +1084 -0
- package/dist/components/framework/header.js +237 -0
- package/dist/components/framework/log-panel.js +637 -0
- package/dist/components/framework/page.js +151 -0
- package/dist/components/framework/sidebar.d.ts +4 -10
- package/dist/components/framework/sidebar.d.ts.map +1 -1
- package/dist/components/framework/sidebar.js +477 -0
- package/dist/components/layout/affix.js +137 -0
- package/dist/components/layout/col.js +103 -0
- package/dist/components/layout/collapse-item.js +165 -0
- package/dist/components/layout/collapse.js +108 -0
- package/dist/components/layout/container.js +92 -0
- package/dist/components/layout/flex.js +100 -0
- package/dist/components/layout/row.js +103 -0
- package/dist/components/layout/space.js +85 -0
- package/dist/components/navigation/back-top.js +127 -0
- package/dist/components/navigation/breadcrumb-item.js +108 -0
- package/dist/components/navigation/breadcrumb.js +70 -0
- package/dist/components/navigation/menu-item.js +181 -0
- package/dist/components/navigation/menu.js +126 -0
- package/dist/components/navigation/steps.js +183 -0
- package/dist/components/navigation/sub-menu.js +253 -0
- package/dist/components/progress/progress-bar.js +97 -0
- package/dist/components/progress/progress-ring.js +111 -0
- package/dist/components/progress/skeleton.js +108 -0
- package/dist/components/progress/spinner.js +129 -0
- package/dist/components/theme/locale-switch.js +241 -0
- package/dist/components/theme/shadow-picker.js +233 -0
- package/dist/components/theme/shape-picker.js +232 -0
- package/dist/components/theme/theme-picker.js +236 -0
- package/dist/components/theme/theme-preview.d.ts +1 -2
- package/dist/components/theme/theme-preview.d.ts.map +1 -1
- package/dist/components/theme/theme-preview.js +376 -0
- package/dist/components/theme/theme-switch.d.ts.map +1 -1
- package/dist/components/theme/theme-switch.js +318 -0
- package/dist/components/theme/typo-picker.js +219 -0
- package/dist/core/AGENTS.md +6 -1
- package/dist/core/aithe-element.d.ts +2 -2
- package/dist/core/aithe-element.js +135 -0
- package/dist/core/aithe-widget.js +30 -0
- package/dist/core/anchored-overlay.d.ts +3 -0
- package/dist/core/anchored-overlay.d.ts.map +1 -1
- package/dist/core/anchored-overlay.js +111 -0
- package/dist/core/autoform/autoform.js +79 -0
- package/dist/core/autoform/condition.js +170 -0
- package/dist/core/autoform/index.js +8 -0
- package/dist/core/autoform/types.js +7 -0
- package/dist/core/datahub/config/strategy.d.ts +1 -1
- package/dist/core/datahub/config/strategy.d.ts.map +1 -1
- package/dist/core/datahub/config/strategy.js +50 -0
- package/dist/core/datahub/core/adapter/fetch-adapter.d.ts +1 -1
- package/dist/core/datahub/core/adapter/fetch-adapter.d.ts.map +1 -1
- package/dist/core/datahub/core/adapter/fetch-adapter.js +118 -0
- package/dist/core/datahub/core/adapter/index.js +7 -0
- package/dist/core/datahub/core/adapter/mock-adapter.d.ts +1 -1
- package/dist/core/datahub/core/adapter/mock-adapter.d.ts.map +1 -1
- package/dist/core/datahub/core/adapter/mock-adapter.js +58 -0
- package/dist/core/datahub/core/api-styles.d.ts +1 -1
- package/dist/core/datahub/core/api-styles.d.ts.map +1 -1
- package/dist/core/datahub/core/api-styles.js +131 -0
- package/dist/core/datahub/core/datahub-core.d.ts +3 -3
- package/dist/core/datahub/core/datahub-core.d.ts.map +1 -1
- package/dist/core/datahub/core/datahub-core.js +441 -0
- package/dist/core/datahub/core/index.js +7 -0
- package/dist/core/datahub/index.js +50 -0
- package/dist/core/datahub/types.d.ts +6 -0
- package/dist/core/datahub/types.d.ts.map +1 -1
- package/dist/core/datahub/types.js +31 -0
- package/dist/core/datahub/utils/cache.js +55 -0
- package/dist/core/datahub/utils/common.js +23 -0
- package/dist/core/datahub/utils/dedup.d.ts +1 -1
- package/dist/core/datahub/utils/dedup.d.ts.map +1 -1
- package/dist/core/datahub/utils/dedup.js +52 -0
- package/dist/core/datahub/utils/idempotent.js +61 -0
- package/dist/core/datahub/utils/is-query.js +53 -0
- package/dist/core/datahub/utils/loading.js +78 -0
- package/dist/core/filter/__tests__/index.test.d.ts +2 -0
- package/dist/core/filter/__tests__/index.test.d.ts.map +1 -0
- package/dist/core/filter/__tests__/index.test.js +230 -0
- package/dist/core/filter/builtins.d.ts +60 -0
- package/dist/core/filter/builtins.d.ts.map +1 -0
- package/dist/core/filter/builtins.js +172 -0
- package/dist/core/filter/factory.d.ts +54 -0
- package/dist/core/filter/factory.d.ts.map +1 -0
- package/dist/core/filter/factory.js +96 -0
- package/dist/core/filter/index.d.ts +11 -0
- package/dist/core/filter/index.d.ts.map +1 -0
- package/dist/core/filter/index.js +9 -0
- package/dist/core/filter/types.d.ts +12 -0
- package/dist/core/filter/types.d.ts.map +1 -0
- package/dist/core/filter/types.js +1 -0
- package/dist/core/floating.js +132 -0
- package/dist/core/highlight/index.js +43 -0
- package/dist/core/highlight/lang-bash.js +27 -0
- package/dist/core/highlight/lang-c.js +27 -0
- package/dist/core/highlight/lang-cmake.js +27 -0
- package/dist/core/highlight/lang-cpp.js +27 -0
- package/dist/core/highlight/lang-css.js +24 -0
- package/dist/core/highlight/lang-dart.js +27 -0
- package/dist/core/highlight/lang-dockerfile.js +16 -0
- package/dist/core/highlight/lang-fsharp.js +23 -0
- package/dist/core/highlight/lang-go.js +22 -0
- package/dist/core/highlight/lang-html.js +12 -0
- package/dist/core/highlight/lang-java.js +22 -0
- package/dist/core/highlight/lang-javascript.js +26 -0
- package/dist/core/highlight/lang-json.js +13 -0
- package/dist/core/highlight/lang-jsonline.js +13 -0
- package/dist/core/highlight/lang-jsx.js +30 -0
- package/dist/core/highlight/lang-kotlin.js +27 -0
- package/dist/core/highlight/lang-latex.js +22 -0
- package/dist/core/highlight/lang-lua.js +26 -0
- package/dist/core/highlight/lang-makefile.js +22 -0
- package/dist/core/highlight/lang-markdown.js +18 -0
- package/dist/core/highlight/lang-objectivec.js +24 -0
- package/dist/core/highlight/lang-perl.js +30 -0
- package/dist/core/highlight/lang-powershell.js +23 -0
- package/dist/core/highlight/lang-python.js +27 -0
- package/dist/core/highlight/lang-r.js +21 -0
- package/dist/core/highlight/lang-ruby.js +29 -0
- package/dist/core/highlight/lang-rust.js +24 -0
- package/dist/core/highlight/lang-scala.js +26 -0
- package/dist/core/highlight/lang-sql.js +21 -0
- package/dist/core/highlight/lang-svelte.js +27 -0
- package/dist/core/highlight/lang-swift.js +28 -0
- package/dist/core/highlight/lang-tsx.js +35 -0
- package/dist/core/highlight/lang-typescript.js +31 -0
- package/dist/core/highlight/lang-vue.js +29 -0
- package/dist/core/highlight/lang-wasm.js +22 -0
- package/dist/core/highlight/lang-xml.js +12 -0
- package/dist/core/highlight/lang-yaml.js +14 -0
- package/dist/core/highlight/registry.js +99 -0
- package/dist/core/logger/LoggerCore.js +626 -0
- package/dist/core/logger/index.js +10 -0
- package/dist/core/logger/types.js +29 -0
- package/dist/core/markdown/index.js +20 -0
- package/dist/core/markdown/parser.d.ts +2 -0
- package/dist/core/markdown/parser.d.ts.map +1 -1
- package/dist/core/markdown/parser.js +376 -0
- package/dist/core/markdown/plugins.js +608 -0
- package/dist/core/markdown/types.d.ts +5 -0
- package/dist/core/markdown/types.d.ts.map +1 -1
- package/dist/core/markdown/types.js +7 -0
- package/dist/core/router/index.js +244 -0
- package/dist/core/styles.js +44 -0
- package/dist/core/types.d.ts +50 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2812 -1253
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1670 -728
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/aithe-ui.d.ts +23 -0
- package/dist/styles/aithe-ui.d.ts.map +1 -1
- package/dist/styles/aithe-ui.js +185 -0
- package/dist/styles/global.css.d.ts +1 -1
- package/dist/styles/global.css.d.ts.map +1 -1
- package/dist/styles/global.css.js +119 -0
- package/dist/styles/i18n/index.js +206 -0
- package/dist/styles/i18n/locales/de-DE.d.ts.map +1 -1
- package/dist/styles/i18n/locales/de-DE.js +148 -0
- package/dist/styles/i18n/locales/en-US.d.ts.map +1 -1
- package/dist/styles/i18n/locales/en-US.js +157 -0
- package/dist/styles/i18n/locales/es-ES.d.ts.map +1 -1
- package/dist/styles/i18n/locales/es-ES.js +148 -0
- package/dist/styles/i18n/locales/fr-FR.d.ts.map +1 -1
- package/dist/styles/i18n/locales/fr-FR.js +148 -0
- package/dist/styles/i18n/locales/index.js +14 -0
- package/dist/styles/i18n/locales/ja-JP.d.ts.map +1 -1
- package/dist/styles/i18n/locales/ja-JP.js +148 -0
- package/dist/styles/i18n/locales/ko-KR.d.ts.map +1 -1
- package/dist/styles/i18n/locales/ko-KR.js +148 -0
- package/dist/styles/i18n/locales/pt-BR.d.ts.map +1 -1
- package/dist/styles/i18n/locales/pt-BR.js +148 -0
- package/dist/styles/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/styles/i18n/locales/zh-CN.js +157 -0
- package/dist/styles/i18n/locales/zh-HK.d.ts.map +1 -1
- package/dist/styles/i18n/locales/zh-HK.js +148 -0
- package/dist/styles/i18n/locales/zh-TW.d.ts.map +1 -1
- package/dist/styles/i18n/locales/zh-TW.js +148 -0
- package/dist/styles/layout/index.js +88 -0
- package/dist/styles/mixins.js +43 -0
- package/dist/styles/shadow/cyber.js +19 -0
- package/dist/styles/shadow/deep.js +19 -0
- package/dist/styles/shadow/diffuse.js +19 -0
- package/dist/styles/shadow/flat.js +19 -0
- package/dist/styles/shadow/glassmorphism.js +19 -0
- package/dist/styles/shadow/index.js +129 -0
- package/dist/styles/shadow/neumorphism.js +21 -0
- package/dist/styles/shadow/retro.js +19 -0
- package/dist/styles/shadow/sharp-business.js +19 -0
- package/dist/styles/shadow/skeuomorphic.js +21 -0
- package/dist/styles/shape/chamfer.js +19 -0
- package/dist/styles/shape/circle.js +19 -0
- package/dist/styles/shape/index.js +174 -0
- package/dist/styles/shape/organic.js +19 -0
- package/dist/styles/shape/pill.js +19 -0
- package/dist/styles/shape/rounded.js +21 -0
- package/dist/styles/shape/rounder.js +19 -0
- package/dist/styles/shape/sharp.js +19 -0
- package/dist/styles/shape/smooth.js +19 -0
- package/dist/styles/theme/aliyun.d.ts +1 -1
- package/dist/styles/theme/aliyun.d.ts.map +1 -1
- package/dist/styles/theme/aliyun.js +102 -0
- package/dist/styles/theme/amber.d.ts +1 -1
- package/dist/styles/theme/amber.d.ts.map +1 -1
- package/dist/styles/theme/amber.js +101 -0
- package/dist/styles/theme/blue.d.ts +1 -1
- package/dist/styles/theme/blue.d.ts.map +1 -1
- package/dist/styles/theme/blue.js +101 -0
- package/dist/styles/theme/charcoal.d.ts +1 -1
- package/dist/styles/theme/charcoal.d.ts.map +1 -1
- package/dist/styles/theme/charcoal.js +106 -0
- package/dist/styles/theme/cyan.d.ts +1 -1
- package/dist/styles/theme/cyan.d.ts.map +1 -1
- package/dist/styles/theme/cyan.js +96 -0
- package/dist/styles/theme/dark.d.ts +1 -1
- package/dist/styles/theme/dark.d.ts.map +1 -1
- package/dist/styles/theme/dark.js +106 -0
- package/dist/styles/theme/ebony.d.ts +1 -1
- package/dist/styles/theme/ebony.d.ts.map +1 -1
- package/dist/styles/theme/ebony.js +106 -0
- package/dist/styles/theme/festive.d.ts +1 -1
- package/dist/styles/theme/festive.d.ts.map +1 -1
- package/dist/styles/theme/festive.js +101 -0
- package/dist/styles/theme/graphite.d.ts +1 -1
- package/dist/styles/theme/graphite.d.ts.map +1 -1
- package/dist/styles/theme/graphite.js +106 -0
- package/dist/styles/theme/gray.d.ts +1 -1
- package/dist/styles/theme/gray.d.ts.map +1 -1
- package/dist/styles/theme/gray.js +101 -0
- package/dist/styles/theme/huawei.d.ts +1 -1
- package/dist/styles/theme/huawei.d.ts.map +1 -1
- package/dist/styles/theme/huawei.js +102 -0
- package/dist/styles/theme/index.d.ts +1 -1
- package/dist/styles/theme/index.d.ts.map +1 -1
- package/dist/styles/theme/index.js +276 -0
- package/dist/styles/theme/indigo.d.ts +1 -1
- package/dist/styles/theme/indigo.d.ts.map +1 -1
- package/dist/styles/theme/indigo.js +101 -0
- package/dist/styles/theme/ink.d.ts +1 -1
- package/dist/styles/theme/ink.d.ts.map +1 -1
- package/dist/styles/theme/ink.js +106 -0
- package/dist/styles/theme/light.d.ts +1 -1
- package/dist/styles/theme/light.d.ts.map +1 -1
- package/dist/styles/theme/light.js +102 -0
- package/dist/styles/theme/midnight.d.ts +1 -1
- package/dist/styles/theme/midnight.d.ts.map +1 -1
- package/dist/styles/theme/midnight.js +106 -0
- package/dist/styles/theme/navy.d.ts +1 -1
- package/dist/styles/theme/navy.d.ts.map +1 -1
- package/dist/styles/theme/navy.js +106 -0
- package/dist/styles/theme/obsidian.d.ts +1 -1
- package/dist/styles/theme/obsidian.d.ts.map +1 -1
- package/dist/styles/theme/obsidian.js +106 -0
- package/dist/styles/theme/onyx.d.ts +1 -1
- package/dist/styles/theme/onyx.d.ts.map +1 -1
- package/dist/styles/theme/onyx.js +106 -0
- package/dist/styles/theme/orange.d.ts +1 -1
- package/dist/styles/theme/orange.d.ts.map +1 -1
- package/dist/styles/theme/orange.js +101 -0
- package/dist/styles/theme/pink.d.ts +1 -1
- package/dist/styles/theme/pink.d.ts.map +1 -1
- package/dist/styles/theme/pink.js +101 -0
- package/dist/styles/theme/purple.d.ts +1 -1
- package/dist/styles/theme/purple.d.ts.map +1 -1
- package/dist/styles/theme/purple.js +101 -0
- package/dist/styles/theme/raisin.d.ts +1 -1
- package/dist/styles/theme/raisin.d.ts.map +1 -1
- package/dist/styles/theme/raisin.js +106 -0
- package/dist/styles/theme/slate.d.ts +1 -1
- package/dist/styles/theme/slate.d.ts.map +1 -1
- package/dist/styles/theme/slate.js +106 -0
- package/dist/styles/theme/teal.d.ts +1 -1
- package/dist/styles/theme/teal.d.ts.map +1 -1
- package/dist/styles/theme/teal.js +101 -0
- package/dist/styles/theme/tianyi.d.ts +1 -1
- package/dist/styles/theme/tianyi.d.ts.map +1 -1
- package/dist/styles/theme/tianyi.js +102 -0
- package/dist/styles/types.js +1 -0
- package/dist/styles/typo/business.js +34 -0
- package/dist/styles/typo/compact.js +34 -0
- package/dist/styles/typo/index.js +99 -0
- package/dist/styles/typo/luxury.js +34 -0
- package/dist/styles/typo/minimal.js +34 -0
- package/dist/types/index.js +2 -0
- package/dist/utils/dom.js +51 -0
- package/dist/utils/events.js +32 -0
- package/dist/utils/icon.js +176 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/utils.d.ts +5 -5
- package/dist/utils/utils.js +89 -0
- package/dist/utils/validation.js +52 -0
- package/docs/api/basic/button.md +9 -6
- package/docs/api/basic/tag.md +24 -17
- package/docs/api/data/box-table.md +73 -0
- package/docs/api/data/dropdown.md +3 -2
- package/docs/api/data/metrics.md +2 -0
- package/docs/api/data/table-column.md +37 -23
- package/docs/api/data/table.md +158 -44
- package/docs/api/data/tabs.md +46 -1
- package/docs/api/data/tree-menu.md +55 -2
- package/docs/api/display/box.md +66 -0
- package/docs/api/display/brief-box.md +73 -0
- package/docs/api/display/desc-item.md +57 -0
- package/docs/api/display/desc.md +204 -0
- package/docs/api/display/detail-box.md +75 -0
- package/docs/api/display/mini-box.md +100 -0
- package/docs/api/display/profile.md +92 -0
- package/docs/api/feedback/popover.md +10 -10
- package/docs/api/feedback/tooltip.md +14 -14
- package/docs/api/form/autoform-item.md +100 -0
- package/docs/api/form/autoform.md +4 -1
- package/docs/api/form/select.md +28 -28
- package/docs/api/framework/log-panel.md +46 -0
- package/docs/api/framework/sidebar.md +3 -2
- package/docs/api/summary.md +45 -35
- package/docs/api/theme/theme-switch.md +1 -1
- package/docs/autoform.md +13 -1
- package/docs/changelog/CHANGELOG.md +80 -0
- package/docs/changelog/VERSION_26.3.1.md +966 -0
- package/docs/datahub.md +1 -1
- package/docs/filter.md +332 -0
- package/docs/framework-integration.md +2 -2
- package/docs/guide.md +66 -1
- package/docs/i18n.md +2 -2
- package/docs/issue/issue_26.3.1.0.md +84 -0
- package/docs/issue/issue_26.3.1.1.md +72 -0
- package/docs/issue/issue_26.3.1.2.md +75 -0
- package/docs/issue/issue_26.3.1.3.md +78 -0
- package/docs/issue/issue_26.3.1.4.md +113 -0
- package/docs/issue/issue_26.3.1.5.md +142 -0
- package/docs/issue/issue_26.3.1.6.md +100 -0
- package/docs/issue/issue_26.3.1.7.md +78 -0
- package/docs/quickstart.md +5 -5
- package/package.json +5 -2
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file FetchAdapter - 浏览器原生 fetch 适配器 / Browser Native Fetch Adapter
|
|
3
|
+
* @description 基于 window.fetch 实现的零依赖 HTTP 适配器。
|
|
4
|
+
* 职责:
|
|
5
|
+
* 1. 将 DataHubAdapterRequest 转换为 fetch 调用
|
|
6
|
+
* 2. 解析 JSON 响应为原始数据,不假设任何业务协议结构
|
|
7
|
+
* 3. 支持超时自动中断(AbortController)
|
|
8
|
+
* 4. 支持外部 signal 与内部超时 signal 合并
|
|
9
|
+
* 5. traceId 通过请求头透传
|
|
10
|
+
*
|
|
11
|
+
* Zero-dependency HTTP adapter based on window.fetch.
|
|
12
|
+
* Responsibilities:
|
|
13
|
+
* 1. Convert DataHubAdapterRequest to fetch calls
|
|
14
|
+
* 2. Parse JSON responses as raw data, assuming no business protocol structure
|
|
15
|
+
* 3. Support timeout-based auto-abort (AbortController)
|
|
16
|
+
* 4. Support merging external signal with internal timeout signal
|
|
17
|
+
* 5. Propagate traceId via request header
|
|
18
|
+
*/
|
|
19
|
+
/** 按 URL 存储的 AbortController 映射,用于主动取消请求 / AbortController map keyed by URL for active request cancellation */
|
|
20
|
+
const abortControllers = new Map();
|
|
21
|
+
/**
|
|
22
|
+
* FetchAdapter - 原生 fetch 适配器 / Native fetch adapter
|
|
23
|
+
* @implements {DataHubAdapter}
|
|
24
|
+
*/
|
|
25
|
+
export class FetchAdapter {
|
|
26
|
+
constructor() {
|
|
27
|
+
/** 适配器名称标识 / Adapter name identifier */
|
|
28
|
+
this.name = 'fetch';
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 执行 HTTP 请求 / Execute HTTP request
|
|
32
|
+
* @param req - 适配器请求对象 / Adapter request object
|
|
33
|
+
* @returns 标准化的适配器响应,data 为原始 JSON 解析结果,不含业务协议假设
|
|
34
|
+
* Standardized adapter response, data is raw JSON-parsed result with no business protocol assumptions
|
|
35
|
+
*/
|
|
36
|
+
async request(req) {
|
|
37
|
+
const { url, data, options } = req;
|
|
38
|
+
const method = options.method ?? 'POST';
|
|
39
|
+
const timeout = options.timeout ?? 30000;
|
|
40
|
+
const controller = new AbortController();
|
|
41
|
+
abortControllers.set(url, controller);
|
|
42
|
+
const signal = options.signal
|
|
43
|
+
? composeSignals(options.signal, controller.signal)
|
|
44
|
+
: controller.signal;
|
|
45
|
+
const init = {
|
|
46
|
+
method,
|
|
47
|
+
signal,
|
|
48
|
+
headers: {
|
|
49
|
+
'Content-Type': 'application/json',
|
|
50
|
+
...options.headers,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
if (method !== 'GET' && data !== undefined) {
|
|
54
|
+
init.body = JSON.stringify(data);
|
|
55
|
+
}
|
|
56
|
+
if (method === 'GET' && data !== undefined) {
|
|
57
|
+
console.warn(`[DataHub] GET request with body is unusual: ${url}`);
|
|
58
|
+
}
|
|
59
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
60
|
+
try {
|
|
61
|
+
const response = await fetch(url, init);
|
|
62
|
+
const resHeaders = {};
|
|
63
|
+
for (const [k, v] of response.headers) {
|
|
64
|
+
resHeaders[k] = v;
|
|
65
|
+
}
|
|
66
|
+
// 只解析 JSON,不做任何业务语义判断
|
|
67
|
+
// Only parse JSON, no business semantics
|
|
68
|
+
let json;
|
|
69
|
+
try {
|
|
70
|
+
json = (await response.json());
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
json = undefined;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
ok: response.ok,
|
|
77
|
+
status: response.status,
|
|
78
|
+
data: json,
|
|
79
|
+
headers: resHeaders,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
clearTimeout(timer);
|
|
84
|
+
abortControllers.delete(url);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* 主动取消指定 URL 的请求 / Actively abort the request for the specified URL
|
|
89
|
+
*/
|
|
90
|
+
abort(url) {
|
|
91
|
+
const controller = abortControllers.get(url);
|
|
92
|
+
if (controller) {
|
|
93
|
+
controller.abort();
|
|
94
|
+
abortControllers.delete(url);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 合并两个 AbortSignal / Compose two AbortSignals
|
|
100
|
+
*/
|
|
101
|
+
function composeSignals(external, internal) {
|
|
102
|
+
const controller = new AbortController();
|
|
103
|
+
const cleanup = () => {
|
|
104
|
+
external.removeEventListener('abort', onAbort);
|
|
105
|
+
internal.removeEventListener('abort', onAbort);
|
|
106
|
+
};
|
|
107
|
+
const onAbort = () => {
|
|
108
|
+
cleanup();
|
|
109
|
+
controller.abort();
|
|
110
|
+
};
|
|
111
|
+
external.addEventListener('abort', onAbort, { once: true });
|
|
112
|
+
internal.addEventListener('abort', onAbort, { once: true });
|
|
113
|
+
if (external.aborted || internal.aborted) {
|
|
114
|
+
cleanup();
|
|
115
|
+
controller.abort();
|
|
116
|
+
}
|
|
117
|
+
return controller.signal;
|
|
118
|
+
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* 2. Support mockDelay to simulate network latency
|
|
13
13
|
* 3. Assume no business protocol structure, return raw mockData directly
|
|
14
14
|
*/
|
|
15
|
-
import type { DataHubAdapter, DataHubAdapterRequest, DataHubAdapterResponse } from '
|
|
15
|
+
import type { DataHubAdapter, DataHubAdapterRequest, DataHubAdapterResponse } from '../../../datahub/types';
|
|
16
16
|
/**
|
|
17
17
|
* MockAdapter - 本地模拟适配器 / Local mock adapter
|
|
18
18
|
* @implements {DataHubAdapter}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-adapter.d.ts","sourceRoot":"","sources":["../../../../../src/core/datahub/core/adapter/mock-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"mock-adapter.d.ts","sourceRoot":"","sources":["../../../../../src/core/datahub/core/adapter/mock-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEzG;;;GAGG;AACH,qBAAa,WAAY,YAAW,cAAc;IAChD,wCAAwC;IACxC,SAAgB,IAAI,UAAU;IAE9B;;;;;OAKG;IACU,OAAO,CAAC,CAAC,GAAG,OAAO,EAC9B,GAAG,EAAE,qBAAqB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;CAyBtC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file MockAdapter - 本地模拟数据适配器 / Local Mock Data Adapter
|
|
3
|
+
* @description 用于开发调试阶段模拟后端接口响应,零依赖。
|
|
4
|
+
* 职责:
|
|
5
|
+
* 1. 根据配置的 mockData 返回模拟数据
|
|
6
|
+
* 2. 支持 mockDelay 模拟网络延迟
|
|
7
|
+
* 3. 不假设任何业务协议结构,直接返回原始 mockData
|
|
8
|
+
*
|
|
9
|
+
* Used during development/debugging to simulate backend API responses, zero dependencies.
|
|
10
|
+
* Responsibilities:
|
|
11
|
+
* 1. Return simulated data based on configured mockData
|
|
12
|
+
* 2. Support mockDelay to simulate network latency
|
|
13
|
+
* 3. Assume no business protocol structure, return raw mockData directly
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* MockAdapter - 本地模拟适配器 / Local mock adapter
|
|
17
|
+
* @implements {DataHubAdapter}
|
|
18
|
+
*/
|
|
19
|
+
export class MockAdapter {
|
|
20
|
+
constructor() {
|
|
21
|
+
/** 适配器名称标识 / Adapter name identifier */
|
|
22
|
+
this.name = 'mock';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 执行模拟请求 / Execute mock request
|
|
26
|
+
* @param req - 适配器请求对象 / Adapter request object
|
|
27
|
+
* @returns 模拟的标准化响应,data 为原始 mockData,不含业务协议假设
|
|
28
|
+
* Simulated standardized response, data is raw mockData with no business protocol assumptions
|
|
29
|
+
*/
|
|
30
|
+
async request(req) {
|
|
31
|
+
const { mockData, mockPath, mockDelay } = req.options;
|
|
32
|
+
let data;
|
|
33
|
+
if (mockData !== undefined) {
|
|
34
|
+
await sleep(mockDelay ?? 300);
|
|
35
|
+
data = mockData;
|
|
36
|
+
}
|
|
37
|
+
else if (mockPath) {
|
|
38
|
+
const response = await fetch(mockPath);
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
throw new Error(`${response.status} - Fetch mock resource failed: ${mockPath}`);
|
|
41
|
+
}
|
|
42
|
+
const text = await response.text();
|
|
43
|
+
try {
|
|
44
|
+
data = JSON.parse(text);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
throw new Error(`Mock resource is not valid JSON: ${mockPath}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
data = {};
|
|
52
|
+
}
|
|
53
|
+
return { ok: true, status: 200, data };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function sleep(ms) {
|
|
57
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
58
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - k8s: Kubernetes API style (request sends object directly, response includes kind/apiVersion/metadata)
|
|
11
11
|
* - raw: Passthrough style, no request/response transformation, returns raw HTTP data directly
|
|
12
12
|
*/
|
|
13
|
-
import type { DataHubAPIStyle } from '
|
|
13
|
+
import type { DataHubAPIStyle } from '../../datahub/types';
|
|
14
14
|
/**
|
|
15
15
|
* 获取内置 APIStyle / Get a built-in APIStyle by name
|
|
16
16
|
* @param name - 风格名称,可选 "default" 或 "k8s" / Style name, either "default" or "k8s"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-styles.d.ts","sourceRoot":"","sources":["../../../../src/core/datahub/core/api-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,
|
|
1
|
+
{"version":3,"file":"api-styles.d.ts","sourceRoot":"","sources":["../../../../src/core/datahub/core/api-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,qBAAqB,CAAC;AAgI7B;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAEzE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file 内置 APIStyle 实现 / Built-in APIStyle Implementations
|
|
3
|
+
* @description 提供开箱即用的 APIStyle:
|
|
4
|
+
* - default: Aithe UI 标准风格(请求 { data },响应 { code/message/data })
|
|
5
|
+
* - k8s: Kubernetes API 风格(请求直接传对象,响应包含 kind/apiVersion/metadata)
|
|
6
|
+
* - raw: 原始风格,不对请求体和响应做任何转换,直接透传原始 HTTP 数据
|
|
7
|
+
*
|
|
8
|
+
* Provides ready-to-use APIStyle implementations:
|
|
9
|
+
* - default: Aithe UI standard style (request { data }, response { code/message/data })
|
|
10
|
+
* - k8s: Kubernetes API style (request sends object directly, response includes kind/apiVersion/metadata)
|
|
11
|
+
* - raw: Passthrough style, no request/response transformation, returns raw HTTP data directly
|
|
12
|
+
*/
|
|
13
|
+
// ─── Default Style / 默认风格 ──────────────────────────────────
|
|
14
|
+
const defaultStyle = {
|
|
15
|
+
name: 'default',
|
|
16
|
+
onRequest(req) {
|
|
17
|
+
req.data = { data: req.data };
|
|
18
|
+
},
|
|
19
|
+
onResponse(res) {
|
|
20
|
+
const rawData = res.data;
|
|
21
|
+
if (!rawData || typeof rawData !== 'object') {
|
|
22
|
+
return { code: 'UnknownError', message: 'Invalid response format', data: undefined };
|
|
23
|
+
}
|
|
24
|
+
const obj = rawData;
|
|
25
|
+
return {
|
|
26
|
+
code: obj.code ?? 'UnknownError',
|
|
27
|
+
message: obj.message ?? '',
|
|
28
|
+
data: obj.data,
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
isSuccess(result) {
|
|
32
|
+
return result.code === 'Ok';
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
// ─── K8s Style / Kubernetes 风格 ───────────────────────────────
|
|
36
|
+
const k8sStyle = {
|
|
37
|
+
name: 'k8s',
|
|
38
|
+
onRequest(_req) {
|
|
39
|
+
// K8s 风格直接发送业务对象,不额外包装
|
|
40
|
+
},
|
|
41
|
+
onResponse(res) {
|
|
42
|
+
const rawData = res.data;
|
|
43
|
+
if (!rawData || typeof rawData !== 'object') {
|
|
44
|
+
return { code: 'UnknownError', message: 'Invalid response format', data: undefined };
|
|
45
|
+
}
|
|
46
|
+
const obj = rawData;
|
|
47
|
+
// K8s 非 2xx 错误响应:Status 对象 { kind: "Status", status: "Failure", message, reason, code }
|
|
48
|
+
// K8s error response: Status object with top-level status string and message/reason fields
|
|
49
|
+
if (!res.ok && typeof obj.status === 'string') {
|
|
50
|
+
return {
|
|
51
|
+
code: obj.reason ?? obj.status ?? 'UnknownError',
|
|
52
|
+
message: obj.message ?? '',
|
|
53
|
+
data: rawData,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const status = obj.status;
|
|
57
|
+
const phase = status?.phase;
|
|
58
|
+
const conditions = status?.conditions;
|
|
59
|
+
const reason = status?.reason;
|
|
60
|
+
const k8sMessage = status?.message;
|
|
61
|
+
let code = 'Ok';
|
|
62
|
+
let message = '';
|
|
63
|
+
if (phase && phase !== 'Active' && phase !== 'Available' && phase !== 'Ready') {
|
|
64
|
+
code = phase;
|
|
65
|
+
}
|
|
66
|
+
if (reason) {
|
|
67
|
+
code = reason;
|
|
68
|
+
}
|
|
69
|
+
if (conditions && conditions.length > 0) {
|
|
70
|
+
const lastCondition = conditions.at(-1);
|
|
71
|
+
if (lastCondition && lastCondition.status !== 'True') {
|
|
72
|
+
code = lastCondition.reason ?? code;
|
|
73
|
+
message = lastCondition.message ?? '';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (k8sMessage) {
|
|
77
|
+
message = k8sMessage;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
code,
|
|
81
|
+
message,
|
|
82
|
+
data: rawData,
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
isSuccess(result) {
|
|
86
|
+
return result.code === 'Ok';
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
// ─── 注册表 / Registry ─────────────────────────────────────────
|
|
90
|
+
/**
|
|
91
|
+
* Raw 风格:不对请求体和响应做任何转换,直接透传原始 HTTP 数据。
|
|
92
|
+
* 适用于对接不遵循统一业务协议的三方接口。
|
|
93
|
+
* Raw style: no request/response transformation, passes raw HTTP data through.
|
|
94
|
+
* Useful for third-party APIs that don't follow a standard business protocol.
|
|
95
|
+
*/
|
|
96
|
+
const rawStyle = {
|
|
97
|
+
name: 'raw',
|
|
98
|
+
onRequest(_req) {
|
|
99
|
+
// 不包装请求体,直接透传
|
|
100
|
+
},
|
|
101
|
+
onResponse(res) {
|
|
102
|
+
return {
|
|
103
|
+
code: 'Ok',
|
|
104
|
+
message: '',
|
|
105
|
+
data: res.data,
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
isSuccess(_result) {
|
|
109
|
+
return true;
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
const builtinStyles = {
|
|
113
|
+
default: defaultStyle,
|
|
114
|
+
k8s: k8sStyle,
|
|
115
|
+
raw: rawStyle,
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* 获取内置 APIStyle / Get a built-in APIStyle by name
|
|
119
|
+
* @param name - 风格名称,可选 "default" 或 "k8s" / Style name, either "default" or "k8s"
|
|
120
|
+
* @returns APIStyle 实例,未找到返回 undefined / APIStyle instance, or undefined if not found
|
|
121
|
+
*/
|
|
122
|
+
export function getBuiltinStyle(name) {
|
|
123
|
+
return builtinStyles[name];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 获取所有内置 APIStyle 名称列表 / Get all built-in APIStyle names
|
|
127
|
+
* @returns 风格名称数组 / Array of style names
|
|
128
|
+
*/
|
|
129
|
+
export function getBuiltinStyleNames() {
|
|
130
|
+
return Object.keys(builtinStyles);
|
|
131
|
+
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
* - Strategy is auto-detected; the business layer need not worry about cache/dedup/idempotent details
|
|
24
24
|
* - Unified error handling, only for transport-layer exceptions
|
|
25
25
|
*/
|
|
26
|
-
import type { DataHubConfig, DataHubAdapter, DataHubRequestOptions, DataHubAdapterRequest, DataHubAdapterResponse, DataHubAPIStyle } from '
|
|
27
|
-
import { DataHubError as DataHubErrorClass } from '
|
|
28
|
-
import { onLoadingChange, isLoading } from '
|
|
26
|
+
import type { DataHubConfig, DataHubAdapter, DataHubRequestOptions, DataHubAdapterRequest, DataHubAdapterResponse, DataHubAPIStyle } from '../../datahub/types';
|
|
27
|
+
import { DataHubError as DataHubErrorClass } from '../../datahub/types';
|
|
28
|
+
import { onLoadingChange, isLoading } from '../../datahub/utils/loading';
|
|
29
29
|
/**
|
|
30
30
|
* DataHubCore - 核心调度器 / Core Dispatcher
|
|
31
31
|
* @description 管理适配器注册、API 注册、请求调度及中间件编排。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datahub-core.d.ts","sourceRoot":"","sources":["../../../../src/core/datahub/core/datahub-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EAChB,MAAM,
|
|
1
|
+
{"version":3,"file":"datahub-core.d.ts","sourceRoot":"","sources":["../../../../src/core/datahub/core/datahub-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxE,OAAO,EAA4B,eAAe,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAenG;;;;;;;;GAQG;AACH,qBAAa,WAAW;IACtB,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAC9D,uDAAuD;IACvD,OAAO,CAAC,MAAM,CAAiB;IAC/B,6FAA6F;IAC7F,OAAO,CAAC,QAAQ,CAA8B;IAE9C;;OAEG;gBACS,MAAM,GAAE,aAAkB;IAatC;;;;OAIG;IACI,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAIrD;;;;OAIG;IACI,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAM3D;;;;;;;;;;;;;;;OAeG;IACI,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI;IAezD;;;OAGG;IACI,WAAW,IAAI,eAAe,GAAG,SAAS;IAIjD;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;;;;;;;;;;;;;;;;;OAkBG;IACU,OAAO,CAAC,CAAC,GAAG,OAAO,EAC9B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAgJrC,+BAA+B;IACxB,UAAU,IAAI,IAAI;IAIzB,yCAAyC;IAClC,UAAU,IAAI,IAAI;IAIzB,2CAA2C;IACpC,eAAe,IAAI,IAAI;IAM9B;;OAEG;IACI,qBAAqB,CAC1B,OAAO,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,qBAAqB,GAAG,IAAI,GACpE,IAAI;IAIP;;OAEG;IACI,sBAAsB,CAC3B,OAAO,EAAE,CACP,GAAG,EAAE,sBAAsB,EAC3B,GAAG,EAAE,qBAAqB,KACvB,sBAAsB,GAAG,IAAI,GACjC,IAAI;IAIP;;OAEG;IACI,eAAe,CACpB,OAAO,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,qBAAqB,KAAK,IAAI,GACtE,IAAI;IAIP;;OAEG;IACI,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IAIzD;;OAEG;IACI,SAAS,IAAI,QAAQ,CAAC,aAAa,CAAC;IAM3C,2DAA2D;IACpD,eAAe,yBAAmB;IAEzC,wEAAwE;IACjE,SAAS,mBAAa;IAI7B;;OAEG;IACH,OAAO,CAAC,cAAc;IAetB;;OAEG;IACH,OAAO,CAAC,UAAU;IAWlB;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;OAEG;IACH,OAAO,CAAC,eAAe;IAgBvB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAe5B;;;OAGG;IACH,OAAO,CAAC,cAAc;CA0BvB"}
|