@vuetify/v0 0.0.9 → 0.0.10
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.
- package/dist/browser/index.js +1497 -466
- package/dist/components/index.d.mts +4 -0
- package/dist/components/index.mjs +7 -0
- package/dist/components-DFGu8N2g.mjs +947 -0
- package/dist/composables/index.d.mts +4 -0
- package/dist/composables/{index.js → index.mjs} +3 -3
- package/dist/{composables-DTW0WfTC.js → composables-TCjvMHyU.mjs} +590 -162
- package/dist/constants/{index.d.ts → index.d.mts} +1 -1
- package/dist/constants/{index.js → index.mjs} +3 -3
- package/dist/{globals-Cfd1Dr_o.js → globals-y0mJ6Eg7.mjs} +2 -2
- package/dist/{index-DWx3x9vE.d.ts → index-CQjOW_w5.d.mts} +101 -846
- package/dist/{index-DIX3zaZG.d.ts → index-CSdGoUCI.d.mts} +3 -2
- package/dist/index-CUnI4hGb.d.mts +815 -0
- package/dist/index-D-EP6KrS.d.mts +812 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.mjs +8 -0
- package/dist/types/{index.d.ts → index.d.mts} +1 -1
- package/dist/utilities/index.d.mts +3 -0
- package/dist/utilities/index.mjs +3 -0
- package/dist/{utilities-rsKHgU2m.js → utilities-C26nB74O.mjs} +5 -1
- package/package.json +5 -5
- package/dist/components/index.d.ts +0 -4
- package/dist/components/index.js +0 -7
- package/dist/components-BfI4Pf1x.js +0 -350
- package/dist/composables/index.d.ts +0 -3
- package/dist/index-TlH7dtTg.d.ts +0 -241
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -8
- package/dist/utilities/index.d.ts +0 -3
- package/dist/utilities/index.js +0 -3
- /package/dist/{constants-De5c3_aB.js → constants-Xfszzyok.mjs} +0 -0
- /package/dist/{htmlElements-lF7PGahL.js → htmlElements-BYo-fMlZ.mjs} +0 -0
- /package/dist/{index-BKc0YiL1.d.ts → index-8AIxAM2d.d.mts} +0 -0
- /package/dist/{index-C_lAPFXS.d.ts → index-DY7-T630.d.mts} +0 -0
- /package/dist/types/{index.js → index.mjs} +0 -0
|
@@ -1,82 +1,10 @@
|
|
|
1
|
-
import { a as MaybeArray, i as ID } from "./index-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { a as MaybeArray, i as ID } from "./index-DY7-T630.mjs";
|
|
2
|
+
import { a as SelectionContext, c as SelectionTicket, f as RegistryContext, h as RegistryTicket, m as RegistryOptions, o as SelectionContextOptions, p as RegistryContextOptions, s as SelectionOptions, t as ContextKey, v as ContextTrinity } from "./index-D-EP6KrS.mjs";
|
|
3
|
+
import * as vue231 from "vue";
|
|
4
|
+
import { App, ComputedRef, MaybeRef, MaybeRefOrGetter, Ref, ShallowRef, UnwrapNestedRefs } from "vue";
|
|
4
5
|
|
|
5
|
-
//#region src/composables/createContext/index.d.ts
|
|
6
|
-
|
|
7
|
-
type ContextKey<Z> = InjectionKey<Z> | string;
|
|
8
|
-
/**
|
|
9
|
-
* Injects a context provided by an ancestor component.
|
|
10
|
-
*
|
|
11
|
-
* @param key The key of the context to inject.
|
|
12
|
-
* @param defaultValue Optional default value if context is not found.
|
|
13
|
-
* @template Z The type of the context.
|
|
14
|
-
* @returns The injected context.
|
|
15
|
-
* @throws An error if the context is not found and no default is provided.
|
|
16
|
-
*
|
|
17
|
-
* @see https://vuejs.org/api/composition-api-dependency-injection.html#inject
|
|
18
|
-
* @see https://0.vuetifyjs.com/composables/foundation/create-context#use-context
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* // Without default value
|
|
23
|
-
* const context = useContext<MyContext>('my-context')
|
|
24
|
-
*
|
|
25
|
-
* // With default value
|
|
26
|
-
* const context = useContext<MyContext>('my-context', defaultContext)
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare function useContext<Z>(key: ContextKey<Z>, defaultValue?: Z): Z & ({} | null);
|
|
30
|
-
/**
|
|
31
|
-
* Provides a context to all descendant components.
|
|
32
|
-
*
|
|
33
|
-
* @param key The key of the context to provide.
|
|
34
|
-
* @param context The context to provide.
|
|
35
|
-
* @param app Optional Vue app instance to provide the context at app level instead of component level.
|
|
36
|
-
* @template Z The type of the context.
|
|
37
|
-
* @returns The provided context.
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* When `app` parameter is provided, the context is made available to all components in the app.
|
|
41
|
-
* When omitted, the context is provided at the current component level and available to descendants only.
|
|
42
|
-
*
|
|
43
|
-
* @see https://vuejs.org/api/composition-api-dependency-injection.html#provide
|
|
44
|
-
* @see https://0.vuetifyjs.com/composables/foundation/create-context#provide-context
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```ts
|
|
48
|
-
* // Component-level provision
|
|
49
|
-
* provideContext<MyContext>('my-context', context)
|
|
50
|
-
*
|
|
51
|
-
* // App-level provision (typically used in plugins)
|
|
52
|
-
* const app = createApp()
|
|
53
|
-
* provideContext<MyContext>('my-context', context, app)
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
declare function provideContext<Z>(key: ContextKey<Z>, context: Z, app?: App): Z;
|
|
57
|
-
/**
|
|
58
|
-
* Creates a new context for providing and injecting data.
|
|
59
|
-
*
|
|
60
|
-
* @param key The key of the context to create.
|
|
61
|
-
* @param defaultValue Optional default value if context is not found.
|
|
62
|
-
* @template Z The type of the context.
|
|
63
|
-
* @returns A tuple containing the `useContext` and `provideContext` functions.
|
|
64
|
-
*
|
|
65
|
-
* @see https://vuejs.org/api/composition-api-dependency-injection.html
|
|
66
|
-
* @see https://0.vuetifyjs.com/composables/foundation/create-context#create-context
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```ts
|
|
70
|
-
* // Without default value
|
|
71
|
-
* const [useMyContext, provideMyContext] = createContext<MyContext>('my-context')
|
|
72
|
-
*
|
|
73
|
-
* // With default value
|
|
74
|
-
* const [useMyContext, provideMyContext] = createContext<MyContext>('my-context', defaultContext)
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
declare function createContext<Z>(_key: ContextKey<Z>, defaultValue?: Z): readonly [(key?: ContextKey<Z>) => Z & ({} | null), (context: Z, app?: App) => Z];
|
|
78
|
-
//#endregion
|
|
79
6
|
//#region src/composables/createPlugin/index.d.ts
|
|
7
|
+
|
|
80
8
|
interface PluginOptions {
|
|
81
9
|
namespace: string;
|
|
82
10
|
provide: (app: App) => void;
|
|
@@ -111,49 +39,6 @@ interface Plugin {
|
|
|
111
39
|
*/
|
|
112
40
|
declare function createPlugin<Z extends Plugin = Plugin>(options: PluginOptions): Z;
|
|
113
41
|
//#endregion
|
|
114
|
-
//#region src/composables/createTrinity/index.d.ts
|
|
115
|
-
type ContextTrinity<Z = unknown> = readonly [() => Z, (context?: Z, app?: App) => Z, Z];
|
|
116
|
-
/**
|
|
117
|
-
* Creates a new trinity for a context composable and its provider.
|
|
118
|
-
*
|
|
119
|
-
* @param createContext The function that retrieves/uses the context (typically named `useContext`).
|
|
120
|
-
* @param provideContext The function that provides the context to descendants.
|
|
121
|
-
* @param context The default context instance to use when no custom context is provided.
|
|
122
|
-
* @template Z The type of the context.
|
|
123
|
-
* @returns A readonly tuple containing: [useContext function, provideContext wrapper function, default context instance].
|
|
124
|
-
*
|
|
125
|
-
* @remarks The trinity pattern is a foundational pattern used throughout the codebase for creating reusable context systems. It provides three related elements:
|
|
126
|
-
*
|
|
127
|
-
* 1. A function to retrieve/use the context
|
|
128
|
-
* 2. A function to provide the context (with default value support)
|
|
129
|
-
* 3. The default context instance
|
|
130
|
-
*
|
|
131
|
-
* The returned tuple is readonly (using `as const`) to ensure proper type inference.
|
|
132
|
-
*
|
|
133
|
-
* @see https://0.vuetifyjs.com/composables/foundation/create-trinity#create-trinity
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* ```ts
|
|
137
|
-
* interface MyContext {
|
|
138
|
-
* foo: string
|
|
139
|
-
* bar: number
|
|
140
|
-
* }
|
|
141
|
-
*
|
|
142
|
-
* export function createMyFeature<E extends MyContext = MyContext>() {
|
|
143
|
-
* const [useContext, _provideContext] = createContext<E>('my-context')
|
|
144
|
-
*
|
|
145
|
-
* const context = { foo: 'hello', bar: 42 }
|
|
146
|
-
*
|
|
147
|
-
* function provideContext (_context: E = context, app?: App): E {
|
|
148
|
-
* return _provideContext(_context, app)
|
|
149
|
-
* }
|
|
150
|
-
*
|
|
151
|
-
* return createTrinity<E>(useContext, provideContext, context)
|
|
152
|
-
* }
|
|
153
|
-
* ```
|
|
154
|
-
*/
|
|
155
|
-
declare function createTrinity<Z = unknown>(createContext: () => Z, provideContext: (_context?: Z, app?: App) => Z, context: Z): ContextTrinity<Z>;
|
|
156
|
-
//#endregion
|
|
157
42
|
//#region src/composables/toArray/index.d.ts
|
|
158
43
|
/**
|
|
159
44
|
* @module toArray
|
|
@@ -432,686 +317,6 @@ declare function useWindowEventListener<E extends keyof WindowEventMap>(event: M
|
|
|
432
317
|
*/
|
|
433
318
|
declare function useDocumentEventListener<E extends keyof DocumentEventMap>(event: MaybeRefOrGetter<MaybeArray<E>>, listener: MaybeRef<MaybeArray<(this: Document, event: DocumentEventMap[E]) => any>>, options?: MaybeRefOrGetter<boolean | AddEventListenerOptions>): CleanupFunction;
|
|
434
319
|
//#endregion
|
|
435
|
-
//#region src/composables/useRegistry/index.d.ts
|
|
436
|
-
interface RegistryTicket {
|
|
437
|
-
/** The unique identifier. Is randomly generated if not provided. */
|
|
438
|
-
id: ID;
|
|
439
|
-
/**
|
|
440
|
-
* The index of the ticket in the registry.
|
|
441
|
-
*
|
|
442
|
-
* @remarks Automatically managed by the registry. Updated during reindexing. It's not recommended to manually set this.
|
|
443
|
-
*/
|
|
444
|
-
index: number;
|
|
445
|
-
/** The value associated with the ticket. If not provided, it defaults to the index. */
|
|
446
|
-
value: unknown;
|
|
447
|
-
/**
|
|
448
|
-
* Whether the value is derived from index.
|
|
449
|
-
*
|
|
450
|
-
* @remarks Set to true when no explicit value is provided during registration. It's not recommended to manually set this.
|
|
451
|
-
*/
|
|
452
|
-
valueIsIndex: boolean;
|
|
453
|
-
}
|
|
454
|
-
interface RegistryContext<Z extends RegistryTicket = RegistryTicket> {
|
|
455
|
-
/**
|
|
456
|
-
* The collection of tickets in the registry
|
|
457
|
-
*
|
|
458
|
-
* @template ID The type of the ticket ID.
|
|
459
|
-
* @template Z The type of the registry ticket.
|
|
460
|
-
*
|
|
461
|
-
* @remarks Exposed for read-only access and advanced use cases. **Warning:** Direct mutation may cause inconsistencies in indexes, catalogs, and caches. Always prefer using the provided methods (`register`, `unregister`, etc.) to maintain internal consistency.
|
|
462
|
-
*/
|
|
463
|
-
collection: Map<ID, Z>;
|
|
464
|
-
/**
|
|
465
|
-
* Clear the entire registry
|
|
466
|
-
*
|
|
467
|
-
* @remarks Removes all tickets from the registry. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
|
|
468
|
-
*
|
|
469
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#clear
|
|
470
|
-
*
|
|
471
|
-
* @example
|
|
472
|
-
* ```ts
|
|
473
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
474
|
-
*
|
|
475
|
-
* const registry = useRegistry()
|
|
476
|
-
*
|
|
477
|
-
* registry.register({ id: 'ticket-1' })
|
|
478
|
-
* registry.register({ id: 'ticket-2' })
|
|
479
|
-
*
|
|
480
|
-
* console.log(registry.size) // 2
|
|
481
|
-
*
|
|
482
|
-
* registry.clear()
|
|
483
|
-
*
|
|
484
|
-
* console.log(registry.size) // 0
|
|
485
|
-
* ```
|
|
486
|
-
*/
|
|
487
|
-
clear: () => void;
|
|
488
|
-
/**
|
|
489
|
-
* Check if a ticket exists by ID
|
|
490
|
-
*
|
|
491
|
-
* @param id The ID of the ticket to check.
|
|
492
|
-
* @remarks Calls `collection.has` internally.
|
|
493
|
-
*
|
|
494
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#has
|
|
495
|
-
*
|
|
496
|
-
* @example
|
|
497
|
-
* ```ts
|
|
498
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
499
|
-
*
|
|
500
|
-
* const registry = useRegistry()
|
|
501
|
-
*
|
|
502
|
-
* registry.register({ id: 'ticket-id' })
|
|
503
|
-
*
|
|
504
|
-
* const exists = registry.has('ticket-id') // true
|
|
505
|
-
* ```
|
|
506
|
-
*/
|
|
507
|
-
has: (id: ID) => boolean;
|
|
508
|
-
/**
|
|
509
|
-
* Get all registered IDs
|
|
510
|
-
*
|
|
511
|
-
* @remarks Calls `collection.keys` internally with caching. First call is O(n), subsequent calls are O(1) until cache invalidation.
|
|
512
|
-
*
|
|
513
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#keys
|
|
514
|
-
*
|
|
515
|
-
* @example
|
|
516
|
-
* ```ts
|
|
517
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
518
|
-
*
|
|
519
|
-
* const registry = useRegistry()
|
|
520
|
-
*
|
|
521
|
-
* registry.register({ id: 'ticket-1' })
|
|
522
|
-
* registry.register({ id: 'ticket-2' })
|
|
523
|
-
*
|
|
524
|
-
* const ids = registry.keys() // ['ticket-1', 'ticket-2']
|
|
525
|
-
* ```
|
|
526
|
-
*/
|
|
527
|
-
keys: () => ID[];
|
|
528
|
-
/**
|
|
529
|
-
* Browse for an ID(s) by value
|
|
530
|
-
*
|
|
531
|
-
* @param value The value to browse for.
|
|
532
|
-
* @remarks Returns a single ID or an array of IDs if multiple tickets share the same value.
|
|
533
|
-
*
|
|
534
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#browse
|
|
535
|
-
*
|
|
536
|
-
* @example
|
|
537
|
-
* ```ts
|
|
538
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
539
|
-
*
|
|
540
|
-
* const registry = useRegistry()
|
|
541
|
-
*
|
|
542
|
-
* registry.register({ id: 'ticket-1', value: 'common-value' })
|
|
543
|
-
* registry.register({ id: 'ticket-2', value: 'common-value' })
|
|
544
|
-
* registry.register({ id: 'ticket-3', value: 'unique-value' })
|
|
545
|
-
*
|
|
546
|
-
* const common = registry.browse('common-value') // ['ticket-1', 'ticket-2']
|
|
547
|
-
* const unique = registry.browse('unique-value') // 'ticket-3'
|
|
548
|
-
* ```
|
|
549
|
-
*/
|
|
550
|
-
browse: (value: unknown) => ID | ID[] | undefined;
|
|
551
|
-
/**
|
|
552
|
-
* lookup a ticket by index number
|
|
553
|
-
*
|
|
554
|
-
* @param index The index number to lookup.
|
|
555
|
-
* @remarks Maps do not support indexing by default, this method provides a way to retrieve an ID based on its index in the registry.
|
|
556
|
-
*
|
|
557
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#lookup
|
|
558
|
-
*
|
|
559
|
-
* @example
|
|
560
|
-
* ```ts
|
|
561
|
-
* const registry = useRegistry()
|
|
562
|
-
*
|
|
563
|
-
* registry.register({ id: 'ticket-1' })
|
|
564
|
-
* registry.register({ id: 'ticket-2' })
|
|
565
|
-
*
|
|
566
|
-
* const ticket1 = registry.lookup(0) // 'ticket-1'
|
|
567
|
-
* const ticket2 = registry.lookup(1) // 'ticket-2'
|
|
568
|
-
* ```
|
|
569
|
-
*/
|
|
570
|
-
lookup: (index: number) => ID | undefined;
|
|
571
|
-
/**
|
|
572
|
-
* Get a ticket by ID
|
|
573
|
-
*
|
|
574
|
-
* @param id The ID of the ticket to retrieve.
|
|
575
|
-
* @remarks Calls `collection.get` internally.
|
|
576
|
-
*
|
|
577
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#get
|
|
578
|
-
*
|
|
579
|
-
* @example
|
|
580
|
-
* ```ts
|
|
581
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
582
|
-
*
|
|
583
|
-
* const registry = useRegistry()
|
|
584
|
-
*
|
|
585
|
-
* registry.register({ id: 'ticket-id', value: 'some-value' })
|
|
586
|
-
*
|
|
587
|
-
* const ticket = registry.get('ticket-id') // { id: 'ticket-id', index: 0, value: 'some-value', ... }
|
|
588
|
-
* ```
|
|
589
|
-
*/
|
|
590
|
-
get: (id: ID) => Z | undefined;
|
|
591
|
-
/**
|
|
592
|
-
* Update or insert a ticket by ID
|
|
593
|
-
*
|
|
594
|
-
* @param id The ID of the ticket to upsert.
|
|
595
|
-
* @param ticket The partial ticket data to update or insert.
|
|
596
|
-
* @remarks If the ticket exists, it will be updated with the provided data. If it doesn't exist, a new ticket will be created with the given ID and data. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
|
|
597
|
-
*
|
|
598
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#upsert
|
|
599
|
-
*
|
|
600
|
-
* @example
|
|
601
|
-
* ```ts
|
|
602
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
603
|
-
*
|
|
604
|
-
* const registry = useRegistry()
|
|
605
|
-
*
|
|
606
|
-
* // Insert a new ticket
|
|
607
|
-
* const ticket = registry.upsert('ticket-id', { value: 'initial-value' })
|
|
608
|
-
*
|
|
609
|
-
* // Update the existing ticket
|
|
610
|
-
* const patched = registry.upsert('ticket-id', { value: 'updated-value' })
|
|
611
|
-
* ```
|
|
612
|
-
*/
|
|
613
|
-
upsert: (id: ID, ticket?: Partial<Z>) => Z;
|
|
614
|
-
/**
|
|
615
|
-
* Get all values of registered tickets
|
|
616
|
-
*
|
|
617
|
-
* @remarks Calls `collection.values` internally with caching. First call is O(n), subsequent calls are O(1) until cache invalidation.
|
|
618
|
-
*
|
|
619
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#values
|
|
620
|
-
*
|
|
621
|
-
* @example
|
|
622
|
-
* ```ts
|
|
623
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
624
|
-
*
|
|
625
|
-
* const registry = useRegistry()
|
|
626
|
-
*
|
|
627
|
-
* registry.register({ id: 'ticket-1', value: 'value-1' })
|
|
628
|
-
* registry.register({ id: 'ticket-2', value: 'value-2' })
|
|
629
|
-
*
|
|
630
|
-
* const values = registry.values() // [{ id: 'ticket-1', ... }, { id: 'ticket-2', ... }]
|
|
631
|
-
* ```
|
|
632
|
-
*/
|
|
633
|
-
values: () => Z[];
|
|
634
|
-
/**
|
|
635
|
-
* Get all entries of registered tickets
|
|
636
|
-
*
|
|
637
|
-
* @remarks Calls `collection.entries` internally with caching. First call is O(n), subsequent calls are O(1) until cache invalidation.
|
|
638
|
-
*
|
|
639
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#entries
|
|
640
|
-
*
|
|
641
|
-
* @example
|
|
642
|
-
* ```ts
|
|
643
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
644
|
-
*
|
|
645
|
-
* const registry = useRegistry()
|
|
646
|
-
*
|
|
647
|
-
* registry.register({ id: 'ticket-1', value: 'value-1' })
|
|
648
|
-
* registry.register({ id: 'ticket-2', value: 'value-2' })
|
|
649
|
-
*
|
|
650
|
-
* const entries = registry.entries() // [['ticket-1', { id: 'ticket-1', ... }], ['ticket-2', { id: 'ticket-2', ... }]]
|
|
651
|
-
* ```
|
|
652
|
-
*/
|
|
653
|
-
entries: () => [ID, Z][];
|
|
654
|
-
/**
|
|
655
|
-
* Register a new ticket
|
|
656
|
-
*
|
|
657
|
-
* @param ticket The partial ticket data to register.
|
|
658
|
-
* @remarks If no ID is provided, a unique ID will be generated automatically. If no value is provided, it defaults to the ticket's index. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
|
|
659
|
-
*
|
|
660
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#register
|
|
661
|
-
*
|
|
662
|
-
* @example
|
|
663
|
-
* ```ts
|
|
664
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
665
|
-
*
|
|
666
|
-
* const registry = useRegistry()
|
|
667
|
-
*
|
|
668
|
-
* const ticket = registry.register()
|
|
669
|
-
*
|
|
670
|
-
* console.log(ticket) // { id: 'generated-id', index: 0, value: 0, valueIsIndex: true }
|
|
671
|
-
* ```
|
|
672
|
-
*/
|
|
673
|
-
register: (ticket?: Partial<Z>) => Z;
|
|
674
|
-
/**
|
|
675
|
-
* Unregister an ticket by ID
|
|
676
|
-
*
|
|
677
|
-
* @param id The ID of the ticket to unregister.
|
|
678
|
-
* @remarks Removes the ticket from the registry and reindexes the remaining tickets. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
|
|
679
|
-
*
|
|
680
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#unregister
|
|
681
|
-
*
|
|
682
|
-
* @example
|
|
683
|
-
* ```ts
|
|
684
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
685
|
-
*
|
|
686
|
-
* const registry = useRegistry()
|
|
687
|
-
*
|
|
688
|
-
* registry.register({ id: 'ticket-id' })
|
|
689
|
-
*
|
|
690
|
-
* registry.unregister('ticket-id')
|
|
691
|
-
* ```
|
|
692
|
-
*/
|
|
693
|
-
unregister: (id: ID) => void;
|
|
694
|
-
/**
|
|
695
|
-
* Reset the index directory and update all tickets
|
|
696
|
-
*
|
|
697
|
-
* @remarks Rebuilds the internal index mapping and ensures all tickets have correct index values. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
|
|
698
|
-
*
|
|
699
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#reindex
|
|
700
|
-
*
|
|
701
|
-
* @example
|
|
702
|
-
* ```ts
|
|
703
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
704
|
-
*
|
|
705
|
-
* const registry = useRegistry()
|
|
706
|
-
*
|
|
707
|
-
* registry.register({ id: 'ticket-1' })
|
|
708
|
-
* registry.register({ id: 'ticket-2' })
|
|
709
|
-
*
|
|
710
|
-
* // After some operations that may affect indexing
|
|
711
|
-
* registry.reindex()
|
|
712
|
-
* ```
|
|
713
|
-
*/
|
|
714
|
-
reindex: () => void;
|
|
715
|
-
/**
|
|
716
|
-
* Seek for a ticket based on direction and optional predicate
|
|
717
|
-
*
|
|
718
|
-
* @param direction The direction to seek ('first' or 'last'). Defaults to 'first'.
|
|
719
|
-
* @param from The index to start seeking from. Defaults to the beginning or end based on direction.
|
|
720
|
-
* @param predicate An optional function to test each ticket. The first ticket that satisfies the predicate will be returned.
|
|
721
|
-
* @remarks This method allows for flexible searching within the registry, either from the start or end, and can filter tickets based on custom criteria.
|
|
722
|
-
*
|
|
723
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#seek
|
|
724
|
-
*
|
|
725
|
-
* @example
|
|
726
|
-
* ```ts
|
|
727
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
728
|
-
*
|
|
729
|
-
* const registry = useRegistry()
|
|
730
|
-
*
|
|
731
|
-
* registry.register({ id: 'ticket-1', value: 'apple' })
|
|
732
|
-
* registry.register({ id: 'ticket-2', value: 'banana' })
|
|
733
|
-
* registry.register({ id: 'ticket-3', value: 'cherry' })
|
|
734
|
-
*
|
|
735
|
-
* // Seek the first ticket
|
|
736
|
-
* const first = registry.seek('first')
|
|
737
|
-
*
|
|
738
|
-
* // Seek the last ticket
|
|
739
|
-
* const last = registry.seek('last')
|
|
740
|
-
*
|
|
741
|
-
* // Seek the first ticket with value 'banana'
|
|
742
|
-
* const banana = registry.seek('first', undefined, ticket => ticket.value === 'banana')
|
|
743
|
-
*
|
|
744
|
-
* // Seek from index 1 to find the next ticket with value starting with 'c'
|
|
745
|
-
* const cherry = registry.seek('first', 1, ticket => (ticket.value as string).startsWith('c'))
|
|
746
|
-
* ```
|
|
747
|
-
*/
|
|
748
|
-
seek: (direction?: 'first' | 'last', from?: number, predicate?: (ticket: Z) => boolean) => Z | undefined;
|
|
749
|
-
/**
|
|
750
|
-
* Listen for registry events
|
|
751
|
-
*
|
|
752
|
-
* @param event The name of the event to listen for.
|
|
753
|
-
* @param cb The callback function to invoke when the event is emitted.
|
|
754
|
-
* @remarks Must be enabled via the `events` option when creating the registry.
|
|
755
|
-
* Supported events:
|
|
756
|
-
* - `register:ticket` - Emitted when a ticket is registered, receives the ticket as argument
|
|
757
|
-
* - `unregister:ticket` - Emitted when a ticket is unregistered, receives the ticket as argument
|
|
758
|
-
* - `update:ticket` - Emitted when a ticket is updated, receives the updated ticket as argument
|
|
759
|
-
* - `clear:registry` - Emitted when the registry is cleared
|
|
760
|
-
*
|
|
761
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#on
|
|
762
|
-
*
|
|
763
|
-
* @example
|
|
764
|
-
* ```ts
|
|
765
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
766
|
-
*
|
|
767
|
-
* const registry = useRegistry({ events: true })
|
|
768
|
-
*
|
|
769
|
-
* registry.on('register:ticket', (ticket) => {
|
|
770
|
-
* console.log('Ticket registered:', ticket)
|
|
771
|
-
* })
|
|
772
|
-
*
|
|
773
|
-
* registry.register({ id: 'ticket-id' }) // Console: Ticket registered: { id: 'ticket-id', ... }
|
|
774
|
-
* ```
|
|
775
|
-
*/
|
|
776
|
-
on: (event: string, cb: Function) => void;
|
|
777
|
-
/**
|
|
778
|
-
* Stop listening for registry events
|
|
779
|
-
*
|
|
780
|
-
* @param event The name of the event to stop listening for.
|
|
781
|
-
* @param cb The callback function to remove.
|
|
782
|
-
* @remarks Must be enabled via the `events` option when creating the registry.
|
|
783
|
-
*
|
|
784
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#off
|
|
785
|
-
*
|
|
786
|
-
* @example
|
|
787
|
-
* ```ts
|
|
788
|
-
* import { onScopeDispose } from 'vue'
|
|
789
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
790
|
-
*
|
|
791
|
-
* const registry = useRegistry({ events: true })
|
|
792
|
-
*
|
|
793
|
-
* function onRegister(ticket) {
|
|
794
|
-
* console.log('Ticket registered:', ticket)
|
|
795
|
-
* }
|
|
796
|
-
*
|
|
797
|
-
* registry.on('register:ticket', onRegister)
|
|
798
|
-
*
|
|
799
|
-
* registry.register({ id: 'ticket-id' }) // Console: Ticket registered: { id: 'ticket-id', ... }
|
|
800
|
-
*
|
|
801
|
-
* onScopeDispose(() => {
|
|
802
|
-
* registry.off('register:ticket', onRegister)
|
|
803
|
-
* })
|
|
804
|
-
* ```
|
|
805
|
-
*/
|
|
806
|
-
off: (event: string, cb: Function) => void;
|
|
807
|
-
/**
|
|
808
|
-
* Emit an event with data
|
|
809
|
-
*
|
|
810
|
-
* @param event The name of the event to emit.
|
|
811
|
-
* @param data The data to pass to event listeners.
|
|
812
|
-
* @remarks Must be enabled via the `events` option when creating the registry.
|
|
813
|
-
*
|
|
814
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#emit
|
|
815
|
-
*
|
|
816
|
-
* @example
|
|
817
|
-
* ```ts
|
|
818
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
819
|
-
*
|
|
820
|
-
* const registry = useRegistry({ events: true })
|
|
821
|
-
*
|
|
822
|
-
* registry.on('custom-event', (data) => {
|
|
823
|
-
* console.log('Custom event received:', data)
|
|
824
|
-
* })
|
|
825
|
-
*
|
|
826
|
-
* registry.emit('custom-event', { message: 'Hello, World!' }) // Console: Custom event received: { message: 'Hello, World!' }
|
|
827
|
-
* ```
|
|
828
|
-
*/
|
|
829
|
-
emit: (event: string, data: unknown) => void;
|
|
830
|
-
/**
|
|
831
|
-
* Clears the registry and removes all listeners
|
|
832
|
-
*
|
|
833
|
-
* @remarks Disposes of the registry by clearing all tickets and removing all event listeners.
|
|
834
|
-
*
|
|
835
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#dispose
|
|
836
|
-
*
|
|
837
|
-
* @example
|
|
838
|
-
* ```ts
|
|
839
|
-
* import { onScopeDispose } from 'vue'
|
|
840
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
841
|
-
*
|
|
842
|
-
* const registry = useRegistry({ events: true })
|
|
843
|
-
*
|
|
844
|
-
* registry.register({ id: 'ticket-id' })
|
|
845
|
-
*
|
|
846
|
-
* onScopeDispose(() => {
|
|
847
|
-
* registry.dispose()
|
|
848
|
-
* })
|
|
849
|
-
* ```
|
|
850
|
-
*/
|
|
851
|
-
dispose: () => void;
|
|
852
|
-
/**
|
|
853
|
-
* Onboard multiple tickets at once
|
|
854
|
-
*
|
|
855
|
-
* @param registrations An array of partial ticket data to register.
|
|
856
|
-
* @remarks Registers multiple tickets in a single operation and returns the array of registered tickets.
|
|
857
|
-
*
|
|
858
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#onboard
|
|
859
|
-
*
|
|
860
|
-
* @example
|
|
861
|
-
* ```ts
|
|
862
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
863
|
-
*
|
|
864
|
-
* const registry = useRegistry()
|
|
865
|
-
*
|
|
866
|
-
* const tickets = registry.onboard([
|
|
867
|
-
* { id: 'ticket-1', value: 'value-1' },
|
|
868
|
-
* { id: 'ticket-2', value: 'value-2' },
|
|
869
|
-
* ])
|
|
870
|
-
*
|
|
871
|
-
* console.log(tickets) // [{ id: 'ticket-1', ... }, { id: 'ticket-2', ... }]
|
|
872
|
-
* ```
|
|
873
|
-
*/
|
|
874
|
-
onboard: (registrations: Partial<Z>[]) => Z[];
|
|
875
|
-
/**
|
|
876
|
-
* The number of tickets in the registry
|
|
877
|
-
*
|
|
878
|
-
* @remarks Reflects the current size of the internal ticket collection.
|
|
879
|
-
*
|
|
880
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#size
|
|
881
|
-
*
|
|
882
|
-
* @example
|
|
883
|
-
* ```ts
|
|
884
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
885
|
-
*
|
|
886
|
-
* const registry = useRegistry()
|
|
887
|
-
*
|
|
888
|
-
* registry.register({ id: 'ticket-1' })
|
|
889
|
-
* registry.register({ id: 'ticket-2' })
|
|
890
|
-
*
|
|
891
|
-
* console.log(registry.size) // 2
|
|
892
|
-
* ```
|
|
893
|
-
*/
|
|
894
|
-
size: number;
|
|
895
|
-
}
|
|
896
|
-
interface RegistryOptions {
|
|
897
|
-
/**
|
|
898
|
-
* Enable event emission for registry operations
|
|
899
|
-
*
|
|
900
|
-
* @default false
|
|
901
|
-
* @remarks When enabled, the registry will emit events for operations like registration and unregistration. Listeners can be added using the `on` method.
|
|
902
|
-
*
|
|
903
|
-
* @example
|
|
904
|
-
* ```ts
|
|
905
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
906
|
-
*
|
|
907
|
-
* const registry = useRegistry({ events: true })
|
|
908
|
-
*
|
|
909
|
-
* registry.on('register:ticket', (ticket) => {
|
|
910
|
-
* console.log('Ticket registered:', ticket)
|
|
911
|
-
* })
|
|
912
|
-
*
|
|
913
|
-
* registry.register({ id: 'ticket-id' }) // Console: Ticket registered: { id: 'ticket-id', ... }
|
|
914
|
-
* ```
|
|
915
|
-
*/
|
|
916
|
-
events?: boolean;
|
|
917
|
-
}
|
|
918
|
-
interface RegistryContextOptions extends RegistryOptions {
|
|
919
|
-
namespace: string;
|
|
920
|
-
}
|
|
921
|
-
/**
|
|
922
|
-
* Creates a new registry instance.
|
|
923
|
-
*
|
|
924
|
-
* @param options The options for the registry instance.
|
|
925
|
-
* @template Z The type of registry ticket that extends RegistryTicket. Use this to add custom properties to tickets.
|
|
926
|
-
* @template E The type of registry context that extends RegistryContext<Z>. Use this when extending the registry with additional methods.
|
|
927
|
-
* @returns A new registry instance.
|
|
928
|
-
*
|
|
929
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#use-registry
|
|
930
|
-
*
|
|
931
|
-
* @example
|
|
932
|
-
* ```ts
|
|
933
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
934
|
-
*
|
|
935
|
-
* const registry = useRegistry()
|
|
936
|
-
*
|
|
937
|
-
* const ticket1 = registry.register({ id: 'user-1', value: { name: 'John' } })
|
|
938
|
-
* const ticket2 = registry.register({ id: 'user-2', value: { name: 'Jane' } })
|
|
939
|
-
*
|
|
940
|
-
* console.log(registry.size) // 2
|
|
941
|
-
* console.log(registry.get('user-1')) // { id: 'user-1', index: 0, value: { name: 'John' }, ... }
|
|
942
|
-
* ```
|
|
943
|
-
*/
|
|
944
|
-
declare function useRegistry<Z extends RegistryTicket = RegistryTicket, E extends RegistryContext<Z> = RegistryContext<Z>>(options?: RegistryOptions): E;
|
|
945
|
-
/**
|
|
946
|
-
* Creates a new registry context.
|
|
947
|
-
*
|
|
948
|
-
* @param namespace The namespace for the registry context.
|
|
949
|
-
* @param options The options for the registry context.
|
|
950
|
-
* @template Z The type of registry ticket that extends RegistryTicket. Use this to add custom properties to tickets.
|
|
951
|
-
* @template E The type of registry context that extends RegistryContext<Z>. Use this when extending the registry with additional methods.
|
|
952
|
-
* @returns A new registry context.
|
|
953
|
-
*
|
|
954
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#create-registry-context
|
|
955
|
-
*
|
|
956
|
-
* @example
|
|
957
|
-
* ```ts
|
|
958
|
-
* import { createRegistryContext } from '@vuetify/v0'
|
|
959
|
-
*
|
|
960
|
-
* export const [useItems, provideItems, items] = createRegistryContext('items')
|
|
961
|
-
*
|
|
962
|
-
* // In a parent component:
|
|
963
|
-
* provideItems()
|
|
964
|
-
*
|
|
965
|
-
* // In a child component:
|
|
966
|
-
* const items = useItems()
|
|
967
|
-
* items.register({ id: 'item-1', value: 'Value 1' })
|
|
968
|
-
* ```
|
|
969
|
-
*/
|
|
970
|
-
declare function createRegistryContext<Z extends RegistryTicket = RegistryTicket, E extends RegistryContext<Z> = RegistryContext<Z>>(_options: RegistryContextOptions): ContextTrinity<E>;
|
|
971
|
-
//#endregion
|
|
972
|
-
//#region src/composables/useSelection/index.d.ts
|
|
973
|
-
interface SelectionTicket extends RegistryTicket {
|
|
974
|
-
disabled: boolean;
|
|
975
|
-
isSelected: Readonly<Ref<boolean, boolean>>;
|
|
976
|
-
/** Select self */
|
|
977
|
-
select: () => void;
|
|
978
|
-
/** Unselect self */
|
|
979
|
-
unselect: () => void;
|
|
980
|
-
/** Toggle self on and off */
|
|
981
|
-
toggle: () => void;
|
|
982
|
-
}
|
|
983
|
-
interface SelectionContext<Z extends SelectionTicket> extends RegistryContext<Z> {
|
|
984
|
-
selectedIds: Reactive<Set<ID>>;
|
|
985
|
-
selectedItems: ComputedRef<Set<Z>>;
|
|
986
|
-
selectedValues: ComputedRef<Set<unknown>>;
|
|
987
|
-
/** Clear all selected IDs and reindexes */
|
|
988
|
-
reset: () => void;
|
|
989
|
-
/** Select a ticket by ID (Toggle ON) */
|
|
990
|
-
select: (id: ID) => void;
|
|
991
|
-
/** Unselect a ticket by ID (Toggle OFF) */
|
|
992
|
-
unselect: (id: ID) => void;
|
|
993
|
-
/** Toggles a ticket ON and OFF by ID */
|
|
994
|
-
toggle: (id: ID) => void;
|
|
995
|
-
/** Check if a ticket is selected by ID */
|
|
996
|
-
selected: (id: ID) => boolean;
|
|
997
|
-
/** Mandates selected ID based on "mandatory" Option */
|
|
998
|
-
mandate: () => void;
|
|
999
|
-
}
|
|
1000
|
-
interface SelectionOptions extends RegistryOptions {
|
|
1001
|
-
/**
|
|
1002
|
-
* When true, newly registered items are automatically selected if not disabled.
|
|
1003
|
-
* Useful for pre-selecting items in multi-select scenarios.
|
|
1004
|
-
*/
|
|
1005
|
-
enroll?: boolean;
|
|
1006
|
-
/**
|
|
1007
|
-
* Controls mandatory selection behavior:
|
|
1008
|
-
* - `false` (default): No mandatory selection enforcement
|
|
1009
|
-
* - `true`: Prevents deselecting the last selected item (user must always have one selected)
|
|
1010
|
-
* - `'force'`: Automatically selects the first non-disabled item on registration
|
|
1011
|
-
*/
|
|
1012
|
-
mandatory?: boolean | 'force';
|
|
1013
|
-
}
|
|
1014
|
-
interface SelectionContextOptions extends SelectionOptions {
|
|
1015
|
-
namespace: string;
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* Creates a new selection instance for managing multiple selected items.
|
|
1019
|
-
*
|
|
1020
|
-
* Extends `useRegistry` with selection tracking via a reactive `Set` of selected IDs.
|
|
1021
|
-
* Supports disabled items, mandatory selection enforcement, and auto-enrollment.
|
|
1022
|
-
*
|
|
1023
|
-
* @param options The options for the selection instance.
|
|
1024
|
-
* @template Z The type of the selection ticket.
|
|
1025
|
-
* @template E The type of the selection context.
|
|
1026
|
-
* @returns A new selection instance with selection management methods.
|
|
1027
|
-
*
|
|
1028
|
-
* @remarks
|
|
1029
|
-
* **Key Features:**
|
|
1030
|
-
* - Multi-selection support (unlike `useSingle` which enforces single selection)
|
|
1031
|
-
* - Set-based `selectedIds` tracking for efficient lookups
|
|
1032
|
-
* - Computed `selectedItems` and `selectedValues` for reactive access
|
|
1033
|
-
* - Each ticket gets `isSelected`, `select()`, `unselect()`, and `toggle()` methods
|
|
1034
|
-
* - Disabled items cannot be selected
|
|
1035
|
-
* - Mandatory mode prevents deselecting the last item
|
|
1036
|
-
* - Force mode auto-selects first non-disabled item on registration
|
|
1037
|
-
* - Enroll option auto-selects all non-disabled items on registration
|
|
1038
|
-
*
|
|
1039
|
-
* **Inheritance Chain:**
|
|
1040
|
-
* `useRegistry` → `createSelection` → `createSingle`/`createGroup` → `createStep`
|
|
1041
|
-
*
|
|
1042
|
-
* @see https://0.vuetifyjs.com/composables/selection/use-selection
|
|
1043
|
-
*
|
|
1044
|
-
* @example
|
|
1045
|
-
* ```ts
|
|
1046
|
-
* import { createSelection } from '@vuetify/v0'
|
|
1047
|
-
*
|
|
1048
|
-
* const selection = createSelection({ mandatory: true })
|
|
1049
|
-
*
|
|
1050
|
-
* selection.onboard([
|
|
1051
|
-
* { id: 'item-1', value: 'Item 1' },
|
|
1052
|
-
* { id: 'item-2', value: 'Item 2', disabled: true },
|
|
1053
|
-
* { id: 'item-3', value: 'Item 3' },
|
|
1054
|
-
* ])
|
|
1055
|
-
*
|
|
1056
|
-
* selection.select('item-1')
|
|
1057
|
-
* selection.select('item-3')
|
|
1058
|
-
*
|
|
1059
|
-
* console.log(selection.selectedIds) // Set { 'item-1', 'item-3' }
|
|
1060
|
-
* console.log(Array.from(selection.selectedValues.value)) // ['Item 1', 'Item 3']
|
|
1061
|
-
* ```
|
|
1062
|
-
*/
|
|
1063
|
-
declare function createSelection<Z extends SelectionTicket = SelectionTicket, E extends SelectionContext<Z> = SelectionContext<Z>>(options?: SelectionOptions): E;
|
|
1064
|
-
/**
|
|
1065
|
-
* Creates a new selection context.
|
|
1066
|
-
*
|
|
1067
|
-
* @param namespace The namespace for the selection context.
|
|
1068
|
-
* @param options The options for the selection context.
|
|
1069
|
-
* @template Z The type of the selection ticket.
|
|
1070
|
-
* @template E The type of the selection context.
|
|
1071
|
-
* @returns A new selection context.
|
|
1072
|
-
*
|
|
1073
|
-
* @see https://0.vuetifyjs.com/composables/selection/use-selection
|
|
1074
|
-
*
|
|
1075
|
-
* @example
|
|
1076
|
-
* ```ts
|
|
1077
|
-
* import { createSelectionContext } from '@vuetify/v0'
|
|
1078
|
-
*
|
|
1079
|
-
* export const [useCheckboxes, provideCheckboxes, checkboxes] = createSelectionContext('checkboxes')
|
|
1080
|
-
*
|
|
1081
|
-
* // In a parent component:
|
|
1082
|
-
* provideCheckboxes()
|
|
1083
|
-
*
|
|
1084
|
-
* // In a child component:
|
|
1085
|
-
* const checkboxes = useCheckboxes()
|
|
1086
|
-
* checkboxes.select('checkbox-1')
|
|
1087
|
-
* ```
|
|
1088
|
-
*/
|
|
1089
|
-
declare function createSelectionContext<Z extends SelectionTicket = SelectionTicket, E extends SelectionContext<Z> = SelectionContext<Z>>(_options: SelectionContextOptions): ContextTrinity<E>;
|
|
1090
|
-
/**
|
|
1091
|
-
* Returns the current selection instance.
|
|
1092
|
-
*
|
|
1093
|
-
* @param namespace The namespace for the selection context. Defaults to `'v0:selection'`.
|
|
1094
|
-
* @returns The current selection instance.
|
|
1095
|
-
*
|
|
1096
|
-
* @see https://0.vuetifyjs.com/composables/selection/use-selection
|
|
1097
|
-
*
|
|
1098
|
-
* @example
|
|
1099
|
-
* ```vue
|
|
1100
|
-
* <script setup lang="ts">
|
|
1101
|
-
* import { useSelection } from '@vuetify/v0'
|
|
1102
|
-
*
|
|
1103
|
-
* const selection = useSelection()
|
|
1104
|
-
* </script>
|
|
1105
|
-
*
|
|
1106
|
-
* <template>
|
|
1107
|
-
* <div>
|
|
1108
|
-
* <p>Selected: {{ selection.selectedIds.size }}</p>
|
|
1109
|
-
* </div>
|
|
1110
|
-
* </template>
|
|
1111
|
-
* ```
|
|
1112
|
-
*/
|
|
1113
|
-
declare function useSelection<Z extends SelectionTicket = SelectionTicket, E extends SelectionContext<Z> = SelectionContext<Z>>(namespace?: string): E;
|
|
1114
|
-
//#endregion
|
|
1115
320
|
//#region src/composables/useGroup/index.d.ts
|
|
1116
321
|
interface GroupTicket extends SelectionTicket {}
|
|
1117
322
|
interface GroupContext<Z extends GroupTicket> extends SelectionContext<Z> {
|
|
@@ -1182,7 +387,7 @@ interface GroupContextOptions extends SelectionContextOptions {}
|
|
|
1182
387
|
* console.log(checkboxes.selectedIds) // Set { 'option-b', 'option-c' }
|
|
1183
388
|
* ```
|
|
1184
389
|
*/
|
|
1185
|
-
declare function createGroup<Z extends GroupTicket = GroupTicket, E extends GroupContext<Z> = GroupContext<Z>>(
|
|
390
|
+
declare function createGroup<Z extends GroupTicket = GroupTicket, E extends GroupContext<Z> = GroupContext<Z>>(_options?: GroupOptions): E;
|
|
1186
391
|
/**
|
|
1187
392
|
* Creates a new group context.
|
|
1188
393
|
*
|
|
@@ -1968,7 +1173,7 @@ interface SingleContextOptions extends SelectionContextOptions {}
|
|
|
1968
1173
|
* console.log(tabs.selectedIds.size) // 1 (always enforces single selection)
|
|
1969
1174
|
* ```
|
|
1970
1175
|
*/
|
|
1971
|
-
declare function createSingle<Z extends SingleTicket = SingleTicket, E extends SingleContext<Z> = SingleContext<Z>>(
|
|
1176
|
+
declare function createSingle<Z extends SingleTicket = SingleTicket, E extends SingleContext<Z> = SingleContext<Z>>(_options?: SingleOptions): E;
|
|
1972
1177
|
/**
|
|
1973
1178
|
* Creates a new single selection context.
|
|
1974
1179
|
*
|
|
@@ -2514,19 +1719,18 @@ declare function usePermissions<Z extends PermissionTicket = PermissionTicket, E
|
|
|
2514
1719
|
//#endregion
|
|
2515
1720
|
//#region src/composables/useProxyModel/index.d.ts
|
|
2516
1721
|
interface ProxyModelOptions {
|
|
2517
|
-
|
|
2518
|
-
|
|
1722
|
+
multiple?: boolean;
|
|
1723
|
+
transformIn?: (val: unknown) => unknown;
|
|
1724
|
+
transformOut?: (val: unknown) => unknown;
|
|
2519
1725
|
}
|
|
2520
1726
|
/**
|
|
2521
|
-
*
|
|
1727
|
+
* Syncs a ref with a selection registry bidirectionally.
|
|
2522
1728
|
*
|
|
2523
1729
|
* @param registry The selection registry to bind to.
|
|
2524
|
-
* @param
|
|
1730
|
+
* @param model The ref to sync.
|
|
2525
1731
|
* @param options The options for the proxy model.
|
|
2526
|
-
* @param transformIn A function to transform the value before setting it.
|
|
2527
|
-
* @param transformOut A function to transform the value before getting it.
|
|
2528
1732
|
* @template Z The type of the selection ticket.
|
|
2529
|
-
* @returns A
|
|
1733
|
+
* @returns A function to stop the sync.
|
|
2530
1734
|
*
|
|
2531
1735
|
* @see https://0.vuetifyjs.com/composables/forms/use-proxy-model
|
|
2532
1736
|
*
|
|
@@ -2534,16 +1738,17 @@ interface ProxyModelOptions {
|
|
|
2534
1738
|
* ```ts
|
|
2535
1739
|
* import { createSelection, useProxyModel } from '@vuetify/v0'
|
|
2536
1740
|
*
|
|
1741
|
+
* const model = ref()
|
|
2537
1742
|
* const registry = createSelection({ events: true })
|
|
2538
1743
|
* registry.onboard([
|
|
2539
1744
|
* { id: 'item-1', value: 'Item 1' },
|
|
2540
1745
|
* { id: 'item-2', value: 'Item 2' },
|
|
2541
1746
|
* ])
|
|
2542
1747
|
*
|
|
2543
|
-
* const
|
|
1748
|
+
* const stop = useProxyModel(registry, model)
|
|
2544
1749
|
* ```
|
|
2545
1750
|
*/
|
|
2546
|
-
declare function useProxyModel<Z extends SelectionTicket>(registry: SelectionContext<Z>,
|
|
1751
|
+
declare function useProxyModel<Z extends SelectionTicket = SelectionTicket>(registry: SelectionContext<Z>, model: Ref<unknown>, options?: ProxyModelOptions): () => void;
|
|
2547
1752
|
//#endregion
|
|
2548
1753
|
//#region src/composables/useProxyRegistry/index.d.ts
|
|
2549
1754
|
interface ProxyRegistryOptions {
|
|
@@ -2942,8 +2147,8 @@ declare function useResizeObserver(target: Ref<Element | undefined>, callback: (
|
|
|
2942
2147
|
* ```
|
|
2943
2148
|
*/
|
|
2944
2149
|
declare function useElementSize(target: Ref<Element | undefined>): {
|
|
2945
|
-
width:
|
|
2946
|
-
height:
|
|
2150
|
+
width: vue231.ShallowRef<number, number>;
|
|
2151
|
+
height: vue231.ShallowRef<number, number>;
|
|
2947
2152
|
isPaused: Readonly<Ref<boolean, boolean>>;
|
|
2948
2153
|
pause: () => void;
|
|
2949
2154
|
resume: () => void;
|
|
@@ -2964,13 +2169,29 @@ interface StepContext<Z extends StepTicket> extends SingleContext<Z> {
|
|
|
2964
2169
|
/** Step through the collection by a given count */
|
|
2965
2170
|
step: (count: number) => void;
|
|
2966
2171
|
}
|
|
2967
|
-
interface StepOptions extends SingleOptions {
|
|
2968
|
-
|
|
2172
|
+
interface StepOptions extends SingleOptions {
|
|
2173
|
+
/**
|
|
2174
|
+
* Enable circular navigation (wrapping at boundaries).
|
|
2175
|
+
* - true: Navigation wraps around (carousel behavior)
|
|
2176
|
+
* - false: Navigation stops at boundaries (pagination behavior)
|
|
2177
|
+
* @default false
|
|
2178
|
+
*/
|
|
2179
|
+
circular?: boolean;
|
|
2180
|
+
}
|
|
2181
|
+
interface StepContextOptions extends SingleContextOptions {
|
|
2182
|
+
/**
|
|
2183
|
+
* Enable circular navigation (wrapping at boundaries).
|
|
2184
|
+
* - true: Navigation wraps around (carousel behavior)
|
|
2185
|
+
* - false: Navigation stops at boundaries (pagination behavior)
|
|
2186
|
+
* @default false
|
|
2187
|
+
*/
|
|
2188
|
+
circular?: boolean;
|
|
2189
|
+
}
|
|
2969
2190
|
/**
|
|
2970
|
-
* Creates a new step instance with
|
|
2191
|
+
* Creates a new step instance with navigation through items.
|
|
2971
2192
|
*
|
|
2972
2193
|
* Extends `createSingle` with `first()`, `last()`, `next()`, `prev()`, and `step(count)` methods
|
|
2973
|
-
* for sequential navigation.
|
|
2194
|
+
* for sequential navigation. Supports both circular (wrapping) and bounded (stopping at edges) modes.
|
|
2974
2195
|
*
|
|
2975
2196
|
* @param options The options for the step instance.
|
|
2976
2197
|
* @template Z The type of the step ticket.
|
|
@@ -2979,7 +2200,7 @@ interface StepContextOptions extends SingleContextOptions {}
|
|
|
2979
2200
|
*
|
|
2980
2201
|
* @remarks
|
|
2981
2202
|
* **Key Features:**
|
|
2982
|
-
* - **
|
|
2203
|
+
* - **Configurable Navigation**: `circular: true` for wrapping, `false` for bounded (default: false)
|
|
2983
2204
|
* - **Disabled Item Skipping**: Automatically skips disabled items during navigation
|
|
2984
2205
|
* - **Bidirectional**: Forward (`next`, positive `step`) and backward (`prev`, negative `step`)
|
|
2985
2206
|
* - **Safe Edge Cases**: Handles empty registries and all-disabled scenarios gracefully
|
|
@@ -2987,15 +2208,20 @@ interface StepContextOptions extends SingleContextOptions {}
|
|
|
2987
2208
|
* **Navigation Methods:**
|
|
2988
2209
|
* - `first()`: Select first non-disabled item
|
|
2989
2210
|
* - `last()`: Select last non-disabled item
|
|
2990
|
-
* - `next()`: Move to next item (wraps
|
|
2991
|
-
* - `prev()`: Move to previous item (wraps
|
|
2211
|
+
* - `next()`: Move to next item (wraps if circular, stops at end if bounded)
|
|
2212
|
+
* - `prev()`: Move to previous item (wraps if circular, stops at start if bounded)
|
|
2992
2213
|
* - `step(count)`: Move by `count` positions (negative for backward)
|
|
2993
2214
|
*
|
|
2994
|
-
* **
|
|
2995
|
-
* - Uses modulo arithmetic for
|
|
2215
|
+
* **Circular Mode (`circular: true`):**
|
|
2216
|
+
* - Uses modulo arithmetic for wrapping: `((index % length) + length) % length`
|
|
2996
2217
|
* - Works correctly with negative indexes and large step counts
|
|
2997
|
-
* -
|
|
2998
|
-
*
|
|
2218
|
+
* - Perfect for carousels, theme switchers, infinite scrolling
|
|
2219
|
+
*
|
|
2220
|
+
* **Bounded Mode (`circular: false`, default):**
|
|
2221
|
+
* - Navigation stops at boundaries (no wrapping)
|
|
2222
|
+
* - `next()` on last item does nothing
|
|
2223
|
+
* - `prev()` on first item does nothing
|
|
2224
|
+
* - Perfect for pagination, wizards with explicit completion, forms
|
|
2999
2225
|
*
|
|
3000
2226
|
* **Inheritance Chain:**
|
|
3001
2227
|
* `useRegistry` → `createSelection` → `createSingle` → `createStep`
|
|
@@ -3006,26 +2232,30 @@ interface StepContextOptions extends SingleContextOptions {}
|
|
|
3006
2232
|
* ```ts
|
|
3007
2233
|
* import { createStep } from '@vuetify/v0'
|
|
3008
2234
|
*
|
|
3009
|
-
*
|
|
3010
|
-
*
|
|
3011
|
-
*
|
|
3012
|
-
* { id: '
|
|
3013
|
-
* { id: '
|
|
3014
|
-
* { id: '
|
|
3015
|
-
* { id: 'confirm', value: 'Confirmation' },
|
|
2235
|
+
* // Bounded navigation (default) - for pagination
|
|
2236
|
+
* const pagination = createStep({ circular: false })
|
|
2237
|
+
* pagination.onboard([
|
|
2238
|
+
* { id: 'page-1', value: 1 },
|
|
2239
|
+
* { id: 'page-2', value: 2 },
|
|
2240
|
+
* { id: 'page-3', value: 3 },
|
|
3016
2241
|
* ])
|
|
3017
|
-
*
|
|
3018
|
-
*
|
|
3019
|
-
*
|
|
3020
|
-
*
|
|
3021
|
-
*
|
|
3022
|
-
*
|
|
3023
|
-
*
|
|
3024
|
-
*
|
|
3025
|
-
*
|
|
2242
|
+
* pagination.first() // Select page 1
|
|
2243
|
+
* pagination.prev() // Does nothing (already at first)
|
|
2244
|
+
* pagination.next() // Select page 2
|
|
2245
|
+
*
|
|
2246
|
+
* // Circular navigation - for carousels
|
|
2247
|
+
* const carousel = createStep({ circular: true })
|
|
2248
|
+
* carousel.onboard([
|
|
2249
|
+
* { id: 'slide-1', value: 'First' },
|
|
2250
|
+
* { id: 'slide-2', value: 'Second' },
|
|
2251
|
+
* { id: 'slide-3', value: 'Third' },
|
|
2252
|
+
* ])
|
|
2253
|
+
* carousel.first()
|
|
2254
|
+
* carousel.prev() // Wraps to 'slide-3'
|
|
2255
|
+
* carousel.next() // Wraps to 'slide-1'
|
|
3026
2256
|
* ```
|
|
3027
2257
|
*/
|
|
3028
|
-
declare function createStep<Z extends StepTicket = StepTicket, E extends StepContext<Z> = StepContext<Z>>(
|
|
2258
|
+
declare function createStep<Z extends StepTicket = StepTicket, E extends StepContext<Z> = StepContext<Z>>(_options?: StepOptions): E;
|
|
3029
2259
|
/**
|
|
3030
2260
|
* Creates a new step context.
|
|
3031
2261
|
*
|
|
@@ -3217,15 +2447,22 @@ declare function createStoragePlugin<E extends StorageContext = StorageContext>(
|
|
|
3217
2447
|
declare function useStorage<E extends StorageContext = StorageContext>(namespace?: string): E;
|
|
3218
2448
|
//#endregion
|
|
3219
2449
|
//#region src/composables/useTheme/adapters/adapter.d.ts
|
|
2450
|
+
interface ThemeAdapterSetupContext {
|
|
2451
|
+
colors: ComputedRef<Record<string, Colors>>;
|
|
2452
|
+
selectedId: Ref<ID | null | undefined>;
|
|
2453
|
+
isDark: Readonly<Ref<boolean>>;
|
|
2454
|
+
}
|
|
3220
2455
|
interface ThemeAdapterInterface {
|
|
3221
|
-
|
|
2456
|
+
setup: <T extends ThemeAdapterSetupContext>(app: App, context: T, target?: string | HTMLElement | null) => void;
|
|
2457
|
+
update: (colors: Record<string, Colors>, isDark?: boolean) => void;
|
|
3222
2458
|
}
|
|
3223
2459
|
declare abstract class ThemeAdapter implements ThemeAdapterInterface {
|
|
3224
2460
|
stylesheetId: string;
|
|
3225
2461
|
prefix: string;
|
|
3226
2462
|
constructor(prefix: string);
|
|
3227
|
-
generate(colors: Record<string, Colors
|
|
3228
|
-
abstract
|
|
2463
|
+
generate(colors: Record<string, Colors>, isDark?: boolean): string;
|
|
2464
|
+
abstract setup<T extends ThemeAdapterSetupContext>(app: App, context: T, target?: string | HTMLElement | null): void;
|
|
2465
|
+
abstract update(colors: Record<string, Colors>, isDark?: boolean): void;
|
|
3229
2466
|
}
|
|
3230
2467
|
//#endregion
|
|
3231
2468
|
//#region src/composables/useTheme/adapters/v0.d.ts
|
|
@@ -3242,7 +2479,8 @@ interface Vuetify0ThemeOptions {
|
|
|
3242
2479
|
declare class Vuetify0ThemeAdapter extends ThemeAdapter {
|
|
3243
2480
|
cspNonce?: string;
|
|
3244
2481
|
constructor(options?: Vuetify0ThemeOptions);
|
|
3245
|
-
|
|
2482
|
+
setup<T extends ThemeAdapterSetupContext>(app: App, context: T, target?: string | HTMLElement | null): void;
|
|
2483
|
+
update(colors: Record<ID, Colors>, isDark?: boolean): void;
|
|
3246
2484
|
upsert(styles: string): void;
|
|
3247
2485
|
}
|
|
3248
2486
|
//#endregion
|
|
@@ -3291,6 +2529,23 @@ interface ThemeContext<Z extends ThemeTicket> extends SingleContext<Z> {
|
|
|
3291
2529
|
* ```
|
|
3292
2530
|
*/
|
|
3293
2531
|
colors: ComputedRef<Record<string, Colors>>;
|
|
2532
|
+
/**
|
|
2533
|
+
* A ref indicating whether the current theme is dark.
|
|
2534
|
+
*
|
|
2535
|
+
* @remarks Returns `true` if the current theme has `dark: true`, otherwise `false`.
|
|
2536
|
+
*
|
|
2537
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-theme#isDark
|
|
2538
|
+
*
|
|
2539
|
+
* @example
|
|
2540
|
+
* ```ts
|
|
2541
|
+
* import { useTheme } from '@vuetify/v0'
|
|
2542
|
+
*
|
|
2543
|
+
* const theme = useTheme()
|
|
2544
|
+
*
|
|
2545
|
+
* console.log(theme.isDark.value) // true or false
|
|
2546
|
+
* ```
|
|
2547
|
+
*/
|
|
2548
|
+
isDark: Readonly<Ref<boolean>>;
|
|
3294
2549
|
/**
|
|
3295
2550
|
* Cycles through the provided themes in order.
|
|
3296
2551
|
*
|
|
@@ -3615,4 +2870,4 @@ declare function createTimelineContext<Z extends TimelineTicket = TimelineTicket
|
|
|
3615
2870
|
*/
|
|
3616
2871
|
declare function useTimeline<Z extends TimelineTicket = TimelineTicket, E extends TimelineContext<Z> = TimelineContext<Z>>(namespace?: string): E;
|
|
3617
2872
|
//#endregion
|
|
3618
|
-
export { ProxyRegistryContext as $, createGroup as $n, IntersectionObserverOptions as $t, useStorage as A, FeatureOptions as An,
|
|
2873
|
+
export { ProxyRegistryContext as $, createGroup as $n, IntersectionObserverOptions as $t, useStorage as A, FeatureOptions as An, LoggerAdapter as At, createStepContext as B, TokenContext as Bn, useLocale as Bt, StorageContextOptions as C, FilterQuery as Cn, createLoggerContext as Ct, createStorageContext as D, useFilter as Dn, Vuetify0LoggerAdapter as Dt, createStorage as E, UseFilterResult as En, LogLevel as Et, StepContext as F, createFeaturesPlugin as Fn, LocaleRecord as Ft, useResizeObserver as G, TokenValue as Gn, SingleOptions as Gt, ResizeObserverEntry as H, TokenOptions as Hn, LocaleAdapter as Ht, StepContextOptions as I, useFeatures as In, LocaleTicket as It, QueueOptions as J, useTokens as Jn, createSingleContext as Jt, QueueContext as K, createTokens as Kn, SingleTicket as Kt, StepOptions as L, FlatTokenCollection as Ln, createLocale as Lt, StorageAdapter as M, FeatureTicket as Mn, LocaleContextOptions as Mt, StorageType as N, createFeatures as Nn, LocaleOptions as Nt, createStoragePlugin as O, FeatureContext as On, PinoLoggerAdapter as Ot, MemoryAdapter as P, createFeaturesContext as Pn, LocalePluginOptions as Pt, useQueue as Q, GroupTicket as Qn, IntersectionObserverEntry as Qt, StepTicket as R, TokenAlias as Rn, createLocaleContext as Rt, StorageContext as S, FilterMode as Sn, createLogger as St, StoragePluginOptions as T, UseFilterOptions as Tn, useLogger as Tt, ResizeObserverOptions as U, TokenPrimitive as Un, SingleContext as Ut, useStep as V, TokenContextOptions as Vn, Vuetify0LocaleAdapter as Vt, useElementSize as W, TokenTicket as Wn, SingleContextOptions as Wt, createQueue as X, GroupContextOptions as Xn, KeyHandler as Xt, QueueTicket as Y, GroupContext as Yn, useSingle as Yt, createQueueContext as Z, GroupOptions as Zn, useKeydown as Zt, createThemeContext as _, createForm as _n, toArray as _r, useMutationObserver as _t, createTimeline as a, HydrationPluginOptions as an, useEventListener as ar, PermissionContextOptions as at, Vuetify0ThemeAdapter as b, FilterFunction as bn, createPlugin as br, LoggerOptions as bt, Colors as c, createHydrationPlugin as cn, BreakpointsContext as cr, PermissionTicket as ct, ThemeContextOptions as d, FormContextOptions as dn, BreakpointsPluginOptions as dr, createPermissionsPlugin as dt, useElementIntersection as en, createGroupContext as er, ProxyRegistryOptions as et, ThemeOptions as f, FormOptions as fn, createBreakpoints as fr, usePermissions as ft, createTheme as g, FormValue as gn, toReactive as gr, UseMutationObserverOptions as gt, ThemeTicket as h, FormValidationRule as hn, useBreakpoints as hr, MutationObserverRecord as ht, TimelineTicket as i, HydrationOptions as in, useDocumentEventListener as ir, PermissionContext as it, useStorageContext as j, FeaturePluginOptions as jn, LocaleContext as jt, provideStorageContext as k, FeatureContextOptions as kn, ConsolaLoggerAdapter as kt, ThemeColors as l, useHydration as ln, BreakpointsContextOptions as lr, createPermissions as lt, ThemeRecord as m, FormValidationResult as mn, createBreakpointsPlugin as mr, PermissionAdapterInterface as mt, TimelineContextOptions as n, HydrationContext as nn, CleanupFunction as nr, ProxyModelOptions as nt, createTimelineContext as o, createHydration as on, useWindowEventListener as or, PermissionOptions as ot, ThemePluginOptions as p, FormTicket as pn, createBreakpointsContext as pr, PermissionAdapter as pt, QueueContextOptions as q, createTokensContext as qn, createSingle as qt, TimelineOptions as r, HydrationContextOptions as rn, EventHandler as rr, useProxyModel as rt, useTimeline as s, createHydrationContext as sn, BreakpointName as sr, PermissionPluginOptions as st, TimelineContext as t, useIntersectionObserver as tn, useGroup as tr, useProxyRegistry as tt, ThemeContext as u, FormContext as un, BreakpointsOptions as ur, createPermissionsContext as ut, createThemePlugin as v, createFormContext as vn, Plugin as vr, LoggerContext as vt, StorageOptions as w, Primitive as wn, createLoggerPlugin as wt, ThemeAdapter as x, FilterItem as xn, LoggerPluginOptions as xt, useTheme as y, useForm as yn, PluginOptions as yr, LoggerContextOptions as yt, createStep as z, TokenCollection as zn, createLocalePlugin as zt };
|