@tongfun/ui 0.0.1-alpha.2 → 0.0.1-alpha.4
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/dist/agent-schema/index.d.ts +12 -0
- package/dist/agent-schema/index.js +33 -0
- package/dist/agent-schema/types.d.ts +27 -0
- package/dist/formula/index.d.ts +17 -0
- package/dist/formula/types.d.ts +136 -0
- package/dist/index.d.ts +167 -0
- package/dist/index.js +156550 -0
- package/dist/lowcode-agent/icons.d.ts +11 -0
- package/dist/lowcode-agent/icons.js +134 -0
- package/{packages/ui/lowcode-agent/index.ts → dist/lowcode-agent/index.d.ts} +1 -2
- package/dist/lowcode-agent/index.js +42625 -0
- package/{packages/ui/lowcode-agent/types.ts → dist/lowcode-agent/types.d.ts} +312 -312
- package/dist/skill/golden-examples/dashboard-workbench.md +224 -0
- package/dist/skill/golden-examples/form-create.md +227 -0
- package/dist/skill/golden-examples/management-list.md +264 -0
- package/dist/skill/golden-examples/new-document.md +748 -0
- package/dist/skill/tongfun-ui-skill.json +470 -0
- package/dist/skill/tongfun-ui-skill.md +297 -0
- package/dist/style.css +1 -0
- package/package.json +16 -2
- package/.claude/settings.local.json +0 -7
- package/.hermes/plans/datapicker-object-mode.md +0 -57
- package/.hermes/plans/design-spec-fusion-5175-v2.md +0 -146
- package/.hermes/plans/design-spec-fusion-5175.md +0 -88
- package/.hermes/plans/file-upload-chip-redesign.md +0 -66
- package/.hermes/plans/form-image-upload-modelvalue-fix.md +0 -38
- package/.hermes/plans/form-layout-responsive-span-plan.md +0 -137
- package/.hermes/plans/global-audit-report.md +0 -728
- package/.hermes/plans/global-audit-report.v1.md +0 -604
- package/.hermes/plans/global-audit-report.v3.md +0 -777
- package/.hermes/plans/image-file-erp-redesign.md +0 -173
- package/.hermes/plans/location-picker-baidu-modal.md +0 -173
- package/.hermes/plans/new-document-3b-color-componentization-plan.md +0 -155
- package/.hermes/plans/new-document-form-layout-rebuild-plan.md +0 -150
- package/.hermes/plans/new-document-fullwidth-3col-plan.md +0 -177
- package/.hermes/plans/picker-quick-options-range-mode.md +0 -143
- package/.hermes/plans/region-picker-mock-contract.md +0 -202
- package/.hermes/plans/zero-div-component-contracts.md +0 -466
- package/components.json +0 -19
- package/docs/DEVELOPMENT.md +0 -315
- package/docs/PRD.md +0 -170
- package/docs/ai-api-layering.md +0 -141
- package/docs/anchor-component-plan.md +0 -165
- package/docs/components-analysis.md +0 -2911
- package/docs/demo-scan-report.md +0 -142
- package/docs/editable-table-research.md +0 -8
- package/docs/form-panorama-plan.md +0 -141
- package/docs/lowcode-agent-component-registry.sample.json +0 -36364
- package/docs/tf-form-table-modification-plan.md +0 -503
- package/docs/token-compliance-audit-report.md +0 -542
- package/env.d.ts +0 -5
- package/eslint.config.js +0 -66
- package/packages/ui/__tests__/package-exports.test.ts +0 -23
- package/packages/ui/components/affix/README.md +0 -78
- package/packages/ui/components/affix/__tests__/affix.test.ts +0 -204
- package/packages/ui/components/affix/index.ts +0 -13
- package/packages/ui/components/affix/src/affix.vue +0 -216
- package/packages/ui/components/affix/src/types.ts +0 -47
- package/packages/ui/components/affix/styles/affix.css +0 -17
- package/packages/ui/components/ai-overlay/README.md +0 -180
- package/packages/ui/components/ai-overlay/__tests__/ai-action-menu.test.ts +0 -133
- package/packages/ui/components/ai-overlay/__tests__/ai-overlay.test.ts +0 -117
- package/packages/ui/components/ai-overlay/index.ts +0 -32
- package/packages/ui/components/ai-overlay/src/ai-action-menu-types.ts +0 -22
- package/packages/ui/components/ai-overlay/src/ai-action-menu.vue +0 -200
- package/packages/ui/components/ai-overlay/src/ai-overlay.vue +0 -329
- package/packages/ui/components/ai-overlay/src/types.ts +0 -84
- package/packages/ui/components/ai-overlay/styles/ai-overlay.css +0 -306
- package/packages/ui/components/ai-state-flow/README.md +0 -111
- package/packages/ui/components/ai-state-flow/__tests__/ai-state-flow.test.ts +0 -69
- package/packages/ui/components/ai-state-flow/ai-state-flow.ts +0 -16
- package/packages/ui/components/ai-state-flow/ai-state-flow.vue +0 -67
- package/packages/ui/components/ai-state-flow/index.ts +0 -24
- package/packages/ui/components/ai-state-flow/styles/ai-state-flow.css +0 -144
- package/packages/ui/components/alert/README.md +0 -83
- package/packages/ui/components/alert/__tests__/alert.test.ts +0 -155
- package/packages/ui/components/alert/index.ts +0 -13
- package/packages/ui/components/alert/src/alert.ts +0 -90
- package/packages/ui/components/alert/src/alert.vue +0 -87
- package/packages/ui/components/alert/styles/alert.css +0 -158
- package/packages/ui/components/anchor/README.md +0 -50
- package/packages/ui/components/anchor/__tests__/anchor.test.ts +0 -284
- package/packages/ui/components/anchor/index.ts +0 -13
- package/packages/ui/components/anchor/src/anchor.vue +0 -94
- package/packages/ui/components/anchor/src/types.ts +0 -55
- package/packages/ui/components/anchor/src/use-anchor.ts +0 -253
- package/packages/ui/components/anchor/styles/anchor.css +0 -90
- package/packages/ui/components/avatar/README.md +0 -118
- package/packages/ui/components/avatar/__tests__/avatar.test.ts +0 -83
- package/packages/ui/components/avatar/index.ts +0 -12
- package/packages/ui/components/avatar/src/avatar.ts +0 -62
- package/packages/ui/components/avatar/src/avatar.vue +0 -106
- package/packages/ui/components/back-top/README.md +0 -63
- package/packages/ui/components/back-top/__tests__/back-top.test.ts +0 -215
- package/packages/ui/components/back-top/index.ts +0 -13
- package/packages/ui/components/back-top/src/back-top.ts +0 -51
- package/packages/ui/components/back-top/src/back-top.vue +0 -104
- package/packages/ui/components/back-top/styles/back-top.css +0 -24
- package/packages/ui/components/badge/README.md +0 -71
- package/packages/ui/components/badge/__tests__/badge.test.ts +0 -142
- package/packages/ui/components/badge/index.ts +0 -13
- package/packages/ui/components/badge/src/badge.ts +0 -64
- package/packages/ui/components/badge/src/badge.vue +0 -76
- package/packages/ui/components/badge/styles/badge.css +0 -45
- package/packages/ui/components/batch-action-button/README.md +0 -68
- package/packages/ui/components/batch-action-button/__tests__/batch-action-button.test.ts +0 -30
- package/packages/ui/components/batch-action-button/index.ts +0 -11
- package/packages/ui/components/batch-action-button/src/batch-action-button.vue +0 -59
- package/packages/ui/components/batch-action-button/src/types.ts +0 -9
- package/packages/ui/components/breadcrumb/README.md +0 -115
- package/packages/ui/components/breadcrumb/__tests__/breadcrumb.test.ts +0 -168
- package/packages/ui/components/breadcrumb/index.ts +0 -13
- package/packages/ui/components/breadcrumb/src/breadcrumb.ts +0 -60
- package/packages/ui/components/breadcrumb/src/breadcrumb.vue +0 -86
- package/packages/ui/components/business/document/action-header/index.ts +0 -14
- package/packages/ui/components/business/document/action-header/src/context.ts +0 -10
- package/packages/ui/components/business/document/action-header/src/document-action-header.vue +0 -296
- package/packages/ui/components/business/document/action-header/src/types.ts +0 -100
- package/packages/ui/components/business/document/ai-toolbar/index.ts +0 -12
- package/packages/ui/components/business/document/ai-toolbar/src/document-ai-toolbar.vue +0 -72
- package/packages/ui/components/business/document/form-page/index.ts +0 -16
- package/packages/ui/components/business/document/form-page/src/composables/use-document-ai-toolbar.ts +0 -37
- package/packages/ui/components/business/document/form-page/src/composables/use-document-layout-mode.ts +0 -24
- package/packages/ui/components/business/document/form-page/src/composables/use-document-recognition.ts +0 -55
- package/packages/ui/components/business/document/form-page/src/composables/use-document-save.ts +0 -243
- package/packages/ui/components/business/document/form-page/src/composables/use-document-sections.ts +0 -234
- package/packages/ui/components/business/document/form-page/src/context.ts +0 -15
- package/packages/ui/components/business/document/form-page/src/document-form-page.vue +0 -251
- package/packages/ui/components/business/document/form-page/src/document-section-card.vue +0 -187
- package/packages/ui/components/business/document/form-page/src/types.ts +0 -245
- package/packages/ui/components/business/document/form-page/styles/document-form-page.css +0 -40
- package/packages/ui/components/business/enum-select/index.ts +0 -18
- package/packages/ui/components/business/enum-select/src/enum-select.vue +0 -171
- package/packages/ui/components/business/enum-select/src/types.ts +0 -33
- package/packages/ui/components/button/README.md +0 -155
- package/packages/ui/components/button/__tests__/button.test.ts +0 -261
- package/packages/ui/components/button/index.ts +0 -14
- package/packages/ui/components/button/src/button.ts +0 -168
- package/packages/ui/components/button/src/button.vue +0 -341
- package/packages/ui/components/button/styles/button.css +0 -149
- package/packages/ui/components/carousel/README.md +0 -48
- package/packages/ui/components/carousel/__tests__/carousel.test.ts +0 -82
- package/packages/ui/components/carousel/index.ts +0 -11
- package/packages/ui/components/carousel/src/carousel.ts +0 -38
- package/packages/ui/components/carousel/src/carousel.vue +0 -101
- package/packages/ui/components/carousel/styles/carousel.css +0 -40
- package/packages/ui/components/chart/README.md +0 -120
- package/packages/ui/components/chart/__tests__/chart.test.ts +0 -86
- package/packages/ui/components/chart/__tests__/simple-charts.test.ts +0 -130
- package/packages/ui/components/chart/index.ts +0 -22
- package/packages/ui/components/chart/src/bar-chart.vue +0 -83
- package/packages/ui/components/chart/src/chart.ts +0 -135
- package/packages/ui/components/chart/src/chart.vue +0 -147
- package/packages/ui/components/chart/src/donut-chart.vue +0 -96
- package/packages/ui/components/chart/src/line-chart.vue +0 -101
- package/packages/ui/components/chart/src/metric-grid.vue +0 -55
- package/packages/ui/components/chart/src/types.ts +0 -91
- package/packages/ui/components/chart/src/utils.ts +0 -68
- package/packages/ui/components/chart/styles/bar-chart.css +0 -134
- package/packages/ui/components/chart/styles/chart.css +0 -48
- package/packages/ui/components/chart/styles/donut-chart.css +0 -114
- package/packages/ui/components/chart/styles/line-chart.css +0 -61
- package/packages/ui/components/chart/styles/metric-grid.css +0 -115
- package/packages/ui/components/code-block/README.md +0 -56
- package/packages/ui/components/code-block/__tests__/code-block.test.ts +0 -166
- package/packages/ui/components/code-block/index.ts +0 -13
- package/packages/ui/components/code-block/src/code-block.vue +0 -216
- package/packages/ui/components/code-block/src/types.ts +0 -31
- package/packages/ui/components/code-block/styles/code-block.css +0 -192
- package/packages/ui/components/data-grid/CellRendererActions.vue +0 -77
- package/packages/ui/components/data-grid/CellRendererButton.vue +0 -51
- package/packages/ui/components/data-grid/CellRendererCsCheckbox.vue +0 -16
- package/packages/ui/components/data-grid/CellRendererCsInput.vue +0 -29
- package/packages/ui/components/data-grid/CellRendererCsSelect.vue +0 -19
- package/packages/ui/components/data-grid/CellRendererInput.vue +0 -120
- package/packages/ui/components/data-grid/CellRendererText.vue +0 -94
- package/packages/ui/components/data-grid/ColumnSettings.vue +0 -40
- package/packages/ui/components/data-grid/ColumnSettingsDialog.vue +0 -367
- package/packages/ui/components/data-grid/DataGrid.vue +0 -850
- package/packages/ui/components/data-grid/DataGridFilter.vue +0 -242
- package/packages/ui/components/data-grid/column-settings-api.ts +0 -62
- package/packages/ui/components/data-grid/index.ts +0 -29
- package/packages/ui/components/data-grid/props.ts +0 -246
- package/packages/ui/components/data-grid/variants.ts +0 -26
- package/packages/ui/components/divider/README.md +0 -84
- package/packages/ui/components/divider/__tests__/divider.test.ts +0 -105
- package/packages/ui/components/divider/index.ts +0 -13
- package/packages/ui/components/divider/src/divider.ts +0 -50
- package/packages/ui/components/divider/src/divider.vue +0 -76
- package/packages/ui/components/divider/styles/divider.css +0 -65
- package/packages/ui/components/drawer/README.md +0 -90
- package/packages/ui/components/drawer/__tests__/drawer.test.ts +0 -218
- package/packages/ui/components/drawer/index.ts +0 -13
- package/packages/ui/components/drawer/src/drawer.ts +0 -88
- package/packages/ui/components/drawer/src/drawer.vue +0 -157
- package/packages/ui/components/drawer/styles/drawer.css +0 -164
- package/packages/ui/components/dropdown/README.md +0 -51
- package/packages/ui/components/dropdown/__tests__/dropdown.test.ts +0 -143
- package/packages/ui/components/dropdown/index.ts +0 -11
- package/packages/ui/components/dropdown/src/dropdown.ts +0 -47
- package/packages/ui/components/dropdown/src/dropdown.vue +0 -75
- package/packages/ui/components/dropdown/styles/dropdown.css +0 -16
- package/packages/ui/components/dropdown-button/README.md +0 -78
- package/packages/ui/components/dropdown-button/__tests__/dropdown-button.test.ts +0 -75
- package/packages/ui/components/dropdown-button/index.ts +0 -11
- package/packages/ui/components/dropdown-button/src/dropdown-button-menu-items.vue +0 -79
- package/packages/ui/components/dropdown-button/src/dropdown-button.vue +0 -152
- package/packages/ui/components/dropdown-button/src/types.ts +0 -98
- package/packages/ui/components/dropdown-button/styles/dropdown-button.css +0 -171
- package/packages/ui/components/empty/README.md +0 -48
- package/packages/ui/components/empty/__tests__/empty.test.ts +0 -37
- package/packages/ui/components/empty/index.ts +0 -13
- package/packages/ui/components/empty/src/empty.vue +0 -73
- package/packages/ui/components/empty/src/types.ts +0 -32
- package/packages/ui/components/empty/styles/empty.css +0 -69
- package/packages/ui/components/error/README.md +0 -44
- package/packages/ui/components/error/__tests__/error.test.ts +0 -34
- package/packages/ui/components/error/index.ts +0 -13
- package/packages/ui/components/error/src/error.vue +0 -65
- package/packages/ui/components/error/src/types.ts +0 -28
- package/packages/ui/components/error/styles/error.css +0 -69
- package/packages/ui/components/filter-button/README.md +0 -68
- package/packages/ui/components/filter-button/__tests__/filter-button.test.ts +0 -30
- package/packages/ui/components/filter-button/index.ts +0 -11
- package/packages/ui/components/filter-button/src/filter-button.vue +0 -59
- package/packages/ui/components/filter-button/src/types.ts +0 -9
- package/packages/ui/components/form/README.md +0 -750
- package/packages/ui/components/form/__tests__/form-ai-registry-integration.test.ts +0 -214
- package/packages/ui/components/form/__tests__/form-field.test.ts +0 -377
- package/packages/ui/components/form/__tests__/form-item-ai-actions.test.ts +0 -299
- package/packages/ui/components/form/__tests__/form-item.test.ts +0 -110
- package/packages/ui/components/form/__tests__/form-wrapper-reject-forward.test.ts +0 -269
- package/packages/ui/components/form/__tests__/form.test.ts +0 -148
- package/packages/ui/components/form/base/cascader/README.md +0 -75
- package/packages/ui/components/form/base/cascader/__tests__/ai-capability.test.ts +0 -507
- package/packages/ui/components/form/base/cascader/__tests__/cascader.test.ts +0 -203
- package/packages/ui/components/form/base/cascader/index.ts +0 -14
- package/packages/ui/components/form/base/cascader/src/cascader.vue +0 -505
- package/packages/ui/components/form/base/cascader/src/types.ts +0 -168
- package/packages/ui/components/form/base/cascader/styles/cascader.css +0 -186
- package/packages/ui/components/form/base/checkbox/README.md +0 -110
- package/packages/ui/components/form/base/checkbox/__tests__/ai-capability.test.ts +0 -465
- package/packages/ui/components/form/base/checkbox/__tests__/checkbox.test.ts +0 -98
- package/packages/ui/components/form/base/checkbox/__tests__/group-integration.test.ts +0 -192
- package/packages/ui/components/form/base/checkbox/index.ts +0 -18
- package/packages/ui/components/form/base/checkbox/src/checkbox-group.vue +0 -311
- package/packages/ui/components/form/base/checkbox/src/checkbox.ts +0 -210
- package/packages/ui/components/form/base/checkbox/src/checkbox.vue +0 -368
- package/packages/ui/components/form/base/checkbox/styles/checkbox.css +0 -24
- package/packages/ui/components/form/base/data-picker/README.md +0 -192
- package/packages/ui/components/form/base/data-picker/__tests__/ai-capability.test.ts +0 -566
- package/packages/ui/components/form/base/data-picker/__tests__/data-picker.test.ts +0 -628
- package/packages/ui/components/form/base/data-picker/index.ts +0 -23
- package/packages/ui/components/form/base/data-picker/src/data-picker.ts +0 -192
- package/packages/ui/components/form/base/data-picker/src/data-picker.vue +0 -1267
- package/packages/ui/components/form/base/data-picker/styles/data-picker.css +0 -174
- package/packages/ui/components/form/base/date-picker/README.md +0 -94
- package/packages/ui/components/form/base/date-picker/__tests__/ai-capability.test.ts +0 -462
- package/packages/ui/components/form/base/date-picker/__tests__/date-picker.test.ts +0 -115
- package/packages/ui/components/form/base/date-picker/index.ts +0 -13
- package/packages/ui/components/form/base/date-picker/src/date-picker.ts +0 -212
- package/packages/ui/components/form/base/date-picker/src/date-picker.vue +0 -871
- package/packages/ui/components/form/base/date-picker/styles/date-picker.css +0 -210
- package/packages/ui/components/form/base/datetime-picker/README.md +0 -197
- package/packages/ui/components/form/base/datetime-picker/__tests__/ai-capability.test.ts +0 -368
- package/packages/ui/components/form/base/datetime-picker/__tests__/datetime-picker.test.ts +0 -445
- package/packages/ui/components/form/base/datetime-picker/index.ts +0 -13
- package/packages/ui/components/form/base/datetime-picker/src/datetime-picker.ts +0 -149
- package/packages/ui/components/form/base/datetime-picker/src/datetime-picker.vue +0 -1158
- package/packages/ui/components/form/base/datetime-picker/styles/datetime-picker.css +0 -570
- package/packages/ui/components/form/base/file-upload/README.md +0 -73
- package/packages/ui/components/form/base/file-upload/__tests__/ai-capability.test.ts +0 -223
- package/packages/ui/components/form/base/file-upload/__tests__/file-upload.spec.ts +0 -199
- package/packages/ui/components/form/base/file-upload/index.ts +0 -11
- package/packages/ui/components/form/base/file-upload/src/file-upload.ts +0 -95
- package/packages/ui/components/form/base/file-upload/src/file-upload.vue +0 -451
- package/packages/ui/components/form/base/file-upload/styles/file-upload.css +0 -57
- package/packages/ui/components/form/base/image-upload/README.md +0 -70
- package/packages/ui/components/form/base/image-upload/__tests__/ai-capability.test.ts +0 -149
- package/packages/ui/components/form/base/image-upload/__tests__/image-upload.spec.ts +0 -282
- package/packages/ui/components/form/base/image-upload/index.ts +0 -11
- package/packages/ui/components/form/base/image-upload/src/image-upload.ts +0 -76
- package/packages/ui/components/form/base/image-upload/src/image-upload.vue +0 -657
- package/packages/ui/components/form/base/index.ts +0 -24
- package/packages/ui/components/form/base/input/README.md +0 -63
- package/packages/ui/components/form/base/input/__tests__/ai-capability.test.ts +0 -143
- package/packages/ui/components/form/base/input/__tests__/input.test.ts +0 -195
- package/packages/ui/components/form/base/input/index.ts +0 -37
- package/packages/ui/components/form/base/input/src/input.ts +0 -104
- package/packages/ui/components/form/base/input/src/input.vue +0 -384
- package/packages/ui/components/form/base/input/styles/input.css +0 -198
- package/packages/ui/components/form/base/location-picker/README.md +0 -92
- package/packages/ui/components/form/base/location-picker/__tests__/ai-capability.test.ts +0 -147
- package/packages/ui/components/form/base/location-picker/__tests__/location-picker.test.ts +0 -161
- package/packages/ui/components/form/base/location-picker/index.ts +0 -13
- package/packages/ui/components/form/base/location-picker/src/location-picker.ts +0 -99
- package/packages/ui/components/form/base/location-picker/src/location-picker.vue +0 -558
- package/packages/ui/components/form/base/radio/README.md +0 -95
- package/packages/ui/components/form/base/radio/__tests__/ai-capability.test.ts +0 -578
- package/packages/ui/components/form/base/radio/__tests__/group-integration.test.ts +0 -191
- package/packages/ui/components/form/base/radio/__tests__/radio.test.ts +0 -64
- package/packages/ui/components/form/base/radio/index.ts +0 -18
- package/packages/ui/components/form/base/radio/src/radio-group.vue +0 -270
- package/packages/ui/components/form/base/radio/src/radio.ts +0 -154
- package/packages/ui/components/form/base/radio/src/radio.vue +0 -141
- package/packages/ui/components/form/base/radio/styles/radio.css +0 -12
- package/packages/ui/components/form/base/region-picker/README.md +0 -166
- package/packages/ui/components/form/base/region-picker/__tests__/ai-capability.test.ts +0 -147
- package/packages/ui/components/form/base/region-picker/__tests__/region-picker.spec.ts +0 -556
- package/packages/ui/components/form/base/region-picker/index.ts +0 -19
- package/packages/ui/components/form/base/region-picker/src/region-picker.ts +0 -333
- package/packages/ui/components/form/base/region-picker/src/region-picker.vue +0 -552
- package/packages/ui/components/form/base/select/README.md +0 -66
- package/packages/ui/components/form/base/select/__tests__/ai-capability.test.ts +0 -463
- package/packages/ui/components/form/base/select/__tests__/select.test.ts +0 -167
- package/packages/ui/components/form/base/select/index.ts +0 -15
- package/packages/ui/components/form/base/select/src/select.ts +0 -173
- package/packages/ui/components/form/base/select/src/select.vue +0 -534
- package/packages/ui/components/form/base/select/styles/select.css +0 -206
- package/packages/ui/components/form/base/signature/README.md +0 -96
- package/packages/ui/components/form/base/signature/__tests__/ai-capability.test.ts +0 -147
- package/packages/ui/components/form/base/signature/__tests__/signature.spec.ts +0 -156
- package/packages/ui/components/form/base/signature/index.ts +0 -14
- package/packages/ui/components/form/base/signature/src/signature.ts +0 -100
- package/packages/ui/components/form/base/signature/src/signature.vue +0 -871
- package/packages/ui/components/form/base/switch/README.md +0 -102
- package/packages/ui/components/form/base/switch/__tests__/ai-capability.test.ts +0 -545
- package/packages/ui/components/form/base/switch/__tests__/switch.test.ts +0 -105
- package/packages/ui/components/form/base/switch/index.ts +0 -12
- package/packages/ui/components/form/base/switch/src/switch.ts +0 -133
- package/packages/ui/components/form/base/switch/src/switch.vue +0 -385
- package/packages/ui/components/form/base/switch/styles/switch.css +0 -35
- package/packages/ui/components/form/base/text-area/README.md +0 -89
- package/packages/ui/components/form/base/text-area/__tests__/ai-capability.test.ts +0 -176
- package/packages/ui/components/form/base/text-area/__tests__/text-area.test.ts +0 -152
- package/packages/ui/components/form/base/text-area/index.ts +0 -37
- package/packages/ui/components/form/base/text-area/src/text-area.ts +0 -137
- package/packages/ui/components/form/base/text-area/src/text-area.vue +0 -405
- package/packages/ui/components/form/base/text-area/styles/text-area.css +0 -137
- package/packages/ui/components/form/base/time-picker/README.md +0 -75
- package/packages/ui/components/form/base/time-picker/__tests__/ai-capability.test.ts +0 -135
- package/packages/ui/components/form/base/time-picker/__tests__/time-picker.test.ts +0 -258
- package/packages/ui/components/form/base/time-picker/index.ts +0 -13
- package/packages/ui/components/form/base/time-picker/src/time-picker.ts +0 -141
- package/packages/ui/components/form/base/time-picker/src/time-picker.vue +0 -844
- package/packages/ui/components/form/base/time-picker/styles/time-picker.css +0 -124
- package/packages/ui/components/form/base/upload/README.md +0 -126
- package/packages/ui/components/form/base/upload/__tests__/ai-capability.test.ts +0 -145
- package/packages/ui/components/form/base/upload/__tests__/upload.spec.ts +0 -288
- package/packages/ui/components/form/base/upload/index.ts +0 -11
- package/packages/ui/components/form/base/upload/src/upload.ts +0 -171
- package/packages/ui/components/form/base/upload/src/upload.vue +0 -890
- package/packages/ui/components/form/base/upload/styles/upload.css +0 -116
- package/packages/ui/components/form/index.ts +0 -138
- package/packages/ui/components/form/items/form-array/README.md +0 -61
- package/packages/ui/components/form/items/form-array/__tests__/form-array.test.ts +0 -122
- package/packages/ui/components/form/items/form-array/index.ts +0 -2
- package/packages/ui/components/form/items/form-array/src/form-array.vue +0 -80
- package/packages/ui/components/form/items/form-array/src/types.ts +0 -27
- package/packages/ui/components/form/items/form-array/styles/form-array.css +0 -99
- package/packages/ui/components/form/items/form-cascader/README.md +0 -132
- package/packages/ui/components/form/items/form-cascader/__tests__/form-cascader.test.ts +0 -99
- package/packages/ui/components/form/items/form-cascader/index.ts +0 -1
- package/packages/ui/components/form/items/form-cascader/src/form-cascader.ts +0 -7
- package/packages/ui/components/form/items/form-cascader/src/form-cascader.vue +0 -15
- package/packages/ui/components/form/items/form-checkbox/README.md +0 -121
- package/packages/ui/components/form/items/form-checkbox/__tests__/form-checkbox.test.ts +0 -93
- package/packages/ui/components/form/items/form-checkbox/index.ts +0 -1
- package/packages/ui/components/form/items/form-checkbox/src/form-checkbox.ts +0 -7
- package/packages/ui/components/form/items/form-checkbox/src/form-checkbox.vue +0 -15
- package/packages/ui/components/form/items/form-data-picker/README.md +0 -111
- package/packages/ui/components/form/items/form-data-picker/__tests__/form-data-picker.test.ts +0 -98
- package/packages/ui/components/form/items/form-data-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-data-picker/src/form-data-picker.ts +0 -7
- package/packages/ui/components/form/items/form-data-picker/src/form-data-picker.vue +0 -17
- package/packages/ui/components/form/items/form-date-picker/README.md +0 -119
- package/packages/ui/components/form/items/form-date-picker/__tests__/form-date-picker.test.ts +0 -104
- package/packages/ui/components/form/items/form-date-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-date-picker/src/form-date-picker.ts +0 -7
- package/packages/ui/components/form/items/form-date-picker/src/form-date-picker.vue +0 -17
- package/packages/ui/components/form/items/form-datetime-picker/README.md +0 -112
- package/packages/ui/components/form/items/form-datetime-picker/__tests__/form-datetime-picker.test.ts +0 -105
- package/packages/ui/components/form/items/form-datetime-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-datetime-picker/src/form-datetime-picker.ts +0 -7
- package/packages/ui/components/form/items/form-datetime-picker/src/form-datetime-picker.vue +0 -17
- package/packages/ui/components/form/items/form-dynamic/README.md +0 -105
- package/packages/ui/components/form/items/form-dynamic/__tests__/form-dynamic.test.ts +0 -172
- package/packages/ui/components/form/items/form-dynamic/index.ts +0 -2
- package/packages/ui/components/form/items/form-dynamic/src/form-dynamic.vue +0 -222
- package/packages/ui/components/form/items/form-dynamic/src/types.ts +0 -63
- package/packages/ui/components/form/items/form-file-upload/README.md +0 -92
- package/packages/ui/components/form/items/form-file-upload/__tests__/form-file-upload.test.ts +0 -99
- package/packages/ui/components/form/items/form-file-upload/index.ts +0 -1
- package/packages/ui/components/form/items/form-file-upload/src/form-file-upload.ts +0 -7
- package/packages/ui/components/form/items/form-file-upload/src/form-file-upload.vue +0 -15
- package/packages/ui/components/form/items/form-group/README.md +0 -57
- package/packages/ui/components/form/items/form-group/__tests__/form-group.test.ts +0 -108
- package/packages/ui/components/form/items/form-group/index.ts +0 -2
- package/packages/ui/components/form/items/form-group/src/form-group.vue +0 -85
- package/packages/ui/components/form/items/form-group/src/types.ts +0 -37
- package/packages/ui/components/form/items/form-group/styles/form-group.css +0 -92
- package/packages/ui/components/form/items/form-image-upload/README.md +0 -92
- package/packages/ui/components/form/items/form-image-upload/__tests__/form-image-upload.test.ts +0 -109
- package/packages/ui/components/form/items/form-image-upload/index.ts +0 -1
- package/packages/ui/components/form/items/form-image-upload/src/form-image-upload.ts +0 -7
- package/packages/ui/components/form/items/form-image-upload/src/form-image-upload.vue +0 -37
- package/packages/ui/components/form/items/form-input/README.md +0 -110
- package/packages/ui/components/form/items/form-input/__tests__/form-input.test.ts +0 -87
- package/packages/ui/components/form/items/form-input/index.ts +0 -1
- package/packages/ui/components/form/items/form-input/src/form-input.ts +0 -7
- package/packages/ui/components/form/items/form-input/src/form-input.vue +0 -15
- package/packages/ui/components/form/items/form-location-picker/README.md +0 -119
- package/packages/ui/components/form/items/form-location-picker/__tests__/form-location-picker.test.ts +0 -98
- package/packages/ui/components/form/items/form-location-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-location-picker/src/form-location-picker.ts +0 -7
- package/packages/ui/components/form/items/form-location-picker/src/form-location-picker.vue +0 -15
- package/packages/ui/components/form/items/form-radio/README.md +0 -125
- package/packages/ui/components/form/items/form-radio/__tests__/form-radio.test.ts +0 -104
- package/packages/ui/components/form/items/form-radio/index.ts +0 -1
- package/packages/ui/components/form/items/form-radio/src/form-radio.ts +0 -7
- package/packages/ui/components/form/items/form-radio/src/form-radio.vue +0 -15
- package/packages/ui/components/form/items/form-region-picker/README.md +0 -111
- package/packages/ui/components/form/items/form-region-picker/__tests__/form-region-picker.test.ts +0 -95
- package/packages/ui/components/form/items/form-region-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-region-picker/src/form-region-picker.ts +0 -7
- package/packages/ui/components/form/items/form-region-picker/src/form-region-picker.vue +0 -15
- package/packages/ui/components/form/items/form-select/README.md +0 -117
- package/packages/ui/components/form/items/form-select/__tests__/form-select.test.ts +0 -80
- package/packages/ui/components/form/items/form-select/index.ts +0 -1
- package/packages/ui/components/form/items/form-select/src/form-select.ts +0 -7
- package/packages/ui/components/form/items/form-select/src/form-select.vue +0 -15
- package/packages/ui/components/form/items/form-signature/README.md +0 -89
- package/packages/ui/components/form/items/form-signature/__tests__/form-signature.test.ts +0 -109
- package/packages/ui/components/form/items/form-signature/index.ts +0 -1
- package/packages/ui/components/form/items/form-signature/src/form-signature.ts +0 -7
- package/packages/ui/components/form/items/form-signature/src/form-signature.vue +0 -15
- package/packages/ui/components/form/items/form-slider/README.md +0 -125
- package/packages/ui/components/form/items/form-slider/__tests__/form-slider.test.ts +0 -95
- package/packages/ui/components/form/items/form-slider/index.ts +0 -1
- package/packages/ui/components/form/items/form-slider/src/form-slider.ts +0 -7
- package/packages/ui/components/form/items/form-slider/src/form-slider.vue +0 -15
- package/packages/ui/components/form/items/form-subform/README.md +0 -71
- package/packages/ui/components/form/items/form-subform/__tests__/form-subform.test.ts +0 -116
- package/packages/ui/components/form/items/form-subform/index.ts +0 -2
- package/packages/ui/components/form/items/form-subform/src/form-subform.vue +0 -92
- package/packages/ui/components/form/items/form-subform/src/types.ts +0 -32
- package/packages/ui/components/form/items/form-subform/styles/form-subform.css +0 -127
- package/packages/ui/components/form/items/form-switch/README.md +0 -118
- package/packages/ui/components/form/items/form-switch/__tests__/form-switch.test.ts +0 -88
- package/packages/ui/components/form/items/form-switch/index.ts +0 -1
- package/packages/ui/components/form/items/form-switch/src/form-switch.ts +0 -7
- package/packages/ui/components/form/items/form-switch/src/form-switch.vue +0 -15
- package/packages/ui/components/form/items/form-table/OPTIMIZATION_REPORT.md +0 -205
- package/packages/ui/components/form/items/form-table/README.md +0 -144
- package/packages/ui/components/form/items/form-table/__tests__/form-table.test.ts +0 -373
- package/packages/ui/components/form/items/form-table/index.ts +0 -3
- package/packages/ui/components/form/items/form-table/src/column-filter-popover.vue +0 -149
- package/packages/ui/components/form/items/form-table/src/form-table.vue +0 -1315
- package/packages/ui/components/form/items/form-table/src/types.ts +0 -165
- package/packages/ui/components/form/items/form-table/styles/column-filter-popover.css +0 -138
- package/packages/ui/components/form/items/form-table/styles/form-table.css +0 -393
- package/packages/ui/components/form/items/form-textarea/README.md +0 -123
- package/packages/ui/components/form/items/form-textarea/__tests__/form-textarea.test.ts +0 -93
- package/packages/ui/components/form/items/form-textarea/index.ts +0 -1
- package/packages/ui/components/form/items/form-textarea/src/form-textarea.ts +0 -7
- package/packages/ui/components/form/items/form-textarea/src/form-textarea.vue +0 -15
- package/packages/ui/components/form/items/form-time-picker/README.md +0 -117
- package/packages/ui/components/form/items/form-time-picker/__tests__/form-time-picker.test.ts +0 -105
- package/packages/ui/components/form/items/form-time-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-time-picker/src/form-time-picker.ts +0 -7
- package/packages/ui/components/form/items/form-time-picker/src/form-time-picker.vue +0 -17
- package/packages/ui/components/form/items/form-upload/README.md +0 -92
- package/packages/ui/components/form/items/form-upload/__tests__/form-upload.test.ts +0 -137
- package/packages/ui/components/form/items/form-upload/index.ts +0 -1
- package/packages/ui/components/form/items/form-upload/src/form-upload.ts +0 -7
- package/packages/ui/components/form/items/form-upload/src/form-upload.vue +0 -15
- package/packages/ui/components/form/shared/types.ts +0 -82
- package/packages/ui/components/form/src/form-field.ts +0 -96
- package/packages/ui/components/form/src/form-field.vue +0 -404
- package/packages/ui/components/form/src/form-item.vue +0 -646
- package/packages/ui/components/form/src/form.ts +0 -11
- package/packages/ui/components/form/src/form.vue +0 -156
- package/packages/ui/components/form/src/types.ts +0 -337
- package/packages/ui/components/form/src/use-form-field.ts +0 -190
- package/packages/ui/components/form/styles/form-ai-actions.css +0 -41
- package/packages/ui/components/form/styles/form-field.css +0 -123
- package/packages/ui/components/form/styles/form-item-ai-status.css +0 -212
- package/packages/ui/components/form/styles/form-item.css +0 -218
- package/packages/ui/components/form/styles/form.css +0 -132
- package/packages/ui/components/form-ai-status/README.md +0 -86
- package/packages/ui/components/form-ai-status/__tests__/form-ai-status.test.ts +0 -183
- package/packages/ui/components/form-ai-status/index.ts +0 -12
- package/packages/ui/components/form-ai-status/src/form-ai-status.vue +0 -254
- package/packages/ui/components/form-ai-status/src/types.ts +0 -36
- package/packages/ui/components/form-ai-status/styles/form-ai-status.css +0 -238
- package/packages/ui/components/form-ai-toolbar/README.md +0 -100
- package/packages/ui/components/form-ai-toolbar/__tests__/form-ai-toolbar.test.ts +0 -344
- package/packages/ui/components/form-ai-toolbar/index.ts +0 -13
- package/packages/ui/components/form-ai-toolbar/src/form-ai-toolbar.vue +0 -598
- package/packages/ui/components/form-ai-toolbar/src/types.ts +0 -130
- package/packages/ui/components/form-ai-toolbar/styles/form-ai-toolbar.css +0 -281
- package/packages/ui/components/icon/README.md +0 -137
- package/packages/ui/components/icon/__tests__/icon.test.ts +0 -125
- package/packages/ui/components/icon/index.ts +0 -13
- package/packages/ui/components/icon/src/icon.ts +0 -67
- package/packages/ui/components/icon/src/icon.vue +0 -69
- package/packages/ui/components/icon/styles/icon.css +0 -41
- package/packages/ui/components/image-preview/README.md +0 -90
- package/packages/ui/components/image-preview/__tests__/image-preview.test.ts +0 -183
- package/packages/ui/components/image-preview/index.ts +0 -13
- package/packages/ui/components/image-preview/src/image-preview.vue +0 -71
- package/packages/ui/components/image-preview/src/index.ts +0 -11
- package/packages/ui/components/image-preview/src/preview-layer.vue +0 -90
- package/packages/ui/components/image-preview/src/types.ts +0 -63
- package/packages/ui/components/image-preview/styles/image-preview.css +0 -39
- package/packages/ui/components/layout/app-bar/README.md +0 -59
- package/packages/ui/components/layout/app-bar/__tests__/app-bar.test.ts +0 -124
- package/packages/ui/components/layout/app-bar/index.ts +0 -13
- package/packages/ui/components/layout/app-bar/src/app-bar.vue +0 -106
- package/packages/ui/components/layout/app-bar/src/types.ts +0 -43
- package/packages/ui/components/layout/app-bar/styles/app-bar.css +0 -175
- package/packages/ui/components/layout/card/README.md +0 -90
- package/packages/ui/components/layout/card/__tests__/card.test.ts +0 -321
- package/packages/ui/components/layout/card/index.ts +0 -13
- package/packages/ui/components/layout/card/src/card.vue +0 -210
- package/packages/ui/components/layout/card/src/types.ts +0 -79
- package/packages/ui/components/layout/card/styles/card.css +0 -334
- package/packages/ui/components/layout/container/README.md +0 -29
- package/packages/ui/components/layout/container/__tests__/container.test.ts +0 -74
- package/packages/ui/components/layout/container/index.ts +0 -13
- package/packages/ui/components/layout/container/src/container.vue +0 -35
- package/packages/ui/components/layout/container/src/types.ts +0 -15
- package/packages/ui/components/layout/container/styles/container.css +0 -50
- package/packages/ui/components/layout/detail-layout/README.md +0 -30
- package/packages/ui/components/layout/detail-layout/__tests__/detail-layout.test.ts +0 -75
- package/packages/ui/components/layout/detail-layout/index.ts +0 -13
- package/packages/ui/components/layout/detail-layout/src/detail-layout.vue +0 -53
- package/packages/ui/components/layout/detail-layout/src/types.ts +0 -22
- package/packages/ui/components/layout/detail-layout/styles/detail-layout.css +0 -71
- package/packages/ui/components/layout/form-layout/README.md +0 -59
- package/packages/ui/components/layout/form-layout/__tests__/form-layout.test.ts +0 -140
- package/packages/ui/components/layout/form-layout/index.ts +0 -13
- package/packages/ui/components/layout/form-layout/src/form-layout.vue +0 -93
- package/packages/ui/components/layout/form-layout/src/types.ts +0 -64
- package/packages/ui/components/layout/form-layout/styles/form-layout.css +0 -98
- package/packages/ui/components/layout/grid/README.md +0 -41
- package/packages/ui/components/layout/grid/__tests__/grid.test.ts +0 -77
- package/packages/ui/components/layout/grid/index.ts +0 -13
- package/packages/ui/components/layout/grid/src/grid.vue +0 -79
- package/packages/ui/components/layout/grid/src/types.ts +0 -44
- package/packages/ui/components/layout/grid/styles/grid.css +0 -46
- package/packages/ui/components/layout/hero/README.md +0 -59
- package/packages/ui/components/layout/hero/__tests__/hero.test.ts +0 -112
- package/packages/ui/components/layout/hero/index.ts +0 -13
- package/packages/ui/components/layout/hero/src/hero.vue +0 -143
- package/packages/ui/components/layout/hero/src/types.ts +0 -44
- package/packages/ui/components/layout/hero/styles/hero.css +0 -129
- package/packages/ui/components/layout/inline/README.md +0 -30
- package/packages/ui/components/layout/inline/__tests__/inline.test.ts +0 -154
- package/packages/ui/components/layout/inline/index.ts +0 -13
- package/packages/ui/components/layout/inline/src/inline.vue +0 -99
- package/packages/ui/components/layout/inline/src/types.ts +0 -23
- package/packages/ui/components/layout/inline/styles/inline.css +0 -150
- package/packages/ui/components/layout/master-detail/README.md +0 -36
- package/packages/ui/components/layout/master-detail/__tests__/master-detail.test.ts +0 -104
- package/packages/ui/components/layout/master-detail/index.ts +0 -13
- package/packages/ui/components/layout/master-detail/src/master-detail.vue +0 -72
- package/packages/ui/components/layout/master-detail/src/types.ts +0 -28
- package/packages/ui/components/layout/master-detail/styles/master-detail.css +0 -82
- package/packages/ui/components/layout/page/README.md +0 -35
- package/packages/ui/components/layout/page/__tests__/page.test.ts +0 -136
- package/packages/ui/components/layout/page/index.ts +0 -13
- package/packages/ui/components/layout/page/src/page.vue +0 -85
- package/packages/ui/components/layout/page/src/types.ts +0 -39
- package/packages/ui/components/layout/page/styles/page.css +0 -177
- package/packages/ui/components/layout/page-header/README.md +0 -39
- package/packages/ui/components/layout/page-header/__tests__/page-header.test.ts +0 -198
- package/packages/ui/components/layout/page-header/index.ts +0 -13
- package/packages/ui/components/layout/page-header/src/page-header.vue +0 -133
- package/packages/ui/components/layout/page-header/src/types.ts +0 -56
- package/packages/ui/components/layout/page-header/styles/page-header.css +0 -155
- package/packages/ui/components/layout/section/README.md +0 -40
- package/packages/ui/components/layout/section/__tests__/section.test.ts +0 -121
- package/packages/ui/components/layout/section/index.ts +0 -13
- package/packages/ui/components/layout/section/src/section.vue +0 -79
- package/packages/ui/components/layout/section/src/types.ts +0 -28
- package/packages/ui/components/layout/section/styles/section.css +0 -103
- package/packages/ui/components/layout/sidebar-layout/README.md +0 -60
- package/packages/ui/components/layout/sidebar-layout/__tests__/sidebar-layout.test.ts +0 -220
- package/packages/ui/components/layout/sidebar-layout/index.ts +0 -13
- package/packages/ui/components/layout/sidebar-layout/src/sidebar-layout.vue +0 -113
- package/packages/ui/components/layout/sidebar-layout/src/types.ts +0 -54
- package/packages/ui/components/layout/sidebar-layout/styles/sidebar-layout.css +0 -211
- package/packages/ui/components/layout/split/README.md +0 -40
- package/packages/ui/components/layout/split/__tests__/split.test.ts +0 -99
- package/packages/ui/components/layout/split/index.ts +0 -13
- package/packages/ui/components/layout/split/src/split.vue +0 -65
- package/packages/ui/components/layout/split/src/types.ts +0 -49
- package/packages/ui/components/layout/split/styles/split.css +0 -40
- package/packages/ui/components/layout/stack/README.md +0 -29
- package/packages/ui/components/layout/stack/__tests__/stack.test.ts +0 -66
- package/packages/ui/components/layout/stack/index.ts +0 -13
- package/packages/ui/components/layout/stack/src/stack.vue +0 -31
- package/packages/ui/components/layout/stack/src/types.ts +0 -14
- package/packages/ui/components/layout/stack/styles/stack.css +0 -61
- package/packages/ui/components/layout/state-container/README.md +0 -45
- package/packages/ui/components/layout/state-container/__tests__/state-container.test.ts +0 -123
- package/packages/ui/components/layout/state-container/index.ts +0 -13
- package/packages/ui/components/layout/state-container/src/state-container.vue +0 -72
- package/packages/ui/components/layout/state-container/src/types.ts +0 -46
- package/packages/ui/components/layout/state-container/styles/state-container.css +0 -71
- package/packages/ui/components/layout/toolbar/README.md +0 -34
- package/packages/ui/components/layout/toolbar/__tests__/toolbar.test.ts +0 -90
- package/packages/ui/components/layout/toolbar/index.ts +0 -13
- package/packages/ui/components/layout/toolbar/src/toolbar.vue +0 -50
- package/packages/ui/components/layout/toolbar/src/types.ts +0 -19
- package/packages/ui/components/layout/toolbar/styles/toolbar.css +0 -80
- package/packages/ui/components/loading/README.md +0 -39
- package/packages/ui/components/loading/__tests__/loading.test.ts +0 -37
- package/packages/ui/components/loading/index.ts +0 -13
- package/packages/ui/components/loading/src/loading.vue +0 -59
- package/packages/ui/components/loading/src/types.ts +0 -27
- package/packages/ui/components/loading/styles/loading.css +0 -59
- package/packages/ui/components/menu/README.md +0 -51
- package/packages/ui/components/menu/__tests__/menu.test.ts +0 -80
- package/packages/ui/components/menu/index.ts +0 -11
- package/packages/ui/components/menu/src/menu.ts +0 -49
- package/packages/ui/components/menu/src/menu.vue +0 -103
- package/packages/ui/components/menu/styles/menu.css +0 -19
- package/packages/ui/components/message/README.md +0 -69
- package/packages/ui/components/message/__tests__/message.test.ts +0 -98
- package/packages/ui/components/message/index.ts +0 -13
- package/packages/ui/components/message/src/message.ts +0 -87
- package/packages/ui/components/message/src/message.vue +0 -88
- package/packages/ui/components/message/styles/message.css +0 -70
- package/packages/ui/components/metric/README.md +0 -63
- package/packages/ui/components/metric/__tests__/metric.test.ts +0 -166
- package/packages/ui/components/metric/index.ts +0 -13
- package/packages/ui/components/metric/src/metric.vue +0 -107
- package/packages/ui/components/metric/src/types.ts +0 -50
- package/packages/ui/components/metric/styles/metric.css +0 -233
- package/packages/ui/components/modal/README.md +0 -91
- package/packages/ui/components/modal/__tests__/modal.test.ts +0 -145
- package/packages/ui/components/modal/index.ts +0 -13
- package/packages/ui/components/modal/src/modal.ts +0 -153
- package/packages/ui/components/modal/src/modal.vue +0 -234
- package/packages/ui/components/modal/styles/modal.css +0 -104
- package/packages/ui/components/more-action-button/README.md +0 -68
- package/packages/ui/components/more-action-button/__tests__/more-action-button.test.ts +0 -30
- package/packages/ui/components/more-action-button/index.ts +0 -11
- package/packages/ui/components/more-action-button/src/more-action-button.vue +0 -59
- package/packages/ui/components/more-action-button/src/types.ts +0 -9
- package/packages/ui/components/navigation/side-nav/README.md +0 -59
- package/packages/ui/components/navigation/side-nav/__tests__/side-nav.test.ts +0 -105
- package/packages/ui/components/navigation/side-nav/index.ts +0 -13
- package/packages/ui/components/navigation/side-nav/src/side-nav.vue +0 -147
- package/packages/ui/components/navigation/side-nav/src/types.ts +0 -50
- package/packages/ui/components/navigation/side-nav/styles/side-nav.css +0 -171
- package/packages/ui/components/notification/README.md +0 -82
- package/packages/ui/components/notification/__tests__/notification.test.ts +0 -150
- package/packages/ui/components/notification/index.ts +0 -30
- package/packages/ui/components/notification/src/notification.vue +0 -114
- package/packages/ui/components/notification/src/types.ts +0 -67
- package/packages/ui/components/notification/src/use-notification.ts +0 -136
- package/packages/ui/components/notification/styles/notification.css +0 -4
- package/packages/ui/components/pagination/README.md +0 -82
- package/packages/ui/components/pagination/__tests__/pagination.test.ts +0 -210
- package/packages/ui/components/pagination/index.ts +0 -13
- package/packages/ui/components/pagination/src/pagination.ts +0 -86
- package/packages/ui/components/pagination/src/pagination.vue +0 -270
- package/packages/ui/components/pagination/styles/pagination.css +0 -143
- package/packages/ui/components/progress/README.md +0 -132
- package/packages/ui/components/progress/__tests__/progress.test.ts +0 -81
- package/packages/ui/components/progress/index.ts +0 -12
- package/packages/ui/components/progress/src/progress.ts +0 -80
- package/packages/ui/components/progress/src/progress.vue +0 -202
- package/packages/ui/components/skeleton/README.md +0 -71
- package/packages/ui/components/skeleton/__tests__/skeleton.test.ts +0 -138
- package/packages/ui/components/skeleton/index.ts +0 -13
- package/packages/ui/components/skeleton/src/skeleton.ts +0 -46
- package/packages/ui/components/skeleton/src/skeleton.vue +0 -67
- package/packages/ui/components/skeleton/styles/skeleton.css +0 -75
- package/packages/ui/components/slider/README.md +0 -87
- package/packages/ui/components/slider/__tests__/ai-capability.test.ts +0 -469
- package/packages/ui/components/slider/__tests__/slider.test.ts +0 -235
- package/packages/ui/components/slider/index.ts +0 -26
- package/packages/ui/components/slider/src/slider.ts +0 -192
- package/packages/ui/components/slider/src/slider.vue +0 -504
- package/packages/ui/components/slider/src/use-slider.ts +0 -399
- package/packages/ui/components/slider/styles/slider.css +0 -344
- package/packages/ui/components/split-button/README.md +0 -71
- package/packages/ui/components/split-button/__tests__/split-button.test.ts +0 -32
- package/packages/ui/components/split-button/index.ts +0 -11
- package/packages/ui/components/split-button/src/split-button.vue +0 -69
- package/packages/ui/components/split-button/src/types.ts +0 -34
- package/packages/ui/components/split-button/styles/split-button.css +0 -15
- package/packages/ui/components/status-dot/README.md +0 -42
- package/packages/ui/components/status-dot/__tests__/status-dot.test.ts +0 -53
- package/packages/ui/components/status-dot/index.ts +0 -13
- package/packages/ui/components/status-dot/src/status-dot.vue +0 -39
- package/packages/ui/components/status-dot/src/types.ts +0 -23
- package/packages/ui/components/status-dot/styles/status-dot.css +0 -65
- package/packages/ui/components/steps/README.md +0 -101
- package/packages/ui/components/steps/__tests__/steps.test.ts +0 -261
- package/packages/ui/components/steps/index.ts +0 -15
- package/packages/ui/components/steps/src/step.vue +0 -99
- package/packages/ui/components/steps/src/steps.ts +0 -93
- package/packages/ui/components/steps/src/steps.vue +0 -143
- package/packages/ui/components/steps/styles/step.css +0 -116
- package/packages/ui/components/steps/styles/steps.css +0 -200
- package/packages/ui/components/table/README.md +0 -81
- package/packages/ui/components/table/__tests__/table.test.ts +0 -162
- package/packages/ui/components/table/index.ts +0 -13
- package/packages/ui/components/table/src/table.ts +0 -195
- package/packages/ui/components/table/src/table.vue +0 -453
- package/packages/ui/components/table/styles/table.css +0 -88
- package/packages/ui/components/tabs/README.md +0 -88
- package/packages/ui/components/tabs/__tests__/tabs.test.ts +0 -161
- package/packages/ui/components/tabs/index.ts +0 -19
- package/packages/ui/components/tabs/src/tab-pane.ts +0 -18
- package/packages/ui/components/tabs/src/tab-pane.vue +0 -11
- package/packages/ui/components/tabs/src/tabs-content.vue +0 -58
- package/packages/ui/components/tabs/src/tabs-list.vue +0 -36
- package/packages/ui/components/tabs/src/tabs-trigger.vue +0 -70
- package/packages/ui/components/tabs/src/tabs.ts +0 -94
- package/packages/ui/components/tabs/src/tabs.vue +0 -101
- package/packages/ui/components/tabs/src/types.ts +0 -126
- package/packages/ui/components/tabs/styles/tabs.css +0 -239
- package/packages/ui/components/tag/README.md +0 -67
- package/packages/ui/components/tag/__tests__/tag.test.ts +0 -222
- package/packages/ui/components/tag/index.ts +0 -13
- package/packages/ui/components/tag/src/tag.ts +0 -87
- package/packages/ui/components/tag/src/tag.vue +0 -163
- package/packages/ui/components/tag/styles/tag.css +0 -47
- package/packages/ui/components/timeline/README.md +0 -80
- package/packages/ui/components/timeline/__tests__/timeline.test.ts +0 -78
- package/packages/ui/components/timeline/index.ts +0 -15
- package/packages/ui/components/timeline/src/timeline-item.vue +0 -38
- package/packages/ui/components/timeline/src/timeline.ts +0 -76
- package/packages/ui/components/timeline/src/timeline.vue +0 -30
- package/packages/ui/components/timeline/styles/timeline-item.css +0 -49
- package/packages/ui/components/timeline/styles/timeline.css +0 -43
- package/packages/ui/components/tooltip/README.md +0 -134
- package/packages/ui/components/tooltip/__tests__/tooltip.test.ts +0 -125
- package/packages/ui/components/tooltip/index.ts +0 -12
- package/packages/ui/components/tooltip/src/tooltip.ts +0 -66
- package/packages/ui/components/tooltip/src/tooltip.vue +0 -189
- package/packages/ui/components/tree/README.md +0 -54
- package/packages/ui/components/tree/__tests__/tree.test.ts +0 -80
- package/packages/ui/components/tree/index.ts +0 -11
- package/packages/ui/components/tree/src/tree.ts +0 -51
- package/packages/ui/components/tree/src/tree.vue +0 -242
- package/packages/ui/components/tree/styles/tree.css +0 -31
- package/packages/ui/components/typography/README.md +0 -120
- package/packages/ui/components/typography/__tests__/typography.test.ts +0 -164
- package/packages/ui/components/typography/index.ts +0 -13
- package/packages/ui/components/typography/src/typography.ts +0 -95
- package/packages/ui/components/typography/src/typography.vue +0 -94
- package/packages/ui/components/typography/styles/typography.css +0 -47
- package/packages/ui/components/upload/README.md +0 -103
- package/packages/ui/components/upload/__tests__/upload.test.ts +0 -181
- package/packages/ui/components/upload/index.ts +0 -11
- package/packages/ui/components/upload/src/upload.ts +0 -92
- package/packages/ui/components/upload/src/upload.vue +0 -382
- package/packages/ui/components/upload/styles/upload.css +0 -283
- package/packages/ui/components/watermark/README.md +0 -94
- package/packages/ui/components/watermark/__tests__/watermark.test.ts +0 -252
- package/packages/ui/components/watermark/index.ts +0 -13
- package/packages/ui/components/watermark/src/index.ts +0 -13
- package/packages/ui/components/watermark/src/types.ts +0 -86
- package/packages/ui/components/watermark/src/use-watermark.ts +0 -132
- package/packages/ui/components/watermark/src/watermark.vue +0 -181
- package/packages/ui/components/watermark/styles/watermark.css +0 -27
- package/packages/ui/index.ts +0 -338
- package/packages/ui/lib/utils.ts +0 -6
- package/packages/ui/lowcode-agent/icons.ts +0 -148
- package/packages/ui/lowcode-agent/registry.json +0 -37004
- package/packages/ui/src/composables/__tests__/use-floating-popup.test.ts +0 -275
- package/packages/ui/src/composables/__tests__/use-form-ai-actions.test.ts +0 -101
- package/packages/ui/src/composables/__tests__/use-form-ai-registry.test.ts +0 -92
- package/packages/ui/src/composables/__tests__/use-form-ai.test.ts +0 -116
- package/packages/ui/src/composables/index.ts +0 -10
- package/packages/ui/src/composables/use-ai-state-machine.ts +0 -142
- package/packages/ui/src/composables/use-floating-popup.ts +0 -237
- package/packages/ui/src/composables/use-form-ai-registry.ts +0 -198
- package/packages/ui/src/composables/use-form-ai.ts +0 -280
- package/packages/ui/src/composables/useLightbox.ts +0 -51
- package/packages/ui/src/request/document.ts +0 -53
- package/packages/ui/src/request/enum.ts +0 -18
- package/packages/ui/src/request/index.ts +0 -4
- package/packages/ui/src/request/request.ts +0 -200
- package/packages/ui/src/request/types.ts +0 -27
- package/packages/ui/src/types/form-ai-registry.ts +0 -70
- package/packages/ui/src/types/form-ai.ts +0 -84
- package/packages/ui/src/utils/date-format.ts +0 -60
- package/packages/ui/styles/design-tokens.css +0 -383
- package/packages/ui/styles/tailwind.css +0 -76
- package/packages/ui/styles/tokens.css +0 -7
- package/playground/index.html +0 -12
- package/playground/postcss.config.cjs +0 -5
- package/playground/src/App.vue +0 -3
- package/playground/src/__tests__/__debug-input.test.ts +0 -29
- package/playground/src/__tests__/button-ai-confirm.test.ts +0 -41
- package/playground/src/__tests__/home-render.test.ts +0 -87
- package/playground/src/__tests__/icon-library.test.ts +0 -107
- package/playground/src/__tests__/input-ai-confirm.test.ts +0 -113
- package/playground/src/__tests__/textarea-ai-button.test.ts +0 -87
- package/playground/src/__tests__/textarea-wordlimit.test.ts +0 -66
- package/playground/src/chart-theme.ts +0 -22
- package/playground/src/components/AiStateFlow.vue +0 -59
- package/playground/src/components/ComponentShowcase.vue +0 -180
- package/playground/src/composables/useAiStateMachine.ts +0 -111
- package/playground/src/data/component-api.ts +0 -187
- package/playground/src/data/component-meta.ts +0 -84
- package/playground/src/layouts/DefaultLayout.vue +0 -318
- package/playground/src/main.ts +0 -18
- package/playground/src/router/index.ts +0 -101
- package/playground/src/views/AffixDemo.vue +0 -133
- package/playground/src/views/AiStateFlowDemo.vue +0 -170
- package/playground/src/views/AlertDemo.vue +0 -554
- package/playground/src/views/AnchorDemo.vue +0 -150
- package/playground/src/views/AppBarDemo.vue +0 -722
- package/playground/src/views/AvatarDemo.vue +0 -266
- package/playground/src/views/BackTopDemo.vue +0 -71
- package/playground/src/views/BadgeDemo.vue +0 -109
- package/playground/src/views/BatchActionButtonDemo.vue +0 -65
- package/playground/src/views/BreadcrumbDemo.vue +0 -248
- package/playground/src/views/ButtonDemo.vue +0 -344
- package/playground/src/views/CardDemo.vue +0 -254
- package/playground/src/views/CarouselDemo.vue +0 -158
- package/playground/src/views/CascaderDemo.vue +0 -425
- package/playground/src/views/ChartDemo.vue +0 -232
- package/playground/src/views/CheckboxDemo.vue +0 -339
- package/playground/src/views/DataGridDemo.vue +0 -518
- package/playground/src/views/DataPickerDemo.vue +0 -240
- package/playground/src/views/DatePickerDemo.vue +0 -292
- package/playground/src/views/DateTimePickerDemo.vue +0 -208
- package/playground/src/views/DesignSpecDemo.vue +0 -1647
- package/playground/src/views/DividerDemo.vue +0 -77
- package/playground/src/views/DocumentActionHeaderDemo.vue +0 -113
- package/playground/src/views/DocumentFormPageDemo.vue +0 -200
- package/playground/src/views/DrawerDemo.vue +0 -166
- package/playground/src/views/DropdownButtonDemo.vue +0 -74
- package/playground/src/views/DropdownDemo.vue +0 -306
- package/playground/src/views/EmptyDemo.vue +0 -104
- package/playground/src/views/ErrorDemo.vue +0 -111
- package/playground/src/views/FileUploadDemo.vue +0 -241
- package/playground/src/views/FilterButtonDemo.vue +0 -65
- package/playground/src/views/FormFieldAiDemo.vue +0 -364
- package/playground/src/views/FormFieldBasicDemo.vue +0 -174
- package/playground/src/views/FormFieldBusinessDemo.vue +0 -245
- package/playground/src/views/FormFieldDemo.vue +0 -178
- package/playground/src/views/FormFieldLayoutDemo.vue +0 -183
- package/playground/src/views/FormFieldValidationDemo.vue +0 -163
- package/playground/src/views/FormItemAiDemo.vue +0 -371
- package/playground/src/views/FormSelectDemo.vue +0 -519
- package/playground/src/views/FormUploadDemo.vue +0 -536
- package/playground/src/views/HeroDemo.vue +0 -836
- package/playground/src/views/Home.vue +0 -213
- package/playground/src/views/IconDemo.vue +0 -186
- package/playground/src/views/IconLibraryView.vue +0 -370
- package/playground/src/views/IconRenderTest.vue +0 -86
- package/playground/src/views/ImagePreviewDemo.vue +0 -368
- package/playground/src/views/ImageUploadDemo.vue +0 -199
- package/playground/src/views/InputDemo.vue +0 -348
- package/playground/src/views/LayoutDemo.vue +0 -946
- package/playground/src/views/LoadingDemo.vue +0 -95
- package/playground/src/views/LocationPickerDemo.vue +0 -218
- package/playground/src/views/MenuDemo.vue +0 -283
- package/playground/src/views/MessageDemo.vue +0 -201
- package/playground/src/views/MetricDemo.vue +0 -535
- package/playground/src/views/ModalDemo.vue +0 -291
- package/playground/src/views/MoreActionButtonDemo.vue +0 -65
- package/playground/src/views/NewDocumentDemo.vue +0 -973
- package/playground/src/views/NotificationDemo.vue +0 -255
- package/playground/src/views/PaginationDemo.vue +0 -292
- package/playground/src/views/ProgressDemo.vue +0 -356
- package/playground/src/views/RadioDemo.vue +0 -414
- package/playground/src/views/RegionPickerDemo.vue +0 -249
- package/playground/src/views/ScalingRulesDemo.vue +0 -333
- package/playground/src/views/SelectDemo.vue +0 -453
- package/playground/src/views/SideNavDemo.vue +0 -769
- package/playground/src/views/SignatureDemo.vue +0 -205
- package/playground/src/views/SkeletonDemo.vue +0 -109
- package/playground/src/views/SliderDemo.vue +0 -312
- package/playground/src/views/SplitButtonDemo.vue +0 -65
- package/playground/src/views/StatusDotDemo.vue +0 -131
- package/playground/src/views/StepsDemo.vue +0 -587
- package/playground/src/views/SwitchDemo.vue +0 -442
- package/playground/src/views/TableDemo.vue +0 -438
- package/playground/src/views/TabsDemo.vue +0 -246
- package/playground/src/views/TagDemo.vue +0 -113
- package/playground/src/views/TextAreaDemo.vue +0 -317
- package/playground/src/views/TimePickerDemo.vue +0 -291
- package/playground/src/views/TimelineDemo.vue +0 -133
- package/playground/src/views/TooltipDemo.vue +0 -102
- package/playground/src/views/TreeDemo.vue +0 -521
- package/playground/src/views/TypographyDemo.vue +0 -175
- package/playground/src/views/UploadDemo.vue +0 -331
- package/playground/src/views/WatermarkDemo.vue +0 -112
- package/playground/src/views/_mocks/new-document.mock.ts +0 -506
- package/playground/src/views/data/form-field-events-table.ts +0 -243
- package/playground/src/views/data/form-field-options.ts +0 -77
- package/playground/src/views/data/form-field-props-table.ts +0 -227
- package/playground/src/views/data/form-field-snippets.ts +0 -149
- package/playground/src/views/data/slider-snippets.ts +0 -100
- package/playground/src/views/inner/FormFieldEventsDoc.vue +0 -147
- package/playground/src/views/inner/FormFieldPropsDoc.vue +0 -138
- package/playground/vite.config.ts +0 -25
- package/pnpm-workspace.yaml +0 -3
- package/postcss.config.cjs +0 -5
- package/scripts/check-design-token-compliance.mjs +0 -223
- package/scripts/generate-package-dts.mjs +0 -105
- package/tsconfig.json +0 -35
- package/tsconfig.node.json +0 -13
- package/vite.config.ts +0 -68
|
@@ -1,646 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, inject, ref, watch, onUnmounted, toRef, type Component } from 'vue'
|
|
3
|
-
import type { CSSProperties } from 'vue'
|
|
4
|
-
import { Sparkles, AlertTriangle, AlertCircle, Check, X } from 'lucide-vue-next'
|
|
5
|
-
import type { FormItemWrapperProps } from './types'
|
|
6
|
-
import TfAiOverlay from '../../ai-overlay/src/ai-overlay.vue'
|
|
7
|
-
import TfAiActionMenu from '../../ai-overlay/src/ai-action-menu.vue'
|
|
8
|
-
import { useFormAiActions } from '../../../src/composables/use-form-ai'
|
|
9
|
-
import {
|
|
10
|
-
AI_FIELD_STATUS_COLOR,
|
|
11
|
-
type AiAction,
|
|
12
|
-
type AiActionContext,
|
|
13
|
-
type AiActionResult,
|
|
14
|
-
type AiFieldStatus
|
|
15
|
-
} from '../../../src/types/form-ai'
|
|
16
|
-
import { AI_REGISTRY_KEY, type FormAiRegistry } from '../../../src/types/form-ai-registry'
|
|
17
|
-
|
|
18
|
-
const props = withDefaults(defineProps<FormItemWrapperProps>(), {
|
|
19
|
-
required: false,
|
|
20
|
-
aiBadge: false,
|
|
21
|
-
size: 'md',
|
|
22
|
-
ai: false,
|
|
23
|
-
aiPlacement: 'bottom-start',
|
|
24
|
-
aiNeedConfirm: true,
|
|
25
|
-
aiMockDuration: 1200
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
defineSlots<{
|
|
29
|
-
default?: (_: any) => any
|
|
30
|
-
label?: (_: any) => any
|
|
31
|
-
error?: (_: any) => any
|
|
32
|
-
}>()
|
|
33
|
-
|
|
34
|
-
const emit = defineEmits<{
|
|
35
|
-
'update:modelValue': [value: any]
|
|
36
|
-
'ai-apply': [value: any]
|
|
37
|
-
'ai-state-change': [payload: { state: string; result: any; error: string | null }]
|
|
38
|
-
'ai-status-change': [status: AiFieldStatus]
|
|
39
|
-
}>()
|
|
40
|
-
|
|
41
|
-
// 注入父级表单
|
|
42
|
-
const formContext = inject('tfForm', null) as any
|
|
43
|
-
|
|
44
|
-
// 注入父级 TfFormLayout 上下文
|
|
45
|
-
const formLayoutCtx = inject<any>('tfFormLayoutContext', null)
|
|
46
|
-
|
|
47
|
-
// 注入 form 级 AI 注册表(批 5)—— 独立用法时为 null,不报错
|
|
48
|
-
const aiRegistry = inject<FormAiRegistry | null>(AI_REGISTRY_KEY, null)
|
|
49
|
-
|
|
50
|
-
// 布局模式
|
|
51
|
-
const itemLayout = computed<'vertical' | 'horizontal'>(() => {
|
|
52
|
-
if (props.layout) return props.layout
|
|
53
|
-
const ctxLayout = formContext?.layout?.value
|
|
54
|
-
if (ctxLayout === 'horizontal' || ctxLayout === 'inline') return 'horizontal'
|
|
55
|
-
return 'vertical'
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
const layout = itemLayout
|
|
59
|
-
|
|
60
|
-
// 标签宽度
|
|
61
|
-
const labelWidth = computed(() => {
|
|
62
|
-
if (layout.value === 'horizontal') {
|
|
63
|
-
return props.labelWidth || (formContext?.labelWidth?.value || '100px')
|
|
64
|
-
}
|
|
65
|
-
return 'auto'
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
// 标签对齐
|
|
69
|
-
const labelAlign = computed(() => {
|
|
70
|
-
if (layout.value === 'horizontal') {
|
|
71
|
-
return formContext?.labelAlign?.value || 'right'
|
|
72
|
-
}
|
|
73
|
-
return 'left'
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
// 标签字体尺寸
|
|
77
|
-
const labelFontSizes: Record<string, string> = {
|
|
78
|
-
sm: 'var(--tf-font-size-xs)',
|
|
79
|
-
md: 'var(--tf-font-size-sm)',
|
|
80
|
-
lg: 'var(--tf-font-size-md)'
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// 是否显示冒号
|
|
84
|
-
const showColon = computed(() => formContext?.colon?.value || false)
|
|
85
|
-
|
|
86
|
-
// 错误信息
|
|
87
|
-
const fieldError = computed(() => {
|
|
88
|
-
if (props.error) return props.error
|
|
89
|
-
if (props.prop && formContext?.errors?.value?.[props.prop]) {
|
|
90
|
-
return formContext.errors.value[props.prop][0]
|
|
91
|
-
}
|
|
92
|
-
return ''
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
// span CSS 变量
|
|
96
|
-
const spanStyle = computed<CSSProperties & Record<string, string | number | undefined>>(() => {
|
|
97
|
-
const span = props.span
|
|
98
|
-
if (span === undefined) return {} as any
|
|
99
|
-
const ctxCols = formLayoutCtx?.columnsByBreakpoint?.value
|
|
100
|
-
const resolve = (s: number | 'full' | undefined, breakpoint: 'base' | 'sm' | 'md' | 'lg' | 'xl'): number | undefined => {
|
|
101
|
-
if (s === undefined) return undefined
|
|
102
|
-
if (s === 'full') {
|
|
103
|
-
const cols = ctxCols
|
|
104
|
-
return (cols?.[breakpoint] ?? cols?.base ?? 1) as number
|
|
105
|
-
}
|
|
106
|
-
return typeof s === 'number' ? s : 1
|
|
107
|
-
}
|
|
108
|
-
const style: Record<string, string | number | undefined> = {}
|
|
109
|
-
if (typeof span === 'number' || span === 'full') {
|
|
110
|
-
const v = resolve(span, 'base')
|
|
111
|
-
if (v !== undefined) style['--tf-form-item-span-base'] = v
|
|
112
|
-
return style as any
|
|
113
|
-
}
|
|
114
|
-
const baseV = resolve(span.base ?? 1, 'base')
|
|
115
|
-
if (baseV !== undefined) style['--tf-form-item-span-base'] = baseV
|
|
116
|
-
if (span.sm !== undefined) style['--tf-form-item-span-sm'] = resolve(span.sm, 'sm')
|
|
117
|
-
if (span.md !== undefined) style['--tf-form-item-span-md'] = resolve(span.md, 'md')
|
|
118
|
-
if (span.lg !== undefined) style['--tf-form-item-span-lg'] = resolve(span.lg, 'lg')
|
|
119
|
-
if (span.xl !== undefined) style['--tf-form-item-span-xl'] = resolve(span.xl, 'xl')
|
|
120
|
-
return style as any
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
// 合并布局 + span 的 inline style
|
|
124
|
-
const itemStyle = computed<CSSProperties & Record<string, string | number | undefined>>(() => {
|
|
125
|
-
const base: Record<string, string | number | undefined> = {
|
|
126
|
-
display: 'flex',
|
|
127
|
-
flexDirection: itemLayout.value === 'vertical' ? 'column' : 'row',
|
|
128
|
-
alignItems: itemLayout.value === 'vertical' ? 'stretch' : 'flex-start',
|
|
129
|
-
gap: itemLayout.value === 'vertical' ? '0' : undefined,
|
|
130
|
-
gridTemplateColumns: 'none'
|
|
131
|
-
}
|
|
132
|
-
return { ...base, ...(spanStyle.value as any) } as any
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
// ============== AI v2 多动作能力 ==============
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* effectiveActions —— 旧 ai/aiResolver 包成单 action; aiActions 优先
|
|
139
|
-
*/
|
|
140
|
-
const effectiveActions = computed<AiAction[]>(() => {
|
|
141
|
-
if (props.aiActions && props.aiActions.length > 0) return props.aiActions
|
|
142
|
-
if (props.ai) {
|
|
143
|
-
const mockDuration = props.aiMockDuration ?? 1200
|
|
144
|
-
const resolverFn = props.aiResolver
|
|
145
|
-
return [
|
|
146
|
-
{
|
|
147
|
-
key: 'complete',
|
|
148
|
-
label: 'AI 智能补全',
|
|
149
|
-
prompt: props.aiPrompt,
|
|
150
|
-
resolver: async (ctx: AiActionContext): Promise<AiActionResult> => {
|
|
151
|
-
let value: any
|
|
152
|
-
if (resolverFn) {
|
|
153
|
-
value = await resolverFn({ prompt: ctx.prompt, value: ctx.value, label: ctx.label })
|
|
154
|
-
} else {
|
|
155
|
-
await new Promise((r) => setTimeout(r, mockDuration))
|
|
156
|
-
value = ctx.prompt || `AI 生成 - ${ctx.label ?? ''}`
|
|
157
|
-
}
|
|
158
|
-
return { kind: 'fill', value }
|
|
159
|
-
},
|
|
160
|
-
needConfirm: props.aiNeedConfirm ?? true,
|
|
161
|
-
placement: props.aiPlacement
|
|
162
|
-
} as AiAction
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
|
-
return []
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
const hasAiActions = computed(() => effectiveActions.value.length > 0)
|
|
169
|
-
|
|
170
|
-
// 内部状态 (props.aiStatus 受控时被覆盖)
|
|
171
|
-
const internalStatus = ref<AiFieldStatus>('idle')
|
|
172
|
-
|
|
173
|
-
// effectiveActions 出现时初始化 enhanced
|
|
174
|
-
watch(
|
|
175
|
-
hasAiActions,
|
|
176
|
-
(has) => {
|
|
177
|
-
if (has && internalStatus.value === 'idle') {
|
|
178
|
-
internalStatus.value = 'enhanced'
|
|
179
|
-
} else if (!has) {
|
|
180
|
-
internalStatus.value = 'idle'
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
{ immediate: true }
|
|
184
|
-
)
|
|
185
|
-
|
|
186
|
-
// 跟踪最近一次 AI 写入的值
|
|
187
|
-
const lastAppliedValue = ref<any>(undefined)
|
|
188
|
-
const hasAppliedValue = ref(false)
|
|
189
|
-
|
|
190
|
-
// v3: 快照 trigger 前的值用于 reject 回滚 + 最近 AI 直写值
|
|
191
|
-
const aiOriginValue = ref<any>(undefined)
|
|
192
|
-
const lastAiAppliedValue = ref<any>(undefined)
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* v3 引用类型快照防御:
|
|
196
|
-
* 控件 modelValue 可能是 array / object(cascader / file-upload / data-picker),
|
|
197
|
-
* 直接 `aiOriginValue.value = props.modelValue` 仅拷引用,
|
|
198
|
-
* 父组件 mutate 后回滚等于不回滚。优先 structuredClone,降级 JSON 深拷,
|
|
199
|
-
* 原始值 / Date / 不可克隆对象走兜底原样返回。
|
|
200
|
-
*/
|
|
201
|
-
function snapshotValue<T>(v: T): T {
|
|
202
|
-
if (v === null || v === undefined) return v
|
|
203
|
-
if (typeof v !== 'object') return v
|
|
204
|
-
if (v instanceof Date) return new Date(v.getTime()) as any
|
|
205
|
-
try {
|
|
206
|
-
if (typeof structuredClone === 'function') return structuredClone(v)
|
|
207
|
-
} catch {
|
|
208
|
-
/* fallthrough */
|
|
209
|
-
}
|
|
210
|
-
try {
|
|
211
|
-
return JSON.parse(JSON.stringify(v))
|
|
212
|
-
} catch {
|
|
213
|
-
return v
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const aiTriggerRef = ref<HTMLElement | null>(null)
|
|
218
|
-
const controlRef = ref<HTMLElement | null>(null)
|
|
219
|
-
const overlayOpen = ref(false)
|
|
220
|
-
|
|
221
|
-
// useFormAiActions 内部 actions.find 直接消费数组引用:mutate 保持引用
|
|
222
|
-
const actionsArr: AiAction[] = [...effectiveActions.value]
|
|
223
|
-
watch(
|
|
224
|
-
effectiveActions,
|
|
225
|
-
(next) => {
|
|
226
|
-
actionsArr.length = 0
|
|
227
|
-
next.forEach((a) => actionsArr.push(a))
|
|
228
|
-
},
|
|
229
|
-
{ deep: true }
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
const aiActionsApi = useFormAiActions({
|
|
233
|
-
actions: actionsArr,
|
|
234
|
-
// v3: trigger 完成时立即派发新状态 + fill 类直写 modelValue(不等用户确认)
|
|
235
|
-
onResolve: (r) => {
|
|
236
|
-
if (r.kind === 'fill' || r.kind === 'suggestion') {
|
|
237
|
-
const v = (r as any).value
|
|
238
|
-
// ★ v3 修正:仅当不在 suggestion 状态时记录 origin
|
|
239
|
-
// 这样连续多次 trigger(用户对推荐不满意再点 ✨)也只记最初的真原值,
|
|
240
|
-
// reject 时能回滚到"AI 介入前",而非上一次的 AI 推荐值
|
|
241
|
-
// ★ 引用类型深拷防御:避免 array/object 父组件 mutate 后回滚失效
|
|
242
|
-
if (internalStatus.value !== 'suggestion') {
|
|
243
|
-
aiOriginValue.value = snapshotValue(props.modelValue)
|
|
244
|
-
}
|
|
245
|
-
lastAiAppliedValue.value = v
|
|
246
|
-
lastAppliedValue.value = v
|
|
247
|
-
hasAppliedValue.value = true
|
|
248
|
-
internalStatus.value = 'suggestion'
|
|
249
|
-
// ★ v3 关键:直写 modelValue,控件立即看到 AI 值(紫边由用户交互确认)
|
|
250
|
-
emit('update:modelValue', v)
|
|
251
|
-
emit('ai-apply', v)
|
|
252
|
-
// fill 不开 overlay
|
|
253
|
-
} else if (r.kind === 'check') {
|
|
254
|
-
if (r.level === 'pass') {
|
|
255
|
-
// 检查通过:先短暂 confirmed 闪绿,1.2s 后回 enhanced
|
|
256
|
-
internalStatus.value = 'confirmed'
|
|
257
|
-
setTimeout(() => {
|
|
258
|
-
if (internalStatus.value === 'confirmed') internalStatus.value = 'enhanced'
|
|
259
|
-
}, 1200)
|
|
260
|
-
} else if (r.level === 'warn') {
|
|
261
|
-
internalStatus.value = 'issue-warn'
|
|
262
|
-
overlayOpen.value = true // ★ check warn 开 overlay 让用户看到问题
|
|
263
|
-
} else if (r.level === 'error') {
|
|
264
|
-
internalStatus.value = 'issue-error'
|
|
265
|
-
overlayOpen.value = true // ★ check error 开 overlay
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
// v3: onApply 仅作为 v2 兼容路径(registry.confirmAll → applyCallback → apply())
|
|
270
|
-
onApply: (r) => {
|
|
271
|
-
if (r.kind === 'fill' || r.kind === 'suggestion') {
|
|
272
|
-
// v3: 值已在 onResolve 直写;这里仅推进状态
|
|
273
|
-
if (internalStatus.value === 'suggestion') internalStatus.value = 'confirmed'
|
|
274
|
-
} else if (r.kind === 'check') {
|
|
275
|
-
if (r.level !== 'pass') internalStatus.value = 'rejected'
|
|
276
|
-
}
|
|
277
|
-
overlayOpen.value = false
|
|
278
|
-
},
|
|
279
|
-
onReject: () => {
|
|
280
|
-
// v3: reject 时若是 suggestion 状态需要回滚 modelValue
|
|
281
|
-
if (internalStatus.value === 'suggestion' && hasAppliedValue.value) {
|
|
282
|
-
emit('update:modelValue', aiOriginValue.value)
|
|
283
|
-
hasAppliedValue.value = false
|
|
284
|
-
}
|
|
285
|
-
internalStatus.value = 'rejected'
|
|
286
|
-
overlayOpen.value = false
|
|
287
|
-
setTimeout(() => {
|
|
288
|
-
if (internalStatus.value === 'rejected') internalStatus.value = hasAiActions.value ? 'enhanced' : 'idle'
|
|
289
|
-
}, 1200)
|
|
290
|
-
}
|
|
291
|
-
})
|
|
292
|
-
|
|
293
|
-
// ============ v3 命令式接受 / 拒绝 ============
|
|
294
|
-
function acceptSuggestion() {
|
|
295
|
-
if (internalStatus.value === 'suggestion') {
|
|
296
|
-
internalStatus.value = 'confirmed'
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
function rejectSuggestion() {
|
|
300
|
-
if (internalStatus.value === 'suggestion') {
|
|
301
|
-
// ★ 回滚到 trigger 前的值
|
|
302
|
-
if (hasAppliedValue.value) {
|
|
303
|
-
emit('update:modelValue', aiOriginValue.value)
|
|
304
|
-
hasAppliedValue.value = false
|
|
305
|
-
}
|
|
306
|
-
internalStatus.value = 'rejected'
|
|
307
|
-
setTimeout(() => {
|
|
308
|
-
if (internalStatus.value === 'rejected') internalStatus.value = hasAiActions.value ? 'enhanced' : 'idle'
|
|
309
|
-
}, 1200)
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// ★ v3: focus 即确认 —— focusin 冒泡覆盖 input/textarea/select 等控件
|
|
314
|
-
function onControlFocusIn(e: FocusEvent) {
|
|
315
|
-
if (internalStatus.value !== 'suggestion') return
|
|
316
|
-
// ★ 排除点击 hover 双按钮 (✓/✗) 触发的 focus —— 否则 focusin 在 mousedown 抢先
|
|
317
|
-
// 把 status 推成 confirmed,导致后续 click 进入 rejectSuggestion 时守卫失败、不回滚。
|
|
318
|
-
// accept 路径不走守卫所以受影响;reject 必须保留 suggestion → 守卫 → emit origin。
|
|
319
|
-
const target = e.target as HTMLElement | null
|
|
320
|
-
if (target && target.closest('.tf-form-item__suggestion-actions')) return
|
|
321
|
-
internalStatus.value = 'confirmed'
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// ★ 点击 label 文本区:聚焦到控件内第一个 input/textarea/select,而非触发 AI 按钮
|
|
325
|
-
function focusControl() {
|
|
326
|
-
const el = controlRef.value
|
|
327
|
-
if (!el) return
|
|
328
|
-
const target = el.querySelector('input, textarea, select, [contenteditable]') as HTMLElement | null
|
|
329
|
-
target?.focus()
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// ★ v3: 单 action 直触
|
|
333
|
-
function onQuickTrigger() {
|
|
334
|
-
const a = effectiveActions.value[0]
|
|
335
|
-
if (!a) return
|
|
336
|
-
// ★ 同步抢拍 origin (在 trigger 之前),避免 await resolver 期间 modelValue 被外部改动
|
|
337
|
-
// ★ 引用类型深拷防御
|
|
338
|
-
if (internalStatus.value !== 'suggestion') {
|
|
339
|
-
aiOriginValue.value = snapshotValue(props.modelValue)
|
|
340
|
-
}
|
|
341
|
-
void aiActionsApi.trigger(a.key, {
|
|
342
|
-
value: props.modelValue,
|
|
343
|
-
label: props.label,
|
|
344
|
-
field: props.aiField ?? props.label
|
|
345
|
-
})
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
// 兼容旧 ai-state-change emit
|
|
349
|
-
watch(
|
|
350
|
-
() => [aiActionsApi.state.value, aiActionsApi.result.value, aiActionsApi.error.value] as const,
|
|
351
|
-
([state, result, error]) => {
|
|
352
|
-
emit('ai-state-change', {
|
|
353
|
-
state: state as string,
|
|
354
|
-
result: result as any,
|
|
355
|
-
error: error ? (error as Error).message : null
|
|
356
|
-
})
|
|
357
|
-
}
|
|
358
|
-
)
|
|
359
|
-
|
|
360
|
-
// confirmed 后又被外部改动 -> modified;忽略 AI apply 同步那一拍
|
|
361
|
-
const modelValueRef = toRef(props, 'modelValue')
|
|
362
|
-
watch(modelValueRef, (newV, oldV) => {
|
|
363
|
-
if (internalStatus.value !== 'confirmed') return
|
|
364
|
-
if (newV === oldV) return
|
|
365
|
-
if (hasAppliedValue.value && newV === lastAppliedValue.value) {
|
|
366
|
-
hasAppliedValue.value = false
|
|
367
|
-
return
|
|
368
|
-
}
|
|
369
|
-
if (newV === lastAppliedValue.value) return
|
|
370
|
-
internalStatus.value = 'modified'
|
|
371
|
-
})
|
|
372
|
-
|
|
373
|
-
// effectiveStatus: 外部受控 > 触发态 pending > 内部 status
|
|
374
|
-
const effectiveStatus = computed<AiFieldStatus>(() => {
|
|
375
|
-
if (props.aiStatus) return props.aiStatus
|
|
376
|
-
if (!hasAiActions.value) return 'idle'
|
|
377
|
-
const s = aiActionsApi.state.value
|
|
378
|
-
// running 阶段沿用 enhanced 视觉(pulse 由 CSS 处理); confirming 阶段 onResolve 已派发 internalStatus(suggestion/issue-*)
|
|
379
|
-
if (s === 'running') return 'enhanced'
|
|
380
|
-
return internalStatus.value
|
|
381
|
-
})
|
|
382
|
-
|
|
383
|
-
watch(effectiveStatus, (s) => {
|
|
384
|
-
emit('ai-status-change', s)
|
|
385
|
-
// 同步 registry(批 5)
|
|
386
|
-
if (!aiRegistry) return
|
|
387
|
-
const k = fieldKey.value
|
|
388
|
-
if (!k) return
|
|
389
|
-
aiRegistry.updateStatus(
|
|
390
|
-
k,
|
|
391
|
-
s,
|
|
392
|
-
(aiActionsApi.result.value as AiActionResult | null) ?? undefined,
|
|
393
|
-
aiActionsApi.activeActionKey.value ?? undefined
|
|
394
|
-
)
|
|
395
|
-
})
|
|
396
|
-
|
|
397
|
-
// 5 色映射
|
|
398
|
-
const badgeColor = computed(() => AI_FIELD_STATUS_COLOR[effectiveStatus.value])
|
|
399
|
-
|
|
400
|
-
// 状态 icon 内嵌:仅保留待处理/异常状态;confirmed 不再显示勾,避免占用输入框/文本域内容空间
|
|
401
|
-
const statusIconMap: Partial<Record<AiFieldStatus, Component>> = {
|
|
402
|
-
suggestion: Sparkles,
|
|
403
|
-
'issue-warn': AlertTriangle,
|
|
404
|
-
'issue-error': AlertCircle
|
|
405
|
-
}
|
|
406
|
-
const showStatusIcon = computed(() => statusIconMap[effectiveStatus.value] !== undefined)
|
|
407
|
-
const statusIconComponent = computed<Component | null>(() => statusIconMap[effectiveStatus.value] ?? null)
|
|
408
|
-
function onStatusIconClick() {
|
|
409
|
-
// v3: 点击 status icon 仅在 check warn/error 路径打开 overlay;
|
|
410
|
-
// suggestion 由 hover 展开的双按钮直接处理,不再走 overlay。
|
|
411
|
-
if (!hasAiActions.value) return
|
|
412
|
-
const s = effectiveStatus.value
|
|
413
|
-
if (s === 'issue-warn' || s === 'issue-error') {
|
|
414
|
-
overlayOpen.value = true
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
// v3 hover 展开 ✓✗ 双按钮:直接走 v3 acceptSuggestion / rejectSuggestion(含值回滚)
|
|
419
|
-
function onAcceptSuggestion() {
|
|
420
|
-
acceptSuggestion()
|
|
421
|
-
}
|
|
422
|
-
function onRejectSuggestion() {
|
|
423
|
-
rejectSuggestion()
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
// 触发器选择动作(多 action 模式)
|
|
427
|
-
// 不预先打开 overlay——fill 类结果由 onResolve 直写 modelValue + status=suggestion;
|
|
428
|
-
// check 类 warn/error 由 onResolve 自动打开 overlay 展示问题。
|
|
429
|
-
async function onMenuSelect(actionKey: string) {
|
|
430
|
-
// ★ 同步抢拍 origin (与 onQuickTrigger 一致)
|
|
431
|
-
// ★ 引用类型深拷防御
|
|
432
|
-
if (internalStatus.value !== 'suggestion') {
|
|
433
|
-
aiOriginValue.value = snapshotValue(props.modelValue)
|
|
434
|
-
}
|
|
435
|
-
await aiActionsApi.trigger(actionKey, {
|
|
436
|
-
value: props.modelValue,
|
|
437
|
-
label: props.label,
|
|
438
|
-
field: props.aiField ?? props.label
|
|
439
|
-
})
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// ============ 批 5:自动 register / unregister 字段 ============
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* fieldKey 计算:aiField > prop > label > ''
|
|
446
|
-
* 空 key 视为不可注册(避免冲撞)
|
|
447
|
-
*/
|
|
448
|
-
const fieldKey = computed(() => props.aiField ?? props.prop ?? props.label ?? '')
|
|
449
|
-
|
|
450
|
-
watch(
|
|
451
|
-
[hasAiActions, fieldKey, effectiveActions] as const,
|
|
452
|
-
([has, key, actions], _old, onCleanup) => {
|
|
453
|
-
if (!aiRegistry) return
|
|
454
|
-
if (!has || !key) return
|
|
455
|
-
aiRegistry.register(key, {
|
|
456
|
-
field: key,
|
|
457
|
-
label: props.label,
|
|
458
|
-
actions: actions as AiAction[],
|
|
459
|
-
triggerCallback: (actionKey, ctx) => {
|
|
460
|
-
// ★ v3: registry 路径(toolbar 一键 AI 填充)也需同步抢拍 origin
|
|
461
|
-
// ★ 引用类型深拷防御
|
|
462
|
-
if (internalStatus.value !== 'suggestion') {
|
|
463
|
-
aiOriginValue.value = snapshotValue(props.modelValue)
|
|
464
|
-
}
|
|
465
|
-
return aiActionsApi.trigger(actionKey, ctx)
|
|
466
|
-
},
|
|
467
|
-
applyCallback: () => aiActionsApi.apply(),
|
|
468
|
-
getValue: () => props.modelValue
|
|
469
|
-
})
|
|
470
|
-
// 当 key 变化时清理上一份
|
|
471
|
-
onCleanup(() => {
|
|
472
|
-
// 仅在 key 真的变了或 hasAiActions=false 时反注册当前 key
|
|
473
|
-
// 注意:watch 重跑时 onCleanup 在新值生效前调用,
|
|
474
|
-
// 此处用闭包捕获的 key 安全反注册
|
|
475
|
-
if (aiRegistry && key) aiRegistry.unregister(key)
|
|
476
|
-
})
|
|
477
|
-
},
|
|
478
|
-
{ immediate: true }
|
|
479
|
-
)
|
|
480
|
-
|
|
481
|
-
onUnmounted(() => {
|
|
482
|
-
aiActionsApi.reset()
|
|
483
|
-
if (aiRegistry && fieldKey.value) {
|
|
484
|
-
aiRegistry.unregister(fieldKey.value)
|
|
485
|
-
}
|
|
486
|
-
})
|
|
487
|
-
|
|
488
|
-
// 给 registry / toolbar 提供命令式 API
|
|
489
|
-
defineExpose({
|
|
490
|
-
effectiveActions,
|
|
491
|
-
effectiveStatus,
|
|
492
|
-
trigger: aiActionsApi.trigger,
|
|
493
|
-
apply: aiActionsApi.apply,
|
|
494
|
-
reject: aiActionsApi.reject,
|
|
495
|
-
acceptSuggestion,
|
|
496
|
-
rejectSuggestion,
|
|
497
|
-
reset: () => {
|
|
498
|
-
aiActionsApi.reset()
|
|
499
|
-
internalStatus.value = hasAiActions.value ? 'enhanced' : 'idle'
|
|
500
|
-
}
|
|
501
|
-
})
|
|
502
|
-
</script>
|
|
503
|
-
|
|
504
|
-
<template>
|
|
505
|
-
<div
|
|
506
|
-
class="tf-form-item"
|
|
507
|
-
:data-layout="itemLayout"
|
|
508
|
-
:data-size="props.size"
|
|
509
|
-
:data-ai-status="effectiveStatus"
|
|
510
|
-
:data-loading="aiActionsApi.state.value === 'running' ? 'true' : undefined"
|
|
511
|
-
:style="itemStyle"
|
|
512
|
-
>
|
|
513
|
-
<!-- 标签 -->
|
|
514
|
-
<label
|
|
515
|
-
v-if="$slots.label || label"
|
|
516
|
-
:class="'flex-shrink-0 tf-form-item__label tf-form-item-label'"
|
|
517
|
-
:data-size="props.size"
|
|
518
|
-
:style="{ fontSize: labelFontSizes[props.size], width: labelWidth, textAlign: labelAlign, color: 'var(--tf-color-text)' }"
|
|
519
|
-
>
|
|
520
|
-
<!-- 标签文本区(独立 label,点击可聚焦控件) -->
|
|
521
|
-
<span
|
|
522
|
-
class="tf-form-item__label-inner"
|
|
523
|
-
:for="(typeof props.prop === 'string' ? props.prop : undefined)"
|
|
524
|
-
@click.prevent="focusControl"
|
|
525
|
-
>
|
|
526
|
-
<span v-if="required" class="tf-form-item-required mr-1" :style="{ color: 'var(--tf-color-error)' }">*</span>
|
|
527
|
-
<span class="tf-form-item__label-text" :title="typeof label === 'string' ? label : undefined">
|
|
528
|
-
<slot name="label">{{ label }}</slot>
|
|
529
|
-
</span>
|
|
530
|
-
<span v-if="showColon && label" class="tf-form-item-colon ml-1">:</span>
|
|
531
|
-
|
|
532
|
-
<!-- AI 图标紧随 label 文本 -->
|
|
533
|
-
<span
|
|
534
|
-
v-if="hasAiActions"
|
|
535
|
-
ref="aiTriggerRef"
|
|
536
|
-
class="tf-form-item-ai-trigger-wrap"
|
|
537
|
-
:data-status="effectiveStatus"
|
|
538
|
-
>
|
|
539
|
-
<button
|
|
540
|
-
v-if="effectiveActions.length === 1"
|
|
541
|
-
type="button"
|
|
542
|
-
class="tf-form-item-ai-quick-trigger"
|
|
543
|
-
:title="effectiveActions[0].label"
|
|
544
|
-
@click.stop="onQuickTrigger"
|
|
545
|
-
>
|
|
546
|
-
<Sparkles class="tf-form-item-ai-quick-trigger-icon w-3.5 h-3.5" />
|
|
547
|
-
</button>
|
|
548
|
-
<TfAiActionMenu
|
|
549
|
-
v-else
|
|
550
|
-
:actions="effectiveActions"
|
|
551
|
-
:badge-color="badgeColor"
|
|
552
|
-
:size="props.size"
|
|
553
|
-
@select="onMenuSelect"
|
|
554
|
-
/>
|
|
555
|
-
</span>
|
|
556
|
-
<!-- 仅 aiBadge=true: 装饰角标 -->
|
|
557
|
-
<span
|
|
558
|
-
v-else-if="aiBadge"
|
|
559
|
-
class="tf-form-item-ai-badge"
|
|
560
|
-
:data-status="effectiveStatus"
|
|
561
|
-
>
|
|
562
|
-
AI
|
|
563
|
-
</span>
|
|
564
|
-
</span>
|
|
565
|
-
</label>
|
|
566
|
-
|
|
567
|
-
<!-- 内容区域 -->
|
|
568
|
-
<div class="flex-1 min-w-0" ref="controlRef">
|
|
569
|
-
<div
|
|
570
|
-
class="tf-form-item__control-wrap"
|
|
571
|
-
:data-ai-status-icon="effectiveStatus"
|
|
572
|
-
@focusin="onControlFocusIn"
|
|
573
|
-
>
|
|
574
|
-
<div class="tf-form-item__control-anchor">
|
|
575
|
-
<slot />
|
|
576
|
-
<span
|
|
577
|
-
v-if="showStatusIcon"
|
|
578
|
-
class="tf-form-item__status-icon"
|
|
579
|
-
:class="`tf-form-item__status-icon--${effectiveStatus}`"
|
|
580
|
-
role="button"
|
|
581
|
-
:aria-label="`AI 状态: ${effectiveStatus}`"
|
|
582
|
-
@click="onStatusIconClick"
|
|
583
|
-
>
|
|
584
|
-
<component :is="statusIconComponent" class="w-3 h-3" />
|
|
585
|
-
</span>
|
|
586
|
-
<!-- v3 hover 展开 ✓✗ - 仅 suggestion 时存在 -->
|
|
587
|
-
<span
|
|
588
|
-
v-if="effectiveStatus === 'suggestion'"
|
|
589
|
-
class="tf-form-item__suggestion-actions"
|
|
590
|
-
>
|
|
591
|
-
<button
|
|
592
|
-
type="button"
|
|
593
|
-
class="tf-form-item__suggestion-btn tf-form-item__suggestion-btn--accept"
|
|
594
|
-
title="采纳"
|
|
595
|
-
@mousedown.prevent
|
|
596
|
-
@click.stop="onAcceptSuggestion"
|
|
597
|
-
>
|
|
598
|
-
<Check class="w-3 h-3" />
|
|
599
|
-
</button>
|
|
600
|
-
<button
|
|
601
|
-
type="button"
|
|
602
|
-
class="tf-form-item__suggestion-btn tf-form-item__suggestion-btn--reject"
|
|
603
|
-
title="撤销"
|
|
604
|
-
@mousedown.prevent
|
|
605
|
-
@click.stop="onRejectSuggestion"
|
|
606
|
-
>
|
|
607
|
-
<X class="w-3 h-3" />
|
|
608
|
-
</button>
|
|
609
|
-
</span>
|
|
610
|
-
</div>
|
|
611
|
-
</div>
|
|
612
|
-
|
|
613
|
-
<div v-if="$slots.error || fieldError" class="tf-form-item-error mt-1" :style="{ fontSize: 'var(--tf-font-size-xs)', color: 'var(--tf-color-error)' }">
|
|
614
|
-
<slot name="error"><span class="tf-form-item-error-text">{{ fieldError }}</span></slot>
|
|
615
|
-
</div>
|
|
616
|
-
|
|
617
|
-
<div v-if="tip && !fieldError" class="tf-form-item-tip mt-1" :style="{ fontSize: 'var(--tf-font-size-xs)', color: 'var(--tf-color-text-secondary)' }">
|
|
618
|
-
{{ tip }}
|
|
619
|
-
</div>
|
|
620
|
-
</div>
|
|
621
|
-
|
|
622
|
-
<!-- AI 浮层(v2 多动作模式) -->
|
|
623
|
-
<TfAiOverlay
|
|
624
|
-
v-if="hasAiActions"
|
|
625
|
-
v-model:open="overlayOpen"
|
|
626
|
-
:anchor="aiTriggerRef"
|
|
627
|
-
:state="aiActionsApi.state.value"
|
|
628
|
-
:result="aiActionsApi.result.value"
|
|
629
|
-
:error="aiActionsApi.error.value"
|
|
630
|
-
:actions="effectiveActions"
|
|
631
|
-
:active-action-key="aiActionsApi.activeActionKey.value"
|
|
632
|
-
:placement="effectiveActions[0]?.placement ?? aiPlacement ?? 'bottom-start'"
|
|
633
|
-
:width="aiOverlayWidth"
|
|
634
|
-
:title="label ? `AI 增强:${label}` : 'AI 增强'"
|
|
635
|
-
compact
|
|
636
|
-
@confirm="aiActionsApi.apply"
|
|
637
|
-
@reject="aiActionsApi.reject"
|
|
638
|
-
/>
|
|
639
|
-
</div>
|
|
640
|
-
</template>
|
|
641
|
-
|
|
642
|
-
<style scoped>
|
|
643
|
-
@import '../styles/form-item.css';
|
|
644
|
-
</style>
|
|
645
|
-
|
|
646
|
-
<style src="../styles/form-item-ai-status.css"></style>
|