@expcat/tigercat-vue 2.0.19 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -10
- package/dist/chunk-26QCTL2E.mjs +180 -0
- package/dist/{chunk-7W3NALIL.mjs → chunk-3FPS7XVB.mjs} +26 -27
- package/dist/{chunk-2OI6GWOT.mjs → chunk-3KAHJF7D.mjs} +12 -11
- package/dist/chunk-3OCHBGPF.mjs +835 -0
- package/dist/chunk-3ONCXHE5.mjs +184 -0
- package/dist/{chunk-4HUYX5WW.mjs → chunk-4PQZMDBK.mjs} +29 -8
- package/dist/{chunk-DI6RRAGQ.mjs → chunk-562Z32GR.mjs} +3 -3
- package/dist/{chunk-OQVGB7X6.mjs → chunk-626VUZ2Q.mjs} +1 -1
- package/dist/{chunk-WUQMFKQ6.mjs → chunk-67VS6QHJ.mjs} +29 -15
- package/dist/chunk-6GR3XC5V.mjs +281 -0
- package/dist/chunk-6GR5U4UB.mjs +225 -0
- package/dist/{chunk-KFJIZED5.mjs → chunk-6JAAXPBW.mjs} +7 -6
- package/dist/{chunk-XGXZF27U.mjs → chunk-6NYC7EY2.mjs} +32 -18
- package/dist/{chunk-6BDDX2R4.mjs → chunk-73Z7N7VG.mjs} +1 -4
- package/dist/chunk-7C7SG3SS.mjs +269 -0
- package/dist/{chunk-NNC75I7F.mjs → chunk-7TJE7OYH.mjs} +7 -6
- package/dist/{chunk-AU6IC6K7.mjs → chunk-ABNS4B5V.mjs} +35 -15
- package/dist/chunk-AECXFT7D.mjs +121 -0
- package/dist/chunk-AOLRZG4E.mjs +347 -0
- package/dist/chunk-AY7CGLMO.mjs +368 -0
- package/dist/chunk-BBNCP55O.mjs +156 -0
- package/dist/{chunk-EGIMTTZA.mjs → chunk-BOHE5URZ.mjs} +18 -3
- package/dist/{chunk-5RIHHZF6.mjs → chunk-BQK7LH2L.mjs} +4 -1
- package/dist/{chunk-E6EZHSGY.mjs → chunk-BSOLH6R5.mjs} +0 -1
- package/dist/{chunk-RSM6FOWX.mjs → chunk-CCC3S6LK.mjs} +6 -3
- package/dist/{chunk-U75YXWSA.mjs → chunk-CLTRADS7.mjs} +17 -5
- package/dist/{chunk-BEIPGX74.mjs → chunk-DRLQCY7R.mjs} +162 -7
- package/dist/{chunk-KBJANUZZ.mjs → chunk-E523VGZP.mjs} +1 -1
- package/dist/{chunk-D3U2NJ32.mjs → chunk-FEQ7PZXI.mjs} +8 -2
- package/dist/{chunk-PE5OA4YG.mjs → chunk-FHUGOSEY.mjs} +8 -2
- package/dist/{chunk-OAPIT53X.mjs → chunk-FIEECAJV.mjs} +7 -10
- package/dist/{chunk-7SFB77JR.mjs → chunk-GBPMQJJJ.mjs} +8 -1
- package/dist/{chunk-KOG3HKOF.mjs → chunk-GQOPDD44.mjs} +2 -5
- package/dist/{chunk-5RXYJWNA.mjs → chunk-H4DEIGEG.mjs} +77 -25
- package/dist/{chunk-ZGA66PSG.mjs → chunk-IK2WHKDA.mjs} +32 -18
- package/dist/{chunk-HGXD57QM.mjs → chunk-JBS3AESR.mjs} +65 -23
- package/dist/{chunk-PYRKFQ6J.mjs → chunk-JIU5UEOU.mjs} +70 -26
- package/dist/{chunk-JALHMWKW.mjs → chunk-K5MHUMKR.mjs} +2 -2
- package/dist/{chunk-5E4LINDO.mjs → chunk-LH2V2JMZ.mjs} +26 -10
- package/dist/{chunk-PQBKN2NH.mjs → chunk-LRFKHJDU.mjs} +14 -5
- package/dist/{chunk-OTHJIFDV.mjs → chunk-M4FWWEMX.mjs} +18 -9
- package/dist/{chunk-NGAA73CV.mjs → chunk-N2XV37BL.mjs} +40 -44
- package/dist/{chunk-2LIIMWBR.mjs → chunk-OYU47A57.mjs} +1 -2
- package/dist/{chunk-KU2Q5V3L.mjs → chunk-P62TYR3M.mjs} +18 -2
- package/dist/chunk-P6FMU4AT.mjs +54 -0
- package/dist/{chunk-P5FDKBXG.mjs → chunk-P7X46BAW.mjs} +70 -3
- package/dist/chunk-PFIV5MXD.mjs +48 -0
- package/dist/{chunk-KROVW4AW.mjs → chunk-PJQTRDIG.mjs} +13 -3
- package/dist/{chunk-26OI3TEA.mjs → chunk-PMQSXEMT.mjs} +42 -6
- package/dist/{chunk-XLNK3Z2P.mjs → chunk-POWDTOMF.mjs} +88 -79
- package/dist/{chunk-AXDBME5A.mjs → chunk-PSGVG4TN.mjs} +38 -21
- package/dist/chunk-PWWWACHC.mjs +302 -0
- package/dist/{chunk-UUWTKCMY.mjs → chunk-QWLD5FMJ.mjs} +1 -1
- package/dist/{chunk-ALIUAGJO.mjs → chunk-QZLOF36M.mjs} +7 -13
- package/dist/{chunk-WLYQHKLZ.mjs → chunk-QZRSFGZZ.mjs} +50 -11
- package/dist/{chunk-MAKOSWR6.mjs → chunk-RHQWQJ4I.mjs} +7 -6
- package/dist/{chunk-GS4SV2HK.mjs → chunk-RRLE7QRH.mjs} +43 -22
- package/dist/{chunk-RID7A5V7.mjs → chunk-RRNQL6MJ.mjs} +23 -6
- package/dist/{chunk-VJ6YM2EW.mjs → chunk-S4BKVFQ7.mjs} +1 -1
- package/dist/{chunk-LPZBXTJ6.mjs → chunk-SAC4PAG3.mjs} +4 -4
- package/dist/{chunk-W5RZPTFD.mjs → chunk-SNNT64HK.mjs} +13 -2
- package/dist/{chunk-N3C6YI7I.mjs → chunk-SWMYIORV.mjs} +22 -7
- package/dist/{chunk-2XCXK3NQ.mjs → chunk-SX3NAN4M.mjs} +1 -1
- package/dist/chunk-TBOXTAIA.mjs +94 -0
- package/dist/{chunk-JL3CN4UK.mjs → chunk-TDBMAKTJ.mjs} +10 -3
- package/dist/{chunk-EDBMWZKH.mjs → chunk-TPESRDUG.mjs} +5 -1
- package/dist/chunk-UEGNXN5B.mjs +28 -0
- package/dist/{chunk-NEEGXKJW.mjs → chunk-UGHLEKEZ.mjs} +22 -3
- package/dist/{chunk-HKYRRQS7.mjs → chunk-UNQO7EVG.mjs} +1 -1
- package/dist/chunk-UR5F74ZB.mjs +601 -0
- package/dist/{chunk-VCCK4CDT.mjs → chunk-URPXBKK4.mjs} +23 -5
- package/dist/chunk-UUWPSRNV.mjs +337 -0
- package/dist/chunk-UXJRH72H.mjs +834 -0
- package/dist/chunk-VFS5XAZ3.mjs +602 -0
- package/dist/{chunk-7KCOF5US.mjs → chunk-VY6FVIOZ.mjs} +10 -8
- package/dist/{chunk-KICZSLOX.mjs → chunk-W2ICYZVU.mjs} +1 -1
- package/dist/{chunk-FIVVKBBF.mjs → chunk-W3QOMJKQ.mjs} +8 -6
- package/dist/{chunk-DCMRB3HR.mjs → chunk-WV25G4M3.mjs} +4 -3
- package/dist/{chunk-3KITFMBJ.mjs → chunk-X5LJT76O.mjs} +52 -35
- package/dist/{chunk-BNYA5IUB.mjs → chunk-YNXP34KO.mjs} +39 -38
- package/dist/{chunk-2T2NEZRZ.mjs → chunk-YVDTXHQ6.mjs} +1 -1
- package/dist/{chunk-AUMTHL6N.mjs → chunk-ZOP7PEKY.mjs} +2 -1
- package/dist/components/ActivityFeed.d.mts +29 -11
- package/dist/components/ActivityFeed.mjs +3 -3
- package/dist/components/Affix.d.mts +4 -4
- package/dist/components/Affix.mjs +1 -1
- package/dist/components/Alert.d.mts +4 -4
- package/dist/components/Anchor.d.mts +2 -2
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/AreaChart.d.mts +3 -3
- package/dist/components/AreaChart.mjs +5 -4
- package/dist/components/AspectRatio.d.mts +44 -0
- package/dist/components/AspectRatio.mjs +8 -0
- package/dist/components/AutoComplete.d.mts +3 -3
- package/dist/components/AutoComplete.mjs +1 -1
- package/dist/components/Avatar.d.mts +2 -2
- package/dist/components/AvatarGroup.d.mts +2 -2
- package/dist/components/BackTop.d.mts +2 -2
- package/dist/components/Badge.d.mts +5 -5
- package/dist/components/BarChart.d.mts +2 -2
- package/dist/components/BarChart.mjs +5 -4
- package/dist/components/Breadcrumb.d.mts +2 -2
- package/dist/components/Button.d.mts +5 -5
- package/dist/components/ButtonGroup.d.mts +1 -1
- package/dist/components/Calendar.d.mts +2 -2
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Card.d.mts +3 -3
- package/dist/components/Carousel.d.mts +3 -3
- package/dist/components/Cascader.d.mts +37 -3
- package/dist/components/Cascader.mjs +1 -1
- package/dist/components/ChartCanvas.d.mts +8 -4
- package/dist/components/ChartCanvas.mjs +1 -1
- package/dist/components/ChartGrid.d.mts +1 -1
- package/dist/components/ChartLegend.d.mts +2 -2
- package/dist/components/ChartTooltip.d.mts +1 -1
- package/dist/components/ChatWindow.d.mts +29 -11
- package/dist/components/ChatWindow.mjs +4 -4
- package/dist/components/Checkbox.d.mts +1 -1
- package/dist/components/Code.d.mts +33 -6
- package/dist/components/Code.mjs +3 -1
- package/dist/components/CodeEditor.d.mts +1 -1
- package/dist/components/CodeEditor.mjs +1 -1
- package/dist/components/Collapse.d.mts +1 -1
- package/dist/components/CollapsePanel.mjs +1 -1
- package/dist/components/ColorPicker.mjs +1 -1
- package/dist/components/ColorSwatch.d.mts +8 -2
- package/dist/components/ColorSwatch.mjs +1 -1
- package/dist/components/CommentThread.d.mts +63 -27
- package/dist/components/CommentThread.mjs +2 -2
- package/dist/components/Container.d.mts +1 -1
- package/dist/components/ContextMenu.d.mts +234 -0
- package/dist/components/ContextMenu.mjs +17 -0
- package/dist/components/Countdown.d.mts +1 -1
- package/dist/components/CronEditor.d.mts +3 -3
- package/dist/components/CropUpload.d.mts +1 -1
- package/dist/components/DataExport.d.mts +1 -1
- package/dist/components/DataExport.mjs +2 -2
- package/dist/components/DataTableWithToolbar.d.mts +11 -11
- package/dist/components/DataTableWithToolbar.mjs +8 -8
- package/dist/components/DatePicker.d.mts +5 -5
- package/dist/components/Descriptions.d.mts +3 -3
- package/dist/components/DonutChart.d.mts +3 -3
- package/dist/components/DonutChart.mjs +5 -5
- package/dist/components/Drawer.d.mts +6 -6
- package/dist/components/Dropdown.d.mts +21 -2
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/Empty.d.mts +1 -1
- package/dist/components/FileManager.d.mts +10 -4
- package/dist/components/FileManager.mjs +1 -1
- package/dist/components/FloatButton.d.mts +37 -7
- package/dist/components/FloatButton.mjs +1 -1
- package/dist/components/Form.d.mts +2 -2
- package/dist/components/FormWizard.d.mts +4 -4
- package/dist/components/FormWizard.mjs +1 -1
- package/dist/components/FunnelChart.d.mts +4 -4
- package/dist/components/FunnelChart.mjs +4 -4
- package/dist/components/Gantt.d.mts +6 -4
- package/dist/components/Gantt.mjs +2 -2
- package/dist/components/GaugeChart.d.mts +4 -4
- package/dist/components/GaugeChart.mjs +2 -2
- package/dist/components/Header.d.mts +1 -1
- package/dist/components/HeatmapChart.d.mts +3 -3
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Highlight.d.mts +146 -0
- package/dist/components/Highlight.mjs +8 -0
- package/dist/components/Icon.d.mts +2 -2
- package/dist/components/Image.d.mts +2 -2
- package/dist/components/Image.mjs +3 -3
- package/dist/components/ImageAnnotation.d.mts +4 -4
- package/dist/components/ImageCompare.d.mts +284 -0
- package/dist/components/ImageCompare.mjs +8 -0
- package/dist/components/ImageCropper.d.mts +1 -1
- package/dist/components/ImageGroup.mjs +2 -2
- package/dist/components/ImagePreview.d.mts +1 -1
- package/dist/components/ImagePreview.mjs +1 -1
- package/dist/components/ImageViewer.d.mts +1 -1
- package/dist/components/InfiniteScroll.d.mts +4 -4
- package/dist/components/Input.d.mts +7 -7
- package/dist/components/Input.mjs +1 -1
- package/dist/components/InputGroup.d.mts +2 -2
- package/dist/components/InputNumber.d.mts +3 -3
- package/dist/components/InputNumber.mjs +1 -1
- package/dist/components/InputOTP.d.mts +261 -0
- package/dist/components/InputOTP.mjs +11 -0
- package/dist/components/Kanban.d.mts +1 -1
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/Kbd.d.mts +118 -0
- package/dist/components/Kbd.mjs +8 -0
- package/dist/components/LineChart.d.mts +2 -2
- package/dist/components/LineChart.mjs +5 -4
- package/dist/components/Link.d.mts +1 -1
- package/dist/components/List.d.mts +7 -7
- package/dist/components/List.mjs +2 -2
- package/dist/components/Loading.d.mts +7 -7
- package/dist/components/Loading.mjs +1 -1
- package/dist/components/LoadingBar.d.mts +8 -0
- package/dist/components/LoadingBar.mjs +114 -0
- package/dist/components/LoadingBarContainer.d.mts +78 -0
- package/dist/components/LoadingBarContainer.mjs +8 -0
- package/dist/components/LoadingBarRoot.d.mts +6 -0
- package/dist/components/LoadingBarRoot.mjs +6 -0
- package/dist/components/MarkdownEditor.d.mts +4 -4
- package/dist/components/Marquee.d.mts +158 -0
- package/dist/components/Marquee.mjs +8 -0
- package/dist/components/MaskInput.d.mts +207 -0
- package/dist/components/MaskInput.mjs +11 -0
- package/dist/components/Masonry.d.mts +66 -0
- package/dist/components/Masonry.mjs +8 -0
- package/dist/components/Mentions.d.mts +1 -1
- package/dist/components/Menu.d.mts +4 -4
- package/dist/components/Modal.d.mts +7 -7
- package/dist/components/NavigationMenu.d.mts +411 -0
- package/dist/components/NavigationMenu.mjs +25 -0
- package/dist/components/NotificationCenter.d.mts +48 -30
- package/dist/components/NotificationCenter.mjs +4 -4
- package/dist/components/NumberKeyboard.d.mts +4 -4
- package/dist/components/OrgChart.d.mts +4 -4
- package/dist/components/OrgChart.mjs +2 -2
- package/dist/components/PageHeader.d.mts +140 -0
- package/dist/components/PageHeader.mjs +11 -0
- package/dist/components/Pagination.d.mts +5 -5
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/PieChart.d.mts +3 -3
- package/dist/components/PieChart.mjs +4 -4
- package/dist/components/Popconfirm.d.mts +4 -4
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.d.mts +5 -5
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/Progress.d.mts +7 -7
- package/dist/components/QRCode.d.mts +4 -13
- package/dist/components/QRCode.mjs +1 -1
- package/dist/components/RadarChart.d.mts +3 -3
- package/dist/components/RadarChart.mjs +4 -4
- package/dist/components/Radio.d.mts +1 -1
- package/dist/components/Radio.mjs +1 -1
- package/dist/components/Rate.d.mts +1 -1
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/Result.d.mts +1 -1
- package/dist/components/RichTextEditor.d.mts +4 -4
- package/dist/components/Row.d.mts +1 -1
- package/dist/components/ScatterChart.d.mts +3 -3
- package/dist/components/ScatterChart.mjs +5 -4
- package/dist/components/ScrollArea.d.mts +136 -0
- package/dist/components/ScrollArea.mjs +8 -0
- package/dist/components/ScrollSpy.d.mts +2 -2
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Segmented.d.mts +2 -2
- package/dist/components/Select.d.mts +3 -3
- package/dist/components/Signature.d.mts +6 -6
- package/dist/components/Signature.mjs +1 -1
- package/dist/components/Skeleton.d.mts +2 -2
- package/dist/components/Slider.d.mts +19 -1
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Space.d.mts +2 -2
- package/dist/components/SplitButton.d.mts +286 -0
- package/dist/components/SplitButton.mjs +12 -0
- package/dist/components/Splitter.d.mts +4 -4
- package/dist/components/Splitter.mjs +1 -1
- package/dist/components/Spotlight.d.mts +6 -6
- package/dist/components/Statistic.d.mts +1 -1
- package/dist/components/Stepper.d.mts +7 -1
- package/dist/components/Stepper.mjs +1 -1
- package/dist/components/Steps.d.mts +1 -1
- package/dist/components/SunburstChart.d.mts +2 -2
- package/dist/components/SunburstChart.mjs +4 -4
- package/dist/components/Switch.d.mts +22 -6
- package/dist/components/Switch.mjs +1 -1
- package/dist/components/Table.d.mts +9 -9
- package/dist/components/Table.mjs +3 -3
- package/dist/components/Tabs.d.mts +5 -5
- package/dist/components/Tag.d.mts +3 -3
- package/dist/components/TagsInput.d.mts +214 -0
- package/dist/components/TagsInput.mjs +12 -0
- package/dist/components/TaskBoard.d.mts +2 -2
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/Text.d.mts +3 -3
- package/dist/components/Textarea.d.mts +4 -4
- package/dist/components/Textarea.mjs +1 -1
- package/dist/components/TimePicker.d.mts +6 -6
- package/dist/components/Timeline.d.mts +2 -2
- package/dist/components/Tooltip.d.mts +2 -2
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/components/Tour.d.mts +4 -4
- package/dist/components/Tour.mjs +1 -1
- package/dist/components/Transfer.d.mts +5 -4
- package/dist/components/Transfer.mjs +1 -1
- package/dist/components/Tree.d.mts +6 -6
- package/dist/components/TreeMapChart.d.mts +3 -3
- package/dist/components/TreeMapChart.mjs +4 -4
- package/dist/components/TreeSelect.d.mts +54 -3
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/components/Upload.d.mts +4 -4
- package/dist/components/Upload.mjs +1 -1
- package/dist/components/VirtualTable.d.mts +5 -5
- package/dist/components/Watermark.d.mts +6 -6
- package/dist/composables/useChartInteraction.d.mts +5 -0
- package/dist/composables/useChartInteraction.mjs +1 -1
- package/dist/index.d.mts +17 -1
- package/dist/index.mjs +406 -0
- package/package.json +117 -2
- package/dist/chunk-OTGGPXDT.mjs +0 -433
- package/dist/chunk-WC5MKASU.mjs +0 -393
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useResponsiveChartSize
|
|
3
|
+
} from "./chunk-UEGNXN5B.mjs";
|
|
1
4
|
import {
|
|
2
5
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FHUGOSEY.mjs";
|
|
7
|
+
import {
|
|
8
|
+
ChartSeries
|
|
9
|
+
} from "./chunk-2ZUEXCVJ.mjs";
|
|
4
10
|
import {
|
|
5
11
|
ChartTooltip
|
|
6
12
|
} from "./chunk-SPFL55TF.mjs";
|
|
@@ -9,16 +15,13 @@ import {
|
|
|
9
15
|
} from "./chunk-ZWVA7HT3.mjs";
|
|
10
16
|
import {
|
|
11
17
|
ChartCanvas
|
|
12
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SNNT64HK.mjs";
|
|
13
19
|
import {
|
|
14
20
|
ChartGrid
|
|
15
21
|
} from "./chunk-MI6TL3CQ.mjs";
|
|
16
22
|
import {
|
|
17
23
|
ChartLegend
|
|
18
24
|
} from "./chunk-V443QIJM.mjs";
|
|
19
|
-
import {
|
|
20
|
-
ChartSeries
|
|
21
|
-
} from "./chunk-2ZUEXCVJ.mjs";
|
|
22
25
|
|
|
23
26
|
// src/components/BarChart.ts
|
|
24
27
|
import { defineComponent, computed, h, useId } from "vue";
|
|
@@ -30,7 +33,6 @@ import {
|
|
|
30
33
|
ensureBarMinHeight,
|
|
31
34
|
getStableChartGradientPrefix,
|
|
32
35
|
getBarValueLabelY,
|
|
33
|
-
getChartInnerRect,
|
|
34
36
|
getNumberExtent,
|
|
35
37
|
resolveChartPalette,
|
|
36
38
|
buildChartLegendItems,
|
|
@@ -245,6 +247,7 @@ var BarChart = defineComponent({
|
|
|
245
247
|
wrapperClasses
|
|
246
248
|
} = useChartInteraction({
|
|
247
249
|
hoverable: computed(() => props.hoverable),
|
|
250
|
+
showTooltip: computed(() => props.showTooltip),
|
|
248
251
|
hoveredIndexProp: () => props.hoveredIndex,
|
|
249
252
|
selectable: computed(() => props.selectable),
|
|
250
253
|
selectedIndexProp: () => props.selectedIndex,
|
|
@@ -255,7 +258,12 @@ var BarChart = defineComponent({
|
|
|
255
258
|
getData: (index) => props.data[index],
|
|
256
259
|
eventNames: { hover: "bar-hover", click: "bar-click" }
|
|
257
260
|
});
|
|
258
|
-
const innerRect
|
|
261
|
+
const { innerRect, onResolvedSizeChange } = useResponsiveChartSize(
|
|
262
|
+
() => props.width,
|
|
263
|
+
() => props.height,
|
|
264
|
+
() => props.padding,
|
|
265
|
+
() => props.responsive
|
|
266
|
+
);
|
|
259
267
|
const xDomain = computed(() => props.data.map((item) => String(item.x)));
|
|
260
268
|
const yValues = computed(() => props.data.map((item) => item.y));
|
|
261
269
|
const resolvedXScale = computed(() => {
|
|
@@ -379,7 +387,8 @@ var BarChart = defineComponent({
|
|
|
379
387
|
responsive: props.responsive,
|
|
380
388
|
title: props.title,
|
|
381
389
|
desc: props.desc,
|
|
382
|
-
className: classNames(props.className)
|
|
390
|
+
className: classNames(props.className),
|
|
391
|
+
onResolvedSizeChange
|
|
383
392
|
},
|
|
384
393
|
{
|
|
385
394
|
default: () => [
|
|
@@ -452,7 +461,7 @@ var BarChart = defineComponent({
|
|
|
452
461
|
].filter(Boolean)
|
|
453
462
|
}
|
|
454
463
|
);
|
|
455
|
-
const tooltip = props.showTooltip
|
|
464
|
+
const tooltip = props.showTooltip ? h(ChartTooltip, {
|
|
456
465
|
content: tooltipContent.value,
|
|
457
466
|
open: resolvedHoveredIndex.value !== null && tooltipContent.value !== "",
|
|
458
467
|
x: tooltipPosition.value.x,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHUGOSEY.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ChartSeries
|
|
6
|
+
} from "./chunk-2ZUEXCVJ.mjs";
|
|
4
7
|
import {
|
|
5
8
|
ChartTooltip
|
|
6
9
|
} from "./chunk-SPFL55TF.mjs";
|
|
7
10
|
import {
|
|
8
11
|
ChartCanvas
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SNNT64HK.mjs";
|
|
10
13
|
import {
|
|
11
14
|
ChartLegend
|
|
12
15
|
} from "./chunk-V443QIJM.mjs";
|
|
13
|
-
import {
|
|
14
|
-
ChartSeries
|
|
15
|
-
} from "./chunk-2ZUEXCVJ.mjs";
|
|
16
16
|
|
|
17
17
|
// src/components/RadarChart.ts
|
|
18
18
|
import { defineComponent, computed, h, ref, useId } from "vue";
|
|
@@ -20,7 +20,9 @@ import {
|
|
|
20
20
|
chartAxisTickTextClasses,
|
|
21
21
|
chartGridLineClasses,
|
|
22
22
|
classNames,
|
|
23
|
+
createCircleRingPath,
|
|
23
24
|
createPolygonPath,
|
|
25
|
+
createPolygonRingPath,
|
|
24
26
|
getChartGridLineDasharray,
|
|
25
27
|
getChartInnerRect,
|
|
26
28
|
getRadarAngles,
|
|
@@ -269,6 +271,7 @@ var RadarChart = defineComponent({
|
|
|
269
271
|
wrapperClasses
|
|
270
272
|
} = useChartInteraction({
|
|
271
273
|
hoverable: computed(() => props.hoverable),
|
|
274
|
+
showTooltip: computed(() => props.showTooltip),
|
|
272
275
|
hoveredIndexProp: () => props.hoveredIndex,
|
|
273
276
|
selectable: computed(() => props.selectable),
|
|
274
277
|
selectedIndexProp: () => props.selectedIndex,
|
|
@@ -284,7 +287,7 @@ var RadarChart = defineComponent({
|
|
|
284
287
|
});
|
|
285
288
|
const hoveredPoint = ref(null);
|
|
286
289
|
const handlePointEnter = (seriesIndex, pointIndex, event) => {
|
|
287
|
-
if (!props.hoverable) return;
|
|
290
|
+
if (!props.hoverable && !props.showTooltip) return;
|
|
288
291
|
hoveredPoint.value = { seriesIndex, pointIndex };
|
|
289
292
|
handleHoverEnter(seriesIndex, event);
|
|
290
293
|
};
|
|
@@ -547,43 +550,36 @@ var RadarChart = defineComponent({
|
|
|
547
550
|
);
|
|
548
551
|
}) : []
|
|
549
552
|
]) : null,
|
|
550
|
-
// Split area (alternating fills –
|
|
553
|
+
// Split area (alternating fills – evenodd ring, transparent inner)
|
|
551
554
|
...splitAreaPaths.value.map((area, index) => {
|
|
555
|
+
const shared = {
|
|
556
|
+
key: `split-${index}`,
|
|
557
|
+
fill: area.color,
|
|
558
|
+
"fill-opacity": props.splitAreaOpacity,
|
|
559
|
+
stroke: "none",
|
|
560
|
+
"data-radar-split-area": "true"
|
|
561
|
+
};
|
|
552
562
|
if (area.type === "circle-ring") {
|
|
553
|
-
|
|
554
|
-
h("
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
area.
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
]);
|
|
563
|
+
if (area.innerRadius > 0) {
|
|
564
|
+
return h("path", {
|
|
565
|
+
...shared,
|
|
566
|
+
d: createCircleRingPath(area.cx, area.cy, area.outerRadius, area.innerRadius),
|
|
567
|
+
"fill-rule": "evenodd"
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
return h("circle", {
|
|
571
|
+
...shared,
|
|
572
|
+
cx: area.cx,
|
|
573
|
+
cy: area.cy,
|
|
574
|
+
r: area.outerRadius
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
if (area.innerPoints.length > 0) {
|
|
578
|
+
const d2 = createPolygonRingPath(area.outerPoints, area.innerPoints);
|
|
579
|
+
return d2 ? h("path", { ...shared, d: d2, "fill-rule": "evenodd" }) : null;
|
|
571
580
|
}
|
|
572
|
-
const
|
|
573
|
-
return h("
|
|
574
|
-
outerPath ? h("path", {
|
|
575
|
-
d: outerPath,
|
|
576
|
-
fill: area.color,
|
|
577
|
-
"fill-opacity": props.splitAreaOpacity,
|
|
578
|
-
stroke: "none",
|
|
579
|
-
"data-radar-split-area": "true"
|
|
580
|
-
}) : null,
|
|
581
|
-
area.innerPoints.length > 0 ? h("path", {
|
|
582
|
-
d: createPolygonPath(area.innerPoints),
|
|
583
|
-
fill: "var(--tiger-bg,#fff)",
|
|
584
|
-
stroke: "none"
|
|
585
|
-
}) : null
|
|
586
|
-
]);
|
|
581
|
+
const d = createPolygonPath(area.outerPoints);
|
|
582
|
+
return d ? h("path", { ...shared, d }) : null;
|
|
587
583
|
}),
|
|
588
584
|
// Grid lines
|
|
589
585
|
...gridPaths.value.map(
|
|
@@ -694,9 +690,9 @@ var RadarChart = defineComponent({
|
|
|
694
690
|
"data-series-index": seriesIndex,
|
|
695
691
|
"data-series-key": item.seriesKey,
|
|
696
692
|
"data-point-index": point.index,
|
|
697
|
-
onMouseenter: props.showTooltip
|
|
698
|
-
onMousemove: props.showTooltip
|
|
699
|
-
onMouseleave: props.showTooltip
|
|
693
|
+
onMouseenter: props.showTooltip || props.hoverable ? (e) => handlePointEnter(seriesIndex, point.index, e) : void 0,
|
|
694
|
+
onMousemove: props.showTooltip || props.hoverable ? handlePointMove : void 0,
|
|
695
|
+
onMouseleave: props.showTooltip || props.hoverable ? handlePointLeave : void 0,
|
|
700
696
|
onFocus: props.showTooltip && props.hoverable ? (e) => showPointTooltipFromElement(
|
|
701
697
|
e.currentTarget,
|
|
702
698
|
seriesIndex,
|
|
@@ -753,7 +749,7 @@ var RadarChart = defineComponent({
|
|
|
753
749
|
].filter(Boolean)
|
|
754
750
|
}
|
|
755
751
|
);
|
|
756
|
-
const tooltip = props.showTooltip
|
|
752
|
+
const tooltip = props.showTooltip ? h(ChartTooltip, {
|
|
757
753
|
content: tooltipContent.value,
|
|
758
754
|
open: hoveredPoint.value !== null && tooltipContent.value !== "",
|
|
759
755
|
x: tooltipPosition.value.x,
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
getPageRange,
|
|
20
20
|
validateCurrentPage,
|
|
21
21
|
getPageNumbers,
|
|
22
|
-
defaultTotalText,
|
|
23
22
|
formatPaginationTotal,
|
|
24
23
|
getPaginationContainerClasses,
|
|
25
24
|
getPaginationButtonBaseClasses,
|
|
@@ -357,7 +356,7 @@ var Pagination = defineComponent({
|
|
|
357
356
|
const prevDisabled = page <= 1 || props.disabled;
|
|
358
357
|
const nextDisabled = page >= pages || props.disabled;
|
|
359
358
|
if (props.showTotal) {
|
|
360
|
-
const totalTextFn = props.totalText || (
|
|
359
|
+
const totalTextFn = props.totalText || ((value, range) => formatPaginationTotal(labels.value.totalText, value, range, localeCode.value));
|
|
361
360
|
elements.push(
|
|
362
361
|
h("span", { class: getTotalTextClasses(size) }, totalTextFn(props.total, pageRange.value))
|
|
363
362
|
);
|
|
@@ -102,6 +102,9 @@ var CollapsePanel = defineComponent({
|
|
|
102
102
|
collapseContext.handlePanelClick(props.panelKey);
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
+
const handleExtraClick = (event) => {
|
|
106
|
+
event.stopPropagation();
|
|
107
|
+
};
|
|
105
108
|
const handleKeydown = (event) => {
|
|
106
109
|
if (props.disabled) {
|
|
107
110
|
return;
|
|
@@ -163,7 +166,16 @@ var CollapsePanel = defineComponent({
|
|
|
163
166
|
)
|
|
164
167
|
);
|
|
165
168
|
if (extraSlot) {
|
|
166
|
-
headerContent.push(
|
|
169
|
+
headerContent.push(
|
|
170
|
+
h(
|
|
171
|
+
"span",
|
|
172
|
+
{
|
|
173
|
+
class: "ml-auto",
|
|
174
|
+
onClick: handleExtraClick
|
|
175
|
+
},
|
|
176
|
+
extraSlot
|
|
177
|
+
)
|
|
178
|
+
);
|
|
167
179
|
}
|
|
168
180
|
if (props.showArrow && collapseContext.expandIconPosition === "end") {
|
|
169
181
|
headerContent.push(arrowIcon);
|
|
@@ -187,7 +199,11 @@ var CollapsePanel = defineComponent({
|
|
|
187
199
|
ref: contentRef,
|
|
188
200
|
"data-tiger-collapse-content": "",
|
|
189
201
|
class: collapsePanelContentWrapperClasses,
|
|
190
|
-
style: initialContentStyle
|
|
202
|
+
style: initialContentStyle,
|
|
203
|
+
...isActive.value ? {} : {
|
|
204
|
+
inert: true,
|
|
205
|
+
"aria-hidden": "true"
|
|
206
|
+
}
|
|
191
207
|
},
|
|
192
208
|
[
|
|
193
209
|
h(
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/components/AspectRatio.ts
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
classNames,
|
|
5
|
+
coerceClassValue,
|
|
6
|
+
mergeStyleValues,
|
|
7
|
+
getAspectRatioContentClasses,
|
|
8
|
+
getAspectRatioRootClasses,
|
|
9
|
+
getAspectRatioStyle,
|
|
10
|
+
ASPECT_RATIO_DEFAULT
|
|
11
|
+
} from "@expcat/tigercat-core";
|
|
12
|
+
var AspectRatio = defineComponent({
|
|
13
|
+
name: "TigerAspectRatio",
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
props: {
|
|
16
|
+
ratio: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
default: ASPECT_RATIO_DEFAULT
|
|
19
|
+
},
|
|
20
|
+
className: { type: String, default: void 0 },
|
|
21
|
+
contentClassName: { type: String, default: void 0 }
|
|
22
|
+
},
|
|
23
|
+
setup(props, { slots, attrs }) {
|
|
24
|
+
return () => h(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
...attrs,
|
|
28
|
+
class: classNames(
|
|
29
|
+
getAspectRatioRootClasses(),
|
|
30
|
+
props.className,
|
|
31
|
+
coerceClassValue(attrs.class)
|
|
32
|
+
),
|
|
33
|
+
style: mergeStyleValues(getAspectRatioStyle(props.ratio), attrs.style),
|
|
34
|
+
"data-aspect-ratio": ""
|
|
35
|
+
},
|
|
36
|
+
[
|
|
37
|
+
h(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
class: classNames(getAspectRatioContentClasses(), props.contentClassName),
|
|
41
|
+
"data-aspect-ratio-content": ""
|
|
42
|
+
},
|
|
43
|
+
slots.default?.()
|
|
44
|
+
)
|
|
45
|
+
]
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
var AspectRatio_default = AspectRatio;
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
AspectRatio,
|
|
53
|
+
AspectRatio_default
|
|
54
|
+
};
|
|
@@ -3,7 +3,15 @@ import {
|
|
|
3
3
|
} from "./chunk-UOJOJBEU.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/Signature.ts
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
computed,
|
|
8
|
+
defineComponent,
|
|
9
|
+
h,
|
|
10
|
+
onMounted,
|
|
11
|
+
onUnmounted,
|
|
12
|
+
ref,
|
|
13
|
+
watch
|
|
14
|
+
} from "vue";
|
|
7
15
|
import {
|
|
8
16
|
classNames,
|
|
9
17
|
clampSignatureLineWidth,
|
|
@@ -61,8 +69,10 @@ var Signature = defineComponent({
|
|
|
61
69
|
const canvasRef = ref(null);
|
|
62
70
|
const strokes = ref([]);
|
|
63
71
|
const activeStroke = ref(null);
|
|
72
|
+
const capturedPointerId = ref(null);
|
|
64
73
|
const isDisabled = computed(() => props.disabled || props.readonly);
|
|
65
74
|
const normalizedLineWidth = computed(() => clampSignatureLineWidth(props.lineWidth));
|
|
75
|
+
let documentPointerListening = false;
|
|
66
76
|
const draw = (nextStrokes) => {
|
|
67
77
|
const canvas = canvasRef.value;
|
|
68
78
|
const context = canvas?.getContext("2d");
|
|
@@ -90,6 +100,8 @@ var Signature = defineComponent({
|
|
|
90
100
|
if (value === "" && !isSignatureEmpty(strokes.value)) {
|
|
91
101
|
strokes.value = [];
|
|
92
102
|
activeStroke.value = null;
|
|
103
|
+
detachDocumentPointerListeners();
|
|
104
|
+
releaseCanvasPointer();
|
|
93
105
|
draw([]);
|
|
94
106
|
}
|
|
95
107
|
}
|
|
@@ -130,6 +142,8 @@ var Signature = defineComponent({
|
|
|
130
142
|
const clear = () => {
|
|
131
143
|
strokes.value = [];
|
|
132
144
|
activeStroke.value = null;
|
|
145
|
+
detachDocumentPointerListeners();
|
|
146
|
+
releaseCanvasPointer();
|
|
133
147
|
draw([]);
|
|
134
148
|
emitChange([]);
|
|
135
149
|
emit("clear");
|
|
@@ -144,10 +158,55 @@ var Signature = defineComponent({
|
|
|
144
158
|
};
|
|
145
159
|
return getSignaturePoint(event.clientX, event.clientY, rect, props.width, props.height);
|
|
146
160
|
};
|
|
161
|
+
const captureCanvasPointer = (pointerId) => {
|
|
162
|
+
capturedPointerId.value = pointerId;
|
|
163
|
+
const canvas = canvasRef.value;
|
|
164
|
+
if (!canvas || typeof canvas.setPointerCapture !== "function") return;
|
|
165
|
+
try {
|
|
166
|
+
canvas.setPointerCapture(pointerId);
|
|
167
|
+
} catch {
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const releaseCanvasPointer = () => {
|
|
171
|
+
const canvas = canvasRef.value;
|
|
172
|
+
const pointerId = capturedPointerId.value;
|
|
173
|
+
capturedPointerId.value = null;
|
|
174
|
+
if (!canvas || pointerId == null || typeof canvas.releasePointerCapture !== "function") return;
|
|
175
|
+
if (typeof canvas.hasPointerCapture === "function") {
|
|
176
|
+
try {
|
|
177
|
+
if (!canvas.hasPointerCapture(pointerId)) return;
|
|
178
|
+
} catch {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
canvas.releasePointerCapture(pointerId);
|
|
184
|
+
} catch {
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const handleDocumentPointerEnd = () => {
|
|
188
|
+
finishStroke();
|
|
189
|
+
};
|
|
190
|
+
const attachDocumentPointerListeners = () => {
|
|
191
|
+
if (documentPointerListening || !isBrowser()) return;
|
|
192
|
+
document.addEventListener("pointerup", handleDocumentPointerEnd);
|
|
193
|
+
document.addEventListener("pointercancel", handleDocumentPointerEnd);
|
|
194
|
+
documentPointerListening = true;
|
|
195
|
+
};
|
|
196
|
+
const detachDocumentPointerListeners = () => {
|
|
197
|
+
if (!documentPointerListening || !isBrowser()) return;
|
|
198
|
+
document.removeEventListener("pointerup", handleDocumentPointerEnd);
|
|
199
|
+
document.removeEventListener("pointercancel", handleDocumentPointerEnd);
|
|
200
|
+
documentPointerListening = false;
|
|
201
|
+
};
|
|
147
202
|
const handlePointerDown = (event) => {
|
|
148
203
|
if (isDisabled.value) return;
|
|
149
204
|
event.preventDefault();
|
|
150
205
|
canvasRef.value?.focus();
|
|
206
|
+
const pointerId = event.pointerId;
|
|
207
|
+
if (typeof pointerId === "number") {
|
|
208
|
+
captureCanvasPointer(pointerId);
|
|
209
|
+
}
|
|
151
210
|
const stroke = {
|
|
152
211
|
color: props.penColor,
|
|
153
212
|
lineWidth: normalizedLineWidth.value,
|
|
@@ -155,6 +214,7 @@ var Signature = defineComponent({
|
|
|
155
214
|
};
|
|
156
215
|
activeStroke.value = stroke;
|
|
157
216
|
strokes.value = [...strokes.value, stroke];
|
|
217
|
+
attachDocumentPointerListeners();
|
|
158
218
|
emit("begin");
|
|
159
219
|
};
|
|
160
220
|
const handlePointerMove = (event) => {
|
|
@@ -163,12 +223,18 @@ var Signature = defineComponent({
|
|
|
163
223
|
activeStroke.value.points.push(getPointFromEvent(event));
|
|
164
224
|
strokes.value = [...strokes.value];
|
|
165
225
|
};
|
|
166
|
-
|
|
226
|
+
function finishStroke() {
|
|
167
227
|
if (!activeStroke.value) return;
|
|
168
228
|
activeStroke.value = null;
|
|
169
229
|
const payload = emitChange(strokes.value);
|
|
170
230
|
emit("end", payload);
|
|
171
|
-
|
|
231
|
+
detachDocumentPointerListeners();
|
|
232
|
+
releaseCanvasPointer();
|
|
233
|
+
}
|
|
234
|
+
onUnmounted(() => {
|
|
235
|
+
detachDocumentPointerListeners();
|
|
236
|
+
releaseCanvasPointer();
|
|
237
|
+
});
|
|
172
238
|
const handleKeyDown = (event) => {
|
|
173
239
|
if (!props.clearable || isDisabled.value) return;
|
|
174
240
|
if (event.key !== "Delete" && event.key !== "Backspace") return;
|
|
@@ -213,6 +279,7 @@ var Signature = defineComponent({
|
|
|
213
279
|
onPointermove: handlePointerMove,
|
|
214
280
|
onPointerup: finishStroke,
|
|
215
281
|
onPointercancel: finishStroke,
|
|
282
|
+
onLostpointercapture: finishStroke,
|
|
216
283
|
onKeydown: handleKeyDown
|
|
217
284
|
})
|
|
218
285
|
]),
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/components/LoadingBarRoot.ts
|
|
2
|
+
var loadingBarModulePromise = null;
|
|
3
|
+
var pendingCommands = [];
|
|
4
|
+
var resolvedApi = null;
|
|
5
|
+
function loadLoadingBarModule() {
|
|
6
|
+
loadingBarModulePromise ??= import("./components/LoadingBar.mjs");
|
|
7
|
+
return loadingBarModulePromise;
|
|
8
|
+
}
|
|
9
|
+
function applyCommand(api, command) {
|
|
10
|
+
if (command.type === "start") {
|
|
11
|
+
api.start(command.options);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
api[command.type]();
|
|
15
|
+
}
|
|
16
|
+
function enqueue(command) {
|
|
17
|
+
if (resolvedApi) {
|
|
18
|
+
applyCommand(resolvedApi, command);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
pendingCommands.push(command);
|
|
22
|
+
void loadLoadingBarModule().then(({ LoadingBar: LoadingBar2 }) => {
|
|
23
|
+
resolvedApi = LoadingBar2;
|
|
24
|
+
const queue = pendingCommands;
|
|
25
|
+
pendingCommands = [];
|
|
26
|
+
for (const item of queue) {
|
|
27
|
+
applyCommand(LoadingBar2, item);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
var LoadingBar = {
|
|
32
|
+
start(options) {
|
|
33
|
+
enqueue({ type: "start", options });
|
|
34
|
+
},
|
|
35
|
+
finish() {
|
|
36
|
+
enqueue({ type: "finish" });
|
|
37
|
+
},
|
|
38
|
+
error() {
|
|
39
|
+
enqueue({ type: "error" });
|
|
40
|
+
},
|
|
41
|
+
clear() {
|
|
42
|
+
enqueue({ type: "clear" });
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
LoadingBar
|
|
48
|
+
};
|
|
@@ -101,6 +101,15 @@ var DropdownItem = defineComponent({
|
|
|
101
101
|
type: Boolean,
|
|
102
102
|
default: false
|
|
103
103
|
},
|
|
104
|
+
/**
|
|
105
|
+
* When set, overrides the parent Dropdown `closeOnClick`.
|
|
106
|
+
* Omitted inherits the parent. Must default to undefined (not false): a
|
|
107
|
+
* bare Boolean would coerce omitted to false and break parent inheritance.
|
|
108
|
+
*/
|
|
109
|
+
closeOnClick: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: void 0
|
|
112
|
+
},
|
|
104
113
|
/**
|
|
105
114
|
* Additional CSS classes
|
|
106
115
|
*/
|
|
@@ -125,8 +134,9 @@ var DropdownItem = defineComponent({
|
|
|
125
134
|
return;
|
|
126
135
|
}
|
|
127
136
|
emit("click", event);
|
|
128
|
-
|
|
129
|
-
|
|
137
|
+
const shouldClose = props.closeOnClick ?? context?.closeOnClick ?? true;
|
|
138
|
+
if (shouldClose) {
|
|
139
|
+
context?.handleItemClick();
|
|
130
140
|
}
|
|
131
141
|
};
|
|
132
142
|
const itemClasses = computed(() => {
|
|
@@ -286,7 +296,7 @@ var Dropdown = defineComponent({
|
|
|
286
296
|
}
|
|
287
297
|
};
|
|
288
298
|
const handleItemClick = () => {
|
|
289
|
-
|
|
299
|
+
setVisible(false);
|
|
290
300
|
};
|
|
291
301
|
let hoverTimer = null;
|
|
292
302
|
const handleMouseEnter = () => {
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-Q7Y22OFX.mjs";
|
|
4
4
|
|
|
5
5
|
// src/utils/use-floating-popup.ts
|
|
6
|
-
import { computed, ref, watch } from "vue";
|
|
6
|
+
import { computed, onBeforeUnmount, ref, watch } from "vue";
|
|
7
7
|
import {
|
|
8
8
|
buildTriggerHandlerMap,
|
|
9
|
+
createFloatingHoverDelayController,
|
|
9
10
|
restoreFocus
|
|
10
11
|
} from "@expcat/tigercat-core";
|
|
11
12
|
function useFloatingPopup(options) {
|
|
@@ -27,6 +28,10 @@ function useFloatingPopup(options) {
|
|
|
27
28
|
emit("update:open", next);
|
|
28
29
|
emit("open-change", next);
|
|
29
30
|
};
|
|
31
|
+
const hoverController = createFloatingHoverDelayController({
|
|
32
|
+
show: () => setVisible(true),
|
|
33
|
+
hide: () => setVisible(false)
|
|
34
|
+
});
|
|
30
35
|
const containerRef = ref(null);
|
|
31
36
|
const triggerRef = ref(null);
|
|
32
37
|
const floatingRef = ref(null);
|
|
@@ -40,7 +45,7 @@ function useFloatingPopup(options) {
|
|
|
40
45
|
}, 0);
|
|
41
46
|
};
|
|
42
47
|
const closeAndRestoreFocus = () => {
|
|
43
|
-
|
|
48
|
+
hoverController.closeNow();
|
|
44
49
|
restoreTriggerFocus();
|
|
45
50
|
};
|
|
46
51
|
const effectiveTrigger = computed(
|
|
@@ -59,21 +64,52 @@ function useFloatingPopup(options) {
|
|
|
59
64
|
if (reason === "escape") {
|
|
60
65
|
closeAndRestoreFocus();
|
|
61
66
|
} else {
|
|
62
|
-
|
|
67
|
+
hoverController.closeNow();
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
});
|
|
66
71
|
const x = overlay.x;
|
|
67
72
|
const y = overlay.y;
|
|
68
73
|
const handleToggle = () => {
|
|
69
|
-
if (
|
|
74
|
+
if (props.disabled) return;
|
|
75
|
+
hoverController.cancel();
|
|
76
|
+
setVisible(!currentVisible.value);
|
|
70
77
|
};
|
|
71
78
|
const handleShow = () => {
|
|
72
|
-
if (
|
|
79
|
+
if (props.disabled) return;
|
|
80
|
+
if (effectiveTrigger.value === "hover") {
|
|
81
|
+
hoverController.enter();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
hoverController.cancel();
|
|
85
|
+
setVisible(true);
|
|
73
86
|
};
|
|
74
87
|
const handleHide = () => {
|
|
75
|
-
if (
|
|
88
|
+
if (props.disabled) return;
|
|
89
|
+
if (effectiveTrigger.value === "hover") {
|
|
90
|
+
hoverController.leave();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
hoverController.closeNow();
|
|
76
94
|
};
|
|
95
|
+
watch(
|
|
96
|
+
() => [floatingRef.value, currentVisible.value, effectiveTrigger.value],
|
|
97
|
+
([el, visible, trigger], _prev, onCleanup) => {
|
|
98
|
+
if (!multiTrigger || trigger !== "hover" || !visible || !el) return;
|
|
99
|
+
const handleEnter = () => hoverController.enter();
|
|
100
|
+
const handleLeave = () => hoverController.leave();
|
|
101
|
+
el.addEventListener("mouseenter", handleEnter);
|
|
102
|
+
el.addEventListener("mouseleave", handleLeave);
|
|
103
|
+
onCleanup(() => {
|
|
104
|
+
el.removeEventListener("mouseenter", handleEnter);
|
|
105
|
+
el.removeEventListener("mouseleave", handleLeave);
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
{ flush: "post", immediate: true }
|
|
109
|
+
);
|
|
110
|
+
onBeforeUnmount(() => {
|
|
111
|
+
hoverController.dispose();
|
|
112
|
+
});
|
|
77
113
|
const triggerHandlers = computed(() => {
|
|
78
114
|
if (!multiTrigger) {
|
|
79
115
|
return { onClick: handleToggle };
|