@vuetify/v0 0.1.5 → 0.1.7

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 (162) hide show
  1. package/README.md +0 -1
  2. package/dist/{adapter-Cmeg49W9.mjs → adapter-B4zE-hA5.mjs} +10 -15
  3. package/dist/adapter-CqP9Z4JU.d.mts +1087 -0
  4. package/dist/{adapter-D2JoR-4d.d.mts → adapter-DIx4Rntl.d.mts} +6 -49
  5. package/dist/adapters-BjeDmKc6.mjs +1 -0
  6. package/dist/adapters-Bv5aRv3l.mjs +1 -0
  7. package/dist/adapters-C66XaKkw.mjs +1 -0
  8. package/dist/adapters-DkVblyML.mjs +1 -0
  9. package/dist/adapters-uJLWGQJl.mjs +1 -0
  10. package/dist/browser/index.js +2251 -826
  11. package/dist/components/index.d.mts +2 -20
  12. package/dist/components/index.mjs +34 -39
  13. package/dist/{components-BbbGkTcN.mjs → components-CACff-Lt.mjs} +1154 -317
  14. package/dist/composables/index.d.mts +18 -17
  15. package/dist/composables/index.mjs +34 -37
  16. package/dist/{consola-DiUk9j3y.d.mts → consola-BVzYzeLH.d.mts} +1 -1
  17. package/dist/{consola-GBy8XRuL.mjs → consola-Ceox8BWi.mjs} +1 -2
  18. package/dist/constants/index.d.mts +1 -1
  19. package/dist/constants/index.mjs +3 -5
  20. package/dist/{createDataTable-cNf6DdHz.mjs → createDataTable-CLI4TALE.mjs} +9 -11
  21. package/dist/{createGroup-BrZPZudL.mjs → createGroup-Cf6lK9BR.mjs} +7 -9
  22. package/dist/{createPagination-Wc_vRGNQ.mjs → createPagination-Bu8vE0JW.mjs} +3 -5
  23. package/dist/{createSelection-BURpoE3p.mjs → createSelection-DvOR2tKk.mjs} +216 -63
  24. package/dist/{createSingle-BE1vHaZy.mjs → createSingle-Bbcwcq4R.mjs} +3 -5
  25. package/dist/{createTokens-jwf8-iGn.mjs → createTokens-CMRBDlzN.mjs} +41 -26
  26. package/dist/{createTrinity-DkwPrPRS.mjs → createTrinity-C_c8eedz.mjs} +10 -13
  27. package/dist/data-table/adapters/client/index.d.mts +1 -2
  28. package/dist/data-table/adapters/client/index.mjs +7 -9
  29. package/dist/data-table/adapters/index.d.mts +4 -4
  30. package/dist/data-table/adapters/index.mjs +10 -12
  31. package/dist/data-table/adapters/server/index.d.mts +1 -2
  32. package/dist/data-table/adapters/server/index.mjs +5 -7
  33. package/dist/data-table/adapters/virtual/index.d.mts +1 -2
  34. package/dist/data-table/adapters/virtual/index.mjs +7 -9
  35. package/dist/data-table/index.d.mts +5 -6
  36. package/dist/data-table/index.mjs +22 -25
  37. package/dist/date/index.d.mts +1 -3
  38. package/dist/date/index.mjs +3932 -3943
  39. package/dist/features/adapters/flagsmith/index.d.mts +2 -4
  40. package/dist/features/adapters/flagsmith/index.mjs +2 -3
  41. package/dist/features/adapters/launchdarkly/index.d.mts +1 -3
  42. package/dist/features/adapters/launchdarkly/index.mjs +2 -3
  43. package/dist/features/adapters/posthog/index.d.mts +1 -3
  44. package/dist/features/adapters/posthog/index.mjs +3 -4
  45. package/dist/features/index.d.mts +2 -16
  46. package/dist/features/index.mjs +13 -18
  47. package/dist/{flagsmith-CHmpPGR7.mjs → flagsmith-CrWUeIhT.mjs} +1 -2
  48. package/dist/{globals-vN-O052q.mjs → globals-BqRH_jdr.mjs} +2 -3
  49. package/dist/{htmlElements-d8iBCGpO.mjs → htmlElements-DcYtv0hg.mjs} +7 -10
  50. package/dist/index-8sflFIN8.d.mts +856 -0
  51. package/dist/{index-BTMzRHep.d.mts → index-BE848tZ2.d.mts} +938 -889
  52. package/dist/{index-DRax9EgT.d.mts → index-CKbxWC4t.d.mts} +1358 -542
  53. package/dist/index-CeNfBYuo.d.mts +46 -0
  54. package/dist/{index-DdWxDPX3.d.mts → index-CmCMrlt3.d.mts} +3 -3
  55. package/dist/{index-BFBN5Zl3.d.mts → index-Dor6eAEc.d.mts} +0 -1
  56. package/dist/{index-UNwEBkQT.d.mts → index-MHkcqY_y.d.mts} +1 -2
  57. package/dist/{index-BuOz3Rgm.d.mts → index-dJKXAO5D.d.mts} +1 -2
  58. package/dist/index.d.mts +22 -20
  59. package/dist/index.mjs +38 -40
  60. package/dist/json/attributes.json +196 -12
  61. package/dist/json/importMap.json +40 -0
  62. package/dist/json/tags.json +86 -0
  63. package/dist/json/web-types.json +605 -13
  64. package/dist/{launchdarkly-W8t8ZANX.mjs → launchdarkly-jF2KZGoH.mjs} +1 -2
  65. package/dist/locale/adapters/index.d.mts +1 -2
  66. package/dist/locale/adapters/index.mjs +4 -6
  67. package/dist/locale/adapters/v0/index.d.mts +1 -2
  68. package/dist/locale/adapters/v0/index.mjs +3 -5
  69. package/dist/locale/index.d.mts +2 -16
  70. package/dist/locale/index.mjs +14 -17
  71. package/dist/logger/adapters/consola/index.d.mts +1 -2
  72. package/dist/logger/adapters/consola/index.mjs +2 -3
  73. package/dist/logger/adapters/index.d.mts +4 -4
  74. package/dist/logger/adapters/index.mjs +6 -8
  75. package/dist/logger/adapters/pino/index.d.mts +1 -2
  76. package/dist/logger/adapters/pino/index.mjs +3 -5
  77. package/dist/logger/adapters/v0/index.d.mts +1 -2
  78. package/dist/logger/adapters/v0/index.mjs +3 -5
  79. package/dist/logger/index.d.mts +5 -16
  80. package/dist/logger/index.mjs +8 -10
  81. package/dist/{memory-BsZGbGnG.mjs → memory-XCMtkld1.mjs} +1 -2
  82. package/dist/palettes/ant/generate/index.d.mts +9 -0
  83. package/dist/palettes/ant/generate/index.mjs +98 -0
  84. package/dist/palettes/ant/index.d.mts +6 -0
  85. package/dist/palettes/ant/index.mjs +149 -0
  86. package/dist/palettes/index.d.mts +12 -0
  87. package/dist/palettes/index.mjs +1 -0
  88. package/dist/palettes/leonardo/generate/index.d.mts +10 -0
  89. package/dist/palettes/leonardo/generate/index.mjs +120 -0
  90. package/dist/palettes/material/generate/index.d.mts +10 -0
  91. package/dist/palettes/material/generate/index.mjs +103 -0
  92. package/dist/palettes/material/index.d.mts +6 -0
  93. package/dist/palettes/material/index.mjs +173 -0
  94. package/dist/palettes/md1/index.d.mts +6 -0
  95. package/dist/palettes/md1/index.mjs +261 -0
  96. package/dist/palettes/md2/index.d.mts +6 -0
  97. package/dist/palettes/md2/index.mjs +297 -0
  98. package/dist/palettes/radix/index.d.mts +6 -0
  99. package/dist/palettes/radix/index.mjs +439 -0
  100. package/dist/palettes/tailwind/index.d.mts +6 -0
  101. package/dist/palettes/tailwind/index.mjs +291 -0
  102. package/dist/permissions/adapters/index.d.mts +2 -17
  103. package/dist/permissions/adapters/index.mjs +4 -6
  104. package/dist/permissions/adapters/v0/index.d.mts +1 -17
  105. package/dist/permissions/adapters/v0/index.mjs +3 -5
  106. package/dist/permissions/index.d.mts +1 -16
  107. package/dist/permissions/index.mjs +12 -15
  108. package/dist/{pino-DFxkZLiu.mjs → pino-B7tJ3m18.mjs} +2 -4
  109. package/dist/{pino-p-jDkNQd.d.mts → pino-Bzighnkd.d.mts} +1 -2
  110. package/dist/{posthog-BOUoZTTf.mjs → posthog-DbPqmaAp.mjs} +2 -4
  111. package/dist/rules/index.d.mts +2 -0
  112. package/dist/rules/index.mjs +15 -0
  113. package/dist/{server-C2R2POGE.mjs → server-CZ6ahbEH.mjs} +2 -4
  114. package/dist/{server-B-HWxaTQ.d.mts → server-Ch9J86tb.d.mts} +1 -2
  115. package/dist/storage/adapters/index.d.mts +2 -2
  116. package/dist/storage/adapters/index.mjs +2 -3
  117. package/dist/storage/adapters/memory/index.d.mts +1 -1
  118. package/dist/storage/adapters/memory/index.mjs +2 -3
  119. package/dist/storage/index.d.mts +3 -16
  120. package/dist/storage/index.mjs +33 -37
  121. package/dist/theme/adapters/index.d.mts +1 -16
  122. package/dist/theme/adapters/index.mjs +4 -6
  123. package/dist/theme/adapters/v0/index.d.mts +1 -16
  124. package/dist/theme/adapters/v0/index.mjs +3 -5
  125. package/dist/theme/index.d.mts +1 -16
  126. package/dist/theme/index.mjs +13 -16
  127. package/dist/{toArray-VIn8vYt3.mjs → toArray-VdROPpy-.mjs} +2 -4
  128. package/dist/types/index.d.mts +1 -1
  129. package/dist/types/index.mjs +1 -1
  130. package/dist/{useClickOutside-DIi0kjN5.mjs → useClickOutside-YOGwKo7v.mjs} +603 -287
  131. package/dist/{useFeatures-6O7EPJUS.mjs → useFeatures-BGDgUrdr.mjs} +5 -8
  132. package/dist/{useLocale-DHjbekzS.mjs → useLocale-C8I_fNAS.mjs} +7 -9
  133. package/dist/{useLogger-BXqiUvt2.mjs → useLogger-B70T4SgK.mjs} +13 -16
  134. package/dist/{usePermissions-DFacFVqO.mjs → usePermissions-afVt2qR7.mjs} +5 -7
  135. package/dist/useRules-7C92Xzyt.mjs +144 -0
  136. package/dist/{useTheme-D0_1mjTw.mjs → useTheme-jp2wL2FJ.mjs} +11 -13
  137. package/dist/utilities/index.d.mts +1 -2
  138. package/dist/utilities/index.mjs +426 -4
  139. package/dist/{v0-BNXo1ecc.d.mts → v0-1bfmyZ5_.d.mts} +2 -2
  140. package/dist/{v0-BOxb3nD1.d.mts → v0-1xxC39wf.d.mts} +1 -2
  141. package/dist/{v0-BYqmw3qM.mjs → v0-B1QQGE4O.mjs} +2 -5
  142. package/dist/{v0-DHMoZ7dS.d.mts → v0-CAKa6tzG.d.mts} +1 -1
  143. package/dist/{v0-Dwufx8ae.mjs → v0-CGlkn5u7.mjs} +3 -6
  144. package/dist/{v0-CfSj99gF.mjs → v0-CHvU3jQE.mjs} +3 -5
  145. package/dist/{v0-BPzPP8C5.d.mts → v0-CdUL2eOn.d.mts} +1 -2
  146. package/dist/{v0-C8DBv9mh.mjs → v0-V-cQsuZD.mjs} +3 -5
  147. package/dist/{v0-Dc5mcpQs.mjs → v0-YAqbXudL.mjs} +3 -5
  148. package/dist/{virtual-A4e1yrdn.d.mts → virtual-DwBiFA25.d.mts} +1 -2
  149. package/dist/{virtual-BoTGK6HT.mjs → virtual-eDNVH1fz.mjs} +3 -5
  150. package/package.json +39 -11
  151. package/dist/adapter-DcwxFryd.d.mts +0 -97
  152. package/dist/adapters-BGJKsBrw.mjs +0 -1
  153. package/dist/adapters-BQ-Lr3PW.mjs +0 -1
  154. package/dist/adapters-DEXpW9If.mjs +0 -1
  155. package/dist/adapters-Q9WaOsJp.mjs +0 -1
  156. package/dist/adapters-SSDVth5e.mjs +0 -1
  157. package/dist/constants-B8pMSkcW.mjs +0 -1
  158. package/dist/utilities-Dx8wzGa5.mjs +0 -429
  159. /package/dist/{adapter-CJIj5ySf.d.mts → adapter-JTFG3Jn8.d.mts} +0 -0
  160. /package/dist/{index-Bv1VN_j5.d.mts → index-B5ZDDkXv.d.mts} +0 -0
  161. /package/dist/{index-BDTbJClL.d.mts → index-NsE5nARK.d.mts} +0 -0
  162. /package/dist/{memory-DVjquu_v.d.mts → memory-BTtRdnNn.d.mts} +0 -0
@@ -1,28 +1,192 @@
1
- import { h as isUndefined, v as useId$1 } from "./utilities-Dx8wzGa5.mjs";
2
- import { i as useContext, n as createContext, t as createTrinity } from "./createTrinity-DkwPrPRS.mjs";
3
- import { i as createRegistry } from "./createTokens-jwf8-iGn.mjs";
4
- import { computed, shallowReactive, toRef, toValue } from "vue";
5
-
1
+ import { isUndefined, useId as useId$1 } from "./utilities/index.mjs";
2
+ import { i as useContext, n as createContext, t as createTrinity } from "./createTrinity-C_c8eedz.mjs";
3
+ import { i as createRegistry } from "./createTokens-CMRBDlzN.mjs";
4
+ import { computed, isRef, shallowReactive, toRaw, toRef, toValue } from "vue";
5
+ //#region src/composables/createModel/index.ts
6
+ /**
7
+ * @module createModel
8
+ *
9
+ * @remarks
10
+ * Value store layer that extends createRegistry with a reactive Set of
11
+ * selected IDs, disabled guards, and an `apply` bridge for useProxyModel sync.
12
+ *
13
+ * Think of it as a creative way to store a single value — more like
14
+ * `defineModel` than `createSelection`. Selection-specific concepts
15
+ * (mandatory) belong in createSelection. The `multiple` option here
16
+ * controls whether `select()` accumulates or replaces.
17
+ *
18
+ * Both Selection and Slider extend this layer:
19
+ * - createRegistry → createModel → createSelection → createSingle/createGroup/createStep
20
+ * - createRegistry → createModel → createSlider (values override)
21
+ */
22
+ /**
23
+ * Creates a new model instance for storing a single value.
24
+ *
25
+ * @param options The options for the model instance.
26
+ * @template Z The input ticket type. Extend {@link ModelTicketInput} to add custom properties.
27
+ * @template E The output ticket type. Automatically includes `disabled` and `isSelected`.
28
+ * @template R The context type. Defaults to {@link ModelContext}<Z, E>.
29
+ * @returns A new model instance with selection tracking and disabled guards.
30
+ *
31
+ * @remarks
32
+ * Extends createRegistry with value tracking via a reactive Set of selected IDs.
33
+ * Provides the shared model-value concept used by both Selection and Slider.
34
+ *
35
+ * **Enrollment**: Tickets are auto-selected on registration by default (`enroll: true`).
36
+ * With single-value semantics, only the most recently registered ticket is active.
37
+ * Pass `enroll: false` to opt out. `createSelection` overrides this to `false`.
38
+ *
39
+ * **Apply bridge**: `useProxyModel` calls `apply()` to sync a ref with the model.
40
+ * When the active ticket's value is a ref, `apply` writes to it directly. Otherwise,
41
+ * it resolves via `registry.browse()`.
42
+ *
43
+ * @see https://0.vuetifyjs.com/composables/selection/create-model
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * import { shallowRef } from 'vue'
48
+ * import { createModel, useProxyModel } from '@vuetify/v0'
49
+ *
50
+ * const value = shallowRef('Apple')
51
+ * const model = createModel({ events: true })
52
+ *
53
+ * model.register({ id: 'fruit', value })
54
+ * useProxyModel(model, value)
55
+ *
56
+ * // value and model stay in sync bidirectionally
57
+ * ```
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * // Disabled model — all selection operations are no-ops
62
+ * const model = createModel({ disabled: true })
63
+ * model.register({ id: 'a', value: shallowRef('Apple') })
64
+ * model.select('a') // no-op
65
+ * ```
66
+ */
67
+ function createModel(_options = {}) {
68
+ const { disabled = false, enroll = true, multiple = false, ...options } = _options;
69
+ const registry = createRegistry(options);
70
+ const selectedIds = shallowReactive(/* @__PURE__ */ new Set());
71
+ const selectedItems = computed(() => {
72
+ return new Set(Array.from(selectedIds).map((id) => registry.get(id)).filter((item) => !/* @__PURE__ */ isUndefined(item)));
73
+ });
74
+ const selectedValues = computed(() => {
75
+ return new Set(Array.from(selectedItems.value).map((item) => toValue(item.value)));
76
+ });
77
+ function select(id) {
78
+ if (toValue(disabled)) return;
79
+ const item = registry.get(id);
80
+ if (!item || toValue(item.disabled)) return;
81
+ if (!toValue(multiple)) selectedIds.clear();
82
+ selectedIds.add(id);
83
+ }
84
+ function unselect(id) {
85
+ if (toValue(disabled)) return;
86
+ selectedIds.delete(id);
87
+ }
88
+ function toggle(id) {
89
+ if (toValue(disabled)) return;
90
+ if (selected(id)) unselect(id);
91
+ else select(id);
92
+ }
93
+ function selected(id) {
94
+ return selectedIds.has(id);
95
+ }
96
+ function apply(values, _options) {
97
+ const value = values[0];
98
+ for (const id of selectedIds) {
99
+ const item = registry.get(id);
100
+ if (!item || !isRef(item.value)) continue;
101
+ item.value.value = value;
102
+ }
103
+ if (!toValue(multiple)) selectedIds.clear();
104
+ if (/* @__PURE__ */ isUndefined(value)) return;
105
+ const id = registry.browse(toRaw(value))?.values().next().value;
106
+ if (!/* @__PURE__ */ isUndefined(id)) selectedIds.add(id);
107
+ }
108
+ function register(registration = {}) {
109
+ const id = registration.id ?? /* @__PURE__ */ useId$1();
110
+ const item = {
111
+ disabled: false,
112
+ ...registration,
113
+ isSelected: toRef(() => selected(id)),
114
+ id
115
+ };
116
+ const ticket = registry.register(item);
117
+ if (toValue(enroll) && !toValue(disabled) && !toValue(ticket.disabled)) select(id);
118
+ return ticket;
119
+ }
120
+ function unregister(id) {
121
+ selectedIds.delete(id);
122
+ registry.unregister(id);
123
+ }
124
+ function onboard(registrations) {
125
+ return registry.batch(() => registrations.map((r) => register(r)));
126
+ }
127
+ function offboard(ids) {
128
+ for (const id of ids) selectedIds.delete(id);
129
+ registry.offboard(ids);
130
+ }
131
+ function reset() {
132
+ selectedIds.clear();
133
+ }
134
+ function clear() {
135
+ reset();
136
+ registry.clear();
137
+ }
138
+ function dispose() {
139
+ reset();
140
+ registry.dispose();
141
+ }
142
+ return {
143
+ ...registry,
144
+ disabled,
145
+ selectedIds,
146
+ selectedItems,
147
+ selectedValues,
148
+ register,
149
+ onboard,
150
+ unregister,
151
+ offboard,
152
+ clear,
153
+ dispose,
154
+ reset,
155
+ select,
156
+ unselect,
157
+ toggle,
158
+ selected,
159
+ apply,
160
+ get size() {
161
+ return registry.size;
162
+ }
163
+ };
164
+ }
165
+ //#endregion
6
166
  //#region src/composables/createSelection/index.ts
7
167
  /**
8
168
  * @module useSelection
9
169
  *
10
170
  * @remarks
11
- * Base composable for managing selected items in a collection with Set-based tracking.
171
+ * Selection composable that extends createModel with multi-select,
172
+ * mandatory enforcement, auto-enrollment, and ticket self-methods.
12
173
  *
13
174
  * Key features:
14
175
  * - Set-based selectedIds for O(1) selection checks
176
+ * - Single or multi-select mode
15
177
  * - Mandatory selection mode (prevents deselecting last item)
16
178
  * - Auto-enrollment option (selects non-disabled items on register)
17
179
  * - Disabled item filtering
18
180
  * - Computed selectedItems and selectedValues Sets
181
+ * - Ticket self-methods: select(), unselect(), toggle()
19
182
  *
20
- * Extends useRegistry and serves as the base for useSingle, useGroup, useStep, and useFeatures.
183
+ * Extends createModel and serves as the base for useSingle, useGroup, useStep, and useFeatures.
21
184
  */
22
185
  /**
23
186
  * Creates a new selection instance for managing multiple selected items.
24
187
  *
25
- * Extends `useRegistry` with selection tracking via a reactive `Set` of selected IDs.
188
+ * Extends `createModel` with multi-select, mandatory enforcement,
189
+ * auto-enrollment, and ticket self-methods.
26
190
  * Supports disabled items, mandatory selection enforcement, and auto-enrollment.
27
191
  *
28
192
  * @param options The options for the selection instance.
@@ -43,7 +207,7 @@ import { computed, shallowReactive, toRef, toValue } from "vue";
43
207
  * - Enroll option auto-selects all non-disabled items on registration
44
208
  *
45
209
  * **Inheritance Chain:**
46
- * `useRegistry` → `createSelection` → `createSingle`/`createGroup` → `createStep`
210
+ * `createRegistry` → `createModel` → `createSelection` → `createSingle`/`createGroup` → `createStep`
47
211
  *
48
212
  * @see https://0.vuetifyjs.com/composables/selection/use-selection
49
213
  *
@@ -85,96 +249,86 @@ import { computed, shallowReactive, toRef, toValue } from "vue";
85
249
  * ```
86
250
  */
87
251
  function createSelection(_options = {}) {
88
- const { disabled = false, enroll = false, mandatory = false, multiple = false, ...options } = _options;
89
- const registry = createRegistry(options);
90
- const selectedIds = shallowReactive(/* @__PURE__ */ new Set());
91
- const selectedItems = computed(() => {
92
- return new Set(Array.from(selectedIds).map((id) => registry.get(id)).filter((item) => !/* @__PURE__ */ isUndefined(item)));
93
- });
94
- const selectedValues = computed(() => {
95
- return new Set(Array.from(selectedItems.value).map((item) => item.value));
252
+ const { enroll = false, mandatory = false, multiple = false, ...options } = _options;
253
+ const model = createModel({
254
+ ...options,
255
+ enroll: false
96
256
  });
97
257
  function seek(direction = "first", from) {
98
- return registry.seek(direction, from, (ticket) => !toValue(ticket.disabled));
258
+ return model.seek(direction, from, (ticket) => !toValue(ticket.disabled));
99
259
  }
100
260
  function mandate() {
101
- if (!toValue(mandatory) || registry.size === 0 || selectedIds.size > 0) return;
261
+ if (!toValue(mandatory) || model.size === 0 || model.selectedIds.size > 0) return;
102
262
  const ticket = seek("first");
103
263
  if (ticket) select(ticket.id);
104
264
  }
105
265
  function select(id) {
106
- if (toValue(disabled)) return;
107
- const item = registry.get(id);
266
+ if (toValue(model.disabled)) return;
267
+ const item = model.get(id);
108
268
  if (!item || toValue(item.disabled)) return;
109
- if (!toValue(multiple)) selectedIds.clear();
110
- selectedIds.add(id);
269
+ if (!toValue(multiple)) model.selectedIds.clear();
270
+ model.selectedIds.add(id);
111
271
  }
112
272
  function unselect(id) {
113
- if (toValue(disabled)) return;
114
- if (toValue(mandatory) && selectedIds.size === 1) return;
115
- selectedIds.delete(id);
273
+ if (toValue(model.disabled)) return;
274
+ if (toValue(mandatory) && model.selectedIds.size === 1) return;
275
+ model.selectedIds.delete(id);
116
276
  }
117
277
  function toggle(id) {
118
- if (toValue(disabled)) return;
119
- if (selected(id)) unselect(id);
278
+ if (toValue(model.disabled)) return;
279
+ if (model.selectedIds.has(id)) unselect(id);
120
280
  else select(id);
121
281
  }
122
- function selected(id) {
123
- return selectedIds.has(id);
282
+ function apply(values, options) {
283
+ const isMultiple = options?.multiple ?? toValue(multiple);
284
+ const currentIds = new Set(model.selectedIds);
285
+ const targetIds = /* @__PURE__ */ new Set();
286
+ for (const value of values) {
287
+ const ids = model.browse(toRaw(value));
288
+ if (ids) for (const id of ids) targetIds.add(id);
289
+ }
290
+ if (isMultiple) {
291
+ for (const id of currentIds.difference(targetIds)) model.selectedIds.delete(id);
292
+ for (const id of targetIds.difference(currentIds)) model.selectedIds.add(id);
293
+ } else {
294
+ const next = targetIds.values().next().value;
295
+ const last = currentIds.values().next().value;
296
+ if (!/* @__PURE__ */ isUndefined(last)) unselect(last);
297
+ if (!/* @__PURE__ */ isUndefined(next)) select(next);
298
+ }
124
299
  }
125
300
  function register(registration = {}) {
126
301
  const id = registration.id ?? /* @__PURE__ */ useId$1();
127
- const item = {
128
- disabled: false,
302
+ const decorated = {
129
303
  select: () => select(id),
130
304
  unselect: () => unselect(id),
131
305
  toggle: () => toggle(id),
132
- isSelected: toRef(() => selected(id)),
133
306
  ...registration,
134
307
  id
135
308
  };
136
- const ticket = registry.register(item);
137
- if (toValue(enroll) && !toValue(disabled) && !toValue(item.disabled)) select(ticket.id);
309
+ const ticket = model.register(decorated);
310
+ if (toValue(enroll) && !toValue(model.disabled) && !toValue(ticket.disabled)) select(ticket.id);
138
311
  if (toValue(mandatory) === "force") mandate();
139
312
  return ticket;
140
313
  }
141
- function unregister(id) {
142
- selectedIds.delete(id);
143
- registry.unregister(id);
144
- }
145
- function offboard(ids) {
146
- for (const id of ids) selectedIds.delete(id);
147
- registry.offboard(ids);
148
- }
149
314
  function onboard(registrations) {
150
- const tickets = registry.batch(() => registrations.map((registration) => register(registration)));
315
+ const tickets = model.batch(() => registrations.map((registration) => register(registration)));
151
316
  if (toValue(mandatory) === "force") mandate();
152
317
  return tickets;
153
318
  }
154
- function reset() {
155
- registry.clear();
156
- selectedIds.clear();
157
- mandate();
158
- }
159
319
  return {
160
- ...registry,
161
- disabled,
162
- selectedIds,
163
- selectedItems,
164
- selectedValues,
320
+ ...model,
321
+ multiple,
165
322
  register,
166
- unregister,
167
323
  onboard,
168
- offboard,
169
- reset,
170
- mandate,
171
- seek,
172
324
  select,
173
325
  unselect,
174
326
  toggle,
175
- selected,
327
+ apply,
328
+ mandate,
329
+ seek,
176
330
  get size() {
177
- return registry.size;
331
+ return model.size;
178
332
  }
179
333
  };
180
334
  }
@@ -256,6 +410,5 @@ function createSelectionContext(_options = {}) {
256
410
  function useSelection(namespace = "v0:selection") {
257
411
  return useContext(namespace);
258
412
  }
259
-
260
413
  //#endregion
261
- export { createSelectionContext as n, useSelection as r, createSelection as t };
414
+ export { createModel as i, createSelectionContext as n, useSelection as r, createSelection as t };
@@ -1,7 +1,6 @@
1
- import { i as useContext, n as createContext, t as createTrinity } from "./createTrinity-DkwPrPRS.mjs";
2
- import { t as createSelection } from "./createSelection-BURpoE3p.mjs";
1
+ import { i as useContext, n as createContext, t as createTrinity } from "./createTrinity-C_c8eedz.mjs";
2
+ import { t as createSelection } from "./createSelection-DvOR2tKk.mjs";
3
3
  import { computed } from "vue";
4
-
5
4
  //#region src/composables/createSingle/index.ts
6
5
  /**
7
6
  * @module useSingle
@@ -174,6 +173,5 @@ function createSingleContext(_options = {}) {
174
173
  function useSingle(namespace = "v0:single") {
175
174
  return useContext(namespace);
176
175
  }
177
-
178
176
  //#endregion
179
- export { createSingleContext as n, useSingle as r, createSingle as t };
177
+ export { createSingleContext as n, useSingle as r, createSingle as t };
@@ -1,8 +1,7 @@
1
- import { d as isObject, h as isUndefined, p as isString, t as clamp, v as useId$1 } from "./utilities-Dx8wzGa5.mjs";
2
- import { i as useContext, n as createContext, t as createTrinity } from "./createTrinity-DkwPrPRS.mjs";
3
- import { i as useLogger } from "./useLogger-BXqiUvt2.mjs";
1
+ import { clamp, isObject, isString, isUndefined, useId as useId$1 } from "./utilities/index.mjs";
2
+ import { i as useContext, n as createContext, t as createTrinity } from "./createTrinity-C_c8eedz.mjs";
3
+ import { i as useLogger } from "./useLogger-B70T4SgK.mjs";
4
4
  import { shallowReactive } from "vue";
5
-
6
5
  //#region src/composables/createRegistry/index.ts
7
6
  /**
8
7
  * @module createRegistry
@@ -47,8 +46,8 @@ import { shallowReactive } from "vue";
47
46
  function createRegistry(options) {
48
47
  const logger = useLogger();
49
48
  const events = options?.events ?? false;
50
- const reactive$1 = options?.reactive ?? false;
51
- const collection = reactive$1 ? shallowReactive(/* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
49
+ const reactive = options?.reactive ?? false;
50
+ const collection = reactive ? shallowReactive(/* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
52
51
  const catalog = /* @__PURE__ */ new Map();
53
52
  const directory = /* @__PURE__ */ new Map();
54
53
  const cache = /* @__PURE__ */ new Map();
@@ -160,23 +159,23 @@ function createRegistry(options) {
160
159
  function keys() {
161
160
  const cached = cache.get("keys");
162
161
  if (!/* @__PURE__ */ isUndefined(cached)) return cached;
163
- const keys$1 = Array.from(collection.keys());
164
- cache.set("keys", keys$1);
165
- return keys$1;
162
+ const keys = Array.from(collection.keys());
163
+ cache.set("keys", keys);
164
+ return keys;
166
165
  }
167
166
  function values() {
168
167
  const cached = cache.get("values");
169
168
  if (!/* @__PURE__ */ isUndefined(cached)) return cached;
170
- const values$1 = Array.from(collection.values());
171
- cache.set("values", values$1);
172
- return values$1;
169
+ const values = Array.from(collection.values());
170
+ cache.set("values", values);
171
+ return values;
173
172
  }
174
173
  function entries() {
175
174
  const cached = cache.get("entries");
176
175
  if (!/* @__PURE__ */ isUndefined(cached)) return cached;
177
- const entries$1 = Array.from(collection.entries());
178
- cache.set("entries", entries$1);
179
- return entries$1;
176
+ const entries = Array.from(collection.entries());
177
+ cache.set("entries", entries);
178
+ return entries;
180
179
  }
181
180
  function clear() {
182
181
  collection.clear();
@@ -252,7 +251,7 @@ function createRegistry(options) {
252
251
  value,
253
252
  valueIsIndex
254
253
  };
255
- const ticket = reactive$1 ? shallowReactive(rawTicket) : rawTicket;
254
+ const ticket = reactive ? shallowReactive(rawTicket) : rawTicket;
256
255
  collection.set(ticket.id, ticket);
257
256
  directory.set(ticket.index, ticket.id);
258
257
  assign(ticket.value, ticket.id);
@@ -292,12 +291,29 @@ function createRegistry(options) {
292
291
  needsReindex = true;
293
292
  });
294
293
  }
294
+ function move(id, toIndex) {
295
+ if (needsReindex) reindex();
296
+ const ticket = collection.get(id);
297
+ if (!ticket) return void 0;
298
+ const size = collection.size;
299
+ const target = /* @__PURE__ */ clamp(toIndex, 0, size - 1);
300
+ if (ticket.index === target) return ticket;
301
+ const items = Array.from(collection.entries());
302
+ const fromIndex = items.findIndex(([key]) => key === id);
303
+ const [entry] = items.splice(fromIndex, 1);
304
+ items.splice(target, 0, entry);
305
+ collection.clear();
306
+ for (const [key, value] of items) collection.set(key, value);
307
+ minDirtyIndex = Math.min(ticket.index, target);
308
+ reindex();
309
+ return ticket;
310
+ }
295
311
  function seek(direction = "first", from, predicate) {
296
312
  if (collection.size === 0) return void 0;
297
313
  if (needsReindex) reindex();
298
314
  if (!predicate && /* @__PURE__ */ isUndefined(from)) {
299
- const tickets$1 = values();
300
- return direction === "first" ? tickets$1[0] : tickets$1.at(-1);
315
+ const tickets = values();
316
+ return direction === "first" ? tickets[0] : tickets.at(-1);
301
317
  }
302
318
  const tickets = values();
303
319
  const index = /* @__PURE__ */ isUndefined(from) ? void 0 : /* @__PURE__ */ clamp(from, 0, tickets.length - 1);
@@ -333,6 +349,7 @@ function createRegistry(options) {
333
349
  register,
334
350
  unregister,
335
351
  reindex,
352
+ move,
336
353
  seek,
337
354
  batch,
338
355
  onboard(registrations) {
@@ -404,7 +421,6 @@ function createRegistryContext(_options = {}) {
404
421
  function useRegistry(namespace = "v0:registry") {
405
422
  return useContext(namespace);
406
423
  }
407
-
408
424
  //#endregion
409
425
  //#region src/composables/createTokens/index.ts
410
426
  /**
@@ -617,7 +633,7 @@ function flatten(tokens, prefix = "", flat = false) {
617
633
  flat
618
634
  }];
619
635
  while (stack.length > 0) {
620
- const { tokens: currentTokens, prefix: currentPrefix, flat: flat$1 } = stack.pop();
636
+ const { tokens: currentTokens, prefix: currentPrefix, flat } = stack.pop();
621
637
  const meta = {};
622
638
  for (const k in currentTokens) if (k.startsWith("$")) meta[k] = currentTokens[k];
623
639
  if (Object.keys(meta).length > 0 && currentPrefix) flattened.push({
@@ -641,7 +657,7 @@ function flatten(tokens, prefix = "", flat = false) {
641
657
  value
642
658
  });
643
659
  const inner = value.$value;
644
- if (/* @__PURE__ */ isObject(inner) && !flat$1) for (const innerKey in inner) {
660
+ if (/* @__PURE__ */ isObject(inner) && !flat) for (const innerKey in inner) {
645
661
  if (innerKey.startsWith("$")) continue;
646
662
  const child = inner[innerKey];
647
663
  const childId = `${id}.${innerKey}`;
@@ -656,12 +672,12 @@ function flatten(tokens, prefix = "", flat = false) {
656
672
  else stack.push({
657
673
  tokens: child,
658
674
  prefix: childId,
659
- flat: flat$1
675
+ flat
660
676
  });
661
677
  }
662
678
  continue;
663
679
  }
664
- if (flat$1) {
680
+ if (flat) {
665
681
  flattened.push({
666
682
  id,
667
683
  value
@@ -671,12 +687,11 @@ function flatten(tokens, prefix = "", flat = false) {
671
687
  stack.push({
672
688
  tokens: value,
673
689
  prefix: id,
674
- flat: flat$1
690
+ flat
675
691
  });
676
692
  }
677
693
  }
678
694
  return flattened;
679
695
  }
680
-
681
696
  //#endregion
682
- export { createRegistryContext as a, createRegistry as i, createTokensContext as n, useRegistry as o, useTokens as r, createTokens as t };
697
+ export { createRegistryContext as a, createRegistry as i, createTokensContext as n, useRegistry as o, useTokens as r, createTokens as t };
@@ -1,6 +1,5 @@
1
- import { d as isObject, h as isUndefined, m as isSymbol, p as isString } from "./utilities-Dx8wzGa5.mjs";
1
+ import { isObject, isString, isSymbol, isUndefined } from "./utilities/index.mjs";
2
2
  import { inject, provide } from "vue";
3
-
4
3
  //#region src/composables/createContext/index.ts
5
4
  /**
6
5
  * @module createContext
@@ -78,24 +77,23 @@ function provideContext(key, context, app) {
78
77
  function createContext(keyOrOptions, defaultValue) {
79
78
  if (/* @__PURE__ */ isString(keyOrOptions) || /* @__PURE__ */ isSymbol(keyOrOptions)) {
80
79
  const _key = keyOrOptions;
81
- function _provideContext$1(context, app) {
80
+ function _provideContext(context, app) {
82
81
  return provideContext(_key, context, app);
83
82
  }
84
- function _useContext$1() {
83
+ function _useContext() {
85
84
  return useContext(_key, defaultValue);
86
85
  }
87
- return [_useContext$1, _provideContext$1];
86
+ return [_useContext, _provideContext];
88
87
  }
89
88
  const suffix = /* @__PURE__ */ isObject(keyOrOptions) ? keyOrOptions.suffix : void 0;
90
89
  function _provideContext(key, context, app) {
91
90
  return provideContext(suffix ? `${key}:${suffix}` : key, context, app);
92
91
  }
93
- function _useContext(key, defaultValue$1) {
94
- return useContext(suffix ? `${key}:${suffix}` : key, defaultValue$1);
92
+ function _useContext(key, defaultValue) {
93
+ return useContext(suffix ? `${key}:${suffix}` : key, defaultValue);
95
94
  }
96
95
  return [_useContext, _provideContext];
97
96
  }
98
-
99
97
  //#endregion
100
98
  //#region src/composables/createTrinity/index.ts
101
99
  /**
@@ -137,13 +135,12 @@ function createContext(keyOrOptions, defaultValue) {
137
135
  * }
138
136
  * ```
139
137
  */
140
- function createTrinity(useContext$1, provideContext$1, context) {
138
+ function createTrinity(useContext, provideContext, context) {
141
139
  return [
142
- useContext$1,
143
- (_context = context, app) => provideContext$1(_context, app),
140
+ useContext,
141
+ (_context = context, app) => provideContext(_context, app),
144
142
  context
145
143
  ];
146
144
  }
147
-
148
145
  //#endregion
149
- export { useContext as i, createContext as n, provideContext as r, createTrinity as t };
146
+ export { useContext as i, createContext as n, provideContext as r, createTrinity as t };
@@ -1,3 +1,2 @@
1
- import "../../../adapter-D2JoR-4d.mjs";
2
- import { t as ClientAdapter } from "../../../v0-BPzPP8C5.mjs";
1
+ import { t as ClientAdapter } from "../../../v0-CdUL2eOn.mjs";
3
2
  export { ClientAdapter };
@@ -1,9 +1,7 @@
1
- import "../../../globals-vN-O052q.mjs";
2
- import "../../../utilities-Dx8wzGa5.mjs";
3
- import "../../../createTrinity-DkwPrPRS.mjs";
4
- import "../../../toArray-VIn8vYt3.mjs";
5
- import "../../../createPagination-Wc_vRGNQ.mjs";
6
- import "../../../adapter-Cmeg49W9.mjs";
7
- import { t as ClientAdapter } from "../../../v0-Dc5mcpQs.mjs";
8
-
9
- export { ClientAdapter };
1
+ import "../../../globals-BqRH_jdr.mjs";
2
+ import "../../../createTrinity-C_c8eedz.mjs";
3
+ import "../../../toArray-VdROPpy-.mjs";
4
+ import "../../../createPagination-Bu8vE0JW.mjs";
5
+ import "../../../adapter-B4zE-hA5.mjs";
6
+ import { t as ClientAdapter } from "../../../v0-YAqbXudL.mjs";
7
+ export { ClientAdapter };
@@ -1,5 +1,5 @@
1
- import { a as SortDirection, i as DataTableAdapterResult, n as DataTableAdapterContext, o as SortEntry, r as DataTableAdapterInterface, t as DataTableAdapter } from "../../adapter-D2JoR-4d.mjs";
2
- import { n as ServerAdapterOptions, t as ServerAdapter } from "../../server-B-HWxaTQ.mjs";
3
- import { t as ClientAdapter } from "../../v0-BPzPP8C5.mjs";
4
- import { t as VirtualAdapter } from "../../virtual-A4e1yrdn.mjs";
1
+ import { a as SortDirection, i as DataTableAdapterResult, n as DataTableAdapterContext, o as SortEntry, r as DataTableAdapterInterface, t as DataTableAdapter } from "../../adapter-DIx4Rntl.mjs";
2
+ import { n as ServerAdapterOptions, t as ServerAdapter } from "../../server-Ch9J86tb.mjs";
3
+ import { t as ClientAdapter } from "../../v0-CdUL2eOn.mjs";
4
+ import { t as VirtualAdapter } from "../../virtual-DwBiFA25.mjs";
5
5
  export { ClientAdapter, DataTableAdapter, DataTableAdapterContext, DataTableAdapterInterface, DataTableAdapterResult, ServerAdapter, ServerAdapterOptions, SortDirection, SortEntry, VirtualAdapter };
@@ -1,12 +1,10 @@
1
- import "../../globals-vN-O052q.mjs";
2
- import "../../utilities-Dx8wzGa5.mjs";
3
- import "../../createTrinity-DkwPrPRS.mjs";
4
- import "../../toArray-VIn8vYt3.mjs";
5
- import "../../createPagination-Wc_vRGNQ.mjs";
6
- import { t as DataTableAdapter } from "../../adapter-Cmeg49W9.mjs";
7
- import { t as ClientAdapter } from "../../v0-Dc5mcpQs.mjs";
8
- import { t as ServerAdapter } from "../../server-C2R2POGE.mjs";
9
- import { t as VirtualAdapter } from "../../virtual-BoTGK6HT.mjs";
10
- import "../../adapters-SSDVth5e.mjs";
11
-
12
- export { ClientAdapter, DataTableAdapter, ServerAdapter, VirtualAdapter };
1
+ import "../../globals-BqRH_jdr.mjs";
2
+ import "../../createTrinity-C_c8eedz.mjs";
3
+ import "../../toArray-VdROPpy-.mjs";
4
+ import "../../createPagination-Bu8vE0JW.mjs";
5
+ import { t as DataTableAdapter } from "../../adapter-B4zE-hA5.mjs";
6
+ import { t as ClientAdapter } from "../../v0-YAqbXudL.mjs";
7
+ import { t as ServerAdapter } from "../../server-CZ6ahbEH.mjs";
8
+ import { t as VirtualAdapter } from "../../virtual-eDNVH1fz.mjs";
9
+ import "../../adapters-uJLWGQJl.mjs";
10
+ export { ClientAdapter, DataTableAdapter, ServerAdapter, VirtualAdapter };
@@ -1,3 +1,2 @@
1
- import "../../../adapter-D2JoR-4d.mjs";
2
- import { n as ServerAdapterOptions, t as ServerAdapter } from "../../../server-B-HWxaTQ.mjs";
1
+ import { n as ServerAdapterOptions, t as ServerAdapter } from "../../../server-Ch9J86tb.mjs";
3
2
  export { ServerAdapter, ServerAdapterOptions };
@@ -1,7 +1,5 @@
1
- import "../../../globals-vN-O052q.mjs";
2
- import "../../../utilities-Dx8wzGa5.mjs";
3
- import "../../../createTrinity-DkwPrPRS.mjs";
4
- import "../../../createPagination-Wc_vRGNQ.mjs";
5
- import { t as ServerAdapter } from "../../../server-C2R2POGE.mjs";
6
-
7
- export { ServerAdapter };
1
+ import "../../../globals-BqRH_jdr.mjs";
2
+ import "../../../createTrinity-C_c8eedz.mjs";
3
+ import "../../../createPagination-Bu8vE0JW.mjs";
4
+ import { t as ServerAdapter } from "../../../server-CZ6ahbEH.mjs";
5
+ export { ServerAdapter };
@@ -1,3 +1,2 @@
1
- import "../../../adapter-D2JoR-4d.mjs";
2
- import { t as VirtualAdapter } from "../../../virtual-A4e1yrdn.mjs";
1
+ import { t as VirtualAdapter } from "../../../virtual-DwBiFA25.mjs";
3
2
  export { VirtualAdapter };