@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,228 @@
|
|
|
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 } from 'lit/decorators.js';
|
|
9
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
+
import { AitheElement } from '../../core/aithe-element';
|
|
11
|
+
import { aitheBaseStyles, aithePanelStyles } from '../../core/styles';
|
|
12
|
+
import { t } from '../../styles/i18n';
|
|
13
|
+
/**
|
|
14
|
+
* Lightweight confirm dialog with cancel/confirm actions.
|
|
15
|
+
* 轻量级确认对话框,支持取消/确认操作。
|
|
16
|
+
*
|
|
17
|
+
* @slot - Default slot for dialog body content. 对话框正文内容。
|
|
18
|
+
* @fires aithe-confirm - Emitted when the confirm button is clicked. 确认按钮点击时触发。
|
|
19
|
+
* @fires aithe-cancel - Emitted when the cancel button or close button is clicked. 取消或关闭按钮点击时触发。
|
|
20
|
+
* @example
|
|
21
|
+
* ```html
|
|
22
|
+
* <aithe-dialog title="Delete item?" visible confirm-text="Delete" cancel-text="Cancel">
|
|
23
|
+
* This action cannot be undone.
|
|
24
|
+
* </aithe-dialog>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
let AitheDialog = class AitheDialog extends AitheElement {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
/** Dialog title text. 对话框标题文本。 */
|
|
31
|
+
this.title = 'Confirm';
|
|
32
|
+
/** Icon name to display before the title. 在标题前显示的图标名称。 */
|
|
33
|
+
this.icon = '';
|
|
34
|
+
/** Whether the dialog is visible. 是否显示对话框。 */
|
|
35
|
+
this.visible = false;
|
|
36
|
+
/** Whether the dialog can be closed via close button or Escape. 是否可通过关闭按钮或 Escape 关闭。 */
|
|
37
|
+
this.closeable = true;
|
|
38
|
+
/** Whether a backdrop mask is shown. 是否显示背景遮罩。 */
|
|
39
|
+
this.mask = true;
|
|
40
|
+
/** Confirm button label text. 确认按钮文本。 */
|
|
41
|
+
this.confirmText = '';
|
|
42
|
+
/** Cancel button label text. 取消按钮文本。 */
|
|
43
|
+
this.cancelText = '';
|
|
44
|
+
/** Closes dialog on Escape key press. 按 Escape 键关闭对话框。 */
|
|
45
|
+
this.handleKeydown = (event) => {
|
|
46
|
+
if (event.key === 'Escape' && this.visible) {
|
|
47
|
+
this.cancel();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
/** Hides dialog and emits cancel event. 隐藏对话框并触发取消事件。 */
|
|
51
|
+
this.cancel = () => {
|
|
52
|
+
this.visible = false;
|
|
53
|
+
this.emit('aithe-cancel');
|
|
54
|
+
};
|
|
55
|
+
/** Hides dialog and emits confirm event. 隐藏对话框并触发确认事件。 */
|
|
56
|
+
this.confirm = () => {
|
|
57
|
+
this.visible = false;
|
|
58
|
+
this.emit('aithe-confirm');
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
static { this.styles = [
|
|
62
|
+
aitheBaseStyles,
|
|
63
|
+
aithePanelStyles('.panel'),
|
|
64
|
+
css `
|
|
65
|
+
:host {
|
|
66
|
+
display: contents;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.overlay {
|
|
70
|
+
position: fixed;
|
|
71
|
+
inset: 0;
|
|
72
|
+
z-index: var(--aithe-z-modal);
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
padding: var(--aithe-space-lg);
|
|
77
|
+
background: var(--aithe-color-overlay);
|
|
78
|
+
opacity: 0;
|
|
79
|
+
pointer-events: none;
|
|
80
|
+
transition: opacity var(--aithe-duration-base) var(--aithe-ease-standard);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.overlay.visible {
|
|
84
|
+
opacity: 1;
|
|
85
|
+
pointer-events: auto;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.panel {
|
|
89
|
+
width: min(100%, 420px);
|
|
90
|
+
display: grid;
|
|
91
|
+
gap: var(--aithe-space-4);
|
|
92
|
+
padding: var(--aithe-space-lg);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.head,
|
|
96
|
+
.foot {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: space-between;
|
|
100
|
+
gap: var(--aithe-space-3);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.title {
|
|
104
|
+
margin: 0;
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: var(--aithe-space-2);
|
|
108
|
+
font-size: var(--aithe-font-size-lg);
|
|
109
|
+
font-weight: var(--aithe-font-weight-semibold);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.title-icon {
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
color: var(--aithe-color-text-muted);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.content {
|
|
118
|
+
color: var(--aithe-color-text-muted);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.actions {
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
gap: var(--aithe-space-2);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
button {
|
|
127
|
+
min-height: 38px;
|
|
128
|
+
padding: 0 var(--aithe-space-4);
|
|
129
|
+
border: 1px solid var(--aithe-color-border);
|
|
130
|
+
border-radius: var(--aithe-radius-md);
|
|
131
|
+
background: var(--aithe-color-surface);
|
|
132
|
+
color: var(--aithe-color-text);
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.primary {
|
|
137
|
+
border-color: transparent;
|
|
138
|
+
background: linear-gradient(180deg, var(--aithe-primary-6), var(--aithe-primary-7));
|
|
139
|
+
color: var(--aithe-color-text-on-primary, #ffffff);
|
|
140
|
+
}
|
|
141
|
+
`,
|
|
142
|
+
]; }
|
|
143
|
+
connectedCallback() {
|
|
144
|
+
super.connectedCallback();
|
|
145
|
+
document.addEventListener('keydown', this.handleKeydown);
|
|
146
|
+
}
|
|
147
|
+
disconnectedCallback() {
|
|
148
|
+
super.disconnectedCallback();
|
|
149
|
+
document.removeEventListener('keydown', this.handleKeydown);
|
|
150
|
+
}
|
|
151
|
+
render() {
|
|
152
|
+
const confirmLabel = this.confirmText || t('form.dialog.confirmText');
|
|
153
|
+
const cancelLabel = this.cancelText || t('form.dialog.cancelText');
|
|
154
|
+
return html `
|
|
155
|
+
<div
|
|
156
|
+
class=${classMap({ overlay: true, visible: this.visible })}
|
|
157
|
+
@click=${(event) => {
|
|
158
|
+
if (this.mask && event.target === event.currentTarget) {
|
|
159
|
+
this.cancel();
|
|
160
|
+
}
|
|
161
|
+
}}
|
|
162
|
+
>
|
|
163
|
+
<div
|
|
164
|
+
class="panel"
|
|
165
|
+
role="dialog"
|
|
166
|
+
aria-modal="true"
|
|
167
|
+
@click=${(event) => event.stopPropagation()}
|
|
168
|
+
>
|
|
169
|
+
<div class="head">
|
|
170
|
+
<h3 class="title">
|
|
171
|
+
${this.icon
|
|
172
|
+
? html `
|
|
173
|
+
<aithe-icon class="title-icon" name=${this.icon} size="18"></aithe-icon>
|
|
174
|
+
`
|
|
175
|
+
: nothing}${this.title}
|
|
176
|
+
</h3>
|
|
177
|
+
${this.closeable
|
|
178
|
+
? html `
|
|
179
|
+
<button
|
|
180
|
+
type="button"
|
|
181
|
+
aria-label=${t('form.dialog.closeAriaLabel')}
|
|
182
|
+
@click=${this.cancel}
|
|
183
|
+
>
|
|
184
|
+
×
|
|
185
|
+
</button>
|
|
186
|
+
`
|
|
187
|
+
: null}
|
|
188
|
+
</div>
|
|
189
|
+
<div class="content">
|
|
190
|
+
<slot></slot>
|
|
191
|
+
</div>
|
|
192
|
+
<div class="foot">
|
|
193
|
+
<span></span>
|
|
194
|
+
<div class="actions">
|
|
195
|
+
<button type="button" @click=${this.cancel}>${cancelLabel}</button>
|
|
196
|
+
<button class="primary" type="button" @click=${this.confirm}>${confirmLabel}</button>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
`;
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
__decorate([
|
|
205
|
+
property({ type: String })
|
|
206
|
+
], AitheDialog.prototype, "title", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
property({ type: String })
|
|
209
|
+
], AitheDialog.prototype, "icon", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
property({ type: Boolean, reflect: true })
|
|
212
|
+
], AitheDialog.prototype, "visible", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
property({ type: Boolean })
|
|
215
|
+
], AitheDialog.prototype, "closeable", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
property({ type: Boolean })
|
|
218
|
+
], AitheDialog.prototype, "mask", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
property({ type: String, attribute: 'confirm-text' })
|
|
221
|
+
], AitheDialog.prototype, "confirmText", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
property({ type: String, attribute: 'cancel-text' })
|
|
224
|
+
], AitheDialog.prototype, "cancelText", void 0);
|
|
225
|
+
AitheDialog = __decorate([
|
|
226
|
+
customElement('aithe-dialog')
|
|
227
|
+
], AitheDialog);
|
|
228
|
+
export { AitheDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAM1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD;;;;;;;;;;;;;;GAcG;AACH,qBACa,WAAY,SAAQ,YAAY;IAC3C,0CAA0C;IACE,IAAI,UAAS;IACzD,iCAAiC;IACL,KAAK,SAAM;IACvC,0DAA0D;IAC9B,IAAI,SAAM;IACtC,uDAAuD;IAC3B,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAW;IACrF,iFAAiF;IACrD,IAAI,SAAW;IAC3C,uFAAuF;IAC3D,KAAK,SAAM;IACvC,wEAAwE;IACf,WAAW,UAAQ;IAC5E,kEAAkE;IACV,UAAU,UAAQ;IAEzD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAc;IACX,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAE/E,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,aAAa,CAAS;IAEvC,OAAO,CAAC,WAAW,CAA4B;IAE/C,MAAM,CAAC,QAAQ,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAM1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD;;;;;;;;;;;;;;GAcG;AACH,qBACa,WAAY,SAAQ,YAAY;IAC3C,0CAA0C;IACE,IAAI,UAAS;IACzD,iCAAiC;IACL,KAAK,SAAM;IACvC,0DAA0D;IAC9B,IAAI,SAAM;IACtC,uDAAuD;IAC3B,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAW;IACrF,iFAAiF;IACrD,IAAI,SAAW;IAC3C,uFAAuF;IAC3D,KAAK,SAAM;IACvC,wEAAwE;IACf,WAAW,UAAQ;IAC5E,kEAAkE;IACV,UAAU,UAAQ;IAEzD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAc;IACX,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAE/E,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,aAAa,CAAS;IAEvC,OAAO,CAAC,WAAW,CAA4B;IAE/C,MAAM,CAAC,QAAQ,CAAC,MAAM,0DA6HpB;IAEF,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAK5B,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAqBtD,wEAAwE;IACxE,OAAO,CAAC,gBAAgB;IAWxB,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAGxB;IAEF,2DAA2D;IAC3D,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAIpC;IAEF,0DAA0D;IAC1D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAMlC;IAEF,8BAA8B;IAC9B,IAAI,QAAO,IAAI,CAEb;IAEF,+BAA+B;IAC/B,IAAI,QAAO,IAAI,CAEb;IAEF,MAAM;CAwDP"}
|
|
@@ -0,0 +1,338 @@
|
|
|
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, queryAssignedElements, state } from 'lit/decorators.js';
|
|
9
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
11
|
+
import { AitheElement } from '../../core/aithe-element';
|
|
12
|
+
import { aitheBaseStyles, aithePanelStyles } from '../../core/styles';
|
|
13
|
+
import { t } from '../../styles/i18n';
|
|
14
|
+
/**
|
|
15
|
+
* Side drawer panel that slides in from any edge of the viewport.
|
|
16
|
+
* 侧边抽屉面板,从视口任意边缘滑入。
|
|
17
|
+
*
|
|
18
|
+
* @slot - Default slot for drawer body content. 抽屉正文内容。
|
|
19
|
+
* @slot header - Custom header content (overrides title property). 自定义头部内容。
|
|
20
|
+
* @slot footer - Footer action area. 底部操作区域。
|
|
21
|
+
* @fires aithe-open-change - Emitted when open state changes, with `{ open }`. 开关状态变更时触发。
|
|
22
|
+
* @example
|
|
23
|
+
* ```html
|
|
24
|
+
* <aithe-drawer title="Details" placement="right" size="420px">
|
|
25
|
+
* <p>Drawer content here.</p>
|
|
26
|
+
* </aithe-drawer>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
let AitheDrawer = class AitheDrawer extends AitheElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
/** Whether the drawer is open. 是否打开抽屉。 */
|
|
33
|
+
this.open = false;
|
|
34
|
+
/** Drawer title text. 抽屉标题文本。 */
|
|
35
|
+
this.title = '';
|
|
36
|
+
/** Icon name to display before the title. 在标题前显示的图标名称。 */
|
|
37
|
+
this.icon = '';
|
|
38
|
+
/** Edge from which the drawer slides in. 抽屉滑入的边缘方向。 */
|
|
39
|
+
this.placement = 'right';
|
|
40
|
+
/** Drawer width (for left/right) or height (for top/bottom). 抽屉宽度(左右)或高度(上下)。 */
|
|
41
|
+
this.size = '420px';
|
|
42
|
+
/** CSS selector for a mount target element (teleports the drawer). 挂载目标元素的 CSS 选择器。 */
|
|
43
|
+
this.mount = '';
|
|
44
|
+
/** Whether clicking the backdrop mask closes the drawer. 点击遮罩是否关闭抽屉。 */
|
|
45
|
+
this.closeOnMask = true;
|
|
46
|
+
/** Whether pressing Escape closes the drawer. 按 Escape 是否关闭抽屉。 */
|
|
47
|
+
this.closeOnEsc = true;
|
|
48
|
+
this.hasHeaderSlot = false;
|
|
49
|
+
this.hasFooterSlot = false;
|
|
50
|
+
this.lastFocused = null;
|
|
51
|
+
/** Syncs header/footer slot presence state. 同步头部/底部插槽状态。 */
|
|
52
|
+
this.syncSlots = () => {
|
|
53
|
+
this.hasHeaderSlot = this.headerNodes.length > 0;
|
|
54
|
+
this.hasFooterSlot = this.footerNodes.length > 0;
|
|
55
|
+
};
|
|
56
|
+
/** Handles Escape key to close drawer. 处理 Escape 键关闭抽屉。 */
|
|
57
|
+
this.handleDocumentKeydown = (event) => {
|
|
58
|
+
if (event.key === 'Escape' && this.closeOnEsc && this.open) {
|
|
59
|
+
this.hide();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
/** Handles backdrop click to close drawer. 处理遮罩点击关闭抽屉。 */
|
|
63
|
+
this.handleBackdropClick = (event) => {
|
|
64
|
+
if (!this.closeOnMask || event.target !== event.currentTarget) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.hide();
|
|
68
|
+
};
|
|
69
|
+
/** Opens the drawer. 打开抽屉。 */
|
|
70
|
+
this.show = () => {
|
|
71
|
+
this.open = true;
|
|
72
|
+
};
|
|
73
|
+
/** Closes the drawer. 关闭抽屉。 */
|
|
74
|
+
this.hide = () => {
|
|
75
|
+
this.open = false;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
static { this.styles = [
|
|
79
|
+
aitheBaseStyles,
|
|
80
|
+
aithePanelStyles('.panel'),
|
|
81
|
+
css `
|
|
82
|
+
:host {
|
|
83
|
+
display: contents;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.overlay {
|
|
87
|
+
position: fixed;
|
|
88
|
+
inset: 0;
|
|
89
|
+
z-index: var(--aithe-z-drawer);
|
|
90
|
+
display: flex;
|
|
91
|
+
background: var(--aithe-color-overlay);
|
|
92
|
+
opacity: 0;
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
transition: opacity var(--aithe-duration-base) var(--aithe-ease-standard);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.overlay.open {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
pointer-events: auto;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.top {
|
|
103
|
+
align-items: flex-start;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.right {
|
|
108
|
+
align-items: stretch;
|
|
109
|
+
justify-content: flex-end;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.bottom {
|
|
113
|
+
align-items: flex-end;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.left {
|
|
118
|
+
align-items: stretch;
|
|
119
|
+
justify-content: flex-start;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.panel {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
max-width: 100vw;
|
|
126
|
+
max-height: 100vh;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.panel-inner {
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
flex: 1;
|
|
133
|
+
transition: transform var(--aithe-duration-base) var(--aithe-ease-standard);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.panel-inner.top {
|
|
137
|
+
transform: translateY(-100%);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.panel-inner.right {
|
|
141
|
+
transform: translateX(100%);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.panel-inner.bottom {
|
|
145
|
+
transform: translateY(100%);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.panel-inner.left {
|
|
149
|
+
transform: translateX(-100%);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.overlay.open .panel-inner {
|
|
153
|
+
transform: translate(0, 0);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.header,
|
|
157
|
+
.footer {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: space-between;
|
|
161
|
+
gap: var(--aithe-space-4);
|
|
162
|
+
padding: var(--aithe-space-lg);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.header {
|
|
166
|
+
border-bottom: 1px solid var(--aithe-color-border);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.footer {
|
|
170
|
+
border-top: 1px solid var(--aithe-color-border);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.title {
|
|
174
|
+
margin: 0;
|
|
175
|
+
display: inline-flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
gap: var(--aithe-space-2);
|
|
178
|
+
font-size: var(--aithe-font-size-lg);
|
|
179
|
+
font-weight: var(--aithe-font-weight-semibold);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.title-icon {
|
|
183
|
+
flex-shrink: 0;
|
|
184
|
+
color: var(--aithe-color-text-muted);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.body {
|
|
188
|
+
flex: 1;
|
|
189
|
+
overflow: auto;
|
|
190
|
+
padding: var(--aithe-space-lg);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.close {
|
|
194
|
+
width: 36px;
|
|
195
|
+
height: 36px;
|
|
196
|
+
border: none;
|
|
197
|
+
border-radius: 50%;
|
|
198
|
+
background: transparent;
|
|
199
|
+
color: var(--aithe-color-text-muted);
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
}
|
|
202
|
+
`,
|
|
203
|
+
]; }
|
|
204
|
+
connectedCallback() {
|
|
205
|
+
super.connectedCallback();
|
|
206
|
+
this.applyMountTarget();
|
|
207
|
+
}
|
|
208
|
+
disconnectedCallback() {
|
|
209
|
+
super.disconnectedCallback();
|
|
210
|
+
document.removeEventListener('keydown', this.handleDocumentKeydown);
|
|
211
|
+
}
|
|
212
|
+
updated(changed) {
|
|
213
|
+
super.updated(changed);
|
|
214
|
+
if (changed.has('mount')) {
|
|
215
|
+
this.applyMountTarget();
|
|
216
|
+
}
|
|
217
|
+
if (changed.has('open')) {
|
|
218
|
+
this.emit('aithe-open-change', { open: this.open });
|
|
219
|
+
if (this.open) {
|
|
220
|
+
this.lastFocused = document.activeElement;
|
|
221
|
+
document.addEventListener('keydown', this.handleDocumentKeydown);
|
|
222
|
+
queueMicrotask(() => this.focusFirst(this.panel ?? this.renderRoot));
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
document.removeEventListener('keydown', this.handleDocumentKeydown);
|
|
226
|
+
this.lastFocused?.focus?.();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/** Teleports the drawer into the mount target element. 将抽屉传送至挂载目标元素。 */
|
|
231
|
+
applyMountTarget() {
|
|
232
|
+
if (!this.mount || typeof document === 'undefined') {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const target = document.querySelector(this.mount);
|
|
236
|
+
if (target instanceof HTMLElement && this.parentElement !== target) {
|
|
237
|
+
target.appendChild(this);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
render() {
|
|
241
|
+
const isVertical = this.placement === 'left' || this.placement === 'right';
|
|
242
|
+
const showHeader = true;
|
|
243
|
+
const drawerIcon = this.icon
|
|
244
|
+
? html `
|
|
245
|
+
<aithe-icon class="title-icon" name=${this.icon} size="18"></aithe-icon>
|
|
246
|
+
`
|
|
247
|
+
: nothing;
|
|
248
|
+
return html `
|
|
249
|
+
<div
|
|
250
|
+
class=${classMap({
|
|
251
|
+
overlay: true,
|
|
252
|
+
open: this.open,
|
|
253
|
+
[this.placement]: true,
|
|
254
|
+
})}
|
|
255
|
+
@click=${this.handleBackdropClick}
|
|
256
|
+
>
|
|
257
|
+
<aside
|
|
258
|
+
class="panel"
|
|
259
|
+
aria-modal="true"
|
|
260
|
+
role="dialog"
|
|
261
|
+
style=${styleMap(isVertical ? { width: this.size } : { height: this.size })}
|
|
262
|
+
tabindex="-1"
|
|
263
|
+
@click=${(event) => event.stopPropagation()}
|
|
264
|
+
@keydown=${(event) => this.trapFocus(event, this.panel ?? this.renderRoot)}
|
|
265
|
+
>
|
|
266
|
+
<div class=${classMap({ 'panel-inner': true, [this.placement]: true })}>
|
|
267
|
+
<header class="header" ?hidden=${!showHeader}>
|
|
268
|
+
<slot name="header" @slotchange=${this.syncSlots}>
|
|
269
|
+
${this.title
|
|
270
|
+
? html `
|
|
271
|
+
<h2 class="title">${drawerIcon}${this.title}</h2>
|
|
272
|
+
`
|
|
273
|
+
: null}
|
|
274
|
+
</slot>
|
|
275
|
+
<button
|
|
276
|
+
class="close"
|
|
277
|
+
type="button"
|
|
278
|
+
aria-label=${t('feedback.drawer.closeAriaLabel')}
|
|
279
|
+
@click=${this.hide}
|
|
280
|
+
>
|
|
281
|
+
×
|
|
282
|
+
</button>
|
|
283
|
+
</header>
|
|
284
|
+
<div class="body">
|
|
285
|
+
<slot></slot>
|
|
286
|
+
</div>
|
|
287
|
+
<footer class="footer" ?hidden=${!this.hasFooterSlot}>
|
|
288
|
+
<slot name="footer" @slotchange=${this.syncSlots}></slot>
|
|
289
|
+
</footer>
|
|
290
|
+
</div>
|
|
291
|
+
</aside>
|
|
292
|
+
</div>
|
|
293
|
+
`;
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
__decorate([
|
|
297
|
+
property({ type: Boolean, reflect: true })
|
|
298
|
+
], AitheDrawer.prototype, "open", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
property({ type: String })
|
|
301
|
+
], AitheDrawer.prototype, "title", void 0);
|
|
302
|
+
__decorate([
|
|
303
|
+
property({ type: String })
|
|
304
|
+
], AitheDrawer.prototype, "icon", void 0);
|
|
305
|
+
__decorate([
|
|
306
|
+
property({ type: String })
|
|
307
|
+
], AitheDrawer.prototype, "placement", void 0);
|
|
308
|
+
__decorate([
|
|
309
|
+
property({ type: String })
|
|
310
|
+
], AitheDrawer.prototype, "size", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
property({ type: String })
|
|
313
|
+
], AitheDrawer.prototype, "mount", void 0);
|
|
314
|
+
__decorate([
|
|
315
|
+
property({ type: Boolean, attribute: 'close-on-mask' })
|
|
316
|
+
], AitheDrawer.prototype, "closeOnMask", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
property({ type: Boolean, attribute: 'close-on-esc' })
|
|
319
|
+
], AitheDrawer.prototype, "closeOnEsc", void 0);
|
|
320
|
+
__decorate([
|
|
321
|
+
query('.panel')
|
|
322
|
+
], AitheDrawer.prototype, "panel", void 0);
|
|
323
|
+
__decorate([
|
|
324
|
+
queryAssignedElements({ slot: 'header' })
|
|
325
|
+
], AitheDrawer.prototype, "headerNodes", void 0);
|
|
326
|
+
__decorate([
|
|
327
|
+
queryAssignedElements({ slot: 'footer' })
|
|
328
|
+
], AitheDrawer.prototype, "footerNodes", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
state()
|
|
331
|
+
], AitheDrawer.prototype, "hasHeaderSlot", void 0);
|
|
332
|
+
__decorate([
|
|
333
|
+
state()
|
|
334
|
+
], AitheDrawer.prototype, "hasFooterSlot", void 0);
|
|
335
|
+
AitheDrawer = __decorate([
|
|
336
|
+
customElement('aithe-drawer')
|
|
337
|
+
], AitheDrawer);
|
|
338
|
+
export { AitheDrawer };
|
|
@@ -0,0 +1,130 @@
|
|
|
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 } from 'lit';
|
|
8
|
+
import { customElement, property } 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
|
+
/**
|
|
13
|
+
* Inline or fullscreen loading overlay with spinner and optional tip text.
|
|
14
|
+
* 内联或全屏加载遮罩层,带旋转器和可选提示文本。
|
|
15
|
+
*
|
|
16
|
+
* @slot - Default slot for content to be covered by the loading overlay. 被加载遮罩层覆盖的内容。
|
|
17
|
+
* @example
|
|
18
|
+
* ```html
|
|
19
|
+
* <aithe-loading spinning tip="Loading..." size="md">
|
|
20
|
+
* <div>Content behind the overlay</div>
|
|
21
|
+
* </aithe-loading>
|
|
22
|
+
* <aithe-loading fullscreen tip="Please wait..."></aithe-loading>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
let AitheLoading = class AitheLoading extends AitheElement {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
/** Whether the loading spinner is active. 是否显示加载旋转器。 */
|
|
29
|
+
this.spinning = true;
|
|
30
|
+
/** Spinner size scale. 旋转器尺寸规格。 */
|
|
31
|
+
this.size = 'md';
|
|
32
|
+
/** Tip text displayed below the spinner. 旋转器下方显示的提示文本。 */
|
|
33
|
+
this.tip = '';
|
|
34
|
+
/** Whether the loading overlay covers the entire viewport. 加载遮罩是否覆盖整个视口。 */
|
|
35
|
+
this.fullscreen = false;
|
|
36
|
+
}
|
|
37
|
+
static { this.styles = [
|
|
38
|
+
aitheBaseStyles,
|
|
39
|
+
css `
|
|
40
|
+
:host {
|
|
41
|
+
position: relative;
|
|
42
|
+
display: block;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.overlay {
|
|
46
|
+
position: absolute;
|
|
47
|
+
inset: 0;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
gap: var(--aithe-space-3);
|
|
53
|
+
background: rgba(255, 255, 255, 0.48);
|
|
54
|
+
backdrop-filter: blur(6px);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.overlay.fullscreen {
|
|
58
|
+
position: fixed;
|
|
59
|
+
z-index: var(--aithe-z-modal);
|
|
60
|
+
background: var(--aithe-color-overlay);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.spinner {
|
|
64
|
+
border: 3px solid rgba(77, 141, 255, 0.18);
|
|
65
|
+
border-top-color: var(--aithe-primary-6);
|
|
66
|
+
border-radius: 50%;
|
|
67
|
+
animation: aithe-spin 0.85s linear infinite;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.spinner.sm {
|
|
71
|
+
width: 20px;
|
|
72
|
+
height: 20px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.spinner.md {
|
|
76
|
+
width: 28px;
|
|
77
|
+
height: 28px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.spinner.lg {
|
|
81
|
+
width: 40px;
|
|
82
|
+
height: 40px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tip {
|
|
86
|
+
color: var(--aithe-color-text-muted);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@keyframes aithe-spin {
|
|
90
|
+
to {
|
|
91
|
+
transform: rotate(360deg);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`,
|
|
95
|
+
]; }
|
|
96
|
+
render() {
|
|
97
|
+
const tipContent = this.tip
|
|
98
|
+
? html `
|
|
99
|
+
<span class="tip">${this.tip}</span>
|
|
100
|
+
`
|
|
101
|
+
: null;
|
|
102
|
+
return html `
|
|
103
|
+
<slot></slot>
|
|
104
|
+
${this.spinning
|
|
105
|
+
? html `
|
|
106
|
+
<div class=${classMap({ overlay: true, fullscreen: this.fullscreen })}>
|
|
107
|
+
<span class=${classMap({ spinner: true, [this.size]: true })}></span>
|
|
108
|
+
${tipContent}
|
|
109
|
+
</div>
|
|
110
|
+
`
|
|
111
|
+
: null}
|
|
112
|
+
`;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ type: Boolean })
|
|
117
|
+
], AitheLoading.prototype, "spinning", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ type: String })
|
|
120
|
+
], AitheLoading.prototype, "size", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: String })
|
|
123
|
+
], AitheLoading.prototype, "tip", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: Boolean })
|
|
126
|
+
], AitheLoading.prototype, "fullscreen", void 0);
|
|
127
|
+
AitheLoading = __decorate([
|
|
128
|
+
customElement('aithe-loading')
|
|
129
|
+
], AitheLoading);
|
|
130
|
+
export { AitheLoading };
|