nuxt-ui-tools 1.12.0 → 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.
Files changed (321) hide show
  1. package/README.md +11 -5
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +46 -0
  4. package/dist/runtime/dashboard/components/dashboard-stat.d.vue.ts +1 -1
  5. package/dist/runtime/dashboard/components/dashboard-stat.vue.d.ts +1 -1
  6. package/dist/runtime/file-preview/components/shell/file-preview-stage.d.vue.ts +2 -2
  7. package/dist/runtime/file-preview/components/shell/file-preview-stage.vue.d.ts +2 -2
  8. package/dist/runtime/i18n/locales/en.js +251 -130
  9. package/dist/runtime/i18n/locales/fr.js +251 -130
  10. package/dist/runtime/i18n/types.d.ts +241 -119
  11. package/dist/runtime/shared/types/remote-options.d.ts +11 -0
  12. package/dist/runtime/shared/utils/define-remote-options.js +6 -0
  13. package/dist/runtime/shared/utils/file.d.ts +1 -1
  14. package/dist/runtime/spreadsheet/components/{steps/review/spreadsheet-review-overflow-alert.d.vue.ts → internal/spreadsheet-import-cell-editor.d.vue.ts} +8 -5
  15. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-cell-editor.vue +73 -0
  16. package/dist/runtime/spreadsheet/components/{steps/review/spreadsheet-review-overflow-alert.vue.d.ts → internal/spreadsheet-import-cell-editor.vue.d.ts} +8 -5
  17. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-column-row.d.vue.ts +17 -0
  18. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-column-row.vue +98 -0
  19. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-column-row.vue.d.ts +17 -0
  20. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-heading.d.vue.ts +17 -0
  21. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-heading.vue +20 -0
  22. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-heading.vue.d.ts +17 -0
  23. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-status-badge.d.vue.ts +10 -0
  24. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-status-badge.vue +34 -0
  25. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-status-badge.vue.d.ts +10 -0
  26. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-value-row.d.vue.ts +13 -0
  27. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-value-row.vue +113 -0
  28. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-value-row.vue.d.ts +13 -0
  29. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-column-mapping.d.vue.ts +35 -0
  30. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-column-mapping.vue +154 -0
  31. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-column-mapping.vue.d.ts +35 -0
  32. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-dropzone.d.vue.ts +23 -0
  33. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-dropzone.vue +83 -0
  34. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-dropzone.vue.d.ts +23 -0
  35. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-expected-columns.d.vue.ts +19 -0
  36. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-expected-columns.vue +45 -0
  37. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-expected-columns.vue.d.ts +19 -0
  38. package/dist/runtime/spreadsheet/components/{shared/spreadsheet-object-preview-table.d.vue.ts → parts/spreadsheet-import-export-button.d.vue.ts} +3 -2
  39. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-export-button.vue +34 -0
  40. package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-file-bar.vue.d.ts → parts/spreadsheet-import-export-button.vue.d.ts} +3 -4
  41. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-file-card.d.vue.ts +17 -0
  42. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-file-card.vue +49 -0
  43. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-file-card.vue.d.ts +17 -0
  44. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-progress.d.vue.ts +18 -0
  45. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-progress.vue +101 -0
  46. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-progress.vue.d.ts +18 -0
  47. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-row-inspector.d.vue.ts +22 -0
  48. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-row-inspector.vue +276 -0
  49. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-row-inspector.vue.d.ts +22 -0
  50. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-source-settings.d.vue.ts +11 -0
  51. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-source-settings.vue +164 -0
  52. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-source-settings.vue.d.ts +11 -0
  53. package/dist/runtime/spreadsheet/components/{shared/spreadsheet-value-preview.d.vue.ts → parts/spreadsheet-import-stat.d.vue.ts} +7 -4
  54. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-stat.vue +30 -0
  55. package/dist/runtime/spreadsheet/components/{shared/spreadsheet-value-preview.vue.d.ts → parts/spreadsheet-import-stat.vue.d.ts} +7 -4
  56. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-stats.d.vue.ts +26 -0
  57. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-stats.vue +55 -0
  58. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-stats.vue.d.ts +26 -0
  59. package/dist/runtime/spreadsheet/components/{shared/spreadsheet-object-preview-table.vue.d.ts → parts/spreadsheet-import-submit-button.d.vue.ts} +3 -2
  60. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-submit-button.vue +27 -0
  61. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-submit-button.vue.d.ts +8 -0
  62. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-summary.d.vue.ts +16 -0
  63. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-summary.vue +51 -0
  64. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-summary.vue.d.ts +16 -0
  65. package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-file-bar.d.vue.ts → parts/spreadsheet-import-table-toolbar.d.vue.ts} +2 -4
  66. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-table-toolbar.vue +217 -0
  67. package/dist/runtime/spreadsheet/components/{shared/spreadsheet-raw-preview-table.d.vue.ts → parts/spreadsheet-import-table-toolbar.vue.d.ts} +2 -2
  68. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-table.d.vue.ts +33 -0
  69. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-table.vue +302 -0
  70. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-table.vue.d.ts +33 -0
  71. package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-sidebar.d.vue.ts → parts/spreadsheet-import-template-button.d.vue.ts} +5 -4
  72. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-template-button.vue +31 -0
  73. package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-sidebar.vue.d.ts → parts/spreadsheet-import-template-button.vue.d.ts} +5 -4
  74. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-value-mapping.d.vue.ts +27 -0
  75. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-value-mapping.vue +162 -0
  76. package/dist/runtime/spreadsheet/components/parts/spreadsheet-import-value-mapping.vue.d.ts +27 -0
  77. package/dist/runtime/spreadsheet/components/spreadsheet-import-root.d.vue.ts +24 -0
  78. package/dist/runtime/spreadsheet/components/spreadsheet-import-root.vue +23 -0
  79. package/dist/runtime/spreadsheet/components/spreadsheet-import-root.vue.d.ts +24 -0
  80. package/dist/runtime/spreadsheet/components/spreadsheet-import.d.vue.ts +21 -6
  81. package/dist/runtime/spreadsheet/components/spreadsheet-import.vue +46 -262
  82. package/dist/runtime/spreadsheet/components/spreadsheet-import.vue.d.ts +21 -6
  83. package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-header.d.vue.ts → steps/spreadsheet-import-step-nav.d.vue.ts} +6 -2
  84. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-step-nav.vue +116 -0
  85. package/dist/runtime/spreadsheet/components/{layout/spreadsheet-import-header.vue.d.ts → steps/spreadsheet-import-step-nav.vue.d.ts} +6 -2
  86. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-step.d.vue.ts +26 -0
  87. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-step.vue +106 -0
  88. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-step.vue.d.ts +26 -0
  89. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-stepper.d.vue.ts +15 -0
  90. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-stepper.vue +131 -0
  91. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-stepper.vue.d.ts +15 -0
  92. package/dist/runtime/spreadsheet/composables/index.d.ts +2 -0
  93. package/dist/runtime/spreadsheet/composables/index.js +2 -0
  94. package/dist/runtime/spreadsheet/composables/use-spreadsheet-answers.d.ts +8 -0
  95. package/dist/runtime/spreadsheet/composables/use-spreadsheet-answers.js +19 -0
  96. package/dist/runtime/spreadsheet/composables/use-spreadsheet-columns.d.ts +23 -0
  97. package/dist/runtime/spreadsheet/composables/use-spreadsheet-columns.js +75 -0
  98. package/dist/runtime/spreadsheet/composables/use-spreadsheet-context.d.ts +8 -45
  99. package/dist/runtime/spreadsheet/composables/use-spreadsheet-context.js +28 -32
  100. package/dist/runtime/spreadsheet/composables/use-spreadsheet-edits.d.ts +11 -0
  101. package/dist/runtime/spreadsheet/composables/use-spreadsheet-edits.js +25 -0
  102. package/dist/runtime/spreadsheet/composables/use-spreadsheet-fields.d.ts +16 -0
  103. package/dist/runtime/spreadsheet/composables/use-spreadsheet-fields.js +20 -0
  104. package/dist/runtime/spreadsheet/composables/use-spreadsheet-file.d.ts +14 -0
  105. package/dist/runtime/spreadsheet/composables/use-spreadsheet-file.js +44 -0
  106. package/dist/runtime/spreadsheet/composables/use-spreadsheet-import-context.d.ts +12 -0
  107. package/dist/runtime/spreadsheet/composables/use-spreadsheet-import-context.js +22 -0
  108. package/dist/runtime/spreadsheet/composables/use-spreadsheet-import.d.ts +18 -7
  109. package/dist/runtime/spreadsheet/composables/use-spreadsheet-import.js +340 -109
  110. package/dist/runtime/spreadsheet/composables/use-spreadsheet-layout.d.ts +36 -0
  111. package/dist/runtime/spreadsheet/composables/use-spreadsheet-layout.js +95 -0
  112. package/dist/runtime/spreadsheet/composables/use-spreadsheet-options.d.ts +24 -0
  113. package/dist/runtime/spreadsheet/composables/use-spreadsheet-options.js +159 -0
  114. package/dist/runtime/spreadsheet/composables/use-spreadsheet-queries.d.ts +14 -0
  115. package/dist/runtime/spreadsheet/composables/use-spreadsheet-queries.js +11 -0
  116. package/dist/runtime/spreadsheet/composables/use-spreadsheet-review.d.ts +37 -169
  117. package/dist/runtime/spreadsheet/composables/use-spreadsheet-review.js +148 -408
  118. package/dist/runtime/spreadsheet/composables/use-spreadsheet-rows.d.ts +48 -26
  119. package/dist/runtime/spreadsheet/composables/use-spreadsheet-rows.js +334 -21
  120. package/dist/runtime/spreadsheet/composables/use-spreadsheet-steps.d.ts +33 -0
  121. package/dist/runtime/spreadsheet/composables/use-spreadsheet-steps.js +126 -0
  122. package/dist/runtime/spreadsheet/composables/use-spreadsheet-submit.d.ts +37 -0
  123. package/dist/runtime/spreadsheet/composables/use-spreadsheet-submit.js +136 -0
  124. package/dist/runtime/spreadsheet/composables/use-spreadsheet-values.d.ts +27 -0
  125. package/dist/runtime/spreadsheet/composables/use-spreadsheet-values.js +121 -0
  126. package/dist/runtime/spreadsheet/index.d.ts +0 -1
  127. package/dist/runtime/spreadsheet/index.js +0 -1
  128. package/dist/runtime/spreadsheet/schema/builder.d.ts +8 -0
  129. package/dist/runtime/spreadsheet/schema/builder.js +31 -0
  130. package/dist/runtime/spreadsheet/schema/index.d.ts +24 -32
  131. package/dist/runtime/spreadsheet/schema/index.js +4 -21
  132. package/dist/runtime/spreadsheet/types/columns.d.ts +252 -273
  133. package/dist/runtime/spreadsheet/types/fields.d.ts +64 -0
  134. package/dist/runtime/spreadsheet/types/importer.d.ts +308 -0
  135. package/dist/runtime/spreadsheet/types/index.d.ts +6 -10
  136. package/dist/runtime/spreadsheet/types/options.d.ts +47 -9
  137. package/dist/runtime/spreadsheet/types/rows.d.ts +57 -48
  138. package/dist/runtime/spreadsheet/types/schema.d.ts +162 -76
  139. package/dist/runtime/spreadsheet/types/shared.d.ts +19 -21
  140. package/dist/runtime/spreadsheet/types/source.d.ts +39 -15
  141. package/dist/runtime/spreadsheet/types/steps.d.ts +76 -0
  142. package/dist/runtime/spreadsheet/types/validation.d.ts +49 -69
  143. package/dist/runtime/spreadsheet/types/values.d.ts +77 -0
  144. package/dist/runtime/spreadsheet/utils/download.d.ts +2 -0
  145. package/dist/runtime/spreadsheet/utils/download.js +8 -0
  146. package/dist/runtime/spreadsheet/utils/export.d.ts +26 -0
  147. package/dist/runtime/spreadsheet/utils/export.js +50 -0
  148. package/dist/runtime/spreadsheet/utils/fields.d.ts +26 -0
  149. package/dist/runtime/spreadsheet/utils/fields.js +169 -0
  150. package/dist/runtime/spreadsheet/utils/guards.d.ts +18 -0
  151. package/dist/runtime/spreadsheet/utils/guards.js +27 -0
  152. package/dist/runtime/spreadsheet/utils/headers.d.ts +15 -0
  153. package/dist/runtime/spreadsheet/utils/headers.js +36 -0
  154. package/dist/runtime/spreadsheet/utils/identity.d.ts +24 -0
  155. package/dist/runtime/spreadsheet/utils/identity.js +57 -0
  156. package/dist/runtime/spreadsheet/utils/index.d.ts +15 -6
  157. package/dist/runtime/spreadsheet/utils/index.js +15 -6
  158. package/dist/runtime/spreadsheet/utils/layout.d.ts +12 -0
  159. package/dist/runtime/spreadsheet/utils/layout.js +37 -0
  160. package/dist/runtime/spreadsheet/utils/options.d.ts +31 -10
  161. package/dist/runtime/spreadsheet/utils/options.js +58 -30
  162. package/dist/runtime/spreadsheet/utils/parse.d.ts +6 -0
  163. package/dist/runtime/spreadsheet/utils/parse.js +147 -0
  164. package/dist/runtime/spreadsheet/utils/paths.d.ts +4 -0
  165. package/dist/runtime/spreadsheet/utils/paths.js +29 -0
  166. package/dist/runtime/spreadsheet/utils/rows.d.ts +69 -0
  167. package/dist/runtime/spreadsheet/utils/rows.js +168 -0
  168. package/dist/runtime/spreadsheet/utils/rules.d.ts +4 -0
  169. package/dist/runtime/spreadsheet/utils/rules.js +95 -0
  170. package/dist/runtime/spreadsheet/utils/suggestions.d.ts +20 -0
  171. package/dist/runtime/spreadsheet/utils/suggestions.js +43 -0
  172. package/dist/runtime/spreadsheet/utils/text.d.ts +9 -0
  173. package/dist/runtime/spreadsheet/utils/text.js +11 -0
  174. package/dist/runtime/spreadsheet/utils/workbook.d.ts +13 -0
  175. package/dist/runtime/spreadsheet/utils/workbook.js +121 -0
  176. package/dist/runtime/table/components/filters/tags/boolean-filter-tag.d.vue.ts +2 -2
  177. package/dist/runtime/table/components/filters/tags/boolean-filter-tag.vue.d.ts +2 -2
  178. package/dist/runtime/table/components/filters/tags/date-filter-tag.d.vue.ts +2 -2
  179. package/dist/runtime/table/components/filters/tags/date-filter-tag.vue.d.ts +2 -2
  180. package/dist/runtime/table/components/filters/tags/number-filter-tag.d.vue.ts +2 -2
  181. package/dist/runtime/table/components/filters/tags/number-filter-tag.vue.d.ts +2 -2
  182. package/dist/runtime/table/components/filters/tags/option-filter-tag.d.vue.ts +2 -2
  183. package/dist/runtime/table/components/filters/tags/option-filter-tag.vue.d.ts +2 -2
  184. package/dist/runtime/table/components/filters/tags/text-filter-tag.d.vue.ts +2 -2
  185. package/dist/runtime/table/components/filters/tags/text-filter-tag.vue.d.ts +2 -2
  186. package/dist/runtime/table/components/table/table-cell-ellipsis.d.ts +1 -1
  187. package/dist/runtime/table/utils/data-list-ui.d.ts +1 -1
  188. package/package.json +18 -3
  189. package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-file-bar.vue +0 -31
  190. package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.d.vue.ts +0 -24
  191. package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.vue +0 -69
  192. package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.vue.d.ts +0 -24
  193. package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-header.vue +0 -36
  194. package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-sidebar.vue +0 -63
  195. package/dist/runtime/spreadsheet/components/shared/spreadsheet-object-preview-table.vue +0 -67
  196. package/dist/runtime/spreadsheet/components/shared/spreadsheet-raw-preview-table.vue +0 -41
  197. package/dist/runtime/spreadsheet/components/shared/spreadsheet-raw-preview-table.vue.d.ts +0 -7
  198. package/dist/runtime/spreadsheet/components/shared/spreadsheet-summary-stats.d.vue.ts +0 -10
  199. package/dist/runtime/spreadsheet/components/shared/spreadsheet-summary-stats.vue +0 -25
  200. package/dist/runtime/spreadsheet/components/shared/spreadsheet-summary-stats.vue.d.ts +0 -10
  201. package/dist/runtime/spreadsheet/components/shared/spreadsheet-value-preview.vue +0 -201
  202. package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-summary.d.vue.ts +0 -11
  203. package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-summary.vue +0 -38
  204. package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-summary.vue.d.ts +0 -11
  205. package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-table.d.vue.ts +0 -45
  206. package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-table.vue +0 -219
  207. package/dist/runtime/spreadsheet/components/steps/matching/spreadsheet-matching-table.vue.d.ts +0 -45
  208. package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-accordion.d.vue.ts +0 -51
  209. package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-accordion.vue +0 -166
  210. package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-accordion.vue.d.ts +0 -51
  211. package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-summary.d.vue.ts +0 -11
  212. package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-summary.vue +0 -26
  213. package/dist/runtime/spreadsheet/components/steps/references/spreadsheet-references-summary.vue.d.ts +0 -11
  214. package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-inspection.d.vue.ts +0 -41
  215. package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-inspection.vue +0 -392
  216. package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-inspection.vue.d.ts +0 -41
  217. package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-overflow-alert.vue +0 -43
  218. package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-stats.d.vue.ts +0 -15
  219. package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-stats.vue +0 -40
  220. package/dist/runtime/spreadsheet/components/steps/review/spreadsheet-review-stats.vue.d.ts +0 -15
  221. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-matching-step.d.vue.ts +0 -7
  222. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-matching-step.vue +0 -137
  223. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-matching-step.vue.d.ts +0 -7
  224. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-references-step.d.vue.ts +0 -7
  225. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-references-step.vue +0 -222
  226. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-references-step.vue.d.ts +0 -7
  227. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-review-step.d.vue.ts +0 -7
  228. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-review-step.vue +0 -191
  229. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-review-step.vue.d.ts +0 -7
  230. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-structure-step.d.vue.ts +0 -7
  231. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-structure-step.vue +0 -62
  232. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-structure-step.vue.d.ts +0 -7
  233. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-upload-step.d.vue.ts +0 -8
  234. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-upload-step.vue +0 -81
  235. package/dist/runtime/spreadsheet/components/steps/spreadsheet-import-upload-step.vue.d.ts +0 -8
  236. package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-preview-table.d.vue.ts +0 -15
  237. package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-preview-table.vue +0 -95
  238. package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-preview-table.vue.d.ts +0 -15
  239. package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-sheet-list.d.vue.ts +0 -15
  240. package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-sheet-list.vue +0 -56
  241. package/dist/runtime/spreadsheet/components/steps/structure/spreadsheet-structure-sheet-list.vue.d.ts +0 -15
  242. package/dist/runtime/spreadsheet/components/types.d.ts +0 -41
  243. package/dist/runtime/spreadsheet/composables/use-spreadsheet-column-matching.d.ts +0 -18
  244. package/dist/runtime/spreadsheet/composables/use-spreadsheet-column-matching.js +0 -62
  245. package/dist/runtime/spreadsheet/composables/use-spreadsheet-internals.d.ts +0 -629
  246. package/dist/runtime/spreadsheet/composables/use-spreadsheet-internals.js +0 -68
  247. package/dist/runtime/spreadsheet/composables/use-spreadsheet-references.d.ts +0 -1
  248. package/dist/runtime/spreadsheet/composables/use-spreadsheet-references.js +0 -3
  249. package/dist/runtime/spreadsheet/composables/use-spreadsheet-resolutions.d.ts +0 -40
  250. package/dist/runtime/spreadsheet/composables/use-spreadsheet-resolutions.js +0 -97
  251. package/dist/runtime/spreadsheet/composables/use-spreadsheet-row-state.d.ts +0 -24
  252. package/dist/runtime/spreadsheet/composables/use-spreadsheet-row-state.js +0 -74
  253. package/dist/runtime/spreadsheet/composables/use-spreadsheet-source.d.ts +0 -27
  254. package/dist/runtime/spreadsheet/composables/use-spreadsheet-source.js +0 -109
  255. package/dist/runtime/spreadsheet/composables/use-spreadsheet-view.d.ts +0 -15
  256. package/dist/runtime/spreadsheet/composables/use-spreadsheet-view.js +0 -109
  257. package/dist/runtime/spreadsheet/schema/normalize.d.ts +0 -73
  258. package/dist/runtime/spreadsheet/schema/normalize.js +0 -136
  259. package/dist/runtime/spreadsheet/types/context.d.ts +0 -9
  260. package/dist/runtime/spreadsheet/types/import.d.ts +0 -55
  261. package/dist/runtime/spreadsheet/types/inference.d.ts +0 -83
  262. package/dist/runtime/spreadsheet/types/normalized.d.ts +0 -50
  263. package/dist/runtime/spreadsheet/types/normalized.js +0 -0
  264. package/dist/runtime/spreadsheet/types/pipeline.d.ts +0 -7
  265. package/dist/runtime/spreadsheet/types/pipeline.js +0 -0
  266. package/dist/runtime/spreadsheet/types/reference-session.d.ts +0 -43
  267. package/dist/runtime/spreadsheet/types/reference-session.js +0 -0
  268. package/dist/runtime/spreadsheet/types/references.d.ts +0 -32
  269. package/dist/runtime/spreadsheet/types/references.js +0 -0
  270. package/dist/runtime/spreadsheet/types/resolution.d.ts +0 -43
  271. package/dist/runtime/spreadsheet/types/resolution.js +0 -0
  272. package/dist/runtime/spreadsheet/utils/builders/core.d.ts +0 -17
  273. package/dist/runtime/spreadsheet/utils/builders/core.js +0 -262
  274. package/dist/runtime/spreadsheet/utils/builders/index.d.ts +0 -1
  275. package/dist/runtime/spreadsheet/utils/builders/index.js +0 -1
  276. package/dist/runtime/spreadsheet/utils/context.d.ts +0 -20
  277. package/dist/runtime/spreadsheet/utils/context.js +0 -25
  278. package/dist/runtime/spreadsheet/utils/display.d.ts +0 -6
  279. package/dist/runtime/spreadsheet/utils/display.js +0 -26
  280. package/dist/runtime/spreadsheet/utils/object.d.ts +0 -9
  281. package/dist/runtime/spreadsheet/utils/object.js +0 -78
  282. package/dist/runtime/spreadsheet/utils/references/candidates.d.ts +0 -6
  283. package/dist/runtime/spreadsheet/utils/references/candidates.js +0 -28
  284. package/dist/runtime/spreadsheet/utils/references/core.d.ts +0 -3
  285. package/dist/runtime/spreadsheet/utils/references/core.js +0 -3
  286. package/dist/runtime/spreadsheet/utils/references/guards.d.ts +0 -4
  287. package/dist/runtime/spreadsheet/utils/references/guards.js +0 -28
  288. package/dist/runtime/spreadsheet/utils/references/index.d.ts +0 -1
  289. package/dist/runtime/spreadsheet/utils/references/index.js +0 -1
  290. package/dist/runtime/spreadsheet/utils/references/resolutions.d.ts +0 -17
  291. package/dist/runtime/spreadsheet/utils/references/resolutions.js +0 -172
  292. package/dist/runtime/spreadsheet/utils/references/shared.d.ts +0 -3
  293. package/dist/runtime/spreadsheet/utils/references/shared.js +0 -26
  294. package/dist/runtime/spreadsheet/utils/references/sources.d.ts +0 -9
  295. package/dist/runtime/spreadsheet/utils/references/sources.js +0 -38
  296. package/dist/runtime/spreadsheet/utils/rows/core.d.ts +0 -4
  297. package/dist/runtime/spreadsheet/utils/rows/core.js +0 -4
  298. package/dist/runtime/spreadsheet/utils/rows/headers.d.ts +0 -2
  299. package/dist/runtime/spreadsheet/utils/rows/headers.js +0 -9
  300. package/dist/runtime/spreadsheet/utils/rows/index.d.ts +0 -1
  301. package/dist/runtime/spreadsheet/utils/rows/index.js +0 -1
  302. package/dist/runtime/spreadsheet/utils/rows/matching.d.ts +0 -5
  303. package/dist/runtime/spreadsheet/utils/rows/matching.js +0 -209
  304. package/dist/runtime/spreadsheet/utils/rows/parsing.d.ts +0 -7
  305. package/dist/runtime/spreadsheet/utils/rows/parsing.js +0 -209
  306. package/dist/runtime/spreadsheet/utils/rows/shared.d.ts +0 -17
  307. package/dist/runtime/spreadsheet/utils/rows/shared.js +0 -309
  308. package/dist/runtime/spreadsheet/utils/rows/summary.d.ts +0 -2
  309. package/dist/runtime/spreadsheet/utils/rows/summary.js +0 -10
  310. package/dist/runtime/spreadsheet/utils/source/core.d.ts +0 -9
  311. package/dist/runtime/spreadsheet/utils/source/core.js +0 -65
  312. package/dist/runtime/spreadsheet/utils/source/index.d.ts +0 -1
  313. package/dist/runtime/spreadsheet/utils/source/index.js +0 -1
  314. package/dist/runtime/spreadsheet/utils/validation/core.d.ts +0 -16
  315. package/dist/runtime/spreadsheet/utils/validation/core.js +0 -211
  316. package/dist/runtime/spreadsheet/utils/validation/index.d.ts +0 -1
  317. package/dist/runtime/spreadsheet/utils/validation/index.js +0 -1
  318. /package/dist/runtime/spreadsheet/{components/types.js → types/fields.js} +0 -0
  319. /package/dist/runtime/spreadsheet/types/{context.js → importer.js} +0 -0
  320. /package/dist/runtime/spreadsheet/types/{import.js → steps.js} +0 -0
  321. /package/dist/runtime/spreadsheet/types/{inference.js → values.js} +0 -0
@@ -148,144 +148,266 @@ export interface UiToolsTableMessages {
148
148
  };
149
149
  }
150
150
  export interface UiToolsSpreadsheetMessages {
151
- common: {
152
- steps: string;
153
- previous: string;
154
- continue: string;
155
- closeImport: string;
156
- preparingReview: string;
157
- preparingReviewDescription: string;
158
- importRows: string;
159
- exportDiscardedRows: string;
160
- importSummary: string;
161
- clickToChangeHeaderRow: string;
162
- referencesStepHint: string;
163
- sheetStats: string;
164
- arrayValue: string;
165
- objectValue: string;
166
- arraySummary: string;
167
- objectSummary: string;
151
+ issues: {
152
+ required: string;
153
+ number: string;
154
+ date: string;
155
+ boolean: string;
156
+ unknownValue: string;
157
+ notFound: string;
158
+ skipped: string;
159
+ duplicate: string;
160
+ exists: string;
161
+ email: string;
162
+ pattern: string;
163
+ minLength: string;
164
+ maxLength: string;
165
+ min: string;
166
+ max: string;
167
+ between: string;
168
+ notFuture: string;
169
+ };
170
+ template: {
171
+ sheet: string;
172
+ guide: string;
173
+ column: string;
174
+ required: string;
175
+ allowed: string;
176
+ description: string;
177
+ yes: string;
168
178
  };
169
179
  steps: {
170
- upload: {
180
+ file: string;
181
+ columns: string;
182
+ values: string;
183
+ review: string;
184
+ submit: string;
185
+ auto: string;
186
+ };
187
+ stepHints: {
188
+ file: string;
189
+ columns: string;
190
+ values: string;
191
+ review: string;
192
+ submit: string;
193
+ };
194
+ headings: {
195
+ file: {
171
196
  title: string;
172
197
  description: string;
173
- stageTitle: string;
174
198
  };
175
- structure: {
199
+ columns: {
176
200
  title: string;
177
201
  description: string;
178
- stageTitle: string;
179
- loadWorkbookFirstTitle: string;
180
- loadWorkbookFirstDescription: string;
181
- sheetLabel: string;
182
- previewTitle: string;
183
- autoDetected: string;
184
- headerDetectedAtRow: string;
185
- };
186
- matching: {
202
+ };
203
+ values: {
187
204
  title: string;
188
205
  description: string;
189
- matched: string;
190
- needsMatch: string;
191
- missing: string;
192
- autoMapped: string;
193
- ignored: string;
194
- ignoreField: string;
195
- columnFallback: string;
196
- systemField: string;
197
- requirement: string;
198
- spreadsheetColumn: string;
199
- statusHeader: string;
200
- required: string;
201
- optional: string;
202
- searchColumns: string;
203
- selectColumn: string;
204
- assigned: string;
205
- available: string;
206
- autoMappedField: string;
207
- ignoredColumns: string;
208
- };
209
- references: {
206
+ };
207
+ review: {
210
208
  title: string;
211
209
  description: string;
212
210
  };
213
- review: {
211
+ submit: {
214
212
  title: string;
215
213
  description: string;
216
- importLimit: string;
217
- selected: string;
218
- discard: string;
219
- restore: string;
220
- discardRow: string;
221
- next: string;
222
- prev: string;
223
- backToTable: string;
224
- restoreRow: string;
225
- allRows: string;
226
- valid: string;
214
+ };
215
+ };
216
+ nav: {
217
+ back: string;
218
+ continue: string;
219
+ cancel: string;
220
+ close: string;
221
+ import: string;
222
+ another: string;
223
+ blockers: {
224
+ file: string;
225
+ columns: string;
226
+ values: string;
227
+ review: string;
228
+ invalid: string;
229
+ };
230
+ };
231
+ file: {
232
+ dropTitle: string;
233
+ dropBrowse: string;
234
+ dropHint: string;
235
+ dropHintNoLimit: string;
236
+ paste: string;
237
+ reading: string;
238
+ readFailed: string;
239
+ replace: string;
240
+ summary: string;
241
+ sheet: string;
242
+ sheetOption: string;
243
+ headerRow: string;
244
+ rowOption: string;
245
+ emptyRow: string;
246
+ detected: string;
247
+ titleRows: string;
248
+ ambiguous: string;
249
+ noMatch: string;
250
+ useDetected: string;
251
+ previewTitle: string;
252
+ previewHeader: string;
253
+ expected: string;
254
+ expectedCount: string;
255
+ optional: string;
256
+ fromContext: string;
257
+ template: string;
258
+ };
259
+ columns: {
260
+ field: string;
261
+ column: string;
262
+ samples: string;
263
+ none: string;
264
+ columnFor: string;
265
+ emptyColumn: string;
266
+ statuses: {
267
+ matched: string;
268
+ manual: string;
269
+ default: string;
270
+ missing: string;
271
+ unmatched: string;
272
+ };
273
+ suggestion: string;
274
+ useSuggestion: string;
275
+ reset: string;
276
+ reads: string;
277
+ found: string;
278
+ allFound: string;
279
+ unused: string;
280
+ };
281
+ values: {
282
+ value: string;
283
+ rows: string;
284
+ answer: string;
285
+ rowCount: string;
286
+ choose: string;
287
+ search: string;
288
+ loading: string;
289
+ valueFor: string;
290
+ /** Heading of values checked against options that depend on other columns. */
291
+ scope: string;
292
+ condition: string;
293
+ leaveEmpty: string;
294
+ skipRows: string;
295
+ create: string;
296
+ statuses: {
297
+ open: string;
298
+ user: string;
299
+ policy: string;
300
+ recognized: string;
301
+ };
302
+ recognized: string;
303
+ nothing: string;
304
+ };
305
+ table: {
306
+ tabs: {
307
+ all: string;
308
+ importable: string;
227
309
  invalid: string;
228
310
  discarded: string;
229
- allIssues: string;
311
+ };
312
+ levels: {
313
+ all: string;
230
314
  blocking: string;
231
315
  warnings: string;
232
- ready: string;
233
- validRows: string;
234
- noBlockingIssues: string;
235
- willNotBeImported: string;
236
- nothingDiscarded: string;
237
- row: string;
238
- blockingIssues: string;
239
- warningsOnly: string;
240
- validRow: string;
241
- issueBadgeBlocking: string;
242
- issueBadgeWarning: string;
243
- noValue: string;
244
- overflowTitle: string;
245
- overflowDescription: string;
246
- discardedStatus: string;
247
- blockingStatus: string;
248
- warningStatus: string;
249
- validStatus: string;
250
- issueRowsProgress: string;
251
- inspectingRow: string;
252
- propertyGroups: string;
253
- issueGroups: string;
254
- rowData: string;
255
- issuesOnThisRow: string;
256
- byProperty: string;
257
- byIssueType: string;
258
- ruleKey: string;
259
- groupedByIssueType: string;
260
- rowLevelIssue: string;
261
- affectsFullRow: string;
262
- property: string;
263
- valueInFile: string;
264
- viewAllRowsWithThisIssue: string;
265
- autoTrim: string;
266
- };
267
- };
268
- upload: {
269
- dropzoneLabel: string;
270
- dropzoneDescription: string;
271
- parsingFailed: string;
272
- downloadTemplate: string;
273
- downloadTemplateDescription: string;
316
+ };
317
+ modes: {
318
+ all: string;
319
+ create: string;
320
+ update: string;
321
+ };
322
+ search: string;
323
+ anyIssue: string;
324
+ byColumn: string;
325
+ byIssue: string;
326
+ columnIssueOption: string;
327
+ issueOption: string;
328
+ clearFilter: string;
329
+ selected: string;
330
+ discard: string;
331
+ restore: string;
332
+ clearSelection: string;
333
+ row: string;
334
+ selectRow: string;
335
+ selectAll: string;
336
+ inspectRow: string;
337
+ empty: string;
338
+ emptyCell: string;
339
+ edited: string;
340
+ defaulted: string;
341
+ created: string;
342
+ stored: string;
343
+ rowCount: string;
344
+ modeCreate: string;
345
+ modeUpdate: string;
346
+ status: {
347
+ valid: string;
348
+ warning: string;
349
+ blocking: string;
350
+ discarded: string;
351
+ };
352
+ reasons: {
353
+ manual: string;
354
+ value: string;
355
+ limit: string;
356
+ duplicate: string;
357
+ existing: string;
358
+ };
274
359
  };
275
- validation: {
276
- required: string;
277
- maxLength: string;
278
- minLength: string;
279
- number: string;
280
- min: string;
281
- max: string;
282
- between: string;
283
- oneOf: string;
284
- unrecognizedValue: string;
285
- invalidNumberInput: string;
286
- invalidBooleanInput: string;
287
- missingValue: string;
288
- parseFailed: string;
360
+ inspector: {
361
+ title: string;
362
+ close: string;
363
+ position: string;
364
+ positionNone: string;
365
+ previous: string;
366
+ next: string;
367
+ issues: string;
368
+ noIssue: string;
369
+ values: string;
370
+ inFile: string;
371
+ revert: string;
372
+ discard: string;
373
+ restore: string;
374
+ allRows: string;
375
+ answerIt: string;
376
+ };
377
+ stats: {
378
+ importable: string;
379
+ invalid: string;
380
+ discarded: string;
381
+ create: string;
382
+ update: string;
383
+ warnings: string;
384
+ blocking: string;
385
+ };
386
+ review: {
387
+ issuesColumn: string;
388
+ export: string;
389
+ };
390
+ summary: {
391
+ file: string;
392
+ toImport: string;
393
+ create: string;
394
+ update: string;
395
+ invalid: string;
396
+ discarded: string;
397
+ edited: string;
398
+ created: string;
399
+ };
400
+ progress: {
401
+ running: string;
402
+ count: string;
403
+ done: string;
404
+ doneHint: string;
405
+ rejected: string;
406
+ rejectedHint: string;
407
+ retry: string;
408
+ review: string;
409
+ error: string;
410
+ tryAgain: string;
289
411
  };
290
412
  }
291
413
  export interface UiToolsFormMessages {
@@ -52,6 +52,13 @@ export interface RemoteOptionsLoader<TOption> {
52
52
  resolveSelected: (request: {
53
53
  values: readonly RemoteOptionValue[];
54
54
  }) => QueryFnDefinition<readonly TOption[]>;
55
+ /**
56
+ * Options whose label is exactly one of `labels`, in one request. Spreadsheet imports use it to
57
+ * match the values of a file; without it they search each value.
58
+ */
59
+ resolveLabels?: (request: {
60
+ labels: readonly string[];
61
+ }) => QueryFnDefinition<readonly TOption[]>;
55
62
  pagination: RemoteOptionsPagination;
56
63
  search?: RemoteOptionsSearch;
57
64
  /** Identity of a page query, used by pickers that cache an infinite list as one query. */
@@ -77,6 +84,10 @@ export interface RemoteOptionsQueries<TPageQuery extends RemoteOptionsQueryDefin
77
84
  resolveSelected: (request: {
78
85
  values: readonly RemoteOptionValue[];
79
86
  }) => TSelectedQuery;
87
+ /** Options whose label is one of `labels`; its response has the shape of `resolveSelected`'s. */
88
+ resolveLabels?: (request: {
89
+ labels: readonly string[];
90
+ }) => TSelectedQuery;
80
91
  }
81
92
  /** Maps endpoint responses to the option result shared by all three pickers. */
82
93
  export interface DefineRemoteOptionsConfig<TPageQuery extends RemoteOptionsQueryDefinition, TSelectedQuery extends RemoteOptionsQueryDefinition, TOption extends RemoteOption> {
@@ -1,6 +1,7 @@
1
1
  import { mapRemoteOptionsQuery } from "./remote-options-query.js";
2
2
  export function defineRemoteOptions(queries, config) {
3
3
  const suffix = ["remote-options", config.key];
4
+ const resolveLabels = queries.resolveLabels;
4
5
  return {
5
6
  load: (request) => mapRemoteOptionsQuery(
6
7
  queries.load(request),
@@ -9,6 +10,11 @@ export function defineRemoteOptions(queries, config) {
9
10
  ),
10
11
  pagination: config.pagination,
11
12
  queryKeyFor: (request) => [...queries.load(request).queryKey, ...suffix, "page"],
13
+ resolveLabels: resolveLabels ? (request) => mapRemoteOptionsQuery(
14
+ resolveLabels(request),
15
+ config.mapSelected,
16
+ [...suffix, "labels"]
17
+ ) : void 0,
12
18
  resolveSelected: (request) => mapRemoteOptionsQuery(
13
19
  queries.resolveSelected(request),
14
20
  config.mapSelected,
@@ -1,4 +1,4 @@
1
- export declare function fileIconName(type: string | null | undefined): "i-lucide-file-spreadsheet" | "i-lucide-file-text" | "i-lucide-file-image" | "i-lucide-file-video" | "i-lucide-file-audio" | "i-lucide-file-type" | "i-lucide-file-archive" | "i-lucide-file";
1
+ export declare function fileIconName(type: string | null | undefined): "i-lucide-file-text" | "i-lucide-file-image" | "i-lucide-file-video" | "i-lucide-file-audio" | "i-lucide-file-spreadsheet" | "i-lucide-file-type" | "i-lucide-file-archive" | "i-lucide-file";
2
2
  /** Lowercase extension of a file name without the dot, or `null` when it has none. */
3
3
  export declare function fileExtension(name: string): string | null;
4
4
  export declare function fileExtensionLabel(file: {
@@ -1,12 +1,15 @@
1
1
  type __VLS_Props = {
2
- reviewRowsLength: number;
3
- maxRecords: number;
4
- overflowCount: number;
2
+ /** Current text of the cell. */
3
+ text: string;
4
+ /** Labels to pick from, for a select column. */
5
+ choices?: readonly string[];
5
6
  };
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- autoTrim: () => any;
8
+ cancel: () => any;
9
+ commit: (text: string, move?: 1 | -1 | undefined) => any;
8
10
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- onAutoTrim?: (() => any) | undefined;
11
+ onCancel?: (() => any) | undefined;
12
+ onCommit?: ((text: string, move?: 1 | -1 | undefined) => any) | undefined;
10
13
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
14
  declare const _default: typeof __VLS_export;
12
15
  export default _default;
@@ -0,0 +1,73 @@
1
+ <script setup>
2
+ import { nextTick, onMounted, useTemplateRef } from "vue";
3
+ import { useUiToolsLocale } from "#ui-tools/i18n";
4
+ const props = defineProps({
5
+ text: { type: String, required: true },
6
+ choices: { type: Array, required: false }
7
+ });
8
+ const emit = defineEmits(["commit", "cancel"]);
9
+ const { t } = useUiToolsLocale();
10
+ const input = useTemplateRef("input");
11
+ const select = useTemplateRef("select");
12
+ let done = false;
13
+ onMounted(async () => {
14
+ await nextTick();
15
+ if (input.value) {
16
+ input.value.focus({ preventScroll: true });
17
+ input.value.select();
18
+ } else select.value?.focus({ preventScroll: true });
19
+ });
20
+ function finish(text, move) {
21
+ if (done) return;
22
+ done = true;
23
+ emit("commit", text.trim(), move);
24
+ }
25
+ function onKeydown(event) {
26
+ const target = event.target;
27
+ if (!(target instanceof HTMLInputElement || target instanceof HTMLSelectElement)) return;
28
+ if (event.key === "Escape") {
29
+ event.preventDefault();
30
+ done = true;
31
+ emit("cancel");
32
+ } else if (event.key === "Enter") {
33
+ event.preventDefault();
34
+ finish(target.value);
35
+ } else if (event.key === "Tab") {
36
+ event.preventDefault();
37
+ finish(target.value, event.shiftKey ? -1 : 1);
38
+ }
39
+ }
40
+ function onCommit(event) {
41
+ const target = event.target;
42
+ if (target instanceof HTMLInputElement || target instanceof HTMLSelectElement)
43
+ finish(target.value);
44
+ }
45
+ </script>
46
+
47
+ <template>
48
+ <select
49
+ v-if="choices"
50
+ ref="select"
51
+ class="block h-full w-full min-w-40 bg-transparent px-2.5 text-highlighted outline-none"
52
+ @change="onCommit"
53
+ @keydown="onKeydown"
54
+ @blur="onCommit"
55
+ >
56
+ <option v-if="!choices.includes(text)" :value="text" selected>
57
+ {{ text || t("spreadsheet.table.emptyCell") }}
58
+ </option>
59
+ <option v-for="choice in choices" :key="choice" :value="choice" :selected="choice === text">
60
+ {{ choice }}
61
+ </option>
62
+ </select>
63
+ <input
64
+ v-else
65
+ ref="input"
66
+ :value="text"
67
+ autocomplete="off"
68
+ spellcheck="false"
69
+ class="block h-full w-full min-w-40 bg-transparent px-3 text-highlighted outline-none"
70
+ @keydown="onKeydown"
71
+ @blur="onCommit"
72
+ />
73
+ </template>
@@ -1,12 +1,15 @@
1
1
  type __VLS_Props = {
2
- reviewRowsLength: number;
3
- maxRecords: number;
4
- overflowCount: number;
2
+ /** Current text of the cell. */
3
+ text: string;
4
+ /** Labels to pick from, for a select column. */
5
+ choices?: readonly string[];
5
6
  };
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- autoTrim: () => any;
8
+ cancel: () => any;
9
+ commit: (text: string, move?: 1 | -1 | undefined) => any;
8
10
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- onAutoTrim?: (() => any) | undefined;
11
+ onCancel?: (() => any) | undefined;
12
+ onCommit?: ((text: string, move?: 1 | -1 | undefined) => any) | undefined;
10
13
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
14
  declare const _default: typeof __VLS_export;
12
15
  export default _default;
@@ -0,0 +1,17 @@
1
+ import type { SpreadsheetFieldState, SpreadsheetHeaderCell } from '../../types/index.js';
2
+ type __VLS_Props = {
3
+ field: SpreadsheetFieldState;
4
+ headers: readonly SpreadsheetHeaderCell[];
5
+ suggestions: boolean;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ reset: () => any;
9
+ assign: (header: number) => any;
10
+ ignore: () => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ onReset?: (() => any) | undefined;
13
+ onAssign?: ((header: number) => any) | undefined;
14
+ onIgnore?: (() => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,98 @@
1
+ <script setup>
2
+ import UButton from "@nuxt/ui/components/Button.vue";
3
+ import USelect from "@nuxt/ui/components/Select.vue";
4
+ import { computed } from "vue";
5
+ import { useUiToolsLocale } from "#ui-tools/i18n";
6
+ const NONE = -1;
7
+ const props = defineProps({
8
+ field: { type: Object, required: true },
9
+ headers: { type: Array, required: true },
10
+ suggestions: { type: Boolean, required: true }
11
+ });
12
+ const emit = defineEmits(["assign", "ignore", "reset"]);
13
+ const { t } = useUiToolsLocale();
14
+ const items = computed(() => [
15
+ { label: t("spreadsheet.columns.none"), value: NONE },
16
+ ...props.headers.filter((header) => header.text).map((header) => ({ label: header.text, value: header.index }))
17
+ ]);
18
+ const tone = computed(
19
+ () => ({
20
+ default: "bg-info",
21
+ matched: props.field.assignedBy === "user" ? "bg-primary" : "bg-success",
22
+ missing: "bg-error",
23
+ unmatched: "bg-accented"
24
+ })[props.field.status]
25
+ );
26
+ function select(value) {
27
+ if (value === NONE) emit("ignore");
28
+ else emit("assign", value);
29
+ }
30
+ function useSuggestion() {
31
+ if (props.field.suggestion) emit("assign", props.field.suggestion.header.index);
32
+ }
33
+ </script>
34
+
35
+ <template>
36
+ <div
37
+ :data-spreadsheet-field="field.path"
38
+ :data-status="field.status"
39
+ class="grid grid-cols-1 items-center gap-x-4 gap-y-1.5 px-4 py-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,1.05fr)_minmax(0,1fr)]"
40
+ :class="field.status === 'missing' ? 'bg-error/3' : ''"
41
+ >
42
+ <div class="flex min-w-0 items-center gap-2.5">
43
+ <span class="size-2 shrink-0 rounded-full" :class="tone" />
44
+ <span class="truncate font-medium text-highlighted">{{ field.label }}</span>
45
+ <span v-if="field.required" class="shrink-0 text-error" aria-hidden="true">*</span>
46
+ </div>
47
+ <USelect
48
+ :model-value="field.header?.index ?? NONE"
49
+ :items="items"
50
+ :color="field.status === 'missing' ? 'error' : 'neutral'"
51
+ :highlight="field.status === 'missing'"
52
+ :aria-label="t('spreadsheet.columns.columnFor', { field: field.label })"
53
+ class="w-full"
54
+ @update:model-value="select"
55
+ />
56
+ <div class="min-w-0 text-[12.5px] leading-snug">
57
+ <template v-if="field.status === 'missing' && suggestions && field.suggestion">
58
+ <span class="text-muted">{{
59
+ t("spreadsheet.columns.suggestion", {
60
+ header: field.suggestion.header.text,
61
+ samples: field.suggestion.samples.join(", ")
62
+ })
63
+ }}</span>
64
+ <UButton
65
+ data-spreadsheet-use-suggestion
66
+ variant="link"
67
+ size="xs"
68
+ class="px-1"
69
+ :label="t('spreadsheet.columns.useSuggestion')"
70
+ @click="useSuggestion"
71
+ />
72
+ </template>
73
+ <span v-else-if="field.status === 'missing'" class="font-medium text-error">{{
74
+ t("spreadsheet.columns.statuses.missing")
75
+ }}</span>
76
+ <span v-else-if="field.status === 'default'" class="text-info">{{
77
+ t("spreadsheet.columns.statuses.default")
78
+ }}</span>
79
+ <span v-else-if="field.status === 'unmatched'" class="text-dimmed">{{
80
+ t("spreadsheet.columns.statuses.unmatched")
81
+ }}</span>
82
+ <span v-else class="flex min-w-0 items-center gap-1.5">
83
+ <span class="truncate text-muted">{{
84
+ field.samples.join(" \xB7 ") || t("spreadsheet.columns.emptyColumn")
85
+ }}</span>
86
+ <UButton
87
+ v-if="field.assignedBy === 'user'"
88
+ variant="link"
89
+ color="neutral"
90
+ size="xs"
91
+ class="shrink-0 px-0"
92
+ :label="t('spreadsheet.columns.reset')"
93
+ @click="emit('reset')"
94
+ />
95
+ </span>
96
+ </div>
97
+ </div>
98
+ </template>