@vuetify/v0 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -3
- package/dist/adapter-BN-h5JbD.d.mts +344 -0
- package/dist/adapter-CJIj5ySf.d.mts +11 -0
- package/dist/adapter-D_0ptsPm.mjs +229 -0
- package/dist/adapters-BQ-Lr3PW.mjs +1 -0
- package/dist/adapters-DEXpW9If.mjs +1 -0
- package/dist/adapters-Q9WaOsJp.mjs +1 -0
- package/dist/adapters-SSDVth5e.mjs +1 -0
- package/dist/browser/index.js +5593 -4490
- package/dist/components/index.d.mts +20 -4
- package/dist/components/index.mjs +38 -6
- package/dist/{components-z56rRlS4.mjs → components-CMuzTJdK.mjs} +588 -90
- package/dist/composables/index.d.mts +17 -5
- package/dist/composables/index.mjs +36 -4
- package/dist/consola-DiUk9j3y.d.mts +15 -0
- package/dist/consola-GBy8XRuL.mjs +31 -0
- package/dist/constants/index.d.mts +1 -1
- package/dist/constants/index.mjs +3 -3
- package/dist/constants-B8pMSkcW.mjs +1 -0
- package/dist/createDataTable-BJnmvxfb.mjs +387 -0
- package/dist/createGroup-CPhp6FUh.mjs +363 -0
- package/dist/createPagination-cyOWlpfH.mjs +234 -0
- package/dist/createSelection-uqEbFgha.mjs +261 -0
- package/dist/createSingle-B59ya3aa.mjs +179 -0
- package/dist/createTokens-BlhLdHXE.mjs +682 -0
- package/dist/createTrinity-EeHQSsb6.mjs +149 -0
- package/dist/data-table/adapters/client/index.d.mts +3 -0
- package/dist/data-table/adapters/client/index.mjs +9 -0
- package/dist/data-table/adapters/index.d.mts +5 -0
- package/dist/data-table/adapters/index.mjs +12 -0
- package/dist/data-table/adapters/server/index.d.mts +3 -0
- package/dist/data-table/adapters/server/index.mjs +7 -0
- package/dist/data-table/adapters/virtual/index.d.mts +3 -0
- package/dist/data-table/adapters/virtual/index.mjs +9 -0
- package/dist/data-table/index.d.mts +7 -0
- package/dist/data-table/index.mjs +25 -0
- package/dist/date/index.d.mts +1 -1
- package/dist/date/index.mjs +19 -15
- package/dist/features/adapters/flagsmith/index.d.mts +16 -0
- package/dist/features/adapters/flagsmith/index.mjs +3 -0
- package/dist/features/adapters/launchdarkly/index.d.mts +15 -0
- package/dist/features/adapters/launchdarkly/index.mjs +3 -0
- package/dist/features/adapters/posthog/index.d.mts +15 -0
- package/dist/features/adapters/posthog/index.mjs +4 -0
- package/dist/features/index.d.mts +17 -0
- package/dist/features/index.mjs +18 -0
- package/dist/flagsmith-CHmpPGR7.mjs +40 -0
- package/dist/{globals-VwjZ5i4B.mjs → globals-B_GVfG06.mjs} +2 -2
- package/dist/index-7mWYFHA6.d.mts +251 -0
- package/dist/index-BDTbJClL.d.mts +11 -0
- package/dist/{index-DlxrzbvZ.d.mts → index-BFBN5Zl3.d.mts} +41 -1
- package/dist/index-BuOz3Rgm.d.mts +32 -0
- package/dist/{index-cPmI99rd.d.mts → index-Bv1VN_j5.d.mts} +1 -1
- package/dist/{index-PuLeBGZ3.d.mts → index-CQrDeqsK.d.mts} +894 -329
- package/dist/{index-CLKfXGEQ.d.mts → index-Dd0m0LIJ.d.mts} +2228 -1178
- package/dist/{index-CoO8LW8o.d.mts → index-UNwEBkQT.d.mts} +16 -2
- package/dist/index.d.mts +20 -8
- package/dist/index.mjs +39 -7
- package/dist/json/attributes.json +140 -0
- package/dist/json/importMap.json +36 -0
- package/dist/json/tags.json +75 -0
- package/dist/json/web-types.json +440 -1
- package/dist/launchdarkly-W8t8ZANX.mjs +28 -0
- package/dist/locale/adapters/index.d.mts +3 -0
- package/dist/locale/adapters/index.mjs +6 -0
- package/dist/locale/adapters/v0/index.d.mts +3 -0
- package/dist/locale/adapters/v0/index.mjs +5 -0
- package/dist/locale/index.d.mts +17 -0
- package/dist/locale/index.mjs +17 -0
- package/dist/logger/adapters/consola/index.d.mts +3 -0
- package/dist/logger/adapters/consola/index.mjs +3 -0
- package/dist/logger/adapters/index.d.mts +5 -0
- package/dist/logger/adapters/index.mjs +8 -0
- package/dist/logger/adapters/pino/index.d.mts +3 -0
- package/dist/logger/adapters/pino/index.mjs +5 -0
- package/dist/logger/adapters/v0/index.d.mts +3 -0
- package/dist/logger/adapters/v0/index.mjs +5 -0
- package/dist/logger/index.d.mts +17 -0
- package/dist/logger/index.mjs +10 -0
- package/dist/memory-BsZGbGnG.mjs +27 -0
- package/dist/memory-DVjquu_v.d.mts +25 -0
- package/dist/permissions/adapters/index.d.mts +18 -0
- package/dist/permissions/adapters/index.mjs +6 -0
- package/dist/permissions/adapters/v0/index.d.mts +18 -0
- package/dist/permissions/adapters/v0/index.mjs +5 -0
- package/dist/permissions/index.d.mts +17 -0
- package/dist/permissions/index.mjs +15 -0
- package/dist/pino-01x_NmWp.mjs +49 -0
- package/dist/pino-p-jDkNQd.d.mts +24 -0
- package/dist/posthog-BrGBPPir.mjs +50 -0
- package/dist/server-6cs14bj1.d.mts +20 -0
- package/dist/server-ClCwiLMA.mjs +45 -0
- package/dist/storage/adapters/index.d.mts +3 -0
- package/dist/storage/adapters/index.mjs +3 -0
- package/dist/storage/adapters/memory/index.d.mts +2 -0
- package/dist/storage/adapters/memory/index.mjs +3 -0
- package/dist/storage/index.d.mts +17 -0
- package/dist/storage/index.mjs +37 -0
- package/dist/theme/adapters/index.d.mts +17 -0
- package/dist/theme/adapters/index.mjs +6 -0
- package/dist/theme/adapters/v0/index.d.mts +17 -0
- package/dist/theme/adapters/v0/index.mjs +5 -0
- package/dist/theme/index.d.mts +17 -0
- package/dist/theme/index.mjs +16 -0
- package/dist/toArray-DIeXVX1C.mjs +38 -0
- package/dist/types/index.d.mts +2 -2
- package/dist/{useClickOutside-Dp1MHIjr.mjs → useClickOutside-p8HP07At.mjs} +2437 -5442
- package/dist/useFeatures-C4JF3Hgr.mjs +122 -0
- package/dist/useLocale-DlbShzF-.mjs +85 -0
- package/dist/useLogger-CO9JwbSJ.mjs +283 -0
- package/dist/usePermissions-DQVT_4nD.mjs +128 -0
- package/dist/useTheme-Bcw1Ebyt.mjs +135 -0
- package/dist/utilities/index.d.mts +3 -3
- package/dist/utilities/index.mjs +3 -2
- package/dist/{utilities-B58TiS_S.mjs → utilities-BqS1sC1W.mjs} +27 -1
- package/dist/v0-B40YkIQ-.mjs +21 -0
- package/dist/v0-BOxb3nD1.d.mts +33 -0
- package/dist/v0-BogbIzpM.mjs +41 -0
- package/dist/v0-BtQCSBOG.mjs +37 -0
- package/dist/v0-C-9dv_1S.d.mts +10 -0
- package/dist/v0-CtjuUUPl.mjs +73 -0
- package/dist/v0-DHMoZ7dS.d.mts +22 -0
- package/dist/v0-ONBWyQYQ.mjs +83 -0
- package/dist/v0-RepwEY1F.d.mts +9 -0
- package/dist/virtual-B3IPkHC0.d.mts +9 -0
- package/dist/virtual-BP9WXRzN.mjs +44 -0
- package/package.json +37 -4
- package/dist/index-qSuLpob3.d.mts +0 -1544
- /package/dist/{adapter-L4Php1_S.d.mts → adapter-DcwxFryd.d.mts} +0 -0
- /package/dist/{constants-DHKqjdjH.mjs → adapters-BGJKsBrw.mjs} +0 -0
- /package/dist/{htmlElements-DO9n35bD.mjs → htmlElements-d8iBCGpO.mjs} +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { o as createPluginContext } from "./useLogger-CO9JwbSJ.mjs";
|
|
2
|
+
import { t as createTokens } from "./createTokens-BlhLdHXE.mjs";
|
|
3
|
+
import { t as createSingle } from "./createSingle-B59ya3aa.mjs";
|
|
4
|
+
import { t as Vuetify0ThemeAdapter } from "./v0-ONBWyQYQ.mjs";
|
|
5
|
+
import { computed, shallowRef, toRef } from "vue";
|
|
6
|
+
|
|
7
|
+
//#region src/composables/useTheme/index.ts
|
|
8
|
+
/**
|
|
9
|
+
* @module useTheme
|
|
10
|
+
*
|
|
11
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-theme
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Theme management composable with token resolution and CSS variable injection.
|
|
15
|
+
*
|
|
16
|
+
* Key features:
|
|
17
|
+
* - Single-selection theme switching (extends createSingle)
|
|
18
|
+
* - Token alias resolution via useTokens
|
|
19
|
+
* - Lazy theme loading (compute colors only when selected)
|
|
20
|
+
* - CSS variable generation via adapter pattern
|
|
21
|
+
* - SSR support with head integration
|
|
22
|
+
* - Theme cycling
|
|
23
|
+
*
|
|
24
|
+
* Integrates with createSingle for selection and useTokens for color resolution.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new theme instance.
|
|
28
|
+
*
|
|
29
|
+
* @param options The options for the theme instance.
|
|
30
|
+
* @template Z The type of the theme ticket.
|
|
31
|
+
* @template E The type of the theme context.
|
|
32
|
+
* @returns A new theme instance.
|
|
33
|
+
*
|
|
34
|
+
* @see https://0.vuetifyjs.com/composables/plugins/use-theme
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { createTheme } from '@vuetify/v0'
|
|
39
|
+
*
|
|
40
|
+
* export const [useTheme, provideTheme] = createTheme({
|
|
41
|
+
* namespace: 'v0:theme',
|
|
42
|
+
* default: 'light',
|
|
43
|
+
* themes: {
|
|
44
|
+
* light: {
|
|
45
|
+
* dark: false,
|
|
46
|
+
* colors: {
|
|
47
|
+
* primary: '#3b82f6',
|
|
48
|
+
* },
|
|
49
|
+
* },
|
|
50
|
+
* dark: {
|
|
51
|
+
* dark: true,
|
|
52
|
+
* colors: {
|
|
53
|
+
* primary: '#675496',
|
|
54
|
+
* },
|
|
55
|
+
* },
|
|
56
|
+
* },
|
|
57
|
+
* })
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
function createTheme(_options = {}) {
|
|
61
|
+
const { themes = {}, palette = {}, ...options } = _options;
|
|
62
|
+
const tokens = createTokens({
|
|
63
|
+
palette,
|
|
64
|
+
...themes
|
|
65
|
+
}, { flat: true });
|
|
66
|
+
const registry = createSingle(options);
|
|
67
|
+
for (const id in themes) {
|
|
68
|
+
const { colors: value, ...theme } = themes[id];
|
|
69
|
+
register({
|
|
70
|
+
id,
|
|
71
|
+
value,
|
|
72
|
+
...theme
|
|
73
|
+
});
|
|
74
|
+
if (id === options.default && !registry.selectedId.value) registry.select(id);
|
|
75
|
+
}
|
|
76
|
+
const names = computed(() => registry.keys());
|
|
77
|
+
const colors = computed(() => {
|
|
78
|
+
const resolved = {};
|
|
79
|
+
for (const theme of registry.values()) {
|
|
80
|
+
if (theme.lazy && theme.id !== registry.selectedId.value) continue;
|
|
81
|
+
resolved[theme.id] = resolve(theme.value);
|
|
82
|
+
}
|
|
83
|
+
return resolved;
|
|
84
|
+
});
|
|
85
|
+
const isDark = toRef(() => registry.selectedItem.value?.dark ?? false);
|
|
86
|
+
function cycle(themes$1 = names.value) {
|
|
87
|
+
const current = themes$1.indexOf(registry.selectedId.value ?? "");
|
|
88
|
+
const next = current === -1 ? 0 : (current + 1) % themes$1.length;
|
|
89
|
+
registry.select(themes$1[next]);
|
|
90
|
+
}
|
|
91
|
+
function resolve(colors$1) {
|
|
92
|
+
const resolved = {};
|
|
93
|
+
for (const [key, value] of Object.entries(colors$1)) resolved[key] = tokens.isAlias(value) ? tokens.resolve(value) : value;
|
|
94
|
+
return resolved;
|
|
95
|
+
}
|
|
96
|
+
function register(registration = {}) {
|
|
97
|
+
const item = {
|
|
98
|
+
lazy: false,
|
|
99
|
+
dark: false,
|
|
100
|
+
...registration
|
|
101
|
+
};
|
|
102
|
+
return registry.register(item);
|
|
103
|
+
}
|
|
104
|
+
function onboard(registrations) {
|
|
105
|
+
return registry.batch(() => registrations.map((registration) => register(registration)));
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
...registry,
|
|
109
|
+
colors,
|
|
110
|
+
isDark,
|
|
111
|
+
register,
|
|
112
|
+
onboard,
|
|
113
|
+
cycle,
|
|
114
|
+
get size() {
|
|
115
|
+
return registry.size;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function createThemeFallback() {
|
|
120
|
+
return {
|
|
121
|
+
size: 0,
|
|
122
|
+
colors: computed(() => ({})),
|
|
123
|
+
isDark: shallowRef(false),
|
|
124
|
+
cycle: () => {}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const [createThemeContext, createThemePlugin, useTheme] = createPluginContext("v0:theme", (options) => createTheme(options), {
|
|
128
|
+
fallback: () => createThemeFallback(),
|
|
129
|
+
setup: (context, app, { adapter = new Vuetify0ThemeAdapter(), target }) => {
|
|
130
|
+
adapter.setup(app, context, target);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
//#endregion
|
|
135
|
+
export { useTheme as i, createThemeContext as n, createThemePlugin as r, createTheme as t };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import { _ as
|
|
3
|
-
export { clamp, debounce, instanceExists, instanceName, isArray, isBoolean, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isSymbol, isUndefined, mergeDeep, range, useId };
|
|
1
|
+
import "../index-BFBN5Zl3.mjs";
|
|
2
|
+
import { _ as isUndefined, a as isArray, b as useId, c as isFunction, d as isNullOrUndefined, f as isNumber, g as isSymbol, h as isString, i as debounce, l as isNaN, m as isPrimitive, n as instanceName, o as isBoolean, p as isObject, r as clamp, s as isElement, t as instanceExists, u as isNull, v as mergeDeep, y as range } from "../index-UNwEBkQT.mjs";
|
|
3
|
+
export { clamp, debounce, instanceExists, instanceName, isArray, isBoolean, isElement, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isSymbol, isUndefined, mergeDeep, range, useId };
|
package/dist/utilities/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../globals-B_GVfG06.mjs";
|
|
2
|
+
import { _ as range, a as isElement, b as instanceName, c as isNull, d as isObject, f as isPrimitive, g as mergeDeep, h as isUndefined, i as isBoolean, l as isNullOrUndefined, m as isSymbol, n as debounce, o as isFunction, p as isString, r as isArray, s as isNaN, t as clamp, u as isNumber, v as useId, y as instanceExists } from "../utilities-BqS1sC1W.mjs";
|
|
2
3
|
|
|
3
|
-
export { clamp, debounce, instanceExists, instanceName, isArray, isBoolean, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isSymbol, isUndefined, mergeDeep, range, useId };
|
|
4
|
+
export { clamp, debounce, instanceExists, instanceName, isArray, isBoolean, isElement, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isSymbol, isUndefined, mergeDeep, range, useId };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as IN_BROWSER } from "./globals-B_GVfG06.mjs";
|
|
1
2
|
import * as Vue from "vue";
|
|
2
3
|
import { useId } from "vue";
|
|
3
4
|
|
|
@@ -28,6 +29,13 @@ function instanceName() {
|
|
|
28
29
|
//#endregion
|
|
29
30
|
//#region src/utilities/helpers.ts
|
|
30
31
|
/**
|
|
32
|
+
* @module utilities/helpers
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Collection of utility functions for type checking, object manipulation,
|
|
36
|
+
* and common transformations. All exports are tree-shakeable.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
31
39
|
* Checks if a value is a function
|
|
32
40
|
*
|
|
33
41
|
* @param item The value to check
|
|
@@ -138,6 +146,23 @@ function isArray(item) {
|
|
|
138
146
|
return Array.isArray(item);
|
|
139
147
|
}
|
|
140
148
|
/**
|
|
149
|
+
* Checks if a value is a DOM Element
|
|
150
|
+
*
|
|
151
|
+
* @param item The value to check
|
|
152
|
+
* @returns True if the value is a DOM Element
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* isElement(document.body) // true
|
|
157
|
+
* isElement('string') // false
|
|
158
|
+
* isElement(null) // false
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
162
|
+
function isElement(item) {
|
|
163
|
+
return item instanceof Element;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
141
166
|
* Checks if a value is null
|
|
142
167
|
*
|
|
143
168
|
* @param item The value to check
|
|
@@ -328,6 +353,7 @@ let idCounter = 0;
|
|
|
328
353
|
/* @__NO_SIDE_EFFECTS__ */
|
|
329
354
|
function useId$1() {
|
|
330
355
|
if (instanceExists()) return useId();
|
|
356
|
+
if (!/* @__PURE__ */ isUndefined(process.env.NODE_ENV !== "production") && process.env.NODE_ENV !== "production" && !IN_BROWSER) console.warn("[v0 warn] useId() called outside component context during SSR. Provide explicit ID to avoid hydration mismatch.");
|
|
331
357
|
return `v0-${idCounter++}`;
|
|
332
358
|
}
|
|
333
359
|
/**
|
|
@@ -400,4 +426,4 @@ function debounce(fn, delay) {
|
|
|
400
426
|
}
|
|
401
427
|
|
|
402
428
|
//#endregion
|
|
403
|
-
export {
|
|
429
|
+
export { range as _, isElement as a, instanceName as b, isNull as c, isObject as d, isPrimitive as f, mergeDeep as g, isUndefined as h, isBoolean as i, isNullOrUndefined as l, isSymbol as m, debounce as n, isFunction as o, isString as p, isArray as r, isNaN as s, clamp as t, isNumber as u, useId$1 as v, instanceExists as y };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { o as isFunction } from "./utilities-BqS1sC1W.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/composables/usePermissions/adapters/adapter.ts
|
|
4
|
+
var PermissionAdapter = class {};
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/composables/usePermissions/adapters/v0.ts
|
|
8
|
+
var Vuetify0PermissionAdapter = class extends PermissionAdapter {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
}
|
|
12
|
+
can(role, action, subject, context, permissions) {
|
|
13
|
+
const access = `${role}.${action}.${subject}`;
|
|
14
|
+
const ticket = permissions.get(access);
|
|
15
|
+
if (!ticket || !ticket.value) return false;
|
|
16
|
+
return /* @__PURE__ */ isFunction(ticket.value) ? ticket.value(context) : ticket.value;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { PermissionAdapter as n, Vuetify0PermissionAdapter as t };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as LoggerAdapter } from "./adapter-CJIj5ySf.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/composables/useLogger/adapters/v0.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Vuetify0.x logger adapter implementation
|
|
7
|
+
*
|
|
8
|
+
* This adapter provides console-based logging with proper formatting,
|
|
9
|
+
* color coding, timestamps, and log level filtering for development
|
|
10
|
+
* and production environments.
|
|
11
|
+
*/
|
|
12
|
+
declare class Vuetify0LoggerAdapter implements LoggerAdapter {
|
|
13
|
+
private prefix;
|
|
14
|
+
private colors;
|
|
15
|
+
private timestamps;
|
|
16
|
+
constructor(options?: {
|
|
17
|
+
prefix?: string;
|
|
18
|
+
colors?: boolean;
|
|
19
|
+
timestamps?: boolean;
|
|
20
|
+
});
|
|
21
|
+
debug(message: string, ...args: unknown[]): void;
|
|
22
|
+
info(message: string, ...args: unknown[]): void;
|
|
23
|
+
warn(message: string, ...args: unknown[]): void;
|
|
24
|
+
error(message: string, ...args: unknown[]): void;
|
|
25
|
+
trace(message: string, ...args: unknown[]): void;
|
|
26
|
+
fatal(message: string, ...args: unknown[]): void;
|
|
27
|
+
private format;
|
|
28
|
+
private timestamp;
|
|
29
|
+
private style;
|
|
30
|
+
private log;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Vuetify0LoggerAdapter as t };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { t as createPagination } from "./createPagination-cyOWlpfH.mjs";
|
|
2
|
+
import { t as DataTableAdapter } from "./adapter-D_0ptsPm.mjs";
|
|
3
|
+
import { computed, toRef, watch } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/composables/createDataTable/adapters/v0.ts
|
|
6
|
+
/**
|
|
7
|
+
* @module createDataTable/adapters/v0
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Default data table adapter that performs all pipeline operations client-side:
|
|
11
|
+
* filtering via createFilter, sorting via computed comparisons, and pagination
|
|
12
|
+
* via createPagination. Automatically resets to page 1 on filter/sort changes.
|
|
13
|
+
*/
|
|
14
|
+
var ClientAdapter = class extends DataTableAdapter {
|
|
15
|
+
setup(context) {
|
|
16
|
+
const { search, sortBy, locale, paginationOptions, customSorts } = context;
|
|
17
|
+
const { allItems, filteredItems } = this.filter(context);
|
|
18
|
+
const sortedItems = this.sort(filteredItems, sortBy, locale, customSorts);
|
|
19
|
+
const pagination = createPagination({
|
|
20
|
+
...paginationOptions,
|
|
21
|
+
size: toRef(() => sortedItems.value.length)
|
|
22
|
+
});
|
|
23
|
+
const items = computed(() => {
|
|
24
|
+
return sortedItems.value.slice(pagination.pageStart.value, pagination.pageStop.value);
|
|
25
|
+
});
|
|
26
|
+
watch([search, sortBy], () => {
|
|
27
|
+
pagination.first();
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
allItems,
|
|
31
|
+
filteredItems,
|
|
32
|
+
sortedItems,
|
|
33
|
+
items,
|
|
34
|
+
pagination,
|
|
35
|
+
total: toRef(() => sortedItems.value.length)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ClientAdapter as t };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { t as IN_BROWSER } from "./globals-B_GVfG06.mjs";
|
|
2
|
+
import { d as isObject, h as isUndefined } from "./utilities-BqS1sC1W.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/composables/useLocale/adapters/v0.ts
|
|
5
|
+
/**
|
|
6
|
+
* Vuetify0.x locale adapter implementation
|
|
7
|
+
*
|
|
8
|
+
* This adapter provides translation and number formatting
|
|
9
|
+
* capabilities using the Intl API and supports both
|
|
10
|
+
* numbered ({0}, {1}) and named ({name}) variables in translation strings.
|
|
11
|
+
*/
|
|
12
|
+
var Vuetify0LocaleAdapter = class {
|
|
13
|
+
t(message, ...params) {
|
|
14
|
+
let resolvedMessage = message;
|
|
15
|
+
if (params.length > 0 && /* @__PURE__ */ isObject(params[0])) {
|
|
16
|
+
const variables = params[0];
|
|
17
|
+
resolvedMessage = resolvedMessage.replace(/{([a-zA-Z][a-zA-Z0-9_]*)}/g, (match, name) => {
|
|
18
|
+
return /* @__PURE__ */ isUndefined(variables[name]) ? match : String(variables[name]);
|
|
19
|
+
});
|
|
20
|
+
params = params.slice(1);
|
|
21
|
+
}
|
|
22
|
+
resolvedMessage = resolvedMessage.replace(/\{(\d+)\}/g, (match, index) => {
|
|
23
|
+
const idx = Number.parseInt(index, 10);
|
|
24
|
+
if (!/* @__PURE__ */ isUndefined(params[idx])) return String(params[idx]);
|
|
25
|
+
return match;
|
|
26
|
+
});
|
|
27
|
+
return resolvedMessage;
|
|
28
|
+
}
|
|
29
|
+
n(value, locale, ...params) {
|
|
30
|
+
if (!IN_BROWSER || !locale) return value.toString();
|
|
31
|
+
const options = params[0];
|
|
32
|
+
return new Intl.NumberFormat(String(locale), options).format(value);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Vuetify0LocaleAdapter as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { o as ID } from "./index-BFBN5Zl3.mjs";
|
|
2
|
+
import { Nt as PermissionTicket, Rt as PermissionAdapter, kt as PermissionContext } from "./index-Dd0m0LIJ.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/composables/usePermissions/adapters/v0.d.ts
|
|
5
|
+
declare class Vuetify0PermissionAdapter extends PermissionAdapter {
|
|
6
|
+
constructor();
|
|
7
|
+
can<Z extends PermissionTicket = PermissionTicket>(role: ID, action: string, subject: string, context: Record<string, any>, permissions: PermissionContext<Z>): boolean;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Vuetify0PermissionAdapter as t };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as IN_BROWSER } from "./globals-B_GVfG06.mjs";
|
|
2
|
+
import { o as isFunction } from "./utilities-BqS1sC1W.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/composables/useLogger/adapters/v0.ts
|
|
5
|
+
/**
|
|
6
|
+
* Vuetify0.x logger adapter implementation
|
|
7
|
+
*
|
|
8
|
+
* This adapter provides console-based logging with proper formatting,
|
|
9
|
+
* color coding, timestamps, and log level filtering for development
|
|
10
|
+
* and production environments.
|
|
11
|
+
*/
|
|
12
|
+
var Vuetify0LoggerAdapter = class {
|
|
13
|
+
prefix;
|
|
14
|
+
colors;
|
|
15
|
+
timestamps;
|
|
16
|
+
constructor(options = {}) {
|
|
17
|
+
this.prefix = options.prefix || "v0";
|
|
18
|
+
this.colors = options.colors !== false;
|
|
19
|
+
this.timestamps = options.timestamps !== false;
|
|
20
|
+
}
|
|
21
|
+
debug(message, ...args) {
|
|
22
|
+
this.log("debug", "debug", message, ...args);
|
|
23
|
+
}
|
|
24
|
+
info(message, ...args) {
|
|
25
|
+
this.log("info", "info", message, ...args);
|
|
26
|
+
}
|
|
27
|
+
warn(message, ...args) {
|
|
28
|
+
this.log("warn", "warn", message, ...args);
|
|
29
|
+
}
|
|
30
|
+
error(message, ...args) {
|
|
31
|
+
this.log("error", "error", message, ...args);
|
|
32
|
+
}
|
|
33
|
+
trace(message, ...args) {
|
|
34
|
+
this.log("trace", "trace", message, ...args);
|
|
35
|
+
}
|
|
36
|
+
fatal(message, ...args) {
|
|
37
|
+
this.log("fatal", "error", message, ...args);
|
|
38
|
+
}
|
|
39
|
+
format(level, message, ...args) {
|
|
40
|
+
return [[
|
|
41
|
+
this.timestamps ? this.timestamp() : "",
|
|
42
|
+
`[${this.prefix} ${level.toLowerCase()}]`,
|
|
43
|
+
message
|
|
44
|
+
].filter(Boolean).join(" "), ...args];
|
|
45
|
+
}
|
|
46
|
+
timestamp() {
|
|
47
|
+
if (!IN_BROWSER) return (/* @__PURE__ */ new Date()).toISOString();
|
|
48
|
+
/* v8 ignore next -- defensive fallback, toTimeString always returns valid format */
|
|
49
|
+
return (/* @__PURE__ */ new Date()).toTimeString().split(" ")[0] ?? "";
|
|
50
|
+
}
|
|
51
|
+
style(level) {
|
|
52
|
+
if (!this.colors || !IN_BROWSER) return "";
|
|
53
|
+
/* v8 ignore next -- LogLevel union is exhaustive */
|
|
54
|
+
return {
|
|
55
|
+
trace: "color: #64748b",
|
|
56
|
+
debug: "color: #3b82f6",
|
|
57
|
+
info: "color: #10b981",
|
|
58
|
+
warn: "color: #f59e0b",
|
|
59
|
+
error: "color: #ef4444",
|
|
60
|
+
fatal: "color: #dc2626; font-weight: bold",
|
|
61
|
+
silent: ""
|
|
62
|
+
}[level] || "";
|
|
63
|
+
}
|
|
64
|
+
log(level, method, message, ...args) {
|
|
65
|
+
const [formattedMessage, ...restArgs] = this.format(level, message, ...args);
|
|
66
|
+
const style = this.style(level);
|
|
67
|
+
if (IN_BROWSER && style && /* @__PURE__ */ isFunction(console[method])) console[method](`%c${formattedMessage}`, style, ...restArgs);
|
|
68
|
+
else if (/* @__PURE__ */ isFunction(console[method])) console[method](formattedMessage, ...restArgs);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { Vuetify0LoggerAdapter as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { o as ID } from "./index-BFBN5Zl3.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/composables/useLocale/adapters/adapter.d.ts
|
|
4
|
+
interface LocaleAdapter {
|
|
5
|
+
t: (message: string, ...params: unknown[]) => string;
|
|
6
|
+
n: (value: number, locale: ID | undefined, ...params: unknown[]) => string;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/composables/useLocale/adapters/v0.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* Vuetify0.x locale adapter implementation
|
|
12
|
+
*
|
|
13
|
+
* This adapter provides translation and number formatting
|
|
14
|
+
* capabilities using the Intl API and supports both
|
|
15
|
+
* numbered ({0}, {1}) and named ({name}) variables in translation strings.
|
|
16
|
+
*/
|
|
17
|
+
declare class Vuetify0LocaleAdapter implements LocaleAdapter {
|
|
18
|
+
t(message: string, ...params: unknown[]): string;
|
|
19
|
+
n(value: number, locale: ID | undefined, ...params: unknown[]): string;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { LocaleAdapter as n, Vuetify0LocaleAdapter as t };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { t as IN_BROWSER } from "./globals-B_GVfG06.mjs";
|
|
2
|
+
import { c as isNull, h as isUndefined, p as isString } from "./utilities-BqS1sC1W.mjs";
|
|
3
|
+
import { onScopeDispose, watch } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/composables/useTheme/adapters/adapter.ts
|
|
6
|
+
var ThemeAdapter = class {
|
|
7
|
+
stylesheetId = "v0-theme-stylesheet";
|
|
8
|
+
prefix;
|
|
9
|
+
constructor(prefix) {
|
|
10
|
+
this.prefix = prefix;
|
|
11
|
+
}
|
|
12
|
+
generate(colors, isDark) {
|
|
13
|
+
let css = "";
|
|
14
|
+
for (const theme in colors) {
|
|
15
|
+
const themeColors = colors[theme];
|
|
16
|
+
if (!themeColors) continue;
|
|
17
|
+
const vars = Object.entries(themeColors).map(([key, val]) => ` --${this.prefix}-${key}: ${val};`).join("\n");
|
|
18
|
+
css += `[data-theme="${theme}"] {\n${vars}\n}\n`;
|
|
19
|
+
}
|
|
20
|
+
if (!/* @__PURE__ */ isUndefined(isDark)) css += `:root {\n color-scheme: ${isDark ? "dark" : "light"};\n}\n`;
|
|
21
|
+
return css;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/composables/useTheme/adapters/v0.ts
|
|
27
|
+
/**
|
|
28
|
+
* Theme adapter implementation for Vuetify v0 design system.
|
|
29
|
+
* This adapter generates CSS custom properties and injects them into the DOM
|
|
30
|
+
* as a stylesheet, allowing themes to be applied globally.
|
|
31
|
+
*/
|
|
32
|
+
var Vuetify0ThemeAdapter = class extends ThemeAdapter {
|
|
33
|
+
cspNonce;
|
|
34
|
+
sheet;
|
|
35
|
+
constructor(options = {}) {
|
|
36
|
+
super(options.prefix ?? "v0");
|
|
37
|
+
this.cspNonce = options.cspNonce;
|
|
38
|
+
this.stylesheetId = options.stylesheetId ?? this.stylesheetId;
|
|
39
|
+
}
|
|
40
|
+
setup(app, context, target) {
|
|
41
|
+
if (IN_BROWSER) {
|
|
42
|
+
this.update(context.colors.value, context.isDark.value);
|
|
43
|
+
onScopeDispose(watch([context.colors, context.isDark], ([colors, isDark]) => {
|
|
44
|
+
this.update(colors, isDark);
|
|
45
|
+
}), true);
|
|
46
|
+
if (/* @__PURE__ */ isNull(target)) return;
|
|
47
|
+
const targetEl = target instanceof HTMLElement ? target : /* @__PURE__ */ isString(target) ? document.querySelector(target) : app._container || document.querySelector("#app") || document.body;
|
|
48
|
+
if (!targetEl) return;
|
|
49
|
+
if (context.selectedId.value) targetEl.dataset.theme = String(context.selectedId.value);
|
|
50
|
+
onScopeDispose(watch(context.selectedId, (id) => {
|
|
51
|
+
if (!id) return;
|
|
52
|
+
targetEl.dataset.theme = String(id);
|
|
53
|
+
}), true);
|
|
54
|
+
} else {
|
|
55
|
+
const head = app._context?.provides?.usehead ?? app._context?.provides?.head;
|
|
56
|
+
if (head?.push) {
|
|
57
|
+
const id = context.selectedId.value;
|
|
58
|
+
head.push({
|
|
59
|
+
htmlAttrs: { "data-theme": id ? String(id) : "" },
|
|
60
|
+
style: [{
|
|
61
|
+
innerHTML: this.generate(context.colors.value, context.isDark.value),
|
|
62
|
+
id: this.stylesheetId
|
|
63
|
+
}]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
update(colors, isDark) {
|
|
69
|
+
if (!IN_BROWSER) return;
|
|
70
|
+
this.upsert(this.generate(colors, isDark));
|
|
71
|
+
}
|
|
72
|
+
upsert(styles) {
|
|
73
|
+
if (!IN_BROWSER) return;
|
|
74
|
+
if (!this.sheet) {
|
|
75
|
+
this.sheet = new CSSStyleSheet();
|
|
76
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, this.sheet];
|
|
77
|
+
}
|
|
78
|
+
this.sheet.replaceSync(styles);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
export { ThemeAdapter as n, Vuetify0ThemeAdapter as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { i as DataTableAdapterResult, n as DataTableAdapterContext, t as DataTableAdapter } from "./adapter-BN-h5JbD.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/composables/createDataTable/adapters/v0.d.ts
|
|
4
|
+
|
|
5
|
+
declare class ClientAdapter<T extends Record<string, unknown>> extends DataTableAdapter<T> {
|
|
6
|
+
setup(context: DataTableAdapterContext<T>): DataTableAdapterResult<T>;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ClientAdapter as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { i as DataTableAdapterResult, n as DataTableAdapterContext, t as DataTableAdapter } from "./adapter-BN-h5JbD.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/composables/createDataTable/adapters/virtual.d.ts
|
|
4
|
+
|
|
5
|
+
declare class VirtualAdapter<T extends Record<string, unknown>> extends DataTableAdapter<T> {
|
|
6
|
+
setup(context: DataTableAdapterContext<T>): DataTableAdapterResult<T>;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { VirtualAdapter as t };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { t as createPagination } from "./createPagination-cyOWlpfH.mjs";
|
|
2
|
+
import { t as DataTableAdapter } from "./adapter-D_0ptsPm.mjs";
|
|
3
|
+
import { toRef, watch } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/composables/createDataTable/adapters/virtual.ts
|
|
6
|
+
/**
|
|
7
|
+
* @module createDataTable/adapters/virtual
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Virtual scrolling data table adapter. Performs client-side filtering
|
|
11
|
+
* and sorting (via DataTableAdapter base) but skips pagination slicing,
|
|
12
|
+
* returning all sorted items for use with createVirtual at the component level.
|
|
13
|
+
*
|
|
14
|
+
* Pagination is created with itemsPerPage matching the total item count,
|
|
15
|
+
* effectively placing all items on a single page. The consumer wraps
|
|
16
|
+
* `table.items` (or `table.sortedItems`) with createVirtual to render
|
|
17
|
+
* only the visible viewport.
|
|
18
|
+
*/
|
|
19
|
+
var VirtualAdapter = class extends DataTableAdapter {
|
|
20
|
+
setup(context) {
|
|
21
|
+
const { search, sortBy, locale, customSorts } = context;
|
|
22
|
+
const { allItems, filteredItems } = this.filter(context);
|
|
23
|
+
const sortedItems = this.sort(filteredItems, sortBy, locale, customSorts);
|
|
24
|
+
const size = toRef(() => sortedItems.value.length);
|
|
25
|
+
const pagination = createPagination({
|
|
26
|
+
size,
|
|
27
|
+
itemsPerPage: size
|
|
28
|
+
});
|
|
29
|
+
watch([search, sortBy], () => {
|
|
30
|
+
pagination.first();
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
allItems,
|
|
34
|
+
filteredItems,
|
|
35
|
+
sortedItems,
|
|
36
|
+
items: sortedItems,
|
|
37
|
+
pagination,
|
|
38
|
+
total: toRef(() => sortedItems.value.length)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { VirtualAdapter as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuetify/v0",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Vuetify0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"types": "./dist/index.d.mts",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"files": [
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"SKILL.md"
|
|
12
13
|
],
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
@@ -36,20 +37,52 @@
|
|
|
36
37
|
"@vue/test-utils": "^2.4.6",
|
|
37
38
|
"flagsmith": "^10.0.0",
|
|
38
39
|
"launchdarkly-js-client-sdk": "^3.9.0",
|
|
39
|
-
"posthog-js": "
|
|
40
|
+
"posthog-js": "1.310.1",
|
|
40
41
|
"tsdown": "^0.16.8",
|
|
41
|
-
"tsx": "
|
|
42
|
+
"tsx": "4.21.0",
|
|
42
43
|
"typescript": "5.9.3",
|
|
43
44
|
"unplugin-vue": "^7.1.0",
|
|
44
45
|
"vue": "3.5.24",
|
|
45
46
|
"vue-component-meta": "^3.2.2"
|
|
46
47
|
},
|
|
48
|
+
"imports": {
|
|
49
|
+
"#v0/*": {
|
|
50
|
+
"development": "./src/*",
|
|
51
|
+
"default": "./dist/*"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
47
54
|
"exports": {
|
|
48
55
|
".": "./dist/index.mjs",
|
|
49
56
|
"./components": "./dist/components/index.mjs",
|
|
50
57
|
"./composables": "./dist/composables/index.mjs",
|
|
51
58
|
"./constants": "./dist/constants/index.mjs",
|
|
59
|
+
"./data-table": "./dist/data-table/index.mjs",
|
|
60
|
+
"./data-table/adapters": "./dist/data-table/adapters/index.mjs",
|
|
61
|
+
"./data-table/adapters/client": "./dist/data-table/adapters/client/index.mjs",
|
|
62
|
+
"./data-table/adapters/server": "./dist/data-table/adapters/server/index.mjs",
|
|
63
|
+
"./data-table/adapters/virtual": "./dist/data-table/adapters/virtual/index.mjs",
|
|
52
64
|
"./date": "./dist/date/index.mjs",
|
|
65
|
+
"./features": "./dist/features/index.mjs",
|
|
66
|
+
"./features/adapters/flagsmith": "./dist/features/adapters/flagsmith/index.mjs",
|
|
67
|
+
"./features/adapters/launchdarkly": "./dist/features/adapters/launchdarkly/index.mjs",
|
|
68
|
+
"./features/adapters/posthog": "./dist/features/adapters/posthog/index.mjs",
|
|
69
|
+
"./locale": "./dist/locale/index.mjs",
|
|
70
|
+
"./locale/adapters": "./dist/locale/adapters/index.mjs",
|
|
71
|
+
"./locale/adapters/v0": "./dist/locale/adapters/v0/index.mjs",
|
|
72
|
+
"./logger": "./dist/logger/index.mjs",
|
|
73
|
+
"./logger/adapters": "./dist/logger/adapters/index.mjs",
|
|
74
|
+
"./logger/adapters/consola": "./dist/logger/adapters/consola/index.mjs",
|
|
75
|
+
"./logger/adapters/pino": "./dist/logger/adapters/pino/index.mjs",
|
|
76
|
+
"./logger/adapters/v0": "./dist/logger/adapters/v0/index.mjs",
|
|
77
|
+
"./permissions": "./dist/permissions/index.mjs",
|
|
78
|
+
"./permissions/adapters": "./dist/permissions/adapters/index.mjs",
|
|
79
|
+
"./permissions/adapters/v0": "./dist/permissions/adapters/v0/index.mjs",
|
|
80
|
+
"./storage": "./dist/storage/index.mjs",
|
|
81
|
+
"./storage/adapters": "./dist/storage/adapters/index.mjs",
|
|
82
|
+
"./storage/adapters/memory": "./dist/storage/adapters/memory/index.mjs",
|
|
83
|
+
"./theme": "./dist/theme/index.mjs",
|
|
84
|
+
"./theme/adapters": "./dist/theme/adapters/index.mjs",
|
|
85
|
+
"./theme/adapters/v0": "./dist/theme/adapters/v0/index.mjs",
|
|
53
86
|
"./types": "./dist/types/index.mjs",
|
|
54
87
|
"./utilities": "./dist/utilities/index.mjs",
|
|
55
88
|
"./package.json": "./package.json",
|