@expcat/tigercat-vue 2.0.0 → 2.0.19
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/{chunk-KE6RGD4Y.mjs → chunk-26OI3TEA.mjs} +25 -55
- package/dist/{chunk-A7QIMKWQ.mjs → chunk-2T2NEZRZ.mjs} +1 -1
- package/dist/chunk-4HUYX5WW.mjs +239 -0
- package/dist/{chunk-IDUEWMWN.mjs → chunk-7KCOF5US.mjs} +61 -62
- package/dist/{chunk-RHV6DWY6.mjs → chunk-7VHXZX7Y.mjs} +20 -28
- package/dist/{chunk-IZRQ7LB3.mjs → chunk-AU6IC6K7.mjs} +1 -1
- package/dist/{chunk-O6BN5R6J.mjs → chunk-AUMTHL6N.mjs} +1 -1
- package/dist/{chunk-MNSVJBNH.mjs → chunk-B4MDHE3L.mjs} +18 -4
- package/dist/{chunk-N7LWKAYS.mjs → chunk-BZ6MVFV7.mjs} +190 -174
- package/dist/{chunk-TK3QU367.mjs → chunk-DI6RRAGQ.mjs} +3 -3
- package/dist/{chunk-H6FZBFRT.mjs → chunk-EDBMWZKH.mjs} +2 -1
- package/dist/{chunk-4ZZYQITT.mjs → chunk-FWO7RNGI.mjs} +249 -220
- package/dist/{chunk-EZZD4OCV.mjs → chunk-GS4SV2HK.mjs} +1 -1
- package/dist/{chunk-EUSODI5E.mjs → chunk-HKYRRQS7.mjs} +11 -5
- package/dist/{chunk-D4APFWWS.mjs → chunk-IPGPLFUZ.mjs} +18 -4
- package/dist/{chunk-JKPXJ3VB.mjs → chunk-JALHMWKW.mjs} +14 -6
- package/dist/{chunk-OHPXOLNB.mjs → chunk-K3WTQBE4.mjs} +40 -15
- package/dist/{chunk-VMYV5EWI.mjs → chunk-KICZSLOX.mjs} +9 -8
- package/dist/{chunk-SK2QJ66E.mjs → chunk-KROVW4AW.mjs} +19 -59
- package/dist/{chunk-AQMPCLX7.mjs → chunk-NMAJD353.mjs} +248 -253
- package/dist/{chunk-4BO6JNA6.mjs → chunk-OAPIT53X.mjs} +4 -4
- package/dist/{chunk-SYRRMZT2.mjs → chunk-OQVGB7X6.mjs} +43 -29
- package/dist/{chunk-DWK5GUMB.mjs → chunk-OTGGPXDT.mjs} +26 -19
- package/dist/{chunk-DWPZRG7A.mjs → chunk-PGF7HLLR.mjs} +43 -39
- package/dist/chunk-Q7Y22OFX.mjs +330 -0
- package/dist/{chunk-NP6DZQ3O.mjs → chunk-RID7A5V7.mjs} +1 -1
- package/dist/{chunk-DKMKJZ7A.mjs → chunk-S5RTMAQN.mjs} +1 -1
- package/dist/{chunk-SJ7W5I5H.mjs → chunk-TCV6YPH5.mjs} +1 -1
- package/dist/{chunk-LFENEILY.mjs → chunk-WC5MKASU.mjs} +110 -99
- package/dist/components/ActivityFeed.d.mts +2 -2
- package/dist/components/ActivityFeed.mjs +3 -3
- package/dist/components/Affix.d.mts +4 -4
- package/dist/components/Alert.d.mts +2 -2
- package/dist/components/Anchor.d.mts +3 -3
- package/dist/components/AutoComplete.d.mts +2 -2
- package/dist/components/AutoComplete.mjs +2 -1
- package/dist/components/Avatar.d.mts +1 -1
- package/dist/components/AvatarGroup.d.mts +1 -1
- package/dist/components/BackTop.d.mts +3 -3
- package/dist/components/Badge.d.mts +2 -2
- package/dist/components/Breadcrumb.d.mts +2 -2
- package/dist/components/Button.d.mts +2 -2
- package/dist/components/ButtonGroup.d.mts +1 -1
- package/dist/components/Calendar.d.mts +1 -1
- package/dist/components/Card.d.mts +2 -2
- package/dist/components/Carousel.d.mts +2 -2
- package/dist/components/Cascader.mjs +2 -1
- package/dist/components/ChartTooltip.d.mts +1 -1
- package/dist/components/ChatWindow.d.mts +1 -1
- package/dist/components/CodeEditor.d.mts +3 -3
- package/dist/components/CodeEditor.mjs +1 -1
- package/dist/components/CollapsePanel.d.mts +1 -1
- package/dist/components/ColorPicker.mjs +2 -1
- package/dist/components/CommentThread.d.mts +1 -1
- package/dist/components/Countdown.d.mts +3 -3
- package/dist/components/CropUpload.d.mts +1 -1
- package/dist/components/CropUpload.mjs +3 -3
- package/dist/components/DataExport.d.mts +1 -1
- package/dist/components/DataExport.mjs +3 -3
- package/dist/components/DataTableWithToolbar.d.mts +3 -3
- package/dist/components/DataTableWithToolbar.mjs +6 -6
- package/dist/components/DatePicker.d.mts +3 -3
- package/dist/components/DatePicker.mjs +2 -1
- package/dist/components/Descriptions.d.mts +1 -1
- package/dist/components/DonutChart.d.mts +1 -1
- package/dist/components/Drawer.d.mts +6 -6
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.d.mts +2 -2
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/Empty.d.mts +1 -1
- package/dist/components/FileManager.d.mts +1 -1
- package/dist/components/FloatButton.d.mts +3 -3
- package/dist/components/FormItem.mjs +2 -1
- package/dist/components/FormWizard.d.mts +2 -2
- package/dist/components/FunnelChart.d.mts +1 -1
- package/dist/components/Gantt.d.mts +1 -1
- package/dist/components/GaugeChart.d.mts +2 -2
- package/dist/components/Header.d.mts +1 -1
- package/dist/components/HeatmapChart.d.mts +1 -1
- package/dist/components/Icon.d.mts +1 -1
- package/dist/components/Image.mjs +3 -3
- package/dist/components/ImageAnnotation.d.mts +3 -3
- package/dist/components/ImageCropper.d.mts +1 -1
- package/dist/components/ImagePreview.d.mts +1 -1
- package/dist/components/ImageViewer.d.mts +1 -1
- package/dist/components/InfiniteScroll.d.mts +1 -1
- package/dist/components/Input.d.mts +3 -3
- package/dist/components/InputGroup.d.mts +1 -1
- package/dist/components/InputNumber.d.mts +3 -3
- package/dist/components/Kanban.d.mts +1 -1
- package/dist/components/List.d.mts +2 -2
- package/dist/components/Loading.d.mts +2 -2
- package/dist/components/Loading.mjs +2 -2
- package/dist/components/MarkdownEditor.d.mts +5 -5
- package/dist/components/Mentions.d.mts +2 -2
- package/dist/components/Mentions.mjs +2 -1
- package/dist/components/Menu.d.mts +4 -4
- package/dist/components/Menu.mjs +2 -2
- package/dist/components/Modal.d.mts +7 -7
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/NotificationCenter.d.mts +2 -2
- package/dist/components/NotificationCenter.mjs +3 -3
- package/dist/components/NumberKeyboard.d.mts +3 -3
- package/dist/components/OrgChart.d.mts +2 -2
- package/dist/components/Pagination.d.mts +2 -2
- package/dist/components/PieChart.d.mts +1 -1
- package/dist/components/Popconfirm.d.mts +4 -4
- package/dist/components/Popconfirm.mjs +3 -3
- package/dist/components/Popover.d.mts +5 -5
- package/dist/components/Popover.mjs +3 -3
- package/dist/components/Progress.d.mts +6 -6
- package/dist/components/QRCode.d.mts +1 -1
- package/dist/components/Result.d.mts +1 -1
- package/dist/components/RichTextEditor.d.mts +4 -4
- package/dist/components/ScatterChart.d.mts +2 -2
- package/dist/components/ScrollSpy.d.mts +3 -3
- package/dist/components/Segmented.d.mts +2 -2
- package/dist/components/Select.mjs +2 -1
- package/dist/components/Signature.d.mts +5 -5
- package/dist/components/Skeleton.d.mts +1 -1
- package/dist/components/Slider.d.mts +1 -1
- package/dist/components/Splitter.d.mts +1 -1
- package/dist/components/Spotlight.d.mts +5 -5
- package/dist/components/Spotlight.mjs +2 -2
- package/dist/components/Statistic.d.mts +1 -1
- package/dist/components/Steps.d.mts +3 -3
- package/dist/components/Table.mjs +3 -2
- package/dist/components/Tabs.d.mts +3 -3
- package/dist/components/Tag.d.mts +2 -2
- package/dist/components/TaskBoard.d.mts +2 -2
- package/dist/components/Textarea.d.mts +1 -1
- package/dist/components/TimePicker.d.mts +3 -3
- package/dist/components/TimePicker.mjs +2 -1
- package/dist/components/Timeline.d.mts +3 -3
- package/dist/components/Tooltip.d.mts +2 -2
- package/dist/components/Tooltip.mjs +3 -3
- package/dist/components/Tour.d.mts +1 -1
- package/dist/components/Tour.mjs +2 -2
- package/dist/components/Tree.d.mts +2 -2
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/components/Upload.d.mts +4 -4
- package/dist/components/VirtualTable.d.mts +2 -2
- package/dist/components/Watermark.d.mts +5 -5
- package/dist/index.mjs +5 -2
- package/package.json +2 -2
- package/dist/chunk-BDTPFPSB.mjs +0 -163
- package/dist/chunk-EWUHEW6W.mjs +0 -219
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createFilledIcon
|
|
3
3
|
} from "./chunk-2TNZ4JNT.mjs";
|
|
4
|
+
import {
|
|
5
|
+
renderVueOverlayTeleport,
|
|
6
|
+
useVueAnchoredOverlay
|
|
7
|
+
} from "./chunk-Q7Y22OFX.mjs";
|
|
4
8
|
import {
|
|
5
9
|
useTigerConfig
|
|
6
10
|
} from "./chunk-UOJOJBEU.mjs";
|
|
7
11
|
|
|
8
12
|
// src/components/DatePicker.ts
|
|
9
|
-
import { defineComponent, computed, ref, nextTick, h, watch
|
|
13
|
+
import { defineComponent, computed, ref, nextTick, h, watch } from "vue";
|
|
10
14
|
import {
|
|
11
15
|
classNames,
|
|
12
16
|
coerceClassValue,
|
|
@@ -238,6 +242,18 @@ var DatePicker = defineComponent({
|
|
|
238
242
|
const mobileCalendarRef = ref(null);
|
|
239
243
|
const inputWrapperRef = ref(null);
|
|
240
244
|
const inputRef = ref(null);
|
|
245
|
+
const panelRef = ref(null);
|
|
246
|
+
const overlay = useVueAnchoredOverlay({
|
|
247
|
+
enabled: isOpen,
|
|
248
|
+
referenceRef: inputWrapperRef,
|
|
249
|
+
floatingRef: panelRef,
|
|
250
|
+
placement: "bottom-start",
|
|
251
|
+
offset: 4,
|
|
252
|
+
layout: "bottom-sheet-sm",
|
|
253
|
+
dismissOnOutside: true,
|
|
254
|
+
dismissOnEscape: true,
|
|
255
|
+
onDismiss: closeCalendar
|
|
256
|
+
});
|
|
241
257
|
const activeDateIso = ref(null);
|
|
242
258
|
const activeRangePart = ref("start");
|
|
243
259
|
const pendingFocusIso = ref(null);
|
|
@@ -522,17 +538,11 @@ var DatePicker = defineComponent({
|
|
|
522
538
|
if (!date) return false;
|
|
523
539
|
return date.getMonth() === viewingMonth.value;
|
|
524
540
|
}
|
|
525
|
-
function handleClickOutside(event) {
|
|
526
|
-
if (inputWrapperRef.value && !calendarRef.value?.contains(event.target) && !mobileCalendarRef.value?.contains(event.target) && !inputWrapperRef.value.contains(event.target)) {
|
|
527
|
-
closeCalendar();
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
541
|
function handleInputClick() {
|
|
531
542
|
toggleCalendar();
|
|
532
543
|
}
|
|
533
544
|
watch(isOpen, (newValue) => {
|
|
534
545
|
if (newValue) {
|
|
535
|
-
document.addEventListener("click", handleClickOutside);
|
|
536
546
|
const preferred = pendingFocusIso.value ?? getPreferredFocusIso();
|
|
537
547
|
pendingFocusIso.value = null;
|
|
538
548
|
nextTick().then(() => {
|
|
@@ -541,15 +551,11 @@ var DatePicker = defineComponent({
|
|
|
541
551
|
if (fallback) focusDateButtonByIso(fallback);
|
|
542
552
|
});
|
|
543
553
|
} else {
|
|
544
|
-
document.removeEventListener("click", handleClickOutside);
|
|
545
554
|
nextTick().then(() => {
|
|
546
555
|
restoreFocus();
|
|
547
556
|
});
|
|
548
557
|
}
|
|
549
558
|
});
|
|
550
|
-
onBeforeUnmount(() => {
|
|
551
|
-
document.removeEventListener("click", handleClickOutside);
|
|
552
|
-
});
|
|
553
559
|
const rootClass = computed(
|
|
554
560
|
() => classNames(datePickerBaseClasses, props.className, coerceClassValue(attrs.class))
|
|
555
561
|
);
|
|
@@ -623,232 +629,255 @@ var DatePicker = defineComponent({
|
|
|
623
629
|
]
|
|
624
630
|
),
|
|
625
631
|
// Calendar dropdown
|
|
626
|
-
isOpen.value &&
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
h(
|
|
637
|
-
"button",
|
|
638
|
-
{
|
|
639
|
-
type: "button",
|
|
640
|
-
class: datePickerFooterButtonClasses,
|
|
641
|
-
"aria-selected": activeRangePart.value === "start",
|
|
642
|
-
onClick: () => activeRangePart.value = "start"
|
|
643
|
-
},
|
|
644
|
-
"Start"
|
|
645
|
-
),
|
|
646
|
-
h(
|
|
647
|
-
"button",
|
|
648
|
-
{
|
|
649
|
-
type: "button",
|
|
650
|
-
class: datePickerFooterButtonClasses,
|
|
651
|
-
"aria-selected": activeRangePart.value === "end",
|
|
652
|
-
onClick: () => activeRangePart.value = "end"
|
|
653
|
-
},
|
|
654
|
-
"End"
|
|
655
|
-
)
|
|
656
|
-
]) : null,
|
|
657
|
-
h("div", { class: datePickerMobileWheelGridClasses }, [
|
|
658
|
-
h(
|
|
659
|
-
"select",
|
|
660
|
-
{
|
|
661
|
-
class: datePickerMobileWheelSelectClasses,
|
|
662
|
-
value: mobileDate.value.getFullYear(),
|
|
663
|
-
"aria-label": labels.value.year,
|
|
664
|
-
onChange: (event) => updateMobileDate("year", Number(event.target.value))
|
|
665
|
-
},
|
|
666
|
-
mobileYears.value.map((year) => h("option", { value: year }, year))
|
|
667
|
-
),
|
|
668
|
-
h(
|
|
669
|
-
"select",
|
|
670
|
-
{
|
|
671
|
-
class: datePickerMobileWheelSelectClasses,
|
|
672
|
-
value: mobileDate.value.getMonth(),
|
|
673
|
-
"aria-label": labels.value.month,
|
|
674
|
-
onChange: (event) => updateMobileDate("month", Number(event.target.value))
|
|
675
|
-
},
|
|
676
|
-
Array.from(
|
|
677
|
-
{ length: 12 },
|
|
678
|
-
(_, month) => h("option", { value: month }, month + 1)
|
|
679
|
-
)
|
|
680
|
-
),
|
|
681
|
-
h(
|
|
682
|
-
"select",
|
|
683
|
-
{
|
|
684
|
-
class: datePickerMobileWheelSelectClasses,
|
|
685
|
-
value: mobileDate.value.getDate(),
|
|
686
|
-
"aria-label": labels.value.day,
|
|
687
|
-
onChange: (event) => updateMobileDate("day", Number(event.target.value))
|
|
688
|
-
},
|
|
689
|
-
mobileDays.value.map((day) => h("option", { value: day }, day))
|
|
690
|
-
)
|
|
691
|
-
]),
|
|
692
|
-
h("div", { class: "mt-4 flex justify-end gap-2" }, [
|
|
693
|
-
h(
|
|
694
|
-
"button",
|
|
695
|
-
{
|
|
696
|
-
type: "button",
|
|
697
|
-
class: datePickerFooterButtonClasses,
|
|
698
|
-
"aria-label": `Mobile ${labels.value.ok}`,
|
|
699
|
-
onClick: closeCalendar
|
|
700
|
-
},
|
|
701
|
-
labels.value.ok
|
|
702
|
-
)
|
|
703
|
-
])
|
|
704
|
-
]
|
|
705
|
-
),
|
|
706
|
-
isOpen.value && h(
|
|
707
|
-
"div",
|
|
708
|
-
{
|
|
709
|
-
ref: calendarRef,
|
|
710
|
-
class: datePickerCalendarClasses,
|
|
711
|
-
role: "dialog",
|
|
712
|
-
"aria-modal": "true",
|
|
713
|
-
"aria-label": labels.value.calendar,
|
|
714
|
-
onKeydown: handleCalendarKeyDown
|
|
715
|
-
},
|
|
716
|
-
[
|
|
717
|
-
// Calendar header
|
|
718
|
-
h("div", { class: datePickerCalendarHeaderClasses }, [
|
|
632
|
+
isOpen.value && renderVueOverlayTeleport(
|
|
633
|
+
h(
|
|
634
|
+
"div",
|
|
635
|
+
{
|
|
636
|
+
ref: panelRef,
|
|
637
|
+
class: overlay.floatingClasses.value,
|
|
638
|
+
style: overlay.floatingStyles.value,
|
|
639
|
+
"data-positioned": overlay.positioned.value
|
|
640
|
+
},
|
|
641
|
+
[
|
|
719
642
|
h(
|
|
720
|
-
"
|
|
643
|
+
"div",
|
|
721
644
|
{
|
|
722
|
-
|
|
723
|
-
class:
|
|
724
|
-
|
|
725
|
-
"aria-label": labels.value.
|
|
645
|
+
ref: mobileCalendarRef,
|
|
646
|
+
class: datePickerMobileWheelClasses,
|
|
647
|
+
role: "group",
|
|
648
|
+
"aria-label": labels.value.calendar
|
|
726
649
|
},
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
650
|
+
[
|
|
651
|
+
isRangeMode.value ? h("div", { class: "mb-3 flex items-center gap-2" }, [
|
|
652
|
+
h(
|
|
653
|
+
"button",
|
|
654
|
+
{
|
|
655
|
+
type: "button",
|
|
656
|
+
class: datePickerFooterButtonClasses,
|
|
657
|
+
"aria-selected": activeRangePart.value === "start",
|
|
658
|
+
onClick: () => activeRangePart.value = "start"
|
|
659
|
+
},
|
|
660
|
+
"Start"
|
|
661
|
+
),
|
|
662
|
+
h(
|
|
663
|
+
"button",
|
|
664
|
+
{
|
|
665
|
+
type: "button",
|
|
666
|
+
class: datePickerFooterButtonClasses,
|
|
667
|
+
"aria-selected": activeRangePart.value === "end",
|
|
668
|
+
onClick: () => activeRangePart.value = "end"
|
|
669
|
+
},
|
|
670
|
+
"End"
|
|
671
|
+
)
|
|
672
|
+
]) : null,
|
|
673
|
+
h("div", { class: datePickerMobileWheelGridClasses }, [
|
|
674
|
+
h(
|
|
675
|
+
"select",
|
|
676
|
+
{
|
|
677
|
+
class: datePickerMobileWheelSelectClasses,
|
|
678
|
+
value: mobileDate.value.getFullYear(),
|
|
679
|
+
"aria-label": labels.value.year,
|
|
680
|
+
onChange: (event) => updateMobileDate(
|
|
681
|
+
"year",
|
|
682
|
+
Number(event.target.value)
|
|
683
|
+
)
|
|
684
|
+
},
|
|
685
|
+
mobileYears.value.map((year) => h("option", { value: year }, year))
|
|
686
|
+
),
|
|
687
|
+
h(
|
|
688
|
+
"select",
|
|
689
|
+
{
|
|
690
|
+
class: datePickerMobileWheelSelectClasses,
|
|
691
|
+
value: mobileDate.value.getMonth(),
|
|
692
|
+
"aria-label": labels.value.month,
|
|
693
|
+
onChange: (event) => updateMobileDate(
|
|
694
|
+
"month",
|
|
695
|
+
Number(event.target.value)
|
|
696
|
+
)
|
|
697
|
+
},
|
|
698
|
+
Array.from(
|
|
699
|
+
{ length: 12 },
|
|
700
|
+
(_, month) => h("option", { value: month }, month + 1)
|
|
701
|
+
)
|
|
702
|
+
),
|
|
703
|
+
h(
|
|
704
|
+
"select",
|
|
705
|
+
{
|
|
706
|
+
class: datePickerMobileWheelSelectClasses,
|
|
707
|
+
value: mobileDate.value.getDate(),
|
|
708
|
+
"aria-label": labels.value.day,
|
|
709
|
+
onChange: (event) => updateMobileDate(
|
|
710
|
+
"day",
|
|
711
|
+
Number(event.target.value)
|
|
712
|
+
)
|
|
713
|
+
},
|
|
714
|
+
mobileDays.value.map((day) => h("option", { value: day }, day))
|
|
715
|
+
)
|
|
716
|
+
]),
|
|
717
|
+
h("div", { class: "mt-4 flex justify-end gap-2" }, [
|
|
718
|
+
h(
|
|
719
|
+
"button",
|
|
720
|
+
{
|
|
721
|
+
type: "button",
|
|
722
|
+
class: datePickerFooterButtonClasses,
|
|
723
|
+
"aria-label": `Mobile ${labels.value.ok}`,
|
|
724
|
+
onClick: closeCalendar
|
|
725
|
+
},
|
|
726
|
+
labels.value.ok
|
|
727
|
+
)
|
|
728
|
+
])
|
|
729
|
+
]
|
|
733
730
|
),
|
|
734
731
|
h(
|
|
735
|
-
"button",
|
|
736
|
-
{
|
|
737
|
-
type: "button",
|
|
738
|
-
class: datePickerNavButtonClasses,
|
|
739
|
-
onClick: nextMonth,
|
|
740
|
-
"aria-label": labels.value.nextMonth
|
|
741
|
-
},
|
|
742
|
-
nextMonthIcon.value
|
|
743
|
-
)
|
|
744
|
-
]),
|
|
745
|
-
// Day names header
|
|
746
|
-
h("div", { class: datePickerCalendarGridClasses, role: "row" }, [
|
|
747
|
-
...dayNames.value.map(
|
|
748
|
-
(day) => h(
|
|
749
|
-
"div",
|
|
750
|
-
{
|
|
751
|
-
class: datePickerDayNameClasses,
|
|
752
|
-
key: day,
|
|
753
|
-
role: "columnheader"
|
|
754
|
-
},
|
|
755
|
-
day
|
|
756
|
-
)
|
|
757
|
-
)
|
|
758
|
-
]),
|
|
759
|
-
// Calendar grid
|
|
760
|
-
(() => {
|
|
761
|
-
return h(
|
|
762
732
|
"div",
|
|
763
733
|
{
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
"
|
|
767
|
-
"aria-
|
|
734
|
+
ref: calendarRef,
|
|
735
|
+
class: datePickerCalendarClasses,
|
|
736
|
+
role: "dialog",
|
|
737
|
+
"aria-modal": "true",
|
|
738
|
+
"aria-label": labels.value.calendar,
|
|
739
|
+
onKeydown: handleCalendarKeyDown
|
|
768
740
|
},
|
|
769
741
|
[
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
742
|
+
// Calendar header
|
|
743
|
+
h("div", { class: datePickerCalendarHeaderClasses }, [
|
|
744
|
+
h(
|
|
745
|
+
"button",
|
|
746
|
+
{
|
|
747
|
+
type: "button",
|
|
748
|
+
class: datePickerNavButtonClasses,
|
|
749
|
+
onClick: previousMonth,
|
|
750
|
+
"aria-label": labels.value.previousMonth
|
|
751
|
+
},
|
|
752
|
+
previousMonthIcon.value
|
|
753
|
+
),
|
|
754
|
+
h(
|
|
755
|
+
"div",
|
|
756
|
+
{ class: datePickerMonthYearClasses },
|
|
757
|
+
formatMonthYear(viewingYear.value, viewingMonth.value, localeCode.value)
|
|
758
|
+
),
|
|
759
|
+
h(
|
|
781
760
|
"button",
|
|
782
761
|
{
|
|
783
|
-
key: index,
|
|
784
762
|
type: "button",
|
|
785
|
-
class:
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
763
|
+
class: datePickerNavButtonClasses,
|
|
764
|
+
onClick: nextMonth,
|
|
765
|
+
"aria-label": labels.value.nextMonth
|
|
766
|
+
},
|
|
767
|
+
nextMonthIcon.value
|
|
768
|
+
)
|
|
769
|
+
]),
|
|
770
|
+
// Day names header
|
|
771
|
+
h("div", { class: datePickerCalendarGridClasses, role: "row" }, [
|
|
772
|
+
...dayNames.value.map(
|
|
773
|
+
(day) => h(
|
|
774
|
+
"div",
|
|
775
|
+
{
|
|
776
|
+
class: datePickerDayNameClasses,
|
|
777
|
+
key: day,
|
|
778
|
+
role: "columnheader"
|
|
800
779
|
},
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
780
|
+
day
|
|
781
|
+
)
|
|
782
|
+
)
|
|
783
|
+
]),
|
|
784
|
+
// Calendar grid
|
|
785
|
+
(() => {
|
|
786
|
+
return h(
|
|
787
|
+
"div",
|
|
788
|
+
{
|
|
789
|
+
class: datePickerCalendarGridClasses,
|
|
790
|
+
role: "grid",
|
|
791
|
+
"aria-rowcount": 6,
|
|
792
|
+
"aria-colcount": 7
|
|
805
793
|
},
|
|
806
|
-
|
|
794
|
+
[
|
|
795
|
+
...calendarDays.value.map((date, index) => {
|
|
796
|
+
if (!date) return null;
|
|
797
|
+
const cell = getDatePickerCalendarCellState({
|
|
798
|
+
date,
|
|
799
|
+
selectedDate: selectedDate.value,
|
|
800
|
+
selectedRange: selectedRange.value,
|
|
801
|
+
isRangeMode: isRangeMode.value,
|
|
802
|
+
isCurrentMonth,
|
|
803
|
+
isDateDisabled
|
|
804
|
+
});
|
|
805
|
+
return h(
|
|
806
|
+
"button",
|
|
807
|
+
{
|
|
808
|
+
key: index,
|
|
809
|
+
type: "button",
|
|
810
|
+
class: getDatePickerDayCellClasses(
|
|
811
|
+
cell.isCurrentMonthDay,
|
|
812
|
+
cell.isSelected,
|
|
813
|
+
cell.isTodayDay,
|
|
814
|
+
cell.isDisabled,
|
|
815
|
+
cell.isInRange,
|
|
816
|
+
cell.isRangeStart,
|
|
817
|
+
cell.isRangeEnd
|
|
818
|
+
),
|
|
819
|
+
disabled: cell.isDisabled,
|
|
820
|
+
onClick: () => selectDate(date),
|
|
821
|
+
role: "gridcell",
|
|
822
|
+
"data-date": cell.iso,
|
|
823
|
+
onFocus: () => {
|
|
824
|
+
activeDateIso.value = cell.iso;
|
|
825
|
+
},
|
|
826
|
+
tabindex: activeDateIso.value === cell.iso && !cell.isDisabled ? 0 : -1,
|
|
827
|
+
"aria-label": cell.iso,
|
|
828
|
+
"aria-selected": cell.isSelected,
|
|
829
|
+
"aria-current": cell.isTodayDay ? "date" : void 0
|
|
830
|
+
},
|
|
831
|
+
date.getDate()
|
|
832
|
+
);
|
|
833
|
+
})
|
|
834
|
+
]
|
|
807
835
|
);
|
|
808
|
-
})
|
|
836
|
+
})(),
|
|
837
|
+
// Shortcuts panel
|
|
838
|
+
props.shortcuts?.length ? h(
|
|
839
|
+
"div",
|
|
840
|
+
{
|
|
841
|
+
class: "flex flex-wrap gap-1 px-3 py-2 border-t border-[var(--tiger-border,#e5e7eb)]"
|
|
842
|
+
},
|
|
843
|
+
props.shortcuts.map(
|
|
844
|
+
(sc) => h(
|
|
845
|
+
"button",
|
|
846
|
+
{
|
|
847
|
+
type: "button",
|
|
848
|
+
class: datePickerFooterButtonClasses,
|
|
849
|
+
onClick: () => handleShortcut(sc)
|
|
850
|
+
},
|
|
851
|
+
sc.label
|
|
852
|
+
)
|
|
853
|
+
)
|
|
854
|
+
) : null,
|
|
855
|
+
// Footer (range mode only)
|
|
856
|
+
isRangeMode.value ? h("div", { class: datePickerFooterClasses }, [
|
|
857
|
+
h(
|
|
858
|
+
"button",
|
|
859
|
+
{
|
|
860
|
+
type: "button",
|
|
861
|
+
class: datePickerFooterButtonClasses,
|
|
862
|
+
onClick: setToday
|
|
863
|
+
},
|
|
864
|
+
labels.value.today
|
|
865
|
+
),
|
|
866
|
+
h(
|
|
867
|
+
"button",
|
|
868
|
+
{
|
|
869
|
+
type: "button",
|
|
870
|
+
class: datePickerFooterButtonClasses,
|
|
871
|
+
onClick: closeCalendar
|
|
872
|
+
},
|
|
873
|
+
labels.value.ok
|
|
874
|
+
)
|
|
875
|
+
]) : null
|
|
809
876
|
]
|
|
810
|
-
);
|
|
811
|
-
})(),
|
|
812
|
-
// Shortcuts panel
|
|
813
|
-
props.shortcuts?.length ? h(
|
|
814
|
-
"div",
|
|
815
|
-
{
|
|
816
|
-
class: "flex flex-wrap gap-1 px-3 py-2 border-t border-[var(--tiger-border,#e5e7eb)]"
|
|
817
|
-
},
|
|
818
|
-
props.shortcuts.map(
|
|
819
|
-
(sc) => h(
|
|
820
|
-
"button",
|
|
821
|
-
{
|
|
822
|
-
type: "button",
|
|
823
|
-
class: datePickerFooterButtonClasses,
|
|
824
|
-
onClick: () => handleShortcut(sc)
|
|
825
|
-
},
|
|
826
|
-
sc.label
|
|
827
|
-
)
|
|
828
|
-
)
|
|
829
|
-
) : null,
|
|
830
|
-
// Footer (range mode only)
|
|
831
|
-
isRangeMode.value ? h("div", { class: datePickerFooterClasses }, [
|
|
832
|
-
h(
|
|
833
|
-
"button",
|
|
834
|
-
{
|
|
835
|
-
type: "button",
|
|
836
|
-
class: datePickerFooterButtonClasses,
|
|
837
|
-
onClick: setToday
|
|
838
|
-
},
|
|
839
|
-
labels.value.today
|
|
840
|
-
),
|
|
841
|
-
h(
|
|
842
|
-
"button",
|
|
843
|
-
{
|
|
844
|
-
type: "button",
|
|
845
|
-
class: datePickerFooterButtonClasses,
|
|
846
|
-
onClick: closeCalendar
|
|
847
|
-
},
|
|
848
|
-
labels.value.ok
|
|
849
877
|
)
|
|
850
|
-
]
|
|
851
|
-
|
|
878
|
+
]
|
|
879
|
+
),
|
|
880
|
+
overlay.target.value
|
|
852
881
|
)
|
|
853
882
|
]
|
|
854
883
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useFloatingPopup
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-26OI3TEA.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
renderVueOverlayTeleport
|
|
6
|
+
} from "./chunk-Q7Y22OFX.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/Tooltip.ts
|
|
9
9
|
import { defineComponent, computed, h } from "vue";
|
|
@@ -47,6 +47,9 @@ var Tooltip = defineComponent({
|
|
|
47
47
|
triggerRef,
|
|
48
48
|
floatingRef,
|
|
49
49
|
floatingStyles,
|
|
50
|
+
floatingClasses,
|
|
51
|
+
positioned,
|
|
52
|
+
overlayTarget,
|
|
50
53
|
triggerHandlers
|
|
51
54
|
} = useFloatingPopup({ props, emit });
|
|
52
55
|
const tooltipId = createTooltipId();
|
|
@@ -85,12 +88,14 @@ var Tooltip = defineComponent({
|
|
|
85
88
|
defaultSlot
|
|
86
89
|
),
|
|
87
90
|
// Tooltip content (positioned with Floating UI)
|
|
88
|
-
currentVisible.value ?
|
|
91
|
+
currentVisible.value ? renderVueOverlayTeleport(
|
|
89
92
|
h(
|
|
90
93
|
"div",
|
|
91
94
|
{
|
|
92
95
|
ref: floatingRef,
|
|
96
|
+
class: floatingClasses.value,
|
|
93
97
|
style: floatingStyles.value,
|
|
98
|
+
"data-positioned": positioned.value,
|
|
94
99
|
"aria-hidden": false
|
|
95
100
|
},
|
|
96
101
|
[
|
|
@@ -104,7 +109,8 @@ var Tooltip = defineComponent({
|
|
|
104
109
|
slots.content ? slots.content() : props.content
|
|
105
110
|
)
|
|
106
111
|
]
|
|
107
|
-
)
|
|
112
|
+
),
|
|
113
|
+
overlayTarget.value
|
|
108
114
|
) : null
|
|
109
115
|
]
|
|
110
116
|
);
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useVueBodyScrollLock,
|
|
7
7
|
useVueEscapeKey,
|
|
8
8
|
useVueFocusTrap
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Q7Y22OFX.mjs";
|
|
10
10
|
import {
|
|
11
11
|
useTigerConfig
|
|
12
12
|
} from "./chunk-UOJOJBEU.mjs";
|
|
@@ -216,6 +216,7 @@ var Modal = defineComponent({
|
|
|
216
216
|
const instanceId = ref(createModalId());
|
|
217
217
|
const hasBeenOpened = ref(props.open);
|
|
218
218
|
const dialogRef = ref(null);
|
|
219
|
+
const rootRef = ref(null);
|
|
219
220
|
const closeButtonRef = ref(null);
|
|
220
221
|
const previousActiveElement = ref(null);
|
|
221
222
|
let touchStartPoint = null;
|
|
@@ -290,9 +291,13 @@ var Modal = defineComponent({
|
|
|
290
291
|
const overlayOpen = computed(() => props.open);
|
|
291
292
|
let cleanupEscape;
|
|
292
293
|
useVueBodyScrollLock(overlayOpen);
|
|
293
|
-
useVueFocusTrap({ enabled: overlayOpen, containerRef:
|
|
294
|
+
useVueFocusTrap({ enabled: overlayOpen, containerRef: rootRef });
|
|
294
295
|
onMounted(() => {
|
|
295
|
-
cleanupEscape = useVueEscapeKey({
|
|
296
|
+
cleanupEscape = useVueEscapeKey({
|
|
297
|
+
enabled: overlayOpen,
|
|
298
|
+
onEscape: handleClose,
|
|
299
|
+
layerRef: rootRef
|
|
300
|
+
});
|
|
296
301
|
});
|
|
297
302
|
onBeforeUnmount(() => {
|
|
298
303
|
cleanupEscape?.();
|
|
@@ -350,6 +355,7 @@ var Modal = defineComponent({
|
|
|
350
355
|
);
|
|
351
356
|
const ariaLabelledbyFromAttrs = typeof attrs["aria-labelledby"] === "string" ? attrs["aria-labelledby"] : void 0;
|
|
352
357
|
const ariaLabelledby = ariaLabelledbyFromAttrs ?? (props.title || slots.title ? titleId.value : void 0);
|
|
358
|
+
const overlayHostId = `${instanceId.value}-overlay-host`;
|
|
353
359
|
const mergedClass = classNames(contentClasses.value, coerceClassValue(attrs.class));
|
|
354
360
|
const widthStyle = props.width ? {
|
|
355
361
|
width: typeof props.width === "number" ? `${props.width}px` : props.width,
|
|
@@ -430,9 +436,11 @@ var Modal = defineComponent({
|
|
|
430
436
|
"div",
|
|
431
437
|
{
|
|
432
438
|
class: modalWrapperClasses,
|
|
439
|
+
ref: rootRef,
|
|
433
440
|
style: { zIndex: props.zIndex },
|
|
434
441
|
hidden: !props.open,
|
|
435
442
|
"aria-hidden": !props.open ? "true" : void 0,
|
|
443
|
+
"data-tiger-overlay-layer": "",
|
|
436
444
|
"data-tiger-modal-root": ""
|
|
437
445
|
},
|
|
438
446
|
[
|
|
@@ -457,6 +465,7 @@ var Modal = defineComponent({
|
|
|
457
465
|
role: "dialog",
|
|
458
466
|
"aria-modal": "true",
|
|
459
467
|
"aria-labelledby": ariaLabelledby,
|
|
468
|
+
"aria-owns": overlayHostId,
|
|
460
469
|
tabindex: -1,
|
|
461
470
|
ref: dialogRef,
|
|
462
471
|
onTouchstart: handleTouchStart,
|
|
@@ -468,7 +477,12 @@ var Modal = defineComponent({
|
|
|
468
477
|
[header, body, footer]
|
|
469
478
|
)
|
|
470
479
|
]
|
|
471
|
-
)
|
|
480
|
+
),
|
|
481
|
+
h("div", {
|
|
482
|
+
id: overlayHostId,
|
|
483
|
+
class: "contents",
|
|
484
|
+
"data-tiger-overlay-host": ""
|
|
485
|
+
})
|
|
472
486
|
]
|
|
473
487
|
);
|
|
474
488
|
return renderVueBodyTeleport([renderedWrapper]);
|