@vuetify/v0 1.0.0-beta.2 → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{adapter-D2ABPTpo.d.mts → adapter-BI-oyZCe.d.mts} +3 -2
- package/dist/{adapter-CQoi3rdC.d.mts → adapter-Butx_2UU.d.mts} +1 -1
- package/dist/{adapter-Cj7vxEdB.mjs → adapter-CJY6aQIS.mjs} +5 -1
- package/dist/browser/index.d.ts +25318 -0
- package/dist/browser/index.js +285 -170
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/{components-DcOwIGXt.mjs → components-CQ570531.mjs} +119 -72
- package/dist/composables/index.d.mts +7 -7
- package/dist/composables/index.mjs +22 -22
- package/dist/{composables-DxKmYiTj.mjs → composables-Dp_S74ft.mjs} +11 -11
- package/dist/constants/index.mjs +1 -1
- package/dist/{createDataTable-CBfnCUKU.mjs → createDataTable-xLtNGdr7.mjs} +3 -3
- package/dist/{createGroup-BTG6xcyp.mjs → createGroup-CBsJPLpN.mjs} +1 -1
- package/dist/{createRegistry-Cb6ftNMU.mjs → createRegistry-CRsG7t_g.mjs} +2 -2
- package/dist/{createSelection-BMvXj84C.mjs → createSelection-DuaoHPSc.mjs} +8 -3
- package/dist/{createSingle-BCUJuV4D.mjs → createSingle-CiKU87Hj.mjs} +1 -1
- package/dist/{createTokens-BSSQAfNX.mjs → createTokens-4BZfgv9F.mjs} +6 -6
- package/dist/data-table/index.d.mts +1 -1
- package/dist/data-table/index.mjs +1 -1
- package/dist/date/index.mjs +1 -1
- package/dist/features/adapters/flagsmith/index.d.mts +1 -1
- package/dist/features/adapters/launchdarkly/index.d.mts +1 -1
- package/dist/features/adapters/posthog/index.d.mts +1 -1
- package/dist/features/adapters/posthog/index.mjs +1 -1
- package/dist/features/index.d.mts +2 -2
- package/dist/features/index.mjs +1 -1
- package/dist/{flagsmith-CXzNBqm3.d.mts → flagsmith-DA2GCyGv.d.mts} +1 -1
- package/dist/{globals-C1X-9O7K.mjs → globals-B0pQgO4u.mjs} +1 -1
- package/dist/{index-LMiCHwZl.d.mts → index-BBJnOUyA.d.mts} +2 -1
- package/dist/{index-DLBPM47A.d.mts → index-BkTaCktP.d.mts} +106 -104
- package/dist/{index-CKyDkh8J.d.mts → index-CV7bOS7B.d.mts} +82 -12
- package/dist/{index-Bmz8PZMY.d.mts → index-CfHm03dg.d.mts} +1 -1
- package/dist/{index-B9YmdGZ3.d.mts → index-CyNk9FpR.d.mts} +3 -0
- package/dist/{index-DRrHHgE7.d.mts → index-DgPFPx_7.d.mts} +2 -2
- package/dist/{index-rJ_lhMYJ.d.mts → index-pM8UX1XI.d.mts} +2 -2
- package/dist/index.d.mts +10 -10
- package/dist/index.mjs +24 -24
- package/dist/json/attributes.json +8 -4
- package/dist/json/tags.json +2 -1
- package/dist/json/web-types.json +16 -6
- package/dist/{launchdarkly-DvhloBts.d.mts → launchdarkly-Bp8p9PMD.d.mts} +1 -1
- package/dist/locale/adapters/index.d.mts +2 -2
- package/dist/locale/adapters/index.mjs +1 -1
- package/dist/locale/adapters/v0/index.d.mts +1 -1
- package/dist/locale/adapters/v0/index.mjs +1 -1
- package/dist/locale/adapters/vue-i18n/index.d.mts +2 -1
- package/dist/locale/adapters/vue-i18n/index.mjs +3 -0
- package/dist/locale/index.d.mts +3 -3
- package/dist/locale/index.mjs +2 -2
- package/dist/locale/messages/en/index.d.mts +70 -0
- package/dist/locale/messages/en/index.mjs +56 -0
- package/dist/logger/adapters/index.mjs +1 -1
- package/dist/logger/adapters/v0/index.mjs +1 -1
- package/dist/logger/index.d.mts +1 -1
- package/dist/logger/index.mjs +2 -2
- package/dist/notifications/index.d.mts +1 -1
- package/dist/notifications/index.mjs +2 -2
- package/dist/palettes/ant/index.d.mts +1 -1
- package/dist/palettes/index.d.mts +3 -3
- package/dist/palettes/material/index.d.mts +1 -1
- package/dist/palettes/md1/index.d.mts +1 -1
- package/dist/palettes/md2/index.d.mts +1 -1
- package/dist/palettes/radix/index.d.mts +1 -1
- package/dist/palettes/tailwind/index.d.mts +1 -1
- package/dist/permissions/adapters/index.d.mts +1 -1
- package/dist/permissions/adapters/v0/index.d.mts +1 -1
- package/dist/permissions/index.d.mts +1 -1
- package/dist/permissions/index.mjs +1 -1
- package/dist/{posthog-BOT5W7Ds.d.mts → posthog-sFqk0bGy.d.mts} +1 -1
- package/dist/rules/index.d.mts +1 -1
- package/dist/rules/index.mjs +1 -1
- package/dist/storage/index.d.mts +1 -1
- package/dist/storage/index.mjs +1 -1
- package/dist/theme/adapters/index.d.mts +1 -1
- package/dist/theme/adapters/index.mjs +3 -3
- package/dist/theme/adapters/unhead/index.d.mts +1 -1
- package/dist/theme/adapters/unhead/index.mjs +1 -1
- package/dist/theme/adapters/v0/index.d.mts +1 -1
- package/dist/theme/adapters/v0/index.mjs +1 -1
- package/dist/theme/index.d.mts +1 -1
- package/dist/theme/index.mjs +4 -4
- package/dist/types/index.d.mts +1 -1
- package/dist/{unhead-i8ji788n.mjs → unhead-Bn7eatWe.mjs} +10 -5
- package/dist/{useEventListener-BK_uaXZv.mjs → useEventListener-D1ETqQMm.mjs} +1 -1
- package/dist/{useFeatures-BKAK56af.mjs → useFeatures-D3DFBsYY.mjs} +3 -3
- package/dist/{useLocale-CTwn8uZk.mjs → useLocale-B44zLhFE.mjs} +9 -4
- package/dist/{useLogger-D7_hm4e8.mjs → useLogger-D7Fqcp_l.mjs} +11 -8
- package/dist/{useNotifications-B2YeotHN.mjs → useNotifications-DMHmr9C1.mjs} +4 -4
- package/dist/{usePermissions-CWYXR7ji.mjs → usePermissions-S0As54sf.mjs} +2 -2
- package/dist/{useRovingFocus-BdnSUVrD.mjs → useRovingFocus-u7uhPx2H.mjs} +111 -85
- package/dist/{useRules-CB2_tvd0.mjs → useRules-ByuxbMsA.mjs} +2 -2
- package/dist/{useStorage-BORz1d1g.mjs → useStorage-Fy5tWYkG.mjs} +3 -3
- package/dist/{useTheme-ClUmdmvT.mjs → useTheme-DrR7HoLL.mjs} +4 -4
- package/dist/utilities/index.d.mts +1 -1
- package/dist/utilities/index.mjs +4 -3
- package/dist/{v0-DL9JtgCO.mjs → v0-BDdBMbzN.mjs} +1 -1
- package/dist/{v0-BU39ZO4s.mjs → v0-BXjZknUK.mjs} +18 -5
- package/dist/{v0-D7NA38Vu.d.mts → v0-Cf5DZ4lw.d.mts} +3 -1
- package/dist/{v0-SwedwC_b.mjs → v0-DwKPTLJv.mjs} +16 -10
- package/package.json +4 -4
package/dist/browser/index.js
CHANGED
|
@@ -135,7 +135,7 @@ const SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof wind
|
|
|
135
135
|
const SUPPORTS_OBSERVER = IN_BROWSER && "ResizeObserver" in window;
|
|
136
136
|
const SUPPORTS_INTERSECTION_OBSERVER = IN_BROWSER && "IntersectionObserver" in window;
|
|
137
137
|
const SUPPORTS_MUTATION_OBSERVER = IN_BROWSER && "MutationObserver" in window;
|
|
138
|
-
const version = "1.0.0-beta.
|
|
138
|
+
const version = "1.0.0-beta.4";
|
|
139
139
|
/* v8 ignore next -- build-time constant, __DEV__ short-circuits in tests */
|
|
140
140
|
const __LOGGER_ENABLED__ = false;
|
|
141
141
|
//#endregion
|
|
@@ -478,12 +478,12 @@ function isPlainObject(value) {
|
|
|
478
478
|
/* @__NO_SIDE_EFFECTS__ */
|
|
479
479
|
function mergeDeep(target, ...sources) {
|
|
480
480
|
const out = {};
|
|
481
|
-
for (const key in target) if (Object.
|
|
481
|
+
for (const key in target) if (Object.hasOwn(target, key)) out[key] = target[key];
|
|
482
482
|
for (const source of sources) {
|
|
483
483
|
if (!/* @__PURE__ */ isObject(source)) continue;
|
|
484
484
|
for (const key in source) {
|
|
485
485
|
if (UNSAFE_KEYS.has(key)) continue;
|
|
486
|
-
if (!Object.
|
|
486
|
+
if (!Object.hasOwn(source, key)) continue;
|
|
487
487
|
const sourceValue = source[key];
|
|
488
488
|
if (/* @__PURE__ */ isUndefined(sourceValue)) continue;
|
|
489
489
|
const targetValue = out[key];
|
|
@@ -649,6 +649,7 @@ var V0Error = class extends Error {
|
|
|
649
649
|
seed;
|
|
650
650
|
variant;
|
|
651
651
|
adapter;
|
|
652
|
+
prefix;
|
|
652
653
|
constructor(message, details) {
|
|
653
654
|
const { cause, ...rest } = details;
|
|
654
655
|
super(message, /* @__PURE__ */ isUndefined(cause) ? void 0 : { cause });
|
|
@@ -1188,13 +1189,15 @@ function createPluginContext(defaultNamespace, factory, config) {
|
|
|
1188
1189
|
}
|
|
1189
1190
|
function createXPlugin(_options = {}) {
|
|
1190
1191
|
const { namespace = defaultNamespace, persist: shouldPersist, ...options } = _options;
|
|
1191
|
-
|
|
1192
|
-
...options,
|
|
1193
|
-
namespace
|
|
1194
|
-
});
|
|
1192
|
+
let context;
|
|
1195
1193
|
return createPlugin({
|
|
1196
1194
|
namespace,
|
|
1197
1195
|
provide: (app) => {
|
|
1196
|
+
const [, provide, ctx] = createXContext({
|
|
1197
|
+
...options,
|
|
1198
|
+
namespace
|
|
1199
|
+
});
|
|
1200
|
+
context = ctx;
|
|
1198
1201
|
provide(context, app);
|
|
1199
1202
|
if (shouldPersist && config?.restore) {
|
|
1200
1203
|
const storage = getPersistedStorage();
|
|
@@ -1204,12 +1207,13 @@ function createPluginContext(defaultNamespace, factory, config) {
|
|
|
1204
1207
|
}
|
|
1205
1208
|
},
|
|
1206
1209
|
setup: config?.setup || shouldPersist ? (app) => {
|
|
1207
|
-
|
|
1210
|
+
const ctx = context;
|
|
1211
|
+
config?.setup?.(ctx, app, options);
|
|
1208
1212
|
if (shouldPersist && config?.persist) {
|
|
1209
1213
|
const storage = getPersistedStorage();
|
|
1210
1214
|
const key = deriveKey(namespace);
|
|
1211
1215
|
const stored = storage.get(key);
|
|
1212
|
-
const stop = watch(() => config.persist(
|
|
1216
|
+
const stop = watch(() => config.persist(ctx), (val) => {
|
|
1213
1217
|
stored.value = val;
|
|
1214
1218
|
});
|
|
1215
1219
|
app.onUnmount(stop);
|
|
@@ -1699,7 +1703,7 @@ function createRegistry(options) {
|
|
|
1699
1703
|
...patch,
|
|
1700
1704
|
id
|
|
1701
1705
|
});
|
|
1702
|
-
const hasValue = Object.
|
|
1706
|
+
const hasValue = Object.hasOwn(patch, "value");
|
|
1703
1707
|
let value = existing.value;
|
|
1704
1708
|
let valueIsIndex = existing.valueIsIndex;
|
|
1705
1709
|
if (hasValue) {
|
|
@@ -2184,7 +2188,7 @@ function createModel(_options = {}) {
|
|
|
2184
2188
|
if (!toValue(multiple)) selectedIds.clear();
|
|
2185
2189
|
if (/* @__PURE__ */ isUndefined(value)) return;
|
|
2186
2190
|
const id = registry.browse(toRaw(value))?.values().next().value;
|
|
2187
|
-
if (!/* @__PURE__ */ isUndefined(id))
|
|
2191
|
+
if (!/* @__PURE__ */ isUndefined(id)) select(id);
|
|
2188
2192
|
}
|
|
2189
2193
|
function register(registration = {}) {
|
|
2190
2194
|
const id = registration.id ?? /* @__PURE__ */ useId();
|
|
@@ -2377,7 +2381,12 @@ function createSelection(_options = {}) {
|
|
|
2377
2381
|
}
|
|
2378
2382
|
if (isMultiple) {
|
|
2379
2383
|
for (const id of currentIds) if (!targetIds.has(id)) unselect(id);
|
|
2380
|
-
for (const id of targetIds)
|
|
2384
|
+
for (const id of targetIds) {
|
|
2385
|
+
if (currentIds.has(id)) continue;
|
|
2386
|
+
const ticket = model.get(id);
|
|
2387
|
+
if (ticket && toValue(ticket.disabled)) continue;
|
|
2388
|
+
model.selectedIds.add(id);
|
|
2389
|
+
}
|
|
2381
2390
|
} else {
|
|
2382
2391
|
const next = targetIds.values().next().value;
|
|
2383
2392
|
const last = currentIds.values().next().value;
|
|
@@ -2767,7 +2776,7 @@ function createTokens(tokens = {}, options = {}) {
|
|
|
2767
2776
|
if (segments.length > 0) {
|
|
2768
2777
|
if (isTokenAlias(current)) current = current.$value;
|
|
2769
2778
|
for (const segment of segments) {
|
|
2770
|
-
if (!/* @__PURE__ */ isObject(current) ||
|
|
2779
|
+
if (!/* @__PURE__ */ isObject(current) || UNSAFE_KEYS.has(segment) || !Object.prototype.hasOwnProperty.call(current, segment)) {
|
|
2771
2780
|
current = void 0;
|
|
2772
2781
|
break;
|
|
2773
2782
|
}
|
|
@@ -2902,7 +2911,7 @@ function flatten(tokens, prefix = "", flat = false) {
|
|
|
2902
2911
|
const { tokens: currentTokens, prefix: currentPrefix, flat } = stack.pop();
|
|
2903
2912
|
const meta = {};
|
|
2904
2913
|
for (const k in currentTokens) {
|
|
2905
|
-
if (!Object.
|
|
2914
|
+
if (!Object.hasOwn(currentTokens, k)) continue;
|
|
2906
2915
|
if (k.startsWith("$")) meta[k] = currentTokens[k];
|
|
2907
2916
|
}
|
|
2908
2917
|
if (Object.keys(meta).length > 0 && currentPrefix) flattened.push({
|
|
@@ -2910,7 +2919,7 @@ function flatten(tokens, prefix = "", flat = false) {
|
|
|
2910
2919
|
value: meta
|
|
2911
2920
|
});
|
|
2912
2921
|
for (const key in currentTokens) {
|
|
2913
|
-
if (!Object.
|
|
2922
|
+
if (!Object.hasOwn(currentTokens, key)) continue;
|
|
2914
2923
|
if (UNSAFE_KEYS.has(key)) continue;
|
|
2915
2924
|
if (key.startsWith("$")) continue;
|
|
2916
2925
|
const value = currentTokens[key];
|
|
@@ -2929,7 +2938,7 @@ function flatten(tokens, prefix = "", flat = false) {
|
|
|
2929
2938
|
});
|
|
2930
2939
|
const inner = value.$value;
|
|
2931
2940
|
if (/* @__PURE__ */ isObject(inner) && !flat) for (const innerKey in inner) {
|
|
2932
|
-
if (!Object.
|
|
2941
|
+
if (!Object.hasOwn(inner, innerKey)) continue;
|
|
2933
2942
|
if (UNSAFE_KEYS.has(innerKey)) continue;
|
|
2934
2943
|
if (innerKey.startsWith("$")) continue;
|
|
2935
2944
|
const child = inner[innerKey];
|
|
@@ -2984,21 +2993,27 @@ var V0LocaleAdapter = class extends LocaleAdapter {
|
|
|
2984
2993
|
this.context = context;
|
|
2985
2994
|
}
|
|
2986
2995
|
t(key, ...params) {
|
|
2987
|
-
const
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
const fbMessage = this.context.tokens.get(`${this.context.fallbackLocale}.${key}`)?.value;
|
|
2993
|
-
if (/* @__PURE__ */ isString(fbMessage)) return this.interpolate(this.resolve(this.context.fallbackLocale, fbMessage), params);
|
|
2994
|
-
}
|
|
2995
|
-
return this.interpolate(key, params);
|
|
2996
|
+
const found = this.lookup(key, params);
|
|
2997
|
+
return /* @__PURE__ */ isUndefined(found) ? this.interpolate(key, params) : found;
|
|
2998
|
+
}
|
|
2999
|
+
ti(key, ...params) {
|
|
3000
|
+
return this.lookup(key, params);
|
|
2996
3001
|
}
|
|
2997
3002
|
n(value) {
|
|
2998
3003
|
const locale = this.context.selectedId.value;
|
|
2999
3004
|
if (!IN_BROWSER || !locale) return value.toString();
|
|
3000
3005
|
return new Intl.NumberFormat(String(locale)).format(value);
|
|
3001
3006
|
}
|
|
3007
|
+
lookup(key, params) {
|
|
3008
|
+
const locale = this.context.selectedId.value;
|
|
3009
|
+
if (!locale) return void 0;
|
|
3010
|
+
const message = this.context.tokens.get(`${locale}.${key}`)?.value;
|
|
3011
|
+
if (/* @__PURE__ */ isString(message)) return this.interpolate(this.resolve(locale, message), params);
|
|
3012
|
+
if (this.context.fallbackLocale) {
|
|
3013
|
+
const fb = this.context.tokens.get(`${this.context.fallbackLocale}.${key}`)?.value;
|
|
3014
|
+
if (/* @__PURE__ */ isString(fb)) return this.interpolate(this.resolve(this.context.fallbackLocale, fb), params);
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3002
3017
|
resolve(locale, str, visited = /* @__PURE__ */ new Set()) {
|
|
3003
3018
|
return str.replace(/{([a-zA-Z0-9.\-_]+)}/g, (match, key) => {
|
|
3004
3019
|
const [prefix, ...rest] = key.split(".");
|
|
@@ -3084,6 +3099,9 @@ function createLocale(_options = {}) {
|
|
|
3084
3099
|
function t(key, ...params) {
|
|
3085
3100
|
return adapter.t(key, ...params);
|
|
3086
3101
|
}
|
|
3102
|
+
function ti(key, ...params) {
|
|
3103
|
+
return adapter.ti(key, ...params);
|
|
3104
|
+
}
|
|
3087
3105
|
function n(value) {
|
|
3088
3106
|
return adapter.n(value);
|
|
3089
3107
|
}
|
|
@@ -3095,6 +3113,7 @@ function createLocale(_options = {}) {
|
|
|
3095
3113
|
return {
|
|
3096
3114
|
...registry,
|
|
3097
3115
|
t,
|
|
3116
|
+
ti,
|
|
3098
3117
|
n,
|
|
3099
3118
|
register,
|
|
3100
3119
|
get size() {
|
|
@@ -3106,6 +3125,7 @@ function createLocaleFallback() {
|
|
|
3106
3125
|
return {
|
|
3107
3126
|
size: 0,
|
|
3108
3127
|
t: (key) => key,
|
|
3128
|
+
ti: () => void 0,
|
|
3109
3129
|
n: String
|
|
3110
3130
|
};
|
|
3111
3131
|
}
|
|
@@ -3134,7 +3154,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3134
3154
|
isOpen: context.isOpen.value,
|
|
3135
3155
|
attrs: {
|
|
3136
3156
|
"type": __props.as === "button" ? "button" : void 0,
|
|
3137
|
-
"aria-label": locale.
|
|
3157
|
+
"aria-label": locale.ti("AlertDialog.close") ?? "Close",
|
|
3138
3158
|
"onClick": onClick
|
|
3139
3159
|
}
|
|
3140
3160
|
}));
|
|
@@ -3475,6 +3495,19 @@ function useClickOutside(target, handler, options = {}) {
|
|
|
3475
3495
|
});
|
|
3476
3496
|
}
|
|
3477
3497
|
/**
|
|
3498
|
+
* Check if the event target is a strict descendant of any target element.
|
|
3499
|
+
*
|
|
3500
|
+
* @remarks Used by bounds mode so content rendered *inside* the element but
|
|
3501
|
+
* positioned outside its box (e.g. a top-layer overlay teleported into a
|
|
3502
|
+
* native `<dialog>`) is not treated as an outside click. A backdrop click has
|
|
3503
|
+
* `target === el`, so it is not a strict descendant and still counts as outside.
|
|
3504
|
+
*/
|
|
3505
|
+
function isDescendant(eventTarget) {
|
|
3506
|
+
/* v8 ignore next -- defensive guard, callers always pass an Element */
|
|
3507
|
+
if (!(eventTarget instanceof Node)) return false;
|
|
3508
|
+
return getTargets().some((el) => el !== eventTarget && el.contains(eventTarget));
|
|
3509
|
+
}
|
|
3510
|
+
/**
|
|
3478
3511
|
* Validate that the target is still in the DOM.
|
|
3479
3512
|
*/
|
|
3480
3513
|
function isValidTarget(eventTarget) {
|
|
@@ -3514,7 +3547,7 @@ function useClickOutside(target, handler, options = {}) {
|
|
|
3514
3547
|
const dy = Math.abs(event.clientY - startPosition.y);
|
|
3515
3548
|
if (dx >= touchScrollThreshold || dy >= touchScrollThreshold) return;
|
|
3516
3549
|
}
|
|
3517
|
-
if ((bounds ? startedOutsideBounds && isOutsideBounds(event.clientX, event.clientY) : isOutside(pointerdownTarget) && isOutside(pointerupTarget)) && !shouldIgnore(path)) handler(event);
|
|
3550
|
+
if ((bounds ? startedOutsideBounds && isOutsideBounds(event.clientX, event.clientY) && !isDescendant(pointerdownTarget) && !isDescendant(pointerupTarget) : isOutside(pointerdownTarget) && isOutside(pointerupTarget)) && !shouldIgnore(path)) handler(event);
|
|
3518
3551
|
}
|
|
3519
3552
|
/**
|
|
3520
3553
|
* Handle window blur - detect focus moving to iframe.
|
|
@@ -3571,6 +3604,63 @@ function useClickOutside(target, handler, options = {}) {
|
|
|
3571
3604
|
};
|
|
3572
3605
|
}
|
|
3573
3606
|
//#endregion
|
|
3607
|
+
//#region src/composables/toElement/index.ts
|
|
3608
|
+
/**
|
|
3609
|
+
* @module toElement
|
|
3610
|
+
*
|
|
3611
|
+
* @see https://0.vuetifyjs.com/composables/transformers/to-element
|
|
3612
|
+
*
|
|
3613
|
+
* @remarks
|
|
3614
|
+
* Resolves various element reference types to a DOM Element.
|
|
3615
|
+
*
|
|
3616
|
+
* Accepts refs, getters, raw DOM elements, or Vue component instances
|
|
3617
|
+
* and normalizes them to a plain Element. Uses structural typing to
|
|
3618
|
+
* avoid cross-version Vue Ref incompatibilities.
|
|
3619
|
+
*
|
|
3620
|
+
* @example
|
|
3621
|
+
* ```ts
|
|
3622
|
+
* import { shallowRef } from 'vue'
|
|
3623
|
+
* import { toElement } from '@vuetify/v0'
|
|
3624
|
+
*
|
|
3625
|
+
* const el = shallowRef<HTMLElement | null>(null)
|
|
3626
|
+
* const resolved = toElement(el) // HTMLElement | undefined
|
|
3627
|
+
* ```
|
|
3628
|
+
*/
|
|
3629
|
+
/**
|
|
3630
|
+
* Resolves a {@link MaybeElementRef} to a DOM Element or undefined.
|
|
3631
|
+
*
|
|
3632
|
+
* Handles:
|
|
3633
|
+
* - `Ref<Element>`, `ShallowRef<HTMLElement>`, getter functions
|
|
3634
|
+
* - Vue component instances (extracts `$el`)
|
|
3635
|
+
* - Raw DOM elements (pass-through)
|
|
3636
|
+
* - null/undefined (returns undefined)
|
|
3637
|
+
*
|
|
3638
|
+
* @param target The element ref, getter, or raw value to resolve
|
|
3639
|
+
* @returns The resolved DOM Element, or undefined if not available
|
|
3640
|
+
*
|
|
3641
|
+
* @see https://0.vuetifyjs.com/composables/transformers/to-element
|
|
3642
|
+
*
|
|
3643
|
+
* @example
|
|
3644
|
+
* ```ts
|
|
3645
|
+
* import { toElement } from '@vuetify/v0'
|
|
3646
|
+
*
|
|
3647
|
+
* const el = shallowRef<HTMLElement | null>(null)
|
|
3648
|
+
* toElement(el) // HTMLElement | undefined
|
|
3649
|
+
*
|
|
3650
|
+
* const component = ref<ComponentPublicInstance>()
|
|
3651
|
+
* toElement(component) // Element | undefined (from $el)
|
|
3652
|
+
* ```
|
|
3653
|
+
*/
|
|
3654
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3655
|
+
function toElement(target) {
|
|
3656
|
+
if (!target) return void 0;
|
|
3657
|
+
if (/* @__PURE__ */ isElement(target)) return target;
|
|
3658
|
+
const raw = /* @__PURE__ */ isFunction(target) ? target() : /* @__PURE__ */ isObject(target) && "value" in target ? target.value : target;
|
|
3659
|
+
if (!raw) return void 0;
|
|
3660
|
+
if (/* @__PURE__ */ isElement(raw)) return raw;
|
|
3661
|
+
if (/* @__PURE__ */ isObject(raw) && "$el" in raw) return raw.$el;
|
|
3662
|
+
}
|
|
3663
|
+
//#endregion
|
|
3574
3664
|
//#region src/composables/useStack/index.ts
|
|
3575
3665
|
/**
|
|
3576
3666
|
* @module useStack
|
|
@@ -3627,23 +3717,31 @@ function createStack(_options = {}) {
|
|
|
3627
3717
|
...options,
|
|
3628
3718
|
multiple: true
|
|
3629
3719
|
});
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
});
|
|
3720
|
+
function selectedScrims() {
|
|
3721
|
+
return Array.from(selection.selectedIds).map((id) => selection.get(id)).filter((ticket) => !!ticket && ticket.scrim.value !== false);
|
|
3722
|
+
}
|
|
3723
|
+
const isActive = toRef(() => selectedScrims().length > 0);
|
|
3724
|
+
const top = toRef(() => selectedScrims().at(-1));
|
|
3636
3725
|
const scrimZIndex = toRef(() => {
|
|
3637
3726
|
const ticket = top.value;
|
|
3638
3727
|
return ticket ? ticket.zIndex.value - 1 : 0;
|
|
3639
3728
|
});
|
|
3640
|
-
const isBlocking = toRef(() => top.value?.blocking ?? false);
|
|
3729
|
+
const isBlocking = toRef(() => toValue(top.value?.blocking) ?? false);
|
|
3730
|
+
const topElement = toRef(() => {
|
|
3731
|
+
const scrims = selectedScrims();
|
|
3732
|
+
for (let i = scrims.length - 1; i >= 0; i--) {
|
|
3733
|
+
const el = /* @__PURE__ */ toElement(toValue(scrims[i].el));
|
|
3734
|
+
if (el) return el;
|
|
3735
|
+
}
|
|
3736
|
+
return null;
|
|
3737
|
+
});
|
|
3641
3738
|
function ids() {
|
|
3642
3739
|
return Array.from(selection.selectedIds);
|
|
3643
3740
|
}
|
|
3644
3741
|
function register(input = {}) {
|
|
3645
3742
|
const id = input.id ?? /* @__PURE__ */ useId();
|
|
3646
|
-
const blocking = input.blocking ?? false;
|
|
3743
|
+
const blocking = toRef(() => toValue(input.blocking) ?? false);
|
|
3744
|
+
const scrim = toRef(() => toValue(input.scrim) ?? true);
|
|
3647
3745
|
const onDismiss = input.onDismiss;
|
|
3648
3746
|
const zIndex = toRef(() => {
|
|
3649
3747
|
const position = ids().indexOf(id);
|
|
@@ -3656,17 +3754,18 @@ function createStack(_options = {}) {
|
|
|
3656
3754
|
return list.at(-1) === id;
|
|
3657
3755
|
});
|
|
3658
3756
|
function dismiss() {
|
|
3659
|
-
if (blocking) return;
|
|
3757
|
+
if (blocking.value) return;
|
|
3660
3758
|
onDismiss?.();
|
|
3661
3759
|
selection.unselect(id);
|
|
3662
3760
|
}
|
|
3663
3761
|
const ticket = selection.register({
|
|
3762
|
+
...input,
|
|
3664
3763
|
blocking,
|
|
3764
|
+
scrim,
|
|
3665
3765
|
onDismiss,
|
|
3666
3766
|
zIndex,
|
|
3667
3767
|
globalTop,
|
|
3668
3768
|
dismiss,
|
|
3669
|
-
...input,
|
|
3670
3769
|
id
|
|
3671
3770
|
});
|
|
3672
3771
|
if (/* @__PURE__ */ instanceExists()) onScopeDispose(() => {
|
|
@@ -3681,6 +3780,7 @@ function createStack(_options = {}) {
|
|
|
3681
3780
|
top,
|
|
3682
3781
|
scrimZIndex,
|
|
3683
3782
|
isBlocking,
|
|
3783
|
+
topElement,
|
|
3684
3784
|
get size() {
|
|
3685
3785
|
return selection.size;
|
|
3686
3786
|
}
|
|
@@ -3747,6 +3847,7 @@ function createStackPlugin(_options = {}) {
|
|
|
3747
3847
|
}
|
|
3748
3848
|
let fallbackStack;
|
|
3749
3849
|
function getStackFallback() {
|
|
3850
|
+
if (!IN_BROWSER) return createStack();
|
|
3750
3851
|
if (!fallbackStack) fallbackStack = createStack();
|
|
3751
3852
|
return fallbackStack;
|
|
3752
3853
|
}
|
|
@@ -3938,7 +4039,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3938
4039
|
const contentRef = useTemplateRef("content");
|
|
3939
4040
|
const ticket = useStack().register({
|
|
3940
4041
|
onDismiss: () => context.close(),
|
|
3941
|
-
blocking: __props.blocking
|
|
4042
|
+
blocking: () => __props.blocking,
|
|
4043
|
+
el: () => contentRef.value?.element
|
|
3942
4044
|
});
|
|
3943
4045
|
watch(context.isOpen, (isOpen) => {
|
|
3944
4046
|
if (isOpen) ticket.select();
|
|
@@ -4364,63 +4466,6 @@ const [createHydrationContext, createHydrationPlugin, useHydration] = createPlug
|
|
|
4364
4466
|
}
|
|
4365
4467
|
});
|
|
4366
4468
|
//#endregion
|
|
4367
|
-
//#region src/composables/toElement/index.ts
|
|
4368
|
-
/**
|
|
4369
|
-
* @module toElement
|
|
4370
|
-
*
|
|
4371
|
-
* @see https://0.vuetifyjs.com/composables/transformers/to-element
|
|
4372
|
-
*
|
|
4373
|
-
* @remarks
|
|
4374
|
-
* Resolves various element reference types to a DOM Element.
|
|
4375
|
-
*
|
|
4376
|
-
* Accepts refs, getters, raw DOM elements, or Vue component instances
|
|
4377
|
-
* and normalizes them to a plain Element. Uses structural typing to
|
|
4378
|
-
* avoid cross-version Vue Ref incompatibilities.
|
|
4379
|
-
*
|
|
4380
|
-
* @example
|
|
4381
|
-
* ```ts
|
|
4382
|
-
* import { shallowRef } from 'vue'
|
|
4383
|
-
* import { toElement } from '@vuetify/v0'
|
|
4384
|
-
*
|
|
4385
|
-
* const el = shallowRef<HTMLElement | null>(null)
|
|
4386
|
-
* const resolved = toElement(el) // HTMLElement | undefined
|
|
4387
|
-
* ```
|
|
4388
|
-
*/
|
|
4389
|
-
/**
|
|
4390
|
-
* Resolves a {@link MaybeElementRef} to a DOM Element or undefined.
|
|
4391
|
-
*
|
|
4392
|
-
* Handles:
|
|
4393
|
-
* - `Ref<Element>`, `ShallowRef<HTMLElement>`, getter functions
|
|
4394
|
-
* - Vue component instances (extracts `$el`)
|
|
4395
|
-
* - Raw DOM elements (pass-through)
|
|
4396
|
-
* - null/undefined (returns undefined)
|
|
4397
|
-
*
|
|
4398
|
-
* @param target The element ref, getter, or raw value to resolve
|
|
4399
|
-
* @returns The resolved DOM Element, or undefined if not available
|
|
4400
|
-
*
|
|
4401
|
-
* @see https://0.vuetifyjs.com/composables/transformers/to-element
|
|
4402
|
-
*
|
|
4403
|
-
* @example
|
|
4404
|
-
* ```ts
|
|
4405
|
-
* import { toElement } from '@vuetify/v0'
|
|
4406
|
-
*
|
|
4407
|
-
* const el = shallowRef<HTMLElement | null>(null)
|
|
4408
|
-
* toElement(el) // HTMLElement | undefined
|
|
4409
|
-
*
|
|
4410
|
-
* const component = ref<ComponentPublicInstance>()
|
|
4411
|
-
* toElement(component) // Element | undefined (from $el)
|
|
4412
|
-
* ```
|
|
4413
|
-
*/
|
|
4414
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
4415
|
-
function toElement(target) {
|
|
4416
|
-
if (!target) return void 0;
|
|
4417
|
-
if (/* @__PURE__ */ isElement(target)) return target;
|
|
4418
|
-
const raw = /* @__PURE__ */ isFunction(target) ? target() : /* @__PURE__ */ isObject(target) && "value" in target ? target.value : target;
|
|
4419
|
-
if (!raw) return void 0;
|
|
4420
|
-
if (/* @__PURE__ */ isElement(raw)) return raw;
|
|
4421
|
-
if (/* @__PURE__ */ isObject(raw) && "$el" in raw) return raw.$el;
|
|
4422
|
-
}
|
|
4423
|
-
//#endregion
|
|
4424
4469
|
//#region src/composables/createObserver/index.ts
|
|
4425
4470
|
/**
|
|
4426
4471
|
* @module createObserver
|
|
@@ -5348,8 +5393,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
5348
5393
|
});
|
|
5349
5394
|
const count = toRef(() => hidden.value.length);
|
|
5350
5395
|
const slotProps = toRef(() => {
|
|
5351
|
-
const
|
|
5352
|
-
const ariaLabel = translated === LABEL_KEY ? `+${count.value}` : translated;
|
|
5396
|
+
const ariaLabel = locale.ti(LABEL_KEY, { count: count.value }) ?? `+${count.value} more`;
|
|
5353
5397
|
return {
|
|
5354
5398
|
count: count.value,
|
|
5355
5399
|
hidden: hidden.value,
|
|
@@ -6113,7 +6157,7 @@ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
|
|
|
6113
6157
|
prev: breadcrumbs.prev,
|
|
6114
6158
|
select: breadcrumbs.select,
|
|
6115
6159
|
attrs: {
|
|
6116
|
-
"aria-label": __props.label ?? locale.
|
|
6160
|
+
"aria-label": __props.label ?? locale.ti("Breadcrumbs.label") ?? "Breadcrumbs",
|
|
6117
6161
|
"role": __props.as === "nav" ? void 0 : "navigation"
|
|
6118
6162
|
}
|
|
6119
6163
|
}));
|
|
@@ -6997,7 +7041,7 @@ const _sfc_main$27 = /* @__PURE__ */ defineComponent({
|
|
|
6997
7041
|
"aria-disabled": isDisabled.value || isPassive.value,
|
|
6998
7042
|
"aria-busy": isLoading.value ? true : void 0,
|
|
6999
7043
|
"aria-pressed": group ? isSelected.value : void 0,
|
|
7000
|
-
"aria-label": __props.ariaLabel || (isSolo.value ? locale.
|
|
7044
|
+
"aria-label": __props.ariaLabel || (!__props.renderless && isSolo.value ? locale.ti("Button.label") ?? "Button" : void 0),
|
|
7001
7045
|
"tabindex": isDisabled.value ? -1 : 0,
|
|
7002
7046
|
"data-loading": isLoading.value ? true : void 0,
|
|
7003
7047
|
"data-passive": isPassive.value ? true : void 0,
|
|
@@ -7590,7 +7634,7 @@ const _sfc_main$34 = /* @__PURE__ */ defineComponent({
|
|
|
7590
7634
|
attrs: {
|
|
7591
7635
|
"role": "region",
|
|
7592
7636
|
"aria-roledescription": "carousel",
|
|
7593
|
-
"aria-label": __props.label ?? locale.
|
|
7637
|
+
"aria-label": __props.label ?? locale.ti("Carousel.label") ?? "Carousel",
|
|
7594
7638
|
"aria-disabled": toValue(step.disabled),
|
|
7595
7639
|
"data-disabled": toValue(step.disabled) || void 0
|
|
7596
7640
|
}
|
|
@@ -7849,10 +7893,10 @@ const _sfc_main$29 = /* @__PURE__ */ defineComponent({
|
|
|
7849
7893
|
"id": `${carousel.rootId}-slide-${ticket.index}`,
|
|
7850
7894
|
"role": "group",
|
|
7851
7895
|
"aria-roledescription": "slide",
|
|
7852
|
-
"aria-label": locale.
|
|
7896
|
+
"aria-label": locale.ti("Carousel.slide", {
|
|
7853
7897
|
current: ticket.index + 1,
|
|
7854
7898
|
size: carousel.size
|
|
7855
|
-
})
|
|
7899
|
+
}) ?? `Slide ${ticket.index + 1} of ${carousel.size}`,
|
|
7856
7900
|
"aria-hidden": isActive.value ? void 0 : true,
|
|
7857
7901
|
"data-selected": toValue(ticket.isSelected) || void 0,
|
|
7858
7902
|
"data-active": isActive.value || void 0,
|
|
@@ -7910,7 +7954,7 @@ const _sfc_main$32 = /* @__PURE__ */ defineComponent({
|
|
|
7910
7954
|
isAtEdge: isAtEdge.value,
|
|
7911
7955
|
attrs: {
|
|
7912
7956
|
"type": __props.as === "button" ? "button" : void 0,
|
|
7913
|
-
"aria-label": locale.
|
|
7957
|
+
"aria-label": locale.ti("Carousel.prev") ?? "Previous slide",
|
|
7914
7958
|
"aria-controls": viewportId,
|
|
7915
7959
|
"aria-disabled": isDisabled.value,
|
|
7916
7960
|
"disabled": __props.as === "button" ? isDisabled.value : void 0,
|
|
@@ -7966,7 +8010,7 @@ const _sfc_main$31 = /* @__PURE__ */ defineComponent({
|
|
|
7966
8010
|
isAtEdge: isAtEdge.value,
|
|
7967
8011
|
attrs: {
|
|
7968
8012
|
"type": __props.as === "button" ? "button" : void 0,
|
|
7969
|
-
"aria-label": locale.
|
|
8013
|
+
"aria-label": locale.ti("Carousel.next") ?? "Next slide",
|
|
7970
8014
|
"aria-controls": viewportId,
|
|
7971
8015
|
"aria-disabled": isDisabled.value,
|
|
7972
8016
|
"disabled": __props.as === "button" ? isDisabled.value : void 0,
|
|
@@ -8069,10 +8113,10 @@ const _sfc_main$28 = /* @__PURE__ */ defineComponent({
|
|
|
8069
8113
|
"tabindex": isSelected ? 0 : -1,
|
|
8070
8114
|
"aria-selected": isSelected,
|
|
8071
8115
|
"aria-controls": `${carousel.rootId}-slide-${i}`,
|
|
8072
|
-
"aria-label": locale.
|
|
8116
|
+
"aria-label": locale.ti("Carousel.indicator", {
|
|
8073
8117
|
current: i + 1,
|
|
8074
8118
|
size
|
|
8075
|
-
})
|
|
8119
|
+
}) ?? `Go to slide ${i + 1} of ${size}`,
|
|
8076
8120
|
"data-selected": isSelected || void 0,
|
|
8077
8121
|
"data-active": isActive || void 0,
|
|
8078
8122
|
"onClick"() {
|
|
@@ -8084,7 +8128,7 @@ const _sfc_main$28 = /* @__PURE__ */ defineComponent({
|
|
|
8084
8128
|
}),
|
|
8085
8129
|
attrs: {
|
|
8086
8130
|
"role": "tablist",
|
|
8087
|
-
"aria-label": __props.label ?? locale.
|
|
8131
|
+
"aria-label": __props.label ?? locale.ti("Carousel.indicators") ?? "Carousel indicators",
|
|
8088
8132
|
"aria-orientation": carousel.orientation.value
|
|
8089
8133
|
}
|
|
8090
8134
|
};
|
|
@@ -8143,8 +8187,8 @@ const _sfc_main$33 = /* @__PURE__ */ defineComponent({
|
|
|
8143
8187
|
"aria-valuenow": percent,
|
|
8144
8188
|
"aria-valuemin": 0,
|
|
8145
8189
|
"aria-valuemax": 100,
|
|
8146
|
-
"aria-valuetext": locale.
|
|
8147
|
-
"aria-label": locale.
|
|
8190
|
+
"aria-valuetext": locale.ti("Carousel.progress", { percent }) ?? `${percent}% complete`,
|
|
8191
|
+
"aria-label": locale.ti("Carousel.progressLabel") ?? "Carousel progress",
|
|
8148
8192
|
"data-state": state.value,
|
|
8149
8193
|
"style": { width: `${percent}%` }
|
|
8150
8194
|
}
|
|
@@ -8195,10 +8239,10 @@ const _sfc_main$30 = /* @__PURE__ */ defineComponent({
|
|
|
8195
8239
|
if (/* @__PURE__ */ isUndefined(prevIndex)) return;
|
|
8196
8240
|
clearTimeout(pending);
|
|
8197
8241
|
pending = setTimeout(() => {
|
|
8198
|
-
text.value = locale.
|
|
8242
|
+
text.value = locale.ti("Carousel.liveRegion", {
|
|
8199
8243
|
current: index + 1,
|
|
8200
8244
|
size: carousel.size
|
|
8201
|
-
})
|
|
8245
|
+
}) ?? `Slide ${index + 1} of ${carousel.size}`;
|
|
8202
8246
|
}, 100);
|
|
8203
8247
|
});
|
|
8204
8248
|
onBeforeUnmount(() => clearTimeout(pending));
|
|
@@ -9412,6 +9456,7 @@ function useDelay(callback, options = {}) {
|
|
|
9412
9456
|
function usePopover(options = {}) {
|
|
9413
9457
|
const { id: _id, positionArea = "bottom", positionTry = "most-width bottom", openDelay, closeDelay } = options;
|
|
9414
9458
|
const id = _id ?? /* @__PURE__ */ useId();
|
|
9459
|
+
const anchor = `--${String(id).replace(/[^a-zA-Z0-9_-]/g, "")}`;
|
|
9415
9460
|
const isOpen = options.isOpen ?? shallowRef(false);
|
|
9416
9461
|
const delay = useDelay((direction) => {
|
|
9417
9462
|
isOpen.value = direction;
|
|
@@ -9432,7 +9477,7 @@ function usePopover(options = {}) {
|
|
|
9432
9477
|
function cancel() {
|
|
9433
9478
|
delay.stop();
|
|
9434
9479
|
}
|
|
9435
|
-
const anchorStyles = toRef(() => ({ anchorName:
|
|
9480
|
+
const anchorStyles = toRef(() => ({ anchorName: anchor }));
|
|
9436
9481
|
const contentAttrs = toRef(() => ({
|
|
9437
9482
|
id,
|
|
9438
9483
|
popover: ""
|
|
@@ -9442,7 +9487,7 @@ function usePopover(options = {}) {
|
|
|
9442
9487
|
"margin": "unset",
|
|
9443
9488
|
"inset-area": positionArea,
|
|
9444
9489
|
"position-area": positionArea,
|
|
9445
|
-
"position-anchor":
|
|
9490
|
+
"position-anchor": anchor,
|
|
9446
9491
|
"position-try-fallbacks": positionTry
|
|
9447
9492
|
}));
|
|
9448
9493
|
/* v8 ignore start -- browser popover API */
|
|
@@ -11013,7 +11058,7 @@ const _sfc_main$55 = /* @__PURE__ */ defineComponent({
|
|
|
11013
11058
|
isOpen: context.isOpen.value,
|
|
11014
11059
|
attrs: {
|
|
11015
11060
|
"type": __props.as === "button" ? "button" : void 0,
|
|
11016
|
-
"aria-label": locale.
|
|
11061
|
+
"aria-label": locale.ti("Dialog.close") ?? "Close",
|
|
11017
11062
|
"onClick": onClick
|
|
11018
11063
|
}
|
|
11019
11064
|
}));
|
|
@@ -11053,7 +11098,8 @@ const _sfc_main$56 = /* @__PURE__ */ defineComponent({
|
|
|
11053
11098
|
const contentRef = useTemplateRef("content");
|
|
11054
11099
|
const ticket = useStack().register({
|
|
11055
11100
|
onDismiss: () => context.close(),
|
|
11056
|
-
blocking: __props.blocking
|
|
11101
|
+
blocking: () => __props.blocking,
|
|
11102
|
+
el: () => contentRef.value?.element
|
|
11057
11103
|
});
|
|
11058
11104
|
watch(context.isOpen, (isOpen) => {
|
|
11059
11105
|
if (isOpen) ticket.select();
|
|
@@ -13612,16 +13658,17 @@ function createNumberField(options = {}) {
|
|
|
13612
13658
|
const result = Number(cleaned);
|
|
13613
13659
|
return Number.isNaN(result) ? null : result;
|
|
13614
13660
|
}
|
|
13615
|
-
function commit() {
|
|
13616
|
-
|
|
13617
|
-
if (
|
|
13661
|
+
function commit(next) {
|
|
13662
|
+
const val = arguments.length === 0 ? value.value : next;
|
|
13663
|
+
if (/* @__PURE__ */ isNull(val)) return;
|
|
13664
|
+
if (!shouldClamp && (val < numeric.min || val > numeric.max)) {
|
|
13618
13665
|
if (numeric.step > 0 && Number.isFinite(numeric.min)) {
|
|
13619
|
-
const steps = Math.round((
|
|
13666
|
+
const steps = Math.round((val - numeric.min) / numeric.step);
|
|
13620
13667
|
value.value = numeric.min + steps * numeric.step;
|
|
13621
13668
|
}
|
|
13622
13669
|
return;
|
|
13623
13670
|
}
|
|
13624
|
-
value.value = numeric.snap(
|
|
13671
|
+
value.value = numeric.snap(val);
|
|
13625
13672
|
}
|
|
13626
13673
|
return {
|
|
13627
13674
|
value,
|
|
@@ -13847,7 +13894,7 @@ const _sfc_main$78 = /* @__PURE__ */ defineComponent({
|
|
|
13847
13894
|
function onBlur() {
|
|
13848
13895
|
const parsed = root.parse(text.value);
|
|
13849
13896
|
root.value.value = parsed;
|
|
13850
|
-
root.commit();
|
|
13897
|
+
root.commit(parsed);
|
|
13851
13898
|
root.isFocused.value = false;
|
|
13852
13899
|
syncText();
|
|
13853
13900
|
}
|
|
@@ -13870,7 +13917,7 @@ const _sfc_main$78 = /* @__PURE__ */ defineComponent({
|
|
|
13870
13917
|
Enter: () => {
|
|
13871
13918
|
const parsed = root.parse(text.value);
|
|
13872
13919
|
root.value.value = parsed;
|
|
13873
|
-
root.commit();
|
|
13920
|
+
root.commit(parsed);
|
|
13874
13921
|
}
|
|
13875
13922
|
}[e.key];
|
|
13876
13923
|
if (!action) return;
|
|
@@ -13999,7 +14046,7 @@ const _sfc_main$79 = /* @__PURE__ */ defineComponent({
|
|
|
13999
14046
|
return {
|
|
14000
14047
|
"type": "button",
|
|
14001
14048
|
"tabindex": -1,
|
|
14002
|
-
"aria-label": locale.
|
|
14049
|
+
"aria-label": locale.ti("NumberField.decrement") ?? "Decrement",
|
|
14003
14050
|
"disabled": disabled || void 0,
|
|
14004
14051
|
"data-disabled": disabled ? true : void 0,
|
|
14005
14052
|
onBlur,
|
|
@@ -14140,7 +14187,7 @@ const _sfc_main$82 = /* @__PURE__ */ defineComponent({
|
|
|
14140
14187
|
return {
|
|
14141
14188
|
"type": "button",
|
|
14142
14189
|
"tabindex": -1,
|
|
14143
|
-
"aria-label": locale.
|
|
14190
|
+
"aria-label": locale.ti("NumberField.increment") ?? "Increment",
|
|
14144
14191
|
"disabled": disabled || void 0,
|
|
14145
14192
|
"data-disabled": disabled ? true : void 0,
|
|
14146
14193
|
onBlur,
|
|
@@ -14491,23 +14538,20 @@ const _sfc_main$87 = /* @__PURE__ */ defineComponent({
|
|
|
14491
14538
|
reserved: indicatorWidth,
|
|
14492
14539
|
reverse: () => __props.priority === "end"
|
|
14493
14540
|
});
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
const ticket = tickets[index];
|
|
14498
|
-
if (!ticket) return true;
|
|
14499
|
-
if (toValue(ticket.disabled)) return true;
|
|
14541
|
+
const hidden = computed(() => {
|
|
14542
|
+
const set = /* @__PURE__ */ new Set();
|
|
14543
|
+
if (__props.disabled) return set;
|
|
14500
14544
|
const cap = overflow.capacity.value;
|
|
14501
|
-
if (cap === Infinity) return
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
for (const [i,
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14509
|
-
|
|
14510
|
-
return
|
|
14545
|
+
if (cap === Infinity) return set;
|
|
14546
|
+
const tickets = registry.values();
|
|
14547
|
+
const enabled = [];
|
|
14548
|
+
for (const [i, ticket] of tickets.entries()) if (!toValue(ticket.disabled)) enabled.push(i);
|
|
14549
|
+
const total = enabled.length;
|
|
14550
|
+
for (let rank = 0; rank < total; rank++) if (!(__props.priority === "end" ? rank >= total - cap : rank < cap)) set.add(enabled[rank]);
|
|
14551
|
+
return set;
|
|
14552
|
+
});
|
|
14553
|
+
function isVisible(index) {
|
|
14554
|
+
return !hidden.value.has(index);
|
|
14511
14555
|
}
|
|
14512
14556
|
provideOverflowRoot(__props.namespace, {
|
|
14513
14557
|
overflow,
|
|
@@ -15082,7 +15126,7 @@ const _sfc_main$94 = /* @__PURE__ */ defineComponent({
|
|
|
15082
15126
|
prev: pagination.prev,
|
|
15083
15127
|
select: pagination.select,
|
|
15084
15128
|
attrs: {
|
|
15085
|
-
"aria-label": locale.
|
|
15129
|
+
"aria-label": locale.ti("Pagination.label") ?? "Pagination",
|
|
15086
15130
|
"role": __props.as === "nav" ? void 0 : "navigation"
|
|
15087
15131
|
}
|
|
15088
15132
|
}));
|
|
@@ -15179,7 +15223,7 @@ const _sfc_main$89 = /* @__PURE__ */ defineComponent({
|
|
|
15179
15223
|
isDisabled: isDisabled.value,
|
|
15180
15224
|
first,
|
|
15181
15225
|
attrs: {
|
|
15182
|
-
"aria-label": locale.
|
|
15226
|
+
"aria-label": locale.ti("Pagination.first") ?? "First page",
|
|
15183
15227
|
"aria-disabled": isDisabled.value,
|
|
15184
15228
|
"data-disabled": isDisabled.value || void 0,
|
|
15185
15229
|
"disabled": __props.as === "button" ? isDisabled.value : void 0,
|
|
@@ -15233,7 +15277,7 @@ const _sfc_main$90 = /* @__PURE__ */ defineComponent({
|
|
|
15233
15277
|
}, { immediate: true });
|
|
15234
15278
|
const isSelected = toRef(() => pagination.page.value === __props.value);
|
|
15235
15279
|
const ariaLabel = toRef(() => {
|
|
15236
|
-
return isSelected.value ? locale.
|
|
15280
|
+
return isSelected.value ? locale.ti("Pagination.currentPage", { page: __props.value }) ?? `Page ${__props.value}, current` : locale.ti("Pagination.goToPage", { page: __props.value }) ?? `Go to page ${__props.value}`;
|
|
15237
15281
|
});
|
|
15238
15282
|
function select() {
|
|
15239
15283
|
if (__props.disabled) return;
|
|
@@ -15304,7 +15348,7 @@ const _sfc_main$91 = /* @__PURE__ */ defineComponent({
|
|
|
15304
15348
|
isDisabled: isDisabled.value,
|
|
15305
15349
|
last,
|
|
15306
15350
|
attrs: {
|
|
15307
|
-
"aria-label": locale.
|
|
15351
|
+
"aria-label": locale.ti("Pagination.last") ?? "Last page",
|
|
15308
15352
|
"aria-disabled": isDisabled.value,
|
|
15309
15353
|
"data-disabled": isDisabled.value || void 0,
|
|
15310
15354
|
"disabled": __props.as === "button" ? isDisabled.value : void 0,
|
|
@@ -15361,7 +15405,7 @@ const _sfc_main$92 = /* @__PURE__ */ defineComponent({
|
|
|
15361
15405
|
isDisabled: isDisabled.value,
|
|
15362
15406
|
next,
|
|
15363
15407
|
attrs: {
|
|
15364
|
-
"aria-label": locale.
|
|
15408
|
+
"aria-label": locale.ti("Pagination.next") ?? "Next page",
|
|
15365
15409
|
"aria-disabled": isDisabled.value,
|
|
15366
15410
|
"data-disabled": isDisabled.value || void 0,
|
|
15367
15411
|
"disabled": __props.as === "button" ? isDisabled.value : void 0,
|
|
@@ -15418,7 +15462,7 @@ const _sfc_main$93 = /* @__PURE__ */ defineComponent({
|
|
|
15418
15462
|
isDisabled: isDisabled.value,
|
|
15419
15463
|
prev,
|
|
15420
15464
|
attrs: {
|
|
15421
|
-
"aria-label": locale.
|
|
15465
|
+
"aria-label": locale.ti("Pagination.prev") ?? "Previous page",
|
|
15422
15466
|
"aria-disabled": isDisabled.value,
|
|
15423
15467
|
"data-disabled": isDisabled.value || void 0,
|
|
15424
15468
|
"disabled": __props.as === "button" ? isDisabled.value : void 0,
|
|
@@ -15462,10 +15506,10 @@ const _sfc_main$95 = /* @__PURE__ */ defineComponent({
|
|
|
15462
15506
|
if (/* @__PURE__ */ isUndefined(prevPage)) return;
|
|
15463
15507
|
clearTimeout(pending);
|
|
15464
15508
|
pending = setTimeout(() => {
|
|
15465
|
-
text.value = locale.
|
|
15509
|
+
text.value = locale.ti("Pagination.status", {
|
|
15466
15510
|
page,
|
|
15467
15511
|
pages: pagination.pages
|
|
15468
|
-
})
|
|
15512
|
+
}) ?? `Page ${page} of ${pagination.pages}`;
|
|
15469
15513
|
}, 100);
|
|
15470
15514
|
});
|
|
15471
15515
|
onBeforeUnmount(() => clearTimeout(pending));
|
|
@@ -15764,7 +15808,7 @@ const _sfc_main$96 = /* @__PURE__ */ defineComponent({
|
|
|
15764
15808
|
const context = usePopoverContext();
|
|
15765
15809
|
const popovertarget = toRef(() => __props.target ?? context.id);
|
|
15766
15810
|
const style = toRef(() => {
|
|
15767
|
-
if (__props.target) return { anchorName: `--${__props.target}` };
|
|
15811
|
+
if (__props.target) return { anchorName: `--${String(__props.target).replace(/[^a-zA-Z0-9_-]/g, "")}` };
|
|
15768
15812
|
return context.anchorStyles.value;
|
|
15769
15813
|
});
|
|
15770
15814
|
const slotProps = toRef(() => ({
|
|
@@ -15811,7 +15855,7 @@ const _sfc_main$97 = /* @__PURE__ */ defineComponent({
|
|
|
15811
15855
|
"margin": "unset",
|
|
15812
15856
|
"inset-area": __props.positionArea ?? "bottom",
|
|
15813
15857
|
"position-area": __props.positionArea ?? "bottom",
|
|
15814
|
-
"position-anchor": `--${__props.id}`,
|
|
15858
|
+
"position-anchor": `--${String(__props.id).replace(/[^a-zA-Z0-9_-]/g, "")}`,
|
|
15815
15859
|
"position-try-fallbacks": __props.positionTry ?? "most-width bottom"
|
|
15816
15860
|
};
|
|
15817
15861
|
return context.contentStyles.value;
|
|
@@ -15940,16 +15984,23 @@ const _sfc_main$99 = /* @__PURE__ */ defineComponent({
|
|
|
15940
15984
|
blocking: {
|
|
15941
15985
|
type: Boolean,
|
|
15942
15986
|
default: false
|
|
15987
|
+
},
|
|
15988
|
+
scrim: {
|
|
15989
|
+
type: Boolean,
|
|
15990
|
+
default: true
|
|
15943
15991
|
}
|
|
15944
15992
|
},
|
|
15945
15993
|
emits: ["close"],
|
|
15946
15994
|
setup(__props, { emit: __emit }) {
|
|
15947
15995
|
const emit = __emit;
|
|
15948
|
-
const
|
|
15949
|
-
|
|
15996
|
+
const stack = useStack();
|
|
15997
|
+
const ticket = stack.register({
|
|
15998
|
+
blocking: () => __props.blocking,
|
|
15999
|
+
scrim: () => __props.scrim,
|
|
15950
16000
|
onDismiss: () => emit("close")
|
|
15951
16001
|
});
|
|
15952
16002
|
ticket.select();
|
|
16003
|
+
const target = toRef(() => __props.to === "top-layer" ? stack.topElement.value ?? "body" : __props.to);
|
|
15953
16004
|
const slotProps = toRef(() => ({
|
|
15954
16005
|
zIndex: ticket.zIndex.value,
|
|
15955
16006
|
close: ticket.dismiss
|
|
@@ -15957,7 +16008,7 @@ const _sfc_main$99 = /* @__PURE__ */ defineComponent({
|
|
|
15957
16008
|
return (_ctx, _cache) => {
|
|
15958
16009
|
return openBlock(), createBlock(Teleport, {
|
|
15959
16010
|
disabled: __props.disabled,
|
|
15960
|
-
to:
|
|
16011
|
+
to: target.value
|
|
15961
16012
|
}, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))], 8, ["disabled", "to"]);
|
|
15962
16013
|
};
|
|
15963
16014
|
}
|
|
@@ -17438,10 +17489,10 @@ const _sfc_main$114 = /* @__PURE__ */ defineComponent({
|
|
|
17438
17489
|
"aria-valuenow": rating.value.value,
|
|
17439
17490
|
"aria-valuemin": 0,
|
|
17440
17491
|
"aria-valuemax": rating.size,
|
|
17441
|
-
"aria-valuetext": locale.
|
|
17492
|
+
"aria-valuetext": locale.ti("Rating.valueText", {
|
|
17442
17493
|
value: rating.value.value,
|
|
17443
17494
|
size: rating.size
|
|
17444
|
-
})
|
|
17495
|
+
}) ?? `${rating.value.value} of ${rating.size} stars`,
|
|
17445
17496
|
"aria-disabled": isDisabled.value ? true : void 0,
|
|
17446
17497
|
"aria-readonly": isReadonly.value ? true : void 0,
|
|
17447
17498
|
"data-disabled": isDisabled.value ? true : void 0,
|
|
@@ -17713,16 +17764,16 @@ const _sfc_main$115 = /* @__PURE__ */ defineComponent({
|
|
|
17713
17764
|
setup(__props) {
|
|
17714
17765
|
const attrs = useAttrs();
|
|
17715
17766
|
const stack = useStack();
|
|
17716
|
-
const tickets = computed(() => Array.from(stack.selectedItems.value));
|
|
17767
|
+
const tickets = computed(() => Array.from(stack.selectedItems.value).filter((ticket) => ticket.scrim.value !== false));
|
|
17717
17768
|
function onDismiss(ticket) {
|
|
17718
|
-
if (!ticket.blocking) ticket.dismiss();
|
|
17769
|
+
if (!ticket.blocking.value) ticket.dismiss();
|
|
17719
17770
|
}
|
|
17720
17771
|
function getSlotProps(ticket) {
|
|
17721
17772
|
const zIndex = ticket.zIndex.value - 1;
|
|
17722
17773
|
return {
|
|
17723
17774
|
ticket,
|
|
17724
17775
|
zIndex,
|
|
17725
|
-
isBlocking: ticket.blocking,
|
|
17776
|
+
isBlocking: ticket.blocking.value,
|
|
17726
17777
|
dismiss: () => onDismiss(ticket),
|
|
17727
17778
|
attrs: {
|
|
17728
17779
|
style: { zIndex },
|
|
@@ -19474,8 +19525,12 @@ const _sfc_main$134 = /* @__PURE__ */ defineComponent({
|
|
|
19474
19525
|
__name: "SnackbarPortal",
|
|
19475
19526
|
props: {
|
|
19476
19527
|
teleport: {
|
|
19477
|
-
type: [
|
|
19478
|
-
|
|
19528
|
+
type: [
|
|
19529
|
+
String,
|
|
19530
|
+
Object,
|
|
19531
|
+
Boolean
|
|
19532
|
+
],
|
|
19533
|
+
default: "top-layer"
|
|
19479
19534
|
},
|
|
19480
19535
|
as: { default: "div" },
|
|
19481
19536
|
renderless: { type: Boolean }
|
|
@@ -19490,6 +19545,7 @@ const _sfc_main$134 = /* @__PURE__ */ defineComponent({
|
|
|
19490
19545
|
return (_ctx, _cache) => {
|
|
19491
19546
|
return openBlock(), createBlock(unref(_sfc_main$99), {
|
|
19492
19547
|
disabled: __props.teleport === false,
|
|
19548
|
+
scrim: false,
|
|
19493
19549
|
to: __props.teleport || "body"
|
|
19494
19550
|
}, {
|
|
19495
19551
|
default: withCtx(({ zIndex }) => [createVNode(unref(_sfc_main$9), mergeProps({
|
|
@@ -19587,7 +19643,7 @@ function createQueue(_options = {}) {
|
|
|
19587
19643
|
}
|
|
19588
19644
|
function register(registration = {}) {
|
|
19589
19645
|
const id = registration.id ?? /* @__PURE__ */ useId();
|
|
19590
|
-
const timeout = Object.
|
|
19646
|
+
const timeout = Object.hasOwn(registration, "timeout") ? registration.timeout : _timeout;
|
|
19591
19647
|
const ticket = {
|
|
19592
19648
|
...registration,
|
|
19593
19649
|
id,
|
|
@@ -20386,7 +20442,7 @@ const _sfc_main$132 = /* @__PURE__ */ defineComponent({
|
|
|
20386
20442
|
}
|
|
20387
20443
|
const slotProps = toRef(() => ({ attrs: {
|
|
20388
20444
|
"type": __props.as === "button" ? "button" : void 0,
|
|
20389
|
-
"aria-label": locale.
|
|
20445
|
+
"aria-label": locale.ti("Snackbar.close") ?? "Dismiss",
|
|
20390
20446
|
"onClick": onClick
|
|
20391
20447
|
} }));
|
|
20392
20448
|
return (_ctx, _cache) => {
|
|
@@ -22307,6 +22363,10 @@ var ThemeAdapter = class ThemeAdapter {
|
|
|
22307
22363
|
*/
|
|
22308
22364
|
dispose;
|
|
22309
22365
|
constructor(prefix) {
|
|
22366
|
+
if (!ThemeAdapter.SAFE_IDENT.test(prefix)) throw new V0Error(`Invalid theme prefix: "${prefix}". Expected an identifier matching ${ThemeAdapter.SAFE_IDENT}.`, {
|
|
22367
|
+
code: "V0_THEME_INVALID_PREFIX",
|
|
22368
|
+
prefix
|
|
22369
|
+
});
|
|
22310
22370
|
this.prefix = prefix;
|
|
22311
22371
|
}
|
|
22312
22372
|
generate(colors, isDark) {
|
|
@@ -22347,12 +22407,18 @@ var V0StyleSheetThemeAdapter = class extends ThemeAdapter {
|
|
|
22347
22407
|
this.update(colors, isDark);
|
|
22348
22408
|
});
|
|
22349
22409
|
if (/* @__PURE__ */ isNull(target)) {
|
|
22350
|
-
this.dispose =
|
|
22410
|
+
this.dispose = () => {
|
|
22411
|
+
stopWatch();
|
|
22412
|
+
this.detach();
|
|
22413
|
+
};
|
|
22351
22414
|
return;
|
|
22352
22415
|
}
|
|
22353
22416
|
const targetEl = target instanceof HTMLElement ? target : /* @__PURE__ */ isString(target) ? document.querySelector(target) : app._container || document.querySelector("#app") || document.body;
|
|
22354
22417
|
if (!targetEl) {
|
|
22355
|
-
this.dispose =
|
|
22418
|
+
this.dispose = () => {
|
|
22419
|
+
stopWatch();
|
|
22420
|
+
this.detach();
|
|
22421
|
+
};
|
|
22356
22422
|
return;
|
|
22357
22423
|
}
|
|
22358
22424
|
if (context.selectedId.value) targetEl.dataset.theme = String(context.selectedId.value);
|
|
@@ -22363,6 +22429,7 @@ var V0StyleSheetThemeAdapter = class extends ThemeAdapter {
|
|
|
22363
22429
|
this.dispose = () => {
|
|
22364
22430
|
stopWatch();
|
|
22365
22431
|
stopTheme();
|
|
22432
|
+
this.detach();
|
|
22366
22433
|
};
|
|
22367
22434
|
} else {
|
|
22368
22435
|
const head = app._context?.provides?.usehead ?? app._context?.provides?.head;
|
|
@@ -22372,7 +22439,8 @@ var V0StyleSheetThemeAdapter = class extends ThemeAdapter {
|
|
|
22372
22439
|
htmlAttrs: { "data-theme": id ? String(id) : "" },
|
|
22373
22440
|
style: [{
|
|
22374
22441
|
innerHTML: this.generate(context.colors.value, context.isDark.value),
|
|
22375
|
-
id: this.stylesheetId
|
|
22442
|
+
id: this.stylesheetId,
|
|
22443
|
+
...this.cspNonce ? { nonce: this.cspNonce } : {}
|
|
22376
22444
|
}]
|
|
22377
22445
|
});
|
|
22378
22446
|
if (entry?.dispose) this.dispose = entry.dispose;
|
|
@@ -22391,6 +22459,11 @@ var V0StyleSheetThemeAdapter = class extends ThemeAdapter {
|
|
|
22391
22459
|
}
|
|
22392
22460
|
this.sheet.replaceSync(styles);
|
|
22393
22461
|
}
|
|
22462
|
+
detach() {
|
|
22463
|
+
if (!IN_BROWSER) return;
|
|
22464
|
+
document.adoptedStyleSheets = document.adoptedStyleSheets.filter((s) => s !== this.sheet);
|
|
22465
|
+
this.sheet = void 0;
|
|
22466
|
+
}
|
|
22394
22467
|
};
|
|
22395
22468
|
//#endregion
|
|
22396
22469
|
//#region src/composables/useTheme/adapters/unhead.ts
|
|
@@ -22406,8 +22479,10 @@ var V0StyleSheetThemeAdapter = class extends ThemeAdapter {
|
|
|
22406
22479
|
*/
|
|
22407
22480
|
var V0UnheadThemeAdapter = class extends ThemeAdapter {
|
|
22408
22481
|
entry;
|
|
22482
|
+
cspNonce;
|
|
22409
22483
|
constructor(options = {}) {
|
|
22410
22484
|
super(options.prefix ?? "v0");
|
|
22485
|
+
this.cspNonce = options.cspNonce;
|
|
22411
22486
|
this.stylesheetId = options.stylesheetId ?? this.stylesheetId;
|
|
22412
22487
|
}
|
|
22413
22488
|
setup(app, context, target) {
|
|
@@ -22418,7 +22493,8 @@ var V0UnheadThemeAdapter = class extends ThemeAdapter {
|
|
|
22418
22493
|
htmlAttrs: { "data-theme": id ? String(id) : "" },
|
|
22419
22494
|
style: [{
|
|
22420
22495
|
innerHTML: this.generate(context.colors.value, context.isDark.value),
|
|
22421
|
-
id: this.stylesheetId
|
|
22496
|
+
id: this.stylesheetId,
|
|
22497
|
+
...this.cspNonce ? { nonce: this.cspNonce } : {}
|
|
22422
22498
|
}]
|
|
22423
22499
|
});
|
|
22424
22500
|
}
|
|
@@ -22437,7 +22513,8 @@ var V0UnheadThemeAdapter = class extends ThemeAdapter {
|
|
|
22437
22513
|
htmlAttrs: { "data-theme": themeStr },
|
|
22438
22514
|
style: [{
|
|
22439
22515
|
innerHTML: this.generate(colors, isDark),
|
|
22440
|
-
id: this.stylesheetId
|
|
22516
|
+
id: this.stylesheetId,
|
|
22517
|
+
...this.cspNonce ? { nonce: this.cspNonce } : {}
|
|
22441
22518
|
}]
|
|
22442
22519
|
});
|
|
22443
22520
|
});
|
|
@@ -22451,7 +22528,8 @@ var V0UnheadThemeAdapter = class extends ThemeAdapter {
|
|
|
22451
22528
|
if (!this.entry) return;
|
|
22452
22529
|
this.entry.patch?.({ style: [{
|
|
22453
22530
|
innerHTML: this.generate(colors, isDark),
|
|
22454
|
-
id: this.stylesheetId
|
|
22531
|
+
id: this.stylesheetId,
|
|
22532
|
+
...this.cspNonce ? { nonce: this.cspNonce } : {}
|
|
22455
22533
|
}] });
|
|
22456
22534
|
}
|
|
22457
22535
|
};
|
|
@@ -24156,6 +24234,7 @@ function useRovingFocus(items, options = {}) {
|
|
|
24156
24234
|
}
|
|
24157
24235
|
//#endregion
|
|
24158
24236
|
//#region src/components/Treeview/TreeviewList.vue
|
|
24237
|
+
const FOCUSABLE = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]";
|
|
24159
24238
|
const [useTreeviewList, provideTreeviewList] = createContext({ suffix: "list" });
|
|
24160
24239
|
const _sfc_main$166 = /* @__PURE__ */ defineComponent({
|
|
24161
24240
|
name: "TreeviewList",
|
|
@@ -24204,7 +24283,43 @@ const _sfc_main$166 = /* @__PURE__ */ defineComponent({
|
|
|
24204
24283
|
if (toValue(ticket.isOpen) && expandable(ticket)) nested.close(ticket.id);
|
|
24205
24284
|
else if (!/* @__PURE__ */ isNullOrUndefined(ticket.parentId)) roving.focus(ticket.parentId);
|
|
24206
24285
|
}
|
|
24286
|
+
function focusableChildren(el) {
|
|
24287
|
+
return Array.from(el.querySelectorAll(FOCUSABLE)).filter((child) => child.getAttribute("tabindex") !== "-1" && child.getAttribute("aria-disabled") !== "true" && child.closest("[role=\"treeitem\"]") === el);
|
|
24288
|
+
}
|
|
24289
|
+
function nextItemId(id) {
|
|
24290
|
+
/* v8 ignore next -- defensive: source is always a registered visible item */
|
|
24291
|
+
if (/* @__PURE__ */ isNullOrUndefined(id)) return void 0;
|
|
24292
|
+
const visible = nested.visibleItems();
|
|
24293
|
+
const index = visible.findIndex((item) => item.id === id);
|
|
24294
|
+
/* v8 ignore next -- defensive: a registered item is always found in visibleItems */
|
|
24295
|
+
if (index === -1) return void 0;
|
|
24296
|
+
return visible.slice(index + 1).find((item) => !toValue(item.disabled))?.id;
|
|
24297
|
+
}
|
|
24207
24298
|
function onKeydown(e) {
|
|
24299
|
+
const target = e.target;
|
|
24300
|
+
const itemEl = target.closest("[role=\"treeitem\"]");
|
|
24301
|
+
const onItem = target === e.currentTarget || target.getAttribute("role") === "treeitem";
|
|
24302
|
+
if (e.key === "Tab") {
|
|
24303
|
+
if (!itemEl) return;
|
|
24304
|
+
const controls = focusableChildren(itemEl);
|
|
24305
|
+
if (controls.length === 0) return;
|
|
24306
|
+
if (!e.shiftKey && onItem) {
|
|
24307
|
+
e.preventDefault();
|
|
24308
|
+
controls[0].focus();
|
|
24309
|
+
} else if (!e.shiftKey && target === controls.at(-1)) {
|
|
24310
|
+
const source = nested.visibleItems().find((item) => toValue(item.el) === itemEl)?.id;
|
|
24311
|
+
const next = nextItemId(source);
|
|
24312
|
+
if (!/* @__PURE__ */ isNullOrUndefined(next)) {
|
|
24313
|
+
e.preventDefault();
|
|
24314
|
+
roving.focus(next);
|
|
24315
|
+
}
|
|
24316
|
+
} else if (e.shiftKey && target === controls[0]) {
|
|
24317
|
+
e.preventDefault();
|
|
24318
|
+
itemEl.focus();
|
|
24319
|
+
}
|
|
24320
|
+
return;
|
|
24321
|
+
}
|
|
24322
|
+
if (!onItem) return;
|
|
24208
24323
|
const id = roving.focusedId.value;
|
|
24209
24324
|
const ticket = /* @__PURE__ */ isNullOrUndefined(id) ? void 0 : nested.get(id);
|
|
24210
24325
|
const rtl = isRtl(e);
|
|
@@ -27564,7 +27679,7 @@ function createMapProxy(refObject) {
|
|
|
27564
27679
|
mapHandlers[Symbol.iterator] = mapHandlers.entries;
|
|
27565
27680
|
mapProxy = new Proxy(/* @__PURE__ */ new Map(), { get(_, p) {
|
|
27566
27681
|
if (p === "size") return refObject.value.size;
|
|
27567
|
-
if (Object.
|
|
27682
|
+
if (Object.hasOwn(mapHandlers, p)) return mapHandlers[p];
|
|
27568
27683
|
const map = refObject.value;
|
|
27569
27684
|
const value = Reflect.get(map, p);
|
|
27570
27685
|
return /* @__PURE__ */ isFunction(value) ? value.bind(map) : value;
|
|
@@ -27603,7 +27718,7 @@ function createSetProxy(refObject) {
|
|
|
27603
27718
|
setHandlers[Symbol.iterator] = setHandlers.values;
|
|
27604
27719
|
setProxy = new Proxy(/* @__PURE__ */ new Set(), { get(_, p) {
|
|
27605
27720
|
if (p === "size") return refObject.value.size;
|
|
27606
|
-
if (Object.
|
|
27721
|
+
if (Object.hasOwn(setHandlers, p)) return setHandlers[p];
|
|
27607
27722
|
const set = refObject.value;
|
|
27608
27723
|
const value = Reflect.get(set, p);
|
|
27609
27724
|
return /* @__PURE__ */ isFunction(value) ? value.bind(set) : value;
|