@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,791 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @file JSON-driven auto form item / JSON 驱动的自动表单项
|
|
9
|
+
* @description 单个表单项容器,固定三段式布局:顶部(图标+label+tooltip)、
|
|
10
|
+
* 中部(输入控件)、底部(description+校验错误提示)。
|
|
11
|
+
* Single form item container with fixed three-section layout:
|
|
12
|
+
* top (icon + label + tooltip), middle (input control),
|
|
13
|
+
* bottom (description + validation error).
|
|
14
|
+
*/
|
|
15
|
+
import { css, html, nothing } from 'lit';
|
|
16
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
17
|
+
import { AitheElement } from '../../core/aithe-element';
|
|
18
|
+
import { aitheBaseStyles } from '../../core/styles';
|
|
19
|
+
import { t } from '../../styles/i18n';
|
|
20
|
+
import { FormRegistry, FormRuleEngine } from '../../core/autoform';
|
|
21
|
+
import { safeStringify } from '../../utils/utils';
|
|
22
|
+
import '../display/label.js';
|
|
23
|
+
/**
|
|
24
|
+
* JSON-driven auto form item with three-section layout and validation.
|
|
25
|
+
* JSON 驱动的自动表单项,三段式布局,支持校验。
|
|
26
|
+
*
|
|
27
|
+
* @slot - Default slot for the form control element. 表单控件元素内容。
|
|
28
|
+
* ### Events
|
|
29
|
+
* - **aithe-change** — Emitted when the field value changes, with `{ name, value }`. 字段值变更时触发。
|
|
30
|
+
* @example
|
|
31
|
+
* ```html
|
|
32
|
+
* <aithe-autoform-item
|
|
33
|
+
* name="email"
|
|
34
|
+
* type="input"
|
|
35
|
+
* label="Email"
|
|
36
|
+
* icon="mail"
|
|
37
|
+
* tooltip="Your work email"
|
|
38
|
+
* description="We will never share your email."
|
|
39
|
+
* required
|
|
40
|
+
* ></aithe-autoform-item>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
let AitheAutoformItem = class AitheAutoformItem extends AitheElement {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
/** Field unique identifier. 字段唯一标识。 */
|
|
47
|
+
this.name = '';
|
|
48
|
+
/** Control type: input | textarea | select | radio | checkbox | switch | number | slider | date-picker | time-picker | rate | color-picker. 控件类型。 */
|
|
49
|
+
this.type = 'input';
|
|
50
|
+
/** Label text. 标签文本。 */
|
|
51
|
+
this.label = '';
|
|
52
|
+
/** Icon name displayed before the label. 标签前显示的图标名称。 */
|
|
53
|
+
this.icon = '';
|
|
54
|
+
/** Tooltip text shown on hover. 悬停提示文本。 */
|
|
55
|
+
this.tooltip = '';
|
|
56
|
+
/** Description text below the control. 控件下方的说明文字。 */
|
|
57
|
+
this.description = '';
|
|
58
|
+
/** Default value. 缺省值。 */
|
|
59
|
+
this.dft = '';
|
|
60
|
+
/** Placeholder text. 占位提示文本。 */
|
|
61
|
+
this.placeholder = '';
|
|
62
|
+
/** Whether the field is disabled. 是否禁用。 */
|
|
63
|
+
this.disabled = false;
|
|
64
|
+
/** Whether the field is required. 是否必填。 */
|
|
65
|
+
this.required = false;
|
|
66
|
+
/** Validation regex pattern string. 校验正则表达式字符串。 */
|
|
67
|
+
this.pattern = '';
|
|
68
|
+
/** Validation failure message. 校验失败提示语。 */
|
|
69
|
+
this.message = '';
|
|
70
|
+
/** Options for select/radio/checkbox. 选择类控件的选项。 */
|
|
71
|
+
this.options = [];
|
|
72
|
+
/** Current field value. 当前字段值。 */
|
|
73
|
+
this.value = '';
|
|
74
|
+
/** Input type attribute for type="input". input 控件的 type 属性。 */
|
|
75
|
+
this.inputType = 'text';
|
|
76
|
+
/** Minimum value for number/slider. 数字/滑块最小值。 */
|
|
77
|
+
this.min = '';
|
|
78
|
+
/** Maximum value for number/slider. 数字/滑块最大值。 */
|
|
79
|
+
this.max = '';
|
|
80
|
+
/** Step value for number/slider/rate. 数字/滑块/评分步长。 */
|
|
81
|
+
this.step = '';
|
|
82
|
+
/** Number of rows for textarea. 文本域行数。 */
|
|
83
|
+
this.rows = '3';
|
|
84
|
+
/** Whether to validate on every change. 是否在每次变更时实时校验。 */
|
|
85
|
+
this.validateOnChange = true;
|
|
86
|
+
/** Internal validation error message. 内部校验错误消息。 */
|
|
87
|
+
this.errorMsg = '';
|
|
88
|
+
/** Dependency field names. 依赖字段名称列表。 */
|
|
89
|
+
this.dependencies = [];
|
|
90
|
+
/** Dependency rules. 依赖联动规则。 */
|
|
91
|
+
this.rules = [];
|
|
92
|
+
/** Current values of dependency fields. 依赖字段的当前值。 */
|
|
93
|
+
this.dependencyValues = {};
|
|
94
|
+
/** Whether the field is visible (controlled by dependency rules). 字段是否可见(由依赖规则控制)。 */
|
|
95
|
+
this._visible = true;
|
|
96
|
+
/** Whether the field is disabled by dependency rules. 是否被依赖规则禁用。 */
|
|
97
|
+
this._ruleDisabled = false;
|
|
98
|
+
/** Options computed by dependency rules. 依赖规则计算的选项。 */
|
|
99
|
+
this._ruleOptions = null;
|
|
100
|
+
/** Whether the password is visible (only for inputType="password"). 密码是否明文显示(仅 inputType="password" 时生效)。 */
|
|
101
|
+
this._passwordVisible = false;
|
|
102
|
+
this.pendingClear = false;
|
|
103
|
+
/** Handles input/textarea/number change events. 处理 input/textarea/number 的变更事件。 */
|
|
104
|
+
this.handleInputChange = (ev) => {
|
|
105
|
+
const target = ev.target;
|
|
106
|
+
this.value = target.value;
|
|
107
|
+
this.emit('aithe-change', { name: this.name, value: this.value });
|
|
108
|
+
if (this.validateOnChange) {
|
|
109
|
+
this.validate();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
/** Toggles password visibility (only for inputType="password"). 切换密码明文显示(仅 inputType="password" 时生效)。 */
|
|
113
|
+
this.togglePasswordVisible = () => {
|
|
114
|
+
this._passwordVisible = !this._passwordVisible;
|
|
115
|
+
};
|
|
116
|
+
/** Handles switch toggle change. 处理开关组件的切换事件。 */
|
|
117
|
+
this.handleSwitchChange = (ev) => {
|
|
118
|
+
const target = ev.target;
|
|
119
|
+
this.value = target.checked ? 'true' : 'false';
|
|
120
|
+
this.emit('aithe-change', { name: this.name, value: this.value === 'true' });
|
|
121
|
+
if (this.validateOnChange) {
|
|
122
|
+
this.validate();
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
/** Handles select dropdown change. 处理下拉选择器的变更事件。 */
|
|
126
|
+
this.handleSelectChange = (ev) => {
|
|
127
|
+
const target = ev.target;
|
|
128
|
+
this.value = target.value ?? '';
|
|
129
|
+
this.emit('aithe-change', { name: this.name, value: this.value });
|
|
130
|
+
if (this.validateOnChange) {
|
|
131
|
+
this.validate();
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
/** Handles radio group selection change. 处理单选框组的变更事件。 */
|
|
135
|
+
this.handleRadioChange = (ev) => {
|
|
136
|
+
const target = ev.target;
|
|
137
|
+
this.value = target.value ?? '';
|
|
138
|
+
this.emit('aithe-change', { name: this.name, value: this.value });
|
|
139
|
+
if (this.validateOnChange) {
|
|
140
|
+
this.validate();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
/** Handles checkbox group change, serializes selected values to JSON string. 处理复选框组的变更事件,将选中值序列化为 JSON 字符串。 */
|
|
144
|
+
this.handleCheckboxChange = (ev) => {
|
|
145
|
+
this.value = JSON.stringify(ev.detail.value ?? []);
|
|
146
|
+
this.emit('aithe-change', { name: this.name, value: this.getFieldValue() });
|
|
147
|
+
if (this.validateOnChange) {
|
|
148
|
+
this.validate();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
/** Handles slider value change. 处理滑块组件的变更事件。 */
|
|
152
|
+
this.handleSliderChange = (ev) => {
|
|
153
|
+
const target = ev.target;
|
|
154
|
+
this.value = target.value ?? '';
|
|
155
|
+
this.emit('aithe-change', { name: this.name, value: this.value });
|
|
156
|
+
if (this.validateOnChange) {
|
|
157
|
+
this.validate();
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
/** Handles rate component value change. 处理评分组件的变更事件。 */
|
|
161
|
+
this.handleRateChange = (ev) => {
|
|
162
|
+
const target = ev.target;
|
|
163
|
+
this.value = target.value ?? '';
|
|
164
|
+
this.emit('aithe-change', { name: this.name, value: this.value });
|
|
165
|
+
if (this.validateOnChange) {
|
|
166
|
+
this.validate();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
/** Handles color picker value change. 处理颜色选择器的变更事件。 */
|
|
170
|
+
this.handleColorPickerChange = (ev) => {
|
|
171
|
+
const target = ev.target;
|
|
172
|
+
this.value = target.value ?? '';
|
|
173
|
+
this.emit('aithe-change', { name: this.name, value: this.value });
|
|
174
|
+
if (this.validateOnChange) {
|
|
175
|
+
this.validate();
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
/** Handles date picker value change. 处理日期选择器的变更事件。 */
|
|
179
|
+
this.handleDatePickerChange = (ev) => {
|
|
180
|
+
const target = ev.target;
|
|
181
|
+
this.value = target.value ?? '';
|
|
182
|
+
this.emit('aithe-change', { name: this.name, value: this.value });
|
|
183
|
+
if (this.validateOnChange) {
|
|
184
|
+
this.validate();
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
/** Handles time picker value change. 处理时间选择器的变更事件。 */
|
|
188
|
+
this.handleTimePickerChange = (ev) => {
|
|
189
|
+
const target = ev.target;
|
|
190
|
+
this.value = target.value ?? '';
|
|
191
|
+
this.emit('aithe-change', { name: this.name, value: this.value });
|
|
192
|
+
if (this.validateOnChange) {
|
|
193
|
+
this.validate();
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
/** Handles combobox value change. 处理组合框的变更事件。 */
|
|
197
|
+
this.handleComboboxChange = (ev) => {
|
|
198
|
+
this.value = ev.detail.value ?? '';
|
|
199
|
+
this.emit('aithe-change', { name: this.name, value: this.value });
|
|
200
|
+
if (this.validateOnChange) {
|
|
201
|
+
this.validate();
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/** Whether the field is visible (controlled by dependency rules). 字段是否可见(由依赖规则控制)。 */
|
|
206
|
+
get visible() {
|
|
207
|
+
return this._visible;
|
|
208
|
+
}
|
|
209
|
+
static { this.styles = [
|
|
210
|
+
aitheBaseStyles,
|
|
211
|
+
css `
|
|
212
|
+
:host {
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: var(--aithe-space-2);
|
|
216
|
+
width: 100%;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.item-header {
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
gap: var(--aithe-space-2);
|
|
223
|
+
font-weight: var(--aithe-font-weight-medium);
|
|
224
|
+
font-size: var(--aithe-font-size-sm);
|
|
225
|
+
color: var(--aithe-color-text);
|
|
226
|
+
line-height: 1.5;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.item-icon {
|
|
230
|
+
flex-shrink: 0;
|
|
231
|
+
color: var(--aithe-color-text-muted);
|
|
232
|
+
font-size: 14px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.item-label {
|
|
236
|
+
flex: 1;
|
|
237
|
+
min-width: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.item-required {
|
|
241
|
+
color: var(--aithe-danger-6);
|
|
242
|
+
margin-left: 2px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.item-tooltip {
|
|
246
|
+
flex-shrink: 0;
|
|
247
|
+
color: var(--aithe-color-text-muted);
|
|
248
|
+
cursor: help;
|
|
249
|
+
font-size: 12px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.item-control {
|
|
253
|
+
width: 100%;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.item-control aithe-input,
|
|
257
|
+
.item-control aithe-textarea,
|
|
258
|
+
.item-control aithe-select,
|
|
259
|
+
.item-control aithe-slider,
|
|
260
|
+
.item-control aithe-rate,
|
|
261
|
+
.item-control aithe-color-picker,
|
|
262
|
+
.item-control aithe-date-picker,
|
|
263
|
+
.item-control aithe-time-picker,
|
|
264
|
+
.item-control aithe-combobox {
|
|
265
|
+
width: 100%;
|
|
266
|
+
display: block;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.item-control aithe-radio-group,
|
|
270
|
+
.item-control aithe-checkbox-group {
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-wrap: wrap;
|
|
273
|
+
gap: var(--aithe-space-3);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.item-control aithe-switch {
|
|
277
|
+
display: inline-flex;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.item-control input[type='number'] {
|
|
281
|
+
width: 100%;
|
|
282
|
+
box-sizing: border-box;
|
|
283
|
+
padding: var(--aithe-space-2) var(--aithe-space-3);
|
|
284
|
+
border: 1px solid var(--aithe-color-border);
|
|
285
|
+
border-radius: var(--aithe-radius-md, 6px);
|
|
286
|
+
background: var(--aithe-color-surface);
|
|
287
|
+
color: var(--aithe-color-text);
|
|
288
|
+
font-size: var(--aithe-font-size-base);
|
|
289
|
+
font-family: inherit;
|
|
290
|
+
line-height: var(--aithe-line-height-base, 1.5);
|
|
291
|
+
outline: none;
|
|
292
|
+
transition: border-color 0.2s;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.item-control input[type='number']:focus {
|
|
296
|
+
border-color: var(--aithe-primary-6);
|
|
297
|
+
box-shadow: 0 0 0 2px rgba(var(--aithe-primary-6-rgb, 77, 141, 255), 0.15);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.item-control input[type='number']:disabled {
|
|
301
|
+
opacity: 0.5;
|
|
302
|
+
cursor: not-allowed;
|
|
303
|
+
background: var(--aithe-color-bg-subtle);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.item-footer {
|
|
307
|
+
display: flex;
|
|
308
|
+
flex-direction: column;
|
|
309
|
+
gap: 2px;
|
|
310
|
+
min-height: 0;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.item-description {
|
|
314
|
+
font-size: var(--aithe-font-size-xs);
|
|
315
|
+
color: var(--aithe-color-text-muted);
|
|
316
|
+
line-height: 1.5;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.item-error {
|
|
320
|
+
font-size: var(--aithe-font-size-xs);
|
|
321
|
+
color: var(--aithe-danger-6);
|
|
322
|
+
line-height: 1.5;
|
|
323
|
+
}
|
|
324
|
+
`,
|
|
325
|
+
]; }
|
|
326
|
+
/** Initializes value from default if empty. 初始化时若值为空则使用缺省值。 */
|
|
327
|
+
connectedCallback() {
|
|
328
|
+
super.connectedCallback();
|
|
329
|
+
if (this.value === '' && this.dft !== '') {
|
|
330
|
+
this.value = this.dft;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/** Applies dependency rules when dependencyValues or rules change. Also emits change after a clear rule resets the value. 依赖值或规则变更时应用联动规则,clear 规则重置值后触发 change 事件。 */
|
|
334
|
+
updated(changed) {
|
|
335
|
+
if (this.rules.length > 0) {
|
|
336
|
+
const depsChanged = changed.has('dependencyValues');
|
|
337
|
+
const rulesChanged = changed.has('rules');
|
|
338
|
+
if (depsChanged || rulesChanged) {
|
|
339
|
+
this.applyRules();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
if (this.pendingClear) {
|
|
343
|
+
this.pendingClear = false;
|
|
344
|
+
this.emit('aithe-change', { name: this.name, value: this.getFieldValue() });
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
/** Evaluates all dependency rules and updates visibility, disabled state, options, and value accordingly. 评估所有依赖规则,更新可见性、禁用状态、选项和值。 */
|
|
348
|
+
applyRules() {
|
|
349
|
+
const baseState = {
|
|
350
|
+
visible: this._visible,
|
|
351
|
+
disabled: this._ruleDisabled,
|
|
352
|
+
options: this._ruleOptions ?? this.options,
|
|
353
|
+
value: this.value,
|
|
354
|
+
};
|
|
355
|
+
const result = FormRuleEngine.evaluate(this.rules, this.dependencyValues, baseState);
|
|
356
|
+
if (result.visible !== this._visible) {
|
|
357
|
+
this._visible = result.visible;
|
|
358
|
+
}
|
|
359
|
+
if (result.disabled !== this._ruleDisabled) {
|
|
360
|
+
this._ruleDisabled = result.disabled;
|
|
361
|
+
}
|
|
362
|
+
if (result.options !== baseState.options) {
|
|
363
|
+
this._ruleOptions = result.options;
|
|
364
|
+
}
|
|
365
|
+
if (result.value === '' && this.value !== '') {
|
|
366
|
+
this.value = '';
|
|
367
|
+
this.pendingClear = true;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/** Validates the field and sets error state. Skips validation if hidden. 校验字段并设置错误状态,隐藏时跳过校验。 */
|
|
371
|
+
validate() {
|
|
372
|
+
if (!this._visible)
|
|
373
|
+
return true;
|
|
374
|
+
const val = this.value;
|
|
375
|
+
if (this.required && !String(val).trim()) {
|
|
376
|
+
this.errorMsg =
|
|
377
|
+
this.message ||
|
|
378
|
+
t('form.formItem.required', '{label} is required', {
|
|
379
|
+
label: this.label || this.name || t('form.formItem.requiredField'),
|
|
380
|
+
});
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
if (this.pattern && String(val).trim()) {
|
|
384
|
+
const regex = new RegExp(this.pattern);
|
|
385
|
+
if (!regex.test(String(val))) {
|
|
386
|
+
this.errorMsg = this.message || t('form.autoform.patternMismatch');
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
this.errorMsg = '';
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
/** Clears the validation error. 清除校验错误。 */
|
|
394
|
+
clearError() {
|
|
395
|
+
this.errorMsg = '';
|
|
396
|
+
}
|
|
397
|
+
/** Returns the current validation error message. 返回当前校验错误消息。 */
|
|
398
|
+
getError() {
|
|
399
|
+
return this.errorMsg;
|
|
400
|
+
}
|
|
401
|
+
/** Returns the current field value. 返回当前字段值。 */
|
|
402
|
+
getFieldValue() {
|
|
403
|
+
if (this.type === 'switch') {
|
|
404
|
+
return this.value === 'true' || this.value === '';
|
|
405
|
+
}
|
|
406
|
+
if (this.type === 'number') {
|
|
407
|
+
const num = Number(this.value);
|
|
408
|
+
return Number.isNaN(num) ? '' : num;
|
|
409
|
+
}
|
|
410
|
+
if (this.type === 'checkbox') {
|
|
411
|
+
try {
|
|
412
|
+
const parsed = JSON.parse(this.value || '[]');
|
|
413
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
414
|
+
}
|
|
415
|
+
catch {
|
|
416
|
+
return [];
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
const customDef = FormRegistry.get(this.type);
|
|
420
|
+
if (customDef?.valueTransformer) {
|
|
421
|
+
return customDef.valueTransformer(this.value);
|
|
422
|
+
}
|
|
423
|
+
return this.value;
|
|
424
|
+
}
|
|
425
|
+
/** Resolves the effective input type for password fields based on visibility state. 根据可见状态解析密码字段的有效输入类型。 */
|
|
426
|
+
resolvePasswordType() {
|
|
427
|
+
return this._passwordVisible ? 'text' : 'password';
|
|
428
|
+
}
|
|
429
|
+
/** Renders the appropriate form control based on type. Falls back to input for unknown types. 根据控件类型渲染对应的表单控件,未知类型回退为 input。 */
|
|
430
|
+
renderControl() {
|
|
431
|
+
const ph = this.placeholder || '';
|
|
432
|
+
const dis = this.disabled || this._ruleDisabled;
|
|
433
|
+
const effectiveOptions = this._ruleOptions ?? this.options;
|
|
434
|
+
const customDef = FormRegistry.get(this.type);
|
|
435
|
+
if (customDef) {
|
|
436
|
+
return customDef.render({
|
|
437
|
+
value: this.value,
|
|
438
|
+
placeholder: ph,
|
|
439
|
+
disabled: dis,
|
|
440
|
+
name: this.name,
|
|
441
|
+
options: effectiveOptions,
|
|
442
|
+
min: this.min,
|
|
443
|
+
max: this.max,
|
|
444
|
+
step: this.step,
|
|
445
|
+
rows: this.rows,
|
|
446
|
+
inputType: this.inputType,
|
|
447
|
+
onChange: (val) => {
|
|
448
|
+
if (val == null || typeof val === 'object') {
|
|
449
|
+
this.value = '';
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
this.value = safeStringify(val);
|
|
453
|
+
}
|
|
454
|
+
this.emit('aithe-change', { name: this.name, value: this.getFieldValue() });
|
|
455
|
+
if (this.validateOnChange) {
|
|
456
|
+
this.validate();
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
switch (this.type) {
|
|
462
|
+
case 'input': {
|
|
463
|
+
const isPassword = this.inputType === 'password';
|
|
464
|
+
const effectiveType = isPassword ? this.resolvePasswordType() : this.inputType || 'text';
|
|
465
|
+
const passwordIconName = this._passwordVisible ? 'eyeOff' : 'eye';
|
|
466
|
+
return html `
|
|
467
|
+
<aithe-input
|
|
468
|
+
.type=${effectiveType}
|
|
469
|
+
.placeholder=${ph}
|
|
470
|
+
.value=${this.value}
|
|
471
|
+
?disabled=${dis}
|
|
472
|
+
name=${this.name}
|
|
473
|
+
@aithe-change=${this.handleInputChange}
|
|
474
|
+
>
|
|
475
|
+
${isPassword
|
|
476
|
+
? html `
|
|
477
|
+
<aithe-icon
|
|
478
|
+
slot="suffix"
|
|
479
|
+
name=${passwordIconName}
|
|
480
|
+
size="sm"
|
|
481
|
+
@click=${this.togglePasswordVisible}
|
|
482
|
+
></aithe-icon>
|
|
483
|
+
`
|
|
484
|
+
: nothing}
|
|
485
|
+
</aithe-input>
|
|
486
|
+
`;
|
|
487
|
+
}
|
|
488
|
+
case 'textarea':
|
|
489
|
+
return html `
|
|
490
|
+
<aithe-textarea
|
|
491
|
+
.placeholder=${ph}
|
|
492
|
+
.value=${this.value}
|
|
493
|
+
.rows=${Number(this.rows) || 3}
|
|
494
|
+
?disabled=${dis}
|
|
495
|
+
name=${this.name}
|
|
496
|
+
@aithe-change=${this.handleInputChange}
|
|
497
|
+
></aithe-textarea>
|
|
498
|
+
`;
|
|
499
|
+
case 'select':
|
|
500
|
+
return html `
|
|
501
|
+
<aithe-select
|
|
502
|
+
.placeholder=${ph}
|
|
503
|
+
.value=${this.value}
|
|
504
|
+
.options=${effectiveOptions}
|
|
505
|
+
?disabled=${dis}
|
|
506
|
+
name=${this.name}
|
|
507
|
+
@aithe-change=${this.handleSelectChange}
|
|
508
|
+
></aithe-select>
|
|
509
|
+
`;
|
|
510
|
+
case 'radio':
|
|
511
|
+
return html `
|
|
512
|
+
<aithe-radio-group
|
|
513
|
+
.value=${this.value}
|
|
514
|
+
?disabled=${dis}
|
|
515
|
+
name=${this.name}
|
|
516
|
+
@aithe-change=${this.handleRadioChange}
|
|
517
|
+
>
|
|
518
|
+
${this.renderRadioOptions(effectiveOptions)}
|
|
519
|
+
</aithe-radio-group>
|
|
520
|
+
`;
|
|
521
|
+
case 'checkbox':
|
|
522
|
+
return html `
|
|
523
|
+
<aithe-checkbox-group
|
|
524
|
+
.value=${this.parseCheckboxValue(this.value)}
|
|
525
|
+
?disabled=${dis}
|
|
526
|
+
name=${this.name}
|
|
527
|
+
@aithe-change=${this.handleCheckboxChange}
|
|
528
|
+
>
|
|
529
|
+
${this.renderCheckboxOptions(effectiveOptions)}
|
|
530
|
+
</aithe-checkbox-group>
|
|
531
|
+
`;
|
|
532
|
+
case 'switch':
|
|
533
|
+
return html `
|
|
534
|
+
<aithe-switch
|
|
535
|
+
.checked=${this.value === 'true' || this.value === ''}
|
|
536
|
+
?disabled=${dis}
|
|
537
|
+
name=${this.name}
|
|
538
|
+
@aithe-change=${this.handleSwitchChange}
|
|
539
|
+
></aithe-switch>
|
|
540
|
+
`;
|
|
541
|
+
case 'number':
|
|
542
|
+
return html `
|
|
543
|
+
<input
|
|
544
|
+
type="number"
|
|
545
|
+
.value=${this.value}
|
|
546
|
+
.placeholder=${ph}
|
|
547
|
+
?disabled=${dis}
|
|
548
|
+
.min=${this.min || undefined}
|
|
549
|
+
.max=${this.max || undefined}
|
|
550
|
+
.step=${this.step || undefined}
|
|
551
|
+
name=${this.name}
|
|
552
|
+
@input=${this.handleInputChange}
|
|
553
|
+
/>
|
|
554
|
+
`;
|
|
555
|
+
case 'slider':
|
|
556
|
+
return html `
|
|
557
|
+
<aithe-slider
|
|
558
|
+
.value=${this.value}
|
|
559
|
+
?disabled=${dis}
|
|
560
|
+
.min=${this.min || undefined}
|
|
561
|
+
.max=${this.max || undefined}
|
|
562
|
+
.step=${this.step || undefined}
|
|
563
|
+
name=${this.name}
|
|
564
|
+
@aithe-change=${this.handleSliderChange}
|
|
565
|
+
></aithe-slider>
|
|
566
|
+
`;
|
|
567
|
+
case 'rate':
|
|
568
|
+
return html `
|
|
569
|
+
<aithe-rate
|
|
570
|
+
.value=${this.value}
|
|
571
|
+
?disabled=${dis}
|
|
572
|
+
name=${this.name}
|
|
573
|
+
@aithe-change=${this.handleRateChange}
|
|
574
|
+
></aithe-rate>
|
|
575
|
+
`;
|
|
576
|
+
case 'color-picker':
|
|
577
|
+
return html `
|
|
578
|
+
<aithe-color-picker
|
|
579
|
+
.value=${this.value}
|
|
580
|
+
?disabled=${dis}
|
|
581
|
+
name=${this.name}
|
|
582
|
+
@aithe-change=${this.handleColorPickerChange}
|
|
583
|
+
></aithe-color-picker>
|
|
584
|
+
`;
|
|
585
|
+
case 'date-picker':
|
|
586
|
+
return html `
|
|
587
|
+
<aithe-date-picker
|
|
588
|
+
.value=${this.value}
|
|
589
|
+
?disabled=${dis}
|
|
590
|
+
name=${this.name}
|
|
591
|
+
@aithe-change=${this.handleDatePickerChange}
|
|
592
|
+
></aithe-date-picker>
|
|
593
|
+
`;
|
|
594
|
+
case 'time-picker':
|
|
595
|
+
return html `
|
|
596
|
+
<aithe-time-picker
|
|
597
|
+
.value=${this.value}
|
|
598
|
+
?disabled=${dis}
|
|
599
|
+
name=${this.name}
|
|
600
|
+
@aithe-change=${this.handleTimePickerChange}
|
|
601
|
+
></aithe-time-picker>
|
|
602
|
+
`;
|
|
603
|
+
case 'combobox':
|
|
604
|
+
return html `
|
|
605
|
+
<aithe-combobox
|
|
606
|
+
.placeholder=${ph}
|
|
607
|
+
.value=${this.value}
|
|
608
|
+
.options=${JSON.stringify(effectiveOptions)}
|
|
609
|
+
?disabled=${dis}
|
|
610
|
+
name=${this.name}
|
|
611
|
+
@aithe-change=${this.handleComboboxChange}
|
|
612
|
+
></aithe-combobox>
|
|
613
|
+
`;
|
|
614
|
+
default:
|
|
615
|
+
return html `
|
|
616
|
+
<aithe-input
|
|
617
|
+
.placeholder=${ph}
|
|
618
|
+
.value=${this.value}
|
|
619
|
+
?disabled=${dis}
|
|
620
|
+
name=${this.name}
|
|
621
|
+
@aithe-change=${this.handleInputChange}
|
|
622
|
+
></aithe-input>
|
|
623
|
+
`;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
/** Renders radio button options for radio group. 渲染单选框组的选项。 */
|
|
627
|
+
renderRadioOptions(opts) {
|
|
628
|
+
return opts.map((opt) => html `
|
|
629
|
+
<aithe-radio value=${opt.id} name=${this.name} ?disabled=${opt.disabled ?? false}>
|
|
630
|
+
${opt.label}
|
|
631
|
+
</aithe-radio>
|
|
632
|
+
`);
|
|
633
|
+
}
|
|
634
|
+
/** Renders checkbox options for checkbox group. 渲染复选框组的选项。 */
|
|
635
|
+
renderCheckboxOptions(opts) {
|
|
636
|
+
return opts.map((opt) => html `
|
|
637
|
+
<aithe-checkbox value=${opt.id} ?disabled=${opt.disabled ?? false}>
|
|
638
|
+
${opt.label}
|
|
639
|
+
</aithe-checkbox>
|
|
640
|
+
`);
|
|
641
|
+
}
|
|
642
|
+
/** Parses checkbox value from JSON string or array to a string array. 将复选框值从 JSON 字符串或数组解析为字符串数组。 */
|
|
643
|
+
parseCheckboxValue(raw) {
|
|
644
|
+
if (Array.isArray(raw)) {
|
|
645
|
+
return raw;
|
|
646
|
+
}
|
|
647
|
+
try {
|
|
648
|
+
const parsed = JSON.parse(raw || '[]');
|
|
649
|
+
return Array.isArray(parsed) ? parsed.filter((v) => typeof v === 'string') : [];
|
|
650
|
+
}
|
|
651
|
+
catch {
|
|
652
|
+
return [];
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
render() {
|
|
656
|
+
if (!this._visible)
|
|
657
|
+
return nothing;
|
|
658
|
+
const iconEl = this.icon
|
|
659
|
+
? html `
|
|
660
|
+
<aithe-icon class="item-icon" name=${this.icon} size="14"></aithe-icon>
|
|
661
|
+
`
|
|
662
|
+
: nothing;
|
|
663
|
+
const requiredMark = this.required
|
|
664
|
+
? html `
|
|
665
|
+
<span class="item-required">*</span>
|
|
666
|
+
`
|
|
667
|
+
: nothing;
|
|
668
|
+
const tooltipEl = this.tooltip
|
|
669
|
+
? html `
|
|
670
|
+
<aithe-tooltip content=${this.tooltip}><span class="item-tooltip">ⓘ</span></aithe-tooltip>
|
|
671
|
+
`
|
|
672
|
+
: nothing;
|
|
673
|
+
const headerEl = this.label || this.icon || this.tooltip
|
|
674
|
+
? html `
|
|
675
|
+
<div class="item-header">
|
|
676
|
+
${iconEl}
|
|
677
|
+
<span class="item-label">${this.label}</span>
|
|
678
|
+
${requiredMark} ${tooltipEl}
|
|
679
|
+
</div>
|
|
680
|
+
`
|
|
681
|
+
: nothing;
|
|
682
|
+
const descriptionEl = this.description
|
|
683
|
+
? html `
|
|
684
|
+
<aithe-label class="item-description" content=${this.description} size="sm"></aithe-label>
|
|
685
|
+
`
|
|
686
|
+
: nothing;
|
|
687
|
+
const errorEl = this.errorMsg
|
|
688
|
+
? html `
|
|
689
|
+
<span class="item-error">${this.errorMsg}</span>
|
|
690
|
+
`
|
|
691
|
+
: nothing;
|
|
692
|
+
const footerEl = descriptionEl || errorEl
|
|
693
|
+
? html `
|
|
694
|
+
<div class="item-footer">${descriptionEl}${errorEl}</div>
|
|
695
|
+
`
|
|
696
|
+
: nothing;
|
|
697
|
+
return html `
|
|
698
|
+
${headerEl}
|
|
699
|
+
<div class="item-control">${this.renderControl()}</div>
|
|
700
|
+
${footerEl}
|
|
701
|
+
`;
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
__decorate([
|
|
705
|
+
property({ type: String })
|
|
706
|
+
], AitheAutoformItem.prototype, "name", void 0);
|
|
707
|
+
__decorate([
|
|
708
|
+
property({ type: String })
|
|
709
|
+
], AitheAutoformItem.prototype, "type", void 0);
|
|
710
|
+
__decorate([
|
|
711
|
+
property({ type: String })
|
|
712
|
+
], AitheAutoformItem.prototype, "label", void 0);
|
|
713
|
+
__decorate([
|
|
714
|
+
property({ type: String })
|
|
715
|
+
], AitheAutoformItem.prototype, "icon", void 0);
|
|
716
|
+
__decorate([
|
|
717
|
+
property({ type: String })
|
|
718
|
+
], AitheAutoformItem.prototype, "tooltip", void 0);
|
|
719
|
+
__decorate([
|
|
720
|
+
property({ type: String })
|
|
721
|
+
], AitheAutoformItem.prototype, "description", void 0);
|
|
722
|
+
__decorate([
|
|
723
|
+
property({ type: String })
|
|
724
|
+
], AitheAutoformItem.prototype, "dft", void 0);
|
|
725
|
+
__decorate([
|
|
726
|
+
property({ type: String })
|
|
727
|
+
], AitheAutoformItem.prototype, "placeholder", void 0);
|
|
728
|
+
__decorate([
|
|
729
|
+
property({ type: Boolean, reflect: true })
|
|
730
|
+
], AitheAutoformItem.prototype, "disabled", void 0);
|
|
731
|
+
__decorate([
|
|
732
|
+
property({ type: Boolean })
|
|
733
|
+
], AitheAutoformItem.prototype, "required", void 0);
|
|
734
|
+
__decorate([
|
|
735
|
+
property({ type: String })
|
|
736
|
+
], AitheAutoformItem.prototype, "pattern", void 0);
|
|
737
|
+
__decorate([
|
|
738
|
+
property({ type: String })
|
|
739
|
+
], AitheAutoformItem.prototype, "message", void 0);
|
|
740
|
+
__decorate([
|
|
741
|
+
property({ attribute: false })
|
|
742
|
+
], AitheAutoformItem.prototype, "options", void 0);
|
|
743
|
+
__decorate([
|
|
744
|
+
property({ type: String })
|
|
745
|
+
], AitheAutoformItem.prototype, "value", void 0);
|
|
746
|
+
__decorate([
|
|
747
|
+
property({ type: String })
|
|
748
|
+
], AitheAutoformItem.prototype, "inputType", void 0);
|
|
749
|
+
__decorate([
|
|
750
|
+
property({ type: String })
|
|
751
|
+
], AitheAutoformItem.prototype, "min", void 0);
|
|
752
|
+
__decorate([
|
|
753
|
+
property({ type: String })
|
|
754
|
+
], AitheAutoformItem.prototype, "max", void 0);
|
|
755
|
+
__decorate([
|
|
756
|
+
property({ type: String })
|
|
757
|
+
], AitheAutoformItem.prototype, "step", void 0);
|
|
758
|
+
__decorate([
|
|
759
|
+
property({ type: String })
|
|
760
|
+
], AitheAutoformItem.prototype, "rows", void 0);
|
|
761
|
+
__decorate([
|
|
762
|
+
property({ type: Boolean, attribute: 'validate-on-change' })
|
|
763
|
+
], AitheAutoformItem.prototype, "validateOnChange", void 0);
|
|
764
|
+
__decorate([
|
|
765
|
+
state()
|
|
766
|
+
], AitheAutoformItem.prototype, "errorMsg", void 0);
|
|
767
|
+
__decorate([
|
|
768
|
+
property({ attribute: false })
|
|
769
|
+
], AitheAutoformItem.prototype, "dependencies", void 0);
|
|
770
|
+
__decorate([
|
|
771
|
+
property({ attribute: false })
|
|
772
|
+
], AitheAutoformItem.prototype, "rules", void 0);
|
|
773
|
+
__decorate([
|
|
774
|
+
property({ attribute: false })
|
|
775
|
+
], AitheAutoformItem.prototype, "dependencyValues", void 0);
|
|
776
|
+
__decorate([
|
|
777
|
+
state()
|
|
778
|
+
], AitheAutoformItem.prototype, "_visible", void 0);
|
|
779
|
+
__decorate([
|
|
780
|
+
state()
|
|
781
|
+
], AitheAutoformItem.prototype, "_ruleDisabled", void 0);
|
|
782
|
+
__decorate([
|
|
783
|
+
state()
|
|
784
|
+
], AitheAutoformItem.prototype, "_ruleOptions", void 0);
|
|
785
|
+
__decorate([
|
|
786
|
+
state()
|
|
787
|
+
], AitheAutoformItem.prototype, "_passwordVisible", void 0);
|
|
788
|
+
AitheAutoformItem = __decorate([
|
|
789
|
+
customElement('aithe-autoform-item')
|
|
790
|
+
], AitheAutoformItem);
|
|
791
|
+
export { AitheAutoformItem };
|