@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
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderVueOverlayTeleport,
|
|
3
|
+
useVueAnchoredOverlay
|
|
4
|
+
} from "./chunk-Q7Y22OFX.mjs";
|
|
5
|
+
|
|
6
|
+
// src/components/ContextMenu.ts
|
|
7
|
+
import {
|
|
8
|
+
defineComponent,
|
|
9
|
+
computed,
|
|
10
|
+
ref,
|
|
11
|
+
provide,
|
|
12
|
+
inject,
|
|
13
|
+
h,
|
|
14
|
+
onBeforeUnmount,
|
|
15
|
+
onMounted,
|
|
16
|
+
nextTick,
|
|
17
|
+
cloneVNode,
|
|
18
|
+
watch
|
|
19
|
+
} from "vue";
|
|
20
|
+
import {
|
|
21
|
+
classNames,
|
|
22
|
+
coerceClassValue,
|
|
23
|
+
mergeStyleValues,
|
|
24
|
+
getContextMenuContainerClasses,
|
|
25
|
+
getContextMenuTriggerClasses,
|
|
26
|
+
getContextMenuMenuClasses,
|
|
27
|
+
getContextMenuItemClasses,
|
|
28
|
+
getContextMenuSubTriggerClasses,
|
|
29
|
+
getContextMenuSubChevronClasses,
|
|
30
|
+
getContextMenuPointStyle,
|
|
31
|
+
getContextMenuOpenPoint,
|
|
32
|
+
injectContextMenuStyles,
|
|
33
|
+
CONTEXT_MENU_ENTER_CLASS,
|
|
34
|
+
CONTEXT_MENU_SUB_CHEVRON_PATH,
|
|
35
|
+
isContextMenuKeyboardEvent,
|
|
36
|
+
handleMenuNavigation,
|
|
37
|
+
focusFirstMenuItem,
|
|
38
|
+
captureActiveElement,
|
|
39
|
+
restoreFocus
|
|
40
|
+
} from "@expcat/tigercat-core";
|
|
41
|
+
var ContextMenuMenu = defineComponent({
|
|
42
|
+
name: "TigerContextMenuMenu",
|
|
43
|
+
inheritAttrs: false,
|
|
44
|
+
props: {
|
|
45
|
+
className: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: void 0
|
|
48
|
+
},
|
|
49
|
+
style: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: void 0
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
setup(props, { slots, attrs }) {
|
|
55
|
+
const attrsRecord = attrs;
|
|
56
|
+
const attrsClass = attrsRecord.class;
|
|
57
|
+
const attrsStyle = attrsRecord.style;
|
|
58
|
+
const menuClasses = computed(
|
|
59
|
+
() => classNames(getContextMenuMenuClasses(), props.className, coerceClassValue(attrsClass))
|
|
60
|
+
);
|
|
61
|
+
const mergedStyle = computed(() => mergeStyleValues(attrsStyle, props.style));
|
|
62
|
+
return () => {
|
|
63
|
+
const {
|
|
64
|
+
class: _class,
|
|
65
|
+
style: _style,
|
|
66
|
+
...restAttrs
|
|
67
|
+
} = attrsRecord;
|
|
68
|
+
return h(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
...restAttrs,
|
|
72
|
+
class: menuClasses.value,
|
|
73
|
+
role: "menu",
|
|
74
|
+
style: mergedStyle.value
|
|
75
|
+
},
|
|
76
|
+
slots.default?.()
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
var contextMenuIdCounter = 0;
|
|
82
|
+
var createContextMenuId = () => `tiger-context-menu-${++contextMenuIdCounter}`;
|
|
83
|
+
var ContextMenuContextKey = /* @__PURE__ */ Symbol("ContextMenuContext");
|
|
84
|
+
var ContextMenuItem = defineComponent({
|
|
85
|
+
name: "TigerContextMenuItem",
|
|
86
|
+
inheritAttrs: false,
|
|
87
|
+
props: {
|
|
88
|
+
disabled: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false
|
|
91
|
+
},
|
|
92
|
+
divided: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false
|
|
95
|
+
},
|
|
96
|
+
className: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: void 0
|
|
99
|
+
},
|
|
100
|
+
style: {
|
|
101
|
+
type: Object,
|
|
102
|
+
default: void 0
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
emits: ["click"],
|
|
106
|
+
setup(props, { slots, emit, attrs }) {
|
|
107
|
+
const attrsRecord = attrs;
|
|
108
|
+
const attrsClass = attrsRecord.class;
|
|
109
|
+
const attrsStyle = attrsRecord.style;
|
|
110
|
+
const context = inject(ContextMenuContextKey, null);
|
|
111
|
+
const handleClick = (event) => {
|
|
112
|
+
if (props.disabled) {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
emit("click", event);
|
|
117
|
+
if (context?.closeOnClick) {
|
|
118
|
+
context.handleItemClick();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const itemClasses = computed(
|
|
122
|
+
() => classNames(
|
|
123
|
+
getContextMenuItemClasses(props.disabled, props.divided),
|
|
124
|
+
props.className,
|
|
125
|
+
coerceClassValue(attrsClass)
|
|
126
|
+
)
|
|
127
|
+
);
|
|
128
|
+
const mergedStyle = computed(() => mergeStyleValues(attrsStyle, props.style));
|
|
129
|
+
return () => {
|
|
130
|
+
const {
|
|
131
|
+
class: _class,
|
|
132
|
+
style: _style,
|
|
133
|
+
...restAttrs
|
|
134
|
+
} = attrsRecord;
|
|
135
|
+
return h(
|
|
136
|
+
"button",
|
|
137
|
+
{
|
|
138
|
+
...restAttrs,
|
|
139
|
+
type: "button",
|
|
140
|
+
class: itemClasses.value,
|
|
141
|
+
role: "menuitem",
|
|
142
|
+
tabindex: -1,
|
|
143
|
+
"aria-disabled": props.disabled,
|
|
144
|
+
disabled: props.disabled,
|
|
145
|
+
onClick: handleClick,
|
|
146
|
+
style: mergedStyle.value
|
|
147
|
+
},
|
|
148
|
+
slots.default?.()
|
|
149
|
+
);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
var ContextMenuSub = defineComponent({
|
|
154
|
+
name: "TigerContextMenuSub",
|
|
155
|
+
inheritAttrs: false,
|
|
156
|
+
props: {
|
|
157
|
+
itemKey: {
|
|
158
|
+
type: [String, Number],
|
|
159
|
+
default: void 0
|
|
160
|
+
},
|
|
161
|
+
title: {
|
|
162
|
+
type: String,
|
|
163
|
+
default: ""
|
|
164
|
+
},
|
|
165
|
+
disabled: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: false
|
|
168
|
+
},
|
|
169
|
+
className: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: void 0
|
|
172
|
+
},
|
|
173
|
+
style: {
|
|
174
|
+
type: Object,
|
|
175
|
+
default: void 0
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
setup(props, { slots, attrs }) {
|
|
179
|
+
const attrsRecord = attrs;
|
|
180
|
+
const attrsClass = attrsRecord.class;
|
|
181
|
+
const attrsStyle = attrsRecord.style;
|
|
182
|
+
const context = inject(ContextMenuContextKey, null);
|
|
183
|
+
const isHovered = ref(false);
|
|
184
|
+
const isOpenByKeyboard = ref(false);
|
|
185
|
+
const titleRef = ref(null);
|
|
186
|
+
const popupRef = ref(null);
|
|
187
|
+
let popupCloseTimer = null;
|
|
188
|
+
const isExpanded = computed(() => isHovered.value || isOpenByKeyboard.value);
|
|
189
|
+
const portalEnabled = computed(() => Boolean(context?.portal.value));
|
|
190
|
+
const overlay = useVueAnchoredOverlay({
|
|
191
|
+
referenceRef: titleRef,
|
|
192
|
+
floatingRef: popupRef,
|
|
193
|
+
enabled: computed(() => Boolean(context) && isExpanded.value && !props.disabled),
|
|
194
|
+
placement: "right-start",
|
|
195
|
+
offset: 4,
|
|
196
|
+
portal: portalEnabled,
|
|
197
|
+
dismissOnEscape: true,
|
|
198
|
+
onDismiss: () => {
|
|
199
|
+
isOpenByKeyboard.value = false;
|
|
200
|
+
isHovered.value = false;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
watch(
|
|
204
|
+
() => context?.visible.value,
|
|
205
|
+
(visible) => {
|
|
206
|
+
if (!visible) {
|
|
207
|
+
isHovered.value = false;
|
|
208
|
+
isOpenByKeyboard.value = false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
onBeforeUnmount(() => {
|
|
213
|
+
if (popupCloseTimer) clearTimeout(popupCloseTimer);
|
|
214
|
+
});
|
|
215
|
+
const clearCloseTimer = () => {
|
|
216
|
+
if (popupCloseTimer) {
|
|
217
|
+
clearTimeout(popupCloseTimer);
|
|
218
|
+
popupCloseTimer = null;
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const handleMouseEnter = () => {
|
|
222
|
+
if (props.disabled) return;
|
|
223
|
+
clearCloseTimer();
|
|
224
|
+
isHovered.value = true;
|
|
225
|
+
};
|
|
226
|
+
const handleMouseLeave = () => {
|
|
227
|
+
const close = () => {
|
|
228
|
+
isHovered.value = false;
|
|
229
|
+
isOpenByKeyboard.value = false;
|
|
230
|
+
};
|
|
231
|
+
if (portalEnabled.value) {
|
|
232
|
+
popupCloseTimer = setTimeout(close, 120);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
close();
|
|
236
|
+
};
|
|
237
|
+
const focusPopupFirstItem = () => {
|
|
238
|
+
nextTick(() => {
|
|
239
|
+
if (popupRef.value) focusFirstMenuItem(popupRef.value);
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
const handleTitleKeyDown = (event) => {
|
|
243
|
+
if (props.disabled) return;
|
|
244
|
+
if (event.key === "ArrowRight" || event.key === "Enter" || event.key === " ") {
|
|
245
|
+
event.preventDefault();
|
|
246
|
+
event.stopPropagation();
|
|
247
|
+
isOpenByKeyboard.value = true;
|
|
248
|
+
isHovered.value = true;
|
|
249
|
+
focusPopupFirstItem();
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (event.key === "ArrowLeft" || event.key === "Escape") {
|
|
253
|
+
if (isExpanded.value) {
|
|
254
|
+
event.preventDefault();
|
|
255
|
+
event.stopPropagation();
|
|
256
|
+
isOpenByKeyboard.value = false;
|
|
257
|
+
isHovered.value = false;
|
|
258
|
+
titleRef.value?.focus();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
const handlePopupKeyDown = (event) => {
|
|
263
|
+
if (popupRef.value) {
|
|
264
|
+
handleMenuNavigation(popupRef.value, event);
|
|
265
|
+
}
|
|
266
|
+
if (event.key === "ArrowLeft" || event.key === "Escape") {
|
|
267
|
+
event.preventDefault();
|
|
268
|
+
event.stopPropagation();
|
|
269
|
+
isOpenByKeyboard.value = false;
|
|
270
|
+
isHovered.value = false;
|
|
271
|
+
titleRef.value?.focus();
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
const handlePopupContextMenu = (event) => {
|
|
275
|
+
event.preventDefault();
|
|
276
|
+
};
|
|
277
|
+
const titleClasses = computed(
|
|
278
|
+
() => classNames(
|
|
279
|
+
getContextMenuSubTriggerClasses(props.disabled),
|
|
280
|
+
props.className,
|
|
281
|
+
coerceClassValue(attrsClass)
|
|
282
|
+
)
|
|
283
|
+
);
|
|
284
|
+
const mergedStyle = computed(() => mergeStyleValues(attrsStyle, props.style));
|
|
285
|
+
const popupClasses = computed(
|
|
286
|
+
() => classNames(overlay.floatingClasses.value, CONTEXT_MENU_ENTER_CLASS)
|
|
287
|
+
);
|
|
288
|
+
return () => {
|
|
289
|
+
if (!context) return null;
|
|
290
|
+
const {
|
|
291
|
+
class: _class,
|
|
292
|
+
style: _style,
|
|
293
|
+
...restAttrs
|
|
294
|
+
} = attrsRecord;
|
|
295
|
+
const trigger = h(
|
|
296
|
+
"button",
|
|
297
|
+
{
|
|
298
|
+
...restAttrs,
|
|
299
|
+
ref: titleRef,
|
|
300
|
+
type: "button",
|
|
301
|
+
class: titleClasses.value,
|
|
302
|
+
style: mergedStyle.value,
|
|
303
|
+
role: "menuitem",
|
|
304
|
+
tabindex: -1,
|
|
305
|
+
"aria-haspopup": "menu",
|
|
306
|
+
"aria-expanded": isExpanded.value,
|
|
307
|
+
"aria-disabled": props.disabled || void 0,
|
|
308
|
+
"data-state": isExpanded.value ? "open" : "closed",
|
|
309
|
+
"data-tiger-context-menu-sub-trigger": "",
|
|
310
|
+
disabled: props.disabled,
|
|
311
|
+
onClick: (event) => {
|
|
312
|
+
event.preventDefault();
|
|
313
|
+
event.stopPropagation();
|
|
314
|
+
},
|
|
315
|
+
onMouseenter: handleMouseEnter,
|
|
316
|
+
onKeydown: handleTitleKeyDown
|
|
317
|
+
},
|
|
318
|
+
[
|
|
319
|
+
h("span", { class: "flex-1 text-left" }, props.title),
|
|
320
|
+
h(
|
|
321
|
+
"svg",
|
|
322
|
+
{
|
|
323
|
+
class: getContextMenuSubChevronClasses(),
|
|
324
|
+
viewBox: "0 0 24 24",
|
|
325
|
+
fill: "none",
|
|
326
|
+
stroke: "currentColor",
|
|
327
|
+
"stroke-width": "2",
|
|
328
|
+
"stroke-linecap": "round",
|
|
329
|
+
"stroke-linejoin": "round",
|
|
330
|
+
"aria-hidden": "true"
|
|
331
|
+
},
|
|
332
|
+
[h("path", { d: CONTEXT_MENU_SUB_CHEVRON_PATH })]
|
|
333
|
+
)
|
|
334
|
+
]
|
|
335
|
+
);
|
|
336
|
+
const popup = h(
|
|
337
|
+
"div",
|
|
338
|
+
{
|
|
339
|
+
ref: popupRef,
|
|
340
|
+
class: popupClasses.value,
|
|
341
|
+
style: overlay.floatingStyles.value,
|
|
342
|
+
"data-positioned": overlay.positioned.value,
|
|
343
|
+
"data-tiger-context-menu-sub": "",
|
|
344
|
+
hidden: !isExpanded.value,
|
|
345
|
+
onMouseenter: handleMouseEnter,
|
|
346
|
+
onMouseleave: handleMouseLeave,
|
|
347
|
+
onKeydown: handlePopupKeyDown,
|
|
348
|
+
onContextmenu: handlePopupContextMenu
|
|
349
|
+
},
|
|
350
|
+
[
|
|
351
|
+
h(
|
|
352
|
+
"div",
|
|
353
|
+
{
|
|
354
|
+
class: getContextMenuMenuClasses(),
|
|
355
|
+
role: "menu"
|
|
356
|
+
},
|
|
357
|
+
slots.default?.()
|
|
358
|
+
)
|
|
359
|
+
]
|
|
360
|
+
);
|
|
361
|
+
return h(
|
|
362
|
+
"div",
|
|
363
|
+
{
|
|
364
|
+
class: portalEnabled.value ? void 0 : "relative",
|
|
365
|
+
onMouseenter: handleMouseEnter,
|
|
366
|
+
onMouseleave: handleMouseLeave,
|
|
367
|
+
role: "none"
|
|
368
|
+
},
|
|
369
|
+
[trigger, renderVueOverlayTeleport(popup, overlay.target.value, !portalEnabled.value)]
|
|
370
|
+
);
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
var ContextMenu = defineComponent({
|
|
375
|
+
name: "TigerContextMenu",
|
|
376
|
+
inheritAttrs: false,
|
|
377
|
+
props: {
|
|
378
|
+
disabled: {
|
|
379
|
+
type: Boolean,
|
|
380
|
+
default: false
|
|
381
|
+
},
|
|
382
|
+
open: {
|
|
383
|
+
type: Boolean,
|
|
384
|
+
default: void 0
|
|
385
|
+
},
|
|
386
|
+
defaultOpen: {
|
|
387
|
+
type: Boolean,
|
|
388
|
+
default: false
|
|
389
|
+
},
|
|
390
|
+
closeOnClick: {
|
|
391
|
+
type: Boolean,
|
|
392
|
+
default: true
|
|
393
|
+
},
|
|
394
|
+
portal: {
|
|
395
|
+
type: Boolean,
|
|
396
|
+
default: true
|
|
397
|
+
},
|
|
398
|
+
offset: {
|
|
399
|
+
type: Number,
|
|
400
|
+
default: 0
|
|
401
|
+
},
|
|
402
|
+
placement: {
|
|
403
|
+
type: String,
|
|
404
|
+
default: "bottom-start"
|
|
405
|
+
},
|
|
406
|
+
className: {
|
|
407
|
+
type: String,
|
|
408
|
+
default: void 0
|
|
409
|
+
},
|
|
410
|
+
style: {
|
|
411
|
+
type: Object,
|
|
412
|
+
default: void 0
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
emits: ["update:open", "open-change"],
|
|
416
|
+
setup(props, { slots, emit, attrs }) {
|
|
417
|
+
const attrsRecord = attrs;
|
|
418
|
+
const attrsClass = attrsRecord.class;
|
|
419
|
+
const attrsStyle = attrsRecord.style;
|
|
420
|
+
onMounted(() => {
|
|
421
|
+
injectContextMenuStyles();
|
|
422
|
+
if (currentVisible.value) ensurePoint();
|
|
423
|
+
});
|
|
424
|
+
const menuId = createContextMenuId();
|
|
425
|
+
const previousActiveElement = ref(null);
|
|
426
|
+
const internalVisible = ref(props.defaultOpen);
|
|
427
|
+
const currentVisible = computed(
|
|
428
|
+
() => props.open !== void 0 ? props.open : internalVisible.value
|
|
429
|
+
);
|
|
430
|
+
const containerRef = ref(null);
|
|
431
|
+
const triggerRef = ref(null);
|
|
432
|
+
const pointRef = ref(null);
|
|
433
|
+
const floatingRef = ref(null);
|
|
434
|
+
const point = ref({ x: 0, y: 0 });
|
|
435
|
+
const hasExplicitPoint = ref(false);
|
|
436
|
+
const setVisible = (visible) => {
|
|
437
|
+
if (props.disabled && visible) return;
|
|
438
|
+
if (visible && !currentVisible.value) {
|
|
439
|
+
previousActiveElement.value = captureActiveElement();
|
|
440
|
+
}
|
|
441
|
+
if (props.open === void 0) {
|
|
442
|
+
internalVisible.value = visible;
|
|
443
|
+
}
|
|
444
|
+
emit("update:open", visible);
|
|
445
|
+
emit("open-change", visible);
|
|
446
|
+
if (visible) {
|
|
447
|
+
nextTick(() => {
|
|
448
|
+
requestAnimationFrame(() => {
|
|
449
|
+
if (floatingRef.value) {
|
|
450
|
+
focusFirstMenuItem(floatingRef.value);
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
} else {
|
|
455
|
+
restoreFocus(previousActiveElement.value);
|
|
456
|
+
previousActiveElement.value = null;
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
const ensurePoint = () => {
|
|
460
|
+
if (hasExplicitPoint.value) return;
|
|
461
|
+
point.value = getContextMenuOpenPoint(null, triggerRef.value);
|
|
462
|
+
};
|
|
463
|
+
watch(
|
|
464
|
+
currentVisible,
|
|
465
|
+
(visible) => {
|
|
466
|
+
if (visible) ensurePoint();
|
|
467
|
+
},
|
|
468
|
+
{ immediate: true }
|
|
469
|
+
);
|
|
470
|
+
const handleItemClick = () => {
|
|
471
|
+
if (props.closeOnClick) setVisible(false);
|
|
472
|
+
};
|
|
473
|
+
const openAt = (next) => {
|
|
474
|
+
point.value = next;
|
|
475
|
+
hasExplicitPoint.value = true;
|
|
476
|
+
setVisible(true);
|
|
477
|
+
};
|
|
478
|
+
const handleContextMenu = (event) => {
|
|
479
|
+
if (props.disabled) return;
|
|
480
|
+
event.preventDefault();
|
|
481
|
+
event.stopPropagation();
|
|
482
|
+
openAt(getContextMenuOpenPoint(event, triggerRef.value));
|
|
483
|
+
};
|
|
484
|
+
const handleTriggerKeyDown = (event) => {
|
|
485
|
+
if (props.disabled || !isContextMenuKeyboardEvent(event)) return;
|
|
486
|
+
event.preventDefault();
|
|
487
|
+
openAt(getContextMenuOpenPoint(null, triggerRef.value));
|
|
488
|
+
};
|
|
489
|
+
const handleMenuKeyDown = (event) => {
|
|
490
|
+
if (floatingRef.value) {
|
|
491
|
+
handleMenuNavigation(floatingRef.value, event);
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
const handleMenuContextMenu = (event) => {
|
|
495
|
+
event.preventDefault();
|
|
496
|
+
};
|
|
497
|
+
const portalEnabled = computed(() => props.portal);
|
|
498
|
+
const overlay = useVueAnchoredOverlay({
|
|
499
|
+
referenceRef: pointRef,
|
|
500
|
+
floatingRef,
|
|
501
|
+
enabled: currentVisible,
|
|
502
|
+
placement: props.placement,
|
|
503
|
+
offset: props.offset,
|
|
504
|
+
portal: portalEnabled,
|
|
505
|
+
dismissOnOutside: true,
|
|
506
|
+
dismissOnEscape: true,
|
|
507
|
+
onDismiss: () => setVisible(false)
|
|
508
|
+
});
|
|
509
|
+
const containerClasses = computed(
|
|
510
|
+
() => classNames(getContextMenuContainerClasses(), props.className, coerceClassValue(attrsClass))
|
|
511
|
+
);
|
|
512
|
+
const mergedStyle = computed(() => mergeStyleValues(attrsStyle, props.style));
|
|
513
|
+
const triggerClasses = computed(() => getContextMenuTriggerClasses(props.disabled));
|
|
514
|
+
const menuWrapperClasses = computed(
|
|
515
|
+
() => classNames(overlay.floatingClasses.value, CONTEXT_MENU_ENTER_CLASS)
|
|
516
|
+
);
|
|
517
|
+
const pointStyle = computed(() => getContextMenuPointStyle(point.value));
|
|
518
|
+
const contextMenuContext = {
|
|
519
|
+
get closeOnClick() {
|
|
520
|
+
return props.closeOnClick;
|
|
521
|
+
},
|
|
522
|
+
handleItemClick,
|
|
523
|
+
portal: portalEnabled,
|
|
524
|
+
visible: currentVisible
|
|
525
|
+
};
|
|
526
|
+
provide(ContextMenuContextKey, contextMenuContext);
|
|
527
|
+
return () => {
|
|
528
|
+
const defaultSlot = slots.default?.() ?? [];
|
|
529
|
+
let triggerNodes = [];
|
|
530
|
+
let menuNode = null;
|
|
531
|
+
defaultSlot.forEach((node) => {
|
|
532
|
+
if (node.type === ContextMenuMenu) {
|
|
533
|
+
menuNode = node;
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
triggerNodes.push(node);
|
|
537
|
+
});
|
|
538
|
+
const trigger = h(
|
|
539
|
+
"div",
|
|
540
|
+
{
|
|
541
|
+
ref: triggerRef,
|
|
542
|
+
class: triggerClasses.value,
|
|
543
|
+
onContextmenu: handleContextMenu,
|
|
544
|
+
onKeydown: handleTriggerKeyDown,
|
|
545
|
+
"aria-haspopup": "menu",
|
|
546
|
+
"aria-expanded": currentVisible.value,
|
|
547
|
+
"aria-controls": currentVisible.value ? menuId : void 0,
|
|
548
|
+
"data-state": currentVisible.value ? "open" : "closed",
|
|
549
|
+
"data-tiger-context-menu-trigger": ""
|
|
550
|
+
},
|
|
551
|
+
triggerNodes
|
|
552
|
+
);
|
|
553
|
+
const pointNode = h("div", {
|
|
554
|
+
ref: pointRef,
|
|
555
|
+
style: pointStyle.value,
|
|
556
|
+
"aria-hidden": "true",
|
|
557
|
+
"data-tiger-context-menu-point": ""
|
|
558
|
+
});
|
|
559
|
+
const menuWrapper = menuNode ? h(
|
|
560
|
+
"div",
|
|
561
|
+
{
|
|
562
|
+
key: `${point.value.x},${point.value.y}`,
|
|
563
|
+
ref: floatingRef,
|
|
564
|
+
class: menuWrapperClasses.value,
|
|
565
|
+
style: overlay.floatingStyles.value,
|
|
566
|
+
"data-positioned": overlay.positioned.value,
|
|
567
|
+
"data-tiger-context-menu": "",
|
|
568
|
+
onKeydown: handleMenuKeyDown,
|
|
569
|
+
onContextmenu: handleMenuContextMenu,
|
|
570
|
+
hidden: !currentVisible.value
|
|
571
|
+
},
|
|
572
|
+
[cloneVNode(menuNode, { id: menuId })]
|
|
573
|
+
) : null;
|
|
574
|
+
const menu = menuWrapper ? renderVueOverlayTeleport(menuWrapper, overlay.target.value, !props.portal) : null;
|
|
575
|
+
const {
|
|
576
|
+
class: _class,
|
|
577
|
+
style: _style,
|
|
578
|
+
...restAttrs
|
|
579
|
+
} = attrsRecord;
|
|
580
|
+
return h(
|
|
581
|
+
"div",
|
|
582
|
+
{
|
|
583
|
+
...restAttrs,
|
|
584
|
+
ref: containerRef,
|
|
585
|
+
class: containerClasses.value,
|
|
586
|
+
style: mergedStyle.value
|
|
587
|
+
},
|
|
588
|
+
[trigger, pointNode, menu]
|
|
589
|
+
);
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
var ContextMenu_default = ContextMenu;
|
|
594
|
+
|
|
595
|
+
export {
|
|
596
|
+
ContextMenuMenu,
|
|
597
|
+
ContextMenuContextKey,
|
|
598
|
+
ContextMenuItem,
|
|
599
|
+
ContextMenuSub,
|
|
600
|
+
ContextMenu,
|
|
601
|
+
ContextMenu_default
|
|
602
|
+
};
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
getAutoCompleteInputClasses,
|
|
18
18
|
getAutoCompleteOptionClasses,
|
|
19
19
|
filterAutoCompleteOptions,
|
|
20
|
+
resolveAutoCompleteDisplayValue,
|
|
20
21
|
getInitialPickerActiveIndex,
|
|
21
22
|
getPickerComboboxAria,
|
|
22
23
|
getPickerListboxAria,
|
|
@@ -109,7 +110,7 @@ var AutoComplete = defineComponent({
|
|
|
109
110
|
const listboxId = `tiger-autocomplete-listbox-${instanceId}`;
|
|
110
111
|
const isOpen = ref(false);
|
|
111
112
|
const uncontrolledSearchValue = ref(
|
|
112
|
-
|
|
113
|
+
props.searchValue ?? resolveAutoCompleteDisplayValue(props.modelValue, props.options, props.defaultSearchValue)
|
|
113
114
|
);
|
|
114
115
|
const inputValue = computed(() => props.searchValue ?? uncontrolledSearchValue.value);
|
|
115
116
|
const activeIndex = ref(-1);
|
|
@@ -135,14 +136,15 @@ var AutoComplete = defineComponent({
|
|
|
135
136
|
const showClearButton = computed(
|
|
136
137
|
() => props.clearable && !props.disabled && inputValue.value !== ""
|
|
137
138
|
);
|
|
138
|
-
watch(
|
|
139
|
-
()
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
watch([() => props.modelValue, () => props.options], () => {
|
|
140
|
+
if (props.searchValue === void 0) {
|
|
141
|
+
uncontrolledSearchValue.value = resolveAutoCompleteDisplayValue(
|
|
142
|
+
props.modelValue,
|
|
143
|
+
props.options,
|
|
144
|
+
props.defaultSearchValue
|
|
145
|
+
);
|
|
144
146
|
}
|
|
145
|
-
);
|
|
147
|
+
});
|
|
146
148
|
function openDropdown() {
|
|
147
149
|
if (props.disabled) return;
|
|
148
150
|
isOpen.value = true;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHUGOSEY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ChartTooltip
|
|
6
6
|
} from "./chunk-SPFL55TF.mjs";
|
|
7
7
|
import {
|
|
8
8
|
ChartCanvas
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SNNT64HK.mjs";
|
|
10
10
|
|
|
11
11
|
// src/components/HeatmapChart.ts
|
|
12
12
|
import { defineComponent, computed, h, nextTick, ref, watchEffect } from "vue";
|
|
@@ -69,6 +69,7 @@ var HeatmapChart = defineComponent({
|
|
|
69
69
|
wrapperClasses: _wrapperClasses
|
|
70
70
|
} = useChartInteraction({
|
|
71
71
|
hoverable: computed(() => props.hoverable),
|
|
72
|
+
showTooltip: computed(() => props.showTooltip),
|
|
72
73
|
hoveredIndexProp: () => props.hoveredIndex,
|
|
73
74
|
selectable: computed(() => props.selectable),
|
|
74
75
|
selectedIndexProp: () => props.selectedIndex,
|
|
@@ -192,6 +193,7 @@ var HeatmapChart = defineComponent({
|
|
|
192
193
|
};
|
|
193
194
|
return () => {
|
|
194
195
|
const interactive = props.hoverable || props.selectable;
|
|
196
|
+
const pointerInteractive = interactive || props.showTooltip;
|
|
195
197
|
const rect = innerRect.value;
|
|
196
198
|
const chart = h(
|
|
197
199
|
ChartCanvas,
|
|
@@ -283,7 +285,7 @@ var HeatmapChart = defineComponent({
|
|
|
283
285
|
}
|
|
284
286
|
}
|
|
285
287
|
);
|
|
286
|
-
const tooltip = props.showTooltip
|
|
288
|
+
const tooltip = props.showTooltip ? h(ChartTooltip, {
|
|
287
289
|
content: tooltipContent.value,
|
|
288
290
|
open: resolvedHoveredIndex.value !== null && tooltipContent.value !== "",
|
|
289
291
|
x: tooltipPosition.value.x,
|
|
@@ -300,12 +302,12 @@ var HeatmapChart = defineComponent({
|
|
|
300
302
|
top: `${rect.y}px`,
|
|
301
303
|
width: `${rect.width}px`,
|
|
302
304
|
height: `${rect.height}px`,
|
|
303
|
-
pointerEvents:
|
|
305
|
+
pointerEvents: pointerInteractive ? "auto" : "none"
|
|
304
306
|
},
|
|
305
307
|
"data-heatmap-canvas": "true",
|
|
306
308
|
"data-heatmap-render-mode": resolvedRenderMode.value,
|
|
307
|
-
onMousemove:
|
|
308
|
-
onMouseleave:
|
|
309
|
+
onMousemove: pointerInteractive ? handleCanvasMouseMove : void 0,
|
|
310
|
+
onMouseleave: pointerInteractive ? handleMouseLeave : void 0,
|
|
309
311
|
onClick: interactive ? handleCanvasClick : void 0
|
|
310
312
|
}) : null;
|
|
311
313
|
return h("div", { class: "inline-block relative" }, [chart, canvas, tooltip]);
|