@vuetify/v0 1.2.0 → 1.2.2
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 +34 -0
- package/dist/{adapter-TiGrumDi.mjs → adapter-B6R54NMr.mjs} +1 -1
- package/dist/{adapter-D5nT3bLw.d.mts → adapter-BC1VWu0H.d.mts} +0 -1
- package/dist/{adapter-PDTe5nFT.d.mts → adapter-BP7jNtvH.d.mts} +3 -4
- package/dist/{adapter-CqS8xexO.d.mts → adapter-Bi799Zn7.d.mts} +2 -3
- package/dist/{adapter-ClB-53_F.d.mts → adapter-CbkRdMju.d.mts} +0 -1
- package/dist/{adapter-BiQV5j8B.mjs → adapter-DMzQI6ma.mjs} +8 -6
- package/dist/{adapter-BXunW_mw.d.mts → adapter-w8SEWO2v.d.mts} +1 -2
- package/dist/{adapter-BuSfpxur.mjs → adapter-z5dFxm0f.mjs} +1 -1
- package/dist/browser/index.d.ts +1288 -1112
- package/dist/browser/index.js +619 -523
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/{components-DBhVg-t1.mjs → components-CSFzUH3d.mjs} +407 -384
- package/dist/composables/index.d.mts +22 -22
- package/dist/composables/index.mjs +40 -40
- package/dist/{composables-ZGhVN2EJ.mjs → composables-CLNFa1uu.mjs} +55 -47
- package/dist/{consola-cad-VEV2.mjs → consola-B9K6H_EB.mjs} +1 -1
- package/dist/{consola-CdMU53rU.d.mts → consola-BGm_oQkS.d.mts} +1 -2
- package/dist/constants/index.d.mts +1 -1
- package/dist/constants/index.mjs +2 -2
- package/dist/{createDataTable-VmQEDn-7.mjs → createDataTable-CfJCltDt.mjs} +15 -13
- package/dist/{createGroup-B_LL7xRr.mjs → createGroup-CKE5o-VH.mjs} +17 -5
- package/dist/{createPlugin-Oo6t-vBw.mjs → createPlugin-YYkwbiUd.mjs} +3 -2
- package/dist/{createRegistry-DVdvep0v.mjs → createRegistry-D31hPifx.mjs} +10 -7
- package/dist/{createSelection-BNdDz8oY.mjs → createSelection-DdTgggyM.mjs} +5 -3
- package/dist/{createSingle-DHyIQ9Cj.mjs → createSingle-hQWwVTVX.mjs} +4 -3
- package/dist/{createTokens-DoISbwd7.mjs → createTokens-DuZrXRfN.mjs} +6 -5
- package/dist/data-table/adapters/client/index.d.mts +1 -1
- package/dist/data-table/adapters/client/index.mjs +1 -1
- package/dist/data-table/adapters/index.d.mts +6 -5
- package/dist/data-table/adapters/index.mjs +4 -4
- package/dist/data-table/adapters/server/index.d.mts +1 -1
- package/dist/data-table/adapters/server/index.mjs +1 -1
- package/dist/data-table/adapters/virtual/index.d.mts +1 -1
- package/dist/data-table/adapters/virtual/index.mjs +1 -1
- package/dist/data-table/index.d.mts +6 -6
- package/dist/data-table/index.mjs +5 -5
- package/dist/date/index.d.mts +1 -2
- package/dist/date/index.mjs +3 -3
- package/dist/features/adapters/flagsmith/index.d.mts +1 -1
- package/dist/features/adapters/flagsmith/index.mjs +1 -1
- package/dist/features/adapters/launchdarkly/index.d.mts +1 -1
- package/dist/features/adapters/launchdarkly/index.mjs +2 -1
- package/dist/features/adapters/posthog/index.d.mts +1 -1
- package/dist/features/adapters/posthog/index.mjs +3 -2
- package/dist/features/index.d.mts +3 -3
- package/dist/features/index.mjs +2 -2
- package/dist/{flagsmith-DcIDrI7_.d.mts → flagsmith-BA8q5LAx.d.mts} +1 -2
- package/dist/{globals-DaoKtIGF.mjs → globals-DVcr1oW0.mjs} +1 -1
- package/dist/{htmlElements-CHXZfsZu.mjs → htmlElements-Bt1XN_d8.mjs} +1 -1
- package/dist/{index-H_hl6-4b.d.mts → index-ClUa0Bl7.d.mts} +0 -1
- package/dist/{index-Cx0cWGlx.d.mts → index-Ct0Pmzpx.d.mts} +182 -64
- package/dist/{index-Di9e8sOm.d.mts → index-DDwX_0Um.d.mts} +6 -6
- package/dist/{index-DjRE4lLl.d.mts → index-DMQv04YO.d.mts} +19 -12
- package/dist/{index-D0ub61GV.d.mts → index-Dlr9_rf1.d.mts} +2 -3
- package/dist/index-DmDf_FmM.d.mts +4 -0
- package/dist/{index-Cm6CbqI6.d.mts → index-DqAML7MT.d.mts} +1103 -1059
- package/dist/{index-DtiaWx5U.d.mts → index-XNZrgWCq.d.mts} +1 -2
- package/dist/{index-DSPkZ0ql.d.mts → index-Y6VfllT2.d.mts} +26 -21
- package/dist/index-h87SNntw.d.mts +2 -0
- package/dist/index.d.mts +25 -25
- package/dist/index.mjs +43 -43
- package/dist/json/attributes.json +14 -2
- package/dist/json/tags.json +3 -0
- package/dist/json/web-types.json +32 -3
- package/dist/{launchdarkly-CUzunYol.d.mts → launchdarkly-CWhPi3lZ.d.mts} +1 -2
- package/dist/locale/adapters/index.d.mts +4 -3
- package/dist/locale/adapters/index.mjs +2 -2
- 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 -2
- package/dist/locale/adapters/vue-i18n/index.mjs +1 -1
- package/dist/locale/index.d.mts +4 -4
- package/dist/locale/index.mjs +3 -3
- package/dist/locale/messages/en/index.d.mts +3 -0
- package/dist/locale/messages/en/index.mjs +1 -0
- package/dist/logger/adapters/consola/index.d.mts +1 -1
- package/dist/logger/adapters/consola/index.mjs +1 -1
- package/dist/logger/adapters/index.d.mts +4 -4
- package/dist/logger/adapters/index.mjs +4 -4
- package/dist/logger/adapters/pino/index.d.mts +1 -1
- package/dist/logger/adapters/pino/index.mjs +1 -1
- package/dist/logger/adapters/v0/index.d.mts +1 -1
- package/dist/logger/adapters/v0/index.mjs +1 -1
- package/dist/logger/index.d.mts +6 -6
- package/dist/logger/index.mjs +5 -5
- package/dist/notifications/index.d.mts +1 -2
- package/dist/notifications/index.mjs +4 -2
- package/dist/palettes/ant/generate/index.d.mts +0 -1
- package/dist/palettes/ant/generate/index.mjs +1 -1
- package/dist/palettes/ant/index.d.mts +1 -2
- package/dist/palettes/index.d.mts +3 -4
- package/dist/palettes/leonardo/generate/index.d.mts +0 -1
- package/dist/palettes/leonardo/generate/index.mjs +1 -1
- package/dist/palettes/material/generate/index.d.mts +0 -1
- package/dist/palettes/material/generate/index.mjs +1 -1
- package/dist/palettes/material/index.d.mts +1 -2
- package/dist/palettes/md1/index.d.mts +1 -2
- package/dist/palettes/md2/index.d.mts +1 -2
- package/dist/palettes/radix/index.d.mts +1 -2
- package/dist/palettes/tailwind/index.d.mts +1 -2
- package/dist/permissions/adapters/index.d.mts +1 -1
- package/dist/permissions/adapters/index.mjs +1 -1
- package/dist/permissions/adapters/v0/index.d.mts +1 -1
- package/dist/permissions/adapters/v0/index.mjs +1 -1
- package/dist/permissions/index.d.mts +1 -1
- package/dist/permissions/index.mjs +2 -2
- package/dist/{pino-BscMO3RR.mjs → pino-DOI2Y-WP.mjs} +1 -1
- package/dist/{pino-DjeWBFnj.d.mts → pino-cSCLlizQ.d.mts} +1 -2
- package/dist/popover/adapters/floating-ui/index.d.mts +1 -2
- package/dist/popover/adapters/floating-ui/index.mjs +4 -3
- package/dist/popover/index.d.mts +3 -3
- package/dist/popover/index.mjs +2 -2
- package/dist/{posthog-CJAYssdr.d.mts → posthog-Bzaj2Jbd.d.mts} +1 -2
- package/dist/rules/index.d.mts +2 -2
- package/dist/rules/index.mjs +1 -1
- package/dist/{server-m7iD1vOr.mjs → server-CSXNc-my.mjs} +1 -1
- package/dist/{server-5vbJ7GGs.d.mts → server-bE0UxPFS.d.mts} +1 -2
- package/dist/storage/adapters/index.d.mts +2 -2
- package/dist/storage/adapters/index.mjs +1 -1
- package/dist/storage/adapters/memory/index.d.mts +1 -1
- package/dist/storage/adapters/memory/index.mjs +1 -1
- package/dist/storage/index.d.mts +4 -4
- package/dist/storage/index.mjs +2 -2
- 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/{toArray-MY9Kb1Qy.mjs → toArray-DCZRopC6.mjs} +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/{unhead-C8zbWr45.mjs → unhead-hPXFvbDX.mjs} +2 -2
- package/dist/{useEventListener-2eAMwUdw.mjs → useEventListener-DI-1-WPJ.mjs} +2 -2
- package/dist/{useFeatures-DLafCOWt.mjs → useFeatures-CuTiM9YA.mjs} +4 -4
- package/dist/{useLocale-K_45ulPt.mjs → useLocale-OjumdVbi.mjs} +4 -4
- package/dist/{useLogger-YyWuYvrH.mjs → useLogger-CuGy-g9B.mjs} +3 -3
- package/dist/{useNotifications-Kh_KvM7j.mjs → useNotifications-BuZuDxSy.mjs} +6 -5
- package/dist/{usePermissions-BCGwsOES.mjs → usePermissions-CabbzZd_.mjs} +4 -4
- package/dist/{usePopover-BTo0AGIQ.mjs → usePopover-7WMiJ9Zt.mjs} +15 -12
- package/dist/{useRovingFocus-CkRnVmJ1.mjs → useRovingFocus-DuYBgzOA.mjs} +132 -94
- package/dist/{useRules-BuE5ffOJ.mjs → useRules-Bg7yBYP5.mjs} +5 -5
- package/dist/{useStorage-BT8-mjVs.mjs → useStorage-BtuW9p_Q.mjs} +7 -6
- package/dist/{useTheme-DkK6tPqY.mjs → useTheme-CfrtMZFH.mjs} +6 -6
- package/dist/{useTimer-CGVXk397.mjs → useTimer-aOp5haHg.mjs} +1 -1
- package/dist/utilities/index.d.mts +1 -1
- package/dist/utilities/index.mjs +66 -43
- package/dist/{v0-D0Exc2bO.mjs → v0-B9gSaems.mjs} +2 -2
- package/dist/{v0-SuxTihEe.mjs → v0-BusOrX6s.mjs} +2 -2
- package/dist/{v0-GI9U-rPA.d.mts → v0-CMqoGujd.d.mts} +1 -2
- package/dist/{v0-yZ2ZUtVF.mjs → v0-DoHWpAZn.mjs} +1 -1
- package/dist/{v0-CDW1Ktk-.d.mts → v0-IFGH9KS0.d.mts} +1 -2
- package/dist/{v0-B_53w7Fu.mjs → v0-Lo13oRUf.mjs} +2 -2
- package/dist/{v0-DfFK-p4X.d.mts → v0-QlSKvaAH.d.mts} +1 -2
- package/dist/{virtual-Bbu26O_h.mjs → virtual-Bsnip0cm.mjs} +1 -1
- package/dist/{virtual-JIdFLpTQ.d.mts → virtual-DrLIdUr1.d.mts} +1 -2
- package/package.json +10 -10
- package/dist/index-CX869wwk.d.mts +0 -1
- package/dist/index-CsuikFeJ.d.mts +0 -1
- /package/dist/{adapter-Chznb9Ju.mjs → adapter-B5mEUP5W.mjs} +0 -0
- /package/dist/{adapter-CrRJuxRk.mjs → adapter-B5teFrQH.mjs} +0 -0
- /package/dist/{adapter-D8zizQVP.mjs → adapter-BTNELv6-.mjs} +0 -0
- /package/dist/{adapter-ryk5H6YZ.d.mts → adapter-CHvvxw4c.d.mts} +0 -0
- /package/dist/{adapter-8UADsA3-.mjs → adapter-CxCiZYZO.mjs} +0 -0
- /package/dist/{createTrinity-z-3q9QWR.mjs → createTrinity-DJROWgXU.mjs} +0 -0
- /package/dist/{index-u_qSc2xS.d.mts → index-Bmr3SnAx.d.mts} +0 -0
- /package/dist/{index-Djhiy3nS.d.mts → index-Cyv2jtYx.d.mts} +0 -0
- /package/dist/{memory-CR6zvuaP.mjs → memory-C-Hi69Zc.mjs} +0 -0
- /package/dist/{memory-B7z1RR9r.d.mts → memory-DyA22X2q.d.mts} +0 -0
- /package/dist/{v0-Ch0yBKEj.mjs → v0-C4TLCYZJ.mjs} +0 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { a as SUPPORTS_OBSERVER, n as SUPPORTS_INTERSECTION_OBSERVER, t as IN_BROWSER } from "./globals-
|
|
1
|
+
import { a as SUPPORTS_OBSERVER, n as SUPPORTS_INTERSECTION_OBSERVER, t as IN_BROWSER } from "./globals-DVcr1oW0.mjs";
|
|
2
2
|
import { clamp, getActiveElement, instanceExists, isArray, isElement, isFunction, isNaN, isNull, isNullOrUndefined, isObject, isString, isUndefined, pxToNumber, range, resolveIds, resolveIndexes, useId as useId$1 } from "./utilities/index.mjs";
|
|
3
|
-
import { i as useContext, n as createContext, t as createTrinity } from "./createTrinity-
|
|
4
|
-
import { n as createPluginContext, t as createPlugin } from "./createPlugin-
|
|
5
|
-
import { i as useLogger } from "./useLogger-
|
|
6
|
-
import { t as createRegistry } from "./createRegistry-
|
|
7
|
-
import { i as createModel, t as createSelection } from "./createSelection-
|
|
8
|
-
import { t as createSingle } from "./createSingle-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { a as
|
|
17
|
-
import { a as
|
|
3
|
+
import { i as useContext, n as createContext, t as createTrinity } from "./createTrinity-DJROWgXU.mjs";
|
|
4
|
+
import { n as createPluginContext, t as createPlugin } from "./createPlugin-YYkwbiUd.mjs";
|
|
5
|
+
import { i as useLogger } from "./useLogger-CuGy-g9B.mjs";
|
|
6
|
+
import { t as createRegistry } from "./createRegistry-D31hPifx.mjs";
|
|
7
|
+
import { i as createModel, t as createSelection } from "./createSelection-DdTgggyM.mjs";
|
|
8
|
+
import { t as createSingle } from "./createSingle-hQWwVTVX.mjs";
|
|
9
|
+
import { a as useLocale } from "./useLocale-OjumdVbi.mjs";
|
|
10
|
+
import { t as toArray } from "./toArray-DCZRopC6.mjs";
|
|
11
|
+
import { n as useEventListener, r as useWindowEventListener, t as useDocumentEventListener } from "./useEventListener-DI-1-WPJ.mjs";
|
|
12
|
+
import { p as useHydration } from "./useTheme-CfrtMZFH.mjs";
|
|
13
|
+
import { i as useProxyRegistry, t as createGroup } from "./createGroup-CKE5o-VH.mjs";
|
|
14
|
+
import { t as useTimer } from "./useTimer-aOp5haHg.mjs";
|
|
15
|
+
import { i as usePopover } from "./usePopover-7WMiJ9Zt.mjs";
|
|
16
|
+
import { a as createFilter } from "./adapter-DMzQI6ma.mjs";
|
|
17
|
+
import { a as extractLeaves, t as createDataTable } from "./createDataTable-CfJCltDt.mjs";
|
|
18
|
+
import { a as useRules, o as isStandardSchema } from "./useRules-Bg7yBYP5.mjs";
|
|
18
19
|
import { computed, effectScope, hasInjectionContext, isReadonly, isRef, nextTick, onScopeDispose, ref, shallowReactive, shallowReadonly, shallowRef, toRef, toValue, watch } from "vue";
|
|
19
20
|
//#region src/composables/useClickOutside/index.ts
|
|
20
21
|
/**
|
|
@@ -352,7 +353,7 @@ function useClickOutside(target, handler, options = {}) {
|
|
|
352
353
|
* toElement(component) // Element | undefined (from $el)
|
|
353
354
|
* ```
|
|
354
355
|
*/
|
|
355
|
-
/*
|
|
356
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
356
357
|
function toElement(target) {
|
|
357
358
|
if (!target) return void 0;
|
|
358
359
|
if (/* @__PURE__ */ isElement(target)) return target;
|
|
@@ -515,7 +516,8 @@ function createStack(_options = {}) {
|
|
|
515
516
|
*/
|
|
516
517
|
function createStackContext(_options = {}) {
|
|
517
518
|
const { namespace = "v0:stack", ...options } = _options;
|
|
518
|
-
|
|
519
|
+
const context = createStack(options);
|
|
520
|
+
return createTrinity(namespace, context);
|
|
519
521
|
}
|
|
520
522
|
/**
|
|
521
523
|
* Creates a Vue plugin to provide stack context at app level.
|
|
@@ -861,7 +863,7 @@ function createObserver(target, userCallback, config) {
|
|
|
861
863
|
* with no layout box resolves its lengths to `''`, and this runs on whatever
|
|
862
864
|
* `getComputedStyle` returns.
|
|
863
865
|
*/
|
|
864
|
-
/*
|
|
866
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
865
867
|
function measure(el) {
|
|
866
868
|
const rect = el.getBoundingClientRect();
|
|
867
869
|
const style = getComputedStyle(el);
|
|
@@ -1117,7 +1119,7 @@ function useElementSize(target) {
|
|
|
1117
1119
|
*/
|
|
1118
1120
|
function createOverflow(options = {}) {
|
|
1119
1121
|
const { container: _container, gap = 0, reserved = 0, itemWidth, reverse } = options;
|
|
1120
|
-
const container = /* @__PURE__ */ isUndefined(_container) ? shallowRef() : toRef(_container);
|
|
1122
|
+
const container = /* @__PURE__ */ isUndefined(_container) ? shallowRef() : toRef(() => /* @__PURE__ */ toElement(_container) ?? null);
|
|
1121
1123
|
const widths = shallowRef(/* @__PURE__ */ new Map());
|
|
1122
1124
|
const { width } = useElementSize(container);
|
|
1123
1125
|
function measure(index, el) {
|
|
@@ -1217,7 +1219,8 @@ function createOverflow(options = {}) {
|
|
|
1217
1219
|
*/
|
|
1218
1220
|
function createOverflowContext(_options = {}) {
|
|
1219
1221
|
const { namespace = "v0:overflow", ...options } = _options;
|
|
1220
|
-
|
|
1222
|
+
const context = createOverflow(options);
|
|
1223
|
+
return createTrinity(namespace, context);
|
|
1221
1224
|
}
|
|
1222
1225
|
/**
|
|
1223
1226
|
* Returns the current overflow context from dependency injection.
|
|
@@ -1480,7 +1483,8 @@ function createBreadcrumbs(options = {}) {
|
|
|
1480
1483
|
*/
|
|
1481
1484
|
function createBreadcrumbsContext(_options = {}) {
|
|
1482
1485
|
const { namespace = "v0:breadcrumbs", ...options } = _options;
|
|
1483
|
-
|
|
1486
|
+
const context = createBreadcrumbs(options);
|
|
1487
|
+
return createTrinity(namespace, context);
|
|
1484
1488
|
}
|
|
1485
1489
|
/**
|
|
1486
1490
|
* Returns the current breadcrumbs instance from context.
|
|
@@ -1752,6 +1756,7 @@ function createStep(_options = {}) {
|
|
|
1752
1756
|
function step(count = 1) {
|
|
1753
1757
|
const length = registry.size;
|
|
1754
1758
|
if (!length) return;
|
|
1759
|
+
registry.lookup(0);
|
|
1755
1760
|
const currentIndex = registry.selectedIndex.value;
|
|
1756
1761
|
const direction = Math.sign(count || 1);
|
|
1757
1762
|
let hops = 0;
|
|
@@ -1808,7 +1813,8 @@ function createStep(_options = {}) {
|
|
|
1808
1813
|
*/
|
|
1809
1814
|
function createStepContext(_options = {}) {
|
|
1810
1815
|
const { namespace = "v0:step", ...options } = _options;
|
|
1811
|
-
|
|
1816
|
+
const context = createStep(options);
|
|
1817
|
+
return createTrinity(namespace, context);
|
|
1812
1818
|
}
|
|
1813
1819
|
/**
|
|
1814
1820
|
* Returns the current step instance.
|
|
@@ -1984,7 +1990,6 @@ function createFocusTraversal(items, activate, options = {}) {
|
|
|
1984
1990
|
e.preventDefault();
|
|
1985
1991
|
if (e.ctrlKey) last();
|
|
1986
1992
|
else rowLast();
|
|
1987
|
-
break;
|
|
1988
1993
|
}
|
|
1989
1994
|
return;
|
|
1990
1995
|
}
|
|
@@ -2360,7 +2365,8 @@ function createCombobox(options = {}) {
|
|
|
2360
2365
|
*/
|
|
2361
2366
|
function createComboboxContext(_options = {}) {
|
|
2362
2367
|
const { namespace = "v0:combobox", ...options } = _options;
|
|
2363
|
-
|
|
2368
|
+
const context = createCombobox(options);
|
|
2369
|
+
return createTrinity(namespace, context);
|
|
2364
2370
|
}
|
|
2365
2371
|
/**
|
|
2366
2372
|
* Injects the current combobox context from a parent provider.
|
|
@@ -2461,9 +2467,10 @@ function useLazy(active, options = {}) {
|
|
|
2461
2467
|
isBooted.value = true;
|
|
2462
2468
|
}, { duration: delay }) : void 0;
|
|
2463
2469
|
const stop = watch(() => toValue(active), (value) => {
|
|
2464
|
-
if (value)
|
|
2465
|
-
|
|
2466
|
-
|
|
2470
|
+
if (value) {
|
|
2471
|
+
if (timer) timer.start();
|
|
2472
|
+
else isBooted.value = true;
|
|
2473
|
+
} else timer?.stop();
|
|
2467
2474
|
}, { immediate: true });
|
|
2468
2475
|
function reset() {
|
|
2469
2476
|
isBooted.value = false;
|
|
@@ -3103,7 +3110,7 @@ function createRowSpanning(options) {
|
|
|
3103
3110
|
if (!span) return result;
|
|
3104
3111
|
const list = items.value;
|
|
3105
3112
|
const resolved = toValue(columns);
|
|
3106
|
-
const covered = Array.from({ length: resolved.length })
|
|
3113
|
+
const covered = Array.from({ length: resolved.length }, () => 0);
|
|
3107
3114
|
for (let row = 0; row < list.length; row++) {
|
|
3108
3115
|
const item = list[row];
|
|
3109
3116
|
const id = key ? key(item, row) : item[itemKey];
|
|
@@ -3599,7 +3606,8 @@ function createForm(_options = {}) {
|
|
|
3599
3606
|
*/
|
|
3600
3607
|
function createFormContext(_options = {}) {
|
|
3601
3608
|
const { namespace = "v0:form", ...options } = _options;
|
|
3602
|
-
|
|
3609
|
+
const context = createForm(options);
|
|
3610
|
+
return createTrinity(namespace, context);
|
|
3603
3611
|
}
|
|
3604
3612
|
/**
|
|
3605
3613
|
* Returns the current form instance.
|
|
@@ -3864,7 +3872,7 @@ const UNSET = /* @__PURE__ */ Symbol("unset");
|
|
|
3864
3872
|
* ```
|
|
3865
3873
|
*/
|
|
3866
3874
|
function createValidation(_options = {}) {
|
|
3867
|
-
const { rules: initialRules = [], value: valueSource, enroll = true, ...options } = _options;
|
|
3875
|
+
const { rules: initialRules = [], value: valueSource, enroll = true, formNamespace = "v0:form", ...options } = _options;
|
|
3868
3876
|
const group = createGroup({
|
|
3869
3877
|
...options,
|
|
3870
3878
|
enroll,
|
|
@@ -3879,8 +3887,8 @@ function createValidation(_options = {}) {
|
|
|
3879
3887
|
let latest;
|
|
3880
3888
|
function register(input) {
|
|
3881
3889
|
if (/* @__PURE__ */ isFunction(input) || /* @__PURE__ */ isString(input) || /* @__PURE__ */ isStandardSchema(input)) {
|
|
3882
|
-
const
|
|
3883
|
-
return group.register({ value:
|
|
3890
|
+
const rule = rulesContext.resolve([input])[0] ?? (() => /* @__PURE__ */ isString(input) ? `Unknown validation rule "${input}"` : false);
|
|
3891
|
+
return group.register({ value: rule });
|
|
3884
3892
|
}
|
|
3885
3893
|
return group.register(input);
|
|
3886
3894
|
}
|
|
@@ -3959,7 +3967,7 @@ function createValidation(_options = {}) {
|
|
|
3959
3967
|
return group.size;
|
|
3960
3968
|
}
|
|
3961
3969
|
};
|
|
3962
|
-
const form = useForm();
|
|
3970
|
+
const form = useForm(formNamespace);
|
|
3963
3971
|
const ticket = form?.register({ value: context });
|
|
3964
3972
|
onScopeDispose(() => {
|
|
3965
3973
|
if (!ticket || !form) return;
|
|
@@ -3987,15 +3995,24 @@ function createValidation(_options = {}) {
|
|
|
3987
3995
|
* import { createInput } from '@vuetify/v0'
|
|
3988
3996
|
*
|
|
3989
3997
|
* const value = shallowRef('')
|
|
3990
|
-
* const input = createInput({ value, label: 'Name',
|
|
3998
|
+
* const input = createInput({ value, label: 'Name', required: true })
|
|
3991
3999
|
* await input.validate()
|
|
3992
4000
|
* ```
|
|
3993
4001
|
*/
|
|
3994
4002
|
function createInput(options) {
|
|
3995
|
-
const { value, id = /* @__PURE__ */ useId$1(), label, name, form, required, disabled = false, readonly: _readonly = false, rules = [], error = false, errorMessages, dirty: dirtyFn, equals = (a, b) => a === b } = options;
|
|
4003
|
+
const { value, id = /* @__PURE__ */ useId$1(), label, name, form, formNamespace, required, disabled = false, readonly: _readonly = false, rules = [], error = false, errorMessages, dirty: dirtyFn, equals = (a, b) => a === b } = options;
|
|
4004
|
+
function filled(val) {
|
|
4005
|
+
if (dirtyFn) return dirtyFn(val);
|
|
4006
|
+
return /* @__PURE__ */ isString(val) ? val.length > 0 : !/* @__PURE__ */ isNullOrUndefined(val);
|
|
4007
|
+
}
|
|
4008
|
+
const locale = useLocale();
|
|
4009
|
+
function requiredRule(v) {
|
|
4010
|
+
return filled(v) || (locale.ti("Input.required") ?? "Required");
|
|
4011
|
+
}
|
|
3996
4012
|
const validation = createValidation({
|
|
3997
|
-
rules,
|
|
3998
|
-
value
|
|
4013
|
+
rules: required ? [requiredRule, ...rules] : rules,
|
|
4014
|
+
value,
|
|
4015
|
+
formNamespace
|
|
3999
4016
|
});
|
|
4000
4017
|
const initialValue = value.value;
|
|
4001
4018
|
const isFocused = shallowRef(false);
|
|
@@ -4008,10 +4025,7 @@ function createInput(options) {
|
|
|
4008
4025
|
const isReadonly = toRef(() => toValue(_readonly));
|
|
4009
4026
|
const descriptionId = `${id}-description`;
|
|
4010
4027
|
const errorId = `${id}-error`;
|
|
4011
|
-
const isDirty = toRef(() =>
|
|
4012
|
-
if (dirtyFn) return dirtyFn(value.value);
|
|
4013
|
-
return /* @__PURE__ */ isString(value.value) ? value.value.length > 0 : !/* @__PURE__ */ isNullOrUndefined(value.value);
|
|
4014
|
-
});
|
|
4028
|
+
const isDirty = toRef(() => filled(value.value));
|
|
4015
4029
|
const isPristine = shallowRef(true);
|
|
4016
4030
|
watch(value, (val) => {
|
|
4017
4031
|
isPristine.value = equals(val, initialValue);
|
|
@@ -4101,7 +4115,8 @@ function createNumeric(options = {}) {
|
|
|
4101
4115
|
function snap(value) {
|
|
4102
4116
|
if (!Number.isFinite(value)) return min;
|
|
4103
4117
|
if (step <= 0 || !Number.isFinite(min)) return /* @__PURE__ */ clamp(value, min, max);
|
|
4104
|
-
const
|
|
4118
|
+
const steps = Math.round((/* @__PURE__ */ clamp(value, min, max) - min) / step);
|
|
4119
|
+
const result = min + steps * step;
|
|
4105
4120
|
return /* @__PURE__ */ clamp(decimals > 0 ? +result.toFixed(decimals) : result, min, max);
|
|
4106
4121
|
}
|
|
4107
4122
|
function fromValue(value) {
|
|
@@ -4173,7 +4188,7 @@ function createNumeric(options = {}) {
|
|
|
4173
4188
|
* ```
|
|
4174
4189
|
*/
|
|
4175
4190
|
function createNumberField(options = {}) {
|
|
4176
|
-
const { value = ref(null), locale = "en-US", format: formatOptions, clamp: shouldClamp = true, commitOn = "change", disabled = false, readonly: _readonly = false, min, max, step, leap, wrap, id, label, name, rules, error, errorMessages } = options;
|
|
4191
|
+
const { value = ref(null), locale = "en-US", format: formatOptions, clamp: shouldClamp = true, commitOn = "change", disabled = false, readonly: _readonly = false, min, max, step, leap, wrap, id, label, name, formNamespace, required, rules, error, errorMessages } = options;
|
|
4177
4192
|
const numeric = createNumeric({
|
|
4178
4193
|
min,
|
|
4179
4194
|
max,
|
|
@@ -4186,6 +4201,8 @@ function createNumberField(options = {}) {
|
|
|
4186
4201
|
id,
|
|
4187
4202
|
label,
|
|
4188
4203
|
name,
|
|
4204
|
+
formNamespace,
|
|
4205
|
+
required,
|
|
4189
4206
|
disabled,
|
|
4190
4207
|
readonly: _readonly,
|
|
4191
4208
|
rules,
|
|
@@ -4389,9 +4406,7 @@ function usePresence(options) {
|
|
|
4389
4406
|
case "mounted":
|
|
4390
4407
|
state.value = "present";
|
|
4391
4408
|
break;
|
|
4392
|
-
case "unmounted":
|
|
4393
|
-
enter();
|
|
4394
|
-
break;
|
|
4409
|
+
case "unmounted": enter();
|
|
4395
4410
|
}
|
|
4396
4411
|
} else if (booted) leave();
|
|
4397
4412
|
}, { immediate: true });
|
|
@@ -4489,6 +4504,9 @@ function createProgress(options = {}) {
|
|
|
4489
4504
|
if (pending && segments.value.length >= pending.length) pending = null;
|
|
4490
4505
|
return ticket;
|
|
4491
4506
|
}
|
|
4507
|
+
function onboard(registrations) {
|
|
4508
|
+
return model.batch(() => registrations.map((registration) => register(registration)));
|
|
4509
|
+
}
|
|
4492
4510
|
function apply(incoming, _options) {
|
|
4493
4511
|
const clamped = incoming.map((v) => /* @__PURE__ */ clamp(Number(v), min, max));
|
|
4494
4512
|
if (segments.value.length === 0) {
|
|
@@ -4508,6 +4526,7 @@ function createProgress(options = {}) {
|
|
|
4508
4526
|
isIndeterminate,
|
|
4509
4527
|
fromValue,
|
|
4510
4528
|
register,
|
|
4529
|
+
onboard,
|
|
4511
4530
|
apply,
|
|
4512
4531
|
min,
|
|
4513
4532
|
max,
|
|
@@ -4524,7 +4543,8 @@ function createProgress(options = {}) {
|
|
|
4524
4543
|
*/
|
|
4525
4544
|
function createProgressContext(_options = {}) {
|
|
4526
4545
|
const { namespace = "v0:progress", ...options } = _options;
|
|
4527
|
-
|
|
4546
|
+
const context = createProgress(options);
|
|
4547
|
+
return createTrinity(namespace, context);
|
|
4528
4548
|
}
|
|
4529
4549
|
/**
|
|
4530
4550
|
* Returns the current progress instance from context.
|
|
@@ -4623,7 +4643,8 @@ function createRating(_options = {}) {
|
|
|
4623
4643
|
value,
|
|
4624
4644
|
items: computed(() => {
|
|
4625
4645
|
const current = value.value;
|
|
4626
|
-
|
|
4646
|
+
const count = /* @__PURE__ */ clamp(Math.floor(toValue(_size)), 0, MAX_SIZE);
|
|
4647
|
+
return (/* @__PURE__ */ range(count, 1)).map((i) => ({
|
|
4627
4648
|
value: i,
|
|
4628
4649
|
state: getState(i, current)
|
|
4629
4650
|
}));
|
|
@@ -4663,7 +4684,8 @@ function createRating(_options = {}) {
|
|
|
4663
4684
|
*/
|
|
4664
4685
|
function createRatingContext(_options = {}) {
|
|
4665
4686
|
const { namespace = "v0:rating", ...options } = _options;
|
|
4666
|
-
|
|
4687
|
+
const context = createRating(options);
|
|
4688
|
+
return createTrinity(namespace, context);
|
|
4667
4689
|
}
|
|
4668
4690
|
/**
|
|
4669
4691
|
* Returns the current rating instance from context.
|
|
@@ -5063,7 +5085,7 @@ function createNested(_options = {}) {
|
|
|
5063
5085
|
}
|
|
5064
5086
|
if (revealOnOpen) {
|
|
5065
5087
|
let parentId = parents.get(id);
|
|
5066
|
-
const visited = new Set([id]);
|
|
5088
|
+
const visited = /* @__PURE__ */ new Set([id]);
|
|
5067
5089
|
while (!/* @__PURE__ */ isUndefined(parentId)) {
|
|
5068
5090
|
if (visited.has(parentId)) {
|
|
5069
5091
|
logger.warn(`Circular parent reference detected at "${parentId}".`);
|
|
@@ -5184,7 +5206,7 @@ function createNested(_options = {}) {
|
|
|
5184
5206
|
const initial = children.get(id);
|
|
5185
5207
|
if (!initial) return descendants;
|
|
5186
5208
|
const queue = initial.slice();
|
|
5187
|
-
const visited = new Set([id]);
|
|
5209
|
+
const visited = /* @__PURE__ */ new Set([id]);
|
|
5188
5210
|
let index = 0;
|
|
5189
5211
|
while (index < queue.length) {
|
|
5190
5212
|
const currentId = queue[index++];
|
|
@@ -5214,7 +5236,7 @@ function createNested(_options = {}) {
|
|
|
5214
5236
|
if (!group.has(ancestorId) || !group.has(descendantId)) return false;
|
|
5215
5237
|
if (ancestorId === descendantId) return false;
|
|
5216
5238
|
let currentId = parents.get(descendantId);
|
|
5217
|
-
const visited = new Set([descendantId]);
|
|
5239
|
+
const visited = /* @__PURE__ */ new Set([descendantId]);
|
|
5218
5240
|
while (!/* @__PURE__ */ isUndefined(currentId)) {
|
|
5219
5241
|
if (currentId === ancestorId) return true;
|
|
5220
5242
|
if (visited.has(currentId)) {
|
|
@@ -5282,7 +5304,7 @@ function createNested(_options = {}) {
|
|
|
5282
5304
|
function updateAncestors(id) {
|
|
5283
5305
|
const { selectedIds, mixedIds } = group;
|
|
5284
5306
|
let parentId = parents.get(id);
|
|
5285
|
-
const visited = new Set([id]);
|
|
5307
|
+
const visited = /* @__PURE__ */ new Set([id]);
|
|
5286
5308
|
while (!/* @__PURE__ */ isUndefined(parentId)) {
|
|
5287
5309
|
if (visited.has(parentId)) {
|
|
5288
5310
|
logger.warn(`Circular parent reference detected at "${parentId}".`);
|
|
@@ -5327,13 +5349,14 @@ function createNested(_options = {}) {
|
|
|
5327
5349
|
function select(ids) {
|
|
5328
5350
|
if (toValue(group.disabled)) return;
|
|
5329
5351
|
for (const id of /* @__PURE__ */ toArray(ids)) if (selectionMode === "independent") group.select(id);
|
|
5330
|
-
else if (selectionMode === "leaf")
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5352
|
+
else if (selectionMode === "leaf") {
|
|
5353
|
+
if (isLeaf(id)) group.select(id);
|
|
5354
|
+
else {
|
|
5355
|
+
const item = group.get(id);
|
|
5356
|
+
if (!item || toValue(item.disabled)) continue;
|
|
5357
|
+
for (const lid of getLeafDescendants(id)) group.select(lid);
|
|
5358
|
+
}
|
|
5359
|
+
} else {
|
|
5337
5360
|
const item = group.get(id);
|
|
5338
5361
|
if (!item || toValue(item.disabled)) continue;
|
|
5339
5362
|
if (!toValue(multipleOption)) {
|
|
@@ -5364,7 +5387,7 @@ function createNested(_options = {}) {
|
|
|
5364
5387
|
if (!item || toValue(item.disabled)) continue;
|
|
5365
5388
|
const { selectedIds, mixedIds } = group;
|
|
5366
5389
|
if (toValue(mandatoryOption)) {
|
|
5367
|
-
const toRemove = new Set([id, ...getDescendants(id)]);
|
|
5390
|
+
const toRemove = /* @__PURE__ */ new Set([id, ...getDescendants(id)]);
|
|
5368
5391
|
if ([...selectedIds].every((sid) => toRemove.has(sid))) return;
|
|
5369
5392
|
}
|
|
5370
5393
|
mixedIds.delete(id);
|
|
@@ -5379,15 +5402,16 @@ function createNested(_options = {}) {
|
|
|
5379
5402
|
function toggle(ids) {
|
|
5380
5403
|
if (toValue(group.disabled)) return;
|
|
5381
5404
|
for (const id of /* @__PURE__ */ toArray(ids)) if (selectionMode === "independent") group.toggle(id);
|
|
5382
|
-
else if (selectionMode === "leaf")
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5405
|
+
else if (selectionMode === "leaf") {
|
|
5406
|
+
if (isLeaf(id)) group.toggle(id);
|
|
5407
|
+
else {
|
|
5408
|
+
const item = group.get(id);
|
|
5409
|
+
if (!item || toValue(item.disabled)) continue;
|
|
5410
|
+
const leafIds = getLeafDescendants(id);
|
|
5411
|
+
if (leafIds.every((lid) => group.selected(lid))) removeLeaves(leafIds);
|
|
5412
|
+
else for (const lid of leafIds) group.select(lid);
|
|
5413
|
+
}
|
|
5414
|
+
} else if (group.selected(id) || group.mixed(id)) unselect(id);
|
|
5391
5415
|
else select(id);
|
|
5392
5416
|
}
|
|
5393
5417
|
function selectAll() {
|
|
@@ -5401,12 +5425,13 @@ function createNested(_options = {}) {
|
|
|
5401
5425
|
}
|
|
5402
5426
|
function unselectAll() {
|
|
5403
5427
|
if (toValue(group.disabled)) return;
|
|
5404
|
-
const first = group.selectedIds.values().next().value;
|
|
5405
5428
|
group.selectedIds.clear();
|
|
5406
5429
|
group.mixedIds.clear();
|
|
5407
|
-
if (toValue(mandatoryOption)
|
|
5408
|
-
|
|
5409
|
-
|
|
5430
|
+
if (!toValue(mandatoryOption)) return;
|
|
5431
|
+
const ticket = group.seek("first");
|
|
5432
|
+
if (ticket) {
|
|
5433
|
+
group.selectedIds.add(ticket.id);
|
|
5434
|
+
updateAncestors(ticket.id);
|
|
5410
5435
|
}
|
|
5411
5436
|
}
|
|
5412
5437
|
function toggleAll() {
|
|
@@ -5480,6 +5505,7 @@ function createNested(_options = {}) {
|
|
|
5480
5505
|
ticket.select = () => select(id);
|
|
5481
5506
|
ticket.unselect = () => unselect(id);
|
|
5482
5507
|
ticket.toggle = () => toggle(id);
|
|
5508
|
+
ticket.unregister = () => unregister(id);
|
|
5483
5509
|
if (registration.active) activate(id);
|
|
5484
5510
|
if (nested?.length) for (const child of nested) register({
|
|
5485
5511
|
...child,
|
|
@@ -5499,24 +5525,26 @@ function createNested(_options = {}) {
|
|
|
5499
5525
|
}
|
|
5500
5526
|
}
|
|
5501
5527
|
const list = children.get(id);
|
|
5502
|
-
if (list?.length)
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5528
|
+
if (list?.length) {
|
|
5529
|
+
if (cascade) {
|
|
5530
|
+
const descendantIds = getDescendants(id);
|
|
5531
|
+
for (const did of descendantIds) {
|
|
5532
|
+
parents.delete(did);
|
|
5533
|
+
children.delete(did);
|
|
5534
|
+
openedIds.delete(did);
|
|
5535
|
+
activeIds.delete(did);
|
|
5536
|
+
rootIds.delete(did);
|
|
5537
|
+
}
|
|
5538
|
+
group.offboard(descendantIds);
|
|
5539
|
+
} else {
|
|
5540
|
+
for (const did of getDescendants(id)) {
|
|
5541
|
+
openedIds.delete(did);
|
|
5542
|
+
activeIds.delete(did);
|
|
5543
|
+
}
|
|
5544
|
+
for (const cid of list) {
|
|
5545
|
+
parents.set(cid, void 0);
|
|
5546
|
+
rootIds.add(cid);
|
|
5547
|
+
}
|
|
5520
5548
|
}
|
|
5521
5549
|
}
|
|
5522
5550
|
parents.delete(id);
|
|
@@ -5563,6 +5591,14 @@ function createNested(_options = {}) {
|
|
|
5563
5591
|
rootIds.clear();
|
|
5564
5592
|
group.reset();
|
|
5565
5593
|
}
|
|
5594
|
+
function dispose() {
|
|
5595
|
+
children.clear();
|
|
5596
|
+
parents.clear();
|
|
5597
|
+
openedIds.clear();
|
|
5598
|
+
activeIds.clear();
|
|
5599
|
+
rootIds.clear();
|
|
5600
|
+
group.dispose();
|
|
5601
|
+
}
|
|
5566
5602
|
return {
|
|
5567
5603
|
...group,
|
|
5568
5604
|
children,
|
|
@@ -5611,6 +5647,7 @@ function createNested(_options = {}) {
|
|
|
5611
5647
|
onboard,
|
|
5612
5648
|
clear,
|
|
5613
5649
|
reset,
|
|
5650
|
+
dispose,
|
|
5614
5651
|
get size() {
|
|
5615
5652
|
return group.size;
|
|
5616
5653
|
}
|
|
@@ -5636,7 +5673,8 @@ function createNested(_options = {}) {
|
|
|
5636
5673
|
*/
|
|
5637
5674
|
function createNestedContext(_options = {}) {
|
|
5638
5675
|
const { namespace = "v0:nested", ...options } = _options;
|
|
5639
|
-
|
|
5676
|
+
const context = createNested(options);
|
|
5677
|
+
return createTrinity(namespace, context);
|
|
5640
5678
|
}
|
|
5641
5679
|
/**
|
|
5642
5680
|
* Returns the current nested instance from context.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { instanceExists, isFunction, isObject } from "./utilities/index.mjs";
|
|
2
|
-
import { n as createPluginContext } from "./createPlugin-
|
|
3
|
-
import { i as useLogger } from "./useLogger-
|
|
4
|
-
import { a as useLocale } from "./useLocale-
|
|
2
|
+
import { n as createPluginContext } from "./createPlugin-YYkwbiUd.mjs";
|
|
3
|
+
import { i as useLogger } from "./useLogger-CuGy-g9B.mjs";
|
|
4
|
+
import { a as useLocale } from "./useLocale-OjumdVbi.mjs";
|
|
5
5
|
//#region src/composables/useRules/adapters/standard.ts
|
|
6
6
|
/**
|
|
7
7
|
* Type guard for Standard Schema objects.
|
|
@@ -10,7 +10,7 @@ import { a as useLocale } from "./useLocale-K_45ulPt.mjs";
|
|
|
10
10
|
* @param value The value to check.
|
|
11
11
|
* @returns `true` if the value conforms to the Standard Schema interface.
|
|
12
12
|
*/
|
|
13
|
-
/*
|
|
13
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
14
14
|
function isStandardSchema(value) {
|
|
15
15
|
return /* @__PURE__ */ isObject(value) && "~standard" in value;
|
|
16
16
|
}
|
|
@@ -26,7 +26,7 @@ function isStandardSchema(value) {
|
|
|
26
26
|
*
|
|
27
27
|
* @see https://standardschema.dev/
|
|
28
28
|
*/
|
|
29
|
-
/*
|
|
29
|
+
/* #__NO_SIDE_EFFECTS__ */
|
|
30
30
|
function toRule(schema) {
|
|
31
31
|
return async (value) => {
|
|
32
32
|
let result = schema["~standard"].validate(value);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as IN_BROWSER } from "./globals-
|
|
1
|
+
import { t as IN_BROWSER } from "./globals-DVcr1oW0.mjs";
|
|
2
2
|
import { isArray, isNullOrUndefined, isObject } from "./utilities/index.mjs";
|
|
3
|
-
import { n as createPluginContext } from "./createPlugin-
|
|
4
|
-
import { i as useLogger } from "./useLogger-
|
|
5
|
-
import { r as useWindowEventListener } from "./useEventListener-
|
|
6
|
-
import { t as MemoryStorageAdapter } from "./memory-
|
|
3
|
+
import { n as createPluginContext } from "./createPlugin-YYkwbiUd.mjs";
|
|
4
|
+
import { i as useLogger } from "./useLogger-CuGy-g9B.mjs";
|
|
5
|
+
import { r as useWindowEventListener } from "./useEventListener-DI-1-WPJ.mjs";
|
|
6
|
+
import { t as MemoryStorageAdapter } from "./memory-C-Hi69Zc.mjs";
|
|
7
7
|
import { ref, watch } from "vue";
|
|
8
8
|
//#region src/composables/useStorage/index.ts
|
|
9
9
|
/**
|
|
@@ -103,7 +103,8 @@ function createStorage(options = {}) {
|
|
|
103
103
|
function get(key, defaultValue) {
|
|
104
104
|
const prefixedKey = `${prefix}${key}`;
|
|
105
105
|
if (cache.has(prefixedKey)) return cache.get(prefixedKey);
|
|
106
|
-
const
|
|
106
|
+
const initialValue = readStored(prefixedKey) ?? (/* @__PURE__ */ isObject(defaultValue) || /* @__PURE__ */ isArray(defaultValue) ? structuredClone(defaultValue) : defaultValue);
|
|
107
|
+
const valueRef = ref(initialValue);
|
|
107
108
|
const stop = watch(valueRef, (newValue) => {
|
|
108
109
|
if (/* @__PURE__ */ isNullOrUndefined(newValue)) adapter?.removeItem(prefixedKey);
|
|
109
110
|
else writeStored(prefixedKey, newValue);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as SUPPORTS_MATCH_MEDIA, t as IN_BROWSER } from "./globals-
|
|
1
|
+
import { r as SUPPORTS_MATCH_MEDIA, t as IN_BROWSER } from "./globals-DVcr1oW0.mjs";
|
|
2
2
|
import { foreground, isNumber, isString } from "./utilities/index.mjs";
|
|
3
|
-
import { n as createPluginContext } from "./createPlugin-
|
|
4
|
-
import { i as useLogger } from "./useLogger-
|
|
5
|
-
import { t as createSingle } from "./createSingle-
|
|
6
|
-
import { r as flatten, t as createTokens } from "./createTokens-
|
|
7
|
-
import { t as V0StyleSheetThemeAdapter } from "./v0-
|
|
3
|
+
import { n as createPluginContext } from "./createPlugin-YYkwbiUd.mjs";
|
|
4
|
+
import { i as useLogger } from "./useLogger-CuGy-g9B.mjs";
|
|
5
|
+
import { t as createSingle } from "./createSingle-hQWwVTVX.mjs";
|
|
6
|
+
import { r as flatten, t as createTokens } from "./createTokens-DuZrXRfN.mjs";
|
|
7
|
+
import { t as V0StyleSheetThemeAdapter } from "./v0-Lo13oRUf.mjs";
|
|
8
8
|
import { computed, nextTick, onScopeDispose, shallowReadonly, shallowRef, toRef, toValue, watch } from "vue";
|
|
9
9
|
//#region src/composables/useHydration/index.ts
|
|
10
10
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as IN_BROWSER } from "./globals-
|
|
1
|
+
import { t as IN_BROWSER } from "./globals-DVcr1oW0.mjs";
|
|
2
2
|
import { isUndefined } from "./utilities/index.mjs";
|
|
3
3
|
import { onScopeDispose, shallowRef, toValue } from "vue";
|
|
4
4
|
//#region src/composables/useTimer/index.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as MatchRange, C as resolveIds, D as isV0Error, E as V0Error, F as hexToRgb, I as rgbToHex, M as apca, N as foreground, O as FindMatchRangesOptions, P as RGB, S as range, T as useId, _ as isSymbol, a as getActiveElement, b as mergeDeep, c as isElement, d as isNull, f as isNullOrUndefined, g as isString, h as isPrimitive, i as clamp, j as findMatchRanges, k as IgnoreAccents, l as isFunction, m as isObject, n as instanceName, o as isArray, p as isNumber, r as UNSAFE_KEYS, s as isBoolean, t as instanceExists, u as isNaN, v as isThenable, w as resolveIndexes, x as pxToNumber, y as isUndefined } from "../index-
|
|
1
|
+
import { A as MatchRange, C as resolveIds, D as isV0Error, E as V0Error, F as hexToRgb, I as rgbToHex, M as apca, N as foreground, O as FindMatchRangesOptions, P as RGB, S as range, T as useId, _ as isSymbol, a as getActiveElement, b as mergeDeep, c as isElement, d as isNull, f as isNullOrUndefined, g as isString, h as isPrimitive, i as clamp, j as findMatchRanges, k as IgnoreAccents, l as isFunction, m as isObject, n as instanceName, o as isArray, p as isNumber, r as UNSAFE_KEYS, s as isBoolean, t as instanceExists, u as isNaN, v as isThenable, w as resolveIndexes, x as pxToNumber, y as isUndefined } from "../index-DMQv04YO.mjs";
|
|
2
2
|
export { FindMatchRangesOptions, IgnoreAccents, MatchRange, RGB, UNSAFE_KEYS, V0Error, apca, clamp, findMatchRanges, foreground, getActiveElement, hexToRgb, instanceExists, instanceName, isArray, isBoolean, isElement, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isSymbol, isThenable, isUndefined, isV0Error, mergeDeep, pxToNumber, range, resolveIds, resolveIndexes, rgbToHex, useId };
|