@vuetify/v0 0.1.3 → 0.1.4

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 (127) hide show
  1. package/dist/adapter-BN-h5JbD.d.mts +344 -0
  2. package/dist/adapter-CJIj5ySf.d.mts +11 -0
  3. package/dist/adapter-D_0ptsPm.mjs +229 -0
  4. package/dist/adapters-BQ-Lr3PW.mjs +1 -0
  5. package/dist/adapters-DEXpW9If.mjs +1 -0
  6. package/dist/adapters-Q9WaOsJp.mjs +1 -0
  7. package/dist/adapters-SSDVth5e.mjs +1 -0
  8. package/dist/browser/index.js +359 -933
  9. package/dist/components/index.d.mts +19 -6
  10. package/dist/components/index.mjs +37 -5
  11. package/dist/{components-C0zEvP7w.mjs → components-CMuzTJdK.mjs} +11 -4
  12. package/dist/composables/index.d.mts +17 -4
  13. package/dist/composables/index.mjs +36 -4
  14. package/dist/consola-DiUk9j3y.d.mts +15 -0
  15. package/dist/consola-GBy8XRuL.mjs +31 -0
  16. package/dist/constants/index.d.mts +1 -1
  17. package/dist/constants/index.mjs +3 -3
  18. package/dist/constants-B8pMSkcW.mjs +1 -0
  19. package/dist/createDataTable-BJnmvxfb.mjs +387 -0
  20. package/dist/createGroup-CPhp6FUh.mjs +363 -0
  21. package/dist/createPagination-cyOWlpfH.mjs +234 -0
  22. package/dist/createSelection-uqEbFgha.mjs +261 -0
  23. package/dist/createSingle-B59ya3aa.mjs +179 -0
  24. package/dist/createTokens-BlhLdHXE.mjs +682 -0
  25. package/dist/createTrinity-EeHQSsb6.mjs +149 -0
  26. package/dist/data-table/adapters/client/index.d.mts +3 -0
  27. package/dist/data-table/adapters/client/index.mjs +9 -0
  28. package/dist/data-table/adapters/index.d.mts +5 -0
  29. package/dist/data-table/adapters/index.mjs +12 -0
  30. package/dist/data-table/adapters/server/index.d.mts +3 -0
  31. package/dist/data-table/adapters/server/index.mjs +7 -0
  32. package/dist/data-table/adapters/virtual/index.d.mts +3 -0
  33. package/dist/data-table/adapters/virtual/index.mjs +9 -0
  34. package/dist/data-table/index.d.mts +7 -0
  35. package/dist/data-table/index.mjs +25 -0
  36. package/dist/date/index.d.mts +1 -1
  37. package/dist/date/index.mjs +2 -2
  38. package/dist/features/adapters/flagsmith/index.d.mts +16 -0
  39. package/dist/features/adapters/flagsmith/index.mjs +3 -0
  40. package/dist/features/adapters/launchdarkly/index.d.mts +15 -0
  41. package/dist/features/adapters/launchdarkly/index.mjs +3 -0
  42. package/dist/features/adapters/posthog/index.d.mts +15 -0
  43. package/dist/features/adapters/posthog/index.mjs +4 -0
  44. package/dist/features/index.d.mts +17 -0
  45. package/dist/features/index.mjs +18 -0
  46. package/dist/flagsmith-CHmpPGR7.mjs +40 -0
  47. package/dist/{globals-BwYsH-rt.mjs → globals-B_GVfG06.mjs} +2 -2
  48. package/dist/index-7mWYFHA6.d.mts +251 -0
  49. package/dist/index-BDTbJClL.d.mts +11 -0
  50. package/dist/index-BuOz3Rgm.d.mts +32 -0
  51. package/dist/{index-Bmem4l8m.d.mts → index-Bv1VN_j5.d.mts} +1 -1
  52. package/dist/{index-DFM5iBqh.d.mts → index-CQrDeqsK.d.mts} +280 -279
  53. package/dist/{index-2wh69fk5.d.mts → index-Dd0m0LIJ.d.mts} +135 -1407
  54. package/dist/{index-DBZTizq2.d.mts → index-UNwEBkQT.d.mts} +16 -2
  55. package/dist/index.d.mts +20 -7
  56. package/dist/index.mjs +39 -7
  57. package/dist/json/web-types.json +1 -1
  58. package/dist/launchdarkly-W8t8ZANX.mjs +28 -0
  59. package/dist/locale/adapters/index.d.mts +3 -0
  60. package/dist/locale/adapters/index.mjs +6 -0
  61. package/dist/locale/adapters/v0/index.d.mts +3 -0
  62. package/dist/locale/adapters/v0/index.mjs +5 -0
  63. package/dist/locale/index.d.mts +17 -0
  64. package/dist/locale/index.mjs +17 -0
  65. package/dist/logger/adapters/consola/index.d.mts +3 -0
  66. package/dist/logger/adapters/consola/index.mjs +3 -0
  67. package/dist/logger/adapters/index.d.mts +5 -0
  68. package/dist/logger/adapters/index.mjs +8 -0
  69. package/dist/logger/adapters/pino/index.d.mts +3 -0
  70. package/dist/logger/adapters/pino/index.mjs +5 -0
  71. package/dist/logger/adapters/v0/index.d.mts +3 -0
  72. package/dist/logger/adapters/v0/index.mjs +5 -0
  73. package/dist/logger/index.d.mts +17 -0
  74. package/dist/logger/index.mjs +10 -0
  75. package/dist/memory-BsZGbGnG.mjs +27 -0
  76. package/dist/memory-DVjquu_v.d.mts +25 -0
  77. package/dist/permissions/adapters/index.d.mts +18 -0
  78. package/dist/permissions/adapters/index.mjs +6 -0
  79. package/dist/permissions/adapters/v0/index.d.mts +18 -0
  80. package/dist/permissions/adapters/v0/index.mjs +5 -0
  81. package/dist/permissions/index.d.mts +17 -0
  82. package/dist/permissions/index.mjs +15 -0
  83. package/dist/pino-01x_NmWp.mjs +49 -0
  84. package/dist/pino-p-jDkNQd.d.mts +24 -0
  85. package/dist/posthog-BrGBPPir.mjs +50 -0
  86. package/dist/server-6cs14bj1.d.mts +20 -0
  87. package/dist/server-ClCwiLMA.mjs +45 -0
  88. package/dist/storage/adapters/index.d.mts +3 -0
  89. package/dist/storage/adapters/index.mjs +3 -0
  90. package/dist/storage/adapters/memory/index.d.mts +2 -0
  91. package/dist/storage/adapters/memory/index.mjs +3 -0
  92. package/dist/storage/index.d.mts +17 -0
  93. package/dist/storage/index.mjs +37 -0
  94. package/dist/theme/adapters/index.d.mts +17 -0
  95. package/dist/theme/adapters/index.mjs +6 -0
  96. package/dist/theme/adapters/v0/index.d.mts +17 -0
  97. package/dist/theme/adapters/v0/index.mjs +5 -0
  98. package/dist/theme/index.d.mts +17 -0
  99. package/dist/theme/index.mjs +16 -0
  100. package/dist/toArray-DIeXVX1C.mjs +38 -0
  101. package/dist/types/index.d.mts +1 -1
  102. package/dist/useClickOutside-p8HP07At.mjs +4680 -0
  103. package/dist/useFeatures-C4JF3Hgr.mjs +122 -0
  104. package/dist/useLocale-DlbShzF-.mjs +85 -0
  105. package/dist/useLogger-CO9JwbSJ.mjs +283 -0
  106. package/dist/usePermissions-DQVT_4nD.mjs +128 -0
  107. package/dist/useTheme-Bcw1Ebyt.mjs +135 -0
  108. package/dist/utilities/index.d.mts +3 -3
  109. package/dist/utilities/index.mjs +3 -3
  110. package/dist/{utilities-BbKjbXTx.mjs → utilities-BqS1sC1W.mjs} +20 -3
  111. package/dist/v0-B40YkIQ-.mjs +21 -0
  112. package/dist/v0-BOxb3nD1.d.mts +33 -0
  113. package/dist/v0-BogbIzpM.mjs +41 -0
  114. package/dist/v0-BtQCSBOG.mjs +37 -0
  115. package/dist/v0-C-9dv_1S.d.mts +10 -0
  116. package/dist/v0-CtjuUUPl.mjs +73 -0
  117. package/dist/v0-DHMoZ7dS.d.mts +22 -0
  118. package/dist/v0-ONBWyQYQ.mjs +83 -0
  119. package/dist/v0-RepwEY1F.d.mts +9 -0
  120. package/dist/virtual-B3IPkHC0.d.mts +9 -0
  121. package/dist/virtual-BP9WXRzN.mjs +44 -0
  122. package/package.json +34 -2
  123. package/dist/useClickOutside-DrkNYxDe.mjs +0 -8871
  124. /package/dist/{adapter-D95FHAtt.d.mts → adapter-DcwxFryd.d.mts} +0 -0
  125. /package/dist/{constants-DHKqjdjH.mjs → adapters-BGJKsBrw.mjs} +0 -0
  126. /package/dist/{htmlElements-DO9n35bD.mjs → htmlElements-d8iBCGpO.mjs} +0 -0
  127. /package/dist/{index-BLK67J_-.d.mts → index-BFBN5Zl3.d.mts} +0 -0
@@ -0,0 +1,344 @@
1
+ import * as vue583 from "vue";
2
+ import { App, ComputedRef, MaybeRef, MaybeRefOrGetter, Ref, ShallowRef } from "vue";
3
+
4
+ //#region src/composables/createTrinity/index.d.ts
5
+
6
+ type ContextTrinity<Z = unknown> = readonly [() => Z, (context?: Z, app?: App) => Z, Z];
7
+ /**
8
+ * Creates a new trinity for a context composable and its provider.
9
+ *
10
+ * @param useContext The function that retrieves/uses the context (typically named `useContext`).
11
+ * @param provideContext The function that provides the context to descendants.
12
+ * @param context The default context instance to use when no custom context is provided.
13
+ * @template Z The type of the context.
14
+ * @returns A readonly tuple containing: [useContext function, provideContext wrapper function, default context instance].
15
+ *
16
+ * @remarks The trinity pattern is a foundational pattern used throughout the codebase for creating reusable context systems. It provides three related elements:
17
+ *
18
+ * 1. A function to retrieve/use the context
19
+ * 2. A function to provide the context (with default value support)
20
+ * 3. The default context instance
21
+ *
22
+ * The returned tuple is readonly (using `as const`) to ensure proper type inference.
23
+ *
24
+ * @see https://0.vuetifyjs.com/composables/foundation/create-trinity#create-trinity
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * interface MyContext {
29
+ * foo: string
30
+ * bar: number
31
+ * }
32
+ *
33
+ * export function createMyFeature<E extends MyContext = MyContext>() {
34
+ * const [useContext, _provideContext] = createContext<E>('my-context')
35
+ *
36
+ * const context = { foo: 'hello', bar: 42 }
37
+ *
38
+ * function provideContext (_context: E = context, app?: App): E {
39
+ * return _provideContext(_context, app)
40
+ * }
41
+ *
42
+ * return createTrinity<E>(useContext, provideContext, context)
43
+ * }
44
+ * ```
45
+ */
46
+ declare function createTrinity<Z = unknown>(useContext: () => Z, provideContext: (_context?: Z, app?: App) => Z, context: Z): ContextTrinity<Z>;
47
+ //#endregion
48
+ //#region src/composables/createFilter/index.d.ts
49
+ type Primitive = string | number | boolean;
50
+ type FilterQuery = MaybeRefOrGetter<Primitive | Primitive[]>;
51
+ type FilterItem = Primitive | Record<string, any>;
52
+ type FilterMode = 'some' | 'every' | 'union' | 'intersection';
53
+ type FilterFunction = (query: Primitive | Primitive[], item: FilterItem) => boolean;
54
+ interface FilterOptions {
55
+ customFilter?: FilterFunction;
56
+ keys?: string[];
57
+ mode?: FilterMode;
58
+ }
59
+ interface FilterResult<Z extends FilterItem = FilterItem> {
60
+ items: ComputedRef<Z[]>;
61
+ }
62
+ interface FilterContext<Z extends FilterItem = FilterItem> {
63
+ /** The filter mode */
64
+ mode: FilterMode;
65
+ /** Keys to filter on for object items */
66
+ keys: string[] | undefined;
67
+ /** Custom filter function */
68
+ customFilter: FilterFunction | undefined;
69
+ /** Current query ref */
70
+ query: ShallowRef<Primitive | Primitive[]>;
71
+ /**
72
+ * Apply filter to an array of items
73
+ *
74
+ * @param query The query to filter by
75
+ * @param items The items to filter
76
+ * @returns The filtered items as a computed ref
77
+ */
78
+ apply: <T extends Z>(query: FilterQuery, items: MaybeRef<T[]>) => FilterResult<T>;
79
+ }
80
+ interface FilterContextOptions extends FilterOptions {
81
+ namespace?: string;
82
+ }
83
+ /**
84
+ * Creates a filter context with pre-configured options.
85
+ *
86
+ * @param options The filter options
87
+ * @template Z The type of the items
88
+ * @template E The type of the filter context
89
+ * @returns A filter context
90
+ *
91
+ * @see https://0.vuetifyjs.com/composables/utilities/use-filter
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * import { createFilter } from '@vuetify/v0'
96
+ *
97
+ * const filter = createFilter({
98
+ * mode: 'intersection',
99
+ * keys: ['name', 'email'],
100
+ * })
101
+ *
102
+ * const { items } = filter.apply(query, users)
103
+ * ```
104
+ */
105
+ declare function createFilter<Z extends FilterItem = FilterItem, E extends FilterContext<Z> = FilterContext<Z>>(options?: FilterOptions): E;
106
+ /**
107
+ * Creates a filter context with dependency injection support.
108
+ *
109
+ * @param options The filter context options
110
+ * @template Z The type of the items
111
+ * @template E The type of the filter context
112
+ * @returns A trinity tuple: [useContext, provideContext, defaultContext]
113
+ *
114
+ * @see https://0.vuetifyjs.com/composables/utilities/use-filter
115
+ *
116
+ * @example
117
+ * ```ts
118
+ * import { createFilterContext } from '@vuetify/v0'
119
+ *
120
+ * export const [useSearchFilter, provideSearchFilter, searchFilter] = createFilterContext({
121
+ * namespace: 'app:search',
122
+ * mode: 'union',
123
+ * keys: ['title', 'description'],
124
+ * })
125
+ *
126
+ * // In parent component
127
+ * provideSearchFilter()
128
+ *
129
+ * // In child component
130
+ * const filter = useSearchFilter()
131
+ * const { items } = filter.apply(query, products)
132
+ * ```
133
+ */
134
+ declare function createFilterContext<Z extends FilterItem = FilterItem, E extends FilterContext<Z> = FilterContext<Z>>(_options?: FilterContextOptions): ContextTrinity<E>;
135
+ /**
136
+ * Returns the current filter context from dependency injection.
137
+ *
138
+ * @param namespace The namespace for the filter context. Defaults to `'v0:filter'`.
139
+ * @template Z The type of the items.
140
+ * @template E The type of the filter context.
141
+ * @returns The current filter context.
142
+ *
143
+ * @see https://0.vuetifyjs.com/composables/utilities/use-filter
144
+ *
145
+ * @example
146
+ * ```vue
147
+ * <script setup lang="ts">
148
+ * import { useFilter } from '@vuetify/v0'
149
+ *
150
+ * const filter = useFilter()
151
+ * const { items } = filter.apply(query, products)
152
+ * </script>
153
+ * ```
154
+ */
155
+ declare function useFilter<Z extends FilterItem = FilterItem, E extends FilterContext<Z> = FilterContext<Z>>(namespace?: string): E;
156
+ //#endregion
157
+ //#region src/composables/createPagination/index.d.ts
158
+ type PaginationTicket = {
159
+ type: 'page';
160
+ value: number;
161
+ } | {
162
+ type: 'ellipsis';
163
+ value: string;
164
+ };
165
+ interface PaginationContext {
166
+ /** Current page (1-indexed) */
167
+ page: ShallowRef<number>;
168
+ /** Items per page */
169
+ itemsPerPage: number;
170
+ /** Total number of items */
171
+ size: number;
172
+ /** Total number of pages (computed from size / itemsPerPage) */
173
+ pages: number;
174
+ /** Ellipsis character, or false if disabled */
175
+ ellipsis: string | false;
176
+ /** Visible page numbers and ellipsis for rendering */
177
+ items: ComputedRef<PaginationTicket[]>;
178
+ /** Start index of items on current page (0-indexed) */
179
+ pageStart: ComputedRef<number>;
180
+ /** End index of items on current page (exclusive, 0-indexed) */
181
+ pageStop: ComputedRef<number>;
182
+ /** Whether current page is the first page */
183
+ isFirst: ComputedRef<boolean>;
184
+ /** Whether current page is the last page */
185
+ isLast: ComputedRef<boolean>;
186
+ /** Go to first page */
187
+ first: () => void;
188
+ /** Go to last page */
189
+ last: () => void;
190
+ /** Go to next page */
191
+ next: () => void;
192
+ /** Go to previous page */
193
+ prev: () => void;
194
+ /** Go to specific page */
195
+ select: (value: number) => void;
196
+ }
197
+ interface PaginationOptions {
198
+ /** Initial page or ref for v-model (1-indexed). @default 1 */
199
+ page?: number | ShallowRef<number>;
200
+ /** Items per page. @default 10 */
201
+ itemsPerPage?: MaybeRefOrGetter<number>;
202
+ /** Total number of items. @default 0 */
203
+ size?: MaybeRefOrGetter<number>;
204
+ /** Maximum visible page buttons. @default 5 */
205
+ visible?: MaybeRefOrGetter<number>;
206
+ /** Ellipsis character. @default '…' */
207
+ ellipsis?: string | false;
208
+ }
209
+ interface PaginationContextOptions extends PaginationOptions {
210
+ /** Namespace for dependency injection */
211
+ namespace?: string;
212
+ }
213
+ /**
214
+ * Creates a pagination instance.
215
+ *
216
+ * @param options The options for the pagination instance.
217
+ * @returns A pagination context with navigation methods.
218
+ *
219
+ * @example
220
+ * ```ts
221
+ * import { createPagination } from '@vuetify/v0'
222
+ *
223
+ * // Basic usage
224
+ * const pagination = createPagination({ size: 100 })
225
+ * pagination.next()
226
+ * pagination.items.value // [{ type: 'page', value: 1 }, { type: 'page', value: 2 }, ...]
227
+ *
228
+ * // With v-model (pass a ref)
229
+ * const page = ref(1)
230
+ * const pagination = createPagination({ page, size: 100 })
231
+ * // Mutating pagination.page or the passed ref syncs both
232
+ * ```
233
+ */
234
+ declare function createPagination(_options?: PaginationOptions): PaginationContext;
235
+ /**
236
+ * Creates a pagination context for dependency injection.
237
+ *
238
+ * @param options The options including namespace.
239
+ * @returns A trinity: [usePagination, providePagination, defaultContext]
240
+ *
241
+ * @example
242
+ * ```ts
243
+ * // With default namespace 'v0:pagination'
244
+ * const [usePagination, providePaginationContext] = createPaginationContext({ size: 50 })
245
+ *
246
+ * // Or with custom namespace
247
+ * const [usePagination, providePaginationContext] = createPaginationContext({
248
+ * namespace: 'my-pagination',
249
+ * size: 50,
250
+ * })
251
+ *
252
+ * // Parent component
253
+ * providePaginationContext()
254
+ *
255
+ * // Child component
256
+ * const pagination = usePagination()
257
+ * pagination.next()
258
+ * ```
259
+ */
260
+ declare function createPaginationContext(_options?: PaginationContextOptions): ContextTrinity<PaginationContext>;
261
+ /**
262
+ * Returns the current pagination instance from context.
263
+ *
264
+ * @param namespace The namespace. @default 'v0:pagination'
265
+ * @returns The pagination context.
266
+ *
267
+ * @example
268
+ * ```vue
269
+ * <script setup lang="ts">
270
+ * import { usePagination } from '@vuetify/v0'
271
+ *
272
+ * const pagination = usePagination()
273
+ * </script>
274
+ *
275
+ * <template>
276
+ * <button @click="pagination.prev()" :disabled="pagination.isFirst.value">Prev</button>
277
+ * <button @click="pagination.next()" :disabled="pagination.isLast.value">Next</button>
278
+ * </template>
279
+ * ```
280
+ */
281
+ declare function usePagination(namespace?: string): PaginationContext;
282
+ //#endregion
283
+ //#region src/composables/createDataTable/adapters/adapter.d.ts
284
+ type SortDirection = 'asc' | 'desc' | 'none';
285
+ interface SortEntry {
286
+ key: string;
287
+ direction: SortDirection;
288
+ }
289
+ /** Inputs provided by createDataTable to the adapter */
290
+ interface DataTableAdapterContext<T extends Record<string, unknown>> {
291
+ /** Source items */
292
+ items: MaybeRefOrGetter<T[]>;
293
+ /** Search query ref */
294
+ search: ShallowRef<string>;
295
+ /** Column keys eligible for filtering */
296
+ filterableKeys: ReadonlyArray<keyof T & string>;
297
+ /** Current sort state derived from sort controls */
298
+ sortBy: Readonly<Ref<SortEntry[]>>;
299
+ /** Locale for sorting (reactive, from useLocale or options) */
300
+ locale: Readonly<Ref<string | undefined>>;
301
+ /** Filter options (keys excluded, derived from columns) */
302
+ filterOptions: Omit<FilterOptions, 'keys'>;
303
+ /** Pagination options (size excluded, derived from pipeline) */
304
+ paginationOptions: Omit<PaginationOptions, 'size'>;
305
+ /** Per-column custom sort comparators */
306
+ customSorts: Partial<Record<keyof T & string, (a: unknown, b: unknown) => number>>;
307
+ /** Per-column custom filter functions */
308
+ customColumnFilters: Partial<Record<keyof T & string, (value: unknown, query: string) => boolean>>;
309
+ }
310
+ /** Outputs returned by the adapter to createDataTable */
311
+ interface DataTableAdapterResult<T extends Record<string, unknown>> {
312
+ /** Raw unprocessed items */
313
+ allItems: Readonly<Ref<readonly T[]>>;
314
+ /** Items after filtering */
315
+ filteredItems: Readonly<Ref<readonly T[]>>;
316
+ /** Items after filtering and sorting */
317
+ sortedItems: Readonly<Ref<readonly T[]>>;
318
+ /** Final visible items (paginated or virtualized) */
319
+ items: Readonly<Ref<readonly T[]>>;
320
+ /** Pagination controls */
321
+ pagination: PaginationContext;
322
+ /** Total row count for aria-rowcount */
323
+ total: Readonly<Ref<number>>;
324
+ /** Loading state (optional, for async adapters) */
325
+ loading?: Readonly<Ref<boolean>>;
326
+ /** Error state (optional, for async adapters) */
327
+ error?: Readonly<Ref<Error | null>>;
328
+ }
329
+ /** Pipeline adapter interface for data table strategies */
330
+ interface DataTableAdapterInterface<T extends Record<string, unknown>> {
331
+ setup: (context: DataTableAdapterContext<T>) => DataTableAdapterResult<T>;
332
+ }
333
+ declare abstract class DataTableAdapter<T extends Record<string, unknown>> implements DataTableAdapterInterface<T> {
334
+ /** Create the filter pipeline stage */
335
+ protected filter(context: DataTableAdapterContext<T>): {
336
+ allItems: Readonly<Ref<T[], T[]>>;
337
+ filteredItems: vue583.ComputedRef<T[]>;
338
+ };
339
+ /** Create the sort pipeline stage */
340
+ protected sort(filteredItems: Readonly<Ref<readonly T[]>>, sortBy: Readonly<Ref<SortEntry[]>>, locale?: Readonly<Ref<string | undefined>>, customSorts?: Partial<Record<string, (a: unknown, b: unknown) => number>>): Readonly<Ref<readonly T[]>>;
341
+ abstract setup(context: DataTableAdapterContext<T>): DataTableAdapterResult<T>;
342
+ }
343
+ //#endregion
344
+ export { createFilter as C, createTrinity as D, ContextTrinity as E, Primitive as S, useFilter as T, FilterItem as _, SortDirection as a, FilterQuery as b, PaginationContextOptions as c, createPagination as d, createPaginationContext as f, FilterFunction as g, FilterContextOptions as h, DataTableAdapterResult as i, PaginationOptions as l, FilterContext as m, DataTableAdapterContext as n, SortEntry as o, usePagination as p, DataTableAdapterInterface as r, PaginationContext as s, DataTableAdapter as t, PaginationTicket as u, FilterMode as v, createFilterContext as w, FilterResult as x, FilterOptions as y };
@@ -0,0 +1,11 @@
1
+ //#region src/composables/useLogger/adapters/adapter.d.ts
2
+ interface LoggerAdapter {
3
+ debug: (message: string, ...args: unknown[]) => void;
4
+ info: (message: string, ...args: unknown[]) => void;
5
+ warn: (message: string, ...args: unknown[]) => void;
6
+ error: (message: string, ...args: unknown[]) => void;
7
+ trace?: (message: string, ...args: unknown[]) => void;
8
+ fatal?: (message: string, ...args: unknown[]) => void;
9
+ }
10
+ //#endregion
11
+ export { LoggerAdapter as t };
@@ -0,0 +1,229 @@
1
+ import { d as isObject, l as isNullOrUndefined, p as isString, s as isNaN, u as isNumber } from "./utilities-BqS1sC1W.mjs";
2
+ import { i as useContext, n as createContext, t as createTrinity } from "./createTrinity-EeHQSsb6.mjs";
3
+ import { t as toArray } from "./toArray-DIeXVX1C.mjs";
4
+ import { computed, isRef, toRef, toValue } from "vue";
5
+
6
+ //#region src/composables/createFilter/index.ts
7
+ /**
8
+ * @module useFilter
9
+ *
10
+ * @remarks
11
+ * Reactive array filtering composable with multiple filter modes.
12
+ *
13
+ * Key features:
14
+ * - Four filter modes: some, every, union, intersection
15
+ * - Case-insensitive filtering
16
+ * - Custom filter functions
17
+ * - Reactive updates
18
+ * - Context-based DI support
19
+ * - Perfect for search, multi-criteria filtering
20
+ *
21
+ * Filters arrays based on query strings with configurable matching strategies.
22
+ */
23
+ function defaultFilter(query, item, keys, mode = "some") {
24
+ const queries = toArray(query).map((q) => String(q).toLowerCase());
25
+ const stringValues = (/* @__PURE__ */ isObject(item) ? keys?.length ? keys.map((k) => item[k]) : Object.values(item) : [item]).map((v) => String(v).toLowerCase());
26
+ if (mode === "some") return stringValues.some((val) => val.includes(queries[0]));
27
+ if (mode === "every") return stringValues.every((val) => val.includes(queries[0]));
28
+ const joined = stringValues.join("\0");
29
+ if (mode === "union") return queries.some((q) => joined.includes(q));
30
+ if (mode === "intersection") return queries.every((q) => joined.includes(q));
31
+ return false;
32
+ }
33
+ /**
34
+ * Creates a filter context with pre-configured options.
35
+ *
36
+ * @param options The filter options
37
+ * @template Z The type of the items
38
+ * @template E The type of the filter context
39
+ * @returns A filter context
40
+ *
41
+ * @see https://0.vuetifyjs.com/composables/utilities/use-filter
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * import { createFilter } from '@vuetify/v0'
46
+ *
47
+ * const filter = createFilter({
48
+ * mode: 'intersection',
49
+ * keys: ['name', 'email'],
50
+ * })
51
+ *
52
+ * const { items } = filter.apply(query, users)
53
+ * ```
54
+ */
55
+ function createFilter(options = {}) {
56
+ const { customFilter, keys, mode = "some" } = options;
57
+ const filterFunction = customFilter ?? ((q, i) => defaultFilter(q, i, keys, mode));
58
+ const query = toRef("");
59
+ function apply(_query, items) {
60
+ const itemsRef = isRef(items) ? items : toRef(() => items);
61
+ const queryRef = toRef(_query);
62
+ return { items: computed(() => {
63
+ const q = toValue(queryRef);
64
+ query.value = q;
65
+ const queries = toArray(q).filter((q$1) => String(q$1).trim());
66
+ if (queries.length === 0) return itemsRef.value;
67
+ const queryParam = queries.length === 1 ? queries[0] : queries;
68
+ return itemsRef.value.filter((item) => filterFunction(queryParam, item));
69
+ }) };
70
+ }
71
+ return {
72
+ mode,
73
+ keys,
74
+ customFilter,
75
+ query,
76
+ apply
77
+ };
78
+ }
79
+ /**
80
+ * Creates a filter context with dependency injection support.
81
+ *
82
+ * @param options The filter context options
83
+ * @template Z The type of the items
84
+ * @template E The type of the filter context
85
+ * @returns A trinity tuple: [useContext, provideContext, defaultContext]
86
+ *
87
+ * @see https://0.vuetifyjs.com/composables/utilities/use-filter
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * import { createFilterContext } from '@vuetify/v0'
92
+ *
93
+ * export const [useSearchFilter, provideSearchFilter, searchFilter] = createFilterContext({
94
+ * namespace: 'app:search',
95
+ * mode: 'union',
96
+ * keys: ['title', 'description'],
97
+ * })
98
+ *
99
+ * // In parent component
100
+ * provideSearchFilter()
101
+ *
102
+ * // In child component
103
+ * const filter = useSearchFilter()
104
+ * const { items } = filter.apply(query, products)
105
+ * ```
106
+ */
107
+ function createFilterContext(_options = {}) {
108
+ const { namespace = "v0:filter", ...options } = _options;
109
+ const [useFilterContext, _provideFilterContext] = createContext(namespace);
110
+ const context = createFilter(options);
111
+ function provideFilterContext(_context = context, app) {
112
+ return _provideFilterContext(_context, app);
113
+ }
114
+ return createTrinity(useFilterContext, provideFilterContext, context);
115
+ }
116
+ /**
117
+ * Returns the current filter context from dependency injection.
118
+ *
119
+ * @param namespace The namespace for the filter context. Defaults to `'v0:filter'`.
120
+ * @template Z The type of the items.
121
+ * @template E The type of the filter context.
122
+ * @returns The current filter context.
123
+ *
124
+ * @see https://0.vuetifyjs.com/composables/utilities/use-filter
125
+ *
126
+ * @example
127
+ * ```vue
128
+ * <script setup lang="ts">
129
+ * import { useFilter } from '@vuetify/v0'
130
+ *
131
+ * const filter = useFilter()
132
+ * const { items } = filter.apply(query, products)
133
+ * <\/script>
134
+ * ```
135
+ */
136
+ function useFilter(namespace = "v0:filter") {
137
+ return useContext(namespace);
138
+ }
139
+
140
+ //#endregion
141
+ //#region src/composables/createDataTable/adapters/adapter.ts
142
+ /**
143
+ * @module createDataTable/adapters
144
+ *
145
+ * @remarks
146
+ * Defines the adapter interface and abstract base class for data table
147
+ * pipeline strategies. Adapters control how raw items are filtered, sorted,
148
+ * and sliced into visible items.
149
+ *
150
+ * The abstract DataTableAdapter provides shared filter and sort pipelines
151
+ * used by client-side adapters. Server adapters that delegate pipeline
152
+ * operations externally can implement DataTableAdapterInterface directly.
153
+ */
154
+ function getNestedValue(obj, key) {
155
+ const keys = key.split(".");
156
+ let result = obj;
157
+ for (const k of keys) {
158
+ if (/* @__PURE__ */ isNullOrUndefined(result)) return void 0;
159
+ result = result[k];
160
+ }
161
+ return result;
162
+ }
163
+ function compareValues(a, b, locale) {
164
+ if (a === b) return 0;
165
+ if (/* @__PURE__ */ isNullOrUndefined(a)) return 1;
166
+ if (/* @__PURE__ */ isNullOrUndefined(b)) return -1;
167
+ if (/* @__PURE__ */ isString(a) && /* @__PURE__ */ isString(b)) return a.localeCompare(b, locale);
168
+ if (/* @__PURE__ */ isNumber(a) && /* @__PURE__ */ isNumber(b)) {
169
+ if (/* @__PURE__ */ isNaN(a)) return 1;
170
+ if (/* @__PURE__ */ isNaN(b)) return -1;
171
+ return a - b;
172
+ }
173
+ return String(a).localeCompare(String(b), locale);
174
+ }
175
+ var DataTableAdapter = class {
176
+ /** Create the filter pipeline stage */
177
+ filter(context) {
178
+ const filter = createFilter(Object.keys(context.customColumnFilters).length > 0 && !context.filterOptions.customFilter ? {
179
+ ...context.filterOptions,
180
+ keys: [...context.filterableKeys],
181
+ customFilter: (query, item) => {
182
+ if (!/* @__PURE__ */ isObject(item)) return false;
183
+ const q = String(Array.isArray(query) ? query[0] : query).toLowerCase();
184
+ if (!q) return true;
185
+ const obj = item;
186
+ for (const key of context.filterableKeys) {
187
+ const customFn = context.customColumnFilters[key];
188
+ if (customFn) {
189
+ if (customFn(obj[key], q)) return true;
190
+ } else {
191
+ const val = obj[key];
192
+ if (!/* @__PURE__ */ isNullOrUndefined(val) && String(val).toLowerCase().includes(q)) return true;
193
+ }
194
+ }
195
+ return false;
196
+ }
197
+ } : {
198
+ ...context.filterOptions,
199
+ keys: [...context.filterableKeys]
200
+ });
201
+ const allItems = toRef(() => toValue(context.items));
202
+ const { items: filteredItems } = filter.apply(context.search, allItems);
203
+ return {
204
+ allItems,
205
+ filteredItems
206
+ };
207
+ }
208
+ /** Create the sort pipeline stage */
209
+ sort(filteredItems, sortBy, locale, customSorts) {
210
+ return computed(() => {
211
+ const entries = sortBy.value;
212
+ if (entries.length === 0) return filteredItems.value;
213
+ const loc = locale?.value;
214
+ return filteredItems.value.toSorted((a, b) => {
215
+ for (const { key, direction } of entries) {
216
+ const aVal = getNestedValue(a, key);
217
+ const bVal = getNestedValue(b, key);
218
+ const customSort = customSorts?.[key];
219
+ const cmp = customSort ? customSort(aVal, bVal) : compareValues(aVal, bVal, loc);
220
+ if (cmp !== 0) return direction === "desc" ? -cmp : cmp;
221
+ }
222
+ return 0;
223
+ });
224
+ });
225
+ }
226
+ };
227
+
228
+ //#endregion
229
+ export { useFilter as i, createFilter as n, createFilterContext as r, DataTableAdapter as t };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };