@vuetify/v0 0.0.23 → 0.0.24
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/dist/adapter-L4Php1_S.d.mts +97 -0
- package/dist/browser/index.js +1069 -809
- package/dist/components/index.d.mts +4 -4
- package/dist/components/index.mjs +6 -6
- package/dist/{components-BI9xdoz5.mjs → components-D_yAxHwn.mjs} +433 -113
- package/dist/composables/index.d.mts +5 -4
- package/dist/composables/index.mjs +4 -4
- package/dist/constants/index.d.mts +1 -1
- package/dist/constants/index.mjs +3 -3
- package/dist/date/index.d.mts +124 -0
- package/dist/date/index.mjs +7514 -0
- package/dist/{globals-WKdFmgwy.mjs → globals-BhNI7no7.mjs} +1 -1
- package/dist/{index-Bby5ljat.d.mts → index-DknfL2GU.d.mts} +1 -1
- package/dist/{index-_y91DmIS.d.mts → index-OghXharF.d.mts} +721 -359
- package/dist/{index-DYSwiS9k.d.mts → index-ZW2YLa57.d.mts} +21 -2
- package/dist/{index-rcTqb9U3.d.mts → index-isYKpbs6.d.mts} +426 -266
- package/dist/{index-C8YcMooA.d.mts → index-kvJsAOSg.d.mts} +13 -9
- package/dist/index.d.mts +8 -7
- package/dist/index.mjs +7 -7
- package/dist/json/attributes.json +100 -0
- package/dist/json/importMap.json +64 -0
- package/dist/json/tags.json +45 -0
- package/dist/json/web-types.json +1303 -392
- package/dist/types/index.d.mts +2 -2
- package/dist/{useClickOutside-B47X8X6-.mjs → useClickOutside-w-Y2QxHh.mjs} +591 -657
- package/dist/utilities/index.d.mts +3 -3
- package/dist/utilities/index.mjs +2 -2
- package/dist/{utilities-9i1hJnMd.mjs → utilities-B58TiS_S.mjs} +41 -34
- package/package.json +3 -2
- /package/dist/{constants-3l8TGg5J.mjs → constants-DHKqjdjH.mjs} +0 -0
- /package/dist/{htmlElements-CXObxj0V.mjs → htmlElements-DO9n35bD.mjs} +0 -0
- /package/dist/{index-DMQJJUrv.d.mts → index-cPmI99rd.d.mts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as MaybeArray, i as ID } from "./index-
|
|
2
|
-
import { B as RegistryTicket, I as RegistryContext, L as RegistryContextOptions, M as SelectionTicket, S as GroupContext, T as GroupTicket, U as ContextTrinity, c as SingleContext, d as SingleTicket, k as SelectionContext, u as SingleOptions, z as RegistryOptions } from "./index-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { a as MaybeArray, i as ID, o as MaybeRef$1 } from "./index-ZW2YLa57.mjs";
|
|
2
|
+
import { B as RegistryTicket, C as GroupContextOptions, I as RegistryContext, L as RegistryContextOptions, M as SelectionTicket, S as GroupContext, T as GroupTicket, U as ContextTrinity, c as SingleContext, d as SingleTicket, k as SelectionContext, u as SingleOptions, w as GroupOptions, z as RegistryOptions } from "./index-DknfL2GU.mjs";
|
|
3
|
+
import { t as DateAdapter } from "./adapter-L4Php1_S.mjs";
|
|
4
|
+
import { App, ComputedRef, InjectionKey, MaybeRef, MaybeRefOrGetter, Reactive, Ref, ShallowRef, UnwrapNestedRefs, WatchSource } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/composables/createContext/index.d.ts
|
|
7
7
|
|
|
@@ -454,246 +454,41 @@ interface UseClickOutsideReturn {
|
|
|
454
454
|
*/
|
|
455
455
|
declare function useClickOutside(target: MaybeArray<ClickOutsideTarget>, handler: (event: PointerEvent | FocusEvent) => void, options?: UseClickOutsideOptions): UseClickOutsideReturn;
|
|
456
456
|
//#endregion
|
|
457
|
-
//#region src/composables/useDate/adapters/adapter.d.ts
|
|
458
|
-
interface DateAdapter<T = Temporal.PlainDateTime> {
|
|
459
|
-
/** Current locale for formatting */
|
|
460
|
-
locale?: string;
|
|
461
|
-
/** Create a date from various input types */
|
|
462
|
-
date: (value?: unknown) => T | null;
|
|
463
|
-
/** Convert to JavaScript Date object */
|
|
464
|
-
toJsDate: (value: T) => Date;
|
|
465
|
-
/** Parse ISO 8601 string */
|
|
466
|
-
parseISO: (date: string) => T;
|
|
467
|
-
/** Convert to ISO 8601 string */
|
|
468
|
-
toISO: (date: T) => string;
|
|
469
|
-
/** Parse date string with custom format */
|
|
470
|
-
parse: (value: string, format: string) => T | null;
|
|
471
|
-
/** Check if value is a valid date (type predicate for narrowing) */
|
|
472
|
-
isValid: (date: unknown) => date is T;
|
|
473
|
-
/** Check if value is null (type predicate for narrowing) */
|
|
474
|
-
isNull: (value: T | null) => value is null;
|
|
475
|
-
/** Get current locale code */
|
|
476
|
-
getCurrentLocaleCode: () => string;
|
|
477
|
-
/** Check if current locale uses 12-hour cycle */
|
|
478
|
-
is12HourCycleInCurrentLocale: () => boolean;
|
|
479
|
-
/** Format date using preset format key */
|
|
480
|
-
format: (date: T, formatString: string) => string;
|
|
481
|
-
/** Format date using custom format string */
|
|
482
|
-
formatByString: (date: T, formatString: string) => string;
|
|
483
|
-
/** Get helper text for format string (e.g., "mm/dd/yyyy") */
|
|
484
|
-
getFormatHelperText: (format: string) => string;
|
|
485
|
-
/** Format number according to locale */
|
|
486
|
-
formatNumber: (numberToFormat: string) => string;
|
|
487
|
-
/** Get meridiem text (AM/PM) for locale */
|
|
488
|
-
getMeridiemText: (ampm: 'am' | 'pm') => string;
|
|
489
|
-
startOfDay: (date: T) => T;
|
|
490
|
-
endOfDay: (date: T) => T;
|
|
491
|
-
/** @param firstDayOfWeek - 0=Sunday, 1=Monday, etc. */
|
|
492
|
-
startOfWeek: (date: T, firstDayOfWeek?: number) => T;
|
|
493
|
-
/** @param firstDayOfWeek - 0=Sunday, 1=Monday, etc. */
|
|
494
|
-
endOfWeek: (date: T, firstDayOfWeek?: number) => T;
|
|
495
|
-
startOfMonth: (date: T) => T;
|
|
496
|
-
endOfMonth: (date: T) => T;
|
|
497
|
-
startOfYear: (date: T) => T;
|
|
498
|
-
endOfYear: (date: T) => T;
|
|
499
|
-
addSeconds: (date: T, amount: number) => T;
|
|
500
|
-
addMinutes: (date: T, amount: number) => T;
|
|
501
|
-
addHours: (date: T, amount: number) => T;
|
|
502
|
-
addDays: (date: T, amount: number) => T;
|
|
503
|
-
addWeeks: (date: T, amount: number) => T;
|
|
504
|
-
addMonths: (date: T, amount: number) => T;
|
|
505
|
-
addYears: (date: T, amount: number) => T;
|
|
506
|
-
isAfter: (date: T, comparing: T) => boolean;
|
|
507
|
-
isAfterDay: (date: T, comparing: T) => boolean;
|
|
508
|
-
isAfterMonth: (date: T, comparing: T) => boolean;
|
|
509
|
-
isAfterYear: (date: T, comparing: T) => boolean;
|
|
510
|
-
isBefore: (date: T, comparing: T) => boolean;
|
|
511
|
-
isBeforeDay: (date: T, comparing: T) => boolean;
|
|
512
|
-
isBeforeMonth: (date: T, comparing: T) => boolean;
|
|
513
|
-
isBeforeYear: (date: T, comparing: T) => boolean;
|
|
514
|
-
isEqual: (date: T, comparing: T) => boolean;
|
|
515
|
-
isSameDay: (date: T, comparing: T) => boolean;
|
|
516
|
-
isSameMonth: (date: T, comparing: T) => boolean;
|
|
517
|
-
isSameYear: (date: T, comparing: T) => boolean;
|
|
518
|
-
isSameHour: (date: T, comparing: T) => boolean;
|
|
519
|
-
isWithinRange: (date: T, range: [T, T]) => boolean;
|
|
520
|
-
getYear: (date: T) => number;
|
|
521
|
-
getMonth: (date: T) => number;
|
|
522
|
-
getDate: (date: T) => number;
|
|
523
|
-
getHours: (date: T) => number;
|
|
524
|
-
getMinutes: (date: T) => number;
|
|
525
|
-
getSeconds: (date: T) => number;
|
|
526
|
-
/** @param comparing - Can be T or ISO string */
|
|
527
|
-
getDiff: (date: T, comparing: T | string, unit?: string) => number;
|
|
528
|
-
/** @param minimalDays - Minimum days in first week for it to count as week 1 */
|
|
529
|
-
getWeek: (date: T, firstDayOfWeek?: number, minimalDays?: number) => number;
|
|
530
|
-
/** Get number of days in the month */
|
|
531
|
-
getDaysInMonth: (date: T) => number;
|
|
532
|
-
setYear: (date: T, year: number) => T;
|
|
533
|
-
setMonth: (date: T, month: number) => T;
|
|
534
|
-
setDate: (date: T, day: number) => T;
|
|
535
|
-
setHours: (date: T, hours: number) => T;
|
|
536
|
-
setMinutes: (date: T, minutes: number) => T;
|
|
537
|
-
setSeconds: (date: T, seconds: number) => T;
|
|
538
|
-
getWeekdays: (firstDayOfWeek?: number, weekdayFormat?: 'long' | 'short' | 'narrow') => string[];
|
|
539
|
-
getWeekArray: (date: T, firstDayOfWeek?: number) => T[][];
|
|
540
|
-
/** Get array of months in a year (12 dates, one for each month) */
|
|
541
|
-
getMonthArray: (date: T) => T[];
|
|
542
|
-
/** Get array of years between start and end dates */
|
|
543
|
-
getYearRange: (start: T, end: T) => T[];
|
|
544
|
-
getNextMonth: (date: T) => T;
|
|
545
|
-
getPreviousMonth: (date: T) => T;
|
|
546
|
-
/** Merge date from one value with time from another */
|
|
547
|
-
mergeDateAndTime: (date: T, time: T) => T;
|
|
548
|
-
}
|
|
549
|
-
//#endregion
|
|
550
|
-
//#region src/composables/useDate/adapters/v0.d.ts
|
|
551
|
-
type PlainDateTime = Temporal.PlainDateTime;
|
|
552
|
-
declare class Vuetify0DateAdapter implements DateAdapter<PlainDateTime> {
|
|
553
|
-
private _locale;
|
|
554
|
-
/** Cache for Intl.DateTimeFormat instances, keyed by locale + options */
|
|
555
|
-
private formatCache;
|
|
556
|
-
/** Cache for Intl.NumberFormat instances, keyed by locale */
|
|
557
|
-
private numberFormatCache;
|
|
558
|
-
constructor(locale?: string);
|
|
559
|
-
/** Current locale. Setting a new locale clears format caches. */
|
|
560
|
-
get locale(): string;
|
|
561
|
-
set locale(value: string);
|
|
562
|
-
/**
|
|
563
|
-
* Create a date from various input types.
|
|
564
|
-
*
|
|
565
|
-
* @param value - Date value (PlainDateTime, PlainDate, ZonedDateTime, Date, ISO string, timestamp)
|
|
566
|
-
* @returns PlainDateTime or null if invalid
|
|
567
|
-
*
|
|
568
|
-
* @remarks
|
|
569
|
-
* **SSR Safety:** When called without arguments:
|
|
570
|
-
* - Browser: Returns current time via `Temporal.Now.plainDateTimeISO()`
|
|
571
|
-
* - Server: Returns epoch (1970-01-01T00:00:00) for deterministic rendering
|
|
572
|
-
*
|
|
573
|
-
* For SSR apps needing current time, pass `Date.now()` explicitly and handle
|
|
574
|
-
* hydration via `<ClientOnly>` (Nuxt) or `v-if` + `onMounted` pattern.
|
|
575
|
-
*/
|
|
576
|
-
date(value?: unknown): PlainDateTime | null;
|
|
577
|
-
toJsDate(value: PlainDateTime): Date;
|
|
578
|
-
parseISO(dateString: string): PlainDateTime;
|
|
579
|
-
toISO(date: PlainDateTime): string;
|
|
580
|
-
/**
|
|
581
|
-
* Parses a date string into a PlainDateTime.
|
|
582
|
-
*
|
|
583
|
-
* **Known limitation**: The `format` parameter is currently ignored.
|
|
584
|
-
* Temporal API doesn't provide built-in format parsing, and implementing
|
|
585
|
-
* full format string parsing (e.g., 'MM/DD/YYYY') would require a
|
|
586
|
-
* substantial custom parser. This method delegates to `date()` which
|
|
587
|
-
* handles ISO 8601 strings and common formats.
|
|
588
|
-
*
|
|
589
|
-
* For custom format parsing, consider using a library like date-fns or
|
|
590
|
-
* luxon with a custom adapter.
|
|
591
|
-
*
|
|
592
|
-
* @param value - The date string to parse
|
|
593
|
-
* @param _format - Format hint (currently ignored)
|
|
594
|
-
* @returns Parsed PlainDateTime or null if invalid
|
|
595
|
-
*/
|
|
596
|
-
parse(value: string, _format: string): PlainDateTime | null;
|
|
597
|
-
isValid(date: unknown): date is PlainDateTime;
|
|
598
|
-
isNull(value: PlainDateTime | null): value is null;
|
|
599
|
-
getCurrentLocaleCode(): string;
|
|
600
|
-
is12HourCycleInCurrentLocale(): boolean;
|
|
601
|
-
format(date: PlainDateTime, formatString: string): string;
|
|
602
|
-
formatByString(date: PlainDateTime, formatString: string): string;
|
|
603
|
-
getFormatHelperText(format: string): string;
|
|
604
|
-
formatNumber(numberToFormat: string): string;
|
|
605
|
-
getMeridiemText(ampm: 'am' | 'pm'): string;
|
|
606
|
-
startOfDay(date: PlainDateTime): PlainDateTime;
|
|
607
|
-
endOfDay(date: PlainDateTime): PlainDateTime;
|
|
608
|
-
startOfWeek(date: PlainDateTime, firstDayOfWeek?: number): PlainDateTime;
|
|
609
|
-
endOfWeek(date: PlainDateTime, firstDayOfWeek?: number): PlainDateTime;
|
|
610
|
-
startOfMonth(date: PlainDateTime): PlainDateTime;
|
|
611
|
-
endOfMonth(date: PlainDateTime): PlainDateTime;
|
|
612
|
-
startOfYear(date: PlainDateTime): PlainDateTime;
|
|
613
|
-
endOfYear(date: PlainDateTime): PlainDateTime;
|
|
614
|
-
addSeconds(date: PlainDateTime, amount: number): PlainDateTime;
|
|
615
|
-
addMinutes(date: PlainDateTime, amount: number): PlainDateTime;
|
|
616
|
-
addHours(date: PlainDateTime, amount: number): PlainDateTime;
|
|
617
|
-
addDays(date: PlainDateTime, amount: number): PlainDateTime;
|
|
618
|
-
addWeeks(date: PlainDateTime, amount: number): PlainDateTime;
|
|
619
|
-
addMonths(date: PlainDateTime, amount: number): PlainDateTime;
|
|
620
|
-
addYears(date: PlainDateTime, amount: number): PlainDateTime;
|
|
621
|
-
isAfter(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
622
|
-
isAfterDay(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
623
|
-
isAfterMonth(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
624
|
-
isAfterYear(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
625
|
-
isBefore(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
626
|
-
isBeforeDay(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
627
|
-
isBeforeMonth(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
628
|
-
isBeforeYear(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
629
|
-
isEqual(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
630
|
-
isSameDay(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
631
|
-
isSameMonth(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
632
|
-
isSameYear(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
633
|
-
isSameHour(date: PlainDateTime, comparing: PlainDateTime): boolean;
|
|
634
|
-
isWithinRange(date: PlainDateTime, [start, end]: [PlainDateTime, PlainDateTime]): boolean;
|
|
635
|
-
getYear(date: PlainDateTime): number;
|
|
636
|
-
getMonth(date: PlainDateTime): number;
|
|
637
|
-
getDate(date: PlainDateTime): number;
|
|
638
|
-
getHours(date: PlainDateTime): number;
|
|
639
|
-
getMinutes(date: PlainDateTime): number;
|
|
640
|
-
getSeconds(date: PlainDateTime): number;
|
|
641
|
-
getDiff(date: PlainDateTime, comparing: PlainDateTime | string, unit?: string): number;
|
|
642
|
-
getWeek(date: PlainDateTime, firstDayOfWeek?: number, minimalDays?: number): number;
|
|
643
|
-
getDaysInMonth(date: PlainDateTime): number;
|
|
644
|
-
setYear(date: PlainDateTime, year: number): PlainDateTime;
|
|
645
|
-
setMonth(date: PlainDateTime, month: number): PlainDateTime;
|
|
646
|
-
setDate(date: PlainDateTime, day: number): PlainDateTime;
|
|
647
|
-
setHours(date: PlainDateTime, hours: number): PlainDateTime;
|
|
648
|
-
setMinutes(date: PlainDateTime, minutes: number): PlainDateTime;
|
|
649
|
-
setSeconds(date: PlainDateTime, seconds: number): PlainDateTime;
|
|
650
|
-
getWeekdays(firstDayOfWeek?: number, format?: 'long' | 'short' | 'narrow'): string[];
|
|
651
|
-
getWeekArray(date: PlainDateTime, firstDayOfWeek?: number): PlainDateTime[][];
|
|
652
|
-
getMonthArray(date: PlainDateTime): PlainDateTime[];
|
|
653
|
-
getYearRange(start: PlainDateTime, end: PlainDateTime): PlainDateTime[];
|
|
654
|
-
getNextMonth(date: PlainDateTime): PlainDateTime;
|
|
655
|
-
getPreviousMonth(date: PlainDateTime): PlainDateTime;
|
|
656
|
-
mergeDateAndTime(date: PlainDateTime, time: PlainDateTime): PlainDateTime;
|
|
657
|
-
/**
|
|
658
|
-
* Gets a cached Intl.DateTimeFormat instance or creates one if not cached.
|
|
659
|
-
* Cache is limited to MAX_CACHE_SIZE entries to prevent memory leaks.
|
|
660
|
-
*/
|
|
661
|
-
private getFormatter;
|
|
662
|
-
/**
|
|
663
|
-
* Gets a cached Intl.NumberFormat instance or creates one if not cached.
|
|
664
|
-
* Cache is limited to MAX_CACHE_SIZE entries to prevent memory leaks.
|
|
665
|
-
*/
|
|
666
|
-
private getNumberFormatter;
|
|
667
|
-
}
|
|
668
|
-
//#endregion
|
|
669
457
|
//#region src/composables/useDate/index.d.ts
|
|
670
|
-
|
|
671
|
-
type DefaultDateType = Temporal.PlainDateTime;
|
|
672
|
-
interface DateContext<Z = DefaultDateType> {
|
|
458
|
+
interface DateContext<Z> {
|
|
673
459
|
/** The date adapter instance */
|
|
674
460
|
adapter: DateAdapter<Z>;
|
|
675
461
|
/** Current locale (reactive, synced with useLocale if available) */
|
|
676
462
|
locale: ComputedRef<string | undefined>;
|
|
677
463
|
}
|
|
678
464
|
/** Options for date composables */
|
|
679
|
-
interface DateOptions<Z
|
|
680
|
-
/**
|
|
681
|
-
|
|
465
|
+
interface DateOptions<Z> {
|
|
466
|
+
/**
|
|
467
|
+
* Date adapter instance.
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* ```ts
|
|
471
|
+
* import { Vuetify0DateAdapter } from '@vuetify/v0/date'
|
|
472
|
+
* createDate({ adapter: new Vuetify0DateAdapter() })
|
|
473
|
+
* ```
|
|
474
|
+
*/
|
|
475
|
+
adapter: DateAdapter<Z>;
|
|
682
476
|
/** Locale for formatting (defaults to useLocale's selected locale or 'en-US') */
|
|
683
477
|
locale?: string;
|
|
684
478
|
/** Short locale codes mapped to full Intl locale strings (e.g., { en: 'en-US' }) */
|
|
685
479
|
locales?: Record<string, string>;
|
|
686
480
|
}
|
|
687
481
|
/** Context options with namespace */
|
|
688
|
-
interface DateContextOptions<Z
|
|
482
|
+
interface DateContextOptions<Z> extends DateOptions<Z> {
|
|
689
483
|
namespace?: string;
|
|
690
484
|
}
|
|
691
485
|
/** Plugin options */
|
|
692
|
-
interface DatePluginOptions<Z
|
|
486
|
+
interface DatePluginOptions<Z> extends DateContextOptions<Z> {}
|
|
693
487
|
/**
|
|
694
488
|
* Creates a new date context.
|
|
695
489
|
*
|
|
696
|
-
* @param options
|
|
490
|
+
* @param options Adapter and locale configuration.
|
|
491
|
+
* @template Z The date type used by the adapter.
|
|
697
492
|
* @template E The date context type.
|
|
698
493
|
* @returns A date context.
|
|
699
494
|
*
|
|
@@ -701,28 +496,24 @@ interface DatePluginOptions<Z = DefaultDateType> extends DateContextOptions<Z> {
|
|
|
701
496
|
*
|
|
702
497
|
* @example
|
|
703
498
|
* ```ts
|
|
704
|
-
*
|
|
705
|
-
* const today = adapter.date() // Temporal.PlainDateTime
|
|
499
|
+
* import { Vuetify0DateAdapter } from '@vuetify/v0/date'
|
|
706
500
|
*
|
|
707
|
-
*
|
|
708
|
-
* const
|
|
501
|
+
* const { adapter } = createDate({ adapter: new Vuetify0DateAdapter() })
|
|
502
|
+
* const today = adapter.date()
|
|
709
503
|
*
|
|
710
|
-
* // With
|
|
711
|
-
* const { adapter } = createDate({
|
|
504
|
+
* // With locale options
|
|
505
|
+
* const { adapter } = createDate({
|
|
506
|
+
* adapter: new Vuetify0DateAdapter(),
|
|
507
|
+
* locale: 'de-DE',
|
|
508
|
+
* })
|
|
712
509
|
* ```
|
|
713
510
|
*/
|
|
714
|
-
declare function createDate<Z
|
|
715
|
-
/**
|
|
716
|
-
* Creates a fallback date context for when useDate is called outside of a Vue component.
|
|
717
|
-
*
|
|
718
|
-
* @returns A fallback date context with Vuetify0DateAdapter.
|
|
719
|
-
* @internal
|
|
720
|
-
*/
|
|
721
|
-
declare function createDateFallback(): DateContext<DefaultDateType>;
|
|
511
|
+
declare function createDate<Z, E extends DateContext<Z> = DateContext<Z>>(options: DateOptions<Z>): E;
|
|
722
512
|
/**
|
|
723
513
|
* Creates a new date context trinity.
|
|
724
514
|
*
|
|
725
|
-
* @param options
|
|
515
|
+
* @param options Adapter, locale, and namespace configuration.
|
|
516
|
+
* @template Z The date type used by the adapter.
|
|
726
517
|
* @template E The date context type.
|
|
727
518
|
* @returns A trinity [useContext, provideContext, defaultContext].
|
|
728
519
|
*
|
|
@@ -730,22 +521,20 @@ declare function createDateFallback(): DateContext<DefaultDateType>;
|
|
|
730
521
|
*
|
|
731
522
|
* @example
|
|
732
523
|
* ```ts
|
|
733
|
-
*
|
|
734
|
-
* namespace: 'app:date',
|
|
735
|
-
* })
|
|
524
|
+
* import { Vuetify0DateAdapter } from '@vuetify/v0/date'
|
|
736
525
|
*
|
|
737
|
-
* // With custom adapter
|
|
738
526
|
* const [useAppDate, provideAppDate] = createDateContext({
|
|
739
|
-
* adapter: new
|
|
527
|
+
* adapter: new Vuetify0DateAdapter(),
|
|
740
528
|
* namespace: 'app:date',
|
|
741
529
|
* })
|
|
742
530
|
* ```
|
|
743
531
|
*/
|
|
744
|
-
declare function createDateContext<Z
|
|
532
|
+
declare function createDateContext<Z, E extends DateContext<Z> = DateContext<Z>>(options: DateContextOptions<Z>): ContextTrinity<E>;
|
|
745
533
|
/**
|
|
746
534
|
* Creates a new date plugin.
|
|
747
535
|
*
|
|
748
|
-
* @param options
|
|
536
|
+
* @param options Adapter, locale, and namespace configuration.
|
|
537
|
+
* @template Z The date type used by the adapter.
|
|
749
538
|
* @template E The date context type.
|
|
750
539
|
* @returns A Vue plugin.
|
|
751
540
|
*
|
|
@@ -753,30 +542,42 @@ declare function createDateContext<Z = DefaultDateType, E extends DateContext<Z>
|
|
|
753
542
|
*
|
|
754
543
|
* @example
|
|
755
544
|
* ```ts
|
|
756
|
-
*
|
|
757
|
-
* app.use(createDatePlugin())
|
|
545
|
+
* import { Vuetify0DateAdapter } from '@vuetify/v0/date'
|
|
758
546
|
*
|
|
759
|
-
*
|
|
760
|
-
* app.use(createDatePlugin({
|
|
547
|
+
* const app = createApp(App)
|
|
548
|
+
* app.use(createDatePlugin({ adapter: new Vuetify0DateAdapter() }))
|
|
761
549
|
*
|
|
762
|
-
* // With
|
|
763
|
-
* app.use(createDatePlugin({
|
|
550
|
+
* // With locale options
|
|
551
|
+
* app.use(createDatePlugin({
|
|
552
|
+
* adapter: new Vuetify0DateAdapter(),
|
|
553
|
+
* locale: 'de-DE',
|
|
554
|
+
* }))
|
|
764
555
|
* ```
|
|
765
556
|
*/
|
|
766
|
-
declare function createDatePlugin<Z
|
|
557
|
+
declare function createDatePlugin<Z, E extends DateContext<Z> = DateContext<Z>>(options: DatePluginOptions<Z>): Plugin;
|
|
767
558
|
/**
|
|
768
559
|
* Returns the current date context.
|
|
769
560
|
*
|
|
770
|
-
*
|
|
771
|
-
* returns that context. Otherwise, returns a fallback context with Vuetify0DateAdapter.
|
|
561
|
+
* Requires `createDatePlugin` to be installed with an adapter.
|
|
772
562
|
*
|
|
773
563
|
* @param namespace The namespace to look up (defaults to 'v0:date').
|
|
564
|
+
* @template Z The date type used by the adapter.
|
|
774
565
|
* @template E The date context type.
|
|
775
566
|
* @returns The current date context.
|
|
567
|
+
* @throws If called outside a component or without a date plugin installed.
|
|
776
568
|
*
|
|
777
569
|
* @see https://0.vuetifyjs.com/composables/plugins/use-date
|
|
778
570
|
*
|
|
779
571
|
* @example
|
|
572
|
+
* ```ts
|
|
573
|
+
* // main.ts
|
|
574
|
+
* import { Vuetify0DateAdapter } from '@vuetify/v0/date'
|
|
575
|
+
* import { createDatePlugin } from '@vuetify/v0'
|
|
576
|
+
*
|
|
577
|
+
* app.use(createDatePlugin({ adapter: new Vuetify0DateAdapter() }))
|
|
578
|
+
* ```
|
|
579
|
+
*
|
|
580
|
+
* @example
|
|
780
581
|
* ```vue
|
|
781
582
|
* <script setup lang="ts">
|
|
782
583
|
* import { useDate } from '@vuetify/v0'
|
|
@@ -786,7 +587,7 @@ declare function createDatePlugin<Z = DefaultDateType, E extends DateContext<Z>
|
|
|
786
587
|
* </script>
|
|
787
588
|
* ```
|
|
788
589
|
*/
|
|
789
|
-
declare function useDate<Z
|
|
590
|
+
declare function useDate<Z, E extends DateContext<Z> = DateContext<Z>>(namespace?: string): E;
|
|
790
591
|
//#endregion
|
|
791
592
|
//#region src/composables/useEventListener/index.d.ts
|
|
792
593
|
type CleanupFunction = () => void;
|
|
@@ -1490,8 +1291,14 @@ declare function useHotkey(keys: MaybeRefOrGetter<string | undefined>, callback:
|
|
|
1490
1291
|
//#endregion
|
|
1491
1292
|
//#region src/composables/useHydration/index.d.ts
|
|
1492
1293
|
interface HydrationContext {
|
|
1294
|
+
/** True when root component has mounted (hydration complete) */
|
|
1493
1295
|
isHydrated: Readonly<ShallowRef<boolean>>;
|
|
1296
|
+
/** True after first tick post-hydration (safe for animations after state restoration) */
|
|
1297
|
+
isSettled: Readonly<ShallowRef<boolean>>;
|
|
1298
|
+
/** Mark hydration as complete */
|
|
1494
1299
|
hydrate: () => void;
|
|
1300
|
+
/** Mark as settled (called automatically after nextTick post-hydration) */
|
|
1301
|
+
settle: () => void;
|
|
1495
1302
|
}
|
|
1496
1303
|
interface HydrationOptions {}
|
|
1497
1304
|
interface HydrationContextOptions extends HydrationOptions {
|
|
@@ -1572,20 +1379,22 @@ declare function createHydrationPlugin<E extends HydrationContext = HydrationCon
|
|
|
1572
1379
|
* <script setup lang="ts">
|
|
1573
1380
|
* import { useHydration } from '@vuetify/v0'
|
|
1574
1381
|
*
|
|
1575
|
-
* const
|
|
1382
|
+
* const { isHydrated, isSettled } = useHydration()
|
|
1383
|
+
*
|
|
1384
|
+
* // Use isSettled to gate animations after state restoration
|
|
1385
|
+
* const transition = computed(() => isSettled.value ? 'fade' : undefined)
|
|
1576
1386
|
* </script>
|
|
1577
1387
|
*
|
|
1578
1388
|
* <template>
|
|
1579
|
-
* <
|
|
1580
|
-
* <
|
|
1581
|
-
* </
|
|
1389
|
+
* <Transition :name="transition">
|
|
1390
|
+
* <div v-if="show">Animates only after hydration settles</div>
|
|
1391
|
+
* </Transition>
|
|
1582
1392
|
* </template>
|
|
1583
1393
|
* ```
|
|
1584
1394
|
*/
|
|
1585
1395
|
declare function useHydration<E extends HydrationContext = HydrationContext>(namespace?: string): E;
|
|
1586
1396
|
//#endregion
|
|
1587
1397
|
//#region src/composables/useIntersectionObserver/index.d.ts
|
|
1588
|
-
type MaybeRef$1<T> = T | Ref<T> | Readonly<Ref<T>> | ShallowRef<T> | Readonly<ShallowRef<T>>;
|
|
1589
1398
|
interface IntersectionObserverEntry {
|
|
1590
1399
|
boundingClientRect: DOMRectReadOnly;
|
|
1591
1400
|
intersectionRatio: number;
|
|
@@ -2248,7 +2057,358 @@ interface UseMutationObserverReturn {
|
|
|
2248
2057
|
* resume()
|
|
2249
2058
|
* ```
|
|
2250
2059
|
*/
|
|
2251
|
-
declare function useMutationObserver(target:
|
|
2060
|
+
declare function useMutationObserver(target: MaybeRef$1<Element | null | undefined>, callback: (entries: MutationObserverRecord[]) => void, options?: UseMutationObserverOptions): UseMutationObserverReturn;
|
|
2061
|
+
//#endregion
|
|
2062
|
+
//#region src/composables/createNested/types.d.ts
|
|
2063
|
+
/**
|
|
2064
|
+
* Ticket for nested/hierarchical items with parent-child relationships.
|
|
2065
|
+
*
|
|
2066
|
+
* @remarks
|
|
2067
|
+
* Extends GroupTicket with open/close state and leaf detection.
|
|
2068
|
+
* Each ticket knows its parent and can control its own open/closed state.
|
|
2069
|
+
*/
|
|
2070
|
+
interface NestedTicket<V = unknown> extends GroupTicket<V> {
|
|
2071
|
+
/** ID of the parent ticket, or undefined if this is a root item */
|
|
2072
|
+
parentId: ID | undefined;
|
|
2073
|
+
/** Whether this ticket is currently open/expanded */
|
|
2074
|
+
isOpen: Readonly<Ref<boolean>>;
|
|
2075
|
+
/** Whether this ticket is a leaf node (has no children) */
|
|
2076
|
+
isLeaf: Readonly<Ref<boolean>>;
|
|
2077
|
+
/** Depth in tree (0 = root) */
|
|
2078
|
+
depth: Readonly<Ref<number>>;
|
|
2079
|
+
/** Open/expand this ticket */
|
|
2080
|
+
open: () => void;
|
|
2081
|
+
/** Close/collapse this ticket */
|
|
2082
|
+
close: () => void;
|
|
2083
|
+
/** Flip this ticket's open/closed state */
|
|
2084
|
+
flip: () => void;
|
|
2085
|
+
/** Reveal this ticket by opening all ancestors */
|
|
2086
|
+
reveal: () => void;
|
|
2087
|
+
/** Get path from root to self (includes self) */
|
|
2088
|
+
getPath: () => ID[];
|
|
2089
|
+
/** Get ancestors excluding self */
|
|
2090
|
+
getAncestors: () => ID[];
|
|
2091
|
+
/** Get all descendants */
|
|
2092
|
+
getDescendants: () => ID[];
|
|
2093
|
+
/** Check if this ticket is an ancestor of the given ID */
|
|
2094
|
+
isAncestorOf: (descendantId: ID) => boolean;
|
|
2095
|
+
/** Check if this ticket has the given ID as an ancestor */
|
|
2096
|
+
hasAncestor: (ancestorId: ID) => boolean;
|
|
2097
|
+
/** Get sibling IDs (including self) */
|
|
2098
|
+
siblings: () => ID[];
|
|
2099
|
+
/** Get 1-indexed position among siblings (for aria-posinset) */
|
|
2100
|
+
position: () => number;
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Minimal context interface for open strategy callbacks.
|
|
2104
|
+
* Only exposes the state needed for open/close operations.
|
|
2105
|
+
*/
|
|
2106
|
+
interface OpenStrategyContext {
|
|
2107
|
+
/** Set of currently opened item IDs (mutable for strategy control) */
|
|
2108
|
+
openedIds: Reactive<Set<ID>>;
|
|
2109
|
+
/** Map of parent IDs to child ID arrays (readonly - use for traversal only) */
|
|
2110
|
+
readonly children: ReadonlyMap<ID, readonly ID[]>;
|
|
2111
|
+
/** Map of child IDs to parent IDs (readonly - use for traversal only) */
|
|
2112
|
+
readonly parents: ReadonlyMap<ID, ID | undefined>;
|
|
2113
|
+
}
|
|
2114
|
+
/**
|
|
2115
|
+
* Strategy interface for controlling how items are opened.
|
|
2116
|
+
*
|
|
2117
|
+
* @remarks
|
|
2118
|
+
* Strategies define the behavior when an item is opened:
|
|
2119
|
+
* - Single: Only one item open at a time
|
|
2120
|
+
* - Multiple: Multiple items can be open
|
|
2121
|
+
* - Custom: Implement your own logic
|
|
2122
|
+
*/
|
|
2123
|
+
interface OpenStrategy {
|
|
2124
|
+
/** Called when an item is opened */
|
|
2125
|
+
onOpen?: (id: ID, context: OpenStrategyContext) => void;
|
|
2126
|
+
/** Called when an item is closed */
|
|
2127
|
+
onClose?: (id: ID, context: OpenStrategyContext) => void;
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Registration input for nested items.
|
|
2131
|
+
* Allows inline children definition for easier tree construction.
|
|
2132
|
+
*/
|
|
2133
|
+
interface NestedRegistration<V = unknown> {
|
|
2134
|
+
/** Unique identifier (auto-generated if not provided) */
|
|
2135
|
+
id?: ID;
|
|
2136
|
+
/** Value associated with this item */
|
|
2137
|
+
value?: V;
|
|
2138
|
+
/** Parent ID (set automatically when using children property) */
|
|
2139
|
+
parentId?: ID;
|
|
2140
|
+
/** Whether this item is disabled */
|
|
2141
|
+
disabled?: boolean;
|
|
2142
|
+
/** Inline children to register with this item as parent */
|
|
2143
|
+
children?: NestedRegistration<V>[];
|
|
2144
|
+
}
|
|
2145
|
+
/**
|
|
2146
|
+
* Context for managing nested/hierarchical item collections.
|
|
2147
|
+
*
|
|
2148
|
+
* @remarks
|
|
2149
|
+
* Extends GroupContext with parent-child relationship tracking, open/close state,
|
|
2150
|
+
* and hierarchical traversal methods. Perfect for tree structures, nested menus,
|
|
2151
|
+
* file explorers, and organizational charts.
|
|
2152
|
+
*/
|
|
2153
|
+
interface NestedContext<Z extends NestedTicket> extends Omit<GroupContext<Z>, 'register' | 'onboard' | 'select' | 'unselect' | 'toggle'> {
|
|
2154
|
+
/** Map of parent IDs to arrays of child IDs. Use register/unregister to modify. */
|
|
2155
|
+
readonly children: ReadonlyMap<ID, readonly ID[]>;
|
|
2156
|
+
/** Map of child IDs to their parent ID (or undefined for roots). Use register/unregister to modify. */
|
|
2157
|
+
readonly parents: ReadonlyMap<ID, ID | undefined>;
|
|
2158
|
+
/** Reactive Set of opened/expanded item IDs. Use open/close/flip to modify. */
|
|
2159
|
+
readonly openedIds: Reactive<Set<ID>>;
|
|
2160
|
+
/** Computed Set of opened/expanded item instances */
|
|
2161
|
+
openedItems: ComputedRef<Set<Z>>;
|
|
2162
|
+
/** Open/expand one or more items by ID */
|
|
2163
|
+
open: (ids: ID | ID[]) => void;
|
|
2164
|
+
/** Close/collapse one or more items by ID */
|
|
2165
|
+
close: (ids: ID | ID[]) => void;
|
|
2166
|
+
/** Flip one or more items' open/closed state by ID */
|
|
2167
|
+
flip: (ids: ID | ID[]) => void;
|
|
2168
|
+
/** Check if an item is open by ID */
|
|
2169
|
+
opened: (id: ID) => boolean;
|
|
2170
|
+
/** Open node(s) and their immediate non-leaf children */
|
|
2171
|
+
unfold: (ids: ID | ID[]) => void;
|
|
2172
|
+
/** Reveal node(s) by opening all ancestors (makes node visible without opening it) */
|
|
2173
|
+
reveal: (ids: ID | ID[]) => void;
|
|
2174
|
+
/** Fully expand node(s) and all their non-leaf descendants */
|
|
2175
|
+
expand: (ids: ID | ID[]) => void;
|
|
2176
|
+
/** Expand all non-leaf nodes */
|
|
2177
|
+
expandAll: () => void;
|
|
2178
|
+
/** Collapse all nodes */
|
|
2179
|
+
collapseAll: () => void;
|
|
2180
|
+
/** Convert tree to flat array with parentId references */
|
|
2181
|
+
toFlat: () => Array<{
|
|
2182
|
+
id: ID;
|
|
2183
|
+
parentId: ID | undefined;
|
|
2184
|
+
value: unknown;
|
|
2185
|
+
}>;
|
|
2186
|
+
/** Get the path from root to the specified item (inclusive) */
|
|
2187
|
+
getPath: (id: ID) => ID[];
|
|
2188
|
+
/** Get all descendants of an item */
|
|
2189
|
+
getDescendants: (id: ID) => ID[];
|
|
2190
|
+
/** Get all ancestors of an item (excluding self) */
|
|
2191
|
+
getAncestors: (id: ID) => ID[];
|
|
2192
|
+
/** Check if an item is a leaf node */
|
|
2193
|
+
isLeaf: (id: ID) => boolean;
|
|
2194
|
+
/** Get the depth level of an item in the tree */
|
|
2195
|
+
getDepth: (id: ID) => number;
|
|
2196
|
+
/** Check if ancestorId is an ancestor of descendantId */
|
|
2197
|
+
isAncestorOf: (ancestorId: ID, descendantId: ID) => boolean;
|
|
2198
|
+
/** Check if id has ancestorId as an ancestor (semantic alias for isAncestorOf) */
|
|
2199
|
+
hasAncestor: (id: ID, ancestorId: ID) => boolean;
|
|
2200
|
+
/** Get sibling IDs (including self). For roots, returns all root IDs. */
|
|
2201
|
+
siblings: (id: ID) => ID[];
|
|
2202
|
+
/** Get 1-indexed position among siblings (for aria-posinset). Returns 0 if not found. */
|
|
2203
|
+
position: (id: ID) => number;
|
|
2204
|
+
/** Computed array of root items (items with no parent) */
|
|
2205
|
+
roots: ComputedRef<Z[]>;
|
|
2206
|
+
/** Computed array of leaf items (items with no children) */
|
|
2207
|
+
leaves: ComputedRef<Z[]>;
|
|
2208
|
+
/** Strategy controlling how items are opened */
|
|
2209
|
+
openStrategy: OpenStrategy;
|
|
2210
|
+
/** Select item(s) and all descendants, updating ancestor mixed states */
|
|
2211
|
+
select: (ids: ID | ID[]) => void;
|
|
2212
|
+
/** Unselect item(s) and all descendants, updating ancestor mixed states */
|
|
2213
|
+
unselect: (ids: ID | ID[]) => void;
|
|
2214
|
+
/** Toggle selection with cascading behavior */
|
|
2215
|
+
toggle: (ids: ID | ID[]) => void;
|
|
2216
|
+
/** Register a node with optional inline children */
|
|
2217
|
+
register: (registration?: NestedRegistration) => Z;
|
|
2218
|
+
/** Batch register nodes with optional inline children */
|
|
2219
|
+
onboard: (registrations: NestedRegistration[]) => Z[];
|
|
2220
|
+
/** Unregister a node, optionally cascading to descendants */
|
|
2221
|
+
unregister: (id: ID, cascade?: boolean) => void;
|
|
2222
|
+
/** Offboard multiple nodes, optionally cascading */
|
|
2223
|
+
offboard: (ids: ID[], cascade?: boolean) => void;
|
|
2224
|
+
/** Clear all nodes and nested state (children, parents, openedIds) */
|
|
2225
|
+
clear: () => void;
|
|
2226
|
+
}
|
|
2227
|
+
/**
|
|
2228
|
+
* Open mode for nested items.
|
|
2229
|
+
* - `'multiple'` (default): Multiple nodes can be open simultaneously
|
|
2230
|
+
* - `'single'`: Only one node can be open at a time (accordion behavior)
|
|
2231
|
+
*/
|
|
2232
|
+
type NestedOpenMode = 'single' | 'multiple';
|
|
2233
|
+
/**
|
|
2234
|
+
* Selection mode for nested items.
|
|
2235
|
+
* - `'cascade'` (default): Selecting a parent selects all descendants; ancestors show mixed state
|
|
2236
|
+
* - `'independent'`: Each node is selected independently, no cascading
|
|
2237
|
+
* - `'leaf'`: Only leaf nodes can be selected; selecting parent selects all leaf descendants
|
|
2238
|
+
*/
|
|
2239
|
+
type NestedSelectionMode = 'cascade' | 'independent' | 'leaf';
|
|
2240
|
+
/**
|
|
2241
|
+
* Options for creating a nested instance.
|
|
2242
|
+
*/
|
|
2243
|
+
interface NestedOptions extends GroupOptions {
|
|
2244
|
+
/**
|
|
2245
|
+
* Controls how nodes expand/collapse.
|
|
2246
|
+
* - `'multiple'` (default): Multiple nodes can be open simultaneously
|
|
2247
|
+
* - `'single'`: Only one node open at a time (accordion behavior)
|
|
2248
|
+
*/
|
|
2249
|
+
open?: NestedOpenMode;
|
|
2250
|
+
/**
|
|
2251
|
+
* When true, parent nodes automatically open when children are registered.
|
|
2252
|
+
* Similar to `enroll` in selection composables but for open state.
|
|
2253
|
+
*/
|
|
2254
|
+
openAll?: boolean;
|
|
2255
|
+
/**
|
|
2256
|
+
* When true, opening a node also opens all its ancestors.
|
|
2257
|
+
* Ensures the opened node is always visible in the tree.
|
|
2258
|
+
*/
|
|
2259
|
+
reveal?: boolean;
|
|
2260
|
+
/**
|
|
2261
|
+
* Controls how selection cascades through the hierarchy.
|
|
2262
|
+
* - `'cascade'` (default): Selecting parent selects descendants; ancestors show mixed state
|
|
2263
|
+
* - `'independent'`: Each node selected independently
|
|
2264
|
+
* - `'leaf'`: Only leaf nodes selectable; parent selection selects leaf descendants
|
|
2265
|
+
*/
|
|
2266
|
+
selection?: NestedSelectionMode;
|
|
2267
|
+
/**
|
|
2268
|
+
* Advanced: Custom strategy for open behavior.
|
|
2269
|
+
* Overrides `open` option if provided.
|
|
2270
|
+
* @deprecated Use `open` option for simple cases
|
|
2271
|
+
*/
|
|
2272
|
+
openStrategy?: OpenStrategy;
|
|
2273
|
+
}
|
|
2274
|
+
/**
|
|
2275
|
+
* Options for creating a nested context.
|
|
2276
|
+
*/
|
|
2277
|
+
interface NestedContextOptions extends GroupContextOptions {
|
|
2278
|
+
/**
|
|
2279
|
+
* Controls how nodes expand/collapse.
|
|
2280
|
+
* - `'multiple'` (default): Multiple nodes can be open simultaneously
|
|
2281
|
+
* - `'single'`: Only one node open at a time (accordion behavior)
|
|
2282
|
+
*/
|
|
2283
|
+
open?: NestedOpenMode;
|
|
2284
|
+
/**
|
|
2285
|
+
* When true, parent nodes automatically open when children are registered.
|
|
2286
|
+
* Similar to `enroll` in selection composables but for open state.
|
|
2287
|
+
*/
|
|
2288
|
+
openAll?: boolean;
|
|
2289
|
+
/**
|
|
2290
|
+
* When true, opening a node also opens all its ancestors.
|
|
2291
|
+
* Ensures the opened node is always visible in the tree.
|
|
2292
|
+
*/
|
|
2293
|
+
reveal?: boolean;
|
|
2294
|
+
/**
|
|
2295
|
+
* Controls how selection cascades through the hierarchy.
|
|
2296
|
+
* - `'cascade'` (default): Selecting parent selects descendants; ancestors show mixed state
|
|
2297
|
+
* - `'independent'`: Each node selected independently
|
|
2298
|
+
* - `'leaf'`: Only leaf nodes selectable; parent selection selects leaf descendants
|
|
2299
|
+
*/
|
|
2300
|
+
selection?: NestedSelectionMode;
|
|
2301
|
+
/**
|
|
2302
|
+
* Advanced: Custom strategy for open behavior.
|
|
2303
|
+
* Overrides `open` option if provided.
|
|
2304
|
+
* @deprecated Use `open` option for simple cases
|
|
2305
|
+
*/
|
|
2306
|
+
openStrategy?: OpenStrategy;
|
|
2307
|
+
}
|
|
2308
|
+
//#endregion
|
|
2309
|
+
//#region src/composables/createNested/strategies.d.ts
|
|
2310
|
+
/**
|
|
2311
|
+
* Multiple open strategy: allows multiple nodes to be open simultaneously.
|
|
2312
|
+
*
|
|
2313
|
+
* @remarks
|
|
2314
|
+
* Perfect for tree views, file explorers, and nested menus where users expect
|
|
2315
|
+
* to keep multiple sections expanded at once.
|
|
2316
|
+
*
|
|
2317
|
+
* @example
|
|
2318
|
+
* ```ts
|
|
2319
|
+
* const tree = createNested({ openStrategy: multipleOpenStrategy })
|
|
2320
|
+
* tree.open('node-1')
|
|
2321
|
+
* tree.open('node-2')
|
|
2322
|
+
* // Both nodes are now open
|
|
2323
|
+
* ```
|
|
2324
|
+
*/
|
|
2325
|
+
declare const multipleOpenStrategy: OpenStrategy;
|
|
2326
|
+
/**
|
|
2327
|
+
* Single open strategy: only one node can be open at a time (accordion behavior).
|
|
2328
|
+
*
|
|
2329
|
+
* @remarks
|
|
2330
|
+
* Perfect for accordions, single-select navigation, and contexts where only
|
|
2331
|
+
* one section should be visible at a time.
|
|
2332
|
+
*
|
|
2333
|
+
* @example
|
|
2334
|
+
* ```ts
|
|
2335
|
+
* const tree = createNested({ openStrategy: singleOpenStrategy })
|
|
2336
|
+
* tree.open('node-1') // node-1 opens
|
|
2337
|
+
* tree.open('node-2') // node-1 closes, node-2 opens
|
|
2338
|
+
* ```
|
|
2339
|
+
*/
|
|
2340
|
+
declare const singleOpenStrategy: OpenStrategy;
|
|
2341
|
+
//#endregion
|
|
2342
|
+
//#region src/composables/createNested/index.d.ts
|
|
2343
|
+
/**
|
|
2344
|
+
* Creates a new nested tree instance with hierarchical management.
|
|
2345
|
+
*
|
|
2346
|
+
* Extends `createGroup` to support parent-child relationships, tree traversal,
|
|
2347
|
+
* and open/close state management. Perfect for tree views, nested navigation,
|
|
2348
|
+
* and hierarchical data structures.
|
|
2349
|
+
*
|
|
2350
|
+
* @param options The options for the nested instance.
|
|
2351
|
+
* @template Z The type of the nested ticket.
|
|
2352
|
+
* @template E The type of the nested context.
|
|
2353
|
+
* @returns A new nested instance with tree management capabilities.
|
|
2354
|
+
*
|
|
2355
|
+
* @remarks
|
|
2356
|
+
* **Key Differences from `createGroup`:**
|
|
2357
|
+
* - `register()` accepts `parentId` for establishing parent-child relationships
|
|
2358
|
+
* - `unregister()` accepts optional `cascade` parameter for cascading deletions
|
|
2359
|
+
* - Adds tree traversal methods: `getPath()`, `getAncestors()`, `getDescendants()`
|
|
2360
|
+
* - Adds computed properties: `roots`, `leaves`, `isLeaf()`, `getDepth()`
|
|
2361
|
+
* - Adds open state management: `open()`, `close()`, `flip()`, `opened()`
|
|
2362
|
+
*
|
|
2363
|
+
* @see https://0.vuetifyjs.com/composables/selection/use-nested
|
|
2364
|
+
*
|
|
2365
|
+
* @example
|
|
2366
|
+
* ```ts
|
|
2367
|
+
* import { createNested } from '@vuetify/v0'
|
|
2368
|
+
*
|
|
2369
|
+
* const tree = createNested()
|
|
2370
|
+
*
|
|
2371
|
+
* const root = tree.register({ id: 'root', value: 'Root' })
|
|
2372
|
+
* const child1 = tree.register({ id: 'child-1', value: 'Child 1', parentId: 'root' })
|
|
2373
|
+
* const child2 = tree.register({ id: 'child-2', value: 'Child 2', parentId: 'root' })
|
|
2374
|
+
*
|
|
2375
|
+
* console.log(tree.getPath('child-1')) // ['root', 'child-1']
|
|
2376
|
+
* console.log(tree.getDescendants('root')) // ['child-1', 'child-2']
|
|
2377
|
+
* console.log(tree.isLeaf('child-2')) // true
|
|
2378
|
+
*
|
|
2379
|
+
* tree.open('root')
|
|
2380
|
+
* console.log(tree.opened('root')) // true
|
|
2381
|
+
* ```
|
|
2382
|
+
*/
|
|
2383
|
+
declare function createNested<Z extends NestedTicket = NestedTicket, E extends NestedContext<Z> = NestedContext<Z>>(_options?: NestedOptions): E;
|
|
2384
|
+
/**
|
|
2385
|
+
* Creates a new nested context with provide/inject pattern.
|
|
2386
|
+
*
|
|
2387
|
+
* @param options The options for the nested context.
|
|
2388
|
+
* @returns A trinity tuple [useNested, provideNested, defaultNested]
|
|
2389
|
+
*
|
|
2390
|
+
* @see https://0.vuetifyjs.com/composables/selection/use-nested
|
|
2391
|
+
*
|
|
2392
|
+
* @example
|
|
2393
|
+
* ```ts
|
|
2394
|
+
* import { createNestedContext } from '@vuetify/v0'
|
|
2395
|
+
*
|
|
2396
|
+
* export const [useTree, provideTree, tree] = createNestedContext()
|
|
2397
|
+
*
|
|
2398
|
+
* // In parent: provideTree()
|
|
2399
|
+
* // In child: const tree = useTree()
|
|
2400
|
+
* ```
|
|
2401
|
+
*/
|
|
2402
|
+
declare function createNestedContext<Z extends NestedTicket = NestedTicket, E extends NestedContext<Z> = NestedContext<Z>>(_options?: NestedContextOptions): ContextTrinity<E>;
|
|
2403
|
+
/**
|
|
2404
|
+
* Returns the current nested instance from context.
|
|
2405
|
+
*
|
|
2406
|
+
* @param namespace The namespace for the nested context. Defaults to `'v0:nested'`.
|
|
2407
|
+
* @returns The current nested instance.
|
|
2408
|
+
*
|
|
2409
|
+
* @see https://0.vuetifyjs.com/composables/selection/use-nested
|
|
2410
|
+
*/
|
|
2411
|
+
declare function useNested<Z extends NestedTicket = NestedTicket, E extends NestedContext<Z> = NestedContext<Z>>(namespace?: string): E;
|
|
2252
2412
|
//#endregion
|
|
2253
2413
|
//#region src/composables/useOverflow/index.d.ts
|
|
2254
2414
|
interface OverflowOptions {
|
|
@@ -2937,7 +3097,7 @@ interface UseResizeObserverReturn {
|
|
|
2937
3097
|
* resume()
|
|
2938
3098
|
* ```
|
|
2939
3099
|
*/
|
|
2940
|
-
declare function useResizeObserver(target:
|
|
3100
|
+
declare function useResizeObserver(target: MaybeRef$1<Element | null | undefined>, callback: (entries: ResizeObserverEntry[]) => void, options?: ResizeObserverOptions): UseResizeObserverReturn;
|
|
2941
3101
|
interface UseElementSizeReturn extends UseResizeObserverReturn {
|
|
2942
3102
|
/**
|
|
2943
3103
|
* The width of the element in pixels
|
|
@@ -2971,7 +3131,7 @@ interface UseElementSizeReturn extends UseResizeObserverReturn {
|
|
|
2971
3131
|
* })
|
|
2972
3132
|
* ```
|
|
2973
3133
|
*/
|
|
2974
|
-
declare function useElementSize(target:
|
|
3134
|
+
declare function useElementSize(target: MaybeRef$1<Element | null | undefined>): UseElementSizeReturn;
|
|
2975
3135
|
//#endregion
|
|
2976
3136
|
//#region src/composables/useStorage/adapters/adapter.d.ts
|
|
2977
3137
|
interface StorageAdapter$1 {
|
|
@@ -3902,4 +4062,4 @@ interface VirtualContext<T = unknown> {
|
|
|
3902
4062
|
*/
|
|
3903
4063
|
declare function useVirtual<T = unknown>(items: Ref<readonly T[]>, _options?: VirtualOptions): VirtualContext<T>;
|
|
3904
4064
|
//#endregion
|
|
3905
|
-
export { createQueue as $,
|
|
4065
|
+
export { createQueue as $, FilterFunction as $n, BreakpointsOptions as $r, createLoggerPlugin as $t, Vuetify0ThemeAdapter as A, HydrationOptions as An, useTokens as Ar, NestedContextOptions as At, StorageAdapter as B, useHotkey as Bn, createDate as Br, UseMutationObserverReturn as Bt, ThemePluginOptions as C, IntersectionObserverOptions as Cn, TokenContextOptions as Cr, useOverflow as Ct, createThemeContext as D, useIntersectionObserver as Dn, TokenValue as Dr, multipleOpenStrategy as Dt, createTheme as E, useElementIntersection as En, TokenTicket as Er, useNested as Et, StoragePluginOptions as F, createHydrationPlugin as Fn, useWindowEventListener as Fr, NestedTicket as Ft, UseElementSizeReturn as G, FormValidationResult as Gn, ClickOutsideIgnoreTarget as Gr, usePrefersDark as Gt, MemoryAdapter as H, FormContextOptions as Hn, createDatePlugin as Hr, MediaQueryContext as Ht, createStorage as I, useHydration as In, DateContext as Ir, OpenStrategy as It, useResizeObserver as J, createForm as Jn, UseClickOutsideReturn as Jr, LoggerContextOptions as Jt, UseResizeObserverReturn as K, FormValidationRule as Kn, ClickOutsideTarget as Kr, usePrefersReducedMotion as Kt, createStorageContext as L, PlatformContext as Ln, DateContextOptions as Lr, OpenStrategyContext as Lt, StorageContext as M, createFallbackHydration as Mn, EventHandler as Mr, NestedOptions as Mt, StorageContextOptions as N, createHydration as Nn, useDocumentEventListener as Nr, NestedRegistration as Nt, createThemePlugin as O, HydrationContext as On, createTokens as Or, singleOpenStrategy as Ot, StorageOptions as P, createHydrationContext as Pn, useEventListener as Pr, NestedSelectionMode as Pt, QueueTicket as Q, FilterContextOptions as Qn, BreakpointsContextOptions as Qr, createLoggerContext as Qt, createStoragePlugin as R, UseHotkeyOptions as Rn, DateOptions as Rr, MutationObserverRecord as Rt, ThemeOptions as S, IntersectionObserverEntry as Sn, TokenContext as Sr, createOverflowContext as St, ThemeTicket as T, UseIntersectionObserverReturn as Tn, TokenPrimitive as Tr, createNestedContext as Tt, ResizeObserverEntry as U, FormOptions as Un, useDate as Ur, useMediaQuery as Ut, StorageType as V, FormContext as Vn, createDateContext as Vr, useMutationObserver as Vt, ResizeObserverOptions as W, FormTicket as Wn, ClickOutsideElement as Wr, usePrefersContrast as Wt, QueueContextOptions as X, useForm as Xn, BreakpointName as Xr, LoggerPluginOptions as Xt, QueueContext as Y, createFormContext as Yn, useClickOutside as Yr, LoggerOptions as Yt, QueueOptions as Z, FilterContext as Zn, BreakpointsContext as Zr, createLogger as Zt, useTimeline as _, Vuetify0LocaleAdapter as _n, createFeaturesPlugin as _r, PermissionAdapterInterface as _t, VirtualItem as a, toReactive as ai, LoggerAdapter as an, Primitive as ar, ProxyModelOptions as at, ThemeContext as b, LazyOptions as bn, TokenAlias as br, OverflowOptions as bt, useVirtual as c, PluginOptions as ci, LocaleOptions as cn, useFilter as cr, PermissionContextOptions as ct, TimelineContext as d, CreateContextOptions as di, LocaleTicket as dn, FeatureContextOptions as dr, PermissionTicket as dt, BreakpointsPluginOptions as ei, useLogger as en, FilterItem as er, createQueueContext as et, TimelineContextOptions as f, createContext as fi, createLocale as fn, FeatureOptions as fr, createPermissions as ft, createTimelineContext as g, useLocale as gn, createFeaturesContext as gr, PermissionAdapter as gt, createTimeline as h, createLocalePlugin as hn, createFeatures as hr, usePermissions as ht, VirtualDirection as i, useBreakpoints as ii, ConsolaLoggerAdapter as in, FilterResult as ir, useProxyRegistry as it, ThemeAdapter as j, HydrationPluginOptions as jn, CleanupFunction as jr, NestedOpenMode as jt, useTheme as k, HydrationContextOptions as kn, createTokensContext as kr, NestedContext as kt, ToggleScopeControls as l, createPlugin as li, LocalePluginOptions as ln, useFilterContext as lr, PermissionOptions as lt, TimelineTicket as m, useContext as mi, createLocaleFallback as mn, FeatureTicket as mr, createPermissionsPlugin as mt, VirtualAnchor as n, createBreakpointsContext as ni, Vuetify0LoggerAdapter as nn, FilterOptions as nr, ProxyRegistryContext as nt, VirtualOptions as o, toArray as oi, LocaleContext as on, createFilter as or, useProxyModel as ot, TimelineOptions as p, provideContext as pi, createLocaleContext as pn, FeaturePluginOptions as pr, createPermissionsContext as pt, useElementSize as q, FormValue as qn, UseClickOutsideOptions as qr, LoggerContext as qt, VirtualContext as r, createBreakpointsPlugin as ri, PinoLoggerAdapter as rn, FilterQuery as rr, ProxyRegistryOptions as rt, VirtualState as s, Plugin as si, LocaleContextOptions as sn, createFilterContext as sr, PermissionContext as st, ScrollToOptions as t, createBreakpoints as ti, LogLevel as tn, FilterMode as tr, useQueue as tt, useToggleScope as u, ContextKey as ui, LocaleRecord as un, FeatureContext as ur, PermissionPluginOptions as ut, Colors as v, LocaleAdapter as vn, useFeatures as vr, OverflowContext as vt, ThemeRecord as w, UseElementIntersectionReturn as wn, TokenOptions as wr, createNested as wt, ThemeContextOptions as x, useLazy as xn, TokenCollection as xr, createOverflow as xt, ThemeColors as y, LazyContext as yn, FlatTokenCollection as yr, OverflowContextOptions as yt, useStorage as z, UseHotkeyReturn as zn, DatePluginOptions as zr, UseMutationObserverOptions as zt };
|