vlite3 1.4.31 → 1.4.33
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/components/Accordion/Accordion.vue.js +19 -16
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionItem.vue.js +38 -36
- package/components/CategoryManager/CategoryManager.vue2.js +4 -3
- package/components/CategoryManager/CategoryNode.vue.js +30 -30
- package/components/CategoryMenu/CategoryMenu.vue.js +9 -11
- package/components/Chart/GanttChart.vue.d.ts +18 -2
- package/components/Chart/GanttChart.vue.js +1 -1
- package/components/Chart/GanttChart.vue2.js +1347 -604
- package/components/Chart/GanttChartConnectorRouting.d.ts +83 -0
- package/components/Chart/GanttChartConnectorRouting.js +405 -0
- package/components/Chart/GanttChartDateUtils.d.ts +38 -0
- package/components/Chart/GanttChartDateUtils.js +79 -0
- package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
- package/components/Chart/GanttChartDependencyUtils.js +109 -0
- package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
- package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
- package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
- package/components/Chart/GanttChartTooltipUtils.js +63 -0
- package/components/Chart/index.d.ts +3 -1
- package/components/Chart/types.d.ts +92 -2
- package/components/Chart/types.js +8 -0
- package/components/ColorPicker/ColorIro.vue2.js +155 -0
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.d.ts +5 -0
- package/components/ColorPicker/ColorPicker.vue.js +111 -65
- package/components/ColorPicker/constants.d.ts +2 -0
- package/components/ColorPicker/constants.js +4 -0
- package/components/ColorPicker/index.d.ts +1 -0
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/Dropdown/Dropdown.vue.js +100 -97
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Form/AccordionView.vue.js +5 -220
- package/components/Form/AccordionView.vue3.js +250 -0
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +309 -280
- package/components/Form/FormField.vue.js +177 -197
- package/components/Form/FormFields.vue.js +1 -1
- package/components/Form/FormFields.vue2.js +60 -60
- package/components/Form/FormSkeleton.vue.js +50 -35
- package/components/Form/TableView.vue.js +59 -43
- package/components/Form/composables/useForm.js +159 -148
- package/components/Form/index.vue2.js +7 -7
- package/components/Form/utils/form.utils.d.ts +2 -0
- package/components/Form/utils/form.utils.js +17 -13
- package/components/GoogleMap.vue.d.ts +1 -1
- package/components/Kanban/Kanban.vue.d.ts +16 -2
- package/components/Kanban/Kanban.vue.js +2 -2
- package/components/Kanban/Kanban.vue2.js +150 -86
- package/components/Kanban/types.d.ts +37 -0
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
- package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
- package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
- package/components/PanZoomViewport/index.d.ts +2 -0
- package/components/PanZoomViewport/types.d.ts +121 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
- package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
- package/components/ScaleGenerator/types.d.ts +2 -0
- package/components/Screen/ScreenFilter.vue.js +19 -18
- package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
- package/components/SeoProvider/SeoProvider.vue.js +39 -33
- package/components/SeoProvider/domAdapter.d.ts +1 -4
- package/components/SeoProvider/domAdapter.js +71 -58
- package/components/SeoProvider/index.d.ts +5 -2
- package/components/SeoProvider/normalizeSeo.d.ts +10 -49
- package/components/SeoProvider/normalizeSeo.js +246 -182
- package/components/SeoProvider/plainText.d.ts +8 -0
- package/components/SeoProvider/plainText.js +117 -0
- package/components/SeoProvider/seoUrl.d.ts +13 -0
- package/components/SeoProvider/seoUrl.js +25 -0
- package/components/SeoProvider/structuredData.d.ts +100 -0
- package/components/SeoProvider/structuredData.js +33 -0
- package/components/SeoProvider/types.d.ts +47 -109
- package/components/Tabes/Tabes.vue.js +1 -1
- package/components/Tabes/Tabes.vue2.js +215 -193
- package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
- package/components/Tabes/TabesMarkerGeometry.js +21 -0
- package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
- package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
- package/components/ThemeProvider/index.d.ts +1 -1
- package/components/ThemeProvider/themeVars.d.ts +9 -13
- package/components/ThemeProvider/themeVars.js +173 -125
- package/components/ThemeProvider/types.d.ts +10 -0
- package/components/ToastNotification.vue.js +1 -1
- package/components/ToastNotification.vue2.js +3 -3
- package/components/index.d.ts +3 -2
- package/composables/useKeyStroke.d.ts +18 -0
- package/composables/useKeyStroke.js +103 -77
- package/composables/useTheme.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +380 -350
- package/package.json +12 -4
- package/style.css +1 -1
- package/utils/environment.d.ts +29 -0
- package/utils/environment.js +4 -0
- package/utils/functions.js +14 -13
- package/components/ColorPicker/ColorIro.vue.js +0 -141
- package/components/Form/AccordionView.vue2.js +0 -4
- /package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { GANTT_DEPENDENCY_TYPE_LABELS as f } from "./types.js";
|
|
2
|
+
function D(e) {
|
|
3
|
+
return f[e];
|
|
4
|
+
}
|
|
5
|
+
function l(e) {
|
|
6
|
+
const i = /* @__PURE__ */ new Map(), r = (n, t) => {
|
|
7
|
+
!n || !t || n === t || i.set(p(n, t), {
|
|
8
|
+
predecessorId: n,
|
|
9
|
+
successorId: t
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
for (const n of e) {
|
|
13
|
+
for (const t of n.dependencies ?? [])
|
|
14
|
+
r(t, n.id);
|
|
15
|
+
for (const t of n.dependencyLinks ?? [])
|
|
16
|
+
t.type !== "related-to" && (t.type === "waiting-on" ? r(t.taskId, n.id) : t.type === "blocking" && r(n.id, t.taskId));
|
|
17
|
+
}
|
|
18
|
+
return [...i.values()];
|
|
19
|
+
}
|
|
20
|
+
function d(e, i, r) {
|
|
21
|
+
return l(e).some(
|
|
22
|
+
(n) => n.predecessorId === i && n.successorId === r
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function h(e, i, r = 8) {
|
|
26
|
+
const n = e.y + i / 2;
|
|
27
|
+
if (e.milestone) {
|
|
28
|
+
const t = i * 0.4;
|
|
29
|
+
return { cx: e.x + e.fullW / 2 + t + r * 0.5, cy: n };
|
|
30
|
+
}
|
|
31
|
+
return { cx: e.x + e.fullW + r, cy: n };
|
|
32
|
+
}
|
|
33
|
+
function v(e, i, r, n, t = 4) {
|
|
34
|
+
for (let c = e.length - 1; c >= 0; c--) {
|
|
35
|
+
const o = e[c];
|
|
36
|
+
if (o.milestone) {
|
|
37
|
+
const s = o.x + o.fullW / 2, a = o.y + n / 2, u = n * 0.4 + t;
|
|
38
|
+
if (Math.abs(i - s) <= u && Math.abs(r - a) <= u) return o;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (i >= o.x - t && i <= o.x + o.fullW + t && r >= o.y - t && r <= o.y + n + t)
|
|
42
|
+
return o;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
function y(e, i, r) {
|
|
47
|
+
if (i === r) return !0;
|
|
48
|
+
const n = /* @__PURE__ */ new Map();
|
|
49
|
+
for (const o of l(e)) {
|
|
50
|
+
const s = n.get(o.successorId) ?? [];
|
|
51
|
+
s.push(o.predecessorId), n.set(o.successorId, s);
|
|
52
|
+
}
|
|
53
|
+
const t = /* @__PURE__ */ new Set(), c = [i];
|
|
54
|
+
for (; c.length; ) {
|
|
55
|
+
const o = c.shift();
|
|
56
|
+
if (t.has(o)) continue;
|
|
57
|
+
t.add(o);
|
|
58
|
+
const s = n.get(o);
|
|
59
|
+
if (s?.length)
|
|
60
|
+
for (const a of s) {
|
|
61
|
+
if (a === r) return !0;
|
|
62
|
+
t.has(a) || c.push(a);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return !1;
|
|
66
|
+
}
|
|
67
|
+
function $(e, i, r) {
|
|
68
|
+
if (i === r)
|
|
69
|
+
return { valid: !1, reason: "self" };
|
|
70
|
+
const n = e.find((c) => c.id === i), t = e.find((c) => c.id === r);
|
|
71
|
+
return n ? t ? d(e, i, r) ? { valid: !1, reason: "duplicate" } : y(e, i, r) ? { valid: !1, reason: "circular" } : { valid: !0 } : { valid: !1, reason: "missing-successor" } : { valid: !1, reason: "missing-predecessor" };
|
|
72
|
+
}
|
|
73
|
+
function k(e, i, r) {
|
|
74
|
+
if (e.valid === !0)
|
|
75
|
+
return `Dependency requested: ${r} waiting on ${i}`;
|
|
76
|
+
switch ("reason" in e ? e.reason : void 0) {
|
|
77
|
+
case "self":
|
|
78
|
+
return `Cannot create a dependency from ${i} to itself`;
|
|
79
|
+
case "duplicate":
|
|
80
|
+
return `${r} is already waiting on ${i}`;
|
|
81
|
+
case "circular":
|
|
82
|
+
return `Cannot link ${i} to ${r}: would create a circular dependency`;
|
|
83
|
+
case "missing-predecessor":
|
|
84
|
+
return "Predecessor task is not available";
|
|
85
|
+
case "missing-successor":
|
|
86
|
+
return "Successor task is not available";
|
|
87
|
+
default:
|
|
88
|
+
return "Invalid dependency target";
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function p(e, i) {
|
|
92
|
+
return `${e}\0${i}`;
|
|
93
|
+
}
|
|
94
|
+
function x(e, i, r, n = 40, t = 14) {
|
|
95
|
+
let c = 0, o = 0;
|
|
96
|
+
return e < r.left + n ? c = -t : e > r.right - n && (c = t), i < r.top + n ? o = -t : i > r.bottom - n && (o = t), { dx: c, dy: o };
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
k as describeGanttDependencyLinkValidation,
|
|
100
|
+
v as findGanttDependencyBarAtPoint,
|
|
101
|
+
p as ganttDependencyEdgeKey,
|
|
102
|
+
y as ganttDependencyReachable,
|
|
103
|
+
D as ganttDependencyTypeLabel,
|
|
104
|
+
h as getGanttDependencyConnectorPosition,
|
|
105
|
+
x as getGanttDependencyEdgeScrollDelta,
|
|
106
|
+
d as hasGanttScheduleDependency,
|
|
107
|
+
l as resolveGanttScheduleDependencyEdges,
|
|
108
|
+
$ as validateGanttDependencyLink
|
|
109
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure resize/move preview math for GanttChart.
|
|
3
|
+
* Preview snapping must match the values emitted on pointer release.
|
|
4
|
+
*/
|
|
5
|
+
export type GanttInteractionMode = 'move' | 'resize-left' | 'resize-right';
|
|
6
|
+
export type GanttInteractionPreview = {
|
|
7
|
+
/** Half-day-snapped day delta applied to the interaction */
|
|
8
|
+
snappedDays: number;
|
|
9
|
+
/** Pixel delta after min-duration clamp (pre-snap) */
|
|
10
|
+
clampedPxDelta: number;
|
|
11
|
+
start: Date;
|
|
12
|
+
end: Date;
|
|
13
|
+
};
|
|
14
|
+
/** Same snap used on drag end — half-day increments */
|
|
15
|
+
export declare function snapGanttDayDelta(daysDelta: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Clamp a resize pixel delta so the task never shrinks below min duration.
|
|
18
|
+
*/
|
|
19
|
+
export declare function clampGanttResizePxDelta(input: {
|
|
20
|
+
mode: 'resize-left' | 'resize-right';
|
|
21
|
+
pxDelta: number;
|
|
22
|
+
origDurationDays: number;
|
|
23
|
+
pxToDays: (px: number) => number;
|
|
24
|
+
daysToPx: (days: number) => number;
|
|
25
|
+
minDurationDays?: number;
|
|
26
|
+
}): number;
|
|
27
|
+
/**
|
|
28
|
+
* Compute temporary preview dates for move/resize.
|
|
29
|
+
* Uses the same half-day snap and min-duration rules as the final emission.
|
|
30
|
+
*/
|
|
31
|
+
export declare function computeGanttInteractionPreview(input: {
|
|
32
|
+
mode: GanttInteractionMode;
|
|
33
|
+
pxDelta: number;
|
|
34
|
+
origStart: Date;
|
|
35
|
+
origEnd: Date;
|
|
36
|
+
origDurationDays: number;
|
|
37
|
+
pxToDays: (px: number) => number;
|
|
38
|
+
daysToPx: (days: number) => number;
|
|
39
|
+
addDays: (d: Date, n: number) => Date;
|
|
40
|
+
minDurationDays?: number;
|
|
41
|
+
}): GanttInteractionPreview;
|
|
42
|
+
/** Pixel geometry for a temporary preview bar derived from preview dates */
|
|
43
|
+
export declare function ganttPreviewBarGeometry(input: {
|
|
44
|
+
start: Date;
|
|
45
|
+
end: Date;
|
|
46
|
+
dateToX: (d: Date) => number;
|
|
47
|
+
minWidthPx?: number;
|
|
48
|
+
}): {
|
|
49
|
+
x: number;
|
|
50
|
+
fullW: number;
|
|
51
|
+
xEnd: number;
|
|
52
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function D(a) {
|
|
2
|
+
return Math.round(a * 2) / 2;
|
|
3
|
+
}
|
|
4
|
+
function d(a) {
|
|
5
|
+
const o = a.minDurationDays ?? 0.5, r = a.pxToDays(a.pxDelta), e = a.origDurationDays;
|
|
6
|
+
return a.mode === "resize-left" && r >= e - o ? a.daysToPx(e - o) : a.mode === "resize-right" && -r >= e - o ? -a.daysToPx(e - o) : a.pxDelta;
|
|
7
|
+
}
|
|
8
|
+
function n(a) {
|
|
9
|
+
const o = a.minDurationDays ?? 0.5;
|
|
10
|
+
let r = a.pxDelta;
|
|
11
|
+
(a.mode === "resize-left" || a.mode === "resize-right") && (r = d({
|
|
12
|
+
mode: a.mode,
|
|
13
|
+
pxDelta: a.pxDelta,
|
|
14
|
+
origDurationDays: a.origDurationDays,
|
|
15
|
+
pxToDays: a.pxToDays,
|
|
16
|
+
daysToPx: a.daysToPx,
|
|
17
|
+
minDurationDays: o
|
|
18
|
+
}));
|
|
19
|
+
let e = D(a.pxToDays(r));
|
|
20
|
+
if (a.mode === "move")
|
|
21
|
+
return {
|
|
22
|
+
snappedDays: e,
|
|
23
|
+
clampedPxDelta: r,
|
|
24
|
+
start: a.addDays(a.origStart, e),
|
|
25
|
+
end: a.addDays(a.origEnd, e)
|
|
26
|
+
};
|
|
27
|
+
if (a.mode === "resize-left") {
|
|
28
|
+
const s = a.origDurationDays - o;
|
|
29
|
+
return e = Math.min(e, s), {
|
|
30
|
+
snappedDays: e,
|
|
31
|
+
clampedPxDelta: r,
|
|
32
|
+
start: a.addDays(a.origStart, e),
|
|
33
|
+
end: new Date(a.origEnd.getTime())
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const t = -(a.origDurationDays - o);
|
|
37
|
+
return e = Math.max(e, t), {
|
|
38
|
+
snappedDays: e,
|
|
39
|
+
clampedPxDelta: r,
|
|
40
|
+
start: new Date(a.origStart.getTime()),
|
|
41
|
+
end: a.addDays(a.origEnd, e)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function m(a) {
|
|
45
|
+
const o = a.dateToX(a.start), r = a.dateToX(a.end), e = Math.max(a.minWidthPx ?? 8, r - o);
|
|
46
|
+
return { x: o, fullW: e, xEnd: o + e };
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
d as clampGanttResizePxDelta,
|
|
50
|
+
n as computeGanttInteractionPreview,
|
|
51
|
+
m as ganttPreviewBarGeometry,
|
|
52
|
+
D as snapGanttDayDelta
|
|
53
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure tooltip placement helpers for GanttChart.
|
|
3
|
+
* Keeps task tooltips clear of the dependency connector and viewport edges.
|
|
4
|
+
*/
|
|
5
|
+
/** Axis-aligned screen rect to steer the tooltip away from */
|
|
6
|
+
export type GanttTooltipAvoidRect = {
|
|
7
|
+
left: number;
|
|
8
|
+
top: number;
|
|
9
|
+
right: number;
|
|
10
|
+
bottom: number;
|
|
11
|
+
};
|
|
12
|
+
export type GanttTooltipPlaceInput = {
|
|
13
|
+
pointerX: number;
|
|
14
|
+
pointerY: number;
|
|
15
|
+
viewportWidth: number;
|
|
16
|
+
viewportHeight: number;
|
|
17
|
+
/** Estimated tooltip box — used only for collision / clamping */
|
|
18
|
+
estimatedWidth?: number;
|
|
19
|
+
estimatedHeight?: number;
|
|
20
|
+
/** Optional region to avoid (e.g. dependency connector hit area in screen space) */
|
|
21
|
+
avoid?: GanttTooltipAvoidRect | null;
|
|
22
|
+
gap?: number;
|
|
23
|
+
/** Extra shift below the pointer (positive moves tooltip down) */
|
|
24
|
+
offsetBottom?: number;
|
|
25
|
+
margin?: number;
|
|
26
|
+
};
|
|
27
|
+
export type GanttTooltipPlaceResult = {
|
|
28
|
+
left: number;
|
|
29
|
+
top: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Place a Gantt task tooltip near the pointer while avoiding an optional
|
|
33
|
+
* connector rect and staying inside the viewport.
|
|
34
|
+
* Prefers sitting just below the task/pointer so it does not cover the connector.
|
|
35
|
+
*/
|
|
36
|
+
export declare function placeGanttTaskTooltip(input: GanttTooltipPlaceInput): GanttTooltipPlaceResult;
|
|
37
|
+
/**
|
|
38
|
+
* Whether a pointer in SVG space is inside the connector clear zone
|
|
39
|
+
* (hide tooltip rather than fighting overlap).
|
|
40
|
+
*/
|
|
41
|
+
export declare function isGanttPointerNearConnector(pointerSvgX: number, pointerSvgY: number, connectorSvgX: number, connectorSvgY: number, radius?: number): boolean;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
function d(f, t, a, s, p) {
|
|
2
|
+
const o = f + a, e = t + s;
|
|
3
|
+
return !(o < p.left || f > p.right || e < p.top || t > p.bottom);
|
|
4
|
+
}
|
|
5
|
+
function m(f, t, a, s, p, o, e) {
|
|
6
|
+
return {
|
|
7
|
+
left: Math.max(e, Math.min(f, Math.max(e, p - a - e))),
|
|
8
|
+
top: Math.max(e, Math.min(t, Math.max(e, o - s - e)))
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function x(f) {
|
|
12
|
+
const {
|
|
13
|
+
pointerX: t,
|
|
14
|
+
pointerY: a,
|
|
15
|
+
viewportWidth: s,
|
|
16
|
+
viewportHeight: p,
|
|
17
|
+
estimatedWidth: o = 200,
|
|
18
|
+
estimatedHeight: e = 120,
|
|
19
|
+
avoid: i = null,
|
|
20
|
+
gap: n = 12,
|
|
21
|
+
offsetBottom: M = 16,
|
|
22
|
+
margin: u = 8
|
|
23
|
+
} = f, l = a + M, h = [];
|
|
24
|
+
i && (h.push({
|
|
25
|
+
left: t + n,
|
|
26
|
+
top: Math.max(l, i.bottom + n)
|
|
27
|
+
}), h.push({
|
|
28
|
+
left: i.left - o - n,
|
|
29
|
+
top: Math.max(l, i.bottom + n)
|
|
30
|
+
}), h.push({
|
|
31
|
+
left: Math.min(t, i.left) - o - n,
|
|
32
|
+
top: l
|
|
33
|
+
})), h.push({ left: t + n, top: l }), h.push({ left: t - o - n, top: l }), h.push({ left: t - o / 2, top: l }), h.push({ left: t + n, top: a - n }), h.push({ left: t - o / 2, top: a - e - n });
|
|
34
|
+
for (const c of h) {
|
|
35
|
+
const r = m(
|
|
36
|
+
c.left,
|
|
37
|
+
c.top,
|
|
38
|
+
o,
|
|
39
|
+
e,
|
|
40
|
+
s,
|
|
41
|
+
p,
|
|
42
|
+
u
|
|
43
|
+
);
|
|
44
|
+
if (!i || !d(r.left, r.top, o, e, i))
|
|
45
|
+
return r;
|
|
46
|
+
}
|
|
47
|
+
return m(
|
|
48
|
+
t - o - n,
|
|
49
|
+
l,
|
|
50
|
+
o,
|
|
51
|
+
e,
|
|
52
|
+
s,
|
|
53
|
+
p,
|
|
54
|
+
u
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
function b(f, t, a, s, p = 16) {
|
|
58
|
+
return Math.hypot(f - a, t - s) <= p;
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
b as isGanttPointerNearConnector,
|
|
62
|
+
x as placeGanttTaskTooltip
|
|
63
|
+
};
|
|
@@ -9,5 +9,7 @@ export { default as SegmentBarChart } from './SegmentBarChart.vue';
|
|
|
9
9
|
export { default as StatCardChart } from './StatCardChart.vue';
|
|
10
10
|
export { default as WaffleChart } from './WaffleChart.vue';
|
|
11
11
|
export { default as GanttChart } from './GanttChart.vue';
|
|
12
|
-
export type { ChartDataPoint, ChartDataset, ChartLegendsVariant, LegendPosition, LineChartProps, BarChartProps, PieChartProps, CircleChartProps, GaugeChartProps, GaugeVariant, GaugeZone, SpeedometerChartProps, SpeedometerVariant, TimelineChartProps, TimelineTask, SegmentBarChartProps, StatCardChartProps, StatCardItem, WaffleChartProps, GanttChartProps, GanttTask, GanttViewMode, } from './types';
|
|
12
|
+
export type { ChartDataPoint, ChartDataset, ChartLegendsVariant, LegendPosition, LineChartProps, BarChartProps, PieChartProps, CircleChartProps, GaugeChartProps, GaugeVariant, GaugeZone, SpeedometerChartProps, SpeedometerVariant, TimelineChartProps, TimelineTask, SegmentBarChartProps, StatCardChartProps, StatCardItem, WaffleChartProps, GanttChartProps, GanttTask, GanttViewMode, GanttDependencyType, GanttTaskDependencyLink, GanttDependencyCreatePayload, GanttDependencyDeletePayload, } from './types';
|
|
13
|
+
export { GANTT_DEPENDENCY_TYPE_LABELS } from './types';
|
|
14
|
+
export { formatGanttLocalDate, parseGanttDate, ganttDateToX, ganttCalendarDaysBetween, } from './GanttChartDateUtils';
|
|
13
15
|
export { default as ChartLegend } from './ChartLegend.vue';
|
|
@@ -362,6 +362,30 @@ export interface WaffleChartProps {
|
|
|
362
362
|
}
|
|
363
363
|
/** View granularity for the Gantt time axis */
|
|
364
364
|
export type GanttViewMode = 'day' | 'week' | 'month';
|
|
365
|
+
/**
|
|
366
|
+
* User-facing dependency type from the **owning task's** perspective.
|
|
367
|
+
*
|
|
368
|
+
* - `waiting-on` — this task cannot proceed until `taskId` is completed
|
|
369
|
+
* - `blocking` — this task prevents `taskId` from proceeding
|
|
370
|
+
* - `related-to` — connected, but does not schedule-block (no Gantt arrow)
|
|
371
|
+
*
|
|
372
|
+
* `waiting-on` and `blocking` are opposite views of one schedule edge:
|
|
373
|
+
* "B waiting on A" === "A blocking B". Parents should persist one canonical
|
|
374
|
+
* record (e.g. BLOCKS with blockingTaskId=A, waitingTaskId=B).
|
|
375
|
+
*/
|
|
376
|
+
export type GanttDependencyType = 'waiting-on' | 'blocking' | 'related-to';
|
|
377
|
+
/** Display labels for the Type | Task selector pattern */
|
|
378
|
+
export declare const GANTT_DEPENDENCY_TYPE_LABELS: Record<GanttDependencyType, string>;
|
|
379
|
+
/**
|
|
380
|
+
* Typed dependency link on a Gantt task.
|
|
381
|
+
* Only `waiting-on` / `blocking` contribute to schedule arrows; `related-to` does not.
|
|
382
|
+
*/
|
|
383
|
+
export interface GanttTaskDependencyLink {
|
|
384
|
+
/** The other task in this relationship */
|
|
385
|
+
taskId: string;
|
|
386
|
+
/** Relationship from THIS task's perspective */
|
|
387
|
+
type: GanttDependencyType;
|
|
388
|
+
}
|
|
365
389
|
/** A single task (or milestone) on the Gantt chart */
|
|
366
390
|
export interface GanttTask {
|
|
367
391
|
/** Unique identifier for this task */
|
|
@@ -378,10 +402,28 @@ export interface GanttTask {
|
|
|
378
402
|
color?: string;
|
|
379
403
|
/** Group label — tasks sharing the same group are visually grouped */
|
|
380
404
|
group?: string;
|
|
381
|
-
/**
|
|
405
|
+
/**
|
|
406
|
+
* Legacy / shorthand: IDs of tasks this task is **waiting on** (predecessors).
|
|
407
|
+
* Renders finish-to-start dependency arrows. Equivalent to
|
|
408
|
+
* `dependencyLinks: [{ taskId, type: 'waiting-on' }, ...]`.
|
|
409
|
+
*/
|
|
382
410
|
dependencies?: string[];
|
|
411
|
+
/**
|
|
412
|
+
* Typed user-facing dependency links (Waiting on / Blocking / Related to).
|
|
413
|
+
* Schedule arrows are drawn only for waiting-on / blocking edges.
|
|
414
|
+
* `related-to` is retained for parent UIs and never draws an arrow.
|
|
415
|
+
*/
|
|
416
|
+
dependencyLinks?: GanttTaskDependencyLink[];
|
|
383
417
|
/** If true, renders as a diamond milestone marker instead of a bar */
|
|
384
418
|
milestone?: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Presentational blocked state (e.g. waiting on incomplete work or manually
|
|
421
|
+
* blocked). Renders a hatched overlay + lock marker on the bar and a
|
|
422
|
+
* blocked line in the tooltip. Purely visual — parents own the rule.
|
|
423
|
+
*/
|
|
424
|
+
blocked?: boolean;
|
|
425
|
+
/** Short human-readable reason shown in the tooltip when `blocked` */
|
|
426
|
+
blockedReason?: string;
|
|
385
427
|
}
|
|
386
428
|
export interface GanttChartProps {
|
|
387
429
|
/** Array of task objects */
|
|
@@ -422,8 +464,56 @@ export interface GanttChartProps {
|
|
|
422
464
|
locale?: string;
|
|
423
465
|
/** Allow drag-and-drop to move/resize tasks */
|
|
424
466
|
draggable?: boolean;
|
|
425
|
-
/**
|
|
467
|
+
/**
|
|
468
|
+
* Opt-in: show dependency connectors and allow creating links by drag
|
|
469
|
+
* (or keyboard). Independent of `showDependencies` (which only controls
|
|
470
|
+
* rendering of existing arrows). Default `false` for backward compatibility.
|
|
471
|
+
*/
|
|
472
|
+
editableDependencies?: boolean;
|
|
473
|
+
/**
|
|
474
|
+
* When moving a task, dependent tasks visually FOLLOW during the drag as a
|
|
475
|
+
* preview. On release only ONE `task-update` is emitted (the root task) —
|
|
476
|
+
* the parent/server owns the authoritative cascade and passes the final
|
|
477
|
+
* dates back through `tasks`. (The pre-1.x behavior of emitting one update
|
|
478
|
+
* per dependent task is removed: it produced N independent writes with no
|
|
479
|
+
* transactional guarantee.)
|
|
480
|
+
*/
|
|
426
481
|
cascadeDependencies?: boolean;
|
|
427
482
|
/** Show zoom controls and enable Ctrl/Meta + wheel zoom */
|
|
428
483
|
zoom?: boolean;
|
|
429
484
|
}
|
|
485
|
+
/**
|
|
486
|
+
* Payload emitted by GanttChart `@dependency-create`.
|
|
487
|
+
* Parent should persist one canonical schedule edge
|
|
488
|
+
* (successor waiting on predecessor / predecessor blocking successor)
|
|
489
|
+
* and pass updated `tasks` back — the chart never mutates tasks.
|
|
490
|
+
*/
|
|
491
|
+
export interface GanttDependencyCreatePayload {
|
|
492
|
+
/** Task that must finish first (source / arrow origin) */
|
|
493
|
+
predecessorId: string;
|
|
494
|
+
/** Task that waits on the predecessor */
|
|
495
|
+
successorId: string;
|
|
496
|
+
predecessor: GanttTask;
|
|
497
|
+
successor: GanttTask;
|
|
498
|
+
/**
|
|
499
|
+
* User-facing type from the **successor's** perspective.
|
|
500
|
+
* Connector linking always emits `waiting-on`
|
|
501
|
+
* (successor Waiting on | predecessor).
|
|
502
|
+
*/
|
|
503
|
+
type: Extract<GanttDependencyType, 'waiting-on'>;
|
|
504
|
+
/** Localized-ready label, e.g. "Waiting on" */
|
|
505
|
+
typeLabel: string;
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Payload emitted by GanttChart `@dependency-delete`.
|
|
509
|
+
* Parent should remove the canonical schedule edge and update `tasks`.
|
|
510
|
+
*/
|
|
511
|
+
export interface GanttDependencyDeletePayload {
|
|
512
|
+
predecessorId: string;
|
|
513
|
+
successorId: string;
|
|
514
|
+
predecessor: GanttTask;
|
|
515
|
+
successor: GanttTask;
|
|
516
|
+
/** Same semantics as create — schedule edge from successor's view */
|
|
517
|
+
type: Extract<GanttDependencyType, 'waiting-on'>;
|
|
518
|
+
typeLabel: string;
|
|
519
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { defineComponent as T, ref as x, computed as _, watch as u, onMounted as B, onUnmounted as P, openBlock as a, createElementBlock as b, createVNode as R, unref as S, createBlock as z, createCommentVNode as p, createElementVNode as L, normalizeStyle as V, renderSlot as I, nextTick as M } from "vue";
|
|
2
|
+
import c from "@jaames/iro";
|
|
3
|
+
import { useEyeDropper as N } from "@vueuse/core";
|
|
4
|
+
import d from "../Button.vue.js";
|
|
5
|
+
import { COLOR_PICKER_RESET_VALUE as $ } from "./constants.js";
|
|
6
|
+
const D = { class: "space-y-3 w-max" }, F = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "flex gap-2 mb-2.5 -text-fs-3 pr-0.5"
|
|
9
|
+
}, j = /* @__PURE__ */ T({
|
|
10
|
+
__name: "ColorIro",
|
|
11
|
+
props: {
|
|
12
|
+
color: {},
|
|
13
|
+
showHeader: { type: Boolean, default: !0 },
|
|
14
|
+
size: { default: "md" }
|
|
15
|
+
},
|
|
16
|
+
emits: ["update:color", "close"],
|
|
17
|
+
setup(l, { emit: E }) {
|
|
18
|
+
const n = l, s = E, t = x(), o = x(null);
|
|
19
|
+
let i = !1;
|
|
20
|
+
const { isSupported: f, open: w, sRGBHex: H } = N(), m = (e) => {
|
|
21
|
+
const r = (e || "").toLowerCase();
|
|
22
|
+
return r === $ || r === "#00000000";
|
|
23
|
+
}, C = (e) => m(e) || !e ? "#000000" : e, v = _(() => {
|
|
24
|
+
switch (n.size) {
|
|
25
|
+
case "sm":
|
|
26
|
+
return 140;
|
|
27
|
+
case "lg":
|
|
28
|
+
return 170;
|
|
29
|
+
default:
|
|
30
|
+
return 162;
|
|
31
|
+
}
|
|
32
|
+
}), y = {
|
|
33
|
+
sm: 120,
|
|
34
|
+
md: 140,
|
|
35
|
+
lg: 150
|
|
36
|
+
}, h = async () => {
|
|
37
|
+
if (!(!t.value || o.value)) {
|
|
38
|
+
await M();
|
|
39
|
+
try {
|
|
40
|
+
o.value && (o.value.off("color:change"), o.value = null), t.value && (t.value.innerHTML = ""), o.value = c.ColorPicker(t.value, {
|
|
41
|
+
width: v.value,
|
|
42
|
+
color: C(n.color),
|
|
43
|
+
margin: 9,
|
|
44
|
+
boxHeight: y[n.size],
|
|
45
|
+
sliderSize: 14,
|
|
46
|
+
layout: [
|
|
47
|
+
{
|
|
48
|
+
component: c.ui.Box
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
component: c.ui.Slider,
|
|
52
|
+
options: {
|
|
53
|
+
sliderType: "hue"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
component: c.ui.Slider,
|
|
58
|
+
options: {
|
|
59
|
+
sliderType: "saturation"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
component: c.ui.Slider,
|
|
64
|
+
options: {
|
|
65
|
+
sliderType: "value"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}), o.value.on("color:change", (e) => {
|
|
70
|
+
i || s("update:color", e.hexString);
|
|
71
|
+
});
|
|
72
|
+
} catch (e) {
|
|
73
|
+
console.error("Failed to initialize color picker:", e);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, k = () => {
|
|
77
|
+
o.value && (o.value.off("color:change"), o.value = null), t.value && (t.value.innerHTML = "");
|
|
78
|
+
};
|
|
79
|
+
u(
|
|
80
|
+
() => n.color,
|
|
81
|
+
(e) => {
|
|
82
|
+
if (o.value && !m(e) && o.value.color.hexString !== e) {
|
|
83
|
+
i = !0;
|
|
84
|
+
try {
|
|
85
|
+
o.value.color.hexString = e;
|
|
86
|
+
} catch (r) {
|
|
87
|
+
console.error("Error updating color:", r);
|
|
88
|
+
} finally {
|
|
89
|
+
i = !1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
), u(
|
|
94
|
+
() => n.size,
|
|
95
|
+
() => {
|
|
96
|
+
k(), h();
|
|
97
|
+
}
|
|
98
|
+
), u(H, (e) => {
|
|
99
|
+
if (e && (s("update:color", e), o.value)) {
|
|
100
|
+
i = !0;
|
|
101
|
+
try {
|
|
102
|
+
o.value.color.hexString = e;
|
|
103
|
+
} catch (r) {
|
|
104
|
+
console.error("Error updating color from eyedropper:", r);
|
|
105
|
+
} finally {
|
|
106
|
+
i = !1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
const g = async () => {
|
|
111
|
+
try {
|
|
112
|
+
await w();
|
|
113
|
+
} catch (e) {
|
|
114
|
+
console.error("Error opening eyedropper:", e);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
return B(() => {
|
|
118
|
+
h();
|
|
119
|
+
}), P(() => {
|
|
120
|
+
k();
|
|
121
|
+
}), (e, r) => (a(), b("div", D, [
|
|
122
|
+
l.showHeader ? (a(), b("div", F, [
|
|
123
|
+
R(d, {
|
|
124
|
+
icon: "typcn:arrow-back",
|
|
125
|
+
onClick: r[0] || (r[0] = (O) => s("close")),
|
|
126
|
+
class: "flex-1 px-2 py-1 bg-background hover:bg-accent rounded text-xs border border-border transition-colors"
|
|
127
|
+
}),
|
|
128
|
+
S(f) ? (a(), z(d, {
|
|
129
|
+
key: 0,
|
|
130
|
+
onClick: g,
|
|
131
|
+
icon: "pepicons-pop:color-picker",
|
|
132
|
+
class: "flex-1 px-2 py-1 bg-background hover:bg-accent rounded text-xs border border-border transition-colors"
|
|
133
|
+
})) : p("", !0)
|
|
134
|
+
])) : p("", !0),
|
|
135
|
+
L("div", {
|
|
136
|
+
ref_key: "pickerRef",
|
|
137
|
+
ref: t,
|
|
138
|
+
style: V({ width: v.value + "px", minHeight: y[l.size] + "px" })
|
|
139
|
+
}, null, 4),
|
|
140
|
+
I(e.$slots, "bottom", {}, () => [
|
|
141
|
+
S(f) && !l.showHeader ? (a(), z(d, {
|
|
142
|
+
key: 0,
|
|
143
|
+
onClick: g,
|
|
144
|
+
icon: "pepicons-pop:color-picker",
|
|
145
|
+
variant: "outline",
|
|
146
|
+
size: "sm",
|
|
147
|
+
class: "w-full"
|
|
148
|
+
})) : p("", !0)
|
|
149
|
+
])
|
|
150
|
+
]));
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
export {
|
|
154
|
+
j as default
|
|
155
|
+
};
|
|
@@ -10,6 +10,8 @@ interface Props {
|
|
|
10
10
|
btnProps?: ButtonProps;
|
|
11
11
|
showInput?: boolean;
|
|
12
12
|
trigger?: 'input' | 'button' | 'swatch';
|
|
13
|
+
/** When true, shows a reset control that sets the value to `#0000` (transparent). */
|
|
14
|
+
allowReset?: boolean;
|
|
13
15
|
}
|
|
14
16
|
declare function __VLS_template(): {
|
|
15
17
|
attrs: Partial<{}>;
|
|
@@ -23,9 +25,11 @@ declare function __VLS_template(): {
|
|
|
23
25
|
};
|
|
24
26
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
25
27
|
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
28
|
+
reset: (value: string) => any;
|
|
26
29
|
change: (value: string) => any;
|
|
27
30
|
"update:modelValue": (value: string) => any;
|
|
28
31
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
32
|
+
onReset?: (value: string) => any;
|
|
29
33
|
onChange?: (value: string) => any;
|
|
30
34
|
"onUpdate:modelValue"?: (value: string) => any;
|
|
31
35
|
}>, {
|
|
@@ -37,6 +41,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
37
41
|
trigger: "input" | "button" | "swatch";
|
|
38
42
|
position: TooltTipPlacement;
|
|
39
43
|
showInput: boolean;
|
|
44
|
+
allowReset: boolean;
|
|
40
45
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
41
46
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
42
47
|
export default _default;
|