@vuetify/v0 1.0.0-alpha.0 → 1.0.0-alpha.1
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 +5 -1
- package/dist/{adapter-CCIeOzqr.mjs → adapter-CDpOQ8sn.mjs} +29 -20
- package/dist/{adapter-CcHB7rs3.d.mts → adapter-DoziXEzS.d.mts} +1 -1
- package/dist/{adapter-Drq1v5wV.mjs → adapter-DtgIrQsG.mjs} +5 -2
- package/dist/{adapter-BZjmDNJF.d.mts → adapter-J7ude3gO.d.mts} +2 -2
- package/dist/adapters-CFjrKxA2.mjs +5 -0
- package/dist/adapters-CiCexgsk.mjs +4 -0
- package/dist/{adapters-D49L7m2R.mjs → adapters-Da2twiUn.mjs} +1 -1
- package/dist/adapters-DegUcfkd.mjs +2 -0
- package/dist/browser/index.js +10113 -8547
- package/dist/components/index.d.mts +3 -3
- package/dist/components/index.mjs +2 -2
- package/dist/{components-Dc7sUTsg.mjs → components-CaPQCjo5.mjs} +1356 -386
- package/dist/composables/index.d.mts +11 -11
- package/dist/composables/index.mjs +24 -24
- package/dist/constants/index.mjs +2 -2
- package/dist/{createDataTable-BbUL9Vva.mjs → createDataTable-B4UflKnT.mjs} +100 -30
- package/dist/{createGroup-C2WCfYPB.mjs → createGroup-BC2nfttd.mjs} +24 -9
- package/dist/{createPagination-Tp4C4He8.mjs → createPagination-qvJkcTUY.mjs} +11 -7
- package/dist/{createSelection-AmMX6sjc.mjs → createSelection-BA9guLah.mjs} +28 -21
- package/dist/{createSingle-CffpxK__.mjs → createSingle-BHxHLZeg.mjs} +13 -17
- package/dist/{createTokens-qv02qq4_.mjs → createTokens-oJAeh262.mjs} +27 -15
- package/dist/{createTrinity-vvXk0ARD.mjs → createTrinity-BTCs1pYx.mjs} +34 -31
- 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 +5 -5
- 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 +6 -6
- package/dist/date/index.mjs +1 -1
- package/dist/features/adapters/posthog/index.mjs +1 -1
- package/dist/features/index.d.mts +1 -1
- package/dist/features/index.mjs +1 -1
- package/dist/{globals-CAv9vqkP.mjs → globals-Berkg6mP.mjs} +1 -1
- package/dist/{htmlElements-DcYtv0hg.mjs → htmlElements-CIePKaTX.mjs} +1 -1
- package/dist/{index-76fQGkkO.d.mts → index-D4odwkZg.d.mts} +8 -11
- package/dist/{index-B_XLHftL.d.mts → index-DFvLSoto.d.mts} +296 -258
- package/dist/{index-DoGxDgdN.d.mts → index-DVPq3_Fz.d.mts} +55 -4
- package/dist/{index-D26_u_WI.d.mts → index-Gk3x_7zD.d.mts} +1439 -306
- package/dist/{index-BUsrN1vL.d.mts → index-TtSSvHY6.d.mts} +1 -1
- package/dist/index.d.mts +12 -12
- package/dist/index.mjs +27 -27
- package/dist/json/attributes.json +276 -0
- package/dist/json/importMap.json +60 -0
- package/dist/json/tags.json +136 -2
- package/dist/json/web-types.json +1183 -344
- 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/index.d.mts +3 -3
- package/dist/locale/index.mjs +2 -2
- package/dist/logger/adapters/index.mjs +2 -2
- package/dist/logger/adapters/v0/index.mjs +1 -1
- package/dist/logger/index.d.mts +1 -1
- package/dist/logger/index.mjs +2 -2
- package/dist/notifications/index.d.mts +1 -1
- package/dist/notifications/index.mjs +1 -1
- package/dist/palettes/ant/index.d.mts +1 -1
- package/dist/palettes/index.d.mts +2 -2
- package/dist/palettes/material/index.d.mts +1 -1
- package/dist/palettes/md1/index.d.mts +1 -1
- package/dist/palettes/md2/index.d.mts +1 -1
- package/dist/palettes/radix/index.d.mts +1 -1
- package/dist/palettes/tailwind/index.d.mts +1 -1
- package/dist/permissions/adapters/index.d.mts +1 -1
- package/dist/permissions/adapters/v0/index.d.mts +1 -1
- package/dist/permissions/index.d.mts +1 -1
- package/dist/permissions/index.mjs +1 -1
- package/dist/{posthog-B8PEtlFr.mjs → posthog-CPvNHMUb.mjs} +1 -1
- package/dist/rules/index.d.mts +1 -1
- package/dist/rules/index.mjs +1 -1
- package/dist/{server-CIftA0pK.mjs → server-B6OtHgBT.mjs} +1 -1
- package/dist/{server-DNUTnISs.d.mts → server-ZiHJ4tfq.d.mts} +1 -1
- package/dist/storage/index.d.mts +1 -1
- package/dist/storage/index.mjs +1 -1
- package/dist/theme/adapters/index.d.mts +1 -1
- package/dist/theme/adapters/index.mjs +4 -4
- package/dist/theme/adapters/unhead/index.d.mts +1 -1
- package/dist/theme/adapters/unhead/index.mjs +1 -1
- package/dist/theme/adapters/v0/index.d.mts +1 -1
- package/dist/theme/adapters/v0/index.mjs +1 -1
- package/dist/theme/index.d.mts +1 -1
- package/dist/theme/index.mjs +3 -3
- package/dist/{toArray-doLQVI56.mjs → toArray-BA_JxFPv.mjs} +9 -0
- package/dist/{unhead-BYw3a366.mjs → unhead-D2YqAcmF.mjs} +2 -2
- package/dist/{useClickOutside-CnCQkh7M.mjs → useClickOutside-B9a6Jext.mjs} +572 -160
- package/dist/{useFeatures-CMpkbU8Q.mjs → useFeatures-wgMwaQ5W.mjs} +14 -5
- package/dist/{useLocale-BYmoHpo6.mjs → useLocale-qMmVnAwS.mjs} +14 -5
- package/dist/{useLogger-BfaFH-Bi.mjs → useLogger-DFIRqm-N.mjs} +33 -16
- package/dist/{usePermissions-y3Uum3nO.mjs → usePermissions-tZhkBJmq.mjs} +11 -3
- package/dist/{useRules-eqSXpP9V.mjs → useRules-D3UXEtu7.mjs} +10 -2
- package/dist/{useTheme-CFH6I91x.mjs → useTheme-BeD__R8t.mjs} +14 -5
- package/dist/utilities/index.mjs +5 -5
- package/dist/{v0-DXqYgj7J.mjs → v0-6XptGYVx.mjs} +2 -2
- package/dist/{v0-DOq_Ia5H.mjs → v0-BG7RhKBv.mjs} +2 -2
- package/dist/{v0-BqikIgl0.mjs → v0-CNitYI9N.mjs} +1 -1
- package/dist/{v0-BpgPZ1qB.d.mts → v0-CWXUkMY0.d.mts} +1 -1
- package/dist/{v0-BAG8p0si.d.mts → v0-Dzw5OwNo.d.mts} +1 -1
- package/dist/{v0-CFV8A5PF.mjs → v0-I2mHxD9T.mjs} +1 -1
- package/dist/{virtual-BaQWQ9ji.d.mts → virtual-BCOfxnRS.d.mts} +1 -1
- package/dist/{virtual-D1HwNBLS.mjs → virtual-To-dSw2_.mjs} +2 -2
- package/package.json +10 -7
- package/SKILL.md +0 -95
- package/dist/adapters-BOVGPozf.mjs +0 -2
- package/dist/adapters-BbNfjyvY.mjs +0 -5
- package/dist/adapters-RwNU3wNj.mjs +0 -4
- /package/dist/{index-c55Utzva.d.mts → index-DvuJXuAN.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -81,6 +81,7 @@ import { ... } from '@vuetify/v0/date' // Date adapter and utilities
|
|
|
81
81
|
|
|
82
82
|
| Component | Description |
|
|
83
83
|
|-----------|-------------|
|
|
84
|
+
| [AspectRatio](https://0.vuetifyjs.com/components/primitives/aspect-ratio) | Fixed width-to-height ratio container via CSS `aspect-ratio` |
|
|
84
85
|
| [Atom](https://0.vuetifyjs.com/components/primitives/atom) | Polymorphic base element with dynamic `as` prop and renderless mode |
|
|
85
86
|
| [Portal](https://0.vuetifyjs.com/components/primitives/portal) | Teleport wrapper with automatic z-index stacking via useStack |
|
|
86
87
|
| [Presence](https://0.vuetifyjs.com/components/primitives/presence) | Animation-agnostic mount lifecycle with lazy mounting and exit timing |
|
|
@@ -137,6 +138,8 @@ import { ... } from '@vuetify/v0/date' // Date adapter and utilities
|
|
|
137
138
|
|-----------|-------------|
|
|
138
139
|
| [Avatar](https://0.vuetifyjs.com/components/semantic/avatar) | Image/fallback avatar with priority loading |
|
|
139
140
|
| [Breadcrumbs](https://0.vuetifyjs.com/components/semantic/breadcrumbs) | Navigation breadcrumbs with overflow detection and truncation |
|
|
141
|
+
| [Carousel](https://0.vuetifyjs.com/components/semantic/carousel) | Scroll-snap slide navigation with multi-slide display and drag/swipe |
|
|
142
|
+
| [Image](https://0.vuetifyjs.com/components/semantic/image) | Image with placeholder, error fallback, and lazy loading |
|
|
140
143
|
| [Pagination](https://0.vuetifyjs.com/components/semantic/pagination) | Page navigation with semantic `<nav>` wrapper |
|
|
141
144
|
| [Snackbar](https://0.vuetifyjs.com/components/semantic/snackbar) | Toast notification with queue, positioning, and auto-dismiss |
|
|
142
145
|
| [Splitter](https://0.vuetifyjs.com/components/semantic/splitter) | Resizable panel layout with drag handles |
|
|
@@ -209,6 +212,7 @@ Selection management composables built on `createRegistry`:
|
|
|
209
212
|
- [`useClickOutside`](https://0.vuetifyjs.com/composables/system/use-click-outside) - Click outside detection with cleanup
|
|
210
213
|
- [`useEventListener`](https://0.vuetifyjs.com/composables/system/use-event-listener) - Lifecycle-managed event listeners
|
|
211
214
|
- [`useHotkey`](https://0.vuetifyjs.com/composables/system/use-hotkey) - Hotkey combinations and sequences
|
|
215
|
+
- [`useImage`](https://0.vuetifyjs.com/composables/system/use-image) - Image loading state machine with deferred loading and retry
|
|
212
216
|
- [`useIntersectionObserver`](https://0.vuetifyjs.com/composables/system/use-intersection-observer) - Intersection observer with auto-cleanup
|
|
213
217
|
- [`useLazy`](https://0.vuetifyjs.com/composables/system/use-lazy) - Deferred content rendering for dialogs, menus, and tooltips
|
|
214
218
|
- [`useMediaQuery`](https://0.vuetifyjs.com/composables/system/use-media-query) - Reactive CSS media query matching
|
|
@@ -283,7 +287,7 @@ pnpm validate
|
|
|
283
287
|
|
|
284
288
|
## Contributing
|
|
285
289
|
|
|
286
|
-
|
|
290
|
+
v0 is in alpha — open for feedback, bug reports, and contributions. See the [Alpha Roadmap](https://0.vuetifyjs.com/roadmap#alpha) for what's planned and how to get involved.
|
|
287
291
|
|
|
288
292
|
## License
|
|
289
293
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isArray, isNaN, isNullOrUndefined, isNumber, isObject, isString } from "./utilities/index.mjs";
|
|
2
|
-
import { i as useContext,
|
|
3
|
-
import { t as toArray } from "./toArray-
|
|
2
|
+
import { i as useContext, t as createTrinity } from "./createTrinity-BTCs1pYx.mjs";
|
|
3
|
+
import { t as toArray } from "./toArray-BA_JxFPv.mjs";
|
|
4
4
|
import { computed, shallowRef, toRef, toValue } from "vue";
|
|
5
5
|
//#region src/composables/createFilter/index.ts
|
|
6
6
|
/**
|
|
@@ -20,6 +20,15 @@ import { computed, shallowRef, toRef, toValue } from "vue";
|
|
|
20
20
|
* - Perfect for search, multi-criteria filtering
|
|
21
21
|
*
|
|
22
22
|
* Filters arrays based on query strings with configurable matching strategies.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { createFilter } from '@vuetify/v0'
|
|
27
|
+
*
|
|
28
|
+
* const filter = createFilter({ mode: 'some' })
|
|
29
|
+
* const { items } = filter.apply('an', ['apple', 'banana', 'cherry'])
|
|
30
|
+
* console.log(items.value) // ['banana']
|
|
31
|
+
* ```
|
|
23
32
|
*/
|
|
24
33
|
function defaultFilter(query, item, keys, mode = "some") {
|
|
25
34
|
const queries = toArray(query).map((q) => String(q).toLowerCase());
|
|
@@ -105,12 +114,7 @@ function createFilter(options = {}) {
|
|
|
105
114
|
*/
|
|
106
115
|
function createFilterContext(_options = {}) {
|
|
107
116
|
const { namespace = "v0:filter", ...options } = _options;
|
|
108
|
-
|
|
109
|
-
const context = createFilter(options);
|
|
110
|
-
function provideFilterContext(_context = context, app) {
|
|
111
|
-
return _provideFilterContext(_context, app);
|
|
112
|
-
}
|
|
113
|
-
return createTrinity(useFilterContext, provideFilterContext, context);
|
|
117
|
+
return createTrinity(namespace, createFilter(options));
|
|
114
118
|
}
|
|
115
119
|
/**
|
|
116
120
|
* Returns the current filter context from dependency injection.
|
|
@@ -149,29 +153,30 @@ function useFilter(namespace = "v0:filter") {
|
|
|
149
153
|
* used by client-side adapters. Server adapters that delegate pipeline
|
|
150
154
|
* operations externally can implement DataTableAdapterInterface directly.
|
|
151
155
|
*/
|
|
152
|
-
function getNestedValue(obj,
|
|
153
|
-
const keys = key.split(".");
|
|
156
|
+
function getNestedValue(obj, parts) {
|
|
154
157
|
let result = obj;
|
|
155
|
-
for (const k of
|
|
158
|
+
for (const k of parts) {
|
|
156
159
|
if (/* @__PURE__ */ isNullOrUndefined(result)) return void 0;
|
|
157
160
|
result = result[k];
|
|
158
161
|
}
|
|
159
162
|
return result;
|
|
160
163
|
}
|
|
161
|
-
function compareValues(a, b,
|
|
164
|
+
function compareValues(a, b, collator) {
|
|
162
165
|
if (a === b) return 0;
|
|
163
166
|
const aNil = /* @__PURE__ */ isNullOrUndefined(a);
|
|
164
167
|
const bNil = /* @__PURE__ */ isNullOrUndefined(b);
|
|
165
168
|
if (aNil && bNil) return 0;
|
|
166
169
|
if (aNil) return 1;
|
|
167
170
|
if (bNil) return -1;
|
|
168
|
-
if (/* @__PURE__ */ isString(a) && /* @__PURE__ */ isString(b)) return a.localeCompare(b
|
|
171
|
+
if (/* @__PURE__ */ isString(a) && /* @__PURE__ */ isString(b)) return collator ? collator.compare(a, b) : a.localeCompare(b);
|
|
169
172
|
if (/* @__PURE__ */ isNumber(a) && /* @__PURE__ */ isNumber(b)) {
|
|
170
173
|
if (/* @__PURE__ */ isNaN(a)) return 1;
|
|
171
174
|
if (/* @__PURE__ */ isNaN(b)) return -1;
|
|
172
175
|
return a - b;
|
|
173
176
|
}
|
|
174
|
-
|
|
177
|
+
const sa = String(a);
|
|
178
|
+
const sb = String(b);
|
|
179
|
+
return collator ? collator.compare(sa, sb) : sa.localeCompare(sb);
|
|
175
180
|
}
|
|
176
181
|
var DataTableAdapter = class {
|
|
177
182
|
/** Create the filter pipeline stage */
|
|
@@ -211,13 +216,17 @@ var DataTableAdapter = class {
|
|
|
211
216
|
return computed(() => {
|
|
212
217
|
const entries = sortBy.value;
|
|
213
218
|
if (entries.length === 0) return filteredItems.value;
|
|
214
|
-
const
|
|
219
|
+
const collator = new Intl.Collator(locale?.value);
|
|
220
|
+
const resolved = entries.map(({ key, direction }) => ({
|
|
221
|
+
parts: key.split("."),
|
|
222
|
+
direction,
|
|
223
|
+
custom: customSorts?.[key]
|
|
224
|
+
}));
|
|
215
225
|
return filteredItems.value.toSorted((a, b) => {
|
|
216
|
-
for (const {
|
|
217
|
-
const aVal = getNestedValue(a,
|
|
218
|
-
const bVal = getNestedValue(b,
|
|
219
|
-
const
|
|
220
|
-
const cmp = customSort ? customSort(aVal, bVal) : compareValues(aVal, bVal, loc);
|
|
226
|
+
for (const { parts, direction, custom } of resolved) {
|
|
227
|
+
const aVal = parts.length === 1 ? a[parts[0]] : getNestedValue(a, parts);
|
|
228
|
+
const bVal = parts.length === 1 ? b[parts[0]] : getNestedValue(b, parts);
|
|
229
|
+
const cmp = custom ? custom(aVal, bVal) : compareValues(aVal, bVal, collator);
|
|
221
230
|
if (cmp !== 0) return direction === "desc" ? -cmp : cmp;
|
|
222
231
|
}
|
|
223
232
|
return 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as ID } from "./index-B_AlCD7t.mjs";
|
|
2
|
-
import { c as TokenTicket, i as TokenContext } from "./index-
|
|
2
|
+
import { c as TokenTicket, i as TokenContext } from "./index-TtSSvHY6.mjs";
|
|
3
3
|
import { Ref } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/composables/useLocale/adapters/adapter.d.ts
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { hexToRgb, isUndefined } from "./utilities/index.mjs";
|
|
2
2
|
//#region src/composables/useTheme/adapters/adapter.ts
|
|
3
|
-
var ThemeAdapter = class {
|
|
3
|
+
var ThemeAdapter = class ThemeAdapter {
|
|
4
|
+
static UNSAFE_CSS = /url\s*\(|@import|expression\s*\(|[{}]/i;
|
|
5
|
+
static SAFE_IDENT = /^[a-zA-Z0-9_-]+$/;
|
|
4
6
|
stylesheetId = "v0-theme-stylesheet";
|
|
5
7
|
prefix;
|
|
6
8
|
rgb = false;
|
|
@@ -12,7 +14,8 @@ var ThemeAdapter = class {
|
|
|
12
14
|
for (const theme in colors) {
|
|
13
15
|
const themeColors = colors[theme];
|
|
14
16
|
if (!themeColors) continue;
|
|
15
|
-
|
|
17
|
+
if (!ThemeAdapter.SAFE_IDENT.test(theme)) continue;
|
|
18
|
+
const vars = Object.entries(themeColors).filter(([key, val]) => ThemeAdapter.SAFE_IDENT.test(key) && !ThemeAdapter.UNSAFE_CSS.test(val)).map(([key, val]) => ` --${this.prefix}-${key}: ${this.rgb ? this.decompose(val) : val};`).join("\n");
|
|
16
19
|
css += `[data-theme="${theme}"] {\n${vars}\n color: var(--${this.prefix}-on-background);\n}\n`;
|
|
17
20
|
}
|
|
18
21
|
if (!/* @__PURE__ */ isUndefined(isDark)) css += `:root {\n color-scheme: ${isDark ? "dark" : "light"};\n}\n`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ContextTrinity } from "./index-
|
|
1
|
+
import { t as ContextTrinity } from "./index-D4odwkZg.mjs";
|
|
2
2
|
import * as _$vue from "vue";
|
|
3
3
|
import { ComputedRef, MaybeRefOrGetter, Ref, ShallowRef, WritableComputedRef } from "vue";
|
|
4
4
|
|
|
@@ -250,7 +250,7 @@ interface DataTableAdapterContext<T extends Record<string, unknown>> {
|
|
|
250
250
|
/** Search query ref */
|
|
251
251
|
search: ShallowRef<string>;
|
|
252
252
|
/** Column keys eligible for filtering */
|
|
253
|
-
filterableKeys:
|
|
253
|
+
filterableKeys: readonly string[];
|
|
254
254
|
/** Current sort state derived from sort controls */
|
|
255
255
|
sortBy: Readonly<Ref<SortEntry[]>>;
|
|
256
256
|
/** Locale for sorting (reactive, from useLocale or options) */
|