@vuetify/v0 1.0.0-beta.0 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +2 -1
  2. package/dist/{adapter-DZeI0ZbW.d.mts → adapter-CQoi3rdC.d.mts} +1 -1
  3. package/dist/adapter-CVoWg0sw.mjs +99 -0
  4. package/dist/{adapter-oM18AdUc.mjs → adapter-Cj7vxEdB.mjs} +6 -1
  5. package/dist/adapter-Cy7wXVFe.mjs +4 -0
  6. package/dist/{adapter-we-0GbFH.d.mts → adapter-D2ABPTpo.d.mts} +2 -2
  7. package/dist/{adapter-BO75n0Cn.d.mts → adapter-_srNCBEi.d.mts} +3 -3
  8. package/dist/browser/index.js +23639 -23267
  9. package/dist/components/index.d.mts +1 -1
  10. package/dist/components/index.mjs +1 -1
  11. package/dist/{components-_uxZ_Zo3.mjs → components-DcOwIGXt.mjs} +304 -214
  12. package/dist/composables/index.d.mts +20 -20
  13. package/dist/composables/index.mjs +34 -28
  14. package/dist/composables-DxKmYiTj.mjs +4077 -0
  15. package/dist/{consola-CUNHyu8J.d.mts → consola-BPGkJp_q.d.mts} +1 -1
  16. package/dist/constants/index.d.mts +1 -1
  17. package/dist/constants/index.mjs +1 -1
  18. package/dist/{createDataTable-DlFQyBTN.mjs → createDataTable-CBfnCUKU.mjs} +14 -11
  19. package/dist/{createGroup-DsKJMuRd.mjs → createGroup-BTG6xcyp.mjs} +26 -14
  20. package/dist/{adapter-BCVxBtDp.mjs → createPagination-B5dfqY-a.mjs} +3 -98
  21. package/dist/{createRegistry-tJ1PPNIr.mjs → createRegistry-Cb6ftNMU.mjs} +57 -41
  22. package/dist/{createSelection-DEqhvdoj.mjs → createSelection-BMvXj84C.mjs} +7 -4
  23. package/dist/{createSingle-ClzWqRCe.mjs → createSingle-BCUJuV4D.mjs} +3 -3
  24. package/dist/{createTokens-mNxs8DQ3.mjs → createTokens-BSSQAfNX.mjs} +12 -6
  25. package/dist/data-table/adapters/client/index.d.mts +1 -1
  26. package/dist/data-table/adapters/client/index.mjs +1 -1
  27. package/dist/data-table/adapters/index.d.mts +4 -4
  28. package/dist/data-table/adapters/index.mjs +4 -5
  29. package/dist/data-table/adapters/server/index.d.mts +1 -1
  30. package/dist/data-table/adapters/server/index.mjs +1 -1
  31. package/dist/data-table/adapters/virtual/index.d.mts +1 -1
  32. package/dist/data-table/adapters/virtual/index.mjs +1 -1
  33. package/dist/data-table/index.d.mts +5 -5
  34. package/dist/data-table/index.mjs +5 -5
  35. package/dist/date/index.d.mts +1 -1
  36. package/dist/date/index.mjs +36 -33
  37. package/dist/features/adapters/flagsmith/index.d.mts +1 -1
  38. package/dist/features/adapters/flagsmith/index.mjs +47 -1
  39. package/dist/features/adapters/launchdarkly/index.d.mts +1 -1
  40. package/dist/features/adapters/launchdarkly/index.mjs +37 -1
  41. package/dist/features/adapters/posthog/index.d.mts +1 -1
  42. package/dist/features/adapters/posthog/index.mjs +46 -1
  43. package/dist/features/index.d.mts +2 -2
  44. package/dist/features/index.mjs +2 -2
  45. package/dist/{flagsmith-Cn_KVy6v.d.mts → flagsmith-CXzNBqm3.d.mts} +1 -1
  46. package/dist/{globals-DB-krEA-.mjs → globals-C1X-9O7K.mjs} +1 -1
  47. package/dist/{index-DWAgQOBa.d.mts → index-Bmz8PZMY.d.mts} +3 -4
  48. package/dist/{index-BN06veYe.d.mts → index-CKyDkh8J.d.mts} +169 -88
  49. package/dist/{index-B3PDLk_Y.d.mts → index-DLBPM47A.d.mts} +509 -439
  50. package/dist/{index-ZD3hw2Zo.d.mts → index-DRrHHgE7.d.mts} +4 -4
  51. package/dist/{index-ATZqco03.d.mts → index-LMiCHwZl.d.mts} +7 -2
  52. package/dist/{index-BIyQ3OxC.d.mts → index-rJ_lhMYJ.d.mts} +5 -5
  53. package/dist/index.d.mts +24 -24
  54. package/dist/index.mjs +37 -31
  55. package/dist/json/attributes.json +2 -2
  56. package/dist/json/web-types.json +3 -3
  57. package/dist/{launchdarkly-C3Knz7-v.d.mts → launchdarkly-DvhloBts.d.mts} +1 -1
  58. package/dist/locale/adapters/index.d.mts +2 -2
  59. package/dist/locale/adapters/index.mjs +2 -3
  60. package/dist/locale/adapters/v0/index.d.mts +1 -1
  61. package/dist/locale/adapters/v0/index.mjs +1 -1
  62. package/dist/locale/adapters/vue-i18n/index.d.mts +1 -1
  63. package/dist/locale/adapters/vue-i18n/index.mjs +1 -1
  64. package/dist/locale/index.d.mts +3 -3
  65. package/dist/locale/index.mjs +3 -3
  66. package/dist/logger/adapters/consola/index.d.mts +1 -1
  67. package/dist/logger/adapters/index.d.mts +4 -4
  68. package/dist/logger/adapters/index.mjs +1 -2
  69. package/dist/logger/adapters/pino/index.d.mts +1 -1
  70. package/dist/logger/adapters/v0/index.d.mts +1 -1
  71. package/dist/logger/adapters/v0/index.mjs +1 -1
  72. package/dist/logger/index.d.mts +5 -5
  73. package/dist/logger/index.mjs +2 -2
  74. package/dist/notifications/index.d.mts +6 -6
  75. package/dist/notifications/index.mjs +29 -29
  76. package/dist/palettes/ant/index.d.mts +1 -1
  77. package/dist/palettes/index.d.mts +3 -3
  78. package/dist/palettes/material/index.d.mts +1 -1
  79. package/dist/palettes/md1/index.d.mts +1 -1
  80. package/dist/palettes/md2/index.d.mts +1 -1
  81. package/dist/palettes/radix/index.d.mts +1 -1
  82. package/dist/palettes/tailwind/index.d.mts +1 -1
  83. package/dist/permissions/adapters/index.d.mts +1 -1
  84. package/dist/permissions/adapters/index.mjs +1 -2
  85. package/dist/permissions/adapters/v0/index.d.mts +1 -1
  86. package/dist/permissions/adapters/v0/index.mjs +1 -1
  87. package/dist/permissions/index.d.mts +1 -1
  88. package/dist/permissions/index.mjs +2 -2
  89. package/dist/{pino-BaYY_KIN.d.mts → pino-B6BI1AOK.d.mts} +1 -1
  90. package/dist/{posthog-CR8R2ywM.d.mts → posthog-BOT5W7Ds.d.mts} +1 -1
  91. package/dist/rules/index.d.mts +1 -1
  92. package/dist/rules/index.mjs +1 -1
  93. package/dist/{server-CZ83nTn_.mjs → server-D5BJBjB0.mjs} +2 -1
  94. package/dist/{server-7vjHxjNc.d.mts → server-DbtTGb67.d.mts} +1 -1
  95. package/dist/storage/adapters/index.d.mts +2 -2
  96. package/dist/storage/adapters/index.mjs +1 -1
  97. package/dist/storage/adapters/memory/index.d.mts +1 -1
  98. package/dist/storage/adapters/memory/index.mjs +1 -1
  99. package/dist/storage/index.d.mts +3 -3
  100. package/dist/storage/index.mjs +2 -2
  101. package/dist/theme/adapters/index.d.mts +1 -1
  102. package/dist/theme/adapters/index.mjs +3 -4
  103. package/dist/theme/adapters/unhead/index.d.mts +1 -1
  104. package/dist/theme/adapters/unhead/index.mjs +1 -1
  105. package/dist/theme/adapters/v0/index.d.mts +1 -1
  106. package/dist/theme/adapters/v0/index.mjs +1 -1
  107. package/dist/theme/index.d.mts +1 -1
  108. package/dist/theme/index.mjs +5 -4
  109. package/dist/types/index.d.mts +1 -1
  110. package/dist/{unhead-CG672gKh.mjs → unhead-i8ji788n.mjs} +12 -8
  111. package/dist/useEventListener-BK_uaXZv.mjs +103 -0
  112. package/dist/{useFeatures-B-A-eOo-.mjs → useFeatures-BKAK56af.mjs} +4 -8
  113. package/dist/{useLocale-CbpoxbVU.mjs → useLocale-CTwn8uZk.mjs} +4 -5
  114. package/dist/{useLogger-CTgAedNH.mjs → useLogger-D7_hm4e8.mjs} +2 -3
  115. package/dist/{useNotifications-BkKGUl_1.mjs → useNotifications-B2YeotHN.mjs} +15 -8
  116. package/dist/{usePermissions-BYOrKcnk.mjs → usePermissions-CWYXR7ji.mjs} +18 -11
  117. package/dist/{useClickOutside-DoOgNtrj.mjs → useRovingFocus-BdnSUVrD.mjs} +4014 -8138
  118. package/dist/{useRules-mD_DY9dy.mjs → useRules-CB2_tvd0.mjs} +2 -2
  119. package/dist/useStorage-BORz1d1g.mjs +162 -0
  120. package/dist/{useTheme-B1lUya5B.mjs → useTheme-ClUmdmvT.mjs} +12 -9
  121. package/dist/utilities/index.d.mts +2 -2
  122. package/dist/utilities/index.mjs +7 -3
  123. package/dist/{v0-COaQncfZ.mjs → v0-A4GLojAr.mjs} +2 -1
  124. package/dist/{v0-Bx5Mi7qE.mjs → v0-BU39ZO4s.mjs} +21 -10
  125. package/dist/{v0-WzS4GAIp.d.mts → v0-D7NA38Vu.d.mts} +1 -1
  126. package/dist/{v0-CG9o3on7.mjs → v0-DL9JtgCO.mjs} +1 -1
  127. package/dist/{v0-QIjffi4E.d.mts → v0-DotXXGXU.d.mts} +1 -1
  128. package/dist/{v0-CHK79mZX.mjs → v0-SwedwC_b.mjs} +3 -4
  129. package/dist/{v0-DWZ_N2GG.d.mts → v0-rSxMW8FJ.d.mts} +1 -1
  130. package/dist/{virtual-CrgGA-o6.d.mts → virtual-C-NsLue0.d.mts} +1 -1
  131. package/dist/{virtual-UumJ2BQ9.mjs → virtual-DFvOoeG6.mjs} +2 -1
  132. package/package.json +10 -7
  133. package/dist/adapters-BHD1lc-K.mjs +0 -4
  134. package/dist/adapters-BYLWDmYl.mjs +0 -5
  135. package/dist/adapters-BxrTL8E3.mjs +0 -4
  136. package/dist/adapters-CBgBd7VE.mjs +0 -2
  137. package/dist/adapters-D64TORDu.mjs +0 -2
  138. package/dist/flagsmith-Cu93hUIF.mjs +0 -48
  139. package/dist/launchdarkly-CLGtJCsI.mjs +0 -38
  140. package/dist/posthog-B5s_KGhy.mjs +0 -47
  141. /package/dist/{adapter-BEJXp-ie.d.mts → adapter-BYzU4Ey5.d.mts} +0 -0
  142. /package/dist/{adapter-B6IrPwib.d.mts → adapter-C5F2huij.d.mts} +0 -0
  143. /package/dist/{adapter-BSKx9WQ7.mjs → adapter-CTsckKAR.mjs} +0 -0
  144. /package/dist/{adapter-D8zizQVP.mjs → adapter-bwZo7b5p.mjs} +0 -0
  145. /package/dist/{index-DHmuwBdv.d.mts → index-B9YmdGZ3.d.mts} +0 -0
  146. /package/dist/{index-PvkxPev3.d.mts → index-BgCkepP_.d.mts} +0 -0
  147. /package/dist/{index-BOn0AAue.d.mts → index-CROz1VSV.d.mts} +0 -0
  148. /package/dist/{index-H_hl6-4b.d.mts → index-DXMlYoiQ.d.mts} +0 -0
  149. /package/dist/{index-C6NnIuDv.d.mts → index-DidZKN6S.d.mts} +0 -0
  150. /package/dist/{index-CKKoxA9V.d.mts → index-FtE8MXJ_.d.mts} +0 -0
  151. /package/dist/{memory-BMpJcQjQ.mjs → memory-BJjkQzxs.mjs} +0 -0
  152. /package/dist/{memory-D-JbdKXg.d.mts → memory-DbyZeNjg.d.mts} +0 -0
  153. /package/dist/{toArray-CD2-OxAz.mjs → toArray-C89ZaEuF.mjs} +0 -0
  154. /package/dist/{v0-Dvu8fMl3.mjs → v0-UNyykD27.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as LoggerAdapter } from "./adapter-BEJXp-ie.mjs";
1
+ import { t as LoggerAdapter } from "./adapter-BYzU4Ey5.mjs";
2
2
 
3
3
  //#region src/composables/useLogger/adapters/consola.d.ts
4
4
  declare class ConsolaLoggerAdapter extends LoggerAdapter {
@@ -1,2 +1,2 @@
1
- import { a as IN_BROWSER, c as SUPPORTS_MUTATION_OBSERVER, d as __LOGGER_ENABLED__, f as version, i as isSelfClosingTag, l as SUPPORTS_OBSERVER, n as SELF_CLOSING_TAGS, o as SUPPORTS_INTERSECTION_OBSERVER, r as SelfClosingElement, s as SUPPORTS_MATCH_MEDIA, t as HTMLElementName, u as SUPPORTS_TOUCH } from "../index-PvkxPev3.mjs";
1
+ import { a as IN_BROWSER, c as SUPPORTS_MUTATION_OBSERVER, d as __LOGGER_ENABLED__, f as version, i as isSelfClosingTag, l as SUPPORTS_OBSERVER, n as SELF_CLOSING_TAGS, o as SUPPORTS_INTERSECTION_OBSERVER, r as SelfClosingElement, s as SUPPORTS_MATCH_MEDIA, t as HTMLElementName, u as SUPPORTS_TOUCH } from "../index-BgCkepP_.mjs";
2
2
  export { HTMLElementName, IN_BROWSER, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, SelfClosingElement, __LOGGER_ENABLED__, isSelfClosingTag, version };
@@ -1,3 +1,3 @@
1
1
  import { n as isSelfClosingTag, t as SELF_CLOSING_TAGS } from "../htmlElements-CHXZfsZu.mjs";
2
- import { a as SUPPORTS_OBSERVER, c as version, i as SUPPORTS_MUTATION_OBSERVER, n as SUPPORTS_INTERSECTION_OBSERVER, o as SUPPORTS_TOUCH, r as SUPPORTS_MATCH_MEDIA, s as __LOGGER_ENABLED__, t as IN_BROWSER } from "../globals-DB-krEA-.mjs";
2
+ import { a as SUPPORTS_OBSERVER, c as version, i as SUPPORTS_MUTATION_OBSERVER, n as SUPPORTS_INTERSECTION_OBSERVER, o as SUPPORTS_TOUCH, r as SUPPORTS_MATCH_MEDIA, s as __LOGGER_ENABLED__, t as IN_BROWSER } from "../globals-C1X-9O7K.mjs";
3
3
  export { IN_BROWSER, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, __LOGGER_ENABLED__, isSelfClosingTag, version };
@@ -1,10 +1,9 @@
1
1
  import { isNullOrUndefined } from "./utilities/index.mjs";
2
2
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
3
- import { t as createRegistry } from "./createRegistry-tJ1PPNIr.mjs";
4
- import { a as useLocale } from "./useLocale-CbpoxbVU.mjs";
5
- import { t as createGroup } from "./createGroup-DsKJMuRd.mjs";
6
- import { t as ClientDataTableAdapter } from "./v0-COaQncfZ.mjs";
7
- import "./adapters-BYLWDmYl.mjs";
3
+ import { t as createRegistry } from "./createRegistry-Cb6ftNMU.mjs";
4
+ import { a as useLocale } from "./useLocale-CTwn8uZk.mjs";
5
+ import { i as useProxyRegistry, t as createGroup } from "./createGroup-BTG6xcyp.mjs";
6
+ import { t as ClientDataTableAdapter } from "./v0-A4GLojAr.mjs";
8
7
  import { computed, shallowReactive, shallowReadonly, shallowRef, toRef, watch } from "vue";
9
8
  //#region src/composables/createDataTable/columns.ts
10
9
  /**
@@ -85,6 +84,9 @@ function resolveHeaders(columns) {
85
84
  * columns and `table.onboard([...])` / `table.register({...})` for rows.
86
85
  * Row identity is the ticket id (caller-supplied or auto-generated); column
87
86
  * identity is the caller-supplied `id` (required — no auto-generation).
87
+ * The row registry is non-reactive: iterate rows via `items` / `allItems`
88
+ * and update a row via `upsert(id, { value })` — never mutate a ticket's
89
+ * value in place or iterate raw `values()` in templates or computeds.
88
90
  *
89
91
  * Key features:
90
92
  * - Adapter pattern for pipeline strategy (client, server, virtual)
@@ -160,8 +162,9 @@ function createDataTable(options = {}) {
160
162
  const { filter: filterOptions = {}, pagination: paginationOptions = {}, sortMultiple = false, mandate = false, firstSortOrder = "asc", selectStrategy = "page", itemSelectable, groupBy, openAll = false, expandMultiple = true, locale: initialLocale, adapter = new ClientDataTableAdapter() } = options;
161
163
  const registry = createRegistry({
162
164
  events: true,
163
- reactive: true
165
+ reactive: false
164
166
  });
167
+ const proxy = useProxyRegistry(registry);
165
168
  const columns = createRegistry({
166
169
  events: true,
167
170
  reactive: true
@@ -283,7 +286,7 @@ function createDataTable(options = {}) {
283
286
  for (const col of leaves.value) if (col.filter) filters[String(col.id)] = col.filter;
284
287
  return filters;
285
288
  });
286
- const source = computed(() => registry.values().map((t) => t.value));
289
+ const source = computed(() => proxy.values.map((t) => t.value));
287
290
  const { allItems, filteredItems, sortedItems, items: visible, pagination, total, loading = toRef(() => false), error = toRef(() => null) } = adapter.setup({
288
291
  items: source,
289
292
  search: _query,
@@ -299,7 +302,7 @@ function createDataTable(options = {}) {
299
302
  const selectableIds = computed(() => {
300
303
  if (!itemSelectable) return null;
301
304
  const ids = /* @__PURE__ */ new Set();
302
- for (const ticket of registry.values()) {
305
+ for (const ticket of proxy.values) {
303
306
  const value = ticket.value;
304
307
  if (!/* @__PURE__ */ isNullOrUndefined(value) && value[itemSelectable]) ids.add(ticket.id);
305
308
  }
@@ -317,7 +320,7 @@ function createDataTable(options = {}) {
317
320
  if (scope.length === 0) return [];
318
321
  const set = new Set(scope);
319
322
  const result = [];
320
- for (const ticket of registry.values()) {
323
+ for (const ticket of proxy.values) {
321
324
  const value = ticket.value;
322
325
  if (/* @__PURE__ */ isNullOrUndefined(value) || !set.has(value)) continue;
323
326
  if (itemSelectable && !value[itemSelectable]) continue;
@@ -371,7 +374,7 @@ function createDataTable(options = {}) {
371
374
  if (scope.length === 0) return [];
372
375
  const set = new Set(scope);
373
376
  const result = [];
374
- for (const ticket of registry.values()) {
377
+ for (const ticket of proxy.values) {
375
378
  const value = ticket.value;
376
379
  if (!/* @__PURE__ */ isNullOrUndefined(value) && set.has(value)) result.push(ticket);
377
380
  }
@@ -490,7 +493,7 @@ function createDataTable(options = {}) {
490
493
  loading,
491
494
  error,
492
495
  get size() {
493
- return registry.size;
496
+ return proxy.size;
494
497
  }
495
498
  };
496
499
  }
@@ -1,8 +1,8 @@
1
1
  import { resolveIds, resolveIndexes, useId as useId$1 } from "./utilities/index.mjs";
2
2
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
3
- import { t as createSelection } from "./createSelection-DEqhvdoj.mjs";
4
- import { t as toArray } from "./toArray-CD2-OxAz.mjs";
5
- import { computed, onScopeDispose, reactive, shallowReactive, toRef, toValue } from "vue";
3
+ import { t as createSelection } from "./createSelection-BMvXj84C.mjs";
4
+ import { t as toArray } from "./toArray-C89ZaEuF.mjs";
5
+ import { computed, onScopeDispose, reactive, shallowReactive, shallowRef, toRef, toValue } from "vue";
6
6
  //#region src/composables/useProxyRegistry/index.ts
7
7
  /**
8
8
  * @module useProxyRegistry
@@ -54,17 +54,12 @@ import { computed, onScopeDispose, reactive, shallowReactive, toRef, toValue } f
54
54
  * ```
55
55
  */
56
56
  function useProxyRegistry(registry, options) {
57
- const state = (options?.deep ? reactive : shallowReactive)({
58
- keys: registry.keys(),
59
- values: registry.values(),
60
- entries: registry.entries(),
61
- size: registry.size
62
- });
57
+ const version = shallowRef(0);
58
+ function wrap(value) {
59
+ return options?.deep ? reactive(value) : value;
60
+ }
63
61
  function update() {
64
- state.keys = registry.keys();
65
- state.values = registry.values();
66
- state.entries = registry.entries();
67
- state.size = registry.size;
62
+ version.value++;
68
63
  }
69
64
  registry.on("register:ticket", update);
70
65
  registry.on("unregister:ticket", update);
@@ -78,7 +73,24 @@ function useProxyRegistry(registry, options) {
78
73
  registry.off("clear:registry", update);
79
74
  registry.off("reindex:registry", update);
80
75
  }, true);
81
- return state;
76
+ return reactive({
77
+ keys: computed(() => {
78
+ version.value;
79
+ return registry.keys();
80
+ }),
81
+ values: computed(() => {
82
+ version.value;
83
+ return wrap(registry.values());
84
+ }),
85
+ entries: computed(() => {
86
+ version.value;
87
+ return wrap(registry.entries());
88
+ }),
89
+ size: computed(() => {
90
+ version.value;
91
+ return registry.size;
92
+ })
93
+ });
82
94
  }
83
95
  //#endregion
84
96
  //#region src/composables/createGroup/index.ts
@@ -1,6 +1,6 @@
1
- import { clamp, isArray, isNaN, isNullOrUndefined, isNumber, isObject, isString, range } from "./utilities/index.mjs";
1
+ import { clamp, isNaN, isObject, range } from "./utilities/index.mjs";
2
2
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
3
- import { t as toArray } from "./toArray-CD2-OxAz.mjs";
3
+ import { t as toArray } from "./toArray-C89ZaEuF.mjs";
4
4
  import { computed, isRef, shallowRef, toRef, toValue } from "vue";
5
5
  //#region src/composables/createFilter/index.ts
6
6
  /**
@@ -383,99 +383,4 @@ function usePagination(namespace = "v0:pagination") {
383
383
  return useContext(namespace);
384
384
  }
385
385
  //#endregion
386
- //#region src/composables/createDataTable/adapters/adapter.ts
387
- /**
388
- * @module createDataTable/adapters
389
- *
390
- * @remarks
391
- * Defines the adapter interface and abstract base class for data table
392
- * pipeline strategies. Adapters control how raw items are filtered, sorted,
393
- * and sliced into visible items.
394
- *
395
- * The abstract DataTableAdapter provides shared filter and sort pipelines
396
- * used by client-side adapters. Server adapters that delegate pipeline
397
- * operations externally subclass DataTableAdapter directly.
398
- */
399
- function getNestedValue(obj, parts) {
400
- let result = obj;
401
- for (const k of parts) {
402
- if (/* @__PURE__ */ isNullOrUndefined(result)) return void 0;
403
- result = result[k];
404
- }
405
- return result;
406
- }
407
- function compareValues(a, b, collator) {
408
- if (a === b) return 0;
409
- const aNil = /* @__PURE__ */ isNullOrUndefined(a);
410
- const bNil = /* @__PURE__ */ isNullOrUndefined(b);
411
- if (aNil && bNil) return 0;
412
- if (aNil) return 1;
413
- if (bNil) return -1;
414
- if (/* @__PURE__ */ isString(a) && /* @__PURE__ */ isString(b)) return collator ? collator.compare(a, b) : a.localeCompare(b);
415
- if (/* @__PURE__ */ isNumber(a) && /* @__PURE__ */ isNumber(b)) {
416
- if (/* @__PURE__ */ isNaN(a)) return 1;
417
- if (/* @__PURE__ */ isNaN(b)) return -1;
418
- return a - b;
419
- }
420
- const sa = String(a);
421
- const sb = String(b);
422
- return collator ? collator.compare(sa, sb) : sa.localeCompare(sb);
423
- }
424
- var DataTableAdapter = class {
425
- /** Create the filter pipeline stage */
426
- filter(context) {
427
- const filter = createFilter({
428
- ...context.filterOptions,
429
- keys: [...toValue(context.filterableKeys)],
430
- customFilter: context.filterOptions.customFilter ?? ((query, item) => {
431
- const columnFilters = toValue(context.customColumnFilters);
432
- const keys = toValue(context.filterableKeys);
433
- if (!/* @__PURE__ */ isObject(item)) return false;
434
- const q = String(/* @__PURE__ */ isArray(query) ? query[0] : query).toLowerCase();
435
- if (!q) return true;
436
- const obj = item;
437
- for (const key of keys) {
438
- const customFn = columnFilters[key];
439
- if (customFn) {
440
- if (customFn(obj[key], q)) return true;
441
- } else {
442
- const val = obj[key];
443
- if (!/* @__PURE__ */ isNullOrUndefined(val) && String(val).toLowerCase().includes(q)) return true;
444
- }
445
- }
446
- return false;
447
- })
448
- });
449
- const allItems = toRef(() => toValue(context.items));
450
- const { items: filteredItems } = filter.apply(context.search, allItems);
451
- return {
452
- allItems,
453
- filteredItems
454
- };
455
- }
456
- /** Create the sort pipeline stage */
457
- sort(filteredItems, sortBy, locale, customSorts) {
458
- return computed(() => {
459
- const entries = sortBy.value;
460
- if (entries.length === 0) return filteredItems.value;
461
- const sorts = toValue(customSorts) ?? {};
462
- const collator = new Intl.Collator(locale?.value);
463
- const resolved = entries.map(({ key, direction }) => ({
464
- parts: key.split("."),
465
- direction,
466
- custom: sorts[key]
467
- }));
468
- return filteredItems.value.toSorted((a, b) => {
469
- for (const { parts, direction, custom } of resolved) {
470
- const aVal = parts.length === 1 ? a[parts[0]] : getNestedValue(a, parts);
471
- const bVal = parts.length === 1 ? b[parts[0]] : getNestedValue(b, parts);
472
- const cmp = custom ? custom(aVal, bVal) : compareValues(aVal, bVal, collator);
473
- if (cmp !== 0) return direction === "desc" ? -cmp : cmp;
474
- }
475
- return 0;
476
- });
477
- });
478
- }
479
- };
480
- //#endregion
481
- export { createFilter as a, usePagination as i, createPagination as n, createFilterContext as o, createPaginationContext as r, useFilter as s, DataTableAdapter as t };
386
+ export { createFilterContext as a, createFilter as i, createPaginationContext as n, useFilter as o, usePagination as r, createPagination as t };
@@ -1,6 +1,6 @@
1
1
  import { clamp, isUndefined, useId as useId$1 } from "./utilities/index.mjs";
2
2
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
3
- import { i as useLogger } from "./useLogger-CTgAedNH.mjs";
3
+ import { i as useLogger } from "./useLogger-D7_hm4e8.mjs";
4
4
  import { shallowReactive } from "vue";
5
5
  //#region src/composables/createRegistry/index.ts
6
6
  /**
@@ -63,9 +63,11 @@ function createRegistry(options) {
63
63
  const directory = /* @__PURE__ */ new Map();
64
64
  const cache = /* @__PURE__ */ new Map();
65
65
  const listeners = /* @__PURE__ */ new Map();
66
+ const order = reactive ? shallowReactive([]) : [];
66
67
  let indexDependentCount = 0;
67
68
  let needsReindex = false;
68
69
  let minDirtyIndex = Infinity;
70
+ let maxDirtyIndex = -Infinity;
69
71
  let isBatching = false;
70
72
  let batched = [];
71
73
  function dispatch(event, data) {
@@ -171,30 +173,31 @@ function createRegistry(options) {
171
173
  else catalog.set(value, next);
172
174
  }
173
175
  function keys() {
174
- if (reactive) return Array.from(collection.keys());
176
+ if (reactive) return order.map((ticket) => ticket.id);
175
177
  const cached = cache.get("keys");
176
178
  if (!/* @__PURE__ */ isUndefined(cached)) return cached;
177
- const out = Array.from(collection.keys());
179
+ const out = order.map((ticket) => ticket.id);
178
180
  cache.set("keys", out);
179
181
  return out;
180
182
  }
181
183
  function values() {
182
- if (reactive) return Array.from(collection.values());
184
+ if (reactive) return order.slice();
183
185
  const cached = cache.get("values");
184
186
  if (!/* @__PURE__ */ isUndefined(cached)) return cached;
185
- const out = Array.from(collection.values());
187
+ const out = order.slice();
186
188
  cache.set("values", out);
187
189
  return out;
188
190
  }
189
191
  function entries() {
190
- if (reactive) return Array.from(collection.entries());
192
+ if (reactive) return order.map((ticket) => [ticket.id, ticket]);
191
193
  const cached = cache.get("entries");
192
194
  if (!/* @__PURE__ */ isUndefined(cached)) return cached;
193
- const out = Array.from(collection.entries());
195
+ const out = order.map((ticket) => [ticket.id, ticket]);
194
196
  cache.set("entries", out);
195
197
  return out;
196
198
  }
197
199
  function clear() {
200
+ order.length = 0;
198
201
  collection.clear();
199
202
  catalog.clear();
200
203
  directory.clear();
@@ -202,6 +205,7 @@ function createRegistry(options) {
202
205
  indexDependentCount = 0;
203
206
  needsReindex = false;
204
207
  minDirtyIndex = Infinity;
208
+ maxDirtyIndex = -Infinity;
205
209
  emit("clear:registry");
206
210
  }
207
211
  function invalidate() {
@@ -220,33 +224,35 @@ function createRegistry(options) {
220
224
  } finally {
221
225
  isBatching = false;
222
226
  batched = [];
227
+ cache.clear();
223
228
  }
224
229
  }
225
230
  function reindex() {
226
- const startIndex = minDirtyIndex === Infinity ? 0 : minDirtyIndex;
227
- if (startIndex === 0) {
231
+ const size = order.length;
232
+ const start = minDirtyIndex === Infinity ? 0 : minDirtyIndex;
233
+ const end = maxDirtyIndex === -Infinity ? size - 1 : Math.min(maxDirtyIndex, size - 1);
234
+ const full = start === 0 && end === size - 1;
235
+ invalidate();
236
+ if (full) {
228
237
  catalog.clear();
229
238
  directory.clear();
239
+ } else for (let i = start; i <= end; i++) {
240
+ const ticket = order[i];
241
+ directory.delete(ticket.index);
242
+ if (ticket.valueIsIndex) unassign(ticket.value, ticket.id);
230
243
  }
231
- invalidate();
232
- let index = 0;
233
- for (const ticket of collection.values()) {
234
- if (index < startIndex) {
235
- index++;
236
- continue;
237
- }
238
- if (startIndex > 0) directory.delete(ticket.index);
244
+ for (let i = start; i <= end; i++) {
245
+ const ticket = order[i];
239
246
  if (ticket.valueIsIndex) {
240
- if (startIndex > 0) unassign(ticket.value, ticket.id);
241
- ticket.value = index;
247
+ ticket.value = i;
242
248
  assign(ticket.value, ticket.id);
243
- } else if (startIndex === 0) assign(ticket.value, ticket.id);
244
- ticket.index = index;
245
- directory.set(index, ticket.id);
246
- index++;
249
+ } else if (full) assign(ticket.value, ticket.id);
250
+ ticket.index = i;
251
+ directory.set(i, ticket.id);
247
252
  }
248
253
  needsReindex = false;
249
254
  minDirtyIndex = Infinity;
255
+ maxDirtyIndex = -Infinity;
250
256
  emit("reindex:registry");
251
257
  }
252
258
  function register(registration = {}) {
@@ -258,7 +264,7 @@ function createRegistry(options) {
258
264
  return get(id);
259
265
  }
260
266
  const valueIsUndefined = /* @__PURE__ */ isUndefined(registration.value);
261
- const index = registration.index ?? size;
267
+ const index = size;
262
268
  const value = valueIsUndefined ? index : registration.value;
263
269
  const valueIsIndex = registration.valueIsIndex ?? valueIsUndefined;
264
270
  if (valueIsIndex) indexDependentCount++;
@@ -272,6 +278,7 @@ function createRegistry(options) {
272
278
  };
273
279
  const ticket = reactive ? shallowReactive(input) : input;
274
280
  collection.set(ticket.id, ticket);
281
+ order.push(ticket);
275
282
  directory.set(ticket.index, ticket.id);
276
283
  assign(ticket.value, ticket.id);
277
284
  invalidate();
@@ -282,6 +289,8 @@ function createRegistry(options) {
282
289
  const ticket = collection.get(id);
283
290
  if (!ticket) return;
284
291
  if (ticket.valueIsIndex) indexDependentCount--;
292
+ const orderPos = order.indexOf(ticket);
293
+ if (orderPos !== -1) order.splice(orderPos, 1);
285
294
  collection.delete(ticket.id);
286
295
  directory.delete(ticket.index);
287
296
  unassign(ticket.value, ticket.id);
@@ -308,18 +317,27 @@ function createRegistry(options) {
308
317
  }
309
318
  function offboard(ids) {
310
319
  const removed = [];
320
+ const removedIds = /* @__PURE__ */ new Set();
321
+ for (const id of ids) {
322
+ if (removedIds.has(id)) continue;
323
+ const ticket = collection.get(id);
324
+ if (ticket) {
325
+ removed.push(ticket);
326
+ removedIds.add(id);
327
+ }
328
+ }
329
+ if (removed.length === 0) return [];
311
330
  batch(() => {
312
- for (const id of ids) {
313
- const ticket = collection.get(id);
314
- if (!ticket) continue;
331
+ let w = 0;
332
+ for (const ticket of order) if (!removedIds.has(ticket.id)) order[w++] = ticket;
333
+ order.length = w;
334
+ for (const ticket of removed) {
315
335
  if (ticket.valueIsIndex) indexDependentCount--;
316
336
  minDirtyIndex = Math.min(minDirtyIndex, ticket.index);
317
337
  collection.delete(ticket.id);
318
338
  directory.delete(ticket.index);
319
339
  unassign(ticket.value, ticket.id);
320
- removed.push(ticket);
321
340
  }
322
- if (removed.length === 0) return;
323
341
  for (const ticket of removed) emit("unregister:ticket", ticket);
324
342
  needsReindex = true;
325
343
  });
@@ -331,15 +349,13 @@ function createRegistry(options) {
331
349
  if (!ticket) return void 0;
332
350
  const size = collection.size;
333
351
  const target = /* @__PURE__ */ clamp(toIndex, 0, size - 1);
334
- if (ticket.index === target) return ticket;
352
+ const from = ticket.index;
353
+ if (from === target) return ticket;
335
354
  return batch(() => {
336
- const items = Array.from(collection.entries());
337
- const fromIndex = items.findIndex(([key]) => key === id);
338
- const [entry] = items.splice(fromIndex, 1);
339
- items.splice(target, 0, entry);
340
- collection.clear();
341
- for (const [key, value] of items) collection.set(key, value);
342
- minDirtyIndex = Math.min(ticket.index, target);
355
+ order.splice(from, 1);
356
+ order.splice(target, 0, ticket);
357
+ minDirtyIndex = Math.min(from, target);
358
+ maxDirtyIndex = Math.max(from, target);
343
359
  reindex();
344
360
  emit("update:ticket", ticket);
345
361
  return ticket;
@@ -349,18 +365,18 @@ function createRegistry(options) {
349
365
  if (needsReindex) reindex();
350
366
  if (ids.length !== collection.size) return;
351
367
  const seen = /* @__PURE__ */ new Set();
352
- const entries = [];
368
+ const next = [];
353
369
  for (const id of ids) {
354
370
  if (seen.has(id)) return;
355
371
  const ticket = collection.get(id);
356
372
  if (!ticket) return;
357
373
  seen.add(id);
358
- entries.push([id, ticket]);
374
+ next.push(ticket);
359
375
  }
360
376
  batch(() => {
361
- collection.clear();
362
- for (const [id, ticket] of entries) collection.set(id, ticket);
377
+ for (const [i, ticket] of next.entries()) order[i] = ticket;
363
378
  minDirtyIndex = 0;
379
+ maxDirtyIndex = -Infinity;
364
380
  reindex();
365
381
  });
366
382
  }
@@ -1,6 +1,6 @@
1
1
  import { isUndefined, resolveIds, useId as useId$1 } from "./utilities/index.mjs";
2
2
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
3
- import { t as createRegistry } from "./createRegistry-tJ1PPNIr.mjs";
3
+ import { t as createRegistry } from "./createRegistry-Cb6ftNMU.mjs";
4
4
  import { computed, isRef, shallowReactive, toRaw, toRef, toValue } from "vue";
5
5
  //#region src/composables/createModel/index.ts
6
6
  /**
@@ -105,11 +105,14 @@ function createModel(_options = {}) {
105
105
  }
106
106
  function apply(values, _options) {
107
107
  const value = values[0];
108
+ let written = false;
108
109
  for (const id of selectedIds) {
109
110
  const item = registry.get(id);
110
111
  if (!item || !isRef(item.value)) continue;
111
- item.value.value = value;
112
+ if (!/* @__PURE__ */ isUndefined(value)) item.value.value = value;
113
+ written = true;
112
114
  }
115
+ if (written) return;
113
116
  if (!toValue(multiple)) selectedIds.clear();
114
117
  if (/* @__PURE__ */ isUndefined(value)) return;
115
118
  const id = registry.browse(toRaw(value))?.values().next().value;
@@ -305,8 +308,8 @@ function createSelection(_options = {}) {
305
308
  if (ids) for (const id of ids) targetIds.add(id);
306
309
  }
307
310
  if (isMultiple) {
308
- for (const id of currentIds.difference(targetIds)) unselect(id);
309
- for (const id of targetIds.difference(currentIds)) model.selectedIds.add(id);
311
+ for (const id of currentIds) if (!targetIds.has(id)) unselect(id);
312
+ for (const id of targetIds) if (!currentIds.has(id)) model.selectedIds.add(id);
310
313
  } else {
311
314
  const next = targetIds.values().next().value;
312
315
  const last = currentIds.values().next().value;
@@ -1,5 +1,5 @@
1
1
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
2
- import { t as createSelection } from "./createSelection-DEqhvdoj.mjs";
2
+ import { t as createSelection } from "./createSelection-BMvXj84C.mjs";
3
3
  import { toRef } from "vue";
4
4
  //#region src/composables/createSingle/index.ts
5
5
  /**
@@ -91,11 +91,11 @@ import { toRef } from "vue";
91
91
  * ```
92
92
  */
93
93
  function createSingle(_options = {}) {
94
- const { mandatory = false, multiple = false, ...options } = _options;
94
+ const { mandatory = false, ...options } = _options;
95
95
  const registry = createSelection({
96
96
  ...options,
97
97
  mandatory,
98
- multiple
98
+ multiple: false
99
99
  });
100
100
  const selectedId = toRef(() => registry.selectedIds.values().next().value);
101
101
  const selectedItem = toRef(() => registry.selectedItems.value.values().next().value);
@@ -1,7 +1,7 @@
1
- import { isObject, isString, isUndefined } from "./utilities/index.mjs";
1
+ import { UNSAFE_KEYS, isObject, isString, isUndefined } from "./utilities/index.mjs";
2
2
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
3
- import { i as useLogger } from "./useLogger-CTgAedNH.mjs";
4
- import { t as createRegistry } from "./createRegistry-tJ1PPNIr.mjs";
3
+ import { i as useLogger } from "./useLogger-D7_hm4e8.mjs";
4
+ import { t as createRegistry } from "./createRegistry-Cb6ftNMU.mjs";
5
5
  //#region src/composables/createTokens/index.ts
6
6
  /**
7
7
  * @module createTokens
@@ -175,8 +175,7 @@ function createTokens(tokens = {}, options = {}) {
175
175
  /**
176
176
  * Creates a new token context.
177
177
  *
178
- * @param namespace The namespace for the token context.
179
- * @param tokens The tokens to use.
178
+ * @param options The options for the token context.
180
179
  * @template Z The type of the token ticket.
181
180
  * @template E The type of the token context.
182
181
  * @returns A new token context.
@@ -240,12 +239,17 @@ function flatten(tokens, prefix = "", flat = false) {
240
239
  while (stack.length > 0) {
241
240
  const { tokens: currentTokens, prefix: currentPrefix, flat } = stack.pop();
242
241
  const meta = {};
243
- for (const k in currentTokens) if (k.startsWith("$")) meta[k] = currentTokens[k];
242
+ for (const k in currentTokens) {
243
+ if (!Object.prototype.hasOwnProperty.call(currentTokens, k)) continue;
244
+ if (k.startsWith("$")) meta[k] = currentTokens[k];
245
+ }
244
246
  if (Object.keys(meta).length > 0 && currentPrefix) flattened.push({
245
247
  id: currentPrefix,
246
248
  value: meta
247
249
  });
248
250
  for (const key in currentTokens) {
251
+ if (!Object.prototype.hasOwnProperty.call(currentTokens, key)) continue;
252
+ if (UNSAFE_KEYS.has(key)) continue;
249
253
  if (key.startsWith("$")) continue;
250
254
  const value = currentTokens[key];
251
255
  const id = currentPrefix ? `${currentPrefix}.${key}` : key;
@@ -263,6 +267,8 @@ function flatten(tokens, prefix = "", flat = false) {
263
267
  });
264
268
  const inner = value.$value;
265
269
  if (/* @__PURE__ */ isObject(inner) && !flat) for (const innerKey in inner) {
270
+ if (!Object.prototype.hasOwnProperty.call(inner, innerKey)) continue;
271
+ if (UNSAFE_KEYS.has(innerKey)) continue;
266
272
  if (innerKey.startsWith("$")) continue;
267
273
  const child = inner[innerKey];
268
274
  const childId = `${id}.${innerKey}`;
@@ -1,2 +1,2 @@
1
- import { t as ClientDataTableAdapter } from "../../../v0-QIjffi4E.mjs";
1
+ import { t as ClientDataTableAdapter } from "../../../v0-DotXXGXU.mjs";
2
2
  export { ClientDataTableAdapter };
@@ -1,2 +1,2 @@
1
- import { t as ClientDataTableAdapter } from "../../../v0-COaQncfZ.mjs";
1
+ import { t as ClientDataTableAdapter } from "../../../v0-A4GLojAr.mjs";
2
2
  export { ClientDataTableAdapter };
@@ -1,5 +1,5 @@
1
- import { a as SortEntry, i as SortDirection, n as DataTableAdapterContext, r as DataTableAdapterResult, t as DataTableAdapter } from "../../adapter-BO75n0Cn.mjs";
2
- import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../../server-7vjHxjNc.mjs";
3
- import { t as ClientDataTableAdapter } from "../../v0-QIjffi4E.mjs";
4
- import { t as VirtualDataTableAdapter } from "../../virtual-CrgGA-o6.mjs";
1
+ import { a as SortEntry, i as SortDirection, n as DataTableAdapterContext, r as DataTableAdapterResult, t as DataTableAdapter } from "../../adapter-_srNCBEi.mjs";
2
+ import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../../server-DbtTGb67.mjs";
3
+ import { t as ClientDataTableAdapter } from "../../v0-DotXXGXU.mjs";
4
+ import { t as VirtualDataTableAdapter } from "../../virtual-C-NsLue0.mjs";
5
5
  export { ClientDataTableAdapter, DataTableAdapter, DataTableAdapterContext, DataTableAdapterResult, ServerDataTableAdapter, ServerDataTableAdapterOptions, SortDirection, SortEntry, VirtualDataTableAdapter };
@@ -1,6 +1,5 @@
1
- import { t as DataTableAdapter } from "../../adapter-BCVxBtDp.mjs";
2
- import { t as ClientDataTableAdapter } from "../../v0-COaQncfZ.mjs";
3
- import { t as ServerDataTableAdapter } from "../../server-CZ83nTn_.mjs";
4
- import { t as VirtualDataTableAdapter } from "../../virtual-UumJ2BQ9.mjs";
5
- import "../../adapters-BYLWDmYl.mjs";
1
+ import { t as DataTableAdapter } from "../../adapter-CVoWg0sw.mjs";
2
+ import { t as ClientDataTableAdapter } from "../../v0-A4GLojAr.mjs";
3
+ import { t as ServerDataTableAdapter } from "../../server-D5BJBjB0.mjs";
4
+ import { t as VirtualDataTableAdapter } from "../../virtual-DFvOoeG6.mjs";
6
5
  export { ClientDataTableAdapter, DataTableAdapter, ServerDataTableAdapter, VirtualDataTableAdapter };
@@ -1,2 +1,2 @@
1
- import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../../../server-7vjHxjNc.mjs";
1
+ import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../../../server-DbtTGb67.mjs";
2
2
  export { ServerDataTableAdapter, ServerDataTableAdapterOptions };
@@ -1,2 +1,2 @@
1
- import { t as ServerDataTableAdapter } from "../../../server-CZ83nTn_.mjs";
1
+ import { t as ServerDataTableAdapter } from "../../../server-D5BJBjB0.mjs";
2
2
  export { ServerDataTableAdapter };
@@ -1,2 +1,2 @@
1
- import { t as VirtualDataTableAdapter } from "../../../virtual-CrgGA-o6.mjs";
1
+ import { t as VirtualDataTableAdapter } from "../../../virtual-C-NsLue0.mjs";
2
2
  export { VirtualDataTableAdapter };
@@ -1,2 +1,2 @@
1
- import { t as VirtualDataTableAdapter } from "../../../virtual-UumJ2BQ9.mjs";
1
+ import { t as VirtualDataTableAdapter } from "../../../virtual-DFvOoeG6.mjs";
2
2
  export { VirtualDataTableAdapter };