nuxt-ui-tools 1.11.2 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +46 -0
- package/dist/runtime/dashboard/components/dashboard-stat.d.vue.ts +1 -1
- package/dist/runtime/dashboard/components/dashboard-stat.vue.d.ts +1 -1
- package/dist/runtime/file-preview/components/shell/file-preview-stage.d.vue.ts +2 -2
- package/dist/runtime/file-preview/components/shell/file-preview-stage.vue.d.ts +2 -2
- package/dist/runtime/form/fields/array-collapse/component.vue +2 -1
- package/dist/runtime/form/fields/array-list/component.vue +72 -63
- package/dist/runtime/form/fields/array-list/use-array-items.d.ts +1 -0
- package/dist/runtime/form/fields/array-list/use-array-items.js +4 -0
- package/dist/runtime/form/fields/array-table/component.vue +2 -1
- package/dist/runtime/form/types/api.d.ts +10 -2
- package/dist/runtime/i18n/locales/en.js +252 -130
- package/dist/runtime/i18n/locales/fr.js +252 -130
- package/dist/runtime/i18n/types.d.ts +242 -119
- package/dist/runtime/shared/types/query.d.ts +14 -4
- package/dist/runtime/shared/types/remote-options.d.ts +11 -0
- package/dist/runtime/shared/utils/define-remote-options.js +6 -0
- package/dist/runtime/shared/utils/file.d.ts +1 -1
- package/dist/runtime/spreadsheet/components/{steps/review/spreadsheet-review-overflow-alert.d.vue.ts → internal/spreadsheet-import-cell-editor.d.vue.ts} +8 -5
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-cell-editor.vue +73 -0
- package/dist/runtime/spreadsheet/components/{steps/review/spreadsheet-review-overflow-alert.vue.d.ts → internal/spreadsheet-import-cell-editor.vue.d.ts} +8 -5
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-column-row.d.vue.ts +17 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-column-row.vue +98 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-column-row.vue.d.ts +17 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-heading.d.vue.ts +17 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-heading.vue +20 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-heading.vue.d.ts +17 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-status-badge.d.vue.ts +10 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-status-badge.vue +34 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-status-badge.vue.d.ts +10 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-value-row.d.vue.ts +13 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-value-row.vue +113 -0
- package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-value-row.vue.d.ts +13 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-column-mapping.d.vue.ts +35 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-column-mapping.vue +154 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-column-mapping.vue.d.ts +35 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-dropzone.d.vue.ts +23 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-dropzone.vue +83 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-dropzone.vue.d.ts +23 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-expected-columns.d.vue.ts +19 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-expected-columns.vue +45 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-expected-columns.vue.d.ts +19 -0
- package/dist/runtime/spreadsheet/components/{shared/spreadsheet-object-preview-table.d.vue.ts → parts/spreadsheet-import-export-button.d.vue.ts} +3 -2
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-export-button.vue +34 -0
- package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-file-bar.vue.d.ts → parts/spreadsheet-import-export-button.vue.d.ts} +3 -4
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-file-card.d.vue.ts +17 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-file-card.vue +49 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-file-card.vue.d.ts +17 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-progress.d.vue.ts +18 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-progress.vue +101 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-progress.vue.d.ts +18 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-row-inspector.d.vue.ts +22 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-row-inspector.vue +276 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-row-inspector.vue.d.ts +22 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-source-settings.d.vue.ts +11 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-source-settings.vue +164 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-source-settings.vue.d.ts +11 -0
- package/dist/runtime/spreadsheet/components/{shared/spreadsheet-value-preview.d.vue.ts → parts/spreadsheet-import-stat.d.vue.ts} +7 -4
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-stat.vue +30 -0
- package/dist/runtime/spreadsheet/components/{shared/spreadsheet-value-preview.vue.d.ts → parts/spreadsheet-import-stat.vue.d.ts} +7 -4
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-stats.d.vue.ts +26 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-stats.vue +55 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-stats.vue.d.ts +26 -0
- package/dist/runtime/spreadsheet/components/{shared/spreadsheet-object-preview-table.vue.d.ts → parts/spreadsheet-import-submit-button.d.vue.ts} +3 -2
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-submit-button.vue +27 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-submit-button.vue.d.ts +8 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-summary.d.vue.ts +16 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-summary.vue +51 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-summary.vue.d.ts +16 -0
- package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-file-bar.d.vue.ts → parts/spreadsheet-import-table-toolbar.d.vue.ts} +2 -4
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-table-toolbar.vue +217 -0
- package/dist/runtime/spreadsheet/components/{shared/spreadsheet-raw-preview-table.d.vue.ts → parts/spreadsheet-import-table-toolbar.vue.d.ts} +2 -2
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-table.d.vue.ts +33 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-table.vue +302 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-table.vue.d.ts +33 -0
- package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-sidebar.d.vue.ts → parts/spreadsheet-import-template-button.d.vue.ts} +5 -4
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-template-button.vue +31 -0
- package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-sidebar.vue.d.ts → parts/spreadsheet-import-template-button.vue.d.ts} +5 -4
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-value-mapping.d.vue.ts +27 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-value-mapping.vue +162 -0
- package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-value-mapping.vue.d.ts +27 -0
- package/dist/runtime/spreadsheet/components/spreadsheet-import-root.d.vue.ts +24 -0
- package/dist/runtime/spreadsheet/components/spreadsheet-import-root.vue +23 -0
- package/dist/runtime/spreadsheet/components/spreadsheet-import-root.vue.d.ts +24 -0
- package/dist/runtime/spreadsheet/components/spreadsheet-import.d.vue.ts +21 -6
- package/dist/runtime/spreadsheet/components/spreadsheet-import.vue +46 -262
- package/dist/runtime/spreadsheet/components/spreadsheet-import.vue.d.ts +21 -6
- package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-header.d.vue.ts → steps/spreadsheet-import-step-nav.d.vue.ts} +6 -2
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-step-nav.vue +116 -0
- package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-header.vue.d.ts → steps/spreadsheet-import-step-nav.vue.d.ts} +6 -2
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-step.d.vue.ts +26 -0
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-step.vue +106 -0
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-step.vue.d.ts +26 -0
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-stepper.d.vue.ts +15 -0
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-stepper.vue +131 -0
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-stepper.vue.d.ts +15 -0
- package/dist/runtime/spreadsheet/composables/index.d.ts +2 -0
- package/dist/runtime/spreadsheet/composables/index.js +2 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-answers.d.ts +8 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-answers.js +19 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-columns.d.ts +23 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-columns.js +75 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-context.d.ts +8 -45
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-context.js +28 -32
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-edits.d.ts +11 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-edits.js +25 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-fields.d.ts +16 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-fields.js +20 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-file.d.ts +14 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-file.js +44 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-import-context.d.ts +12 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-import-context.js +22 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-import.d.ts +18 -7
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-import.js +340 -109
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-layout.d.ts +36 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-layout.js +95 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-options.d.ts +24 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-options.js +159 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-queries.d.ts +14 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-queries.js +11 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-review.d.ts +37 -169
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-review.js +148 -408
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-rows.d.ts +48 -26
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-rows.js +334 -21
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-steps.d.ts +33 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-steps.js +126 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-submit.d.ts +37 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-submit.js +136 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-values.d.ts +27 -0
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-values.js +121 -0
- package/dist/runtime/spreadsheet/index.d.ts +0 -1
- package/dist/runtime/spreadsheet/index.js +0 -1
- package/dist/runtime/spreadsheet/schema/builder.d.ts +8 -0
- package/dist/runtime/spreadsheet/schema/builder.js +31 -0
- package/dist/runtime/spreadsheet/schema/index.d.ts +24 -32
- package/dist/runtime/spreadsheet/schema/index.js +4 -21
- package/dist/runtime/spreadsheet/types/columns.d.ts +252 -273
- package/dist/runtime/spreadsheet/types/fields.d.ts +64 -0
- package/dist/runtime/spreadsheet/types/importer.d.ts +308 -0
- package/dist/runtime/spreadsheet/types/index.d.ts +6 -10
- package/dist/runtime/spreadsheet/types/options.d.ts +47 -9
- package/dist/runtime/spreadsheet/types/rows.d.ts +57 -48
- package/dist/runtime/spreadsheet/types/schema.d.ts +162 -76
- package/dist/runtime/spreadsheet/types/shared.d.ts +19 -21
- package/dist/runtime/spreadsheet/types/source.d.ts +39 -15
- package/dist/runtime/spreadsheet/types/steps.d.ts +76 -0
- package/dist/runtime/spreadsheet/types/validation.d.ts +49 -69
- package/dist/runtime/spreadsheet/types/values.d.ts +77 -0
- package/dist/runtime/spreadsheet/utils/download.d.ts +2 -0
- package/dist/runtime/spreadsheet/utils/download.js +8 -0
- package/dist/runtime/spreadsheet/utils/export.d.ts +26 -0
- package/dist/runtime/spreadsheet/utils/export.js +50 -0
- package/dist/runtime/spreadsheet/utils/fields.d.ts +26 -0
- package/dist/runtime/spreadsheet/utils/fields.js +169 -0
- package/dist/runtime/spreadsheet/utils/guards.d.ts +18 -0
- package/dist/runtime/spreadsheet/utils/guards.js +27 -0
- package/dist/runtime/spreadsheet/utils/headers.d.ts +15 -0
- package/dist/runtime/spreadsheet/utils/headers.js +36 -0
- package/dist/runtime/spreadsheet/utils/identity.d.ts +24 -0
- package/dist/runtime/spreadsheet/utils/identity.js +57 -0
- package/dist/runtime/spreadsheet/utils/index.d.ts +15 -6
- package/dist/runtime/spreadsheet/utils/index.js +15 -6
- package/dist/runtime/spreadsheet/utils/layout.d.ts +12 -0
- package/dist/runtime/spreadsheet/utils/layout.js +37 -0
- package/dist/runtime/spreadsheet/utils/options.d.ts +31 -10
- package/dist/runtime/spreadsheet/utils/options.js +58 -30
- package/dist/runtime/spreadsheet/utils/parse.d.ts +6 -0
- package/dist/runtime/spreadsheet/utils/parse.js +147 -0
- package/dist/runtime/spreadsheet/utils/paths.d.ts +4 -0
- package/dist/runtime/spreadsheet/utils/paths.js +29 -0
- package/dist/runtime/spreadsheet/utils/rows.d.ts +69 -0
- package/dist/runtime/spreadsheet/utils/rows.js +168 -0
- package/dist/runtime/spreadsheet/utils/rules.d.ts +4 -0
- package/dist/runtime/spreadsheet/utils/rules.js +95 -0
- package/dist/runtime/spreadsheet/utils/suggestions.d.ts +20 -0
- package/dist/runtime/spreadsheet/utils/suggestions.js +43 -0
- package/dist/runtime/spreadsheet/utils/text.d.ts +9 -0
- package/dist/runtime/spreadsheet/utils/text.js +11 -0
- package/dist/runtime/spreadsheet/utils/workbook.d.ts +13 -0
- package/dist/runtime/spreadsheet/utils/workbook.js +121 -0
- package/dist/runtime/table/components/filters/tags/boolean-filter-tag.d.vue.ts +2 -2
- package/dist/runtime/table/components/filters/tags/boolean-filter-tag.vue.d.ts +2 -2
- package/dist/runtime/table/components/filters/tags/date-filter-tag.d.vue.ts +2 -2
- package/dist/runtime/table/components/filters/tags/date-filter-tag.vue.d.ts +2 -2
- package/dist/runtime/table/components/filters/tags/number-filter-tag.d.vue.ts +2 -2
- package/dist/runtime/table/components/filters/tags/number-filter-tag.vue.d.ts +2 -2
- package/dist/runtime/table/components/filters/tags/option-filter-tag.d.vue.ts +2 -2
- package/dist/runtime/table/components/filters/tags/option-filter-tag.vue.d.ts +2 -2
- package/dist/runtime/table/components/filters/tags/text-filter-tag.d.vue.ts +2 -2
- package/dist/runtime/table/components/filters/tags/text-filter-tag.vue.d.ts +2 -2
- package/dist/runtime/table/components/table/table-cell-ellipsis.d.ts +1 -1
- package/dist/runtime/table/composables/use-table-actions.d.ts +1 -1
- package/dist/runtime/table/composables/use-table-actions.js +11 -3
- package/dist/runtime/table/composables/use-table-internals.d.ts +3 -3
- package/dist/runtime/table/types/actions.d.ts +8 -1
- package/dist/runtime/table/utils/data-list-ui.d.ts +1 -1
- package/package.json +18 -3
- package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-file-bar.vue +0 -31
- package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.d.vue.ts +0 -24
- package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.vue +0 -69
- package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.vue.d.ts +0 -24
- package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-header.vue +0 -36
- package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-sidebar.vue +0 -63
- package/dist/runtime/spreadsheet/components/shared/spreadsheet-object-preview-table.vue +0 -67
- package/dist/runtime/spreadsheet/components/shared/spreadsheet-raw-preview-table.vue +0 -41
- package/dist/runtime/spreadsheet/components/shared/spreadsheet-raw-preview-table.vue.d.ts +0 -7
- package/dist/runtime/spreadsheet/components/shared/spreadsheet-summary-stats.d.vue.ts +0 -10
- package/dist/runtime/spreadsheet/components/shared/spreadsheet-summary-stats.vue +0 -25
- package/dist/runtime/spreadsheet/components/shared/spreadsheet-summary-stats.vue.d.ts +0 -10
- package/dist/runtime/spreadsheet/components/shared/spreadsheet-value-preview.vue +0 -201
- package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-summary.d.vue.ts +0 -11
- package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-summary.vue +0 -38
- package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-summary.vue.d.ts +0 -11
- package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-table.d.vue.ts +0 -45
- package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-table.vue +0 -219
- package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-table.vue.d.ts +0 -45
- package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-accordion.d.vue.ts +0 -51
- package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-accordion.vue +0 -166
- package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-accordion.vue.d.ts +0 -51
- package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-summary.d.vue.ts +0 -11
- package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-summary.vue +0 -26
- package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-summary.vue.d.ts +0 -11
- package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-inspection.d.vue.ts +0 -41
- package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-inspection.vue +0 -392
- package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-inspection.vue.d.ts +0 -41
- package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-overflow-alert.vue +0 -43
- package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-stats.d.vue.ts +0 -15
- package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-stats.vue +0 -40
- package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-stats.vue.d.ts +0 -15
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-matching-step.d.vue.ts +0 -7
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-matching-step.vue +0 -137
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-matching-step.vue.d.ts +0 -7
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-references-step.d.vue.ts +0 -7
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-references-step.vue +0 -222
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-references-step.vue.d.ts +0 -7
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-review-step.d.vue.ts +0 -7
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-review-step.vue +0 -191
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-review-step.vue.d.ts +0 -7
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-structure-step.d.vue.ts +0 -7
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-structure-step.vue +0 -62
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-structure-step.vue.d.ts +0 -7
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-upload-step.d.vue.ts +0 -8
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-upload-step.vue +0 -81
- package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-upload-step.vue.d.ts +0 -8
- package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-preview-table.d.vue.ts +0 -15
- package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-preview-table.vue +0 -95
- package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-preview-table.vue.d.ts +0 -15
- package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-sheet-list.d.vue.ts +0 -15
- package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-sheet-list.vue +0 -56
- package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-sheet-list.vue.d.ts +0 -15
- package/dist/runtime/spreadsheet/components/types.d.ts +0 -41
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-column-matching.d.ts +0 -18
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-column-matching.js +0 -62
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-internals.d.ts +0 -629
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-internals.js +0 -68
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-references.d.ts +0 -1
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-references.js +0 -3
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-resolutions.d.ts +0 -40
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-resolutions.js +0 -97
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-row-state.d.ts +0 -24
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-row-state.js +0 -74
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-source.d.ts +0 -27
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-source.js +0 -109
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-view.d.ts +0 -15
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-view.js +0 -109
- package/dist/runtime/spreadsheet/schema/normalize.d.ts +0 -73
- package/dist/runtime/spreadsheet/schema/normalize.js +0 -136
- package/dist/runtime/spreadsheet/types/context.d.ts +0 -9
- package/dist/runtime/spreadsheet/types/import.d.ts +0 -55
- package/dist/runtime/spreadsheet/types/inference.d.ts +0 -83
- package/dist/runtime/spreadsheet/types/normalized.d.ts +0 -50
- package/dist/runtime/spreadsheet/types/normalized.js +0 -0
- package/dist/runtime/spreadsheet/types/pipeline.d.ts +0 -7
- package/dist/runtime/spreadsheet/types/pipeline.js +0 -0
- package/dist/runtime/spreadsheet/types/reference-session.d.ts +0 -43
- package/dist/runtime/spreadsheet/types/reference-session.js +0 -0
- package/dist/runtime/spreadsheet/types/references.d.ts +0 -32
- package/dist/runtime/spreadsheet/types/references.js +0 -0
- package/dist/runtime/spreadsheet/types/resolution.d.ts +0 -43
- package/dist/runtime/spreadsheet/types/resolution.js +0 -0
- package/dist/runtime/spreadsheet/utils/builders/core.d.ts +0 -17
- package/dist/runtime/spreadsheet/utils/builders/core.js +0 -262
- package/dist/runtime/spreadsheet/utils/builders/index.d.ts +0 -1
- package/dist/runtime/spreadsheet/utils/builders/index.js +0 -1
- package/dist/runtime/spreadsheet/utils/context.d.ts +0 -20
- package/dist/runtime/spreadsheet/utils/context.js +0 -25
- package/dist/runtime/spreadsheet/utils/display.d.ts +0 -6
- package/dist/runtime/spreadsheet/utils/display.js +0 -26
- package/dist/runtime/spreadsheet/utils/object.d.ts +0 -9
- package/dist/runtime/spreadsheet/utils/object.js +0 -78
- package/dist/runtime/spreadsheet/utils/references/candidates.d.ts +0 -6
- package/dist/runtime/spreadsheet/utils/references/candidates.js +0 -28
- package/dist/runtime/spreadsheet/utils/references/core.d.ts +0 -3
- package/dist/runtime/spreadsheet/utils/references/core.js +0 -3
- package/dist/runtime/spreadsheet/utils/references/guards.d.ts +0 -4
- package/dist/runtime/spreadsheet/utils/references/guards.js +0 -28
- package/dist/runtime/spreadsheet/utils/references/index.d.ts +0 -1
- package/dist/runtime/spreadsheet/utils/references/index.js +0 -1
- package/dist/runtime/spreadsheet/utils/references/resolutions.d.ts +0 -17
- package/dist/runtime/spreadsheet/utils/references/resolutions.js +0 -172
- package/dist/runtime/spreadsheet/utils/references/shared.d.ts +0 -3
- package/dist/runtime/spreadsheet/utils/references/shared.js +0 -26
- package/dist/runtime/spreadsheet/utils/references/sources.d.ts +0 -9
- package/dist/runtime/spreadsheet/utils/references/sources.js +0 -38
- package/dist/runtime/spreadsheet/utils/rows/core.d.ts +0 -4
- package/dist/runtime/spreadsheet/utils/rows/core.js +0 -4
- package/dist/runtime/spreadsheet/utils/rows/headers.d.ts +0 -2
- package/dist/runtime/spreadsheet/utils/rows/headers.js +0 -9
- package/dist/runtime/spreadsheet/utils/rows/index.d.ts +0 -1
- package/dist/runtime/spreadsheet/utils/rows/index.js +0 -1
- package/dist/runtime/spreadsheet/utils/rows/matching.d.ts +0 -5
- package/dist/runtime/spreadsheet/utils/rows/matching.js +0 -209
- package/dist/runtime/spreadsheet/utils/rows/parsing.d.ts +0 -7
- package/dist/runtime/spreadsheet/utils/rows/parsing.js +0 -209
- package/dist/runtime/spreadsheet/utils/rows/shared.d.ts +0 -17
- package/dist/runtime/spreadsheet/utils/rows/shared.js +0 -309
- package/dist/runtime/spreadsheet/utils/rows/summary.d.ts +0 -2
- package/dist/runtime/spreadsheet/utils/rows/summary.js +0 -10
- package/dist/runtime/spreadsheet/utils/source/core.d.ts +0 -9
- package/dist/runtime/spreadsheet/utils/source/core.js +0 -65
- package/dist/runtime/spreadsheet/utils/source/index.d.ts +0 -1
- package/dist/runtime/spreadsheet/utils/source/index.js +0 -1
- package/dist/runtime/spreadsheet/utils/validation/core.d.ts +0 -16
- package/dist/runtime/spreadsheet/utils/validation/core.js +0 -211
- package/dist/runtime/spreadsheet/utils/validation/index.d.ts +0 -1
- package/dist/runtime/spreadsheet/utils/validation/index.js +0 -1
- /package/dist/runtime/spreadsheet/{components/types.js → types/fields.js} +0 -0
- /package/dist/runtime/spreadsheet/types/{context.js → importer.js} +0 -0
- /package/dist/runtime/spreadsheet/types/{import.js → steps.js} +0 -0
- /package/dist/runtime/spreadsheet/types/{inference.js → values.js} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { UiToolsTranslator } from '#ui-tools/i18n';
|
|
2
|
+
import type { SpreadsheetField, SpreadsheetFieldOptions, SpreadsheetHeaderCell } from '../types/index.js';
|
|
3
|
+
/** Share of sample values that must pass before a column is suggested for a field. */
|
|
4
|
+
export declare const SPREADSHEET_SUGGESTION_PASS_RATE = 0.8;
|
|
5
|
+
/**
|
|
6
|
+
* For each required field without a column, the first unused column whose sample values all read
|
|
7
|
+
* as the field's type and pass its rules. A suggestion is offered to the user, never applied.
|
|
8
|
+
*/
|
|
9
|
+
export declare function suggestSpreadsheetColumns(params: {
|
|
10
|
+
fields: readonly SpreadsheetField[];
|
|
11
|
+
headers: readonly SpreadsheetHeaderCell[];
|
|
12
|
+
rows: readonly (readonly string[])[];
|
|
13
|
+
raws: readonly (readonly unknown[] | undefined)[];
|
|
14
|
+
options: ReadonlyMap<string, SpreadsheetFieldOptions>;
|
|
15
|
+
ctx: unknown;
|
|
16
|
+
t: UiToolsTranslator;
|
|
17
|
+
}): Map<string, {
|
|
18
|
+
header: SpreadsheetHeaderCell;
|
|
19
|
+
samples: readonly string[];
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { parseSpreadsheetRow } from "./rows.js";
|
|
2
|
+
export const SPREADSHEET_SUGGESTION_PASS_RATE = 0.8;
|
|
3
|
+
const SAMPLE_SIZE = 30;
|
|
4
|
+
export function suggestSpreadsheetColumns(params) {
|
|
5
|
+
const suggestions = /* @__PURE__ */ new Map();
|
|
6
|
+
const taken = /* @__PURE__ */ new Set();
|
|
7
|
+
for (const field of params.fields) {
|
|
8
|
+
if (field.select?.rowOptions) continue;
|
|
9
|
+
const rules = field.staticRules ? field.rulesOf({}) : [];
|
|
10
|
+
if (field.kind === "text" && !rules.length && !field.parse) continue;
|
|
11
|
+
for (const header of params.headers) {
|
|
12
|
+
if (taken.has(header.index) || !header.text) continue;
|
|
13
|
+
const samples = params.rows.map((row, index) => ({ index, text: String(row[header.index] ?? "").trim() })).filter((entry) => entry.text).slice(0, SAMPLE_SIZE);
|
|
14
|
+
if (samples.length < 2) continue;
|
|
15
|
+
const passing = samples.filter((sample) => {
|
|
16
|
+
const parsed = parseSpreadsheetRow({
|
|
17
|
+
cells: params.rows[sample.index] ?? [],
|
|
18
|
+
context: {
|
|
19
|
+
answers: {},
|
|
20
|
+
columns: /* @__PURE__ */ new Map([[field.path, header.index]]),
|
|
21
|
+
ctx: params.ctx,
|
|
22
|
+
fields: [{ ...field, required: false, rulesOf: () => rules }],
|
|
23
|
+
headers: [],
|
|
24
|
+
optionsOf: () => ({ options: params.options.get(field.path), scope: null }),
|
|
25
|
+
t: params.t
|
|
26
|
+
},
|
|
27
|
+
edits: void 0,
|
|
28
|
+
index: sample.index,
|
|
29
|
+
raws: params.raws[sample.index]
|
|
30
|
+
});
|
|
31
|
+
return !parsed.issues.some((issue) => issue.level === "error") && !parsed.unmatched.length;
|
|
32
|
+
});
|
|
33
|
+
if (passing.length / samples.length < SPREADSHEET_SUGGESTION_PASS_RATE) continue;
|
|
34
|
+
suggestions.set(field.path, {
|
|
35
|
+
header,
|
|
36
|
+
samples: [...new Set(samples.map((sample) => sample.text))].slice(0, 3)
|
|
37
|
+
});
|
|
38
|
+
taken.add(header.index);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return suggestions;
|
|
43
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text used for exact matching: no case, no accents, one space between words, and no trailing
|
|
3
|
+
* `*` or `(required)` marker. Two values match when their normalized texts are equal.
|
|
4
|
+
*/
|
|
5
|
+
export declare function normalizeSpreadsheetText(value: unknown): string;
|
|
6
|
+
/** Cell text as displayed: trimmed, empty for `null` and `undefined`. */
|
|
7
|
+
export declare function toSpreadsheetText(value: unknown): string;
|
|
8
|
+
/** Splits a cell into its items, trimmed, without empty ones. */
|
|
9
|
+
export declare function splitSpreadsheetItems(text: string, separator: string): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function normalizeSpreadsheetText(value) {
|
|
2
|
+
return String(value ?? "").normalize("NFD").replaceAll(/[̀-ͯ]/gu, "").replaceAll(/\s*\*\s*$/gu, "").replaceAll(/\s*\(required\)\s*$/giu, "").replaceAll(/\s+/gu, " ").trim().toLowerCase();
|
|
3
|
+
}
|
|
4
|
+
export function toSpreadsheetText(value) {
|
|
5
|
+
if (value === null || value === void 0) return "";
|
|
6
|
+
if (value instanceof Date) return Number.isNaN(value.getTime()) ? "" : value.toISOString();
|
|
7
|
+
return String(value).trim();
|
|
8
|
+
}
|
|
9
|
+
export function splitSpreadsheetItems(text, separator) {
|
|
10
|
+
return text.split(separator).map((item) => item.trim()).filter(Boolean);
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SpreadsheetFileSource, SpreadsheetWorkbook } from '../types/index.js';
|
|
2
|
+
/** Splits delimited text (CSV, TSV, or rows pasted from a spreadsheet) into rows of cells. */
|
|
3
|
+
export declare function parseSpreadsheetDelimitedText(text: string, separator?: string): string[][];
|
|
4
|
+
/** Reads an Excel or CSV file. CSV files may use commas, semicolons, or tabs, in UTF-8 or Windows-1252. */
|
|
5
|
+
export declare function readSpreadsheetFile(params: {
|
|
6
|
+
source: SpreadsheetFileSource;
|
|
7
|
+
name: string;
|
|
8
|
+
}): Promise<SpreadsheetWorkbook>;
|
|
9
|
+
/** Reads text pasted from a spreadsheet, or the content of a CSV file. */
|
|
10
|
+
export declare function readSpreadsheetText(params: {
|
|
11
|
+
text: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}): SpreadsheetWorkbook;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { read, utils } from "xlsx";
|
|
2
|
+
const TEXT_EXTENSIONS = /\.(?:csv|tsv|txt)$/iu;
|
|
3
|
+
async function toBytes(source) {
|
|
4
|
+
if (source instanceof Uint8Array) return source;
|
|
5
|
+
if (source instanceof ArrayBuffer) return new Uint8Array(source);
|
|
6
|
+
return new Uint8Array(await source.arrayBuffer());
|
|
7
|
+
}
|
|
8
|
+
function decodeText(bytes) {
|
|
9
|
+
try {
|
|
10
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(bytes).replace(/^/u, "");
|
|
11
|
+
} catch {
|
|
12
|
+
return new TextDecoder("windows-1252").decode(bytes);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function detectSeparator(text) {
|
|
16
|
+
const firstLine = text.slice(0, text.search(/\r?\n/u) + 1 || text.length);
|
|
17
|
+
const counts = [" ", ";", ","].map((separator) => ({
|
|
18
|
+
count: firstLine.split(separator).length - 1,
|
|
19
|
+
separator
|
|
20
|
+
}));
|
|
21
|
+
return counts.reduce((best, entry) => entry.count > best.count ? entry : best).separator;
|
|
22
|
+
}
|
|
23
|
+
export function parseSpreadsheetDelimitedText(text, separator = detectSeparator(text)) {
|
|
24
|
+
const rows = [];
|
|
25
|
+
let row = [];
|
|
26
|
+
let cell = "";
|
|
27
|
+
let quoted = false;
|
|
28
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
29
|
+
const char = text[index];
|
|
30
|
+
if (quoted) {
|
|
31
|
+
if (char === '"' && text[index + 1] === '"') {
|
|
32
|
+
cell += '"';
|
|
33
|
+
index += 1;
|
|
34
|
+
} else if (char === '"') quoted = false;
|
|
35
|
+
else cell += char;
|
|
36
|
+
} else if (char === '"' && cell === "") quoted = true;
|
|
37
|
+
else if (char === separator) {
|
|
38
|
+
row.push(cell);
|
|
39
|
+
cell = "";
|
|
40
|
+
} else if (char === "\n" || char === "\r") {
|
|
41
|
+
if (char === "\r" && text[index + 1] === "\n") index += 1;
|
|
42
|
+
row.push(cell);
|
|
43
|
+
rows.push(row);
|
|
44
|
+
row = [];
|
|
45
|
+
cell = "";
|
|
46
|
+
} else cell += char;
|
|
47
|
+
}
|
|
48
|
+
if (cell !== "" || row.length) {
|
|
49
|
+
row.push(cell);
|
|
50
|
+
rows.push(row);
|
|
51
|
+
}
|
|
52
|
+
return rows;
|
|
53
|
+
}
|
|
54
|
+
function toSheet(name, cells, raws) {
|
|
55
|
+
const rows = [];
|
|
56
|
+
const keptRaws = [];
|
|
57
|
+
const rowNumbers = [];
|
|
58
|
+
for (const [index, row] of cells.entries()) {
|
|
59
|
+
const texts = row.map((value) => value.trim());
|
|
60
|
+
if (!texts.some(Boolean)) continue;
|
|
61
|
+
rows.push(texts);
|
|
62
|
+
keptRaws.push(raws?.[index]);
|
|
63
|
+
rowNumbers.push(index + 1);
|
|
64
|
+
}
|
|
65
|
+
return { name, raws: keptRaws, rowNumbers, rows };
|
|
66
|
+
}
|
|
67
|
+
function cellText(cell) {
|
|
68
|
+
if (!cell || cell.v === void 0 || cell.v === null) return "";
|
|
69
|
+
return cell.w ?? String(cell.v);
|
|
70
|
+
}
|
|
71
|
+
function cellRaw(cell) {
|
|
72
|
+
if (!cell) return void 0;
|
|
73
|
+
if (cell.t === "n" || cell.t === "b" || cell.t === "d") return cell.v;
|
|
74
|
+
return void 0;
|
|
75
|
+
}
|
|
76
|
+
function readSheet(name, sheet) {
|
|
77
|
+
const reference = sheet?.["!ref"];
|
|
78
|
+
if (!sheet || !reference) return { name, raws: [], rowNumbers: [], rows: [] };
|
|
79
|
+
const range = utils.decode_range(reference);
|
|
80
|
+
const cells = [];
|
|
81
|
+
const raws = [];
|
|
82
|
+
for (let rowIndex = 0; rowIndex <= range.e.r; rowIndex += 1) {
|
|
83
|
+
const texts = [];
|
|
84
|
+
let typed;
|
|
85
|
+
for (let columnIndex = 0; columnIndex <= range.e.c; columnIndex += 1) {
|
|
86
|
+
const cell = sheet[utils.encode_cell({ c: columnIndex, r: rowIndex })];
|
|
87
|
+
texts.push(cellText(cell));
|
|
88
|
+
const raw = cellRaw(cell);
|
|
89
|
+
if (raw !== void 0) {
|
|
90
|
+
typed ??= [];
|
|
91
|
+
typed[columnIndex] = raw;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
cells.push(texts);
|
|
95
|
+
raws.push(typed);
|
|
96
|
+
}
|
|
97
|
+
return toSheet(name, cells, raws);
|
|
98
|
+
}
|
|
99
|
+
export async function readSpreadsheetFile(params) {
|
|
100
|
+
const bytes = await toBytes(params.source);
|
|
101
|
+
if (TEXT_EXTENSIONS.test(params.name))
|
|
102
|
+
return readSpreadsheetText({ name: params.name, text: decodeText(bytes) });
|
|
103
|
+
const workbook = read(bytes, { cellDates: true, type: "array" });
|
|
104
|
+
return {
|
|
105
|
+
name: params.name,
|
|
106
|
+
sheets: workbook.SheetNames.map(
|
|
107
|
+
(sheetName) => readSheet(sheetName, workbook.Sheets[sheetName])
|
|
108
|
+
)
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export function readSpreadsheetText(params) {
|
|
112
|
+
return {
|
|
113
|
+
name: params.name,
|
|
114
|
+
sheets: [
|
|
115
|
+
toSheet(
|
|
116
|
+
params.name.replace(/\.[^.]+$/u, "") || "Sheet 1",
|
|
117
|
+
parseSpreadsheetDelimitedText(params.text)
|
|
118
|
+
)
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
}
|
|
@@ -27,12 +27,12 @@ type __VLS_Slots = {} & {
|
|
|
27
27
|
trigger?: (props: typeof __VLS_10) => any;
|
|
28
28
|
};
|
|
29
29
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
-
dismiss: () => any;
|
|
31
30
|
back: () => any;
|
|
31
|
+
dismiss: () => any;
|
|
32
32
|
sessionClosed: () => any;
|
|
33
33
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
|
-
onDismiss?: (() => any) | undefined;
|
|
35
34
|
onBack?: (() => any) | undefined;
|
|
35
|
+
onDismiss?: (() => any) | undefined;
|
|
36
36
|
onSessionClosed?: (() => any) | undefined;
|
|
37
37
|
}>, {
|
|
38
38
|
header: boolean;
|
|
@@ -27,12 +27,12 @@ type __VLS_Slots = {} & {
|
|
|
27
27
|
trigger?: (props: typeof __VLS_10) => any;
|
|
28
28
|
};
|
|
29
29
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
-
dismiss: () => any;
|
|
31
30
|
back: () => any;
|
|
31
|
+
dismiss: () => any;
|
|
32
32
|
sessionClosed: () => any;
|
|
33
33
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
|
-
onDismiss?: (() => any) | undefined;
|
|
35
34
|
onBack?: (() => any) | undefined;
|
|
35
|
+
onDismiss?: (() => any) | undefined;
|
|
36
36
|
onSessionClosed?: (() => any) | undefined;
|
|
37
37
|
}>, {
|
|
38
38
|
header: boolean;
|
|
@@ -29,12 +29,12 @@ type __VLS_Slots = {} & {
|
|
|
29
29
|
trigger?: (props: typeof __VLS_10) => any;
|
|
30
30
|
};
|
|
31
31
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
-
dismiss: () => any;
|
|
33
32
|
back: () => any;
|
|
33
|
+
dismiss: () => any;
|
|
34
34
|
sessionClosed: () => any;
|
|
35
35
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
36
|
-
onDismiss?: (() => any) | undefined;
|
|
37
36
|
onBack?: (() => any) | undefined;
|
|
37
|
+
onDismiss?: (() => any) | undefined;
|
|
38
38
|
onSessionClosed?: (() => any) | undefined;
|
|
39
39
|
}>, {
|
|
40
40
|
header: boolean;
|
|
@@ -29,12 +29,12 @@ type __VLS_Slots = {} & {
|
|
|
29
29
|
trigger?: (props: typeof __VLS_10) => any;
|
|
30
30
|
};
|
|
31
31
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
-
dismiss: () => any;
|
|
33
32
|
back: () => any;
|
|
33
|
+
dismiss: () => any;
|
|
34
34
|
sessionClosed: () => any;
|
|
35
35
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
36
|
-
onDismiss?: (() => any) | undefined;
|
|
37
36
|
onBack?: (() => any) | undefined;
|
|
37
|
+
onDismiss?: (() => any) | undefined;
|
|
38
38
|
onSessionClosed?: (() => any) | undefined;
|
|
39
39
|
}>, {
|
|
40
40
|
header: boolean;
|
|
@@ -28,12 +28,12 @@ type __VLS_Slots = {} & {
|
|
|
28
28
|
trigger?: (props: typeof __VLS_10) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
-
dismiss: () => any;
|
|
32
31
|
back: () => any;
|
|
32
|
+
dismiss: () => any;
|
|
33
33
|
sessionClosed: () => any;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
-
onDismiss?: (() => any) | undefined;
|
|
36
35
|
onBack?: (() => any) | undefined;
|
|
36
|
+
onDismiss?: (() => any) | undefined;
|
|
37
37
|
onSessionClosed?: (() => any) | undefined;
|
|
38
38
|
}>, {
|
|
39
39
|
header: boolean;
|
|
@@ -28,12 +28,12 @@ type __VLS_Slots = {} & {
|
|
|
28
28
|
trigger?: (props: typeof __VLS_10) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
-
dismiss: () => any;
|
|
32
31
|
back: () => any;
|
|
32
|
+
dismiss: () => any;
|
|
33
33
|
sessionClosed: () => any;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
-
onDismiss?: (() => any) | undefined;
|
|
36
35
|
onBack?: (() => any) | undefined;
|
|
36
|
+
onDismiss?: (() => any) | undefined;
|
|
37
37
|
onSessionClosed?: (() => any) | undefined;
|
|
38
38
|
}>, {
|
|
39
39
|
header: boolean;
|
|
@@ -28,12 +28,12 @@ type __VLS_Slots = {} & {
|
|
|
28
28
|
trigger?: (props: typeof __VLS_10) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
-
dismiss: () => any;
|
|
32
31
|
back: () => any;
|
|
32
|
+
dismiss: () => any;
|
|
33
33
|
sessionClosed: () => any;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
-
onDismiss?: (() => any) | undefined;
|
|
36
35
|
onBack?: (() => any) | undefined;
|
|
36
|
+
onDismiss?: (() => any) | undefined;
|
|
37
37
|
onSessionClosed?: (() => any) | undefined;
|
|
38
38
|
}>, {
|
|
39
39
|
header: boolean;
|
|
@@ -28,12 +28,12 @@ type __VLS_Slots = {} & {
|
|
|
28
28
|
trigger?: (props: typeof __VLS_10) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
-
dismiss: () => any;
|
|
32
31
|
back: () => any;
|
|
32
|
+
dismiss: () => any;
|
|
33
33
|
sessionClosed: () => any;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
-
onDismiss?: (() => any) | undefined;
|
|
36
35
|
onBack?: (() => any) | undefined;
|
|
36
|
+
onDismiss?: (() => any) | undefined;
|
|
37
37
|
onSessionClosed?: (() => any) | undefined;
|
|
38
38
|
}>, {
|
|
39
39
|
header: boolean;
|
|
@@ -28,12 +28,12 @@ type __VLS_Slots = {} & {
|
|
|
28
28
|
trigger?: (props: typeof __VLS_10) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
-
dismiss: () => any;
|
|
32
31
|
back: () => any;
|
|
32
|
+
dismiss: () => any;
|
|
33
33
|
sessionClosed: () => any;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
-
onDismiss?: (() => any) | undefined;
|
|
36
35
|
onBack?: (() => any) | undefined;
|
|
36
|
+
onDismiss?: (() => any) | undefined;
|
|
37
37
|
onSessionClosed?: (() => any) | undefined;
|
|
38
38
|
}>, {
|
|
39
39
|
header: boolean;
|
|
@@ -28,12 +28,12 @@ type __VLS_Slots = {} & {
|
|
|
28
28
|
trigger?: (props: typeof __VLS_10) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
-
dismiss: () => any;
|
|
32
31
|
back: () => any;
|
|
32
|
+
dismiss: () => any;
|
|
33
33
|
sessionClosed: () => any;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
-
onDismiss?: (() => any) | undefined;
|
|
36
35
|
onBack?: (() => any) | undefined;
|
|
36
|
+
onDismiss?: (() => any) | undefined;
|
|
37
37
|
onSessionClosed?: (() => any) | undefined;
|
|
38
38
|
}>, {
|
|
39
39
|
header: boolean;
|
|
@@ -26,8 +26,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
26
26
|
type: StringConstructor;
|
|
27
27
|
};
|
|
28
28
|
}>> & Readonly<{}>, {
|
|
29
|
-
disabled: boolean;
|
|
30
29
|
title: string;
|
|
30
|
+
disabled: boolean;
|
|
31
31
|
wrapperClass: string;
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
33
|
export default _default;
|
|
@@ -21,7 +21,7 @@ export declare function useTableActions(options: UseTableActionsParams): {
|
|
|
21
21
|
actions: ComputedRef<TableActionController[]>;
|
|
22
22
|
bulkActions: ComputedRef<TableActionController[]>;
|
|
23
23
|
definitions: ComputedRef<TableActionDefinition[]>;
|
|
24
|
-
execute: (definition: TableActionDefinition) => Promise<
|
|
24
|
+
execute: (definition: TableActionDefinition) => Promise<boolean>;
|
|
25
25
|
runningKeys: import("vue").Ref<string[], string[]>;
|
|
26
26
|
toolbarActions: ComputedRef<TableActionController[]>;
|
|
27
27
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { computed, ref } from "vue";
|
|
2
|
+
import { isRecord } from "../../shared/utils/path.js";
|
|
2
3
|
import { isFunction } from "../../shared/utils/predicate.js";
|
|
3
4
|
import { resolveTableActionDefinitions } from "../utils/actions.js";
|
|
4
5
|
export function useTableActions(options) {
|
|
@@ -46,10 +47,10 @@ export function useTableActions(options) {
|
|
|
46
47
|
async function execute(definition) {
|
|
47
48
|
const state = resolveState(definition);
|
|
48
49
|
if (!state.visible || state.disabled || state.loading || state.running) {
|
|
49
|
-
return;
|
|
50
|
+
return false;
|
|
50
51
|
}
|
|
51
52
|
if (!definition.action) {
|
|
52
|
-
return;
|
|
53
|
+
return false;
|
|
53
54
|
}
|
|
54
55
|
const actionContext = context.value;
|
|
55
56
|
runningKeys.value = [...runningKeys.value, definition.key];
|
|
@@ -58,10 +59,14 @@ export function useTableActions(options) {
|
|
|
58
59
|
selectionApi.clear();
|
|
59
60
|
}
|
|
60
61
|
try {
|
|
61
|
-
await definition.action(actionContext);
|
|
62
|
+
const result = await definition.action(actionContext);
|
|
63
|
+
if (isFailedActionResult(result)) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
62
66
|
if (selectionClear === "success") {
|
|
63
67
|
selectionApi.clear();
|
|
64
68
|
}
|
|
69
|
+
return true;
|
|
65
70
|
} finally {
|
|
66
71
|
runningKeys.value = runningKeys.value.filter((key) => key !== definition.key);
|
|
67
72
|
}
|
|
@@ -111,6 +116,9 @@ function resolveFlag(value, context) {
|
|
|
111
116
|
function isBooleanResolver(value) {
|
|
112
117
|
return isFunction(value);
|
|
113
118
|
}
|
|
119
|
+
function isFailedActionResult(result) {
|
|
120
|
+
return result === false || isRecord(result) && result.success === false;
|
|
121
|
+
}
|
|
114
122
|
function toPlainRecord(value) {
|
|
115
123
|
return Object.fromEntries(Object.entries(value));
|
|
116
124
|
}
|
|
@@ -22,7 +22,7 @@ declare function createTableInternals<TSchema>(options: {
|
|
|
22
22
|
[x: string]: unknown;
|
|
23
23
|
}, {
|
|
24
24
|
[x: string]: unknown;
|
|
25
|
-
}>) => Promise<
|
|
25
|
+
}>) => Promise<boolean>;
|
|
26
26
|
runningKeys: import("vue").Ref<string[], string[]>;
|
|
27
27
|
toolbarActions: import("vue").ComputedRef<import("./use-table-actions.js").TableActionController[]>;
|
|
28
28
|
};
|
|
@@ -618,7 +618,7 @@ declare function useProvideTableInternals<TSchema>(options: {
|
|
|
618
618
|
[x: string]: unknown;
|
|
619
619
|
}, {
|
|
620
620
|
[x: string]: unknown;
|
|
621
|
-
}>) => Promise<
|
|
621
|
+
}>) => Promise<boolean>;
|
|
622
622
|
runningKeys: import("vue").Ref<string[], string[]>;
|
|
623
623
|
toolbarActions: import("vue").ComputedRef<import("./use-table-actions.js").TableActionController[]>;
|
|
624
624
|
};
|
|
@@ -1211,7 +1211,7 @@ declare function useTableInternals(): {
|
|
|
1211
1211
|
[x: string]: unknown;
|
|
1212
1212
|
}, {
|
|
1213
1213
|
[x: string]: unknown;
|
|
1214
|
-
}>) => Promise<
|
|
1214
|
+
}>) => Promise<boolean>;
|
|
1215
1215
|
runningKeys: import("vue").Ref<string[], string[]>;
|
|
1216
1216
|
toolbarActions: import("vue").ComputedRef<import("./use-table-actions.js").TableActionController[]>;
|
|
1217
1217
|
};
|
|
@@ -18,10 +18,16 @@ export interface TableToolbarAction<TRow extends GenericObject = GenericObject,
|
|
|
18
18
|
condition?: boolean | ((context: TContext) => boolean);
|
|
19
19
|
disabled?: boolean | ((context: TableActionContext<TRow, TContext, TPageContext>) => boolean);
|
|
20
20
|
loading?: boolean | ((context: TableActionContext<TRow, TContext, TPageContext>) => boolean);
|
|
21
|
+
/**
|
|
22
|
+
* Runs the action. Returning `false` or `{ success: false }` marks the run as failed without
|
|
23
|
+
* throwing, like a form submit handler: the selection is kept and `execute()` resolves `false`.
|
|
24
|
+
* A rejection also keeps the selection and propagates to the caller.
|
|
25
|
+
*/
|
|
21
26
|
action?: (context: TableActionContext<TRow, TContext, TPageContext>) => MaybePromise<unknown>;
|
|
22
27
|
}
|
|
23
28
|
export interface TableBulkAction<TRow extends GenericObject = GenericObject, TContext extends GenericObject = GenericObject, TPageContext extends GenericObject = GenericObject> extends TableToolbarAction<TRow, TContext, TPageContext> {
|
|
24
29
|
requiresSelection?: boolean;
|
|
30
|
+
/** When the selection clears: before the action runs, after it succeeds, or never. */
|
|
25
31
|
selectionClear?: 'trigger' | 'success' | 'never';
|
|
26
32
|
}
|
|
27
33
|
/** Runtime state exposed for a configured toolbar or bulk action. */
|
|
@@ -42,7 +48,8 @@ export interface TableActionSlotProps<TRow extends GenericObject = GenericObject
|
|
|
42
48
|
state: TableActionState;
|
|
43
49
|
running: boolean;
|
|
44
50
|
selection: TableApi['selection'];
|
|
45
|
-
|
|
51
|
+
/** Runs the action and resolves `true` when it ran and succeeded. */
|
|
52
|
+
execute: () => Promise<boolean>;
|
|
46
53
|
}
|
|
47
54
|
export interface TableRowActionContext<TRow extends GenericObject = GenericObject, TContext extends GenericObject = GenericObject, TPageContext extends GenericObject = GenericObject> extends TableRowRenderParams<TRow, TContext, TPageContext> {
|
|
48
55
|
layout: TableLayout;
|
|
@@ -122,6 +122,6 @@ export declare function resolveDataListTableDensity(density: DataListDensity): {
|
|
|
122
122
|
export declare function resolveDataListContentShellClass(options: {
|
|
123
123
|
layout: 'table' | 'grid';
|
|
124
124
|
surface: DataListContentSurface;
|
|
125
|
-
}): "overflow-hidden" | "grid gap-5 overflow-hidden rounded-md border border-default bg-default" | "
|
|
125
|
+
}): "grid gap-5" | "overflow-hidden" | "grid gap-5 overflow-hidden rounded-md border border-default bg-default" | "overflow-hidden rounded-md border border-default bg-default";
|
|
126
126
|
/** Merges application and root DataList defaults without losing nested UI slots. */
|
|
127
127
|
export declare function mergeDataListUiConfig(appUi: DataListUiConfig | undefined, componentUi: DataListUiConfig | undefined, density?: DataListDensity, size?: DataListControlSize): DataListUiConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-ui-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Nuxt module and runtime toolkit for UI-heavy Nuxt applications",
|
|
5
5
|
"homepage": "https://github.com/ChronicStone/nuxt-ui-tools#readme",
|
|
6
6
|
"bugs": "https://github.com/ChronicStone/nuxt-ui-tools/issues",
|
|
@@ -43,6 +43,9 @@
|
|
|
43
43
|
],
|
|
44
44
|
"table": [
|
|
45
45
|
"./dist/runtime/table/index.d.ts"
|
|
46
|
+
],
|
|
47
|
+
"spreadsheet": [
|
|
48
|
+
"./dist/runtime/spreadsheet/index.d.ts"
|
|
46
49
|
]
|
|
47
50
|
}
|
|
48
51
|
},
|
|
@@ -110,6 +113,14 @@
|
|
|
110
113
|
"#ui-tools/table/*": {
|
|
111
114
|
"types": "./dist/runtime/table/*.d.ts",
|
|
112
115
|
"default": "./dist/runtime/table/*.js"
|
|
116
|
+
},
|
|
117
|
+
"#ui-tools/spreadsheet": {
|
|
118
|
+
"types": "./dist/runtime/spreadsheet/index.d.ts",
|
|
119
|
+
"default": "./dist/runtime/spreadsheet/index.js"
|
|
120
|
+
},
|
|
121
|
+
"#ui-tools/spreadsheet/*": {
|
|
122
|
+
"types": "./dist/runtime/spreadsheet/*.d.ts",
|
|
123
|
+
"default": "./dist/runtime/spreadsheet/*.js"
|
|
113
124
|
}
|
|
114
125
|
},
|
|
115
126
|
"exports": {
|
|
@@ -148,6 +159,10 @@
|
|
|
148
159
|
"./table": {
|
|
149
160
|
"types": "./dist/runtime/table/index.d.ts",
|
|
150
161
|
"import": "./dist/runtime/table/index.js"
|
|
162
|
+
},
|
|
163
|
+
"./spreadsheet": {
|
|
164
|
+
"types": "./dist/runtime/spreadsheet/index.d.ts",
|
|
165
|
+
"import": "./dist/runtime/spreadsheet/index.js"
|
|
151
166
|
}
|
|
152
167
|
},
|
|
153
168
|
"publishConfig": {
|
|
@@ -217,7 +232,7 @@
|
|
|
217
232
|
"vitest": "5.0.2",
|
|
218
233
|
"vue-draggable-plus": "0.6.1",
|
|
219
234
|
"vue-tsc": "3.3.11",
|
|
220
|
-
"xlsx": "0.
|
|
235
|
+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
221
236
|
},
|
|
222
237
|
"peerDependencies": {
|
|
223
238
|
"@internationalized/date": ">=3.12.0",
|
|
@@ -234,7 +249,7 @@
|
|
|
234
249
|
"vue": ">=3.5.41",
|
|
235
250
|
"vue-draggable-plus": ">=0.6.1",
|
|
236
251
|
"vue-router": ">=4.6.4",
|
|
237
|
-
"xlsx": ">=0.
|
|
252
|
+
"xlsx": ">=0.20.2"
|
|
238
253
|
},
|
|
239
254
|
"peerDependenciesMeta": {
|
|
240
255
|
"@unovis/ts": {
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import UIcon from "@nuxt/ui/components/Icon.vue";
|
|
3
|
-
defineProps({
|
|
4
|
-
fileName: { type: String, required: false },
|
|
5
|
-
totalSheets: { type: Number, required: true },
|
|
6
|
-
rowCount: { type: Number, required: true },
|
|
7
|
-
hasWorkbook: { type: Boolean, required: true }
|
|
8
|
-
});
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<div
|
|
13
|
-
class="flex min-h-10 flex-wrap items-center gap-3 border border-default/70 bg-default px-4 py-2.5"
|
|
14
|
-
>
|
|
15
|
-
<template v-if="hasWorkbook">
|
|
16
|
-
<UIcon name="i-lucide-file-spreadsheet" class="size-4 text-success" />
|
|
17
|
-
<span class="font-mono text-xs font-medium text-highlighted">
|
|
18
|
-
{{ fileName ?? "Untitled workbook" }}
|
|
19
|
-
</span>
|
|
20
|
-
<div class="h-4 w-px bg-default/70" />
|
|
21
|
-
<span class="font-mono text-[11px] text-muted">
|
|
22
|
-
{{ totalSheets }} sheets · {{ rowCount }} rows
|
|
23
|
-
</span>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<template v-else>
|
|
27
|
-
<UIcon name="i-lucide-file-spreadsheet" class="size-[18px] text-muted" />
|
|
28
|
-
<span class="font-mono text-[11px] text-muted"> No file loaded </span>
|
|
29
|
-
</template>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
hint?: string;
|
|
3
|
-
showPrevious?: boolean;
|
|
4
|
-
previousLabel?: string;
|
|
5
|
-
primaryLabel: string;
|
|
6
|
-
primaryDisabled?: boolean;
|
|
7
|
-
primaryLoading?: boolean;
|
|
8
|
-
showExport?: boolean;
|
|
9
|
-
exportLabel?: string;
|
|
10
|
-
metaText?: string;
|
|
11
|
-
primaryColor?: 'primary' | 'success';
|
|
12
|
-
primaryIcon?: string;
|
|
13
|
-
};
|
|
14
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
-
previous: () => any;
|
|
16
|
-
primary: () => any;
|
|
17
|
-
export: () => any;
|
|
18
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
-
onPrevious?: (() => any) | undefined;
|
|
20
|
-
onPrimary?: (() => any) | undefined;
|
|
21
|
-
onExport?: (() => any) | undefined;
|
|
22
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
-
declare const _default: typeof __VLS_export;
|
|
24
|
-
export default _default;
|