@aithe/aithe-ui 26.2.3 → 26.3.2
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 +19 -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 +131 -0
- package/dist/apps/api/i18n/en-US.d.ts.map +1 -1
- package/dist/apps/api/i18n/en-US.js +141 -0
- package/dist/apps/api/i18n/es-ES.d.ts.map +1 -1
- package/dist/apps/api/i18n/es-ES.js +131 -0
- package/dist/apps/api/i18n/fr-FR.d.ts.map +1 -1
- package/dist/apps/api/i18n/fr-FR.js +131 -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 +131 -0
- package/dist/apps/api/i18n/ko-KR.d.ts.map +1 -1
- package/dist/apps/api/i18n/ko-KR.js +131 -0
- package/dist/apps/api/i18n/pt-BR.d.ts.map +1 -1
- package/dist/apps/api/i18n/pt-BR.js +131 -0
- package/dist/apps/api/i18n/zh-CN.d.ts.map +1 -1
- package/dist/apps/api/i18n/zh-CN.js +141 -0
- package/dist/apps/api/i18n/zh-HK.d.ts.map +1 -1
- package/dist/apps/api/i18n/zh-HK.js +131 -0
- package/dist/apps/api/i18n/zh-TW.d.ts.map +1 -1
- package/dist/apps/api/i18n/zh-TW.js +131 -0
- package/dist/apps/api/pages/docs.d.ts.map +1 -1
- package/dist/apps/api/pages/docs.js +369 -0
- package/dist/apps/api/standalone.js +1 -0
- package/dist/apps/demo/app.d.ts.map +1 -1
- package/dist/apps/demo/app.js +275 -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 +289 -0
- package/dist/apps/demo/i18n/en-US.d.ts.map +1 -1
- package/dist/apps/demo/i18n/en-US.js +301 -0
- package/dist/apps/demo/i18n/es-ES.d.ts.map +1 -1
- package/dist/apps/demo/i18n/es-ES.js +289 -0
- package/dist/apps/demo/i18n/fr-FR.d.ts.map +1 -1
- package/dist/apps/demo/i18n/fr-FR.js +289 -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 +289 -0
- package/dist/apps/demo/i18n/ko-KR.d.ts.map +1 -1
- package/dist/apps/demo/i18n/ko-KR.js +289 -0
- package/dist/apps/demo/i18n/pt-BR.d.ts.map +1 -1
- package/dist/apps/demo/i18n/pt-BR.js +289 -0
- package/dist/apps/demo/i18n/zh-CN.d.ts.map +1 -1
- package/dist/apps/demo/i18n/zh-CN.js +301 -0
- package/dist/apps/demo/i18n/zh-HK.d.ts.map +1 -1
- package/dist/apps/demo/i18n/zh-HK.js +289 -0
- package/dist/apps/demo/i18n/zh-TW.d.ts.map +1 -1
- package/dist/apps/demo/i18n/zh-TW.js +289 -0
- package/dist/apps/demo/pages/autoform.d.ts.map +1 -1
- package/dist/apps/demo/pages/autoform.js +422 -0
- package/dist/apps/demo/pages/autoview.d.ts +3 -0
- package/dist/apps/demo/pages/autoview.d.ts.map +1 -0
- package/dist/apps/demo/pages/autoview.js +310 -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.d.ts.map +1 -1
- package/dist/apps/demo/pages/form.js +119 -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/autoview.d.ts +139 -0
- package/dist/components/display/autoview.d.ts.map +1 -0
- package/dist/components/display/autoview.js +460 -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 +68 -0
- package/dist/components/display/desc.d.ts.map +1 -0
- package/dist/components/display/desc.js +405 -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.d.ts +6 -0
- package/dist/components/form/autoform-item.d.ts.map +1 -1
- package/dist/components/form/autoform-item.js +791 -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 +4 -0
- package/dist/components/form/combobox.d.ts.map +1 -1
- package/dist/components/form/combobox.js +325 -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 +5 -1
- package/dist/components/form/select.d.ts.map +1 -1
- package/dist/components/form/select.js +539 -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.d.ts.map +1 -1
- package/dist/components/navigation/sub-menu.js +252 -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/autoview.d.ts +86 -0
- package/dist/core/autoform/autoview.d.ts.map +1 -0
- package/dist/core/autoform/autoview.js +37 -0
- package/dist/core/autoform/condition.js +170 -0
- package/dist/core/autoform/index.d.ts +2 -0
- package/dist/core/autoform/index.d.ts.map +1 -1
- package/dist/core/autoform/index.js +9 -0
- package/dist/core/autoform/types.js +7 -0
- package/dist/core/datahub/__tests__/force-options.test.d.ts +8 -0
- package/dist/core/datahub/__tests__/force-options.test.d.ts.map +1 -0
- package/dist/core/datahub/__tests__/force-options.test.js +161 -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 +136 -0
- package/dist/core/datahub/core/datahub-core.d.ts +53 -3
- package/dist/core/datahub/core/datahub-core.d.ts.map +1 -1
- package/dist/core/datahub/core/datahub-core.js +520 -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 +24 -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.d.ts +2 -1
- package/dist/core/markdown/plugins.d.ts.map +1 -1
- package/dist/core/markdown/plugins.js +755 -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 +52 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3695 -1622
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1844 -758
- 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 +151 -0
- package/dist/styles/i18n/locales/en-US.d.ts.map +1 -1
- package/dist/styles/i18n/locales/en-US.js +160 -0
- package/dist/styles/i18n/locales/es-ES.d.ts.map +1 -1
- package/dist/styles/i18n/locales/es-ES.js +151 -0
- package/dist/styles/i18n/locales/fr-FR.d.ts.map +1 -1
- package/dist/styles/i18n/locales/fr-FR.js +151 -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 +151 -0
- package/dist/styles/i18n/locales/ko-KR.d.ts.map +1 -1
- package/dist/styles/i18n/locales/ko-KR.js +151 -0
- package/dist/styles/i18n/locales/pt-BR.d.ts.map +1 -1
- package/dist/styles/i18n/locales/pt-BR.js +151 -0
- package/dist/styles/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/styles/i18n/locales/zh-CN.js +160 -0
- package/dist/styles/i18n/locales/zh-HK.d.ts.map +1 -1
- package/dist/styles/i18n/locales/zh-HK.js +151 -0
- package/dist/styles/i18n/locales/zh-TW.d.ts.map +1 -1
- package/dist/styles/i18n/locales/zh-TW.js +151 -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/autoview.md +277 -0
- 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 +246 -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 +115 -0
- package/docs/api/form/autoform.md +7 -3
- package/docs/api/form/combobox.md +27 -7
- package/docs/api/form/select.md +50 -28
- package/docs/api/framework/log-panel.md +46 -0
- package/docs/api/framework/sidebar.md +3 -2
- package/docs/api/summary.md +46 -35
- package/docs/api/theme/theme-switch.md +1 -1
- package/docs/autoform.md +14 -33
- package/docs/changelog/CHANGELOG.md +155 -0
- package/docs/changelog/VERSION_26.3.1.md +966 -0
- package/docs/changelog/VERSION_26.3.2.md +852 -0
- package/docs/datahub.md +4 -1
- package/docs/filter.md +332 -0
- package/docs/framework-integration.md +2 -2
- package/docs/guide.md +72 -6
- package/docs/i18n.md +2 -4
- package/docs/issue/26.3.1/issue_26.3.1.0.md +84 -0
- package/docs/issue/26.3.1/issue_26.3.1.1.md +72 -0
- package/docs/issue/26.3.1/issue_26.3.1.2.md +75 -0
- package/docs/issue/26.3.1/issue_26.3.1.3.md +78 -0
- package/docs/issue/26.3.1/issue_26.3.1.4.md +113 -0
- package/docs/issue/26.3.1/issue_26.3.1.5.md +142 -0
- package/docs/issue/26.3.1/issue_26.3.1.6.md +100 -0
- package/docs/issue/26.3.1/issue_26.3.1.7.md +78 -0
- package/docs/issue/26.3.2/issue_26.3.2.1.md +46 -0
- package/docs/issue/26.3.2/issue_26.3.2.2.md +82 -0
- package/docs/issue/26.3.2/issue_26.3.2.3.md +57 -0
- package/docs/issue/26.3.2/issue_26.3.2.4.md +43 -0
- package/docs/issue/AGENTS.md +24 -3
- package/docs/markdown.md +2 -2
- package/docs/quickstart.md +5 -5
- package/docs/theming.md +5 -4
- package/package.json +5 -2
- package/dist/components/navigation/dropdown.d.ts +0 -56
- package/dist/components/navigation/dropdown.d.ts.map +0 -1
- /package/docs/issue/{issue_26.2.2.1.md → 26.2.2/issue_26.2.2.1.md} +0 -0
- /package/docs/issue/{issue_26.2.2.2.md → 26.2.2/issue_26.2.2.2.md} +0 -0
- /package/docs/issue/{issue_26.2.2.3.md → 26.2.2/issue_26.2.2.3.md} +0 -0
- /package/docs/issue/{issue_26.2.2.4.md → 26.2.2/issue_26.2.2.4.md} +0 -0
- /package/docs/issue/{issue_26.2.3.1.md → 26.2.3/issue_26.2.3.1.md} +0 -0
- /package/docs/issue/{issue_26.2.3.10.md → 26.2.3/issue_26.2.3.10.md} +0 -0
- /package/docs/issue/{issue_26.2.3.11.md → 26.2.3/issue_26.2.3.11.md} +0 -0
- /package/docs/issue/{issue_26.2.3.12.md → 26.2.3/issue_26.2.3.12.md} +0 -0
- /package/docs/issue/{issue_26.2.3.13.md → 26.2.3/issue_26.2.3.13.md} +0 -0
- /package/docs/issue/{issue_26.2.3.14.md → 26.2.3/issue_26.2.3.14.md} +0 -0
- /package/docs/issue/{issue_26.2.3.15.md → 26.2.3/issue_26.2.3.15.md} +0 -0
- /package/docs/issue/{issue_26.2.3.16.md → 26.2.3/issue_26.2.3.16.md} +0 -0
- /package/docs/issue/{issue_26.2.3.2.md → 26.2.3/issue_26.2.3.2.md} +0 -0
- /package/docs/issue/{issue_26.2.3.3.md → 26.2.3/issue_26.2.3.3.md} +0 -0
- /package/docs/issue/{issue_26.2.3.4.md → 26.2.3/issue_26.2.3.4.md} +0 -0
- /package/docs/issue/{issue_26.2.3.5.md → 26.2.3/issue_26.2.3.5.md} +0 -0
- /package/docs/issue/{issue_26.2.3.6.md → 26.2.3/issue_26.2.3.6.md} +0 -0
- /package/docs/issue/{issue_26.2.3.7.md → 26.2.3/issue_26.2.3.7.md} +0 -0
- /package/docs/issue/{issue_26.2.3.8.md → 26.2.3/issue_26.2.3.8.md} +0 -0
- /package/docs/issue/{issue_26.2.3.9.md → 26.2.3/issue_26.2.3.9.md} +0 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* aithe-theme-switch 组件
|
|
9
|
+
* Theme switch dropdown that integrates theme, shadow, and typo selection in a single submenu.
|
|
10
|
+
*
|
|
11
|
+
* 基于 floating overlay 模式实现,在单个下拉菜单中整合主题、阴影和排版切换。
|
|
12
|
+
* Built on the floating overlay pattern, integrates theme, shadow, and typo switching in one dropdown.
|
|
13
|
+
*
|
|
14
|
+
* @fires aithe-theme-change - Emitted when any option is selected. 选择选项时发出,detail 包含 `{ category: string, value: string }`。
|
|
15
|
+
* Call `event.preventDefault()` to suppress the built-in switch. 调用 `preventDefault()` 可阻止内置切换逻辑。
|
|
16
|
+
*/
|
|
17
|
+
import { css, html, nothing } from 'lit';
|
|
18
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
19
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
20
|
+
import { AitheElement } from '../../core/aithe-element';
|
|
21
|
+
import { computeFloatingPosition } from '../../core/floating';
|
|
22
|
+
import { aitheBaseStyles } from '../../core/styles';
|
|
23
|
+
import { aitheUI } from '../../styles/aithe-ui';
|
|
24
|
+
import { themeMenu } from '../../styles/theme';
|
|
25
|
+
import { shadowMenu } from '../../styles/shadow';
|
|
26
|
+
import { shapeMenu } from '../../styles/shape';
|
|
27
|
+
import { typoMenu } from '../../styles/typo';
|
|
28
|
+
import { t } from '../../styles/i18n';
|
|
29
|
+
/**
|
|
30
|
+
* Build a grouped tree menu structure for theme selection.
|
|
31
|
+
* Groups: Theme → Shadow → Shape → Typo, each with their respective items.
|
|
32
|
+
*/
|
|
33
|
+
function buildThemeMenu() {
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
id: 'theme-group',
|
|
37
|
+
label: 'Theme',
|
|
38
|
+
i18n: 'appearance.group.theme',
|
|
39
|
+
children: themeMenu.map((group) => ({
|
|
40
|
+
...group,
|
|
41
|
+
children: (group.children ?? []).map((c) => ({ ...c, category: 'theme' })),
|
|
42
|
+
})),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'shadow-group',
|
|
46
|
+
label: 'Shadow',
|
|
47
|
+
i18n: 'appearance.group.shadow',
|
|
48
|
+
children: shadowMenu.map((s) => ({ ...s, category: 'shadow' })),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'shape-group',
|
|
52
|
+
label: 'Shape',
|
|
53
|
+
i18n: 'appearance.group.shape',
|
|
54
|
+
children: shapeMenu.map((s) => ({ ...s, category: 'shape' })),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'typo-group',
|
|
58
|
+
label: 'Typo',
|
|
59
|
+
i18n: 'appearance.group.typo',
|
|
60
|
+
children: typoMenu.map((t) => ({ ...t, category: 'typo' })),
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
let AitheThemeSwitch = class AitheThemeSwitch extends AitheElement {
|
|
65
|
+
constructor() {
|
|
66
|
+
super(...arguments);
|
|
67
|
+
this.placement = 'bottom-end';
|
|
68
|
+
/** Whether to show only the icon and arrow without the label text. 是否仅显示图标和箭头,不显示标签文字。 */
|
|
69
|
+
this.iconOnly = false;
|
|
70
|
+
this.open = false;
|
|
71
|
+
this.currentTheme = aitheUI.getTheme();
|
|
72
|
+
this.currentShadow = aitheUI.getShadow();
|
|
73
|
+
this.currentShape = aitheUI.getShape();
|
|
74
|
+
this.currentTypo = aitheUI.getTypo();
|
|
75
|
+
this.themeMenu = buildThemeMenu();
|
|
76
|
+
this.handleViewportChange = () => this.updatePosition();
|
|
77
|
+
this.handleOutsideClick = (event) => {
|
|
78
|
+
if (!this.open)
|
|
79
|
+
return;
|
|
80
|
+
if (!event.composedPath().includes(this)) {
|
|
81
|
+
this.open = false;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
this.toggleOpen = () => {
|
|
85
|
+
this.open = !this.open;
|
|
86
|
+
if (this.open) {
|
|
87
|
+
this.bindViewport();
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.unbindViewport();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
this.handleTreeSelect = (event) => {
|
|
94
|
+
const { value, item } = event.detail;
|
|
95
|
+
if (!value || !item)
|
|
96
|
+
return;
|
|
97
|
+
const category = item.category;
|
|
98
|
+
if (!category)
|
|
99
|
+
return;
|
|
100
|
+
this.open = false;
|
|
101
|
+
this.unbindViewport();
|
|
102
|
+
const notPrevented = this.emit('aithe-theme-change', { category, value });
|
|
103
|
+
if (!notPrevented)
|
|
104
|
+
return;
|
|
105
|
+
switch (category) {
|
|
106
|
+
case 'theme':
|
|
107
|
+
aitheUI.setTheme(value);
|
|
108
|
+
break;
|
|
109
|
+
case 'shadow':
|
|
110
|
+
aitheUI.setShadow(value);
|
|
111
|
+
break;
|
|
112
|
+
case 'shape':
|
|
113
|
+
aitheUI.setShape(value);
|
|
114
|
+
break;
|
|
115
|
+
case 'typo':
|
|
116
|
+
aitheUI.setTypo(value);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
this.renderThemeItem = (item) => {
|
|
121
|
+
if (item.color) {
|
|
122
|
+
return html `<span
|
|
123
|
+
style="display:inline-block;width:12px;height:12px;border-radius:50%;border:1px solid rgba(0,0,0,0.15);flex-shrink:0;background:${item.color}"
|
|
124
|
+
></span>`;
|
|
125
|
+
}
|
|
126
|
+
if (item.preview) {
|
|
127
|
+
return html `<span
|
|
128
|
+
style="display:inline-block;width:24px;height:24px;border:1px solid var(--aithe-color-border);flex-shrink:0;background:var(--aithe-color-surface-elevated);border-radius:${item.preview}"
|
|
129
|
+
></span>`;
|
|
130
|
+
}
|
|
131
|
+
if (item.icon) {
|
|
132
|
+
return html `<span
|
|
133
|
+
style="display:inline-block;width:24px;height:24px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:16px;color:var(--aithe-color-text-muted)"
|
|
134
|
+
>${item.icon}</span>`;
|
|
135
|
+
}
|
|
136
|
+
return nothing;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
static { this.styles = [
|
|
140
|
+
aitheBaseStyles,
|
|
141
|
+
css `
|
|
142
|
+
:host {
|
|
143
|
+
display: inline-flex;
|
|
144
|
+
position: relative;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.trigger {
|
|
148
|
+
display: inline-flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
gap: var(--aithe-space-2);
|
|
151
|
+
min-height: 34px;
|
|
152
|
+
padding: 0 var(--aithe-space-3);
|
|
153
|
+
border: 1px solid var(--aithe-color-border);
|
|
154
|
+
border-radius: var(--aithe-radius-full);
|
|
155
|
+
background: var(--aithe-color-surface);
|
|
156
|
+
color: var(--aithe-color-text);
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
font-size: var(--aithe-font-size-sm);
|
|
159
|
+
font-family: inherit;
|
|
160
|
+
transition:
|
|
161
|
+
border-color 0.15s,
|
|
162
|
+
background 0.15s;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.trigger:hover {
|
|
166
|
+
border-color: var(--aithe-primary-6);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:host([icon-only]) .trigger {
|
|
170
|
+
min-height: 32px;
|
|
171
|
+
min-width: 32px;
|
|
172
|
+
padding: 0 var(--aithe-space-1);
|
|
173
|
+
justify-content: center;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:host([icon-only]) .trigger-label {
|
|
177
|
+
display: none;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.icon {
|
|
181
|
+
font-size: 14px;
|
|
182
|
+
color: var(--aithe-color-text-muted);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.arrow {
|
|
186
|
+
font-size: 10px;
|
|
187
|
+
color: var(--aithe-color-text-muted);
|
|
188
|
+
transition: transform var(--aithe-duration-fast) var(--aithe-ease-standard);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.arrow.open {
|
|
192
|
+
transform: rotate(180deg);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.overlay {
|
|
196
|
+
position: fixed;
|
|
197
|
+
z-index: var(--aithe-z-dropdown);
|
|
198
|
+
width: max-content;
|
|
199
|
+
min-width: 200px;
|
|
200
|
+
padding: var(--aithe-space-2);
|
|
201
|
+
border: 1px solid var(--aithe-color-border);
|
|
202
|
+
border-radius: var(--aithe-container-radius-lg);
|
|
203
|
+
background: var(--aithe-color-surface-elevated);
|
|
204
|
+
box-shadow: var(--aithe-shadow-3);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
aithe-tree-menu {
|
|
208
|
+
display: block;
|
|
209
|
+
width: 100%;
|
|
210
|
+
}
|
|
211
|
+
`,
|
|
212
|
+
]; }
|
|
213
|
+
getActiveId() {
|
|
214
|
+
return this.currentTheme;
|
|
215
|
+
}
|
|
216
|
+
connectedCallback() {
|
|
217
|
+
super.connectedCallback();
|
|
218
|
+
document.addEventListener('mousedown', this.handleOutsideClick);
|
|
219
|
+
this.unsubscribeTheme = aitheUI.onThemeChange(() => {
|
|
220
|
+
this.currentTheme = aitheUI.getTheme();
|
|
221
|
+
});
|
|
222
|
+
this.unsubscribeShadow = aitheUI.onShadowChange(() => {
|
|
223
|
+
this.currentShadow = aitheUI.getShadow();
|
|
224
|
+
});
|
|
225
|
+
this.unsubscribeShape = aitheUI.onShapeChange(() => {
|
|
226
|
+
this.currentShape = aitheUI.getShape();
|
|
227
|
+
});
|
|
228
|
+
this.unsubscribeTypo = aitheUI.onTypoChange(() => {
|
|
229
|
+
this.currentTypo = aitheUI.getTypo();
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
disconnectedCallback() {
|
|
233
|
+
super.disconnectedCallback();
|
|
234
|
+
document.removeEventListener('mousedown', this.handleOutsideClick);
|
|
235
|
+
this.unbindViewport();
|
|
236
|
+
this.unsubscribeTheme?.();
|
|
237
|
+
this.unsubscribeShadow?.();
|
|
238
|
+
this.unsubscribeShape?.();
|
|
239
|
+
this.unsubscribeTypo?.();
|
|
240
|
+
}
|
|
241
|
+
updated() {
|
|
242
|
+
if (this.open) {
|
|
243
|
+
queueMicrotask(() => this.updatePosition());
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
bindViewport() {
|
|
247
|
+
globalThis.addEventListener('resize', this.handleViewportChange);
|
|
248
|
+
globalThis.addEventListener('scroll', this.handleViewportChange, true);
|
|
249
|
+
}
|
|
250
|
+
unbindViewport() {
|
|
251
|
+
globalThis.removeEventListener('resize', this.handleViewportChange);
|
|
252
|
+
globalThis.removeEventListener('scroll', this.handleViewportChange, true);
|
|
253
|
+
}
|
|
254
|
+
updatePosition() {
|
|
255
|
+
const overlay = this.overlayEl;
|
|
256
|
+
const trigger = this.triggerEl;
|
|
257
|
+
if (!overlay || !trigger || !this.open)
|
|
258
|
+
return;
|
|
259
|
+
const anchorRect = trigger.getBoundingClientRect();
|
|
260
|
+
const overlayRect = overlay.getBoundingClientRect();
|
|
261
|
+
const pos = computeFloatingPosition(anchorRect, overlayRect, this.placement, { offset: 8 });
|
|
262
|
+
overlay.style.left = `${pos.left}px`;
|
|
263
|
+
overlay.style.top = `${pos.top}px`;
|
|
264
|
+
}
|
|
265
|
+
render() {
|
|
266
|
+
const displayLabel = t('appearance.label', 'Appearance');
|
|
267
|
+
return html `
|
|
268
|
+
<button class="trigger" type="button" @click=${this.toggleOpen}>
|
|
269
|
+
<span class="icon">✦</span>
|
|
270
|
+
<span class="trigger-label">${displayLabel}</span>
|
|
271
|
+
<span class=${classMap({ arrow: true, open: this.open })}>▾</span>
|
|
272
|
+
</button>
|
|
273
|
+
${this.open
|
|
274
|
+
? html `
|
|
275
|
+
<div class="overlay" role="menu">
|
|
276
|
+
<aithe-tree-menu
|
|
277
|
+
.items=${this.themeMenu}
|
|
278
|
+
.active=${this.getActiveId()}
|
|
279
|
+
.itemRenderer=${this.renderThemeItem}
|
|
280
|
+
@aithe-select=${this.handleTreeSelect}
|
|
281
|
+
></aithe-tree-menu>
|
|
282
|
+
</div>
|
|
283
|
+
`
|
|
284
|
+
: nothing}
|
|
285
|
+
`;
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
__decorate([
|
|
289
|
+
property({ type: String })
|
|
290
|
+
], AitheThemeSwitch.prototype, "placement", void 0);
|
|
291
|
+
__decorate([
|
|
292
|
+
property({ type: Boolean, attribute: 'icon-only' })
|
|
293
|
+
], AitheThemeSwitch.prototype, "iconOnly", void 0);
|
|
294
|
+
__decorate([
|
|
295
|
+
state()
|
|
296
|
+
], AitheThemeSwitch.prototype, "open", void 0);
|
|
297
|
+
__decorate([
|
|
298
|
+
state()
|
|
299
|
+
], AitheThemeSwitch.prototype, "currentTheme", void 0);
|
|
300
|
+
__decorate([
|
|
301
|
+
state()
|
|
302
|
+
], AitheThemeSwitch.prototype, "currentShadow", void 0);
|
|
303
|
+
__decorate([
|
|
304
|
+
state()
|
|
305
|
+
], AitheThemeSwitch.prototype, "currentShape", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
state()
|
|
308
|
+
], AitheThemeSwitch.prototype, "currentTypo", void 0);
|
|
309
|
+
__decorate([
|
|
310
|
+
query('.trigger')
|
|
311
|
+
], AitheThemeSwitch.prototype, "triggerEl", void 0);
|
|
312
|
+
__decorate([
|
|
313
|
+
query('.overlay')
|
|
314
|
+
], AitheThemeSwitch.prototype, "overlayEl", void 0);
|
|
315
|
+
AitheThemeSwitch = __decorate([
|
|
316
|
+
customElement('aithe-theme-switch')
|
|
317
|
+
], AitheThemeSwitch);
|
|
318
|
+
export { AitheThemeSwitch };
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, html, nothing } from 'lit';
|
|
8
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
9
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
+
import { AitheElement } from '../../core/aithe-element';
|
|
11
|
+
import { computeFloatingPosition } from '../../core/floating';
|
|
12
|
+
import { aitheBaseStyles } from '../../core/styles';
|
|
13
|
+
import { aitheUI } from '../../styles/aithe-ui';
|
|
14
|
+
import { typoMenu } from '../../styles/typo';
|
|
15
|
+
import { t } from '../../styles/i18n';
|
|
16
|
+
let AitheTypoPicker = class AitheTypoPicker extends AitheElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.placement = 'bottom-end';
|
|
20
|
+
/** Whether to show only the icon and arrow without the label text. 是否仅显示图标和箭头,不显示标签文字。 */
|
|
21
|
+
this.iconOnly = false;
|
|
22
|
+
this.open = false;
|
|
23
|
+
this.currentTypo = aitheUI.getTypo();
|
|
24
|
+
this.handleViewportChange = () => this.updatePosition();
|
|
25
|
+
this.handleOutsideClick = (event) => {
|
|
26
|
+
if (!this.open)
|
|
27
|
+
return;
|
|
28
|
+
if (!event.composedPath().includes(this)) {
|
|
29
|
+
this.open = false;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
this.toggleOpen = () => {
|
|
33
|
+
this.open = !this.open;
|
|
34
|
+
if (this.open) {
|
|
35
|
+
this.bindViewport();
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.unbindViewport();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
this.handleTreeSelect = (event) => {
|
|
42
|
+
const typo = event.detail.value;
|
|
43
|
+
if (!typo)
|
|
44
|
+
return;
|
|
45
|
+
this.open = false;
|
|
46
|
+
this.unbindViewport();
|
|
47
|
+
const notPrevented = this.emit('aithe-typo-change', { typo });
|
|
48
|
+
if (notPrevented) {
|
|
49
|
+
aitheUI.setTypo(typo);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static { this.styles = [
|
|
54
|
+
aitheBaseStyles,
|
|
55
|
+
css `
|
|
56
|
+
:host {
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
position: relative;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.trigger {
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: var(--aithe-space-2);
|
|
65
|
+
min-height: 34px;
|
|
66
|
+
padding: 0 var(--aithe-space-3);
|
|
67
|
+
border: 1px solid var(--aithe-color-border);
|
|
68
|
+
border-radius: var(--aithe-radius-full);
|
|
69
|
+
background: var(--aithe-color-surface);
|
|
70
|
+
color: var(--aithe-color-text);
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
font-size: var(--aithe-font-size-sm);
|
|
73
|
+
font-family: inherit;
|
|
74
|
+
transition:
|
|
75
|
+
border-color 0.15s,
|
|
76
|
+
background 0.15s;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.trigger:hover {
|
|
80
|
+
border-color: var(--aithe-primary-6);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([icon-only]) .trigger {
|
|
84
|
+
min-height: 32px;
|
|
85
|
+
min-width: 32px;
|
|
86
|
+
padding: 0 var(--aithe-space-1);
|
|
87
|
+
justify-content: center;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([icon-only]) .trigger-label {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.icon {
|
|
95
|
+
font-size: 14px;
|
|
96
|
+
color: var(--aithe-color-text-muted);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.arrow {
|
|
100
|
+
font-size: 10px;
|
|
101
|
+
color: var(--aithe-color-text-muted);
|
|
102
|
+
transition: transform var(--aithe-duration-fast) var(--aithe-ease-standard);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.arrow.open {
|
|
106
|
+
transform: rotate(180deg);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.overlay {
|
|
110
|
+
position: fixed;
|
|
111
|
+
z-index: var(--aithe-z-dropdown);
|
|
112
|
+
width: max-content;
|
|
113
|
+
min-width: 200px;
|
|
114
|
+
padding: var(--aithe-space-2);
|
|
115
|
+
border: 1px solid var(--aithe-color-border);
|
|
116
|
+
border-radius: var(--aithe-container-radius-lg);
|
|
117
|
+
background: var(--aithe-color-surface-elevated);
|
|
118
|
+
box-shadow: var(--aithe-shadow-3);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
aithe-tree-menu {
|
|
122
|
+
display: block;
|
|
123
|
+
width: 100%;
|
|
124
|
+
}
|
|
125
|
+
`,
|
|
126
|
+
]; }
|
|
127
|
+
getEffectiveTypo() {
|
|
128
|
+
return this.value ?? this.currentTypo;
|
|
129
|
+
}
|
|
130
|
+
connectedCallback() {
|
|
131
|
+
super.connectedCallback();
|
|
132
|
+
document.addEventListener('mousedown', this.handleOutsideClick);
|
|
133
|
+
this.unsubscribe = aitheUI.onTypoChange(() => {
|
|
134
|
+
this.currentTypo = aitheUI.getTypo();
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
disconnectedCallback() {
|
|
138
|
+
super.disconnectedCallback();
|
|
139
|
+
document.removeEventListener('mousedown', this.handleOutsideClick);
|
|
140
|
+
this.unbindViewport();
|
|
141
|
+
this.unsubscribe?.();
|
|
142
|
+
}
|
|
143
|
+
updated() {
|
|
144
|
+
if (this.open) {
|
|
145
|
+
queueMicrotask(() => this.updatePosition());
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
bindViewport() {
|
|
149
|
+
window.addEventListener('resize', this.handleViewportChange);
|
|
150
|
+
window.addEventListener('scroll', this.handleViewportChange, true);
|
|
151
|
+
}
|
|
152
|
+
unbindViewport() {
|
|
153
|
+
window.removeEventListener('resize', this.handleViewportChange);
|
|
154
|
+
window.removeEventListener('scroll', this.handleViewportChange, true);
|
|
155
|
+
}
|
|
156
|
+
updatePosition() {
|
|
157
|
+
const overlay = this.overlayEl;
|
|
158
|
+
const trigger = this.triggerEl;
|
|
159
|
+
if (!overlay || !trigger || !this.open)
|
|
160
|
+
return;
|
|
161
|
+
const anchorRect = trigger.getBoundingClientRect();
|
|
162
|
+
const overlayRect = overlay.getBoundingClientRect();
|
|
163
|
+
const pos = computeFloatingPosition(anchorRect, overlayRect, this.placement, { offset: 8 });
|
|
164
|
+
overlay.style.left = `${pos.left}px`;
|
|
165
|
+
overlay.style.top = `${pos.top}px`;
|
|
166
|
+
}
|
|
167
|
+
render() {
|
|
168
|
+
const effectiveTypo = this.getEffectiveTypo();
|
|
169
|
+
const displayLabel = t(`typoPicker.${effectiveTypo}`, effectiveTypo.charAt(0).toUpperCase() + effectiveTypo.slice(1));
|
|
170
|
+
return html `
|
|
171
|
+
<button class="trigger" type="button" @click=${this.toggleOpen}>
|
|
172
|
+
<span class="icon">✦</span>
|
|
173
|
+
<span class="trigger-label">${displayLabel}</span>
|
|
174
|
+
<span class=${classMap({ arrow: true, open: this.open })}>▾</span>
|
|
175
|
+
</button>
|
|
176
|
+
${this.open
|
|
177
|
+
? html `
|
|
178
|
+
<div class="overlay" role="menu">
|
|
179
|
+
<aithe-tree-menu
|
|
180
|
+
.items=${typoMenu}
|
|
181
|
+
.active=${effectiveTypo}
|
|
182
|
+
.itemRenderer=${(item) => item.icon
|
|
183
|
+
? html `<span
|
|
184
|
+
style="display:inline-block;width:24px;height:24px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:16px;color:var(--aithe-color-text-muted)"
|
|
185
|
+
>${item.icon}</span>`
|
|
186
|
+
: nothing}
|
|
187
|
+
@aithe-select=${this.handleTreeSelect}
|
|
188
|
+
></aithe-tree-menu>
|
|
189
|
+
</div>
|
|
190
|
+
`
|
|
191
|
+
: nothing}
|
|
192
|
+
`;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
__decorate([
|
|
196
|
+
property({ type: String })
|
|
197
|
+
], AitheTypoPicker.prototype, "placement", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
property({ type: Boolean, attribute: 'icon-only' })
|
|
200
|
+
], AitheTypoPicker.prototype, "iconOnly", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
property({ type: String })
|
|
203
|
+
], AitheTypoPicker.prototype, "value", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
state()
|
|
206
|
+
], AitheTypoPicker.prototype, "open", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
state()
|
|
209
|
+
], AitheTypoPicker.prototype, "currentTypo", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
query('.trigger')
|
|
212
|
+
], AitheTypoPicker.prototype, "triggerEl", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
query('.overlay')
|
|
215
|
+
], AitheTypoPicker.prototype, "overlayEl", void 0);
|
|
216
|
+
AitheTypoPicker = __decorate([
|
|
217
|
+
customElement('aithe-typo-picker')
|
|
218
|
+
], AitheTypoPicker);
|
|
219
|
+
export { AitheTypoPicker };
|
package/dist/core/AGENTS.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
| ---------- | --------------------- | ------------------------------------------------------------------------------------------- |
|
|
11
11
|
| 基类 | `aithe-element.ts` | 所有组件的基类,继承 LitElement,提供 theme/disabled/log 等公共属性和 `emit()` 事件发射方法 |
|
|
12
12
|
| 浮层 | `floating.ts` | 浮层定位引擎,用于 tooltip/popover/dropdown 等弹出层 |
|
|
13
|
-
| 锚定覆盖 | `anchored-overlay.ts` |
|
|
13
|
+
| 锚定覆盖 | `anchored-overlay.ts` | 锚定覆盖层组件,提供定位(含含入块偏移修正)+ 点击外部关闭 + 焦点管理 |
|
|
14
14
|
| 样式 | `styles.ts` | 基础样式集合,导出 `aitheBaseStyles` 供所有组件使用 |
|
|
15
15
|
| 类型 | `types.ts` | 核心类型定义 |
|
|
16
16
|
| 路由 | `router/index.ts` | 轻量前端路由,支持 hash/history 模式、动态路由、路由守卫 |
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
| Markdown | `markdown/` | Markdown 解析渲染模块,支持插件架构 |
|
|
20
20
|
| 日志 | `logger/` | 日志系统,支持 console 劫持、级别过滤、远程上报 |
|
|
21
21
|
| 自动表单 | `autoform/` | 表单控件类型注册表和规则引擎 |
|
|
22
|
+
| 过滤器 | `filter/` | 数据格式化框架,内置 amount/date/empty/bytes/timeAgo 过滤器,支持链式表达式 |
|
|
22
23
|
|
|
23
24
|
## 编码规范
|
|
24
25
|
|
|
@@ -36,3 +37,7 @@
|
|
|
36
37
|
- DataHub 适配器通过 `registerAdapter` 注册,可扩展
|
|
37
38
|
- 高亮引擎语言通过 `import './lang-xxx'` 副作用导入注册
|
|
38
39
|
- 路由守卫返回 `false` 阻止导航
|
|
40
|
+
- Filter 接口设计为无状态,参数通过 `apply(value, ...args)` 变参传入,工厂注册时 `new ctor()` 一次缓存复用
|
|
41
|
+
- Filter 表达式语法:`"filterName arg1 arg2 | filter2"`,管道符 `|` 分隔多个过滤器,从左到右依次执行
|
|
42
|
+
- MockAdapter 的 `mockData` 支持 `mockDelay` 模拟网络延迟,`mockPath` 加载本地 JSON 文件(无延迟)
|
|
43
|
+
- 测试文件统一放在模块下的 `__tests__/` 目录,利用 `package.json` 的 `files` 字段排除 src 发布
|
|
@@ -2,8 +2,8 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
import type { AitheVariant } from "../styles/types";
|
|
3
3
|
/**
|
|
4
4
|
* Base class for all Aithe UI components. Extends LitElement with theme awareness,
|
|
5
|
-
* accessibility helpers,
|
|
6
|
-
* 所有 Aithe UI 组件的基类。继承 LitElement
|
|
5
|
+
* accessibility helpers, a unified event emission API, and browser environment detection.
|
|
6
|
+
* 所有 Aithe UI 组件的基类。继承 LitElement,提供主题感知、无障碍辅助、统一事件发射 API 和浏览器环境检测。
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```ts
|