@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,100 @@
|
|
|
1
|
+
import type { Component } from 'vue'
|
|
2
|
+
import type { DropdownButtonItem } from '../../../../dropdown-button/src/types'
|
|
3
|
+
|
|
4
|
+
export type DocumentActionHeaderSize = 'sm' | 'md'
|
|
5
|
+
export type DocumentActionHeaderLayoutMode = 'vertical' | 'horizontal'
|
|
6
|
+
export type DocumentActionHeaderActionType = 'default' | 'primary' | 'success' | 'warning' | 'error'
|
|
7
|
+
export type DocumentActionHeaderActionGroup = 'layout' | 'document' | 'workflow' | 'custom'
|
|
8
|
+
export type DocumentBuiltInActionKey =
|
|
9
|
+
| 'reset'
|
|
10
|
+
| 'pushDown'
|
|
11
|
+
| 'linkQuery'
|
|
12
|
+
| 'businessAction'
|
|
13
|
+
| 'previous'
|
|
14
|
+
| 'next'
|
|
15
|
+
| 'option'
|
|
16
|
+
| 'refresh'
|
|
17
|
+
| 'exit'
|
|
18
|
+
| 'approve'
|
|
19
|
+
| 'delete'
|
|
20
|
+
| 'save'
|
|
21
|
+
| 'submit'
|
|
22
|
+
| 'aiRecognize'
|
|
23
|
+
| 'aiRecognizeError'
|
|
24
|
+
| 'aiApplyAll'
|
|
25
|
+
| 'aiRejectAll'
|
|
26
|
+
| 'aiCheckAll'
|
|
27
|
+
| 'aiRiskCheck'
|
|
28
|
+
| 'aiInsight'
|
|
29
|
+
| 'aiAnalyze'
|
|
30
|
+
|
|
31
|
+
export interface DocumentActionHeaderAction {
|
|
32
|
+
key: string
|
|
33
|
+
title: string
|
|
34
|
+
icon?: Component | string
|
|
35
|
+
type?: DocumentActionHeaderActionType
|
|
36
|
+
plain?: boolean
|
|
37
|
+
group?: DocumentActionHeaderActionGroup
|
|
38
|
+
disabled?: boolean
|
|
39
|
+
loading?: boolean
|
|
40
|
+
hidden?: boolean
|
|
41
|
+
order?: number
|
|
42
|
+
tooltip?: string
|
|
43
|
+
menuItems?: DropdownButtonItem[]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface DocumentActionContext {
|
|
47
|
+
action: DocumentActionHeaderAction
|
|
48
|
+
actionKey: string
|
|
49
|
+
layoutMode: DocumentActionHeaderLayoutMode
|
|
50
|
+
source: 'document-action-header'
|
|
51
|
+
payload?: Record<string, any>
|
|
52
|
+
document?: Record<string, any>
|
|
53
|
+
bizType?: string | number
|
|
54
|
+
entityId?: string | number
|
|
55
|
+
pageConfigId?: string | number
|
|
56
|
+
pageCode?: string
|
|
57
|
+
pageName?: string
|
|
58
|
+
mode?: 'create' | 'edit' | 'view'
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface DocumentActionResult {
|
|
62
|
+
success?: boolean
|
|
63
|
+
message?: string
|
|
64
|
+
data?: unknown
|
|
65
|
+
[key: string]: unknown
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type DocumentActionHook = (
|
|
69
|
+
ctx: DocumentActionContext
|
|
70
|
+
) => boolean | void | DocumentActionContext | Promise<boolean | void | DocumentActionContext>
|
|
71
|
+
|
|
72
|
+
export interface DocumentActionHeaderProps {
|
|
73
|
+
title?: string
|
|
74
|
+
subtitle?: string
|
|
75
|
+
sticky?: boolean
|
|
76
|
+
bordered?: boolean
|
|
77
|
+
size?: DocumentActionHeaderSize
|
|
78
|
+
layoutMode?: DocumentActionHeaderLayoutMode
|
|
79
|
+
showLayoutToggle?: boolean
|
|
80
|
+
actions?: DocumentActionHeaderAction[]
|
|
81
|
+
hiddenKeys?: string[]
|
|
82
|
+
disabledKeys?: string[]
|
|
83
|
+
loadingKeys?: string[]
|
|
84
|
+
showDefaultActions?: boolean
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface DocumentActionHeaderEmits {
|
|
88
|
+
(e: 'update:layoutMode', value: DocumentActionHeaderLayoutMode): void
|
|
89
|
+
(e: 'action', key: string, action: DocumentActionHeaderAction, payload?: Record<string, any>): void
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface DocumentActionHeaderSlots {
|
|
93
|
+
title?: (_: any) => any
|
|
94
|
+
subtitle?: (_: any) => any
|
|
95
|
+
beforeActions?: (_: any) => any
|
|
96
|
+
aiToolbar?: (_: {
|
|
97
|
+
emitAction: (action: DocumentActionHeaderAction, payload?: Record<string, any>) => void
|
|
98
|
+
}) => any
|
|
99
|
+
afterActions?: (_: any) => any
|
|
100
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { App, Plugin } from 'vue'
|
|
2
|
+
import TfDocumentAiToolbar from './src/document-ai-toolbar.vue'
|
|
3
|
+
|
|
4
|
+
export { TfDocumentAiToolbar }
|
|
5
|
+
|
|
6
|
+
export const DocumentAiToolbar: Plugin = {
|
|
7
|
+
install(app: App) {
|
|
8
|
+
app.component('TfDocumentAiToolbar', TfDocumentAiToolbar)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default DocumentAiToolbar
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import TfFormAiToolbar from '../../../../form-ai-toolbar/src/form-ai-toolbar.vue'
|
|
3
|
+
import type {
|
|
4
|
+
DocumentActionHeaderAction,
|
|
5
|
+
DocumentActionHeaderSize,
|
|
6
|
+
DocumentBuiltInActionKey
|
|
7
|
+
} from '../../action-header/src/types'
|
|
8
|
+
import type {
|
|
9
|
+
DrawerContent,
|
|
10
|
+
NoticeReport,
|
|
11
|
+
ToolbarFeature
|
|
12
|
+
} from '../../../../form-ai-toolbar/src/types'
|
|
13
|
+
|
|
14
|
+
interface DocumentAiToolbarProps {
|
|
15
|
+
size?: DocumentActionHeaderSize
|
|
16
|
+
features?: ToolbarFeature[]
|
|
17
|
+
recognizeAccept?: string
|
|
18
|
+
showRejectAll?: boolean
|
|
19
|
+
onRecognize?: (file: File) => Promise<Record<string, any>>
|
|
20
|
+
onRiskCheck?: () => Promise<NoticeReport>
|
|
21
|
+
onInsight?: () => Promise<DrawerContent>
|
|
22
|
+
onAnalyze?: () => Promise<DrawerContent>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const props = withDefaults(defineProps<DocumentAiToolbarProps>(), {
|
|
26
|
+
size: 'sm',
|
|
27
|
+
features: () => ['recognize', 'fill', 'check', 'risk', 'insight', 'analyze'],
|
|
28
|
+
recognizeAccept: '.pdf,.png,.jpg,.jpeg',
|
|
29
|
+
showRejectAll: false
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const emit = defineEmits<{
|
|
33
|
+
'ai-action': [action: DocumentActionHeaderAction, payload?: Record<string, any>]
|
|
34
|
+
}>()
|
|
35
|
+
|
|
36
|
+
defineOptions({ name: 'TfDocumentAiToolbar' })
|
|
37
|
+
|
|
38
|
+
const createAiAction = (key: DocumentBuiltInActionKey, title: string): DocumentActionHeaderAction => ({
|
|
39
|
+
key,
|
|
40
|
+
title,
|
|
41
|
+
group: 'document',
|
|
42
|
+
hidden: false
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const emitAiAction = (key: DocumentBuiltInActionKey, title: string, payload?: Record<string, any>) => {
|
|
46
|
+
emit('ai-action', createAiAction(key, title), payload)
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<TfFormAiToolbar
|
|
52
|
+
:features="features"
|
|
53
|
+
:recognize-accept="recognizeAccept"
|
|
54
|
+
:on-recognize="onRecognize"
|
|
55
|
+
:on-risk-check="onRiskCheck"
|
|
56
|
+
:on-insight="onInsight"
|
|
57
|
+
:on-analyze="onAnalyze"
|
|
58
|
+
:show-risk-check="true"
|
|
59
|
+
:show-insight="true"
|
|
60
|
+
:show-analyze="true"
|
|
61
|
+
:show-reject-all="showRejectAll"
|
|
62
|
+
:size="size"
|
|
63
|
+
@recognize-success="fields => emitAiAction('aiRecognize', 'AI recognize', { fields })"
|
|
64
|
+
@recognize-error="error => emitAiAction('aiRecognizeError', 'AI recognize error', { error })"
|
|
65
|
+
@apply-all="emitAiAction('aiApplyAll', 'AI apply all')"
|
|
66
|
+
@reject-all="emitAiAction('aiRejectAll', 'AI reject all')"
|
|
67
|
+
@check-all="report => emitAiAction('aiCheckAll', 'AI check all', { report })"
|
|
68
|
+
@risk-check="report => emitAiAction('aiRiskCheck', 'AI risk check', { report })"
|
|
69
|
+
@insight="content => emitAiAction('aiInsight', 'AI insight', { content })"
|
|
70
|
+
@analyze="content => emitAiAction('aiAnalyze', 'AI analyze', { content })"
|
|
71
|
+
/>
|
|
72
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { App, Plugin } from 'vue'
|
|
2
|
+
import TfDocumentFormPage from './src/document-form-page.vue'
|
|
3
|
+
import TfDocumentSectionCard from './src/document-section-card.vue'
|
|
4
|
+
|
|
5
|
+
export { TfDocumentFormPage, TfDocumentSectionCard }
|
|
6
|
+
export * from './src/types'
|
|
7
|
+
export * from './src/context'
|
|
8
|
+
|
|
9
|
+
export const DocumentFormPage: Plugin = {
|
|
10
|
+
install(app: App) {
|
|
11
|
+
app.component('TfDocumentFormPage', TfDocumentFormPage)
|
|
12
|
+
app.component('TfDocumentSectionCard', TfDocumentSectionCard)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default DocumentFormPage
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { computed, type ComputedRef } from 'vue'
|
|
2
|
+
import type { DocumentFormActionConfig, DocumentFormPageProps } from '../types'
|
|
3
|
+
|
|
4
|
+
export function useDocumentAiToolbar(
|
|
5
|
+
props: DocumentFormPageProps,
|
|
6
|
+
actionConfig: ComputedRef<DocumentFormActionConfig>
|
|
7
|
+
) {
|
|
8
|
+
const aiToolbarConfig = computed(() => ({
|
|
9
|
+
enabled: props.actionHeader?.showAiToolbar !== false,
|
|
10
|
+
features: props.actionHeader?.aiFeatures,
|
|
11
|
+
recognizeAccept: props.actionHeader?.recognizeAccept,
|
|
12
|
+
onRecognize: props.actionHeader?.onRecognize,
|
|
13
|
+
onRiskCheck: props.actionHeader?.onRiskCheck,
|
|
14
|
+
onInsight: props.actionHeader?.onInsight,
|
|
15
|
+
onAnalyze: props.actionHeader?.onAnalyze,
|
|
16
|
+
showRejectAll: props.actionHeader?.showAiRejectAll,
|
|
17
|
+
...(props.aiConfig || {})
|
|
18
|
+
}))
|
|
19
|
+
|
|
20
|
+
const actionHeaderProps = computed(() => {
|
|
21
|
+
const headerProps = { ...actionConfig.value } as Record<string, unknown>
|
|
22
|
+
delete headerProps.showAiToolbar
|
|
23
|
+
delete headerProps.aiFeatures
|
|
24
|
+
delete headerProps.recognizeAccept
|
|
25
|
+
delete headerProps.onRecognize
|
|
26
|
+
delete headerProps.onRiskCheck
|
|
27
|
+
delete headerProps.onInsight
|
|
28
|
+
delete headerProps.onAnalyze
|
|
29
|
+
delete headerProps.showAiRejectAll
|
|
30
|
+
return headerProps
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
aiToolbarConfig,
|
|
35
|
+
actionHeaderProps
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import type { DocumentActionHeaderLayoutMode } from '../../../action-header/src/types'
|
|
3
|
+
import type { DocumentFormPageProps } from '../types'
|
|
4
|
+
|
|
5
|
+
export function useDocumentLayoutMode(props: DocumentFormPageProps) {
|
|
6
|
+
const resolveInitialLayoutMode = (): DocumentActionHeaderLayoutMode => {
|
|
7
|
+
const mode = props.actionConfig?.layoutMode || props.actionHeader?.layoutMode
|
|
8
|
+
if (mode === 'horizontal' || mode === 'vertical') {
|
|
9
|
+
return mode
|
|
10
|
+
}
|
|
11
|
+
return props.formConfig?.layout === 'horizontal' ? 'horizontal' : 'vertical'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const documentLayoutMode = ref<DocumentActionHeaderLayoutMode>(resolveInitialLayoutMode())
|
|
15
|
+
|
|
16
|
+
const handleLayoutModeChange = (mode: DocumentActionHeaderLayoutMode) => {
|
|
17
|
+
documentLayoutMode.value = mode
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
documentLayoutMode,
|
|
22
|
+
handleLayoutModeChange
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue'
|
|
2
|
+
import type { DocumentActionHeaderAction } from '../../../action-header/src/types'
|
|
3
|
+
import type {
|
|
4
|
+
DocumentFormPageEmits,
|
|
5
|
+
DocumentFormPageProps
|
|
6
|
+
} from '../types'
|
|
7
|
+
|
|
8
|
+
const setByPath = (source: Record<string, any>, path: string, value: unknown) => {
|
|
9
|
+
const keys = path.split('.').filter(Boolean)
|
|
10
|
+
if (!keys.length) return
|
|
11
|
+
let current = source
|
|
12
|
+
keys.slice(0, -1).forEach(key => {
|
|
13
|
+
if (!current[key] || typeof current[key] !== 'object') current[key] = {}
|
|
14
|
+
current = current[key]
|
|
15
|
+
})
|
|
16
|
+
current[keys[keys.length - 1]] = value
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function useDocumentRecognition(
|
|
20
|
+
props: DocumentFormPageProps,
|
|
21
|
+
model: ComputedRef<Record<string, any>>,
|
|
22
|
+
emit: DocumentFormPageEmits,
|
|
23
|
+
updateModel?: (next: Record<string, any>) => void
|
|
24
|
+
) {
|
|
25
|
+
const applyRecognizedFields = (fields: Record<string, any>) => {
|
|
26
|
+
if (!props.autoApplyRecognizedFields || !fields || typeof fields !== 'object') return
|
|
27
|
+
|
|
28
|
+
const nextModel = { ...model.value }
|
|
29
|
+
Object.entries(fields).forEach(([key, value]) => {
|
|
30
|
+
const targetField = props.recognizedFieldMap?.[key] || key
|
|
31
|
+
setByPath(nextModel, targetField, value)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
if (updateModel) {
|
|
35
|
+
updateModel(nextModel)
|
|
36
|
+
} else {
|
|
37
|
+
emit('update:modelValue', nextModel)
|
|
38
|
+
}
|
|
39
|
+
emit('recognized-fields-apply', fields, nextModel)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const handleRecognizedAction = (
|
|
43
|
+
action: DocumentActionHeaderAction,
|
|
44
|
+
payload?: Record<string, any>
|
|
45
|
+
) => {
|
|
46
|
+
if (action.key !== 'aiRecognize') return false
|
|
47
|
+
applyRecognizedFields(payload?.fields || {})
|
|
48
|
+
return true
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
applyRecognizedFields,
|
|
53
|
+
handleRecognizedAction
|
|
54
|
+
}
|
|
55
|
+
}
|
package/packages/ui/components/business/document/form-page/src/composables/use-document-save.ts
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue'
|
|
2
|
+
import { saveDocument } from '../../../../../../src/request'
|
|
3
|
+
import type {
|
|
4
|
+
DocumentActionContext,
|
|
5
|
+
DocumentActionHeaderAction,
|
|
6
|
+
DocumentActionHeaderLayoutMode
|
|
7
|
+
} from '../../../action-header/src/types'
|
|
8
|
+
import type {
|
|
9
|
+
DocumentFormActionConfig,
|
|
10
|
+
DocumentFormMissingItem,
|
|
11
|
+
DocumentFormPageEmits,
|
|
12
|
+
DocumentFormPageProps,
|
|
13
|
+
DocumentFormServiceContext,
|
|
14
|
+
DocumentFormSection
|
|
15
|
+
} from '../types'
|
|
16
|
+
|
|
17
|
+
interface UseDocumentSaveOptions {
|
|
18
|
+
props: DocumentFormPageProps
|
|
19
|
+
emit: DocumentFormPageEmits
|
|
20
|
+
actionConfig: ComputedRef<DocumentFormActionConfig>
|
|
21
|
+
model: ComputedRef<Record<string, any>>
|
|
22
|
+
visibleSections: ComputedRef<DocumentFormSection[]>
|
|
23
|
+
missingItems: ComputedRef<DocumentFormMissingItem[]>
|
|
24
|
+
documentLayoutMode: Ref<DocumentActionHeaderLayoutMode>
|
|
25
|
+
formRef: Ref<{ validate?: () => boolean | Promise<boolean> } | null>
|
|
26
|
+
focusFirstMissingSection: () => boolean
|
|
27
|
+
updateModel: (next: Record<string, any>) => void
|
|
28
|
+
applyRecognizedFields?: (fields: Record<string, any>) => void
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const internalActionKeys = new Set([
|
|
32
|
+
'save',
|
|
33
|
+
'submit',
|
|
34
|
+
'detail',
|
|
35
|
+
'exit',
|
|
36
|
+
'back',
|
|
37
|
+
'return',
|
|
38
|
+
'aiRecognize'
|
|
39
|
+
])
|
|
40
|
+
|
|
41
|
+
export function useDocumentSave(options: UseDocumentSaveOptions) {
|
|
42
|
+
const {
|
|
43
|
+
props,
|
|
44
|
+
emit,
|
|
45
|
+
actionConfig,
|
|
46
|
+
model,
|
|
47
|
+
visibleSections,
|
|
48
|
+
missingItems,
|
|
49
|
+
documentLayoutMode,
|
|
50
|
+
formRef,
|
|
51
|
+
focusFirstMissingSection,
|
|
52
|
+
updateModel,
|
|
53
|
+
applyRecognizedFields
|
|
54
|
+
} = options
|
|
55
|
+
|
|
56
|
+
const buildActionContext = (
|
|
57
|
+
action: DocumentActionHeaderAction,
|
|
58
|
+
payload?: Record<string, any>
|
|
59
|
+
): DocumentActionContext => ({
|
|
60
|
+
action,
|
|
61
|
+
actionKey: action.key,
|
|
62
|
+
layoutMode: documentLayoutMode.value,
|
|
63
|
+
source: 'document-action-header',
|
|
64
|
+
payload,
|
|
65
|
+
document: model.value,
|
|
66
|
+
bizType: props.bizType,
|
|
67
|
+
entityId: props.entityId,
|
|
68
|
+
pageConfigId: props.pageConfigId,
|
|
69
|
+
pageCode: props.pageCode,
|
|
70
|
+
pageName: props.pageName,
|
|
71
|
+
mode: props.mode || 'create'
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const buildActionPayload = (ctx: DocumentActionContext) => ({
|
|
75
|
+
...ctx.payload,
|
|
76
|
+
bizType: props.bizType,
|
|
77
|
+
entityId: props.entityId,
|
|
78
|
+
pageConfigId: props.pageConfigId,
|
|
79
|
+
pageCode: props.pageCode,
|
|
80
|
+
pageName: props.pageName,
|
|
81
|
+
mode: props.mode || 'create',
|
|
82
|
+
formData: ctx.document || model.value,
|
|
83
|
+
sections: visibleSections.value
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const handleBeforeAction = async (ctx: DocumentActionContext) => {
|
|
87
|
+
const externalResult = await actionConfig.value.beforeAction?.(ctx)
|
|
88
|
+
if (externalResult === false) return false
|
|
89
|
+
|
|
90
|
+
return externalResult && typeof externalResult === 'object'
|
|
91
|
+
? externalResult
|
|
92
|
+
: ctx
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const transformActionPayload = async (ctx: DocumentActionContext) => {
|
|
96
|
+
const document = ctx.document || model.value
|
|
97
|
+
const requestPayload = actionConfig.value.transformPayload
|
|
98
|
+
? await actionConfig.value.transformPayload(document, ctx)
|
|
99
|
+
: buildActionPayload(ctx)
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
...ctx,
|
|
103
|
+
payload: {
|
|
104
|
+
...ctx.payload,
|
|
105
|
+
requestPayload,
|
|
106
|
+
formData: document
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const validateForm = async () => {
|
|
112
|
+
if (!props.formProvider) return true
|
|
113
|
+
const validate = formRef.value?.validate
|
|
114
|
+
if (!validate) return true
|
|
115
|
+
return await validate()
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const blockByMissingItems = () => {
|
|
119
|
+
const highlighted = focusFirstMissingSection()
|
|
120
|
+
if (highlighted) {
|
|
121
|
+
emit('submit-blocked', missingItems.value)
|
|
122
|
+
}
|
|
123
|
+
return highlighted
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const buildServiceContext = (ctx: DocumentActionContext): DocumentFormServiceContext => {
|
|
127
|
+
const payload = buildActionPayload(ctx)
|
|
128
|
+
const requestPayload = ctx.payload?.requestPayload ?? payload
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
bizType: props.bizType,
|
|
132
|
+
entityId: props.entityId,
|
|
133
|
+
pageConfigId: props.pageConfigId,
|
|
134
|
+
pageCode: props.pageCode,
|
|
135
|
+
pageName: props.pageName,
|
|
136
|
+
mode: props.mode || 'create',
|
|
137
|
+
actionKey: ctx.actionKey,
|
|
138
|
+
action: ctx.action,
|
|
139
|
+
model: ctx.document || model.value,
|
|
140
|
+
payload,
|
|
141
|
+
requestPayload,
|
|
142
|
+
sections: visibleSections.value,
|
|
143
|
+
missingItems: missingItems.value,
|
|
144
|
+
actionContext: ctx
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const runBusinessAction = async (ctx: DocumentActionContext) => {
|
|
149
|
+
const serviceCtx = buildServiceContext(ctx)
|
|
150
|
+
|
|
151
|
+
if (ctx.actionKey === 'save') {
|
|
152
|
+
if (props.saveService) {
|
|
153
|
+
return await props.saveService(serviceCtx)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return await saveDocument(serviceCtx.requestPayload)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (ctx.actionKey === 'submit') {
|
|
160
|
+
if (!props.submitService) return undefined
|
|
161
|
+
return await props.submitService(serviceCtx)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (ctx.actionKey === 'detail') {
|
|
165
|
+
if (!props.detailService) return undefined
|
|
166
|
+
const detail = await props.detailService({
|
|
167
|
+
...serviceCtx,
|
|
168
|
+
requestPayload: serviceCtx.requestPayload
|
|
169
|
+
})
|
|
170
|
+
if (detail && typeof detail === 'object') {
|
|
171
|
+
updateModel(detail)
|
|
172
|
+
}
|
|
173
|
+
return { success: true, data: detail }
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (ctx.actionKey === 'aiRecognize') {
|
|
177
|
+
const fields = ctx.payload?.fields || (
|
|
178
|
+
props.recognizeService
|
|
179
|
+
? await props.recognizeService({
|
|
180
|
+
...serviceCtx,
|
|
181
|
+
file: ctx.payload?.file as File | undefined
|
|
182
|
+
})
|
|
183
|
+
: {}
|
|
184
|
+
)
|
|
185
|
+
if (fields && typeof fields === 'object') {
|
|
186
|
+
applyRecognizedFields?.(fields)
|
|
187
|
+
}
|
|
188
|
+
return { success: true, data: fields, fields }
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return undefined
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const shouldValidateAction = (actionKey: string) =>
|
|
195
|
+
actionKey === 'save'
|
|
196
|
+
|| actionKey === 'submit'
|
|
197
|
+
|| Boolean(props.validateActionKeys?.includes(actionKey))
|
|
198
|
+
|
|
199
|
+
async function handleAction(_key: string, action: DocumentActionHeaderAction, payload?: Record<string, any>) {
|
|
200
|
+
const beforeCtx = buildActionContext(action, payload)
|
|
201
|
+
emit('action', beforeCtx)
|
|
202
|
+
|
|
203
|
+
const nextCtx = await handleBeforeAction(beforeCtx)
|
|
204
|
+
if (nextCtx === false) return
|
|
205
|
+
|
|
206
|
+
try {
|
|
207
|
+
if (shouldValidateAction(nextCtx.actionKey)) {
|
|
208
|
+
const isValid = await validateForm()
|
|
209
|
+
if (!isValid) {
|
|
210
|
+
blockByMissingItems()
|
|
211
|
+
emit('action-error', nextCtx, new Error('表单校验未通过,请检查必填项'))
|
|
212
|
+
return
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (props.validateActionKeys?.includes(nextCtx.actionKey) && missingItems.value.length > 0) {
|
|
216
|
+
blockByMissingItems()
|
|
217
|
+
return
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (!internalActionKeys.has(nextCtx.actionKey)) {
|
|
222
|
+
emit('action-success', nextCtx)
|
|
223
|
+
return
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const requestCtx = await transformActionPayload(nextCtx)
|
|
227
|
+
const result = await runBusinessAction(requestCtx)
|
|
228
|
+
emit('action-success', requestCtx, result)
|
|
229
|
+
await actionConfig.value.afterAction?.(requestCtx, result as any)
|
|
230
|
+
} catch (error) {
|
|
231
|
+
emit('action-error', nextCtx, error)
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const handleAiToolbarAction = (action: DocumentActionHeaderAction, payload?: Record<string, any>) => {
|
|
236
|
+
void handleAction(action.key, action, payload)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return {
|
|
240
|
+
handleAction,
|
|
241
|
+
handleAiToolbarAction
|
|
242
|
+
}
|
|
243
|
+
}
|