@tongfun/ui 0.0.0-alpha.3 → 0.0.1-alpha.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/.claude/settings.local.json +7 -0
- package/.hermes/plans/datapicker-object-mode.md +57 -0
- package/.hermes/plans/design-spec-fusion-5175-v2.md +146 -0
- package/.hermes/plans/design-spec-fusion-5175.md +88 -0
- package/.hermes/plans/file-upload-chip-redesign.md +66 -0
- package/.hermes/plans/form-image-upload-modelvalue-fix.md +38 -0
- package/.hermes/plans/form-layout-responsive-span-plan.md +137 -0
- package/.hermes/plans/global-audit-report.md +728 -0
- package/.hermes/plans/global-audit-report.v1.md +604 -0
- package/.hermes/plans/global-audit-report.v3.md +777 -0
- package/.hermes/plans/image-file-erp-redesign.md +173 -0
- package/.hermes/plans/location-picker-baidu-modal.md +173 -0
- package/.hermes/plans/new-document-3b-color-componentization-plan.md +155 -0
- package/.hermes/plans/new-document-form-layout-rebuild-plan.md +150 -0
- package/.hermes/plans/new-document-fullwidth-3col-plan.md +177 -0
- package/.hermes/plans/picker-quick-options-range-mode.md +143 -0
- package/.hermes/plans/region-picker-mock-contract.md +202 -0
- package/.hermes/plans/zero-div-component-contracts.md +466 -0
- package/README.md +110 -0
- package/components.json +19 -0
- package/docs/DEVELOPMENT.md +315 -0
- package/docs/PRD.md +170 -0
- package/docs/ai-api-layering.md +141 -0
- package/docs/anchor-component-plan.md +165 -0
- package/docs/components-analysis.md +2911 -0
- package/docs/demo-scan-report.md +142 -0
- package/docs/editable-table-research.md +8 -0
- package/docs/form-panorama-plan.md +141 -0
- package/docs/lowcode-agent-component-registry.sample.json +36364 -0
- package/docs/tf-form-table-modification-plan.md +503 -0
- package/docs/token-compliance-audit-report.md +542 -0
- package/env.d.ts +5 -0
- package/eslint.config.js +66 -0
- package/package.json +85 -38
- package/packages/ui/__tests__/package-exports.test.ts +23 -0
- package/packages/ui/components/affix/README.md +78 -0
- package/packages/ui/components/affix/__tests__/affix.test.ts +204 -0
- package/packages/ui/components/affix/index.ts +13 -0
- package/packages/ui/components/affix/src/affix.vue +216 -0
- package/packages/ui/components/affix/src/types.ts +47 -0
- package/packages/ui/components/affix/styles/affix.css +17 -0
- package/packages/ui/components/ai-overlay/README.md +180 -0
- package/packages/ui/components/ai-overlay/__tests__/ai-action-menu.test.ts +133 -0
- package/packages/ui/components/ai-overlay/__tests__/ai-overlay.test.ts +117 -0
- package/packages/ui/components/ai-overlay/index.ts +32 -0
- package/packages/ui/components/ai-overlay/src/ai-action-menu-types.ts +22 -0
- package/packages/ui/components/ai-overlay/src/ai-action-menu.vue +200 -0
- package/packages/ui/components/ai-overlay/src/ai-overlay.vue +329 -0
- package/packages/ui/components/ai-overlay/src/types.ts +84 -0
- package/packages/ui/components/ai-overlay/styles/ai-overlay.css +306 -0
- package/packages/ui/components/ai-state-flow/README.md +111 -0
- package/packages/ui/components/ai-state-flow/__tests__/ai-state-flow.test.ts +69 -0
- package/packages/ui/components/ai-state-flow/ai-state-flow.ts +16 -0
- package/packages/ui/components/ai-state-flow/ai-state-flow.vue +67 -0
- package/packages/ui/components/ai-state-flow/index.ts +24 -0
- package/packages/ui/components/ai-state-flow/styles/ai-state-flow.css +144 -0
- package/packages/ui/components/alert/README.md +83 -0
- package/packages/ui/components/alert/__tests__/alert.test.ts +155 -0
- package/packages/ui/components/alert/index.ts +13 -0
- package/packages/ui/components/alert/src/alert.ts +90 -0
- package/packages/ui/components/alert/src/alert.vue +87 -0
- package/packages/ui/components/alert/styles/alert.css +158 -0
- package/packages/ui/components/anchor/README.md +50 -0
- package/packages/ui/components/anchor/__tests__/anchor.test.ts +284 -0
- package/packages/ui/components/anchor/index.ts +13 -0
- package/packages/ui/components/anchor/src/anchor.vue +94 -0
- package/packages/ui/components/anchor/src/types.ts +55 -0
- package/packages/ui/components/anchor/src/use-anchor.ts +253 -0
- package/packages/ui/components/anchor/styles/anchor.css +90 -0
- package/packages/ui/components/avatar/README.md +118 -0
- package/packages/ui/components/avatar/__tests__/avatar.test.ts +83 -0
- package/packages/ui/components/avatar/index.ts +12 -0
- package/packages/ui/components/avatar/src/avatar.ts +62 -0
- package/packages/ui/components/avatar/src/avatar.vue +106 -0
- package/packages/ui/components/back-top/README.md +63 -0
- package/packages/ui/components/back-top/__tests__/back-top.test.ts +215 -0
- package/packages/ui/components/back-top/index.ts +13 -0
- package/packages/ui/components/back-top/src/back-top.ts +51 -0
- package/packages/ui/components/back-top/src/back-top.vue +104 -0
- package/packages/ui/components/back-top/styles/back-top.css +24 -0
- package/packages/ui/components/badge/README.md +71 -0
- package/packages/ui/components/badge/__tests__/badge.test.ts +142 -0
- package/packages/ui/components/badge/index.ts +13 -0
- package/packages/ui/components/badge/src/badge.ts +64 -0
- package/packages/ui/components/badge/src/badge.vue +76 -0
- package/packages/ui/components/badge/styles/badge.css +45 -0
- package/packages/ui/components/batch-action-button/README.md +68 -0
- package/packages/ui/components/batch-action-button/__tests__/batch-action-button.test.ts +30 -0
- package/packages/ui/components/batch-action-button/index.ts +11 -0
- package/packages/ui/components/batch-action-button/src/batch-action-button.vue +59 -0
- package/packages/ui/components/batch-action-button/src/types.ts +9 -0
- package/packages/ui/components/breadcrumb/README.md +115 -0
- package/packages/ui/components/breadcrumb/__tests__/breadcrumb.test.ts +168 -0
- package/packages/ui/components/breadcrumb/index.ts +13 -0
- package/packages/ui/components/breadcrumb/src/breadcrumb.ts +60 -0
- package/packages/ui/components/breadcrumb/src/breadcrumb.vue +86 -0
- package/packages/ui/components/business/document/action-header/index.ts +14 -0
- package/packages/ui/components/business/document/action-header/src/context.ts +10 -0
- package/packages/ui/components/business/document/action-header/src/document-action-header.vue +296 -0
- package/packages/ui/components/business/document/action-header/src/types.ts +100 -0
- package/packages/ui/components/business/document/ai-toolbar/index.ts +12 -0
- package/packages/ui/components/business/document/ai-toolbar/src/document-ai-toolbar.vue +72 -0
- package/packages/ui/components/business/document/form-page/index.ts +16 -0
- package/packages/ui/components/business/document/form-page/src/composables/use-document-ai-toolbar.ts +37 -0
- package/packages/ui/components/business/document/form-page/src/composables/use-document-layout-mode.ts +24 -0
- package/packages/ui/components/business/document/form-page/src/composables/use-document-recognition.ts +55 -0
- package/packages/ui/components/business/document/form-page/src/composables/use-document-save.ts +243 -0
- package/packages/ui/components/business/document/form-page/src/composables/use-document-sections.ts +234 -0
- package/packages/ui/components/business/document/form-page/src/context.ts +15 -0
- package/packages/ui/components/business/document/form-page/src/document-form-page.vue +251 -0
- package/packages/ui/components/business/document/form-page/src/document-section-card.vue +187 -0
- package/packages/ui/components/business/document/form-page/src/types.ts +245 -0
- package/packages/ui/components/business/document/form-page/styles/document-form-page.css +40 -0
- package/packages/ui/components/business/enum-select/index.ts +18 -0
- package/packages/ui/components/business/enum-select/src/enum-select.vue +171 -0
- package/packages/ui/components/business/enum-select/src/types.ts +33 -0
- package/packages/ui/components/button/README.md +155 -0
- package/packages/ui/components/button/__tests__/button.test.ts +261 -0
- package/packages/ui/components/button/index.ts +14 -0
- package/packages/ui/components/button/src/button.ts +168 -0
- package/packages/ui/components/button/src/button.vue +341 -0
- package/packages/ui/components/button/styles/button.css +149 -0
- package/packages/ui/components/carousel/README.md +48 -0
- package/packages/ui/components/carousel/__tests__/carousel.test.ts +82 -0
- package/packages/ui/components/carousel/index.ts +11 -0
- package/packages/ui/components/carousel/src/carousel.ts +38 -0
- package/packages/ui/components/carousel/src/carousel.vue +101 -0
- package/packages/ui/components/carousel/styles/carousel.css +40 -0
- package/packages/ui/components/chart/README.md +120 -0
- package/packages/ui/components/chart/__tests__/chart.test.ts +86 -0
- package/packages/ui/components/chart/__tests__/simple-charts.test.ts +130 -0
- package/packages/ui/components/chart/index.ts +22 -0
- package/packages/ui/components/chart/src/bar-chart.vue +83 -0
- package/packages/ui/components/chart/src/chart.ts +135 -0
- package/packages/ui/components/chart/src/chart.vue +147 -0
- package/packages/ui/components/chart/src/donut-chart.vue +96 -0
- package/packages/ui/components/chart/src/line-chart.vue +101 -0
- package/packages/ui/components/chart/src/metric-grid.vue +55 -0
- package/packages/ui/components/chart/src/types.ts +91 -0
- package/packages/ui/components/chart/src/utils.ts +68 -0
- package/packages/ui/components/chart/styles/bar-chart.css +134 -0
- package/packages/ui/components/chart/styles/chart.css +48 -0
- package/packages/ui/components/chart/styles/donut-chart.css +114 -0
- package/packages/ui/components/chart/styles/line-chart.css +61 -0
- package/packages/ui/components/chart/styles/metric-grid.css +115 -0
- package/packages/ui/components/code-block/README.md +56 -0
- package/packages/ui/components/code-block/__tests__/code-block.test.ts +166 -0
- package/packages/ui/components/code-block/index.ts +13 -0
- package/packages/ui/components/code-block/src/code-block.vue +216 -0
- package/packages/ui/components/code-block/src/types.ts +31 -0
- package/packages/ui/components/code-block/styles/code-block.css +192 -0
- package/packages/ui/components/data-grid/CellRendererActions.vue +77 -0
- package/packages/ui/components/data-grid/CellRendererButton.vue +51 -0
- package/packages/ui/components/data-grid/CellRendererCsCheckbox.vue +16 -0
- package/packages/ui/components/data-grid/CellRendererCsInput.vue +29 -0
- package/packages/ui/components/data-grid/CellRendererCsSelect.vue +19 -0
- package/packages/ui/components/data-grid/CellRendererInput.vue +120 -0
- package/packages/ui/components/data-grid/CellRendererText.vue +94 -0
- package/packages/ui/components/data-grid/ColumnSettings.vue +40 -0
- package/packages/ui/components/data-grid/ColumnSettingsDialog.vue +367 -0
- package/packages/ui/components/data-grid/DataGrid.vue +850 -0
- package/packages/ui/components/data-grid/DataGridFilter.vue +242 -0
- package/packages/ui/components/data-grid/column-settings-api.ts +62 -0
- package/packages/ui/components/data-grid/index.ts +29 -0
- package/packages/ui/components/data-grid/props.ts +246 -0
- package/packages/ui/components/data-grid/variants.ts +26 -0
- package/packages/ui/components/divider/README.md +84 -0
- package/packages/ui/components/divider/__tests__/divider.test.ts +105 -0
- package/packages/ui/components/divider/index.ts +13 -0
- package/packages/ui/components/divider/src/divider.ts +50 -0
- package/packages/ui/components/divider/src/divider.vue +76 -0
- package/packages/ui/components/divider/styles/divider.css +65 -0
- package/packages/ui/components/drawer/README.md +90 -0
- package/packages/ui/components/drawer/__tests__/drawer.test.ts +218 -0
- package/packages/ui/components/drawer/index.ts +13 -0
- package/packages/ui/components/drawer/src/drawer.ts +88 -0
- package/packages/ui/components/drawer/src/drawer.vue +157 -0
- package/packages/ui/components/drawer/styles/drawer.css +164 -0
- package/packages/ui/components/dropdown/README.md +51 -0
- package/packages/ui/components/dropdown/__tests__/dropdown.test.ts +143 -0
- package/packages/ui/components/dropdown/index.ts +11 -0
- package/packages/ui/components/dropdown/src/dropdown.ts +47 -0
- package/packages/ui/components/dropdown/src/dropdown.vue +75 -0
- package/packages/ui/components/dropdown/styles/dropdown.css +16 -0
- package/packages/ui/components/dropdown-button/README.md +78 -0
- package/packages/ui/components/dropdown-button/__tests__/dropdown-button.test.ts +75 -0
- package/packages/ui/components/dropdown-button/index.ts +11 -0
- package/packages/ui/components/dropdown-button/src/dropdown-button-menu-items.vue +79 -0
- package/packages/ui/components/dropdown-button/src/dropdown-button.vue +152 -0
- package/packages/ui/components/dropdown-button/src/types.ts +98 -0
- package/packages/ui/components/dropdown-button/styles/dropdown-button.css +171 -0
- package/packages/ui/components/empty/README.md +48 -0
- package/packages/ui/components/empty/__tests__/empty.test.ts +37 -0
- package/packages/ui/components/empty/index.ts +13 -0
- package/packages/ui/components/empty/src/empty.vue +73 -0
- package/packages/ui/components/empty/src/types.ts +32 -0
- package/packages/ui/components/empty/styles/empty.css +69 -0
- package/packages/ui/components/error/README.md +44 -0
- package/packages/ui/components/error/__tests__/error.test.ts +34 -0
- package/packages/ui/components/error/index.ts +13 -0
- package/packages/ui/components/error/src/error.vue +65 -0
- package/packages/ui/components/error/src/types.ts +28 -0
- package/packages/ui/components/error/styles/error.css +69 -0
- package/packages/ui/components/filter-button/README.md +68 -0
- package/packages/ui/components/filter-button/__tests__/filter-button.test.ts +30 -0
- package/packages/ui/components/filter-button/index.ts +11 -0
- package/packages/ui/components/filter-button/src/filter-button.vue +59 -0
- package/packages/ui/components/filter-button/src/types.ts +9 -0
- package/packages/ui/components/form/README.md +750 -0
- package/packages/ui/components/form/__tests__/form-ai-registry-integration.test.ts +214 -0
- package/packages/ui/components/form/__tests__/form-field.test.ts +377 -0
- package/packages/ui/components/form/__tests__/form-item-ai-actions.test.ts +299 -0
- package/packages/ui/components/form/__tests__/form-item.test.ts +110 -0
- package/packages/ui/components/form/__tests__/form-wrapper-reject-forward.test.ts +269 -0
- package/packages/ui/components/form/__tests__/form.test.ts +148 -0
- package/packages/ui/components/form/base/cascader/README.md +75 -0
- package/packages/ui/components/form/base/cascader/__tests__/ai-capability.test.ts +507 -0
- package/packages/ui/components/form/base/cascader/__tests__/cascader.test.ts +203 -0
- package/packages/ui/components/form/base/cascader/index.ts +14 -0
- package/packages/ui/components/form/base/cascader/src/cascader.vue +505 -0
- package/packages/ui/components/form/base/cascader/src/types.ts +168 -0
- package/packages/ui/components/form/base/cascader/styles/cascader.css +186 -0
- package/packages/ui/components/form/base/checkbox/README.md +110 -0
- package/packages/ui/components/form/base/checkbox/__tests__/ai-capability.test.ts +465 -0
- package/packages/ui/components/form/base/checkbox/__tests__/checkbox.test.ts +98 -0
- package/packages/ui/components/form/base/checkbox/__tests__/group-integration.test.ts +192 -0
- package/packages/ui/components/form/base/checkbox/index.ts +18 -0
- package/packages/ui/components/form/base/checkbox/src/checkbox-group.vue +311 -0
- package/packages/ui/components/form/base/checkbox/src/checkbox.ts +210 -0
- package/packages/ui/components/form/base/checkbox/src/checkbox.vue +368 -0
- package/packages/ui/components/form/base/checkbox/styles/checkbox.css +24 -0
- package/packages/ui/components/form/base/data-picker/README.md +192 -0
- package/packages/ui/components/form/base/data-picker/__tests__/ai-capability.test.ts +566 -0
- package/packages/ui/components/form/base/data-picker/__tests__/data-picker.test.ts +628 -0
- package/packages/ui/components/form/base/data-picker/index.ts +23 -0
- package/packages/ui/components/form/base/data-picker/src/data-picker.ts +192 -0
- package/packages/ui/components/form/base/data-picker/src/data-picker.vue +1267 -0
- package/packages/ui/components/form/base/data-picker/styles/data-picker.css +174 -0
- package/packages/ui/components/form/base/date-picker/README.md +94 -0
- package/packages/ui/components/form/base/date-picker/__tests__/ai-capability.test.ts +462 -0
- package/packages/ui/components/form/base/date-picker/__tests__/date-picker.test.ts +115 -0
- package/packages/ui/components/form/base/date-picker/index.ts +13 -0
- package/packages/ui/components/form/base/date-picker/src/date-picker.ts +212 -0
- package/packages/ui/components/form/base/date-picker/src/date-picker.vue +871 -0
- package/packages/ui/components/form/base/date-picker/styles/date-picker.css +210 -0
- package/packages/ui/components/form/base/datetime-picker/README.md +197 -0
- package/packages/ui/components/form/base/datetime-picker/__tests__/ai-capability.test.ts +368 -0
- package/packages/ui/components/form/base/datetime-picker/__tests__/datetime-picker.test.ts +445 -0
- package/packages/ui/components/form/base/datetime-picker/index.ts +13 -0
- package/packages/ui/components/form/base/datetime-picker/src/datetime-picker.ts +149 -0
- package/packages/ui/components/form/base/datetime-picker/src/datetime-picker.vue +1158 -0
- package/packages/ui/components/form/base/datetime-picker/styles/datetime-picker.css +570 -0
- package/packages/ui/components/form/base/file-upload/README.md +73 -0
- package/packages/ui/components/form/base/file-upload/__tests__/ai-capability.test.ts +223 -0
- package/packages/ui/components/form/base/file-upload/__tests__/file-upload.spec.ts +199 -0
- package/packages/ui/components/form/base/file-upload/index.ts +11 -0
- package/packages/ui/components/form/base/file-upload/src/file-upload.ts +95 -0
- package/packages/ui/components/form/base/file-upload/src/file-upload.vue +451 -0
- package/packages/ui/components/form/base/file-upload/styles/file-upload.css +57 -0
- package/packages/ui/components/form/base/image-upload/README.md +70 -0
- package/packages/ui/components/form/base/image-upload/__tests__/ai-capability.test.ts +149 -0
- package/packages/ui/components/form/base/image-upload/__tests__/image-upload.spec.ts +282 -0
- package/packages/ui/components/form/base/image-upload/index.ts +11 -0
- package/packages/ui/components/form/base/image-upload/src/image-upload.ts +76 -0
- package/packages/ui/components/form/base/image-upload/src/image-upload.vue +657 -0
- package/packages/ui/components/form/base/index.ts +24 -0
- package/packages/ui/components/form/base/input/README.md +63 -0
- package/packages/ui/components/form/base/input/__tests__/ai-capability.test.ts +143 -0
- package/packages/ui/components/form/base/input/__tests__/input.test.ts +195 -0
- package/packages/ui/components/form/base/input/index.ts +37 -0
- package/packages/ui/components/form/base/input/src/input.ts +104 -0
- package/packages/ui/components/form/base/input/src/input.vue +384 -0
- package/packages/ui/components/form/base/input/styles/input.css +198 -0
- package/packages/ui/components/form/base/location-picker/README.md +92 -0
- package/packages/ui/components/form/base/location-picker/__tests__/ai-capability.test.ts +147 -0
- package/packages/ui/components/form/base/location-picker/__tests__/location-picker.test.ts +161 -0
- package/packages/ui/components/form/base/location-picker/index.ts +13 -0
- package/packages/ui/components/form/base/location-picker/src/location-picker.ts +99 -0
- package/packages/ui/components/form/base/location-picker/src/location-picker.vue +558 -0
- package/packages/ui/components/form/base/radio/README.md +95 -0
- package/packages/ui/components/form/base/radio/__tests__/ai-capability.test.ts +578 -0
- package/packages/ui/components/form/base/radio/__tests__/group-integration.test.ts +191 -0
- package/packages/ui/components/form/base/radio/__tests__/radio.test.ts +64 -0
- package/packages/ui/components/form/base/radio/index.ts +18 -0
- package/packages/ui/components/form/base/radio/src/radio-group.vue +270 -0
- package/packages/ui/components/form/base/radio/src/radio.ts +154 -0
- package/packages/ui/components/form/base/radio/src/radio.vue +141 -0
- package/packages/ui/components/form/base/radio/styles/radio.css +12 -0
- package/packages/ui/components/form/base/region-picker/README.md +166 -0
- package/packages/ui/components/form/base/region-picker/__tests__/ai-capability.test.ts +147 -0
- package/packages/ui/components/form/base/region-picker/__tests__/region-picker.spec.ts +556 -0
- package/packages/ui/components/form/base/region-picker/index.ts +19 -0
- package/packages/ui/components/form/base/region-picker/src/region-picker.ts +333 -0
- package/packages/ui/components/form/base/region-picker/src/region-picker.vue +552 -0
- package/packages/ui/components/form/base/select/README.md +66 -0
- package/packages/ui/components/form/base/select/__tests__/ai-capability.test.ts +463 -0
- package/packages/ui/components/form/base/select/__tests__/select.test.ts +167 -0
- package/packages/ui/components/form/base/select/index.ts +15 -0
- package/packages/ui/components/form/base/select/src/select.ts +173 -0
- package/packages/ui/components/form/base/select/src/select.vue +534 -0
- package/packages/ui/components/form/base/select/styles/select.css +206 -0
- package/packages/ui/components/form/base/signature/README.md +96 -0
- package/packages/ui/components/form/base/signature/__tests__/ai-capability.test.ts +147 -0
- package/packages/ui/components/form/base/signature/__tests__/signature.spec.ts +156 -0
- package/packages/ui/components/form/base/signature/index.ts +14 -0
- package/packages/ui/components/form/base/signature/src/signature.ts +100 -0
- package/packages/ui/components/form/base/signature/src/signature.vue +871 -0
- package/packages/ui/components/form/base/switch/README.md +102 -0
- package/packages/ui/components/form/base/switch/__tests__/ai-capability.test.ts +545 -0
- package/packages/ui/components/form/base/switch/__tests__/switch.test.ts +105 -0
- package/packages/ui/components/form/base/switch/index.ts +12 -0
- package/packages/ui/components/form/base/switch/src/switch.ts +133 -0
- package/packages/ui/components/form/base/switch/src/switch.vue +385 -0
- package/packages/ui/components/form/base/switch/styles/switch.css +35 -0
- package/packages/ui/components/form/base/text-area/README.md +89 -0
- package/packages/ui/components/form/base/text-area/__tests__/ai-capability.test.ts +176 -0
- package/packages/ui/components/form/base/text-area/__tests__/text-area.test.ts +152 -0
- package/packages/ui/components/form/base/text-area/index.ts +37 -0
- package/packages/ui/components/form/base/text-area/src/text-area.ts +137 -0
- package/packages/ui/components/form/base/text-area/src/text-area.vue +405 -0
- package/packages/ui/components/form/base/text-area/styles/text-area.css +137 -0
- package/packages/ui/components/form/base/time-picker/README.md +75 -0
- package/packages/ui/components/form/base/time-picker/__tests__/ai-capability.test.ts +135 -0
- package/packages/ui/components/form/base/time-picker/__tests__/time-picker.test.ts +258 -0
- package/packages/ui/components/form/base/time-picker/index.ts +13 -0
- package/packages/ui/components/form/base/time-picker/src/time-picker.ts +141 -0
- package/packages/ui/components/form/base/time-picker/src/time-picker.vue +844 -0
- package/packages/ui/components/form/base/time-picker/styles/time-picker.css +124 -0
- package/packages/ui/components/form/base/upload/README.md +126 -0
- package/packages/ui/components/form/base/upload/__tests__/ai-capability.test.ts +145 -0
- package/packages/ui/components/form/base/upload/__tests__/upload.spec.ts +288 -0
- package/packages/ui/components/form/base/upload/index.ts +11 -0
- package/packages/ui/components/form/base/upload/src/upload.ts +171 -0
- package/packages/ui/components/form/base/upload/src/upload.vue +890 -0
- package/packages/ui/components/form/base/upload/styles/upload.css +116 -0
- package/packages/ui/components/form/index.ts +138 -0
- package/packages/ui/components/form/items/form-array/README.md +61 -0
- package/packages/ui/components/form/items/form-array/__tests__/form-array.test.ts +122 -0
- package/packages/ui/components/form/items/form-array/index.ts +2 -0
- package/packages/ui/components/form/items/form-array/src/form-array.vue +80 -0
- package/packages/ui/components/form/items/form-array/src/types.ts +27 -0
- package/packages/ui/components/form/items/form-array/styles/form-array.css +99 -0
- package/packages/ui/components/form/items/form-cascader/README.md +132 -0
- package/packages/ui/components/form/items/form-cascader/__tests__/form-cascader.test.ts +99 -0
- package/packages/ui/components/form/items/form-cascader/index.ts +1 -0
- package/packages/ui/components/form/items/form-cascader/src/form-cascader.ts +7 -0
- package/packages/ui/components/form/items/form-cascader/src/form-cascader.vue +15 -0
- package/packages/ui/components/form/items/form-checkbox/README.md +121 -0
- package/packages/ui/components/form/items/form-checkbox/__tests__/form-checkbox.test.ts +93 -0
- package/packages/ui/components/form/items/form-checkbox/index.ts +1 -0
- package/packages/ui/components/form/items/form-checkbox/src/form-checkbox.ts +7 -0
- package/packages/ui/components/form/items/form-checkbox/src/form-checkbox.vue +15 -0
- package/packages/ui/components/form/items/form-data-picker/README.md +111 -0
- package/packages/ui/components/form/items/form-data-picker/__tests__/form-data-picker.test.ts +98 -0
- package/packages/ui/components/form/items/form-data-picker/index.ts +1 -0
- package/packages/ui/components/form/items/form-data-picker/src/form-data-picker.ts +7 -0
- package/packages/ui/components/form/items/form-data-picker/src/form-data-picker.vue +17 -0
- package/packages/ui/components/form/items/form-date-picker/README.md +119 -0
- package/packages/ui/components/form/items/form-date-picker/__tests__/form-date-picker.test.ts +104 -0
- package/packages/ui/components/form/items/form-date-picker/index.ts +1 -0
- package/packages/ui/components/form/items/form-date-picker/src/form-date-picker.ts +7 -0
- package/packages/ui/components/form/items/form-date-picker/src/form-date-picker.vue +17 -0
- package/packages/ui/components/form/items/form-datetime-picker/README.md +112 -0
- package/packages/ui/components/form/items/form-datetime-picker/__tests__/form-datetime-picker.test.ts +105 -0
- package/packages/ui/components/form/items/form-datetime-picker/index.ts +1 -0
- package/packages/ui/components/form/items/form-datetime-picker/src/form-datetime-picker.ts +7 -0
- package/packages/ui/components/form/items/form-datetime-picker/src/form-datetime-picker.vue +17 -0
- package/packages/ui/components/form/items/form-dynamic/README.md +105 -0
- package/packages/ui/components/form/items/form-dynamic/__tests__/form-dynamic.test.ts +172 -0
- package/packages/ui/components/form/items/form-dynamic/index.ts +2 -0
- package/packages/ui/components/form/items/form-dynamic/src/form-dynamic.vue +222 -0
- package/packages/ui/components/form/items/form-dynamic/src/types.ts +63 -0
- package/packages/ui/components/form/items/form-file-upload/README.md +92 -0
- package/packages/ui/components/form/items/form-file-upload/__tests__/form-file-upload.test.ts +99 -0
- package/packages/ui/components/form/items/form-file-upload/index.ts +1 -0
- package/packages/ui/components/form/items/form-file-upload/src/form-file-upload.ts +7 -0
- package/packages/ui/components/form/items/form-file-upload/src/form-file-upload.vue +15 -0
- package/packages/ui/components/form/items/form-group/README.md +57 -0
- package/packages/ui/components/form/items/form-group/__tests__/form-group.test.ts +108 -0
- package/packages/ui/components/form/items/form-group/index.ts +2 -0
- package/packages/ui/components/form/items/form-group/src/form-group.vue +85 -0
- package/packages/ui/components/form/items/form-group/src/types.ts +37 -0
- package/packages/ui/components/form/items/form-group/styles/form-group.css +92 -0
- package/packages/ui/components/form/items/form-image-upload/README.md +92 -0
- package/packages/ui/components/form/items/form-image-upload/__tests__/form-image-upload.test.ts +109 -0
- package/packages/ui/components/form/items/form-image-upload/index.ts +1 -0
- package/packages/ui/components/form/items/form-image-upload/src/form-image-upload.ts +7 -0
- package/packages/ui/components/form/items/form-image-upload/src/form-image-upload.vue +37 -0
- package/packages/ui/components/form/items/form-input/README.md +110 -0
- package/packages/ui/components/form/items/form-input/__tests__/form-input.test.ts +87 -0
- package/packages/ui/components/form/items/form-input/index.ts +1 -0
- package/packages/ui/components/form/items/form-input/src/form-input.ts +7 -0
- package/packages/ui/components/form/items/form-input/src/form-input.vue +15 -0
- package/packages/ui/components/form/items/form-location-picker/README.md +119 -0
- package/packages/ui/components/form/items/form-location-picker/__tests__/form-location-picker.test.ts +98 -0
- package/packages/ui/components/form/items/form-location-picker/index.ts +1 -0
- package/packages/ui/components/form/items/form-location-picker/src/form-location-picker.ts +7 -0
- package/packages/ui/components/form/items/form-location-picker/src/form-location-picker.vue +15 -0
- package/packages/ui/components/form/items/form-radio/README.md +125 -0
- package/packages/ui/components/form/items/form-radio/__tests__/form-radio.test.ts +104 -0
- package/packages/ui/components/form/items/form-radio/index.ts +1 -0
- package/packages/ui/components/form/items/form-radio/src/form-radio.ts +7 -0
- package/packages/ui/components/form/items/form-radio/src/form-radio.vue +15 -0
- package/packages/ui/components/form/items/form-region-picker/README.md +111 -0
- package/packages/ui/components/form/items/form-region-picker/__tests__/form-region-picker.test.ts +95 -0
- package/packages/ui/components/form/items/form-region-picker/index.ts +1 -0
- package/packages/ui/components/form/items/form-region-picker/src/form-region-picker.ts +7 -0
- package/packages/ui/components/form/items/form-region-picker/src/form-region-picker.vue +15 -0
- package/packages/ui/components/form/items/form-select/README.md +117 -0
- package/packages/ui/components/form/items/form-select/__tests__/form-select.test.ts +80 -0
- package/packages/ui/components/form/items/form-select/index.ts +1 -0
- package/packages/ui/components/form/items/form-select/src/form-select.ts +7 -0
- package/packages/ui/components/form/items/form-select/src/form-select.vue +15 -0
- package/packages/ui/components/form/items/form-signature/README.md +89 -0
- package/packages/ui/components/form/items/form-signature/__tests__/form-signature.test.ts +109 -0
- package/packages/ui/components/form/items/form-signature/index.ts +1 -0
- package/packages/ui/components/form/items/form-signature/src/form-signature.ts +7 -0
- package/packages/ui/components/form/items/form-signature/src/form-signature.vue +15 -0
- package/packages/ui/components/form/items/form-slider/README.md +125 -0
- package/packages/ui/components/form/items/form-slider/__tests__/form-slider.test.ts +95 -0
- package/packages/ui/components/form/items/form-slider/index.ts +1 -0
- package/packages/ui/components/form/items/form-slider/src/form-slider.ts +7 -0
- package/packages/ui/components/form/items/form-slider/src/form-slider.vue +15 -0
- package/packages/ui/components/form/items/form-subform/README.md +71 -0
- package/packages/ui/components/form/items/form-subform/__tests__/form-subform.test.ts +116 -0
- package/packages/ui/components/form/items/form-subform/index.ts +2 -0
- package/packages/ui/components/form/items/form-subform/src/form-subform.vue +92 -0
- package/packages/ui/components/form/items/form-subform/src/types.ts +32 -0
- package/packages/ui/components/form/items/form-subform/styles/form-subform.css +127 -0
- package/packages/ui/components/form/items/form-switch/README.md +118 -0
- package/packages/ui/components/form/items/form-switch/__tests__/form-switch.test.ts +88 -0
- package/packages/ui/components/form/items/form-switch/index.ts +1 -0
- package/packages/ui/components/form/items/form-switch/src/form-switch.ts +7 -0
- package/packages/ui/components/form/items/form-switch/src/form-switch.vue +15 -0
- package/packages/ui/components/form/items/form-table/OPTIMIZATION_REPORT.md +205 -0
- package/packages/ui/components/form/items/form-table/README.md +144 -0
- package/packages/ui/components/form/items/form-table/__tests__/form-table.test.ts +373 -0
- package/packages/ui/components/form/items/form-table/index.ts +3 -0
- package/packages/ui/components/form/items/form-table/src/column-filter-popover.vue +149 -0
- package/packages/ui/components/form/items/form-table/src/form-table.vue +1315 -0
- package/packages/ui/components/form/items/form-table/src/types.ts +165 -0
- package/packages/ui/components/form/items/form-table/styles/column-filter-popover.css +138 -0
- package/packages/ui/components/form/items/form-table/styles/form-table.css +393 -0
- package/packages/ui/components/form/items/form-textarea/README.md +123 -0
- package/packages/ui/components/form/items/form-textarea/__tests__/form-textarea.test.ts +93 -0
- package/packages/ui/components/form/items/form-textarea/index.ts +1 -0
- package/packages/ui/components/form/items/form-textarea/src/form-textarea.ts +7 -0
- package/packages/ui/components/form/items/form-textarea/src/form-textarea.vue +15 -0
- package/packages/ui/components/form/items/form-time-picker/README.md +117 -0
- package/packages/ui/components/form/items/form-time-picker/__tests__/form-time-picker.test.ts +105 -0
- package/packages/ui/components/form/items/form-time-picker/index.ts +1 -0
- package/packages/ui/components/form/items/form-time-picker/src/form-time-picker.ts +7 -0
- package/packages/ui/components/form/items/form-time-picker/src/form-time-picker.vue +17 -0
- package/packages/ui/components/form/items/form-upload/README.md +92 -0
- package/packages/ui/components/form/items/form-upload/__tests__/form-upload.test.ts +137 -0
- package/packages/ui/components/form/items/form-upload/index.ts +1 -0
- package/packages/ui/components/form/items/form-upload/src/form-upload.ts +7 -0
- package/packages/ui/components/form/items/form-upload/src/form-upload.vue +15 -0
- package/packages/ui/components/form/shared/types.ts +82 -0
- package/packages/ui/components/form/src/form-field.ts +96 -0
- package/packages/ui/components/form/src/form-field.vue +404 -0
- package/packages/ui/components/form/src/form-item.vue +646 -0
- package/packages/ui/components/form/src/form.ts +11 -0
- package/packages/ui/components/form/src/form.vue +156 -0
- package/packages/ui/components/form/src/types.ts +337 -0
- package/packages/ui/components/form/src/use-form-field.ts +190 -0
- package/packages/ui/components/form/styles/form-ai-actions.css +41 -0
- package/packages/ui/components/form/styles/form-field.css +123 -0
- package/packages/ui/components/form/styles/form-item-ai-status.css +212 -0
- package/packages/ui/components/form/styles/form-item.css +218 -0
- package/packages/ui/components/form/styles/form.css +132 -0
- package/packages/ui/components/form-ai-status/README.md +86 -0
- package/packages/ui/components/form-ai-status/__tests__/form-ai-status.test.ts +183 -0
- package/packages/ui/components/form-ai-status/index.ts +12 -0
- package/packages/ui/components/form-ai-status/src/form-ai-status.vue +254 -0
- package/packages/ui/components/form-ai-status/src/types.ts +36 -0
- package/packages/ui/components/form-ai-status/styles/form-ai-status.css +238 -0
- package/packages/ui/components/form-ai-toolbar/README.md +100 -0
- package/packages/ui/components/form-ai-toolbar/__tests__/form-ai-toolbar.test.ts +344 -0
- package/packages/ui/components/form-ai-toolbar/index.ts +13 -0
- package/packages/ui/components/form-ai-toolbar/src/form-ai-toolbar.vue +598 -0
- package/packages/ui/components/form-ai-toolbar/src/types.ts +130 -0
- package/packages/ui/components/form-ai-toolbar/styles/form-ai-toolbar.css +281 -0
- package/packages/ui/components/icon/README.md +137 -0
- package/packages/ui/components/icon/__tests__/icon.test.ts +125 -0
- package/packages/ui/components/icon/index.ts +13 -0
- package/packages/ui/components/icon/src/icon.ts +67 -0
- package/packages/ui/components/icon/src/icon.vue +69 -0
- package/packages/ui/components/icon/styles/icon.css +41 -0
- package/packages/ui/components/image-preview/README.md +90 -0
- package/packages/ui/components/image-preview/__tests__/image-preview.test.ts +183 -0
- package/packages/ui/components/image-preview/index.ts +13 -0
- package/packages/ui/components/image-preview/src/image-preview.vue +71 -0
- package/packages/ui/components/image-preview/src/index.ts +11 -0
- package/packages/ui/components/image-preview/src/preview-layer.vue +90 -0
- package/packages/ui/components/image-preview/src/types.ts +63 -0
- package/packages/ui/components/image-preview/styles/image-preview.css +39 -0
- package/packages/ui/components/layout/app-bar/README.md +59 -0
- package/packages/ui/components/layout/app-bar/__tests__/app-bar.test.ts +124 -0
- package/packages/ui/components/layout/app-bar/index.ts +13 -0
- package/packages/ui/components/layout/app-bar/src/app-bar.vue +106 -0
- package/packages/ui/components/layout/app-bar/src/types.ts +43 -0
- package/packages/ui/components/layout/app-bar/styles/app-bar.css +175 -0
- package/packages/ui/components/layout/card/README.md +90 -0
- package/packages/ui/components/layout/card/__tests__/card.test.ts +321 -0
- package/packages/ui/components/layout/card/index.ts +13 -0
- package/packages/ui/components/layout/card/src/card.vue +210 -0
- package/packages/ui/components/layout/card/src/types.ts +79 -0
- package/packages/ui/components/layout/card/styles/card.css +334 -0
- package/packages/ui/components/layout/container/README.md +29 -0
- package/packages/ui/components/layout/container/__tests__/container.test.ts +74 -0
- package/packages/ui/components/layout/container/index.ts +13 -0
- package/packages/ui/components/layout/container/src/container.vue +35 -0
- package/packages/ui/components/layout/container/src/types.ts +15 -0
- package/packages/ui/components/layout/container/styles/container.css +50 -0
- package/packages/ui/components/layout/detail-layout/README.md +30 -0
- package/packages/ui/components/layout/detail-layout/__tests__/detail-layout.test.ts +75 -0
- package/packages/ui/components/layout/detail-layout/index.ts +13 -0
- package/packages/ui/components/layout/detail-layout/src/detail-layout.vue +53 -0
- package/packages/ui/components/layout/detail-layout/src/types.ts +22 -0
- package/packages/ui/components/layout/detail-layout/styles/detail-layout.css +71 -0
- package/packages/ui/components/layout/form-layout/README.md +59 -0
- package/packages/ui/components/layout/form-layout/__tests__/form-layout.test.ts +140 -0
- package/packages/ui/components/layout/form-layout/index.ts +13 -0
- package/packages/ui/components/layout/form-layout/src/form-layout.vue +93 -0
- package/packages/ui/components/layout/form-layout/src/types.ts +64 -0
- package/packages/ui/components/layout/form-layout/styles/form-layout.css +98 -0
- package/packages/ui/components/layout/grid/README.md +41 -0
- package/packages/ui/components/layout/grid/__tests__/grid.test.ts +77 -0
- package/packages/ui/components/layout/grid/index.ts +13 -0
- package/packages/ui/components/layout/grid/src/grid.vue +79 -0
- package/packages/ui/components/layout/grid/src/types.ts +44 -0
- package/packages/ui/components/layout/grid/styles/grid.css +46 -0
- package/packages/ui/components/layout/hero/README.md +59 -0
- package/packages/ui/components/layout/hero/__tests__/hero.test.ts +112 -0
- package/packages/ui/components/layout/hero/index.ts +13 -0
- package/packages/ui/components/layout/hero/src/hero.vue +143 -0
- package/packages/ui/components/layout/hero/src/types.ts +44 -0
- package/packages/ui/components/layout/hero/styles/hero.css +129 -0
- package/packages/ui/components/layout/inline/README.md +30 -0
- package/packages/ui/components/layout/inline/__tests__/inline.test.ts +154 -0
- package/packages/ui/components/layout/inline/index.ts +13 -0
- package/packages/ui/components/layout/inline/src/inline.vue +99 -0
- package/packages/ui/components/layout/inline/src/types.ts +23 -0
- package/packages/ui/components/layout/inline/styles/inline.css +150 -0
- package/packages/ui/components/layout/master-detail/README.md +36 -0
- package/packages/ui/components/layout/master-detail/__tests__/master-detail.test.ts +104 -0
- package/packages/ui/components/layout/master-detail/index.ts +13 -0
- package/packages/ui/components/layout/master-detail/src/master-detail.vue +72 -0
- package/packages/ui/components/layout/master-detail/src/types.ts +28 -0
- package/packages/ui/components/layout/master-detail/styles/master-detail.css +82 -0
- package/packages/ui/components/layout/page/README.md +35 -0
- package/packages/ui/components/layout/page/__tests__/page.test.ts +136 -0
- package/packages/ui/components/layout/page/index.ts +13 -0
- package/packages/ui/components/layout/page/src/page.vue +85 -0
- package/packages/ui/components/layout/page/src/types.ts +39 -0
- package/packages/ui/components/layout/page/styles/page.css +177 -0
- package/packages/ui/components/layout/page-header/README.md +39 -0
- package/packages/ui/components/layout/page-header/__tests__/page-header.test.ts +198 -0
- package/packages/ui/components/layout/page-header/index.ts +13 -0
- package/packages/ui/components/layout/page-header/src/page-header.vue +133 -0
- package/packages/ui/components/layout/page-header/src/types.ts +56 -0
- package/packages/ui/components/layout/page-header/styles/page-header.css +155 -0
- package/packages/ui/components/layout/section/README.md +40 -0
- package/packages/ui/components/layout/section/__tests__/section.test.ts +121 -0
- package/packages/ui/components/layout/section/index.ts +13 -0
- package/packages/ui/components/layout/section/src/section.vue +79 -0
- package/packages/ui/components/layout/section/src/types.ts +28 -0
- package/packages/ui/components/layout/section/styles/section.css +103 -0
- package/packages/ui/components/layout/sidebar-layout/README.md +60 -0
- package/packages/ui/components/layout/sidebar-layout/__tests__/sidebar-layout.test.ts +220 -0
- package/packages/ui/components/layout/sidebar-layout/index.ts +13 -0
- package/packages/ui/components/layout/sidebar-layout/src/sidebar-layout.vue +113 -0
- package/packages/ui/components/layout/sidebar-layout/src/types.ts +54 -0
- package/packages/ui/components/layout/sidebar-layout/styles/sidebar-layout.css +211 -0
- package/packages/ui/components/layout/split/README.md +40 -0
- package/packages/ui/components/layout/split/__tests__/split.test.ts +99 -0
- package/packages/ui/components/layout/split/index.ts +13 -0
- package/packages/ui/components/layout/split/src/split.vue +65 -0
- package/packages/ui/components/layout/split/src/types.ts +49 -0
- package/packages/ui/components/layout/split/styles/split.css +40 -0
- package/packages/ui/components/layout/stack/README.md +29 -0
- package/packages/ui/components/layout/stack/__tests__/stack.test.ts +66 -0
- package/packages/ui/components/layout/stack/index.ts +13 -0
- package/packages/ui/components/layout/stack/src/stack.vue +31 -0
- package/packages/ui/components/layout/stack/src/types.ts +14 -0
- package/packages/ui/components/layout/stack/styles/stack.css +61 -0
- package/packages/ui/components/layout/state-container/README.md +45 -0
- package/packages/ui/components/layout/state-container/__tests__/state-container.test.ts +123 -0
- package/packages/ui/components/layout/state-container/index.ts +13 -0
- package/packages/ui/components/layout/state-container/src/state-container.vue +72 -0
- package/packages/ui/components/layout/state-container/src/types.ts +46 -0
- package/packages/ui/components/layout/state-container/styles/state-container.css +71 -0
- package/packages/ui/components/layout/toolbar/README.md +34 -0
- package/packages/ui/components/layout/toolbar/__tests__/toolbar.test.ts +90 -0
- package/packages/ui/components/layout/toolbar/index.ts +13 -0
- package/packages/ui/components/layout/toolbar/src/toolbar.vue +50 -0
- package/packages/ui/components/layout/toolbar/src/types.ts +19 -0
- package/packages/ui/components/layout/toolbar/styles/toolbar.css +80 -0
- package/packages/ui/components/loading/README.md +39 -0
- package/packages/ui/components/loading/__tests__/loading.test.ts +37 -0
- package/packages/ui/components/loading/index.ts +13 -0
- package/packages/ui/components/loading/src/loading.vue +59 -0
- package/packages/ui/components/loading/src/types.ts +27 -0
- package/packages/ui/components/loading/styles/loading.css +59 -0
- package/packages/ui/components/menu/README.md +51 -0
- package/packages/ui/components/menu/__tests__/menu.test.ts +80 -0
- package/packages/ui/components/menu/index.ts +11 -0
- package/packages/ui/components/menu/src/menu.ts +49 -0
- package/packages/ui/components/menu/src/menu.vue +103 -0
- package/packages/ui/components/menu/styles/menu.css +19 -0
- package/packages/ui/components/message/README.md +69 -0
- package/packages/ui/components/message/__tests__/message.test.ts +98 -0
- package/packages/ui/components/message/index.ts +13 -0
- package/packages/ui/components/message/src/message.ts +87 -0
- package/packages/ui/components/message/src/message.vue +88 -0
- package/packages/ui/components/message/styles/message.css +70 -0
- package/packages/ui/components/metric/README.md +63 -0
- package/packages/ui/components/metric/__tests__/metric.test.ts +166 -0
- package/packages/ui/components/metric/index.ts +13 -0
- package/packages/ui/components/metric/src/metric.vue +107 -0
- package/packages/ui/components/metric/src/types.ts +50 -0
- package/packages/ui/components/metric/styles/metric.css +233 -0
- package/packages/ui/components/modal/README.md +91 -0
- package/packages/ui/components/modal/__tests__/modal.test.ts +145 -0
- package/packages/ui/components/modal/index.ts +13 -0
- package/packages/ui/components/modal/src/modal.ts +153 -0
- package/packages/ui/components/modal/src/modal.vue +234 -0
- package/packages/ui/components/modal/styles/modal.css +104 -0
- package/packages/ui/components/more-action-button/README.md +68 -0
- package/packages/ui/components/more-action-button/__tests__/more-action-button.test.ts +30 -0
- package/packages/ui/components/more-action-button/index.ts +11 -0
- package/packages/ui/components/more-action-button/src/more-action-button.vue +59 -0
- package/packages/ui/components/more-action-button/src/types.ts +9 -0
- package/packages/ui/components/navigation/side-nav/README.md +59 -0
- package/packages/ui/components/navigation/side-nav/__tests__/side-nav.test.ts +105 -0
- package/packages/ui/components/navigation/side-nav/index.ts +13 -0
- package/packages/ui/components/navigation/side-nav/src/side-nav.vue +147 -0
- package/packages/ui/components/navigation/side-nav/src/types.ts +50 -0
- package/packages/ui/components/navigation/side-nav/styles/side-nav.css +171 -0
- package/packages/ui/components/notification/README.md +82 -0
- package/packages/ui/components/notification/__tests__/notification.test.ts +150 -0
- package/packages/ui/components/notification/index.ts +30 -0
- package/packages/ui/components/notification/src/notification.vue +114 -0
- package/packages/ui/components/notification/src/types.ts +67 -0
- package/packages/ui/components/notification/src/use-notification.ts +136 -0
- package/packages/ui/components/notification/styles/notification.css +4 -0
- package/packages/ui/components/pagination/README.md +82 -0
- package/packages/ui/components/pagination/__tests__/pagination.test.ts +210 -0
- package/packages/ui/components/pagination/index.ts +13 -0
- package/packages/ui/components/pagination/src/pagination.ts +86 -0
- package/packages/ui/components/pagination/src/pagination.vue +270 -0
- package/packages/ui/components/pagination/styles/pagination.css +143 -0
- package/packages/ui/components/progress/README.md +132 -0
- package/packages/ui/components/progress/__tests__/progress.test.ts +81 -0
- package/packages/ui/components/progress/index.ts +12 -0
- package/packages/ui/components/progress/src/progress.ts +80 -0
- package/packages/ui/components/progress/src/progress.vue +202 -0
- package/packages/ui/components/skeleton/README.md +71 -0
- package/packages/ui/components/skeleton/__tests__/skeleton.test.ts +138 -0
- package/packages/ui/components/skeleton/index.ts +13 -0
- package/packages/ui/components/skeleton/src/skeleton.ts +46 -0
- package/packages/ui/components/skeleton/src/skeleton.vue +67 -0
- package/packages/ui/components/skeleton/styles/skeleton.css +75 -0
- package/packages/ui/components/slider/README.md +87 -0
- package/packages/ui/components/slider/__tests__/ai-capability.test.ts +469 -0
- package/packages/ui/components/slider/__tests__/slider.test.ts +235 -0
- package/packages/ui/components/slider/index.ts +26 -0
- package/packages/ui/components/slider/src/slider.ts +192 -0
- package/packages/ui/components/slider/src/slider.vue +504 -0
- package/packages/ui/components/slider/src/use-slider.ts +399 -0
- package/packages/ui/components/slider/styles/slider.css +344 -0
- package/packages/ui/components/split-button/README.md +71 -0
- package/packages/ui/components/split-button/__tests__/split-button.test.ts +32 -0
- package/packages/ui/components/split-button/index.ts +11 -0
- package/packages/ui/components/split-button/src/split-button.vue +69 -0
- package/packages/ui/components/split-button/src/types.ts +34 -0
- package/packages/ui/components/split-button/styles/split-button.css +15 -0
- package/packages/ui/components/status-dot/README.md +42 -0
- package/packages/ui/components/status-dot/__tests__/status-dot.test.ts +53 -0
- package/packages/ui/components/status-dot/index.ts +13 -0
- package/packages/ui/components/status-dot/src/status-dot.vue +39 -0
- package/packages/ui/components/status-dot/src/types.ts +23 -0
- package/packages/ui/components/status-dot/styles/status-dot.css +65 -0
- package/packages/ui/components/steps/README.md +101 -0
- package/packages/ui/components/steps/__tests__/steps.test.ts +261 -0
- package/packages/ui/components/steps/index.ts +15 -0
- package/packages/ui/components/steps/src/step.vue +99 -0
- package/packages/ui/components/steps/src/steps.ts +93 -0
- package/packages/ui/components/steps/src/steps.vue +143 -0
- package/packages/ui/components/steps/styles/step.css +116 -0
- package/packages/ui/components/steps/styles/steps.css +200 -0
- package/packages/ui/components/table/README.md +81 -0
- package/packages/ui/components/table/__tests__/table.test.ts +162 -0
- package/packages/ui/components/table/index.ts +13 -0
- package/packages/ui/components/table/src/table.ts +195 -0
- package/packages/ui/components/table/src/table.vue +453 -0
- package/packages/ui/components/table/styles/table.css +88 -0
- package/packages/ui/components/tabs/README.md +88 -0
- package/packages/ui/components/tabs/__tests__/tabs.test.ts +161 -0
- package/packages/ui/components/tabs/index.ts +19 -0
- package/packages/ui/components/tabs/src/tab-pane.ts +18 -0
- package/packages/ui/components/tabs/src/tab-pane.vue +11 -0
- package/packages/ui/components/tabs/src/tabs-content.vue +58 -0
- package/packages/ui/components/tabs/src/tabs-list.vue +36 -0
- package/packages/ui/components/tabs/src/tabs-trigger.vue +70 -0
- package/packages/ui/components/tabs/src/tabs.ts +94 -0
- package/packages/ui/components/tabs/src/tabs.vue +101 -0
- package/packages/ui/components/tabs/src/types.ts +126 -0
- package/packages/ui/components/tabs/styles/tabs.css +239 -0
- package/packages/ui/components/tag/README.md +67 -0
- package/packages/ui/components/tag/__tests__/tag.test.ts +222 -0
- package/packages/ui/components/tag/index.ts +13 -0
- package/packages/ui/components/tag/src/tag.ts +87 -0
- package/packages/ui/components/tag/src/tag.vue +163 -0
- package/packages/ui/components/tag/styles/tag.css +47 -0
- package/packages/ui/components/timeline/README.md +80 -0
- package/packages/ui/components/timeline/__tests__/timeline.test.ts +78 -0
- package/packages/ui/components/timeline/index.ts +15 -0
- package/packages/ui/components/timeline/src/timeline-item.vue +38 -0
- package/packages/ui/components/timeline/src/timeline.ts +76 -0
- package/packages/ui/components/timeline/src/timeline.vue +30 -0
- package/packages/ui/components/timeline/styles/timeline-item.css +49 -0
- package/packages/ui/components/timeline/styles/timeline.css +43 -0
- package/packages/ui/components/tooltip/README.md +134 -0
- package/packages/ui/components/tooltip/__tests__/tooltip.test.ts +125 -0
- package/packages/ui/components/tooltip/index.ts +12 -0
- package/packages/ui/components/tooltip/src/tooltip.ts +66 -0
- package/packages/ui/components/tooltip/src/tooltip.vue +189 -0
- package/packages/ui/components/tree/README.md +54 -0
- package/packages/ui/components/tree/__tests__/tree.test.ts +80 -0
- package/packages/ui/components/tree/index.ts +11 -0
- package/packages/ui/components/tree/src/tree.ts +51 -0
- package/packages/ui/components/tree/src/tree.vue +242 -0
- package/packages/ui/components/tree/styles/tree.css +31 -0
- package/packages/ui/components/typography/README.md +120 -0
- package/packages/ui/components/typography/__tests__/typography.test.ts +164 -0
- package/packages/ui/components/typography/index.ts +13 -0
- package/packages/ui/components/typography/src/typography.ts +95 -0
- package/packages/ui/components/typography/src/typography.vue +94 -0
- package/packages/ui/components/typography/styles/typography.css +47 -0
- package/packages/ui/components/upload/README.md +103 -0
- package/packages/ui/components/upload/__tests__/upload.test.ts +181 -0
- package/packages/ui/components/upload/index.ts +11 -0
- package/packages/ui/components/upload/src/upload.ts +92 -0
- package/packages/ui/components/upload/src/upload.vue +382 -0
- package/packages/ui/components/upload/styles/upload.css +283 -0
- package/packages/ui/components/watermark/README.md +94 -0
- package/packages/ui/components/watermark/__tests__/watermark.test.ts +252 -0
- package/packages/ui/components/watermark/index.ts +13 -0
- package/packages/ui/components/watermark/src/index.ts +13 -0
- package/packages/ui/components/watermark/src/types.ts +86 -0
- package/packages/ui/components/watermark/src/use-watermark.ts +132 -0
- package/packages/ui/components/watermark/src/watermark.vue +181 -0
- package/packages/ui/components/watermark/styles/watermark.css +27 -0
- package/packages/ui/index.ts +338 -0
- package/packages/ui/lib/utils.ts +6 -0
- package/packages/ui/lowcode-agent/icons.ts +148 -0
- package/packages/ui/lowcode-agent/index.ts +26 -0
- package/packages/ui/lowcode-agent/registry.json +37004 -0
- package/packages/ui/lowcode-agent/types.ts +312 -0
- package/packages/ui/src/composables/__tests__/use-floating-popup.test.ts +275 -0
- package/packages/ui/src/composables/__tests__/use-form-ai-actions.test.ts +101 -0
- package/packages/ui/src/composables/__tests__/use-form-ai-registry.test.ts +92 -0
- package/packages/ui/src/composables/__tests__/use-form-ai.test.ts +116 -0
- package/packages/ui/src/composables/index.ts +10 -0
- package/packages/ui/src/composables/use-ai-state-machine.ts +142 -0
- package/packages/ui/src/composables/use-floating-popup.ts +237 -0
- package/packages/ui/src/composables/use-form-ai-registry.ts +198 -0
- package/packages/ui/src/composables/use-form-ai.ts +280 -0
- package/packages/ui/src/composables/useLightbox.ts +51 -0
- package/packages/ui/src/request/document.ts +53 -0
- package/packages/ui/src/request/enum.ts +18 -0
- package/packages/ui/src/request/index.ts +4 -0
- package/packages/ui/src/request/request.ts +200 -0
- package/packages/ui/src/request/types.ts +27 -0
- package/packages/ui/src/types/form-ai-registry.ts +70 -0
- package/packages/ui/src/types/form-ai.ts +84 -0
- package/packages/ui/src/utils/date-format.ts +60 -0
- package/packages/ui/styles/design-tokens.css +383 -0
- package/packages/ui/styles/tailwind.css +76 -0
- package/packages/ui/styles/tokens.css +7 -0
- package/playground/index.html +12 -0
- package/playground/postcss.config.cjs +5 -0
- package/playground/src/App.vue +3 -0
- package/playground/src/__tests__/__debug-input.test.ts +29 -0
- package/playground/src/__tests__/button-ai-confirm.test.ts +41 -0
- package/playground/src/__tests__/home-render.test.ts +87 -0
- package/playground/src/__tests__/icon-library.test.ts +107 -0
- package/playground/src/__tests__/input-ai-confirm.test.ts +113 -0
- package/playground/src/__tests__/textarea-ai-button.test.ts +87 -0
- package/playground/src/__tests__/textarea-wordlimit.test.ts +66 -0
- package/playground/src/chart-theme.ts +22 -0
- package/playground/src/components/AiStateFlow.vue +59 -0
- package/playground/src/components/ComponentShowcase.vue +180 -0
- package/playground/src/composables/useAiStateMachine.ts +111 -0
- package/playground/src/data/component-api.ts +187 -0
- package/playground/src/data/component-meta.ts +84 -0
- package/playground/src/layouts/DefaultLayout.vue +318 -0
- package/playground/src/main.ts +18 -0
- package/playground/src/router/index.ts +101 -0
- package/playground/src/views/AffixDemo.vue +133 -0
- package/playground/src/views/AiStateFlowDemo.vue +170 -0
- package/playground/src/views/AlertDemo.vue +554 -0
- package/playground/src/views/AnchorDemo.vue +150 -0
- package/playground/src/views/AppBarDemo.vue +722 -0
- package/playground/src/views/AvatarDemo.vue +266 -0
- package/playground/src/views/BackTopDemo.vue +71 -0
- package/playground/src/views/BadgeDemo.vue +109 -0
- package/playground/src/views/BatchActionButtonDemo.vue +65 -0
- package/playground/src/views/BreadcrumbDemo.vue +248 -0
- package/playground/src/views/ButtonDemo.vue +344 -0
- package/playground/src/views/CardDemo.vue +254 -0
- package/playground/src/views/CarouselDemo.vue +158 -0
- package/playground/src/views/CascaderDemo.vue +425 -0
- package/playground/src/views/ChartDemo.vue +232 -0
- package/playground/src/views/CheckboxDemo.vue +339 -0
- package/playground/src/views/DataGridDemo.vue +518 -0
- package/playground/src/views/DataPickerDemo.vue +240 -0
- package/playground/src/views/DatePickerDemo.vue +292 -0
- package/playground/src/views/DateTimePickerDemo.vue +208 -0
- package/playground/src/views/DesignSpecDemo.vue +1647 -0
- package/playground/src/views/DividerDemo.vue +77 -0
- package/playground/src/views/DocumentActionHeaderDemo.vue +113 -0
- package/playground/src/views/DocumentFormPageDemo.vue +200 -0
- package/playground/src/views/DrawerDemo.vue +166 -0
- package/playground/src/views/DropdownButtonDemo.vue +74 -0
- package/playground/src/views/DropdownDemo.vue +306 -0
- package/playground/src/views/EmptyDemo.vue +104 -0
- package/playground/src/views/ErrorDemo.vue +111 -0
- package/playground/src/views/FileUploadDemo.vue +241 -0
- package/playground/src/views/FilterButtonDemo.vue +65 -0
- package/playground/src/views/FormFieldAiDemo.vue +364 -0
- package/playground/src/views/FormFieldBasicDemo.vue +174 -0
- package/playground/src/views/FormFieldBusinessDemo.vue +245 -0
- package/playground/src/views/FormFieldDemo.vue +178 -0
- package/playground/src/views/FormFieldLayoutDemo.vue +183 -0
- package/playground/src/views/FormFieldValidationDemo.vue +163 -0
- package/playground/src/views/FormItemAiDemo.vue +371 -0
- package/playground/src/views/FormSelectDemo.vue +519 -0
- package/playground/src/views/FormUploadDemo.vue +536 -0
- package/playground/src/views/HeroDemo.vue +836 -0
- package/playground/src/views/Home.vue +213 -0
- package/playground/src/views/IconDemo.vue +186 -0
- package/playground/src/views/IconLibraryView.vue +370 -0
- package/playground/src/views/IconRenderTest.vue +86 -0
- package/playground/src/views/ImagePreviewDemo.vue +368 -0
- package/playground/src/views/ImageUploadDemo.vue +199 -0
- package/playground/src/views/InputDemo.vue +348 -0
- package/playground/src/views/LayoutDemo.vue +946 -0
- package/playground/src/views/LoadingDemo.vue +95 -0
- package/playground/src/views/LocationPickerDemo.vue +218 -0
- package/playground/src/views/MenuDemo.vue +283 -0
- package/playground/src/views/MessageDemo.vue +201 -0
- package/playground/src/views/MetricDemo.vue +535 -0
- package/playground/src/views/ModalDemo.vue +291 -0
- package/playground/src/views/MoreActionButtonDemo.vue +65 -0
- package/playground/src/views/NewDocumentDemo.vue +973 -0
- package/playground/src/views/NotificationDemo.vue +255 -0
- package/playground/src/views/PaginationDemo.vue +292 -0
- package/playground/src/views/ProgressDemo.vue +356 -0
- package/playground/src/views/RadioDemo.vue +414 -0
- package/playground/src/views/RegionPickerDemo.vue +249 -0
- package/playground/src/views/ScalingRulesDemo.vue +333 -0
- package/playground/src/views/SelectDemo.vue +453 -0
- package/playground/src/views/SideNavDemo.vue +769 -0
- package/playground/src/views/SignatureDemo.vue +205 -0
- package/playground/src/views/SkeletonDemo.vue +109 -0
- package/playground/src/views/SliderDemo.vue +312 -0
- package/playground/src/views/SplitButtonDemo.vue +65 -0
- package/playground/src/views/StatusDotDemo.vue +131 -0
- package/playground/src/views/StepsDemo.vue +587 -0
- package/playground/src/views/SwitchDemo.vue +442 -0
- package/playground/src/views/TableDemo.vue +438 -0
- package/playground/src/views/TabsDemo.vue +246 -0
- package/playground/src/views/TagDemo.vue +113 -0
- package/playground/src/views/TextAreaDemo.vue +317 -0
- package/playground/src/views/TimePickerDemo.vue +291 -0
- package/playground/src/views/TimelineDemo.vue +133 -0
- package/playground/src/views/TooltipDemo.vue +102 -0
- package/playground/src/views/TreeDemo.vue +521 -0
- package/playground/src/views/TypographyDemo.vue +175 -0
- package/playground/src/views/UploadDemo.vue +331 -0
- package/playground/src/views/WatermarkDemo.vue +112 -0
- package/playground/src/views/_mocks/new-document.mock.ts +506 -0
- package/playground/src/views/data/form-field-events-table.ts +243 -0
- package/playground/src/views/data/form-field-options.ts +77 -0
- package/playground/src/views/data/form-field-props-table.ts +227 -0
- package/playground/src/views/data/form-field-snippets.ts +149 -0
- package/playground/src/views/data/slider-snippets.ts +100 -0
- package/playground/src/views/inner/FormFieldEventsDoc.vue +147 -0
- package/playground/src/views/inner/FormFieldPropsDoc.vue +138 -0
- package/playground/vite.config.ts +25 -0
- package/pnpm-workspace.yaml +3 -0
- package/postcss.config.cjs +5 -0
- package/scripts/check-design-token-compliance.mjs +223 -0
- package/scripts/generate-package-dts.mjs +105 -0
- package/tsconfig.json +35 -0
- package/tsconfig.node.json +13 -0
- package/vite.config.ts +68 -0
- package/Button/button-props.d.ts +0 -9
- package/Button/button-variants.d.ts +0 -5
- package/Button/index.d.ts +0 -20
- package/Button/index.js +0 -111
- package/index.css +0 -596
- package/index.d.ts +0 -15
- package/index.js +0 -19
- package/utils/forward-attrs.d.ts +0 -6
- package/utils/install.d.ts +0 -6
- package/utils/utils.d.ts +0 -2
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* TfImageUpload 多图上传组件
|
|
4
|
+
* 缩略图网格 + hover 操作层 + lightbox 预览
|
|
5
|
+
*/
|
|
6
|
+
import { ref, computed, watch, onBeforeUnmount } from 'vue'
|
|
7
|
+
import Cropper from 'cropperjs'
|
|
8
|
+
import { useLightbox } from '../../../../../src/composables/useLightbox'
|
|
9
|
+
import { useAiStateMachine } from '../../../../../src/composables/use-ai-state-machine'
|
|
10
|
+
import type { AiState } from '../../../../../src/composables/use-ai-state-machine'
|
|
11
|
+
import type { ImageUploadProps, ImageUploadEmits, ImageUploadSlots, ImageFileItem, AiConfig } from './image-upload'
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(defineProps<ImageUploadProps>(), {
|
|
14
|
+
modelValue: () => [],
|
|
15
|
+
multiple: true,
|
|
16
|
+
maxCount: undefined,
|
|
17
|
+
maxSize: 5,
|
|
18
|
+
accept: 'image/*',
|
|
19
|
+
disabled: false,
|
|
20
|
+
enableCrop: false,
|
|
21
|
+
cropAspectRatio: NaN,
|
|
22
|
+
thumbnailSize: 96
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const emit = defineEmits<ImageUploadEmits>()
|
|
26
|
+
defineSlots<ImageUploadSlots>()
|
|
27
|
+
|
|
28
|
+
// ===== Lightbox =====
|
|
29
|
+
const {
|
|
30
|
+
visible: lightboxVisible,
|
|
31
|
+
currentUrl: lightboxUrl,
|
|
32
|
+
currentIndex: lightboxIndex,
|
|
33
|
+
totalCount,
|
|
34
|
+
open: openLightbox,
|
|
35
|
+
close: closeLightbox,
|
|
36
|
+
next: nextLightbox,
|
|
37
|
+
prev: prevLightbox,
|
|
38
|
+
onKeydown: lightboxOnKeydown
|
|
39
|
+
} = useLightbox()
|
|
40
|
+
|
|
41
|
+
// ===== 图片列表 =====
|
|
42
|
+
const imageList = computed(() => props.modelValue ?? [])
|
|
43
|
+
const maxedOut = computed(() => props.maxCount != null && imageList.value.length >= props.maxCount)
|
|
44
|
+
|
|
45
|
+
// ===== 文件输入 =====
|
|
46
|
+
const inputRef = ref<HTMLInputElement | null>(null)
|
|
47
|
+
let uidCounter = 0
|
|
48
|
+
|
|
49
|
+
function genUid(): string {
|
|
50
|
+
return `img-${Date.now()}-${++uidCounter}`
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ===== 工具函数 =====
|
|
54
|
+
function getImageUrl(item: ImageFileItem): string {
|
|
55
|
+
return item.base64 || item.url || ''
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function formatFileSize(bytes: number): string {
|
|
59
|
+
if (bytes < 1024) return `${bytes}B`
|
|
60
|
+
if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)}KB`
|
|
61
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ===== 文件处理 =====
|
|
65
|
+
function triggerInput() {
|
|
66
|
+
if (props.disabled) return
|
|
67
|
+
inputRef.value?.click()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function handleChange(e: Event) {
|
|
71
|
+
const input = e.target as HTMLInputElement
|
|
72
|
+
const files = Array.from(input.files || [])
|
|
73
|
+
if (files.length === 0) return
|
|
74
|
+
|
|
75
|
+
for (const file of files) {
|
|
76
|
+
// 检查数量限制
|
|
77
|
+
if (props.maxCount != null && imageList.value.length >= props.maxCount) {
|
|
78
|
+
emit('exceed', { type: 'count', message: `最多只能上传 ${props.maxCount} 张图片` })
|
|
79
|
+
break
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 检查大小
|
|
83
|
+
if (props.maxSize) {
|
|
84
|
+
const maxBytes = props.maxSize * 1024 * 1024
|
|
85
|
+
if (file.size > maxBytes) {
|
|
86
|
+
emit('exceed', {
|
|
87
|
+
type: 'size',
|
|
88
|
+
message: `图片 "${file.name}" 超出大小限制,最大允许 ${props.maxSize}MB`
|
|
89
|
+
})
|
|
90
|
+
continue
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const reader = new FileReader()
|
|
95
|
+
const item: ImageFileItem = { uid: genUid(), file, name: file.name, status: 'done' }
|
|
96
|
+
|
|
97
|
+
reader.onload = () => {
|
|
98
|
+
item.base64 = reader.result as string
|
|
99
|
+
addItem(item)
|
|
100
|
+
}
|
|
101
|
+
reader.readAsDataURL(file)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// 重置 input 以允许重复选择同一文件
|
|
105
|
+
input.value = ''
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function addItem(item: ImageFileItem) {
|
|
109
|
+
const list = [...imageList.value, item]
|
|
110
|
+
emit('update:modelValue', list)
|
|
111
|
+
emit('change', list)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function removeImage(idx: number) {
|
|
115
|
+
if (props.disabled) return
|
|
116
|
+
const list = [...imageList.value]
|
|
117
|
+
const removed = list.splice(idx, 1)
|
|
118
|
+
// 清理可能存在的 blob URL
|
|
119
|
+
if (removed[0]?.url && removed[0].url.startsWith('blob:')) {
|
|
120
|
+
URL.revokeObjectURL(removed[0].url)
|
|
121
|
+
}
|
|
122
|
+
emit('update:modelValue', list)
|
|
123
|
+
emit('change', list)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ===== Lightbox 操作 =====
|
|
127
|
+
function previewImage(idx: number) {
|
|
128
|
+
const url = getImageUrl(imageList.value[idx])
|
|
129
|
+
openLightbox(url, idx, imageList.value.length)
|
|
130
|
+
emit('preview', imageList.value[idx], idx)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// 监听 lightboxIndex 变化 → 同步更新 lightboxUrl
|
|
134
|
+
watch(lightboxIndex, (idx) => {
|
|
135
|
+
if (lightboxVisible.value && idx >= 0 && idx < imageList.value.length) {
|
|
136
|
+
lightboxUrl.value = getImageUrl(imageList.value[idx])
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
// ===== 裁剪功能 =====
|
|
141
|
+
const cropping = ref(false)
|
|
142
|
+
const cropFile = ref<File | null>(null)
|
|
143
|
+
const cropIndex = ref(-1)
|
|
144
|
+
const cropPreviewUrl = ref('')
|
|
145
|
+
const cropImgRef = ref<HTMLImageElement | null>(null)
|
|
146
|
+
let cropperInstance: Cropper | null = null
|
|
147
|
+
|
|
148
|
+
function cropImage(idx: number) {
|
|
149
|
+
if (props.disabled) return
|
|
150
|
+
const item = imageList.value[idx]
|
|
151
|
+
if (!item.file) {
|
|
152
|
+
// 如果是 url 或 base64,创建一个临时 blob
|
|
153
|
+
fetch(item.base64 || item.url || '')
|
|
154
|
+
.then(res => res.blob())
|
|
155
|
+
.then(blob => {
|
|
156
|
+
const f = new File([blob], item.name || 'image.png', { type: blob.type || 'image/png' })
|
|
157
|
+
startCrop(f, idx)
|
|
158
|
+
})
|
|
159
|
+
.catch(() => {})
|
|
160
|
+
return
|
|
161
|
+
}
|
|
162
|
+
startCrop(item.file, idx)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function startCrop(file: File, idx: number) {
|
|
166
|
+
cropFile.value = file
|
|
167
|
+
cropIndex.value = idx
|
|
168
|
+
cropPreviewUrl.value = URL.createObjectURL(file)
|
|
169
|
+
cropping.value = true
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function initCropper() {
|
|
173
|
+
if (!cropImgRef.value) return
|
|
174
|
+
if (cropperInstance) {
|
|
175
|
+
cropperInstance.destroy()
|
|
176
|
+
cropperInstance = null
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const options: Cropper.Options = {
|
|
180
|
+
viewMode: 1,
|
|
181
|
+
dragMode: 'move',
|
|
182
|
+
autoCropArea: 0.8,
|
|
183
|
+
restore: false,
|
|
184
|
+
guides: true,
|
|
185
|
+
center: true,
|
|
186
|
+
highlight: true,
|
|
187
|
+
cropBoxMovable: true,
|
|
188
|
+
cropBoxResizable: true,
|
|
189
|
+
toggleDragModeOnDblclick: false,
|
|
190
|
+
background: false,
|
|
191
|
+
modal: true,
|
|
192
|
+
responsive: true
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (!Number.isNaN(props.cropAspectRatio) && props.cropAspectRatio > 0) {
|
|
196
|
+
options.aspectRatio = props.cropAspectRatio
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
cropperInstance = new Cropper(cropImgRef.value, options)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function confirmCrop() {
|
|
203
|
+
if (!cropperInstance) return
|
|
204
|
+
const canvas = cropperInstance.getCroppedCanvas()
|
|
205
|
+
if (!canvas) return
|
|
206
|
+
|
|
207
|
+
const base64 = canvas.toDataURL('image/png')
|
|
208
|
+
const list = [...imageList.value]
|
|
209
|
+
if (cropIndex.value >= 0 && cropIndex.value < list.length) {
|
|
210
|
+
list[cropIndex.value] = {
|
|
211
|
+
...list[cropIndex.value],
|
|
212
|
+
base64,
|
|
213
|
+
file: cropFile.value ?? list[cropIndex.value].file
|
|
214
|
+
}
|
|
215
|
+
emit('update:modelValue', list)
|
|
216
|
+
emit('change', list)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
destroyCropper()
|
|
220
|
+
cancelCropUI()
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function cancelCropUI() {
|
|
224
|
+
destroyCropper()
|
|
225
|
+
if (cropPreviewUrl.value) {
|
|
226
|
+
URL.revokeObjectURL(cropPreviewUrl.value)
|
|
227
|
+
cropPreviewUrl.value = ''
|
|
228
|
+
}
|
|
229
|
+
cropFile.value = null
|
|
230
|
+
cropIndex.value = -1
|
|
231
|
+
cropping.value = false
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function resetCrop() {
|
|
235
|
+
cropperInstance?.reset()
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function destroyCropper() {
|
|
239
|
+
if (cropperInstance) {
|
|
240
|
+
cropperInstance.destroy()
|
|
241
|
+
cropperInstance = null
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// 裁剪阶段初始化 Cropper
|
|
246
|
+
watch(cropping, async (val) => {
|
|
247
|
+
if (val) {
|
|
248
|
+
await import('vue').then(m => m.nextTick()).then(() => initCropper())
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
onBeforeUnmount(() => {
|
|
253
|
+
destroyCropper()
|
|
254
|
+
if (cropPreviewUrl.value) URL.revokeObjectURL(cropPreviewUrl.value)
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
// ============== AI 状态机集成 ==============
|
|
258
|
+
const aiEnabled = computed(() => !!props.ai)
|
|
259
|
+
|
|
260
|
+
const preset = computed(() => props.ai?.preset ?? 'check')
|
|
261
|
+
|
|
262
|
+
const defaultLabels = computed(() => {
|
|
263
|
+
switch (preset.value) {
|
|
264
|
+
case 'validate':
|
|
265
|
+
return { trigger: 'AI 校验', retry: '重新校验', confirm: '✓ 应用' }
|
|
266
|
+
case 'complete':
|
|
267
|
+
return { trigger: 'AI 分析', retry: '再次分析', confirm: '✓ 应用' }
|
|
268
|
+
case 'check':
|
|
269
|
+
default:
|
|
270
|
+
return { trigger: 'AI 检测', retry: '重新检测', confirm: '✓ 应用' }
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
const triggerLabel = computed(() => props.ai?.triggerLabel ?? defaultLabels.value.trigger)
|
|
275
|
+
const retryLabel = computed(() => props.ai?.retryLabel ?? defaultLabels.value.retry)
|
|
276
|
+
const confirmLabel = computed(() => props.ai?.confirmLabel ?? defaultLabels.value.confirm)
|
|
277
|
+
|
|
278
|
+
const ai = useAiStateMachine({
|
|
279
|
+
needConfirm: props.ai?.needConfirm ?? true,
|
|
280
|
+
errorRate: props.ai?.errorRate ?? 0,
|
|
281
|
+
runningDuration: props.ai?.runningDuration ?? 1500,
|
|
282
|
+
autoReset: props.ai?.autoReset ?? 0
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
const aiStateLabels: Record<AiState, string> = {
|
|
286
|
+
idle: '空闲',
|
|
287
|
+
running: 'AI 处理中',
|
|
288
|
+
confirming: '⚠ 等待确认',
|
|
289
|
+
done: '✓ 已完成',
|
|
290
|
+
error: '✗ 失败'
|
|
291
|
+
}
|
|
292
|
+
const aiStateClasses: Record<AiState, string> = {
|
|
293
|
+
idle: 'tf-image-upload__ai-chip--idle',
|
|
294
|
+
running: 'bg-[var(--info-50)] text-[var(--info-600)] animate-pulse',
|
|
295
|
+
confirming: 'bg-[var(--warning-50)] text-[var(--warning-700)]',
|
|
296
|
+
done: 'bg-[var(--success-50)] text-[var(--success-700)]',
|
|
297
|
+
error: 'bg-[var(--error-50)] text-[var(--error-600)]'
|
|
298
|
+
}
|
|
299
|
+
const aiStateLabel = computed(() => aiStateLabels[ai.state.value])
|
|
300
|
+
const aiStateClass = computed(() => aiStateClasses[ai.state.value])
|
|
301
|
+
|
|
302
|
+
const currentTriggerLabel = computed(() => {
|
|
303
|
+
const s = ai.state.value
|
|
304
|
+
if (s === 'error') return retryLabel.value
|
|
305
|
+
if (s === 'done') return retryLabel.value
|
|
306
|
+
return triggerLabel.value
|
|
307
|
+
})
|
|
308
|
+
|
|
309
|
+
const defaultApply = (result: any): ImageFileItem[] => {
|
|
310
|
+
if (result == null) return imageList.value
|
|
311
|
+
if (Array.isArray(result)) return result
|
|
312
|
+
if (Array.isArray(result?.images)) return result.images
|
|
313
|
+
return imageList.value
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const applyAndConfirm = () => {
|
|
317
|
+
const r = ai.result.value
|
|
318
|
+
const applyFn = props.ai?.applyResult ?? defaultApply
|
|
319
|
+
const next = applyFn(r, imageList.value)
|
|
320
|
+
emit('update:modelValue', next)
|
|
321
|
+
emit('change', next)
|
|
322
|
+
ai.confirm()
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const handleAiTrigger = () => {
|
|
326
|
+
if (typeof props.ai?.onTrigger === 'function') {
|
|
327
|
+
ai.trigger(() => props.ai!.onTrigger(imageList.value))
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
let watchTimer2: ReturnType<typeof setTimeout> | null = null
|
|
332
|
+
watch(
|
|
333
|
+
() => [aiEnabled.value, props.ai?.mode, imageList.value] as const,
|
|
334
|
+
([enabled, mode]) => {
|
|
335
|
+
if (!enabled || mode !== 'watch') return
|
|
336
|
+
if (ai.busy.value) return
|
|
337
|
+
if (watchTimer2) { clearTimeout(watchTimer2); watchTimer2 = null }
|
|
338
|
+
watchTimer2 = setTimeout(() => { handleAiTrigger() }, 600)
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
watch(
|
|
343
|
+
() => ai.state.value,
|
|
344
|
+
(s) => {
|
|
345
|
+
if (!aiEnabled.value) return
|
|
346
|
+
emit('ai-state-change', s, ai.result.value, ai.error.value)
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
</script>
|
|
350
|
+
|
|
351
|
+
<template>
|
|
352
|
+
<div class="tf-image-upload tf-form-control">
|
|
353
|
+
<!-- ===== 裁剪界面 ===== -->
|
|
354
|
+
<div v-if="cropping && cropPreviewUrl" class="space-y-3 mb-4">
|
|
355
|
+
<div class="tf-image-upload__crop-container rounded-lg overflow-hidden" style="max-height: 400px;">
|
|
356
|
+
<img ref="cropImgRef" :src="cropPreviewUrl" alt="裁剪图片" class="max-w-full" />
|
|
357
|
+
</div>
|
|
358
|
+
<div class="flex items-center justify-end gap-2">
|
|
359
|
+
<button
|
|
360
|
+
type="button"
|
|
361
|
+
class="tf-image-upload__crop-btn px-3 py-1.5 text-sm rounded-md transition-colors"
|
|
362
|
+
@click="resetCrop"
|
|
363
|
+
>
|
|
364
|
+
重置
|
|
365
|
+
</button>
|
|
366
|
+
<button
|
|
367
|
+
type="button"
|
|
368
|
+
class="tf-image-upload__crop-btn px-3 py-1.5 text-sm rounded-md transition-colors"
|
|
369
|
+
@click="cancelCropUI"
|
|
370
|
+
>
|
|
371
|
+
取消
|
|
372
|
+
</button>
|
|
373
|
+
<button
|
|
374
|
+
type="button"
|
|
375
|
+
class="tf-image-upload__crop-confirm px-3 py-1.5 text-sm rounded-md transition-colors"
|
|
376
|
+
@click="confirmCrop"
|
|
377
|
+
>
|
|
378
|
+
确认裁剪
|
|
379
|
+
</button>
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
|
|
383
|
+
<!-- ===== 缩略图网格 ===== -->
|
|
384
|
+
<div class="flex flex-wrap gap-3">
|
|
385
|
+
<!-- 每张图片 -->
|
|
386
|
+
<div
|
|
387
|
+
v-for="(item, idx) in imageList"
|
|
388
|
+
:key="item.uid"
|
|
389
|
+
class="tf-image-upload__thumbnail relative group rounded-lg overflow-hidden shrink-0"
|
|
390
|
+
:style="{ width: thumbnailSize + 'px', height: thumbnailSize + 'px' }"
|
|
391
|
+
>
|
|
392
|
+
<img
|
|
393
|
+
:src="getImageUrl(item)"
|
|
394
|
+
class="w-full h-full object-cover"
|
|
395
|
+
:alt="item.name || '图片'"
|
|
396
|
+
/>
|
|
397
|
+
|
|
398
|
+
<!-- hover 操作层 -->
|
|
399
|
+
<div
|
|
400
|
+
class="absolute inset-0 tf-image-upload__hover-mask opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-1"
|
|
401
|
+
>
|
|
402
|
+
<button
|
|
403
|
+
type="button"
|
|
404
|
+
class="w-7 h-7 flex items-center justify-center tf-image-upload__action-btn rounded-full text-sm transition-colors"
|
|
405
|
+
aria-label="放大预览"
|
|
406
|
+
@click="previewImage(idx)"
|
|
407
|
+
>
|
|
408
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
409
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
410
|
+
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" />
|
|
411
|
+
</svg>
|
|
412
|
+
</button>
|
|
413
|
+
<button
|
|
414
|
+
v-if="enableCrop"
|
|
415
|
+
type="button"
|
|
416
|
+
class="w-7 h-7 flex items-center justify-center tf-image-upload__action-btn rounded-full text-sm transition-colors"
|
|
417
|
+
aria-label="裁剪"
|
|
418
|
+
@click="cropImage(idx)"
|
|
419
|
+
>
|
|
420
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
421
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
422
|
+
d="M4 4h4v4H4V4zm12 0h4v4h-4V4zM4 16h4v4H4v-4zm12 0h4v4h-4v-4z" />
|
|
423
|
+
</svg>
|
|
424
|
+
</button>
|
|
425
|
+
<button
|
|
426
|
+
type="button"
|
|
427
|
+
class="w-7 h-7 flex items-center justify-center tf-image-upload__action-btn rounded-full text-sm transition-colors text-[var(--tf-color-error)]"
|
|
428
|
+
aria-label="删除"
|
|
429
|
+
@click="removeImage(idx)"
|
|
430
|
+
>
|
|
431
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
432
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
433
|
+
</svg>
|
|
434
|
+
</button>
|
|
435
|
+
</div>
|
|
436
|
+
|
|
437
|
+
<!-- uploading 状态遮罩 -->
|
|
438
|
+
<div
|
|
439
|
+
v-if="item.status === 'uploading'"
|
|
440
|
+
class="absolute inset-0 tf-image-upload__uploading-mask flex items-center justify-center"
|
|
441
|
+
>
|
|
442
|
+
<svg class="animate-spin w-5 h-5 text-[var(--brand-600)]" fill="none" viewBox="0 0 24 24">
|
|
443
|
+
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" />
|
|
444
|
+
<path class="opacity-75" fill="currentColor"
|
|
445
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
|
|
446
|
+
</svg>
|
|
447
|
+
</div>
|
|
448
|
+
</div>
|
|
449
|
+
|
|
450
|
+
<!-- 添加按钮 -->
|
|
451
|
+
<div
|
|
452
|
+
v-if="!maxedOut"
|
|
453
|
+
class="border-2 border-dashed tf-image-upload__add-btn rounded-lg flex flex-col items-center justify-center cursor-pointer transition-colors shrink-0"
|
|
454
|
+
:class="{ 'opacity-50 cursor-not-allowed': disabled }"
|
|
455
|
+
:style="{ width: thumbnailSize + 'px', height: thumbnailSize + 'px' }"
|
|
456
|
+
@click="triggerInput"
|
|
457
|
+
>
|
|
458
|
+
<svg class="w-6 h-6 text-[var(--neutral-400)]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
459
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 5v14m-7-7h14" />
|
|
460
|
+
</svg>
|
|
461
|
+
<span class="text-xs text-[var(--neutral-400)] mt-1">添加图片</span>
|
|
462
|
+
</div>
|
|
463
|
+
</div>
|
|
464
|
+
|
|
465
|
+
<!-- 隐藏 input -->
|
|
466
|
+
<input
|
|
467
|
+
ref="inputRef"
|
|
468
|
+
type="file"
|
|
469
|
+
:accept="accept"
|
|
470
|
+
:multiple="multiple"
|
|
471
|
+
:disabled="disabled"
|
|
472
|
+
hidden
|
|
473
|
+
@change="handleChange"
|
|
474
|
+
/>
|
|
475
|
+
|
|
476
|
+
<!-- ===== Lightbox (Teleport to body) ===== -->
|
|
477
|
+
<Teleport to="body">
|
|
478
|
+
<div
|
|
479
|
+
v-if="lightboxVisible"
|
|
480
|
+
class="fixed inset-0 z-[100] flex items-center justify-center"
|
|
481
|
+
@keydown="lightboxOnKeydown"
|
|
482
|
+
tabindex="0"
|
|
483
|
+
>
|
|
484
|
+
<div class="absolute inset-0 z-0" :style="{ background: 'color-mix(in srgb, var(--tf-color-black) 80%, transparent)' }" @click="closeLightbox"></div>
|
|
485
|
+
<!-- 左箭头 -->
|
|
486
|
+
<button
|
|
487
|
+
v-if="lightboxIndex > 0"
|
|
488
|
+
class="absolute left-4 z-10 text-[var(--tf-color-white)] text-3xl hover:scale-110 transition"
|
|
489
|
+
@click.stop="prevLightbox"
|
|
490
|
+
>
|
|
491
|
+
‹
|
|
492
|
+
</button>
|
|
493
|
+
|
|
494
|
+
<!-- 大图 -->
|
|
495
|
+
<img
|
|
496
|
+
:src="lightboxUrl"
|
|
497
|
+
class="relative z-10 max-w-[90vw] max-h-[90vh] object-contain select-none"
|
|
498
|
+
@click.stop
|
|
499
|
+
draggable="false"
|
|
500
|
+
/>
|
|
501
|
+
|
|
502
|
+
<!-- 右箭头 -->
|
|
503
|
+
<button
|
|
504
|
+
v-if="lightboxIndex < totalCount - 1"
|
|
505
|
+
class="absolute right-4 z-10 text-[var(--tf-color-white)] text-3xl hover:scale-110 transition"
|
|
506
|
+
@click.stop="nextLightbox"
|
|
507
|
+
>
|
|
508
|
+
›
|
|
509
|
+
</button>
|
|
510
|
+
|
|
511
|
+
<!-- 关闭按钮 -->
|
|
512
|
+
<button
|
|
513
|
+
class="absolute top-4 right-4 z-10 text-[var(--tf-color-white)] text-2xl hover:scale-110 transition"
|
|
514
|
+
@click.stop="closeLightbox"
|
|
515
|
+
>
|
|
516
|
+
×
|
|
517
|
+
</button>
|
|
518
|
+
|
|
519
|
+
<!-- 计数 -->
|
|
520
|
+
<span class="absolute bottom-4 z-10 text-[var(--tf-color-white)] text-sm px-3 py-1 rounded-full" :style="{ background: 'color-mix(in srgb, var(--tf-color-black) 50%, transparent)' }">
|
|
521
|
+
{{ lightboxIndex + 1 }} / {{ totalCount }}
|
|
522
|
+
</span>
|
|
523
|
+
</div>
|
|
524
|
+
</Teleport>
|
|
525
|
+
|
|
526
|
+
<!-- AI 状态栏 -->
|
|
527
|
+
<div
|
|
528
|
+
v-if="aiEnabled"
|
|
529
|
+
class="tf-image-upload__ai-bar basis-full flex items-center justify-between gap-2 mt-1.5 text-[10px]"
|
|
530
|
+
>
|
|
531
|
+
<div class="flex items-center gap-2 min-w-0 flex-1 overflow-hidden">
|
|
532
|
+
<span
|
|
533
|
+
:class="['px-2 py-0.5 rounded-full font-medium whitespace-nowrap shrink-0 inline-flex items-center leading-none h-5', aiStateClass]"
|
|
534
|
+
>
|
|
535
|
+
{{ aiStateLabel }}
|
|
536
|
+
</span>
|
|
537
|
+
<span
|
|
538
|
+
v-if="ai.state.value === 'error' && ai.error.value"
|
|
539
|
+
class="text-[var(--tf-color-error)] truncate min-w-0"
|
|
540
|
+
>
|
|
541
|
+
{{ ai.error.value }}
|
|
542
|
+
</span>
|
|
543
|
+
</div>
|
|
544
|
+
<div class="flex items-center gap-1.5 shrink-0 h-5">
|
|
545
|
+
<button
|
|
546
|
+
v-if="ai.state.value === 'idle' || ai.state.value === 'error' || ai.state.value === 'done'"
|
|
547
|
+
type="button"
|
|
548
|
+
:disabled="disabled"
|
|
549
|
+
class="px-2 py-0.5 rounded bg-[var(--tf-color-ai-primary)] text-[var(--tf-color-white)] hover:bg-[var(--ai-600)] disabled:opacity-50 disabled:cursor-not-allowed transition inline-flex items-center leading-none h-5"
|
|
550
|
+
@click="handleAiTrigger"
|
|
551
|
+
>
|
|
552
|
+
{{ currentTriggerLabel }}
|
|
553
|
+
</button>
|
|
554
|
+
<button
|
|
555
|
+
v-else-if="ai.state.value === 'confirming'"
|
|
556
|
+
type="button"
|
|
557
|
+
:disabled="disabled"
|
|
558
|
+
class="px-2 py-0.5 rounded tf-image-upload__ai-confirm disabled:opacity-50 disabled:cursor-not-allowed transition inline-flex items-center leading-none h-5"
|
|
559
|
+
@click="applyAndConfirm"
|
|
560
|
+
>
|
|
561
|
+
{{ confirmLabel }}
|
|
562
|
+
</button>
|
|
563
|
+
<button
|
|
564
|
+
v-else-if="ai.state.value === 'running'"
|
|
565
|
+
type="button"
|
|
566
|
+
:disabled="disabled"
|
|
567
|
+
class="px-2 py-0.5 rounded tf-image-upload__ai-cancel disabled:opacity-50 disabled:cursor-not-allowed transition inline-flex items-center leading-none h-5"
|
|
568
|
+
@click="ai.reset()"
|
|
569
|
+
>
|
|
570
|
+
取消
|
|
571
|
+
</button>
|
|
572
|
+
</div>
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
</template>
|
|
576
|
+
|
|
577
|
+
<style scoped>
|
|
578
|
+
/* ===== 裁剪容器背景 ===== */
|
|
579
|
+
.tf-image-upload__crop-container {
|
|
580
|
+
background: var(--neutral-100);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/* ===== 裁剪操作按钮(重置/取消) ===== */
|
|
584
|
+
.tf-image-upload__crop-btn {
|
|
585
|
+
border: 1px solid var(--neutral-300);
|
|
586
|
+
color: var(--neutral-600);
|
|
587
|
+
}
|
|
588
|
+
.tf-image-upload__crop-btn:hover {
|
|
589
|
+
background: var(--neutral-50);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/* ===== 裁剪确认按钮 ===== */
|
|
593
|
+
.tf-image-upload__crop-confirm {
|
|
594
|
+
background: var(--brand-600);
|
|
595
|
+
color: var(--tf-color-white);
|
|
596
|
+
}
|
|
597
|
+
.tf-image-upload__crop-confirm:hover {
|
|
598
|
+
background: var(--brand-700);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/* ===== 缩略图容器 ===== */
|
|
602
|
+
.tf-image-upload__thumbnail {
|
|
603
|
+
border: 1px solid var(--neutral-200);
|
|
604
|
+
background: var(--neutral-100);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/* ===== AI idle 状态标签 ===== */
|
|
608
|
+
.tf-image-upload__ai-chip--idle {
|
|
609
|
+
background: var(--neutral-100);
|
|
610
|
+
color: var(--neutral-500);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/* ===== Hover 遮罩层 ===== */
|
|
614
|
+
.tf-image-upload__hover-mask {
|
|
615
|
+
background: color-mix(in srgb, var(--tf-color-black) 40%, transparent);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/* ===== Hover 操作按钮 ===== */
|
|
619
|
+
.tf-image-upload__action-btn {
|
|
620
|
+
background: color-mix(in srgb, var(--tf-color-white) 90%, transparent);
|
|
621
|
+
}
|
|
622
|
+
.tf-image-upload__action-btn:hover {
|
|
623
|
+
background: var(--tf-color-white);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/* ===== Uploading 遮罩 ===== */
|
|
627
|
+
.tf-image-upload__uploading-mask {
|
|
628
|
+
background: color-mix(in srgb, var(--tf-color-white) 60%, transparent);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/* ===== 添加按钮 ===== */
|
|
632
|
+
.tf-image-upload__add-btn {
|
|
633
|
+
border-color: var(--neutral-300);
|
|
634
|
+
}
|
|
635
|
+
.tf-image-upload__add-btn:hover {
|
|
636
|
+
border-color: var(--brand-400);
|
|
637
|
+
background: color-mix(in srgb, var(--brand-50) 30%, transparent);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/* ===== AI 确认按钮 ===== */
|
|
641
|
+
.tf-image-upload__ai-confirm {
|
|
642
|
+
background: var(--emerald-500);
|
|
643
|
+
color: var(--tf-color-white);
|
|
644
|
+
}
|
|
645
|
+
.tf-image-upload__ai-confirm:hover {
|
|
646
|
+
background: var(--emerald-600);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/* ===== AI 取消按钮 ===== */
|
|
650
|
+
.tf-image-upload__ai-cancel {
|
|
651
|
+
background: var(--neutral-200);
|
|
652
|
+
color: var(--neutral-600);
|
|
653
|
+
}
|
|
654
|
+
.tf-image-upload__ai-cancel:hover {
|
|
655
|
+
background: var(--neutral-300);
|
|
656
|
+
}
|
|
657
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form 基础层聚合导出
|
|
3
|
+
*
|
|
4
|
+
* 8 个基础表单控件的统一入口 (input / text-area / select / cascader /
|
|
5
|
+
* checkbox / radio / switch / date-picker)
|
|
6
|
+
*
|
|
7
|
+
* 注意: 这是 base 层的 index, **不**直接 re-export 到 packages/ui 顶层
|
|
8
|
+
* 顶层使用方请导入 'packages/ui/components/form' (复合层)
|
|
9
|
+
*
|
|
10
|
+
* 业务侧使用:
|
|
11
|
+
* - 单独使用: import { TfInput } from '@tongfang/ui/components/form/base'
|
|
12
|
+
* - 复合组件: import { TfFormField } from '@tongfang/ui/components/form'
|
|
13
|
+
*/
|
|
14
|
+
export * from './input'
|
|
15
|
+
export * from './text-area'
|
|
16
|
+
export * from './select'
|
|
17
|
+
export * from './cascader'
|
|
18
|
+
export * from './checkbox'
|
|
19
|
+
export * from './radio'
|
|
20
|
+
export * from './switch'
|
|
21
|
+
export * from './date-picker'
|
|
22
|
+
export * from './upload'
|
|
23
|
+
// AiConfig 在 input/text-area 都存在, 显式从 input 导出, 避免冲突
|
|
24
|
+
export type { AiConfig } from './input/src/input'
|