@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,482 @@
|
|
|
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, state } from 'lit/decorators.js';
|
|
9
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
+
import { AitheElement } from '../../core/aithe-element';
|
|
11
|
+
import { aitheBaseStyles } from '../../core/styles';
|
|
12
|
+
import { translateNodeLabel, onAitheLocaleChange } from '../../styles/i18n';
|
|
13
|
+
/**
|
|
14
|
+
* Data-driven tree menu with menu-style active highlighting and expand/collapse.
|
|
15
|
+
* 数据驱动的树形菜单,支持菜单样式高亮和展开/折叠。
|
|
16
|
+
*
|
|
17
|
+
* @fires aithe-select - Emitted when a menu item is selected with `{ value }`. 菜单项选中时发出 `{ value }`。
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <aithe-tree-menu
|
|
22
|
+
* items='[{"label":"Dashboard","id":"dashboard","icon":"home"},{"label":"Settings","id":"settings","icon":"settings","children":[{"label":"Profile","id":"profile"},{"label":"Security","id":"security"}]}]'
|
|
23
|
+
* active="dashboard"
|
|
24
|
+
* ></aithe-tree-menu>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
let AitheTreeMenu = class AitheTreeMenu extends AitheElement {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
/** JSON string of tree menu items (parsed into `items`). 树菜单项的 JSON 字符串(解析为 `items`)。 */
|
|
31
|
+
this.itemsJson = '';
|
|
32
|
+
/** Array of tree menu items (prefer this over `itemsJson` in JS). 树菜单项数组(在 JS 中优先使用此属性而非 `itemsJson`)。 */
|
|
33
|
+
this.items = [];
|
|
34
|
+
/** Active (selected) menu item value. 当前选中的菜单项值。 */
|
|
35
|
+
this.active = '';
|
|
36
|
+
/** Whether all nodes are expanded by default. 是否默认展开所有节点。 */
|
|
37
|
+
this.expandAll = false;
|
|
38
|
+
/** Layout direction: vertical (stacked) or horizontal (inline). 布局方向:垂直(堆叠)或水平(行内)。 */
|
|
39
|
+
this.direction = 'vertical';
|
|
40
|
+
/** Whether the tree menu supports collapse/expand toggle. 树菜单是否支持伸缩切换。 */
|
|
41
|
+
this.collapsible = false;
|
|
42
|
+
/** Whether the tree menu is currently collapsed. 树菜单当前是否收起。 */
|
|
43
|
+
this.collapsed = false;
|
|
44
|
+
/** Width when collapsed (CSS value). 收起时的宽度。 */
|
|
45
|
+
this.collapsedWidth = '64px';
|
|
46
|
+
/** Width when expanded (CSS value). 展开时的宽度。 */
|
|
47
|
+
this.expandedWidth = '260px';
|
|
48
|
+
/**
|
|
49
|
+
* Filter callback for menu items. Return `true` to show the item, `false` to hide it.
|
|
50
|
+
* Useful for permission-based access control.
|
|
51
|
+
* 菜单项过滤回调。返回 `true` 显示该项,返回 `false` 隐藏该项。适用于基于权限的访问控制。
|
|
52
|
+
*/
|
|
53
|
+
this.itemFilter = null;
|
|
54
|
+
/**
|
|
55
|
+
* Custom item renderer. When provided, this function is called for each leaf item
|
|
56
|
+
* and its return value is rendered inside the `<button>` element, replacing the
|
|
57
|
+
* default icon/label rendering. Useful for rendering custom previews like color dots,
|
|
58
|
+
* shape previews, etc.
|
|
59
|
+
* 自定义 item 渲染器。当提供时,每个叶子项都会调用此函数,返回值渲染在 `<button>` 内部,
|
|
60
|
+
* 替换默认的图标/标签渲染。适用于渲染自定义预览,如颜色圆点、形状预览等。
|
|
61
|
+
*
|
|
62
|
+
* The function receives the item metadata and should return a `TemplateResult` or `nothing`.
|
|
63
|
+
* 函数接收 item 元数据,应返回 `TemplateResult` 或 `nothing`。
|
|
64
|
+
*/
|
|
65
|
+
this.itemRenderer = null;
|
|
66
|
+
this.expanded = new Set();
|
|
67
|
+
this.handleDocumentPointer = (event) => {
|
|
68
|
+
if (this.direction === 'horizontal' && !event.composedPath().includes(this)) {
|
|
69
|
+
this.expanded = new Set();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
connectedCallback() {
|
|
74
|
+
super.connectedCallback();
|
|
75
|
+
document.addEventListener('mousedown', this.handleDocumentPointer);
|
|
76
|
+
this.unsubscribeLocale = onAitheLocaleChange(() => this.requestUpdate());
|
|
77
|
+
}
|
|
78
|
+
disconnectedCallback() {
|
|
79
|
+
super.disconnectedCallback();
|
|
80
|
+
document.removeEventListener('mousedown', this.handleDocumentPointer);
|
|
81
|
+
this.unsubscribeLocale?.();
|
|
82
|
+
}
|
|
83
|
+
static { this.styles = [
|
|
84
|
+
aitheBaseStyles,
|
|
85
|
+
css `
|
|
86
|
+
:host {
|
|
87
|
+
display: block;
|
|
88
|
+
transition: width var(--aithe-duration-base, 0.2s) var(--aithe-ease-standard, ease);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host([collapsed]) {
|
|
92
|
+
width: var(--aithe-tree-menu-collapsed-width, 64px);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.menu {
|
|
96
|
+
display: grid;
|
|
97
|
+
gap: var(--aithe-space-2);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.menu.horizontal {
|
|
101
|
+
grid-auto-flow: column;
|
|
102
|
+
align-items: center;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([collapsed]) .item-label,
|
|
106
|
+
:host([collapsed]) .group-toggle-text,
|
|
107
|
+
:host([collapsed]) .arrow {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:host([collapsed]) .item {
|
|
112
|
+
justify-content: center;
|
|
113
|
+
padding: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([collapsed]) .group-toggle {
|
|
117
|
+
justify-content: center;
|
|
118
|
+
padding: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host([collapsed]) .group-toggle-label {
|
|
122
|
+
justify-content: center;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host([collapsed]) .children {
|
|
126
|
+
padding-left: 0;
|
|
127
|
+
position: relative;
|
|
128
|
+
z-index: var(--aithe-z-dropdown, 1000);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.item {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: var(--aithe-space-3);
|
|
135
|
+
width: 100%;
|
|
136
|
+
min-height: 42px;
|
|
137
|
+
padding: 0 var(--aithe-space-4);
|
|
138
|
+
border: none;
|
|
139
|
+
border-radius: var(--aithe-radius-md);
|
|
140
|
+
background: transparent;
|
|
141
|
+
color: var(--aithe-color-text-muted);
|
|
142
|
+
text-align: left;
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.item-icon {
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
color: var(--aithe-color-text-muted);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.fallback-icon {
|
|
152
|
+
display: inline-flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
width: 24px;
|
|
156
|
+
height: 24px;
|
|
157
|
+
font-size: 14px;
|
|
158
|
+
font-weight: var(--aithe-font-weight-bold);
|
|
159
|
+
line-height: 1;
|
|
160
|
+
border-radius: var(--aithe-radius-sm, 3px);
|
|
161
|
+
background: var(--aithe-color-surface-muted);
|
|
162
|
+
color: var(--aithe-color-text-muted);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.item.active .fallback-icon {
|
|
166
|
+
background: transparent;
|
|
167
|
+
color: var(--aithe-color-text-on-primary, #ffffff);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.group-toggle.active .fallback-icon {
|
|
171
|
+
background: var(--aithe-primary-6);
|
|
172
|
+
color: var(--aithe-color-text-on-primary, #ffffff);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.item.active {
|
|
176
|
+
background: linear-gradient(180deg, var(--aithe-primary-6), var(--aithe-primary-7));
|
|
177
|
+
color: var(--aithe-color-text-on-primary, #ffffff);
|
|
178
|
+
box-shadow: var(--aithe-shadow-2);
|
|
179
|
+
padding: var(--aithe-space-1) var(--aithe-space-3);
|
|
180
|
+
margin: 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.item.active .item-icon {
|
|
184
|
+
color: var(--aithe-color-text-on-primary, #ffffff);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.item:hover:not(:disabled):not(.active) {
|
|
188
|
+
background: var(--aithe-color-surface-muted);
|
|
189
|
+
color: var(--aithe-color-text);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.item:disabled {
|
|
193
|
+
opacity: 0.48;
|
|
194
|
+
cursor: not-allowed;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.divider {
|
|
198
|
+
height: 1px;
|
|
199
|
+
margin: var(--aithe-space-2) 0;
|
|
200
|
+
background: var(--aithe-color-border);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.item.primary {
|
|
204
|
+
color: var(--aithe-primary-7);
|
|
205
|
+
}
|
|
206
|
+
.item.success {
|
|
207
|
+
color: var(--aithe-success-7);
|
|
208
|
+
}
|
|
209
|
+
.item.warning {
|
|
210
|
+
color: var(--aithe-warning-7);
|
|
211
|
+
}
|
|
212
|
+
.item.danger {
|
|
213
|
+
color: var(--aithe-danger-7);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.item.active.primary,
|
|
217
|
+
.item.active.success,
|
|
218
|
+
.item.active.warning,
|
|
219
|
+
.item.active.danger {
|
|
220
|
+
color: var(--aithe-color-text-on-primary, #ffffff);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.group-toggle {
|
|
224
|
+
display: flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
gap: var(--aithe-space-3);
|
|
227
|
+
width: 100%;
|
|
228
|
+
min-height: 42px;
|
|
229
|
+
padding: 0 var(--aithe-space-4);
|
|
230
|
+
border: none;
|
|
231
|
+
border-radius: var(--aithe-radius-md);
|
|
232
|
+
background: transparent;
|
|
233
|
+
color: var(--aithe-color-text-muted);
|
|
234
|
+
text-align: left;
|
|
235
|
+
cursor: pointer;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.group-toggle-label {
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
gap: var(--aithe-space-2);
|
|
242
|
+
flex: 1;
|
|
243
|
+
min-width: 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.group-toggle-icon {
|
|
247
|
+
flex-shrink: 0;
|
|
248
|
+
color: var(--aithe-color-text-muted);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.group-toggle.active {
|
|
252
|
+
color: var(--aithe-color-text);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.group-toggle:hover:not(:disabled) {
|
|
256
|
+
background: var(--aithe-color-surface-muted);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.group-toggle:disabled {
|
|
260
|
+
opacity: 0.48;
|
|
261
|
+
cursor: not-allowed;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.group-toggle.primary {
|
|
265
|
+
color: var(--aithe-primary-7);
|
|
266
|
+
}
|
|
267
|
+
.group-toggle.success {
|
|
268
|
+
color: var(--aithe-success-7);
|
|
269
|
+
}
|
|
270
|
+
.group-toggle.warning {
|
|
271
|
+
color: var(--aithe-warning-7);
|
|
272
|
+
}
|
|
273
|
+
.group-toggle.danger {
|
|
274
|
+
color: var(--aithe-danger-7);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.arrow {
|
|
278
|
+
transition: transform var(--aithe-duration-fast) var(--aithe-ease-standard);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.arrow.open {
|
|
282
|
+
transform: rotate(180deg);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.children {
|
|
286
|
+
display: grid;
|
|
287
|
+
gap: var(--aithe-space-2);
|
|
288
|
+
padding-left: var(--aithe-space-4);
|
|
289
|
+
padding-top: var(--aithe-space-2);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.horizontal .children {
|
|
293
|
+
position: absolute;
|
|
294
|
+
top: calc(100% + var(--aithe-space-2));
|
|
295
|
+
left: 0;
|
|
296
|
+
z-index: var(--aithe-z-dropdown);
|
|
297
|
+
padding: var(--aithe-space-2);
|
|
298
|
+
min-width: 180px;
|
|
299
|
+
border: 1px solid var(--aithe-color-border);
|
|
300
|
+
border-radius: var(--aithe-container-radius-lg);
|
|
301
|
+
background: var(--aithe-color-surface-elevated);
|
|
302
|
+
box-shadow: var(--aithe-shadow-3);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.horizontal .group-wrapper {
|
|
306
|
+
position: relative;
|
|
307
|
+
}
|
|
308
|
+
`,
|
|
309
|
+
]; }
|
|
310
|
+
willUpdate(changed) {
|
|
311
|
+
if (changed.has('itemsJson') && this.itemsJson) {
|
|
312
|
+
try {
|
|
313
|
+
this.items = JSON.parse(this.itemsJson);
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
this.items = [];
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
updated(changed) {
|
|
321
|
+
if (changed.has('expandAll') && this.expandAll) {
|
|
322
|
+
this.expanded = new Set(this.collectKeys(this.items));
|
|
323
|
+
}
|
|
324
|
+
if (changed.has('collapsed') || changed.has('expandedWidth') || changed.has('collapsedWidth')) {
|
|
325
|
+
this.applyWidth();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
applyWidth() {
|
|
329
|
+
if (this.collapsed) {
|
|
330
|
+
this.style.setProperty('--aithe-tree-menu-collapsed-width', this.collapsedWidth);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
collectKeys(items) {
|
|
334
|
+
return items.flatMap((item) => item.children?.length ? [item.id, ...this.collectKeys(item.children)] : []);
|
|
335
|
+
}
|
|
336
|
+
isGroupActive(item) {
|
|
337
|
+
if (item.id === this.active)
|
|
338
|
+
return true;
|
|
339
|
+
return item.children?.some((child) => this.isGroupActive(child)) ?? false;
|
|
340
|
+
}
|
|
341
|
+
toggleExpand(key) {
|
|
342
|
+
const next = new Set(this.expanded);
|
|
343
|
+
if (next.has(key)) {
|
|
344
|
+
next.delete(key);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
next.add(key);
|
|
348
|
+
}
|
|
349
|
+
this.expanded = next;
|
|
350
|
+
}
|
|
351
|
+
selectItem(item) {
|
|
352
|
+
this.active = item.id;
|
|
353
|
+
this.emit('aithe-select', { value: item.id, item });
|
|
354
|
+
}
|
|
355
|
+
renderIcon(item, cls) {
|
|
356
|
+
if (item.icon) {
|
|
357
|
+
return html `
|
|
358
|
+
<aithe-icon class=${cls} name=${item.icon} size="16"></aithe-icon>
|
|
359
|
+
`;
|
|
360
|
+
}
|
|
361
|
+
if (this.collapsed) {
|
|
362
|
+
const ch = translateNodeLabel(item).charAt(0).toUpperCase();
|
|
363
|
+
return html `
|
|
364
|
+
<span class="${cls} fallback-icon">${ch}</span>
|
|
365
|
+
`;
|
|
366
|
+
}
|
|
367
|
+
return nothing;
|
|
368
|
+
}
|
|
369
|
+
renderItems(items, isHorizontal = false, depth = 0) {
|
|
370
|
+
const filter = this.itemFilter ?? ((item) => item.hasPermission !== false);
|
|
371
|
+
const visible = items.filter((item) => filter(item, depth));
|
|
372
|
+
return visible.flatMap((item) => {
|
|
373
|
+
const hasChildren = Boolean(item.children?.length);
|
|
374
|
+
const isActive = item.id === this.active;
|
|
375
|
+
const isExpanded = this.expanded.has(item.id);
|
|
376
|
+
const intentClass = item.variant && item.variant !== 'default' ? item.variant : '';
|
|
377
|
+
const nodeType = item.type || 'item';
|
|
378
|
+
const result = [];
|
|
379
|
+
if (nodeType === 'divider') {
|
|
380
|
+
result.push(html `<div class="divider" role="separator"></div>`);
|
|
381
|
+
return result;
|
|
382
|
+
}
|
|
383
|
+
if (hasChildren) {
|
|
384
|
+
result.push(html `
|
|
385
|
+
<div class=${isHorizontal ? 'group-wrapper' : nothing}>
|
|
386
|
+
<button
|
|
387
|
+
class=${classMap({
|
|
388
|
+
'group-toggle': true,
|
|
389
|
+
active: this.isGroupActive(item),
|
|
390
|
+
[intentClass]: !!intentClass,
|
|
391
|
+
})}
|
|
392
|
+
type="button"
|
|
393
|
+
?disabled=${item.disabled}
|
|
394
|
+
title=${this.collapsed ? translateNodeLabel(item) : ''}
|
|
395
|
+
aria-expanded=${String(isExpanded)}
|
|
396
|
+
@click=${() => this.toggleExpand(item.id)}
|
|
397
|
+
>
|
|
398
|
+
<span class="group-toggle-label">
|
|
399
|
+
${this.renderIcon(item, 'group-toggle-icon')}
|
|
400
|
+
<span class="group-toggle-text">${translateNodeLabel(item)}</span>
|
|
401
|
+
</span>
|
|
402
|
+
<span class=${classMap({ arrow: true, open: isExpanded })}>⌄</span>
|
|
403
|
+
</button>
|
|
404
|
+
<div class="children" ?hidden=${!isExpanded}>
|
|
405
|
+
${this.renderItems(item.children, false, depth + 1)}
|
|
406
|
+
</div>
|
|
407
|
+
</div>
|
|
408
|
+
`);
|
|
409
|
+
return result;
|
|
410
|
+
}
|
|
411
|
+
let iconContent;
|
|
412
|
+
if (this.itemRenderer) {
|
|
413
|
+
iconContent = this.itemRenderer(item);
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
iconContent = this.renderIcon(item, 'item-icon');
|
|
417
|
+
}
|
|
418
|
+
result.push(html `
|
|
419
|
+
<button
|
|
420
|
+
class=${classMap({ item: true, active: isActive, [intentClass]: !!intentClass })}
|
|
421
|
+
type="button"
|
|
422
|
+
role="menuitem"
|
|
423
|
+
?disabled=${item.disabled}
|
|
424
|
+
title=${this.collapsed ? translateNodeLabel(item) : ''}
|
|
425
|
+
@click=${() => this.selectItem(item)}
|
|
426
|
+
>
|
|
427
|
+
${iconContent}
|
|
428
|
+
<span class="item-label">${translateNodeLabel(item)}</span>
|
|
429
|
+
</button>
|
|
430
|
+
`);
|
|
431
|
+
return result;
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
render() {
|
|
435
|
+
const isHorizontal = this.direction === 'horizontal';
|
|
436
|
+
return html `
|
|
437
|
+
<div class=${classMap({ menu: true, horizontal: isHorizontal })}>
|
|
438
|
+
${this.renderItems(this.items, isHorizontal)}
|
|
439
|
+
</div>
|
|
440
|
+
`;
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
__decorate([
|
|
444
|
+
property({ type: String, attribute: 'items' })
|
|
445
|
+
], AitheTreeMenu.prototype, "itemsJson", void 0);
|
|
446
|
+
__decorate([
|
|
447
|
+
property({ attribute: false })
|
|
448
|
+
], AitheTreeMenu.prototype, "items", void 0);
|
|
449
|
+
__decorate([
|
|
450
|
+
property({ type: String })
|
|
451
|
+
], AitheTreeMenu.prototype, "active", void 0);
|
|
452
|
+
__decorate([
|
|
453
|
+
property({ type: Boolean, attribute: 'expand-all' })
|
|
454
|
+
], AitheTreeMenu.prototype, "expandAll", void 0);
|
|
455
|
+
__decorate([
|
|
456
|
+
property({ type: String })
|
|
457
|
+
], AitheTreeMenu.prototype, "direction", void 0);
|
|
458
|
+
__decorate([
|
|
459
|
+
property({ type: Boolean })
|
|
460
|
+
], AitheTreeMenu.prototype, "collapsible", void 0);
|
|
461
|
+
__decorate([
|
|
462
|
+
property({ type: Boolean, reflect: true })
|
|
463
|
+
], AitheTreeMenu.prototype, "collapsed", void 0);
|
|
464
|
+
__decorate([
|
|
465
|
+
property({ type: String, attribute: 'collapsed-width' })
|
|
466
|
+
], AitheTreeMenu.prototype, "collapsedWidth", void 0);
|
|
467
|
+
__decorate([
|
|
468
|
+
property({ type: String, attribute: 'expanded-width' })
|
|
469
|
+
], AitheTreeMenu.prototype, "expandedWidth", void 0);
|
|
470
|
+
__decorate([
|
|
471
|
+
property({ attribute: false })
|
|
472
|
+
], AitheTreeMenu.prototype, "itemFilter", void 0);
|
|
473
|
+
__decorate([
|
|
474
|
+
property({ attribute: false })
|
|
475
|
+
], AitheTreeMenu.prototype, "itemRenderer", void 0);
|
|
476
|
+
__decorate([
|
|
477
|
+
state()
|
|
478
|
+
], AitheTreeMenu.prototype, "expanded", void 0);
|
|
479
|
+
AitheTreeMenu = __decorate([
|
|
480
|
+
customElement('aithe-tree-menu')
|
|
481
|
+
], AitheTreeMenu);
|
|
482
|
+
export { AitheTreeMenu };
|