@vuetify/v0 1.0.0-rc.7 → 1.0.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-CMdKyFLz.d.mts → adapter-CVNRHfrz.d.mts} +1 -1
- package/dist/browser/index.d.ts +33 -33
- package/dist/browser/index.js +164 -108
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/{components-D87gpuRI.mjs → components-Cl9fclA1.mjs} +17 -20
- package/dist/composables/index.d.mts +6 -6
- package/dist/composables/index.mjs +21 -21
- package/dist/{composables-DAc4DbYb.mjs → composables-CU2JD9oM.mjs} +13 -11
- package/dist/constants/index.mjs +1 -1
- package/dist/{createDataTable-C86TFzxJ.mjs → createDataTable-BaYtcmAO.mjs} +3 -3
- package/dist/{createGroup-DKVmhWJZ.mjs → createGroup-5UjYS6_G.mjs} +1 -1
- package/dist/{createRegistry-DaRYxox5.mjs → createRegistry-C_M475FE.mjs} +23 -13
- package/dist/{createSelection-CZFfJnBv.mjs → createSelection-BokWvmnd.mjs} +27 -13
- package/dist/{createSingle-D08Et-36.mjs → createSingle-DTqmo-GH.mjs} +1 -1
- package/dist/{createTokens-BY_7TedA.mjs → createTokens-q-A6Ywox.mjs} +7 -7
- 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/posthog/index.mjs +1 -1
- package/dist/features/index.d.mts +1 -1
- package/dist/features/index.mjs +1 -1
- package/dist/{globals-Djy_aCgG.mjs → globals-C0tKiM_M.mjs} +1 -1
- package/dist/{index-B5ybQyJO.d.mts → index-BwNRi6BK.d.mts} +9 -7
- package/dist/{index-CIf2yTGR.d.mts → index-CrFFilCd.d.mts} +2 -2
- package/dist/{index-CfSenWTN.d.mts → index-DCtHbY0a.d.mts} +1 -1
- package/dist/{index-CUdlfMMw.d.mts → index-DOjheBVl.d.mts} +103 -106
- package/dist/{index-DTYOP7ci.d.mts → index-RGiSdjYt.d.mts} +8 -7
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +23 -23
- package/dist/json/web-types.json +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 +1 -1
- package/dist/locale/index.d.mts +3 -3
- package/dist/locale/index.mjs +2 -2
- package/dist/locale/messages/en/index.d.mts +3 -0
- package/dist/locale/messages/en/index.mjs +1 -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 +2 -2
- 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/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 +2 -2
- 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 +3 -3
- package/dist/{unhead-CAPMhSV7.mjs → unhead-BXJ8cqN-.mjs} +1 -1
- package/dist/{useEventListener-BtOsc1qg.mjs → useEventListener-UJ8VS4eS.mjs} +1 -1
- package/dist/{useFeatures-B5I-8W8H.mjs → useFeatures-Cn-HGB7v.mjs} +4 -4
- package/dist/{useLocale-AKOyyv43.mjs → useLocale-BFKJosku.mjs} +4 -4
- package/dist/{useLogger-bHW-Guij.mjs → useLogger-DGG3fsnB.mjs} +2 -2
- package/dist/{useNotifications-P-1VQHi8.mjs → useNotifications-DO10ylRQ.mjs} +3 -3
- package/dist/{usePermissions-nuWucbL_.mjs → usePermissions-BC-ppxf2.mjs} +2 -2
- package/dist/{useRovingFocus-BfbmLJoo.mjs → useRovingFocus-BWww4Lm1.mjs} +109 -76
- package/dist/{useRules-SLj8Le-M.mjs → useRules-CMDEY2-D.mjs} +2 -2
- package/dist/{useStorage-B4eV6lZZ.mjs → useStorage-BkutRChm.mjs} +3 -3
- package/dist/{useTheme-SVM2VmlS.mjs → useTheme-CJ5fgT5y.mjs} +4 -4
- package/dist/utilities/index.mjs +1 -1
- package/dist/{v0-DcTsWvzJ.d.mts → v0-C0OfckSF.d.mts} +1 -1
- package/dist/{v0-D5BwU_Up.mjs → v0-DUvaNE4R.mjs} +1 -1
- package/dist/{v0-BoEyw8RC.mjs → v0-M7azful7.mjs} +1 -1
- package/dist/{v0-gVrU_ObF.mjs → v0-sTRNcP5u.mjs} +1 -1
- package/package.json +7 -2
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-rc.
|
|
138
|
+
const version = "1.0.0-rc.8";
|
|
139
139
|
/* v8 ignore next -- build-time constant, __DEV__ short-circuits in tests */
|
|
140
140
|
const __LOGGER_ENABLED__ = false;
|
|
141
141
|
//#endregion
|
|
@@ -1666,6 +1666,7 @@ function createRegistry(options) {
|
|
|
1666
1666
|
const directory = /* @__PURE__ */ new Map();
|
|
1667
1667
|
const cache = /* @__PURE__ */ new Map();
|
|
1668
1668
|
const listeners = /* @__PURE__ */ new Map();
|
|
1669
|
+
const minted = /* @__PURE__ */ new WeakSet();
|
|
1669
1670
|
const order = [];
|
|
1670
1671
|
const version = shallowRef(0);
|
|
1671
1672
|
let indexDependentCount = 0;
|
|
@@ -1673,6 +1674,7 @@ function createRegistry(options) {
|
|
|
1673
1674
|
let minDirtyIndex = Infinity;
|
|
1674
1675
|
let maxDirtyIndex = -Infinity;
|
|
1675
1676
|
let isBatching = false;
|
|
1677
|
+
let structural = false;
|
|
1676
1678
|
let batched = [];
|
|
1677
1679
|
function dispatch(event, data) {
|
|
1678
1680
|
const cbs = listeners.get(event);
|
|
@@ -1812,23 +1814,29 @@ function createRegistry(options) {
|
|
|
1812
1814
|
}
|
|
1813
1815
|
function invalidate() {
|
|
1814
1816
|
cache.clear();
|
|
1815
|
-
if (isBatching)
|
|
1817
|
+
if (isBatching) {
|
|
1818
|
+
structural = true;
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1816
1821
|
version.value++;
|
|
1817
1822
|
}
|
|
1818
1823
|
function batch(fn) {
|
|
1819
1824
|
if (isBatching) return fn();
|
|
1820
1825
|
isBatching = true;
|
|
1826
|
+
structural = false;
|
|
1821
1827
|
batched = [];
|
|
1822
1828
|
try {
|
|
1823
|
-
|
|
1824
|
-
cache.clear();
|
|
1825
|
-
for (const { event, data } of batched) dispatch(event, data);
|
|
1826
|
-
return result;
|
|
1829
|
+
return fn();
|
|
1827
1830
|
} finally {
|
|
1828
1831
|
isBatching = false;
|
|
1832
|
+
const queue = batched;
|
|
1829
1833
|
batched = [];
|
|
1830
1834
|
cache.clear();
|
|
1831
|
-
|
|
1835
|
+
try {
|
|
1836
|
+
for (const { event, data } of queue) dispatch(event, data);
|
|
1837
|
+
} finally {
|
|
1838
|
+
if (structural) version.value++;
|
|
1839
|
+
}
|
|
1832
1840
|
}
|
|
1833
1841
|
}
|
|
1834
1842
|
function reindex() {
|
|
@@ -1862,6 +1870,7 @@ function createRegistry(options) {
|
|
|
1862
1870
|
function register(registration = {}) {
|
|
1863
1871
|
if (needsReindex) reindex();
|
|
1864
1872
|
const size = collection.size;
|
|
1873
|
+
const auto = /* @__PURE__ */ isNullOrUndefined(registration.id);
|
|
1865
1874
|
const id = registration.id ?? /* @__PURE__ */ useId();
|
|
1866
1875
|
if (has(id)) {
|
|
1867
1876
|
logger.warn(`Ticket "${id}" already exists. Use \`upsert()\` to update or check \`has()\` before registering.`);
|
|
@@ -1881,6 +1890,7 @@ function createRegistry(options) {
|
|
|
1881
1890
|
unregister: () => unregister(id)
|
|
1882
1891
|
};
|
|
1883
1892
|
const ticket = reactive ? shallowReactive(input) : input;
|
|
1893
|
+
if (auto) minted.add(ticket);
|
|
1884
1894
|
collection.set(ticket.id, ticket);
|
|
1885
1895
|
order.push(ticket);
|
|
1886
1896
|
directory.set(ticket.index, ticket.id);
|
|
@@ -1914,10 +1924,8 @@ function createRegistry(options) {
|
|
|
1914
1924
|
delete input.index;
|
|
1915
1925
|
delete input.valueIsIndex;
|
|
1916
1926
|
delete input.unregister;
|
|
1917
|
-
if (ticket
|
|
1918
|
-
|
|
1919
|
-
delete input.value;
|
|
1920
|
-
}
|
|
1927
|
+
if (minted.has(ticket)) delete input.id;
|
|
1928
|
+
if (ticket.valueIsIndex) delete input.value;
|
|
1921
1929
|
return input;
|
|
1922
1930
|
}
|
|
1923
1931
|
function offboard(ids) {
|
|
@@ -1936,6 +1944,7 @@ function createRegistry(options) {
|
|
|
1936
1944
|
let w = 0;
|
|
1937
1945
|
for (const ticket of order) if (!removedIds.has(ticket.id)) order[w++] = ticket;
|
|
1938
1946
|
order.length = w;
|
|
1947
|
+
invalidate();
|
|
1939
1948
|
for (const ticket of removed) {
|
|
1940
1949
|
if (ticket.valueIsIndex) indexDependentCount--;
|
|
1941
1950
|
minDirtyIndex = Math.min(minDirtyIndex, ticket.index);
|
|
@@ -1944,7 +1953,8 @@ function createRegistry(options) {
|
|
|
1944
1953
|
unassign(ticket.value, ticket.id);
|
|
1945
1954
|
}
|
|
1946
1955
|
for (const ticket of removed) emit("unregister:ticket", ticket);
|
|
1947
|
-
|
|
1956
|
+
if (indexDependentCount > 0 && minDirtyIndex < collection.size) reindex();
|
|
1957
|
+
else needsReindex = true;
|
|
1948
1958
|
});
|
|
1949
1959
|
return removed.map((ticket) => toInput(ticket));
|
|
1950
1960
|
}
|
|
@@ -2183,6 +2193,8 @@ function createModel(_options = {}) {
|
|
|
2183
2193
|
}
|
|
2184
2194
|
function unselect(id) {
|
|
2185
2195
|
if (toValue(disabled)) return;
|
|
2196
|
+
const item = registry.get(id);
|
|
2197
|
+
if (!item || toValue(item.disabled)) return;
|
|
2186
2198
|
selectedIds.delete(id);
|
|
2187
2199
|
}
|
|
2188
2200
|
function toggle(id) {
|
|
@@ -2379,11 +2391,17 @@ function createSelection(_options = {}) {
|
|
|
2379
2391
|
const ticket = seek("first");
|
|
2380
2392
|
if (ticket) model.select(ticket.id);
|
|
2381
2393
|
}
|
|
2382
|
-
function
|
|
2394
|
+
function drain(id) {
|
|
2383
2395
|
if (toValue(model.disabled)) return;
|
|
2384
2396
|
if (toValue(mandatory) && model.selectedIds.size === 1) return;
|
|
2385
2397
|
model.selectedIds.delete(id);
|
|
2386
2398
|
}
|
|
2399
|
+
function unselect(id) {
|
|
2400
|
+
if (toValue(model.disabled)) return;
|
|
2401
|
+
const item = model.get(id);
|
|
2402
|
+
if (!item || toValue(item.disabled)) return;
|
|
2403
|
+
drain(id);
|
|
2404
|
+
}
|
|
2387
2405
|
function toggle(id) {
|
|
2388
2406
|
if (toValue(model.disabled)) return;
|
|
2389
2407
|
if (model.selectedIds.has(id)) unselect(id);
|
|
@@ -2393,22 +2411,28 @@ function createSelection(_options = {}) {
|
|
|
2393
2411
|
const isMultiple = options?.multiple ?? toValue(multiple);
|
|
2394
2412
|
const currentIds = new Set(model.selectedIds);
|
|
2395
2413
|
const targetIds = /* @__PURE__ */ new Set();
|
|
2396
|
-
for (const value of values) {
|
|
2397
|
-
const ids = model.browse(toRaw(value));
|
|
2398
|
-
if (ids) for (const id of ids) targetIds.add(id);
|
|
2399
|
-
}
|
|
2400
2414
|
if (isMultiple) {
|
|
2401
|
-
for (const
|
|
2402
|
-
|
|
2403
|
-
if (
|
|
2404
|
-
const
|
|
2405
|
-
|
|
2406
|
-
|
|
2415
|
+
for (const value of values) {
|
|
2416
|
+
const ids = model.browse(toRaw(value));
|
|
2417
|
+
if (/* @__PURE__ */ isUndefined(ids)) continue;
|
|
2418
|
+
for (const id of ids) {
|
|
2419
|
+
const ticket = model.get(id);
|
|
2420
|
+
if (!ticket || toValue(ticket.disabled)) continue;
|
|
2421
|
+
targetIds.add(id);
|
|
2422
|
+
}
|
|
2407
2423
|
}
|
|
2424
|
+
if (toValue(mandatory) && targetIds.size === 0) return;
|
|
2425
|
+
for (const id of currentIds) if (!targetIds.has(id)) model.selectedIds.delete(id);
|
|
2426
|
+
for (const id of targetIds) model.selectedIds.add(id);
|
|
2408
2427
|
} else {
|
|
2428
|
+
for (const value of values) {
|
|
2429
|
+
const ids = model.browse(toRaw(value));
|
|
2430
|
+
if (/* @__PURE__ */ isUndefined(ids)) continue;
|
|
2431
|
+
for (const id of ids) targetIds.add(id);
|
|
2432
|
+
}
|
|
2409
2433
|
const next = targetIds.values().next().value;
|
|
2410
2434
|
const last = currentIds.values().next().value;
|
|
2411
|
-
if (!/* @__PURE__ */ isUndefined(last))
|
|
2435
|
+
if (!/* @__PURE__ */ isUndefined(last)) drain(last);
|
|
2412
2436
|
if (!/* @__PURE__ */ isUndefined(next)) model.select(next);
|
|
2413
2437
|
}
|
|
2414
2438
|
}
|
|
@@ -2704,10 +2728,10 @@ function useSingle(namespace = "v0:single") {
|
|
|
2704
2728
|
* - Alias resolution with circular reference detection
|
|
2705
2729
|
* - Nested token flattening with dot notation
|
|
2706
2730
|
* - W3C Design Tokens format ($value, $type, $description, $extensions)
|
|
2707
|
-
* - Path-based resolution (e.g., {colors}.blue.500)
|
|
2708
|
-
* - Resolution caching for performance
|
|
2731
|
+
* - Path-based resolution (e.g., {colors.blue.500} or colors.blue.500)
|
|
2732
|
+
* - Resolution caching for performance
|
|
2709
2733
|
*
|
|
2710
|
-
* Used by useTheme, useLocale, and
|
|
2734
|
+
* Used by useTheme, useLocale, useFeatures, and usePermissions for token-based configuration.
|
|
2711
2735
|
*
|
|
2712
2736
|
* @example
|
|
2713
2737
|
* ```ts
|
|
@@ -2821,9 +2845,9 @@ function createTokens(tokens = {}, options = {}) {
|
|
|
2821
2845
|
cache.clear();
|
|
2822
2846
|
return _register(registration);
|
|
2823
2847
|
}
|
|
2824
|
-
function upsert(id, registration) {
|
|
2848
|
+
function upsert(id, registration, event) {
|
|
2825
2849
|
cache.clear();
|
|
2826
|
-
return _upsert(id, registration);
|
|
2850
|
+
return _upsert(id, registration, event);
|
|
2827
2851
|
}
|
|
2828
2852
|
function unregister(id) {
|
|
2829
2853
|
cache.clear();
|
|
@@ -6660,11 +6684,14 @@ function useProxyModel(context, model, options) {
|
|
|
6660
6684
|
return toValue(multiple) ? val : val[0];
|
|
6661
6685
|
}
|
|
6662
6686
|
const applyOptions = toValue(multiple) === toValue(context.multiple ?? false) ? void 0 : { multiple: toValue(multiple) };
|
|
6663
|
-
const
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6687
|
+
const pending = /* @__PURE__ */ new Set();
|
|
6688
|
+
function reconcile(values) {
|
|
6689
|
+
context.apply(values, applyOptions);
|
|
6690
|
+
const selected = new Set(context.selectedValues.value);
|
|
6691
|
+
pending.clear();
|
|
6692
|
+
for (const value of values) if (!selected.has(value)) pending.add(value);
|
|
6693
|
+
}
|
|
6694
|
+
reconcile(transformIn(model));
|
|
6668
6695
|
let syncing = false;
|
|
6669
6696
|
function shallowEqual(a, b) {
|
|
6670
6697
|
if (a === b) return true;
|
|
@@ -6673,15 +6700,17 @@ function useProxyModel(context, model, options) {
|
|
|
6673
6700
|
}
|
|
6674
6701
|
const contextWatch = watch(context.selectedValues, (val) => {
|
|
6675
6702
|
if (syncing) return;
|
|
6703
|
+
syncing = true;
|
|
6676
6704
|
modelWatch.pause();
|
|
6677
6705
|
model.value = transformOut(Array.from(toValue(val)));
|
|
6678
6706
|
modelWatch.resume();
|
|
6707
|
+
syncing = false;
|
|
6679
6708
|
}, { flush: "sync" });
|
|
6680
6709
|
const modelWatch = watch(model, (val) => {
|
|
6681
6710
|
if (syncing) return;
|
|
6682
6711
|
syncing = true;
|
|
6683
6712
|
contextWatch.pause();
|
|
6684
|
-
|
|
6713
|
+
reconcile(transformIn(val));
|
|
6685
6714
|
const actual = transformOut(Array.from(context.selectedValues.value));
|
|
6686
6715
|
if (!shallowEqual(val, actual)) model.value = actual;
|
|
6687
6716
|
contextWatch.resume();
|
|
@@ -10159,7 +10188,11 @@ function createCombobox(options = {}) {
|
|
|
10159
10188
|
function clear() {
|
|
10160
10189
|
query.value = "";
|
|
10161
10190
|
pristine.value = true;
|
|
10162
|
-
|
|
10191
|
+
if (toValue(disabled)) return;
|
|
10192
|
+
for (const id of Array.from(selection.selectedIds)) {
|
|
10193
|
+
if (toValue(mandatory) && selection.selectedIds.size === 1) break;
|
|
10194
|
+
selection.selectedIds.delete(id);
|
|
10195
|
+
}
|
|
10163
10196
|
}
|
|
10164
10197
|
watch(isOpen, (open) => {
|
|
10165
10198
|
if (!open) cursor.clear();
|
|
@@ -10682,6 +10715,7 @@ const _sfc_main$50 = /* @__PURE__ */ defineComponent({
|
|
|
10682
10715
|
},
|
|
10683
10716
|
setup(__props) {
|
|
10684
10717
|
const context = useComboboxContext(__props.namespace);
|
|
10718
|
+
const locale = useLocale();
|
|
10685
10719
|
const slotProps = toRef(() => ({ query: context.query.value }));
|
|
10686
10720
|
return (_ctx, _cache) => {
|
|
10687
10721
|
return unref(context).isEmpty.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
|
|
@@ -10689,7 +10723,7 @@ const _sfc_main$50 = /* @__PURE__ */ defineComponent({
|
|
|
10689
10723
|
as: __props.as,
|
|
10690
10724
|
renderless: __props.renderless
|
|
10691
10725
|
}, {
|
|
10692
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)), () => [
|
|
10726
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)), () => [createTextVNode(toDisplayString(unref(locale).ti("Combobox.noResults") ?? "No results"), 1)])]),
|
|
10693
10727
|
_: 3
|
|
10694
10728
|
}, 8, ["as", "renderless"])) : createCommentVNode("v-if", true);
|
|
10695
10729
|
};
|
|
@@ -12849,6 +12883,8 @@ function createValidation(_options = {}) {
|
|
|
12849
12883
|
const isValid = shallowRef(null);
|
|
12850
12884
|
const isValidating = shallowRef(false);
|
|
12851
12885
|
let generation = 0;
|
|
12886
|
+
let visible = 0;
|
|
12887
|
+
let latest;
|
|
12852
12888
|
function register(input) {
|
|
12853
12889
|
if (/* @__PURE__ */ isFunction(input) || /* @__PURE__ */ isString(input) || /* @__PURE__ */ isStandardSchema(input)) {
|
|
12854
12890
|
const resolved = rulesContext.resolve([input]);
|
|
@@ -12859,8 +12895,15 @@ function createValidation(_options = {}) {
|
|
|
12859
12895
|
function onboard(rules) {
|
|
12860
12896
|
return group.batch(() => rules.map((r) => register(r)));
|
|
12861
12897
|
}
|
|
12862
|
-
async function
|
|
12863
|
-
|
|
12898
|
+
async function wait() {
|
|
12899
|
+
while (true) {
|
|
12900
|
+
const current = latest;
|
|
12901
|
+
if (/* @__PURE__ */ isUndefined(current)) return false;
|
|
12902
|
+
const result = await current.promise;
|
|
12903
|
+
if (current.generation === generation) return result;
|
|
12904
|
+
}
|
|
12905
|
+
}
|
|
12906
|
+
async function run(gen, _value, silent) {
|
|
12864
12907
|
const val = _value === UNSET ? toValue(valueSource) : _value;
|
|
12865
12908
|
const activeRules = [];
|
|
12866
12909
|
for (const ticket of group.selectedItems.value) activeRules.push(ticket.value);
|
|
@@ -12875,7 +12918,7 @@ function createValidation(_options = {}) {
|
|
|
12875
12918
|
if (!silent) isValidating.value = true;
|
|
12876
12919
|
try {
|
|
12877
12920
|
const results = await Promise.all(activeRules.map((rule) => rule(val)));
|
|
12878
|
-
if (gen !== generation) return
|
|
12921
|
+
if (gen !== generation) return wait();
|
|
12879
12922
|
const errorMessages = results.filter((result) => /* @__PURE__ */ isString(result) || result === false).map((result) => result === false ? "Validation failed" : result);
|
|
12880
12923
|
if (!silent) {
|
|
12881
12924
|
errors.value = errorMessages;
|
|
@@ -12883,21 +12926,32 @@ function createValidation(_options = {}) {
|
|
|
12883
12926
|
}
|
|
12884
12927
|
return errorMessages.length === 0;
|
|
12885
12928
|
} catch (error) {
|
|
12886
|
-
if (gen !== generation) return
|
|
12929
|
+
if (gen !== generation) return wait();
|
|
12887
12930
|
if (!silent) {
|
|
12888
12931
|
errors.value = [error instanceof Error ? error.message : "Validation error"];
|
|
12889
12932
|
isValid.value = false;
|
|
12890
12933
|
}
|
|
12891
12934
|
return false;
|
|
12892
12935
|
} finally {
|
|
12893
|
-
if (gen ===
|
|
12936
|
+
if (!silent && gen === visible) isValidating.value = false;
|
|
12894
12937
|
}
|
|
12895
12938
|
}
|
|
12939
|
+
async function validate(_value = UNSET, silent = false) {
|
|
12940
|
+
const gen = ++generation;
|
|
12941
|
+
if (!silent) visible = gen;
|
|
12942
|
+
const promise = run(gen, _value, silent);
|
|
12943
|
+
latest = {
|
|
12944
|
+
generation: gen,
|
|
12945
|
+
promise
|
|
12946
|
+
};
|
|
12947
|
+
return promise;
|
|
12948
|
+
}
|
|
12896
12949
|
function reset() {
|
|
12897
12950
|
errors.value = [];
|
|
12898
12951
|
isValid.value = null;
|
|
12899
12952
|
isValidating.value = false;
|
|
12900
12953
|
generation++;
|
|
12954
|
+
latest = void 0;
|
|
12901
12955
|
}
|
|
12902
12956
|
if (initialRules.length > 0) onboard(initialRules);
|
|
12903
12957
|
const context = {
|
|
@@ -13679,6 +13733,7 @@ function createNumberField(options = {}) {
|
|
|
13679
13733
|
return Number.isNaN(result) ? null : result;
|
|
13680
13734
|
}
|
|
13681
13735
|
function commit(next) {
|
|
13736
|
+
if (isLocked()) return;
|
|
13682
13737
|
const val = arguments.length === 0 ? value.value : next;
|
|
13683
13738
|
if (/* @__PURE__ */ isNull(val)) return;
|
|
13684
13739
|
if (!shouldClamp && (val < numeric.min || val > numeric.max)) {
|
|
@@ -16323,7 +16378,7 @@ function createProgress(options = {}) {
|
|
|
16323
16378
|
});
|
|
16324
16379
|
function fromValue(value) {
|
|
16325
16380
|
if (extent === 0) return 0;
|
|
16326
|
-
return /* @__PURE__ */ clamp(value,
|
|
16381
|
+
return (/* @__PURE__ */ clamp(value, min, max) - min) / extent * 100;
|
|
16327
16382
|
}
|
|
16328
16383
|
function register(registration = {}) {
|
|
16329
16384
|
const index = segments.value.length;
|
|
@@ -18912,7 +18967,7 @@ function createSlider(options = {}) {
|
|
|
18912
18967
|
}
|
|
18913
18968
|
}
|
|
18914
18969
|
function set(index, value) {
|
|
18915
|
-
if (readonly.value) return;
|
|
18970
|
+
if (disabled.value || readonly.value) return;
|
|
18916
18971
|
const snapped = snap(value);
|
|
18917
18972
|
const current = values.value;
|
|
18918
18973
|
let constrained = snapped;
|
|
@@ -21763,15 +21818,11 @@ const _sfc_main$146 = /* @__PURE__ */ defineComponent({
|
|
|
21763
21818
|
const root = useSwitchRoot(__props.namespace);
|
|
21764
21819
|
const isChecked = toRef(() => toValue(root.isChecked));
|
|
21765
21820
|
const isMixed = toRef(() => toValue(root.isMixed));
|
|
21766
|
-
const isVisible = toRef(() => isChecked.value || isMixed.value);
|
|
21767
21821
|
const dataState = toRef(() => isMixed.value ? "indeterminate" : isChecked.value ? "checked" : "unchecked");
|
|
21768
21822
|
const slotProps = toRef(() => ({
|
|
21769
21823
|
isChecked: isChecked.value,
|
|
21770
21824
|
isMixed: isMixed.value,
|
|
21771
|
-
attrs: {
|
|
21772
|
-
"data-state": dataState.value,
|
|
21773
|
-
"style": { visibility: isVisible.value ? "visible" : "hidden" }
|
|
21774
|
-
}
|
|
21825
|
+
attrs: { "data-state": dataState.value }
|
|
21775
21826
|
}));
|
|
21776
21827
|
return (_ctx, _cache) => {
|
|
21777
21828
|
return openBlock(), createBlock(unref(_sfc_main$9), mergeProps(slotProps.value.attrs, {
|
|
@@ -21972,10 +22023,10 @@ const Switch = {
|
|
|
21972
22023
|
*/
|
|
21973
22024
|
SelectAll: _sfc_main$145,
|
|
21974
22025
|
/**
|
|
21975
|
-
* Sliding knob
|
|
22026
|
+
* Sliding knob for switches.
|
|
21976
22027
|
*
|
|
21977
|
-
* Renders as a span with `data-state` attribute for CSS styling.
|
|
21978
|
-
*
|
|
22028
|
+
* Renders as a span with a `data-state` attribute for CSS styling.
|
|
22029
|
+
* Always visible; drive its off/on position and color from `data-state`.
|
|
21979
22030
|
* Must be used within a Switch.Root or Switch.SelectAll.
|
|
21980
22031
|
*
|
|
21981
22032
|
* @see https://0.vuetifyjs.com/components/forms/switch
|
|
@@ -23517,7 +23568,6 @@ function createNested(_options = {}) {
|
|
|
23517
23568
|
function open(ids) {
|
|
23518
23569
|
if (toValue(group.disabled)) return;
|
|
23519
23570
|
for (const id of /* @__PURE__ */ toArray(ids)) {
|
|
23520
|
-
if (!group.has(id)) continue;
|
|
23521
23571
|
const item = group.get(id);
|
|
23522
23572
|
if (!item || toValue(item.disabled)) continue;
|
|
23523
23573
|
openedIds.add(id);
|
|
@@ -23542,7 +23592,6 @@ function createNested(_options = {}) {
|
|
|
23542
23592
|
function close(ids) {
|
|
23543
23593
|
if (toValue(group.disabled)) return;
|
|
23544
23594
|
for (const id of /* @__PURE__ */ toArray(ids)) {
|
|
23545
|
-
if (!group.has(id)) continue;
|
|
23546
23595
|
const item = group.get(id);
|
|
23547
23596
|
if (!item || toValue(item.disabled)) continue;
|
|
23548
23597
|
openedIds.delete(id);
|
|
@@ -23551,7 +23600,6 @@ function createNested(_options = {}) {
|
|
|
23551
23600
|
function flip(ids) {
|
|
23552
23601
|
if (toValue(group.disabled)) return;
|
|
23553
23602
|
for (const id of /* @__PURE__ */ toArray(ids)) {
|
|
23554
|
-
if (!group.has(id)) continue;
|
|
23555
23603
|
const item = group.get(id);
|
|
23556
23604
|
if (!item || toValue(item.disabled)) continue;
|
|
23557
23605
|
if (opened(id)) close(id);
|
|
@@ -23779,75 +23827,81 @@ function createNested(_options = {}) {
|
|
|
23779
23827
|
function getLeafDescendants(id) {
|
|
23780
23828
|
return getDescendants(id).filter((did) => isLeaf(did));
|
|
23781
23829
|
}
|
|
23830
|
+
function removeLeaves(leafIds) {
|
|
23831
|
+
const { selectedIds, mixedIds } = group;
|
|
23832
|
+
const ids = new Set(leafIds);
|
|
23833
|
+
if (toValue(mandatoryOption) && [...selectedIds].every((id) => ids.has(id))) return;
|
|
23834
|
+
for (const id of ids) {
|
|
23835
|
+
mixedIds.delete(id);
|
|
23836
|
+
selectedIds.delete(id);
|
|
23837
|
+
}
|
|
23838
|
+
for (const id of ids) updateAncestors(id);
|
|
23839
|
+
}
|
|
23782
23840
|
function select(ids) {
|
|
23783
23841
|
if (toValue(group.disabled)) return;
|
|
23784
|
-
for (const id of /* @__PURE__ */ toArray(ids))
|
|
23785
|
-
|
|
23842
|
+
for (const id of /* @__PURE__ */ toArray(ids)) if (selectionMode === "independent") group.select(id);
|
|
23843
|
+
else if (selectionMode === "leaf") if (isLeaf(id)) group.select(id);
|
|
23844
|
+
else {
|
|
23786
23845
|
const item = group.get(id);
|
|
23787
23846
|
if (!item || toValue(item.disabled)) continue;
|
|
23788
|
-
|
|
23789
|
-
|
|
23790
|
-
|
|
23791
|
-
|
|
23792
|
-
|
|
23793
|
-
|
|
23794
|
-
|
|
23795
|
-
|
|
23796
|
-
const { selectedIds, mixedIds } = group;
|
|
23797
|
-
mixedIds.delete(id);
|
|
23798
|
-
selectedIds.add(id);
|
|
23799
|
-
for (const did of getDescendants(id)) {
|
|
23800
|
-
const desc = group.get(did);
|
|
23801
|
-
if (desc && toValue(desc.disabled)) continue;
|
|
23802
|
-
mixedIds.delete(did);
|
|
23803
|
-
selectedIds.add(did);
|
|
23804
|
-
}
|
|
23805
|
-
updateAncestors(id);
|
|
23847
|
+
for (const lid of getLeafDescendants(id)) group.select(lid);
|
|
23848
|
+
}
|
|
23849
|
+
else {
|
|
23850
|
+
const item = group.get(id);
|
|
23851
|
+
if (!item || toValue(item.disabled)) continue;
|
|
23852
|
+
if (!toValue(multipleOption)) {
|
|
23853
|
+
group.select(id);
|
|
23854
|
+
return;
|
|
23806
23855
|
}
|
|
23856
|
+
const { selectedIds, mixedIds } = group;
|
|
23857
|
+
mixedIds.delete(id);
|
|
23858
|
+
selectedIds.add(id);
|
|
23859
|
+
for (const did of getDescendants(id)) {
|
|
23860
|
+
const desc = group.get(did);
|
|
23861
|
+
if (desc && toValue(desc.disabled)) continue;
|
|
23862
|
+
mixedIds.delete(did);
|
|
23863
|
+
selectedIds.add(did);
|
|
23864
|
+
}
|
|
23865
|
+
updateAncestors(id);
|
|
23807
23866
|
}
|
|
23808
23867
|
}
|
|
23809
23868
|
function unselect(ids) {
|
|
23810
23869
|
if (toValue(group.disabled)) return;
|
|
23811
|
-
for (const id of /* @__PURE__ */ toArray(ids))
|
|
23812
|
-
|
|
23870
|
+
for (const id of /* @__PURE__ */ toArray(ids)) if (selectionMode === "independent") group.unselect(id);
|
|
23871
|
+
else if (selectionMode === "leaf") {
|
|
23813
23872
|
const item = group.get(id);
|
|
23814
23873
|
if (!item || toValue(item.disabled)) continue;
|
|
23815
|
-
|
|
23816
|
-
|
|
23817
|
-
|
|
23818
|
-
|
|
23819
|
-
|
|
23820
|
-
|
|
23821
|
-
|
|
23822
|
-
|
|
23823
|
-
|
|
23824
|
-
|
|
23825
|
-
|
|
23826
|
-
|
|
23827
|
-
|
|
23828
|
-
|
|
23829
|
-
mixedIds.delete(did);
|
|
23830
|
-
selectedIds.delete(did);
|
|
23831
|
-
}
|
|
23832
|
-
updateAncestors(id);
|
|
23874
|
+
removeLeaves(isLeaf(id) ? [id] : getLeafDescendants(id));
|
|
23875
|
+
} else {
|
|
23876
|
+
const item = group.get(id);
|
|
23877
|
+
if (!item || toValue(item.disabled)) continue;
|
|
23878
|
+
const { selectedIds, mixedIds } = group;
|
|
23879
|
+
if (toValue(mandatoryOption)) {
|
|
23880
|
+
const toRemove = new Set([id, ...getDescendants(id)]);
|
|
23881
|
+
if ([...selectedIds].every((sid) => toRemove.has(sid))) return;
|
|
23882
|
+
}
|
|
23883
|
+
mixedIds.delete(id);
|
|
23884
|
+
selectedIds.delete(id);
|
|
23885
|
+
for (const did of getDescendants(id)) {
|
|
23886
|
+
mixedIds.delete(did);
|
|
23887
|
+
selectedIds.delete(did);
|
|
23833
23888
|
}
|
|
23889
|
+
updateAncestors(id);
|
|
23834
23890
|
}
|
|
23835
23891
|
}
|
|
23836
23892
|
function toggle(ids) {
|
|
23837
23893
|
if (toValue(group.disabled)) return;
|
|
23838
|
-
for (const id of /* @__PURE__ */ toArray(ids))
|
|
23894
|
+
for (const id of /* @__PURE__ */ toArray(ids)) if (selectionMode === "independent") group.toggle(id);
|
|
23895
|
+
else if (selectionMode === "leaf") if (isLeaf(id)) group.toggle(id);
|
|
23896
|
+
else {
|
|
23839
23897
|
const item = group.get(id);
|
|
23840
23898
|
if (!item || toValue(item.disabled)) continue;
|
|
23841
|
-
|
|
23842
|
-
|
|
23843
|
-
else
|
|
23844
|
-
const leafIds = getLeafDescendants(id);
|
|
23845
|
-
if (leafIds.every((lid) => group.selected(lid))) for (const lid of leafIds) group.unselect(lid);
|
|
23846
|
-
else for (const lid of leafIds) group.select(lid);
|
|
23847
|
-
}
|
|
23848
|
-
else if (group.selected(id) || group.mixed(id)) unselect(id);
|
|
23849
|
-
else select(id);
|
|
23899
|
+
const leafIds = getLeafDescendants(id);
|
|
23900
|
+
if (leafIds.every((lid) => group.selected(lid))) removeLeaves(leafIds);
|
|
23901
|
+
else for (const lid of leafIds) group.select(lid);
|
|
23850
23902
|
}
|
|
23903
|
+
else if (group.selected(id) || group.mixed(id)) unselect(id);
|
|
23904
|
+
else select(id);
|
|
23851
23905
|
}
|
|
23852
23906
|
function selectAll() {
|
|
23853
23907
|
if (toValue(group.disabled)) return;
|
|
@@ -26454,7 +26508,8 @@ function createRowSpanning(options) {
|
|
|
26454
26508
|
function createDataGrid(_options = {}) {
|
|
26455
26509
|
const { editing: editingOptions, preserveRowOrder = false, rowSpanning, ...options } = _options;
|
|
26456
26510
|
const table = createDataTable(options);
|
|
26457
|
-
const sortable = createSortable(
|
|
26511
|
+
const sortable = createSortable();
|
|
26512
|
+
const sortableProxy = useProxyRegistry(sortable);
|
|
26458
26513
|
const dirty = shallowRef(false);
|
|
26459
26514
|
table.on("register:ticket", (ticket) => {
|
|
26460
26515
|
sortable.register({
|
|
@@ -26469,7 +26524,7 @@ function createDataGrid(_options = {}) {
|
|
|
26469
26524
|
sortable.clear();
|
|
26470
26525
|
dirty.value = false;
|
|
26471
26526
|
});
|
|
26472
|
-
const order = toRef(() =>
|
|
26527
|
+
const order = toRef(() => sortableProxy.keys);
|
|
26473
26528
|
const sortedIds = computed(() => {
|
|
26474
26529
|
const buckets = /* @__PURE__ */ new Map();
|
|
26475
26530
|
for (const ticket of table.values()) {
|
|
@@ -26496,6 +26551,7 @@ function createDataGrid(_options = {}) {
|
|
|
26496
26551
|
dirty.value = true;
|
|
26497
26552
|
}
|
|
26498
26553
|
function reset() {
|
|
26554
|
+
if (!dirty.value) return;
|
|
26499
26555
|
if (sortable.size > 0) sortable.reorder(table.keys());
|
|
26500
26556
|
dirty.value = false;
|
|
26501
26557
|
}
|
|
@@ -29112,7 +29168,7 @@ function createFeatures(_options = {}) {
|
|
|
29112
29168
|
const shouldSelect = /* @__PURE__ */ isBoolean(value) ? value === true : /* @__PURE__ */ isObject(value) && /* @__PURE__ */ isBoolean(value.$value) && value.$value === true;
|
|
29113
29169
|
registry.upsert(id, { value });
|
|
29114
29170
|
if (shouldSelect) registry.select(id);
|
|
29115
|
-
else registry.
|
|
29171
|
+
else registry.selectedIds.delete(id);
|
|
29116
29172
|
} else register({
|
|
29117
29173
|
id,
|
|
29118
29174
|
value
|