@vuetify/v0 0.0.14 → 0.0.15

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,10 +1,10 @@
1
1
  import { r as isSelfClosingTag } from "./htmlElements-BYo-fMlZ.mjs";
2
- import { a as isNull, u as isString } from "./utilities-C26nB74O.mjs";
3
- import { At as createContext, Mt as useContext, R as createSingleContext, T as useProxyModel, _ as createStepContext, at as useSelection, it as createSelectionContext, nt as useGroup, tt as createGroupContext, v as useStep, z as useSingle } from "./composables-CGvbvF3U.mjs";
4
- import { computed, createBlock, createCommentVNode, createPropsRestProxy, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, normalizeStyle, onMounted, onUnmounted, openBlock, renderSlot, resolveDynamicComponent, toRef, toValue, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
2
+ import { c as isNull, l as isNullOrUndefined, p as isString, r as genId } from "./utilities-C6o-keMm.mjs";
3
+ import { A as usePagination, Bt as useContext, G as useSingle, Rt as createContext, S as useProxyModel, V as useLocale, W as createSingleContext, _ as createStepContext, ct as useGroup, dt as createSelectionContext, ft as useSelection, j as createOverflow, k as createPaginationContext, pt as createRegistryContext, st as createGroupContext, v as useStep } from "./composables-CrW3IMUM.mjs";
4
+ import { computed, createBlock, createCommentVNode, createPropsRestProxy, createTextVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
5
5
 
6
6
  //#region src/components/Atom/Atom.vue
7
- const _sfc_main$18 = /* @__PURE__ */ defineComponent({
7
+ const _sfc_main$25 = /* @__PURE__ */ defineComponent({
8
8
  name: "Atom",
9
9
  __name: "Atom",
10
10
  props: {
@@ -35,11 +35,11 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
35
35
  };
36
36
  }
37
37
  });
38
- var Atom_default = _sfc_main$18;
38
+ var Atom_default = _sfc_main$25;
39
39
 
40
40
  //#endregion
41
41
  //#region src/components/Avatar/AvatarFallback.vue
42
- const _sfc_main$17 = /* @__PURE__ */ defineComponent({
42
+ const _sfc_main$24 = /* @__PURE__ */ defineComponent({
43
43
  name: "AvatarFallback",
44
44
  __name: "AvatarFallback",
45
45
  props: {
@@ -65,11 +65,11 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
65
65
  };
66
66
  }
67
67
  });
68
- var AvatarFallback_default = _sfc_main$17;
68
+ var AvatarFallback_default = _sfc_main$24;
69
69
 
70
70
  //#endregion
71
71
  //#region src/components/Avatar/AvatarImage.vue
72
- const _sfc_main$16 = /* @__PURE__ */ defineComponent({
72
+ const _sfc_main$23 = /* @__PURE__ */ defineComponent({
73
73
  name: "AvatarImage",
74
74
  inheritAttrs: false,
75
75
  __name: "AvatarImage",
@@ -126,11 +126,11 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
126
126
  };
127
127
  }
128
128
  });
129
- var AvatarImage_default = _sfc_main$16;
129
+ var AvatarImage_default = _sfc_main$23;
130
130
 
131
131
  //#endregion
132
132
  //#region src/components/Avatar/AvatarRoot.vue
133
- const _sfc_main$15 = /* @__PURE__ */ defineComponent({
133
+ const _sfc_main$22 = /* @__PURE__ */ defineComponent({
134
134
  name: "AvatarRoot",
135
135
  __name: "AvatarRoot",
136
136
  props: {
@@ -156,7 +156,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
156
156
  };
157
157
  }
158
158
  });
159
- var AvatarRoot_default = _sfc_main$15;
159
+ var AvatarRoot_default = _sfc_main$22;
160
160
 
161
161
  //#endregion
162
162
  //#region src/components/Avatar/index.ts
@@ -168,7 +168,7 @@ const Avatar = {
168
168
 
169
169
  //#endregion
170
170
  //#region src/components/ExpansionPanel/ExpansionPanelActivator.vue
171
- const _sfc_main$14 = /* @__PURE__ */ defineComponent({
171
+ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
172
172
  name: "ExpansionPanelActivator",
173
173
  __name: "ExpansionPanelActivator",
174
174
  props: {
@@ -184,7 +184,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
184
184
  context.ticket.toggle();
185
185
  }
186
186
  }
187
- const bindableProps = computed(() => ({
187
+ const slotProps = toRef(() => ({
188
188
  "id": context.headerId.value,
189
189
  "role": "button",
190
190
  "tabindex": context.isDisabled.value ? -1 : 0,
@@ -196,20 +196,24 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
196
196
  "onClick": context.ticket.toggle,
197
197
  onKeydown
198
198
  }));
199
+ const isExpanded = toRef(() => context.ticket.isSelected.value);
200
+ const isDisabled = toRef(() => context.isDisabled.value);
199
201
  return (_ctx, _cache) => {
200
202
  return openBlock(), createBlock(unref(Atom_default), {
201
- id: bindableProps.value.id,
202
- "aria-controls": bindableProps.value["aria-controls"],
203
- "aria-disabled": bindableProps.value["aria-disabled"],
204
- "aria-expanded": bindableProps.value["aria-expanded"],
203
+ id: slotProps.value.id,
204
+ "aria-controls": slotProps.value["aria-controls"],
205
+ "aria-disabled": slotProps.value["aria-disabled"],
206
+ "aria-expanded": slotProps.value["aria-expanded"],
205
207
  as: __props.as,
208
+ "data-disabled": isDisabled.value ? "" : void 0,
209
+ "data-expanded": isExpanded.value ? "" : void 0,
206
210
  renderless: __props.renderless,
207
- role: bindableProps.value.role,
208
- tabindex: bindableProps.value.tabindex,
211
+ role: slotProps.value.role,
212
+ tabindex: slotProps.value.tabindex,
209
213
  onClick: unref(context).ticket.toggle,
210
214
  onKeydown
211
215
  }, {
212
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(bindableProps.value)))]),
216
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
213
217
  _: 3
214
218
  }, 8, [
215
219
  "id",
@@ -217,6 +221,8 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
217
221
  "aria-disabled",
218
222
  "aria-expanded",
219
223
  "as",
224
+ "data-disabled",
225
+ "data-expanded",
220
226
  "renderless",
221
227
  "role",
222
228
  "tabindex",
@@ -225,51 +231,54 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
225
231
  };
226
232
  }
227
233
  });
228
- var ExpansionPanelActivator_default = _sfc_main$14;
234
+ var ExpansionPanelActivator_default = _sfc_main$21;
229
235
 
230
236
  //#endregion
231
237
  //#region src/components/ExpansionPanel/ExpansionPanelContent.vue
232
- const _sfc_main$13 = /* @__PURE__ */ defineComponent({
238
+ const _sfc_main$20 = /* @__PURE__ */ defineComponent({
233
239
  name: "ExpansionPanelContent",
234
240
  __name: "ExpansionPanelContent",
235
241
  props: {
236
242
  itemNamespace: { default: "v0:expansion-panel-item" },
237
- as: {},
243
+ as: { default: "div" },
238
244
  renderless: { type: Boolean }
239
245
  },
240
246
  setup(__props) {
241
247
  const context = useContext(__props.itemNamespace);
242
- const bindableProps = computed(() => ({
248
+ const slotProps = toRef(() => ({
243
249
  "id": context.contentId.value,
244
250
  "role": "region",
245
251
  "aria-labelledby": context.headerId.value,
246
252
  "isSelected": context.ticket.isSelected.value
247
253
  }));
254
+ const isExpanded = toRef(() => context.ticket.isSelected.value);
248
255
  return (_ctx, _cache) => {
249
256
  return openBlock(), createBlock(unref(Atom_default), {
250
- id: bindableProps.value.id,
251
- "aria-labelledby": bindableProps.value["aria-labelledby"],
257
+ id: slotProps.value.id,
258
+ "aria-labelledby": slotProps.value["aria-labelledby"],
252
259
  as: __props.as,
260
+ "data-expanded": isExpanded.value ? "" : void 0,
253
261
  renderless: __props.renderless,
254
- role: bindableProps.value.role
262
+ role: slotProps.value.role
255
263
  }, {
256
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(bindableProps.value)))]),
264
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
257
265
  _: 3
258
266
  }, 8, [
259
267
  "id",
260
268
  "aria-labelledby",
261
269
  "as",
270
+ "data-expanded",
262
271
  "renderless",
263
272
  "role"
264
273
  ]);
265
274
  };
266
275
  }
267
276
  });
268
- var ExpansionPanelContent_default = _sfc_main$13;
277
+ var ExpansionPanelContent_default = _sfc_main$20;
269
278
 
270
279
  //#endregion
271
280
  //#region src/components/ExpansionPanel/ExpansionPanelItem.vue
272
- const _sfc_main$12 = /* @__PURE__ */ defineComponent({
281
+ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
273
282
  name: "ExpansionPanelItem",
274
283
  __name: "ExpansionPanelItem",
275
284
  props: {
@@ -312,11 +321,11 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
312
321
  };
313
322
  }
314
323
  });
315
- var ExpansionPanelItem_default = _sfc_main$12;
324
+ var ExpansionPanelItem_default = _sfc_main$19;
316
325
 
317
326
  //#endregion
318
327
  //#region src/components/ExpansionPanel/ExpansionPanelRoot.vue
319
- const _sfc_main$11 = /* @__PURE__ */ defineComponent({
328
+ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
320
329
  name: "ExpansionPanelRoot",
321
330
  __name: "ExpansionPanelRoot",
322
331
  props: /* @__PURE__ */ mergeModels({
@@ -390,7 +399,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
390
399
  };
391
400
  }
392
401
  });
393
- var ExpansionPanelRoot_default = _sfc_main$11;
402
+ var ExpansionPanelRoot_default = _sfc_main$18;
394
403
 
395
404
  //#endregion
396
405
  //#region src/components/ExpansionPanel/index.ts
@@ -403,13 +412,14 @@ const ExpansionPanel = {
403
412
 
404
413
  //#endregion
405
414
  //#region src/components/Group/GroupItem.vue
406
- const _sfc_main$10 = /* @__PURE__ */ defineComponent({
415
+ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
407
416
  name: "GroupItem",
408
417
  __name: "GroupItem",
409
418
  props: {
410
419
  label: {},
411
420
  id: {},
412
421
  disabled: {},
422
+ indeterminate: { default: false },
413
423
  value: {},
414
424
  namespace: { default: "v0:group" }
415
425
  },
@@ -418,9 +428,10 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
418
428
  const ticket = group.register({
419
429
  id: __props.id,
420
430
  value: __props.value,
421
- disabled: __props.disabled
431
+ disabled: __props.disabled,
432
+ indeterminate: __props.indeterminate
422
433
  });
423
- const isDisabled = toRef(() => ticket.disabled || group.disabled);
434
+ const isDisabled = toRef(() => toValue(ticket.disabled) || toValue(group.disabled));
424
435
  onUnmounted(() => {
425
436
  group.unregister(ticket.id);
426
437
  });
@@ -430,21 +441,24 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
430
441
  ariaDisabled: toValue(isDisabled.value),
431
442
  ariaSelected: toValue(unref(ticket).isSelected),
432
443
  disabled: toValue(isDisabled.value),
444
+ isMixed: toValue(unref(ticket).isMixed),
433
445
  isSelected: toValue(unref(ticket).isSelected),
434
446
  label: __props.label,
447
+ mix: unref(ticket).mix,
435
448
  select: unref(ticket).select,
436
449
  toggle: unref(ticket).toggle,
450
+ unmix: unref(ticket).unmix,
437
451
  unselect: unref(ticket).unselect,
438
452
  value: __props.value
439
453
  });
440
454
  };
441
455
  }
442
456
  });
443
- var GroupItem_default = _sfc_main$10;
457
+ var GroupItem_default = _sfc_main$17;
444
458
 
445
459
  //#endregion
446
460
  //#region src/components/Group/GroupRoot.vue
447
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
461
+ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
448
462
  name: "GroupRoot",
449
463
  __name: "GroupRoot",
450
464
  props: /* @__PURE__ */ mergeModels({
@@ -481,14 +495,20 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
481
495
  return renderSlot(_ctx.$slots, "default", {
482
496
  ariaMultiselectable: true,
483
497
  disabled: toValue(unref(context).disabled),
498
+ isAllSelected: unref(context).isAllSelected.value,
499
+ isMixed: unref(context).isMixed.value,
500
+ isNoneSelected: unref(context).isNoneSelected.value,
484
501
  select: unref(context).select,
502
+ selectAll: unref(context).selectAll,
485
503
  toggle: unref(context).toggle,
486
- unselect: unref(context).unselect
504
+ toggleAll: unref(context).toggleAll,
505
+ unselect: unref(context).unselect,
506
+ unselectAll: unref(context).unselectAll
487
507
  });
488
508
  };
489
509
  }
490
510
  });
491
- var GroupRoot_default = _sfc_main$9;
511
+ var GroupRoot_default = _sfc_main$16;
492
512
 
493
513
  //#endregion
494
514
  //#region src/components/Group/index.ts
@@ -497,6 +517,512 @@ const Group = {
497
517
  Item: GroupItem_default
498
518
  };
499
519
 
520
+ //#endregion
521
+ //#region src/components/Pagination/PaginationRoot.vue
522
+ function usePaginationControls(namespace) {
523
+ return useContext(`${namespace}:controls`);
524
+ }
525
+ function usePaginationItems(namespace) {
526
+ return useContext(`${namespace}:items`);
527
+ }
528
+ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
529
+ name: "PaginationRoot",
530
+ __name: "PaginationRoot",
531
+ props: /* @__PURE__ */ mergeModels({
532
+ namespace: { default: "v0:pagination" },
533
+ size: { default: 1 },
534
+ totalVisible: {},
535
+ itemsPerPage: { default: 10 },
536
+ ellipsis: {
537
+ type: [String, Boolean],
538
+ default: "..."
539
+ },
540
+ as: { default: "nav" },
541
+ renderless: { type: Boolean }
542
+ }, {
543
+ "modelValue": { default: 1 },
544
+ "modelModifiers": {}
545
+ }),
546
+ emits: /* @__PURE__ */ mergeModels(["update:model-value"], ["update:modelValue"]),
547
+ setup(__props) {
548
+ const page = useModel(__props, "modelValue");
549
+ const itemWidth = shallowRef(0);
550
+ const itemGap = shallowRef(0);
551
+ const atom = useTemplateRef("atom");
552
+ const locale = useLocale();
553
+ const [, provideControlContext, controls] = createRegistryContext({ namespace: `${__props.namespace}:controls` });
554
+ const [, provideItemContext, items] = createRegistryContext({ namespace: `${__props.namespace}:items` });
555
+ const overflow = createOverflow({
556
+ container: () => atom.value?.element,
557
+ itemWidth,
558
+ gap: itemGap
559
+ });
560
+ watch([() => items.size, () => overflow.width.value], () => {
561
+ const el = items.seek("first")?.value;
562
+ const root = overflow.container.value;
563
+ if (!el || !root) return;
564
+ const rootStyle = getComputedStyle(root);
565
+ const style = getComputedStyle(el);
566
+ const marginX = Number.parseFloat(style.marginLeft) + Number.parseFloat(style.marginRight);
567
+ const gapX = Number.parseFloat(rootStyle.gap) || 0;
568
+ itemWidth.value = el.offsetWidth + marginX;
569
+ itemGap.value = gapX;
570
+ }, { flush: "post" });
571
+ const visible = computed(() => {
572
+ const totalCap = overflow.capacity.value;
573
+ if (totalCap === Infinity) return __props.totalVisible ?? Infinity;
574
+ const pageCap = Math.max(0, totalCap - controls.size);
575
+ const noVisible = /* @__PURE__ */ isNullOrUndefined(__props.totalVisible);
576
+ if (pageCap > 0) return noVisible ? pageCap : Math.min(__props.totalVisible, pageCap);
577
+ return noVisible ? 1 : __props.totalVisible;
578
+ });
579
+ const [, providePaginationContext, pagination] = createPaginationContext({
580
+ namespace: __props.namespace,
581
+ page,
582
+ visible,
583
+ ellipsis: __props.ellipsis,
584
+ size: () => __props.size,
585
+ itemsPerPage: () => __props.itemsPerPage
586
+ });
587
+ const slotProps = toRef(() => ({
588
+ ariaLabel: locale.t("Pagination.label", void 0, "Pagination"),
589
+ page: pagination.page.value,
590
+ size: pagination.size,
591
+ pages: pagination.pages,
592
+ itemsPerPage: pagination.itemsPerPage,
593
+ items: pagination.items.value,
594
+ pageStart: pagination.pageStart.value,
595
+ pageStop: pagination.pageStop.value,
596
+ isFirst: pagination.isFirst.value,
597
+ isLast: pagination.isLast.value,
598
+ first: pagination.first,
599
+ last: pagination.last,
600
+ next: pagination.next,
601
+ prev: pagination.prev,
602
+ select: pagination.select
603
+ }));
604
+ providePaginationContext();
605
+ provideControlContext();
606
+ provideItemContext();
607
+ return (_ctx, _cache) => {
608
+ return openBlock(), createBlock(unref(Atom_default), {
609
+ ref_key: "atom",
610
+ ref: atom,
611
+ "aria-label": slotProps.value.ariaLabel,
612
+ as: __props.as,
613
+ renderless: __props.renderless
614
+ }, {
615
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
616
+ _: 3
617
+ }, 8, [
618
+ "aria-label",
619
+ "as",
620
+ "renderless"
621
+ ]);
622
+ };
623
+ }
624
+ });
625
+ var PaginationRoot_default = _sfc_main$15;
626
+
627
+ //#endregion
628
+ //#region src/components/Pagination/PaginationEllipsis.vue
629
+ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
630
+ name: "PaginationEllipsis",
631
+ __name: "PaginationEllipsis",
632
+ props: {
633
+ namespace: { default: "v0:pagination" },
634
+ ellipsis: {},
635
+ id: { default: () => /* @__PURE__ */ genId() },
636
+ as: { default: "span" },
637
+ renderless: { type: Boolean }
638
+ },
639
+ setup(__props) {
640
+ const pagination = usePagination(__props.namespace);
641
+ const items = usePaginationItems(__props.namespace);
642
+ const atom = useTemplateRef("atom");
643
+ watch(() => atom.value?.element, (el) => {
644
+ if (!el) return;
645
+ items.register({
646
+ id: __props.id,
647
+ value: el
648
+ });
649
+ }, { immediate: true });
650
+ onBeforeUnmount(() => items.unregister(__props.id));
651
+ const resolvedEllipsis = toRef(() => __props.ellipsis ?? pagination.ellipsis);
652
+ const slotProps = toRef(() => ({
653
+ ariaHidden: "true",
654
+ ellipsis: resolvedEllipsis.value
655
+ }));
656
+ return (_ctx, _cache) => {
657
+ return openBlock(), createBlock(unref(Atom_default), {
658
+ ref_key: "atom",
659
+ ref: atom,
660
+ "aria-hidden": slotProps.value.ariaHidden,
661
+ as: __props.as,
662
+ renderless: __props.renderless
663
+ }, {
664
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)), () => [createTextVNode(toDisplayString(resolvedEllipsis.value), 1)])]),
665
+ _: 3
666
+ }, 8, [
667
+ "aria-hidden",
668
+ "as",
669
+ "renderless"
670
+ ]);
671
+ };
672
+ }
673
+ });
674
+ var PaginationEllipsis_default = _sfc_main$14;
675
+
676
+ //#endregion
677
+ //#region src/components/Pagination/PaginationFirst.vue
678
+ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
679
+ name: "PaginationFirst",
680
+ __name: "PaginationFirst",
681
+ props: {
682
+ namespace: { default: "v0:pagination" },
683
+ disabled: { type: Boolean },
684
+ id: { default: () => /* @__PURE__ */ genId() },
685
+ as: { default: "button" },
686
+ renderless: { type: Boolean }
687
+ },
688
+ setup(__props) {
689
+ const locale = useLocale();
690
+ const pagination = usePagination(__props.namespace);
691
+ const controls = usePaginationControls(__props.namespace);
692
+ const atom = useTemplateRef("atom");
693
+ watch(() => atom.value?.element, (el) => {
694
+ if (!el) return;
695
+ controls.register({
696
+ id: __props.id,
697
+ value: el
698
+ });
699
+ }, { immediate: true });
700
+ onBeforeUnmount(() => controls.unregister(__props.id));
701
+ const isDisabled = toRef(() => __props.disabled || pagination.isFirst.value);
702
+ function onClick() {
703
+ if (isDisabled.value) return;
704
+ pagination.first();
705
+ }
706
+ const slotProps = toRef(() => ({
707
+ ariaLabel: locale.t("Pagination.first", void 0, "Go to first page"),
708
+ disabled: isDisabled.value,
709
+ onClick
710
+ }));
711
+ return (_ctx, _cache) => {
712
+ return openBlock(), createBlock(unref(Atom_default), {
713
+ ref_key: "atom",
714
+ ref: atom,
715
+ "aria-disabled": slotProps.value.disabled,
716
+ "aria-label": slotProps.value.ariaLabel,
717
+ as: __props.as,
718
+ "data-disabled": slotProps.value.disabled || void 0,
719
+ disabled: __props.as === "button" ? slotProps.value.disabled : void 0,
720
+ renderless: __props.renderless,
721
+ type: __props.as === "button" ? "button" : void 0,
722
+ onClick: slotProps.value.onClick
723
+ }, {
724
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
725
+ _: 3
726
+ }, 8, [
727
+ "aria-disabled",
728
+ "aria-label",
729
+ "as",
730
+ "data-disabled",
731
+ "disabled",
732
+ "renderless",
733
+ "type",
734
+ "onClick"
735
+ ]);
736
+ };
737
+ }
738
+ });
739
+ var PaginationFirst_default = _sfc_main$13;
740
+
741
+ //#endregion
742
+ //#region src/components/Pagination/PaginationItem.vue
743
+ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
744
+ name: "PaginationItem",
745
+ __name: "PaginationItem",
746
+ props: {
747
+ namespace: { default: "v0:pagination" },
748
+ value: {},
749
+ disabled: {
750
+ type: Boolean,
751
+ default: false
752
+ },
753
+ id: { default: () => /* @__PURE__ */ genId() },
754
+ as: { default: "button" },
755
+ renderless: { type: Boolean }
756
+ },
757
+ setup(__props) {
758
+ const locale = useLocale();
759
+ const pagination = usePagination(__props.namespace);
760
+ const items = usePaginationItems(__props.namespace);
761
+ const atom = useTemplateRef("atom");
762
+ watch(() => atom.value?.element, (el) => {
763
+ if (!el) return;
764
+ items.register({
765
+ id: __props.id,
766
+ value: el
767
+ });
768
+ }, { immediate: true });
769
+ onBeforeUnmount(() => items.unregister(__props.id));
770
+ const isSelected = toRef(() => pagination.page.value === __props.value);
771
+ const ariaLabel = toRef(() => {
772
+ return isSelected.value ? locale.t("Pagination.currentPage", { page: __props.value }, `Page ${__props.value}, current page`) : locale.t("Pagination.goToPage", { page: __props.value }, `Go to page ${__props.value}`);
773
+ });
774
+ const slotProps = toRef(() => ({
775
+ ariaLabel: ariaLabel.value,
776
+ ariaCurrent: isSelected.value ? "page" : void 0,
777
+ page: __props.value,
778
+ isSelected: isSelected.value,
779
+ dataSelected: isSelected.value,
780
+ disabled: __props.disabled,
781
+ select
782
+ }));
783
+ function select() {
784
+ if (__props.disabled) return;
785
+ pagination.select(__props.value);
786
+ }
787
+ return (_ctx, _cache) => {
788
+ return openBlock(), createBlock(unref(Atom_default), {
789
+ ref_key: "atom",
790
+ ref: atom,
791
+ "aria-current": slotProps.value.ariaCurrent,
792
+ "aria-label": slotProps.value.ariaLabel,
793
+ as: __props.as,
794
+ "data-disabled": slotProps.value.disabled || void 0,
795
+ "data-selected": slotProps.value.dataSelected || void 0,
796
+ disabled: __props.as === "button" ? slotProps.value.disabled : void 0,
797
+ renderless: __props.renderless,
798
+ type: __props.as === "button" ? "button" : void 0,
799
+ onClick: slotProps.value.select
800
+ }, {
801
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
802
+ _: 3
803
+ }, 8, [
804
+ "aria-current",
805
+ "aria-label",
806
+ "as",
807
+ "data-disabled",
808
+ "data-selected",
809
+ "disabled",
810
+ "renderless",
811
+ "type",
812
+ "onClick"
813
+ ]);
814
+ };
815
+ }
816
+ });
817
+ var PaginationItem_default = _sfc_main$12;
818
+
819
+ //#endregion
820
+ //#region src/components/Pagination/PaginationLast.vue
821
+ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
822
+ name: "PaginationLast",
823
+ __name: "PaginationLast",
824
+ props: {
825
+ namespace: { default: "v0:pagination" },
826
+ disabled: { type: Boolean },
827
+ id: { default: () => /* @__PURE__ */ genId() },
828
+ as: { default: "button" },
829
+ renderless: { type: Boolean }
830
+ },
831
+ setup(__props) {
832
+ const locale = useLocale();
833
+ const pagination = usePagination(__props.namespace);
834
+ const controls = usePaginationControls(__props.namespace);
835
+ const atom = useTemplateRef("atom");
836
+ watch(() => atom.value?.element, (el) => {
837
+ if (!el) return;
838
+ controls.register({
839
+ id: __props.id,
840
+ value: el
841
+ });
842
+ }, { immediate: true });
843
+ onBeforeUnmount(() => controls.unregister(__props.id));
844
+ const isDisabled = toRef(() => __props.disabled || pagination.isLast.value);
845
+ function onClick() {
846
+ if (isDisabled.value) return;
847
+ pagination.last();
848
+ }
849
+ const slotProps = toRef(() => ({
850
+ ariaLabel: locale.t("Pagination.last", void 0, "Go to last page"),
851
+ disabled: isDisabled.value,
852
+ onClick
853
+ }));
854
+ return (_ctx, _cache) => {
855
+ return openBlock(), createBlock(unref(Atom_default), {
856
+ ref_key: "atom",
857
+ ref: atom,
858
+ "aria-disabled": slotProps.value.disabled,
859
+ "aria-label": slotProps.value.ariaLabel,
860
+ as: __props.as,
861
+ "data-disabled": slotProps.value.disabled || void 0,
862
+ disabled: __props.as === "button" ? slotProps.value.disabled : void 0,
863
+ renderless: __props.renderless,
864
+ type: __props.as === "button" ? "button" : void 0,
865
+ onClick: slotProps.value.onClick
866
+ }, {
867
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
868
+ _: 3
869
+ }, 8, [
870
+ "aria-disabled",
871
+ "aria-label",
872
+ "as",
873
+ "data-disabled",
874
+ "disabled",
875
+ "renderless",
876
+ "type",
877
+ "onClick"
878
+ ]);
879
+ };
880
+ }
881
+ });
882
+ var PaginationLast_default = _sfc_main$11;
883
+
884
+ //#endregion
885
+ //#region src/components/Pagination/PaginationNext.vue
886
+ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
887
+ name: "PaginationNext",
888
+ __name: "PaginationNext",
889
+ props: {
890
+ namespace: { default: "v0:pagination" },
891
+ disabled: { type: Boolean },
892
+ id: { default: () => /* @__PURE__ */ genId() },
893
+ as: { default: "button" },
894
+ renderless: { type: Boolean }
895
+ },
896
+ setup(__props) {
897
+ const locale = useLocale();
898
+ const pagination = usePagination(__props.namespace);
899
+ const controls = usePaginationControls(__props.namespace);
900
+ const atom = useTemplateRef("atom");
901
+ watch(() => atom.value?.element, (el) => {
902
+ if (!el) return;
903
+ controls.register({
904
+ id: __props.id,
905
+ value: el
906
+ });
907
+ }, { immediate: true });
908
+ onBeforeUnmount(() => controls.unregister(__props.id));
909
+ const isDisabled = toRef(() => __props.disabled || pagination.isLast.value);
910
+ function onClick() {
911
+ if (isDisabled.value) return;
912
+ pagination.next();
913
+ }
914
+ const slotProps = toRef(() => ({
915
+ ariaLabel: locale.t("Pagination.next", void 0, "Go to next page"),
916
+ disabled: isDisabled.value,
917
+ onClick
918
+ }));
919
+ return (_ctx, _cache) => {
920
+ return openBlock(), createBlock(unref(Atom_default), {
921
+ ref_key: "atom",
922
+ ref: atom,
923
+ "aria-disabled": slotProps.value.disabled,
924
+ "aria-label": slotProps.value.ariaLabel,
925
+ as: __props.as,
926
+ "data-disabled": slotProps.value.disabled || void 0,
927
+ disabled: __props.as === "button" ? slotProps.value.disabled : void 0,
928
+ renderless: __props.renderless,
929
+ type: __props.as === "button" ? "button" : void 0,
930
+ onClick: slotProps.value.onClick
931
+ }, {
932
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
933
+ _: 3
934
+ }, 8, [
935
+ "aria-disabled",
936
+ "aria-label",
937
+ "as",
938
+ "data-disabled",
939
+ "disabled",
940
+ "renderless",
941
+ "type",
942
+ "onClick"
943
+ ]);
944
+ };
945
+ }
946
+ });
947
+ var PaginationNext_default = _sfc_main$10;
948
+
949
+ //#endregion
950
+ //#region src/components/Pagination/PaginationPrev.vue
951
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
952
+ name: "PaginationPrev",
953
+ __name: "PaginationPrev",
954
+ props: {
955
+ namespace: { default: "v0:pagination" },
956
+ disabled: { type: Boolean },
957
+ id: { default: () => /* @__PURE__ */ genId() },
958
+ as: { default: "button" },
959
+ renderless: { type: Boolean }
960
+ },
961
+ setup(__props) {
962
+ const locale = useLocale();
963
+ const pagination = usePagination(__props.namespace);
964
+ const controls = usePaginationControls(__props.namespace);
965
+ const atom = useTemplateRef("atom");
966
+ watch(() => atom.value?.element, (el) => {
967
+ if (!el) return;
968
+ controls.register({
969
+ id: __props.id,
970
+ value: el
971
+ });
972
+ }, { immediate: true });
973
+ onBeforeUnmount(() => controls.unregister(__props.id));
974
+ const isDisabled = toRef(() => __props.disabled || pagination.isFirst.value);
975
+ function onClick() {
976
+ if (isDisabled.value) return;
977
+ pagination.prev();
978
+ }
979
+ const slotProps = toRef(() => ({
980
+ ariaLabel: locale.t("Pagination.prev", void 0, "Go to previous page"),
981
+ disabled: isDisabled.value,
982
+ onClick
983
+ }));
984
+ return (_ctx, _cache) => {
985
+ return openBlock(), createBlock(unref(Atom_default), {
986
+ ref_key: "atom",
987
+ ref: atom,
988
+ "aria-disabled": slotProps.value.disabled,
989
+ "aria-label": slotProps.value.ariaLabel,
990
+ as: __props.as,
991
+ "data-disabled": slotProps.value.disabled || void 0,
992
+ disabled: __props.as === "button" ? slotProps.value.disabled : void 0,
993
+ renderless: __props.renderless,
994
+ type: __props.as === "button" ? "button" : void 0,
995
+ onClick: slotProps.value.onClick
996
+ }, {
997
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
998
+ _: 3
999
+ }, 8, [
1000
+ "aria-disabled",
1001
+ "aria-label",
1002
+ "as",
1003
+ "data-disabled",
1004
+ "disabled",
1005
+ "renderless",
1006
+ "type",
1007
+ "onClick"
1008
+ ]);
1009
+ };
1010
+ }
1011
+ });
1012
+ var PaginationPrev_default = _sfc_main$9;
1013
+
1014
+ //#endregion
1015
+ //#region src/components/Pagination/index.ts
1016
+ const Pagination = {
1017
+ Root: PaginationRoot_default,
1018
+ Item: PaginationItem_default,
1019
+ First: PaginationFirst_default,
1020
+ Prev: PaginationPrev_default,
1021
+ Ellipsis: PaginationEllipsis_default,
1022
+ Next: PaginationNext_default,
1023
+ Last: PaginationLast_default
1024
+ };
1025
+
500
1026
  //#endregion
501
1027
  //#region src/components/Popover/PopoverRoot.vue
502
1028
  const [usePopoverContext, providePopoverContext] = createContext("Popover");
@@ -663,7 +1189,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
663
1189
  value: __props.value,
664
1190
  disabled: __props.disabled
665
1191
  });
666
- const isDisabled = toRef(() => ticket.disabled || selection.disabled);
1192
+ const isDisabled = toRef(() => toValue(ticket.disabled) || toValue(selection.disabled));
667
1193
  onUnmounted(() => {
668
1194
  selection.unregister(ticket.id);
669
1195
  });
@@ -765,7 +1291,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
765
1291
  value: __props.value,
766
1292
  disabled: __props.disabled
767
1293
  });
768
- const isDisabled = toRef(() => ticket.disabled || single.disabled);
1294
+ const isDisabled = toRef(() => toValue(ticket.disabled) || toValue(single.disabled));
769
1295
  onUnmounted(() => {
770
1296
  single.unregister(ticket.id);
771
1297
  });
@@ -861,7 +1387,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
861
1387
  value: __props.value,
862
1388
  disabled: __props.disabled
863
1389
  });
864
- const isDisabled = toRef(() => ticket.disabled || step.disabled);
1390
+ const isDisabled = toRef(() => toValue(ticket.disabled) || toValue(step.disabled));
865
1391
  onUnmounted(() => {
866
1392
  step.unregister(ticket.id);
867
1393
  });
@@ -944,4 +1470,4 @@ const Step = {
944
1470
  };
945
1471
 
946
1472
  //#endregion
947
- export { providePopoverContext as a, ExpansionPanel as c, Popover as i, Avatar as l, Single as n, usePopoverContext as o, Selection as r, Group as s, Step as t, Atom_default as u };
1473
+ export { providePopoverContext as a, usePaginationControls as c, ExpansionPanel as d, Avatar as f, Popover as i, usePaginationItems as l, Single as n, usePopoverContext as o, Atom_default as p, Selection as r, Pagination as s, Step as t, Group as u };