@expcat/tigercat-vue 2.1.0 → 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.
Files changed (250) hide show
  1. package/dist/{chunk-7W3NALIL.mjs → chunk-3FPS7XVB.mjs} +26 -27
  2. package/dist/{chunk-2OI6GWOT.mjs → chunk-3KAHJF7D.mjs} +12 -11
  3. package/dist/{chunk-IEAEB4TX.mjs → chunk-3OCHBGPF.mjs} +242 -51
  4. package/dist/{chunk-4HUYX5WW.mjs → chunk-4PQZMDBK.mjs} +29 -8
  5. package/dist/{chunk-DI6RRAGQ.mjs → chunk-562Z32GR.mjs} +3 -3
  6. package/dist/{chunk-OQVGB7X6.mjs → chunk-626VUZ2Q.mjs} +1 -1
  7. package/dist/{chunk-66OS5A4D.mjs → chunk-67VS6QHJ.mjs} +26 -12
  8. package/dist/{chunk-EHGFW5GX.mjs → chunk-6JAAXPBW.mjs} +4 -3
  9. package/dist/{chunk-JHMT5Q6P.mjs → chunk-6NYC7EY2.mjs} +29 -15
  10. package/dist/{chunk-6BDDX2R4.mjs → chunk-73Z7N7VG.mjs} +1 -4
  11. package/dist/{chunk-F3ZVVVYD.mjs → chunk-7C7SG3SS.mjs} +15 -3
  12. package/dist/{chunk-CHEXI7MO.mjs → chunk-7TJE7OYH.mjs} +4 -3
  13. package/dist/{chunk-AU6IC6K7.mjs → chunk-ABNS4B5V.mjs} +35 -15
  14. package/dist/{chunk-EGIMTTZA.mjs → chunk-BOHE5URZ.mjs} +18 -3
  15. package/dist/{chunk-5RIHHZF6.mjs → chunk-BQK7LH2L.mjs} +4 -1
  16. package/dist/{chunk-E6EZHSGY.mjs → chunk-BSOLH6R5.mjs} +0 -1
  17. package/dist/{chunk-RSM6FOWX.mjs → chunk-CCC3S6LK.mjs} +6 -3
  18. package/dist/{chunk-U75YXWSA.mjs → chunk-CLTRADS7.mjs} +17 -5
  19. package/dist/{chunk-BEIPGX74.mjs → chunk-DRLQCY7R.mjs} +162 -7
  20. package/dist/{chunk-KBJANUZZ.mjs → chunk-E523VGZP.mjs} +1 -1
  21. package/dist/{chunk-D3U2NJ32.mjs → chunk-FEQ7PZXI.mjs} +8 -2
  22. package/dist/{chunk-PE5OA4YG.mjs → chunk-FHUGOSEY.mjs} +8 -2
  23. package/dist/{chunk-OAPIT53X.mjs → chunk-FIEECAJV.mjs} +7 -10
  24. package/dist/{chunk-7SFB77JR.mjs → chunk-GBPMQJJJ.mjs} +8 -1
  25. package/dist/{chunk-6AMWX5K4.mjs → chunk-GQOPDD44.mjs} +1 -1
  26. package/dist/{chunk-5RXYJWNA.mjs → chunk-H4DEIGEG.mjs} +77 -25
  27. package/dist/{chunk-EZYOCPMM.mjs → chunk-IK2WHKDA.mjs} +29 -15
  28. package/dist/{chunk-HGXD57QM.mjs → chunk-JBS3AESR.mjs} +65 -23
  29. package/dist/{chunk-PYRKFQ6J.mjs → chunk-JIU5UEOU.mjs} +70 -26
  30. package/dist/{chunk-JALHMWKW.mjs → chunk-K5MHUMKR.mjs} +2 -2
  31. package/dist/{chunk-5E4LINDO.mjs → chunk-LH2V2JMZ.mjs} +26 -10
  32. package/dist/{chunk-PQBKN2NH.mjs → chunk-LRFKHJDU.mjs} +14 -5
  33. package/dist/{chunk-W5XFWVNV.mjs → chunk-M4FWWEMX.mjs} +15 -6
  34. package/dist/{chunk-VLW3UBIR.mjs → chunk-N2XV37BL.mjs} +37 -41
  35. package/dist/{chunk-2LIIMWBR.mjs → chunk-OYU47A57.mjs} +1 -2
  36. package/dist/{chunk-KU2Q5V3L.mjs → chunk-P62TYR3M.mjs} +18 -2
  37. package/dist/{chunk-P5FDKBXG.mjs → chunk-P7X46BAW.mjs} +70 -3
  38. package/dist/{chunk-KROVW4AW.mjs → chunk-PJQTRDIG.mjs} +13 -3
  39. package/dist/{chunk-26OI3TEA.mjs → chunk-PMQSXEMT.mjs} +42 -6
  40. package/dist/{chunk-XLNK3Z2P.mjs → chunk-POWDTOMF.mjs} +88 -79
  41. package/dist/{chunk-AXDBME5A.mjs → chunk-PSGVG4TN.mjs} +38 -21
  42. package/dist/{chunk-7DWWNFRP.mjs → chunk-PWWWACHC.mjs} +1 -1
  43. package/dist/{chunk-UUWTKCMY.mjs → chunk-QWLD5FMJ.mjs} +1 -1
  44. package/dist/{chunk-ALIUAGJO.mjs → chunk-QZLOF36M.mjs} +7 -13
  45. package/dist/{chunk-WLYQHKLZ.mjs → chunk-QZRSFGZZ.mjs} +50 -11
  46. package/dist/{chunk-37W7XTA6.mjs → chunk-RHQWQJ4I.mjs} +4 -3
  47. package/dist/{chunk-32X54QKW.mjs → chunk-RRLE7QRH.mjs} +43 -22
  48. package/dist/{chunk-RID7A5V7.mjs → chunk-RRNQL6MJ.mjs} +23 -6
  49. package/dist/{chunk-VJ6YM2EW.mjs → chunk-S4BKVFQ7.mjs} +1 -1
  50. package/dist/{chunk-LPZBXTJ6.mjs → chunk-SAC4PAG3.mjs} +4 -4
  51. package/dist/{chunk-W5RZPTFD.mjs → chunk-SNNT64HK.mjs} +13 -2
  52. package/dist/{chunk-N3C6YI7I.mjs → chunk-SWMYIORV.mjs} +22 -7
  53. package/dist/{chunk-U4B5QT72.mjs → chunk-SX3NAN4M.mjs} +1 -1
  54. package/dist/{chunk-JL3CN4UK.mjs → chunk-TDBMAKTJ.mjs} +10 -3
  55. package/dist/chunk-UEGNXN5B.mjs +28 -0
  56. package/dist/{chunk-NEEGXKJW.mjs → chunk-UGHLEKEZ.mjs} +22 -3
  57. package/dist/{chunk-HKYRRQS7.mjs → chunk-UNQO7EVG.mjs} +1 -1
  58. package/dist/{chunk-VN2TWPRC.mjs → chunk-UR5F74ZB.mjs} +112 -18
  59. package/dist/{chunk-VCCK4CDT.mjs → chunk-URPXBKK4.mjs} +23 -5
  60. package/dist/{chunk-7KCOF5US.mjs → chunk-VY6FVIOZ.mjs} +10 -8
  61. package/dist/{chunk-KICZSLOX.mjs → chunk-W2ICYZVU.mjs} +1 -1
  62. package/dist/{chunk-FIVVKBBF.mjs → chunk-W3QOMJKQ.mjs} +8 -6
  63. package/dist/{chunk-DCMRB3HR.mjs → chunk-WV25G4M3.mjs} +4 -3
  64. package/dist/{chunk-ZOYHZF4N.mjs → chunk-X5LJT76O.mjs} +49 -32
  65. package/dist/{chunk-BNYA5IUB.mjs → chunk-YNXP34KO.mjs} +39 -38
  66. package/dist/{chunk-2T2NEZRZ.mjs → chunk-YVDTXHQ6.mjs} +1 -1
  67. package/dist/{chunk-AUMTHL6N.mjs → chunk-ZOP7PEKY.mjs} +2 -1
  68. package/dist/components/ActivityFeed.d.mts +29 -11
  69. package/dist/components/ActivityFeed.mjs +2 -2
  70. package/dist/components/Affix.mjs +1 -1
  71. package/dist/components/Alert.d.mts +2 -2
  72. package/dist/components/Anchor.d.mts +1 -1
  73. package/dist/components/Anchor.mjs +1 -1
  74. package/dist/components/AreaChart.d.mts +3 -3
  75. package/dist/components/AreaChart.mjs +4 -3
  76. package/dist/components/AutoComplete.d.mts +5 -5
  77. package/dist/components/AutoComplete.mjs +1 -1
  78. package/dist/components/Avatar.d.mts +1 -1
  79. package/dist/components/AvatarGroup.d.mts +1 -1
  80. package/dist/components/BackTop.d.mts +2 -2
  81. package/dist/components/Badge.d.mts +4 -4
  82. package/dist/components/BarChart.d.mts +2 -2
  83. package/dist/components/BarChart.mjs +4 -3
  84. package/dist/components/Breadcrumb.d.mts +3 -3
  85. package/dist/components/Button.d.mts +3 -3
  86. package/dist/components/ButtonGroup.d.mts +1 -1
  87. package/dist/components/Calendar.d.mts +1 -1
  88. package/dist/components/Calendar.mjs +1 -1
  89. package/dist/components/Card.d.mts +2 -2
  90. package/dist/components/Cascader.d.mts +3 -3
  91. package/dist/components/Cascader.mjs +1 -1
  92. package/dist/components/ChartCanvas.d.mts +8 -4
  93. package/dist/components/ChartCanvas.mjs +1 -1
  94. package/dist/components/ChartGrid.d.mts +1 -1
  95. package/dist/components/ChartLegend.d.mts +1 -1
  96. package/dist/components/ChatWindow.d.mts +30 -12
  97. package/dist/components/ChatWindow.mjs +3 -3
  98. package/dist/components/Checkbox.d.mts +1 -1
  99. package/dist/components/Code.d.mts +33 -6
  100. package/dist/components/Code.mjs +3 -1
  101. package/dist/components/CodeEditor.d.mts +3 -3
  102. package/dist/components/Collapse.d.mts +1 -1
  103. package/dist/components/CollapsePanel.d.mts +1 -1
  104. package/dist/components/CollapsePanel.mjs +1 -1
  105. package/dist/components/ColorPicker.mjs +1 -1
  106. package/dist/components/ColorSwatch.d.mts +8 -2
  107. package/dist/components/ColorSwatch.mjs +1 -1
  108. package/dist/components/CommentThread.d.mts +62 -26
  109. package/dist/components/CommentThread.mjs +2 -2
  110. package/dist/components/Container.d.mts +1 -1
  111. package/dist/components/ContextMenu.d.mts +1 -1
  112. package/dist/components/Countdown.d.mts +2 -2
  113. package/dist/components/CronEditor.d.mts +3 -3
  114. package/dist/components/DataExport.mjs +2 -2
  115. package/dist/components/DataTableWithToolbar.d.mts +9 -9
  116. package/dist/components/DataTableWithToolbar.mjs +7 -7
  117. package/dist/components/DatePicker.d.mts +4 -4
  118. package/dist/components/Descriptions.d.mts +2 -2
  119. package/dist/components/DonutChart.d.mts +3 -3
  120. package/dist/components/DonutChart.mjs +4 -4
  121. package/dist/components/Drawer.d.mts +3 -3
  122. package/dist/components/Dropdown.d.mts +20 -1
  123. package/dist/components/Dropdown.mjs +1 -1
  124. package/dist/components/FileManager.d.mts +9 -3
  125. package/dist/components/FileManager.mjs +1 -1
  126. package/dist/components/FloatButton.d.mts +34 -4
  127. package/dist/components/FloatButton.mjs +1 -1
  128. package/dist/components/Form.d.mts +2 -2
  129. package/dist/components/FormWizard.d.mts +5 -5
  130. package/dist/components/FormWizard.mjs +1 -1
  131. package/dist/components/FunnelChart.d.mts +3 -3
  132. package/dist/components/FunnelChart.mjs +3 -3
  133. package/dist/components/Gantt.d.mts +5 -3
  134. package/dist/components/Gantt.mjs +2 -2
  135. package/dist/components/GaugeChart.d.mts +2 -2
  136. package/dist/components/GaugeChart.mjs +2 -2
  137. package/dist/components/HeatmapChart.d.mts +3 -3
  138. package/dist/components/HeatmapChart.mjs +3 -3
  139. package/dist/components/Icon.d.mts +2 -2
  140. package/dist/components/Image.d.mts +2 -2
  141. package/dist/components/Image.mjs +3 -3
  142. package/dist/components/ImageAnnotation.d.mts +5 -5
  143. package/dist/components/ImageCompare.d.mts +2 -2
  144. package/dist/components/ImageGroup.mjs +2 -2
  145. package/dist/components/ImagePreview.mjs +1 -1
  146. package/dist/components/InfiniteScroll.d.mts +3 -3
  147. package/dist/components/Input.d.mts +3 -3
  148. package/dist/components/Input.mjs +1 -1
  149. package/dist/components/InputGroup.d.mts +1 -1
  150. package/dist/components/InputNumber.d.mts +1 -1
  151. package/dist/components/InputNumber.mjs +1 -1
  152. package/dist/components/InputOTP.d.mts +5 -5
  153. package/dist/components/Kanban.mjs +2 -2
  154. package/dist/components/Kbd.d.mts +1 -1
  155. package/dist/components/LineChart.d.mts +2 -2
  156. package/dist/components/LineChart.mjs +4 -3
  157. package/dist/components/Link.d.mts +1 -1
  158. package/dist/components/List.d.mts +6 -6
  159. package/dist/components/List.mjs +2 -2
  160. package/dist/components/Loading.d.mts +6 -6
  161. package/dist/components/Loading.mjs +1 -1
  162. package/dist/components/LoadingBarContainer.d.mts +3 -3
  163. package/dist/components/MarkdownEditor.d.mts +3 -3
  164. package/dist/components/Marquee.d.mts +2 -2
  165. package/dist/components/MaskInput.d.mts +11 -5
  166. package/dist/components/MaskInput.mjs +1 -1
  167. package/dist/components/Mentions.d.mts +3 -3
  168. package/dist/components/Menu.d.mts +4 -4
  169. package/dist/components/Modal.d.mts +6 -6
  170. package/dist/components/NavigationMenu.d.mts +5 -5
  171. package/dist/components/NotificationCenter.d.mts +46 -28
  172. package/dist/components/NotificationCenter.mjs +4 -4
  173. package/dist/components/NumberKeyboard.d.mts +6 -6
  174. package/dist/components/OrgChart.d.mts +3 -3
  175. package/dist/components/OrgChart.mjs +2 -2
  176. package/dist/components/Pagination.d.mts +4 -4
  177. package/dist/components/Pagination.mjs +1 -1
  178. package/dist/components/PieChart.d.mts +3 -3
  179. package/dist/components/PieChart.mjs +3 -3
  180. package/dist/components/Popconfirm.d.mts +2 -2
  181. package/dist/components/Popconfirm.mjs +2 -2
  182. package/dist/components/Popover.d.mts +1 -1
  183. package/dist/components/Popover.mjs +2 -2
  184. package/dist/components/Progress.d.mts +3 -3
  185. package/dist/components/QRCode.d.mts +4 -13
  186. package/dist/components/QRCode.mjs +1 -1
  187. package/dist/components/RadarChart.d.mts +3 -3
  188. package/dist/components/RadarChart.mjs +3 -3
  189. package/dist/components/Radio.d.mts +1 -1
  190. package/dist/components/Radio.mjs +1 -1
  191. package/dist/components/Rate.d.mts +1 -1
  192. package/dist/components/Rate.mjs +1 -1
  193. package/dist/components/Result.d.mts +1 -1
  194. package/dist/components/RichTextEditor.d.mts +2 -2
  195. package/dist/components/Row.d.mts +1 -1
  196. package/dist/components/ScatterChart.d.mts +2 -2
  197. package/dist/components/ScatterChart.mjs +4 -3
  198. package/dist/components/ScrollArea.d.mts +2 -2
  199. package/dist/components/ScrollSpy.d.mts +3 -3
  200. package/dist/components/ScrollSpy.mjs +1 -1
  201. package/dist/components/Select.d.mts +3 -3
  202. package/dist/components/Signature.d.mts +4 -4
  203. package/dist/components/Signature.mjs +1 -1
  204. package/dist/components/Skeleton.d.mts +1 -1
  205. package/dist/components/Slider.d.mts +18 -0
  206. package/dist/components/Slider.mjs +1 -1
  207. package/dist/components/Space.d.mts +2 -2
  208. package/dist/components/SplitButton.d.mts +5 -5
  209. package/dist/components/SplitButton.mjs +2 -2
  210. package/dist/components/Splitter.d.mts +5 -5
  211. package/dist/components/Splitter.mjs +1 -1
  212. package/dist/components/Spotlight.d.mts +4 -4
  213. package/dist/components/Stepper.d.mts +7 -1
  214. package/dist/components/Stepper.mjs +1 -1
  215. package/dist/components/Steps.d.mts +3 -3
  216. package/dist/components/SunburstChart.d.mts +2 -2
  217. package/dist/components/SunburstChart.mjs +3 -3
  218. package/dist/components/Switch.d.mts +22 -6
  219. package/dist/components/Switch.mjs +1 -1
  220. package/dist/components/Table.d.mts +9 -9
  221. package/dist/components/Table.mjs +3 -3
  222. package/dist/components/Tabs.d.mts +3 -3
  223. package/dist/components/Tag.d.mts +2 -2
  224. package/dist/components/TagsInput.d.mts +5 -5
  225. package/dist/components/TaskBoard.mjs +1 -1
  226. package/dist/components/Text.d.mts +3 -3
  227. package/dist/components/Textarea.d.mts +3 -3
  228. package/dist/components/Textarea.mjs +1 -1
  229. package/dist/components/TimePicker.d.mts +4 -4
  230. package/dist/components/Timeline.d.mts +3 -3
  231. package/dist/components/Tooltip.d.mts +1 -1
  232. package/dist/components/Tooltip.mjs +2 -2
  233. package/dist/components/Tour.d.mts +2 -2
  234. package/dist/components/Tour.mjs +1 -1
  235. package/dist/components/Transfer.d.mts +5 -4
  236. package/dist/components/Transfer.mjs +1 -1
  237. package/dist/components/Tree.d.mts +4 -4
  238. package/dist/components/TreeMapChart.d.mts +2 -2
  239. package/dist/components/TreeMapChart.mjs +3 -3
  240. package/dist/components/TreeSelect.d.mts +3 -3
  241. package/dist/components/TreeSelect.mjs +1 -1
  242. package/dist/components/Upload.d.mts +2 -2
  243. package/dist/components/Upload.mjs +1 -1
  244. package/dist/components/VirtualTable.d.mts +3 -3
  245. package/dist/components/Watermark.d.mts +1 -1
  246. package/dist/composables/useChartInteraction.d.mts +5 -0
  247. package/dist/composables/useChartInteraction.mjs +1 -1
  248. package/dist/index.d.mts +1 -1
  249. package/dist/index.mjs +51 -0
  250. package/package.json +2 -2
@@ -1,13 +1,16 @@
1
1
  import {
2
2
  ChartCanvas
3
- } from "./chunk-W5RZPTFD.mjs";
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(props.data, {
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
- onClick: () => selectTask(task),
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();
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SPFL55TF.mjs";
4
4
  import {
5
5
  ChartCanvas
6
- } from "./chunk-W5RZPTFD.mjs";
6
+ } from "./chunk-SNNT64HK.mjs";
7
7
 
8
8
  // src/components/GaugeChart.ts
9
9
  import { defineComponent, computed, h, ref, watch, onBeforeUnmount, useId } from "vue";
@@ -19,6 +19,7 @@ var ColorSwatch = defineComponent({
19
19
  name: "TigerColorSwatch",
20
20
  props: {
21
21
  modelValue: { type: String, default: void 0 },
22
+ defaultValue: { type: String },
22
23
  disabled: { type: Boolean, default: false },
23
24
  size: { type: String, default: "md" },
24
25
  colors: { type: Array, default: void 0 },
@@ -28,12 +29,16 @@ var ColorSwatch = defineComponent({
28
29
  },
29
30
  emits: ["update:modelValue", "change"],
30
31
  setup(props, { attrs, emit }) {
32
+ const innerValue = ref(props.defaultValue);
31
33
  const focusIndex = ref(-1);
32
34
  const optionRefs = ref([]);
33
35
  const normalizedGroups = computed(() => normalizeColorSwatchGroups(props.groups, props.colors));
34
36
  const options = computed(() => flattenColorSwatchGroups(normalizedGroups.value));
37
+ const selectedValue = computed(
38
+ () => props.modelValue !== void 0 ? props.modelValue : innerValue.value
39
+ );
35
40
  const selectedIndex = computed(
36
- () => options.value.findIndex((option) => isColorSwatchSelected(option.value, props.modelValue))
41
+ () => options.value.findIndex((option) => isColorSwatchSelected(option.value, selectedValue.value))
37
42
  );
38
43
  const firstEnabledIndex = computed(() => options.value.findIndex((option) => !option.disabled));
39
44
  const activeIndex = computed(
@@ -41,6 +46,7 @@ var ColorSwatch = defineComponent({
41
46
  );
42
47
  function handleSelect(option) {
43
48
  if (props.disabled || option.disabled) return;
49
+ if (props.modelValue === void 0) innerValue.value = option.value;
44
50
  emit("update:modelValue", option.value);
45
51
  emit("change", option.value, option);
46
52
  }
@@ -89,7 +95,7 @@ var ColorSwatch = defineComponent({
89
95
  group.colors.map((option) => {
90
96
  const optionIndex = flatIndex;
91
97
  flatIndex += 1;
92
- const selected = isColorSwatchSelected(option.value, props.modelValue);
98
+ const selected = isColorSwatchSelected(option.value, selectedValue.value);
93
99
  const optionDisabled = props.disabled || !!option.disabled;
94
100
  const tabIndex = !optionDisabled && optionIndex === (focusIndex.value >= 0 ? focusIndex.value : activeIndex.value) ? 0 : -1;
95
101
  return h(
@@ -10,6 +10,8 @@ function unref(value) {
10
10
  }
11
11
  function useChartInteraction(options) {
12
12
  const { emit, getData, eventNames } = options;
13
+ const isHoverable = () => unref(options.hoverable);
14
+ const isShowTooltip = () => options.showTooltip === void 0 ? true : unref(options.showTooltip);
13
15
  const localHoveredIndex = ref(null);
14
16
  const localSelectedIndex = ref(null);
15
17
  const tooltipPosition = ref({ x: 0, y: 0 });
@@ -43,11 +45,13 @@ function useChartInteraction(options) {
43
45
  });
44
46
  };
45
47
  const handleMouseEnter = (index, event) => {
46
- if (!unref(options.hoverable)) return;
48
+ const hoverable = isHoverable();
49
+ if (!hoverable && !isShowTooltip()) return;
47
50
  if (options.hoveredIndexProp?.() === void 0) {
48
51
  localHoveredIndex.value = index;
49
52
  }
50
53
  tooltipPosition.value = { x: event.clientX, y: event.clientY };
54
+ if (!hoverable) return;
51
55
  emit("update:hoveredIndex", index);
52
56
  if (eventNames?.hover && getData) {
53
57
  emit(eventNames.hover, index, getData(index));
@@ -58,10 +62,12 @@ function useChartInteraction(options) {
58
62
  };
59
63
  const handleMouseLeave = () => {
60
64
  tooltipScheduler.cancel();
61
- if (!unref(options.hoverable)) return;
65
+ const hoverable = isHoverable();
66
+ if (!hoverable && !isShowTooltip()) return;
62
67
  if (options.hoveredIndexProp?.() === void 0) {
63
68
  localHoveredIndex.value = null;
64
69
  }
70
+ if (!hoverable) return;
65
71
  emit("update:hoveredIndex", null);
66
72
  if (eventNames?.hover) {
67
73
  emit(eventNames.hover, null, null);
@@ -30,9 +30,10 @@ import {
30
30
  tourFooterClasses,
31
31
  tourIndicatorClasses,
32
32
  tourCloseButtonClasses,
33
+ tourMaskClasses,
33
34
  getTourTargetRect,
34
35
  getTourPopoverPosition,
35
- getTourSpotlightStyle,
36
+ getTourMaskHoleStyle,
36
37
  getActiveTourSteps,
37
38
  getCurrentActiveTourStep,
38
39
  getActiveTourStepPosition,
@@ -161,6 +162,7 @@ var Tour = defineComponent({
161
162
  goTo(nextStep.index);
162
163
  } else {
163
164
  emit("finish");
165
+ emit("close");
164
166
  emit("update:open", false);
165
167
  }
166
168
  };
@@ -215,18 +217,13 @@ var Tour = defineComponent({
215
217
  };
216
218
  }
217
219
  const children = [];
218
- if (showMask && targetRect.value) {
220
+ if (showMask) {
219
221
  children.push(
220
222
  h("div", {
221
- style: getTourSpotlightStyle(targetRect.value),
222
- "aria-hidden": "true"
223
- })
224
- );
225
- } else if (showMask) {
226
- children.push(
227
- h("div", {
228
- class: "fixed inset-0 z-[1000] bg-black/45",
223
+ class: tourMaskClasses,
224
+ "data-tiger-tour-mask": "",
229
225
  "aria-hidden": "true",
226
+ style: targetRect.value ? getTourMaskHoleStyle(targetRect.value) : void 0,
230
227
  onClick: close
231
228
  })
232
229
  );
@@ -12,6 +12,7 @@ import {
12
12
  import {
13
13
  classNames,
14
14
  coerceClassValue,
15
+ createProgrammaticScrollLock,
15
16
  createScrollSpyObserver,
16
17
  createScrollSpyPayload,
17
18
  flattenScrollSpyItems,
@@ -93,6 +94,7 @@ var ScrollSpy = defineComponent({
93
94
  );
94
95
  const flatItems = computed(() => flattenScrollSpyItems(props.items));
95
96
  let stopObserver = null;
97
+ const scrollLock = createProgrammaticScrollLock(() => props.getContainer());
96
98
  const emitActive = (item, source) => {
97
99
  const nextKeyString = getScrollSpyKeyString(item.key);
98
100
  if (nextKeyString === activeKeyString.value) return;
@@ -108,7 +110,10 @@ var ScrollSpy = defineComponent({
108
110
  offsetTop: props.offsetTop,
109
111
  targetOffset: props.targetOffset,
110
112
  bounds: props.bounds,
111
- onChange: (item) => emitActive(item, "scroll")
113
+ onChange: (item) => {
114
+ if (scrollLock.isLocked()) return;
115
+ emitActive(item, "scroll");
116
+ }
112
117
  });
113
118
  };
114
119
  const handleClick = (item, event) => {
@@ -116,6 +121,7 @@ var ScrollSpy = defineComponent({
116
121
  if (item.disabled) return;
117
122
  emit("click", item, event);
118
123
  emitActive(item, "click");
124
+ scrollLock.lock();
119
125
  scrollToScrollSpyItem(item, props.getContainer(), props.targetOffset ?? props.offsetTop);
120
126
  };
121
127
  onMounted(() => {
@@ -141,6 +147,7 @@ var ScrollSpy = defineComponent({
141
147
  );
142
148
  onBeforeUnmount(() => {
143
149
  stopObserver?.();
150
+ scrollLock.dispose();
144
151
  });
145
152
  const renderItems = (items, nested = false) => h(
146
153
  "ul",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Pagination
3
- } from "./chunk-2LIIMWBR.mjs";
3
+ } from "./chunk-OYU47A57.mjs";
4
4
  import {
5
5
  VirtualList
6
6
  } from "./chunk-HS4YQGZQ.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Textarea
3
- } from "./chunk-2OI6GWOT.mjs";
3
+ } from "./chunk-3KAHJF7D.mjs";
4
4
  import {
5
5
  Button
6
6
  } from "./chunk-YZBQ6IR7.mjs";
@@ -13,6 +13,9 @@ import {
13
13
  import {
14
14
  Avatar
15
15
  } from "./chunk-ZFTRR3KW.mjs";
16
+ import {
17
+ useTigerConfig
18
+ } from "./chunk-UOJOJBEU.mjs";
16
19
 
17
20
  // src/components/CommentThread.ts
18
21
  import { defineComponent, computed, h, ref } from "vue";
@@ -22,7 +25,13 @@ import {
22
25
  mergeStyleValues,
23
26
  buildCommentTree,
24
27
  clipCommentTreeDepth,
25
- formatCommentTime
28
+ formatCommentTime,
29
+ getCommentThreadLabels,
30
+ mergeTigerLocale,
31
+ nextCommentLikeState,
32
+ resolveCommentLikeState,
33
+ resolveLocaleText,
34
+ writeCommentLikeOverlay
26
35
  } from "@expcat/tigercat-core";
27
36
 
28
37
  // ../core/src/internal/comment-thread-styles.ts
@@ -79,39 +88,55 @@ var CommentThread = defineComponent({
79
88
  },
80
89
  emptyText: {
81
90
  type: String,
82
- default: "\u6682\u65E0\u8BC4\u8BBA"
91
+ default: void 0
83
92
  },
84
93
  replyPlaceholder: {
85
94
  type: String,
86
- default: "\u5199\u4E0B\u56DE\u590D..."
95
+ default: void 0
87
96
  },
88
97
  replyButtonText: {
89
98
  type: String,
90
- default: "\u56DE\u590D"
99
+ default: void 0
91
100
  },
92
101
  cancelReplyText: {
93
102
  type: String,
94
- default: "\u53D6\u6D88"
103
+ default: void 0
95
104
  },
96
105
  likeText: {
97
106
  type: String,
98
- default: "\u70B9\u8D5E"
107
+ default: void 0
99
108
  },
100
109
  likedText: {
101
110
  type: String,
102
- default: "\u5DF2\u8D5E"
111
+ default: void 0
103
112
  },
104
113
  replyText: {
105
114
  type: String,
106
- default: "\u56DE\u590D"
115
+ default: void 0
107
116
  },
108
117
  moreText: {
109
118
  type: String,
110
- default: "\u66F4\u591A"
119
+ default: void 0
111
120
  },
112
121
  loadMoreText: {
113
122
  type: String,
114
- default: "\u52A0\u8F7D\u66F4\u591A"
123
+ default: void 0
124
+ },
125
+ collapseRepliesText: {
126
+ type: String,
127
+ default: void 0
128
+ },
129
+ expandRepliesText: {
130
+ type: String,
131
+ default: void 0
132
+ },
133
+ locale: {
134
+ type: Object,
135
+ default: void 0
136
+ },
137
+ labels: {
138
+ type: Object,
139
+ default: void 0
115
140
  },
116
141
  showAvatar: {
117
142
  type: Boolean,
@@ -144,8 +169,12 @@ var CommentThread = defineComponent({
144
169
  },
145
170
  emits: ["like", "reply", "more", "action", "update:expandedKeys", "load-more"],
146
171
  setup(props, { emit, attrs }) {
172
+ const config = useTigerConfig();
173
+ const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
174
+ const labels = computed(() => getCommentThreadLabels(mergedLocale.value, props.labels));
147
175
  const innerExpandedKeys = ref([...props.defaultExpandedKeys]);
148
176
  const expandedAllKeys = ref(/* @__PURE__ */ new Set());
177
+ const likeOverlay = ref(/* @__PURE__ */ new Map());
149
178
  const replyingTo = ref(null);
150
179
  const replyValue = ref("");
151
180
  const mergedExpandedKeys = computed(() => props.expandedKeys ?? innerExpandedKeys.value);
@@ -177,6 +206,11 @@ var CommentThread = defineComponent({
177
206
  expandedAllKeys.value = /* @__PURE__ */ new Set([...expandedAllKeys.value, node.id]);
178
207
  emit("load-more", node);
179
208
  };
209
+ const handleLike = (node) => {
210
+ const next = nextCommentLikeState(node, likeOverlay.value);
211
+ likeOverlay.value = writeCommentLikeOverlay(likeOverlay.value, node.id, next);
212
+ emit("like", node, next.liked);
213
+ };
180
214
  const handleReplySubmit = (node) => {
181
215
  const trimmed = replyValue.value.trim();
182
216
  if (!trimmed) return;
@@ -199,8 +233,9 @@ var CommentThread = defineComponent({
199
233
  const showLoadMore = showReplies && props.maxReplies > 0 && children.length > props.maxReplies && !showAllReplies;
200
234
  const actions = [];
201
235
  if (props.showLike) {
202
- const likeLabel = node.liked ? props.likedText : props.likeText;
203
- const likeCount = node.likes ? ` ${node.likes}` : "";
236
+ const { liked, likes } = resolveCommentLikeState(node, likeOverlay.value);
237
+ const likeLabel = liked ? resolveLocaleText(labels.value.likedText, props.likedText) : resolveLocaleText(labels.value.likeText, props.likeText);
238
+ const likeCount = likes ? ` ${likes}` : "";
204
239
  actions.push(
205
240
  h(
206
241
  Button,
@@ -211,9 +246,9 @@ var CommentThread = defineComponent({
211
246
  className: classNames(
212
247
  commentThreadActionButtonClasses,
213
248
  commentThreadLikeButtonClasses,
214
- node.liked && commentThreadLikedButtonClasses
249
+ liked && commentThreadLikedButtonClasses
215
250
  ),
216
- onClick: () => emit("like", node, !node.liked)
251
+ onClick: () => handleLike(node)
217
252
  },
218
253
  {
219
254
  default: () => h("span", { class: "flex items-center gap-1.5" }, [
@@ -222,7 +257,7 @@ var CommentThread = defineComponent({
222
257
  {
223
258
  class: classNames(
224
259
  commentThreadLikeIconClasses,
225
- node.liked ? "fill-current" : "stroke-current fill-none"
260
+ liked ? "fill-current" : "stroke-current fill-none"
226
261
  ),
227
262
  viewBox: "0 0 24 24",
228
263
  strokeWidth: "2"
@@ -277,7 +312,7 @@ var CommentThread = defineComponent({
277
312
  })
278
313
  ]
279
314
  ),
280
- h("span", props.replyText)
315
+ h("span", resolveLocaleText(labels.value.replyText, props.replyText))
281
316
  ])
282
317
  }
283
318
  )
@@ -316,7 +351,7 @@ var CommentThread = defineComponent({
316
351
  })
317
352
  ]
318
353
  ),
319
- h("span", props.moreText)
354
+ h("span", resolveLocaleText(labels.value.moreText, props.moreText))
320
355
  ])
321
356
  }
322
357
  )
@@ -436,7 +471,10 @@ var CommentThread = defineComponent({
436
471
  h(Textarea, {
437
472
  rows: 3,
438
473
  modelValue: replyValue.value,
439
- placeholder: props.replyPlaceholder,
474
+ placeholder: resolveLocaleText(
475
+ labels.value.replyPlaceholder,
476
+ props.replyPlaceholder
477
+ ),
440
478
  className: commentThreadReplyTextareaClasses,
441
479
  "onUpdate:modelValue": (value) => {
442
480
  replyValue.value = value;
@@ -454,7 +492,9 @@ var CommentThread = defineComponent({
454
492
  replyValue.value = "";
455
493
  }
456
494
  },
457
- { default: () => props.cancelReplyText }
495
+ {
496
+ default: () => resolveLocaleText(labels.value.cancelReplyText, props.cancelReplyText)
497
+ }
458
498
  ),
459
499
  h(
460
500
  Button,
@@ -464,7 +504,9 @@ var CommentThread = defineComponent({
464
504
  className: commentThreadSubmitButtonClasses,
465
505
  onClick: () => handleReplySubmit(node)
466
506
  },
467
- { default: () => props.replyButtonText }
507
+ {
508
+ default: () => resolveLocaleText(labels.value.replyButtonText, props.replyButtonText)
509
+ }
468
510
  )
469
511
  ])
470
512
  ]
@@ -483,7 +525,13 @@ var CommentThread = defineComponent({
483
525
  onClick: () => toggleExpanded(node.id)
484
526
  },
485
527
  {
486
- default: () => isExpanded ? "\u25BE \u6536\u8D77\u56DE\u590D" : `\u25B8 \u5C55\u5F00 ${children.length} \u6761\u56DE\u590D`
528
+ default: () => isExpanded ? resolveLocaleText(
529
+ labels.value.collapseRepliesText,
530
+ props.collapseRepliesText
531
+ ) : resolveLocaleText(
532
+ labels.value.expandRepliesText,
533
+ props.expandRepliesText
534
+ ).replace("{count}", String(children.length))
487
535
  }
488
536
  ) : null,
489
537
  showReplies ? h(
@@ -504,7 +552,9 @@ var CommentThread = defineComponent({
504
552
  className: commentThreadPrimaryButtonClasses,
505
553
  onClick: () => handleLoadMore(node)
506
554
  },
507
- { default: () => props.loadMoreText }
555
+ {
556
+ default: () => resolveLocaleText(labels.value.loadMoreText, props.loadMoreText)
557
+ }
508
558
  ) : null
509
559
  ]
510
560
  ) : null
@@ -514,7 +564,7 @@ var CommentThread = defineComponent({
514
564
  );
515
565
  };
516
566
  return () => {
517
- const ariaLabel = attrs["aria-label"] ?? (attrs["aria-labelledby"] ? void 0 : "\u8BC4\u8BBA\u7EBF\u7A0B");
567
+ const ariaLabel = attrs["aria-label"] ?? (attrs["aria-labelledby"] ? void 0 : "Comment thread");
518
568
  const children = resolvedNodes.value.length === 0 ? [
519
569
  h(
520
570
  "div",
@@ -542,7 +592,9 @@ var CommentThread = defineComponent({
542
592
  h(
543
593
  Text,
544
594
  { tag: "div", size: "sm", color: "muted", class: "font-medium" },
545
- { default: () => props.emptyText }
595
+ {
596
+ default: () => resolveLocaleText(labels.value.emptyText, props.emptyText)
597
+ }
546
598
  )
547
599
  ]
548
600
  )