@vuetify/v0 0.0.8 → 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 -464
- 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-D-M1DZRo.js → composables-TCjvMHyU.mjs} +590 -160
- package/dist/constants/{index.d.ts → index.d.mts} +1 -1
- package/dist/constants/{index.js → index.mjs} +3 -3
- package/dist/{globals-B2jAuapu.js → globals-y0mJ6Eg7.mjs} +2 -2
- package/dist/{index-Bcj8Vovs.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-BJF0Dsww.js +0 -350
- package/dist/composables/index.d.ts +0 -3
- package/dist/index-DoTdnxOm.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
package/dist/browser/index.js
CHANGED
|
@@ -77,8 +77,70 @@ function isSelfClosingTag(tag) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
//#endregion
|
|
80
|
-
//#region src/
|
|
81
|
-
|
|
80
|
+
//#region src/utilities/helpers.ts
|
|
81
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
82
|
+
function isFunction(item) {
|
|
83
|
+
return typeof item === "function";
|
|
84
|
+
}
|
|
85
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
86
|
+
function isString(item) {
|
|
87
|
+
return typeof item === "string";
|
|
88
|
+
}
|
|
89
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
90
|
+
function isNumber(item) {
|
|
91
|
+
return typeof item === "number";
|
|
92
|
+
}
|
|
93
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
94
|
+
function isBoolean(item) {
|
|
95
|
+
return typeof item === "boolean";
|
|
96
|
+
}
|
|
97
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
98
|
+
function isObject(item) {
|
|
99
|
+
return typeof item === "object" && item !== null && !Array.isArray(item);
|
|
100
|
+
}
|
|
101
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
102
|
+
function isArray(item) {
|
|
103
|
+
return Array.isArray(item);
|
|
104
|
+
}
|
|
105
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
106
|
+
function isNull(item) {
|
|
107
|
+
return item === null;
|
|
108
|
+
}
|
|
109
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
110
|
+
function isNullOrUndefined(item) {
|
|
111
|
+
return item == null;
|
|
112
|
+
}
|
|
113
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
114
|
+
function isUndefined(item) {
|
|
115
|
+
return item === void 0;
|
|
116
|
+
}
|
|
117
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
118
|
+
function isPrimitive(item) {
|
|
119
|
+
return typeof item === "string" || typeof item === "number" || typeof item === "boolean";
|
|
120
|
+
}
|
|
121
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
122
|
+
function mergeDeep(target, ...sources) {
|
|
123
|
+
if (sources.length === 0) return target;
|
|
124
|
+
const source = sources.shift();
|
|
125
|
+
if (/* @__PURE__ */ isObject(target) && /* @__PURE__ */ isObject(source)) {
|
|
126
|
+
for (const key in source) if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
127
|
+
const sourceValue = source[key];
|
|
128
|
+
const targetValue = target[key];
|
|
129
|
+
if (/* @__PURE__ */ isObject(sourceValue)) {
|
|
130
|
+
if (!/* @__PURE__ */ isObject(targetValue)) Object.assign(target, { [key]: {} });
|
|
131
|
+
} else Object.assign(target, { [key]: sourceValue });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return /* @__PURE__ */ mergeDeep(target, ...sources);
|
|
135
|
+
}
|
|
136
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
137
|
+
function genId() {
|
|
138
|
+
return Math.random().toString(36).slice(2, 9);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/components/Atom/Atom.vue
|
|
143
|
+
const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
82
144
|
name: "Atom",
|
|
83
145
|
__name: "Atom",
|
|
84
146
|
props: {
|
|
@@ -92,16 +154,16 @@ var Atom_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
92
154
|
const element = useTemplateRef("element");
|
|
93
155
|
__expose({ element });
|
|
94
156
|
const attrs = useAttrs();
|
|
95
|
-
const isSelfClosing = toRef(() =>
|
|
157
|
+
const isSelfClosing = toRef(() => /* @__PURE__ */ isString(__props.as) && isSelfClosingTag(__props.as));
|
|
96
158
|
const slotProps = toRef(() => attrs);
|
|
97
159
|
return (_ctx, _cache) => {
|
|
98
|
-
return
|
|
160
|
+
return __props.renderless || unref(isNull)(__props.as) ? renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 0 }, slotProps.value))) : !isSelfClosing.value ? (openBlock(), createBlock(resolveDynamicComponent(__props.as), mergeProps({ key: 1 }, slotProps.value, {
|
|
99
161
|
ref_key: "element",
|
|
100
162
|
ref: element
|
|
101
163
|
}), {
|
|
102
|
-
default: withCtx(() => [
|
|
164
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
103
165
|
_: 3
|
|
104
|
-
}, 16)) : (openBlock(), createBlock(resolveDynamicComponent(
|
|
166
|
+
}, 16)) : (openBlock(), createBlock(resolveDynamicComponent(__props.as), mergeProps({
|
|
105
167
|
key: 2,
|
|
106
168
|
ref_key: "element",
|
|
107
169
|
ref: element
|
|
@@ -109,14 +171,23 @@ var Atom_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
109
171
|
};
|
|
110
172
|
}
|
|
111
173
|
});
|
|
112
|
-
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/components/Atom/Atom.vue
|
|
115
|
-
var Atom_default = Atom_vue_vue_type_script_setup_true_lang_default;
|
|
174
|
+
var Atom_default = _sfc_main$18;
|
|
116
175
|
|
|
117
176
|
//#endregion
|
|
118
177
|
//#region src/composables/createContext/index.ts
|
|
119
178
|
/**
|
|
179
|
+
* @module createContext
|
|
180
|
+
*
|
|
181
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-context
|
|
182
|
+
*
|
|
183
|
+
* @remarks
|
|
184
|
+
* Factory for creating type-safe Vue dependency injection contexts.
|
|
185
|
+
*
|
|
186
|
+
* Provides a wrapper around Vue's provide/inject that throws errors when context is not found,
|
|
187
|
+
* eliminating silent failures and improving developer experience. Supports both app-level and
|
|
188
|
+
* component-level provision.
|
|
189
|
+
*/
|
|
190
|
+
/**
|
|
120
191
|
* Injects a context provided by an ancestor component.
|
|
121
192
|
*
|
|
122
193
|
* @param key The key of the context to inject.
|
|
@@ -243,7 +314,7 @@ function createPlugin(options) {
|
|
|
243
314
|
/**
|
|
244
315
|
* Creates a new trinity for a context composable and its provider.
|
|
245
316
|
*
|
|
246
|
-
* @param
|
|
317
|
+
* @param useContext The function that retrieves/uses the context (typically named `useContext`).
|
|
247
318
|
* @param provideContext The function that provides the context to descendants.
|
|
248
319
|
* @param context The default context instance to use when no custom context is provided.
|
|
249
320
|
* @template Z The type of the context.
|
|
@@ -279,75 +350,27 @@ function createPlugin(options) {
|
|
|
279
350
|
* }
|
|
280
351
|
* ```
|
|
281
352
|
*/
|
|
282
|
-
function createTrinity(
|
|
353
|
+
function createTrinity(useContext$1, provideContext$1, context) {
|
|
283
354
|
return [
|
|
284
|
-
|
|
355
|
+
useContext$1,
|
|
285
356
|
(_context = context, app) => provideContext$1(_context, app),
|
|
286
357
|
context
|
|
287
358
|
];
|
|
288
359
|
}
|
|
289
360
|
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region src/utilities/helpers.ts
|
|
292
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
293
|
-
function isFunction(item) {
|
|
294
|
-
return typeof item === "function";
|
|
295
|
-
}
|
|
296
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
297
|
-
function isString(item) {
|
|
298
|
-
return typeof item === "string";
|
|
299
|
-
}
|
|
300
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
301
|
-
function isNumber(item) {
|
|
302
|
-
return typeof item === "number";
|
|
303
|
-
}
|
|
304
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
305
|
-
function isBoolean(item) {
|
|
306
|
-
return typeof item === "boolean";
|
|
307
|
-
}
|
|
308
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
309
|
-
function isObject(item) {
|
|
310
|
-
return typeof item === "object" && item !== null && !Array.isArray(item);
|
|
311
|
-
}
|
|
312
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
313
|
-
function isArray(item) {
|
|
314
|
-
return Array.isArray(item);
|
|
315
|
-
}
|
|
316
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
317
|
-
function isNullOrUndefined(item) {
|
|
318
|
-
return item == null;
|
|
319
|
-
}
|
|
320
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
321
|
-
function isUndefined(item) {
|
|
322
|
-
return item === void 0;
|
|
323
|
-
}
|
|
324
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
325
|
-
function isPrimitive(item) {
|
|
326
|
-
return typeof item === "string" || typeof item === "number" || typeof item === "boolean";
|
|
327
|
-
}
|
|
328
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
329
|
-
function mergeDeep(target, ...sources) {
|
|
330
|
-
if (sources.length === 0) return target;
|
|
331
|
-
const source = sources.shift();
|
|
332
|
-
if (/* @__PURE__ */ isObject(target) && /* @__PURE__ */ isObject(source)) {
|
|
333
|
-
for (const key in source) if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
334
|
-
const sourceValue = source[key];
|
|
335
|
-
const targetValue = target[key];
|
|
336
|
-
if (/* @__PURE__ */ isObject(sourceValue)) {
|
|
337
|
-
if (!/* @__PURE__ */ isObject(targetValue)) Object.assign(target, { [key]: {} });
|
|
338
|
-
} else Object.assign(target, { [key]: sourceValue });
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
return /* @__PURE__ */ mergeDeep(target, ...sources);
|
|
342
|
-
}
|
|
343
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
344
|
-
function genId() {
|
|
345
|
-
return Math.random().toString(36).slice(2, 9);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
361
|
//#endregion
|
|
349
362
|
//#region src/composables/toArray/index.ts
|
|
350
363
|
/**
|
|
364
|
+
* @module toArray
|
|
365
|
+
*
|
|
366
|
+
* @remarks
|
|
367
|
+
* Utility function to normalize single values and arrays into arrays.
|
|
368
|
+
*
|
|
369
|
+
* Converts single values into single-element arrays, passes arrays through unchanged,
|
|
370
|
+
* and handles null/undefined by returning empty arrays. Perfect for functions that
|
|
371
|
+
* accept both single values and arrays as input (e.g., ID | ID[]).
|
|
372
|
+
*/
|
|
373
|
+
/**
|
|
351
374
|
* Converts a value to an array.
|
|
352
375
|
*
|
|
353
376
|
* @param value The value to convert.
|
|
@@ -373,6 +396,21 @@ function toArray(value) {
|
|
|
373
396
|
//#endregion
|
|
374
397
|
//#region src/composables/toReactive/index.ts
|
|
375
398
|
/**
|
|
399
|
+
* @module toReactive
|
|
400
|
+
*
|
|
401
|
+
* @remarks
|
|
402
|
+
* Utility function to convert values and refs into reactive proxies with ref unwrapping.
|
|
403
|
+
*
|
|
404
|
+
* Key features:
|
|
405
|
+
* - Automatic ref unwrapping
|
|
406
|
+
* - Deep reactive proxying
|
|
407
|
+
* - Map and Set support with ref unwrapping
|
|
408
|
+
* - Nested object/array reactivity
|
|
409
|
+
* - Type preservation
|
|
410
|
+
*
|
|
411
|
+
* Perfect for creating reactive versions of plain objects while automatically unwrapping refs.
|
|
412
|
+
*/
|
|
413
|
+
/**
|
|
376
414
|
* Converts a `MaybeRef` to a `UnwrapNestedRefs`.
|
|
377
415
|
*
|
|
378
416
|
* @param objectRef The object to convert.
|
|
@@ -493,6 +531,23 @@ function toReactive(objectRef) {
|
|
|
493
531
|
//#endregion
|
|
494
532
|
//#region src/composables/useHydration/index.ts
|
|
495
533
|
/**
|
|
534
|
+
* @module useHydration
|
|
535
|
+
*
|
|
536
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-hydration
|
|
537
|
+
*
|
|
538
|
+
* @remarks
|
|
539
|
+
* SSR hydration state management composable.
|
|
540
|
+
*
|
|
541
|
+
* Key features:
|
|
542
|
+
* - Hydration state detection (browser vs SSR)
|
|
543
|
+
* - Root component detection
|
|
544
|
+
* - Readonly hydration state refs
|
|
545
|
+
* - Plugin installation support
|
|
546
|
+
* - Perfect for hydration-safe rendering
|
|
547
|
+
*
|
|
548
|
+
* Essential for composables that need to behave differently during SSR vs client-side.
|
|
549
|
+
*/
|
|
550
|
+
/**
|
|
496
551
|
* Creates a new hydration instance.
|
|
497
552
|
*
|
|
498
553
|
* @returns A new hydration instance.
|
|
@@ -622,12 +677,30 @@ const SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof wind
|
|
|
622
677
|
const SUPPORTS_OBSERVER = IN_BROWSER && "ResizeObserver" in window;
|
|
623
678
|
const SUPPORTS_INTERSECTION_OBSERVER = IN_BROWSER && "IntersectionObserver" in window;
|
|
624
679
|
const SUPPORTS_MUTATION_OBSERVER = IN_BROWSER && "MutationObserver" in window;
|
|
625
|
-
const version =
|
|
626
|
-
const __LOGGER_ENABLED__ =
|
|
680
|
+
const version = __VERSION__;
|
|
681
|
+
const __LOGGER_ENABLED__ = __DEV__ || __VITE_LOGGER_ENABLED__ === "true";
|
|
627
682
|
|
|
628
683
|
//#endregion
|
|
629
684
|
//#region src/composables/useBreakpoints/index.ts
|
|
630
685
|
/**
|
|
686
|
+
* @module useBreakpoints
|
|
687
|
+
*
|
|
688
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-breakpoints
|
|
689
|
+
*
|
|
690
|
+
* @remarks
|
|
691
|
+
* Responsive breakpoint detection composable with window resize handling.
|
|
692
|
+
*
|
|
693
|
+
* Key features:
|
|
694
|
+
* - Window matchMedia integration
|
|
695
|
+
* - Six built-in breakpoints (xs, sm, md, lg, xl, xxl)
|
|
696
|
+
* - Automatic resize listener with cleanup
|
|
697
|
+
* - SSR-safe (checks IN_BROWSER)
|
|
698
|
+
* - Hydration-aware
|
|
699
|
+
* - Custom breakpoint configuration
|
|
700
|
+
*
|
|
701
|
+
* Perfect for responsive layouts and conditional rendering based on screen size.
|
|
702
|
+
*/
|
|
703
|
+
/**
|
|
631
704
|
* Creates default breakpoint configuration.
|
|
632
705
|
*
|
|
633
706
|
* @returns The default breakpoint configuration object.
|
|
@@ -875,6 +948,21 @@ function useBreakpoints(namespace = "v0:breakpoints") {
|
|
|
875
948
|
//#endregion
|
|
876
949
|
//#region src/composables/useEventListener/index.ts
|
|
877
950
|
/**
|
|
951
|
+
* @module useEventListener
|
|
952
|
+
*
|
|
953
|
+
* @remarks
|
|
954
|
+
* Event listener composable with automatic cleanup on scope disposal.
|
|
955
|
+
*
|
|
956
|
+
* Key features:
|
|
957
|
+
* - Supports Window, Document, and HTMLElement targets
|
|
958
|
+
* - Reactive targets, events, and listeners
|
|
959
|
+
* - Event options support (capture, passive, once)
|
|
960
|
+
* - Automatic removeEventListener on unmount
|
|
961
|
+
* - Multiple overloads for type safety
|
|
962
|
+
*
|
|
963
|
+
* Perfect for safely managing event listeners in Vue components.
|
|
964
|
+
*/
|
|
965
|
+
/**
|
|
878
966
|
* Attaches an event listener to a target.
|
|
879
967
|
*
|
|
880
968
|
* @param target The target to attach the event listener to.
|
|
@@ -1092,6 +1180,23 @@ var Vuetify0LoggerAdapter = class {
|
|
|
1092
1180
|
//#endregion
|
|
1093
1181
|
//#region src/composables/useLogger/index.ts
|
|
1094
1182
|
/**
|
|
1183
|
+
* @module useLogger
|
|
1184
|
+
*
|
|
1185
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-logger
|
|
1186
|
+
*
|
|
1187
|
+
* @remarks
|
|
1188
|
+
* Logging composable with adapter pattern supporting console, consola, and pino.
|
|
1189
|
+
*
|
|
1190
|
+
* Key features:
|
|
1191
|
+
* - Multiple log levels (trace, debug, info, warn, error, fatal)
|
|
1192
|
+
* - Adapter pattern for console/consola/pino integration
|
|
1193
|
+
* - Enable/disable logging
|
|
1194
|
+
* - Fallback logger for undefined loggers
|
|
1195
|
+
* - Context logging support
|
|
1196
|
+
*
|
|
1197
|
+
* Uses adapter pattern to abstract logging implementation.
|
|
1198
|
+
*/
|
|
1199
|
+
/**
|
|
1095
1200
|
* Creates a new logger instance.
|
|
1096
1201
|
*
|
|
1097
1202
|
* @param options The options for the logger instance.
|
|
@@ -1267,7 +1372,9 @@ function createLoggerPlugin(_options = {}) {
|
|
|
1267
1372
|
provide: (app) => {
|
|
1268
1373
|
provideLoggerContext(context, app);
|
|
1269
1374
|
},
|
|
1270
|
-
setup: (_app) => {
|
|
1375
|
+
setup: (_app) => {
|
|
1376
|
+
if (__DEV__ && IN_BROWSER) window.__v0Logger__ = context;
|
|
1377
|
+
}
|
|
1271
1378
|
});
|
|
1272
1379
|
}
|
|
1273
1380
|
/**
|
|
@@ -1304,6 +1411,21 @@ function useLogger(namespace = "v0:logger") {
|
|
|
1304
1411
|
//#endregion
|
|
1305
1412
|
//#region src/composables/useRegistry/index.ts
|
|
1306
1413
|
/**
|
|
1414
|
+
* @module useRegistry
|
|
1415
|
+
*
|
|
1416
|
+
* @remarks
|
|
1417
|
+
* A foundational composable for managing collections of items (tickets) with:
|
|
1418
|
+
* - Unique ID-based access
|
|
1419
|
+
* - Index-based ordering
|
|
1420
|
+
* - Value-based reverse lookup
|
|
1421
|
+
* - Automatic reindexing
|
|
1422
|
+
* - Optional event emission
|
|
1423
|
+
* - Performance-optimized caching
|
|
1424
|
+
*
|
|
1425
|
+
* The registry serves as the base for many other composables in the system,
|
|
1426
|
+
* including useSelection, useForm, useTimeline, and more.
|
|
1427
|
+
*/
|
|
1428
|
+
/**
|
|
1307
1429
|
* Creates a new registry instance.
|
|
1308
1430
|
*
|
|
1309
1431
|
* @param options The options for the registry instance.
|
|
@@ -1429,14 +1551,14 @@ function useRegistry(options) {
|
|
|
1429
1551
|
}
|
|
1430
1552
|
function values() {
|
|
1431
1553
|
const cached = cache.get("values");
|
|
1432
|
-
if (
|
|
1554
|
+
if (!/* @__PURE__ */ isUndefined(cached)) return cached;
|
|
1433
1555
|
const values$1 = Array.from(collection.values());
|
|
1434
1556
|
cache.set("values", values$1);
|
|
1435
1557
|
return values$1;
|
|
1436
1558
|
}
|
|
1437
1559
|
function entries() {
|
|
1438
1560
|
const cached = cache.get("entries");
|
|
1439
|
-
if (
|
|
1561
|
+
if (!/* @__PURE__ */ isUndefined(cached)) return cached;
|
|
1440
1562
|
const entries$1 = Array.from(collection.entries());
|
|
1441
1563
|
cache.set("entries", entries$1);
|
|
1442
1564
|
return entries$1;
|
|
@@ -1454,6 +1576,7 @@ function useRegistry(options) {
|
|
|
1454
1576
|
function reindex() {
|
|
1455
1577
|
if (catalog.size > 0) catalog.clear();
|
|
1456
1578
|
if (directory.size > 0) directory.clear();
|
|
1579
|
+
invalidate();
|
|
1457
1580
|
let index = 0;
|
|
1458
1581
|
for (const ticket of values()) {
|
|
1459
1582
|
if (ticket.index !== index) {
|
|
@@ -1464,7 +1587,7 @@ function useRegistry(options) {
|
|
|
1464
1587
|
assign(ticket.value, ticket.id);
|
|
1465
1588
|
index++;
|
|
1466
1589
|
}
|
|
1467
|
-
|
|
1590
|
+
emit("reindex:registry");
|
|
1468
1591
|
}
|
|
1469
1592
|
function register(registration = {}) {
|
|
1470
1593
|
const size = collection.size;
|
|
@@ -1473,9 +1596,10 @@ function useRegistry(options) {
|
|
|
1473
1596
|
logger.warn(`Ticket with id "${id}" already exists in the registry. Skipping registration.`);
|
|
1474
1597
|
return get(id);
|
|
1475
1598
|
}
|
|
1599
|
+
const valueIsUndefined = /* @__PURE__ */ isUndefined(registration.value);
|
|
1476
1600
|
const index = registration.index ?? size;
|
|
1477
|
-
const value =
|
|
1478
|
-
const valueIsIndex =
|
|
1601
|
+
const value = valueIsUndefined ? index : registration.value;
|
|
1602
|
+
const valueIsIndex = valueIsUndefined;
|
|
1479
1603
|
const ticket = {
|
|
1480
1604
|
...registration,
|
|
1481
1605
|
id,
|
|
@@ -1583,6 +1707,21 @@ function createRegistryContext(_options) {
|
|
|
1583
1707
|
//#endregion
|
|
1584
1708
|
//#region src/composables/useSelection/index.ts
|
|
1585
1709
|
/**
|
|
1710
|
+
* @module useSelection
|
|
1711
|
+
*
|
|
1712
|
+
* @remarks
|
|
1713
|
+
* Base composable for managing selected items in a collection with Set-based tracking.
|
|
1714
|
+
*
|
|
1715
|
+
* Key features:
|
|
1716
|
+
* - Set-based selectedIds for O(1) selection checks
|
|
1717
|
+
* - Mandatory selection mode (prevents deselecting last item)
|
|
1718
|
+
* - Auto-enrollment option (selects non-disabled items on register)
|
|
1719
|
+
* - Disabled item filtering
|
|
1720
|
+
* - Computed selectedItems and selectedValues Sets
|
|
1721
|
+
*
|
|
1722
|
+
* Extends useRegistry and serves as the base for useSingle, useGroup, useStep, and useFeatures.
|
|
1723
|
+
*/
|
|
1724
|
+
/**
|
|
1586
1725
|
* Creates a new selection instance for managing multiple selected items.
|
|
1587
1726
|
*
|
|
1588
1727
|
* Extends `useRegistry` with selection tracking via a reactive `Set` of selected IDs.
|
|
@@ -1628,28 +1767,28 @@ function createRegistryContext(_options) {
|
|
|
1628
1767
|
* console.log(Array.from(selection.selectedValues.value)) // ['Item 1', 'Item 3']
|
|
1629
1768
|
* ```
|
|
1630
1769
|
*/
|
|
1631
|
-
function createSelection(
|
|
1632
|
-
const
|
|
1770
|
+
function createSelection(_options = {}) {
|
|
1771
|
+
const { disabled = false, enroll = false, mandatory = false, multiple = false,...options } = _options;
|
|
1772
|
+
const registry = useRegistry(options);
|
|
1633
1773
|
const selectedIds = shallowReactive(/* @__PURE__ */ new Set());
|
|
1634
|
-
const enroll = options?.enroll ?? false;
|
|
1635
|
-
const mandatory = options?.mandatory ?? false;
|
|
1636
1774
|
const selectedItems = computed(() => {
|
|
1637
|
-
return new Set(Array.from(selectedIds).map((id) => registry
|
|
1775
|
+
return new Set(Array.from(selectedIds).map((id) => registry.get(id)));
|
|
1638
1776
|
});
|
|
1639
1777
|
const selectedValues = computed(() => {
|
|
1640
1778
|
return new Set(Array.from(selectedItems.value).map((item) => item?.value));
|
|
1641
1779
|
});
|
|
1642
1780
|
function seek(direction = "first", from) {
|
|
1643
|
-
return registry
|
|
1781
|
+
return registry.seek(direction, from, (ticket) => !toValue(ticket.disabled));
|
|
1644
1782
|
}
|
|
1645
1783
|
function mandate() {
|
|
1646
|
-
if (!mandatory || registry
|
|
1784
|
+
if (!mandatory || registry.size === 0 || selectedIds.size > 0) return;
|
|
1647
1785
|
const ticket = seek("first");
|
|
1648
1786
|
if (ticket) select(ticket.id);
|
|
1649
1787
|
}
|
|
1650
1788
|
function select(id) {
|
|
1651
|
-
const item = registry
|
|
1652
|
-
if (!item || item.disabled) return;
|
|
1789
|
+
const item = registry.get(id);
|
|
1790
|
+
if (!item || toValue(item.disabled)) return;
|
|
1791
|
+
if (!multiple) selectedIds.clear();
|
|
1653
1792
|
selectedIds.add(id);
|
|
1654
1793
|
}
|
|
1655
1794
|
function unselect(id) {
|
|
@@ -1657,7 +1796,7 @@ function createSelection(options) {
|
|
|
1657
1796
|
selectedIds.delete(id);
|
|
1658
1797
|
}
|
|
1659
1798
|
function toggle(id) {
|
|
1660
|
-
if (
|
|
1799
|
+
if (selected(id)) unselect(id);
|
|
1661
1800
|
else select(id);
|
|
1662
1801
|
}
|
|
1663
1802
|
function selected(id) {
|
|
@@ -1669,27 +1808,28 @@ function createSelection(options) {
|
|
|
1669
1808
|
disabled: false,
|
|
1670
1809
|
...registration,
|
|
1671
1810
|
id,
|
|
1672
|
-
isSelected: toRef(() =>
|
|
1811
|
+
isSelected: toRef(() => selected(id)),
|
|
1673
1812
|
select: () => select(id),
|
|
1674
1813
|
unselect: () => unselect(id),
|
|
1675
1814
|
toggle: () => toggle(id)
|
|
1676
1815
|
};
|
|
1677
|
-
const ticket = registry
|
|
1678
|
-
if (enroll && !item.disabled) selectedIds.add(ticket.id);
|
|
1816
|
+
const ticket = registry.register(item);
|
|
1817
|
+
if (enroll && !toValue(item.disabled)) selectedIds.add(ticket.id);
|
|
1679
1818
|
if (mandatory === "force") mandate();
|
|
1680
1819
|
return ticket;
|
|
1681
1820
|
}
|
|
1682
1821
|
function unregister(id) {
|
|
1683
1822
|
selectedIds.delete(id);
|
|
1684
|
-
registry
|
|
1823
|
+
registry.unregister(id);
|
|
1685
1824
|
}
|
|
1686
1825
|
function reset() {
|
|
1687
|
-
registry
|
|
1826
|
+
registry.clear();
|
|
1688
1827
|
selectedIds.clear();
|
|
1689
1828
|
mandate();
|
|
1690
1829
|
}
|
|
1691
1830
|
return {
|
|
1692
|
-
...registry
|
|
1831
|
+
...registry,
|
|
1832
|
+
disabled,
|
|
1693
1833
|
selectedIds,
|
|
1694
1834
|
selectedItems,
|
|
1695
1835
|
selectedValues,
|
|
@@ -1703,7 +1843,7 @@ function createSelection(options) {
|
|
|
1703
1843
|
toggle,
|
|
1704
1844
|
selected,
|
|
1705
1845
|
get size() {
|
|
1706
|
-
return registry
|
|
1846
|
+
return registry.size;
|
|
1707
1847
|
}
|
|
1708
1848
|
};
|
|
1709
1849
|
}
|
|
@@ -1771,6 +1911,20 @@ function useSelection(namespace = "v0:selection") {
|
|
|
1771
1911
|
//#endregion
|
|
1772
1912
|
//#region src/composables/useGroup/index.ts
|
|
1773
1913
|
/**
|
|
1914
|
+
* @module useGroup
|
|
1915
|
+
*
|
|
1916
|
+
* @remarks
|
|
1917
|
+
* Multi-selection composable that extends useSelection with batch operation support.
|
|
1918
|
+
*
|
|
1919
|
+
* Key features:
|
|
1920
|
+
* - Batch operations (select/unselect/toggle accept ID | ID[])
|
|
1921
|
+
* - selectedIndexes computed Set for position-based tracking
|
|
1922
|
+
* - Perfect for checkboxes, multi-select dropdowns, filter panels
|
|
1923
|
+
*
|
|
1924
|
+
* Inheritance chain: useRegistry → useSelection → useGroup
|
|
1925
|
+
* Extended by: useFeatures
|
|
1926
|
+
*/
|
|
1927
|
+
/**
|
|
1774
1928
|
* Creates a new group instance with batch selection operations.
|
|
1775
1929
|
*
|
|
1776
1930
|
* Extends `createSelection` to support selecting, unselecting, and toggling multiple items
|
|
@@ -1827,28 +1981,33 @@ function useSelection(namespace = "v0:selection") {
|
|
|
1827
1981
|
* console.log(checkboxes.selectedIds) // Set { 'option-b', 'option-c' }
|
|
1828
1982
|
* ```
|
|
1829
1983
|
*/
|
|
1830
|
-
function createGroup(
|
|
1831
|
-
const
|
|
1984
|
+
function createGroup(_options = {}) {
|
|
1985
|
+
const { mandatory = false, multiple = true,...options } = _options;
|
|
1986
|
+
const registry = createSelection({
|
|
1987
|
+
...options,
|
|
1988
|
+
mandatory,
|
|
1989
|
+
multiple
|
|
1990
|
+
});
|
|
1832
1991
|
const selectedIndexes = computed(() => {
|
|
1833
|
-
return new Set(Array.from(registry
|
|
1992
|
+
return new Set(Array.from(registry.selectedItems.value).map((item) => item?.index));
|
|
1834
1993
|
});
|
|
1835
1994
|
function select(ids) {
|
|
1836
|
-
for (const id of toArray(ids)) registry
|
|
1995
|
+
for (const id of toArray(ids)) registry.select(id);
|
|
1837
1996
|
}
|
|
1838
1997
|
function unselect(ids) {
|
|
1839
|
-
for (const id of toArray(ids)) registry
|
|
1998
|
+
for (const id of toArray(ids)) registry.unselect(id);
|
|
1840
1999
|
}
|
|
1841
2000
|
function toggle(ids) {
|
|
1842
|
-
for (const id of toArray(ids)) registry
|
|
2001
|
+
for (const id of toArray(ids)) registry.toggle(id);
|
|
1843
2002
|
}
|
|
1844
2003
|
return {
|
|
1845
|
-
...registry
|
|
2004
|
+
...registry,
|
|
1846
2005
|
select,
|
|
1847
2006
|
unselect,
|
|
1848
2007
|
toggle,
|
|
1849
2008
|
selectedIndexes,
|
|
1850
2009
|
get size() {
|
|
1851
|
-
return registry
|
|
2010
|
+
return registry.size;
|
|
1852
2011
|
}
|
|
1853
2012
|
};
|
|
1854
2013
|
}
|
|
@@ -1915,6 +2074,23 @@ function useGroup(namespace) {
|
|
|
1915
2074
|
//#endregion
|
|
1916
2075
|
//#region src/composables/useTokens/index.ts
|
|
1917
2076
|
/**
|
|
2077
|
+
* @module useTokens
|
|
2078
|
+
*
|
|
2079
|
+
* @see https://0.vuetifyjs.com/composables/registration/use-tokens
|
|
2080
|
+
*
|
|
2081
|
+
* @remarks
|
|
2082
|
+
* Design token registry with alias resolution and W3C Design Tokens format support.
|
|
2083
|
+
*
|
|
2084
|
+
* Key features:
|
|
2085
|
+
* - Alias resolution with circular reference detection
|
|
2086
|
+
* - Nested token flattening with dot notation
|
|
2087
|
+
* - W3C Design Tokens format ($value, $type, $description, $extensions)
|
|
2088
|
+
* - Path-based resolution (e.g., {colors}.blue.500)
|
|
2089
|
+
* - Resolution caching for performance (~28,590 ops/sec)
|
|
2090
|
+
*
|
|
2091
|
+
* Used by useTheme, useLocale, and useFeatures for token-based configuration.
|
|
2092
|
+
*/
|
|
2093
|
+
/**
|
|
1918
2094
|
* Creates a new token instance.
|
|
1919
2095
|
*
|
|
1920
2096
|
* @param tokens The tokens to use.
|
|
@@ -1943,9 +2119,9 @@ function useGroup(namespace) {
|
|
|
1943
2119
|
*/
|
|
1944
2120
|
function createTokens(tokens = {}, options = {}) {
|
|
1945
2121
|
const logger = useLogger();
|
|
1946
|
-
const registry
|
|
2122
|
+
const registry = useRegistry(options);
|
|
1947
2123
|
const cache = /* @__PURE__ */ new Map();
|
|
1948
|
-
registry
|
|
2124
|
+
registry.onboard(flatten(tokens, options.prefix, !!options.flat));
|
|
1949
2125
|
function isAlias(token) {
|
|
1950
2126
|
return /* @__PURE__ */ isString(token) && token.length > 2 && token[0] === "{" && token.at(-1) === "}";
|
|
1951
2127
|
}
|
|
@@ -1964,14 +2140,14 @@ function createTokens(tokens = {}, options = {}) {
|
|
|
1964
2140
|
return;
|
|
1965
2141
|
}
|
|
1966
2142
|
visited.add(clean);
|
|
1967
|
-
let found = registry
|
|
2143
|
+
let found = registry.get(clean);
|
|
1968
2144
|
let segments = [];
|
|
1969
2145
|
if (!found && clean.includes(".")) {
|
|
1970
2146
|
const parts = clean.split(".");
|
|
1971
2147
|
for (let i = parts.length - 1; i > 0; i--) {
|
|
1972
2148
|
const prefix = parts.slice(0, i).join(".");
|
|
1973
2149
|
const suffix = parts.slice(i);
|
|
1974
|
-
const candidate = registry
|
|
2150
|
+
const candidate = registry.get(prefix);
|
|
1975
2151
|
if (candidate?.value !== void 0) {
|
|
1976
2152
|
found = candidate;
|
|
1977
2153
|
segments = suffix;
|
|
@@ -2012,11 +2188,11 @@ function createTokens(tokens = {}, options = {}) {
|
|
|
2012
2188
|
return result;
|
|
2013
2189
|
}
|
|
2014
2190
|
return {
|
|
2015
|
-
...registry
|
|
2191
|
+
...registry,
|
|
2016
2192
|
resolve,
|
|
2017
2193
|
isAlias,
|
|
2018
2194
|
get size() {
|
|
2019
|
-
return registry
|
|
2195
|
+
return registry.size;
|
|
2020
2196
|
}
|
|
2021
2197
|
};
|
|
2022
2198
|
}
|
|
@@ -2154,6 +2330,24 @@ function flatten(tokens, prefix = "", flat = false) {
|
|
|
2154
2330
|
//#endregion
|
|
2155
2331
|
//#region src/composables/useFeatures/index.ts
|
|
2156
2332
|
/**
|
|
2333
|
+
* @module useFeatures
|
|
2334
|
+
*
|
|
2335
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-features
|
|
2336
|
+
*
|
|
2337
|
+
* @remarks
|
|
2338
|
+
* Feature flag system with boolean and token-based features.
|
|
2339
|
+
*
|
|
2340
|
+
* Key features:
|
|
2341
|
+
* - Boolean features (true/false activation)
|
|
2342
|
+
* - Token features with $variation support
|
|
2343
|
+
* - Auto-selection of enabled features
|
|
2344
|
+
* - Multi-select support for feature combinations
|
|
2345
|
+
* - Perfect for A/B testing, progressive rollout, feature toggles
|
|
2346
|
+
*
|
|
2347
|
+
* Inheritance chain: useRegistry → createSelection → createGroup → createFeatures
|
|
2348
|
+
* Integrates with useTokens for token-based features.
|
|
2349
|
+
*/
|
|
2350
|
+
/**
|
|
2157
2351
|
* Creates a new features instance.
|
|
2158
2352
|
*
|
|
2159
2353
|
* @param options The options for the features instance.
|
|
@@ -2179,13 +2373,13 @@ function flatten(tokens, prefix = "", flat = false) {
|
|
|
2179
2373
|
function createFeatures(_options = {}) {
|
|
2180
2374
|
const { features,...options } = _options;
|
|
2181
2375
|
const tokens = createTokens(features, { flat: true });
|
|
2182
|
-
const registry
|
|
2376
|
+
const registry = createGroup(options);
|
|
2183
2377
|
for (const [id, { value }] of tokens.entries()) register({
|
|
2184
2378
|
id,
|
|
2185
2379
|
value
|
|
2186
2380
|
});
|
|
2187
2381
|
function variation(id, fallback = null) {
|
|
2188
|
-
const ticket = registry
|
|
2382
|
+
const ticket = registry.get(id);
|
|
2189
2383
|
if (!ticket) return fallback;
|
|
2190
2384
|
return /* @__PURE__ */ isObject(ticket.value) ? ticket.value.$variation ?? fallback : ticket.value ?? fallback;
|
|
2191
2385
|
}
|
|
@@ -2194,16 +2388,16 @@ function createFeatures(_options = {}) {
|
|
|
2194
2388
|
value: false,
|
|
2195
2389
|
...registration
|
|
2196
2390
|
};
|
|
2197
|
-
const ticket = registry
|
|
2198
|
-
if (/* @__PURE__ */ isBoolean(ticket.value) && ticket.value === true || /* @__PURE__ */ isObject(ticket.value) && /* @__PURE__ */ isBoolean(ticket.value.$value) && ticket.value.$value === true) registry
|
|
2391
|
+
const ticket = registry.register(item);
|
|
2392
|
+
if (/* @__PURE__ */ isBoolean(ticket.value) && ticket.value === true || /* @__PURE__ */ isObject(ticket.value) && /* @__PURE__ */ isBoolean(ticket.value.$value) && ticket.value.$value === true) registry.select(ticket.id);
|
|
2199
2393
|
return ticket;
|
|
2200
2394
|
}
|
|
2201
2395
|
return {
|
|
2202
|
-
...registry
|
|
2396
|
+
...registry,
|
|
2203
2397
|
variation,
|
|
2204
2398
|
register,
|
|
2205
2399
|
get size() {
|
|
2206
|
-
return registry
|
|
2400
|
+
return registry.size;
|
|
2207
2401
|
}
|
|
2208
2402
|
};
|
|
2209
2403
|
}
|
|
@@ -2313,6 +2507,21 @@ function useFeatures(namespace = "v0:features") {
|
|
|
2313
2507
|
|
|
2314
2508
|
//#endregion
|
|
2315
2509
|
//#region src/composables/useFilter/index.ts
|
|
2510
|
+
/**
|
|
2511
|
+
* @module useFilter
|
|
2512
|
+
*
|
|
2513
|
+
* @remarks
|
|
2514
|
+
* Reactive array filtering composable with multiple filter modes.
|
|
2515
|
+
*
|
|
2516
|
+
* Key features:
|
|
2517
|
+
* - Four filter modes: some, every, union, intersection
|
|
2518
|
+
* - Case-insensitive filtering
|
|
2519
|
+
* - Custom filter functions
|
|
2520
|
+
* - Reactive updates
|
|
2521
|
+
* - Perfect for search, multi-criteria filtering
|
|
2522
|
+
*
|
|
2523
|
+
* Filters arrays based on query strings with configurable matching strategies.
|
|
2524
|
+
*/
|
|
2316
2525
|
function defaultFilter(query, item, keys, mode = "some") {
|
|
2317
2526
|
const queries = Array.isArray(query) ? query.map((q) => String(q).toLowerCase()) : [String(query).toLowerCase()];
|
|
2318
2527
|
function match(value, q) {
|
|
@@ -2370,6 +2579,22 @@ function useFilter(query, items, options = {}) {
|
|
|
2370
2579
|
//#endregion
|
|
2371
2580
|
//#region src/composables/useForm/index.ts
|
|
2372
2581
|
/**
|
|
2582
|
+
* @module useForm
|
|
2583
|
+
*
|
|
2584
|
+
* @remarks
|
|
2585
|
+
* Form validation composable with async rule support and multiple validation modes.
|
|
2586
|
+
*
|
|
2587
|
+
* Key features:
|
|
2588
|
+
* - Sync and async validation rules
|
|
2589
|
+
* - Multiple validation modes (submit, change, combined)
|
|
2590
|
+
* - Tri-state isValid (null/true/false)
|
|
2591
|
+
* - isPristine tracking
|
|
2592
|
+
* - Silent validation mode
|
|
2593
|
+
* - Form-level validation and reset
|
|
2594
|
+
*
|
|
2595
|
+
* Each field is registered with validation rules and tracks its own state independently.
|
|
2596
|
+
*/
|
|
2597
|
+
/**
|
|
2373
2598
|
* Creates a new form instance.
|
|
2374
2599
|
*
|
|
2375
2600
|
* @param options The options for the form instance.
|
|
@@ -2399,7 +2624,7 @@ function useFilter(query, items, options = {}) {
|
|
|
2399
2624
|
* ```
|
|
2400
2625
|
*/
|
|
2401
2626
|
function createForm(options) {
|
|
2402
|
-
const registry
|
|
2627
|
+
const registry = useRegistry(options);
|
|
2403
2628
|
const validateOn = options?.validateOn || "submit";
|
|
2404
2629
|
function parse(value) {
|
|
2405
2630
|
return value.toLowerCase().split(/\s+/);
|
|
@@ -2408,12 +2633,12 @@ function createForm(options) {
|
|
|
2408
2633
|
return parse(validateOn).includes(event);
|
|
2409
2634
|
}
|
|
2410
2635
|
const isValidating = computed(() => {
|
|
2411
|
-
for (const ticket of registry
|
|
2636
|
+
for (const ticket of registry.collection.values()) if (ticket.isValidating.value) return true;
|
|
2412
2637
|
return false;
|
|
2413
2638
|
});
|
|
2414
2639
|
const isValid = computed(() => {
|
|
2415
2640
|
let hasFields = false;
|
|
2416
|
-
for (const ticket of registry
|
|
2641
|
+
for (const ticket of registry.values()) {
|
|
2417
2642
|
hasFields = true;
|
|
2418
2643
|
if (ticket.isValid.value === false) return false;
|
|
2419
2644
|
if (ticket.isValid.value === null) return null;
|
|
@@ -2421,15 +2646,15 @@ function createForm(options) {
|
|
|
2421
2646
|
return hasFields || null;
|
|
2422
2647
|
});
|
|
2423
2648
|
function reset() {
|
|
2424
|
-
for (const ticket of registry
|
|
2649
|
+
for (const ticket of registry.values()) ticket.reset();
|
|
2425
2650
|
}
|
|
2426
2651
|
async function submit() {
|
|
2427
|
-
return validate(registry
|
|
2652
|
+
return validate(registry.keys());
|
|
2428
2653
|
}
|
|
2429
2654
|
async function validate(id) {
|
|
2430
2655
|
const validating = toArray(id);
|
|
2431
|
-
if (validatesOn("submit")) return (await Promise.all(validating.map(async (id$1) => await registry
|
|
2432
|
-
return validating.map((id$1) => registry
|
|
2656
|
+
if (validatesOn("submit")) return (await Promise.all(validating.map(async (id$1) => await registry.get(id$1)?.validate() ?? true))).every(Boolean);
|
|
2657
|
+
return validating.map((id$1) => registry.get(id$1)).filter(Boolean).every((ticket) => ticket.isValid.value === true);
|
|
2433
2658
|
}
|
|
2434
2659
|
function register(registration) {
|
|
2435
2660
|
const model = shallowRef(registration.value == null ? "" : toValue(registration.value));
|
|
@@ -2476,7 +2701,7 @@ function createForm(options) {
|
|
|
2476
2701
|
reset: _reset,
|
|
2477
2702
|
validate: validate$1
|
|
2478
2703
|
};
|
|
2479
|
-
const ticket = registry
|
|
2704
|
+
const ticket = registry.register(item);
|
|
2480
2705
|
Object.defineProperty(ticket, "value", {
|
|
2481
2706
|
get() {
|
|
2482
2707
|
return model.value;
|
|
@@ -2493,7 +2718,7 @@ function createForm(options) {
|
|
|
2493
2718
|
return ticket;
|
|
2494
2719
|
}
|
|
2495
2720
|
return {
|
|
2496
|
-
...registry
|
|
2721
|
+
...registry,
|
|
2497
2722
|
register,
|
|
2498
2723
|
reset,
|
|
2499
2724
|
submit,
|
|
@@ -2501,7 +2726,7 @@ function createForm(options) {
|
|
|
2501
2726
|
isValid,
|
|
2502
2727
|
isValidating,
|
|
2503
2728
|
get size() {
|
|
2504
|
-
return registry
|
|
2729
|
+
return registry.size;
|
|
2505
2730
|
}
|
|
2506
2731
|
};
|
|
2507
2732
|
}
|
|
@@ -2571,6 +2796,22 @@ function useForm(namespace = "v0:form") {
|
|
|
2571
2796
|
//#endregion
|
|
2572
2797
|
//#region src/composables/useIntersectionObserver/index.ts
|
|
2573
2798
|
/**
|
|
2799
|
+
* @module useIntersectionObserver
|
|
2800
|
+
*
|
|
2801
|
+
* @remarks
|
|
2802
|
+
* IntersectionObserver composable with lifecycle management.
|
|
2803
|
+
*
|
|
2804
|
+
* Key features:
|
|
2805
|
+
* - IntersectionObserver API wrapper
|
|
2806
|
+
* - Pause/resume/stop functionality
|
|
2807
|
+
* - Automatic cleanup on unmount
|
|
2808
|
+
* - SSR-safe (checks SUPPORTS_INTERSECTION_OBSERVER)
|
|
2809
|
+
* - Hydration-aware
|
|
2810
|
+
* - Immediate callback option
|
|
2811
|
+
*
|
|
2812
|
+
* Perfect for lazy loading, infinite scroll, and visibility detection.
|
|
2813
|
+
*/
|
|
2814
|
+
/**
|
|
2574
2815
|
* A composable that uses the Intersection Observer API to detect when an element
|
|
2575
2816
|
* is visible in the viewport.
|
|
2576
2817
|
*
|
|
@@ -2735,6 +2976,20 @@ function useElementIntersection(target, options = {}) {
|
|
|
2735
2976
|
//#endregion
|
|
2736
2977
|
//#region src/composables/useKeydown/index.ts
|
|
2737
2978
|
/**
|
|
2979
|
+
* @module useKeydown
|
|
2980
|
+
*
|
|
2981
|
+
* @remarks
|
|
2982
|
+
* Keydown event listener composable with key filtering.
|
|
2983
|
+
*
|
|
2984
|
+
* Key features:
|
|
2985
|
+
* - Key-specific event handling
|
|
2986
|
+
* - preventDefault and stopPropagation options
|
|
2987
|
+
* - Automatic cleanup on scope disposal
|
|
2988
|
+
* - Auto-starts when in component scope
|
|
2989
|
+
*
|
|
2990
|
+
* Simplified wrapper around useEventListener for keyboard interactions.
|
|
2991
|
+
*/
|
|
2992
|
+
/**
|
|
2738
2993
|
* A composable that adds a keydown event listener to the document.
|
|
2739
2994
|
*
|
|
2740
2995
|
* @param handlers The key handlers to add.
|
|
@@ -2782,6 +3037,19 @@ function useKeydown(handlers) {
|
|
|
2782
3037
|
//#endregion
|
|
2783
3038
|
//#region src/composables/useSingle/index.ts
|
|
2784
3039
|
/**
|
|
3040
|
+
* @module useSingle
|
|
3041
|
+
*
|
|
3042
|
+
* @remarks
|
|
3043
|
+
* Single-selection composable that extends useSelection to enforce only one selected item.
|
|
3044
|
+
*
|
|
3045
|
+
* Key features:
|
|
3046
|
+
* - Auto-clears previous selection when selecting new item
|
|
3047
|
+
* - Singular computed properties (selectedId, selectedItem, selectedIndex, selectedValue)
|
|
3048
|
+
* - Perfect for tabs, radio buttons, theme selectors
|
|
3049
|
+
*
|
|
3050
|
+
* Inheritance chain: useRegistry → useSelection → useSingle
|
|
3051
|
+
*/
|
|
3052
|
+
/**
|
|
2785
3053
|
* Creates a new single selection instance that enforces only one selected item at a time.
|
|
2786
3054
|
*
|
|
2787
3055
|
* Extends `createSelection` by automatically clearing previous selections when a new item is selected.
|
|
@@ -2831,38 +3099,35 @@ function useKeydown(handlers) {
|
|
|
2831
3099
|
* console.log(tabs.selectedIds.size) // 1 (always enforces single selection)
|
|
2832
3100
|
* ```
|
|
2833
3101
|
*/
|
|
2834
|
-
function createSingle(
|
|
2835
|
-
const
|
|
2836
|
-
const
|
|
2837
|
-
|
|
2838
|
-
|
|
3102
|
+
function createSingle(_options = {}) {
|
|
3103
|
+
const { mandatory = false, multiple = false,...options } = _options;
|
|
3104
|
+
const registry = createSelection({
|
|
3105
|
+
...options,
|
|
3106
|
+
mandatory,
|
|
3107
|
+
multiple
|
|
3108
|
+
});
|
|
3109
|
+
const selectedId = computed(() => registry.selectedIds.values().next().value);
|
|
3110
|
+
const selectedItem = computed(() => registry.selectedItems.value.values().next().value);
|
|
2839
3111
|
const selectedIndex = computed(() => selectedItem.value?.index ?? -1);
|
|
2840
3112
|
const selectedValue = computed(() => selectedItem.value?.value);
|
|
2841
|
-
function select(id) {
|
|
2842
|
-
const item = registry$1.get(id);
|
|
2843
|
-
if (!item || item.disabled) return;
|
|
2844
|
-
registry$1.selectedIds.clear();
|
|
2845
|
-
registry$1.select(id);
|
|
2846
|
-
}
|
|
2847
3113
|
function unselect(id) {
|
|
2848
|
-
if (mandatory && registry
|
|
2849
|
-
registry
|
|
3114
|
+
if (mandatory && registry.selectedIds.size === 1) return;
|
|
3115
|
+
registry.selectedIds.delete(id);
|
|
2850
3116
|
}
|
|
2851
3117
|
function toggle(id) {
|
|
2852
|
-
if (registry
|
|
2853
|
-
else select(id);
|
|
3118
|
+
if (registry.selectedIds.has(id)) unselect(id);
|
|
3119
|
+
else registry.select(id);
|
|
2854
3120
|
}
|
|
2855
3121
|
return {
|
|
2856
|
-
...registry
|
|
3122
|
+
...registry,
|
|
2857
3123
|
selectedId,
|
|
2858
3124
|
selectedItem,
|
|
2859
3125
|
selectedIndex,
|
|
2860
3126
|
selectedValue,
|
|
2861
|
-
select,
|
|
2862
3127
|
unselect,
|
|
2863
3128
|
toggle,
|
|
2864
3129
|
get size() {
|
|
2865
|
-
return registry
|
|
3130
|
+
return registry.size;
|
|
2866
3131
|
}
|
|
2867
3132
|
};
|
|
2868
3133
|
}
|
|
@@ -2963,6 +3228,21 @@ var Vuetify0LocaleAdapter = class {
|
|
|
2963
3228
|
//#endregion
|
|
2964
3229
|
//#region src/composables/useLocale/index.ts
|
|
2965
3230
|
/**
|
|
3231
|
+
* @module useLocale
|
|
3232
|
+
*
|
|
3233
|
+
* @remarks
|
|
3234
|
+
* Internationalization (i18n) composable with adapter pattern for message translation.
|
|
3235
|
+
*
|
|
3236
|
+
* Key features:
|
|
3237
|
+
* - Locale selection with createSingle
|
|
3238
|
+
* - Token-based message storage with useTokens
|
|
3239
|
+
* - Numbered and named placeholder support ({0}, {name})
|
|
3240
|
+
* - Number formatting with Intl.NumberFormat
|
|
3241
|
+
* - Adapter pattern for integration with i18n providers
|
|
3242
|
+
*
|
|
3243
|
+
* Integrates with createSingle for locale selection and useTokens for message resolution.
|
|
3244
|
+
*/
|
|
3245
|
+
/**
|
|
2966
3246
|
* Creates a new locale instance.
|
|
2967
3247
|
*
|
|
2968
3248
|
* @param options The options for the locale instance.
|
|
@@ -2975,32 +3255,32 @@ var Vuetify0LocaleAdapter = class {
|
|
|
2975
3255
|
function createLocale(_options = {}) {
|
|
2976
3256
|
const { adapter = new Vuetify0LocaleAdapter(), messages = {},...options } = _options;
|
|
2977
3257
|
const tokens = createTokens(messages, { flat: true });
|
|
2978
|
-
const registry
|
|
3258
|
+
const registry = createSingle(options);
|
|
2979
3259
|
for (const id in messages) {
|
|
2980
|
-
registry
|
|
3260
|
+
registry.register({
|
|
2981
3261
|
id,
|
|
2982
3262
|
value: messages[id]
|
|
2983
3263
|
});
|
|
2984
|
-
if (id === options.default && !registry
|
|
3264
|
+
if (id === options.default && !registry.selectedId.value) registry.select(id);
|
|
2985
3265
|
}
|
|
2986
3266
|
function t(key, ...params) {
|
|
2987
|
-
const locale = registry
|
|
3267
|
+
const locale = registry.selectedId.value;
|
|
2988
3268
|
if (!locale) return key;
|
|
2989
|
-
const message = (registry
|
|
3269
|
+
const message = (registry.get(locale)?.value)?.[key];
|
|
2990
3270
|
const template = /* @__PURE__ */ isString(message) ? resolve(locale, message) : key;
|
|
2991
3271
|
return adapter.t(template, ...params);
|
|
2992
3272
|
}
|
|
2993
3273
|
function n(value, ...params) {
|
|
2994
|
-
return adapter.n(value, registry
|
|
3274
|
+
return adapter.n(value, registry.selectedId.value, ...params);
|
|
2995
3275
|
}
|
|
2996
3276
|
function resolve(locale, str) {
|
|
2997
3277
|
return str.replace(/{([a-zA-Z0-9.-_]+)}/g, (match, key) => {
|
|
2998
3278
|
const [prefix, ...rest] = key.split(".");
|
|
2999
3279
|
const path = rest.join(".");
|
|
3000
|
-
const prefixTicket = registry
|
|
3280
|
+
const prefixTicket = registry.get(prefix);
|
|
3001
3281
|
const target = prefixTicket ? prefix : locale;
|
|
3002
3282
|
const name = prefixTicket ? path : key;
|
|
3003
|
-
const resolved = (registry
|
|
3283
|
+
const resolved = (registry.get(target)?.value)?.[name];
|
|
3004
3284
|
if (/* @__PURE__ */ isString(resolved)) return resolve(target, resolved);
|
|
3005
3285
|
const alias = `{${key}}`;
|
|
3006
3286
|
if (tokens.isAlias(alias)) {
|
|
@@ -3011,11 +3291,11 @@ function createLocale(_options = {}) {
|
|
|
3011
3291
|
});
|
|
3012
3292
|
}
|
|
3013
3293
|
return {
|
|
3014
|
-
...registry
|
|
3294
|
+
...registry,
|
|
3015
3295
|
t,
|
|
3016
3296
|
n,
|
|
3017
3297
|
get size() {
|
|
3018
|
-
return registry
|
|
3298
|
+
return registry.size;
|
|
3019
3299
|
}
|
|
3020
3300
|
};
|
|
3021
3301
|
}
|
|
@@ -3099,6 +3379,22 @@ function useLocale(namespace = "v0:locale") {
|
|
|
3099
3379
|
//#endregion
|
|
3100
3380
|
//#region src/composables/useMutationObserver/index.ts
|
|
3101
3381
|
/**
|
|
3382
|
+
* @module useMutationObserver
|
|
3383
|
+
*
|
|
3384
|
+
* @remarks
|
|
3385
|
+
* MutationObserver composable with lifecycle management.
|
|
3386
|
+
*
|
|
3387
|
+
* Key features:
|
|
3388
|
+
* - MutationObserver API wrapper
|
|
3389
|
+
* - Pause/resume/stop functionality
|
|
3390
|
+
* - Automatic cleanup on unmount
|
|
3391
|
+
* - SSR-safe (checks SUPPORTS_MUTATION_OBSERVER)
|
|
3392
|
+
* - Hydration-aware
|
|
3393
|
+
* - Configurable observation options (childList, attributes, characterData, etc.)
|
|
3394
|
+
*
|
|
3395
|
+
* Perfect for detecting DOM changes and responding to mutations.
|
|
3396
|
+
*/
|
|
3397
|
+
/**
|
|
3102
3398
|
* A composable that uses the Mutation Observer API to detect changes in the DOM.
|
|
3103
3399
|
*
|
|
3104
3400
|
* @param target The element to observe.
|
|
@@ -3241,6 +3537,23 @@ var Vuetify0PermissionAdapter = class extends PermissionAdapter {
|
|
|
3241
3537
|
//#endregion
|
|
3242
3538
|
//#region src/composables/usePermissions/index.ts
|
|
3243
3539
|
/**
|
|
3540
|
+
* @module usePermissions
|
|
3541
|
+
*
|
|
3542
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-permissions
|
|
3543
|
+
*
|
|
3544
|
+
* @remarks
|
|
3545
|
+
* Permission management composable with support for RBAC and ABAC patterns.
|
|
3546
|
+
*
|
|
3547
|
+
* Key features:
|
|
3548
|
+
* - Role-Based Access Control (RBAC) support
|
|
3549
|
+
* - Attribute-Based Access Control (ABAC) with context
|
|
3550
|
+
* - Functional permission conditions
|
|
3551
|
+
* - Token-based permission storage
|
|
3552
|
+
* - Adapter pattern for custom permission systems
|
|
3553
|
+
*
|
|
3554
|
+
* Built on useTokens for flexible permission configuration.
|
|
3555
|
+
*/
|
|
3556
|
+
/**
|
|
3244
3557
|
* Creates a new permissions instance.
|
|
3245
3558
|
*
|
|
3246
3559
|
* @param options The options for the permissions instance.
|
|
@@ -3387,15 +3700,27 @@ function usePermissions(namespace = "v0:permissions") {
|
|
|
3387
3700
|
//#endregion
|
|
3388
3701
|
//#region src/composables/useProxyModel/index.ts
|
|
3389
3702
|
/**
|
|
3390
|
-
*
|
|
3703
|
+
* @module useProxyModel
|
|
3704
|
+
*
|
|
3705
|
+
* @remarks
|
|
3706
|
+
* Proxy composable for bidirectional sync between selection registry and v-model.
|
|
3707
|
+
*
|
|
3708
|
+
* Key features:
|
|
3709
|
+
* - Bidirectional synchronization
|
|
3710
|
+
* - Array and single-value modes
|
|
3711
|
+
* - Automatic cleanup on scope disposal
|
|
3712
|
+
* - Perfect for form controls with selection backing
|
|
3713
|
+
*
|
|
3714
|
+
* Bridges the gap between selection composables and Vue's v-model.
|
|
3715
|
+
*/
|
|
3716
|
+
/**
|
|
3717
|
+
* Syncs a ref with a selection registry bidirectionally.
|
|
3391
3718
|
*
|
|
3392
3719
|
* @param registry The selection registry to bind to.
|
|
3393
|
-
* @param
|
|
3720
|
+
* @param model The ref to sync.
|
|
3394
3721
|
* @param options The options for the proxy model.
|
|
3395
|
-
* @param transformIn A function to transform the value before setting it.
|
|
3396
|
-
* @param transformOut A function to transform the value before getting it.
|
|
3397
3722
|
* @template Z The type of the selection ticket.
|
|
3398
|
-
* @returns A
|
|
3723
|
+
* @returns A function to stop the sync.
|
|
3399
3724
|
*
|
|
3400
3725
|
* @see https://0.vuetifyjs.com/composables/forms/use-proxy-model
|
|
3401
3726
|
*
|
|
@@ -3403,105 +3728,105 @@ function usePermissions(namespace = "v0:permissions") {
|
|
|
3403
3728
|
* ```ts
|
|
3404
3729
|
* import { createSelection, useProxyModel } from '@vuetify/v0'
|
|
3405
3730
|
*
|
|
3731
|
+
* const model = ref()
|
|
3406
3732
|
* const registry = createSelection({ events: true })
|
|
3407
3733
|
* registry.onboard([
|
|
3408
3734
|
* { id: 'item-1', value: 'Item 1' },
|
|
3409
3735
|
* { id: 'item-2', value: 'Item 2' },
|
|
3410
3736
|
* ])
|
|
3411
3737
|
*
|
|
3412
|
-
* const
|
|
3738
|
+
* const stop = useProxyModel(registry, model)
|
|
3413
3739
|
* ```
|
|
3414
3740
|
*/
|
|
3415
|
-
function useProxyModel(registry
|
|
3416
|
-
const
|
|
3417
|
-
const
|
|
3741
|
+
function useProxyModel(registry, model, options) {
|
|
3742
|
+
const multiple = options?.multiple ?? false;
|
|
3743
|
+
const _transformIn = options?.transformIn;
|
|
3744
|
+
const _transformOut = options?.transformOut;
|
|
3418
3745
|
function transformIn(val) {
|
|
3419
|
-
|
|
3746
|
+
const value = toValue(val);
|
|
3747
|
+
return toArray(/* @__PURE__ */ isFunction(_transformIn) ? _transformIn(value) : value);
|
|
3420
3748
|
}
|
|
3421
3749
|
function transformOut(val) {
|
|
3422
3750
|
if (/* @__PURE__ */ isFunction(_transformOut)) return _transformOut(val);
|
|
3423
|
-
return
|
|
3424
|
-
}
|
|
3425
|
-
const
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3751
|
+
return multiple ? val : val[0];
|
|
3752
|
+
}
|
|
3753
|
+
const modelAsArray = transformIn(model);
|
|
3754
|
+
const pending = new Set(modelAsArray);
|
|
3755
|
+
for (const value of modelAsArray) {
|
|
3756
|
+
const ids = registry.browse(value);
|
|
3757
|
+
if (/* @__PURE__ */ isArray(ids)) {
|
|
3758
|
+
for (const id of ids) registry.select(id);
|
|
3759
|
+
pending.delete(value);
|
|
3760
|
+
} else if (ids) {
|
|
3761
|
+
registry.select(ids);
|
|
3762
|
+
pending.delete(value);
|
|
3431
3763
|
}
|
|
3432
|
-
}
|
|
3433
|
-
const
|
|
3434
|
-
|
|
3435
|
-
model.value = Array.from(toValue(val));
|
|
3436
|
-
|
|
3437
|
-
});
|
|
3438
|
-
const
|
|
3439
|
-
|
|
3764
|
+
}
|
|
3765
|
+
const registryWatch = watch(registry.selectedValues, (val) => {
|
|
3766
|
+
modelWatch.pause();
|
|
3767
|
+
model.value = transformOut(Array.from(toValue(val)));
|
|
3768
|
+
modelWatch.resume();
|
|
3769
|
+
}, { flush: "sync" });
|
|
3770
|
+
const modelWatch = watch(model, (val) => {
|
|
3771
|
+
registryWatch.pause();
|
|
3772
|
+
const currentIds = new Set(toValue(registry.selectedIds));
|
|
3440
3773
|
const targetIds = /* @__PURE__ */ new Set();
|
|
3441
|
-
for (const value of
|
|
3442
|
-
const ids = registry
|
|
3774
|
+
for (const value of transformIn(val)) {
|
|
3775
|
+
const ids = registry.browse(value);
|
|
3443
3776
|
if (/* @__PURE__ */ isArray(ids)) for (const single of ids) targetIds.add(single);
|
|
3444
3777
|
else if (ids) targetIds.add(ids);
|
|
3445
3778
|
}
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
for (const id of
|
|
3449
|
-
for (const id of targetIds.difference(currentIds)) registry$1.selectedIds.add(id);
|
|
3779
|
+
if (multiple) {
|
|
3780
|
+
for (const id of currentIds.difference(targetIds)) registry.selectedIds.delete(id);
|
|
3781
|
+
for (const id of targetIds.difference(currentIds)) registry.selectedIds.add(id);
|
|
3450
3782
|
} else {
|
|
3451
3783
|
const next = targetIds.values().next().value;
|
|
3452
3784
|
const last = currentIds.values().next().value;
|
|
3453
|
-
if (last !== void 0) registry
|
|
3454
|
-
if (next !== void 0) registry
|
|
3785
|
+
if (last !== void 0) registry.unselect(last);
|
|
3786
|
+
if (next !== void 0) registry.select(next);
|
|
3455
3787
|
}
|
|
3456
|
-
|
|
3788
|
+
registryWatch.resume();
|
|
3789
|
+
}, {
|
|
3790
|
+
flush: "sync",
|
|
3791
|
+
deep: multiple
|
|
3457
3792
|
});
|
|
3458
3793
|
function onRegister(ticket) {
|
|
3459
|
-
if (!
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
registry
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
const hasValue = internal.value.includes(ticket.value);
|
|
3476
|
-
const isSelected = toValue(registry$1.selectedIds).has(ticket.id);
|
|
3477
|
-
if (!hasValue && isSelected) onUnregister(ticket);
|
|
3478
|
-
else if (hasValue && !isSelected) onRegister(ticket);
|
|
3479
|
-
}
|
|
3480
|
-
function onClear() {
|
|
3481
|
-
registryWatcher.pause();
|
|
3482
|
-
modelWatcher.pause();
|
|
3483
|
-
registry$1.selectedIds.clear();
|
|
3484
|
-
registryWatcher.resume();
|
|
3485
|
-
modelWatcher.resume();
|
|
3486
|
-
}
|
|
3487
|
-
registry$1.on("register:ticket", onRegister);
|
|
3488
|
-
registry$1.on("unregister:ticket", onUnregister);
|
|
3489
|
-
registry$1.on("update:ticket", onUpdate);
|
|
3490
|
-
registry$1.on("clear:registry", onClear);
|
|
3491
|
-
onScopeDispose(() => {
|
|
3492
|
-
registryWatcher();
|
|
3493
|
-
modelWatcher();
|
|
3494
|
-
registry$1.off("register:item", onRegister);
|
|
3495
|
-
registry$1.off("unregister:ticket", onUnregister);
|
|
3496
|
-
registry$1.off("update:ticket", onUpdate);
|
|
3497
|
-
registry$1.off("clear:registry", onClear);
|
|
3498
|
-
}, true);
|
|
3499
|
-
return model;
|
|
3794
|
+
if (!pending.has(ticket.value) || ticket.disabled) return;
|
|
3795
|
+
registryWatch.pause();
|
|
3796
|
+
modelWatch.pause();
|
|
3797
|
+
registry.select(ticket.id);
|
|
3798
|
+
pending.delete(ticket.value);
|
|
3799
|
+
modelWatch.resume();
|
|
3800
|
+
registryWatch.resume();
|
|
3801
|
+
}
|
|
3802
|
+
registry.on("register:ticket", onRegister);
|
|
3803
|
+
function stop() {
|
|
3804
|
+
registryWatch();
|
|
3805
|
+
modelWatch();
|
|
3806
|
+
registry.off("register:ticket", onRegister);
|
|
3807
|
+
}
|
|
3808
|
+
onScopeDispose(stop, true);
|
|
3809
|
+
return stop;
|
|
3500
3810
|
}
|
|
3501
3811
|
|
|
3502
3812
|
//#endregion
|
|
3503
3813
|
//#region src/composables/useProxyRegistry/index.ts
|
|
3504
3814
|
/**
|
|
3815
|
+
* @module useProxyRegistry
|
|
3816
|
+
*
|
|
3817
|
+
* @remarks
|
|
3818
|
+
* Proxy composable for reactive registry keys, values, entries, and size.
|
|
3819
|
+
*
|
|
3820
|
+
* Key features:
|
|
3821
|
+
* - Reactive proxy for registry data
|
|
3822
|
+
* - Deep or shallow reactivity options
|
|
3823
|
+
* - Event-based updates
|
|
3824
|
+
* - Automatic cleanup on scope disposal
|
|
3825
|
+
* - Transforms Map-based registry into reactive refs
|
|
3826
|
+
*
|
|
3827
|
+
* Perfect for exposing registry data as reactive computed properties.
|
|
3828
|
+
*/
|
|
3829
|
+
/**
|
|
3505
3830
|
* Creates a proxy registry that provides reactive objects for registry data.
|
|
3506
3831
|
*
|
|
3507
3832
|
* @param registry The registry instance to proxy.
|
|
@@ -3522,28 +3847,28 @@ function useProxyModel(registry$1, initial, options, _transformIn, _transformOut
|
|
|
3522
3847
|
* console.log(proxy.size) // 1
|
|
3523
3848
|
* ```
|
|
3524
3849
|
*/
|
|
3525
|
-
function useProxyRegistry(registry
|
|
3850
|
+
function useProxyRegistry(registry, options) {
|
|
3526
3851
|
const state = (options?.deep ? reactive : shallowReactive)({
|
|
3527
|
-
keys: registry
|
|
3528
|
-
values: registry
|
|
3529
|
-
entries: registry
|
|
3530
|
-
size: registry
|
|
3852
|
+
keys: registry.keys(),
|
|
3853
|
+
values: registry.values(),
|
|
3854
|
+
entries: registry.entries(),
|
|
3855
|
+
size: registry.size
|
|
3531
3856
|
});
|
|
3532
3857
|
function update() {
|
|
3533
|
-
state.keys = registry
|
|
3534
|
-
state.values = registry
|
|
3535
|
-
state.entries = registry
|
|
3536
|
-
state.size = registry
|
|
3537
|
-
}
|
|
3538
|
-
registry
|
|
3539
|
-
registry
|
|
3540
|
-
registry
|
|
3541
|
-
registry
|
|
3858
|
+
state.keys = registry.keys();
|
|
3859
|
+
state.values = registry.values();
|
|
3860
|
+
state.entries = registry.entries();
|
|
3861
|
+
state.size = registry.size;
|
|
3862
|
+
}
|
|
3863
|
+
registry.on("register:ticket", update);
|
|
3864
|
+
registry.on("unregister:ticket", update);
|
|
3865
|
+
registry.on("update:ticket", update);
|
|
3866
|
+
registry.on("clear:registry", update);
|
|
3542
3867
|
onScopeDispose(() => {
|
|
3543
|
-
registry
|
|
3544
|
-
registry
|
|
3545
|
-
registry
|
|
3546
|
-
registry
|
|
3868
|
+
registry.off("register:ticket", update);
|
|
3869
|
+
registry.off("unregister:ticket", update);
|
|
3870
|
+
registry.off("update:ticket", update);
|
|
3871
|
+
registry.off("clear:registry", update);
|
|
3547
3872
|
}, true);
|
|
3548
3873
|
return state;
|
|
3549
3874
|
}
|
|
@@ -3551,6 +3876,21 @@ function useProxyRegistry(registry$1, options) {
|
|
|
3551
3876
|
//#endregion
|
|
3552
3877
|
//#region src/composables/useQueue/index.ts
|
|
3553
3878
|
/**
|
|
3879
|
+
* @module useQueue
|
|
3880
|
+
*
|
|
3881
|
+
* @remarks
|
|
3882
|
+
* A queue composable for managing time-based collections with:
|
|
3883
|
+
* - Automatic timeout-based removal
|
|
3884
|
+
* - Pause/resume functionality
|
|
3885
|
+
* - FIFO (First In, First Out) ordering
|
|
3886
|
+
* - Manual dismissal support
|
|
3887
|
+
* - Queue progression management
|
|
3888
|
+
*
|
|
3889
|
+
* Built on top of useRegistry, the queue automatically manages timeouts for tickets,
|
|
3890
|
+
* ensuring only the first ticket in the queue is active at any time. When an ticket
|
|
3891
|
+
* expires or is removed, the next ticket in the queue automatically becomes active.
|
|
3892
|
+
*/
|
|
3893
|
+
/**
|
|
3554
3894
|
* Creates a new queue instance
|
|
3555
3895
|
*
|
|
3556
3896
|
* @param options The options for the queue instance
|
|
@@ -3583,7 +3923,7 @@ function useProxyRegistry(registry$1, options) {
|
|
|
3583
3923
|
*/
|
|
3584
3924
|
function createQueue(_options = {}) {
|
|
3585
3925
|
const { timeout: _timeout = 3e3,...options } = _options;
|
|
3586
|
-
const registry
|
|
3926
|
+
const registry = useRegistry({
|
|
3587
3927
|
...options,
|
|
3588
3928
|
events: true
|
|
3589
3929
|
});
|
|
@@ -3592,7 +3932,7 @@ function createQueue(_options = {}) {
|
|
|
3592
3932
|
if (ticket.timeout === void 0 || ticket.timeout === -1 || ticket.isPaused) return;
|
|
3593
3933
|
const timeout = setTimeout(() => {
|
|
3594
3934
|
timeouts.delete(ticket.id);
|
|
3595
|
-
registry
|
|
3935
|
+
registry.unregister(ticket.id);
|
|
3596
3936
|
resume();
|
|
3597
3937
|
}, ticket.timeout);
|
|
3598
3938
|
timeouts.set(ticket.id, timeout);
|
|
@@ -3611,47 +3951,47 @@ function createQueue(_options = {}) {
|
|
|
3611
3951
|
...registration,
|
|
3612
3952
|
id,
|
|
3613
3953
|
timeout,
|
|
3614
|
-
isPaused: registry
|
|
3954
|
+
isPaused: registry.size > 0,
|
|
3615
3955
|
dismiss: () => unregister(id)
|
|
3616
3956
|
};
|
|
3617
|
-
const registered = registry
|
|
3957
|
+
const registered = registry.register(ticket);
|
|
3618
3958
|
startTimeout(registered);
|
|
3619
3959
|
return registered;
|
|
3620
3960
|
}
|
|
3621
3961
|
function unregister(id) {
|
|
3622
|
-
const ticket = id === void 0 ? registry
|
|
3962
|
+
const ticket = id === void 0 ? registry.seek("first") : registry.get(id);
|
|
3623
3963
|
if (!ticket) return void 0;
|
|
3624
3964
|
const wasFirst = ticket.index === 0;
|
|
3625
3965
|
clearTimeout(ticket.id);
|
|
3626
|
-
registry
|
|
3966
|
+
registry.unregister(ticket.id);
|
|
3627
3967
|
if (wasFirst) resume();
|
|
3628
3968
|
return ticket;
|
|
3629
3969
|
}
|
|
3630
3970
|
function pause() {
|
|
3631
|
-
const ticket = registry
|
|
3971
|
+
const ticket = registry.seek("first");
|
|
3632
3972
|
if (!ticket || ticket.isPaused) return void 0;
|
|
3633
3973
|
clearTimeout(ticket.id);
|
|
3634
|
-
registry
|
|
3974
|
+
registry.upsert(ticket.id, { isPaused: true });
|
|
3635
3975
|
return ticket;
|
|
3636
3976
|
}
|
|
3637
3977
|
function resume() {
|
|
3638
|
-
const ticket = registry
|
|
3978
|
+
const ticket = registry.seek("first");
|
|
3639
3979
|
if (!ticket || ticket.index !== 0 || !ticket.isPaused) return void 0;
|
|
3640
|
-
registry
|
|
3980
|
+
registry.upsert(ticket.id, { isPaused: false });
|
|
3641
3981
|
startTimeout(ticket);
|
|
3642
3982
|
return ticket;
|
|
3643
3983
|
}
|
|
3644
3984
|
function clear() {
|
|
3645
3985
|
for (const id of timeouts.keys()) clearTimeout(id);
|
|
3646
|
-
registry
|
|
3986
|
+
registry.clear();
|
|
3647
3987
|
}
|
|
3648
3988
|
function dispose() {
|
|
3649
3989
|
clear();
|
|
3650
|
-
registry
|
|
3990
|
+
registry.dispose();
|
|
3651
3991
|
}
|
|
3652
3992
|
onScopeDispose(dispose, true);
|
|
3653
3993
|
return {
|
|
3654
|
-
...registry
|
|
3994
|
+
...registry,
|
|
3655
3995
|
register,
|
|
3656
3996
|
unregister,
|
|
3657
3997
|
pause,
|
|
@@ -3659,7 +3999,7 @@ function createQueue(_options = {}) {
|
|
|
3659
3999
|
clear,
|
|
3660
4000
|
dispose,
|
|
3661
4001
|
get size() {
|
|
3662
|
-
return registry
|
|
4002
|
+
return registry.size;
|
|
3663
4003
|
}
|
|
3664
4004
|
};
|
|
3665
4005
|
}
|
|
@@ -3716,6 +4056,22 @@ function useQueue(namespace = "v0:queue") {
|
|
|
3716
4056
|
//#endregion
|
|
3717
4057
|
//#region src/composables/useResizeObserver/index.ts
|
|
3718
4058
|
/**
|
|
4059
|
+
* @module useResizeObserver
|
|
4060
|
+
*
|
|
4061
|
+
* @remarks
|
|
4062
|
+
* ResizeObserver composable with lifecycle management.
|
|
4063
|
+
*
|
|
4064
|
+
* Key features:
|
|
4065
|
+
* - ResizeObserver API wrapper
|
|
4066
|
+
* - Pause/resume/stop functionality
|
|
4067
|
+
* - Automatic cleanup on unmount
|
|
4068
|
+
* - SSR-safe (checks SUPPORTS_OBSERVER)
|
|
4069
|
+
* - Hydration-aware
|
|
4070
|
+
* - Box model options (content-box/border-box)
|
|
4071
|
+
*
|
|
4072
|
+
* Perfect for responsive components and size-based rendering.
|
|
4073
|
+
*/
|
|
4074
|
+
/**
|
|
3719
4075
|
* A composable that uses the Resize Observer API to detect when an element's
|
|
3720
4076
|
* size changes.
|
|
3721
4077
|
*
|
|
@@ -3867,10 +4223,24 @@ function useElementSize(target) {
|
|
|
3867
4223
|
//#endregion
|
|
3868
4224
|
//#region src/composables/useStep/index.ts
|
|
3869
4225
|
/**
|
|
3870
|
-
*
|
|
4226
|
+
* @module useStep
|
|
4227
|
+
*
|
|
4228
|
+
* @remarks
|
|
4229
|
+
* Navigation composable that extends useSingle with first/last/next/prev/step methods.
|
|
4230
|
+
*
|
|
4231
|
+
* Key features:
|
|
4232
|
+
* - Configurable circular or bounded navigation
|
|
4233
|
+
* - Automatic disabled item skipping
|
|
4234
|
+
* - Arbitrary step counts (positive/negative)
|
|
4235
|
+
* - Perfect for wizards, carousels, pagination, onboarding flows
|
|
4236
|
+
*
|
|
4237
|
+
* Inheritance chain: useRegistry → useSelection → useSingle → useStep
|
|
4238
|
+
*/
|
|
4239
|
+
/**
|
|
4240
|
+
* Creates a new step instance with navigation through items.
|
|
3871
4241
|
*
|
|
3872
4242
|
* Extends `createSingle` with `first()`, `last()`, `next()`, `prev()`, and `step(count)` methods
|
|
3873
|
-
* for sequential navigation.
|
|
4243
|
+
* for sequential navigation. Supports both circular (wrapping) and bounded (stopping at edges) modes.
|
|
3874
4244
|
*
|
|
3875
4245
|
* @param options The options for the step instance.
|
|
3876
4246
|
* @template Z The type of the step ticket.
|
|
@@ -3879,7 +4249,7 @@ function useElementSize(target) {
|
|
|
3879
4249
|
*
|
|
3880
4250
|
* @remarks
|
|
3881
4251
|
* **Key Features:**
|
|
3882
|
-
* - **
|
|
4252
|
+
* - **Configurable Navigation**: `circular: true` for wrapping, `false` for bounded (default: false)
|
|
3883
4253
|
* - **Disabled Item Skipping**: Automatically skips disabled items during navigation
|
|
3884
4254
|
* - **Bidirectional**: Forward (`next`, positive `step`) and backward (`prev`, negative `step`)
|
|
3885
4255
|
* - **Safe Edge Cases**: Handles empty registries and all-disabled scenarios gracefully
|
|
@@ -3887,15 +4257,20 @@ function useElementSize(target) {
|
|
|
3887
4257
|
* **Navigation Methods:**
|
|
3888
4258
|
* - `first()`: Select first non-disabled item
|
|
3889
4259
|
* - `last()`: Select last non-disabled item
|
|
3890
|
-
* - `next()`: Move to next item (wraps
|
|
3891
|
-
* - `prev()`: Move to previous item (wraps
|
|
4260
|
+
* - `next()`: Move to next item (wraps if circular, stops at end if bounded)
|
|
4261
|
+
* - `prev()`: Move to previous item (wraps if circular, stops at start if bounded)
|
|
3892
4262
|
* - `step(count)`: Move by `count` positions (negative for backward)
|
|
3893
4263
|
*
|
|
3894
|
-
* **
|
|
3895
|
-
* - Uses modulo arithmetic for
|
|
4264
|
+
* **Circular Mode (`circular: true`):**
|
|
4265
|
+
* - Uses modulo arithmetic for wrapping: `((index % length) + length) % length`
|
|
3896
4266
|
* - Works correctly with negative indexes and large step counts
|
|
3897
|
-
* -
|
|
3898
|
-
*
|
|
4267
|
+
* - Perfect for carousels, theme switchers, infinite scrolling
|
|
4268
|
+
*
|
|
4269
|
+
* **Bounded Mode (`circular: false`, default):**
|
|
4270
|
+
* - Navigation stops at boundaries (no wrapping)
|
|
4271
|
+
* - `next()` on last item does nothing
|
|
4272
|
+
* - `prev()` on first item does nothing
|
|
4273
|
+
* - Perfect for pagination, wizards with explicit completion, forms
|
|
3899
4274
|
*
|
|
3900
4275
|
* **Inheritance Chain:**
|
|
3901
4276
|
* `useRegistry` → `createSelection` → `createSingle` → `createStep`
|
|
@@ -3906,34 +4281,39 @@ function useElementSize(target) {
|
|
|
3906
4281
|
* ```ts
|
|
3907
4282
|
* import { createStep } from '@vuetify/v0'
|
|
3908
4283
|
*
|
|
3909
|
-
*
|
|
3910
|
-
*
|
|
3911
|
-
*
|
|
3912
|
-
* { id: '
|
|
3913
|
-
* { id: '
|
|
3914
|
-
* { id: '
|
|
3915
|
-
* { id: 'confirm', value: 'Confirmation' },
|
|
4284
|
+
* // Bounded navigation (default) - for pagination
|
|
4285
|
+
* const pagination = createStep({ circular: false })
|
|
4286
|
+
* pagination.onboard([
|
|
4287
|
+
* { id: 'page-1', value: 1 },
|
|
4288
|
+
* { id: 'page-2', value: 2 },
|
|
4289
|
+
* { id: 'page-3', value: 3 },
|
|
3916
4290
|
* ])
|
|
3917
|
-
*
|
|
3918
|
-
*
|
|
3919
|
-
*
|
|
3920
|
-
*
|
|
3921
|
-
*
|
|
3922
|
-
*
|
|
3923
|
-
*
|
|
3924
|
-
*
|
|
3925
|
-
*
|
|
4291
|
+
* pagination.first() // Select page 1
|
|
4292
|
+
* pagination.prev() // Does nothing (already at first)
|
|
4293
|
+
* pagination.next() // Select page 2
|
|
4294
|
+
*
|
|
4295
|
+
* // Circular navigation - for carousels
|
|
4296
|
+
* const carousel = createStep({ circular: true })
|
|
4297
|
+
* carousel.onboard([
|
|
4298
|
+
* { id: 'slide-1', value: 'First' },
|
|
4299
|
+
* { id: 'slide-2', value: 'Second' },
|
|
4300
|
+
* { id: 'slide-3', value: 'Third' },
|
|
4301
|
+
* ])
|
|
4302
|
+
* carousel.first()
|
|
4303
|
+
* carousel.prev() // Wraps to 'slide-3'
|
|
4304
|
+
* carousel.next() // Wraps to 'slide-1'
|
|
3926
4305
|
* ```
|
|
3927
4306
|
*/
|
|
3928
|
-
function createStep(
|
|
3929
|
-
const
|
|
4307
|
+
function createStep(_options = {}) {
|
|
4308
|
+
const { circular = false,...options } = _options;
|
|
4309
|
+
const registry = createSingle(options);
|
|
3930
4310
|
function first() {
|
|
3931
|
-
const ticket = registry
|
|
3932
|
-
if (ticket) registry
|
|
4311
|
+
const ticket = registry.seek("first");
|
|
4312
|
+
if (ticket) registry.select(ticket.id);
|
|
3933
4313
|
}
|
|
3934
4314
|
function last() {
|
|
3935
|
-
const ticket = registry
|
|
3936
|
-
if (ticket) registry
|
|
4315
|
+
const ticket = registry.seek("last");
|
|
4316
|
+
if (ticket) registry.select(ticket.id);
|
|
3937
4317
|
}
|
|
3938
4318
|
function next() {
|
|
3939
4319
|
step(1);
|
|
@@ -3945,30 +4325,33 @@ function createStep(options) {
|
|
|
3945
4325
|
return (index % length + length) % length;
|
|
3946
4326
|
}
|
|
3947
4327
|
function step(count = 1) {
|
|
3948
|
-
const length = registry
|
|
4328
|
+
const length = registry.size;
|
|
3949
4329
|
if (!length) return;
|
|
4330
|
+
const currentIndex = registry.selectedIndex.value;
|
|
3950
4331
|
const direction = Math.sign(count || 1);
|
|
3951
4332
|
let hops = 0;
|
|
3952
|
-
let index = wrapped(length,
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
4333
|
+
let index = circular ? wrapped(length, currentIndex + count) : currentIndex + count;
|
|
4334
|
+
if (!circular && (index < 0 || index >= length)) return;
|
|
4335
|
+
let id = registry.lookup(index);
|
|
4336
|
+
while (id !== void 0 && toValue(registry.get(id)?.disabled) && hops < length) {
|
|
4337
|
+
index = circular ? wrapped(length, index + direction) : index + direction;
|
|
4338
|
+
if (!circular && (index < 0 || index >= length)) return;
|
|
4339
|
+
id = registry.lookup(index);
|
|
3957
4340
|
hops++;
|
|
3958
4341
|
}
|
|
3959
4342
|
if (id === void 0 || hops === length) return;
|
|
3960
|
-
registry
|
|
3961
|
-
registry
|
|
4343
|
+
registry.selectedIds.clear();
|
|
4344
|
+
registry.select(id);
|
|
3962
4345
|
}
|
|
3963
4346
|
return {
|
|
3964
|
-
...registry
|
|
4347
|
+
...registry,
|
|
3965
4348
|
first,
|
|
3966
4349
|
last,
|
|
3967
4350
|
next,
|
|
3968
4351
|
prev,
|
|
3969
4352
|
step,
|
|
3970
4353
|
get size() {
|
|
3971
|
-
return registry
|
|
4354
|
+
return registry.size;
|
|
3972
4355
|
}
|
|
3973
4356
|
};
|
|
3974
4357
|
}
|
|
@@ -4062,6 +4445,21 @@ var MemoryAdapter = class {
|
|
|
4062
4445
|
|
|
4063
4446
|
//#endregion
|
|
4064
4447
|
//#region src/composables/useStorage/index.ts
|
|
4448
|
+
/**
|
|
4449
|
+
* @module useStorage
|
|
4450
|
+
*
|
|
4451
|
+
* @remarks
|
|
4452
|
+
* Reactive storage composable with adapter pattern for localStorage, sessionStorage, or memory.
|
|
4453
|
+
*
|
|
4454
|
+
* Key features:
|
|
4455
|
+
* - Reactive refs that sync with storage
|
|
4456
|
+
* - localStorage, sessionStorage, and memory adapters
|
|
4457
|
+
* - Custom serialization support
|
|
4458
|
+
* - SSR fallback to memory adapter
|
|
4459
|
+
* - Automatic cleanup on remove/clear
|
|
4460
|
+
*
|
|
4461
|
+
* Uses adapter pattern to abstract storage implementation details.
|
|
4462
|
+
*/
|
|
4065
4463
|
const [useStorageContext, provideStorageContext] = createContext("v0:storage");
|
|
4066
4464
|
/**
|
|
4067
4465
|
* Creates a new storage instance.
|
|
@@ -4227,14 +4625,15 @@ var ThemeAdapter = class {
|
|
|
4227
4625
|
constructor(prefix) {
|
|
4228
4626
|
this.prefix = prefix;
|
|
4229
4627
|
}
|
|
4230
|
-
generate(colors) {
|
|
4628
|
+
generate(colors, isDark) {
|
|
4231
4629
|
let css = "";
|
|
4232
4630
|
for (const theme in colors) {
|
|
4233
4631
|
const themeColors = colors[theme];
|
|
4234
4632
|
if (!themeColors) continue;
|
|
4235
4633
|
const vars = Object.entries(themeColors).map(([key, val]) => ` --${this.prefix}-${key}: ${val};`).join("\n");
|
|
4236
|
-
css +=
|
|
4634
|
+
css += `[data-theme="${theme}"] {\n${vars}\n}\n`;
|
|
4237
4635
|
}
|
|
4636
|
+
if (isDark !== void 0) css += `:root {\n color-scheme: ${isDark ? "dark" : "light"};\n}\n`;
|
|
4238
4637
|
return css;
|
|
4239
4638
|
}
|
|
4240
4639
|
};
|
|
@@ -4253,9 +4652,35 @@ var Vuetify0ThemeAdapter = class extends ThemeAdapter {
|
|
|
4253
4652
|
this.cspNonce = options.cspNonce;
|
|
4254
4653
|
this.stylesheetId = options.stylesheetId ?? this.stylesheetId;
|
|
4255
4654
|
}
|
|
4256
|
-
|
|
4655
|
+
setup(app, context, target) {
|
|
4656
|
+
if (IN_BROWSER) {
|
|
4657
|
+
onScopeDispose(watch([context.colors, context.isDark], ([colors, isDark]) => {
|
|
4658
|
+
this.update(colors, isDark);
|
|
4659
|
+
}, { immediate: true }), true);
|
|
4660
|
+
if (/* @__PURE__ */ isNull(target)) return;
|
|
4661
|
+
const targetEl = target instanceof HTMLElement ? target : /* @__PURE__ */ isString(target) ? document.querySelector(target) : app._container || document.querySelector("#app") || document.body;
|
|
4662
|
+
if (!targetEl) return;
|
|
4663
|
+
onScopeDispose(watch(context.selectedId, (id) => {
|
|
4664
|
+
if (!id) return;
|
|
4665
|
+
targetEl.dataset.theme = String(id);
|
|
4666
|
+
}, { immediate: true }), true);
|
|
4667
|
+
} else {
|
|
4668
|
+
const head = app._context?.provides?.usehead ?? app._context?.provides?.head;
|
|
4669
|
+
if (head?.push) {
|
|
4670
|
+
const id = context.selectedId.value;
|
|
4671
|
+
head.push({
|
|
4672
|
+
htmlAttrs: { "data-theme": id ? String(id) : "" },
|
|
4673
|
+
style: [{
|
|
4674
|
+
innerHTML: this.generate(context.colors.value, context.isDark.value),
|
|
4675
|
+
id: this.stylesheetId
|
|
4676
|
+
}]
|
|
4677
|
+
});
|
|
4678
|
+
}
|
|
4679
|
+
}
|
|
4680
|
+
}
|
|
4681
|
+
update(colors, isDark) {
|
|
4257
4682
|
if (!IN_BROWSER) return;
|
|
4258
|
-
this.upsert(this.generate(colors));
|
|
4683
|
+
this.upsert(this.generate(colors, isDark));
|
|
4259
4684
|
}
|
|
4260
4685
|
upsert(styles) {
|
|
4261
4686
|
if (!IN_BROWSER) return;
|
|
@@ -4273,6 +4698,24 @@ var Vuetify0ThemeAdapter = class extends ThemeAdapter {
|
|
|
4273
4698
|
//#endregion
|
|
4274
4699
|
//#region src/composables/useTheme/index.ts
|
|
4275
4700
|
/**
|
|
4701
|
+
* @module useTheme
|
|
4702
|
+
*
|
|
4703
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-theme
|
|
4704
|
+
*
|
|
4705
|
+
* @remarks
|
|
4706
|
+
* Theme management composable with token resolution and CSS variable injection.
|
|
4707
|
+
*
|
|
4708
|
+
* Key features:
|
|
4709
|
+
* - Single-selection theme switching (extends createSingle)
|
|
4710
|
+
* - Token alias resolution via useTokens
|
|
4711
|
+
* - Lazy theme loading (compute colors only when selected)
|
|
4712
|
+
* - CSS variable generation via adapter pattern
|
|
4713
|
+
* - SSR support with head integration
|
|
4714
|
+
* - Theme cycling
|
|
4715
|
+
*
|
|
4716
|
+
* Integrates with createSingle for selection and useTokens for color resolution.
|
|
4717
|
+
*/
|
|
4718
|
+
/**
|
|
4276
4719
|
* Creates a new theme instance.
|
|
4277
4720
|
*
|
|
4278
4721
|
* @param options The options for the theme instance.
|
|
@@ -4312,7 +4755,7 @@ function createTheme(_options = {}) {
|
|
|
4312
4755
|
palette,
|
|
4313
4756
|
...themes
|
|
4314
4757
|
}, { flat: true });
|
|
4315
|
-
const registry
|
|
4758
|
+
const registry = createSingle(options);
|
|
4316
4759
|
for (const id in themes) {
|
|
4317
4760
|
const { colors: value,...theme } = themes[id];
|
|
4318
4761
|
register({
|
|
@@ -4320,21 +4763,22 @@ function createTheme(_options = {}) {
|
|
|
4320
4763
|
value,
|
|
4321
4764
|
...theme
|
|
4322
4765
|
});
|
|
4323
|
-
if (id === options.default && !registry
|
|
4766
|
+
if (id === options.default && !registry.selectedId.value) registry.select(id);
|
|
4324
4767
|
}
|
|
4325
|
-
const names = computed(() => registry
|
|
4768
|
+
const names = computed(() => registry.keys());
|
|
4326
4769
|
const colors = computed(() => {
|
|
4327
4770
|
const resolved = {};
|
|
4328
|
-
for (const theme of registry
|
|
4329
|
-
if (theme.lazy && theme.id !== registry
|
|
4771
|
+
for (const theme of registry.values()) {
|
|
4772
|
+
if (theme.lazy && theme.id !== registry.selectedId.value) continue;
|
|
4330
4773
|
resolved[theme.id] = resolve(theme.value);
|
|
4331
4774
|
}
|
|
4332
4775
|
return resolved;
|
|
4333
4776
|
});
|
|
4777
|
+
const isDark = toRef(() => registry.selectedItem.value?.dark ?? false);
|
|
4334
4778
|
function cycle(themes$1 = names.value) {
|
|
4335
|
-
const current = themes$1.indexOf(registry
|
|
4779
|
+
const current = themes$1.indexOf(registry.selectedId.value ?? "");
|
|
4336
4780
|
const next = current === -1 ? 0 : (current + 1) % themes$1.length;
|
|
4337
|
-
registry
|
|
4781
|
+
registry.select(themes$1[next]);
|
|
4338
4782
|
}
|
|
4339
4783
|
function resolve(colors$1) {
|
|
4340
4784
|
const resolved = {};
|
|
@@ -4347,15 +4791,16 @@ function createTheme(_options = {}) {
|
|
|
4347
4791
|
dark: false,
|
|
4348
4792
|
...registration
|
|
4349
4793
|
};
|
|
4350
|
-
return registry
|
|
4794
|
+
return registry.register(item);
|
|
4351
4795
|
}
|
|
4352
4796
|
return {
|
|
4353
|
-
...registry
|
|
4797
|
+
...registry,
|
|
4354
4798
|
colors,
|
|
4799
|
+
isDark,
|
|
4355
4800
|
register,
|
|
4356
4801
|
cycle,
|
|
4357
4802
|
get size() {
|
|
4358
|
-
return registry
|
|
4803
|
+
return registry.size;
|
|
4359
4804
|
}
|
|
4360
4805
|
};
|
|
4361
4806
|
}
|
|
@@ -4457,34 +4902,7 @@ function createThemePlugin(_options = {}) {
|
|
|
4457
4902
|
provideThemeContext(context, app);
|
|
4458
4903
|
},
|
|
4459
4904
|
setup: (app) => {
|
|
4460
|
-
|
|
4461
|
-
onScopeDispose(watch(context.colors, (colors) => {
|
|
4462
|
-
adapter.update(colors);
|
|
4463
|
-
}, { immediate: true }), true);
|
|
4464
|
-
if (target === null) return;
|
|
4465
|
-
const targetEl = target instanceof HTMLElement ? target : /* @__PURE__ */ isString(target) ? document.querySelector(target) : app._container || document.querySelector("#app") || document.body;
|
|
4466
|
-
if (!targetEl) return;
|
|
4467
|
-
let prevClass = "";
|
|
4468
|
-
onScopeDispose(watch(context.selectedId, (id) => {
|
|
4469
|
-
if (!id) return;
|
|
4470
|
-
const themeClass = `${adapter.prefix}-theme--${id}`;
|
|
4471
|
-
if (prevClass) targetEl.classList.remove(prevClass);
|
|
4472
|
-
targetEl.classList.add(themeClass);
|
|
4473
|
-
prevClass = themeClass;
|
|
4474
|
-
}, { immediate: true }), true);
|
|
4475
|
-
} else {
|
|
4476
|
-
const head = app._context?.provides?.usehead ?? app._context?.provides?.head;
|
|
4477
|
-
if (head?.push) {
|
|
4478
|
-
const id = context.selectedId.value;
|
|
4479
|
-
head.push({
|
|
4480
|
-
htmlAttrs: { class: id ? `${adapter.prefix}-theme--${id}` : "" },
|
|
4481
|
-
style: [{
|
|
4482
|
-
innerHTML: adapter.generate(context.colors.value),
|
|
4483
|
-
id: adapter.stylesheetId
|
|
4484
|
-
}]
|
|
4485
|
-
});
|
|
4486
|
-
}
|
|
4487
|
-
}
|
|
4905
|
+
adapter.setup(app, context, target);
|
|
4488
4906
|
}
|
|
4489
4907
|
});
|
|
4490
4908
|
}
|
|
@@ -4518,6 +4936,21 @@ function useTheme(namespace = "v0:theme") {
|
|
|
4518
4936
|
//#endregion
|
|
4519
4937
|
//#region src/composables/useTimeline/index.ts
|
|
4520
4938
|
/**
|
|
4939
|
+
* @module useTimeline
|
|
4940
|
+
*
|
|
4941
|
+
* @remarks
|
|
4942
|
+
* Bounded undo/redo system with overflow management.
|
|
4943
|
+
*
|
|
4944
|
+
* Key features:
|
|
4945
|
+
* - Fixed-size history (default: 10 items)
|
|
4946
|
+
* - Undo/redo stack management
|
|
4947
|
+
* - Overflow queue (preserves oldest items)
|
|
4948
|
+
* - Automatic reindexing after operations
|
|
4949
|
+
* - Perfect for command pattern, history tracking
|
|
4950
|
+
*
|
|
4951
|
+
* Extends useRegistry with temporal navigation capabilities.
|
|
4952
|
+
*/
|
|
4953
|
+
/**
|
|
4521
4954
|
* Creates a new timeline instance.
|
|
4522
4955
|
*
|
|
4523
4956
|
* @param _options The options for the timeline instance.
|
|
@@ -4546,48 +4979,48 @@ function useTheme(namespace = "v0:theme") {
|
|
|
4546
4979
|
*/
|
|
4547
4980
|
function createTimeline(_options = {}) {
|
|
4548
4981
|
const { size = 10,...options } = _options;
|
|
4549
|
-
const registry
|
|
4982
|
+
const registry = useRegistry(options);
|
|
4550
4983
|
const stack = [];
|
|
4551
4984
|
const overflow = [];
|
|
4552
4985
|
function register(item) {
|
|
4553
4986
|
stack.length = 0;
|
|
4554
|
-
if (registry
|
|
4555
|
-
const removing = registry
|
|
4987
|
+
if (registry.size < size) return registry.register({ ...item });
|
|
4988
|
+
const removing = registry.seek("first");
|
|
4556
4989
|
if (overflow.length === size) overflow.shift();
|
|
4557
4990
|
overflow.push(removing);
|
|
4558
|
-
registry
|
|
4559
|
-
const ticket = registry
|
|
4560
|
-
registry
|
|
4991
|
+
registry.unregister(removing.id);
|
|
4992
|
+
const ticket = registry.register({ ...item });
|
|
4993
|
+
registry.reindex();
|
|
4561
4994
|
return ticket;
|
|
4562
4995
|
}
|
|
4563
4996
|
function undo() {
|
|
4564
|
-
const item = registry
|
|
4997
|
+
const item = registry.seek("last");
|
|
4565
4998
|
if (!item) return void 0;
|
|
4566
4999
|
stack.push(item);
|
|
4567
|
-
registry
|
|
5000
|
+
registry.unregister(item.id);
|
|
4568
5001
|
const restored = overflow.pop();
|
|
4569
5002
|
if (restored) {
|
|
4570
|
-
const remaining = registry
|
|
4571
|
-
registry
|
|
4572
|
-
registry
|
|
4573
|
-
registry
|
|
5003
|
+
const remaining = registry.values();
|
|
5004
|
+
registry.clear();
|
|
5005
|
+
registry.onboard([restored, ...remaining]);
|
|
5006
|
+
registry.reindex();
|
|
4574
5007
|
}
|
|
4575
5008
|
return item;
|
|
4576
5009
|
}
|
|
4577
5010
|
function redo() {
|
|
4578
5011
|
if (stack.length === 0) return void 0;
|
|
4579
5012
|
const item = stack.pop();
|
|
4580
|
-
const ticket = registry
|
|
4581
|
-
registry
|
|
5013
|
+
const ticket = registry.register(item);
|
|
5014
|
+
registry.reindex();
|
|
4582
5015
|
return ticket;
|
|
4583
5016
|
}
|
|
4584
5017
|
return {
|
|
4585
|
-
...registry
|
|
5018
|
+
...registry,
|
|
4586
5019
|
register,
|
|
4587
5020
|
undo,
|
|
4588
5021
|
redo,
|
|
4589
5022
|
get size() {
|
|
4590
|
-
return registry
|
|
5023
|
+
return registry.size;
|
|
4591
5024
|
}
|
|
4592
5025
|
};
|
|
4593
5026
|
}
|
|
@@ -4649,82 +5082,26 @@ function useTimeline(namespace = "v0:timeline") {
|
|
|
4649
5082
|
}
|
|
4650
5083
|
|
|
4651
5084
|
//#endregion
|
|
4652
|
-
//#region src/components/Avatar/
|
|
4653
|
-
const
|
|
4654
|
-
var AvatarRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4655
|
-
name: "AvatarRoot",
|
|
4656
|
-
__name: "AvatarRoot",
|
|
4657
|
-
props: {
|
|
4658
|
-
as: { default: "div" },
|
|
4659
|
-
renderless: { type: Boolean }
|
|
4660
|
-
},
|
|
4661
|
-
setup(__props) {
|
|
4662
|
-
const imageItems = computed(() => Array.from(registry.collection.values()).filter((item) => item.type === "image").toSorted((a, b) => a.priority - b.priority));
|
|
4663
|
-
const fallbackItems = computed(() => Array.from(registry.collection.values()).filter((item) => item.type === "fallback"));
|
|
4664
|
-
const visibleItem = computed(() => {
|
|
4665
|
-
const loadedImage = imageItems.value.find((item) => item.status === "loaded");
|
|
4666
|
-
if (loadedImage) return loadedImage;
|
|
4667
|
-
const loadingImage = imageItems.value.find((item) => item.status === "loading");
|
|
4668
|
-
if (loadingImage) return loadingImage;
|
|
4669
|
-
const firstFallback = fallbackItems.value[0];
|
|
4670
|
-
if (firstFallback) return firstFallback;
|
|
4671
|
-
});
|
|
4672
|
-
function register(registration = {}) {
|
|
4673
|
-
const id = registration.id ?? /* @__PURE__ */ genId();
|
|
4674
|
-
const item = {
|
|
4675
|
-
...registration,
|
|
4676
|
-
id,
|
|
4677
|
-
type: registration.type ?? "fallback",
|
|
4678
|
-
priority: registration.priority ?? registry.collection.size,
|
|
4679
|
-
status: registration.status ?? "idle",
|
|
4680
|
-
isVisible: toRef(() => visibleItem.value?.id === id)
|
|
4681
|
-
};
|
|
4682
|
-
return registry.register(item);
|
|
4683
|
-
}
|
|
4684
|
-
function reset() {
|
|
4685
|
-
for (const item of registry.collection.values()) if (item.type === "image") item.status = "idle";
|
|
4686
|
-
}
|
|
4687
|
-
provideAvatarContext({
|
|
4688
|
-
...registry,
|
|
4689
|
-
register,
|
|
4690
|
-
reset
|
|
4691
|
-
});
|
|
4692
|
-
return (_ctx, _cache) => {
|
|
4693
|
-
return openBlock(), createBlock(unref(Atom_default), {
|
|
4694
|
-
as: _ctx.as,
|
|
4695
|
-
renderless: _ctx.renderless
|
|
4696
|
-
}, {
|
|
4697
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
4698
|
-
_: 3
|
|
4699
|
-
}, 8, ["as", "renderless"]);
|
|
4700
|
-
};
|
|
4701
|
-
}
|
|
4702
|
-
});
|
|
4703
|
-
|
|
4704
|
-
//#endregion
|
|
4705
|
-
//#region src/components/Avatar/AvatarRoot.vue
|
|
4706
|
-
var AvatarRoot_default = AvatarRoot_vue_vue_type_script_setup_true_lang_default;
|
|
4707
|
-
|
|
4708
|
-
//#endregion
|
|
4709
|
-
//#region src/components/Avatar/AvatarFallback.vue?vue&type=script&setup=true&lang.ts
|
|
4710
|
-
var AvatarFallback_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
5085
|
+
//#region src/components/Avatar/AvatarFallback.vue
|
|
5086
|
+
const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
4711
5087
|
name: "AvatarFallback",
|
|
4712
5088
|
__name: "AvatarFallback",
|
|
4713
5089
|
props: {
|
|
5090
|
+
namespace: { default: "v0:avatar" },
|
|
4714
5091
|
as: { default: "span" },
|
|
4715
5092
|
renderless: { type: Boolean }
|
|
4716
5093
|
},
|
|
4717
5094
|
setup(__props) {
|
|
4718
|
-
const context =
|
|
5095
|
+
const context = useContext(__props.namespace);
|
|
4719
5096
|
const ticket = context.register({ type: "fallback" });
|
|
4720
5097
|
onUnmounted(() => {
|
|
4721
5098
|
context.unregister(ticket.id);
|
|
4722
5099
|
});
|
|
4723
5100
|
return (_ctx, _cache) => {
|
|
4724
|
-
return unref(ticket).
|
|
5101
|
+
return unref(ticket).isSelected.value ? (openBlock(), createBlock(unref(Atom_default), {
|
|
4725
5102
|
key: 0,
|
|
4726
|
-
as:
|
|
4727
|
-
renderless:
|
|
5103
|
+
as: __props.as,
|
|
5104
|
+
renderless: __props.renderless
|
|
4728
5105
|
}, {
|
|
4729
5106
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
4730
5107
|
_: 3
|
|
@@ -4732,20 +5109,18 @@ var AvatarFallback_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
4732
5109
|
};
|
|
4733
5110
|
}
|
|
4734
5111
|
});
|
|
5112
|
+
var AvatarFallback_default = _sfc_main$17;
|
|
4735
5113
|
|
|
4736
5114
|
//#endregion
|
|
4737
|
-
//#region src/components/Avatar/
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
//#endregion
|
|
4741
|
-
//#region src/components/Avatar/AvatarImage.vue?vue&type=script&setup=true&lang.ts
|
|
4742
|
-
var AvatarImage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
5115
|
+
//#region src/components/Avatar/AvatarImage.vue
|
|
5116
|
+
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
4743
5117
|
name: "AvatarImage",
|
|
4744
5118
|
inheritAttrs: false,
|
|
4745
5119
|
__name: "AvatarImage",
|
|
4746
5120
|
props: {
|
|
4747
5121
|
src: {},
|
|
4748
5122
|
priority: { default: 0 },
|
|
5123
|
+
namespace: { default: "v0:avatar" },
|
|
4749
5124
|
as: { default: "img" },
|
|
4750
5125
|
renderless: { type: Boolean }
|
|
4751
5126
|
},
|
|
@@ -4754,21 +5129,25 @@ var AvatarImage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
4754
5129
|
const props = createPropsRestProxy(__props, [
|
|
4755
5130
|
"as",
|
|
4756
5131
|
"renderless",
|
|
4757
|
-
"priority"
|
|
5132
|
+
"priority",
|
|
5133
|
+
"namespace"
|
|
4758
5134
|
]);
|
|
4759
5135
|
const emit = __emit;
|
|
4760
|
-
const context =
|
|
5136
|
+
const context = useContext(__props.namespace);
|
|
4761
5137
|
const ticket = context.register({
|
|
4762
5138
|
priority: __props.priority,
|
|
4763
|
-
|
|
4764
|
-
|
|
5139
|
+
type: "image",
|
|
5140
|
+
disabled: true
|
|
4765
5141
|
});
|
|
4766
5142
|
function onLoad(e) {
|
|
4767
|
-
ticket.
|
|
5143
|
+
ticket.disabled = false;
|
|
5144
|
+
ticket.select();
|
|
4768
5145
|
emit("load", e);
|
|
4769
5146
|
}
|
|
4770
5147
|
function onError(e) {
|
|
4771
|
-
ticket.
|
|
5148
|
+
ticket.disabled = true;
|
|
5149
|
+
const first = context.seek("first");
|
|
5150
|
+
if (first) context.select(first.id);
|
|
4772
5151
|
emit("error", e);
|
|
4773
5152
|
}
|
|
4774
5153
|
onUnmounted(() => {
|
|
@@ -4782,19 +5161,46 @@ var AvatarImage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
4782
5161
|
}));
|
|
4783
5162
|
return (_ctx, _cache) => {
|
|
4784
5163
|
return withDirectives((openBlock(), createBlock(unref(Atom_default), mergeProps({
|
|
4785
|
-
as:
|
|
4786
|
-
renderless:
|
|
5164
|
+
as: __props.as,
|
|
5165
|
+
renderless: __props.renderless
|
|
4787
5166
|
}, bindableProps.value), {
|
|
4788
5167
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(bindableProps.value)))]),
|
|
4789
5168
|
_: 3
|
|
4790
|
-
}, 16, ["as", "renderless"])), [[vShow, unref(ticket).
|
|
5169
|
+
}, 16, ["as", "renderless"])), [[vShow, unref(ticket).isSelected.value]]);
|
|
4791
5170
|
};
|
|
4792
5171
|
}
|
|
4793
5172
|
});
|
|
5173
|
+
var AvatarImage_default = _sfc_main$16;
|
|
4794
5174
|
|
|
4795
5175
|
//#endregion
|
|
4796
|
-
//#region src/components/Avatar/
|
|
4797
|
-
|
|
5176
|
+
//#region src/components/Avatar/AvatarRoot.vue
|
|
5177
|
+
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
5178
|
+
name: "AvatarRoot",
|
|
5179
|
+
__name: "AvatarRoot",
|
|
5180
|
+
props: {
|
|
5181
|
+
namespace: { default: "v0:avatar" },
|
|
5182
|
+
as: { default: "div" },
|
|
5183
|
+
renderless: { type: Boolean }
|
|
5184
|
+
},
|
|
5185
|
+
setup(__props) {
|
|
5186
|
+
const [, provideAvatarContext] = createSelectionContext({
|
|
5187
|
+
namespace: __props.namespace,
|
|
5188
|
+
mandatory: "force",
|
|
5189
|
+
multiple: false
|
|
5190
|
+
});
|
|
5191
|
+
provideAvatarContext();
|
|
5192
|
+
return (_ctx, _cache) => {
|
|
5193
|
+
return openBlock(), createBlock(unref(Atom_default), {
|
|
5194
|
+
as: __props.as,
|
|
5195
|
+
renderless: __props.renderless
|
|
5196
|
+
}, {
|
|
5197
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
5198
|
+
_: 3
|
|
5199
|
+
}, 8, ["as", "renderless"]);
|
|
5200
|
+
};
|
|
5201
|
+
}
|
|
5202
|
+
});
|
|
5203
|
+
var AvatarRoot_default = _sfc_main$15;
|
|
4798
5204
|
|
|
4799
5205
|
//#endregion
|
|
4800
5206
|
//#region src/components/Avatar/index.ts
|
|
@@ -4805,9 +5211,340 @@ const Avatar = {
|
|
|
4805
5211
|
};
|
|
4806
5212
|
|
|
4807
5213
|
//#endregion
|
|
4808
|
-
//#region src/components/
|
|
5214
|
+
//#region src/components/ExpansionPanel/ExpansionPanelActivator.vue
|
|
5215
|
+
const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
5216
|
+
name: "ExpansionPanelActivator",
|
|
5217
|
+
__name: "ExpansionPanelActivator",
|
|
5218
|
+
props: {
|
|
5219
|
+
itemNamespace: { default: "v0:expansion-panel-item" },
|
|
5220
|
+
as: { default: "button" },
|
|
5221
|
+
renderless: { type: Boolean }
|
|
5222
|
+
},
|
|
5223
|
+
setup(__props) {
|
|
5224
|
+
const context = useContext(__props.itemNamespace);
|
|
5225
|
+
function onKeydown(e) {
|
|
5226
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
5227
|
+
e.preventDefault();
|
|
5228
|
+
context.ticket.toggle();
|
|
5229
|
+
}
|
|
5230
|
+
}
|
|
5231
|
+
const bindableProps = computed(() => ({
|
|
5232
|
+
"id": context.headerId.value,
|
|
5233
|
+
"role": "button",
|
|
5234
|
+
"tabindex": context.isDisabled.value ? -1 : 0,
|
|
5235
|
+
"aria-expanded": context.ticket.isSelected.value,
|
|
5236
|
+
"aria-controls": context.contentId.value,
|
|
5237
|
+
"aria-disabled": context.isDisabled.value,
|
|
5238
|
+
"isSelected": context.ticket.isSelected.value,
|
|
5239
|
+
"toggle": context.ticket.toggle,
|
|
5240
|
+
"onClick": context.ticket.toggle,
|
|
5241
|
+
onKeydown
|
|
5242
|
+
}));
|
|
5243
|
+
return (_ctx, _cache) => {
|
|
5244
|
+
return openBlock(), createBlock(unref(Atom_default), {
|
|
5245
|
+
id: bindableProps.value.id,
|
|
5246
|
+
"aria-controls": bindableProps.value["aria-controls"],
|
|
5247
|
+
"aria-disabled": bindableProps.value["aria-disabled"],
|
|
5248
|
+
"aria-expanded": bindableProps.value["aria-expanded"],
|
|
5249
|
+
as: __props.as,
|
|
5250
|
+
renderless: __props.renderless,
|
|
5251
|
+
role: bindableProps.value.role,
|
|
5252
|
+
tabindex: bindableProps.value.tabindex,
|
|
5253
|
+
onClick: unref(context).ticket.toggle,
|
|
5254
|
+
onKeydown
|
|
5255
|
+
}, {
|
|
5256
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(bindableProps.value)))]),
|
|
5257
|
+
_: 3
|
|
5258
|
+
}, 8, [
|
|
5259
|
+
"id",
|
|
5260
|
+
"aria-controls",
|
|
5261
|
+
"aria-disabled",
|
|
5262
|
+
"aria-expanded",
|
|
5263
|
+
"as",
|
|
5264
|
+
"renderless",
|
|
5265
|
+
"role",
|
|
5266
|
+
"tabindex",
|
|
5267
|
+
"onClick"
|
|
5268
|
+
]);
|
|
5269
|
+
};
|
|
5270
|
+
}
|
|
5271
|
+
});
|
|
5272
|
+
var ExpansionPanelActivator_default = _sfc_main$14;
|
|
5273
|
+
|
|
5274
|
+
//#endregion
|
|
5275
|
+
//#region src/components/ExpansionPanel/ExpansionPanelContent.vue
|
|
5276
|
+
const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
5277
|
+
name: "ExpansionPanelContent",
|
|
5278
|
+
__name: "ExpansionPanelContent",
|
|
5279
|
+
props: {
|
|
5280
|
+
itemNamespace: { default: "v0:expansion-panel-item" },
|
|
5281
|
+
as: {},
|
|
5282
|
+
renderless: { type: Boolean }
|
|
5283
|
+
},
|
|
5284
|
+
setup(__props) {
|
|
5285
|
+
const context = useContext(__props.itemNamespace);
|
|
5286
|
+
const bindableProps = computed(() => ({
|
|
5287
|
+
"id": context.contentId.value,
|
|
5288
|
+
"role": "region",
|
|
5289
|
+
"aria-labelledby": context.headerId.value,
|
|
5290
|
+
"isSelected": context.ticket.isSelected.value
|
|
5291
|
+
}));
|
|
5292
|
+
return (_ctx, _cache) => {
|
|
5293
|
+
return openBlock(), createBlock(unref(Atom_default), {
|
|
5294
|
+
id: bindableProps.value.id,
|
|
5295
|
+
"aria-labelledby": bindableProps.value["aria-labelledby"],
|
|
5296
|
+
as: __props.as,
|
|
5297
|
+
renderless: __props.renderless,
|
|
5298
|
+
role: bindableProps.value.role
|
|
5299
|
+
}, {
|
|
5300
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(bindableProps.value)))]),
|
|
5301
|
+
_: 3
|
|
5302
|
+
}, 8, [
|
|
5303
|
+
"id",
|
|
5304
|
+
"aria-labelledby",
|
|
5305
|
+
"as",
|
|
5306
|
+
"renderless",
|
|
5307
|
+
"role"
|
|
5308
|
+
]);
|
|
5309
|
+
};
|
|
5310
|
+
}
|
|
5311
|
+
});
|
|
5312
|
+
var ExpansionPanelContent_default = _sfc_main$13;
|
|
5313
|
+
|
|
5314
|
+
//#endregion
|
|
5315
|
+
//#region src/components/ExpansionPanel/ExpansionPanelItem.vue
|
|
5316
|
+
const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
5317
|
+
name: "ExpansionPanelItem",
|
|
5318
|
+
__name: "ExpansionPanelItem",
|
|
5319
|
+
props: {
|
|
5320
|
+
id: {},
|
|
5321
|
+
value: {},
|
|
5322
|
+
disabled: {},
|
|
5323
|
+
namespace: { default: "v0:expansion-panel" },
|
|
5324
|
+
itemNamespace: { default: "v0:expansion-panel-item" },
|
|
5325
|
+
as: {},
|
|
5326
|
+
renderless: { type: Boolean }
|
|
5327
|
+
},
|
|
5328
|
+
setup(__props) {
|
|
5329
|
+
const expansion = useSelection(__props.namespace);
|
|
5330
|
+
const ticket = expansion.register({
|
|
5331
|
+
id: __props.id,
|
|
5332
|
+
value: __props.value,
|
|
5333
|
+
disabled: __props.disabled
|
|
5334
|
+
});
|
|
5335
|
+
const headerId = toRef(() => `${ticket.id}-header`);
|
|
5336
|
+
const contentId = toRef(() => `${ticket.id}-content`);
|
|
5337
|
+
const isDisabled = toRef(() => toValue(ticket.disabled) || toValue(expansion.disabled));
|
|
5338
|
+
const [, provideItemContext] = createContext(__props.itemNamespace);
|
|
5339
|
+
provideItemContext({
|
|
5340
|
+
ticket,
|
|
5341
|
+
headerId,
|
|
5342
|
+
contentId,
|
|
5343
|
+
isDisabled
|
|
5344
|
+
});
|
|
5345
|
+
onUnmounted(() => {
|
|
5346
|
+
expansion.unregister(ticket.id);
|
|
5347
|
+
});
|
|
5348
|
+
return (_ctx, _cache) => {
|
|
5349
|
+
return openBlock(), createBlock(unref(Atom_default), {
|
|
5350
|
+
as: __props.as,
|
|
5351
|
+
renderless: __props.renderless
|
|
5352
|
+
}, {
|
|
5353
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
5354
|
+
_: 3
|
|
5355
|
+
}, 8, ["as", "renderless"]);
|
|
5356
|
+
};
|
|
5357
|
+
}
|
|
5358
|
+
});
|
|
5359
|
+
var ExpansionPanelItem_default = _sfc_main$12;
|
|
5360
|
+
|
|
5361
|
+
//#endregion
|
|
5362
|
+
//#region src/components/ExpansionPanel/ExpansionPanelRoot.vue
|
|
5363
|
+
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
5364
|
+
name: "ExpansionPanelRoot",
|
|
5365
|
+
__name: "ExpansionPanelRoot",
|
|
5366
|
+
props: /* @__PURE__ */ mergeModels({
|
|
5367
|
+
namespace: { default: "v0:expansion-panel" },
|
|
5368
|
+
disabled: {
|
|
5369
|
+
type: Boolean,
|
|
5370
|
+
default: false
|
|
5371
|
+
},
|
|
5372
|
+
enroll: {
|
|
5373
|
+
type: Boolean,
|
|
5374
|
+
default: false
|
|
5375
|
+
},
|
|
5376
|
+
mandatory: {
|
|
5377
|
+
type: [Boolean, String],
|
|
5378
|
+
default: false
|
|
5379
|
+
},
|
|
5380
|
+
multiple: {
|
|
5381
|
+
type: Boolean,
|
|
5382
|
+
default: false
|
|
5383
|
+
},
|
|
5384
|
+
as: {},
|
|
5385
|
+
renderless: { type: Boolean }
|
|
5386
|
+
}, {
|
|
5387
|
+
"modelValue": {},
|
|
5388
|
+
"modelModifiers": {}
|
|
5389
|
+
}),
|
|
5390
|
+
emits: /* @__PURE__ */ mergeModels(["update:model-value"], ["update:modelValue"]),
|
|
5391
|
+
setup(__props) {
|
|
5392
|
+
const model = useModel(__props, "modelValue");
|
|
5393
|
+
const [, provideExpansionControl, context] = createSelectionContext({
|
|
5394
|
+
namespace: __props.namespace,
|
|
5395
|
+
disabled: toRef(() => __props.disabled),
|
|
5396
|
+
enroll: __props.enroll,
|
|
5397
|
+
mandatory: __props.mandatory,
|
|
5398
|
+
multiple: __props.multiple,
|
|
5399
|
+
events: true
|
|
5400
|
+
});
|
|
5401
|
+
const bindableProps = computed(() => ({
|
|
5402
|
+
disabled: toValue(context.disabled),
|
|
5403
|
+
multiple: __props.multiple,
|
|
5404
|
+
select: context.select,
|
|
5405
|
+
unselect: context.unselect,
|
|
5406
|
+
toggle: context.toggle,
|
|
5407
|
+
ariaMultiselectable: __props.multiple
|
|
5408
|
+
}));
|
|
5409
|
+
useProxyModel(context, model, { multiple: __props.multiple });
|
|
5410
|
+
provideExpansionControl(context);
|
|
5411
|
+
return (_ctx, _cache) => {
|
|
5412
|
+
return openBlock(), createBlock(unref(Atom_default), {
|
|
5413
|
+
"aria-multiselectable": bindableProps.value.ariaMultiselectable,
|
|
5414
|
+
as: __props.as,
|
|
5415
|
+
disabled: bindableProps.value.disabled,
|
|
5416
|
+
multiple: bindableProps.value.multiple,
|
|
5417
|
+
renderless: __props.renderless,
|
|
5418
|
+
select: bindableProps.value.select,
|
|
5419
|
+
toggle: bindableProps.value.toggle,
|
|
5420
|
+
unselect: bindableProps.value.unselect
|
|
5421
|
+
}, {
|
|
5422
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(bindableProps.value)))]),
|
|
5423
|
+
_: 3
|
|
5424
|
+
}, 8, [
|
|
5425
|
+
"aria-multiselectable",
|
|
5426
|
+
"as",
|
|
5427
|
+
"disabled",
|
|
5428
|
+
"multiple",
|
|
5429
|
+
"renderless",
|
|
5430
|
+
"select",
|
|
5431
|
+
"toggle",
|
|
5432
|
+
"unselect"
|
|
5433
|
+
]);
|
|
5434
|
+
};
|
|
5435
|
+
}
|
|
5436
|
+
});
|
|
5437
|
+
var ExpansionPanelRoot_default = _sfc_main$11;
|
|
5438
|
+
|
|
5439
|
+
//#endregion
|
|
5440
|
+
//#region src/components/ExpansionPanel/index.ts
|
|
5441
|
+
const ExpansionPanel = {
|
|
5442
|
+
Root: ExpansionPanelRoot_default,
|
|
5443
|
+
Item: ExpansionPanelItem_default,
|
|
5444
|
+
Activator: ExpansionPanelActivator_default,
|
|
5445
|
+
Content: ExpansionPanelContent_default
|
|
5446
|
+
};
|
|
5447
|
+
|
|
5448
|
+
//#endregion
|
|
5449
|
+
//#region src/components/Group/GroupItem.vue
|
|
5450
|
+
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
5451
|
+
name: "GroupItem",
|
|
5452
|
+
__name: "GroupItem",
|
|
5453
|
+
props: {
|
|
5454
|
+
label: {},
|
|
5455
|
+
id: {},
|
|
5456
|
+
disabled: {},
|
|
5457
|
+
value: {},
|
|
5458
|
+
namespace: { default: "v0:group" }
|
|
5459
|
+
},
|
|
5460
|
+
setup(__props) {
|
|
5461
|
+
const group = useGroup(__props.namespace);
|
|
5462
|
+
const ticket = group.register({
|
|
5463
|
+
id: __props.id,
|
|
5464
|
+
value: __props.value,
|
|
5465
|
+
disabled: __props.disabled
|
|
5466
|
+
});
|
|
5467
|
+
const isDisabled = toRef(() => ticket.disabled || group.disabled);
|
|
5468
|
+
onUnmounted(() => {
|
|
5469
|
+
group.unregister(ticket.id);
|
|
5470
|
+
});
|
|
5471
|
+
return (_ctx, _cache) => {
|
|
5472
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
5473
|
+
id: String(unref(ticket).id),
|
|
5474
|
+
ariaDisabled: toValue(isDisabled.value),
|
|
5475
|
+
ariaSelected: toValue(unref(ticket).isSelected),
|
|
5476
|
+
disabled: toValue(isDisabled.value),
|
|
5477
|
+
isSelected: toValue(unref(ticket).isSelected),
|
|
5478
|
+
label: __props.label,
|
|
5479
|
+
select: unref(ticket).select,
|
|
5480
|
+
toggle: unref(ticket).toggle,
|
|
5481
|
+
unselect: unref(ticket).unselect,
|
|
5482
|
+
value: __props.value
|
|
5483
|
+
});
|
|
5484
|
+
};
|
|
5485
|
+
}
|
|
5486
|
+
});
|
|
5487
|
+
var GroupItem_default = _sfc_main$10;
|
|
5488
|
+
|
|
5489
|
+
//#endregion
|
|
5490
|
+
//#region src/components/Group/GroupRoot.vue
|
|
5491
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
5492
|
+
name: "GroupRoot",
|
|
5493
|
+
__name: "GroupRoot",
|
|
5494
|
+
props: /* @__PURE__ */ mergeModels({
|
|
5495
|
+
namespace: { default: "v0:group" },
|
|
5496
|
+
disabled: {
|
|
5497
|
+
type: Boolean,
|
|
5498
|
+
default: false
|
|
5499
|
+
},
|
|
5500
|
+
enroll: {
|
|
5501
|
+
type: Boolean,
|
|
5502
|
+
default: false
|
|
5503
|
+
},
|
|
5504
|
+
mandatory: {
|
|
5505
|
+
type: [Boolean, String],
|
|
5506
|
+
default: false
|
|
5507
|
+
}
|
|
5508
|
+
}, {
|
|
5509
|
+
"modelValue": {},
|
|
5510
|
+
"modelModifiers": {}
|
|
5511
|
+
}),
|
|
5512
|
+
emits: ["update:modelValue"],
|
|
5513
|
+
setup(__props) {
|
|
5514
|
+
const model = useModel(__props, "modelValue");
|
|
5515
|
+
const [, provideGroupControl, context] = createGroupContext({
|
|
5516
|
+
namespace: __props.namespace,
|
|
5517
|
+
disabled: toRef(() => __props.disabled),
|
|
5518
|
+
enroll: __props.enroll,
|
|
5519
|
+
mandatory: __props.mandatory,
|
|
5520
|
+
events: true
|
|
5521
|
+
});
|
|
5522
|
+
useProxyModel(context, model, { multiple: true });
|
|
5523
|
+
provideGroupControl(context);
|
|
5524
|
+
return (_ctx, _cache) => {
|
|
5525
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
5526
|
+
ariaMultiselectable: true,
|
|
5527
|
+
disabled: toValue(unref(context).disabled),
|
|
5528
|
+
select: unref(context).select,
|
|
5529
|
+
toggle: unref(context).toggle,
|
|
5530
|
+
unselect: unref(context).unselect
|
|
5531
|
+
});
|
|
5532
|
+
};
|
|
5533
|
+
}
|
|
5534
|
+
});
|
|
5535
|
+
var GroupRoot_default = _sfc_main$9;
|
|
5536
|
+
|
|
5537
|
+
//#endregion
|
|
5538
|
+
//#region src/components/Group/index.ts
|
|
5539
|
+
const Group = {
|
|
5540
|
+
Root: GroupRoot_default,
|
|
5541
|
+
Item: GroupItem_default
|
|
5542
|
+
};
|
|
5543
|
+
|
|
5544
|
+
//#endregion
|
|
5545
|
+
//#region src/components/Popover/PopoverRoot.vue
|
|
4809
5546
|
const [usePopoverContext, providePopoverContext] = createContext("Popover");
|
|
4810
|
-
|
|
5547
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
4811
5548
|
name: "PopoverRoot",
|
|
4812
5549
|
__name: "PopoverRoot",
|
|
4813
5550
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -4841,8 +5578,8 @@ var PopoverRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
4841
5578
|
});
|
|
4842
5579
|
return (_ctx, _cache) => {
|
|
4843
5580
|
return openBlock(), createBlock(unref(Atom_default), mergeProps({
|
|
4844
|
-
as:
|
|
4845
|
-
renderless:
|
|
5581
|
+
as: __props.as,
|
|
5582
|
+
renderless: __props.renderless
|
|
4846
5583
|
}, bindableProps.value), {
|
|
4847
5584
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(bindableProps.value)))]),
|
|
4848
5585
|
_: 3
|
|
@@ -4850,14 +5587,11 @@ var PopoverRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
4850
5587
|
};
|
|
4851
5588
|
}
|
|
4852
5589
|
});
|
|
5590
|
+
var PopoverRoot_default = _sfc_main$8;
|
|
4853
5591
|
|
|
4854
5592
|
//#endregion
|
|
4855
|
-
//#region src/components/Popover/
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
//#endregion
|
|
4859
|
-
//#region src/components/Popover/PopoverAnchor.vue?vue&type=script&setup=true&lang.ts
|
|
4860
|
-
var PopoverAnchor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
5593
|
+
//#region src/components/Popover/PopoverAnchor.vue
|
|
5594
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
4861
5595
|
name: "PopoverAnchor",
|
|
4862
5596
|
__name: "PopoverAnchor",
|
|
4863
5597
|
props: {
|
|
@@ -4872,11 +5606,11 @@ var PopoverAnchor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
4872
5606
|
const style = toRef(() => ({ anchorName: `--${popovertarget.value}` }));
|
|
4873
5607
|
return (_ctx, _cache) => {
|
|
4874
5608
|
return openBlock(), createBlock(unref(Atom_default), {
|
|
4875
|
-
as:
|
|
5609
|
+
as: __props.as,
|
|
4876
5610
|
"data-popover-open": unref(context).isSelected.value ? "" : void 0,
|
|
4877
5611
|
popovertarget: popovertarget.value,
|
|
4878
5612
|
style: normalizeStyle(style.value),
|
|
4879
|
-
type:
|
|
5613
|
+
type: __props.as === "button" ? "button" : void 0
|
|
4880
5614
|
}, {
|
|
4881
5615
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
4882
5616
|
_: 3
|
|
@@ -4890,14 +5624,11 @@ var PopoverAnchor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
4890
5624
|
};
|
|
4891
5625
|
}
|
|
4892
5626
|
});
|
|
5627
|
+
var PopoverAnchor_default = _sfc_main$7;
|
|
4893
5628
|
|
|
4894
5629
|
//#endregion
|
|
4895
|
-
//#region src/components/Popover/
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
//#endregion
|
|
4899
|
-
//#region src/components/Popover/PopoverContent.vue?vue&type=script&setup=true&lang.ts
|
|
4900
|
-
var PopoverContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
5630
|
+
//#region src/components/Popover/PopoverContent.vue
|
|
5631
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
4901
5632
|
name: "PopoverContent",
|
|
4902
5633
|
__name: "PopoverContent",
|
|
4903
5634
|
props: {
|
|
@@ -4922,6 +5653,12 @@ var PopoverContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
4922
5653
|
onMounted(() => {
|
|
4923
5654
|
if (context.isSelected.value) ref$1.value?.element?.showPopover();
|
|
4924
5655
|
});
|
|
5656
|
+
watch(context.isSelected, (isOpen) => {
|
|
5657
|
+
const element = ref$1.value?.element;
|
|
5658
|
+
if (!element) return;
|
|
5659
|
+
if (isOpen) element.showPopover?.();
|
|
5660
|
+
else element.hidePopover?.();
|
|
5661
|
+
});
|
|
4925
5662
|
function onBeforeToggle(e) {
|
|
4926
5663
|
context.isSelected.value = e.newState === "open";
|
|
4927
5664
|
emit("beforetoggle", e);
|
|
@@ -4941,10 +5678,7 @@ var PopoverContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
4941
5678
|
};
|
|
4942
5679
|
}
|
|
4943
5680
|
});
|
|
4944
|
-
|
|
4945
|
-
//#endregion
|
|
4946
|
-
//#region src/components/Popover/PopoverContent.vue
|
|
4947
|
-
var PopoverContent_default = PopoverContent_vue_vue_type_script_setup_true_lang_default;
|
|
5681
|
+
var PopoverContent_default = _sfc_main$6;
|
|
4948
5682
|
|
|
4949
5683
|
//#endregion
|
|
4950
5684
|
//#region src/components/Popover/index.ts
|
|
@@ -4955,4 +5689,303 @@ const Popover = {
|
|
|
4955
5689
|
};
|
|
4956
5690
|
|
|
4957
5691
|
//#endregion
|
|
4958
|
-
|
|
5692
|
+
//#region src/components/Selection/SelectionItem.vue
|
|
5693
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
5694
|
+
name: "SelectionItem",
|
|
5695
|
+
__name: "SelectionItem",
|
|
5696
|
+
props: {
|
|
5697
|
+
label: {},
|
|
5698
|
+
id: {},
|
|
5699
|
+
disabled: {},
|
|
5700
|
+
value: {},
|
|
5701
|
+
namespace: { default: "v0:selection" }
|
|
5702
|
+
},
|
|
5703
|
+
setup(__props) {
|
|
5704
|
+
const selection = useSelection(__props.namespace);
|
|
5705
|
+
const ticket = selection.register({
|
|
5706
|
+
id: __props.id,
|
|
5707
|
+
value: __props.value,
|
|
5708
|
+
disabled: __props.disabled
|
|
5709
|
+
});
|
|
5710
|
+
const isDisabled = toRef(() => ticket.disabled || selection.disabled);
|
|
5711
|
+
onUnmounted(() => {
|
|
5712
|
+
selection.unregister(ticket.id);
|
|
5713
|
+
});
|
|
5714
|
+
return (_ctx, _cache) => {
|
|
5715
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
5716
|
+
id: String(unref(ticket).id),
|
|
5717
|
+
ariaDisabled: toValue(isDisabled.value),
|
|
5718
|
+
ariaSelected: toValue(unref(ticket).isSelected),
|
|
5719
|
+
disabled: toValue(isDisabled.value),
|
|
5720
|
+
isSelected: toValue(unref(ticket).isSelected),
|
|
5721
|
+
label: __props.label,
|
|
5722
|
+
select: unref(ticket).select,
|
|
5723
|
+
toggle: unref(ticket).toggle,
|
|
5724
|
+
unselect: unref(ticket).unselect,
|
|
5725
|
+
value: __props.value
|
|
5726
|
+
});
|
|
5727
|
+
};
|
|
5728
|
+
}
|
|
5729
|
+
});
|
|
5730
|
+
var SelectionItem_default = _sfc_main$5;
|
|
5731
|
+
|
|
5732
|
+
//#endregion
|
|
5733
|
+
//#region src/components/Selection/SelectionRoot.vue
|
|
5734
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
5735
|
+
name: "SelectionRoot",
|
|
5736
|
+
__name: "SelectionRoot",
|
|
5737
|
+
props: /* @__PURE__ */ mergeModels({
|
|
5738
|
+
namespace: { default: "v0:selection" },
|
|
5739
|
+
disabled: {
|
|
5740
|
+
type: Boolean,
|
|
5741
|
+
default: false
|
|
5742
|
+
},
|
|
5743
|
+
enroll: {
|
|
5744
|
+
type: Boolean,
|
|
5745
|
+
default: false
|
|
5746
|
+
},
|
|
5747
|
+
mandatory: {
|
|
5748
|
+
type: [Boolean, String],
|
|
5749
|
+
default: false
|
|
5750
|
+
},
|
|
5751
|
+
multiple: {
|
|
5752
|
+
type: Boolean,
|
|
5753
|
+
default: false
|
|
5754
|
+
}
|
|
5755
|
+
}, {
|
|
5756
|
+
"modelValue": {},
|
|
5757
|
+
"modelModifiers": {}
|
|
5758
|
+
}),
|
|
5759
|
+
emits: ["update:modelValue"],
|
|
5760
|
+
setup(__props) {
|
|
5761
|
+
const model = useModel(__props, "modelValue");
|
|
5762
|
+
const [, provideSelectionControl, context] = createSelectionContext({
|
|
5763
|
+
namespace: __props.namespace,
|
|
5764
|
+
disabled: toRef(() => __props.disabled),
|
|
5765
|
+
enroll: __props.enroll,
|
|
5766
|
+
mandatory: __props.mandatory,
|
|
5767
|
+
multiple: __props.multiple,
|
|
5768
|
+
events: true
|
|
5769
|
+
});
|
|
5770
|
+
useProxyModel(context, model, { multiple: __props.multiple });
|
|
5771
|
+
provideSelectionControl(context);
|
|
5772
|
+
return (_ctx, _cache) => {
|
|
5773
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
5774
|
+
ariaMultiselectable: __props.multiple,
|
|
5775
|
+
disabled: toValue(unref(context).disabled),
|
|
5776
|
+
multiple: __props.multiple,
|
|
5777
|
+
select: unref(context).select,
|
|
5778
|
+
toggle: unref(context).toggle,
|
|
5779
|
+
unselect: unref(context).unselect
|
|
5780
|
+
});
|
|
5781
|
+
};
|
|
5782
|
+
}
|
|
5783
|
+
});
|
|
5784
|
+
var SelectionRoot_default = _sfc_main$4;
|
|
5785
|
+
|
|
5786
|
+
//#endregion
|
|
5787
|
+
//#region src/components/Selection/index.ts
|
|
5788
|
+
const Selection = {
|
|
5789
|
+
Root: SelectionRoot_default,
|
|
5790
|
+
Item: SelectionItem_default
|
|
5791
|
+
};
|
|
5792
|
+
|
|
5793
|
+
//#endregion
|
|
5794
|
+
//#region src/components/Single/SingleItem.vue
|
|
5795
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
5796
|
+
name: "SingleItem",
|
|
5797
|
+
__name: "SingleItem",
|
|
5798
|
+
props: {
|
|
5799
|
+
label: {},
|
|
5800
|
+
id: {},
|
|
5801
|
+
disabled: {},
|
|
5802
|
+
value: {},
|
|
5803
|
+
namespace: { default: "v0:single" }
|
|
5804
|
+
},
|
|
5805
|
+
setup(__props) {
|
|
5806
|
+
const single = useSingle(__props.namespace);
|
|
5807
|
+
const ticket = single.register({
|
|
5808
|
+
id: __props.id,
|
|
5809
|
+
value: __props.value,
|
|
5810
|
+
disabled: __props.disabled
|
|
5811
|
+
});
|
|
5812
|
+
const isDisabled = toRef(() => ticket.disabled || single.disabled);
|
|
5813
|
+
onUnmounted(() => {
|
|
5814
|
+
single.unregister(ticket.id);
|
|
5815
|
+
});
|
|
5816
|
+
return (_ctx, _cache) => {
|
|
5817
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
5818
|
+
id: String(unref(ticket).id),
|
|
5819
|
+
ariaDisabled: toValue(isDisabled.value),
|
|
5820
|
+
ariaSelected: toValue(unref(ticket).isSelected),
|
|
5821
|
+
disabled: toValue(isDisabled.value),
|
|
5822
|
+
isSelected: toValue(unref(ticket).isSelected),
|
|
5823
|
+
label: __props.label,
|
|
5824
|
+
select: unref(ticket).select,
|
|
5825
|
+
toggle: unref(ticket).toggle,
|
|
5826
|
+
unselect: unref(ticket).unselect,
|
|
5827
|
+
value: __props.value
|
|
5828
|
+
});
|
|
5829
|
+
};
|
|
5830
|
+
}
|
|
5831
|
+
});
|
|
5832
|
+
var SingleItem_default = _sfc_main$3;
|
|
5833
|
+
|
|
5834
|
+
//#endregion
|
|
5835
|
+
//#region src/components/Single/SingleRoot.vue
|
|
5836
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
5837
|
+
name: "SingleRoot",
|
|
5838
|
+
__name: "SingleRoot",
|
|
5839
|
+
props: /* @__PURE__ */ mergeModels({
|
|
5840
|
+
namespace: { default: "v0:single" },
|
|
5841
|
+
disabled: {
|
|
5842
|
+
type: Boolean,
|
|
5843
|
+
default: false
|
|
5844
|
+
},
|
|
5845
|
+
enroll: {
|
|
5846
|
+
type: Boolean,
|
|
5847
|
+
default: false
|
|
5848
|
+
},
|
|
5849
|
+
mandatory: {
|
|
5850
|
+
type: [Boolean, String],
|
|
5851
|
+
default: false
|
|
5852
|
+
}
|
|
5853
|
+
}, {
|
|
5854
|
+
"modelValue": {},
|
|
5855
|
+
"modelModifiers": {}
|
|
5856
|
+
}),
|
|
5857
|
+
emits: ["update:modelValue"],
|
|
5858
|
+
setup(__props) {
|
|
5859
|
+
const model = useModel(__props, "modelValue");
|
|
5860
|
+
const [, provideSingleControl, context] = createSingleContext({
|
|
5861
|
+
namespace: __props.namespace,
|
|
5862
|
+
disabled: toRef(() => __props.disabled),
|
|
5863
|
+
enroll: __props.enroll,
|
|
5864
|
+
mandatory: __props.mandatory,
|
|
5865
|
+
events: true
|
|
5866
|
+
});
|
|
5867
|
+
useProxyModel(context, model, { multiple: false });
|
|
5868
|
+
provideSingleControl(context);
|
|
5869
|
+
return (_ctx, _cache) => {
|
|
5870
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
5871
|
+
ariaMultiselectable: true,
|
|
5872
|
+
disabled: toValue(unref(context).disabled),
|
|
5873
|
+
select: unref(context).select,
|
|
5874
|
+
toggle: unref(context).toggle,
|
|
5875
|
+
unselect: unref(context).unselect
|
|
5876
|
+
});
|
|
5877
|
+
};
|
|
5878
|
+
}
|
|
5879
|
+
});
|
|
5880
|
+
var SingleRoot_default = _sfc_main$2;
|
|
5881
|
+
|
|
5882
|
+
//#endregion
|
|
5883
|
+
//#region src/components/Single/index.ts
|
|
5884
|
+
const Single = {
|
|
5885
|
+
Root: SingleRoot_default,
|
|
5886
|
+
Item: SingleItem_default
|
|
5887
|
+
};
|
|
5888
|
+
|
|
5889
|
+
//#endregion
|
|
5890
|
+
//#region src/components/Step/StepItem.vue
|
|
5891
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
5892
|
+
name: "StepItem",
|
|
5893
|
+
__name: "StepItem",
|
|
5894
|
+
props: {
|
|
5895
|
+
label: {},
|
|
5896
|
+
id: {},
|
|
5897
|
+
disabled: {},
|
|
5898
|
+
value: {},
|
|
5899
|
+
namespace: { default: "v0:step" }
|
|
5900
|
+
},
|
|
5901
|
+
setup(__props) {
|
|
5902
|
+
const step = useStep(__props.namespace);
|
|
5903
|
+
const ticket = step.register({
|
|
5904
|
+
id: __props.id,
|
|
5905
|
+
value: __props.value,
|
|
5906
|
+
disabled: __props.disabled
|
|
5907
|
+
});
|
|
5908
|
+
const isDisabled = toRef(() => ticket.disabled || step.disabled);
|
|
5909
|
+
onUnmounted(() => {
|
|
5910
|
+
step.unregister(ticket.id);
|
|
5911
|
+
});
|
|
5912
|
+
return (_ctx, _cache) => {
|
|
5913
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
5914
|
+
id: String(unref(ticket).id),
|
|
5915
|
+
ariaDisabled: toValue(isDisabled.value),
|
|
5916
|
+
ariaSelected: toValue(unref(ticket).isSelected),
|
|
5917
|
+
disabled: toValue(isDisabled.value),
|
|
5918
|
+
isSelected: toValue(unref(ticket).isSelected),
|
|
5919
|
+
label: __props.label,
|
|
5920
|
+
select: unref(ticket).select,
|
|
5921
|
+
toggle: unref(ticket).toggle,
|
|
5922
|
+
unselect: unref(ticket).unselect,
|
|
5923
|
+
value: __props.value
|
|
5924
|
+
});
|
|
5925
|
+
};
|
|
5926
|
+
}
|
|
5927
|
+
});
|
|
5928
|
+
var StepItem_default = _sfc_main$1;
|
|
5929
|
+
|
|
5930
|
+
//#endregion
|
|
5931
|
+
//#region src/components/Step/StepRoot.vue
|
|
5932
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5933
|
+
name: "StepRoot",
|
|
5934
|
+
__name: "StepRoot",
|
|
5935
|
+
props: /* @__PURE__ */ mergeModels({
|
|
5936
|
+
namespace: { default: "v0:step" },
|
|
5937
|
+
disabled: {
|
|
5938
|
+
type: Boolean,
|
|
5939
|
+
default: false
|
|
5940
|
+
},
|
|
5941
|
+
enroll: {
|
|
5942
|
+
type: Boolean,
|
|
5943
|
+
default: false
|
|
5944
|
+
},
|
|
5945
|
+
mandatory: {
|
|
5946
|
+
type: [Boolean, String],
|
|
5947
|
+
default: false
|
|
5948
|
+
}
|
|
5949
|
+
}, {
|
|
5950
|
+
"modelValue": {},
|
|
5951
|
+
"modelModifiers": {}
|
|
5952
|
+
}),
|
|
5953
|
+
emits: ["update:modelValue"],
|
|
5954
|
+
setup(__props) {
|
|
5955
|
+
const model = useModel(__props, "modelValue");
|
|
5956
|
+
const [, provideStepControl, context] = createStepContext({
|
|
5957
|
+
namespace: __props.namespace,
|
|
5958
|
+
disabled: toRef(() => __props.disabled),
|
|
5959
|
+
enroll: __props.enroll,
|
|
5960
|
+
mandatory: __props.mandatory,
|
|
5961
|
+
events: true
|
|
5962
|
+
});
|
|
5963
|
+
useProxyModel(context, model, { multiple: false });
|
|
5964
|
+
provideStepControl(context);
|
|
5965
|
+
return (_ctx, _cache) => {
|
|
5966
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
5967
|
+
ariaMultiselectable: true,
|
|
5968
|
+
disabled: toValue(unref(context).disabled),
|
|
5969
|
+
first: unref(context).first,
|
|
5970
|
+
last: unref(context).last,
|
|
5971
|
+
next: unref(context).next,
|
|
5972
|
+
prev: unref(context).prev,
|
|
5973
|
+
select: unref(context).select,
|
|
5974
|
+
step: unref(context).step,
|
|
5975
|
+
toggle: unref(context).toggle,
|
|
5976
|
+
unselect: unref(context).unselect
|
|
5977
|
+
});
|
|
5978
|
+
};
|
|
5979
|
+
}
|
|
5980
|
+
});
|
|
5981
|
+
var StepRoot_default = _sfc_main;
|
|
5982
|
+
|
|
5983
|
+
//#endregion
|
|
5984
|
+
//#region src/components/Step/index.ts
|
|
5985
|
+
const Step = {
|
|
5986
|
+
Root: StepRoot_default,
|
|
5987
|
+
Item: StepItem_default
|
|
5988
|
+
};
|
|
5989
|
+
|
|
5990
|
+
//#endregion
|
|
5991
|
+
export { Atom_default as Atom, Avatar, COMMON_ELEMENTS, ConsolaLoggerAdapter, ExpansionPanel, Group, IN_BROWSER, MemoryAdapter, PermissionAdapter, PinoLoggerAdapter, Popover, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, Selection, Single, Step, Vuetify0LocaleAdapter, Vuetify0LoggerAdapter, Vuetify0ThemeAdapter, __LOGGER_ENABLED__, createBreakpoints, createBreakpointsContext, createBreakpointsPlugin, createContext, createFeatures, createFeaturesContext, createFeaturesPlugin, createForm, createFormContext, createGroup, createGroupContext, createHydration, createHydrationContext, createHydrationPlugin, createLocale, createLocaleContext, createLocalePlugin, createLogger, createLoggerContext, createLoggerPlugin, createPermissions, createPermissionsContext, createPermissionsPlugin, createPlugin, createQueue, createQueueContext, createRegistryContext, createSelection, createSelectionContext, createSingle, createSingleContext, createStep, createStepContext, createStorage, createStorageContext, createStoragePlugin, createTheme, createThemeContext, createThemePlugin, createTimeline, createTimelineContext, createTokens, createTokensContext, createTrinity, genId, isArray, isBoolean, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isSelfClosingTag, isString, isUndefined, mergeDeep, provideContext, providePopoverContext, provideStorageContext, toArray, toReactive, useBreakpoints, useContext, useDocumentEventListener, useElementIntersection, useElementSize, useEventListener, useFeatures, useFilter, useForm, useGroup, useHydration, useIntersectionObserver, useKeydown, useLocale, useLogger, useMutationObserver, usePermissions, usePopoverContext, useProxyModel, useProxyRegistry, useQueue, useRegistry, useResizeObserver, useSelection, useSingle, useStep, useStorage, useStorageContext, useTheme, useTimeline, useTokens, useWindowEventListener, version };
|