@vuetify/v0 1.0.0-rc.6 → 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/README.md +2 -15
- package/dist/{adapter-BI-oyZCe.d.mts → adapter-CVNRHfrz.d.mts} +1 -1
- package/dist/{adapter-CJY6aQIS.mjs → adapter-lS_VpRow.mjs} +1 -1
- package/dist/browser/index.d.ts +47 -45
- package/dist/browser/index.js +207 -131
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/{components-aNG-L8hk.mjs → components-Cl9fclA1.mjs} +17 -20
- package/dist/composables/index.d.mts +6 -6
- package/dist/composables/index.mjs +22 -22
- package/dist/{composables-BQaa5hFV.mjs → composables-CU2JD9oM.mjs} +15 -13
- package/dist/constants/index.mjs +1 -1
- package/dist/{createDataTable-CG6BWB_u.mjs → createDataTable-BaYtcmAO.mjs} +3 -3
- package/dist/{createGroup-BlILHkT6.mjs → createGroup-5UjYS6_G.mjs} +1 -1
- package/dist/{createRegistry-DR7aTCxG.mjs → createRegistry-C_M475FE.mjs} +40 -29
- package/dist/{createSelection-sPv1j6DV.mjs → createSelection-BokWvmnd.mjs} +30 -14
- package/dist/{createSingle-BWN73zob.mjs → createSingle-DTqmo-GH.mjs} +1 -1
- package/dist/{createTokens-DqtwpqYn.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/flagsmith/index.mjs +2 -1
- package/dist/features/adapters/launchdarkly/index.mjs +8 -5
- package/dist/features/adapters/posthog/index.mjs +3 -2
- package/dist/features/index.d.mts +1 -1
- package/dist/features/index.mjs +1 -1
- package/dist/{globals-DhDj6Ko1.mjs → globals-C0tKiM_M.mjs} +1 -1
- package/dist/{index-CV7bOS7B.d.mts → index-BwNRi6BK.d.mts} +19 -17
- package/dist/{index-CfHm03dg.d.mts → index-CrFFilCd.d.mts} +2 -2
- package/dist/{index-DgPFPx_7.d.mts → index-DCtHbY0a.d.mts} +1 -1
- package/dist/{index-DF1gnhPy.d.mts → index-DOjheBVl.d.mts} +6 -9
- package/dist/{index-pM8UX1XI.d.mts → index-RGiSdjYt.d.mts} +10 -9
- package/dist/{index-BBJnOUyA.d.mts → index-u0Sy6Dif.d.mts} +2 -0
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +24 -24
- 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 +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/{unhead-Cw_jAvJL.mjs → unhead-BXJ8cqN-.mjs} +2 -2
- package/dist/{useEventListener--vhbyU45.mjs → useEventListener-UJ8VS4eS.mjs} +1 -1
- package/dist/{useFeatures-DjGN0KJd.mjs → useFeatures-Cn-HGB7v.mjs} +4 -4
- package/dist/{useLocale-C7I4BsIS.mjs → useLocale-BFKJosku.mjs} +8 -5
- package/dist/{useLogger-DCvIu_Mj.mjs → useLogger-DGG3fsnB.mjs} +2 -2
- package/dist/{useNotifications-Ckm0MqnJ.mjs → useNotifications-DO10ylRQ.mjs} +3 -3
- package/dist/{usePermissions-ygx2OSjo.mjs → usePermissions-BC-ppxf2.mjs} +2 -2
- package/dist/{useRovingFocus-dH3LTiJ8.mjs → useRovingFocus-BWww4Lm1.mjs} +109 -76
- package/dist/{useRules-DlnpIwp8.mjs → useRules-CMDEY2-D.mjs} +2 -2
- package/dist/{useStorage-D_enJrep.mjs → useStorage-BkutRChm.mjs} +3 -3
- package/dist/{useTheme-DdmexROE.mjs → useTheme-CJ5fgT5y.mjs} +6 -6
- package/dist/utilities/index.d.mts +1 -1
- package/dist/utilities/index.mjs +19 -4
- package/dist/{v0-Cf5DZ4lw.d.mts → v0-C0OfckSF.d.mts} +1 -1
- package/dist/{v0-BbCNqIZ1.mjs → v0-DUvaNE4R.mjs} +1 -1
- package/dist/{v0-DFRA_hwF.mjs → v0-M7azful7.mjs} +1 -1
- package/dist/{v0-QF9ZrOlB.mjs → v0-sTRNcP5u.mjs} +2 -2
- 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
|
|
@@ -502,6 +502,8 @@ let idCounter = 0;
|
|
|
502
502
|
* - In component setup/lifecycle: Uses Vue's `useId()` for SSR-safe hydration
|
|
503
503
|
* - Outside components: Falls back to sequential counter (`v0-0`, `v0-1`, ...)
|
|
504
504
|
* - Vapor mode compatible
|
|
505
|
+
* - IDs are sequential and predictable — intended for DOM `id`/ARIA wiring only.
|
|
506
|
+
* Never use them as security tokens (CSRF tokens, session ids, capabilities).
|
|
505
507
|
*
|
|
506
508
|
* @example
|
|
507
509
|
* ```ts
|
|
@@ -564,7 +566,12 @@ function range(length, start = 0) {
|
|
|
564
566
|
*/
|
|
565
567
|
/* @__NO_SIDE_EFFECTS__ */
|
|
566
568
|
function resolveIds(ids, getter) {
|
|
567
|
-
|
|
569
|
+
const result = [];
|
|
570
|
+
for (const id of ids) {
|
|
571
|
+
const item = getter(id);
|
|
572
|
+
if (!/* @__PURE__ */ isUndefined(item)) result.push(item);
|
|
573
|
+
}
|
|
574
|
+
return result;
|
|
568
575
|
}
|
|
569
576
|
/**
|
|
570
577
|
* Extracts defined index values from an iterable of items.
|
|
@@ -573,7 +580,12 @@ function resolveIds(ids, getter) {
|
|
|
573
580
|
*/
|
|
574
581
|
/* @__NO_SIDE_EFFECTS__ */
|
|
575
582
|
function resolveIndexes(items) {
|
|
576
|
-
|
|
583
|
+
const result = [];
|
|
584
|
+
for (const item of items) {
|
|
585
|
+
const index = item?.index;
|
|
586
|
+
if (!/* @__PURE__ */ isUndefined(index)) result.push(index);
|
|
587
|
+
}
|
|
588
|
+
return result;
|
|
577
589
|
}
|
|
578
590
|
//#endregion
|
|
579
591
|
//#region src/utilities/errors.ts
|
|
@@ -654,7 +666,10 @@ var V0Error = class extends Error {
|
|
|
654
666
|
const { cause, ...rest } = details;
|
|
655
667
|
super(message, /* @__PURE__ */ isUndefined(cause) ? void 0 : { cause });
|
|
656
668
|
this.code = details.code;
|
|
657
|
-
Object.
|
|
669
|
+
for (const [key, value] of Object.entries(rest)) {
|
|
670
|
+
if (UNSAFE_KEYS.has(key)) continue;
|
|
671
|
+
this[key] = value;
|
|
672
|
+
}
|
|
658
673
|
}
|
|
659
674
|
};
|
|
660
675
|
/**
|
|
@@ -1651,12 +1666,15 @@ function createRegistry(options) {
|
|
|
1651
1666
|
const directory = /* @__PURE__ */ new Map();
|
|
1652
1667
|
const cache = /* @__PURE__ */ new Map();
|
|
1653
1668
|
const listeners = /* @__PURE__ */ new Map();
|
|
1654
|
-
const
|
|
1669
|
+
const minted = /* @__PURE__ */ new WeakSet();
|
|
1670
|
+
const order = [];
|
|
1671
|
+
const version = shallowRef(0);
|
|
1655
1672
|
let indexDependentCount = 0;
|
|
1656
1673
|
let needsReindex = false;
|
|
1657
1674
|
let minDirtyIndex = Infinity;
|
|
1658
1675
|
let maxDirtyIndex = -Infinity;
|
|
1659
1676
|
let isBatching = false;
|
|
1677
|
+
let structural = false;
|
|
1660
1678
|
let batched = [];
|
|
1661
1679
|
function dispatch(event, data) {
|
|
1662
1680
|
const cbs = listeners.get(event);
|
|
@@ -1728,7 +1746,7 @@ function createRegistry(options) {
|
|
|
1728
1746
|
valueIsIndex
|
|
1729
1747
|
});
|
|
1730
1748
|
collection.set(id, existing);
|
|
1731
|
-
|
|
1749
|
+
cache.clear();
|
|
1732
1750
|
emit("update:ticket", existing);
|
|
1733
1751
|
if (event) emit(event, existing);
|
|
1734
1752
|
return existing;
|
|
@@ -1759,7 +1777,7 @@ function createRegistry(options) {
|
|
|
1759
1777
|
else catalog.set(value, next);
|
|
1760
1778
|
}
|
|
1761
1779
|
function keys() {
|
|
1762
|
-
if (reactive)
|
|
1780
|
+
if (reactive) version.value;
|
|
1763
1781
|
const cached = cache.get("keys");
|
|
1764
1782
|
if (!/* @__PURE__ */ isUndefined(cached)) return cached;
|
|
1765
1783
|
const out = order.map((ticket) => ticket.id);
|
|
@@ -1767,7 +1785,7 @@ function createRegistry(options) {
|
|
|
1767
1785
|
return out;
|
|
1768
1786
|
}
|
|
1769
1787
|
function values() {
|
|
1770
|
-
if (reactive)
|
|
1788
|
+
if (reactive) version.value;
|
|
1771
1789
|
const cached = cache.get("values");
|
|
1772
1790
|
if (!/* @__PURE__ */ isUndefined(cached)) return cached;
|
|
1773
1791
|
const out = order.slice();
|
|
@@ -1775,7 +1793,7 @@ function createRegistry(options) {
|
|
|
1775
1793
|
return out;
|
|
1776
1794
|
}
|
|
1777
1795
|
function entries() {
|
|
1778
|
-
if (reactive)
|
|
1796
|
+
if (reactive) version.value;
|
|
1779
1797
|
const cached = cache.get("entries");
|
|
1780
1798
|
if (!/* @__PURE__ */ isUndefined(cached)) return cached;
|
|
1781
1799
|
const out = order.map((ticket) => [ticket.id, ticket]);
|
|
@@ -1795,22 +1813,30 @@ function createRegistry(options) {
|
|
|
1795
1813
|
emit("clear:registry");
|
|
1796
1814
|
}
|
|
1797
1815
|
function invalidate() {
|
|
1798
|
-
if (isBatching) return;
|
|
1799
1816
|
cache.clear();
|
|
1817
|
+
if (isBatching) {
|
|
1818
|
+
structural = true;
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
version.value++;
|
|
1800
1822
|
}
|
|
1801
1823
|
function batch(fn) {
|
|
1802
1824
|
if (isBatching) return fn();
|
|
1803
1825
|
isBatching = true;
|
|
1826
|
+
structural = false;
|
|
1804
1827
|
batched = [];
|
|
1805
1828
|
try {
|
|
1806
|
-
|
|
1807
|
-
cache.clear();
|
|
1808
|
-
for (const { event, data } of batched) dispatch(event, data);
|
|
1809
|
-
return result;
|
|
1829
|
+
return fn();
|
|
1810
1830
|
} finally {
|
|
1811
1831
|
isBatching = false;
|
|
1832
|
+
const queue = batched;
|
|
1812
1833
|
batched = [];
|
|
1813
1834
|
cache.clear();
|
|
1835
|
+
try {
|
|
1836
|
+
for (const { event, data } of queue) dispatch(event, data);
|
|
1837
|
+
} finally {
|
|
1838
|
+
if (structural) version.value++;
|
|
1839
|
+
}
|
|
1814
1840
|
}
|
|
1815
1841
|
}
|
|
1816
1842
|
function reindex() {
|
|
@@ -1844,6 +1870,7 @@ function createRegistry(options) {
|
|
|
1844
1870
|
function register(registration = {}) {
|
|
1845
1871
|
if (needsReindex) reindex();
|
|
1846
1872
|
const size = collection.size;
|
|
1873
|
+
const auto = /* @__PURE__ */ isNullOrUndefined(registration.id);
|
|
1847
1874
|
const id = registration.id ?? /* @__PURE__ */ useId();
|
|
1848
1875
|
if (has(id)) {
|
|
1849
1876
|
logger.warn(`Ticket "${id}" already exists. Use \`upsert()\` to update or check \`has()\` before registering.`);
|
|
@@ -1863,6 +1890,7 @@ function createRegistry(options) {
|
|
|
1863
1890
|
unregister: () => unregister(id)
|
|
1864
1891
|
};
|
|
1865
1892
|
const ticket = reactive ? shallowReactive(input) : input;
|
|
1893
|
+
if (auto) minted.add(ticket);
|
|
1866
1894
|
collection.set(ticket.id, ticket);
|
|
1867
1895
|
order.push(ticket);
|
|
1868
1896
|
directory.set(ticket.index, ticket.id);
|
|
@@ -1875,7 +1903,8 @@ function createRegistry(options) {
|
|
|
1875
1903
|
const ticket = collection.get(id);
|
|
1876
1904
|
if (!ticket) return;
|
|
1877
1905
|
if (ticket.valueIsIndex) indexDependentCount--;
|
|
1878
|
-
|
|
1906
|
+
let orderPos = ticket.index;
|
|
1907
|
+
if (order[orderPos] !== ticket) orderPos = order.indexOf(ticket);
|
|
1879
1908
|
if (orderPos !== -1) order.splice(orderPos, 1);
|
|
1880
1909
|
collection.delete(ticket.id);
|
|
1881
1910
|
directory.delete(ticket.index);
|
|
@@ -1895,10 +1924,8 @@ function createRegistry(options) {
|
|
|
1895
1924
|
delete input.index;
|
|
1896
1925
|
delete input.valueIsIndex;
|
|
1897
1926
|
delete input.unregister;
|
|
1898
|
-
if (ticket
|
|
1899
|
-
|
|
1900
|
-
delete input.value;
|
|
1901
|
-
}
|
|
1927
|
+
if (minted.has(ticket)) delete input.id;
|
|
1928
|
+
if (ticket.valueIsIndex) delete input.value;
|
|
1902
1929
|
return input;
|
|
1903
1930
|
}
|
|
1904
1931
|
function offboard(ids) {
|
|
@@ -1917,6 +1944,7 @@ function createRegistry(options) {
|
|
|
1917
1944
|
let w = 0;
|
|
1918
1945
|
for (const ticket of order) if (!removedIds.has(ticket.id)) order[w++] = ticket;
|
|
1919
1946
|
order.length = w;
|
|
1947
|
+
invalidate();
|
|
1920
1948
|
for (const ticket of removed) {
|
|
1921
1949
|
if (ticket.valueIsIndex) indexDependentCount--;
|
|
1922
1950
|
minDirtyIndex = Math.min(minDirtyIndex, ticket.index);
|
|
@@ -1925,7 +1953,8 @@ function createRegistry(options) {
|
|
|
1925
1953
|
unassign(ticket.value, ticket.id);
|
|
1926
1954
|
}
|
|
1927
1955
|
for (const ticket of removed) emit("unregister:ticket", ticket);
|
|
1928
|
-
|
|
1956
|
+
if (indexDependentCount > 0 && minDirtyIndex < collection.size) reindex();
|
|
1957
|
+
else needsReindex = true;
|
|
1929
1958
|
});
|
|
1930
1959
|
return removed.map((ticket) => toInput(ticket));
|
|
1931
1960
|
}
|
|
@@ -1969,22 +1998,19 @@ function createRegistry(options) {
|
|
|
1969
1998
|
function seek(direction = "first", from, predicate) {
|
|
1970
1999
|
if (collection.size === 0) return void 0;
|
|
1971
2000
|
if (needsReindex) reindex();
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
}
|
|
1976
|
-
const tickets = values();
|
|
1977
|
-
const index = /* @__PURE__ */ isUndefined(from) ? void 0 : /* @__PURE__ */ clamp(from, 0, tickets.length - 1);
|
|
2001
|
+
const n = order.length;
|
|
2002
|
+
if (!predicate && /* @__PURE__ */ isUndefined(from)) return direction === "first" ? order[0] : order.at(-1);
|
|
2003
|
+
const index = /* @__PURE__ */ isUndefined(from) ? void 0 : /* @__PURE__ */ clamp(from, 0, n - 1);
|
|
1978
2004
|
if (direction === "last") {
|
|
1979
|
-
const start = /* @__PURE__ */ isUndefined(index) ?
|
|
2005
|
+
const start = /* @__PURE__ */ isUndefined(index) ? n - 1 : index;
|
|
1980
2006
|
for (let i = start; i >= 0; i--) {
|
|
1981
|
-
const ticket =
|
|
2007
|
+
const ticket = order[i];
|
|
1982
2008
|
if (!predicate || predicate(ticket)) return ticket;
|
|
1983
2009
|
}
|
|
1984
2010
|
} else {
|
|
1985
2011
|
const start = /* @__PURE__ */ isUndefined(index) ? 0 : index;
|
|
1986
|
-
for (let i = start; i <
|
|
1987
|
-
const ticket =
|
|
2012
|
+
for (let i = start; i < n; i++) {
|
|
2013
|
+
const ticket = order[i];
|
|
1988
2014
|
if (!predicate || predicate(ticket)) return ticket;
|
|
1989
2015
|
}
|
|
1990
2016
|
}
|
|
@@ -2154,7 +2180,9 @@ function createModel(_options = {}) {
|
|
|
2154
2180
|
const selectedIds = shallowReactive(/* @__PURE__ */ new Set());
|
|
2155
2181
|
const selectedItems = computed(() => new Set(/* @__PURE__ */ resolveIds(selectedIds, registry.get)));
|
|
2156
2182
|
const selectedValues = computed(() => {
|
|
2157
|
-
|
|
2183
|
+
const out = /* @__PURE__ */ new Set();
|
|
2184
|
+
for (const item of selectedItems.value) out.add(toValue(item.value));
|
|
2185
|
+
return out;
|
|
2158
2186
|
});
|
|
2159
2187
|
function select(id) {
|
|
2160
2188
|
if (toValue(disabled)) return;
|
|
@@ -2165,6 +2193,8 @@ function createModel(_options = {}) {
|
|
|
2165
2193
|
}
|
|
2166
2194
|
function unselect(id) {
|
|
2167
2195
|
if (toValue(disabled)) return;
|
|
2196
|
+
const item = registry.get(id);
|
|
2197
|
+
if (!item || toValue(item.disabled)) return;
|
|
2168
2198
|
selectedIds.delete(id);
|
|
2169
2199
|
}
|
|
2170
2200
|
function toggle(id) {
|
|
@@ -2361,11 +2391,17 @@ function createSelection(_options = {}) {
|
|
|
2361
2391
|
const ticket = seek("first");
|
|
2362
2392
|
if (ticket) model.select(ticket.id);
|
|
2363
2393
|
}
|
|
2364
|
-
function
|
|
2394
|
+
function drain(id) {
|
|
2365
2395
|
if (toValue(model.disabled)) return;
|
|
2366
2396
|
if (toValue(mandatory) && model.selectedIds.size === 1) return;
|
|
2367
2397
|
model.selectedIds.delete(id);
|
|
2368
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
|
+
}
|
|
2369
2405
|
function toggle(id) {
|
|
2370
2406
|
if (toValue(model.disabled)) return;
|
|
2371
2407
|
if (model.selectedIds.has(id)) unselect(id);
|
|
@@ -2375,22 +2411,28 @@ function createSelection(_options = {}) {
|
|
|
2375
2411
|
const isMultiple = options?.multiple ?? toValue(multiple);
|
|
2376
2412
|
const currentIds = new Set(model.selectedIds);
|
|
2377
2413
|
const targetIds = /* @__PURE__ */ new Set();
|
|
2378
|
-
for (const value of values) {
|
|
2379
|
-
const ids = model.browse(toRaw(value));
|
|
2380
|
-
if (ids) for (const id of ids) targetIds.add(id);
|
|
2381
|
-
}
|
|
2382
2414
|
if (isMultiple) {
|
|
2383
|
-
for (const
|
|
2384
|
-
|
|
2385
|
-
if (
|
|
2386
|
-
const
|
|
2387
|
-
|
|
2388
|
-
|
|
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
|
+
}
|
|
2389
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);
|
|
2390
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
|
+
}
|
|
2391
2433
|
const next = targetIds.values().next().value;
|
|
2392
2434
|
const last = currentIds.values().next().value;
|
|
2393
|
-
if (!/* @__PURE__ */ isUndefined(last))
|
|
2435
|
+
if (!/* @__PURE__ */ isUndefined(last)) drain(last);
|
|
2394
2436
|
if (!/* @__PURE__ */ isUndefined(next)) model.select(next);
|
|
2395
2437
|
}
|
|
2396
2438
|
}
|
|
@@ -2686,10 +2728,10 @@ function useSingle(namespace = "v0:single") {
|
|
|
2686
2728
|
* - Alias resolution with circular reference detection
|
|
2687
2729
|
* - Nested token flattening with dot notation
|
|
2688
2730
|
* - W3C Design Tokens format ($value, $type, $description, $extensions)
|
|
2689
|
-
* - Path-based resolution (e.g., {colors}.blue.500)
|
|
2690
|
-
* - Resolution caching for performance
|
|
2731
|
+
* - Path-based resolution (e.g., {colors.blue.500} or colors.blue.500)
|
|
2732
|
+
* - Resolution caching for performance
|
|
2691
2733
|
*
|
|
2692
|
-
* Used by useTheme, useLocale, and
|
|
2734
|
+
* Used by useTheme, useLocale, useFeatures, and usePermissions for token-based configuration.
|
|
2693
2735
|
*
|
|
2694
2736
|
* @example
|
|
2695
2737
|
* ```ts
|
|
@@ -2803,9 +2845,9 @@ function createTokens(tokens = {}, options = {}) {
|
|
|
2803
2845
|
cache.clear();
|
|
2804
2846
|
return _register(registration);
|
|
2805
2847
|
}
|
|
2806
|
-
function upsert(id, registration) {
|
|
2848
|
+
function upsert(id, registration, event) {
|
|
2807
2849
|
cache.clear();
|
|
2808
|
-
return _upsert(id, registration);
|
|
2850
|
+
return _upsert(id, registration, event);
|
|
2809
2851
|
}
|
|
2810
2852
|
function unregister(id) {
|
|
2811
2853
|
cache.clear();
|
|
@@ -3132,7 +3174,9 @@ function createLocaleFallback() {
|
|
|
3132
3174
|
const [createLocaleContext, createLocalePlugin, useLocale] = createPluginContext("v0:locale", (options) => createLocale(options), {
|
|
3133
3175
|
fallback: () => createLocaleFallback(),
|
|
3134
3176
|
persist: (ctx) => ctx.selectedId.value,
|
|
3135
|
-
restore: (ctx, saved) =>
|
|
3177
|
+
restore: (ctx, saved) => {
|
|
3178
|
+
if (/* @__PURE__ */ isString(saved) || /* @__PURE__ */ isNumber(saved)) ctx.select(saved);
|
|
3179
|
+
}
|
|
3136
3180
|
});
|
|
3137
3181
|
//#endregion
|
|
3138
3182
|
//#region src/components/AlertDialog/AlertDialogClose.vue
|
|
@@ -6640,11 +6684,14 @@ function useProxyModel(context, model, options) {
|
|
|
6640
6684
|
return toValue(multiple) ? val : val[0];
|
|
6641
6685
|
}
|
|
6642
6686
|
const applyOptions = toValue(multiple) === toValue(context.multiple ?? false) ? void 0 : { multiple: toValue(multiple) };
|
|
6643
|
-
const
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
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));
|
|
6648
6695
|
let syncing = false;
|
|
6649
6696
|
function shallowEqual(a, b) {
|
|
6650
6697
|
if (a === b) return true;
|
|
@@ -6653,15 +6700,17 @@ function useProxyModel(context, model, options) {
|
|
|
6653
6700
|
}
|
|
6654
6701
|
const contextWatch = watch(context.selectedValues, (val) => {
|
|
6655
6702
|
if (syncing) return;
|
|
6703
|
+
syncing = true;
|
|
6656
6704
|
modelWatch.pause();
|
|
6657
6705
|
model.value = transformOut(Array.from(toValue(val)));
|
|
6658
6706
|
modelWatch.resume();
|
|
6707
|
+
syncing = false;
|
|
6659
6708
|
}, { flush: "sync" });
|
|
6660
6709
|
const modelWatch = watch(model, (val) => {
|
|
6661
6710
|
if (syncing) return;
|
|
6662
6711
|
syncing = true;
|
|
6663
6712
|
contextWatch.pause();
|
|
6664
|
-
|
|
6713
|
+
reconcile(transformIn(val));
|
|
6665
6714
|
const actual = transformOut(Array.from(context.selectedValues.value));
|
|
6666
6715
|
if (!shallowEqual(val, actual)) model.value = actual;
|
|
6667
6716
|
contextWatch.resume();
|
|
@@ -10139,7 +10188,11 @@ function createCombobox(options = {}) {
|
|
|
10139
10188
|
function clear() {
|
|
10140
10189
|
query.value = "";
|
|
10141
10190
|
pristine.value = true;
|
|
10142
|
-
|
|
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
|
+
}
|
|
10143
10196
|
}
|
|
10144
10197
|
watch(isOpen, (open) => {
|
|
10145
10198
|
if (!open) cursor.clear();
|
|
@@ -10662,6 +10715,7 @@ const _sfc_main$50 = /* @__PURE__ */ defineComponent({
|
|
|
10662
10715
|
},
|
|
10663
10716
|
setup(__props) {
|
|
10664
10717
|
const context = useComboboxContext(__props.namespace);
|
|
10718
|
+
const locale = useLocale();
|
|
10665
10719
|
const slotProps = toRef(() => ({ query: context.query.value }));
|
|
10666
10720
|
return (_ctx, _cache) => {
|
|
10667
10721
|
return unref(context).isEmpty.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
|
|
@@ -10669,7 +10723,7 @@ const _sfc_main$50 = /* @__PURE__ */ defineComponent({
|
|
|
10669
10723
|
as: __props.as,
|
|
10670
10724
|
renderless: __props.renderless
|
|
10671
10725
|
}, {
|
|
10672
|
-
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)])]),
|
|
10673
10727
|
_: 3
|
|
10674
10728
|
}, 8, ["as", "renderless"])) : createCommentVNode("v-if", true);
|
|
10675
10729
|
};
|
|
@@ -12829,6 +12883,8 @@ function createValidation(_options = {}) {
|
|
|
12829
12883
|
const isValid = shallowRef(null);
|
|
12830
12884
|
const isValidating = shallowRef(false);
|
|
12831
12885
|
let generation = 0;
|
|
12886
|
+
let visible = 0;
|
|
12887
|
+
let latest;
|
|
12832
12888
|
function register(input) {
|
|
12833
12889
|
if (/* @__PURE__ */ isFunction(input) || /* @__PURE__ */ isString(input) || /* @__PURE__ */ isStandardSchema(input)) {
|
|
12834
12890
|
const resolved = rulesContext.resolve([input]);
|
|
@@ -12839,8 +12895,15 @@ function createValidation(_options = {}) {
|
|
|
12839
12895
|
function onboard(rules) {
|
|
12840
12896
|
return group.batch(() => rules.map((r) => register(r)));
|
|
12841
12897
|
}
|
|
12842
|
-
async function
|
|
12843
|
-
|
|
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) {
|
|
12844
12907
|
const val = _value === UNSET ? toValue(valueSource) : _value;
|
|
12845
12908
|
const activeRules = [];
|
|
12846
12909
|
for (const ticket of group.selectedItems.value) activeRules.push(ticket.value);
|
|
@@ -12855,7 +12918,7 @@ function createValidation(_options = {}) {
|
|
|
12855
12918
|
if (!silent) isValidating.value = true;
|
|
12856
12919
|
try {
|
|
12857
12920
|
const results = await Promise.all(activeRules.map((rule) => rule(val)));
|
|
12858
|
-
if (gen !== generation) return
|
|
12921
|
+
if (gen !== generation) return wait();
|
|
12859
12922
|
const errorMessages = results.filter((result) => /* @__PURE__ */ isString(result) || result === false).map((result) => result === false ? "Validation failed" : result);
|
|
12860
12923
|
if (!silent) {
|
|
12861
12924
|
errors.value = errorMessages;
|
|
@@ -12863,21 +12926,32 @@ function createValidation(_options = {}) {
|
|
|
12863
12926
|
}
|
|
12864
12927
|
return errorMessages.length === 0;
|
|
12865
12928
|
} catch (error) {
|
|
12866
|
-
if (gen !== generation) return
|
|
12929
|
+
if (gen !== generation) return wait();
|
|
12867
12930
|
if (!silent) {
|
|
12868
12931
|
errors.value = [error instanceof Error ? error.message : "Validation error"];
|
|
12869
12932
|
isValid.value = false;
|
|
12870
12933
|
}
|
|
12871
12934
|
return false;
|
|
12872
12935
|
} finally {
|
|
12873
|
-
if (gen ===
|
|
12936
|
+
if (!silent && gen === visible) isValidating.value = false;
|
|
12874
12937
|
}
|
|
12875
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
|
+
}
|
|
12876
12949
|
function reset() {
|
|
12877
12950
|
errors.value = [];
|
|
12878
12951
|
isValid.value = null;
|
|
12879
12952
|
isValidating.value = false;
|
|
12880
12953
|
generation++;
|
|
12954
|
+
latest = void 0;
|
|
12881
12955
|
}
|
|
12882
12956
|
if (initialRules.length > 0) onboard(initialRules);
|
|
12883
12957
|
const context = {
|
|
@@ -13659,6 +13733,7 @@ function createNumberField(options = {}) {
|
|
|
13659
13733
|
return Number.isNaN(result) ? null : result;
|
|
13660
13734
|
}
|
|
13661
13735
|
function commit(next) {
|
|
13736
|
+
if (isLocked()) return;
|
|
13662
13737
|
const val = arguments.length === 0 ? value.value : next;
|
|
13663
13738
|
if (/* @__PURE__ */ isNull(val)) return;
|
|
13664
13739
|
if (!shouldClamp && (val < numeric.min || val > numeric.max)) {
|
|
@@ -16303,7 +16378,7 @@ function createProgress(options = {}) {
|
|
|
16303
16378
|
});
|
|
16304
16379
|
function fromValue(value) {
|
|
16305
16380
|
if (extent === 0) return 0;
|
|
16306
|
-
return /* @__PURE__ */ clamp(value,
|
|
16381
|
+
return (/* @__PURE__ */ clamp(value, min, max) - min) / extent * 100;
|
|
16307
16382
|
}
|
|
16308
16383
|
function register(registration = {}) {
|
|
16309
16384
|
const index = segments.value.length;
|
|
@@ -18892,7 +18967,7 @@ function createSlider(options = {}) {
|
|
|
18892
18967
|
}
|
|
18893
18968
|
}
|
|
18894
18969
|
function set(index, value) {
|
|
18895
|
-
if (readonly.value) return;
|
|
18970
|
+
if (disabled.value || readonly.value) return;
|
|
18896
18971
|
const snapped = snap(value);
|
|
18897
18972
|
const current = values.value;
|
|
18898
18973
|
let constrained = snapped;
|
|
@@ -21743,15 +21818,11 @@ const _sfc_main$146 = /* @__PURE__ */ defineComponent({
|
|
|
21743
21818
|
const root = useSwitchRoot(__props.namespace);
|
|
21744
21819
|
const isChecked = toRef(() => toValue(root.isChecked));
|
|
21745
21820
|
const isMixed = toRef(() => toValue(root.isMixed));
|
|
21746
|
-
const isVisible = toRef(() => isChecked.value || isMixed.value);
|
|
21747
21821
|
const dataState = toRef(() => isMixed.value ? "indeterminate" : isChecked.value ? "checked" : "unchecked");
|
|
21748
21822
|
const slotProps = toRef(() => ({
|
|
21749
21823
|
isChecked: isChecked.value,
|
|
21750
21824
|
isMixed: isMixed.value,
|
|
21751
|
-
attrs: {
|
|
21752
|
-
"data-state": dataState.value,
|
|
21753
|
-
"style": { visibility: isVisible.value ? "visible" : "hidden" }
|
|
21754
|
-
}
|
|
21825
|
+
attrs: { "data-state": dataState.value }
|
|
21755
21826
|
}));
|
|
21756
21827
|
return (_ctx, _cache) => {
|
|
21757
21828
|
return openBlock(), createBlock(unref(_sfc_main$9), mergeProps(slotProps.value.attrs, {
|
|
@@ -21952,10 +22023,10 @@ const Switch = {
|
|
|
21952
22023
|
*/
|
|
21953
22024
|
SelectAll: _sfc_main$145,
|
|
21954
22025
|
/**
|
|
21955
|
-
* Sliding knob
|
|
22026
|
+
* Sliding knob for switches.
|
|
21956
22027
|
*
|
|
21957
|
-
* Renders as a span with `data-state` attribute for CSS styling.
|
|
21958
|
-
*
|
|
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`.
|
|
21959
22030
|
* Must be used within a Switch.Root or Switch.SelectAll.
|
|
21960
22031
|
*
|
|
21961
22032
|
* @see https://0.vuetifyjs.com/components/forms/switch
|
|
@@ -22352,7 +22423,7 @@ const Tabs = {
|
|
|
22352
22423
|
//#endregion
|
|
22353
22424
|
//#region src/composables/useTheme/adapters/adapter.ts
|
|
22354
22425
|
var ThemeAdapter = class ThemeAdapter {
|
|
22355
|
-
static UNSAFE_CSS = /url\s*\(|@import|expression\s*\(|[{}
|
|
22426
|
+
static UNSAFE_CSS = /url\s*\(|src\s*\(|image\s*\(|image-set\s*\(|cross-fade\s*\(|@import|expression\s*\(|[;{}<>\\]/i;
|
|
22356
22427
|
static SAFE_IDENT = /^[a-zA-Z0-9_-]+$/;
|
|
22357
22428
|
stylesheetId = "v0-theme-stylesheet";
|
|
22358
22429
|
prefix;
|
|
@@ -22685,7 +22756,7 @@ const [createThemeContext, createThemePlugin, useTheme] = createPluginContext("v
|
|
|
22685
22756
|
},
|
|
22686
22757
|
persist: (ctx) => ctx.selectedId.value,
|
|
22687
22758
|
restore: (ctx, saved) => {
|
|
22688
|
-
if (
|
|
22759
|
+
if (/* @__PURE__ */ isString(saved) || /* @__PURE__ */ isNumber(saved)) ctx.select(saved);
|
|
22689
22760
|
}
|
|
22690
22761
|
});
|
|
22691
22762
|
//#endregion
|
|
@@ -23497,7 +23568,6 @@ function createNested(_options = {}) {
|
|
|
23497
23568
|
function open(ids) {
|
|
23498
23569
|
if (toValue(group.disabled)) return;
|
|
23499
23570
|
for (const id of /* @__PURE__ */ toArray(ids)) {
|
|
23500
|
-
if (!group.has(id)) continue;
|
|
23501
23571
|
const item = group.get(id);
|
|
23502
23572
|
if (!item || toValue(item.disabled)) continue;
|
|
23503
23573
|
openedIds.add(id);
|
|
@@ -23522,7 +23592,6 @@ function createNested(_options = {}) {
|
|
|
23522
23592
|
function close(ids) {
|
|
23523
23593
|
if (toValue(group.disabled)) return;
|
|
23524
23594
|
for (const id of /* @__PURE__ */ toArray(ids)) {
|
|
23525
|
-
if (!group.has(id)) continue;
|
|
23526
23595
|
const item = group.get(id);
|
|
23527
23596
|
if (!item || toValue(item.disabled)) continue;
|
|
23528
23597
|
openedIds.delete(id);
|
|
@@ -23531,7 +23600,6 @@ function createNested(_options = {}) {
|
|
|
23531
23600
|
function flip(ids) {
|
|
23532
23601
|
if (toValue(group.disabled)) return;
|
|
23533
23602
|
for (const id of /* @__PURE__ */ toArray(ids)) {
|
|
23534
|
-
if (!group.has(id)) continue;
|
|
23535
23603
|
const item = group.get(id);
|
|
23536
23604
|
if (!item || toValue(item.disabled)) continue;
|
|
23537
23605
|
if (opened(id)) close(id);
|
|
@@ -23759,75 +23827,81 @@ function createNested(_options = {}) {
|
|
|
23759
23827
|
function getLeafDescendants(id) {
|
|
23760
23828
|
return getDescendants(id).filter((did) => isLeaf(did));
|
|
23761
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
|
+
}
|
|
23762
23840
|
function select(ids) {
|
|
23763
23841
|
if (toValue(group.disabled)) return;
|
|
23764
|
-
for (const id of /* @__PURE__ */ toArray(ids))
|
|
23765
|
-
|
|
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 {
|
|
23766
23845
|
const item = group.get(id);
|
|
23767
23846
|
if (!item || toValue(item.disabled)) continue;
|
|
23768
|
-
|
|
23769
|
-
|
|
23770
|
-
|
|
23771
|
-
|
|
23772
|
-
|
|
23773
|
-
|
|
23774
|
-
|
|
23775
|
-
|
|
23776
|
-
const { selectedIds, mixedIds } = group;
|
|
23777
|
-
mixedIds.delete(id);
|
|
23778
|
-
selectedIds.add(id);
|
|
23779
|
-
for (const did of getDescendants(id)) {
|
|
23780
|
-
const desc = group.get(did);
|
|
23781
|
-
if (desc && toValue(desc.disabled)) continue;
|
|
23782
|
-
mixedIds.delete(did);
|
|
23783
|
-
selectedIds.add(did);
|
|
23784
|
-
}
|
|
23785
|
-
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;
|
|
23786
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);
|
|
23787
23866
|
}
|
|
23788
23867
|
}
|
|
23789
23868
|
function unselect(ids) {
|
|
23790
23869
|
if (toValue(group.disabled)) return;
|
|
23791
|
-
for (const id of /* @__PURE__ */ toArray(ids))
|
|
23792
|
-
|
|
23870
|
+
for (const id of /* @__PURE__ */ toArray(ids)) if (selectionMode === "independent") group.unselect(id);
|
|
23871
|
+
else if (selectionMode === "leaf") {
|
|
23793
23872
|
const item = group.get(id);
|
|
23794
23873
|
if (!item || toValue(item.disabled)) continue;
|
|
23795
|
-
|
|
23796
|
-
|
|
23797
|
-
|
|
23798
|
-
|
|
23799
|
-
|
|
23800
|
-
|
|
23801
|
-
|
|
23802
|
-
|
|
23803
|
-
|
|
23804
|
-
|
|
23805
|
-
|
|
23806
|
-
|
|
23807
|
-
|
|
23808
|
-
|
|
23809
|
-
mixedIds.delete(did);
|
|
23810
|
-
selectedIds.delete(did);
|
|
23811
|
-
}
|
|
23812
|
-
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);
|
|
23813
23888
|
}
|
|
23889
|
+
updateAncestors(id);
|
|
23814
23890
|
}
|
|
23815
23891
|
}
|
|
23816
23892
|
function toggle(ids) {
|
|
23817
23893
|
if (toValue(group.disabled)) return;
|
|
23818
|
-
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 {
|
|
23819
23897
|
const item = group.get(id);
|
|
23820
23898
|
if (!item || toValue(item.disabled)) continue;
|
|
23821
|
-
|
|
23822
|
-
|
|
23823
|
-
else
|
|
23824
|
-
const leafIds = getLeafDescendants(id);
|
|
23825
|
-
if (leafIds.every((lid) => group.selected(lid))) for (const lid of leafIds) group.unselect(lid);
|
|
23826
|
-
else for (const lid of leafIds) group.select(lid);
|
|
23827
|
-
}
|
|
23828
|
-
else if (group.selected(id) || group.mixed(id)) unselect(id);
|
|
23829
|
-
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);
|
|
23830
23902
|
}
|
|
23903
|
+
else if (group.selected(id) || group.mixed(id)) unselect(id);
|
|
23904
|
+
else select(id);
|
|
23831
23905
|
}
|
|
23832
23906
|
function selectAll() {
|
|
23833
23907
|
if (toValue(group.disabled)) return;
|
|
@@ -26434,7 +26508,8 @@ function createRowSpanning(options) {
|
|
|
26434
26508
|
function createDataGrid(_options = {}) {
|
|
26435
26509
|
const { editing: editingOptions, preserveRowOrder = false, rowSpanning, ...options } = _options;
|
|
26436
26510
|
const table = createDataTable(options);
|
|
26437
|
-
const sortable = createSortable(
|
|
26511
|
+
const sortable = createSortable();
|
|
26512
|
+
const sortableProxy = useProxyRegistry(sortable);
|
|
26438
26513
|
const dirty = shallowRef(false);
|
|
26439
26514
|
table.on("register:ticket", (ticket) => {
|
|
26440
26515
|
sortable.register({
|
|
@@ -26449,7 +26524,7 @@ function createDataGrid(_options = {}) {
|
|
|
26449
26524
|
sortable.clear();
|
|
26450
26525
|
dirty.value = false;
|
|
26451
26526
|
});
|
|
26452
|
-
const order = toRef(() =>
|
|
26527
|
+
const order = toRef(() => sortableProxy.keys);
|
|
26453
26528
|
const sortedIds = computed(() => {
|
|
26454
26529
|
const buckets = /* @__PURE__ */ new Map();
|
|
26455
26530
|
for (const ticket of table.values()) {
|
|
@@ -26476,6 +26551,7 @@ function createDataGrid(_options = {}) {
|
|
|
26476
26551
|
dirty.value = true;
|
|
26477
26552
|
}
|
|
26478
26553
|
function reset() {
|
|
26554
|
+
if (!dirty.value) return;
|
|
26479
26555
|
if (sortable.size > 0) sortable.reorder(table.keys());
|
|
26480
26556
|
dirty.value = false;
|
|
26481
26557
|
}
|
|
@@ -29092,7 +29168,7 @@ function createFeatures(_options = {}) {
|
|
|
29092
29168
|
const shouldSelect = /* @__PURE__ */ isBoolean(value) ? value === true : /* @__PURE__ */ isObject(value) && /* @__PURE__ */ isBoolean(value.$value) && value.$value === true;
|
|
29093
29169
|
registry.upsert(id, { value });
|
|
29094
29170
|
if (shouldSelect) registry.select(id);
|
|
29095
|
-
else registry.
|
|
29171
|
+
else registry.selectedIds.delete(id);
|
|
29096
29172
|
} else register({
|
|
29097
29173
|
id,
|
|
29098
29174
|
value
|
|
@@ -30028,7 +30104,7 @@ const [createRtlContext, createRtlPlugin, useRtl] = createPluginContext("v0:rtl"
|
|
|
30028
30104
|
},
|
|
30029
30105
|
persist: (ctx) => ctx.isRtl.value,
|
|
30030
30106
|
restore: (ctx, saved) => {
|
|
30031
|
-
if (
|
|
30107
|
+
if (/* @__PURE__ */ isBoolean(saved)) ctx.isRtl.value = saved;
|
|
30032
30108
|
}
|
|
30033
30109
|
});
|
|
30034
30110
|
//#endregion
|