@progress/kendo-react-taskboard 7.2.4-develop.3 → 7.3.0-develop.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 (66) hide show
  1. package/TaskBoard.js +8 -0
  2. package/TaskBoard.mjs +239 -0
  3. package/TaskBoardAddCard.js +8 -0
  4. package/TaskBoardAddCard.mjs +43 -0
  5. package/TaskBoardCardBase.js +8 -0
  6. package/TaskBoardCardBase.mjs +106 -0
  7. package/TaskBoardColumnBase.js +8 -0
  8. package/TaskBoardColumnBase.mjs +129 -0
  9. package/TaskBoardConfirmDialog.js +8 -0
  10. package/TaskBoardConfirmDialog.mjs +28 -0
  11. package/TaskBoardEditCard.js +8 -0
  12. package/TaskBoardEditCard.mjs +44 -0
  13. package/TaskBoardTaskEditPane.js +8 -0
  14. package/TaskBoardTaskEditPane.mjs +69 -0
  15. package/TaskBoardToolbar.js +8 -0
  16. package/TaskBoardToolbar.mjs +22 -0
  17. package/card/Card.js +8 -0
  18. package/card/Card.mjs +68 -0
  19. package/card/CardBody.js +8 -0
  20. package/card/CardBody.mjs +15 -0
  21. package/card/CardHeader.js +8 -0
  22. package/card/CardHeader.mjs +38 -0
  23. package/card/PreviewDialog.js +8 -0
  24. package/card/PreviewDialog.mjs +16 -0
  25. package/column/Column.js +8 -0
  26. package/column/Column.mjs +72 -0
  27. package/column/ColumnBody.js +8 -0
  28. package/column/ColumnBody.mjs +14 -0
  29. package/column/ColumnHeader.js +8 -0
  30. package/column/ColumnHeader.mjs +56 -0
  31. package/constants.js +8 -0
  32. package/constants.mjs +16 -0
  33. package/dist/cdn/js/kendo-react-taskboard.js +8 -5
  34. package/hooks/taskEditing.js +8 -0
  35. package/hooks/taskEditing.mjs +25 -0
  36. package/index.d.mts +839 -5
  37. package/index.d.ts +839 -18
  38. package/index.js +8 -5
  39. package/index.mjs +35 -829
  40. package/messages/index.js +8 -0
  41. package/messages/index.mjs +71 -0
  42. package/package-metadata.js +8 -0
  43. package/package-metadata.mjs +19 -0
  44. package/package.json +12 -12
  45. package/utils.js +8 -0
  46. package/utils.mjs +50 -0
  47. package/TaskBoard.d.ts +0 -149
  48. package/TaskBoardAddCard.d.ts +0 -32
  49. package/TaskBoardCardBase.d.ts +0 -63
  50. package/TaskBoardColumnBase.d.ts +0 -79
  51. package/TaskBoardConfirmDialog.d.ts +0 -38
  52. package/TaskBoardEditCard.d.ts +0 -20
  53. package/TaskBoardTaskEditPane.d.ts +0 -93
  54. package/TaskBoardToolbar.d.ts +0 -26
  55. package/card/Card.d.ts +0 -145
  56. package/card/CardBody.d.ts +0 -23
  57. package/card/CardHeader.d.ts +0 -57
  58. package/card/PreviewDialog.d.ts +0 -51
  59. package/column/Column.d.ts +0 -162
  60. package/column/ColumnBody.d.ts +0 -18
  61. package/column/ColumnHeader.d.ts +0 -56
  62. package/constants.d.ts +0 -24
  63. package/hooks/taskEditing.d.ts +0 -23
  64. package/messages/index.d.ts +0 -154
  65. package/package-metadata.d.ts +0 -9
  66. package/utils.d.ts +0 -29
package/index.mjs CHANGED
@@ -1,832 +1,38 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
5
8
  "use client";
6
- import * as t from "react";
7
- import S from "prop-types";
8
- import { classNames as ae, validatePackage as at, clone as Ye, useDraggable as nt, noop as Ue } from "@progress/kendo-react-common";
9
- import { useLocalization as ce } from "@progress/kendo-react-intl";
10
- import { Button as w } from "@progress/kendo-react-buttons";
11
- import { Input as fe } from "@progress/kendo-react-inputs";
12
- import { pencilIcon as We, plusIcon as ot, xIcon as qe, moreVerticalIcon as it, trashIcon as lt } from "@progress/kendo-svg-icons";
13
- import { Dialog as rt, DialogActionsBar as st } from "@progress/kendo-react-dialogs";
14
- import { CardHeader as dt, Menu as ct, CardBody as ut, Card as mt } from "@progress/kendo-react-layout";
15
- import { Popup as gt } from "@progress/kendo-react-popup";
16
- import { DropDownList as kt } from "@progress/kendo-react-dropdowns";
17
- import { Label as ke } from "@progress/kendo-react-labels";
18
- import { FieldWrapper as Ce } from "@progress/kendo-react-form";
19
- const Ct = {
20
- name: "@progress/kendo-react-taskboard",
21
- productName: "KendoReact",
22
- productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
23
- publishDate: 1709632284,
24
- version: "",
25
- licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
26
- }, ft = "taskBoard.toolbarAddColumnButton", Bt = "taskBoard.toolbarSearchField", Be = "taskBoard.editColumnButton", Te = "taskBoard.addCardButton", Ee = "taskBoard.deleteColumnButton", De = "taskBoard.editCardButton", he = "taskBoard.deleteCardButton", be = "taskBoard.deleteTaskDialogMessage", ye = "taskBoard.deleteTaskDialogTitle", ve = "taskBoard.deleteTaskConfirmButton", Se = "taskBoard.deleteTaskCancelButton", we = "taskBoard.addCardTitle", J = "taskBoard.addCardTitleLabel", Q = "taskBoard.addCardDescriptionLabel", Z = "taskBoard.addCardPriorityLabel", Pe = "taskBoard.addCardCreateButton", Ie = "taskBoard.deleteColumnDialogMessage", Re = "taskBoard.deleteColumnDialogTitle", Le = "taskBoard.deleteColumnConfirmButton", Ne = "taskBoard.deleteColumnCancelButton", xe = "taskBoard.editCardPaneTitle", Me = "taskBoard.editCardPaneSaveButton", $ = "taskBoard.editPaneTitleLabel", p = "taskBoard.editPaneDescriptionLabel", ee = "taskBoard.editPanePriorityLabel", te = "taskBoard.editPaneCancelButton", Ae = "taskBoard.previewPanePriorityLabel", Ke = "taskBoard.previewPaneDeleteButton", He = "taskBoard.previewPaneEditButton", i = {
27
- [ft]: "Add column",
28
- [Bt]: "Search",
29
- [Be]: "Edit column",
30
- [Te]: "Add card",
31
- [Ee]: "Delete column",
32
- [De]: "Edit card",
33
- [he]: "Delete card",
34
- [be]: "Are you sure you want to delete this card?",
35
- [ye]: "Delete Card",
36
- [ve]: "Delete",
37
- [Se]: "Cancel",
38
- [Ie]: "Are you sure you want to delete this column?",
39
- [Re]: "Delete column?",
40
- [Le]: "Delete",
41
- [Ne]: "Cancel",
42
- [we]: "Create new card",
43
- [Pe]: "Create",
44
- [te]: "Cancel",
45
- [xe]: "Edit",
46
- [Me]: "Save changes",
47
- [$]: "Title:",
48
- [p]: "Description:",
49
- [ee]: "Priority:",
50
- [J]: "Title",
51
- [Q]: "Description",
52
- [Z]: "Priority",
53
- [Ae]: "Priority:",
54
- [Ke]: "Delete",
55
- [He]: "Edit"
56
- }, Fe = "data-taskboard-type", _e = "data-taskboard-id", ze = "data-taskboard-placeholder", X = "column", G = "task", Ge = (e) => {
57
- const { edit: n, title: o } = e.column;
58
- return /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-column-header" }, /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-column-header-text k-text-ellipsis" }, n ? /* @__PURE__ */ t.createElement(
59
- fe,
60
- {
61
- value: o,
62
- onChange: e.onTitleChange,
63
- onBlur: e.onColumnExitEdit,
64
- autoFocus: !0
65
- }
66
- ) : o), /* @__PURE__ */ t.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ t.createElement("div", { className: ae("k-taskboard-column-header-actions", { "k-disabled": n }) }, /* @__PURE__ */ t.createElement(
67
- w,
68
- {
69
- fillMode: "flat",
70
- icon: "pencil",
71
- svgIcon: We,
72
- title: e.editButtonTitle,
73
- onClick: e.onColumnEnterEdit
74
- }
75
- ), /* @__PURE__ */ t.createElement(
76
- w,
77
- {
78
- fillMode: "flat",
79
- icon: "plus",
80
- svgIcon: ot,
81
- title: e.addButtonTitle,
82
- onClick: e.onShowAddCardDialog
83
- }
84
- ), /* @__PURE__ */ t.createElement(
85
- w,
86
- {
87
- fillMode: "flat",
88
- icon: "x",
89
- svgIcon: qe,
90
- title: e.closeButtonTitle,
91
- onClick: e.onColumnDelete
92
- }
93
- )));
94
- };
95
- Ge.displayName = "KendoReactTaskBoardColumnHeader";
96
- const Je = (e) => /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-column-cards-container" }, /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-column-cards" }, e.children));
97
- Je.displayName = "KendoReactTaskBoardColumnBody";
98
- const ue = (e) => {
99
- const { onClose: n, onConfirm: o, dialogMessage: s, dialogTitle: B, dialogConfirmButton: c, dialogCancelButton: d } = e;
100
- return /* @__PURE__ */ t.createElement(rt, { title: B, closeIcon: !1 }, s, /* @__PURE__ */ t.createElement(st, { layout: "end" }, /* @__PURE__ */ t.createElement(w, { themeColor: "primary", onClick: o }, c), /* @__PURE__ */ t.createElement(w, { onClick: n }, d)));
101
- };
102
- ue.propTypes = {
103
- onClose: S.func.isRequired,
104
- onConfirm: S.func.isRequired,
105
- dialogMessage: S.string.isRequired,
106
- dialogTitle: S.string.isRequired,
107
- dialogConfirmButton: S.string.isRequired,
108
- dialogCancelButton: S.string.isRequired
109
- };
110
- ue.displayName = "KendoReactTaskBoardConfirmDialog";
111
- const Qe = ({ onSave: e, task: n, priorities: o }) => {
112
- const [s, B] = t.useState(n ? n.title : ""), [c, d] = t.useState(n ? n.description : ""), [u, l] = t.useState(n ? n.priority : o[0]), D = t.useCallback((k) => {
113
- B(k.value);
114
- }, []), f = t.useCallback((k) => {
115
- d(k.value);
116
- }, []), h = t.useCallback((k) => {
117
- l(k.target.value);
118
- }, []), P = t.useCallback((k) => {
119
- const C = { id: void 0, status: "", ...n || {}, title: s, description: c, priority: u };
120
- e.call(void 0, C, n);
121
- }, [e, n, s, c, u]);
122
- return { onTitleChange: D, title: s, onDescriptionChange: f, description: c, onPriorityChange: h, priority: u, onSave: P };
123
- }, Ve = (e) => {
124
- const { onTitleChange: n, title: o, onDescriptionChange: s, description: B, onPriorityChange: c, priority: d, onSave: u } = Qe(e), l = ce();
125
- return /* @__PURE__ */ t.createElement(
126
- e.editPane,
127
- {
128
- header: l.toLanguageString(xe, i[xe]) + e.task.title,
129
- titleInputTitle: l.toLanguageString(J, i[J]),
130
- descriptionInputTitle: l.toLanguageString(Q, i[Q]),
131
- priorityDropDownTitle: l.toLanguageString(Z, i[Z]),
132
- task: e.task,
133
- saveButton: l.toLanguageString(Me, i[Me]),
134
- cancelButton: l.toLanguageString(te, i[te]),
135
- priorities: e.priorities,
136
- titleLabel: l.toLanguageString($, i[$]),
137
- descriptionLabel: l.toLanguageString(p, i[p]),
138
- priorityLabel: l.toLanguageString(ee, i[ee]),
139
- onSave: u,
140
- onClose: e.onClose,
141
- onTitleChange: n,
142
- title: o,
143
- onDescriptionChange: s,
144
- description: B,
145
- onPriorityChange: c,
146
- priority: d
147
- }
148
- );
149
- };
150
- Ve.propTypes = {};
151
- Ve.displayName = "KendoReactTaskBoardEditCard";
152
- const je = (e) => {
153
- const { onTitleChange: n, title: o, onDescriptionChange: s, description: B, onPriorityChange: c, priority: d, onSave: u } = Qe(e), l = ce();
154
- return /* @__PURE__ */ t.createElement(
155
- e.editPane,
156
- {
157
- header: l.toLanguageString(we, i[we]),
158
- titleInputTitle: l.toLanguageString(J, i[J]),
159
- descriptionInputTitle: l.toLanguageString(Q, i[Q]),
160
- priorityDropDownTitle: l.toLanguageString(Z, i[Z]),
161
- titleLabel: l.toLanguageString($, i[$]),
162
- descriptionLabel: l.toLanguageString(p, i[p]),
163
- priorityLabel: l.toLanguageString(ee, i[ee]),
164
- saveButton: l.toLanguageString(Pe, i[Pe]),
165
- cancelButton: l.toLanguageString(te, i[te]),
166
- priorities: e.priorities,
167
- onSave: u,
168
- onClose: e.onClose,
169
- onTitleChange: n,
170
- title: o,
171
- onDescriptionChange: s,
172
- description: B,
173
- onPriorityChange: c,
174
- priority: d
175
- }
176
- );
177
- };
178
- je.propTypes = {};
179
- je.displayName = "KendoReactTaskBoardAddCard";
180
- const Ze = (e) => {
181
- const n = t.useRef();
182
- return /* @__PURE__ */ t.createElement(dt, { className: "k-hbox" }, /* @__PURE__ */ t.createElement(
183
- "span",
184
- {
185
- className: "k-card-title k-link",
186
- onClick: e.onShowPreviewPane
187
- },
188
- e.title
189
- ), /* @__PURE__ */ t.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ t.createElement("div", { className: "k-card-header-actions" }, /* @__PURE__ */ t.createElement(
190
- w,
191
- {
192
- fillMode: "flat",
193
- icon: "more-vertical",
194
- svgIcon: it,
195
- ref: n,
196
- onClick: e.showMenu ? e.onHideMenu : e.onShowMenu,
197
- onBlur: e.onMenuButtonBlur
198
- }
199
- ), /* @__PURE__ */ t.createElement(gt, { anchor: n.current && n.current.element, show: e.showMenu, ref: e.popupRef }, /* @__PURE__ */ t.createElement(ct, { vertical: !0, onSelect: e.onMenuItemSelect, items: e.menuItems, className: "k-context-menu" }))));
200
- };
201
- Ze.displayName = "KendoReactTaskBoardCardHeader";
202
- const $e = (e) => /* @__PURE__ */ t.createElement(ut, null, e.children);
203
- $e.displayName = "KendoReactTaskBoardCardBody";
204
- const pe = (e) => /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane k-taskboard-preview-pane" }, /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-header" }, /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-header-text" }, e.title), /* @__PURE__ */ t.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-header-actions" }, /* @__PURE__ */ t.createElement(w, { icon: "x", svgIcon: qe, fillMode: "flat", onClick: e.onClosePreviewPane }))), /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-content" }, /* @__PURE__ */ t.createElement("p", null, e.description), /* @__PURE__ */ t.createElement("p", null, e.priorityLabel, " ", /* @__PURE__ */ t.createElement("span", { style: { backgroundColor: e.priority.color } }, " "), " ", e.priority.priority)), /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-actions k-actions k-hstack k-justify-content-end" }, /* @__PURE__ */ t.createElement(w, { onClick: e.onTaskDelete }, e.delete), /* @__PURE__ */ t.createElement(w, { themeColor: "primary", onClick: e.onTaskEdit }, e.edit)));
205
- pe.displayName = "KendoReactTaskBoardPreviewDialog";
206
- const me = (e) => {
207
- const { onDeleteTask: n, showEditPane: o, task: s, style: B, dragTargetRef: c, elementRef: d } = e, [u, l] = t.useState(!1), [D, f] = t.useState(!1), [h, P] = t.useState(!1), k = t.useRef(null), C = ce(), I = [
208
- {
209
- text: C.toLanguageString(De, i[De]),
210
- icon: "pencil",
211
- svgIcon: We,
212
- data: () => {
213
- o(s), l(!u);
214
- }
215
- },
216
- {
217
- text: C.toLanguageString(he, i[he]),
218
- icon: "trash",
219
- svgIcon: lt,
220
- data: () => {
221
- f(!D), l(!u);
222
- }
223
- }
224
- ], x = (_) => {
225
- _.item.data();
226
- }, L = () => {
227
- l(!0);
228
- }, y = () => {
229
- l(!1);
230
- }, M = (_) => {
231
- const z = k.current && k.current.element;
232
- z && z.contains(_.relatedTarget) || l(!1);
233
- }, F = () => {
234
- f(!D);
235
- }, A = () => {
236
- P(!0);
237
- }, Y = () => {
238
- P(!1);
239
- }, K = () => {
240
- o(s), A();
241
- };
242
- return s.isPlaceholder && c && c.current ? /* @__PURE__ */ t.createElement(
243
- "div",
244
- {
245
- style: { width: c.current.width, height: c.current.height },
246
- className: "k-taskboard-drag-placeholder",
247
- [ze]: !0
248
- }
249
- ) : /* @__PURE__ */ t.createElement(
250
- e.cardComponent,
251
- {
252
- task: s,
253
- style: B,
254
- tabIndex: e.tabIndex,
255
- disabled: e.disabled,
256
- elementRef: d,
257
- showMenu: u,
258
- showDeleteConfirm: D,
259
- showTaskPreviewPane: h,
260
- menuItems: I,
261
- popupRef: k,
262
- confirmDialogMessage: C.toLanguageString(be, i[be]),
263
- confirmDialogTitle: C.toLanguageString(ye, i[ye]),
264
- confirmDialogConfirmButton: C.toLanguageString(ve, i[ve]),
265
- confirmDialogCancelButton: C.toLanguageString(Se, i[Se]),
266
- previewDialogPriorityLabel: C.toLanguageString(Ae, i[Ae]),
267
- previewDialogDelete: C.toLanguageString(Ke, i[Ke]),
268
- previewDialogEdit: C.toLanguageString(He, i[He]),
269
- onShowPreviewPane: A,
270
- onClosePreviewPane: Y,
271
- onMenuItemSelect: x,
272
- onShowMenu: L,
273
- onHideMenu: y,
274
- onMenuButtonBlur: M,
275
- onTaskDelete: n,
276
- onTaskEdit: K,
277
- onCloseConfirmDialog: F,
278
- card: mt,
279
- cardHeader: Ze,
280
- cardBody: $e,
281
- confirmDialog: ue,
282
- previewDialog: pe
283
- }
284
- );
285
- };
286
- me.propTypes = {
287
- task: S.object.isRequired
288
- };
289
- me.displayName = "KendoReactTaskBoardCardBase";
290
- const se = (e) => {
291
- const [n, o] = t.useState(!1), [s, B] = t.useState(!1), [c, d] = t.useState(!1), [u, l] = t.useState(), {
292
- dragTargetRef: D,
293
- column: f,
294
- onColumnChange: h,
295
- tasks: P,
296
- elementRef: k,
297
- style: C,
298
- onTaskCreate: I,
299
- onTaskEdit: x,
300
- onTaskDelete: L
301
- } = e, y = ce(), M = t.useCallback((m) => {
302
- const H = { ...f, title: m.value };
303
- h.call(void 0, H, f);
304
- }, [f, h]), F = t.useCallback(() => {
305
- const m = { ...f, edit: !0 };
306
- h.call(void 0, m, f);
307
- }, [f, h]), A = t.useCallback(() => {
308
- const m = { ...f, edit: !1 };
309
- h.call(void 0, m, f);
310
- }, [f, h]), Y = t.useCallback(() => {
311
- h.call(void 0, null, f);
312
- }, [f, h]), K = () => {
313
- d(!c);
314
- }, _ = () => {
315
- o(!0);
316
- }, z = (m) => {
317
- B(!0), l(m);
318
- }, ge = () => {
319
- o(!1), B(!1);
320
- }, E = t.useCallback((m) => {
321
- o(!1), I.call(void 0, { ...m, status: f.status });
322
- }, [I, f]), ne = t.useCallback((m, H) => {
323
- B(!1), x.call(void 0, m, H);
324
- }, [x]), W = t.useCallback((m) => {
325
- L.call(void 0, m);
326
- }, [L]);
327
- if (f.isPlaceholder && D && D.current) {
328
- const m = D.current ? D.current.width : 0, H = D.current ? D.current.height : 0;
329
- return /* @__PURE__ */ t.createElement(
330
- "div",
331
- {
332
- style: { width: m, height: H },
333
- className: "k-taskboard-column k-taskboard-drag-placeholder",
334
- [ze]: !0
335
- }
336
- );
337
- }
338
- return /* @__PURE__ */ t.createElement(
339
- e.columnComponent,
340
- {
341
- column: e.column,
342
- tasks: P,
343
- priorities: e.priorities,
344
- style: D ? { overflow: "visible", ...C } : C,
345
- tabIndex: e.tabIndex,
346
- elementRef: k,
347
- onTaskCreate: E,
348
- onTaskEdit: ne,
349
- onTaskDelete: W,
350
- card: e.cardComponent,
351
- header: Ge,
352
- body: Je,
353
- confirmDialog: ue,
354
- editCardDialog: Ve,
355
- addCardDialog: je,
356
- onTitleChange: M,
357
- onColumnEnterEdit: F,
358
- onColumnExitEdit: A,
359
- onColumnConfirmDelete: Y,
360
- onShowAddCardDialog: _,
361
- onShowEditCardPane: z,
362
- onColumnDelete: K,
363
- onCloseDialog: ge,
364
- showAddCard: n,
365
- showEditCard: s,
366
- showColumnConfirmDelete: c,
367
- editedTask: u,
368
- confirmDialogMessage: y.toLanguageString(Ie, i[Ie]),
369
- confirmDialogTitle: y.toLanguageString(Re, i[Re]),
370
- confirmDialogConfirmButton: y.toLanguageString(Le, i[Le]),
371
- confirmDialogCancelButton: y.toLanguageString(Ne, i[Ne]),
372
- editButtonTitle: y.toLanguageString(Be, i[Be]),
373
- addButtonTitle: y.toLanguageString(Te, i[Te]),
374
- closeButtonTitle: y.toLanguageString(Ee, i[Ee])
375
- },
376
- P && P.map((m) => /* @__PURE__ */ t.createElement(
377
- me,
378
- {
379
- key: m.id,
380
- tabIndex: e.tabIndex,
381
- task: m,
382
- disabled: !!e.column.edit,
383
- onDeleteTask: () => W(m),
384
- showEditPane: () => z(m),
385
- dragTargetRef: e.dragTargetRef,
386
- style: { borderLeftColor: m.priority.color },
387
- cardComponent: e.cardComponent
388
- }
389
- ))
390
- );
391
- };
392
- se.propTypes = {
393
- column: S.object.isRequired,
394
- taskMap: S.object
395
- };
396
- se.displayName = "KendoReactTaskBoardColumn";
397
- const Tt = (e, n, o) => {
398
- let s = -1, B = -1;
399
- for (let c = 0; c < o.length; c++) {
400
- const d = String(o[c].id);
401
- if (d === e && (B = c), d === n && (s = c), s !== -1 && B !== -1)
402
- return {
403
- dragIndex: B,
404
- dropIndex: s
405
- };
406
- }
407
- return null;
408
- }, Xe = (e) => {
409
- for (; e; ) {
410
- if (!e.getAttribute)
411
- return null;
412
- const n = e.getAttribute(_e);
413
- if (n)
414
- return {
415
- id: n,
416
- type: e.getAttribute(Fe) || "",
417
- element: e
418
- };
419
- e = e.parentNode;
420
- }
421
- return null;
422
- }, Et = (e, n) => {
423
- const o = n.dataItem.color, s = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("span", { style: { backgroundColor: o } }, " "), e.props.children);
424
- return t.cloneElement(e, e.props, s);
425
- }, Dt = (e, n) => {
426
- if (!n)
427
- return e;
428
- const o = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("span", { style: { backgroundColor: n.color } }, " "), /* @__PURE__ */ t.createElement("span", null, "  ", e.props.children));
429
- return t.cloneElement(e, { ...e.props }, o);
430
- }, re = (e) => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
431
- e.card,
432
- {
433
- key: String(e.task.id),
434
- ref: e.elementRef,
435
- style: e.style,
436
- className: ae("k-taskboard-card k-cursor-move k-taskboard-card-category", {
437
- "k-disabled": e.disabled
438
- }),
439
- [Fe]: G,
440
- [_e]: e.task.id,
441
- tabIndex: e.tabIndex
442
- },
443
- /* @__PURE__ */ t.createElement(
444
- e.cardHeader,
445
- {
446
- showMenu: e.showMenu,
447
- menuItems: e.menuItems,
448
- popupRef: e.popupRef,
449
- title: e.task.title,
450
- task: e.task,
451
- onShowPreviewPane: e.onShowPreviewPane,
452
- onShowMenu: e.onShowMenu,
453
- onHideMenu: e.onHideMenu,
454
- onMenuButtonBlur: e.onMenuButtonBlur,
455
- onMenuItemSelect: e.onMenuItemSelect
456
- }
457
- ),
458
- /* @__PURE__ */ t.createElement(e.cardBody, { task: e.task }, e.task.description)
459
- ), e.showDeleteConfirm && /* @__PURE__ */ t.createElement(
460
- e.confirmDialog,
461
- {
462
- onConfirm: e.onTaskDelete,
463
- onClose: e.onCloseConfirmDialog,
464
- dialogMessage: e.confirmDialogMessage,
465
- dialogTitle: e.confirmDialogTitle,
466
- dialogConfirmButton: e.confirmDialogConfirmButton,
467
- dialogCancelButton: e.confirmDialogCancelButton
468
- }
469
- ), e.showTaskPreviewPane && /* @__PURE__ */ t.createElement(
470
- e.previewDialog,
471
- {
472
- title: e.task.title,
473
- description: e.task.description,
474
- priorityLabel: e.previewDialogPriorityLabel,
475
- delete: e.previewDialogDelete,
476
- edit: e.previewDialogEdit,
477
- onClosePreviewPane: e.onClosePreviewPane,
478
- onTaskDelete: e.onTaskDelete,
479
- onTaskEdit: e.onTaskEdit,
480
- priority: e.task.priority
481
- }
482
- ));
483
- re.displayName = "KendoReactTaskBoardCard";
484
- const de = (e) => /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane k-taskboard-edit-pane" }, /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-header" }, /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-header-text" }, e.header), /* @__PURE__ */ t.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-header-actions" }, /* @__PURE__ */ t.createElement(w, { icon: "x", svgIcon: qe, fillMode: "flat", onClick: e.onClose }))), /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-content" }, /* @__PURE__ */ t.createElement(
485
- "div",
486
- {
487
- role: "form",
488
- "data-role": "form",
489
- className: "k-form"
490
- },
491
- /* @__PURE__ */ t.createElement(Ce, null, /* @__PURE__ */ t.createElement(ke, { editorId: "title" }, e.titleLabel), /* @__PURE__ */ t.createElement(
492
- fe,
493
- {
494
- id: "title",
495
- onChange: e.onTitleChange,
496
- value: e.title,
497
- title: e.titleInputTitle
498
- }
499
- )),
500
- /* @__PURE__ */ t.createElement(Ce, null, /* @__PURE__ */ t.createElement(ke, { editorId: "description" }, e.descriptionLabel), /* @__PURE__ */ t.createElement(
501
- fe,
502
- {
503
- id: "description",
504
- onChange: e.onDescriptionChange,
505
- value: e.description,
506
- title: e.descriptionInputTitle
507
- }
508
- )),
509
- /* @__PURE__ */ t.createElement(Ce, null, /* @__PURE__ */ t.createElement(ke, { editorId: "priority" }, e.priorityLabel), /* @__PURE__ */ t.createElement(
510
- kt,
511
- {
512
- id: "priority",
513
- data: e.priorities,
514
- value: e.priority,
515
- onChange: e.onPriorityChange,
516
- itemRender: Et,
517
- valueRender: Dt,
518
- textField: "priority",
519
- dataItemKey: "priority",
520
- title: e.priorityDropDownTitle
521
- }
522
- ))
523
- )), /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-pane-actions k-actions k-hstack k-justify-content-end" }, /* @__PURE__ */ t.createElement(w, { onClick: e.onClose }, e.cancelButton), /* @__PURE__ */ t.createElement(
524
- w,
525
- {
526
- themeColor: "primary",
527
- onClick: e.onSave,
528
- disabled: !e.title || !e.description
529
- },
530
- e.saveButton
531
- )));
532
- de.propTypes = {};
533
- de.displayName = "KendoReactTaskBoardEditPane";
534
- const Oe = (e) => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
535
- "div",
536
- {
537
- ref: e.elementRef,
538
- style: e.style,
539
- className: ae("k-taskboard-column", {
540
- "k-taskboard-column-edit": e.column.edit
541
- }),
542
- tabIndex: e.tabIndex,
543
- [Fe]: X,
544
- [_e]: e.column.id
545
- },
546
- /* @__PURE__ */ t.createElement(
547
- e.header,
548
- {
549
- column: e.column,
550
- tasks: e.tasks,
551
- onTitleChange: e.onTitleChange,
552
- onColumnExitEdit: e.onColumnExitEdit,
553
- editButtonTitle: e.editButtonTitle,
554
- onColumnEnterEdit: e.onColumnEnterEdit,
555
- addButtonTitle: e.addButtonTitle,
556
- onShowAddCardDialog: e.onShowAddCardDialog,
557
- closeButtonTitle: e.closeButtonTitle,
558
- onColumnDelete: e.onColumnDelete
559
- }
560
- ),
561
- /* @__PURE__ */ t.createElement(e.body, null, e.children)
562
- ), e.showAddCard && /* @__PURE__ */ t.createElement(
563
- e.addCardDialog,
564
- {
565
- onClose: e.onCloseDialog,
566
- onSave: e.onTaskCreate,
567
- priorities: e.priorities,
568
- editPane: de
569
- }
570
- ), e.showEditCard && e.editedTask && /* @__PURE__ */ t.createElement(
571
- e.editCardDialog,
572
- {
573
- onClose: e.onCloseDialog,
574
- onSave: e.onTaskEdit,
575
- task: e.editedTask,
576
- priorities: e.priorities,
577
- editPane: de
578
- }
579
- ), e.showColumnConfirmDelete && /* @__PURE__ */ t.createElement(
580
- e.confirmDialog,
581
- {
582
- onClose: e.onColumnDelete,
583
- onConfirm: e.onColumnConfirmDelete,
584
- dialogMessage: e.confirmDialogMessage,
585
- dialogTitle: e.confirmDialogTitle,
586
- dialogConfirmButton: e.confirmDialogConfirmButton,
587
- dialogCancelButton: e.confirmDialogCancelButton
588
- }
589
- ));
590
- Oe.displayName = "KendoReactTaskBoardColumn";
591
- const et = t.forwardRef((e, n) => {
592
- at(Ct);
593
- const { columnData: o = [], className: s, style: B, id: c, taskData: d = [], onChange: u } = e, l = t.useRef(null), D = t.useRef(null);
594
- t.useImperativeHandle(l, () => ({ props: e })), t.useImperativeHandle(n, () => l.current);
595
- const h = t.Children.toArray(e.children).filter((a) => a && a.type && a.type.displayName === "KendoReactTaskBoardToolbar"), P = t.useRef(null), k = t.useRef(null), C = t.useRef(null), [I, x] = t.useState(null), [L, y] = t.useState(null), [M, F] = t.useState({ top: 0, left: 0 }), A = t.useRef(null), Y = t.useRef(null), K = t.useMemo(() => {
596
- const a = {};
597
- return (I || d).forEach((g) => {
598
- const r = g.status;
599
- a[r] || (a[r] = []), a[r].push(g);
600
- }), a;
601
- }, [d, I]), _ = t.useCallback(
602
- (a) => {
603
- const g = a.originalEvent.target;
604
- if (g.closest("button,input,.k-link,.k-taskboard-preview-pane"))
605
- return;
606
- const r = Xe(g), T = D.current;
607
- if (r && T) {
608
- const b = r.type === X;
609
- if (b && !g.closest(".k-taskboard-column-header"))
610
- return;
611
- const U = r.element.getBoundingClientRect(), V = T.getBoundingClientRect();
612
- C.current = {
613
- x: a.clientX - U.left + V.left,
614
- y: a.clientY - U.top + V.top
615
- };
616
- const R = b ? o : d, oe = b ? y : x, N = R.findIndex((ie) => String(ie.id) === r.id), q = R[N];
617
- if (N === -1 || q.edit)
618
- return;
619
- const v = Ye(q);
620
- v.isPlaceholder = !0;
621
- const j = [...R];
622
- j[N] = v, k.current = {
623
- ...r,
624
- index: N,
625
- item: q,
626
- width: U.width,
627
- height: U.height
628
- }, F({
629
- top: a.clientY - C.current.y,
630
- left: a.clientX - C.current.x
631
- }), oe(j);
632
- }
633
- },
634
- [o, d]
635
- ), z = t.useCallback(
636
- (a) => {
637
- const g = k.current, r = A.current && A.current.element || Y.current;
638
- if (g && r) {
639
- F({
640
- top: a.clientY - C.current.y,
641
- left: a.clientX - C.current.x
642
- }), r.style.visibility = "hidden";
643
- const T = document.elementFromPoint(a.clientX, a.clientY);
644
- if (r.style.visibility = "", T && T.getAttribute(ze))
645
- return;
646
- const b = T && Xe(T);
647
- if (b) {
648
- let O;
649
- const U = b.type === g.type, V = g.type === X, R = (V ? L : I) || [], oe = V ? y : x;
650
- if (V || U) {
651
- if (O = Tt(g.id, b.id, R), O) {
652
- const N = R[O.dragIndex], q = R[O.dropIndex], v = Ye(N);
653
- V || (v.status = q.status);
654
- const j = [...R];
655
- j.splice(O.dragIndex, 1), j.splice(O.dropIndex, 0, v), g.index = O.dropIndex, oe(j);
656
- }
657
- } else {
658
- const N = R.findIndex((v) => String(v.id) === g.id), q = o.findIndex((v) => String(v.id) === b.id);
659
- if (N !== -1 && q !== -1) {
660
- const v = R[N], ie = o[q].status;
661
- if (K[ie])
662
- return;
663
- v.status = ie;
664
- const le = [...R];
665
- le.splice(N, 1), le.push(v), g.index = le.length - 1, oe(le);
666
- }
667
- }
668
- }
669
- }
670
- },
671
- [L, I, o, K]
672
- ), ge = t.useCallback(
673
- () => {
674
- const a = k.current;
675
- if (u && a) {
676
- const r = (a.type === X ? L : I) || [], T = r[a.index];
677
- delete T.isPlaceholder;
678
- const b = {
679
- data: r,
680
- type: a.type,
681
- previousItem: a.item,
682
- item: T
683
- };
684
- u.call(void 0, b);
685
- }
686
- k.current = null, C.current = null, x(null), y(null), F({ top: 0, left: 0 });
687
- },
688
- [L, I, u]
689
- );
690
- nt(P, {
691
- onDragStart: _,
692
- onDrag: z,
693
- onDragEnd: ge
694
- });
695
- const E = k.current, ne = t.useCallback((a) => {
696
- const r = {
697
- data: [...d, a],
698
- type: G,
699
- previousItem: null,
700
- item: a
701
- };
702
- u.call(void 0, r);
703
- }, [u, d]), W = t.useCallback((a, g) => {
704
- const r = d.slice(), T = d.indexOf(g);
705
- T !== -1 && r.splice(T, 1, a);
706
- const b = {
707
- data: r,
708
- type: G,
709
- previousItem: g,
710
- item: a
711
- };
712
- u.call(void 0, b);
713
- }, [u, d]), m = t.useCallback((a) => {
714
- const r = {
715
- data: d.filter((T) => T !== a),
716
- type: G,
717
- previousItem: a,
718
- item: null
719
- };
720
- u.call(void 0, r);
721
- }, [u, d]), H = t.useCallback((a, g) => {
722
- const r = o.slice(), T = r.indexOf(g);
723
- T !== -1 && (a ? r.splice(T, 1, a) : r.splice(T, 1));
724
- const b = {
725
- data: r,
726
- type: X,
727
- previousItem: g,
728
- item: a
729
- };
730
- u.call(void 0, b);
731
- }, [u, o]);
732
- return /* @__PURE__ */ t.createElement(
733
- "div",
734
- {
735
- id: c,
736
- style: B,
737
- ref: D,
738
- className: ae("k-widget k-taskboard", s)
739
- },
740
- h,
741
- /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-content", style: E ? { userSelect: "none" } : void 0 }, /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-columns-container", ref: P }, (L || o).map((a) => /* @__PURE__ */ t.createElement(
742
- se,
743
- {
744
- key: a.id,
745
- tabIndex: e.tabIndex,
746
- column: a,
747
- tasks: K[a.status] || [],
748
- dragTargetRef: k,
749
- onTaskCreate: ne,
750
- onTaskEdit: W,
751
- onTaskDelete: m,
752
- onColumnChange: H,
753
- columnComponent: e.column || Oe,
754
- cardComponent: e.card || re,
755
- priorities: e.priorities
756
- }
757
- )))),
758
- E && E.type === G && /* @__PURE__ */ t.createElement(
759
- me,
760
- {
761
- elementRef: A,
762
- style: {
763
- position: "absolute",
764
- width: E.width,
765
- height: E.height,
766
- top: M.top,
767
- left: M.left,
768
- zIndex: 10,
769
- borderLeftColor: E.item.priority ? E.item.priority.color : E.item.color
770
- },
771
- task: E.item,
772
- dragTargetRef: k,
773
- cardComponent: e.card || re,
774
- onDeleteTask: Ue,
775
- showEditPane: Ue
776
- }
777
- ),
778
- E && E.type === X && /* @__PURE__ */ t.createElement(
779
- se,
780
- {
781
- elementRef: Y,
782
- style: {
783
- position: "absolute",
784
- width: E.width,
785
- height: E.height,
786
- top: M.top,
787
- left: M.left,
788
- zIndex: 10
789
- },
790
- cardComponent: e.card || re,
791
- columnComponent: e.column || Oe,
792
- column: E.item,
793
- tasks: K[E.item.status],
794
- priorities: e.priorities,
795
- dragTargetRef: k,
796
- onTaskDelete: m,
797
- onColumnChange: H,
798
- onTaskEdit: W,
799
- onTaskCreate: ne
800
- }
801
- )
802
- );
803
- });
804
- et.propTypes = {
805
- columnData: S.array.isRequired,
806
- taskData: S.array.isRequired
807
- };
808
- et.displayName = "KendoReactTaskBoard";
809
- const tt = (e) => {
810
- const { className: n, style: o, children: s } = e;
811
- return /* @__PURE__ */ t.createElement("div", { style: o, className: ae("k-taskboard-header", n) }, /* @__PURE__ */ t.createElement("div", { className: "k-taskboard-toolbar k-toolbar" }, s));
812
- };
813
- tt.propTypes = {
814
- children: S.node
815
- };
816
- tt.displayName = "KendoReactTaskBoardToolbar";
9
+ import { TaskBoard as a } from "./TaskBoard.mjs";
10
+ import { TaskBoardToolbar as e } from "./TaskBoardToolbar.mjs";
11
+ import { TaskBoardCard as t } from "./card/Card.mjs";
12
+ import { TaskBoardCardHeader as T } from "./card/CardHeader.mjs";
13
+ import { TaskBoardCardBody as k } from "./card/CardBody.mjs";
14
+ import { TaskBoardColumn as p } from "./column/Column.mjs";
15
+ import { TaskBoardColumnHeader as i } from "./column/ColumnHeader.mjs";
16
+ import { TaskBoardColumnBody as l } from "./column/ColumnBody.mjs";
17
+ import { TaskBoardConfirmDialog as u } from "./TaskBoardConfirmDialog.mjs";
18
+ import { TaskBoardPreviewDialog as E } from "./card/PreviewDialog.mjs";
19
+ import { TaskBoardAddCard as D } from "./TaskBoardAddCard.mjs";
20
+ import { TaskBoardEditCard as P } from "./TaskBoardEditCard.mjs";
21
+ import { TaskBoardTaskEditPane as c } from "./TaskBoardTaskEditPane.mjs";
22
+ import { useTaskEditing as w } from "./hooks/taskEditing.mjs";
817
23
  export {
818
- et as TaskBoard,
819
- je as TaskBoardAddCard,
820
- re as TaskBoardCard,
821
- $e as TaskBoardCardBody,
822
- Ze as TaskBoardCardHeader,
823
- Oe as TaskBoardColumn,
824
- Je as TaskBoardColumnBody,
825
- Ge as TaskBoardColumnHeader,
826
- ue as TaskBoardConfirmDialog,
827
- Ve as TaskBoardEditCard,
828
- pe as TaskBoardPreviewDialog,
829
- de as TaskBoardTaskEditPane,
830
- tt as TaskBoardToolbar,
831
- Qe as useTaskEditing
24
+ a as TaskBoard,
25
+ D as TaskBoardAddCard,
26
+ t as TaskBoardCard,
27
+ k as TaskBoardCardBody,
28
+ T as TaskBoardCardHeader,
29
+ p as TaskBoardColumn,
30
+ l as TaskBoardColumnBody,
31
+ i as TaskBoardColumnHeader,
32
+ u as TaskBoardConfirmDialog,
33
+ P as TaskBoardEditCard,
34
+ E as TaskBoardPreviewDialog,
35
+ c as TaskBoardTaskEditPane,
36
+ e as TaskBoardToolbar,
37
+ w as useTaskEditing
832
38
  };