@primeui/vue-taskboard 0.0.1-alpha.1 → 1.0.0-beta.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 (126) hide show
  1. package/dist/TaskBoard.context.d.ts +21 -21
  2. package/dist/TaskBoard.parts.d.ts +20 -20
  3. package/dist/TaskBoard.vue.d.ts +37 -37
  4. package/dist/TaskBoardContent.vue.d.ts +2 -2
  5. package/dist/chunks/TaskBoard.context-BCq7uauT.mjs +29 -0
  6. package/dist/chunks/TaskBoard.vue_vue_type_script_setup_true_lang-Djmr6yoF.mjs +841 -0
  7. package/dist/chunks/TaskBoardCard.vue_vue_type_script_setup_true_lang-B1Ix7Gjf.mjs +34 -0
  8. package/dist/chunks/TaskBoardCardAdd.vue_vue_type_script_setup_true_lang-Dy4BuCa9.mjs +14 -0
  9. package/dist/chunks/TaskBoardCardContent.vue_vue_type_script_setup_true_lang-DNEmpvcn.mjs +19 -0
  10. package/dist/chunks/TaskBoardCardFooter.vue_vue_type_script_setup_true_lang-8FWnuxSl.mjs +19 -0
  11. package/dist/chunks/TaskBoardCardHeader.vue_vue_type_script_setup_true_lang-Dr-XJfaE.mjs +19 -0
  12. package/dist/chunks/TaskBoardColumn.vue_vue_type_script_setup_true_lang-D_AJ5j7c.mjs +42 -0
  13. package/dist/chunks/TaskBoardColumnAdd-C_JSN3pp.mjs +10 -0
  14. package/dist/chunks/TaskBoardColumnContent.vue_vue_type_script_setup_true_lang-DNRiWBN_.mjs +180 -0
  15. package/dist/chunks/TaskBoardColumnEmpty.vue_vue_type_script_setup_true_lang-D23AtNeX.mjs +18 -0
  16. package/dist/chunks/TaskBoardColumnFooter.vue_vue_type_script_setup_true_lang-BpKRnC6u.mjs +19 -0
  17. package/dist/chunks/TaskBoardColumnHeader.vue_vue_type_script_setup_true_lang-DMc9zcWV.mjs +51 -0
  18. package/dist/chunks/TaskBoardContent.vue_vue_type_script_setup_true_lang-lDUg6UrJ.mjs +292 -0
  19. package/dist/chunks/TaskBoardDragConfirm.vue_vue_type_script_setup_true_lang-B4OdxK5L.mjs +20 -0
  20. package/dist/chunks/TaskBoardDragPreview.vue_vue_type_script_setup_true_lang-B7F-FPY1.mjs +40 -0
  21. package/dist/chunks/TaskBoardDropIndicator-BUMSBiQC.mjs +14 -0
  22. package/dist/chunks/TaskBoardHeader.vue_vue_type_script_setup_true_lang-CwtaadkE.mjs +21 -0
  23. package/dist/chunks/TaskBoardLoading-CrgtYPP-.mjs +10 -0
  24. package/dist/chunks/TaskBoardSwimlaneColumnHeader.vue_vue_type_script_setup_true_lang-BVpen7mj.mjs +23 -0
  25. package/dist/chunks/TaskBoardSwimlaneHeader.vue_vue_type_script_setup_true_lang-D6NdS4hP.mjs +32 -0
  26. package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  27. package/dist/chunks/useHistory-C-Ud-WgS.mjs +510 -0
  28. package/dist/chunks/useTaskBoardDrag-BvBISSNb.mjs +58 -0
  29. package/dist/components/card/TaskBoardCard.vue.d.ts +3 -3
  30. package/dist/components/card/TaskBoardCardContent.vue.d.ts +1 -1
  31. package/dist/components/card/TaskBoardCardFooter.vue.d.ts +1 -1
  32. package/dist/components/card/TaskBoardCardHeader.vue.d.ts +1 -1
  33. package/dist/components/column/TaskBoardColumn.vue.d.ts +2 -2
  34. package/dist/components/column/TaskBoardColumnContent.vue.d.ts +1 -1
  35. package/dist/components/column/TaskBoardColumnFooter.vue.d.ts +1 -1
  36. package/dist/components/column/TaskBoardColumnHeader.vue.d.ts +1 -1
  37. package/dist/components/overlay/TaskBoardDragConfirm.vue.d.ts +2 -2
  38. package/dist/components/swimlane/TaskBoardSwimlaneColumnHeader.vue.d.ts +3 -3
  39. package/dist/components.d.ts +20 -0
  40. package/dist/components.mjs +42 -0
  41. package/dist/composables/index.mjs +6 -5
  42. package/dist/composables/useCardDrag.d.ts +2 -2
  43. package/dist/composables/useColumnDrag.d.ts +5 -5
  44. package/dist/composables/useControllerInit.d.ts +3 -3
  45. package/dist/composables/useKeyboardHandling.d.ts +2 -2
  46. package/dist/index.d.ts +20 -20
  47. package/dist/index.mjs +77 -1650
  48. package/dist/parts/card/index.d.ts +1 -0
  49. package/dist/parts/card/index.mjs +4 -0
  50. package/dist/parts/cardadd/index.d.ts +1 -0
  51. package/dist/parts/cardadd/index.mjs +4 -0
  52. package/dist/parts/cardcontent/index.d.ts +1 -0
  53. package/dist/parts/cardcontent/index.mjs +4 -0
  54. package/dist/parts/cardfooter/index.d.ts +1 -0
  55. package/dist/parts/cardfooter/index.mjs +4 -0
  56. package/dist/parts/cardheader/index.d.ts +1 -0
  57. package/dist/parts/cardheader/index.mjs +4 -0
  58. package/dist/parts/column/index.d.ts +1 -0
  59. package/dist/parts/column/index.mjs +4 -0
  60. package/dist/parts/columnadd/index.d.ts +1 -0
  61. package/dist/parts/columnadd/index.mjs +4 -0
  62. package/dist/parts/columncontent/index.d.ts +1 -0
  63. package/dist/parts/columncontent/index.mjs +4 -0
  64. package/dist/parts/columnempty/index.d.ts +1 -0
  65. package/dist/parts/columnempty/index.mjs +4 -0
  66. package/dist/parts/columnfooter/index.d.ts +1 -0
  67. package/dist/parts/columnfooter/index.mjs +4 -0
  68. package/dist/parts/columnheader/index.d.ts +1 -0
  69. package/dist/parts/columnheader/index.mjs +4 -0
  70. package/dist/parts/content/index.d.ts +1 -0
  71. package/dist/parts/content/index.mjs +4 -0
  72. package/dist/parts/dragconfirm/index.d.ts +1 -0
  73. package/dist/parts/dragconfirm/index.mjs +4 -0
  74. package/dist/parts/dragpreview/index.d.ts +1 -0
  75. package/dist/parts/dragpreview/index.mjs +4 -0
  76. package/dist/parts/dropindicator/index.d.ts +1 -0
  77. package/dist/parts/dropindicator/index.mjs +4 -0
  78. package/dist/parts/header/index.d.ts +1 -0
  79. package/dist/parts/header/index.mjs +4 -0
  80. package/dist/parts/loading/index.d.ts +1 -0
  81. package/dist/parts/loading/index.mjs +4 -0
  82. package/dist/parts/root/index.d.ts +1 -0
  83. package/dist/parts/root/index.mjs +4 -0
  84. package/dist/parts/swimlanecolumnheader/index.d.ts +1 -0
  85. package/dist/parts/swimlanecolumnheader/index.mjs +4 -0
  86. package/dist/parts/swimlaneheader/index.d.ts +1 -0
  87. package/dist/parts/swimlaneheader/index.mjs +4 -0
  88. package/package.json +22 -12
  89. package/dist/TaskBoard.context.d.mts +0 -235
  90. package/dist/TaskBoard.parts.d.mts +0 -20
  91. package/dist/TaskBoard.vue.d.mts +0 -291
  92. package/dist/TaskBoardContent.vue.d.mts +0 -27
  93. package/dist/TaskBoardHeader.vue.d.mts +0 -18
  94. package/dist/TaskBoardLoading.vue.d.mts +0 -13
  95. package/dist/chunks/useTaskBoardDrag-ByZvmcfw.mjs +0 -590
  96. package/dist/components/card/TaskBoardCard.vue.d.mts +0 -23
  97. package/dist/components/card/TaskBoardCardAdd.vue.d.mts +0 -15
  98. package/dist/components/card/TaskBoardCardContent.vue.d.mts +0 -18
  99. package/dist/components/card/TaskBoardCardFooter.vue.d.mts +0 -18
  100. package/dist/components/card/TaskBoardCardHeader.vue.d.mts +0 -18
  101. package/dist/components/column/TaskBoardColumn.vue.d.mts +0 -19
  102. package/dist/components/column/TaskBoardColumnAdd.vue.d.mts +0 -13
  103. package/dist/components/column/TaskBoardColumnContent.vue.d.mts +0 -20
  104. package/dist/components/column/TaskBoardColumnEmpty.vue.d.mts +0 -13
  105. package/dist/components/column/TaskBoardColumnFooter.vue.d.mts +0 -16
  106. package/dist/components/column/TaskBoardColumnHeader.vue.d.mts +0 -19
  107. package/dist/components/overlay/TaskBoardDragConfirm.vue.d.mts +0 -20
  108. package/dist/components/overlay/TaskBoardDragPreview.vue.d.mts +0 -16
  109. package/dist/components/overlay/TaskBoardDropIndicator.d.mts +0 -2
  110. package/dist/components/swimlane/TaskBoardSwimlaneColumnHeader.vue.d.mts +0 -20
  111. package/dist/components/swimlane/TaskBoardSwimlaneHeader.vue.d.mts +0 -22
  112. package/dist/composables/index.d.mts +0 -9
  113. package/dist/composables/useCardDrag.d.mts +0 -47
  114. package/dist/composables/useCardDragGeometry.d.mts +0 -21
  115. package/dist/composables/useColumnDrag.d.mts +0 -24
  116. package/dist/composables/useControllerInit.d.mts +0 -64
  117. package/dist/composables/useHistory.d.mts +0 -15
  118. package/dist/composables/useKeyboardHandling.d.mts +0 -37
  119. package/dist/composables/useTaskBoardAccess.d.mts +0 -9
  120. package/dist/composables/useTaskBoardDrag.d.mts +0 -14
  121. package/dist/composables/useTaskBoardHistory.d.mts +0 -6
  122. package/dist/composables/useTaskBoardPrintRuntime.d.mts +0 -7
  123. package/dist/composables/useTaskBoardSelection.d.mts +0 -11
  124. package/dist/composables/useTaskBoardWorkflow.d.mts +0 -8
  125. package/dist/index.d.mts +0 -29
  126. package/dist/release-date.d.mts +0 -11
@@ -1,590 +0,0 @@
1
- import { nextTick as N, ref as Z, inject as L } from "vue";
2
- import { classes as te, resolveColumnStyle as le, createColumnDragController as re, createTaskBoard as ne, createDragController as ae, createSelectionController as oe, createWorkflowController as se, createHistoryController as de, createAuditController as ue, createKeyboardController as ce, applyHistoryRedo as ie, applyHistoryUndo as me } from "@primeui/taskboard-core";
3
- const Ce = () => ({
4
- columns: [],
5
- containerRect: null,
6
- scrollBodies: []
7
- }), ee = (e) => {
8
- const i = e.getAttribute("data-task-index");
9
- if (i == null || i === "") return;
10
- const k = Number(i);
11
- return Number.isFinite(k) ? k : void 0;
12
- };
13
- function ge(e) {
14
- let i = null, k = !0;
15
- const m = (I) => {
16
- if (e.hasSwimlanes()) {
17
- const C = I.querySelectorAll("[data-column-id][data-swimlane-id]");
18
- return Array.from(C).map((c) => ({
19
- columnId: c.getAttribute("data-column-id"),
20
- swimlaneId: c.getAttribute("data-swimlane-id"),
21
- rect: c.getBoundingClientRect(),
22
- cardRects: Array.from(c.querySelectorAll("[data-task-id]")).map((v) => ({
23
- taskId: v.getAttribute("data-task-id"),
24
- index: ee(v),
25
- rect: v.getBoundingClientRect()
26
- }))
27
- }));
28
- }
29
- const S = I.querySelectorAll("[data-column-id]");
30
- return Array.from(S).map((C) => ({
31
- columnId: C.getAttribute("data-column-id"),
32
- rect: C.getBoundingClientRect(),
33
- cardRects: Array.from(C.querySelectorAll("[data-task-id]")).map((c) => ({
34
- taskId: c.getAttribute("data-task-id"),
35
- index: ee(c),
36
- rect: c.getBoundingClientRect()
37
- }))
38
- }));
39
- }, A = () => {
40
- const I = e.getContainer();
41
- return I ? {
42
- columns: m(I),
43
- containerRect: I.getBoundingClientRect(),
44
- scrollBodies: Array.from(I.querySelectorAll(`.${te.columnBody}`)).map((S) => ({
45
- element: S,
46
- rect: S.getBoundingClientRect()
47
- }))
48
- } : Ce();
49
- }, g = () => (i = A(), k = !1, i);
50
- return {
51
- getSnapshot: () => !i || k ? g() : i,
52
- refresh: g,
53
- markDirty: () => {
54
- k = !0;
55
- },
56
- clear: () => {
57
- i = null, k = !0;
58
- }
59
- };
60
- }
61
- function De(e) {
62
- let g = null, T = null, I = null, S = null, C = null;
63
- const c = ge({
64
- getContainer: () => e.columnsContainerRef.value,
65
- hasSwimlanes: () => e.hasSwimlanes.value
66
- }), v = () => e.draggedCardId.value ?? e.getDragController()?.state.draggedCardId ?? null, f = (r) => {
67
- const d = e.getDragController(), a = e.isDragging.value || !!d?.state.isDragging || r && !!d?.state.isPending, D = v();
68
- return !a || D == null ? [] : e.selectedCardIds.value.length > 1 && e.selectedCardIds.value.some((b) => String(b) === String(D)) ? e.selectedCardIds.value : [D];
69
- }, x = () => {
70
- if (!I) return;
71
- const { element: r, pointerId: d } = I;
72
- if (I = null, !!r.hasPointerCapture?.(d))
73
- try {
74
- r.releasePointerCapture(d);
75
- } catch {
76
- }
77
- }, P = () => f(!1), E = () => {
78
- const r = f(!0), d = new Set(r.length > 1 ? r.map((a) => String(a)) : []);
79
- return d.size ? c.getSnapshot().columns.map((a) => ({
80
- ...a,
81
- cardRects: a.cardRects.filter((D) => !d.has(String(D.taskId)))
82
- })) : c.getSnapshot().columns;
83
- }, M = () => {
84
- c.markDirty();
85
- }, W = () => c.refresh().columns, R = () => {
86
- c.clear();
87
- }, t = (r) => {
88
- const d = r.currentTarget instanceof HTMLElement ? r.currentTarget : null;
89
- return d?.hasAttribute("data-task-id") ? d : r.target instanceof HTMLElement ? r.target.closest("[data-task-id]") : null;
90
- }, n = (r) => {
91
- const a = t(r)?.getBoundingClientRect().width ?? 0;
92
- e.dragPreviewWidth.value = Number.isFinite(a) && a > 0 ? a : null;
93
- }, l = (r, d) => Math.min(d, Math.max(0, r)), s = (r, d, a) => Math.ceil(Math.min(1, Math.max(0, (d - r) / d)) * a), p = (r, d) => {
94
- const a = e.getDragController(), D = a?.state.isPending || a?.state.isDragging ? E() : [], b = e.isDragging.value;
95
- a?.onPointerMove({ x: r, y: d }, D), a && (a.state.isDragging && !b && (g = null, T = null, M(), N(() => M())), e.isDragging.value = a.state.isDragging, e.draggedCardId.value = a.state.draggedCardId, e.dragTargetColumnId.value = a.state.targetColumnId, e.dragTargetIndex.value = a.state.targetIndex, e.dragTargetSwimlaneId.value = a.state.targetSwimlaneId, e.ghostPosition.value = a.state.ghostPosition, a.state.isDragging && a.state.draggedCardId && (e.draggedCardData.value = (e.tasks.value ?? []).find((B) => e.getItemId(B) === a.state.draggedCardId) ?? null));
96
- }, w = (r, d) => {
97
- if (!e.columnsContainerRef.value) return !1;
98
- const a = e.columnsContainerRef.value, D = c.getSnapshot(), b = D.containerRect;
99
- if (!b) return !1;
100
- let B = !1, q = 0;
101
- const Y = r - b.left, _ = b.right - r;
102
- Y < 96 ? q = -s(Y, 96, 44) : _ < 96 && (q = s(_, 96, 44));
103
- for (const { element: K, rect: O } of D.scrollBodies)
104
- if (r >= O.left && r <= O.right) {
105
- const F = Math.max(0, K.scrollHeight - K.clientHeight), U = l(K.scrollTop, F);
106
- let $ = U;
107
- const J = d - O.top, Q = O.bottom - d;
108
- J < 56 ? $ = l(U - s(J, 56, 14), F) : Q < 56 && ($ = l(U + s(Q, 56, 14), F)), $ !== U && (K.scrollTop = $, M(), B = !0);
109
- }
110
- if (q !== 0) {
111
- const K = Math.max(0, a.scrollWidth - a.clientWidth), O = l(a.scrollLeft, K), F = l(O + q, K);
112
- F !== O && (a.scrollLeft = F, M(), B = !0);
113
- }
114
- return B;
115
- }, H = () => {
116
- C != null && (cancelAnimationFrame(C), C = null);
117
- }, G = () => {
118
- C = null, !(!e.getDragController()?.state.isDragging || !S || !w(S.x, S.y)) && (p(S.x, S.y), C = requestAnimationFrame(G));
119
- }, j = (r, d) => {
120
- if (S = { x: r, y: d }, !w(r, d)) {
121
- H();
122
- return;
123
- }
124
- C == null && (C = requestAnimationFrame(G));
125
- }, X = (r, d) => (S = { x: r, y: d }, w(r, d)), o = (r) => {
126
- const d = e.getDragController();
127
- p(r.clientX, r.clientY), d?.state.isDragging ? j(r.clientX, r.clientY) : H();
128
- }, u = () => {
129
- const r = e.getDragController(), d = e.getSelectionController(), a = e.isDragging.value;
130
- if (r?.onPointerUp(), x(), H(), e.isDragging.value = !1, e.draggedCardId.value = null, e.dragTargetColumnId.value = null, e.dragTargetIndex.value = null, e.dragTargetSwimlaneId.value = null, e.ghostPosition.value = null, e.dragPreviewWidth.value = null, e.draggedCardData.value = null, S = null, R(), !a && g && T) {
131
- const { task: D, column: b } = g, B = T;
132
- e.emit("cardClick", { card: D, column: b, jsEvent: new MouseEvent("click") }), e.focusCard(e.getItemId(D)), e.getSelectionMode() !== "none" && e.isFeatureEnabled("cardSelection") && (e.selectionOrigin.value = "pointer", d?.selectCard(e.getItemId(D), {
133
- ctrlKey: B.ctrlKey,
134
- shiftKey: B.shiftKey,
135
- metaKey: B.metaKey
136
- }));
137
- }
138
- g = null, T = null, document.removeEventListener("pointermove", o), document.removeEventListener("pointerup", u);
139
- };
140
- return {
141
- getDragHiddenIds: P,
142
- getColumnElements: E,
143
- markDragGeometryDirty: M,
144
- refreshDragGeometry: W,
145
- clearDragGeometry: R,
146
- autoScroll: X,
147
- onCardPointerDown: (r, d, a) => {
148
- const D = e.getDragController(), b = a.target;
149
- if (x(), b?.setPointerCapture)
150
- try {
151
- b.setPointerCapture(a.pointerId), I = { element: b, pointerId: a.pointerId };
152
- } catch {
153
- I = null;
154
- }
155
- g = { task: r, column: d }, T = { ctrlKey: a.ctrlKey, shiftKey: a.shiftKey, metaKey: a.metaKey }, e.canDrag.value && r.draggable !== !1 && !e.getDisabled() && !e.getReadonly() && e.canMoveOutOfColumn(e.getItemColumnValue(r)) && (R(), n(a), D?.onPointerDown(e.getItemId(r), d.id, { x: a.clientX, y: a.clientY }, a, e.getItemSwimlaneValue(r))), document.addEventListener("pointermove", o), document.addEventListener("pointerup", u);
156
- },
157
- onDocumentPointerMove: o,
158
- onDocumentPointerUp: u,
159
- cleanupCardDrag: () => {
160
- x(), H(), R(), e.dragPreviewWidth.value = null, S = null, document.removeEventListener("pointermove", o), document.removeEventListener("pointerup", u);
161
- }
162
- };
163
- }
164
- const Ie = ["button", "a", "input", "select", "textarea", "summary", '[role="button"]', '[role="link"]', '[contenteditable="true"]', "[data-taskboard-column-header-interactive]"].join(",");
165
- function we(e) {
166
- let m = !1, A = null, g = [], T = 0, I = null, S = 0, C = null;
167
- const c = () => {
168
- const o = e.processedColumns.value;
169
- if (g.length === 0) return o;
170
- const u = new Map(o.map((r) => [String(r.id), r])), h = g.map((r) => u.get(String(r.id))).filter((r) => !!r);
171
- if (h.length === o.length) return h;
172
- const y = new Set(h.map((r) => String(r.id)));
173
- return [...h, ...o.filter((r) => !y.has(String(r.id)))];
174
- }, v = () => (A || (A = re({
175
- getColumns: c,
176
- emit: (o, u) => e.emit(o, u),
177
- isDisabled: e.getDisabled
178
- })), A), f = () => {
179
- if (!e.columnsContainerRef.value) return [];
180
- const o = e.columnsContainerRef.value.querySelectorAll("[data-column-id]"), u = [];
181
- return o.forEach((h) => {
182
- const y = h.getBoundingClientRect();
183
- u.push({ id: h.getAttribute("data-column-id"), left: y.left, width: y.width });
184
- }), u;
185
- }, x = () => {
186
- const o = v();
187
- e.isColumnDragging.value = o.state.isDragging, e.draggedColumnId.value = o.state.draggedColumnId, e.columnDragStartX.value = o.state.startX, e.columnDragOffsets.value = o.state.offsets;
188
- }, P = () => {
189
- const o = e.columnsContainerRef.value;
190
- return Math.max(0, (o?.scrollWidth ?? 0) - (o?.clientWidth ?? 0));
191
- }, E = () => {
192
- const o = P();
193
- return I == null ? o : Math.min(I, o);
194
- }, M = (o) => Math.min(E(), Math.max(0, o)), W = () => M(e.columnsContainerRef.value?.scrollLeft ?? 0) - T, R = (o) => {
195
- const u = v();
196
- u.state.isDragging && (u.onDragMove(o + W(), g), x());
197
- }, t = (o) => {
198
- const u = e.columnsContainerRef.value;
199
- if (!u) return 0;
200
- const h = u.getBoundingClientRect(), y = o - h.left, r = h.right - o, d = (a) => Math.ceil(Math.min(1, Math.max(0, (56 - a) / 56)) * 14);
201
- return y < 56 && u.scrollLeft > 0 ? -d(y) : r < 56 && u.scrollLeft < E() ? d(r) : 0;
202
- }, n = () => {
203
- C != null && (cancelAnimationFrame(C), C = null);
204
- }, l = () => {
205
- C = null;
206
- const o = e.columnsContainerRef.value, u = v();
207
- if (!o || !u.state.isDragging) return;
208
- const h = t(S);
209
- if (h === 0) return;
210
- const y = M(o.scrollLeft), r = M(y + h);
211
- o.scrollLeft = r, M(o.scrollLeft) !== y && (R(S), C = requestAnimationFrame(l));
212
- }, s = (o) => {
213
- if (S = o, t(o) === 0) {
214
- n();
215
- return;
216
- }
217
- C == null && (C = requestAnimationFrame(l));
218
- }, p = (o) => {
219
- v().state.isDragging && (R(o.clientX), s(o.clientX));
220
- }, w = () => {
221
- const o = v();
222
- o.state.isDragging && (n(), R(S), o.onDragEnd(g), x(), g = [], T = 0, I = null, m = !0, requestAnimationFrame(() => {
223
- m = !1;
224
- }), document.removeEventListener("pointermove", p), document.removeEventListener("pointerup", w));
225
- };
226
- return {
227
- onColumnHeaderPointerDown: (o, u) => {
228
- if (u.defaultPrevented || u.button !== 0) return;
229
- const h = u.currentTarget, y = u.target;
230
- if (h instanceof Element && y instanceof Element) {
231
- const a = y.closest(Ie);
232
- if (a && a !== h && h.contains(a)) return;
233
- }
234
- if (!e.canReorderColumns.value || e.getDisabled() || o.locked) return;
235
- u.preventDefault(), u.stopPropagation(), u.target.setPointerCapture?.(u.pointerId);
236
- const r = e.columnsContainerRef.value;
237
- g = f(), I = P(), T = M(r?.scrollLeft ?? 0), S = u.clientX, v().onDragStart(o.id, u.clientX), x(), document.addEventListener("pointermove", p), document.addEventListener("pointerup", w);
238
- },
239
- onColumnHeaderClick: () => {
240
- if (m) {
241
- m = !1;
242
- return;
243
- }
244
- },
245
- onColumnDragMove: p,
246
- onColumnDragEnd: w,
247
- getColumnStyle: (o) => le(o, {
248
- offsets: e.columnDragOffsets.value,
249
- draggedColumnId: e.draggedColumnId.value
250
- }),
251
- cleanupColumnDrag: () => {
252
- n(), document.removeEventListener("pointermove", p), document.removeEventListener("pointerup", w);
253
- }
254
- };
255
- }
256
- function Te(e) {
257
- let i = null, k = null, m = null, A = null, g = null, T = null, I = null;
258
- const S = Z(!1), C = Z(!1), c = (t) => (e.tasks.value ?? []).find((n) => String(e.getItemId(n)) === String(t)), v = (t) => e.allColumns.value.find((n) => String(n.id) === String(t)), f = (t, n, l, s, p) => {
259
- e.emit("cardDropBlocked", {
260
- task: t,
261
- targetColumn: n,
262
- reason: l,
263
- message: s,
264
- failedFields: p
265
- }), e.announce(s);
266
- }, x = (t, n) => {
267
- const l = n?.selectedCardIds ?? e.selectedCardIds.value;
268
- return l.length > 1 && l.some((s) => String(s) === String(t)) ? l.length : 1;
269
- }, P = (t) => {
270
- const n = c(e.getItemId(t.card)), l = v(t.newColumnId);
271
- if (!(!n || !l)) {
272
- if (!e.canMoveOutOfColumn(t.oldColumnId)) {
273
- const s = v(t.oldColumnId);
274
- f(n, l, "move-out-blocked", `Cards cannot move out of "${s?.label ?? t.oldColumnId}"`);
275
- return;
276
- }
277
- if (String(t.oldColumnId) !== String(t.newColumnId) && !e.canMoveIntoColumn(t.newColumnId)) {
278
- f(n, l, "move-in-blocked", `Cards cannot move into "${l.label}"`);
279
- return;
280
- }
281
- if (A && String(t.oldColumnId) !== String(t.newColumnId)) {
282
- const s = A.canMoveCard(n, t.oldColumnId, t.newColumnId, x(e.getItemId(n), t));
283
- if (!s.allowed) {
284
- if (s.reason === "confirmation-required") {
285
- e.pendingConfirmMove.value = { payload: t, task: n, message: s.message ?? "" };
286
- return;
287
- }
288
- f(n, l, s.reason, s.message, s.failedFields);
289
- return;
290
- }
291
- }
292
- e.applyCardMoveHandler(t);
293
- }
294
- }, E = (t) => {
295
- const n = c(t.cardId), l = t.targetColumnId != null ? v(t.targetColumnId) : v(t.columnId);
296
- if (!n || !l) return;
297
- const s = t.reason === "move-out-blocked" ? `Cards cannot move out of "${v(t.columnId)?.label ?? t.columnId}"` : "Keyboard move is disabled for this board";
298
- f(n, l, t.reason, s);
299
- };
300
- return {
301
- initializeCore: () => {
302
- i || (i = ne({
303
- refs: {
304
- root: e.rootRef.value,
305
- columnsContainer: e.columnsContainerRef.value
306
- },
307
- props: e.getCoreProps(),
308
- state: {
309
- selectedCardIds: e.selectedCardIds.value,
310
- lastSelectedCardId: null,
311
- dragState: {
312
- isDragging: !1,
313
- draggedCardId: null,
314
- sourceColumnId: null,
315
- targetColumnId: null,
316
- targetIndex: null
317
- },
318
- focusedCardId: null,
319
- collapsedColumnIds: e.collapsedColumnIds.value,
320
- collapsedSwimlaneIds: e.collapsedSwimlaneIds.value,
321
- columnOrder: []
322
- },
323
- emits: {
324
- cardMove: (t) => {
325
- e.applyCardMoveHandler(t);
326
- },
327
- cardClick: (t) => {
328
- e.emit("cardClick", t);
329
- },
330
- cardDblclick: (t) => {
331
- e.emit("cardDblclick", t);
332
- },
333
- cardSelect: (t) => {
334
- e.emit("cardSelect", t);
335
- },
336
- selectionChange: (t) => {
337
- e.selectedCardIds.value = t.selectedIds, i?.$setState({ selectedCardIds: t.selectedIds }), e.emit("selectionChange", t);
338
- },
339
- cardCreate: (t) => {
340
- e.emit("cardCreate", t);
341
- },
342
- cardUpdate: (t) => {
343
- e.emit("cardUpdate", t);
344
- },
345
- cardDelete: (t) => {
346
- e.emit("cardDelete", t);
347
- },
348
- columnCollapse: (t) => {
349
- t.collapsed ? e.collapsedColumnIds.value = [...e.collapsedColumnIds.value, t.column.id] : e.collapsedColumnIds.value = e.collapsedColumnIds.value.filter((n) => n !== t.column.id), i?.$setState({ collapsedColumnIds: e.collapsedColumnIds.value }), e.emit("columnCollapse", t);
350
- },
351
- columnReorder: (t) => {
352
- e.emit("columnReorder", t);
353
- },
354
- swimlaneCollapse: (t) => {
355
- t.collapsed ? e.collapsedSwimlaneIds.value = [...e.collapsedSwimlaneIds.value, t.swimlane.id] : e.collapsedSwimlaneIds.value = e.collapsedSwimlaneIds.value.filter((n) => n !== t.swimlane.id), i?.$setState({ collapsedSwimlaneIds: e.collapsedSwimlaneIds.value }), e.emit("swimlaneCollapse", t);
356
- },
357
- dragStart: (t) => {
358
- e.emit("dragStart", t);
359
- },
360
- dragEnd: (t) => {
361
- e.emit("dragEnd", t);
362
- },
363
- cardContextMenu: (t) => {
364
- e.emit("cardContextMenu", t);
365
- },
366
- scrollToColumn: (t) => {
367
- e.scrollToColumnImpl(t.id);
368
- },
369
- scrollToCard: (t) => {
370
- e.scrollToCardImpl(t.id);
371
- }
372
- }
373
- }), k = ae({
374
- getColumns: () => e.allColumns.value,
375
- getTasksByColumn: (t) => e.getColumnTasks(t),
376
- getTaskById: c,
377
- getTaskId: (t) => e.getItemId(t),
378
- getTaskSwimlaneValue: (t) => e.getItemSwimlaneValue(t),
379
- getColumnById: (t) => e.allColumns.value.find((n) => n.id === t),
380
- emit: (t, n) => {
381
- if (t === "card-move")
382
- P(n);
383
- else if (t === "drag-start") {
384
- const l = n;
385
- e.emit("dragStart", l);
386
- } else if (t === "drag-end") {
387
- const l = n;
388
- e.emit("dragEnd", l);
389
- } else if (t === "drag-cancel") {
390
- const l = n, s = (e.tasks.value ?? []).find((w) => e.getItemId(w) === l.draggedCardId), p = e.allColumns.value.find((w) => w.id === l.sourceColumnId);
391
- s && p && e.emit("dragCancel", { card: s, column: p });
392
- }
393
- },
394
- isDisabled: () => e.getDisabled(),
395
- isReadonly: () => e.getReadonly(),
396
- dragMinDistance: e.dragMinDistance
397
- }), m = oe({
398
- getTaskById: c,
399
- getTasksByColumn: (t) => e.getColumnTasks(t),
400
- getTaskId: (t) => e.getItemId(t),
401
- getTaskColumnValue: (t) => e.getItemColumnValue(t),
402
- getTaskSwimlaneValue: (t) => e.getItemSwimlaneValue(t),
403
- emit: (t, n) => {
404
- if (t === "card-select") {
405
- const l = n;
406
- e.emit("cardSelect", l);
407
- } else if (t === "selection-change") {
408
- const l = n;
409
- e.selectedCardIds.value = l.selectedIds, i?.$setState({ selectedCardIds: l.selectedIds }), l.selectedIds.length === 0 && (e.selectionOrigin.value = null), e.emit("selectionChange", l), e.announce(`${l.selectedIds.length} task${l.selectedIds.length === 1 ? "" : "s"} selected`);
410
- }
411
- },
412
- getSelectionMode: () => e.getSelectionMode()
413
- }), A = se({
414
- getColumnById: (t) => e.allColumns.value.find((n) => String(n.id) === String(t)),
415
- getTasksByColumn: (t) => e.getColumnTasks(t)
416
- }), T = de({
417
- maxSize: 50,
418
- onHistoryChange: (t) => {
419
- S.value = t.canUndo, C.value = t.canRedo;
420
- }
421
- }), I = ue({ maxEntries: 200 }), g = ce({
422
- getColumns: () => e.visibleColumns.value,
423
- getTasksByColumn: (t) => e.getColumnTasks(t),
424
- getTasksByCell: (t, n) => e.getVisibleCellTasks(t, n),
425
- getSwimlanes: () => e.processedSwimlanes.value,
426
- getTaskById: c,
427
- getSelectedCardIds: () => e.selectedCardIds.value,
428
- getTaskId: (t) => e.getItemId(t),
429
- getTaskColumnValue: (t) => e.getItemColumnValue(t),
430
- getTaskSwimlaneValue: (t) => e.getItemSwimlaneValue(t),
431
- canMoveCards: () => e.canKeyboardMove(),
432
- canMoveOutOfColumn: (t) => e.canMoveOutOfColumn(t),
433
- emit: (t, n) => {
434
- if (t === "focus-change") {
435
- const l = n;
436
- if (e.focusedCardId.value = l.cardId, e.focusedColumnId.value = l.columnId ?? null, e.focusedSwimlaneId.value = l.swimlaneId ?? null, l.cardId) {
437
- const s = c(l.cardId);
438
- s && e.announce(`Focused ${String(s.title ?? e.getItemId(s))}`), N(() => {
439
- const p = String(l.cardId);
440
- Array.from(e.rootRef.value?.querySelectorAll("[data-task-id]") ?? []).find((H) => H.getAttribute("data-task-id") === p)?.scrollIntoView({ block: "nearest", inline: "nearest", behavior: "smooth" });
441
- });
442
- } else if (l.columnId != null) {
443
- const s = v(l.columnId);
444
- s && (e.announce(`Focused ${s.label}`), N(() => e.scrollToColumnImpl(s.id)));
445
- }
446
- } else if (t === "keyboard-enter") {
447
- const s = c(n.cardId), p = s ? e.allColumns.value.find((w) => String(w.id) === String(e.getItemColumnValue(s))) : null;
448
- s && p && e.emit("cardActivate", { card: s, column: p, origin: "keyboard" });
449
- } else if (t === "keyboard-space") {
450
- const l = n;
451
- e.getSelectionMode() !== "none" && (e.selectionOrigin.value = "keyboard", m?.selectCard(l.cardId, { ctrlKey: !0 }));
452
- } else if (t === "keyboard-range-select") {
453
- const l = n;
454
- e.getSelectionMode() !== "none" && (e.selectionOrigin.value = "keyboard", m?.selectRange(l.cardId, l.anchorCardId));
455
- } else if (t === "keyboard-select-all") {
456
- const l = n, s = l.swimlaneId != null ? e.getVisibleCellTasks(l.columnId, l.swimlaneId) : e.getColumnTasks(l.columnId);
457
- e.selectionOrigin.value = "keyboard", m?.selectAll(s);
458
- } else if (t === "keyboard-card-move") {
459
- const l = n, s = c(l.cardId);
460
- if (!s) return;
461
- P({
462
- card: s,
463
- oldColumnId: l.oldColumnId,
464
- newColumnId: l.newColumnId,
465
- oldIndex: l.oldIndex,
466
- newIndex: l.newIndex,
467
- oldSwimlaneId: l.oldSwimlaneId,
468
- newSwimlaneId: l.newSwimlaneId,
469
- selectedCardIds: l.selectedCardIds
470
- }), e.focusedCardId.value = l.cardId, e.focusedColumnId.value = l.newColumnId, e.focusedSwimlaneId.value = l.newSwimlaneId ?? null, g && (g.focusedCardId = l.cardId, g.focusedColumnId = l.newColumnId, g.focusedSwimlaneId = l.newSwimlaneId ?? null);
471
- } else t === "keyboard-card-move-blocked" && E(n);
472
- },
473
- isDisabled: () => e.getDisabled()
474
- }));
475
- },
476
- cleanupControllers: () => {
477
- k?.destroy(), k = null, m = null, A = null, g = null, T = null, I = null, i = null;
478
- },
479
- recordAudit: (t, n, l, s, p) => {
480
- I?.record(t, n, l, s, p);
481
- },
482
- canUndoState: S,
483
- canRedoState: C,
484
- getCoreInstance: () => i,
485
- getDragController: () => k,
486
- getSelectionController: () => m,
487
- getWorkflowController: () => A,
488
- getKeyboardController: () => g,
489
- getHistoryController: () => T,
490
- getAuditController: () => I
491
- };
492
- }
493
- function ye(e) {
494
- return {
495
- performUndo: () => {
496
- const m = e.getHistoryController()?.undo();
497
- m && (e.tasksWritable.value = me(e.tasks.value, m, e.getMutationFields()), e.syncCoreProps(), e.announce("Undo: " + m.description));
498
- },
499
- performRedo: () => {
500
- const m = e.getHistoryController()?.redo();
501
- m && (e.tasksWritable.value = ie(e.tasks.value, m, e.getMutationFields()), e.syncCoreProps(), e.announce("Redo: " + m.description));
502
- }
503
- };
504
- }
505
- const V = /* @__PURE__ */ Symbol.for("taskboard"), Se = /* @__PURE__ */ Symbol.for("taskboard-column"), ve = /* @__PURE__ */ Symbol.for("taskboard-card"), pe = /* @__PURE__ */ Symbol.for("taskboard-swimlane");
506
- function z(e, i, k, m) {
507
- if (!e && !m)
508
- throw new Error(`[PrimeUI TaskBoard] ${i} must be used inside ${k}.`);
509
- return e ?? null;
510
- }
511
- function be(e = {}) {
512
- return z(L(V, null), "useTaskBoardContext()", "TaskBoard.Root", e.optional);
513
- }
514
- function Ae(e = {}) {
515
- return z(L(Se, null), "useTaskBoardColumnContext()", "TaskBoard.Column", e.optional);
516
- }
517
- function Me(e = {}) {
518
- return z(L(ve, null), "useTaskBoardCardContext()", "TaskBoard.Card", e.optional);
519
- }
520
- function fe(e = {}) {
521
- return z(L(pe, null), "useTaskBoardSwimlaneHeaderContext()", "TaskBoard.SwimlaneHeader", e.optional);
522
- }
523
- function xe() {
524
- const e = L(V);
525
- return {
526
- selectedIds: e.selectedItemIds,
527
- select: e.selectCard,
528
- selectAll: e.selectAllCards,
529
- clear: e.clearSelection,
530
- isSelected: (i) => e.selectedItemIds.value.includes(i)
531
- };
532
- }
533
- function Re() {
534
- const e = L(V);
535
- return {
536
- canUndo: e.canUndoState,
537
- canRedo: e.canRedoState,
538
- undo: e.performUndo,
539
- redo: e.performRedo
540
- };
541
- }
542
- function Be() {
543
- const e = L(V);
544
- return {
545
- canDrag: e.canDrag,
546
- canEdit: e.canEdit,
547
- canCreate: e.canCreate,
548
- canDelete: e.canDelete,
549
- canMoveInto: e.canMoveIntoColumn,
550
- canMoveOut: e.canMoveOutOfColumn,
551
- canView: e.canViewColumn
552
- };
553
- }
554
- function Le() {
555
- const e = L(V);
556
- return {
557
- getWipStatus: e.getWipStatus,
558
- canMoveCard: e.canMoveCard
559
- };
560
- }
561
- function Pe() {
562
- const e = L(V);
563
- return {
564
- isDragging: e.isDragging,
565
- draggedItem: e.draggedItem,
566
- targetColumn: e.dragTargetColumnValue,
567
- targetIndex: e.dragTargetIndex,
568
- ghostPosition: e.ghostPosition,
569
- hiddenIds: e.getDragHiddenIds
570
- };
571
- }
572
- export {
573
- Se as C,
574
- pe as S,
575
- V as T,
576
- we as a,
577
- Te as b,
578
- ye as c,
579
- Be as d,
580
- Pe as e,
581
- Re as f,
582
- xe as g,
583
- Le as h,
584
- ve as i,
585
- Me as j,
586
- Ae as k,
587
- be as l,
588
- fe as m,
589
- De as u
590
- };
@@ -1,23 +0,0 @@
1
- import type { TaskBoardColumn, TaskBoardItem } from '@primeui/taskboard-types';
2
- type __VLS_Props = {
3
- item?: TaskBoardItem;
4
- column?: TaskBoardColumn;
5
- };
6
- declare var __VLS_1: {
7
- item: TaskBoardItem | undefined;
8
- isSelected: boolean;
9
- isDragging: boolean;
10
- column: TaskBoardColumn | undefined;
11
- };
12
- type __VLS_Slots = {} & {
13
- default?: (props: typeof __VLS_1) => any;
14
- };
15
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
- declare const _default: typeof __VLS_export;
18
- export default _default;
19
- type __VLS_WithSlots<T, S> = T & {
20
- new (): {
21
- $slots: S;
22
- };
23
- };
@@ -1,15 +0,0 @@
1
- declare var __VLS_1: {
2
- add: (item?: Partial<import("packages/components/taskboard/taskboard-types/src").TaskBoardItem>) => void;
3
- };
4
- type __VLS_Slots = {} & {
5
- default?: (props: typeof __VLS_1) => any;
6
- };
7
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
- declare const _default: typeof __VLS_export;
10
- export default _default;
11
- type __VLS_WithSlots<T, S> = T & {
12
- new (): {
13
- $slots: S;
14
- };
15
- };
@@ -1,18 +0,0 @@
1
- declare var __VLS_1: {
2
- item: import("packages/components/taskboard/taskboard-types/src").TaskBoardItem;
3
- isSelected: boolean;
4
- isDragging: boolean;
5
- column: import("packages/components/taskboard/taskboard-types/src").TaskBoardColumn;
6
- };
7
- type __VLS_Slots = {} & {
8
- default?: (props: typeof __VLS_1) => any;
9
- };
10
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
- declare const _default: typeof __VLS_export;
13
- export default _default;
14
- type __VLS_WithSlots<T, S> = T & {
15
- new (): {
16
- $slots: S;
17
- };
18
- };
@@ -1,18 +0,0 @@
1
- declare var __VLS_1: {
2
- item: import("packages/components/taskboard/taskboard-types/src").TaskBoardItem;
3
- isSelected: boolean;
4
- isDragging: boolean;
5
- column: import("packages/components/taskboard/taskboard-types/src").TaskBoardColumn;
6
- };
7
- type __VLS_Slots = {} & {
8
- default?: (props: typeof __VLS_1) => any;
9
- };
10
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
- declare const _default: typeof __VLS_export;
13
- export default _default;
14
- type __VLS_WithSlots<T, S> = T & {
15
- new (): {
16
- $slots: S;
17
- };
18
- };
@@ -1,18 +0,0 @@
1
- declare var __VLS_1: {
2
- item: import("packages/components/taskboard/taskboard-types/src").TaskBoardItem;
3
- isSelected: boolean;
4
- isDragging: boolean;
5
- column: import("packages/components/taskboard/taskboard-types/src").TaskBoardColumn;
6
- };
7
- type __VLS_Slots = {} & {
8
- default?: (props: typeof __VLS_1) => any;
9
- };
10
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
- declare const _default: typeof __VLS_export;
13
- export default _default;
14
- type __VLS_WithSlots<T, S> = T & {
15
- new (): {
16
- $slots: S;
17
- };
18
- };