@cocoar/vue-ui 3.1.0 → 3.2.0-beta.6

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 (179) hide show
  1. package/dist/components/checkbox/CoarCheckbox.vue.d.ts +1 -1
  2. package/dist/components/checkbox/CoarCheckbox.vue.d.ts.map +1 -1
  3. package/dist/components/code-block/CoarCodeBlock.vue.d.ts +1 -1
  4. package/dist/components/code-block/CoarCodeBlock.vue.d.ts.map +1 -1
  5. package/dist/components/data-list/CoarDataList.vue.d.ts +158 -0
  6. package/dist/components/data-list/CoarDataList.vue.d.ts.map +1 -0
  7. package/dist/components/data-list/CoarDataListToolbar.vue.d.ts +30 -0
  8. package/dist/components/data-list/CoarDataListToolbar.vue.d.ts.map +1 -0
  9. package/dist/components/data-list/data-list-builder.d.ts +288 -0
  10. package/dist/components/data-list/data-list-builder.d.ts.map +1 -0
  11. package/dist/components/data-list/index.d.ts +12 -0
  12. package/dist/components/data-list/index.d.ts.map +1 -0
  13. package/dist/components/data-list/internal/compare.d.ts +14 -0
  14. package/dist/components/data-list/internal/compare.d.ts.map +1 -0
  15. package/dist/components/data-list/internal/reorder-core.d.ts +46 -0
  16. package/dist/components/data-list/internal/reorder-core.d.ts.map +1 -0
  17. package/dist/components/data-list/internal/search.d.ts +16 -0
  18. package/dist/components/data-list/internal/search.d.ts.map +1 -0
  19. package/dist/components/data-list/internal/useDataListLines.d.ts +92 -0
  20. package/dist/components/data-list/internal/useDataListLines.d.ts.map +1 -0
  21. package/dist/components/data-list/internal/useDataListReorder.d.ts +68 -0
  22. package/dist/components/data-list/internal/useDataListReorder.d.ts.map +1 -0
  23. package/dist/components/data-list/internal/useSearchHighlight.d.ts +19 -0
  24. package/dist/components/data-list/internal/useSearchHighlight.d.ts.map +1 -0
  25. package/dist/components/data-list/types.d.ts +185 -0
  26. package/dist/components/data-list/types.d.ts.map +1 -0
  27. package/dist/components/data-list/useDataListModel.d.ts +79 -0
  28. package/dist/components/data-list/useDataListModel.d.ts.map +1 -0
  29. package/dist/components/date-time/_shared/maskito-config.d.ts +7 -2
  30. package/dist/components/date-time/_shared/maskito-config.d.ts.map +1 -1
  31. package/dist/components/date-time/_shared/time-helpers.d.ts +11 -4
  32. package/dist/components/date-time/_shared/time-helpers.d.ts.map +1 -1
  33. package/dist/components/date-time/_shared/use-date-picker-base.d.ts +1 -1
  34. package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts +1 -1
  35. package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts.map +1 -1
  36. package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts +1 -1
  37. package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts.map +1 -1
  38. package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts +1 -1
  39. package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts.map +1 -1
  40. package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts +3 -0
  41. package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts.map +1 -1
  42. package/dist/components/form-field/CoarFormField.vue.d.ts +1 -1
  43. package/dist/components/form-field/CoarFormField.vue.d.ts.map +1 -1
  44. package/dist/components/icon/CoarIcon.vue.d.ts +2 -2
  45. package/dist/components/icon/CoarIcon.vue.d.ts.map +1 -1
  46. package/dist/components/listbox/CoarListbox.vue.d.ts +7 -0
  47. package/dist/components/listbox/CoarListbox.vue.d.ts.map +1 -1
  48. package/dist/components/number-input/CoarNumberInput.vue.d.ts +1 -1
  49. package/dist/components/number-input/CoarNumberInput.vue.d.ts.map +1 -1
  50. package/dist/components/otp-input/CoarOtpInput.vue.d.ts +1 -1
  51. package/dist/components/otp-input/CoarOtpInput.vue.d.ts.map +1 -1
  52. package/dist/components/password-input/CoarPasswordInput.vue.d.ts +1 -1
  53. package/dist/components/password-input/CoarPasswordInput.vue.d.ts.map +1 -1
  54. package/dist/components/switch/CoarSwitch.vue.d.ts +1 -1
  55. package/dist/components/switch/CoarSwitch.vue.d.ts.map +1 -1
  56. package/dist/components/text-input/CoarTextInput.vue.d.ts +1 -1
  57. package/dist/components/text-input/CoarTextInput.vue.d.ts.map +1 -1
  58. package/dist/composables/dragRegistry.d.ts +12 -0
  59. package/dist/composables/dragRegistry.d.ts.map +1 -1
  60. package/dist/composables/index.d.ts +2 -2
  61. package/dist/composables/index.d.ts.map +1 -1
  62. package/dist/composables/useDragDrop.d.ts +62 -6
  63. package/dist/composables/useDragDrop.d.ts.map +1 -1
  64. package/dist/composables/useVirtualList.d.ts +21 -1
  65. package/dist/composables/useVirtualList.d.ts.map +1 -1
  66. package/dist/index.css +1 -1
  67. package/dist/index.d.ts +4 -2
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +4508 -2039
  70. package/package.json +5 -3
  71. package/skills/cocoar-vue-ui/SKILL.md +244 -0
  72. package/skills/cocoar-vue-ui/references/components/avatar.md +178 -0
  73. package/skills/cocoar-vue-ui/references/components/badge.md +290 -0
  74. package/skills/cocoar-vue-ui/references/components/breadcrumb.md +238 -0
  75. package/skills/cocoar-vue-ui/references/components/button.md +252 -0
  76. package/skills/cocoar-vue-ui/references/components/calendar/agenda-view.md +353 -0
  77. package/skills/cocoar-vue-ui/references/components/calendar/coar-calendar.md +1645 -0
  78. package/skills/cocoar-vue-ui/references/components/calendar/day-view.md +361 -0
  79. package/skills/cocoar-vue-ui/references/components/calendar/index.md +312 -0
  80. package/skills/cocoar-vue-ui/references/components/calendar/month-view.md +475 -0
  81. package/skills/cocoar-vue-ui/references/components/calendar/performance.md +186 -0
  82. package/skills/cocoar-vue-ui/references/components/calendar/timeline-view.md +301 -0
  83. package/skills/cocoar-vue-ui/references/components/calendar/week-view.md +382 -0
  84. package/skills/cocoar-vue-ui/references/components/calendar/work-week-view.md +145 -0
  85. package/skills/cocoar-vue-ui/references/components/calendar/year-view.md +63 -0
  86. package/skills/cocoar-vue-ui/references/components/card.md +151 -0
  87. package/skills/cocoar-vue-ui/references/components/checkbox-group.md +103 -0
  88. package/skills/cocoar-vue-ui/references/components/checkbox.md +279 -0
  89. package/skills/cocoar-vue-ui/references/components/code-block.md +241 -0
  90. package/skills/cocoar-vue-ui/references/components/context-menu.md +355 -0
  91. package/skills/cocoar-vue-ui/references/components/data-grid/checkbox.md +213 -0
  92. package/skills/cocoar-vue-ui/references/components/data-grid/date-columns.md +272 -0
  93. package/skills/cocoar-vue-ui/references/components/data-grid/editing.md +236 -0
  94. package/skills/cocoar-vue-ui/references/components/data-grid/multi-select.md +193 -0
  95. package/skills/cocoar-vue-ui/references/components/data-grid/number.md +147 -0
  96. package/skills/cocoar-vue-ui/references/components/data-grid/select.md +202 -0
  97. package/skills/cocoar-vue-ui/references/components/data-grid/text.md +127 -0
  98. package/skills/cocoar-vue-ui/references/components/data-grid.md +1225 -0
  99. package/skills/cocoar-vue-ui/references/components/data-list.md +2121 -0
  100. package/skills/cocoar-vue-ui/references/components/date-or-time-picker.md +200 -0
  101. package/skills/cocoar-vue-ui/references/components/date-picker.md +203 -0
  102. package/skills/cocoar-vue-ui/references/components/date-time-picker.md +154 -0
  103. package/skills/cocoar-vue-ui/references/components/date-views.md +212 -0
  104. package/skills/cocoar-vue-ui/references/components/dialog.md +148 -0
  105. package/skills/cocoar-vue-ui/references/components/divider.md +157 -0
  106. package/skills/cocoar-vue-ui/references/components/document-viewer/annotations.md +400 -0
  107. package/skills/cocoar-vue-ui/references/components/document-viewer/coar-document-viewer.md +327 -0
  108. package/skills/cocoar-vue-ui/references/components/document-viewer/index.md +234 -0
  109. package/skills/cocoar-vue-ui/references/components/document-viewer/toolbar.md +221 -0
  110. package/skills/cocoar-vue-ui/references/components/drag-drop.md +267 -0
  111. package/skills/cocoar-vue-ui/references/components/dual-listbox.md +449 -0
  112. package/skills/cocoar-vue-ui/references/components/file-explorer/asset-store.md +327 -0
  113. package/skills/cocoar-vue-ui/references/components/file-explorer/in-memory-store.md +176 -0
  114. package/skills/cocoar-vue-ui/references/components/file-explorer/index.md +311 -0
  115. package/skills/cocoar-vue-ui/references/components/file-explorer/use-file-explorer.md +300 -0
  116. package/skills/cocoar-vue-ui/references/components/form-field.md +1025 -0
  117. package/skills/cocoar-vue-ui/references/components/fragment-parser.md +298 -0
  118. package/skills/cocoar-vue-ui/references/components/link.md +235 -0
  119. package/skills/cocoar-vue-ui/references/components/listbox.md +575 -0
  120. package/skills/cocoar-vue-ui/references/components/map/editor.md +448 -0
  121. package/skills/cocoar-vue-ui/references/components/map/index.md +351 -0
  122. package/skills/cocoar-vue-ui/references/components/markdown-diagrams.md +210 -0
  123. package/skills/cocoar-vue-ui/references/components/markdown-editor.md +1478 -0
  124. package/skills/cocoar-vue-ui/references/components/markdown-embeds.md +387 -0
  125. package/skills/cocoar-vue-ui/references/components/markdown-form.md +447 -0
  126. package/skills/cocoar-vue-ui/references/components/markdown.md +276 -0
  127. package/skills/cocoar-vue-ui/references/components/menu.md +380 -0
  128. package/skills/cocoar-vue-ui/references/components/mermaid.md +172 -0
  129. package/skills/cocoar-vue-ui/references/components/navbar.md +147 -0
  130. package/skills/cocoar-vue-ui/references/components/note.md +96 -0
  131. package/skills/cocoar-vue-ui/references/components/notice.md +131 -0
  132. package/skills/cocoar-vue-ui/references/components/number-input.md +215 -0
  133. package/skills/cocoar-vue-ui/references/components/otp-input.md +324 -0
  134. package/skills/cocoar-vue-ui/references/components/page-builder/authoring-contract.md +271 -0
  135. package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-builder.md +476 -0
  136. package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-renderer.md +677 -0
  137. package/skills/cocoar-vue-ui/references/components/page-builder/custom-elements.md +441 -0
  138. package/skills/cocoar-vue-ui/references/components/page-builder/idp-integration.md +122 -0
  139. package/skills/cocoar-vue-ui/references/components/page-builder/index.md +573 -0
  140. package/skills/cocoar-vue-ui/references/components/pagination.md +150 -0
  141. package/skills/cocoar-vue-ui/references/components/panel-layout.md +372 -0
  142. package/skills/cocoar-vue-ui/references/components/password-input.md +175 -0
  143. package/skills/cocoar-vue-ui/references/components/popconfirm.md +186 -0
  144. package/skills/cocoar-vue-ui/references/components/popover.md +173 -0
  145. package/skills/cocoar-vue-ui/references/components/progress-bar.md +178 -0
  146. package/skills/cocoar-vue-ui/references/components/radio-group.md +225 -0
  147. package/skills/cocoar-vue-ui/references/components/script-editor.md +1271 -0
  148. package/skills/cocoar-vue-ui/references/components/segmented-control.md +238 -0
  149. package/skills/cocoar-vue-ui/references/components/select.md +463 -0
  150. package/skills/cocoar-vue-ui/references/components/sidebar.md +421 -0
  151. package/skills/cocoar-vue-ui/references/components/spinner.md +132 -0
  152. package/skills/cocoar-vue-ui/references/components/switch.md +195 -0
  153. package/skills/cocoar-vue-ui/references/components/table.md +170 -0
  154. package/skills/cocoar-vue-ui/references/components/tabs.md +382 -0
  155. package/skills/cocoar-vue-ui/references/components/tag.md +178 -0
  156. package/skills/cocoar-vue-ui/references/components/text-input.md +256 -0
  157. package/skills/cocoar-vue-ui/references/components/toast.md +160 -0
  158. package/skills/cocoar-vue-ui/references/components/tooltip.md +121 -0
  159. package/skills/cocoar-vue-ui/references/components/transitions.md +193 -0
  160. package/skills/cocoar-vue-ui/references/components/tree.md +2388 -0
  161. package/skills/cocoar-vue-ui/references/components/virtual-list.md +212 -0
  162. package/skills/cocoar-vue-ui/references/components/wizard.md +251 -0
  163. package/skills/cocoar-vue-ui/references/components/zoned-date-time-picker.md +177 -0
  164. package/skills/cocoar-vue-ui/references/foundations/colors.md +708 -0
  165. package/skills/cocoar-vue-ui/references/foundations/design-principles.md +115 -0
  166. package/skills/cocoar-vue-ui/references/foundations/icons.md +381 -0
  167. package/skills/cocoar-vue-ui/references/foundations/localization/formatting.md +530 -0
  168. package/skills/cocoar-vue-ui/references/foundations/localization/setup.md +86 -0
  169. package/skills/cocoar-vue-ui/references/foundations/localization/timezones.md +182 -0
  170. package/skills/cocoar-vue-ui/references/foundations/localization/translations.md +305 -0
  171. package/skills/cocoar-vue-ui/references/foundations/motion.md +549 -0
  172. package/skills/cocoar-vue-ui/references/foundations/spacing.md +330 -0
  173. package/skills/cocoar-vue-ui/references/foundations/theming.md +140 -0
  174. package/skills/cocoar-vue-ui/references/foundations/typography.md +206 -0
  175. package/skills/cocoar-vue-ui/references/guide/error-handling.md +162 -0
  176. package/skills/cocoar-vue-ui/references/guide/getting-started.md +119 -0
  177. package/skills/cocoar-vue-ui/references/guide/migration-page-builder-3.md +207 -0
  178. package/skills/cocoar-vue-ui/references/guide/migration.md +140 -0
  179. package/skills/cocoar-vue-ui/references/guide/theming.md +98 -0
@@ -0,0 +1,46 @@
1
+ import { CoarDataListDropTarget, CoarDataListKey, CoarDataListLayout } from '../types';
2
+ /**
3
+ * Drop position relative to the item under the pointer: split vertically in the
4
+ * list layout, horizontally between tiles in the grid layout. With `nestable`,
5
+ * the middle half of a list row means "drop inside" (make the item the parent).
6
+ */
7
+ export declare function computeDropTarget(layout: CoarDataListLayout, rect: {
8
+ top: number;
9
+ left: number;
10
+ width: number;
11
+ height: number;
12
+ }, point: {
13
+ x: number;
14
+ y: number;
15
+ }, key: CoarDataListKey, options?: {
16
+ nestable?: boolean;
17
+ }): CoarDataListDropTarget;
18
+ export interface Insertion {
19
+ toIndex: number;
20
+ afterKey: CoarDataListKey | null;
21
+ beforeKey: CoarDataListKey | null;
22
+ }
23
+ /**
24
+ * Translates a drop target into an insertion point among `siblingKeys` (the
25
+ * visible items that share the destination parent) with the dragged keys
26
+ * removed. Pass `null` as target to append. Returns `null` when the drop would
27
+ * change nothing (target is a dragged item, or the block would land where it
28
+ * already is).
29
+ */
30
+ export declare function resolveInsertion(siblingKeys: readonly CoarDataListKey[], draggedKeys: ReadonlySet<CoarDataListKey>, target: {
31
+ key: CoarDataListKey;
32
+ position: 'before' | 'after';
33
+ } | null, options: {
34
+ fromSelf: boolean;
35
+ sameParent: boolean;
36
+ }): Insertion | null;
37
+ /** Distance from the viewport edges at which dragging starts auto-scrolling. */
38
+ export declare const AUTOSCROLL_EDGE = 28;
39
+ /** Scroll step per frame while the pointer sits inside the edge zone. */
40
+ export declare function autoscrollDelta(clientY: number, rect: {
41
+ top: number;
42
+ bottom: number;
43
+ }): number;
44
+ /** `true` when a DataTransfer carries OS files (the only thing readable during dragover). */
45
+ export declare function isFileDrag(dt: DataTransfer | null): boolean;
46
+ //# sourceMappingURL=reorder-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reorder-core.d.ts","sourceRoot":"","sources":["../../../../src/components/data-list/internal/reorder-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE5F;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAClE,KAAK,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAC/B,GAAG,EAAE,eAAe,EACpB,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GACnC,sBAAsB,CAcxB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IACjC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;CACnC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,SAAS,eAAe,EAAE,EACvC,WAAW,EAAE,WAAW,CAAC,eAAe,CAAC,EACzC,MAAM,EAAE;IAAE,GAAG,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAE,GAAG,IAAI,EACrE,OAAO,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,GAClD,SAAS,GAAG,IAAI,CAwBlB;AAED,gFAAgF;AAChF,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAI9F;AAED,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,GAAG,OAAO,CAE3D"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Lower-cases and strips diacritics so "Café" matches "cafe" and "CAFÉ" alike.
3
+ */
4
+ export declare function normalizeSearchText(text: string): string;
5
+ /** Splits a query into normalized, non-empty terms. */
6
+ export declare function searchTerms(query: string | undefined | null): string[];
7
+ /** Every term must occur somewhere in the (already normalized) haystack. */
8
+ export declare function matchesSearchTerms(normalizedHaystack: string, terms: readonly string[]): boolean;
9
+ /**
10
+ * Default searchable text of an item: its own string, number and boolean
11
+ * properties joined with spaces. Nested objects and functions are skipped.
12
+ */
13
+ export declare function defaultSearchText(item: unknown): string;
14
+ /** Builds the searchable text for an item from a field list or extractor. */
15
+ export declare function searchTextOf<T>(item: T, searchBy: ReadonlyArray<keyof T & string> | ((item: T) => string) | undefined): string;
16
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../src/components/data-list/internal/search.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,EAAE,CAGtE;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAKhG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAUvD;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,SAAS,GAC5E,MAAM,CAWR"}
@@ -0,0 +1,92 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { CoarDataListEntry, CoarDataListKey, CoarDataListLayout } from '../types';
3
+ type ItemEntry<T> = Extract<CoarDataListEntry<T>, {
4
+ kind: 'item';
5
+ }>;
6
+ type GroupEntry<T> = Extract<CoarDataListEntry<T>, {
7
+ kind: 'group';
8
+ }>;
9
+ /**
10
+ * Where a line sits when it belongs to the children of an expanded grid tile:
11
+ * the band under that tile's row. `parentColumn` / `columns` describe the
12
+ * parent's position in its row so the frame can open exactly under it.
13
+ */
14
+ export interface CoarDataListBand {
15
+ parentKey: CoarDataListKey;
16
+ parentColumn: number;
17
+ parentColumns: number;
18
+ /** 1 for a band under a top-level row, 2 for a band inside that band, … */
19
+ level: number;
20
+ first: boolean;
21
+ last: boolean;
22
+ }
23
+ /**
24
+ * One virtualized row. `items` lines hold one entry in list layout, up to
25
+ * `columns` entries in grid layout — always in data order. Lines carry the
26
+ * layout of their level, so a list may nest grid children and vice versa.
27
+ */
28
+ export type CoarDataListLine<T> = {
29
+ kind: 'group';
30
+ key: string;
31
+ entry: GroupEntry<T>;
32
+ depth: 0;
33
+ band?: CoarDataListBand;
34
+ } | {
35
+ kind: 'items';
36
+ key: string;
37
+ entries: ItemEntry<T>[];
38
+ depth: number;
39
+ layout: CoarDataListLayout;
40
+ columns: number;
41
+ /** Set on the row that has a band directly under it (its bottom gap is removed). */
42
+ opensBand: boolean;
43
+ band?: CoarDataListBand;
44
+ };
45
+ export interface UseDataListLinesOptions<T> {
46
+ entries: Ref<readonly CoarDataListEntry<T>[]>;
47
+ layout: () => CoarDataListLayout;
48
+ tileMinWidth: () => number | string;
49
+ /** Layout / tile width of the child levels; `undefined` = inherit. */
50
+ childLayout: () => CoarDataListLayout | undefined;
51
+ childTileMinWidth: () => number | string | undefined;
52
+ gap: () => number | string | undefined;
53
+ /** Horizontal inset of a band (px) — bands are narrower than their parent row. */
54
+ bandInset: () => number;
55
+ /** The scroll container — its width decides the column count. */
56
+ viewport: Ref<HTMLElement | null>;
57
+ /** Invisible element styled with `width: tileMinWidth; padding-left: gap`, used to resolve CSS lengths to px. */
58
+ probe: Ref<HTMLElement | null>;
59
+ /** Same for the child levels' tile width. */
60
+ childProbe: Ref<HTMLElement | null>;
61
+ }
62
+ /** A band's extent in lines — one frame is drawn per band, not per line. */
63
+ export interface CoarDataListBandRange {
64
+ parentKey: CoarDataListKey;
65
+ level: number;
66
+ firstLine: number;
67
+ lastLine: number;
68
+ }
69
+ export interface UseDataListLinesReturn<T> {
70
+ lines: ComputedRef<CoarDataListLine<T>[]>;
71
+ bands: ComputedRef<CoarDataListBandRange[]>;
72
+ /** Tiles per row on the top level (1 in list layout). */
73
+ columns: ComputedRef<number>;
74
+ lineIndexOfKey(key: CoarDataListKey): number;
75
+ /** Visual position of an item: its line and its column inside that line. */
76
+ positionOfKey(key: CoarDataListKey): {
77
+ line: number;
78
+ column: number;
79
+ } | null;
80
+ /** Re-read viewport and probe sizes (e.g. after a layout change the observer cannot see). */
81
+ remeasure(): void;
82
+ }
83
+ /**
84
+ * Chunks the model's entries into virtualizable lines and derives the grid
85
+ * column count from the viewport width. Group headings always take a full
86
+ * line. Children of an expanded parent follow the parent row directly in list
87
+ * layout; in grid layout they form a band under the parent's *row*, so tiles
88
+ * never move horizontally when something expands.
89
+ */
90
+ export declare function useDataListLines<T>(options: UseDataListLinesOptions<T>): UseDataListLinesReturn<T>;
91
+ export {};
92
+ //# sourceMappingURL=useDataListLines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDataListLines.d.ts","sourceRoot":"","sources":["../../../../src/components/data-list/internal/useDataListLines.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8D,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC7G,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEvF,KAAK,SAAS,CAAC,CAAC,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AACpE,KAAK,UAAU,CAAC,CAAC,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,eAAe,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAC1B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,GACvF;IACE,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,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WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAAC;IAC7C,4EAA4E;IAC5E,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7E,6FAA6F;IAC7F,SAAS,IAAI,IAAI,CAAC;CACnB;AAoBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CA4NlG"}
@@ -0,0 +1,68 @@
1
+ import { Ref } from 'vue';
2
+ import { DropPayload } from '../../../composables/useDragDrop';
3
+ import { CoarDataListDragEngine, CoarDataListDropEvent, CoarDataListDropTarget, CoarDataListFilesDropEvent, CoarDataListItemsRemoveEvent, CoarDataListKey, CoarDataListLayout } from '../types';
4
+ export interface UseDataListReorderOptions<T> {
5
+ viewport: Ref<HTMLElement | null>;
6
+ /** Reordering / accepting drops is on and the list is not disabled. */
7
+ enabled: () => boolean;
8
+ /**
9
+ * Whether the sibling level under `parentKey` (`null` = top level) is sorted.
10
+ * A sorted level takes no positional drops — its order is the sort's business.
11
+ */
12
+ sortedAt: (parentKey: CoarDataListKey | null) => boolean;
13
+ engine: () => CoarDataListDragEngine;
14
+ layout: () => CoarDataListLayout;
15
+ visibleItems: () => readonly T[];
16
+ keyOf: (item: T) => CoarDataListKey;
17
+ itemByKey: (key: CoarDataListKey) => T | undefined;
18
+ isSelected: (key: CoarDataListKey) => boolean;
19
+ canDrag: () => ((item: T) => boolean) | undefined;
20
+ dragGroup: () => string | undefined;
21
+ dragId: () => string | undefined;
22
+ dragAccept: () => string[] | undefined;
23
+ canDrop: () => ((payload: DropPayload<T>) => boolean) | undefined;
24
+ groupOf: (item: T) => string | null;
25
+ /** Visible parent key of a visible item (`null` at the top level). */
26
+ parentOf: (key: CoarDataListKey) => CoarDataListKey | null;
27
+ /** Visible items sharing `parentKey` (`null` = top level), in display order. */
28
+ siblingsOf: (parentKey: CoarDataListKey | null) => readonly T[];
29
+ /** The list nests and dropping inside `item` is allowed for the dragged items. */
30
+ canNestInto: (parent: T, items: readonly T[]) => boolean;
31
+ /** Ancestor check to refuse dropping a parent into its own subtree. */
32
+ isDescendantOf: (key: CoarDataListKey, ancestorKey: CoarDataListKey) => boolean;
33
+ acceptsFiles: () => boolean;
34
+ focusedKey: Ref<CoarDataListKey | null>;
35
+ scrollToKey: (key: CoarDataListKey) => void;
36
+ onReorder: (event: CoarDataListDropEvent<T>) => void;
37
+ onItemsAdd: (event: CoarDataListDropEvent<T>) => void;
38
+ onItemsRemove: (event: CoarDataListItemsRemoveEvent<T>) => void;
39
+ onFilesDrop: (event: CoarDataListFilesDropEvent<T>) => void;
40
+ onDragStart: (items: readonly T[]) => void;
41
+ onDragEnd: (payload: {
42
+ items: readonly T[];
43
+ dropped: boolean;
44
+ }) => void;
45
+ }
46
+ /**
47
+ * Reordering for `<CoarDataList>`: the list-specific parts (hit testing on rows,
48
+ * insertion maths, keyboard grab mode, file drops) on top of the shared
49
+ * `useDragDrop` engines (native HTML5 or pointer events).
50
+ */
51
+ export declare function useDataListReorder<T>(options: UseDataListReorderOptions<T>): {
52
+ engine: import('vue').ComputedRef<"native" | "pointer">;
53
+ dragging: import('vue').ComputedRef<boolean>;
54
+ grabbed: Ref<boolean, boolean>;
55
+ dragKeys: import('vue').ShallowRef<Set<CoarDataListKey>, Set<CoarDataListKey>>;
56
+ dropTarget: import('vue').ShallowRef<CoarDataListDropTarget | null, CoarDataListDropTarget | null>;
57
+ isDragOver: import('vue').ComputedRef<boolean>;
58
+ nativeDraggable: import('vue').ComputedRef<boolean>;
59
+ isDragged: (key: CoarDataListKey) => boolean;
60
+ onItemDragStart: (event: DragEvent, item: T) => void;
61
+ onItemDragEnd: () => void;
62
+ onItemPointerDown: (event: PointerEvent, item: T) => void;
63
+ onViewportDragOver: (event: DragEvent) => void;
64
+ onViewportDragLeave: (event: DragEvent) => void;
65
+ onViewportDrop: (event: DragEvent) => void;
66
+ onKeyDown: (event: KeyboardEvent) => boolean;
67
+ };
68
+ //# sourceMappingURL=useDataListReorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDataListReorder.d.ts","sourceRoot":"","sources":["../../../../src/components/data-list/internal/useDataListReorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEjF,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,EAC5B,eAAe,EACf,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,QAAQ,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAClC,uEAAuE;IACvE,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB;;;OAGG;IACH,QAAQ,EAAE,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,KAAK,OAAO,CAAC;IACzD,MAAM,EAAE,MAAM,sBAAsB,CAAC;IACrC,MAAM,EAAE,MAAM,kBAAkB,CAAC;IACjC,YAAY,EAAE,MAAM,SAAS,CAAC,EAAE,CAAC;IACjC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,eAAe,CAAC;IACpC,SAAS,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,CAAC,GAAG,SAAS,CAAC;IACnD,UAAU,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC;IAC9C,OAAO,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC;IAClD,SAAS,EAAE,MAAM,MAAM,GAAG,SAA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AAI,CAAC;IAC3C,SAAS,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CACzE;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC;;;;;;;;qBAkWtD,eAAe;6BAzJF,SAAS,QAAQ,CAAC,KAAG,IAAI;yBAU/B,IAAI;+BAKI,YAAY,QAAQ,CAAC,KAAG,IAAI;gCAK3B,SAAS,KAAG,IAAI;iCAkBf,SAAS,KAAG,IAAI;4BASrB,SAAS,KAAG,IAAI;uBAgCrB,aAAa,KAAG,OAAO;EAmFlD"}
@@ -0,0 +1,19 @@
1
+ import { MaybeRefOrGetter, Ref, WatchSource } from 'vue';
2
+ /** Name of the shared CSS highlight — style it with `::highlight(coar-data-list-search)`. */
3
+ export declare const DATA_LIST_HIGHLIGHT_NAME = "coar-data-list-search";
4
+ export interface UseSearchHighlightOptions {
5
+ /** Element whose rendered text is scanned. */
6
+ root: Ref<HTMLElement | null>;
7
+ /** Raw query; split into lower-cased whitespace-separated terms. */
8
+ query: MaybeRefOrGetter<string>;
9
+ enabled: MaybeRefOrGetter<boolean>;
10
+ /** Extra sources that mean "the DOM under root changed" (e.g. the virtual window). */
11
+ triggers?: WatchSource[];
12
+ }
13
+ /**
14
+ * Marks search matches inside `root` with the CSS Custom Highlight API. Browsers
15
+ * without the API simply show no highlight. Matching is case-insensitive on the
16
+ * rendered text; diacritics are not folded here.
17
+ */
18
+ export declare function useSearchHighlight(options: UseSearchHighlightOptions): void;
19
+ //# sourceMappingURL=useSearchHighlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchHighlight.d.ts","sourceRoot":"","sources":["../../../../src/components/data-list/internal/useSearchHighlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,GAAG,EACR,KAAK,WAAW,EACjB,MAAM,KAAK,CAAC;AAEb,6FAA6F;AAC7F,eAAO,MAAM,wBAAwB,0BAA0B,CAAC;AA8ChE,MAAM,WAAW,yBAAyB;IACxC,8CAA8C;IAC9C,IAAI,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9B,oEAAoE;IACpE,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnC,sFAAsF;IACtF,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,CAuC3E"}
@@ -0,0 +1,185 @@
1
+ import { DragEngine } from '../../composables/useDragDrop';
2
+ /** Identity of a list item — what `itemKey` returns. */
3
+ export type CoarDataListKey = string | number;
4
+ export type CoarDataListSortDirection = 'asc' | 'desc';
5
+ /** Active sort state (`v-model:sort`). `null` keeps the input order. */
6
+ export interface CoarDataListSort {
7
+ /** `key` of the chosen {@link CoarDataListSortOption}. */
8
+ key: string;
9
+ direction: CoarDataListSortDirection;
10
+ }
11
+ /** One entry of the sort menu. */
12
+ export interface CoarDataListSortOption<T> {
13
+ /** Stable identifier, also used as the default property name when `by` is omitted. */
14
+ key: string;
15
+ /** Menu label. */
16
+ label: string;
17
+ /**
18
+ * Extracts the value to compare. Values are compared locale-aware (numeric strings,
19
+ * diacritics), numbers numerically, dates chronologically; `null`/`undefined` sort last.
20
+ * Default: `item[key]`.
21
+ */
22
+ by?: (item: T) => unknown;
23
+ /** Full custom comparator for ascending order. Wins over `by`. */
24
+ compare?: (a: T, b: T) => number;
25
+ /** Direction applied when this option is chosen. Default `'asc'`. */
26
+ defaultDirection?: CoarDataListSortDirection;
27
+ }
28
+ /**
29
+ * Which text the search matches against: a list of property names (joined), or a
30
+ * function returning the searchable string. Default: every own string, number and
31
+ * boolean property of the item.
32
+ */
33
+ export type CoarDataListSearchBy<T> = ReadonlyArray<keyof T & string> | ((item: T) => string);
34
+ export type CoarDataListSelectionMode = 'none' | 'single' | 'multiple';
35
+ /** Order of groups when `groupBy` is used. Default `'asc'`. */
36
+ export type CoarDataListSortGroups = 'asc' | 'desc' | 'none' | ((a: string, b: string) => number);
37
+ export type CoarDataListDensity = 's' | 'm' | 'l';
38
+ /**
39
+ * `'list'`: one record per row. `'grid'`: records flow into tiles, as many per
40
+ * row as fit `tileMinWidth`. Both keep the exact data order — a tile grid is a
41
+ * list that wraps.
42
+ */
43
+ export type CoarDataListLayout = 'list' | 'grid';
44
+ /** How nested levels are drawn: guide lines per depth, or indentation only. */
45
+ export type CoarDataListNestingStyle = 'lines' | 'none';
46
+ /**
47
+ * Per-level configuration for nested lists. The top level is the list itself;
48
+ * every child level may override how its items are sorted. (Layout per level
49
+ * is planned — mixed list/grid nesting — and will live here too.)
50
+ */
51
+ export interface CoarDataListLevelConfig<T> {
52
+ sortOptions?: readonly CoarDataListSortOption<T>[];
53
+ sort?: CoarDataListSort | null;
54
+ /** Layout of the child levels. Default: the list's own layout. */
55
+ layout?: CoarDataListLayout;
56
+ /** Minimum tile width when the child levels use the grid layout. Default: the list's `tileMinWidth`. */
57
+ tileMinWidth?: number | string;
58
+ }
59
+ /** A visible row — either an item or the heading of a group. */
60
+ export type CoarDataListEntry<T> = {
61
+ kind: 'item';
62
+ /** Unique row key (`i:` + item key). */
63
+ key: string;
64
+ itemKey: CoarDataListKey;
65
+ item: T;
66
+ /** Position among the visible items (group headings excluded). */
67
+ index: number;
68
+ /** Nesting depth, 0 for top-level items. */
69
+ depth: number;
70
+ /** Key of the parent item, `null` at the top level. */
71
+ parentKey: CoarDataListKey | null;
72
+ /** The item has children (whether or not they are shown). */
73
+ hasChildren: boolean;
74
+ /** Children are currently shown. */
75
+ expanded: boolean;
76
+ } | {
77
+ kind: 'group';
78
+ key: string;
79
+ group: string;
80
+ count: number;
81
+ items: T[];
82
+ };
83
+ export interface CoarDataListItemSlotProps<T> {
84
+ item: T;
85
+ /** Position among the visible items. */
86
+ index: number;
87
+ itemKey: CoarDataListKey;
88
+ selected: boolean;
89
+ focused: boolean;
90
+ /** Part of an in-flight drag (pointer or keyboard). */
91
+ dragging: boolean;
92
+ /** Nesting depth, 0 at the top level. */
93
+ depth: number;
94
+ hasChildren: boolean;
95
+ expanded: boolean;
96
+ /** Select only this item. */
97
+ select(): void;
98
+ /** Toggle this item's selection (multiple) or select/clear it (single). */
99
+ toggle(): void;
100
+ /** Show / hide this item's children. */
101
+ toggleExpanded(): void;
102
+ }
103
+ export interface CoarDataListGroupSlotProps<T> {
104
+ group: string;
105
+ count: number;
106
+ items: T[];
107
+ }
108
+ export interface CoarDataListItemEvent<T> {
109
+ item: T;
110
+ itemKey: CoarDataListKey;
111
+ index: number;
112
+ event: MouseEvent | KeyboardEvent;
113
+ }
114
+ /** Drag engine — see `DragEngine` in `useDragDrop`. Accepting OS files works with either. */
115
+ export type CoarDataListDragEngine = DragEngine;
116
+ /** `'inside'` makes the target the new parent (nested lists only). */
117
+ export type CoarDataListDropPosition = 'before' | 'after' | 'inside';
118
+ /** Where a drag would land, relative to a visible item. */
119
+ export interface CoarDataListDropTarget {
120
+ key: CoarDataListKey;
121
+ position: CoarDataListDropPosition;
122
+ }
123
+ /**
124
+ * Payload of `reorder` (drop inside the same list) and `items-add` (drop from
125
+ * another list). The list never mutates its data — apply the change to your
126
+ * source. `afterKey` / `beforeKey` name the visible neighbours of the insertion
127
+ * point (dragged items excluded), which stays correct while a search hides rows.
128
+ */
129
+ export interface CoarDataListDropEvent<T> {
130
+ items: T[];
131
+ keys: CoarDataListKey[];
132
+ /** Index among the visible siblings of the insertion point, dragged items excluded. */
133
+ toIndex: number;
134
+ afterKey: CoarDataListKey | null;
135
+ beforeKey: CoarDataListKey | null;
136
+ /** `groupBy` value at the insertion point, or `null` without grouping / at the end. */
137
+ group: string | null;
138
+ /** Parent of the insertion point in nested lists (`null` = top level). */
139
+ parentKey: CoarDataListKey | null;
140
+ fromSelf: boolean;
141
+ /** `dragId` of the source list, if it set one. */
142
+ sourceId: string | null;
143
+ sourceDragGroup: string | null;
144
+ }
145
+ export interface CoarDataListItemsRemoveEvent<T> {
146
+ items: T[];
147
+ keys: CoarDataListKey[];
148
+ /** `dragGroup` of the list that accepted the items. */
149
+ toDragGroup: string | null;
150
+ }
151
+ export interface CoarDataListFilesDropEvent<T> {
152
+ files: File[];
153
+ /** The item under the pointer, or `null` on empty space. */
154
+ item: T | null;
155
+ event: DragEvent;
156
+ }
157
+ /** One entry of a declarative context menu (`builder.itemMenu` / `builder.viewportMenu`). */
158
+ export interface CoarDataListMenuItem {
159
+ label: string;
160
+ /** Icon name passed to `<CoarMenuItem :icon>`. */
161
+ icon?: string;
162
+ /** Destructive action styling. */
163
+ danger?: boolean;
164
+ disabled?: boolean;
165
+ /** Invoked on click; the list closes the menu afterwards. */
166
+ onClick: () => void;
167
+ }
168
+ export type CoarDataListMenuEntry = CoarDataListMenuItem | 'divider';
169
+ /** Selection API shared by the composable and the component. */
170
+ export interface CoarDataListSelection<T> {
171
+ isSelected(key: CoarDataListKey): boolean;
172
+ /**
173
+ * Change the selection relative to `key`.
174
+ * - `replace` (default): only this item
175
+ * - `toggle`: add/remove it (in single mode: select or clear)
176
+ * - `range`: from the anchor to this item (multiple mode only)
177
+ */
178
+ select(key: CoarDataListKey, mode?: 'replace' | 'toggle' | 'range'): void;
179
+ /** Select every visible item (multiple mode). */
180
+ selectAll(): void;
181
+ clear(): void;
182
+ /** The currently selected items, in visible order (filtered-out items are kept). */
183
+ selectedItems: import('vue').ComputedRef<T[]>;
184
+ }
185
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/data-list/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,wDAAwD;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ChC;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC;IAC7C,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,uDAAuD;IACvD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC;IAC3C,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,4DAA4D;IAC5D,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,6FAA6F;AAC7F,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG,SAAS,CAAC;AAErE,gEAAgE;AAChE,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,UAAU,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC;IAC1C;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;IAC1E,iDAAiD;IACjD,SAAS,IAAI,IAAI,CAAC;IAClB,KAAK,IAAI,IAAI,CAAC;IACd,oFAAoF;IACpF,aAAa,EAAE,OAAO,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;CAC/C"}
@@ -0,0 +1,79 @@
1
+ import { ComputedRef, MaybeRef, MaybeRefOrGetter, Ref } from 'vue';
2
+ import { CoarDataListEntry, CoarDataListKey, CoarDataListLevelConfig, CoarDataListSearchBy, CoarDataListSelection, CoarDataListSelectionMode, CoarDataListSort, CoarDataListSortGroups, CoarDataListSortOption } from './types';
3
+ type ItemEntry<T> = Extract<CoarDataListEntry<T>, {
4
+ kind: 'item';
5
+ }>;
6
+ export interface UseDataListModelOptions<T> {
7
+ items: MaybeRefOrGetter<readonly T[]>;
8
+ /** Stable identity of an item. Selection and measured heights are stored under it. */
9
+ itemKey: (item: T) => CoarDataListKey;
10
+ /** Free-text query. Whitespace splits it into terms that must all match. */
11
+ search?: MaybeRefOrGetter<string | undefined>;
12
+ /** Plain value or ref (not a getter — a function here is the extractor itself). */
13
+ searchBy?: MaybeRef<CoarDataListSearchBy<T> | undefined>;
14
+ /** Additional predicate applied before the search. Plain function or ref. */
15
+ filter?: MaybeRef<((item: T) => boolean) | undefined>;
16
+ sort?: MaybeRefOrGetter<CoarDataListSort | null | undefined>;
17
+ sortOptions?: MaybeRefOrGetter<readonly CoarDataListSortOption<T>[] | undefined>;
18
+ /** Plain function or ref. */
19
+ groupBy?: MaybeRef<((item: T) => string) | undefined>;
20
+ sortGroups?: MaybeRef<CoarDataListSortGroups | undefined>;
21
+ /** BCP 47 tag for collation. Default: the runtime locale. */
22
+ locale?: MaybeRefOrGetter<string | undefined>;
23
+ selectionMode?: MaybeRefOrGetter<CoarDataListSelectionMode>;
24
+ /** External selection model. When omitted the composable keeps its own. */
25
+ selected?: Ref<CoarDataListKey[]>;
26
+ /** Nested lists: returns an item's children (plain function or ref). */
27
+ children?: MaybeRef<((item: T) => readonly T[] | null | undefined) | undefined>;
28
+ /** Keys of the items whose children are shown. When omitted the composable keeps its own. */
29
+ expanded?: Ref<CoarDataListKey[]>;
30
+ /** Configuration of the child levels (all levels below the top share it). */
31
+ childLevel?: MaybeRefOrGetter<CoarDataListLevelConfig<T> | undefined>;
32
+ /** Deepest level shown, 0 = top level only. Default: unlimited. */
33
+ maxDepth?: MaybeRefOrGetter<number | undefined>;
34
+ /** Set to `false` to show top-level items only (used by layouts without nesting). Default true. */
35
+ nesting?: MaybeRefOrGetter<boolean>;
36
+ }
37
+ export interface UseDataListModelReturn<T> extends CoarDataListSelection<T> {
38
+ /** Visible items after filter, search, sort, grouping and nesting, in display order. */
39
+ items: ComputedRef<T[]>;
40
+ /** Visible rows including group headings, in display order. */
41
+ entries: ComputedRef<CoarDataListEntry<T>[]>;
42
+ /** Number of source items (top level). */
43
+ total: ComputedRef<number>;
44
+ /** Number of visible items (all levels). */
45
+ count: ComputedRef<number>;
46
+ keyOf(item: T): CoarDataListKey;
47
+ itemByKey(key: CoarDataListKey): T | undefined;
48
+ /** Position of a key among the visible items, or -1. */
49
+ indexOfKey(key: CoarDataListKey): number;
50
+ /** Position of a key among `entries` (group headings included), or -1. */
51
+ entryIndexOfKey(key: CoarDataListKey): number;
52
+ /** The visible entry of a key. */
53
+ entryOfKey(key: CoarDataListKey): ItemEntry<T> | undefined;
54
+ selected: Ref<CoarDataListKey[]>;
55
+ /** Anchor for shift-range selection. */
56
+ anchor: Ref<CoarDataListKey | null>;
57
+ /** Keys with children currently shown. */
58
+ expanded: Ref<CoarDataListKey[]>;
59
+ isExpanded(key: CoarDataListKey): boolean;
60
+ hasChildren(item: T): boolean;
61
+ expand(key: CoarDataListKey): void;
62
+ collapse(key: CoarDataListKey): void;
63
+ toggleExpanded(key: CoarDataListKey): void;
64
+ /** Expand every visible item that has children (recursively). */
65
+ expandAll(): void;
66
+ collapseAll(): void;
67
+ /** Parent key of a visible item, `null` at the top level. */
68
+ parentOf(key: CoarDataListKey): CoarDataListKey | null;
69
+ /** The sort in effect on a level (0 = top level); `null` when that level keeps its input order. */
70
+ sortAtDepth(depth: number): CoarDataListSort | null;
71
+ }
72
+ /**
73
+ * Headless data pipeline for {@link CoarDataList}: filter → search → sort → group,
74
+ * nested children under expanded parents, plus key-based selection. Use it
75
+ * directly when you render your own list.
76
+ */
77
+ export declare function useDataListModel<T>(options: UseDataListModelOptions<T>): UseDataListModelReturn<T>;
78
+ export {};
79
+ //# sourceMappingURL=useDataListModel.d.ts.map
@@ -0,0 +1 @@
1
+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@ export declare function coarCreateDateMask(pattern: DateFormatConfig['pattern'])
10
10
  /**
11
11
  * Creates a Maskito datetime mask for a given date format pattern and time options.
12
12
  *
13
+ * The date/time separator must stay a plain space: the pickers format and parse
14
+ * their input as `"<date> <time>"`, while Maskito's default separator is `", "`
15
+ * — with the default, re-masking on the first keystroke inserts a comma the
16
+ * parsers reject, so edits never reach the model and revert on blur.
17
+ *
13
18
  * @example
14
- * const mask = coarCreateDateTimeMask('dd.mm.yyyy', false) // "01.06.2026, 14:30"
15
- * const mask = coarCreateDateTimeMask('mm/dd/yyyy', true) // "06/01/2026, 2:30 PM"
19
+ * const mask = coarCreateDateTimeMask('dd.mm.yyyy', false) // "01.06.2026 14:30"
20
+ * const mask = coarCreateDateTimeMask('mm/dd/yyyy', true) // "06/01/2026 02:30 PM"
16
21
  */
17
22
  export declare function coarCreateDateTimeMask(pattern: DateFormatConfig['pattern'], use12Hour: boolean): Required<import('@maskito/core').MaskitoOptions>;
18
23
  //# sourceMappingURL=maskito-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"maskito-config.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/_shared/maskito-config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIhD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,oDAKtE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,EACpC,SAAS,EAAE,OAAO,oDAOnB"}
1
+ {"version":3,"file":"maskito-config.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/_shared/maskito-config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIhD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,oDAKtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,EACpC,SAAS,EAAE,OAAO,oDAQnB"}
@@ -11,12 +11,19 @@ export declare function coarDetect12HourFormat(locale: string): boolean;
11
11
  /**
12
12
  * Formats a time value as a string.
13
13
  *
14
+ * `forMaskedInput` emits the exact canonical text of the Maskito `HH:MM AA`
15
+ * mask: two-digit hour (the mask shreds "8:30 PM" into "83:0" on the first
16
+ * re-mask) and a no-break space before the meridiem (Maskito's own output —
17
+ * a regular space would make every programmatic write differ from the DOM
18
+ * and yank the cursor to the end). 24h output is identical either way.
19
+ *
14
20
  * @example
15
- * coarFormatTime(14, 30, true) // "14:30"
16
- * coarFormatTime(14, 30, false) // "2:30 PM"
17
- * coarFormatTime(0, 5, false) // "12:05 AM"
21
+ * coarFormatTime(14, 30, true) // "14:30"
22
+ * coarFormatTime(14, 30, false) // "2:30 PM"
23
+ * coarFormatTime(14, 30, false, true) // "02:30\u00a0PM"
24
+ * coarFormatTime(0, 5, false) // "12:05 AM"
18
25
  */
19
- export declare function coarFormatTime(hours: number, minutes: number, use24Hour: boolean): string;
26
+ export declare function coarFormatTime(hours: number, minutes: number, use24Hour: boolean, forMaskedInput?: boolean): string;
20
27
  /**
21
28
  * Parses a time string into hours and minutes.
22
29
  * Supports both 24-hour ("14:30") and 12-hour ("2:30 PM") formats.
@@ -1 +1 @@
1
- {"version":3,"file":"time-helpers.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/_shared/time-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7D;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAW9D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAYzF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CA6BrE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,CAK9F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,MAAM,CAGnF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGvE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,SAAI,GACP;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAgBxC;AAED,gDAAgD;AAChD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,CAMnE"}
1
+ {"version":3,"file":"time-helpers.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/_shared/time-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7D;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAW9D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,OAAO,EAClB,cAAc,UAAQ,GACrB,MAAM,CAeR;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CA6BrE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,CAK9F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,MAAM,CAGnF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGvE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,SAAI,GACP;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAgBxC;AAED,gDAAgD;AAChD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,CAMnE"}
@@ -29,7 +29,7 @@ export declare function useDatePickerBase(props: {
29
29
  }): {
30
30
  effectiveLocale: ComputedRef<string>;
31
31
  effectiveDateFormat: ComputedRef<DateFormatConfig>;
32
- separator: ComputedRef<"." | "/" | "-">;
32
+ separator: ComputedRef<"." | "-" | "/">;
33
33
  timezone: Readonly<Ref<string, string>>;
34
34
  isOpen: Ref<boolean, boolean>;
35
35
  open: () => void;
@@ -55,8 +55,8 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
55
55
  onOpened?: (() => any) | undefined;
56
56
  }>, {
57
57
  error: boolean;
58
- size: CoarPlainDatePickerSize;
59
58
  id: string;
59
+ size: CoarPlainDatePickerSize;
60
60
  required: boolean;
61
61
  disabled: boolean;
62
62
  placeholder: string;