@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,127 @@
|
|
|
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 { AitheElement } from '../../core/aithe-element';
|
|
10
|
+
import { aitheBaseStyles } from '../../core/styles';
|
|
11
|
+
/**
|
|
12
|
+
* Horizontal or vertical divider line with optional label.
|
|
13
|
+
* 水平或垂直分割线,支持可选标签。
|
|
14
|
+
*
|
|
15
|
+
* @slot - Default slot for divider label text (horizontal mode). 分割线标签文本(水平模式)。
|
|
16
|
+
* @example
|
|
17
|
+
* ```html
|
|
18
|
+
* <aithe-divider label="Section"></aithe-divider>
|
|
19
|
+
* <aithe-divider vertical dashed></aithe-divider>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
let AitheDivider = class AitheDivider extends AitheElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
/** Whether the divider renders vertically. 是否垂直渲染分割线。 */
|
|
26
|
+
this.vertical = false;
|
|
27
|
+
/** Whether the line style is dashed. 是否使用虚线样式。 */
|
|
28
|
+
this.dashed = false;
|
|
29
|
+
/** Center label text for horizontal divider. 水平分割线的居中标签文本。 */
|
|
30
|
+
this.label = '';
|
|
31
|
+
}
|
|
32
|
+
static { this.styles = [
|
|
33
|
+
aitheBaseStyles,
|
|
34
|
+
css `
|
|
35
|
+
:host {
|
|
36
|
+
display: block;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([vertical]) {
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
width: auto;
|
|
43
|
+
height: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.divider {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
width: 100%;
|
|
50
|
+
color: var(--aithe-color-text-subtle);
|
|
51
|
+
font-size: var(--aithe-font-size-sm);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.vertical {
|
|
55
|
+
width: auto;
|
|
56
|
+
height: 100%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.line {
|
|
60
|
+
flex: 1;
|
|
61
|
+
border-top: 1px solid var(--aithe-color-border);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.line.dashed {
|
|
65
|
+
border-top-style: dashed;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.vertical .line {
|
|
69
|
+
width: 1px;
|
|
70
|
+
height: 100%;
|
|
71
|
+
border-top: none;
|
|
72
|
+
border-left: 1px solid var(--aithe-color-border);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.vertical .line.dashed {
|
|
76
|
+
border-left-style: dashed;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.label {
|
|
80
|
+
padding-inline: var(--aithe-space-3);
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
}
|
|
83
|
+
`,
|
|
84
|
+
]; }
|
|
85
|
+
render() {
|
|
86
|
+
if (this.vertical) {
|
|
87
|
+
return html `
|
|
88
|
+
<span class="divider vertical" aria-orientation="vertical" role="separator">
|
|
89
|
+
<span class="line ${this.dashed ? 'dashed' : ''}"></span>
|
|
90
|
+
</span>
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
const hasContent = this.label || this.textContent?.trim();
|
|
94
|
+
const dashedClass = this.dashed ? 'dashed' : '';
|
|
95
|
+
const contentSlot = this.label
|
|
96
|
+
? html `
|
|
97
|
+
<span class="label">${this.label}</span>
|
|
98
|
+
`
|
|
99
|
+
: html `
|
|
100
|
+
<slot></slot>
|
|
101
|
+
`;
|
|
102
|
+
const trailingLine = hasContent
|
|
103
|
+
? html `
|
|
104
|
+
<span class="line ${dashedClass}"></span>
|
|
105
|
+
`
|
|
106
|
+
: null;
|
|
107
|
+
return html `
|
|
108
|
+
<div class="divider" aria-orientation="horizontal" role="separator">
|
|
109
|
+
<span class="line ${dashedClass}"></span>
|
|
110
|
+
${contentSlot} ${trailingLine}
|
|
111
|
+
</div>
|
|
112
|
+
`;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ type: Boolean, reflect: true })
|
|
117
|
+
], AitheDivider.prototype, "vertical", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ type: Boolean })
|
|
120
|
+
], AitheDivider.prototype, "dashed", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: String })
|
|
123
|
+
], AitheDivider.prototype, "label", void 0);
|
|
124
|
+
AitheDivider = __decorate([
|
|
125
|
+
customElement('aithe-divider')
|
|
126
|
+
], AitheDivider);
|
|
127
|
+
export { AitheDivider };
|
|
@@ -0,0 +1,72 @@
|
|
|
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 { AitheElement } from '../../core/aithe-element';
|
|
10
|
+
import { aitheBaseStyles } from '../../core/styles';
|
|
11
|
+
import { t } from '../../styles/i18n';
|
|
12
|
+
import './icon';
|
|
13
|
+
/**
|
|
14
|
+
* Empty state placeholder with icon and text.
|
|
15
|
+
* 空状态占位组件,显示图标和提示文本。
|
|
16
|
+
*
|
|
17
|
+
* @slot - Default slot for custom empty content (overrides icon + text). 自定义空状态内容。
|
|
18
|
+
* @example
|
|
19
|
+
* ```html
|
|
20
|
+
* <aithe-empty text="No results found" icon="sparkles"></aithe-empty>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
let AitheEmpty = class AitheEmpty extends AitheElement {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
/** Placeholder text. 占位提示文本。 */
|
|
27
|
+
this.text = '';
|
|
28
|
+
/** Built-in icon name to display. 显示的内置图标名称。 */
|
|
29
|
+
this.icon = 'sparkles';
|
|
30
|
+
}
|
|
31
|
+
static { this.styles = [
|
|
32
|
+
aitheBaseStyles,
|
|
33
|
+
css `
|
|
34
|
+
:host {
|
|
35
|
+
display: block;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.empty {
|
|
39
|
+
display: grid;
|
|
40
|
+
justify-items: center;
|
|
41
|
+
gap: var(--aithe-space-3);
|
|
42
|
+
padding: var(--aithe-space-7);
|
|
43
|
+
color: var(--aithe-color-text-muted);
|
|
44
|
+
text-align: center;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
aithe-icon {
|
|
48
|
+
color: var(--aithe-primary-6);
|
|
49
|
+
}
|
|
50
|
+
`,
|
|
51
|
+
]; }
|
|
52
|
+
render() {
|
|
53
|
+
return html `
|
|
54
|
+
<div class="empty">
|
|
55
|
+
<slot>
|
|
56
|
+
<aithe-icon name=${this.icon} size="lg"></aithe-icon>
|
|
57
|
+
<div>${this.text || t('basic.empty.defaultText')}</div>
|
|
58
|
+
</slot>
|
|
59
|
+
</div>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
__decorate([
|
|
64
|
+
property({ type: String })
|
|
65
|
+
], AitheEmpty.prototype, "text", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
property({ type: String })
|
|
68
|
+
], AitheEmpty.prototype, "icon", void 0);
|
|
69
|
+
AitheEmpty = __decorate([
|
|
70
|
+
customElement('aithe-empty')
|
|
71
|
+
], AitheEmpty);
|
|
72
|
+
export { AitheEmpty };
|
|
@@ -0,0 +1,129 @@
|
|
|
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 } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { AitheElement } from '../../core/aithe-element';
|
|
10
|
+
import { aitheBaseStyles } from '../../core/styles';
|
|
11
|
+
import { IconUtil } from '../../utils';
|
|
12
|
+
/**
|
|
13
|
+
* Vector icon entry for the Aithe UI icon system.
|
|
14
|
+
* 矢量图标组件,用于 Aithe UI 图标系统。
|
|
15
|
+
*
|
|
16
|
+
* Renders an SVG glyph from the built-in icon map based on the `name` property.
|
|
17
|
+
* Supports extended icon format: `(type)value` where type can be:
|
|
18
|
+
* - `class` — built-in icon name (default, e.g. `(class)sparkles` or just `sparkles`)
|
|
19
|
+
* - `auto` — auto-generate from first character of text (e.g. `(auto)User Name`)
|
|
20
|
+
* - `url` | `share` | `remote` — load from URL (e.g. `(url)https://example.com/icon.svg`)
|
|
21
|
+
* Supports `URL|AltText` format — shows alt first character on load failure.
|
|
22
|
+
* 支持 `URL|AltText` 格式,加载失败时显示 alt 首字符。
|
|
23
|
+
* All icons use a 24×24 viewBox, stroke-based rendering with `stroke-width: 1.8`,
|
|
24
|
+
* and inherit color via `currentColor`.
|
|
25
|
+
* 根据 `name` 属性从内置图标映射中渲染 SVG 图形。
|
|
26
|
+
* 所有图标使用 24×24 视口,基于描边渲染(stroke-width: 1.8),颜色继承 currentColor。
|
|
27
|
+
*
|
|
28
|
+
* For `auto` and `url` types, rendering is delegated to {@link IconUtil.render}.
|
|
29
|
+
* `auto` 和 `url` 类型委托给 {@link IconUtil.render} 渲染。
|
|
30
|
+
*
|
|
31
|
+
* Built-in icon names (60+ glyphs):
|
|
32
|
+
* 内置图标名称(60+ 图形):
|
|
33
|
+
*
|
|
34
|
+
* **General / 通用**: sparkles, close, check, info, warning, image, search, plus, minus,
|
|
35
|
+
* menu, more, settings, home, star, heart, copy, download, upload, share, link,
|
|
36
|
+
* external, refresh, edit, trash, filter, sort, lock, unlock, eye, eyeOff, clock,
|
|
37
|
+
* calendar, pin, flag, bookmark, paperclip, tag, thumbUp, thumbDown
|
|
38
|
+
*
|
|
39
|
+
* **Arrows / 箭头**: arrowUp, arrowDown, arrowLeft, arrowRight, chevronUp, chevronDown,
|
|
40
|
+
* chevronLeft, chevronRight, expand, collapse
|
|
41
|
+
*
|
|
42
|
+
* **Status / 状态**: success, error, question
|
|
43
|
+
*
|
|
44
|
+
* **Media / 媒体**: play, pause, volume, mute, camera, video, music
|
|
45
|
+
*
|
|
46
|
+
* **Communication / 交流**: mail, bell, chat, phone
|
|
47
|
+
*
|
|
48
|
+
* **Data / 数据**: barChart, pieChart, database, code, terminal, file, folder
|
|
49
|
+
*
|
|
50
|
+
* **Layout / 布局**: grid, list, sidebar, maximize, minimize
|
|
51
|
+
*
|
|
52
|
+
* **User / 用户**: user, users
|
|
53
|
+
*
|
|
54
|
+
* **Weather / 天气**: sun, moon, cloud
|
|
55
|
+
*
|
|
56
|
+
* @slot - Default slot for custom SVG content (overrides built-in glyph).
|
|
57
|
+
* 默认插槽,用于自定义 SVG 内容(覆盖内置图形)。
|
|
58
|
+
*
|
|
59
|
+
* @cssproperty --aithe-icon-size - Controls the SVG width/height. Set dynamically from `size` property.
|
|
60
|
+
* @cssproperty --aithe-icon-color - Controls the host `color` which cascades to `stroke: currentColor`.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```html
|
|
64
|
+
* <!-- Built-in icon / 内置图标 -->
|
|
65
|
+
* <aithe-icon name="sparkles" size="lg" color="#4d8dff"></aithe-icon>
|
|
66
|
+
* <aithe-icon name="check" size="sm"></aithe-icon>
|
|
67
|
+
* <aithe-icon name="heart" color="var(--aithe-danger-6)"></aithe-icon>
|
|
68
|
+
*
|
|
69
|
+
* <!-- Size presets / 尺寸预设: xs sm md lg xl 2xl 3xl 4xl 5xl 6xl -->
|
|
70
|
+
* <aithe-icon name="search" size="xs"></aithe-icon>
|
|
71
|
+
* <aithe-icon name="search" size="xl"></aithe-icon>
|
|
72
|
+
* <aithe-icon name="search" size="6xl"></aithe-icon>
|
|
73
|
+
*
|
|
74
|
+
* <!-- Auto-generated text / 文本首字母 -->
|
|
75
|
+
* <aithe-icon name="(auto)User Name" size="md"></aithe-icon>
|
|
76
|
+
*
|
|
77
|
+
* <!-- Remote image with alt fallback / 远程图片带 alt 占位 -->
|
|
78
|
+
* <aithe-icon name="(url)https://example.com/icon.svg|User" size="md"></aithe-icon>
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
let AitheIcon = class AitheIcon extends AitheElement {
|
|
82
|
+
constructor() {
|
|
83
|
+
super(...arguments);
|
|
84
|
+
/** Icon glyph name from the built-in map. 内置图标名称。 */
|
|
85
|
+
this.name = 'sparkles';
|
|
86
|
+
/** Custom stroke/fill color. 自定义颜色。 */
|
|
87
|
+
this.color = '';
|
|
88
|
+
/** Icon size preset or explicit CSS value. 图标尺寸预设或显式 CSS 值。
|
|
89
|
+
*
|
|
90
|
+
* Resolved via {@link IconUtil.resolveSize} against {@link ICON_SIZE_MAP}.
|
|
91
|
+
* 通过 {@link IconUtil.resolveSize} 结合 {@link ICON_SIZE_MAP} 解析。
|
|
92
|
+
*
|
|
93
|
+
* Presets / 预设:
|
|
94
|
+
* `xs`(12px), `sm`(16px), `md`(20px), `lg`(24px),
|
|
95
|
+
* `xl`(28px), `2xl`(32px), `3xl`(48px), `4xl`(64px), `5xl`(96px), `6xl`(128px)
|
|
96
|
+
*
|
|
97
|
+
* Any valid CSS dimension also works (e.g. `"32px"`, `"2rem"`, `"24"` → `24px`).
|
|
98
|
+
* 也支持任意合法 CSS 尺寸值。 */
|
|
99
|
+
this.size = 'md';
|
|
100
|
+
}
|
|
101
|
+
static { this.styles = [
|
|
102
|
+
aitheBaseStyles,
|
|
103
|
+
css `
|
|
104
|
+
:host {
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
}
|
|
109
|
+
`,
|
|
110
|
+
]; }
|
|
111
|
+
render() {
|
|
112
|
+
const normalizedSize = IconUtil.resolveSize(this.size, '20px');
|
|
113
|
+
const iconStyle = this.color ? `color:${this.color};` : '';
|
|
114
|
+
return IconUtil.render(this.name, normalizedSize, '', iconStyle);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
__decorate([
|
|
118
|
+
property({ type: String })
|
|
119
|
+
], AitheIcon.prototype, "name", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
property({ type: String })
|
|
122
|
+
], AitheIcon.prototype, "color", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
property({ type: String })
|
|
125
|
+
], AitheIcon.prototype, "size", void 0);
|
|
126
|
+
AitheIcon = __decorate([
|
|
127
|
+
customElement('aithe-icon')
|
|
128
|
+
], AitheIcon);
|
|
129
|
+
export { AitheIcon };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/basic/input.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMnD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,UAAW,SAAQ,YAAY;IAC1C,kDAAkD;IACtB,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAU;IAC5F,yCAAyC;IACb,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAC5D,4CAA4C;IAChB,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAY;IAC9E,2CAA2C;IACf,KAAK,SAAM;IACvC,+BAA+B;IACH,WAAW,SAAM;IAC7C,8CAA8C;IACF,QAAQ,UAAS;IAC7D,+CAA+C;IAClB,QAAQ,UAAS;IAC9C,iFAAiF;IACpD,SAAS,UAAS;IAC/C,6CAA6C;IACjB,IAAI,SAAM;IACtC,6DAA6D;IACjC,YAAY,SAAS;IACjD,2GAA2G;IAC/E,KAAK,SAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAmB;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAE/E,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAS;IAEnC,MAAM,CAAC,QAAQ,CAAC,MAAM,0DAgHpB;IAEF,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAInC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAM5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAGxB;IAEF,OAAO,CAAC,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/basic/input.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMnD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,UAAW,SAAQ,YAAY;IAC1C,kDAAkD;IACtB,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAU;IAC5F,yCAAyC;IACb,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAC5D,4CAA4C;IAChB,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAY;IAC9E,2CAA2C;IACf,KAAK,SAAM;IACvC,+BAA+B;IACH,WAAW,SAAM;IAC7C,8CAA8C;IACF,QAAQ,UAAS;IAC7D,+CAA+C;IAClB,QAAQ,UAAS;IAC9C,iFAAiF;IACpD,SAAS,UAAS;IAC/C,6CAA6C;IACjB,IAAI,SAAM;IACtC,6DAA6D;IACjC,YAAY,SAAS;IACjD,2GAA2G;IAC/E,KAAK,SAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAmB;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAE/E,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAS;IAEnC,MAAM,CAAC,QAAQ,CAAC,MAAM,0DAgHpB;IAEF,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAInC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAM5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAGxB;IAEF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAK1B;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAK3B;IAEF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAUzB;IAEF,MAAM;CAsDP"}
|
|
@@ -0,0 +1,314 @@
|
|
|
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 { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
+
import { AitheElement } from '../../core/aithe-element';
|
|
12
|
+
import { aitheBaseStyles } from '../../core/styles';
|
|
13
|
+
import { t } from '../../styles/i18n';
|
|
14
|
+
const INPUT_EVENT = 'aithe-input';
|
|
15
|
+
/**
|
|
16
|
+
* Single-line text input field with prefix/suffix slots, status states, and clearable support.
|
|
17
|
+
* 单行文本输入框,支持前缀/后缀插槽、状态标记和可清除功能。
|
|
18
|
+
*
|
|
19
|
+
* @slot - Default slot (unused). 默认插槽(未使用)。
|
|
20
|
+
* @slot prefix - Content before the input (icon, label, etc.). 输入框前的内容(图标、标签等)。
|
|
21
|
+
* @slot suffix - Content after the input (icon, unit, etc.). 输入框后的内容(图标、单位等)。
|
|
22
|
+
*
|
|
23
|
+
* @fires aithe-input - Emitted on every keystroke with `{ value }`. 每次按键时发出 `{ value }`。
|
|
24
|
+
* @fires aithe-change - Emitted when the value is committed with `{ value }`. 值提交时发出 `{ value }`。
|
|
25
|
+
* @fires aithe-clear - Emitted when the clear button is clicked. 清除按钮被点击时发出。
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```html
|
|
29
|
+
* <aithe-input placeholder="Search..." clearable></aithe-input>
|
|
30
|
+
* <aithe-input status="error" label="Email">invalid@</aithe-input>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
let AitheInput = class AitheInput extends AitheElement {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
/** HTML input type attribute. HTML input 类型属性。 */
|
|
37
|
+
this.type = 'text';
|
|
38
|
+
/** Size scale of the input. 输入框的尺寸规格。 */
|
|
39
|
+
this.size = 'md';
|
|
40
|
+
/** Validation status indicator. 验证状态指示器。 */
|
|
41
|
+
this.status = 'normal';
|
|
42
|
+
/** Current value of the input. 输入框的当前值。 */
|
|
43
|
+
this.value = '';
|
|
44
|
+
/** Placeholder text. 占位符文本。 */
|
|
45
|
+
this.placeholder = '';
|
|
46
|
+
/** Whether the input is disabled. 输入框是否禁用。 */
|
|
47
|
+
this.disabled = false;
|
|
48
|
+
/** Whether the input is read-only. 输入框是否只读。 */
|
|
49
|
+
this.readonly = false;
|
|
50
|
+
/** Whether to show a clear button when the input has a value. 输入框有值时是否显示清除按钮。 */
|
|
51
|
+
this.clearable = false;
|
|
52
|
+
/** HTML `name` attribute. HTML `name` 属性。 */
|
|
53
|
+
this.name = '';
|
|
54
|
+
/** HTML `autocomplete` attribute. HTML `autocomplete` 属性。 */
|
|
55
|
+
this.autocomplete = 'off';
|
|
56
|
+
/** Accessible label (used as `aria-label` when no visible label exists). 无障碍标签(当无可见标签时用作 `aria-label`)。 */
|
|
57
|
+
this.label = '';
|
|
58
|
+
this.hasPrefix = false;
|
|
59
|
+
this.hasSuffix = false;
|
|
60
|
+
this.syncSlots = () => {
|
|
61
|
+
this.hasPrefix = this.prefixNodes.length > 0;
|
|
62
|
+
this.hasSuffix = this.suffixNodes.length > 0;
|
|
63
|
+
};
|
|
64
|
+
this.handleInput = (event) => {
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
const input = event.currentTarget;
|
|
67
|
+
this.value = input.value;
|
|
68
|
+
this.emit(INPUT_EVENT, { value: this.value });
|
|
69
|
+
};
|
|
70
|
+
this.handleChange = (event) => {
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
const input = event.currentTarget;
|
|
73
|
+
this.value = input.value;
|
|
74
|
+
this.emit('aithe-change', { value: this.value });
|
|
75
|
+
};
|
|
76
|
+
this.clearValue = () => {
|
|
77
|
+
if (this.disabled || this.readonly) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this.value = '';
|
|
81
|
+
this.inputElement?.focus();
|
|
82
|
+
this.emit('aithe-clear');
|
|
83
|
+
this.emit(INPUT_EVENT, { value: this.value });
|
|
84
|
+
this.emit('aithe-change', { value: this.value });
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
static { this.styles = [
|
|
88
|
+
aitheBaseStyles,
|
|
89
|
+
css `
|
|
90
|
+
:host {
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.field {
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
align-items: stretch;
|
|
98
|
+
min-width: 0;
|
|
99
|
+
width: 100%;
|
|
100
|
+
border: 1px solid var(--aithe-color-border);
|
|
101
|
+
border-radius: var(--aithe-radius-md);
|
|
102
|
+
background: var(--aithe-color-surface-elevated);
|
|
103
|
+
transition:
|
|
104
|
+
border-color var(--aithe-duration-fast) var(--aithe-ease-standard),
|
|
105
|
+
box-shadow var(--aithe-duration-fast) var(--aithe-ease-standard),
|
|
106
|
+
background var(--aithe-duration-fast) var(--aithe-ease-standard);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.field:focus-within {
|
|
110
|
+
border-color: var(--aithe-primary-5);
|
|
111
|
+
box-shadow: 0 0 0 4px var(--aithe-color-focus-ring);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.field.error {
|
|
115
|
+
border-color: var(--aithe-danger-5);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.field.success {
|
|
119
|
+
border-color: var(--aithe-success-5);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.field.disabled {
|
|
123
|
+
opacity: 0.58;
|
|
124
|
+
cursor: not-allowed;
|
|
125
|
+
background: var(--aithe-color-surface-muted);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.field.sm {
|
|
129
|
+
min-height: var(--aithe-control-height-sm);
|
|
130
|
+
padding: 4px 8px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.field.md {
|
|
134
|
+
min-height: var(--aithe-control-height-md);
|
|
135
|
+
padding: 6px 12px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.field.lg {
|
|
139
|
+
min-height: var(--aithe-control-height-lg);
|
|
140
|
+
padding: 8px 16px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.prefix,
|
|
144
|
+
.suffix {
|
|
145
|
+
display: inline-flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
color: var(--aithe-color-text-muted);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.prefix {
|
|
152
|
+
margin-inline-end: 2px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.suffix {
|
|
156
|
+
margin-inline-start: 2px;
|
|
157
|
+
gap: 2px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
input {
|
|
161
|
+
width: 100%;
|
|
162
|
+
min-width: 0;
|
|
163
|
+
margin: 0;
|
|
164
|
+
padding: 0px;
|
|
165
|
+
border: none;
|
|
166
|
+
outline: none;
|
|
167
|
+
background: transparent;
|
|
168
|
+
color: inherit;
|
|
169
|
+
line-height: inherit;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
input::placeholder {
|
|
173
|
+
color: var(--aithe-color-text-subtle);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
input:focus {
|
|
177
|
+
outline: none;
|
|
178
|
+
border: none;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.clear {
|
|
182
|
+
display: inline-flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
justify-content: center;
|
|
185
|
+
width: 20px;
|
|
186
|
+
height: 20px;
|
|
187
|
+
border: none;
|
|
188
|
+
border-radius: 50%;
|
|
189
|
+
background: transparent;
|
|
190
|
+
color: var(--aithe-color-text-subtle);
|
|
191
|
+
cursor: pointer;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.clear:hover {
|
|
195
|
+
background: var(--aithe-neutral-2);
|
|
196
|
+
color: var(--aithe-color-text);
|
|
197
|
+
}
|
|
198
|
+
`,
|
|
199
|
+
]; }
|
|
200
|
+
focus(options) {
|
|
201
|
+
this.inputElement?.focus(options);
|
|
202
|
+
}
|
|
203
|
+
updated(changed) {
|
|
204
|
+
if (changed.has('value') && this.inputElement && this.inputElement.value !== this.value) {
|
|
205
|
+
this.inputElement.value = this.value;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
render() {
|
|
209
|
+
const clearTabindex = this.disabled ? -1 : 0;
|
|
210
|
+
return html `
|
|
211
|
+
<label
|
|
212
|
+
class=${classMap({
|
|
213
|
+
field: true,
|
|
214
|
+
[this.size]: true,
|
|
215
|
+
[this.status]: this.status !== 'normal',
|
|
216
|
+
disabled: this.disabled,
|
|
217
|
+
})}
|
|
218
|
+
>
|
|
219
|
+
${this.hasPrefix
|
|
220
|
+
? html `
|
|
221
|
+
<span class="prefix"><slot name="prefix" @slotchange=${this.syncSlots}></slot></span>
|
|
222
|
+
`
|
|
223
|
+
: html `
|
|
224
|
+
<slot name="prefix" hidden @slotchange=${this.syncSlots}></slot>
|
|
225
|
+
`}
|
|
226
|
+
<input
|
|
227
|
+
.value=${this.value}
|
|
228
|
+
aria-invalid=${String(this.status === 'error')}
|
|
229
|
+
aria-label=${this.label || this.placeholder || t('basic.input.ariaLabel')}
|
|
230
|
+
autocomplete=${this.autocomplete}
|
|
231
|
+
?disabled=${this.disabled}
|
|
232
|
+
?readonly=${this.readonly}
|
|
233
|
+
name=${this.name}
|
|
234
|
+
placeholder=${this.placeholder}
|
|
235
|
+
type=${this.type}
|
|
236
|
+
@change=${this.handleChange}
|
|
237
|
+
@input=${this.handleInput}
|
|
238
|
+
/>
|
|
239
|
+
<span class="suffix">
|
|
240
|
+
${this.clearable && this.value
|
|
241
|
+
? html `
|
|
242
|
+
<button
|
|
243
|
+
class="clear"
|
|
244
|
+
type="button"
|
|
245
|
+
tabindex=${clearTabindex}
|
|
246
|
+
@click=${this.clearValue}
|
|
247
|
+
>
|
|
248
|
+
×
|
|
249
|
+
</button>
|
|
250
|
+
`
|
|
251
|
+
: nothing}
|
|
252
|
+
<slot name="suffix" @slotchange=${this.syncSlots}></slot>
|
|
253
|
+
</span>
|
|
254
|
+
${this.hasSuffix || (this.clearable && this.value)
|
|
255
|
+
? null
|
|
256
|
+
: html `
|
|
257
|
+
<span hidden>${ifDefined(undefined)}</span>
|
|
258
|
+
`}
|
|
259
|
+
</label>
|
|
260
|
+
`;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
__decorate([
|
|
264
|
+
property({ type: String })
|
|
265
|
+
], AitheInput.prototype, "type", void 0);
|
|
266
|
+
__decorate([
|
|
267
|
+
property({ type: String })
|
|
268
|
+
], AitheInput.prototype, "size", void 0);
|
|
269
|
+
__decorate([
|
|
270
|
+
property({ type: String })
|
|
271
|
+
], AitheInput.prototype, "status", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
property({ type: String })
|
|
274
|
+
], AitheInput.prototype, "value", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
property({ type: String })
|
|
277
|
+
], AitheInput.prototype, "placeholder", void 0);
|
|
278
|
+
__decorate([
|
|
279
|
+
property({ type: Boolean, reflect: true })
|
|
280
|
+
], AitheInput.prototype, "disabled", void 0);
|
|
281
|
+
__decorate([
|
|
282
|
+
property({ type: Boolean })
|
|
283
|
+
], AitheInput.prototype, "readonly", void 0);
|
|
284
|
+
__decorate([
|
|
285
|
+
property({ type: Boolean })
|
|
286
|
+
], AitheInput.prototype, "clearable", void 0);
|
|
287
|
+
__decorate([
|
|
288
|
+
property({ type: String })
|
|
289
|
+
], AitheInput.prototype, "name", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
property({ type: String })
|
|
292
|
+
], AitheInput.prototype, "autocomplete", void 0);
|
|
293
|
+
__decorate([
|
|
294
|
+
property({ type: String })
|
|
295
|
+
], AitheInput.prototype, "label", void 0);
|
|
296
|
+
__decorate([
|
|
297
|
+
query('input')
|
|
298
|
+
], AitheInput.prototype, "inputElement", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
queryAssignedElements({ slot: 'prefix' })
|
|
301
|
+
], AitheInput.prototype, "prefixNodes", void 0);
|
|
302
|
+
__decorate([
|
|
303
|
+
queryAssignedElements({ slot: 'suffix' })
|
|
304
|
+
], AitheInput.prototype, "suffixNodes", void 0);
|
|
305
|
+
__decorate([
|
|
306
|
+
state()
|
|
307
|
+
], AitheInput.prototype, "hasPrefix", void 0);
|
|
308
|
+
__decorate([
|
|
309
|
+
state()
|
|
310
|
+
], AitheInput.prototype, "hasSuffix", void 0);
|
|
311
|
+
AitheInput = __decorate([
|
|
312
|
+
customElement('aithe-input')
|
|
313
|
+
], AitheInput);
|
|
314
|
+
export { AitheInput };
|
|
@@ -8,11 +8,14 @@ import { AitheElement } from '../../core/aithe-element';
|
|
|
8
8
|
* @fires aithe-close - Emitted when the close button is clicked. 关闭按钮点击时触发。
|
|
9
9
|
* @example
|
|
10
10
|
* ```html
|
|
11
|
-
* <aithe-tag
|
|
11
|
+
* <aithe-tag variant="primary" closable>Selectable Tag</aithe-tag>
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
export declare class AitheTag extends AitheElement {
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Tag color variant. 标签颜色类型。
|
|
17
|
+
* @deprecated Use `variant` instead. 请使用 `variant` 代替。
|
|
18
|
+
*/
|
|
16
19
|
type: 'primary' | 'success' | 'warning' | 'danger' | 'default';
|
|
17
20
|
/** Whether the tag shows a close button. 是否显示关闭按钮。 */
|
|
18
21
|
closable: boolean;
|
|
@@ -24,6 +27,8 @@ export declare class AitheTag extends AitheElement {
|
|
|
24
27
|
rounded: 'sm' | 'md' | 'lg' | 'full';
|
|
25
28
|
/** Whether the tag is disabled. 是否禁用。 */
|
|
26
29
|
disabled: boolean;
|
|
30
|
+
/** Size scale of the tag. 标签的尺寸规格。 */
|
|
31
|
+
size: 'sm' | 'md' | 'lg';
|
|
27
32
|
static readonly styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
|
|
28
33
|
/** Toggles the selected state and emits change event. 切换选中状态并触发变更事件。 */
|
|
29
34
|
private readonly toggleTag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/components/basic/tag.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD;;;;;;;;;;;GAWG;AACH,qBACa,QAAS,SAAQ,YAAY;IACxC
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/components/basic/tag.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD;;;;;;;;;;;GAWG;AACH,qBACa,QAAS,SAAQ,YAAY;IACxC;;;OAGG;IAEH,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAa;IAC3E,sDAAsD;IACzB,QAAQ,UAAS;IAC9C,qEAAqE;IACxC,UAAU,UAAS;IAChD,qDAAqD;IACT,QAAQ,UAAS;IAC7D,kCAAkC;IACN,OAAO,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAU;IAC1E,yCAAyC;IACG,QAAQ,UAAS;IAC7D,sCAAsC;IACV,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAE5D,MAAM,CAAC,QAAQ,CAAC,MAAM,0DA6HpB;IAEF,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAOxB;IAEF,0GAA0G;IAC1G,OAAO,CAAC,QAAQ,CAAC,WAAW,CAM1B;IAEF,MAAM;CAoCP"}
|