@vuetify/v0 1.0.5 → 1.2.0
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 +8 -0
- package/dist/{adapter-Butx_2UU.d.mts → adapter-BXunW_mw.d.mts} +1 -1
- package/dist/{createPagination-B5dfqY-a.mjs → adapter-BiQV5j8B.mjs} +98 -3
- package/dist/adapter-ClB-53_F.d.mts +62 -0
- package/dist/{adapter-hq9YlPOF.d.mts → adapter-CqS8xexO.d.mts} +2 -2
- package/dist/adapter-CrRJuxRk.mjs +21 -0
- package/dist/{adapter-_srNCBEi.d.mts → adapter-PDTe5nFT.d.mts} +6 -7
- package/dist/{adapter-lS_VpRow.mjs → adapter-TiGrumDi.mjs} +3 -1
- package/dist/browser/index.d.ts +17953 -15766
- package/dist/browser/index.js +16633 -14006
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/{components-OCsY4P1f.mjs → components-DBhVg-t1.mjs} +4253 -2247
- package/dist/composables/index.d.mts +22 -20
- package/dist/composables/index.mjs +37 -34
- package/dist/{composables-xhcxXjuE.mjs → composables-ZGhVN2EJ.mjs} +47 -1066
- package/dist/{consola-BPGkJp_q.d.mts → consola-CdMU53rU.d.mts} +1 -1
- package/dist/constants/index.d.mts +1 -1
- package/dist/constants/index.mjs +1 -1
- package/dist/{createDataTable-D38H0Zbp.mjs → createDataTable-VmQEDn-7.mjs} +23 -7
- package/dist/{createGroup-CjUHFae5.mjs → createGroup-B_LL7xRr.mjs} +2 -2
- package/dist/createPlugin-Oo6t-vBw.mjs +157 -0
- package/dist/{createRegistry-B8VqA-QF.mjs → createRegistry-DVdvep0v.mjs} +1 -1
- package/dist/{createSelection-BXd5clS0.mjs → createSelection-BNdDz8oY.mjs} +1 -1
- package/dist/{createSingle-Bdkfht_B.mjs → createSingle-DHyIQ9Cj.mjs} +1 -1
- package/dist/{createTokens-vgyk_0vA.mjs → createTokens-DoISbwd7.mjs} +2 -2
- 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 +4 -4
- 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 +5 -5
- package/dist/data-table/index.mjs +5 -5
- package/dist/date/index.d.mts +1 -1
- package/dist/date/index.mjs +2 -2
- 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 +1 -1
- package/dist/features/adapters/posthog/index.d.mts +1 -1
- package/dist/features/adapters/posthog/index.mjs +2 -2
- package/dist/features/index.d.mts +2 -2
- package/dist/features/index.mjs +2 -2
- package/dist/{flagsmith-DA2GCyGv.d.mts → flagsmith-DcIDrI7_.d.mts} +1 -1
- package/dist/{globals-B7ejLnrz.mjs → globals-DaoKtIGF.mjs} +1 -1
- package/dist/{index-DY81ptHb.d.mts → index-Cm6CbqI6.d.mts} +7494 -5834
- package/dist/{index-CrAgM2EJ.d.mts → index-Cx0cWGlx.d.mts} +493 -132
- package/dist/{index-QnpcDsV7.d.mts → index-D0ub61GV.d.mts} +2 -2
- package/dist/{index-RGiSdjYt.d.mts → index-DSPkZ0ql.d.mts} +2 -2
- package/dist/{index-DCtHbY0a.d.mts → index-Di9e8sOm.d.mts} +24 -19
- package/dist/{index-DF0tMI2_.d.mts → index-DjRE4lLl.d.mts} +108 -2
- package/dist/index.d.mts +25 -24
- package/dist/index.mjs +40 -37
- package/dist/json/attributes.json +488 -0
- package/dist/json/importMap.json +92 -0
- package/dist/json/tags.json +234 -0
- package/dist/json/web-types.json +1540 -113
- package/dist/{launchdarkly-Bp8p9PMD.d.mts → launchdarkly-CUzunYol.d.mts} +1 -1
- package/dist/locale/adapters/index.d.mts +2 -2
- 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 -1
- package/dist/locale/adapters/vue-i18n/index.mjs +1 -1
- package/dist/locale/index.d.mts +3 -3
- package/dist/locale/index.mjs +3 -3
- package/dist/locale/messages/en/index.d.mts +5 -0
- package/dist/locale/messages/en/index.mjs +6 -1
- package/dist/logger/adapters/consola/index.d.mts +1 -1
- package/dist/logger/adapters/index.d.mts +4 -4
- package/dist/logger/adapters/index.mjs +1 -1
- package/dist/logger/adapters/pino/index.d.mts +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 +5 -5
- package/dist/logger/index.mjs +2 -2
- package/dist/notifications/index.d.mts +1 -1
- package/dist/notifications/index.mjs +2 -2
- package/dist/palettes/ant/index.d.mts +1 -1
- package/dist/palettes/index.d.mts +3 -3
- package/dist/palettes/material/index.d.mts +1 -1
- package/dist/palettes/md1/index.d.mts +1 -1
- package/dist/palettes/md2/index.d.mts +1 -1
- package/dist/palettes/radix/index.d.mts +1 -1
- package/dist/palettes/tailwind/index.d.mts +1 -1
- package/dist/permissions/adapters/index.d.mts +1 -1
- package/dist/permissions/adapters/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-B6BI1AOK.d.mts → pino-DjeWBFnj.d.mts} +1 -1
- package/dist/popover/adapters/floating-ui/index.d.mts +25 -0
- package/dist/popover/adapters/floating-ui/index.mjs +98 -0
- package/dist/popover/index.d.mts +3 -0
- package/dist/popover/index.mjs +3 -0
- package/dist/{posthog-sFqk0bGy.d.mts → posthog-CJAYssdr.d.mts} +1 -1
- package/dist/rules/index.d.mts +1 -1
- package/dist/rules/index.mjs +1 -1
- package/dist/{server-DbtTGb67.d.mts → server-5vbJ7GGs.d.mts} +2 -2
- package/dist/{server-D5BJBjB0.mjs → server-m7iD1vOr.mjs} +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 +3 -3
- 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 +2 -2
- package/dist/theme/index.mjs +4 -4
- package/dist/types/index.d.mts +1 -1
- package/dist/{unhead-DxiB3P5p.mjs → unhead-C8zbWr45.mjs} +2 -2
- package/dist/{useEventListener-BjWJPfYS.mjs → useEventListener-2eAMwUdw.mjs} +2 -2
- package/dist/useFeatures-DLafCOWt.mjs +221 -0
- package/dist/{useLocale-B2BAEieU.mjs → useLocale-K_45ulPt.mjs} +4 -4
- package/dist/{useLogger-CXKIZhks.mjs → useLogger-YyWuYvrH.mjs} +5 -159
- package/dist/{useNotifications-Czgbh8Ns.mjs → useNotifications-Kh_KvM7j.mjs} +57 -154
- package/dist/{usePermissions-BkndJNpk.mjs → usePermissions-BCGwsOES.mjs} +4 -4
- package/dist/usePopover-BTo0AGIQ.mjs +420 -0
- package/dist/{useRovingFocus-Cn96TXRw.mjs → useRovingFocus-CkRnVmJ1.mjs} +1122 -531
- package/dist/{useRules-NzJChxfk.mjs → useRules-BuE5ffOJ.mjs} +3 -2
- package/dist/{useStorage-D6xihSHv.mjs → useStorage-BT8-mjVs.mjs} +5 -4
- package/dist/useTheme-DkK6tPqY.mjs +445 -0
- package/dist/useTimer-CGVXk397.mjs +151 -0
- package/dist/utilities/index.d.mts +2 -2
- package/dist/utilities/index.mjs +181 -2
- package/dist/{v0-BFMaRqAx.mjs → v0-B_53w7Fu.mjs} +2 -2
- package/dist/{v0-BnUwMaOv.d.mts → v0-CDW1Ktk-.d.mts} +1 -1
- package/dist/{v0-gU93DxmF.mjs → v0-D0Exc2bO.mjs} +2 -2
- package/dist/{v0-rSxMW8FJ.d.mts → v0-DfFK-p4X.d.mts} +1 -1
- package/dist/{v0-DotXXGXU.d.mts → v0-GI9U-rPA.d.mts} +2 -2
- package/dist/{v0-eZcJPyii.mjs → v0-SuxTihEe.mjs} +1 -1
- package/dist/{v0-A4GLojAr.mjs → v0-yZ2ZUtVF.mjs} +1 -2
- package/dist/{virtual-DFvOoeG6.mjs → virtual-Bbu26O_h.mjs} +1 -2
- package/dist/{virtual-C-NsLue0.d.mts → virtual-JIdFLpTQ.d.mts} +2 -2
- package/package.json +8 -1
- package/dist/adapter-CVoWg0sw.mjs +0 -99
- package/dist/useFeatures-DcgU66KC.mjs +0 -124
- package/dist/useTheme-BuXEQdPz.mjs +0 -162
- /package/dist/{adapter-CTsckKAR.mjs → adapter-8UADsA3-.mjs} +0 -0
- /package/dist/{adapter-BCtceV3b.mjs → adapter-BuSfpxur.mjs} +0 -0
- /package/dist/{adapter-Bc0yPSfo.d.mts → adapter-D5nT3bLw.d.mts} +0 -0
- /package/dist/{adapter-bwZo7b5p.mjs → adapter-D8zizQVP.mjs} +0 -0
- /package/dist/{adapter-BYzU4Ey5.d.mts → adapter-ryk5H6YZ.d.mts} +0 -0
- /package/dist/{index-CROz1VSV.d.mts → index-CX869wwk.d.mts} +0 -0
- /package/dist/{index-FtE8MXJ_.d.mts → index-CsuikFeJ.d.mts} +0 -0
- /package/dist/{index-DidZKN6S.d.mts → index-Djhiy3nS.d.mts} +0 -0
- /package/dist/{index-CyNk9FpR.d.mts → index-DtiaWx5U.d.mts} +0 -0
- /package/dist/{index-DXMlYoiQ.d.mts → index-H_hl6-4b.d.mts} +0 -0
- /package/dist/{index-BgCkepP_.d.mts → index-u_qSc2xS.d.mts} +0 -0
- /package/dist/{memory-DbyZeNjg.d.mts → memory-B7z1RR9r.d.mts} +0 -0
- /package/dist/{memory-BJjkQzxs.mjs → memory-CR6zvuaP.mjs} +0 -0
- /package/dist/{toArray-C89ZaEuF.mjs → toArray-MY9Kb1Qy.mjs} +0 -0
- /package/dist/{v0-UNyykD27.mjs → v0-Ch0yBKEj.mjs} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as IN_BROWSER, c as SUPPORTS_MUTATION_OBSERVER, d as __LOGGER_ENABLED__, f as version, i as isSelfClosingTag, l as SUPPORTS_OBSERVER, n as SELF_CLOSING_TAGS, o as SUPPORTS_INTERSECTION_OBSERVER, r as SelfClosingElement, s as SUPPORTS_MATCH_MEDIA, t as HTMLElementName, u as SUPPORTS_TOUCH } from "../index-
|
|
1
|
+
import { a as IN_BROWSER, c as SUPPORTS_MUTATION_OBSERVER, d as __LOGGER_ENABLED__, f as version, i as isSelfClosingTag, l as SUPPORTS_OBSERVER, n as SELF_CLOSING_TAGS, o as SUPPORTS_INTERSECTION_OBSERVER, r as SelfClosingElement, s as SUPPORTS_MATCH_MEDIA, t as HTMLElementName, u as SUPPORTS_TOUCH } from "../index-u_qSc2xS.mjs";
|
|
2
2
|
export { HTMLElementName, IN_BROWSER, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, SelfClosingElement, __LOGGER_ENABLED__, isSelfClosingTag, version };
|
package/dist/constants/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as isSelfClosingTag, t as SELF_CLOSING_TAGS } from "../htmlElements-CHXZfsZu.mjs";
|
|
2
|
-
import { a as SUPPORTS_OBSERVER, c as version, i as SUPPORTS_MUTATION_OBSERVER, n as SUPPORTS_INTERSECTION_OBSERVER, o as SUPPORTS_TOUCH, r as SUPPORTS_MATCH_MEDIA, s as __LOGGER_ENABLED__, t as IN_BROWSER } from "../globals-
|
|
2
|
+
import { a as SUPPORTS_OBSERVER, c as version, i as SUPPORTS_MUTATION_OBSERVER, n as SUPPORTS_INTERSECTION_OBSERVER, o as SUPPORTS_TOUCH, r as SUPPORTS_MATCH_MEDIA, s as __LOGGER_ENABLED__, t as IN_BROWSER } from "../globals-DaoKtIGF.mjs";
|
|
3
3
|
export { IN_BROWSER, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, __LOGGER_ENABLED__, isSelfClosingTag, version };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isNullOrUndefined } from "./utilities/index.mjs";
|
|
2
2
|
import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
|
|
3
|
-
import { t as createRegistry } from "./createRegistry-
|
|
4
|
-
import { a as useLocale } from "./useLocale-
|
|
5
|
-
import { i as useProxyRegistry, t as createGroup } from "./createGroup-
|
|
6
|
-
import { t as ClientDataTableAdapter } from "./v0-
|
|
7
|
-
import { computed, shallowReactive, shallowReadonly, shallowRef, toRef, watch } from "vue";
|
|
3
|
+
import { t as createRegistry } from "./createRegistry-DVdvep0v.mjs";
|
|
4
|
+
import { a as useLocale } from "./useLocale-K_45ulPt.mjs";
|
|
5
|
+
import { i as useProxyRegistry, t as createGroup } from "./createGroup-B_LL7xRr.mjs";
|
|
6
|
+
import { t as ClientDataTableAdapter } from "./v0-yZ2ZUtVF.mjs";
|
|
7
|
+
import { computed, shallowReactive, shallowReadonly, shallowRef, toRef, toValue, watch } from "vue";
|
|
8
8
|
//#region src/composables/createDataTable/columns.ts
|
|
9
9
|
/**
|
|
10
10
|
* Recursively extract leaf columns (those without children).
|
|
@@ -117,6 +117,9 @@ function resolveHeaders(columns) {
|
|
|
117
117
|
* table.sort.toggle('name')
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
|
+
function recordId(row) {
|
|
121
|
+
return row.id;
|
|
122
|
+
}
|
|
120
123
|
/**
|
|
121
124
|
* Creates a data table instance with sort controls, selection, and an
|
|
122
125
|
* adapter-driven data pipeline.
|
|
@@ -181,7 +184,7 @@ function createDataTable(options = {}) {
|
|
|
181
184
|
});
|
|
182
185
|
const leaves = computed(() => /* @__PURE__ */ extractLeaves(columns.values()));
|
|
183
186
|
const headers = computed(() => /* @__PURE__ */ resolveHeaders(columns.values()));
|
|
184
|
-
const sortable = computed(() => leaves.value.filter((col) => col.sortable === true));
|
|
187
|
+
const sortable = computed(() => leaves.value.filter((col) => toValue(col.sortable) === true));
|
|
185
188
|
const group = createGroup({ multiple: sortMultiple });
|
|
186
189
|
const order = shallowReactive([]);
|
|
187
190
|
watch(sortable, (next) => {
|
|
@@ -273,7 +276,7 @@ function createDataTable(options = {}) {
|
|
|
273
276
|
};
|
|
274
277
|
const filterable = computed(() => {
|
|
275
278
|
const ids = [];
|
|
276
|
-
for (const col of leaves.value) if (col.filterable === true) ids.push(String(col.id));
|
|
279
|
+
for (const col of leaves.value) if (toValue(col.filterable) === true) ids.push(String(col.id));
|
|
277
280
|
return ids;
|
|
278
281
|
});
|
|
279
282
|
const customSorts = computed(() => {
|
|
@@ -473,12 +476,25 @@ function createDataTable(options = {}) {
|
|
|
473
476
|
opened.clear();
|
|
474
477
|
}
|
|
475
478
|
};
|
|
479
|
+
function rank(source) {
|
|
480
|
+
const ranked = sortedItems.value;
|
|
481
|
+
const positions = /* @__PURE__ */ new Map();
|
|
482
|
+
for (const [index, row] of ranked.entries()) {
|
|
483
|
+
positions.set(row, index);
|
|
484
|
+
const id = recordId(row);
|
|
485
|
+
if (!/* @__PURE__ */ isNullOrUndefined(id)) positions.set(id, index);
|
|
486
|
+
}
|
|
487
|
+
return [...source].toSorted((a, b) => {
|
|
488
|
+
return (positions.get(a) ?? positions.get(recordId(a)) ?? Infinity) - (positions.get(b) ?? positions.get(recordId(b)) ?? Infinity);
|
|
489
|
+
});
|
|
490
|
+
}
|
|
476
491
|
return {
|
|
477
492
|
...registry,
|
|
478
493
|
items: visible,
|
|
479
494
|
allItems,
|
|
480
495
|
filteredItems,
|
|
481
496
|
sortedItems,
|
|
497
|
+
rank,
|
|
482
498
|
columns,
|
|
483
499
|
leaves,
|
|
484
500
|
headers,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveIds, resolveIndexes, useId as useId$1 } from "./utilities/index.mjs";
|
|
2
2
|
import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
|
|
3
|
-
import { t as createSelection } from "./createSelection-
|
|
4
|
-
import { t as toArray } from "./toArray-
|
|
3
|
+
import { t as createSelection } from "./createSelection-BNdDz8oY.mjs";
|
|
4
|
+
import { t as toArray } from "./toArray-MY9Kb1Qy.mjs";
|
|
5
5
|
import { computed, onScopeDispose, reactive, shallowReactive, shallowRef, toRef, toValue } from "vue";
|
|
6
6
|
//#region src/composables/useProxyRegistry/index.ts
|
|
7
7
|
/**
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { isNullOrUndefined, isUndefined } from "./utilities/index.mjs";
|
|
2
|
+
import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
|
|
3
|
+
import { hasInjectionContext, inject, watch } from "vue";
|
|
4
|
+
//#region src/composables/createPlugin/index.ts
|
|
5
|
+
/**
|
|
6
|
+
* @module createPlugin
|
|
7
|
+
*
|
|
8
|
+
* @see https://vuejs.org/guide/reusability/plugins.html
|
|
9
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-plugin
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Factory for creating Vue plugins with proper context provision.
|
|
13
|
+
*
|
|
14
|
+
* Wraps the provide function in app.runWithContext() to ensure proper execution context,
|
|
15
|
+
* allowing plugins to safely provide dependency injection contexts at the application level.
|
|
16
|
+
*
|
|
17
|
+
* Also exports `createPluginContext` — a higher-level factory that generates the standard
|
|
18
|
+
* context/plugin/consumer triple for plugin composables, eliminating boilerplate.
|
|
19
|
+
* Supports `persist()` / `restore()` lifecycle hooks for saving and rehydrating plugin state.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { createPlugin } from '@vuetify/v0'
|
|
24
|
+
*
|
|
25
|
+
* const plugin = createPlugin({
|
|
26
|
+
* namespace: 'v0:my-plugin',
|
|
27
|
+
* provide: app => app.provide('my-key', { greet: () => 'hello' }),
|
|
28
|
+
* })
|
|
29
|
+
* // app.use(plugin)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
const INSTALLED = Symbol.for("v0:installed-plugins");
|
|
33
|
+
function getInstalled(app) {
|
|
34
|
+
const ctx = app._context;
|
|
35
|
+
return ctx[INSTALLED] ??= /* @__PURE__ */ new Set();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new Vue plugin.
|
|
39
|
+
*
|
|
40
|
+
* @param options The plugin options.
|
|
41
|
+
* @returns A new Vue plugin.
|
|
42
|
+
*
|
|
43
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-plugin
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* export const [useContext, provideContext] = createContext<MyContext>('my-plugin')
|
|
48
|
+
*
|
|
49
|
+
* const context = {}
|
|
50
|
+
*
|
|
51
|
+
* export const MyPlugin = createPlugin({
|
|
52
|
+
* namespace: 'my-plugin',
|
|
53
|
+
* provide: (app) => {
|
|
54
|
+
* provideContext(context, app)
|
|
55
|
+
* },
|
|
56
|
+
* setup: (app) => {
|
|
57
|
+
* // Optional setup logic
|
|
58
|
+
* },
|
|
59
|
+
* })
|
|
60
|
+
*/
|
|
61
|
+
function createPlugin(options) {
|
|
62
|
+
return { install(app) {
|
|
63
|
+
app.runWithContext(() => {
|
|
64
|
+
const installed = getInstalled(app);
|
|
65
|
+
if (installed.has(options.namespace)) return;
|
|
66
|
+
installed.add(options.namespace);
|
|
67
|
+
options.provide(app);
|
|
68
|
+
options.setup?.(app);
|
|
69
|
+
});
|
|
70
|
+
} };
|
|
71
|
+
}
|
|
72
|
+
function deriveKey(namespace) {
|
|
73
|
+
return namespace.startsWith("v0:") ? namespace.slice(3) : namespace;
|
|
74
|
+
}
|
|
75
|
+
function getPersistedStorage() {
|
|
76
|
+
return useContext("v0:storage");
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Creates the three standard functions for a plugin composable.
|
|
80
|
+
*
|
|
81
|
+
* @param defaultNamespace The default DI namespace string (e.g. `'v0:logger'`).
|
|
82
|
+
* @param factory Function that creates the composable context instance from options.
|
|
83
|
+
* @param config Optional setup callback and fallback factory.
|
|
84
|
+
* @returns A readonly tuple: `[createXContext, createXPlugin, useX]`.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* // Simple — no setup or fallback
|
|
89
|
+
* export const [createStorageContext, createStoragePlugin, useStorage] =
|
|
90
|
+
* createPluginContext('v0:storage', options => createStorage(options))
|
|
91
|
+
*
|
|
92
|
+
* // With fallback — safe outside component instances
|
|
93
|
+
* export const [createLoggerContext, createLoggerPlugin, useLogger] =
|
|
94
|
+
* createPluginContext('v0:logger', options => createLogger(options), {
|
|
95
|
+
* fallback: ns => createFallbackLogger(ns),
|
|
96
|
+
* setup: (context) => {
|
|
97
|
+
* if (__DEV__ && IN_BROWSER) (window as Window & { __v0Logger__?: typeof context }).__v0Logger__ = context
|
|
98
|
+
* },
|
|
99
|
+
* })
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
function createPluginContext(defaultNamespace, factory, config) {
|
|
103
|
+
function createXContext(_options = {}) {
|
|
104
|
+
const { namespace = defaultNamespace, persist: _persist, ...options } = _options;
|
|
105
|
+
return createTrinity(namespace, factory(options));
|
|
106
|
+
}
|
|
107
|
+
function createXPlugin(_options = {}) {
|
|
108
|
+
const { namespace = defaultNamespace, persist: shouldPersist, ...options } = _options;
|
|
109
|
+
let context;
|
|
110
|
+
return createPlugin({
|
|
111
|
+
namespace,
|
|
112
|
+
provide: (app) => {
|
|
113
|
+
const [, provide, ctx] = createXContext({
|
|
114
|
+
...options,
|
|
115
|
+
namespace
|
|
116
|
+
});
|
|
117
|
+
context = ctx;
|
|
118
|
+
provide(context, app);
|
|
119
|
+
if (shouldPersist && config?.restore) {
|
|
120
|
+
const storage = getPersistedStorage();
|
|
121
|
+
const key = deriveKey(namespace);
|
|
122
|
+
const saved = storage.get(key);
|
|
123
|
+
if (!/* @__PURE__ */ isNullOrUndefined(saved.value)) config.restore(context, saved.value);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
setup: config?.setup || shouldPersist ? (app) => {
|
|
127
|
+
const ctx = context;
|
|
128
|
+
config?.setup?.(ctx, app, options);
|
|
129
|
+
if (shouldPersist && config?.persist) {
|
|
130
|
+
const storage = getPersistedStorage();
|
|
131
|
+
const key = deriveKey(namespace);
|
|
132
|
+
const stored = storage.get(key);
|
|
133
|
+
const stop = watch(() => config.persist(ctx), (val) => {
|
|
134
|
+
stored.value = val;
|
|
135
|
+
});
|
|
136
|
+
app.onUnmount(stop);
|
|
137
|
+
}
|
|
138
|
+
} : void 0
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function useX(namespace = defaultNamespace) {
|
|
142
|
+
if (config?.fallback) {
|
|
143
|
+
if (!hasInjectionContext()) return config.fallback(namespace);
|
|
144
|
+
const provided = inject(namespace, void 0);
|
|
145
|
+
if (!/* @__PURE__ */ isUndefined(provided)) return provided;
|
|
146
|
+
return config.fallback(namespace);
|
|
147
|
+
}
|
|
148
|
+
return useContext(namespace);
|
|
149
|
+
}
|
|
150
|
+
return [
|
|
151
|
+
createXContext,
|
|
152
|
+
createXPlugin,
|
|
153
|
+
useX
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
export { createPluginContext as n, createPlugin as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clamp, isNullOrUndefined, isUndefined, useId as useId$1 } from "./utilities/index.mjs";
|
|
2
2
|
import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
|
|
3
|
-
import { i as useLogger } from "./useLogger-
|
|
3
|
+
import { i as useLogger } from "./useLogger-YyWuYvrH.mjs";
|
|
4
4
|
import { shallowReactive, shallowRef } from "vue";
|
|
5
5
|
//#region src/composables/createRegistry/index.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isUndefined, resolveIds, useId as useId$1 } from "./utilities/index.mjs";
|
|
2
2
|
import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
|
|
3
|
-
import { t as createRegistry } from "./createRegistry-
|
|
3
|
+
import { t as createRegistry } from "./createRegistry-DVdvep0v.mjs";
|
|
4
4
|
import { computed, isRef, shallowReactive, toRaw, toRef, toValue } from "vue";
|
|
5
5
|
//#region src/composables/createModel/index.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
|
|
2
|
-
import { t as createSelection } from "./createSelection-
|
|
2
|
+
import { t as createSelection } from "./createSelection-BNdDz8oY.mjs";
|
|
3
3
|
import { toRef } from "vue";
|
|
4
4
|
//#region src/composables/createSingle/index.ts
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UNSAFE_KEYS, isObject, isString, isUndefined } from "./utilities/index.mjs";
|
|
2
2
|
import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
|
|
3
|
-
import { i as useLogger } from "./useLogger-
|
|
4
|
-
import { t as createRegistry } from "./createRegistry-
|
|
3
|
+
import { i as useLogger } from "./useLogger-YyWuYvrH.mjs";
|
|
4
|
+
import { t as createRegistry } from "./createRegistry-DVdvep0v.mjs";
|
|
5
5
|
//#region src/composables/createTokens/index.ts
|
|
6
6
|
/**
|
|
7
7
|
* @module createTokens
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ClientDataTableAdapter } from "../../../v0-
|
|
1
|
+
import { t as ClientDataTableAdapter } from "../../../v0-GI9U-rPA.mjs";
|
|
2
2
|
export { ClientDataTableAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ClientDataTableAdapter } from "../../../v0-
|
|
1
|
+
import { t as ClientDataTableAdapter } from "../../../v0-yZ2ZUtVF.mjs";
|
|
2
2
|
export { ClientDataTableAdapter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as SortEntry, i as SortDirection, n as DataTableAdapterContext, r as DataTableAdapterResult, t as DataTableAdapter } from "../../adapter-
|
|
2
|
-
import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../../server-
|
|
3
|
-
import { t as ClientDataTableAdapter } from "../../v0-
|
|
4
|
-
import { t as VirtualDataTableAdapter } from "../../virtual-
|
|
1
|
+
import { a as SortEntry, i as SortDirection, n as DataTableAdapterContext, r as DataTableAdapterResult, t as DataTableAdapter } from "../../adapter-PDTe5nFT.mjs";
|
|
2
|
+
import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../../server-5vbJ7GGs.mjs";
|
|
3
|
+
import { t as ClientDataTableAdapter } from "../../v0-GI9U-rPA.mjs";
|
|
4
|
+
import { t as VirtualDataTableAdapter } from "../../virtual-JIdFLpTQ.mjs";
|
|
5
5
|
export { ClientDataTableAdapter, DataTableAdapter, DataTableAdapterContext, DataTableAdapterResult, ServerDataTableAdapter, ServerDataTableAdapterOptions, SortDirection, SortEntry, VirtualDataTableAdapter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as DataTableAdapter } from "../../adapter-
|
|
2
|
-
import { t as ClientDataTableAdapter } from "../../v0-
|
|
3
|
-
import { t as ServerDataTableAdapter } from "../../server-
|
|
4
|
-
import { t as VirtualDataTableAdapter } from "../../virtual-
|
|
1
|
+
import { t as DataTableAdapter } from "../../adapter-BiQV5j8B.mjs";
|
|
2
|
+
import { t as ClientDataTableAdapter } from "../../v0-yZ2ZUtVF.mjs";
|
|
3
|
+
import { t as ServerDataTableAdapter } from "../../server-m7iD1vOr.mjs";
|
|
4
|
+
import { t as VirtualDataTableAdapter } from "../../virtual-Bbu26O_h.mjs";
|
|
5
5
|
export { ClientDataTableAdapter, DataTableAdapter, ServerDataTableAdapter, VirtualDataTableAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../../../server-
|
|
1
|
+
import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../../../server-5vbJ7GGs.mjs";
|
|
2
2
|
export { ServerDataTableAdapter, ServerDataTableAdapterOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ServerDataTableAdapter } from "../../../server-
|
|
1
|
+
import { t as ServerDataTableAdapter } from "../../../server-m7iD1vOr.mjs";
|
|
2
2
|
export { ServerDataTableAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as VirtualDataTableAdapter } from "../../../virtual-
|
|
1
|
+
import { t as VirtualDataTableAdapter } from "../../../virtual-JIdFLpTQ.mjs";
|
|
2
2
|
export { VirtualDataTableAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as VirtualDataTableAdapter } from "../../../virtual-
|
|
1
|
+
import { t as VirtualDataTableAdapter } from "../../../virtual-Bbu26O_h.mjs";
|
|
2
2
|
export { VirtualDataTableAdapter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as SortEntry, i as SortDirection, n as DataTableAdapterContext, r as DataTableAdapterResult, t as DataTableAdapter } from "../adapter-
|
|
2
|
-
import { _ as ColumnNode, a as DataTableExpansion, b as extractLeaves, c as DataTableOptions, d as DataTableTicket, f as DataTableTicketInput, g as useDataTable, h as createDataTableContext, i as DataTableContextOptions, l as DataTableSelection, m as createDataTable, n as DataTableColumnTicketInput, o as DataTableGroup, p as SelectStrategy, r as DataTableContext, s as DataTableGrouping, t as DataTableColumnTicket, u as DataTableSort, v as InternalHeader, x as resolveHeaders, y as computeDepth } from "../index-
|
|
3
|
-
import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../server-
|
|
4
|
-
import { t as ClientDataTableAdapter } from "../v0-
|
|
5
|
-
import { t as VirtualDataTableAdapter } from "../virtual-
|
|
1
|
+
import { a as SortEntry, i as SortDirection, n as DataTableAdapterContext, r as DataTableAdapterResult, t as DataTableAdapter } from "../adapter-PDTe5nFT.mjs";
|
|
2
|
+
import { _ as ColumnNode, a as DataTableExpansion, b as extractLeaves, c as DataTableOptions, d as DataTableTicket, f as DataTableTicketInput, g as useDataTable, h as createDataTableContext, i as DataTableContextOptions, l as DataTableSelection, m as createDataTable, n as DataTableColumnTicketInput, o as DataTableGroup, p as SelectStrategy, r as DataTableContext, s as DataTableGrouping, t as DataTableColumnTicket, u as DataTableSort, v as InternalHeader, x as resolveHeaders, y as computeDepth } from "../index-Di9e8sOm.mjs";
|
|
3
|
+
import { n as ServerDataTableAdapterOptions, t as ServerDataTableAdapter } from "../server-5vbJ7GGs.mjs";
|
|
4
|
+
import { t as ClientDataTableAdapter } from "../v0-GI9U-rPA.mjs";
|
|
5
|
+
import { t as VirtualDataTableAdapter } from "../virtual-JIdFLpTQ.mjs";
|
|
6
6
|
export { ClientDataTableAdapter, ColumnNode, DataTableAdapter, DataTableAdapterContext, DataTableAdapterResult, DataTableColumnTicket, DataTableColumnTicketInput, DataTableContext, DataTableContextOptions, DataTableExpansion, DataTableGroup, DataTableGrouping, DataTableOptions, DataTableSelection, DataTableSort, DataTableTicket, DataTableTicketInput, InternalHeader, SelectStrategy, ServerDataTableAdapter, ServerDataTableAdapterOptions, SortDirection, SortEntry, VirtualDataTableAdapter, computeDepth, createDataTable, createDataTableContext, extractLeaves, resolveHeaders, useDataTable };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as DataTableAdapter } from "../adapter-
|
|
2
|
-
import { t as ClientDataTableAdapter } from "../v0-
|
|
3
|
-
import { a as extractLeaves, i as computeDepth, n as createDataTableContext, o as resolveHeaders, r as useDataTable, t as createDataTable } from "../createDataTable-
|
|
4
|
-
import { t as ServerDataTableAdapter } from "../server-
|
|
5
|
-
import { t as VirtualDataTableAdapter } from "../virtual-
|
|
1
|
+
import { t as DataTableAdapter } from "../adapter-BiQV5j8B.mjs";
|
|
2
|
+
import { t as ClientDataTableAdapter } from "../v0-yZ2ZUtVF.mjs";
|
|
3
|
+
import { a as extractLeaves, i as computeDepth, n as createDataTableContext, o as resolveHeaders, r as useDataTable, t as createDataTable } from "../createDataTable-VmQEDn-7.mjs";
|
|
4
|
+
import { t as ServerDataTableAdapter } from "../server-m7iD1vOr.mjs";
|
|
5
|
+
import { t as VirtualDataTableAdapter } from "../virtual-Bbu26O_h.mjs";
|
|
6
6
|
export { ClientDataTableAdapter, DataTableAdapter, ServerDataTableAdapter, VirtualDataTableAdapter, computeDepth, createDataTable, createDataTableContext, extractLeaves, resolveHeaders, useDataTable };
|
package/dist/date/index.d.mts
CHANGED
package/dist/date/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as IN_BROWSER } from "../globals-
|
|
1
|
+
import { t as IN_BROWSER } from "../globals-DaoKtIGF.mjs";
|
|
2
2
|
import { isNull, isNullOrUndefined, isNumber, isString } from "../utilities/index.mjs";
|
|
3
|
-
import { n as deriveWeekInfo, t as DateAdapter } from "../adapter-
|
|
3
|
+
import { n as deriveWeekInfo, t as DateAdapter } from "../adapter-BuSfpxur.mjs";
|
|
4
4
|
import { Temporal } from "@js-temporal/polyfill";
|
|
5
5
|
//#region src/composables/useDate/adapters/v0.ts
|
|
6
6
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as FlagsmithFeaturesAdapter } from "../../../flagsmith-
|
|
1
|
+
import { t as FlagsmithFeaturesAdapter } from "../../../flagsmith-DcIDrI7_.mjs";
|
|
2
2
|
export { FlagsmithFeaturesAdapter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UNSAFE_KEYS, isNullOrUndefined } from "../../../utilities/index.mjs";
|
|
2
|
-
import { t as FeaturesAdapter } from "../../../adapter-
|
|
2
|
+
import { t as FeaturesAdapter } from "../../../adapter-8UADsA3-.mjs";
|
|
3
3
|
//#region src/composables/useFeatures/adapters/flagsmith.ts
|
|
4
4
|
/**
|
|
5
5
|
* @module FlagsmithFeaturesAdapter
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as LaunchDarklyFeaturesAdapter } from "../../../launchdarkly-
|
|
1
|
+
import { t as LaunchDarklyFeaturesAdapter } from "../../../launchdarkly-CUzunYol.mjs";
|
|
2
2
|
export { LaunchDarklyFeaturesAdapter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UNSAFE_KEYS, isBoolean } from "../../../utilities/index.mjs";
|
|
2
|
-
import { t as FeaturesAdapter } from "../../../adapter-
|
|
2
|
+
import { t as FeaturesAdapter } from "../../../adapter-8UADsA3-.mjs";
|
|
3
3
|
//#region src/composables/useFeatures/adapters/launchdarkly.ts
|
|
4
4
|
/**
|
|
5
5
|
* @module LaunchDarklyFeaturesAdapter
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PostHogFeaturesAdapter } from "../../../posthog-
|
|
1
|
+
import { t as PostHogFeaturesAdapter } from "../../../posthog-CJAYssdr.mjs";
|
|
2
2
|
export { PostHogFeaturesAdapter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as IN_BROWSER } from "../../../globals-
|
|
1
|
+
import { t as IN_BROWSER } from "../../../globals-DaoKtIGF.mjs";
|
|
2
2
|
import { UNSAFE_KEYS, isBoolean, isNullOrUndefined } from "../../../utilities/index.mjs";
|
|
3
|
-
import { t as FeaturesAdapter } from "../../../adapter-
|
|
3
|
+
import { t as FeaturesAdapter } from "../../../adapter-8UADsA3-.mjs";
|
|
4
4
|
//#region src/composables/useFeatures/adapters/posthog.ts
|
|
5
5
|
/**
|
|
6
6
|
* @module PostHogFeaturesAdapter
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _r as
|
|
2
|
-
import { n as FeaturesAdapterFlags, r as FeaturesAdapterValue, t as FeaturesAdapter } from "../adapter-
|
|
1
|
+
import { _r as FeatureTicketInput, br as createFeaturesPlugin, fr as FeatureContext, gr as FeatureTicket, hr as FeaturePluginOptions, mr as FeatureOptions, pr as FeatureContextOptions, vr as createFeatures, xr as useFeatures, yr as createFeaturesContext } from "../index-Cx0cWGlx.mjs";
|
|
2
|
+
import { n as FeaturesAdapterFlags, r as FeaturesAdapterValue, t as FeaturesAdapter } from "../adapter-BXunW_mw.mjs";
|
|
3
3
|
export { FeatureContext, FeatureContextOptions, FeatureOptions, FeaturePluginOptions, FeatureTicket, FeatureTicketInput, FeaturesAdapter, FeaturesAdapterFlags, FeaturesAdapterValue, createFeatures, createFeaturesContext, createFeaturesPlugin, useFeatures };
|
package/dist/features/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as FeaturesAdapter } from "../adapter-
|
|
2
|
-
import { i as useFeatures, n as createFeaturesContext, r as createFeaturesPlugin, t as createFeatures } from "../useFeatures-
|
|
1
|
+
import { t as FeaturesAdapter } from "../adapter-8UADsA3-.mjs";
|
|
2
|
+
import { i as useFeatures, n as createFeaturesContext, r as createFeaturesPlugin, t as createFeatures } from "../useFeatures-DLafCOWt.mjs";
|
|
3
3
|
export { FeaturesAdapter, createFeatures, createFeaturesContext, createFeaturesPlugin, useFeatures };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FeaturesAdapterFlags, t as FeaturesAdapter } from "./adapter-
|
|
1
|
+
import { n as FeaturesAdapterFlags, t as FeaturesAdapter } from "./adapter-BXunW_mw.mjs";
|
|
2
2
|
import { IFlagsmith, IInitConfig } from "@flagsmith/flagsmith";
|
|
3
3
|
|
|
4
4
|
//#region src/composables/useFeatures/adapters/flagsmith.d.ts
|
|
@@ -5,7 +5,7 @@ const SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof wind
|
|
|
5
5
|
const SUPPORTS_OBSERVER = IN_BROWSER && "ResizeObserver" in window;
|
|
6
6
|
const SUPPORTS_INTERSECTION_OBSERVER = IN_BROWSER && "IntersectionObserver" in window;
|
|
7
7
|
const SUPPORTS_MUTATION_OBSERVER = IN_BROWSER && "MutationObserver" in window;
|
|
8
|
-
const version = "1.0
|
|
8
|
+
const version = "1.2.0";
|
|
9
9
|
/* v8 ignore next -- build-time constant, __DEV__ short-circuits in tests */
|
|
10
10
|
const __LOGGER_ENABLED__ = typeof (process.env.NODE_ENV !== "production") !== "undefined" && process.env.NODE_ENV !== "production" || typeof process.env.VITE_LOGGER_ENABLED !== "undefined" && process.env.VITE_LOGGER_ENABLED === "true";
|
|
11
11
|
//#endregion
|