@primeui/vue-taskboard 0.0.1-alpha.1 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +35 -0
- package/dist/TaskBoard.context.d.ts +21 -21
- package/dist/TaskBoard.parts.d.ts +20 -20
- package/dist/TaskBoard.vue.d.ts +37 -37
- package/dist/TaskBoardContent.vue.d.ts +2 -2
- package/dist/chunks/TaskBoard.context-BCq7uauT.mjs +29 -0
- package/dist/chunks/TaskBoard.vue_vue_type_script_setup_true_lang-BWN_YxC5.mjs +841 -0
- package/dist/chunks/TaskBoardCard.vue_vue_type_script_setup_true_lang-B1Ix7Gjf.mjs +34 -0
- package/dist/chunks/TaskBoardCardAdd.vue_vue_type_script_setup_true_lang-Dy4BuCa9.mjs +14 -0
- package/dist/chunks/TaskBoardCardContent.vue_vue_type_script_setup_true_lang-DNEmpvcn.mjs +19 -0
- package/dist/chunks/TaskBoardCardFooter.vue_vue_type_script_setup_true_lang-8FWnuxSl.mjs +19 -0
- package/dist/chunks/TaskBoardCardHeader.vue_vue_type_script_setup_true_lang-Dr-XJfaE.mjs +19 -0
- package/dist/chunks/TaskBoardColumn.vue_vue_type_script_setup_true_lang-D_AJ5j7c.mjs +42 -0
- package/dist/chunks/TaskBoardColumnAdd-C_JSN3pp.mjs +10 -0
- package/dist/chunks/TaskBoardColumnContent.vue_vue_type_script_setup_true_lang-DNRiWBN_.mjs +180 -0
- package/dist/chunks/TaskBoardColumnEmpty.vue_vue_type_script_setup_true_lang-D23AtNeX.mjs +18 -0
- package/dist/chunks/TaskBoardColumnFooter.vue_vue_type_script_setup_true_lang-BpKRnC6u.mjs +19 -0
- package/dist/chunks/TaskBoardColumnHeader.vue_vue_type_script_setup_true_lang-DMc9zcWV.mjs +51 -0
- package/dist/chunks/TaskBoardContent.vue_vue_type_script_setup_true_lang-lDUg6UrJ.mjs +292 -0
- package/dist/chunks/TaskBoardDragConfirm.vue_vue_type_script_setup_true_lang-B4OdxK5L.mjs +20 -0
- package/dist/chunks/TaskBoardDragPreview.vue_vue_type_script_setup_true_lang-B7F-FPY1.mjs +40 -0
- package/dist/chunks/TaskBoardDropIndicator-BUMSBiQC.mjs +14 -0
- package/dist/chunks/TaskBoardHeader.vue_vue_type_script_setup_true_lang-CwtaadkE.mjs +21 -0
- package/dist/chunks/TaskBoardLoading-CrgtYPP-.mjs +10 -0
- package/dist/chunks/TaskBoardSwimlaneColumnHeader.vue_vue_type_script_setup_true_lang-BVpen7mj.mjs +23 -0
- package/dist/chunks/TaskBoardSwimlaneHeader.vue_vue_type_script_setup_true_lang-D6NdS4hP.mjs +32 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/chunks/useHistory-C-Ud-WgS.mjs +510 -0
- package/dist/chunks/useTaskBoardDrag-BvBISSNb.mjs +58 -0
- package/dist/components/card/TaskBoardCard.vue.d.ts +3 -3
- package/dist/components/card/TaskBoardCardContent.vue.d.ts +1 -1
- package/dist/components/card/TaskBoardCardFooter.vue.d.ts +1 -1
- package/dist/components/card/TaskBoardCardHeader.vue.d.ts +1 -1
- package/dist/components/column/TaskBoardColumn.vue.d.ts +2 -2
- package/dist/components/column/TaskBoardColumnContent.vue.d.ts +1 -1
- package/dist/components/column/TaskBoardColumnFooter.vue.d.ts +1 -1
- package/dist/components/column/TaskBoardColumnHeader.vue.d.ts +1 -1
- package/dist/components/overlay/TaskBoardDragConfirm.vue.d.ts +2 -2
- package/dist/components/swimlane/TaskBoardSwimlaneColumnHeader.vue.d.ts +3 -3
- package/dist/components.d.ts +20 -0
- package/dist/components.mjs +42 -0
- package/dist/composables/index.mjs +6 -5
- package/dist/composables/useCardDrag.d.ts +2 -2
- package/dist/composables/useColumnDrag.d.ts +5 -5
- package/dist/composables/useControllerInit.d.ts +3 -3
- package/dist/composables/useKeyboardHandling.d.ts +2 -2
- package/dist/index.d.ts +20 -20
- package/dist/index.mjs +77 -1650
- package/dist/parts/card/index.d.ts +1 -0
- package/dist/parts/card/index.mjs +4 -0
- package/dist/parts/cardadd/index.d.ts +1 -0
- package/dist/parts/cardadd/index.mjs +4 -0
- package/dist/parts/cardcontent/index.d.ts +1 -0
- package/dist/parts/cardcontent/index.mjs +4 -0
- package/dist/parts/cardfooter/index.d.ts +1 -0
- package/dist/parts/cardfooter/index.mjs +4 -0
- package/dist/parts/cardheader/index.d.ts +1 -0
- package/dist/parts/cardheader/index.mjs +4 -0
- package/dist/parts/column/index.d.ts +1 -0
- package/dist/parts/column/index.mjs +4 -0
- package/dist/parts/columnadd/index.d.ts +1 -0
- package/dist/parts/columnadd/index.mjs +4 -0
- package/dist/parts/columncontent/index.d.ts +1 -0
- package/dist/parts/columncontent/index.mjs +4 -0
- package/dist/parts/columnempty/index.d.ts +1 -0
- package/dist/parts/columnempty/index.mjs +4 -0
- package/dist/parts/columnfooter/index.d.ts +1 -0
- package/dist/parts/columnfooter/index.mjs +4 -0
- package/dist/parts/columnheader/index.d.ts +1 -0
- package/dist/parts/columnheader/index.mjs +4 -0
- package/dist/parts/content/index.d.ts +1 -0
- package/dist/parts/content/index.mjs +4 -0
- package/dist/parts/dragconfirm/index.d.ts +1 -0
- package/dist/parts/dragconfirm/index.mjs +4 -0
- package/dist/parts/dragpreview/index.d.ts +1 -0
- package/dist/parts/dragpreview/index.mjs +4 -0
- package/dist/parts/dropindicator/index.d.ts +1 -0
- package/dist/parts/dropindicator/index.mjs +4 -0
- package/dist/parts/header/index.d.ts +1 -0
- package/dist/parts/header/index.mjs +4 -0
- package/dist/parts/loading/index.d.ts +1 -0
- package/dist/parts/loading/index.mjs +4 -0
- package/dist/parts/root/index.d.ts +1 -0
- package/dist/parts/root/index.mjs +4 -0
- package/dist/parts/swimlanecolumnheader/index.d.ts +1 -0
- package/dist/parts/swimlanecolumnheader/index.mjs +4 -0
- package/dist/parts/swimlaneheader/index.d.ts +1 -0
- package/dist/parts/swimlaneheader/index.mjs +4 -0
- package/dist/release-date.d.ts +1 -1
- package/package.json +24 -19
- package/LICENSE +0 -23
- package/dist/TaskBoard.context.d.mts +0 -235
- package/dist/TaskBoard.parts.d.mts +0 -20
- package/dist/TaskBoard.vue.d.mts +0 -291
- package/dist/TaskBoardContent.vue.d.mts +0 -27
- package/dist/TaskBoardHeader.vue.d.mts +0 -18
- package/dist/TaskBoardLoading.vue.d.mts +0 -13
- package/dist/chunks/useTaskBoardDrag-ByZvmcfw.mjs +0 -590
- package/dist/components/card/TaskBoardCard.vue.d.mts +0 -23
- package/dist/components/card/TaskBoardCardAdd.vue.d.mts +0 -15
- package/dist/components/card/TaskBoardCardContent.vue.d.mts +0 -18
- package/dist/components/card/TaskBoardCardFooter.vue.d.mts +0 -18
- package/dist/components/card/TaskBoardCardHeader.vue.d.mts +0 -18
- package/dist/components/column/TaskBoardColumn.vue.d.mts +0 -19
- package/dist/components/column/TaskBoardColumnAdd.vue.d.mts +0 -13
- package/dist/components/column/TaskBoardColumnContent.vue.d.mts +0 -20
- package/dist/components/column/TaskBoardColumnEmpty.vue.d.mts +0 -13
- package/dist/components/column/TaskBoardColumnFooter.vue.d.mts +0 -16
- package/dist/components/column/TaskBoardColumnHeader.vue.d.mts +0 -19
- package/dist/components/overlay/TaskBoardDragConfirm.vue.d.mts +0 -20
- package/dist/components/overlay/TaskBoardDragPreview.vue.d.mts +0 -16
- package/dist/components/overlay/TaskBoardDropIndicator.d.mts +0 -2
- package/dist/components/swimlane/TaskBoardSwimlaneColumnHeader.vue.d.mts +0 -20
- package/dist/components/swimlane/TaskBoardSwimlaneHeader.vue.d.mts +0 -22
- package/dist/composables/index.d.mts +0 -9
- package/dist/composables/useCardDrag.d.mts +0 -47
- package/dist/composables/useCardDragGeometry.d.mts +0 -21
- package/dist/composables/useColumnDrag.d.mts +0 -24
- package/dist/composables/useControllerInit.d.mts +0 -64
- package/dist/composables/useHistory.d.mts +0 -15
- package/dist/composables/useKeyboardHandling.d.mts +0 -37
- package/dist/composables/useTaskBoardAccess.d.mts +0 -9
- package/dist/composables/useTaskBoardDrag.d.mts +0 -14
- package/dist/composables/useTaskBoardHistory.d.mts +0 -6
- package/dist/composables/useTaskBoardPrintRuntime.d.mts +0 -7
- package/dist/composables/useTaskBoardSelection.d.mts +0 -11
- package/dist/composables/useTaskBoardWorkflow.d.mts +0 -8
- package/dist/index.d.mts +0 -29
- package/dist/release-date.d.mts +0 -11
|
@@ -0,0 +1,841 @@
|
|
|
1
|
+
import { onBeforeUnmount as Rl, nextTick as O, defineComponent as Wt, useModel as Nt, computed as p, ref as r, watch as y, provide as zt, onMounted as _t, openBlock as de, createElementBlock as he, unref as P, normalizeClass as Ve, createElementVNode as ye, toDisplayString as Oe, createCommentVNode as Ue, renderSlot as kl, createBlock as jt, Teleport as qt, normalizeStyle as Xt, mergeModels as Tl } from "vue";
|
|
2
|
+
import { verifyLicense as Yt } from "@primeui/license-manager";
|
|
3
|
+
import { classes as S, createTaskIndex as Jt, createDataAccessor as Qt, processColumns as Zt, isFeatureEnabled as ea, computeColumnGroupSegments as la, processSwimlanes as xl, resolveRootClasses as ta, exportToCSV as Dl, exportToJSON as Ml, canMoveIntoColumn as aa, canMoveOutOfColumn as na, canViewColumn as oa, calculateVisibleRangeDynamic as ra, countSwimlaneTasks as sa, resolveSwimlaneRowClasses as da, getOrderedColumnTasks as ua, getColumnTasksFromIndex as Ge, toggleCollapsedIds as ia, getOrderedCellTasks as ca, getCellTasksFromIndex as Al, countColumnTasks as ma, resolveColumnClasses as va, resolveCardClasses as ga, serializeBoardState as pa, deserializeBoardState as fa, applyTaskUpdate as Ca, applyTaskCreate as Sa, applyCardMove as wa, applyTaskDelete as Ia } from "@primeui/taskboard-core";
|
|
4
|
+
import { T as ba } from "./TaskBoard.context-BCq7uauT.mjs";
|
|
5
|
+
import { b as ha, u as ya, a as ka, c as Ta } from "./useHistory-C-Ud-WgS.mjs";
|
|
6
|
+
let ue = null;
|
|
7
|
+
const xa = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT", "BUTTON"]), Da = /* @__PURE__ */ new Set(["button", "link", "menuitem", "option", "checkbox", "radio", "switch", "textbox", "combobox", "listbox", "tab", "slider"]), Ma = (n) => (n.closest("[role]")?.getAttribute("role")?.split(/\s+/).filter(Boolean) ?? []).some((a) => Da.has(a.toLowerCase())), Aa = (n) => {
|
|
8
|
+
const c = n.closest("[contenteditable]");
|
|
9
|
+
if (!c) return !1;
|
|
10
|
+
const k = c.getAttribute("contenteditable");
|
|
11
|
+
return k == null || k === "" || k.toLowerCase() !== "false";
|
|
12
|
+
}, Ra = (n) => !!n.closest("label")?.querySelector("input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled])");
|
|
13
|
+
function Ea(n) {
|
|
14
|
+
if (!(n instanceof Element)) return !1;
|
|
15
|
+
if (n.closest("a[href]")) return !0;
|
|
16
|
+
const c = n.closest("input, textarea, select, button");
|
|
17
|
+
return c && xa.has(c.tagName) ? !0 : Aa(n) || Ma(n) || Ra(n);
|
|
18
|
+
}
|
|
19
|
+
function Ba(n, c) {
|
|
20
|
+
return n.altKey || n.ctrlKey || n.metaKey ? !1 : c === "Tab" ? !0 : n.shiftKey ? !1 : c === "ArrowUp" || c === "ArrowDown" || c === "ArrowLeft" || c === "ArrowRight" || c === "Home" || c === "End";
|
|
21
|
+
}
|
|
22
|
+
function Fa(n) {
|
|
23
|
+
const c = () => {
|
|
24
|
+
n.rootRef.value && (ue = n.rootRef.value);
|
|
25
|
+
}, k = () => {
|
|
26
|
+
ue === n.rootRef.value && (ue = null);
|
|
27
|
+
}, a = (u) => {
|
|
28
|
+
const g = n.rootRef.value;
|
|
29
|
+
return g ? u.target instanceof Node && g.contains(u.target) ? (ue = g, !0) : ue === g : !0;
|
|
30
|
+
};
|
|
31
|
+
return { onKeyDown: (u) => {
|
|
32
|
+
if (!a(u)) return;
|
|
33
|
+
const g = Ea(u.target), D = u.key.length === 1 ? u.key.toLowerCase() : u.key, v = D === "Escape";
|
|
34
|
+
if (g && !v)
|
|
35
|
+
return;
|
|
36
|
+
if ((u.ctrlKey || u.metaKey) && D === "z") {
|
|
37
|
+
u.preventDefault(), u.shiftKey ? n.performRedo() : n.performUndo();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if ((u.ctrlKey || u.metaKey) && D === "y") {
|
|
41
|
+
u.preventDefault(), n.performRedo();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (v && n.isDragging.value) {
|
|
45
|
+
if (g)
|
|
46
|
+
return;
|
|
47
|
+
const C = n.draggedCardData.value, i = n.getDragController(), w = i?.state.sourceColumnId, s = w != null ? n.allColumns.value.find((M) => M.id === w) : null;
|
|
48
|
+
i?.cancel(), C && s && n.emit("dragCancel", { card: C, column: s }), n.isDragging.value = !1, n.draggedCardId.value = null, n.dragTargetColumnId.value = null, n.dragTargetIndex.value = null, n.dragTargetSwimlaneId.value = null, n.ghostPosition.value = null, n.draggedCardData.value = null, document.removeEventListener("pointermove", n.onDocumentPointerMove), document.removeEventListener("pointerup", n.onDocumentPointerUp);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (v) {
|
|
52
|
+
if (g)
|
|
53
|
+
return;
|
|
54
|
+
if (n.selectedCardIds.value.length > 0) {
|
|
55
|
+
n.getSelectionController()?.clearSelection();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (n.focusedCardId.value != null) {
|
|
59
|
+
n.focusedCardId.value = null, n.focusedColumnId.value = null, n.focusedSwimlaneId.value = null;
|
|
60
|
+
const C = n.getKeyboardController();
|
|
61
|
+
C && (C.focusedCardId = null, C.focusedColumnId = null, C.focusedSwimlaneId = null);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (n.focusedColumnId.value != null) {
|
|
65
|
+
n.focusedColumnId.value = null, n.focusedSwimlaneId.value = null;
|
|
66
|
+
const C = n.getKeyboardController();
|
|
67
|
+
C && (C.focusedColumnId = null, C.focusedSwimlaneId = null);
|
|
68
|
+
}
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
(n.getKeyboardController()?.handleKeyDown(u) ?? !1) && n.selectionOrigin.value === "pointer" && n.selectedCardIds.value.length > 0 && Ba(u, D) && (n.selectionOrigin.value = null, n.getSelectionController()?.clearSelection());
|
|
72
|
+
}, onDocumentClick: (u) => {
|
|
73
|
+
if (n.rootRef.value && !n.rootRef.value.contains(u.target)) {
|
|
74
|
+
if (k(), n.selectedCardIds.value.length > 0 && n.getSelectionController()?.clearSelection(), n.focusedCardId.value != null) {
|
|
75
|
+
n.focusedCardId.value = null, n.focusedColumnId.value = null, n.focusedSwimlaneId.value = null;
|
|
76
|
+
const g = n.getKeyboardController();
|
|
77
|
+
g && (g.focusedCardId = null, g.focusedColumnId = null, g.focusedSwimlaneId = null);
|
|
78
|
+
} else if (n.focusedColumnId.value != null) {
|
|
79
|
+
n.focusedColumnId.value = null, n.focusedSwimlaneId.value = null;
|
|
80
|
+
const g = n.getKeyboardController();
|
|
81
|
+
g && (g.focusedColumnId = null, g.focusedSwimlaneId = null);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, activateKeyboardScope: c, deactivateKeyboardScope: k };
|
|
85
|
+
}
|
|
86
|
+
function Ha(n) {
|
|
87
|
+
let c = null;
|
|
88
|
+
Rl(() => {
|
|
89
|
+
c?.(), c = null;
|
|
90
|
+
});
|
|
91
|
+
const k = (f, m) => {
|
|
92
|
+
try {
|
|
93
|
+
window.scrollTo(f, m);
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return {
|
|
98
|
+
print: () => {
|
|
99
|
+
if (!n.rootRef.value) return;
|
|
100
|
+
c?.(), c = null;
|
|
101
|
+
const f = n.rootRef.value, m = document.body, u = m.classList.contains(S.printActive), g = f.classList.contains(S.printing), D = f.getAttribute("data-print-target"), v = f.hasAttribute("data-print-target"), $ = window.scrollX, C = window.scrollY, i = /* @__PURE__ */ new Map();
|
|
102
|
+
O(() => {
|
|
103
|
+
if (n.rootRef.value !== f) return;
|
|
104
|
+
let w = !1;
|
|
105
|
+
const s = () => {
|
|
106
|
+
w || (w = !0, window.removeEventListener("afterprint", s), u ? m.classList.add(S.printActive) : m.classList.remove(S.printActive), g ? f.classList.add(S.printing) : f.classList.remove(S.printing), v ? f.setAttribute("data-print-target", D ?? "") : f.removeAttribute("data-print-target"), i.forEach((b, R) => {
|
|
107
|
+
b ? R.classList.add(S.printAncestor) : R.classList.remove(S.printAncestor);
|
|
108
|
+
}), k($, C), c === s && (c = null));
|
|
109
|
+
};
|
|
110
|
+
c = s, m.classList.add(S.printActive), f.classList.add(S.printing), f.setAttribute("data-print-target", "true");
|
|
111
|
+
let M = f.parentElement;
|
|
112
|
+
for (; M && M !== m; )
|
|
113
|
+
i.set(M, M.classList.contains(S.printAncestor)), M.classList.add(S.printAncestor), M = M.parentElement;
|
|
114
|
+
k(0, 0), window.addEventListener("afterprint", s);
|
|
115
|
+
try {
|
|
116
|
+
window.print();
|
|
117
|
+
} catch (b) {
|
|
118
|
+
throw s(), b;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const La = "2026-06-28", Ka = ["dir"], Pa = {
|
|
125
|
+
key: 0,
|
|
126
|
+
role: "alert",
|
|
127
|
+
class: "p-taskboard-license-banner",
|
|
128
|
+
style: { display: "flex", "align-items": "center", gap: "8px", padding: "10px 14px", "margin-bottom": "12px", background: "#fef2f2", border: "1px solid #fecaca", color: "#991b1b", "border-radius": "6px", "font-size": "13px" }
|
|
129
|
+
}, $a = {
|
|
130
|
+
"aria-live": "polite",
|
|
131
|
+
"aria-atomic": "true",
|
|
132
|
+
style: { position: "absolute", width: "1px", height: "1px", overflow: "hidden", "clip-path": "inset(50%)", "white-space": "nowrap" }
|
|
133
|
+
}, Ya = /* @__PURE__ */ Wt({
|
|
134
|
+
__name: "TaskBoard",
|
|
135
|
+
props: /* @__PURE__ */ Tl({
|
|
136
|
+
columns: { default: () => [] },
|
|
137
|
+
swimlanes: { default: () => [] },
|
|
138
|
+
draggable: { type: Boolean, default: !0 },
|
|
139
|
+
selectionMode: { default: "none" },
|
|
140
|
+
contextMenu: { type: Boolean, default: !1 },
|
|
141
|
+
density: { default: "standard" },
|
|
142
|
+
features: {},
|
|
143
|
+
rtl: { type: Boolean },
|
|
144
|
+
disabled: { type: Boolean, default: !1 },
|
|
145
|
+
readonly: { type: Boolean, default: !1 },
|
|
146
|
+
columnWidth: {},
|
|
147
|
+
cardGap: {},
|
|
148
|
+
scrollable: { type: Boolean, default: !0 },
|
|
149
|
+
dragMinDistance: {},
|
|
150
|
+
columnCollapsible: { type: Boolean, default: !0 },
|
|
151
|
+
columnReorderable: { type: Boolean, default: !1 },
|
|
152
|
+
columnGroups: {},
|
|
153
|
+
virtualScroll: { type: Boolean, default: !1 },
|
|
154
|
+
virtualScrollItemHeight: { default: 250 },
|
|
155
|
+
virtualScrollBuffer: { default: 3 },
|
|
156
|
+
access: {},
|
|
157
|
+
items: {},
|
|
158
|
+
dataKey: {},
|
|
159
|
+
columnField: {},
|
|
160
|
+
swimlaneField: {}
|
|
161
|
+
}, {
|
|
162
|
+
tasks: { default: () => [] },
|
|
163
|
+
tasksModifiers: {}
|
|
164
|
+
}),
|
|
165
|
+
emits: /* @__PURE__ */ Tl(["cardMove", "cardClick", "cardDblclick", "cardActivate", "cardSelect", "selectionChange", "cardCreate", "cardUpdate", "cardDelete", "columnCollapse", "columnReorder", "swimlaneCollapse", "dragStart", "dragEnd", "dragCancel", "cardContextMenu", "cardDropBlocked", "cardReorder"], ["update:tasks"]),
|
|
166
|
+
setup(n, { expose: c, emit: k }) {
|
|
167
|
+
const a = n, f = Nt(n, "tasks"), m = p(() => a.items ?? f.value ?? []), u = p(() => Jt(m.value ?? [], { columnField: a.columnField, swimlaneField: a.swimlaneField })), g = p(() => Qt({ dataKey: a.dataKey, columnField: a.columnField, swimlaneField: a.swimlaneField })), D = p(() => ({ idField: a.dataKey, columnField: a.columnField, swimlaneField: a.swimlaneField })), v = (e) => g.value.getItemId(e), $ = (e) => g.value.getItemColumnValue(e), C = (e) => g.value.getItemSwimlaneValue(e), i = k, w = r(), s = r(), M = r(), b = r(null), R = r(null), Z = r(null), ke = r(""), U = r(null), We = p(() => !!U.value?.valid), Ne = p(() => U.value?.message ?? null), G = r(null), T = r([]), Te = r(null), L = r([]), ee = r([]), W = r(null), ze = r(!1), E = r(!1), xe = r(null), le = r(null), te = r(null), N = r(null), z = r(null), _e = r(0), ie = r(null), _ = r(null);
|
|
168
|
+
let B = () => {
|
|
169
|
+
};
|
|
170
|
+
const je = r(null);
|
|
171
|
+
let ce = null;
|
|
172
|
+
y(_, (e) => {
|
|
173
|
+
if (!e || !w.value) {
|
|
174
|
+
ce = null;
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const l = String(v(e)), t = Array.from(w.value.querySelectorAll("[data-task-id]")).find((o) => o.getAttribute("data-task-id") === l);
|
|
178
|
+
ce = t ? t.cloneNode(!0) : null;
|
|
179
|
+
}), y(je, (e) => {
|
|
180
|
+
if (!e || !(ce instanceof Element)) return;
|
|
181
|
+
const l = ce;
|
|
182
|
+
e.className = l.className, e.classList.remove("p-taskboard-card-dragging", "p-taskboard-card-dragging-source"), e.replaceChildren(...Array.from(l.childNodes).map((t) => t.cloneNode(!0))), l.getAttributeNames().filter((t) => t !== "class").forEach((t) => e.setAttribute(t, l.getAttribute(t)));
|
|
183
|
+
});
|
|
184
|
+
const De = r(!1), qe = r(null), El = r(0), Bl = r(/* @__PURE__ */ new Map()), Me = (e) => {
|
|
185
|
+
ke.value = "", O(() => {
|
|
186
|
+
ke.value = e;
|
|
187
|
+
});
|
|
188
|
+
}, Xe = p(() => Zt(a.columns ?? [])), j = r([]), Fl = (e) => {
|
|
189
|
+
j.value.some((l) => String(l.id) === String(e.id)) || (j.value = [...j.value, e]);
|
|
190
|
+
}, Hl = (e) => {
|
|
191
|
+
j.value = j.value.filter((l) => String(l.id) !== String(e));
|
|
192
|
+
}, x = p(() => Xe.value.length > 0 ? Xe.value : j.value), Ye = r(null), Je = r(null), Qe = r(null), Ll = (e) => {
|
|
193
|
+
Ye.value = e;
|
|
194
|
+
}, Kl = (e) => {
|
|
195
|
+
Je.value = e;
|
|
196
|
+
}, Pl = (e) => {
|
|
197
|
+
Qe.value = e;
|
|
198
|
+
}, Ze = r(null), $l = (e) => {
|
|
199
|
+
Ze.value = e;
|
|
200
|
+
}, el = r(null), Vl = (e) => {
|
|
201
|
+
el.value = e;
|
|
202
|
+
}, me = p(() => a.access?.canDrag !== !1 && a.draggable && ve("dragDrop")), Ol = p(() => a.access?.canEdit !== !1), ll = p(() => a.access?.canCreate !== !1), Ul = p(() => a.access?.canDelete !== !1), Gl = p(() => a.access?.canReorderColumns !== !1 && a.columnReorderable && ve("columnReorder")), tl = (e) => aa(a.access, e), Ae = (e) => na(a.access, e), al = (e) => oa(a.access, e), ve = (e) => ea(a.features, e), ge = p(() => x.value.filter((e) => al(e.id))), F = p(() => (a.swimlanes ?? []).length > 0), Wl = p(() => (a.columnGroups ?? []).length > 0), Nl = p(() => la(ge.value, a.columnGroups ?? [])), zl = p(
|
|
203
|
+
() => ge.value.map((e) => {
|
|
204
|
+
const l = (a.columnGroups ?? []).find((t) => t.columns.some((o) => String(o) === String(e.id)));
|
|
205
|
+
return {
|
|
206
|
+
key: `column-${e.id}`,
|
|
207
|
+
column: e,
|
|
208
|
+
label: l?.label,
|
|
209
|
+
group: l
|
|
210
|
+
};
|
|
211
|
+
})
|
|
212
|
+
), _l = (e) => {
|
|
213
|
+
const l = "var(--p-taskboard-column-effective-width, var(--p-taskboard-column-min-width))", t = {};
|
|
214
|
+
if (e.group?.color && (t["--p-taskboard-column-group-color"] = e.group.color), e.span === 1)
|
|
215
|
+
return { ...t, flex: `1 0 ${l}`, minWidth: l };
|
|
216
|
+
const o = `calc(${e.span} * ${l} + ${e.span - 1} * var(--p-taskboard-column-gap))`;
|
|
217
|
+
return { ...t, flex: `${e.span} 0 ${o}`, minWidth: o };
|
|
218
|
+
}, jl = (e) => {
|
|
219
|
+
const l = "var(--p-taskboard-column-effective-width, var(--p-taskboard-column-min-width))", t = {};
|
|
220
|
+
return e?.group?.color && (t["--p-taskboard-column-group-color"] = e.group.color), { ...t, flex: `0 0 ${l}`, minWidth: l };
|
|
221
|
+
}, ql = (e) => e.columnIds ? e.columnIds.map((l) => ge.value.find((t) => String(t.id) === String(l))).filter(Boolean) : [], Xl = () => {
|
|
222
|
+
B();
|
|
223
|
+
}, h = p(() => xl(a.swimlanes ?? [])), Yl = p(() => {
|
|
224
|
+
if (!a.virtualScroll)
|
|
225
|
+
return h.value;
|
|
226
|
+
if (!W.value) {
|
|
227
|
+
const e = a.virtualScrollItemHeight ?? 250, l = a.virtualScrollBuffer ?? 3, t = Math.ceil(600 / e) + l * 2;
|
|
228
|
+
return h.value.slice(0, Math.min(t, h.value.length));
|
|
229
|
+
}
|
|
230
|
+
return h.value.slice(W.value.startIndex, W.value.endIndex);
|
|
231
|
+
});
|
|
232
|
+
let Re = 0, V = null;
|
|
233
|
+
const ae = /* @__PURE__ */ new Map(), ne = r(/* @__PURE__ */ new Map()), nl = () => a.virtualScrollItemHeight ?? 250, Jl = () => a.virtualScrollBuffer ?? 3, q = (e) => String(e.id), Ee = (e) => ae.get(q(e)) ?? nl(), Ql = (e = h.value) => e.map((l) => ae.get(q(l)) ?? 0), Zl = (e) => e.reduce((l, t) => l + Ee(t), 0), ol = (e, l, t) => Math.max(0, Math.min(e, Math.max(0, Zl(l) - t))), et = (e, l) => {
|
|
234
|
+
let t = 0;
|
|
235
|
+
for (let o = 0; o < Math.max(0, l); o++)
|
|
236
|
+
t += Ee(e[o]);
|
|
237
|
+
return t;
|
|
238
|
+
}, lt = (e, l) => {
|
|
239
|
+
let t = 0;
|
|
240
|
+
for (let o = 0; o < e.length; o++) {
|
|
241
|
+
const d = Ee(e[o]);
|
|
242
|
+
if (t + d > l)
|
|
243
|
+
return o;
|
|
244
|
+
t += d;
|
|
245
|
+
}
|
|
246
|
+
return Math.max(0, e.length - 1);
|
|
247
|
+
}, tt = (e, l = h.value) => l.length ? q(l[lt(l, e)]) : null, at = (e = h.value) => {
|
|
248
|
+
const l = new Set(e.map((t) => q(t)));
|
|
249
|
+
for (const t of ae.keys())
|
|
250
|
+
l.has(t) || ae.delete(t);
|
|
251
|
+
}, pe = () => {
|
|
252
|
+
if (!s.value) return;
|
|
253
|
+
const e = s.value.querySelectorAll('[role="group"][data-swimlane-id]'), l = /* @__PURE__ */ new Set();
|
|
254
|
+
e.forEach((t) => {
|
|
255
|
+
const o = t.getAttribute("data-swimlane-id");
|
|
256
|
+
!o || l.has(o) || (l.add(o), ae.set(o, t.offsetHeight));
|
|
257
|
+
});
|
|
258
|
+
}, nt = () => {
|
|
259
|
+
if (!s.value || !F.value) {
|
|
260
|
+
ne.value = /* @__PURE__ */ new Map();
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const e = /* @__PURE__ */ new Map();
|
|
264
|
+
s.value.querySelectorAll('[role="group"][data-swimlane-id]').forEach((t) => {
|
|
265
|
+
const o = t.getAttribute("data-swimlane-id"), d = t.offsetHeight;
|
|
266
|
+
o && d > 0 && e.set(o, d);
|
|
267
|
+
}), ne.value = e;
|
|
268
|
+
};
|
|
269
|
+
y(
|
|
270
|
+
E,
|
|
271
|
+
(e) => {
|
|
272
|
+
if (!F.value) {
|
|
273
|
+
ne.value = /* @__PURE__ */ new Map();
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
e ? nt() : ne.value = /* @__PURE__ */ new Map();
|
|
277
|
+
},
|
|
278
|
+
{ flush: "sync" }
|
|
279
|
+
);
|
|
280
|
+
const fe = (e, l) => {
|
|
281
|
+
const t = ol(e, h.value, l);
|
|
282
|
+
s.value && Math.abs(s.value.scrollTop - t) > 1 && (s.value.scrollTop = t), Re = t, W.value = ra(t, l, h.value.length, Ql(), nl(), Jl());
|
|
283
|
+
}, rl = (e = h.value) => {
|
|
284
|
+
if (!a.virtualScroll || !F.value || !s.value) return;
|
|
285
|
+
const t = s.value.scrollTop, o = tt(t, e);
|
|
286
|
+
at(), O(() => {
|
|
287
|
+
if (!s.value) return;
|
|
288
|
+
const d = h.value, A = o == null ? -1 : d.findIndex(($e) => q($e) === o), re = A >= 0 ? et(d, A) : t, se = ol(re, d, s.value.clientHeight ?? 600);
|
|
289
|
+
s.value.scrollTop = se, pe(), fe(se, s.value.clientHeight ?? 600), B();
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
y(
|
|
293
|
+
() => s.value,
|
|
294
|
+
(e) => {
|
|
295
|
+
e && a.virtualScroll && F.value && !W.value && O(() => {
|
|
296
|
+
pe(), fe(0, e.clientHeight ?? 600);
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
const ot = (e) => {
|
|
301
|
+
if (B(), !a.virtualScroll || !F.value) return;
|
|
302
|
+
const l = e.target;
|
|
303
|
+
Math.abs(l.scrollTop - Re) < 1 || (Re = l.scrollTop, V && cancelAnimationFrame(V), V = requestAnimationFrame(() => {
|
|
304
|
+
pe(), fe(l.scrollTop, l.clientHeight), B(), V = null;
|
|
305
|
+
}));
|
|
306
|
+
}, rt = (e) => a.swimlaneField ? sa(u.value, e) : 0, Be = (e) => ee.value.some((l) => String(l) === String(e)), st = (e) => da(e, { collapsedSwimlaneIds: ee.value }), dt = () => {
|
|
307
|
+
const e = x.value.length, l = Math.max(0, e - 1);
|
|
308
|
+
return `calc(var(--p-taskboard-swimlane-header-width) + (2 * var(--p-taskboard-columns-padding)) + (${e} * var(--p-taskboard-column-min-width)) + (${e * 2} * var(--p-taskboard-column-body-padding)) + (${l} * var(--p-taskboard-column-gap)))`;
|
|
309
|
+
}, sl = () => ({
|
|
310
|
+
minWidth: dt()
|
|
311
|
+
}), ut = (e) => {
|
|
312
|
+
const l = sl(), t = ne.value.get(q(e));
|
|
313
|
+
return E.value && t && !Be(e.id) && (l.height = `${t}px`, l.minHeight = `${t}px`), l;
|
|
314
|
+
}, dl = () => ({
|
|
315
|
+
columns: x.value,
|
|
316
|
+
tasks: m.value,
|
|
317
|
+
swimlanes: a.swimlanes,
|
|
318
|
+
draggable: a.draggable,
|
|
319
|
+
selectionMode: a.selectionMode,
|
|
320
|
+
contextMenu: a.contextMenu,
|
|
321
|
+
density: a.density,
|
|
322
|
+
features: a.features,
|
|
323
|
+
disabled: a.disabled,
|
|
324
|
+
readonly: a.readonly,
|
|
325
|
+
columnWidth: a.columnWidth,
|
|
326
|
+
cardGap: a.cardGap,
|
|
327
|
+
scrollable: a.scrollable
|
|
328
|
+
}), { initializeCore: it, cleanupControllers: ct, recordAudit: Ce, canUndoState: ul, canRedoState: il, getCoreInstance: H, getDragController: Se, getSelectionController: X, getWorkflowController: we, getKeyboardController: Y, getHistoryController: J, getAuditController: cl } = ha({
|
|
329
|
+
rootRef: w,
|
|
330
|
+
columnsContainerRef: s,
|
|
331
|
+
selectedCardIds: T,
|
|
332
|
+
collapsedColumnIds: L,
|
|
333
|
+
collapsedSwimlaneIds: ee,
|
|
334
|
+
focusedCardId: b,
|
|
335
|
+
focusedColumnId: R,
|
|
336
|
+
focusedSwimlaneId: Z,
|
|
337
|
+
selectionOrigin: Te,
|
|
338
|
+
pendingConfirmMove: G,
|
|
339
|
+
tasks: m,
|
|
340
|
+
allColumns: x,
|
|
341
|
+
visibleColumns: ge,
|
|
342
|
+
processedSwimlanes: h,
|
|
343
|
+
getCoreProps: dl,
|
|
344
|
+
getColumnTasks: (e) => Fe(e),
|
|
345
|
+
getVisibleCellTasks: (e, l) => Ke(e, l),
|
|
346
|
+
getItemId: v,
|
|
347
|
+
getItemColumnValue: $,
|
|
348
|
+
getItemSwimlaneValue: C,
|
|
349
|
+
canMoveIntoColumn: tl,
|
|
350
|
+
canMoveOutOfColumn: Ae,
|
|
351
|
+
canKeyboardMove: () => me.value,
|
|
352
|
+
applyCardMoveHandler: (e) => Pe(e),
|
|
353
|
+
announce: Me,
|
|
354
|
+
scrollToColumnImpl: (e) => Cl(e),
|
|
355
|
+
scrollToCardImpl: (e) => Sl(e),
|
|
356
|
+
emit: (e, ...l) => i(e, ...l),
|
|
357
|
+
getDisabled: () => a.disabled,
|
|
358
|
+
getReadonly: () => a.readonly,
|
|
359
|
+
getSelectionMode: () => a.selectionMode,
|
|
360
|
+
dragMinDistance: a.dragMinDistance
|
|
361
|
+
}), mt = (e) => {
|
|
362
|
+
Be(e.id) ? H()?.expandSwimlane(e.id) : H()?.collapseSwimlane(e.id), B(), O(() => B());
|
|
363
|
+
}, Fe = (e) => ua(Ge(u.value, e), e, a.columnField), I = () => {
|
|
364
|
+
H()?.$setProps(dl());
|
|
365
|
+
}, {
|
|
366
|
+
getDragHiddenIds: Q,
|
|
367
|
+
onCardPointerDown: vt,
|
|
368
|
+
onDocumentPointerMove: gt,
|
|
369
|
+
onDocumentPointerUp: pt,
|
|
370
|
+
cleanupCardDrag: ft,
|
|
371
|
+
markDragGeometryDirty: Ct
|
|
372
|
+
} = ya({
|
|
373
|
+
getDisabled: () => a.disabled,
|
|
374
|
+
getReadonly: () => a.readonly,
|
|
375
|
+
getSelectionMode: () => a.selectionMode,
|
|
376
|
+
getDragMinDistance: () => a.dragMinDistance,
|
|
377
|
+
tasks: m,
|
|
378
|
+
columnsContainerRef: s,
|
|
379
|
+
isDragging: E,
|
|
380
|
+
draggedCardId: xe,
|
|
381
|
+
dragTargetColumnId: le,
|
|
382
|
+
dragTargetIndex: te,
|
|
383
|
+
dragTargetSwimlaneId: ie,
|
|
384
|
+
ghostPosition: N,
|
|
385
|
+
dragPreviewWidth: z,
|
|
386
|
+
draggedCardData: _,
|
|
387
|
+
selectedCardIds: T,
|
|
388
|
+
selectionOrigin: Te,
|
|
389
|
+
hasSwimlanes: F,
|
|
390
|
+
canDrag: me,
|
|
391
|
+
getDragController: Se,
|
|
392
|
+
getSelectionController: X,
|
|
393
|
+
isFeatureEnabled: (e) => ve(e),
|
|
394
|
+
canMoveOutOfColumn: Ae,
|
|
395
|
+
focusCard: (e) => Y()?.setFocusedCard(e),
|
|
396
|
+
emit: (e, l) => {
|
|
397
|
+
i(e, l);
|
|
398
|
+
},
|
|
399
|
+
getItemId: v,
|
|
400
|
+
getItemColumnValue: $,
|
|
401
|
+
getItemSwimlaneValue: C
|
|
402
|
+
});
|
|
403
|
+
B = Ct;
|
|
404
|
+
const oe = () => {
|
|
405
|
+
B(), (E.value || Se()?.state.isPending || Se()?.state.isDragging) && O(() => B());
|
|
406
|
+
}, ml = (e) => L.value.some((l) => String(l) === String(e)), vl = (e) => {
|
|
407
|
+
if (!a.columnCollapsible) return;
|
|
408
|
+
const l = ia(L.value, e.id);
|
|
409
|
+
L.value = l.ids, H()?.$setState({ collapsedColumnIds: l.ids }), i("columnCollapse", { column: e, collapsed: l.collapsed }), oe();
|
|
410
|
+
}, { onColumnHeaderPointerDown: St, onColumnHeaderClick: wt, onColumnDragMove: Va, onColumnDragEnd: Oa, getColumnStyle: It, cleanupColumnDrag: bt } = ka({
|
|
411
|
+
getDisabled: () => a.disabled,
|
|
412
|
+
getColumnCollapsible: () => a.columnCollapsible,
|
|
413
|
+
columnsContainerRef: s,
|
|
414
|
+
isColumnDragging: De,
|
|
415
|
+
draggedColumnId: qe,
|
|
416
|
+
columnDragStartX: El,
|
|
417
|
+
columnDragOffsets: Bl,
|
|
418
|
+
processedColumns: x,
|
|
419
|
+
canReorderColumns: Gl,
|
|
420
|
+
isColumnCollapsed: ml,
|
|
421
|
+
onColumnToggle: vl,
|
|
422
|
+
emit: (e, l) => {
|
|
423
|
+
const t = e.replace(/-([a-z])/g, (o, d) => d.toUpperCase());
|
|
424
|
+
i(t, l);
|
|
425
|
+
}
|
|
426
|
+
}), gl = (e, l, t) => {
|
|
427
|
+
a.items || (f.value = Sa(m.value, e), I(), J()?.pushAction({
|
|
428
|
+
type: "create",
|
|
429
|
+
taskId: v(e),
|
|
430
|
+
before: null,
|
|
431
|
+
after: { ...e },
|
|
432
|
+
description: t
|
|
433
|
+
}), Ce("create", v(e), t)), i("cardCreate", { card: e, column: l });
|
|
434
|
+
}, ht = (e, l, t) => {
|
|
435
|
+
a.items || (f.value = Ia(m.value, v(e), D.value), I(), J()?.pushAction({
|
|
436
|
+
type: "delete",
|
|
437
|
+
taskId: v(e),
|
|
438
|
+
before: { ...e },
|
|
439
|
+
after: null,
|
|
440
|
+
description: t
|
|
441
|
+
}), Ce("delete", v(e), t)), i("cardDelete", { card: e, column: l });
|
|
442
|
+
}, yt = (e, l, t) => {
|
|
443
|
+
i("cardDblclick", { card: e, column: l, jsEvent: t }), i("cardActivate", { card: e, column: l, origin: "pointer", jsEvent: t });
|
|
444
|
+
}, kt = (e, l) => {
|
|
445
|
+
if (!ll.value) return;
|
|
446
|
+
const t = {
|
|
447
|
+
...e,
|
|
448
|
+
[a.columnField]: l.id
|
|
449
|
+
};
|
|
450
|
+
t[a.dataKey] == null && (t[a.dataKey] = `task-${Date.now()}`), t.order == null && (t.order = Il(l.id).length), gl(t, l, "Created task");
|
|
451
|
+
}, { performUndo: He, performRedo: Le } = Ta({
|
|
452
|
+
tasks: m,
|
|
453
|
+
tasksWritable: f,
|
|
454
|
+
syncCoreProps: I,
|
|
455
|
+
announce: Me,
|
|
456
|
+
getHistoryController: J,
|
|
457
|
+
getMutationFields: () => D.value
|
|
458
|
+
}), Ke = (e, l) => {
|
|
459
|
+
const t = ca(Al(u.value, e, l), e, l, a.columnField, a.swimlaneField ?? ""), o = Q();
|
|
460
|
+
return o.length > 0 ? t.filter((d) => !o.includes(v(d))) : t;
|
|
461
|
+
}, Tt = (e, l, t) => !E.value || String(le.value) !== String(e) || String(ie.value) !== String(l) ? !1 : te.value === t, xt = (e, l) => !E.value || String(le.value) !== String(e) || String(ie.value) !== String(l) ? !1 : te.value === Ke(e, l).length, Dt = (e) => {
|
|
462
|
+
const l = Fe(e), t = Q();
|
|
463
|
+
return t.length > 0 ? l.filter((o) => !t.includes(v(o))) : l;
|
|
464
|
+
}, Mt = (e) => ma(u.value, e), At = p(
|
|
465
|
+
() => ta({
|
|
466
|
+
disabled: a.disabled,
|
|
467
|
+
readonly: a.readonly,
|
|
468
|
+
density: a.density,
|
|
469
|
+
isDragging: E.value,
|
|
470
|
+
isColumnReordering: De.value,
|
|
471
|
+
isTouch: ze.value,
|
|
472
|
+
rtl: a.rtl
|
|
473
|
+
})
|
|
474
|
+
), Rt = (e) => va(e, {
|
|
475
|
+
collapsedColumnIds: L.value,
|
|
476
|
+
isColumnDragging: De.value,
|
|
477
|
+
draggedColumnId: qe.value,
|
|
478
|
+
focusedColumnId: R.value,
|
|
479
|
+
wipStatus: we() ? we().getWipStatus(e.id) : void 0
|
|
480
|
+
}), Et = (e) => ga(e, {
|
|
481
|
+
taskId: v(e),
|
|
482
|
+
canDrag: me.value,
|
|
483
|
+
selectedCardIds: T.value,
|
|
484
|
+
draggedCardId: xe.value,
|
|
485
|
+
focusedCardId: b.value
|
|
486
|
+
}), Bt = (e, l, t) => {
|
|
487
|
+
!a.contextMenu || !ve("contextMenu") || (t.preventDefault(), i("cardContextMenu", { card: e, column: l, position: { x: t.clientX, y: t.clientY }, jsEvent: t }));
|
|
488
|
+
}, Ft = () => {
|
|
489
|
+
if (T.value.length > 0 && X()?.clearSelection(), b.value != null) {
|
|
490
|
+
b.value = null;
|
|
491
|
+
const e = Y();
|
|
492
|
+
e && (e.focusedCardId = null);
|
|
493
|
+
}
|
|
494
|
+
if (R.value != null) {
|
|
495
|
+
R.value = null, Z.value = null;
|
|
496
|
+
const e = Y();
|
|
497
|
+
e && (e.focusedColumnId = null, e.focusedSwimlaneId = null);
|
|
498
|
+
}
|
|
499
|
+
}, { onKeyDown: pl, onDocumentClick: fl, activateKeyboardScope: Ie, deactivateKeyboardScope: Ht } = Fa({
|
|
500
|
+
isDragging: E,
|
|
501
|
+
draggedCardId: xe,
|
|
502
|
+
dragTargetColumnId: le,
|
|
503
|
+
dragTargetIndex: te,
|
|
504
|
+
dragTargetSwimlaneId: ie,
|
|
505
|
+
ghostPosition: N,
|
|
506
|
+
draggedCardData: _,
|
|
507
|
+
selectedCardIds: T,
|
|
508
|
+
selectionOrigin: Te,
|
|
509
|
+
focusedCardId: b,
|
|
510
|
+
focusedColumnId: R,
|
|
511
|
+
focusedSwimlaneId: Z,
|
|
512
|
+
rootRef: w,
|
|
513
|
+
allColumns: x,
|
|
514
|
+
getDragController: Se,
|
|
515
|
+
getSelectionController: X,
|
|
516
|
+
getKeyboardController: Y,
|
|
517
|
+
onDocumentPointerMove: gt,
|
|
518
|
+
onDocumentPointerUp: pt,
|
|
519
|
+
performUndo: He,
|
|
520
|
+
performRedo: Le,
|
|
521
|
+
emit: (e, ...l) => i(e, ...l)
|
|
522
|
+
}), Pe = (e) => {
|
|
523
|
+
a.items || (f.value = wa(m.value ?? [], {
|
|
524
|
+
cardId: v(e.card),
|
|
525
|
+
targetColumnId: e.newColumnId,
|
|
526
|
+
targetIndex: e.newIndex,
|
|
527
|
+
targetSwimlaneId: e.newSwimlaneId,
|
|
528
|
+
selectedCardIds: T.value,
|
|
529
|
+
fields: D.value
|
|
530
|
+
}), I(), J()?.pushAction({
|
|
531
|
+
type: "move",
|
|
532
|
+
taskId: v(e.card),
|
|
533
|
+
before: { columnId: e.oldColumnId, swimlaneId: e.oldSwimlaneId, order: e.oldIndex },
|
|
534
|
+
after: { columnId: e.newColumnId, swimlaneId: e.newSwimlaneId, order: e.newIndex },
|
|
535
|
+
description: "Moved task"
|
|
536
|
+
}), Ce("move", v(e.card), "Moved card", { columnId: e.oldColumnId }, { columnId: e.newColumnId })), i("cardMove", e), String(e.oldColumnId) === String(e.newColumnId) && i("cardReorder", { card: e.card, columnValue: e.newColumnId, oldIndex: e.oldIndex, newIndex: e.newIndex });
|
|
537
|
+
const l = x.value.find((t) => String(t.id) === String(e.newColumnId));
|
|
538
|
+
l && Me(`Task moved to ${l.label}`);
|
|
539
|
+
}, Lt = () => {
|
|
540
|
+
if (!G.value) return;
|
|
541
|
+
const e = G.value.payload;
|
|
542
|
+
Pe(e), G.value = null;
|
|
543
|
+
}, Kt = () => {
|
|
544
|
+
G.value = null;
|
|
545
|
+
};
|
|
546
|
+
y(
|
|
547
|
+
() => a.columns,
|
|
548
|
+
() => {
|
|
549
|
+
I(), oe();
|
|
550
|
+
},
|
|
551
|
+
{ deep: !0 }
|
|
552
|
+
), y(
|
|
553
|
+
() => m.value,
|
|
554
|
+
() => {
|
|
555
|
+
I(), oe(), a.virtualScroll && F.value && rl();
|
|
556
|
+
},
|
|
557
|
+
{ deep: !0 }
|
|
558
|
+
), y(
|
|
559
|
+
() => a.swimlanes,
|
|
560
|
+
(e, l) => {
|
|
561
|
+
I(), oe(), a.virtualScroll && rl(xl(l ?? []));
|
|
562
|
+
},
|
|
563
|
+
{ deep: !0 }
|
|
564
|
+
), y(() => a.density, I), y(() => a.disabled, I), y(() => a.readonly, I), y(() => a.draggable, I), y(() => a.selectionMode, I), y(
|
|
565
|
+
() => a.columnCollapsible,
|
|
566
|
+
(e) => {
|
|
567
|
+
I(), !e && L.value.length && (L.value = [], H()?.$setState({ collapsedColumnIds: [] }), oe());
|
|
568
|
+
}
|
|
569
|
+
), zt(ba, {
|
|
570
|
+
items: m,
|
|
571
|
+
dataKey: a.dataKey,
|
|
572
|
+
columnField: a.columnField,
|
|
573
|
+
swimlaneField: p(() => F.value ? a.swimlaneField : void 0),
|
|
574
|
+
getItemId: v,
|
|
575
|
+
getItemsByColumn: Fe,
|
|
576
|
+
getVisibleItemsByColumn: Dt,
|
|
577
|
+
itemCount: Mt,
|
|
578
|
+
getDragHiddenIds: Q,
|
|
579
|
+
isDragging: E,
|
|
580
|
+
dragTargetColumnValue: le,
|
|
581
|
+
dragTargetIndex: te,
|
|
582
|
+
selectedItemIds: T,
|
|
583
|
+
ghostPosition: N,
|
|
584
|
+
dragPreviewWidth: z,
|
|
585
|
+
draggedItem: _,
|
|
586
|
+
customDragPreviewCount: _e,
|
|
587
|
+
onCardPointerDown: vt,
|
|
588
|
+
onCardDblClick: yt,
|
|
589
|
+
onCardContextMenu: Bt,
|
|
590
|
+
onColumnToggle: vl,
|
|
591
|
+
onColumnHeaderClick: wt,
|
|
592
|
+
onColumnHeaderPointerDown: St,
|
|
593
|
+
onBoardBackgroundClick: Ft,
|
|
594
|
+
isColumnCollapsed: ml,
|
|
595
|
+
columnClasses: Rt,
|
|
596
|
+
getColumnStyle: It,
|
|
597
|
+
cardWrapperClasses: Et,
|
|
598
|
+
virtualScroll: p(() => a.virtualScroll),
|
|
599
|
+
canUndoState: ul,
|
|
600
|
+
canRedoState: il,
|
|
601
|
+
performUndo: He,
|
|
602
|
+
performRedo: Le,
|
|
603
|
+
selectCard: (e, l) => X()?.selectCard(e, l),
|
|
604
|
+
selectAllCards: (e) => X()?.selectAll(e),
|
|
605
|
+
clearSelection: () => X()?.clearSelection(),
|
|
606
|
+
canDrag: me,
|
|
607
|
+
canEdit: Ol,
|
|
608
|
+
canCreate: ll,
|
|
609
|
+
canDelete: Ul,
|
|
610
|
+
canMoveIntoColumn: tl,
|
|
611
|
+
canMoveOutOfColumn: Ae,
|
|
612
|
+
canViewColumn: al,
|
|
613
|
+
createItem: kt,
|
|
614
|
+
getWipStatus: (e) => we()?.getWipStatus(e),
|
|
615
|
+
canMoveCard: (e, l, t) => we()?.canMoveCard(e, l, t) ?? { allowed: !0 },
|
|
616
|
+
classes: S,
|
|
617
|
+
props: a,
|
|
618
|
+
licenseValid: We,
|
|
619
|
+
licenseMessage: Ne,
|
|
620
|
+
hasColumnGroups: Wl,
|
|
621
|
+
columnGroupSegments: Nl,
|
|
622
|
+
columnGroupColumnSegments: zl,
|
|
623
|
+
getGroupSegmentStyle: _l,
|
|
624
|
+
getGroupColumnSegmentStyle: jl,
|
|
625
|
+
getGroupColumns: ql,
|
|
626
|
+
onColumnsHorizontalScroll: Xl,
|
|
627
|
+
markDragGeometryDirty: B,
|
|
628
|
+
groupHeadersRef: M,
|
|
629
|
+
columnsContainerRef: s,
|
|
630
|
+
hasSwimlanes: F,
|
|
631
|
+
processedSwimlanes: h,
|
|
632
|
+
visibleSwimlanes: Yl,
|
|
633
|
+
swimlaneTaskCount: rt,
|
|
634
|
+
isSwimlaneCollapsed: Be,
|
|
635
|
+
swimlaneRowClasses: st,
|
|
636
|
+
swimlaneTrackStyle: sl,
|
|
637
|
+
swimlaneRowStyle: ut,
|
|
638
|
+
onSwimlaneToggle: mt,
|
|
639
|
+
onSwimlaneGridScroll: ot,
|
|
640
|
+
virtualScrollState: W,
|
|
641
|
+
getVisibleCellTasks: Ke,
|
|
642
|
+
showDropIndicator: Tt,
|
|
643
|
+
showDropIndicatorAtEnd: xt,
|
|
644
|
+
cardSlotRenderer: Ye,
|
|
645
|
+
columnHeaderSlotRenderer: Je,
|
|
646
|
+
swimlaneHeaderSlotRenderer: Qe,
|
|
647
|
+
registerCardSlot: Ll,
|
|
648
|
+
registerColumnHeaderSlot: Kl,
|
|
649
|
+
registerSwimlaneHeaderSlot: Pl,
|
|
650
|
+
dropIndicatorSlotRenderer: Ze,
|
|
651
|
+
registerDropIndicatorSlot: $l,
|
|
652
|
+
swimlaneColumnHeaderSlotRenderer: el,
|
|
653
|
+
registerSwimlaneColumnHeaderSlot: Vl,
|
|
654
|
+
pendingConfirmMove: G,
|
|
655
|
+
confirmPendingMove: Lt,
|
|
656
|
+
cancelPendingMove: Kt,
|
|
657
|
+
processedColumns: x,
|
|
658
|
+
registerColumn: Fl,
|
|
659
|
+
unregisterColumn: Hl,
|
|
660
|
+
emitCardMove: (e) => i("cardMove", e),
|
|
661
|
+
emitCardReorder: (e) => i("cardReorder", e),
|
|
662
|
+
emitColumnReorder: (e) => i("columnReorder", e),
|
|
663
|
+
emitCardClick: (e) => i("cardClick", e),
|
|
664
|
+
emitCardDblClick: (e) => i("cardDblclick", e),
|
|
665
|
+
emitCardActivate: (e) => i("cardActivate", e),
|
|
666
|
+
emitSelectionChange: (e) => i("selectionChange", e),
|
|
667
|
+
emitColumnCollapse: (e) => i("columnCollapse", e),
|
|
668
|
+
emitContextMenu: (e) => i("cardContextMenu", e)
|
|
669
|
+
}), _t(() => {
|
|
670
|
+
ze.value = "ontouchstart" in window || navigator.maxTouchPoints > 0, it(), a.virtualScroll && F.value && s.value && O(() => {
|
|
671
|
+
pe(), fe(0, s.value?.clientHeight ?? 600);
|
|
672
|
+
}), document.addEventListener("keydown", pl), document.addEventListener("click", fl), Pt();
|
|
673
|
+
});
|
|
674
|
+
async function Pt() {
|
|
675
|
+
const e = await Yt("taskboard", { releaseDate: La });
|
|
676
|
+
U.value = e, e.valid || console.warn(`[PrimeUI TaskBoard] ${e.message}`);
|
|
677
|
+
}
|
|
678
|
+
Rl(() => {
|
|
679
|
+
ct(), Ht(), document.removeEventListener("keydown", pl), document.removeEventListener("click", fl), ft(), bt(), V && (cancelAnimationFrame(V), V = null);
|
|
680
|
+
});
|
|
681
|
+
const Cl = (e, l) => {
|
|
682
|
+
if (!s.value) return;
|
|
683
|
+
const t = String(e), o = Array.from(s.value.querySelectorAll("[data-column-id]")).find((d) => d.getAttribute("data-column-id") === t);
|
|
684
|
+
o && o.scrollIntoView({ behavior: l?.behavior ?? "smooth", block: "nearest", inline: "start" });
|
|
685
|
+
}, Sl = (e, l) => {
|
|
686
|
+
if (!w.value) return;
|
|
687
|
+
const t = String(e), o = Array.from(w.value.querySelectorAll("[data-task-id]")).find((d) => d.getAttribute("data-task-id") === t);
|
|
688
|
+
if (o) {
|
|
689
|
+
o.scrollIntoView({ behavior: l?.behavior ?? "smooth", block: l?.block ?? "center", inline: "nearest" }), b.value = e;
|
|
690
|
+
const d = Y();
|
|
691
|
+
d && (d.focusedCardId = e);
|
|
692
|
+
}
|
|
693
|
+
}, { print: $t } = Ha({ rootRef: w }), wl = (e, l, t) => {
|
|
694
|
+
const o = new Blob([e], { type: t }), d = URL.createObjectURL(o), A = document.createElement("a");
|
|
695
|
+
A.href = d, A.download = l, document.body.appendChild(A), A.click(), document.body.removeChild(A), URL.revokeObjectURL(d);
|
|
696
|
+
}, Vt = () => pa({
|
|
697
|
+
collapsedColumnIds: L.value,
|
|
698
|
+
collapsedSwimlaneIds: ee.value,
|
|
699
|
+
selectedCardIds: T.value,
|
|
700
|
+
focusedCardId: b.value,
|
|
701
|
+
focusedColumnId: R.value,
|
|
702
|
+
focusedSwimlaneId: Z.value
|
|
703
|
+
}), Ot = (e) => {
|
|
704
|
+
const l = fa(e);
|
|
705
|
+
if (l.collapsedColumnIds && (L.value = l.collapsedColumnIds, H()?.$setState({ collapsedColumnIds: l.collapsedColumnIds })), l.collapsedSwimlaneIds && (ee.value = l.collapsedSwimlaneIds, H()?.$setState({ collapsedSwimlaneIds: l.collapsedSwimlaneIds })), l.selectedCardIds && (T.value = l.selectedCardIds, H()?.$setState({ selectedCardIds: l.selectedCardIds })), "focusedCardId" in l) {
|
|
706
|
+
b.value = l.focusedCardId ?? null;
|
|
707
|
+
const t = Y();
|
|
708
|
+
t && (t.focusedCardId = b.value);
|
|
709
|
+
}
|
|
710
|
+
"focusedColumnId" in l && (R.value = l.focusedColumnId ?? null), "focusedSwimlaneId" in l && (Z.value = l.focusedSwimlaneId ?? null);
|
|
711
|
+
}, K = () => H(), be = (e) => (m.value ?? []).find((l) => String(v(l)) === String(e)), Il = (e) => [...Ge(u.value, e)], bl = (e, l) => [...a.swimlaneField && l != null ? Al(u.value, e, l) : Ge(u.value, e)].sort((o, d) => (o.order ?? 0) - (d.order ?? 0)), hl = (e = T.value) => {
|
|
712
|
+
const l = new Set(e.map((t) => String(t)));
|
|
713
|
+
return (m.value ?? []).filter((t) => l.has(String(v(t))));
|
|
714
|
+
}, yl = (e) => {
|
|
715
|
+
T.value = e, H()?.$setState({ selectedCardIds: e }), i("selectionChange", { selectedIds: e, cards: hl(e) });
|
|
716
|
+
};
|
|
717
|
+
return c({
|
|
718
|
+
getColumns: () => K()?.getColumns() ?? [],
|
|
719
|
+
getColumnById: (e) => K()?.getColumnById(e),
|
|
720
|
+
getTasks: () => K()?.getTasks() ?? [],
|
|
721
|
+
getTaskById: be,
|
|
722
|
+
getTasksByColumn: Il,
|
|
723
|
+
getSelectedCardIds: () => T.value,
|
|
724
|
+
getSelectedCards: () => hl(),
|
|
725
|
+
setSelectedCards: yl,
|
|
726
|
+
clearSelection: () => yl([]),
|
|
727
|
+
addTask: (e) => {
|
|
728
|
+
const l = x.value.find((t) => String(t.id) === String($(e)));
|
|
729
|
+
l && gl(e, l, "Created task");
|
|
730
|
+
},
|
|
731
|
+
updateTask: (e) => {
|
|
732
|
+
const l = v(e), t = be(l);
|
|
733
|
+
t && (a.items || (f.value = Ca(m.value ?? [], l, e, D.value), I(), J()?.pushAction({
|
|
734
|
+
type: "edit",
|
|
735
|
+
taskId: l,
|
|
736
|
+
before: { ...t },
|
|
737
|
+
after: { ...e },
|
|
738
|
+
description: "Updated task"
|
|
739
|
+
}), Ce("update", l, "Updated task")), i("cardUpdate", { card: e, oldCard: t }));
|
|
740
|
+
},
|
|
741
|
+
removeTask: (e) => {
|
|
742
|
+
const l = be(e);
|
|
743
|
+
if (!l) return;
|
|
744
|
+
const t = x.value.find((o) => String(o.id) === String($(l)));
|
|
745
|
+
t && ht(l, t, "Deleted task");
|
|
746
|
+
},
|
|
747
|
+
moveTask: (e, l, t, o) => {
|
|
748
|
+
const d = be(e);
|
|
749
|
+
if (!d) return;
|
|
750
|
+
const A = $(d), re = C(d), se = o ?? re, $e = bl(A, re).findIndex((Gt) => String(v(Gt)) === String(e)), Ut = t ?? bl(l, se).length;
|
|
751
|
+
Pe({
|
|
752
|
+
card: d,
|
|
753
|
+
oldColumnId: A,
|
|
754
|
+
newColumnId: l,
|
|
755
|
+
oldIndex: $e,
|
|
756
|
+
newIndex: Ut,
|
|
757
|
+
oldSwimlaneId: re,
|
|
758
|
+
newSwimlaneId: se
|
|
759
|
+
});
|
|
760
|
+
},
|
|
761
|
+
collapseColumn: (e) => K()?.collapseColumn(e),
|
|
762
|
+
expandColumn: (e) => K()?.expandColumn(e),
|
|
763
|
+
toggleColumn: (e) => K()?.toggleColumn(e),
|
|
764
|
+
collapseSwimlane: (e) => K()?.collapseSwimlane(e),
|
|
765
|
+
expandSwimlane: (e) => K()?.expandSwimlane(e),
|
|
766
|
+
toggleSwimlane: (e) => K()?.toggleSwimlane(e),
|
|
767
|
+
scrollToColumn: (e, l) => Cl(e, l),
|
|
768
|
+
scrollToCard: (e, l) => Sl(e, l),
|
|
769
|
+
undo: He,
|
|
770
|
+
redo: Le,
|
|
771
|
+
canUndo: () => ul.value,
|
|
772
|
+
canRedo: () => il.value,
|
|
773
|
+
clearHistory: () => J()?.clearHistory(),
|
|
774
|
+
exportToJSON: () => Ml(x.value, m.value ?? [], a.swimlanes ?? []),
|
|
775
|
+
exportToCSV: (e) => Dl(m.value ?? [], e),
|
|
776
|
+
downloadJSON: () => wl(Ml(x.value, m.value ?? [], a.swimlanes ?? []), "taskboard-export.json", "application/json"),
|
|
777
|
+
downloadCSV: (e) => wl(Dl(m.value ?? [], e), "taskboard-export.csv", "text/csv"),
|
|
778
|
+
print: $t,
|
|
779
|
+
serializeState: Vt,
|
|
780
|
+
restoreState: Ot,
|
|
781
|
+
licenseValid: () => We.value,
|
|
782
|
+
licenseMessage: () => Ne.value,
|
|
783
|
+
getAuditLog: () => cl()?.getLog() ?? [],
|
|
784
|
+
clearAuditLog: () => {
|
|
785
|
+
cl()?.clear();
|
|
786
|
+
}
|
|
787
|
+
}), (e, l) => (de(), he("div", {
|
|
788
|
+
ref_key: "rootRef",
|
|
789
|
+
ref: w,
|
|
790
|
+
class: Ve(At.value),
|
|
791
|
+
dir: a.rtl ? "rtl" : void 0,
|
|
792
|
+
role: "group",
|
|
793
|
+
"aria-label": "Task board",
|
|
794
|
+
tabindex: "0",
|
|
795
|
+
onPointerdownCapture: l[0] || (l[0] = //@ts-ignore
|
|
796
|
+
(...t) => P(Ie) && P(Ie)(...t)),
|
|
797
|
+
onFocusinCapture: l[1] || (l[1] = //@ts-ignore
|
|
798
|
+
(...t) => P(Ie) && P(Ie)(...t))
|
|
799
|
+
}, [
|
|
800
|
+
U.value && !U.value.valid ? (de(), he("div", Pa, [
|
|
801
|
+
l[2] || (l[2] = ye("span", { style: { "font-weight": "600" } }, "PrimeUI TaskBoard", -1)),
|
|
802
|
+
ye("span", null, Oe(U.value.message), 1)
|
|
803
|
+
])) : Ue("", !0),
|
|
804
|
+
kl(e.$slots, "default"),
|
|
805
|
+
(de(), jt(qt, { to: "body" }, [
|
|
806
|
+
E.value && N.value && _.value && _e.value === 0 ? (de(), he("div", {
|
|
807
|
+
key: 0,
|
|
808
|
+
class: Ve(P(S).dragPreview),
|
|
809
|
+
style: Xt({
|
|
810
|
+
position: "fixed",
|
|
811
|
+
left: N.value.x + "px",
|
|
812
|
+
top: N.value.y + "px",
|
|
813
|
+
width: z.value ? z.value + "px" : void 0,
|
|
814
|
+
maxWidth: z.value ? z.value + "px" : void 0,
|
|
815
|
+
transform: "translate(-50%, -50%) rotate(var(--p-taskboard-drag-preview-rotation, 1.5deg))",
|
|
816
|
+
pointerEvents: "none",
|
|
817
|
+
zIndex: 9999
|
|
818
|
+
})
|
|
819
|
+
}, [
|
|
820
|
+
P(Q)().length > 1 ? (de(), he("span", {
|
|
821
|
+
key: 0,
|
|
822
|
+
class: Ve(P(S).dragPreviewBadge)
|
|
823
|
+
}, Oe(P(Q)().length), 3)) : Ue("", !0),
|
|
824
|
+
kl(e.$slots, "drag-preview", {
|
|
825
|
+
item: _.value,
|
|
826
|
+
count: P(Q)().length
|
|
827
|
+
}, () => [
|
|
828
|
+
ye("div", {
|
|
829
|
+
ref_key: "dragCloneHost",
|
|
830
|
+
ref: je
|
|
831
|
+
}, null, 512)
|
|
832
|
+
])
|
|
833
|
+
], 6)) : Ue("", !0)
|
|
834
|
+
])),
|
|
835
|
+
ye("div", $a, Oe(ke.value), 1)
|
|
836
|
+
], 42, Ka));
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
export {
|
|
840
|
+
Ya as _
|
|
841
|
+
};
|