@vuetify/v0 0.1.6 → 0.1.8
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/README.md +0 -1
- package/dist/{adapter-Bjs_Nx_J.mjs → adapter-B4zE-hA5.mjs} +5 -8
- package/dist/adapter-CqP9Z4JU.d.mts +1087 -0
- package/dist/{adapter-CLs-OrSN.d.mts → adapter-DIx4Rntl.d.mts} +5 -48
- package/dist/adapters-BjeDmKc6.mjs +1 -0
- package/dist/adapters-Bv5aRv3l.mjs +1 -0
- package/dist/adapters-C66XaKkw.mjs +1 -0
- package/dist/adapters-DkVblyML.mjs +1 -0
- package/dist/adapters-uJLWGQJl.mjs +1 -0
- package/dist/browser/index.js +2380 -1080
- package/dist/components/index.d.mts +2 -20
- package/dist/components/index.mjs +34 -39
- package/dist/{components-GiQh_RfQ.mjs → components-BbxKYAXs.mjs} +1129 -392
- package/dist/composables/index.d.mts +18 -17
- package/dist/composables/index.mjs +34 -37
- package/dist/{consola-DiUk9j3y.d.mts → consola-BVzYzeLH.d.mts} +1 -1
- package/dist/{consola-GBy8XRuL.mjs → consola-Ceox8BWi.mjs} +1 -2
- package/dist/constants/index.d.mts +1 -1
- package/dist/constants/index.mjs +3 -5
- package/dist/{createDataTable-lSofI5rU.mjs → createDataTable-DZouEhvH.mjs} +9 -11
- package/dist/{createGroup-CCb7Zfyw.mjs → createGroup-BpJFi41X.mjs} +5 -8
- package/dist/{createPagination-lagznd8i.mjs → createPagination-Bu8vE0JW.mjs} +3 -5
- package/dist/{createSelection-Zo4RQpYe.mjs → createSelection-8MX0OHXR.mjs} +9 -12
- package/dist/{createSingle-BH9wNDrS.mjs → createSingle-CbuOBb-E.mjs} +3 -5
- package/dist/{createTokens-Cu1efg9Z.mjs → createTokens-CXlT0Vc6.mjs} +25 -27
- package/dist/{createTrinity-Cii8-B2r.mjs → createTrinity-C_c8eedz.mjs} +10 -13
- package/dist/data-table/adapters/client/index.d.mts +1 -2
- package/dist/data-table/adapters/client/index.mjs +7 -9
- package/dist/data-table/adapters/index.d.mts +4 -4
- package/dist/data-table/adapters/index.mjs +10 -12
- package/dist/data-table/adapters/server/index.d.mts +1 -2
- package/dist/data-table/adapters/server/index.mjs +5 -7
- package/dist/data-table/adapters/virtual/index.d.mts +1 -2
- package/dist/data-table/adapters/virtual/index.mjs +7 -9
- package/dist/data-table/index.d.mts +5 -6
- package/dist/data-table/index.mjs +22 -25
- package/dist/date/index.d.mts +1 -3
- package/dist/date/index.mjs +3932 -3943
- package/dist/features/adapters/flagsmith/index.d.mts +2 -4
- package/dist/features/adapters/flagsmith/index.mjs +2 -3
- package/dist/features/adapters/launchdarkly/index.d.mts +1 -3
- package/dist/features/adapters/launchdarkly/index.mjs +2 -3
- package/dist/features/adapters/posthog/index.d.mts +1 -3
- package/dist/features/adapters/posthog/index.mjs +3 -4
- package/dist/features/index.d.mts +2 -16
- package/dist/features/index.mjs +13 -18
- package/dist/{flagsmith-CHmpPGR7.mjs → flagsmith-CrWUeIhT.mjs} +1 -2
- package/dist/{globals-D6FBsWDI.mjs → globals-ClSU6mqC.mjs} +2 -3
- package/dist/{htmlElements-d8iBCGpO.mjs → htmlElements-DcYtv0hg.mjs} +7 -10
- package/dist/{index-De0SQt1w.d.mts → index-63-0oJS8.d.mts} +381 -981
- package/dist/{index-DlUIZN-F.d.mts → index-B5NU2uB7.d.mts} +2754 -1642
- package/dist/index-CeNfBYuo.d.mts +46 -0
- package/dist/{index-DIK84tM4.d.mts → index-CmCMrlt3.d.mts} +3 -3
- package/dist/index-CxW4itj1.d.mts +858 -0
- package/dist/{index-BFBN5Zl3.d.mts → index-Dor6eAEc.d.mts} +0 -1
- package/dist/{index-UNwEBkQT.d.mts → index-MHkcqY_y.d.mts} +1 -2
- package/dist/{index-BuOz3Rgm.d.mts → index-dJKXAO5D.d.mts} +1 -2
- package/dist/index.d.mts +22 -20
- package/dist/index.mjs +38 -40
- package/dist/json/attributes.json +252 -0
- package/dist/json/importMap.json +60 -0
- package/dist/json/tags.json +128 -0
- package/dist/json/web-types.json +1023 -228
- package/dist/{launchdarkly-W8t8ZANX.mjs → launchdarkly-jF2KZGoH.mjs} +1 -2
- package/dist/locale/adapters/index.d.mts +1 -2
- package/dist/locale/adapters/index.mjs +4 -6
- package/dist/locale/adapters/v0/index.d.mts +1 -2
- package/dist/locale/adapters/v0/index.mjs +3 -5
- package/dist/locale/index.d.mts +2 -16
- package/dist/locale/index.mjs +14 -17
- package/dist/logger/adapters/consola/index.d.mts +1 -2
- package/dist/logger/adapters/consola/index.mjs +2 -3
- package/dist/logger/adapters/index.d.mts +4 -4
- package/dist/logger/adapters/index.mjs +6 -8
- package/dist/logger/adapters/pino/index.d.mts +1 -2
- package/dist/logger/adapters/pino/index.mjs +3 -5
- package/dist/logger/adapters/v0/index.d.mts +1 -2
- package/dist/logger/adapters/v0/index.mjs +3 -5
- package/dist/logger/index.d.mts +5 -16
- package/dist/logger/index.mjs +8 -10
- package/dist/{memory-BsZGbGnG.mjs → memory-XCMtkld1.mjs} +1 -2
- package/dist/palettes/ant/generate/index.d.mts +9 -0
- package/dist/palettes/ant/generate/index.mjs +98 -0
- package/dist/palettes/ant/index.d.mts +6 -0
- package/dist/palettes/ant/index.mjs +149 -0
- package/dist/palettes/index.d.mts +12 -0
- package/dist/palettes/index.mjs +1 -0
- package/dist/palettes/leonardo/generate/index.d.mts +10 -0
- package/dist/palettes/leonardo/generate/index.mjs +120 -0
- package/dist/palettes/material/generate/index.d.mts +10 -0
- package/dist/palettes/material/generate/index.mjs +103 -0
- package/dist/palettes/material/index.d.mts +6 -0
- package/dist/palettes/material/index.mjs +173 -0
- package/dist/palettes/md1/index.d.mts +6 -0
- package/dist/palettes/md1/index.mjs +261 -0
- package/dist/palettes/md2/index.d.mts +6 -0
- package/dist/palettes/md2/index.mjs +297 -0
- package/dist/palettes/radix/index.d.mts +6 -0
- package/dist/palettes/radix/index.mjs +439 -0
- package/dist/palettes/tailwind/index.d.mts +6 -0
- package/dist/palettes/tailwind/index.mjs +291 -0
- package/dist/permissions/adapters/index.d.mts +2 -17
- package/dist/permissions/adapters/index.mjs +4 -6
- package/dist/permissions/adapters/v0/index.d.mts +1 -17
- package/dist/permissions/adapters/v0/index.mjs +3 -5
- package/dist/permissions/index.d.mts +1 -16
- package/dist/permissions/index.mjs +12 -15
- package/dist/{pino-BD5PCzAF.mjs → pino-B7tJ3m18.mjs} +2 -4
- package/dist/{pino-p-jDkNQd.d.mts → pino-Bzighnkd.d.mts} +1 -2
- package/dist/{posthog-BxaG8sYi.mjs → posthog-BE7-t7cV.mjs} +2 -4
- package/dist/rules/index.d.mts +2 -0
- package/dist/rules/index.mjs +15 -0
- package/dist/{server-DgOdFYMU.mjs → server-CZ6ahbEH.mjs} +2 -4
- package/dist/{server-CGAeOGPC.d.mts → server-Ch9J86tb.d.mts} +1 -2
- package/dist/storage/adapters/index.d.mts +2 -2
- package/dist/storage/adapters/index.mjs +2 -3
- package/dist/storage/adapters/memory/index.d.mts +1 -1
- package/dist/storage/adapters/memory/index.mjs +2 -3
- package/dist/storage/index.d.mts +3 -16
- package/dist/storage/index.mjs +33 -37
- package/dist/theme/adapters/index.d.mts +1 -16
- package/dist/theme/adapters/index.mjs +4 -6
- package/dist/theme/adapters/v0/index.d.mts +1 -16
- package/dist/theme/adapters/v0/index.mjs +3 -5
- package/dist/theme/index.d.mts +1 -16
- package/dist/theme/index.mjs +13 -16
- package/dist/{toArray-BBZH-G2X.mjs → toArray-VdROPpy-.mjs} +2 -4
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/{useClickOutside-Bm_3mbcT.mjs → useClickOutside-W0Sur1rC.mjs} +671 -211
- package/dist/{useFeatures-BS4mit8z.mjs → useFeatures-CUicSI-E.mjs} +5 -8
- package/dist/{useLocale-DJJmg-wv.mjs → useLocale-cQlPxbpV.mjs} +14 -12
- package/dist/{useLogger-C8G5jgNk.mjs → useLogger-DY1Hbcy1.mjs} +13 -16
- package/dist/{usePermissions-C5Mkotol.mjs → usePermissions-BSW59R4q.mjs} +5 -7
- package/dist/useRules-BbA6_gvs.mjs +144 -0
- package/dist/{useTheme-BBnASLr3.mjs → useTheme-Bdx2Lj5c.mjs} +11 -13
- package/dist/utilities/index.d.mts +1 -2
- package/dist/utilities/index.mjs +426 -4
- package/dist/{v0-BOxb3nD1.d.mts → v0-1xxC39wf.d.mts} +1 -2
- package/dist/{v0-DzvhDU1W.mjs → v0-2G2476h-.mjs} +3 -6
- package/dist/{v0-DtO_ICXr.mjs → v0-B1QQGE4O.mjs} +2 -5
- package/dist/{v0-lua6ffdk.mjs → v0-BFseIsBi.mjs} +3 -5
- package/dist/{v0-Bh8d1j_p.d.mts → v0-BZINNGoC.d.mts} +2 -2
- package/dist/{v0-DHMoZ7dS.d.mts → v0-CAKa6tzG.d.mts} +1 -1
- package/dist/{v0-BWBSVkew.mjs → v0-CHBrvw49.mjs} +3 -5
- package/dist/{v0-CVr15VcY.d.mts → v0-CdUL2eOn.d.mts} +1 -2
- package/dist/{v0-CWUF_HqP.mjs → v0-YAqbXudL.mjs} +3 -5
- package/dist/{virtual-CVb9hRUU.d.mts → virtual-DwBiFA25.d.mts} +1 -2
- package/dist/{virtual-BEOqkQvm.mjs → virtual-eDNVH1fz.mjs} +3 -5
- package/package.json +40 -11
- package/dist/adapter-DcwxFryd.d.mts +0 -97
- package/dist/adapters-BGJKsBrw.mjs +0 -1
- package/dist/adapters-BQ-Lr3PW.mjs +0 -1
- package/dist/adapters-DEXpW9If.mjs +0 -1
- package/dist/adapters-Q9WaOsJp.mjs +0 -1
- package/dist/adapters-SSDVth5e.mjs +0 -1
- package/dist/constants-B8pMSkcW.mjs +0 -1
- package/dist/utilities-CcJtp9Gx.mjs +0 -429
- /package/dist/{adapter-CJIj5ySf.d.mts → adapter-JTFG3Jn8.d.mts} +0 -0
- /package/dist/{index-Bv1VN_j5.d.mts → index-B5ZDDkXv.d.mts} +0 -0
- /package/dist/{index-BDTbJClL.d.mts → index-NsE5nARK.d.mts} +0 -0
- /package/dist/{memory-DVjquu_v.d.mts → memory-BTtRdnNn.d.mts} +0 -0
|
@@ -1,707 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
1
|
+
import { o as ID, s as MaybeArray } from "./index-Dor6eAEc.mjs";
|
|
2
|
+
import { t as ContextTrinity } from "./index-CeNfBYuo.mjs";
|
|
3
|
+
import { b as RegistryTicketInput, c as TokenTicket, i as TokenContext, o as TokenOptions, p as RegistryContext, r as TokenCollection, v as RegistryOptions, y as RegistryTicket } from "./index-CxW4itj1.mjs";
|
|
4
|
+
import { t as DateAdapter } from "./adapter-CqP9Z4JU.mjs";
|
|
5
|
+
import { n as FeaturesAdapterFlags, r as FeaturesAdapterInterface } from "./index-dJKXAO5D.mjs";
|
|
6
|
+
import { n as LocaleAdapter } from "./v0-CAKa6tzG.mjs";
|
|
7
|
+
import { t as LoggerAdapter } from "./adapter-JTFG3Jn8.mjs";
|
|
8
|
+
import { t as StorageAdapter } from "./index-NsE5nARK.mjs";
|
|
8
9
|
import { App, ComponentPublicInstance, ComputedRef, InjectionKey, MaybeRef, MaybeRefOrGetter, Reactive, Ref, ShallowRef, UnwrapNestedRefs, WatchSource } from "vue";
|
|
9
10
|
|
|
10
|
-
//#region src/composables/createRegistry/index.d.ts
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* User-facing input shape for registry tickets.
|
|
14
|
-
*
|
|
15
|
-
* Extend this when defining custom ticket types passed to `register()` and `onboard()`.
|
|
16
|
-
* The registry adds the computed fields (`index`, `valueIsIndex`) automatically — those
|
|
17
|
-
* live on {@link RegistryTicket}, which is the output type returned by `get()` and `values()`.
|
|
18
|
-
*
|
|
19
|
-
* @template V The type of the ticket value.
|
|
20
|
-
*/
|
|
21
|
-
interface RegistryTicketInput<V = unknown> {
|
|
22
|
-
/** The unique identifier. Optional — auto-generated if not provided. */
|
|
23
|
-
id?: ID;
|
|
24
|
-
/** The value associated with the ticket. If not provided, it defaults to the index. */
|
|
25
|
-
value?: V;
|
|
26
|
-
}
|
|
27
|
-
interface RegistryTicket<V = unknown> {
|
|
28
|
-
/** The unique identifier. Is randomly generated if not provided. */
|
|
29
|
-
id: ID;
|
|
30
|
-
/**
|
|
31
|
-
* The index of the ticket in the registry.
|
|
32
|
-
*
|
|
33
|
-
* @remarks Automatically managed by the registry. Updated during reindexing. It's not recommended to manually set this.
|
|
34
|
-
*/
|
|
35
|
-
index: number;
|
|
36
|
-
/** The value associated with the ticket. If not provided, it defaults to the index. */
|
|
37
|
-
value: V;
|
|
38
|
-
/**
|
|
39
|
-
* Whether the value is derived from index.
|
|
40
|
-
*
|
|
41
|
-
* @remarks Set to true when no explicit value is provided during registration. It's not recommended to manually set this.
|
|
42
|
-
*/
|
|
43
|
-
valueIsIndex: boolean;
|
|
44
|
-
}
|
|
45
|
-
/** Valid event names for registry operations */
|
|
46
|
-
type RegistryEventName = 'register:ticket' | 'unregister:ticket' | 'update:ticket' | 'clear:registry' | 'reindex:registry';
|
|
47
|
-
/** Maps event names to their payload types */
|
|
48
|
-
type RegistryEventMap<Z extends RegistryTicket> = {
|
|
49
|
-
'register:ticket': Z;
|
|
50
|
-
'unregister:ticket': Z;
|
|
51
|
-
'update:ticket': Z;
|
|
52
|
-
'clear:registry': undefined;
|
|
53
|
-
'reindex:registry': undefined;
|
|
54
|
-
};
|
|
55
|
-
/** Callback signature for registry event listeners */
|
|
56
|
-
type RegistryEventCallback<Z extends RegistryTicket = RegistryTicket, K extends RegistryEventName = RegistryEventName> = (data: RegistryEventMap<Z>[K]) => void;
|
|
57
|
-
/** Resolves callback type: typed for known events, unknown for custom events */
|
|
58
|
-
type EventHandler$1<Z extends RegistryTicket, K extends string> = K extends RegistryEventName ? (data: RegistryEventMap<Z>[K]) => void : (data: unknown) => void;
|
|
59
|
-
/** Resolves payload type: typed for known events, unknown for custom events */
|
|
60
|
-
type EventPayload<Z extends RegistryTicket, K extends string> = K extends RegistryEventName ? RegistryEventMap<Z>[K] : unknown;
|
|
61
|
-
interface RegistryContext<Z extends RegistryTicketInput = RegistryTicketInput, E extends RegistryTicket & Z = RegistryTicket & Z> {
|
|
62
|
-
/**
|
|
63
|
-
* The collection of tickets in the registry
|
|
64
|
-
*
|
|
65
|
-
* @template ID The type of the ticket ID.
|
|
66
|
-
* @template E The type of the registry ticket.
|
|
67
|
-
*
|
|
68
|
-
* @remarks Read-only view of the internal collection. Use `register`, `unregister`, `upsert`, and `clear` methods to modify.
|
|
69
|
-
*/
|
|
70
|
-
collection: ReadonlyMap<ID, E>;
|
|
71
|
-
/**
|
|
72
|
-
* Clear the entire registry
|
|
73
|
-
*
|
|
74
|
-
* @remarks Removes all tickets from the registry. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
|
|
75
|
-
*
|
|
76
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#clear
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```ts
|
|
80
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
81
|
-
*
|
|
82
|
-
* const registry = createRegistry()
|
|
83
|
-
*
|
|
84
|
-
* registry.register({ id: 'ticket-1' })
|
|
85
|
-
* registry.register({ id: 'ticket-2' })
|
|
86
|
-
*
|
|
87
|
-
* console.log(registry.size) // 2
|
|
88
|
-
*
|
|
89
|
-
* registry.clear()
|
|
90
|
-
*
|
|
91
|
-
* console.log(registry.size) // 0
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
clear: () => void;
|
|
95
|
-
/**
|
|
96
|
-
* Check if a ticket exists by ID
|
|
97
|
-
*
|
|
98
|
-
* @param id The ID of the ticket to check.
|
|
99
|
-
* @remarks Calls `collection.has` internally.
|
|
100
|
-
*
|
|
101
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#has
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* ```ts
|
|
105
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
106
|
-
*
|
|
107
|
-
* const registry = createRegistry()
|
|
108
|
-
*
|
|
109
|
-
* registry.register({ id: 'ticket-id' })
|
|
110
|
-
*
|
|
111
|
-
* const exists = registry.has('ticket-id') // true
|
|
112
|
-
* ```
|
|
113
|
-
*/
|
|
114
|
-
has: (id: ID) => boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Get all registered IDs
|
|
117
|
-
*
|
|
118
|
-
* @remarks Calls `collection.keys` internally with caching. First call is O(n), subsequent calls are O(1) until cache invalidation.
|
|
119
|
-
*
|
|
120
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#keys
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* ```ts
|
|
124
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
125
|
-
*
|
|
126
|
-
* const registry = createRegistry()
|
|
127
|
-
*
|
|
128
|
-
* registry.register({ id: 'ticket-1' })
|
|
129
|
-
* registry.register({ id: 'ticket-2' })
|
|
130
|
-
*
|
|
131
|
-
* const ids = registry.keys() // ['ticket-1', 'ticket-2']
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
keys: () => readonly ID[];
|
|
135
|
-
/**
|
|
136
|
-
* Browse for an ID(s) by value
|
|
137
|
-
*
|
|
138
|
-
* @param value The value to browse for.
|
|
139
|
-
* @remarks Returns an array of IDs that share the given value, or undefined if no match is found.
|
|
140
|
-
*
|
|
141
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#browse
|
|
142
|
-
*
|
|
143
|
-
* @example
|
|
144
|
-
* ```ts
|
|
145
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
146
|
-
*
|
|
147
|
-
* const registry = createRegistry()
|
|
148
|
-
*
|
|
149
|
-
* registry.register({ id: 'ticket-1', value: 'common-value' })
|
|
150
|
-
* registry.register({ id: 'ticket-2', value: 'common-value' })
|
|
151
|
-
* registry.register({ id: 'ticket-3', value: 'unique-value' })
|
|
152
|
-
*
|
|
153
|
-
* const common = registry.browse('common-value') // ['ticket-1', 'ticket-2']
|
|
154
|
-
* const unique = registry.browse('unique-value') // ['ticket-3']
|
|
155
|
-
* ```
|
|
156
|
-
*/
|
|
157
|
-
browse: (value: E['value']) => ID[] | undefined;
|
|
158
|
-
/**
|
|
159
|
-
* lookup a ticket by index number
|
|
160
|
-
*
|
|
161
|
-
* @param index The index number to lookup.
|
|
162
|
-
* @remarks Maps do not support indexing by default, this method provides a way to retrieve an ID based on its index in the registry.
|
|
163
|
-
*
|
|
164
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#lookup
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```ts
|
|
168
|
-
* const registry = createRegistry()
|
|
169
|
-
*
|
|
170
|
-
* registry.register({ id: 'ticket-1' })
|
|
171
|
-
* registry.register({ id: 'ticket-2' })
|
|
172
|
-
*
|
|
173
|
-
* const ticket1 = registry.lookup(0) // 'ticket-1'
|
|
174
|
-
* const ticket2 = registry.lookup(1) // 'ticket-2'
|
|
175
|
-
* ```
|
|
176
|
-
*/
|
|
177
|
-
lookup: (index: number) => ID | undefined;
|
|
178
|
-
/**
|
|
179
|
-
* Get a ticket by ID
|
|
180
|
-
*
|
|
181
|
-
* @param id The ID of the ticket to retrieve.
|
|
182
|
-
* @remarks Calls `collection.get` internally.
|
|
183
|
-
*
|
|
184
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#get
|
|
185
|
-
*
|
|
186
|
-
* @example
|
|
187
|
-
* ```ts
|
|
188
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
189
|
-
*
|
|
190
|
-
* const registry = createRegistry()
|
|
191
|
-
*
|
|
192
|
-
* registry.register({ id: 'ticket-id', value: 'some-value' })
|
|
193
|
-
*
|
|
194
|
-
* const ticket = registry.get('ticket-id') // { id: 'ticket-id', index: 0, value: 'some-value', ... }
|
|
195
|
-
* ```
|
|
196
|
-
*/
|
|
197
|
-
get: (id: ID) => E | undefined;
|
|
198
|
-
/**
|
|
199
|
-
* Update or insert a ticket by ID
|
|
200
|
-
*
|
|
201
|
-
* @param id The ID of the ticket to upsert.
|
|
202
|
-
* @param ticket The partial ticket data to update or insert.
|
|
203
|
-
* @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()`.
|
|
204
|
-
*
|
|
205
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#upsert
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* ```ts
|
|
209
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
210
|
-
*
|
|
211
|
-
* const registry = createRegistry()
|
|
212
|
-
*
|
|
213
|
-
* // Insert a new ticket
|
|
214
|
-
* const ticket = registry.upsert('ticket-id', { value: 'initial-value' })
|
|
215
|
-
*
|
|
216
|
-
* // Update the existing ticket
|
|
217
|
-
* const patched = registry.upsert('ticket-id', { value: 'updated-value' })
|
|
218
|
-
* ```
|
|
219
|
-
*/
|
|
220
|
-
upsert: (id: ID, ticket?: Partial<Z>) => E;
|
|
221
|
-
/**
|
|
222
|
-
* Get all values of registered tickets
|
|
223
|
-
*
|
|
224
|
-
* @remarks Calls `collection.values` internally with caching. First call is O(n), subsequent calls are O(1) until cache invalidation.
|
|
225
|
-
*
|
|
226
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#values
|
|
227
|
-
*
|
|
228
|
-
* @example
|
|
229
|
-
* ```ts
|
|
230
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
231
|
-
*
|
|
232
|
-
* const registry = createRegistry()
|
|
233
|
-
*
|
|
234
|
-
* registry.register({ id: 'ticket-1', value: 'value-1' })
|
|
235
|
-
* registry.register({ id: 'ticket-2', value: 'value-2' })
|
|
236
|
-
*
|
|
237
|
-
* const values = registry.values() // [{ id: 'ticket-1', ... }, { id: 'ticket-2', ... }]
|
|
238
|
-
* ```
|
|
239
|
-
*/
|
|
240
|
-
values: () => readonly E[];
|
|
241
|
-
/**
|
|
242
|
-
* Get all entries of registered tickets
|
|
243
|
-
*
|
|
244
|
-
* @remarks Calls `collection.entries` internally with caching. First call is O(n), subsequent calls are O(1) until cache invalidation.
|
|
245
|
-
*
|
|
246
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#entries
|
|
247
|
-
*
|
|
248
|
-
* @example
|
|
249
|
-
* ```ts
|
|
250
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
251
|
-
*
|
|
252
|
-
* const registry = createRegistry()
|
|
253
|
-
*
|
|
254
|
-
* registry.register({ id: 'ticket-1', value: 'value-1' })
|
|
255
|
-
* registry.register({ id: 'ticket-2', value: 'value-2' })
|
|
256
|
-
*
|
|
257
|
-
* const entries = registry.entries() // [['ticket-1', { id: 'ticket-1', ... }], ['ticket-2', { id: 'ticket-2', ... }]]
|
|
258
|
-
* ```
|
|
259
|
-
*/
|
|
260
|
-
entries: () => readonly [ID, E][];
|
|
261
|
-
/**
|
|
262
|
-
* Register a new ticket
|
|
263
|
-
*
|
|
264
|
-
* @param ticket The partial ticket data to register.
|
|
265
|
-
* @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()`.
|
|
266
|
-
*
|
|
267
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#register
|
|
268
|
-
*
|
|
269
|
-
* @example
|
|
270
|
-
* ```ts
|
|
271
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
272
|
-
*
|
|
273
|
-
* const registry = createRegistry()
|
|
274
|
-
*
|
|
275
|
-
* const ticket = registry.register()
|
|
276
|
-
*
|
|
277
|
-
* console.log(ticket) // { id: 'generated-id', index: 0, value: 0, valueIsIndex: true }
|
|
278
|
-
* ```
|
|
279
|
-
*/
|
|
280
|
-
register: (ticket?: Partial<Z & RegistryTicket>) => E;
|
|
281
|
-
/**
|
|
282
|
-
* Unregister a ticket by ID
|
|
283
|
-
*
|
|
284
|
-
* @param id The ID of the ticket to unregister.
|
|
285
|
-
* @remarks Removes the ticket from the registry and reindexes the remaining tickets. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
|
|
286
|
-
*
|
|
287
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#unregister
|
|
288
|
-
*
|
|
289
|
-
* @example
|
|
290
|
-
* ```ts
|
|
291
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
292
|
-
*
|
|
293
|
-
* const registry = createRegistry()
|
|
294
|
-
*
|
|
295
|
-
* registry.register({ id: 'ticket-id' })
|
|
296
|
-
*
|
|
297
|
-
* registry.unregister('ticket-id')
|
|
298
|
-
* ```
|
|
299
|
-
*/
|
|
300
|
-
unregister: (id: ID) => void;
|
|
301
|
-
/**
|
|
302
|
-
* Reset the index directory and update all tickets
|
|
303
|
-
*
|
|
304
|
-
* @remarks Rebuilds the internal index mapping and ensures all tickets have correct index values. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
|
|
305
|
-
*
|
|
306
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#reindex
|
|
307
|
-
*
|
|
308
|
-
* @example
|
|
309
|
-
* ```ts
|
|
310
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
311
|
-
*
|
|
312
|
-
* const registry = createRegistry()
|
|
313
|
-
*
|
|
314
|
-
* registry.register({ id: 'ticket-1' })
|
|
315
|
-
* registry.register({ id: 'ticket-2' })
|
|
316
|
-
*
|
|
317
|
-
* // After some operations that may affect indexing
|
|
318
|
-
* registry.reindex()
|
|
319
|
-
* ```
|
|
320
|
-
*/
|
|
321
|
-
reindex: () => void;
|
|
322
|
-
/**
|
|
323
|
-
* Seek for a ticket based on direction and optional predicate
|
|
324
|
-
*
|
|
325
|
-
* @param direction The direction to seek ('first' or 'last'). Defaults to 'first'.
|
|
326
|
-
* @param from The index to start seeking from. Defaults to the beginning or end based on direction.
|
|
327
|
-
* @param predicate An optional function to test each ticket. The first ticket that satisfies the predicate will be returned.
|
|
328
|
-
* @remarks This method allows for flexible searching within the registry, either from the start or end, and can filter tickets based on custom criteria.
|
|
329
|
-
*
|
|
330
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#seek
|
|
331
|
-
*
|
|
332
|
-
* @example
|
|
333
|
-
* ```ts
|
|
334
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
335
|
-
*
|
|
336
|
-
* const registry = createRegistry()
|
|
337
|
-
*
|
|
338
|
-
* registry.register({ id: 'ticket-1', value: 'apple' })
|
|
339
|
-
* registry.register({ id: 'ticket-2', value: 'banana' })
|
|
340
|
-
* registry.register({ id: 'ticket-3', value: 'cherry' })
|
|
341
|
-
*
|
|
342
|
-
* // Seek the first ticket
|
|
343
|
-
* const first = registry.seek('first')
|
|
344
|
-
*
|
|
345
|
-
* // Seek the last ticket
|
|
346
|
-
* const last = registry.seek('last')
|
|
347
|
-
*
|
|
348
|
-
* // Seek the first ticket with value 'banana'
|
|
349
|
-
* const banana = registry.seek('first', undefined, ticket => ticket.value === 'banana')
|
|
350
|
-
*
|
|
351
|
-
* // Seek from index 1 to find the next ticket with value starting with 'c'
|
|
352
|
-
* const cherry = registry.seek('first', 1, ticket => (ticket.value as string).startsWith('c'))
|
|
353
|
-
* ```
|
|
354
|
-
*/
|
|
355
|
-
/**
|
|
356
|
-
* Move a ticket to a new index position
|
|
357
|
-
*
|
|
358
|
-
* @param id The ID of the ticket to move.
|
|
359
|
-
* @param toIndex The target index position. Clamped to valid range.
|
|
360
|
-
* @returns The moved ticket, or undefined if the ticket was not found.
|
|
361
|
-
*
|
|
362
|
-
* @remarks Rebuilds the internal collection order by removing and reinserting the entry at the target position. Triggers a full reindex after the move. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
|
|
363
|
-
*
|
|
364
|
-
* @see https://0.vuetifyjs.com/composables/registration/create-registry#move
|
|
365
|
-
*
|
|
366
|
-
* @example
|
|
367
|
-
* ```ts
|
|
368
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
369
|
-
*
|
|
370
|
-
* const registry = createRegistry()
|
|
371
|
-
*
|
|
372
|
-
* registry.onboard([
|
|
373
|
-
* { id: 'a', value: 'alpha' },
|
|
374
|
-
* { id: 'b', value: 'beta' },
|
|
375
|
-
* { id: 'c', value: 'gamma' },
|
|
376
|
-
* ])
|
|
377
|
-
*
|
|
378
|
-
* // Move 'a' from index 0 to index 2
|
|
379
|
-
* registry.move('a', 2)
|
|
380
|
-
*
|
|
381
|
-
* console.log(registry.keys()) // ['b', 'c', 'a']
|
|
382
|
-
* ```
|
|
383
|
-
*/
|
|
384
|
-
move: (id: ID, toIndex: number) => E | undefined;
|
|
385
|
-
seek: (direction?: 'first' | 'last', from?: number, predicate?: (ticket: E) => boolean) => E | undefined;
|
|
386
|
-
/**
|
|
387
|
-
* Listen for registry events
|
|
388
|
-
*
|
|
389
|
-
* @param event The name of the event to listen for.
|
|
390
|
-
* @param cb The callback function to invoke when the event is emitted.
|
|
391
|
-
* @remarks Must be enabled via the `events` option when creating the registry.
|
|
392
|
-
* Supported events:
|
|
393
|
-
* - `register:ticket` - Emitted when a ticket is registered, receives the ticket as argument
|
|
394
|
-
* - `unregister:ticket` - Emitted when a ticket is unregistered, receives the ticket as argument
|
|
395
|
-
* - `update:ticket` - Emitted when a ticket is updated, receives the updated ticket as argument
|
|
396
|
-
* - `clear:registry` - Emitted when the registry is cleared
|
|
397
|
-
* - `reindex:registry` - Emitted when the registry is reindexed
|
|
398
|
-
*
|
|
399
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#on
|
|
400
|
-
*
|
|
401
|
-
* @example
|
|
402
|
-
* ```ts
|
|
403
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
404
|
-
*
|
|
405
|
-
* const registry = createRegistry({ events: true })
|
|
406
|
-
*
|
|
407
|
-
* registry.on('register:ticket', (ticket) => {
|
|
408
|
-
* console.log('Ticket registered:', ticket)
|
|
409
|
-
* })
|
|
410
|
-
*
|
|
411
|
-
* registry.register({ id: 'ticket-id' }) // Console: Ticket registered: { id: 'ticket-id', ... }
|
|
412
|
-
* ```
|
|
413
|
-
*/
|
|
414
|
-
on: <K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler$1<E, K>) => void;
|
|
415
|
-
/**
|
|
416
|
-
* Stop listening for registry events
|
|
417
|
-
*
|
|
418
|
-
* @param event The name of the event to stop listening for.
|
|
419
|
-
* @param cb The callback function to remove.
|
|
420
|
-
* @remarks Must be enabled via the `events` option when creating the registry.
|
|
421
|
-
*
|
|
422
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#off
|
|
423
|
-
*
|
|
424
|
-
* @example
|
|
425
|
-
* ```ts
|
|
426
|
-
* import { onScopeDispose } from 'vue'
|
|
427
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
428
|
-
*
|
|
429
|
-
* const registry = createRegistry({ events: true })
|
|
430
|
-
*
|
|
431
|
-
* function onRegister(ticket) {
|
|
432
|
-
* console.log('Ticket registered:', ticket)
|
|
433
|
-
* }
|
|
434
|
-
*
|
|
435
|
-
* registry.on('register:ticket', onRegister)
|
|
436
|
-
*
|
|
437
|
-
* registry.register({ id: 'ticket-id' }) // Console: Ticket registered: { id: 'ticket-id', ... }
|
|
438
|
-
*
|
|
439
|
-
* onScopeDispose(() => {
|
|
440
|
-
* registry.off('register:ticket', onRegister)
|
|
441
|
-
* })
|
|
442
|
-
* ```
|
|
443
|
-
*/
|
|
444
|
-
off: <K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler$1<E, K>) => void;
|
|
445
|
-
/**
|
|
446
|
-
* Emit an event with data
|
|
447
|
-
*
|
|
448
|
-
* @param event The name of the event to emit.
|
|
449
|
-
* @param data The data to pass to event listeners.
|
|
450
|
-
* @remarks Must be enabled via the `events` option when creating the registry.
|
|
451
|
-
*
|
|
452
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#emit
|
|
453
|
-
*
|
|
454
|
-
* @example
|
|
455
|
-
* ```ts
|
|
456
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
457
|
-
*
|
|
458
|
-
* const registry = createRegistry({ events: true })
|
|
459
|
-
*
|
|
460
|
-
* registry.on('custom-event', (data) => {
|
|
461
|
-
* console.log('Custom event received:', data)
|
|
462
|
-
* })
|
|
463
|
-
*
|
|
464
|
-
* registry.emit('custom-event', { message: 'Hello, World!' }) // Console: Custom event received: { message: 'Hello, World!' }
|
|
465
|
-
* ```
|
|
466
|
-
*/
|
|
467
|
-
emit: <K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<E, K>) => void;
|
|
468
|
-
/**
|
|
469
|
-
* Clears the registry and removes all listeners
|
|
470
|
-
*
|
|
471
|
-
* @remarks Disposes of the registry by clearing all tickets and removing all event listeners.
|
|
472
|
-
*
|
|
473
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#dispose
|
|
474
|
-
*
|
|
475
|
-
* @example
|
|
476
|
-
* ```ts
|
|
477
|
-
* import { onScopeDispose } from 'vue'
|
|
478
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
479
|
-
*
|
|
480
|
-
* const registry = createRegistry({ events: true })
|
|
481
|
-
*
|
|
482
|
-
* registry.register({ id: 'ticket-id' })
|
|
483
|
-
*
|
|
484
|
-
* onScopeDispose(() => {
|
|
485
|
-
* registry.dispose()
|
|
486
|
-
* })
|
|
487
|
-
* ```
|
|
488
|
-
*/
|
|
489
|
-
dispose: () => void;
|
|
490
|
-
/**
|
|
491
|
-
* Onboard multiple tickets at once
|
|
492
|
-
*
|
|
493
|
-
* @param registrations An array of partial ticket data to register.
|
|
494
|
-
* @remarks Registers multiple tickets in a single operation and returns the array of registered tickets.
|
|
495
|
-
*
|
|
496
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#onboard
|
|
497
|
-
*
|
|
498
|
-
* @example
|
|
499
|
-
* ```ts
|
|
500
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
501
|
-
*
|
|
502
|
-
* const registry = createRegistry()
|
|
503
|
-
*
|
|
504
|
-
* const tickets = registry.onboard([
|
|
505
|
-
* { id: 'ticket-1', value: 'value-1' },
|
|
506
|
-
* { id: 'ticket-2', value: 'value-2' },
|
|
507
|
-
* ])
|
|
508
|
-
*
|
|
509
|
-
* console.log(tickets) // [{ id: 'ticket-1', ... }, { id: 'ticket-2', ... }]
|
|
510
|
-
* ```
|
|
511
|
-
*/
|
|
512
|
-
onboard: (registrations: Partial<Z & RegistryTicket>[]) => E[];
|
|
513
|
-
/**
|
|
514
|
-
* Offboard multiple tickets at once
|
|
515
|
-
*
|
|
516
|
-
* @param ids An array of ticket IDs to unregister.
|
|
517
|
-
* @remarks Unregisters multiple tickets in a single operation with optimized reindexing.
|
|
518
|
-
*
|
|
519
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#offboard
|
|
520
|
-
*
|
|
521
|
-
* @example
|
|
522
|
-
* ```ts
|
|
523
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
524
|
-
*
|
|
525
|
-
* const registry = createRegistry()
|
|
526
|
-
*
|
|
527
|
-
* registry.onboard([
|
|
528
|
-
* { id: 'ticket-1', value: 'value-1' },
|
|
529
|
-
* { id: 'ticket-2', value: 'value-2' },
|
|
530
|
-
* { id: 'ticket-3', value: 'value-3' },
|
|
531
|
-
* ])
|
|
532
|
-
*
|
|
533
|
-
* registry.offboard(['ticket-1', 'ticket-3'])
|
|
534
|
-
*
|
|
535
|
-
* console.log(registry.size) // 1
|
|
536
|
-
* ```
|
|
537
|
-
*/
|
|
538
|
-
offboard: (ids: ID[]) => void;
|
|
539
|
-
/**
|
|
540
|
-
* The number of tickets in the registry
|
|
541
|
-
*
|
|
542
|
-
* @remarks Reflects the current size of the internal ticket collection.
|
|
543
|
-
*
|
|
544
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#size
|
|
545
|
-
*
|
|
546
|
-
* @example
|
|
547
|
-
* ```ts
|
|
548
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
549
|
-
*
|
|
550
|
-
* const registry = createRegistry()
|
|
551
|
-
*
|
|
552
|
-
* registry.register({ id: 'ticket-1' })
|
|
553
|
-
* registry.register({ id: 'ticket-2' })
|
|
554
|
-
*
|
|
555
|
-
* console.log(registry.size) // 2
|
|
556
|
-
* ```
|
|
557
|
-
*/
|
|
558
|
-
size: number;
|
|
559
|
-
/**
|
|
560
|
-
* Execute operations in a batch, deferring cache invalidation and event emission until complete
|
|
561
|
-
*
|
|
562
|
-
* @param fn The function containing batch operations.
|
|
563
|
-
* @returns The return value of the batch function.
|
|
564
|
-
* @remarks Useful for bulk operations like onboard(). Invalidation and events happen once at the end, not after each operation.
|
|
565
|
-
*
|
|
566
|
-
* @see https://0.vuetifyjs.com/composables/registration/use-registry#batch
|
|
567
|
-
*
|
|
568
|
-
* @example
|
|
569
|
-
* ```ts
|
|
570
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
571
|
-
*
|
|
572
|
-
* const registry = createRegistry({ events: true })
|
|
573
|
-
*
|
|
574
|
-
* // Without batch: N invalidations + N events
|
|
575
|
-
* // With batch: 1 invalidation + N events (after all registrations)
|
|
576
|
-
* const tickets = registry.batch(() => {
|
|
577
|
-
* return [
|
|
578
|
-
* registry.register({ id: 'a' }),
|
|
579
|
-
* registry.register({ id: 'b' }),
|
|
580
|
-
* registry.register({ id: 'c' }),
|
|
581
|
-
* ]
|
|
582
|
-
* })
|
|
583
|
-
* ```
|
|
584
|
-
*/
|
|
585
|
-
batch: <R>(fn: () => R) => R;
|
|
586
|
-
}
|
|
587
|
-
interface RegistryOptions {
|
|
588
|
-
/**
|
|
589
|
-
* Enable event emission for registry operations
|
|
590
|
-
*
|
|
591
|
-
* @default false
|
|
592
|
-
* @remarks When enabled, the registry will emit events for operations like registration and unregistration. Listeners can be added using the `on` method.
|
|
593
|
-
*
|
|
594
|
-
* @example
|
|
595
|
-
* ```ts
|
|
596
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
597
|
-
*
|
|
598
|
-
* const registry = createRegistry({ events: true })
|
|
599
|
-
*
|
|
600
|
-
* registry.on('register:ticket', (ticket) => {
|
|
601
|
-
* console.log('Ticket registered:', ticket)
|
|
602
|
-
* })
|
|
603
|
-
*
|
|
604
|
-
* registry.register({ id: 'ticket-id' }) // Console: Ticket registered: { id: 'ticket-id', ... }
|
|
605
|
-
* ```
|
|
606
|
-
*/
|
|
607
|
-
events?: boolean;
|
|
608
|
-
/**
|
|
609
|
-
* Enable reactive behavior for registry operations
|
|
610
|
-
*
|
|
611
|
-
* @default false
|
|
612
|
-
* @remarks When enabled, the registry will use Vue's shallowReactive to track changes. This is useful for scenarios where you want to reactively update the registry state in response to changes.
|
|
613
|
-
*
|
|
614
|
-
* @example
|
|
615
|
-
* ```ts
|
|
616
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
617
|
-
*
|
|
618
|
-
* const registry = createRegistry({ reactive: true })
|
|
619
|
-
*
|
|
620
|
-
* registry.register({ id: 'ticket-id' })
|
|
621
|
-
*
|
|
622
|
-
* console.log(registry.size) // 1
|
|
623
|
-
* ```
|
|
624
|
-
*/
|
|
625
|
-
reactive?: boolean;
|
|
626
|
-
}
|
|
627
|
-
interface RegistryContextOptions extends RegistryOptions {
|
|
628
|
-
namespace?: string;
|
|
629
|
-
}
|
|
630
|
-
/**
|
|
631
|
-
* Creates a new registry instance.
|
|
632
|
-
*
|
|
633
|
-
* @param options The options for the registry instance.
|
|
634
|
-
* @template Z The type of registry ticket that extends RegistryTicket. Use this to add custom properties to tickets.
|
|
635
|
-
* @template E The type of registry context that extends RegistryContext<Z>. Use this when extending the registry with additional methods.
|
|
636
|
-
* @returns A new registry instance.
|
|
637
|
-
*
|
|
638
|
-
* @see https://0.vuetifyjs.com/composables/registration/create-registry#create-registry
|
|
639
|
-
*
|
|
640
|
-
* @example
|
|
641
|
-
* ```ts
|
|
642
|
-
* import { createRegistry } from '@vuetify/v0'
|
|
643
|
-
*
|
|
644
|
-
* const registry = createRegistry()
|
|
645
|
-
*
|
|
646
|
-
* const ticket1 = registry.register({ id: 'user-1', value: { name: 'John' } })
|
|
647
|
-
* const ticket2 = registry.register({ id: 'user-2', value: { name: 'Jane' } })
|
|
648
|
-
*
|
|
649
|
-
* console.log(registry.size) // 2
|
|
650
|
-
* console.log(registry.get('user-1')) // { id: 'user-1', index: 0, value: { name: 'John' }, ... }
|
|
651
|
-
* ```
|
|
652
|
-
*/
|
|
653
|
-
declare function createRegistry<Z extends RegistryTicketInput = RegistryTicketInput, E extends RegistryTicket & Z = RegistryTicket & Z>(options?: RegistryOptions): RegistryContext<Z, E>;
|
|
654
|
-
/**
|
|
655
|
-
* Creates a new registry context.
|
|
656
|
-
*
|
|
657
|
-
* @param options The options for the registry context, including `namespace` (defaults to `'v0:registry'`) and `events`.
|
|
658
|
-
* @template Z The type of registry ticket that extends RegistryTicket. Use this to add custom properties to tickets.
|
|
659
|
-
* @template E The type of registry context that extends RegistryContext<Z>. Use this when extending the registry with additional methods.
|
|
660
|
-
* @returns A new registry context.
|
|
661
|
-
*
|
|
662
|
-
* @see https://0.vuetifyjs.com/composables/registration/create-registry#create-registry-context
|
|
663
|
-
*
|
|
664
|
-
* @example
|
|
665
|
-
* ```ts
|
|
666
|
-
* import { createRegistryContext } from '@vuetify/v0'
|
|
667
|
-
*
|
|
668
|
-
* // With default namespace 'v0:registry'
|
|
669
|
-
* export const [useItems, provideItems, items] = createRegistryContext()
|
|
670
|
-
*
|
|
671
|
-
* // Or with custom namespace
|
|
672
|
-
* export const [useItems, provideItems, items] = createRegistryContext({ namespace: 'my-items' })
|
|
673
|
-
*
|
|
674
|
-
* // In a parent component:
|
|
675
|
-
* provideItems()
|
|
676
|
-
*
|
|
677
|
-
* // In a child component:
|
|
678
|
-
* const items = useItems()
|
|
679
|
-
* items.register({ id: 'item-1', value: 'Value 1' })
|
|
680
|
-
* ```
|
|
681
|
-
*/
|
|
682
|
-
declare function createRegistryContext<Z extends RegistryTicketInput = RegistryTicketInput, E extends RegistryTicket & Z = RegistryTicket & Z>(_options?: RegistryContextOptions): ContextTrinity<RegistryContext<Z, E>>;
|
|
683
|
-
/**
|
|
684
|
-
* Uses an existing registry from context.
|
|
685
|
-
*
|
|
686
|
-
* @param namespace The namespace for the registry context. Defaults to `'v0:registry'`.
|
|
687
|
-
* @template Z The type of registry ticket that extends RegistryTicket.
|
|
688
|
-
* @template E The type of registry context that extends RegistryContext<Z>.
|
|
689
|
-
* @returns The registry instance.
|
|
690
|
-
*
|
|
691
|
-
* @see https://0.vuetifyjs.com/composables/registration/create-registry#use-registry
|
|
692
|
-
*
|
|
693
|
-
* @example
|
|
694
|
-
* ```ts
|
|
695
|
-
* import { useRegistry } from '@vuetify/v0'
|
|
696
|
-
*
|
|
697
|
-
* // In a child component (after provideRegistry was called by an ancestor):
|
|
698
|
-
* const registry = useRegistry()
|
|
699
|
-
*
|
|
700
|
-
* registry.register({ id: 'item-1', value: 'Value 1' })
|
|
701
|
-
* ```
|
|
702
|
-
*/
|
|
703
|
-
declare function useRegistry<Z extends RegistryTicketInput = RegistryTicketInput, E extends RegistryTicket & Z = RegistryTicket & Z>(namespace?: string): RegistryContext<Z, E>;
|
|
704
|
-
//#endregion
|
|
705
11
|
//#region src/composables/createModel/index.d.ts
|
|
706
12
|
/**
|
|
707
13
|
* Input type for model tickets - what users provide to register().
|
|
@@ -718,9 +24,7 @@ interface ModelTicketInput<V = unknown> extends RegistryTicketInput<V> {
|
|
|
718
24
|
* @template Z The input ticket type that extends ModelTicketInput.
|
|
719
25
|
*/
|
|
720
26
|
type ModelTicket<Z extends ModelTicketInput = ModelTicketInput> = RegistryTicket & Z & {
|
|
721
|
-
/** Disabled state of the ticket (guaranteed to exist on output) */
|
|
722
|
-
disabled: MaybeRefOrGetter<boolean>;
|
|
723
|
-
/** Whether the ticket is currently selected */
|
|
27
|
+
/** Disabled state of the ticket (guaranteed to exist on output) */disabled: MaybeRefOrGetter<boolean>; /** Whether the ticket is currently selected */
|
|
724
28
|
isSelected: Readonly<Ref<boolean, boolean>>;
|
|
725
29
|
};
|
|
726
30
|
/**
|
|
@@ -1054,11 +358,8 @@ interface SelectionTicketInput<V = unknown> extends ModelTicketInput<V> {}
|
|
|
1054
358
|
* - `toggle()` - Method to toggle selection state
|
|
1055
359
|
*/
|
|
1056
360
|
type SelectionTicket<Z extends SelectionTicketInput = SelectionTicketInput> = ModelTicket<Z> & {
|
|
1057
|
-
/** Select self */
|
|
1058
|
-
|
|
1059
|
-
/** Unselect self */
|
|
1060
|
-
unselect: () => void;
|
|
1061
|
-
/** Toggle self on and off */
|
|
361
|
+
/** Select self */select: () => void; /** Unselect self */
|
|
362
|
+
unselect: () => void; /** Toggle self on and off */
|
|
1062
363
|
toggle: () => void;
|
|
1063
364
|
};
|
|
1064
365
|
/**
|
|
@@ -1500,11 +801,8 @@ interface GroupTicketInput<V = unknown> extends SelectionTicketInput<V> {
|
|
|
1500
801
|
* Includes all input properties plus selection and tri-state methods.
|
|
1501
802
|
*/
|
|
1502
803
|
type GroupTicket<Z extends GroupTicketInput = GroupTicketInput> = SelectionTicket<Z> & {
|
|
1503
|
-
/** Whether the ticket is in a mixed/indeterminate state */
|
|
1504
|
-
|
|
1505
|
-
/** Set self to mixed/indeterminate state */
|
|
1506
|
-
mix: () => void;
|
|
1507
|
-
/** Clear mixed/indeterminate state from self */
|
|
804
|
+
/** Whether the ticket is in a mixed/indeterminate state */isMixed: Readonly<Ref<boolean>>; /** Set self to mixed/indeterminate state */
|
|
805
|
+
mix: () => void; /** Clear mixed/indeterminate state from self */
|
|
1508
806
|
unmix: () => void;
|
|
1509
807
|
};
|
|
1510
808
|
/**
|
|
@@ -2090,6 +1388,7 @@ declare function toReactive<Z extends object>(objectRef: MaybeRef<Z>): UnwrapNes
|
|
|
2090
1388
|
type BreakpointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
2091
1389
|
interface BreakpointsContext {
|
|
2092
1390
|
breakpoints: Readonly<Record<BreakpointName, number>>;
|
|
1391
|
+
mobileBreakpoint: BreakpointName | number;
|
|
2093
1392
|
name: Readonly<ShallowRef<BreakpointName>>;
|
|
2094
1393
|
width: Readonly<ShallowRef<number>>;
|
|
2095
1394
|
height: Readonly<ShallowRef<number>>;
|
|
@@ -2497,164 +1796,6 @@ declare function useWindowEventListener<E extends keyof WindowEventMap>(event: M
|
|
|
2497
1796
|
*/
|
|
2498
1797
|
declare function useDocumentEventListener<E extends keyof DocumentEventMap>(event: MaybeRefOrGetter<MaybeArray<E>>, listener: MaybeRef<MaybeArray<(this: Document, event: DocumentEventMap[E]) => void>>, options?: MaybeRefOrGetter<boolean | AddEventListenerOptions>): CleanupFunction;
|
|
2499
1798
|
//#endregion
|
|
2500
|
-
//#region src/composables/createTokens/index.d.ts
|
|
2501
|
-
interface TokenAlias<T = unknown> {
|
|
2502
|
-
[key: string]: unknown;
|
|
2503
|
-
$value: T;
|
|
2504
|
-
$type?: string;
|
|
2505
|
-
$description?: string;
|
|
2506
|
-
$extensions?: Record<string, unknown>;
|
|
2507
|
-
$deprecated?: boolean | string;
|
|
2508
|
-
}
|
|
2509
|
-
type TokenPrimitive = string | number | boolean | null | Function;
|
|
2510
|
-
type TokenValue = TokenPrimitive | TokenAlias;
|
|
2511
|
-
interface TokenCollection {
|
|
2512
|
-
[key: string]: TokenValue | TokenCollection;
|
|
2513
|
-
}
|
|
2514
|
-
type FlatTokenCollection = {
|
|
2515
|
-
id: string;
|
|
2516
|
-
value: TokenValue;
|
|
2517
|
-
};
|
|
2518
|
-
interface TokenTicket<Z extends TokenValue = TokenValue> extends RegistryTicket<Z> {}
|
|
2519
|
-
interface TokenContext<Z extends TokenTicket> extends RegistryContext<Z> {
|
|
2520
|
-
/**
|
|
2521
|
-
* Checks if a token is an alias
|
|
2522
|
-
*
|
|
2523
|
-
* @param token The token to check.
|
|
2524
|
-
* @returns True if the token is an alias, false otherwise.
|
|
2525
|
-
* @remarks An alias is a string that starts with "{" and ends with "}".
|
|
2526
|
-
*
|
|
2527
|
-
* @see https://0.vuetifyjs.com/composables/registration/create-tokens#is-alias
|
|
2528
|
-
*
|
|
2529
|
-
* @example
|
|
2530
|
-
* ```ts
|
|
2531
|
-
* const tokens = createTokens({
|
|
2532
|
-
* colors: {
|
|
2533
|
-
* primary: '#3b82f6',
|
|
2534
|
-
* secondary: '{colors.primary}', // Alias reference
|
|
2535
|
-
* },
|
|
2536
|
-
* })
|
|
2537
|
-
*
|
|
2538
|
-
* console.log(tokens.isAlias('{colors.primary}')) // true
|
|
2539
|
-
* console.log(tokens.isAlias('#3b82f6')) // false
|
|
2540
|
-
* ```
|
|
2541
|
-
*/
|
|
2542
|
-
isAlias: (token: unknown) => token is string;
|
|
2543
|
-
/**
|
|
2544
|
-
* Resolves a token or alias to its value.
|
|
2545
|
-
*
|
|
2546
|
-
* @param token The token or alias to resolve.
|
|
2547
|
-
* @returns The resolved value of the token or alias, or undefined if not found.
|
|
2548
|
-
* @remarks This function can resolve nested aliases and supports token paths using dot notation.
|
|
2549
|
-
*
|
|
2550
|
-
* @see https://0.vuetifyjs.com/composables/registration/create-tokens#resolve
|
|
2551
|
-
*
|
|
2552
|
-
* @example
|
|
2553
|
-
* ```ts
|
|
2554
|
-
* const tokens = createTokens({
|
|
2555
|
-
* colors: {
|
|
2556
|
-
* primary: '#3b82f6',
|
|
2557
|
-
* secondary: '{colors.primary}', // Alias reference
|
|
2558
|
-
* },
|
|
2559
|
-
* })
|
|
2560
|
-
*
|
|
2561
|
-
* console.log(tokens.resolve('{colors.primary}')) // '#3b82f6'
|
|
2562
|
-
* console.log(tokens.resolve('{colors.secondary}')) // '#3b82f6'
|
|
2563
|
-
* ```
|
|
2564
|
-
*/
|
|
2565
|
-
resolve: (token: string | TokenAlias) => unknown | undefined;
|
|
2566
|
-
}
|
|
2567
|
-
interface TokenOptions extends RegistryOptions {
|
|
2568
|
-
/**
|
|
2569
|
-
* Whether to flatten nested token structures.
|
|
2570
|
-
*
|
|
2571
|
-
* @default false
|
|
2572
|
-
*/
|
|
2573
|
-
flat?: boolean;
|
|
2574
|
-
/**
|
|
2575
|
-
* An optional prefix to prepend to each token ID during registration.
|
|
2576
|
-
*
|
|
2577
|
-
* @remarks This is useful for namespacing tokens.
|
|
2578
|
-
*/
|
|
2579
|
-
prefix?: string;
|
|
2580
|
-
}
|
|
2581
|
-
interface TokenContextOptions extends TokenOptions, RegistryContextOptions {
|
|
2582
|
-
tokens?: TokenCollection;
|
|
2583
|
-
}
|
|
2584
|
-
/**
|
|
2585
|
-
* Creates a new token instance.
|
|
2586
|
-
*
|
|
2587
|
-
* @param tokens The tokens to use.
|
|
2588
|
-
* @param options The options for the token instance.
|
|
2589
|
-
* @template Z The type of the token ticket.
|
|
2590
|
-
* @template E The type of the token context.
|
|
2591
|
-
* @returns A new token instance.
|
|
2592
|
-
*
|
|
2593
|
-
* @see https://www.designtokens.org/tr/drafts/format/
|
|
2594
|
-
* @see https://0.vuetifyjs.com/composables/registration/create-tokens
|
|
2595
|
-
*
|
|
2596
|
-
* @example
|
|
2597
|
-
* ```ts
|
|
2598
|
-
* import { createTokens } from '@vuetify/v0'
|
|
2599
|
-
*
|
|
2600
|
-
* const tokens = createTokens({
|
|
2601
|
-
* colors: {
|
|
2602
|
-
* primary: '#3b82f6',
|
|
2603
|
-
* secondary: '{colors.primary}', // Alias reference
|
|
2604
|
-
* },
|
|
2605
|
-
* })
|
|
2606
|
-
*
|
|
2607
|
-
* console.log(tokens.resolve('{colors.primary}')) // '#3b82f6'
|
|
2608
|
-
* console.log(tokens.resolve('{colors.secondary}')) // '#3b82f6'
|
|
2609
|
-
* ```
|
|
2610
|
-
*/
|
|
2611
|
-
declare function createTokens<Z extends TokenTicket = TokenTicket, E extends TokenContext<Z> = TokenContext<Z>>(tokens?: TokenCollection, options?: TokenOptions): E;
|
|
2612
|
-
/**
|
|
2613
|
-
* Creates a new token context.
|
|
2614
|
-
*
|
|
2615
|
-
* @param namespace The namespace for the token context.
|
|
2616
|
-
* @param tokens The tokens to use.
|
|
2617
|
-
* @template Z The type of the token ticket.
|
|
2618
|
-
* @template E The type of the token context.
|
|
2619
|
-
* @returns A new token context.
|
|
2620
|
-
*
|
|
2621
|
-
* @see https://0.vuetifyjs.com/composables/registration/create-tokens
|
|
2622
|
-
*
|
|
2623
|
-
* @example
|
|
2624
|
-
* ```ts
|
|
2625
|
-
* import { createTokensContext } from '@vuetify/v0'
|
|
2626
|
-
*
|
|
2627
|
-
* export const [useTokens, provideTokens, context] = createTokensContext({
|
|
2628
|
-
* namespace: 'v0:tokens',
|
|
2629
|
-
* tokens: {
|
|
2630
|
-
* colors: {
|
|
2631
|
-
* primary: '#3b82f6',
|
|
2632
|
-
* secondary: '{colors.primary}', // Alias reference
|
|
2633
|
-
* },
|
|
2634
|
-
* },
|
|
2635
|
-
* })
|
|
2636
|
-
* ```
|
|
2637
|
-
*/
|
|
2638
|
-
declare function createTokensContext<Z extends TokenTicket = TokenTicket, E extends TokenContext<Z> = TokenContext<Z>>(_options: TokenContextOptions): ContextTrinity<E>;
|
|
2639
|
-
/**
|
|
2640
|
-
* Returns the current tokens instance.
|
|
2641
|
-
*
|
|
2642
|
-
* @param namespace The namespace for the tokens context. Defaults to `'v0:tokens'`.
|
|
2643
|
-
* @returns The current tokens instance.
|
|
2644
|
-
*
|
|
2645
|
-
* @see https://0.vuetifyjs.com/composables/registration/create-tokens
|
|
2646
|
-
*
|
|
2647
|
-
* @example
|
|
2648
|
-
* ```vue
|
|
2649
|
-
* <script setup lang="ts">
|
|
2650
|
-
* import { useTokens } from '@vuetify/v0'
|
|
2651
|
-
*
|
|
2652
|
-
* const tokens = useTokens()
|
|
2653
|
-
* </script>
|
|
2654
|
-
* ```
|
|
2655
|
-
*/
|
|
2656
|
-
declare function useTokens<Z extends TokenTicket = TokenTicket, E extends TokenContext<Z> = TokenContext<Z>>(namespace?: string): E;
|
|
2657
|
-
//#endregion
|
|
2658
1799
|
//#region src/composables/useFeatures/index.d.ts
|
|
2659
1800
|
/**
|
|
2660
1801
|
* Input type for feature tickets - what users provide to register().
|
|
@@ -2727,100 +1868,250 @@ interface FeaturePluginOptions extends FeatureContextOptions {
|
|
|
2727
1868
|
declare function createFeatures<Z extends FeatureTicketInput = FeatureTicketInput, E extends FeatureTicket<Z> = FeatureTicket<Z>, R extends FeatureContext<Z, E> = FeatureContext<Z, E>>(_options?: FeatureOptions): R;
|
|
2728
1869
|
declare const createFeaturesContext: <_E extends FeatureContext<FeatureTicketInput, FeatureTicket<FeatureTicketInput>> = FeatureContext<FeatureTicketInput, FeatureTicket<FeatureTicketInput>>>(_options?: FeaturePluginOptions | undefined) => ContextTrinity<_E>, createFeaturesPlugin: (_options?: FeaturePluginOptions | undefined) => Plugin, useFeatures: <_E extends FeatureContext<FeatureTicketInput, FeatureTicket<FeatureTicketInput>> = FeatureContext<FeatureTicketInput, FeatureTicket<FeatureTicketInput>>>(namespace?: string) => _E;
|
|
2729
1870
|
//#endregion
|
|
2730
|
-
//#region src/composables/
|
|
2731
|
-
type FormValidationResult = string | true | Promise<string | true>;
|
|
2732
|
-
type FormValidationRule = (value: unknown) => FormValidationResult;
|
|
2733
|
-
type FormValue = Ref<unknown> | ShallowRef<unknown>;
|
|
1871
|
+
//#region src/composables/useRules/adapters/standard.d.ts
|
|
2734
1872
|
/**
|
|
2735
|
-
*
|
|
2736
|
-
*
|
|
1873
|
+
* Minimal duck-typed interface matching the Standard Schema spec (v1).
|
|
1874
|
+
* No npm dependency — structurally compatible with Zod (v3.24+), Valibot, ArkType, and others.
|
|
2737
1875
|
*
|
|
2738
|
-
* @
|
|
1876
|
+
* @see https://standardschema.dev/
|
|
2739
1877
|
*/
|
|
2740
|
-
interface
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
1878
|
+
interface StandardSchemaIssue {
|
|
1879
|
+
message: string;
|
|
1880
|
+
path?: ReadonlyArray<{
|
|
1881
|
+
key: PropertyKey;
|
|
1882
|
+
}>;
|
|
1883
|
+
}
|
|
1884
|
+
interface StandardSchemaResult {
|
|
1885
|
+
value?: unknown;
|
|
1886
|
+
issues?: ReadonlyArray<StandardSchemaIssue>;
|
|
1887
|
+
}
|
|
1888
|
+
interface StandardSchemaV1 {
|
|
1889
|
+
'~standard': {
|
|
1890
|
+
version: 1;
|
|
1891
|
+
vendor: string;
|
|
1892
|
+
validate: (value: unknown) => StandardSchemaResult | Promise<StandardSchemaResult>;
|
|
1893
|
+
};
|
|
2747
1894
|
}
|
|
2748
1895
|
/**
|
|
2749
|
-
*
|
|
2750
|
-
*
|
|
1896
|
+
* Type guard for Standard Schema objects.
|
|
1897
|
+
* Checks for the `~standard` property that all conforming libraries expose.
|
|
2751
1898
|
*
|
|
2752
|
-
* @
|
|
1899
|
+
* @param value The value to check.
|
|
1900
|
+
* @returns `true` if the value conforms to the Standard Schema interface.
|
|
1901
|
+
*/
|
|
1902
|
+
declare function isStandardSchema(value: unknown): value is StandardSchemaV1;
|
|
1903
|
+
//#endregion
|
|
1904
|
+
//#region src/composables/useRules/index.d.ts
|
|
1905
|
+
/** A rule alias: a string name referencing a registered predicate. */
|
|
1906
|
+
type RuleAlias = string;
|
|
1907
|
+
/**
|
|
1908
|
+
* Input accepted by resolve(): alias strings, raw validation functions,
|
|
1909
|
+
* or Standard Schema objects (Zod v3.24+, Valibot, ArkType, etc.).
|
|
1910
|
+
*/
|
|
1911
|
+
type RuleInput = RuleAlias | FormValidationRule | StandardSchemaV1;
|
|
1912
|
+
/** A map of alias names to predicate functions. */
|
|
1913
|
+
interface RuleAliases {
|
|
1914
|
+
[name: string]: FormValidationRule;
|
|
1915
|
+
}
|
|
1916
|
+
interface RulesContext {
|
|
1917
|
+
/** Resolve aliases, functions, and Standard Schema objects to FormValidationRule[]. */
|
|
1918
|
+
resolve: (rules: RuleInput[]) => FormValidationRule[];
|
|
1919
|
+
/** The alias map (custom aliases registered via options). */
|
|
1920
|
+
aliases: RuleAliases;
|
|
1921
|
+
}
|
|
1922
|
+
interface RulesOptions {
|
|
1923
|
+
/** Custom aliases to register. Each alias is a predicate (FormValidationRule). */
|
|
1924
|
+
aliases?: Partial<RuleAliases>;
|
|
1925
|
+
}
|
|
1926
|
+
interface RulesContextOptions extends RulesOptions {
|
|
1927
|
+
namespace?: string;
|
|
1928
|
+
}
|
|
1929
|
+
/**
|
|
1930
|
+
* Creates a new rules instance.
|
|
1931
|
+
*
|
|
1932
|
+
* @param options The options for the rules instance.
|
|
1933
|
+
* @returns A new rules instance with resolve() and aliases.
|
|
1934
|
+
*
|
|
1935
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-rules
|
|
1936
|
+
*
|
|
1937
|
+
* @example
|
|
1938
|
+
* ```ts
|
|
1939
|
+
* import { createRules } from '@vuetify/v0'
|
|
1940
|
+
*
|
|
1941
|
+
* const rules = createRules({
|
|
1942
|
+
* aliases: {
|
|
1943
|
+
* required: (v) => !!v || false,
|
|
1944
|
+
* },
|
|
1945
|
+
* })
|
|
1946
|
+
*
|
|
1947
|
+
* // Resolve alias strings to validation functions
|
|
1948
|
+
* const resolved = rules.resolve(['required'])
|
|
1949
|
+
* ```
|
|
1950
|
+
*/
|
|
1951
|
+
declare function createRules(_options?: RulesOptions): RulesContext;
|
|
1952
|
+
/**
|
|
1953
|
+
* Creates a fallback rules instance for use outside component scope.
|
|
1954
|
+
* No locale lookup — `false` returns fall back to the alias name.
|
|
1955
|
+
*
|
|
1956
|
+
* @returns A standalone rules context with empty aliases.
|
|
1957
|
+
*/
|
|
1958
|
+
declare function createRulesFallback(): RulesContext;
|
|
1959
|
+
declare const createRulesContext: <_E extends RulesContext = RulesContext>(_options?: RulesContextOptions | undefined) => ContextTrinity<_E>, createRulesPlugin: (_options?: RulesContextOptions | undefined) => Plugin, useRules: <_E extends RulesContext = RulesContext>(namespace?: string) => _E;
|
|
1960
|
+
//#endregion
|
|
1961
|
+
//#region src/composables/createValidation/index.d.ts
|
|
1962
|
+
/**
|
|
1963
|
+
* Input type for validation tickets.
|
|
1964
|
+
* Each ticket represents a single validation rule.
|
|
2753
1965
|
*/
|
|
2754
|
-
|
|
2755
|
-
|
|
1966
|
+
interface ValidationTicketInput extends GroupTicketInput<FormValidationRule> {}
|
|
1967
|
+
/**
|
|
1968
|
+
* Output type for validation tickets.
|
|
1969
|
+
* Includes selection methods from GroupTicket for enabling/disabling rules.
|
|
1970
|
+
*/
|
|
1971
|
+
type ValidationTicket<Z extends ValidationTicketInput = ValidationTicketInput> = GroupTicket<Z>;
|
|
1972
|
+
/**
|
|
1973
|
+
* Context for managing validation rules for a single input.
|
|
1974
|
+
*
|
|
1975
|
+
* @template Z The input ticket type.
|
|
1976
|
+
* @template E The output ticket type.
|
|
1977
|
+
*/
|
|
1978
|
+
interface ValidationContext<Z extends ValidationTicketInput = ValidationTicketInput, E extends ValidationTicket<Z> = ValidationTicket<Z>> extends Omit<GroupContext<Z, E>, 'register' | 'onboard' | 'reset'> {
|
|
1979
|
+
register: (rule: RuleInput | Partial<Z>) => E;
|
|
1980
|
+
onboard: (rules: (RuleInput | Partial<Z>)[]) => E[];
|
|
1981
|
+
/** Run validation against all active (selected) rules. */
|
|
1982
|
+
validate: (value?: unknown, silent?: boolean) => Promise<boolean>;
|
|
1983
|
+
/** Reset errors and validation state. Does not affect rule selection. */
|
|
2756
1984
|
reset: () => void;
|
|
2757
|
-
|
|
2758
|
-
disabled: boolean;
|
|
1985
|
+
/** Current validation error messages. */
|
|
2759
1986
|
errors: ShallowRef<string[]>;
|
|
2760
|
-
|
|
2761
|
-
isPristine: ShallowRef<boolean>;
|
|
1987
|
+
/** Tri-state: null (not validated), true (valid), false (invalid). */
|
|
2762
1988
|
isValid: ShallowRef<boolean | null>;
|
|
1989
|
+
/** Whether async validation is in progress. */
|
|
2763
1990
|
isValidating: ShallowRef<boolean>;
|
|
2764
|
-
}
|
|
1991
|
+
}
|
|
1992
|
+
interface ValidationOptions extends GroupOptions {
|
|
1993
|
+
/** Initial rules to register. */
|
|
1994
|
+
rules?: RuleInput[];
|
|
1995
|
+
/** Value source for validate() when called without arguments. */
|
|
1996
|
+
value?: MaybeRefOrGetter<unknown>;
|
|
1997
|
+
}
|
|
1998
|
+
/**
|
|
1999
|
+
* Creates a per-input validation instance.
|
|
2000
|
+
*
|
|
2001
|
+
* Built on `createGroup` — each registered rule becomes a ticket that can be
|
|
2002
|
+
* enabled/disabled via selection methods (`select`, `unselect`, `toggle`).
|
|
2003
|
+
* Only selected (active) rules run during validation.
|
|
2004
|
+
*
|
|
2005
|
+
* @param options The options for the validation instance.
|
|
2006
|
+
* @returns A new validation context.
|
|
2007
|
+
*
|
|
2008
|
+
* @see https://0.vuetifyjs.com/composables/forms/create-validation
|
|
2009
|
+
*
|
|
2010
|
+
* @example
|
|
2011
|
+
* ```ts
|
|
2012
|
+
* import { createValidation } from '@vuetify/v0'
|
|
2013
|
+
*
|
|
2014
|
+
* const validation = createValidation({
|
|
2015
|
+
* rules: [
|
|
2016
|
+
* v => !!v || 'Required',
|
|
2017
|
+
* v => /^.+@\S+\.\S+$/.test(String(v)) || 'Invalid email',
|
|
2018
|
+
* ],
|
|
2019
|
+
* })
|
|
2020
|
+
*
|
|
2021
|
+
* await validation.validate('')
|
|
2022
|
+
*
|
|
2023
|
+
* console.log(validation.errors.value) // ['Required', 'Invalid email']
|
|
2024
|
+
*
|
|
2025
|
+
* validation.reset()
|
|
2026
|
+
* ```
|
|
2027
|
+
*/
|
|
2028
|
+
declare function createValidation<Z extends ValidationTicketInput = ValidationTicketInput, E extends ValidationTicket<Z> = ValidationTicket<Z>, R extends ValidationContext<Z, E> = ValidationContext<Z, E>>(_options?: ValidationOptions): R;
|
|
2029
|
+
//#endregion
|
|
2030
|
+
//#region src/composables/createForm/index.d.ts
|
|
2031
|
+
type FormValidationResult = string | boolean | Promise<string | boolean>;
|
|
2032
|
+
type FormValidationRule = (value: unknown) => FormValidationResult;
|
|
2033
|
+
type FormValue = ValidationContext;
|
|
2034
|
+
/**
|
|
2035
|
+
* User-facing input shape for form tickets.
|
|
2036
|
+
*/
|
|
2037
|
+
interface FormTicketInput extends RegistryTicketInput<FormValue> {}
|
|
2038
|
+
/**
|
|
2039
|
+
* A registered validation in the form registry.
|
|
2040
|
+
*
|
|
2041
|
+
* @template Z The input ticket type that extends FormTicketInput.
|
|
2042
|
+
*/
|
|
2043
|
+
type FormTicket<Z extends FormTicketInput = FormTicketInput> = RegistryTicket<FormValue> & Z;
|
|
2765
2044
|
/**
|
|
2766
|
-
* Context for
|
|
2045
|
+
* Context for coordinating validation across multiple fields.
|
|
2767
2046
|
*
|
|
2768
2047
|
* @template Z The input ticket type.
|
|
2769
2048
|
* @template E The output ticket type.
|
|
2770
2049
|
*/
|
|
2771
2050
|
interface FormContext<Z extends FormTicketInput = FormTicketInput, E extends FormTicket<Z> = FormTicket<Z>> extends Omit<RegistryContext<E>, 'register' | 'onboard'> {
|
|
2772
|
-
|
|
2773
|
-
|
|
2051
|
+
/** Register a validation context with the form. */
|
|
2052
|
+
register: (registration: Partial<Z> & {
|
|
2053
|
+
value: FormValue;
|
|
2054
|
+
}) => E;
|
|
2055
|
+
/** Submit: validate specific fields or all. */
|
|
2774
2056
|
submit: (id?: ID | ID[]) => Promise<boolean>;
|
|
2057
|
+
/** Reset all registered validations. */
|
|
2775
2058
|
reset: () => void;
|
|
2776
|
-
|
|
2059
|
+
/** Whether the form is disabled. Components can read this to conditionally disable inputs. */
|
|
2060
|
+
disabled: MaybeRefOrGetter<boolean>;
|
|
2061
|
+
/** Whether the form is readonly. Components can read this to conditionally disable inputs. */
|
|
2062
|
+
readonly: MaybeRefOrGetter<boolean>;
|
|
2063
|
+
/** Aggregate: true if all validations valid, false if any invalid, null if any unvalidated. */
|
|
2777
2064
|
isValid: ComputedRef<boolean | null>;
|
|
2065
|
+
/** Aggregate: true if any validation is in progress. */
|
|
2778
2066
|
isValidating: ComputedRef<boolean>;
|
|
2779
2067
|
}
|
|
2780
2068
|
interface FormOptions extends RegistryOptions {
|
|
2781
|
-
|
|
2069
|
+
/** Whether the form starts disabled. */
|
|
2070
|
+
disabled?: MaybeRefOrGetter<boolean>;
|
|
2071
|
+
/** Whether the form starts readonly. */
|
|
2072
|
+
readonly?: MaybeRefOrGetter<boolean>;
|
|
2782
2073
|
}
|
|
2783
|
-
interface FormContextOptions extends
|
|
2074
|
+
interface FormContextOptions extends FormOptions {
|
|
2784
2075
|
namespace?: string;
|
|
2785
|
-
validateOn?: 'submit' | 'change' | string;
|
|
2786
2076
|
}
|
|
2787
2077
|
/**
|
|
2788
2078
|
* Creates a new form instance.
|
|
2789
2079
|
*
|
|
2080
|
+
* A form is a pure registry of validation contexts. Validations register
|
|
2081
|
+
* themselves via `useForm()` injection. The form coordinates submit, reset,
|
|
2082
|
+
* and aggregate state across all registered validations.
|
|
2083
|
+
*
|
|
2790
2084
|
* @param options The options for the form instance.
|
|
2791
|
-
* @
|
|
2792
|
-
* @template E The type of the form context.
|
|
2793
|
-
* @returns A new form instance.
|
|
2085
|
+
* @returns A new form context.
|
|
2794
2086
|
*
|
|
2795
2087
|
* @see https://0.vuetifyjs.com/composables/forms/create-form
|
|
2796
2088
|
*
|
|
2797
2089
|
* @example
|
|
2798
2090
|
* ```ts
|
|
2799
|
-
* import { createForm } from '@vuetify/v0'
|
|
2091
|
+
* import { createForm, createValidation } from '@vuetify/v0'
|
|
2092
|
+
* import { shallowRef } from 'vue'
|
|
2800
2093
|
*
|
|
2801
2094
|
* const form = createForm()
|
|
2802
2095
|
*
|
|
2803
|
-
*
|
|
2804
|
-
*
|
|
2805
|
-
*
|
|
2806
|
-
*
|
|
2096
|
+
* // Each validation is one input — form is just the coordinator
|
|
2097
|
+
* const email = shallowRef('')
|
|
2098
|
+
* const validation = createValidation({
|
|
2099
|
+
* value: email,
|
|
2100
|
+
* rules: ['required', 'email'],
|
|
2807
2101
|
* })
|
|
2808
2102
|
*
|
|
2809
|
-
*
|
|
2810
|
-
*
|
|
2811
|
-
* console.log(username.errors.value) // ['Username is required']
|
|
2103
|
+
* form.register({ value: validation })
|
|
2812
2104
|
*
|
|
2105
|
+
* await form.submit()
|
|
2813
2106
|
* form.reset()
|
|
2814
2107
|
* ```
|
|
2815
2108
|
*/
|
|
2816
2109
|
declare function createForm<Z extends FormTicketInput = FormTicketInput, E extends FormTicket<Z> = FormTicket<Z>, R extends FormContext<Z, E> = FormContext<Z, E>>(options?: FormOptions): R;
|
|
2817
2110
|
/**
|
|
2818
|
-
* Creates a new form context.
|
|
2111
|
+
* Creates a new form context using the Trinity pattern.
|
|
2819
2112
|
*
|
|
2820
2113
|
* @param options The options for the form context.
|
|
2821
|
-
* @
|
|
2822
|
-
* @template E The type of the form context.
|
|
2823
|
-
* @returns A new form context.
|
|
2114
|
+
* @returns A Trinity tuple: [useFormContext, provideFormContext, formContext]
|
|
2824
2115
|
*
|
|
2825
2116
|
* @see https://0.vuetifyjs.com/composables/forms/create-form
|
|
2826
2117
|
*
|
|
@@ -2828,21 +2119,7 @@ declare function createForm<Z extends FormTicketInput = FormTicketInput, E exten
|
|
|
2828
2119
|
* ```ts
|
|
2829
2120
|
* import { createFormContext } from '@vuetify/v0'
|
|
2830
2121
|
*
|
|
2831
|
-
*
|
|
2832
|
-
* export const [useMyForm, provideMyForm, myForm] = createFormContext({ validateOn: 'change' })
|
|
2833
|
-
*
|
|
2834
|
-
* // Or with custom namespace
|
|
2835
|
-
* export const [useMyForm, provideMyForm, myForm] = createFormContext({
|
|
2836
|
-
* namespace: 'my-form',
|
|
2837
|
-
* validateOn: 'change',
|
|
2838
|
-
* })
|
|
2839
|
-
*
|
|
2840
|
-
* // In a parent component:
|
|
2841
|
-
* provideMyForm()
|
|
2842
|
-
*
|
|
2843
|
-
* // In a child component:
|
|
2844
|
-
* const form = useMyForm()
|
|
2845
|
-
* form.register({ id: 'field', value: ref(''), rules: [...] })
|
|
2122
|
+
* export const [useMyForm, provideMyForm, myForm] = createFormContext()
|
|
2846
2123
|
* ```
|
|
2847
2124
|
*/
|
|
2848
2125
|
declare function createFormContext<Z extends FormTicketInput = FormTicketInput, E extends FormTicket<Z> = FormTicket<Z>, R extends FormContext<Z, E> = FormContext<Z, E>>(_options?: FormContextOptions): ContextTrinity<R>;
|
|
@@ -2850,7 +2127,7 @@ declare function createFormContext<Z extends FormTicketInput = FormTicketInput,
|
|
|
2850
2127
|
* Returns the current form instance.
|
|
2851
2128
|
*
|
|
2852
2129
|
* @param namespace The namespace for the form context. Defaults to `'v0:form'`.
|
|
2853
|
-
* @returns The current form instance.
|
|
2130
|
+
* @returns The current form instance, or undefined if not provided.
|
|
2854
2131
|
*
|
|
2855
2132
|
* @see https://0.vuetifyjs.com/composables/forms/create-form
|
|
2856
2133
|
*
|
|
@@ -2861,15 +2138,9 @@ declare function createFormContext<Z extends FormTicketInput = FormTicketInput,
|
|
|
2861
2138
|
*
|
|
2862
2139
|
* const form = useForm()
|
|
2863
2140
|
* </script>
|
|
2864
|
-
*
|
|
2865
|
-
* <template>
|
|
2866
|
-
* <div>
|
|
2867
|
-
* <p>Form is {{ form.isValid.value ? 'valid' : 'invalid' }}</p>
|
|
2868
|
-
* </div>
|
|
2869
|
-
* </template>
|
|
2870
2141
|
* ```
|
|
2871
2142
|
*/
|
|
2872
|
-
declare function useForm<Z extends FormTicketInput = FormTicketInput, E extends FormTicket<Z> = FormTicket<Z>, R extends FormContext<Z, E> = FormContext<Z, E>>(namespace?: string): R;
|
|
2143
|
+
declare function useForm<Z extends FormTicketInput = FormTicketInput, E extends FormTicket<Z> = FormTicket<Z>, R extends FormContext<Z, E> = FormContext<Z, E>>(namespace?: string): R | undefined;
|
|
2873
2144
|
//#endregion
|
|
2874
2145
|
//#region src/composables/useHotkey/index.d.ts
|
|
2875
2146
|
interface UseHotkeyOptions {
|
|
@@ -3244,7 +2515,7 @@ interface LocaleContext<Z extends LocaleTicketInput = LocaleTicketInput, E exten
|
|
|
3244
2515
|
* // If not found: returns 'Go to page 5'
|
|
3245
2516
|
* ```
|
|
3246
2517
|
*/
|
|
3247
|
-
t: (key: string, params?: Record<string, unknown
|
|
2518
|
+
t: (key: string, params?: Record<string, unknown> | unknown[], fallback?: string) => string;
|
|
3248
2519
|
n: (value: number) => string;
|
|
3249
2520
|
/** Register a locale (accepts input type, returns output type) */
|
|
3250
2521
|
register: (registration?: Partial<Z>) => E;
|
|
@@ -3509,41 +2780,23 @@ interface NestedTicketInput<V = unknown> extends GroupTicketInput<V> {
|
|
|
3509
2780
|
* @template Z The input ticket type that extends NestedTicketInput.
|
|
3510
2781
|
*/
|
|
3511
2782
|
type NestedTicket<Z extends NestedTicketInput = NestedTicketInput> = GroupTicket<Z> & {
|
|
3512
|
-
/** ID of the parent ticket, or undefined if this is a root item */
|
|
3513
|
-
|
|
3514
|
-
/** Whether this ticket is
|
|
3515
|
-
|
|
3516
|
-
/**
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
/**
|
|
3523
|
-
|
|
3524
|
-
/**
|
|
3525
|
-
|
|
3526
|
-
/**
|
|
3527
|
-
|
|
3528
|
-
/**
|
|
3529
|
-
reveal: () => void;
|
|
3530
|
-
/** Activate/highlight this ticket */
|
|
3531
|
-
activate: () => void;
|
|
3532
|
-
/** Deactivate/unhighlight this ticket */
|
|
3533
|
-
deactivate: () => void;
|
|
3534
|
-
/** Get path from root to self (includes self) */
|
|
3535
|
-
getPath: () => ID[];
|
|
3536
|
-
/** Get ancestors excluding self */
|
|
3537
|
-
getAncestors: () => ID[];
|
|
3538
|
-
/** Get all descendants */
|
|
3539
|
-
getDescendants: () => ID[];
|
|
3540
|
-
/** Check if this ticket is an ancestor of the given ID */
|
|
3541
|
-
isAncestorOf: (descendantId: ID) => boolean;
|
|
3542
|
-
/** Check if this ticket has the given ID as an ancestor */
|
|
3543
|
-
hasAncestor: (ancestorId: ID) => boolean;
|
|
3544
|
-
/** Get sibling IDs (including self) */
|
|
3545
|
-
siblings: () => ID[];
|
|
3546
|
-
/** Get 1-indexed position among siblings (for aria-posinset) */
|
|
2783
|
+
/** ID of the parent ticket, or undefined if this is a root item */parentId: ID | undefined; /** Whether this ticket is currently open/expanded */
|
|
2784
|
+
isOpen: Readonly<Ref<boolean>>; /** Whether this ticket is currently active/highlighted */
|
|
2785
|
+
isActive: Readonly<Ref<boolean>>; /** Whether this ticket is a leaf node (has no children) */
|
|
2786
|
+
isLeaf: Readonly<Ref<boolean>>; /** Depth in tree (0 = root) */
|
|
2787
|
+
depth: Readonly<Ref<number>>; /** Open/expand this ticket */
|
|
2788
|
+
open: () => void; /** Close/collapse this ticket */
|
|
2789
|
+
close: () => void; /** Flip this ticket's open/closed state */
|
|
2790
|
+
flip: () => void; /** Reveal this ticket by opening all ancestors */
|
|
2791
|
+
reveal: () => void; /** Activate/highlight this ticket */
|
|
2792
|
+
activate: () => void; /** Deactivate/unhighlight this ticket */
|
|
2793
|
+
deactivate: () => void; /** Get path from root to self (includes self) */
|
|
2794
|
+
getPath: () => ID[]; /** Get ancestors excluding self */
|
|
2795
|
+
getAncestors: () => ID[]; /** Get all descendants */
|
|
2796
|
+
getDescendants: () => ID[]; /** Check if this ticket is an ancestor of the given ID */
|
|
2797
|
+
isAncestorOf: (descendantId: ID) => boolean; /** Check if this ticket has the given ID as an ancestor */
|
|
2798
|
+
hasAncestor: (ancestorId: ID) => boolean; /** Get sibling IDs (including self) */
|
|
2799
|
+
siblings: () => ID[]; /** Get 1-indexed position among siblings (for aria-posinset) */
|
|
3547
2800
|
position: () => number;
|
|
3548
2801
|
};
|
|
3549
2802
|
/**
|
|
@@ -3580,8 +2833,7 @@ interface OpenStrategy {
|
|
|
3580
2833
|
* @template Z The input ticket type that extends NestedTicketInput.
|
|
3581
2834
|
*/
|
|
3582
2835
|
type NestedRegistration<Z extends NestedTicketInput = NestedTicketInput> = Partial<Z> & {
|
|
3583
|
-
/** Inline children to register with this item as parent */
|
|
3584
|
-
children?: NestedRegistration<Z>[];
|
|
2836
|
+
/** Inline children to register with this item as parent */children?: NestedRegistration<Z>[];
|
|
3585
2837
|
};
|
|
3586
2838
|
/**
|
|
3587
2839
|
* Context for managing nested/hierarchical item collections.
|
|
@@ -3933,6 +3185,42 @@ interface PermissionPluginOptions extends PermissionContextOptions {}
|
|
|
3933
3185
|
declare function createPermissions<Z extends PermissionTicket = PermissionTicket, E extends PermissionContext<Z> = PermissionContext<Z>>(_options?: PermissionOptions): E;
|
|
3934
3186
|
declare const createPermissionsContext: <_E extends PermissionContext<PermissionTicket> = PermissionContext<PermissionTicket>>(_options?: PermissionContextOptions | undefined) => ContextTrinity<_E>, createPermissionsPlugin: (_options?: PermissionContextOptions | undefined) => Plugin, usePermissions: <_E extends PermissionContext<PermissionTicket> = PermissionContext<PermissionTicket>>(namespace?: string) => _E;
|
|
3935
3187
|
//#endregion
|
|
3188
|
+
//#region src/composables/usePopover/index.d.ts
|
|
3189
|
+
interface PopoverOptions {
|
|
3190
|
+
/** Auto-generated if not provided */
|
|
3191
|
+
id?: string;
|
|
3192
|
+
/** CSS position-area value @default 'bottom' */
|
|
3193
|
+
positionArea?: string;
|
|
3194
|
+
/** CSS position-try-fallbacks value @default 'most-width bottom' */
|
|
3195
|
+
positionTry?: string;
|
|
3196
|
+
/** External ref for bidirectional open state (e.g., from defineModel) */
|
|
3197
|
+
isOpen?: Ref<boolean>;
|
|
3198
|
+
}
|
|
3199
|
+
interface PopoverReturn {
|
|
3200
|
+
/** Whether the popover is open */
|
|
3201
|
+
isOpen: Ref<boolean>;
|
|
3202
|
+
/** Unique ID for the popover */
|
|
3203
|
+
id: string;
|
|
3204
|
+
/** Open the popover */
|
|
3205
|
+
open: () => void;
|
|
3206
|
+
/** Close the popover */
|
|
3207
|
+
close: () => void;
|
|
3208
|
+
/** Toggle open/close */
|
|
3209
|
+
toggle: () => void;
|
|
3210
|
+
/** Styles to spread on the activator element (anchor-name) */
|
|
3211
|
+
anchorStyles: Readonly<Ref<Record<string, string>>>;
|
|
3212
|
+
/** Attrs to spread on the content element (id, popover) */
|
|
3213
|
+
contentAttrs: Readonly<Ref<{
|
|
3214
|
+
id: string;
|
|
3215
|
+
popover: '';
|
|
3216
|
+
}>>;
|
|
3217
|
+
/** Styles to spread on the content element (positioning) */
|
|
3218
|
+
contentStyles: Readonly<Ref<Record<string, string>>>;
|
|
3219
|
+
/** Attach to a content element — wires show/hide watch + toggle event sync */
|
|
3220
|
+
attach: (el: MaybeRefOrGetter<HTMLElement | null | undefined>) => void;
|
|
3221
|
+
}
|
|
3222
|
+
declare function usePopover(options?: PopoverOptions): PopoverReturn;
|
|
3223
|
+
//#endregion
|
|
3936
3224
|
//#region src/composables/useProxyModel/index.d.ts
|
|
3937
3225
|
interface ProxyModelOptions {
|
|
3938
3226
|
multiple?: MaybeRefOrGetter<boolean>;
|
|
@@ -4414,6 +3702,86 @@ interface UseElementSizeReturn extends UseResizeObserverReturn {
|
|
|
4414
3702
|
*/
|
|
4415
3703
|
declare function useElementSize(target: MaybeElementRef): UseElementSizeReturn;
|
|
4416
3704
|
//#endregion
|
|
3705
|
+
//#region src/composables/createFocusTraversal/index.d.ts
|
|
3706
|
+
interface TraversalItem {
|
|
3707
|
+
id: ID;
|
|
3708
|
+
disabled?: MaybeRefOrGetter<boolean>;
|
|
3709
|
+
}
|
|
3710
|
+
//#endregion
|
|
3711
|
+
//#region src/composables/useRovingFocus/index.d.ts
|
|
3712
|
+
interface RovingItem extends TraversalItem {
|
|
3713
|
+
el?: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
3714
|
+
}
|
|
3715
|
+
interface RovingFocusOptions {
|
|
3716
|
+
target?: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
3717
|
+
/** Arrow key mapping. Ignored when `columns` is set (grid uses all 4 arrows). */
|
|
3718
|
+
orientation?: 'horizontal' | 'vertical' | 'both';
|
|
3719
|
+
circular?: boolean;
|
|
3720
|
+
/**
|
|
3721
|
+
* Column count for grid navigation. When set, items are treated as a 2D grid
|
|
3722
|
+
* in row-major order: Left/Right step ±1, Up/Down step ±columns,
|
|
3723
|
+
* Home/End go to row start/end, Ctrl+Home/End go to first/last overall.
|
|
3724
|
+
*/
|
|
3725
|
+
columns?: MaybeRefOrGetter<number>;
|
|
3726
|
+
onFocus?: (id: ID) => void;
|
|
3727
|
+
}
|
|
3728
|
+
interface RovingFocusReturn {
|
|
3729
|
+
focusedId: ShallowRef<ID | undefined>;
|
|
3730
|
+
isTabbable: (id: ID) => boolean;
|
|
3731
|
+
focus: (id: ID) => void;
|
|
3732
|
+
next: () => void;
|
|
3733
|
+
prev: () => void;
|
|
3734
|
+
first: () => void;
|
|
3735
|
+
last: () => void;
|
|
3736
|
+
onKeydown: (e: KeyboardEvent) => void;
|
|
3737
|
+
}
|
|
3738
|
+
declare function useRovingFocus(items: () => RovingItem[], options?: RovingFocusOptions): RovingFocusReturn;
|
|
3739
|
+
//#endregion
|
|
3740
|
+
//#region src/composables/useRtl/adapters/adapter.d.ts
|
|
3741
|
+
interface RtlAdapterSetupContext {
|
|
3742
|
+
isRtl: Ref<boolean>;
|
|
3743
|
+
toggle: () => void;
|
|
3744
|
+
}
|
|
3745
|
+
interface RtlAdapter {
|
|
3746
|
+
setup: <T extends RtlAdapterSetupContext>(app: App, context: T, target?: string | HTMLElement | null) => void;
|
|
3747
|
+
}
|
|
3748
|
+
//#endregion
|
|
3749
|
+
//#region src/composables/useRtl/adapters/v0.d.ts
|
|
3750
|
+
declare class Vuetify0RtlAdapter implements RtlAdapter {
|
|
3751
|
+
setup<T extends RtlAdapterSetupContext>(app: App, context: T, target?: string | HTMLElement | null): void;
|
|
3752
|
+
}
|
|
3753
|
+
//#endregion
|
|
3754
|
+
//#region src/composables/useRtl/index.d.ts
|
|
3755
|
+
interface RtlContext {
|
|
3756
|
+
/** Writable ref — true = RTL, false = LTR */
|
|
3757
|
+
isRtl: Ref<boolean>;
|
|
3758
|
+
/** Convenience method to flip direction */
|
|
3759
|
+
toggle: () => void;
|
|
3760
|
+
}
|
|
3761
|
+
interface RtlOptions {
|
|
3762
|
+
/** Initial direction. Defaults to false (LTR). */
|
|
3763
|
+
default?: boolean;
|
|
3764
|
+
/** Adapter for framework-specific side-effects. */
|
|
3765
|
+
adapter?: RtlAdapter;
|
|
3766
|
+
/** Target element or selector for dir attribute. Defaults to documentElement. */
|
|
3767
|
+
target?: string | HTMLElement | null;
|
|
3768
|
+
}
|
|
3769
|
+
interface RtlContextOptions extends RtlOptions {
|
|
3770
|
+
namespace?: string;
|
|
3771
|
+
}
|
|
3772
|
+
interface RtlPluginOptions extends RtlContextOptions {}
|
|
3773
|
+
/**
|
|
3774
|
+
* Creates a new RTL direction instance.
|
|
3775
|
+
*
|
|
3776
|
+
* @param options The options for the RTL instance.
|
|
3777
|
+
* @returns A new RTL context with reactive direction state.
|
|
3778
|
+
*
|
|
3779
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-rtl
|
|
3780
|
+
*/
|
|
3781
|
+
declare function createRtl(options?: RtlOptions): RtlContext;
|
|
3782
|
+
declare function createRtlFallback(): RtlContext;
|
|
3783
|
+
declare const createRtlContext: <_E extends RtlContext = RtlContext>(_options?: RtlContextOptions | undefined) => ContextTrinity<_E>, createRtlPlugin: (_options?: RtlContextOptions | undefined) => Plugin, useRtl: <_E extends RtlContext = RtlContext>(namespace?: string) => _E;
|
|
3784
|
+
//#endregion
|
|
4417
3785
|
//#region src/composables/createSlider/index.d.ts
|
|
4418
3786
|
interface SliderTicketInput extends ModelTicketInput<ShallowRef<number>> {
|
|
4419
3787
|
value: ShallowRef<number>;
|
|
@@ -6071,4 +5439,36 @@ declare function createVirtualContext<T = unknown>(items: Ref<readonly T[]>, _op
|
|
|
6071
5439
|
*/
|
|
6072
5440
|
declare function useVirtual<T = unknown>(namespace?: string): VirtualContext<T>;
|
|
6073
5441
|
//#endregion
|
|
6074
|
-
|
|
5442
|
+
//#region src/composables/useVirtualFocus/index.d.ts
|
|
5443
|
+
interface VirtualFocusItem extends TraversalItem {
|
|
5444
|
+
el?: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
5445
|
+
}
|
|
5446
|
+
interface VirtualFocusOptions {
|
|
5447
|
+
/** Element that retains DOM focus and receives aria-activedescendant */
|
|
5448
|
+
control: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
5449
|
+
/** Element to attach keydown listener to (defaults to control) */
|
|
5450
|
+
target?: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
5451
|
+
/** Arrow key mapping. Ignored when `columns` is set (grid uses all 4 arrows). */
|
|
5452
|
+
orientation?: 'horizontal' | 'vertical' | 'both';
|
|
5453
|
+
circular?: boolean;
|
|
5454
|
+
/**
|
|
5455
|
+
* Column count for grid navigation. When set, items are treated as a 2D grid
|
|
5456
|
+
* in row-major order: Left/Right step +/-1, Up/Down step +/-columns,
|
|
5457
|
+
* Home/End go to row start/end, Ctrl+Home/End go to first/last overall.
|
|
5458
|
+
*/
|
|
5459
|
+
columns?: MaybeRefOrGetter<number>;
|
|
5460
|
+
onHighlight?: (id: ID) => void;
|
|
5461
|
+
}
|
|
5462
|
+
interface VirtualFocusReturn {
|
|
5463
|
+
highlightedId: ShallowRef<ID | undefined>;
|
|
5464
|
+
highlight: (id: ID) => void;
|
|
5465
|
+
clear: () => void;
|
|
5466
|
+
next: () => void;
|
|
5467
|
+
prev: () => void;
|
|
5468
|
+
first: () => void;
|
|
5469
|
+
last: () => void;
|
|
5470
|
+
onKeydown: (e: KeyboardEvent) => void;
|
|
5471
|
+
}
|
|
5472
|
+
declare function useVirtualFocus(items: () => VirtualFocusItem[], options: VirtualFocusOptions): VirtualFocusReturn;
|
|
5473
|
+
//#endregion
|
|
5474
|
+
export { StepTicket as $, createContext as $i, LocaleRecord as $n, createRulesFallback as $r, useProxyModel as $t, ThemePluginOptions as A, createSingleContext as Aa, UseClickOutsideOptions as Ai, MutationObserverRecord as An, FormContextOptions as Ar, RovingFocusOptions as At, ThemeAdapter as B, ModelContext as Ba, createBreakpointsPlugin as Bi, LoggerContext as Bn, ValidationContext as Br, QueueContext as Bt, createTimelineContext as C, useBreadcrumbs as Ca, createDate as Ci, NestedOptions as Cn, createHydrationPlugin as Cr, createRtlContext as Ct, ThemeContext as D, SingleTicket as Da, ClickOutsideElement as Di, NestedTicketInput as Dn, UseHotkeyReturn as Dr, Vuetify0RtlAdapter as Dt, ThemeColors as E, SingleOptions as Ea, useDate as Ei, NestedTicket as En, UseHotkeyOptions as Er, useRtl as Et, createThemeContext as F, SelectionTicket as Fa, BreakpointsContextOptions as Fi, MediaQueryContext as Fn, FormValidationRule as Fr, ResizeObserverOptions as Ft, StoragePluginOptions as G, toArray as Gi, createLoggerContext as Gn, RuleAlias as Gr, createQueue as Gt, StorageContext as H, ModelTicket as Ha, toReactive as Hi, LoggerOptions as Hn, ValidationTicket as Hr, QueueOptions as Ht, createThemePlugin as I, SelectionTicketInput as Ia, BreakpointsOptions as Ii, useMediaQuery as In, FormValue as Ir, UseElementSizeReturn as It, createStoragePlugin as J, PluginOptions as Ji, LogLevel as Jn, RulesContext as Jr, ProxyRegistryContext as Jt, createStorage as K, Plugin as Ki, createLoggerPlugin as Kn, RuleAliases as Kr, createQueueContext as Kt, useTheme as L, createSelection as La, BreakpointsPluginOptions as Li, usePrefersContrast as Ln, createForm as Lr, UseResizeObserverReturn as Lt, ThemeTicket as M, SelectionContext as Ma, useClickOutside as Mi, UseMutationObserverOptions as Mn, FormTicket as Mr, RovingItem as Mt, ThemeTicketInput as N, SelectionContextOptions as Na, BreakpointName as Ni, UseMutationObserverReturn as Nn, FormTicketInput as Nr, useRovingFocus as Nt, ThemeContextOptions as O, SingleTicketInput as Oa, ClickOutsideIgnoreTarget as Oi, OpenStrategy as On, useHotkey as Or, RtlAdapter as Ot, createTheme as P, SelectionOptions as Pa, BreakpointsContext as Pi, useMutationObserver as Pn, FormValidationResult as Pr, ResizeObserverEntry as Pt, StepOptions as Q, CreateContextOptions as Qi, LocalePluginOptions as Qn, createRulesContext as Qr, ProxyModelTarget as Qt, Vuetify0ThemeAdapter as R, createSelectionContext as Ra, createBreakpoints as Ri, usePrefersDark as Rn, createFormContext as Rr, useElementSize as Rt, createTimeline as S, createBreadcrumbsContext as Sa, DatePluginOptions as Si, NestedOpenMode as Sn, createHydrationContext as Sr, createRtl as St, Colors as T, SingleContextOptions as Ta, createDatePlugin as Ti, NestedSelectionMode as Tn, PlatformContext as Tr, createRtlPlugin as Tt, StorageContextOptions as U, ModelTicketInput as Ua, MaybeElementRef as Ui, LoggerPluginOptions as Un, ValidationTicketInput as Ur, QueueTicket as Ut, ThemeAdapterInterface as V, ModelOptions as Va, useBreakpoints as Vi, LoggerContextOptions as Vn, ValidationOptions as Vr, QueueContextOptions as Vt, StorageOptions as W, createModel as Wa, toElement as Wi, createLogger as Wn, createValidation as Wr, QueueTicketInput as Wt, StepContext as X, createPluginContext as Xi, LocaleContextOptions as Xn, RulesOptions as Xr, useProxyRegistry as Xt, useStorage as Y, createPlugin as Yi, LocaleContext as Yn, RulesContextOptions as Yr, ProxyRegistryOptions as Yt, StepContextOptions as Z, ContextKey as Zi, LocaleOptions as Zn, createRules as Zr, ProxyModelOptions as Zt, useToggleScope as _, BreadcrumbTicketInput as _a, useEventListener as _i, multipleOpenStrategy as _n, HydrationContextOptions as _r, createSlider as _t, ScrollToOptions as a, createOverflow as aa, FeatureContextOptions as ai, PermissionOptions as an, createLocalePlugin as ar, StackContextOptions as at, TimelineOptions as b, BreadcrumbsOptions as ba, DateContextOptions as bi, NestedContext as bn, createFallbackHydration as br, RtlOptions as bt, VirtualContextOptions as c, GroupContext as ca, FeatureTicket as ci, createPermissions as cn, LazyOptions as cr, StackTicket as ct, VirtualOptions as d, GroupTicket as da, createFeaturesContext as di, usePermissions as dn, IntersectionObserverOptions as dr, createStackContext as dt, provideContext as ea, createRulesPlugin as ei, PopoverOptions as en, LocaleTicket as er, StepTicketInput as et, VirtualState as f, GroupTicketInput as fa, createFeaturesPlugin as fi, PermissionAdapter as fn, UseElementIntersectionReturn as fr, createStackPlugin as ft, ToggleScopeControls as g, BreadcrumbTicket as ga, useDocumentEventListener as gi, useNested as gn, HydrationContext as gr, SliderTicketInput as gt, useVirtual as h, useGroup as ha, EventHandler as hi, createNestedContext as hn, useIntersectionObserver as hr, SliderOptions as ht, useVirtualFocus as i, OverflowOptions as ia, FeatureContext as ii, PermissionContextOptions as in, createLocaleFallback as ir, StackContext as it, ThemeRecord as j, useSingle as ja, UseClickOutsideReturn as ji, ObservableNodeList as jn, FormOptions as jr, RovingFocusReturn as jt, ThemeOptions as k, createSingle as ka, ClickOutsideTarget as ki, OpenStrategyContext as kn, FormContext as kr, RtlAdapterSetupContext as kt, VirtualDirection as l, GroupContextOptions as la, FeatureTicketInput as li, createPermissionsContext as ln, useLazy as lr, StackTicketInput as lt, createVirtualContext as m, createGroupContext as ma, CleanupFunction as mi, createNested as mn, useElementIntersection as mr, SliderContext as mt, VirtualFocusOptions as n, OverflowContext as na, StandardSchemaV1 as ni, usePopover as nn, createLocale as nr, createStepContext as nt, VirtualAnchor as o, createOverflowContext as oa, FeatureOptions as oi, PermissionPluginOptions as on, useLocale as or, StackOptions as ot, createVirtual as p, createGroup as pa, useFeatures as pi, PermissionAdapterInterface as pn, UseIntersectionObserverReturn as pr, useStack as pt, createStorageContext as q, PluginContextConfig as qi, useLogger as qn, RuleInput as qr, useQueue as qt, VirtualFocusReturn as r, OverflowContextOptions as ra, isStandardSchema as ri, PermissionContext as rn, createLocaleContext as rr, useStep as rt, VirtualContext as s, useOverflow as sa, FeaturePluginOptions as si, PermissionTicket as sn, LazyContext as sr, StackPluginOptions as st, VirtualFocusItem as t, useContext as ta, useRules as ti, PopoverReturn as tn, LocaleTicketInput as tr, createStep as tt, VirtualItem as u, GroupOptions as ua, createFeatures as ui, createPermissionsPlugin as un, IntersectionObserverEntry as ur, createStack as ut, TimelineContext as v, BreadcrumbsContext as va, useWindowEventListener as vi, singleOpenStrategy as vn, HydrationOptions as vr, RtlContext as vt, useTimeline as w, SingleContext as wa, createDateContext as wi, NestedRegistration as wn, useHydration as wr, createRtlFallback as wt, TimelineTicket as x, createBreadcrumbs as xa, DateOptions as xi, NestedContextOptions as xn, createHydration as xr, RtlPluginOptions as xt, TimelineContextOptions as y, BreadcrumbsContextOptions as ya, DateContext as yi, NestedActiveMode as yn, HydrationPluginOptions as yr, RtlContextOptions as yt, Vuetify0ThemeOptions as z, useSelection as za, createBreakpointsContext as zi, usePrefersReducedMotion as zn, useForm as zr, useResizeObserver as zt };
|