@expcat/tigercat-vue 2.1.0 → 2.1.2
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-7W3NALIL.mjs → chunk-3FPS7XVB.mjs} +26 -27
- package/dist/{chunk-2OI6GWOT.mjs → chunk-3KAHJF7D.mjs} +12 -11
- package/dist/{chunk-IEAEB4TX.mjs → chunk-3OCHBGPF.mjs} +242 -51
- package/dist/{chunk-OHR7IUBQ.mjs → chunk-5OILGUNU.mjs} +2 -2
- package/dist/{chunk-OQVGB7X6.mjs → chunk-626VUZ2Q.mjs} +1 -1
- package/dist/{chunk-66OS5A4D.mjs → chunk-67VS6QHJ.mjs} +26 -12
- package/dist/{chunk-EHGFW5GX.mjs → chunk-6JAAXPBW.mjs} +4 -3
- package/dist/{chunk-JHMT5Q6P.mjs → chunk-6NYC7EY2.mjs} +29 -15
- package/dist/{chunk-6BDDX2R4.mjs → chunk-73Z7N7VG.mjs} +1 -4
- package/dist/{chunk-F3ZVVVYD.mjs → chunk-7C7SG3SS.mjs} +15 -3
- package/dist/{chunk-CHEXI7MO.mjs → chunk-7TJE7OYH.mjs} +4 -3
- 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-4HUYX5WW.mjs → chunk-EC62TY2Y.mjs} +80 -19
- 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-6AMWX5K4.mjs → chunk-GQOPDD44.mjs} +1 -1
- package/dist/{chunk-5RXYJWNA.mjs → chunk-H4DEIGEG.mjs} +77 -25
- package/dist/{chunk-AU6IC6K7.mjs → chunk-IFASMNTU.mjs} +36 -16
- package/dist/{chunk-EZYOCPMM.mjs → chunk-IK2WHKDA.mjs} +29 -15
- 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-BZ6MVFV7.mjs → chunk-K5RYFPOQ.mjs} +17 -19
- package/dist/{chunk-DI6RRAGQ.mjs → chunk-KIUGJNQO.mjs} +4 -4
- package/dist/{chunk-5E4LINDO.mjs → chunk-LH2V2JMZ.mjs} +26 -10
- package/dist/{chunk-PQBKN2NH.mjs → chunk-LRFKHJDU.mjs} +14 -5
- package/dist/{chunk-W5XFWVNV.mjs → chunk-M4FWWEMX.mjs} +15 -6
- package/dist/{chunk-VLW3UBIR.mjs → chunk-N2XV37BL.mjs} +37 -41
- package/dist/{chunk-2LIIMWBR.mjs → chunk-OYU47A57.mjs} +1 -2
- package/dist/{chunk-KU2Q5V3L.mjs → chunk-P62TYR3M.mjs} +18 -2
- package/dist/{chunk-P5FDKBXG.mjs → chunk-P7X46BAW.mjs} +70 -3
- 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-7DWWNFRP.mjs → chunk-PWWWACHC.mjs} +1 -1
- 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-37W7XTA6.mjs → chunk-RHQWQJ4I.mjs} +4 -3
- package/dist/{chunk-32X54QKW.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-U4B5QT72.mjs → chunk-SX3NAN4M.mjs} +1 -1
- package/dist/{chunk-JL3CN4UK.mjs → chunk-TDBMAKTJ.mjs} +10 -3
- 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-VN2TWPRC.mjs → chunk-UR5F74ZB.mjs} +112 -18
- package/dist/{chunk-VCCK4CDT.mjs → chunk-URPXBKK4.mjs} +23 -5
- 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-ZOYHZF4N.mjs → chunk-X5LJT76O.mjs} +49 -32
- package/dist/{chunk-FSJRNEZK.mjs → chunk-YLO73TDM.mjs} +4 -4
- 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 +23 -5
- package/dist/components/ActivityFeed.mjs +2 -2
- package/dist/components/Affix.mjs +1 -1
- package/dist/components/Alert.d.mts +1 -1
- package/dist/components/Anchor.d.mts +1 -1
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/AreaChart.mjs +4 -3
- package/dist/components/AutoComplete.mjs +1 -1
- package/dist/components/BarChart.mjs +4 -3
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Cascader.mjs +1 -1
- package/dist/components/ChartCanvas.d.mts +7 -3
- package/dist/components/ChartCanvas.mjs +1 -1
- package/dist/components/ChatWindow.d.mts +26 -8
- package/dist/components/ChatWindow.mjs +3 -3
- package/dist/components/Checkbox.d.mts +1 -1
- package/dist/components/Code.d.mts +34 -7
- package/dist/components/Code.mjs +3 -1
- package/dist/components/CodeEditor.d.mts +1 -1
- package/dist/components/CollapsePanel.mjs +1 -1
- package/dist/components/ColorPicker.d.mts +19 -1
- package/dist/components/ColorPicker.mjs +3 -1
- package/dist/components/ColorSwatch.d.mts +6 -0
- 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/ContextMenu.d.mts +2 -2
- package/dist/components/Countdown.d.mts +2 -2
- package/dist/components/CronEditor.d.mts +1 -1
- package/dist/components/DataExport.mjs +2 -2
- package/dist/components/DataTableWithToolbar.mjs +8 -8
- package/dist/components/DatePicker.d.mts +1 -1
- package/dist/components/Descriptions.d.mts +1 -1
- package/dist/components/DonutChart.mjs +4 -4
- package/dist/components/Drawer.d.mts +1 -1
- package/dist/components/Dropdown.d.mts +21 -2
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/FileManager.d.mts +7 -1
- package/dist/components/FileManager.mjs +1 -1
- package/dist/components/FloatButton.d.mts +31 -1
- package/dist/components/FloatButton.mjs +1 -1
- package/dist/components/FormWizard.mjs +1 -1
- package/dist/components/FunnelChart.mjs +3 -3
- package/dist/components/Gantt.d.mts +3 -1
- package/dist/components/Gantt.mjs +2 -2
- package/dist/components/GaugeChart.mjs +2 -2
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Icon.d.mts +1 -1
- package/dist/components/Image.d.mts +1 -1
- package/dist/components/Image.mjs +3 -3
- package/dist/components/ImageAnnotation.d.mts +1 -1
- package/dist/components/ImageGroup.mjs +2 -2
- package/dist/components/ImagePreview.mjs +1 -1
- package/dist/components/Input.mjs +1 -1
- package/dist/components/InputNumber.mjs +1 -1
- package/dist/components/InputOTP.d.mts +1 -1
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/LineChart.mjs +4 -3
- package/dist/components/Link.d.mts +1 -1
- package/dist/components/List.mjs +2 -2
- package/dist/components/Loading.mjs +1 -1
- package/dist/components/MarkdownEditor.d.mts +1 -1
- package/dist/components/MarkdownEditor.mjs +1 -1
- package/dist/components/MaskInput.d.mts +9 -3
- package/dist/components/MaskInput.mjs +1 -1
- package/dist/components/Menu.d.mts +2 -2
- package/dist/components/Modal.d.mts +1 -1
- package/dist/components/NavigationMenu.d.mts +3 -3
- package/dist/components/NotificationCenter.d.mts +44 -26
- package/dist/components/NotificationCenter.mjs +4 -4
- package/dist/components/NumberKeyboard.d.mts +1 -1
- package/dist/components/OrgChart.mjs +2 -2
- package/dist/components/PageHeader.d.mts +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/PieChart.mjs +3 -3
- package/dist/components/Popconfirm.d.mts +1 -1
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.d.mts +2 -2
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/QRCode.d.mts +2 -11
- package/dist/components/QRCode.mjs +1 -1
- package/dist/components/RadarChart.mjs +3 -3
- package/dist/components/Radio.d.mts +1 -1
- package/dist/components/Radio.mjs +1 -1
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/Result.d.mts +1 -1
- package/dist/components/RichTextEditor.d.mts +1 -1
- package/dist/components/RichTextEditor.mjs +1 -1
- package/dist/components/ScatterChart.mjs +4 -3
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Select.d.mts +4 -6
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Signature.mjs +1 -1
- package/dist/components/Slider.d.mts +18 -0
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/SplitButton.d.mts +1 -1
- package/dist/components/SplitButton.mjs +2 -2
- package/dist/components/Splitter.d.mts +4 -4
- package/dist/components/Splitter.mjs +1 -1
- package/dist/components/Spotlight.d.mts +1 -1
- package/dist/components/Statistic.d.mts +2 -2
- package/dist/components/Stepper.d.mts +7 -1
- package/dist/components/Stepper.mjs +1 -1
- package/dist/components/SunburstChart.mjs +3 -3
- package/dist/components/Switch.d.mts +22 -6
- package/dist/components/Switch.mjs +1 -1
- package/dist/components/Table.d.mts +4 -4
- package/dist/components/Table.mjs +4 -4
- package/dist/components/TagsInput.d.mts +1 -1
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/Text.d.mts +2 -2
- package/dist/components/Textarea.mjs +1 -1
- package/dist/components/TimePicker.d.mts +1 -1
- package/dist/components/Tooltip.d.mts +1 -1
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/components/Tour.mjs +1 -1
- package/dist/components/Transfer.d.mts +2 -1
- package/dist/components/Transfer.mjs +1 -1
- package/dist/components/TreeMapChart.mjs +3 -3
- package/dist/components/TreeSelect.mjs +1 -1
- package/dist/components/Upload.d.mts +1 -1
- package/dist/components/Upload.mjs +1 -1
- package/dist/components/Watermark.d.mts +1 -1
- package/dist/composables/useChartInteraction.d.mts +5 -0
- package/dist/composables/useChartInteraction.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +57 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHUGOSEY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ChartSeries
|
|
6
6
|
} from "./chunk-2ZUEXCVJ.mjs";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-SPFL55TF.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ChartCanvas
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SNNT64HK.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ChartLegend
|
|
15
15
|
} from "./chunk-V443QIJM.mjs";
|
|
@@ -76,6 +76,7 @@ var TreeMapChart = defineComponent({
|
|
|
76
76
|
wrapperClasses
|
|
77
77
|
} = useChartInteraction({
|
|
78
78
|
hoverable: computed(() => props.hoverable),
|
|
79
|
+
showTooltip: computed(() => props.showTooltip),
|
|
79
80
|
hoveredIndexProp: () => props.hoveredIndex,
|
|
80
81
|
selectable: computed(() => props.selectable),
|
|
81
82
|
selectedIndexProp: () => props.selectedIndex,
|
|
@@ -219,7 +220,7 @@ var TreeMapChart = defineComponent({
|
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
222
|
);
|
|
222
|
-
const tooltip = props.showTooltip
|
|
223
|
+
const tooltip = props.showTooltip ? h(ChartTooltip, {
|
|
223
224
|
content: tooltipContent.value,
|
|
224
225
|
open: resolvedHoveredIndex.value !== null && tooltipContent.value !== "",
|
|
225
226
|
x: tooltipPosition.value.x,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useResponsiveChartSize
|
|
3
|
+
} from "./chunk-UEGNXN5B.mjs";
|
|
1
4
|
import {
|
|
2
5
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FHUGOSEY.mjs";
|
|
4
7
|
import {
|
|
5
8
|
ChartSeries
|
|
6
9
|
} from "./chunk-2ZUEXCVJ.mjs";
|
|
@@ -12,7 +15,7 @@ import {
|
|
|
12
15
|
} from "./chunk-ZWVA7HT3.mjs";
|
|
13
16
|
import {
|
|
14
17
|
ChartCanvas
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SNNT64HK.mjs";
|
|
16
19
|
import {
|
|
17
20
|
ChartGrid
|
|
18
21
|
} from "./chunk-MI6TL3CQ.mjs";
|
|
@@ -29,7 +32,6 @@ import {
|
|
|
29
32
|
createLinePath,
|
|
30
33
|
createPointScale,
|
|
31
34
|
getChartElementOpacity,
|
|
32
|
-
getChartInnerRect,
|
|
33
35
|
getStableChartGradientPrefix,
|
|
34
36
|
getNumberExtent,
|
|
35
37
|
linePointTransitionClasses,
|
|
@@ -255,7 +257,12 @@ var LineChart = defineComponent({
|
|
|
255
257
|
const hoveredPointInfo = ref(null);
|
|
256
258
|
const tooltipPosition = ref({ x: 0, y: 0 });
|
|
257
259
|
const gradientPrefix = getStableChartGradientPrefix("line", useId());
|
|
258
|
-
const innerRect
|
|
260
|
+
const { innerRect, onResolvedSizeChange } = useResponsiveChartSize(
|
|
261
|
+
() => props.width,
|
|
262
|
+
() => props.height,
|
|
263
|
+
() => props.padding,
|
|
264
|
+
() => props.responsive
|
|
265
|
+
);
|
|
259
266
|
const resolvedSeries = computed(
|
|
260
267
|
() => resolveSeriesData(props.series, props.data, {
|
|
261
268
|
color: props.lineColor,
|
|
@@ -273,6 +280,7 @@ var LineChart = defineComponent({
|
|
|
273
280
|
wrapperClasses
|
|
274
281
|
} = useChartInteraction({
|
|
275
282
|
hoverable: computed(() => props.hoverable),
|
|
283
|
+
showTooltip: computed(() => props.showTooltip),
|
|
276
284
|
hoveredIndexProp: () => props.hoveredIndex,
|
|
277
285
|
selectable: computed(() => props.selectable),
|
|
278
286
|
selectedIndexProp: () => props.selectedIndex,
|
|
@@ -368,19 +376,23 @@ var LineChart = defineComponent({
|
|
|
368
376
|
const handlePointMouseEnter = (seriesIndex, pointIndex, event) => {
|
|
369
377
|
hoveredPointInfo.value = { seriesIndex, pointIndex };
|
|
370
378
|
tooltipPosition.value = { x: event.clientX, y: event.clientY };
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
379
|
+
if (props.hoverable) {
|
|
380
|
+
emit(
|
|
381
|
+
"point-hover",
|
|
382
|
+
seriesIndex,
|
|
383
|
+
pointIndex,
|
|
384
|
+
resolvedSeries.value[seriesIndex]?.data[pointIndex]
|
|
385
|
+
);
|
|
386
|
+
}
|
|
377
387
|
};
|
|
378
388
|
const handlePointMouseMove = (event) => {
|
|
379
389
|
tooltipPosition.value = { x: event.clientX, y: event.clientY };
|
|
380
390
|
};
|
|
381
391
|
const handlePointMouseLeave = () => {
|
|
382
392
|
hoveredPointInfo.value = null;
|
|
383
|
-
|
|
393
|
+
if (props.hoverable) {
|
|
394
|
+
emit("point-hover", null, null, null);
|
|
395
|
+
}
|
|
384
396
|
};
|
|
385
397
|
const showPointTooltipFromElement = (el, seriesIndex, pointIndex) => {
|
|
386
398
|
if (!props.hoverable) return;
|
|
@@ -411,6 +423,7 @@ var LineChart = defineComponent({
|
|
|
411
423
|
};
|
|
412
424
|
return () => {
|
|
413
425
|
const pointClickable = props.selectable || typeof instance?.vnode.props?.onPointClick === "function";
|
|
426
|
+
const trackPointHover = props.showTooltip || props.hoverable;
|
|
414
427
|
const chart = h(
|
|
415
428
|
ChartCanvas,
|
|
416
429
|
{
|
|
@@ -420,7 +433,8 @@ var LineChart = defineComponent({
|
|
|
420
433
|
responsive: props.responsive,
|
|
421
434
|
title: props.title,
|
|
422
435
|
desc: props.desc,
|
|
423
|
-
className: classNames(props.className)
|
|
436
|
+
className: classNames(props.className),
|
|
437
|
+
onResolvedSizeChange
|
|
424
438
|
},
|
|
425
439
|
{
|
|
426
440
|
default: () => [
|
|
@@ -627,9 +641,9 @@ var LineChart = defineComponent({
|
|
|
627
641
|
tabindex: pointInteractive ? 0 : void 0,
|
|
628
642
|
"data-point-index": point.pointIndex,
|
|
629
643
|
"data-series-key": sd.seriesKey,
|
|
630
|
-
onMouseenter:
|
|
631
|
-
onMousemove:
|
|
632
|
-
onMouseleave:
|
|
644
|
+
onMouseenter: trackPointHover ? (e) => handlePointMouseEnter(sd.seriesIndex, point.pointIndex, e) : void 0,
|
|
645
|
+
onMousemove: trackPointHover ? handlePointMouseMove : void 0,
|
|
646
|
+
onMouseleave: trackPointHover ? handlePointMouseLeave : void 0,
|
|
633
647
|
onClick: pointClickable ? (e) => {
|
|
634
648
|
e.stopPropagation();
|
|
635
649
|
handlePointClick(sd.seriesIndex, point.pointIndex);
|
|
@@ -99,10 +99,7 @@ var Radio = defineComponent({
|
|
|
99
99
|
});
|
|
100
100
|
const isInGroup = computed(() => !!groupContext.value);
|
|
101
101
|
const actualSize = computed(() => props.size || groupContext.value?.size || "md");
|
|
102
|
-
const actualDisabled = computed(() =>
|
|
103
|
-
if (props.disabled !== void 0) return props.disabled;
|
|
104
|
-
return groupContext.value?.disabled || false;
|
|
105
|
-
});
|
|
102
|
+
const actualDisabled = computed(() => props.disabled || groupContext.value?.disabled || false);
|
|
106
103
|
const actualName = computed(() => props.name || groupContext.value?.name);
|
|
107
104
|
const isChecked = computed(() => {
|
|
108
105
|
if (isCheckedControlled.value) return props.modelValue;
|
|
@@ -63,7 +63,10 @@ var MaskInput = defineComponent({
|
|
|
63
63
|
readonly: Boolean,
|
|
64
64
|
/** Whether to show a clear button when the input has value */
|
|
65
65
|
clearable: Boolean,
|
|
66
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Input name attribute. When set, a hidden input with this name submits the
|
|
68
|
+
* raw (unmasked) value; the visible field displays the mask and has no name.
|
|
69
|
+
*/
|
|
67
70
|
name: String,
|
|
68
71
|
/** Input id attribute */
|
|
69
72
|
id: String,
|
|
@@ -200,7 +203,6 @@ var MaskInput = defineComponent({
|
|
|
200
203
|
placeholder: props.placeholder,
|
|
201
204
|
disabled: props.disabled,
|
|
202
205
|
readonly: props.readonly,
|
|
203
|
-
name: props.name,
|
|
204
206
|
id: props.id,
|
|
205
207
|
autocomplete: props.autoComplete,
|
|
206
208
|
autofocus: props.autoFocus,
|
|
@@ -214,11 +216,21 @@ var MaskInput = defineComponent({
|
|
|
214
216
|
onBlur: handleBlur
|
|
215
217
|
})
|
|
216
218
|
];
|
|
219
|
+
if (props.name) {
|
|
220
|
+
children.push(
|
|
221
|
+
h("input", {
|
|
222
|
+
key: "hidden",
|
|
223
|
+
type: "hidden",
|
|
224
|
+
name: props.name,
|
|
225
|
+
value: rawValue.value
|
|
226
|
+
})
|
|
227
|
+
);
|
|
228
|
+
}
|
|
217
229
|
if (activeError) {
|
|
218
230
|
children.push(
|
|
219
231
|
h(
|
|
220
232
|
"div",
|
|
221
|
-
{ id: errorMsgId, class: getInputErrorClasses(props.size) },
|
|
233
|
+
{ id: errorMsgId, class: getInputErrorClasses(props.size), "aria-live": "polite" },
|
|
222
234
|
effectiveErrorMessage.value
|
|
223
235
|
)
|
|
224
236
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHUGOSEY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ChartSeries
|
|
6
6
|
} from "./chunk-2ZUEXCVJ.mjs";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-SPFL55TF.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ChartCanvas
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SNNT64HK.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ChartLegend
|
|
15
15
|
} from "./chunk-V443QIJM.mjs";
|
|
@@ -188,6 +188,7 @@ var PieChart = defineComponent({
|
|
|
188
188
|
wrapperClasses
|
|
189
189
|
} = useChartInteraction({
|
|
190
190
|
hoverable: computed(() => props.hoverable),
|
|
191
|
+
showTooltip: computed(() => props.showTooltip),
|
|
191
192
|
hoveredIndexProp: () => props.hoveredIndex,
|
|
192
193
|
selectable: computed(() => props.selectable),
|
|
193
194
|
selectedIndexProp: () => props.selectedIndex,
|
|
@@ -392,7 +393,7 @@ var PieChart = defineComponent({
|
|
|
392
393
|
}
|
|
393
394
|
}
|
|
394
395
|
);
|
|
395
|
-
const tooltip = props.showTooltip
|
|
396
|
+
const tooltip = props.showTooltip ? h(ChartTooltip, {
|
|
396
397
|
content: tooltipContent.value,
|
|
397
398
|
open: resolvedHoveredIndex.value !== null && tooltipContent.value !== "",
|
|
398
399
|
x: tooltipPosition.value.x,
|
|
@@ -30,11 +30,14 @@ import {
|
|
|
30
30
|
kanbanSwimlaneCollapsedClasses,
|
|
31
31
|
kanbanAddColumnClasses,
|
|
32
32
|
filterColumns,
|
|
33
|
+
filterCards,
|
|
33
34
|
groupBySwimlane,
|
|
34
35
|
getColumnCardCount,
|
|
35
36
|
moveCard,
|
|
37
|
+
mapVisibleCardIndexToSource,
|
|
36
38
|
reorderColumns,
|
|
37
39
|
isWipExceeded,
|
|
40
|
+
appendDefaultTaskBoardCard,
|
|
38
41
|
createTaskBoardDragController,
|
|
39
42
|
createDefaultDragSnapshot
|
|
40
43
|
} from "@expcat/tigercat-core";
|
|
@@ -139,10 +142,22 @@ var TaskBoard = defineComponent({
|
|
|
139
142
|
innerColumns.value = next;
|
|
140
143
|
emit("update:columns", next);
|
|
141
144
|
};
|
|
145
|
+
const addCardToColumn = (columnId) => {
|
|
146
|
+
emit("card-add", columnId);
|
|
147
|
+
if (props.onCardAdd == null) {
|
|
148
|
+
updateColumns(appendDefaultTaskBoardCard(currentColumns.value, columnId));
|
|
149
|
+
}
|
|
150
|
+
};
|
|
142
151
|
const dragSnap = ref(createDefaultDragSnapshot());
|
|
143
152
|
const boardRef = ref(null);
|
|
144
153
|
const applyCardMove = async (cardId, fromColumnId, toColumnId, toIdx) => {
|
|
145
|
-
const
|
|
154
|
+
const sourceCol = currentColumns.value.find((c) => c.id === toColumnId);
|
|
155
|
+
const mappedIdx = sourceCol == null ? toIdx : mapVisibleCardIndexToSource(
|
|
156
|
+
sourceCol.cards,
|
|
157
|
+
filterCards(sourceCol.cards, props.filterText || ""),
|
|
158
|
+
toIdx
|
|
159
|
+
);
|
|
160
|
+
const result = moveCard(currentColumns.value, cardId, fromColumnId, toColumnId, mappedIdx, {
|
|
146
161
|
enforceWipLimit: props.enforceWipLimit
|
|
147
162
|
});
|
|
148
163
|
if (!result) return;
|
|
@@ -395,12 +410,12 @@ var TaskBoard = defineComponent({
|
|
|
395
410
|
role: "button",
|
|
396
411
|
tabindex: 0,
|
|
397
412
|
onClick: () => {
|
|
398
|
-
|
|
413
|
+
addCardToColumn(column.id);
|
|
399
414
|
},
|
|
400
415
|
onKeydown: (e) => {
|
|
401
416
|
if (e.key === "Enter" || e.key === " ") {
|
|
402
417
|
e.preventDefault();
|
|
403
|
-
|
|
418
|
+
addCardToColumn(column.id);
|
|
404
419
|
}
|
|
405
420
|
}
|
|
406
421
|
},
|
|
@@ -271,6 +271,7 @@ var InputNumber = defineComponent({
|
|
|
271
271
|
});
|
|
272
272
|
onBeforeUnmount(() => repeatController.stop());
|
|
273
273
|
return () => {
|
|
274
|
+
const { class: _attrClass, style: attrStyle, ...restAttrs } = attrs;
|
|
274
275
|
const children = [];
|
|
275
276
|
if (props.controls && props.controlsPosition === "both") {
|
|
276
277
|
children.push(
|
|
@@ -307,6 +308,7 @@ var InputNumber = defineComponent({
|
|
|
307
308
|
}
|
|
308
309
|
children.push(
|
|
309
310
|
h("input", {
|
|
311
|
+
...restAttrs,
|
|
310
312
|
ref: inputRef,
|
|
311
313
|
type: "text",
|
|
312
314
|
inputmode: "decimal",
|
|
@@ -423,7 +425,8 @@ var InputNumber = defineComponent({
|
|
|
423
425
|
return h(
|
|
424
426
|
"div",
|
|
425
427
|
{
|
|
426
|
-
class: wrapperClasses.value
|
|
428
|
+
class: wrapperClasses.value,
|
|
429
|
+
style: attrStyle
|
|
427
430
|
},
|
|
428
431
|
children
|
|
429
432
|
);
|
|
@@ -26,7 +26,6 @@ var QRCode = defineComponent({
|
|
|
26
26
|
size: { type: Number, default: 128 },
|
|
27
27
|
color: { type: String, default: "#000000" },
|
|
28
28
|
bgColor: { type: String, default: "#ffffff" },
|
|
29
|
-
level: { type: String, default: "M" },
|
|
30
29
|
status: { type: String, default: "active" },
|
|
31
30
|
className: { type: String, default: void 0 },
|
|
32
31
|
locale: { type: Object, default: void 0 }
|
|
@@ -227,12 +227,15 @@ var FormWizard = defineComponent({
|
|
|
227
227
|
setCurrent(target);
|
|
228
228
|
};
|
|
229
229
|
const handleStepChange = async (nextIndex) => {
|
|
230
|
-
if (nextIndex === currentIndex.value
|
|
231
|
-
|
|
230
|
+
if (nextIndex === currentIndex.value) return;
|
|
231
|
+
const direction = nextIndex > currentIndex.value ? 1 : -1;
|
|
232
|
+
if (direction === 1) {
|
|
232
233
|
const ok = await runBeforeNext();
|
|
233
234
|
if (!ok) return;
|
|
234
235
|
}
|
|
235
|
-
|
|
236
|
+
const target = findNextUnskipped(nextIndex, direction);
|
|
237
|
+
if (target === currentIndex.value) return;
|
|
238
|
+
setCurrent(target);
|
|
236
239
|
};
|
|
237
240
|
const renderContent = () => {
|
|
238
241
|
if (!currentStep.value) {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TaskBoard
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BOHE5URZ.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/Kanban.ts
|
|
6
|
-
import { defineComponent, h } from "vue";
|
|
6
|
+
import { defineComponent, h, ref } from "vue";
|
|
7
|
+
import {
|
|
8
|
+
appendDefaultTaskBoardCard
|
|
9
|
+
} from "@expcat/tigercat-core";
|
|
7
10
|
var Kanban = defineComponent({
|
|
8
11
|
name: "TigerKanban",
|
|
9
12
|
inheritAttrs: false,
|
|
@@ -59,7 +62,14 @@ var Kanban = defineComponent({
|
|
|
59
62
|
},
|
|
60
63
|
emits: ["card-move", "column-move", "update:columns", "card-add", "column-add"],
|
|
61
64
|
setup(props, { emit, attrs, slots }) {
|
|
65
|
+
const pendingColumns = ref(void 0);
|
|
62
66
|
const handleCardAdd = (colId) => {
|
|
67
|
+
if (props.onCardAdd == null) {
|
|
68
|
+
const source = props.columns ?? pendingColumns.value ?? props.defaultColumns;
|
|
69
|
+
const next = appendDefaultTaskBoardCard(source, colId);
|
|
70
|
+
pendingColumns.value = next;
|
|
71
|
+
emit("update:columns", next);
|
|
72
|
+
}
|
|
63
73
|
props.onCardAdd?.(colId);
|
|
64
74
|
emit("card-add", colId);
|
|
65
75
|
};
|
|
@@ -67,14 +77,13 @@ var Kanban = defineComponent({
|
|
|
67
77
|
TaskBoard,
|
|
68
78
|
{
|
|
69
79
|
...attrs,
|
|
70
|
-
columns: props.columns,
|
|
80
|
+
columns: props.columns !== void 0 ? props.columns : pendingColumns.value,
|
|
71
81
|
defaultColumns: props.defaultColumns,
|
|
72
82
|
draggable: props.draggable,
|
|
73
83
|
columnDraggable: props.columnDraggable,
|
|
74
84
|
enforceWipLimit: props.enforceWipLimit,
|
|
75
85
|
beforeCardMove: props.beforeCardMove,
|
|
76
86
|
beforeColumnMove: props.beforeColumnMove,
|
|
77
|
-
// Only set onCardAdd when needed — its presence affects button visibility
|
|
78
87
|
onCardAdd: props.allowAddCard || props.onCardAdd ? handleCardAdd : void 0,
|
|
79
88
|
filterText: props.filterText,
|
|
80
89
|
hiddenColumns: props.hiddenColumns,
|
|
@@ -88,7 +97,10 @@ var Kanban = defineComponent({
|
|
|
88
97
|
style: props.style,
|
|
89
98
|
"onCard-move": (e) => emit("card-move", e),
|
|
90
99
|
"onColumn-move": (e) => emit("column-move", e),
|
|
91
|
-
"onUpdate:columns": (cols) =>
|
|
100
|
+
"onUpdate:columns": (cols) => {
|
|
101
|
+
pendingColumns.value = cols;
|
|
102
|
+
emit("update:columns", cols);
|
|
103
|
+
},
|
|
92
104
|
"onColumn-add": () => emit("column-add")
|
|
93
105
|
},
|
|
94
106
|
slots
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChartCanvas
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SNNT64HK.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/Gantt.ts
|
|
6
|
-
import { computed, defineComponent, h, ref } from "vue";
|
|
6
|
+
import { computed, defineComponent, h, onBeforeUnmount, ref } from "vue";
|
|
7
7
|
import {
|
|
8
|
+
applyGanttTaskDateOverlay,
|
|
8
9
|
classNames,
|
|
10
|
+
clampGanttDragDeltaX,
|
|
9
11
|
computeGanttLayout,
|
|
10
12
|
ganttAxisTextClasses,
|
|
13
|
+
ganttDateValuesEqual,
|
|
11
14
|
ganttDependencyClasses,
|
|
12
15
|
ganttLabelClasses,
|
|
13
16
|
ganttProgressClasses,
|
|
@@ -15,8 +18,11 @@ import {
|
|
|
15
18
|
ganttTodayLineClasses,
|
|
16
19
|
getChartInnerRect,
|
|
17
20
|
getGanttTaskAriaLabel,
|
|
18
|
-
getGanttTaskClasses
|
|
21
|
+
getGanttTaskClasses,
|
|
22
|
+
isBrowser,
|
|
23
|
+
moveGanttTaskByPx
|
|
19
24
|
} from "@expcat/tigercat-core";
|
|
25
|
+
var GANTT_BAR_CLICK_PX = 4;
|
|
20
26
|
var Gantt = defineComponent({
|
|
21
27
|
name: "TigerGantt",
|
|
22
28
|
props: {
|
|
@@ -52,16 +58,22 @@ var Gantt = defineComponent({
|
|
|
52
58
|
ariaLabel: { type: String, default: "Gantt chart" },
|
|
53
59
|
className: { type: String }
|
|
54
60
|
},
|
|
55
|
-
emits: ["update:selectedId", "task-click", "task-hover"],
|
|
61
|
+
emits: ["update:selectedId", "task-click", "task-hover", "task-change", "update:data"],
|
|
56
62
|
setup(props, { emit }) {
|
|
57
63
|
const innerSelectedId = ref(null);
|
|
58
64
|
const hoveredId = ref(null);
|
|
65
|
+
const dateOverlay = ref(/* @__PURE__ */ new Map());
|
|
66
|
+
const dragSession = ref(null);
|
|
67
|
+
const dragPreview = ref(null);
|
|
68
|
+
let documentPointerListening = false;
|
|
69
|
+
let suppressClick = false;
|
|
59
70
|
const resolvedSelectedId = computed(
|
|
60
71
|
() => props.selectedId === void 0 ? innerSelectedId.value : props.selectedId
|
|
61
72
|
);
|
|
73
|
+
const resolvedData = computed(() => applyGanttTaskDateOverlay(props.data, dateOverlay.value));
|
|
62
74
|
const innerRect = computed(() => getChartInnerRect(props.width, props.height, props.padding));
|
|
63
75
|
const layout = computed(
|
|
64
|
-
() => computeGanttLayout(
|
|
76
|
+
() => computeGanttLayout(resolvedData.value, {
|
|
65
77
|
width: innerRect.value.width,
|
|
66
78
|
rowHeight: props.rowHeight,
|
|
67
79
|
barHeight: props.barHeight,
|
|
@@ -94,6 +106,140 @@ var Gantt = defineComponent({
|
|
|
94
106
|
if (activeId.value === null) return props.activeOpacity;
|
|
95
107
|
return activeId.value === task.id ? props.activeOpacity : props.inactiveOpacity;
|
|
96
108
|
};
|
|
109
|
+
const pointerScale = (event) => {
|
|
110
|
+
const target = event.currentTarget;
|
|
111
|
+
const svg = target instanceof SVGElement ? target.ownerSVGElement ?? target.closest("svg") : target instanceof Element ? target.closest("svg") : null;
|
|
112
|
+
const clientWidth = svg?.clientWidth ?? 0;
|
|
113
|
+
if (!(clientWidth > 0)) return 1;
|
|
114
|
+
const viewBoxWidth = svg?.viewBox?.baseVal?.width;
|
|
115
|
+
const resolvedViewBox = typeof viewBoxWidth === "number" && viewBoxWidth > 0 ? viewBoxWidth : props.width;
|
|
116
|
+
return resolvedViewBox / clientWidth;
|
|
117
|
+
};
|
|
118
|
+
const captureBarPointer = (target, pointerId) => {
|
|
119
|
+
if (!(target instanceof Element) || typeof target.setPointerCapture !== "function") return;
|
|
120
|
+
try {
|
|
121
|
+
target.setPointerCapture(pointerId);
|
|
122
|
+
} catch {
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const releaseBarPointer = (target, pointerId) => {
|
|
126
|
+
if (!target || typeof target.releasePointerCapture !== "function") return;
|
|
127
|
+
try {
|
|
128
|
+
target.releasePointerCapture(pointerId);
|
|
129
|
+
} catch {
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const moveBarDrag = (event) => {
|
|
133
|
+
const session = dragSession.value;
|
|
134
|
+
if (!session || event.pointerId !== session.pointerId) return;
|
|
135
|
+
const rawDelta = (event.clientX - session.startClientX) * session.scale;
|
|
136
|
+
const deltaX = clampGanttDragDeltaX(
|
|
137
|
+
rawDelta,
|
|
138
|
+
session.barX,
|
|
139
|
+
session.barWidth,
|
|
140
|
+
session.taskLabelWidth,
|
|
141
|
+
session.layoutWidth
|
|
142
|
+
);
|
|
143
|
+
session.deltaX = deltaX;
|
|
144
|
+
dragPreview.value = { id: session.task.id, deltaX };
|
|
145
|
+
};
|
|
146
|
+
const finishBarDrag = (event) => {
|
|
147
|
+
const session = dragSession.value;
|
|
148
|
+
if (!session || event.pointerId !== session.pointerId) return;
|
|
149
|
+
moveBarDrag(event);
|
|
150
|
+
const deltaX = session.deltaX;
|
|
151
|
+
dragSession.value = null;
|
|
152
|
+
dragPreview.value = null;
|
|
153
|
+
detachDocumentPointerListeners();
|
|
154
|
+
releaseBarPointer(session.captureTarget, session.pointerId);
|
|
155
|
+
suppressClick = true;
|
|
156
|
+
if (Math.abs(deltaX) < GANTT_BAR_CLICK_PX) {
|
|
157
|
+
selectTask(session.task);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const nextTask = moveGanttTaskByPx(session.sourceTask, deltaX, {
|
|
161
|
+
minMs: session.minMs,
|
|
162
|
+
maxMs: session.maxMs,
|
|
163
|
+
timelineWidth: session.timelineWidth
|
|
164
|
+
});
|
|
165
|
+
if (ganttDateValuesEqual(nextTask.start, session.sourceTask.start) && ganttDateValuesEqual(nextTask.end, session.sourceTask.end)) {
|
|
166
|
+
selectTask(session.task);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const incoming = props.data.find((item) => item.id === nextTask.id);
|
|
170
|
+
const previous = dateOverlay.value.get(nextTask.id);
|
|
171
|
+
const nextOverlay = new Map(dateOverlay.value);
|
|
172
|
+
nextOverlay.set(nextTask.id, {
|
|
173
|
+
start: nextTask.start,
|
|
174
|
+
end: nextTask.end,
|
|
175
|
+
baseStart: previous?.baseStart ?? incoming?.start ?? session.sourceTask.start,
|
|
176
|
+
baseEnd: previous?.baseEnd ?? incoming?.end ?? session.sourceTask.end
|
|
177
|
+
});
|
|
178
|
+
dateOverlay.value = nextOverlay;
|
|
179
|
+
const nextData = applyGanttTaskDateOverlay(props.data, nextOverlay);
|
|
180
|
+
emit("task-change", nextTask);
|
|
181
|
+
emit("update:data", nextData);
|
|
182
|
+
};
|
|
183
|
+
const handleDocumentPointerMove = (event) => {
|
|
184
|
+
moveBarDrag(event);
|
|
185
|
+
};
|
|
186
|
+
const handleDocumentPointerEnd = (event) => {
|
|
187
|
+
finishBarDrag(event);
|
|
188
|
+
};
|
|
189
|
+
const attachDocumentPointerListeners = () => {
|
|
190
|
+
if (documentPointerListening || !isBrowser()) return;
|
|
191
|
+
document.addEventListener("pointermove", handleDocumentPointerMove);
|
|
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("pointermove", handleDocumentPointerMove);
|
|
199
|
+
document.removeEventListener("pointerup", handleDocumentPointerEnd);
|
|
200
|
+
document.removeEventListener("pointercancel", handleDocumentPointerEnd);
|
|
201
|
+
documentPointerListening = false;
|
|
202
|
+
};
|
|
203
|
+
const startBarDrag = (event, task) => {
|
|
204
|
+
if (task.task.disabled || dragSession.value) return;
|
|
205
|
+
if (event.button !== void 0 && event.button !== 0) return;
|
|
206
|
+
event.preventDefault();
|
|
207
|
+
const current = layout.value;
|
|
208
|
+
const captureTarget = event.currentTarget instanceof Element ? event.currentTarget : null;
|
|
209
|
+
dragSession.value = {
|
|
210
|
+
pointerId: event.pointerId,
|
|
211
|
+
startClientX: event.clientX,
|
|
212
|
+
scale: pointerScale(event),
|
|
213
|
+
task,
|
|
214
|
+
sourceTask: task.task,
|
|
215
|
+
barX: task.x,
|
|
216
|
+
barWidth: task.width,
|
|
217
|
+
taskLabelWidth: props.taskLabelWidth,
|
|
218
|
+
layoutWidth: current.width,
|
|
219
|
+
minMs: current.minMs,
|
|
220
|
+
maxMs: current.maxMs,
|
|
221
|
+
timelineWidth: current.timelineWidth,
|
|
222
|
+
deltaX: 0,
|
|
223
|
+
captureTarget
|
|
224
|
+
};
|
|
225
|
+
dragPreview.value = { id: task.id, deltaX: 0 };
|
|
226
|
+
captureBarPointer(event.currentTarget, event.pointerId);
|
|
227
|
+
attachDocumentPointerListeners();
|
|
228
|
+
};
|
|
229
|
+
const handleBarClick = (event, task) => {
|
|
230
|
+
if (suppressClick) {
|
|
231
|
+
suppressClick = false;
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
event.stopPropagation();
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
selectTask(task);
|
|
237
|
+
};
|
|
238
|
+
onBeforeUnmount(() => {
|
|
239
|
+
detachDocumentPointerListeners();
|
|
240
|
+
dragSession.value = null;
|
|
241
|
+
dragPreview.value = null;
|
|
242
|
+
});
|
|
97
243
|
return () => h(
|
|
98
244
|
ChartCanvas,
|
|
99
245
|
{
|
|
@@ -169,6 +315,9 @@ var Gantt = defineComponent({
|
|
|
169
315
|
layout.value.tasks.map((task) => {
|
|
170
316
|
const selected = resolvedSelectedId.value === task.id;
|
|
171
317
|
const interactive = (props.hoverable || props.selectable) && !task.task.disabled;
|
|
318
|
+
const movable = !task.task.disabled;
|
|
319
|
+
const grabbing = dragPreview.value?.id === task.id;
|
|
320
|
+
const previewDeltaX = grabbing ? dragPreview.value?.deltaX ?? 0 : 0;
|
|
172
321
|
return h("g", { key: task.id, opacity: getTaskOpacity(task) }, [
|
|
173
322
|
h(
|
|
174
323
|
"text",
|
|
@@ -182,13 +331,19 @@ var Gantt = defineComponent({
|
|
|
182
331
|
h(
|
|
183
332
|
"g",
|
|
184
333
|
{
|
|
185
|
-
class: getGanttTaskClasses(interactive, selected),
|
|
334
|
+
class: getGanttTaskClasses(interactive, selected, movable, grabbing),
|
|
186
335
|
role: interactive ? "button" : "group",
|
|
187
336
|
tabindex: interactive ? 0 : void 0,
|
|
188
337
|
"aria-label": getGanttTaskAriaLabel(task.task),
|
|
338
|
+
"data-gantt-task-id": task.id,
|
|
339
|
+
transform: previewDeltaX !== 0 ? `translate(${previewDeltaX} 0)` : void 0,
|
|
189
340
|
onMouseenter: () => setHoveredTask(task),
|
|
190
341
|
onMouseleave: () => setHoveredTask(null),
|
|
191
|
-
|
|
342
|
+
onPointerdown: (event) => startBarDrag(event, task),
|
|
343
|
+
onPointermove: (event) => moveBarDrag(event),
|
|
344
|
+
onPointerup: (event) => finishBarDrag(event),
|
|
345
|
+
onPointercancel: (event) => finishBarDrag(event),
|
|
346
|
+
onClick: (event) => handleBarClick(event, task),
|
|
192
347
|
onKeydown: (event) => {
|
|
193
348
|
if (event.key === "Enter" || event.key === " ") {
|
|
194
349
|
event.preventDefault();
|