@vuetify/v0 0.0.16 → 0.0.18

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.
@@ -1,4 +1,4 @@
1
- import { i as ID } from "./index-Bd3J4RNS.mjs";
1
+ import { i as ID } from "./index-C5LQZd3v.mjs";
2
2
  import { App, ComputedRef, MaybeRef, MaybeRefOrGetter, Reactive, Ref, ShallowRef } from "vue";
3
3
 
4
4
  //#region src/composables/createTrinity/index.d.ts
@@ -157,10 +157,10 @@ interface RegistryContext<Z extends RegistryTicket = RegistryTicket> {
157
157
  * registry.register({ id: 'ticket-3', value: 'unique-value' })
158
158
  *
159
159
  * const common = registry.browse('common-value') // ['ticket-1', 'ticket-2']
160
- * const unique = registry.browse('unique-value') // 'ticket-3'
160
+ * const unique = registry.browse('unique-value') // ['ticket-3']
161
161
  * ```
162
162
  */
163
- browse: (value: unknown) => ID | ID[] | undefined;
163
+ browse: (value: unknown) => ID[] | undefined;
164
164
  /**
165
165
  * lookup a ticket by index number
166
166
  *
@@ -370,6 +370,7 @@ interface RegistryContext<Z extends RegistryTicket = RegistryTicket> {
370
370
  * - `unregister:ticket` - Emitted when a ticket is unregistered, receives the ticket as argument
371
371
  * - `update:ticket` - Emitted when a ticket is updated, receives the updated ticket as argument
372
372
  * - `clear:registry` - Emitted when the registry is cleared
373
+ * - `reindex:registry` - Emitted when the registry is reindexed
373
374
  *
374
375
  * @see https://0.vuetifyjs.com/composables/registration/use-registry#on
375
376
  *
@@ -531,6 +532,33 @@ interface RegistryContext<Z extends RegistryTicket = RegistryTicket> {
531
532
  * ```
532
533
  */
533
534
  size: number;
535
+ /**
536
+ * Execute operations in a batch, deferring cache invalidation and event emission until complete
537
+ *
538
+ * @param fn The function containing batch operations.
539
+ * @returns The return value of the batch function.
540
+ * @remarks Useful for bulk operations like onboard(). Invalidation and events happen once at the end, not after each operation.
541
+ *
542
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#batch
543
+ *
544
+ * @example
545
+ * ```ts
546
+ * import { useRegistry } from '@vuetify/v0'
547
+ *
548
+ * const registry = useRegistry({ events: true })
549
+ *
550
+ * // Without batch: N invalidations + N events
551
+ * // With batch: 1 invalidation + N events (after all registrations)
552
+ * const tickets = registry.batch(() => {
553
+ * return [
554
+ * registry.register({ id: 'a' }),
555
+ * registry.register({ id: 'b' }),
556
+ * registry.register({ id: 'c' }),
557
+ * ]
558
+ * })
559
+ * ```
560
+ */
561
+ batch: <R>(fn: () => R) => R;
534
562
  }
535
563
  interface RegistryOptions {
536
564
  /**
@@ -584,8 +612,7 @@ declare function useRegistry<Z extends RegistryTicket = RegistryTicket, E extend
584
612
  /**
585
613
  * Creates a new registry context.
586
614
  *
587
- * @param namespace The namespace for the registry context.
588
- * @param options The options for the registry context.
615
+ * @param options The options for the registry context, including `namespace` (defaults to `'v0:registry'`) and `events`.
589
616
  * @template Z The type of registry ticket that extends RegistryTicket. Use this to add custom properties to tickets.
590
617
  * @template E The type of registry context that extends RegistryContext<Z>. Use this when extending the registry with additional methods.
591
618
  * @returns A new registry context.
@@ -941,11 +968,14 @@ declare function createGroupContext<Z extends GroupTicket = GroupTicket, E exten
941
968
  declare function useGroup<Z extends GroupTicket = GroupTicket, E extends GroupContext<Z> = GroupContext<Z>>(namespace?: string): E;
942
969
  //#endregion
943
970
  //#region src/composables/usePagination/index.d.ts
944
- interface PaginationItem {
945
- type: 'page' | 'ellipsis';
946
- value: number | string;
947
- }
948
- interface PaginationContext<Z extends PaginationItem = PaginationItem> {
971
+ type PaginationTicket = {
972
+ type: 'page';
973
+ value: number;
974
+ } | {
975
+ type: 'ellipsis';
976
+ value: string;
977
+ };
978
+ interface PaginationContext {
949
979
  /** Current page (1-indexed) */
950
980
  page: ShallowRef<number>;
951
981
  /** Items per page */
@@ -957,7 +987,7 @@ interface PaginationContext<Z extends PaginationItem = PaginationItem> {
957
987
  /** Ellipsis character, or false if disabled */
958
988
  ellipsis: string | false;
959
989
  /** Visible page numbers and ellipsis for rendering */
960
- items: ComputedRef<Z[]>;
990
+ items: ComputedRef<PaginationTicket[]>;
961
991
  /** Start index of items on current page (0-indexed) */
962
992
  pageStart: ComputedRef<number>;
963
993
  /** End index of items on current page (exclusive, 0-indexed) */
@@ -1014,7 +1044,7 @@ interface PaginationContextOptions extends PaginationOptions {
1014
1044
  * // Mutating pagination.page or the passed ref syncs both
1015
1045
  * ```
1016
1046
  */
1017
- declare function createPagination<Z extends PaginationItem = PaginationItem, E extends PaginationContext<Z> = PaginationContext<Z>>(_options?: PaginationOptions): E;
1047
+ declare function createPagination(_options?: PaginationOptions): PaginationContext;
1018
1048
  /**
1019
1049
  * Creates a pagination context for dependency injection.
1020
1050
  *
@@ -1040,7 +1070,7 @@ declare function createPagination<Z extends PaginationItem = PaginationItem, E e
1040
1070
  * pagination.next()
1041
1071
  * ```
1042
1072
  */
1043
- declare function createPaginationContext<Z extends PaginationItem = PaginationItem, E extends PaginationContext<Z> = PaginationContext<Z>>(_options?: PaginationContextOptions): ContextTrinity<E>;
1073
+ declare function createPaginationContext(_options?: PaginationContextOptions): ContextTrinity<PaginationContext>;
1044
1074
  /**
1045
1075
  * Returns the current pagination instance from context.
1046
1076
  *
@@ -1061,7 +1091,7 @@ declare function createPaginationContext<Z extends PaginationItem = PaginationIt
1061
1091
  * </template>
1062
1092
  * ```
1063
1093
  */
1064
- declare function usePagination<Z extends PaginationItem = PaginationItem, E extends PaginationContext<Z> = PaginationContext<Z>>(namespace?: string): E;
1094
+ declare function usePagination(namespace?: string): PaginationContext;
1065
1095
  //#endregion
1066
1096
  //#region src/composables/useSingle/index.d.ts
1067
1097
  interface SingleTicket<V = unknown> extends SelectionTicket<V> {}
@@ -1328,4 +1358,4 @@ declare function createStepContext<Z extends StepTicket = StepTicket, E extends
1328
1358
  */
1329
1359
  declare function useStep<Z extends StepTicket = StepTicket, E extends StepContext<Z> = StepContext<Z>>(namespace?: string): E;
1330
1360
  //#endregion
1331
- export { SelectionContextOptions as A, createRegistryContext as B, GroupContextOptions as C, createGroupContext as D, createGroup as E, useSelection as F, ContextTrinity as H, RegistryContext as I, RegistryContextOptions as L, SelectionTicket as M, createSelection as N, useGroup as O, createSelectionContext as P, RegistryOptions as R, GroupContext as S, GroupTicket as T, createTrinity as U, useRegistry as V, PaginationItem as _, createStep as a, createPaginationContext as b, SingleContext as c, SingleTicket as d, createSingle as f, PaginationContextOptions as g, PaginationContext as h, StepTicket as i, SelectionOptions as j, SelectionContext as k, SingleContextOptions as l, useSingle as m, StepContextOptions as n, createStepContext as o, createSingleContext as p, StepOptions as r, useStep as s, StepContext as t, SingleOptions as u, PaginationOptions as v, GroupOptions as w, usePagination as x, createPagination as y, RegistryTicket as z };
1361
+ export { SelectionContextOptions as A, createRegistryContext as B, GroupContextOptions as C, createGroupContext as D, createGroup as E, useSelection as F, ContextTrinity as H, RegistryContext as I, RegistryContextOptions as L, SelectionTicket as M, createSelection as N, useGroup as O, createSelectionContext as P, RegistryOptions as R, GroupContext as S, GroupTicket as T, createTrinity as U, useRegistry as V, PaginationOptions as _, createStep as a, createPaginationContext as b, SingleContext as c, SingleTicket as d, createSingle as f, PaginationContextOptions as g, PaginationContext as h, StepTicket as i, SelectionOptions as j, SelectionContext as k, SingleContextOptions as l, useSingle as m, StepContextOptions as n, createStepContext as o, createSingleContext as p, StepOptions as r, useStep as s, StepContext as t, SingleOptions as u, PaginationTicket as v, GroupOptions as w, usePagination as x, createPagination as y, RegistryTicket as z };