@thebuoyant-tsdev/mui-ts-library 3.35.0 → 3.36.0
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/README.de.md +8 -1
- package/README.md +8 -1
- package/dist/components/gantt-chart/GanttTaskPanel.js +56 -56
- package/dist/components/kanban-board/KanbanBoard.d.ts +1 -1
- package/dist/components/kanban-board/KanbanBoard.js +160 -89
- package/dist/components/kanban-board/KanbanBoard.types.d.ts +31 -0
- package/dist/components/kanban-board/KanbanBoard.types.js +7 -1
- package/dist/components/kanban-board/KanbanBoardCard.js +19 -19
- package/dist/components/kanban-board/KanbanBoardCardDialog.js +40 -40
- package/dist/components/kanban-board/KanbanBoardColumn.d.ts +4 -1
- package/dist/components/kanban-board/KanbanBoardColumn.js +115 -56
- package/dist/components/kanban-board/KanbanBoardColumnDialog.d.ts +17 -0
- package/dist/components/kanban-board/KanbanBoardColumnDialog.js +78 -0
- package/dist/components/kanban-board/kanbanBoardClasses.d.ts +4 -0
- package/dist/components/kanban-board/kanbanBoardClasses.js +3 -1
- package/dist/components/rich-text-editor/RichTextEditorTableMenu.js +29 -29
- package/dist/index.cjs +2 -2
- package/package.json +3 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import g from "
|
|
1
|
+
import e from "@mui/icons-material/Add";
|
|
2
|
+
import { Box as t, Button as n, Checkbox as r, Dialog as i, DialogActions as a, DialogContent as o, DialogContentText as s, DialogTitle as c, FormControlLabel as l, IconButton as u, InputAdornment as d, MenuItem as f, Stack as p, TextField as m, Typography as h } from "@mui/material";
|
|
3
|
+
import { useState as g } from "react";
|
|
4
4
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
5
5
|
import b from "@mui/icons-material/Close";
|
|
6
6
|
import x from "@mui/icons-material/Delete";
|
|
7
7
|
//#region src/components/kanban-board/KanbanBoardCardDialog.tsx
|
|
8
8
|
function S({ state: S, columns: C, t: w, showSubtasks: T, onSave: E, onDelete: D, onClose: O, onRequestDelete: k }) {
|
|
9
|
-
let A = S?.mode === "add", j = S?.mode === "edit", M = S?.mode === "delete", N = j ? S.task : null, P = M ? S.task : null, F = A ? S.columnId : null, [I, L] =
|
|
9
|
+
let A = S?.mode === "add", j = S?.mode === "edit", M = S?.mode === "delete", N = j ? S.task : null, P = M ? S.task : null, F = A ? S.columnId : null, [I, L] = g(() => j && N ? { ...N } : A && F ? {
|
|
10
10
|
id: "",
|
|
11
11
|
title: "",
|
|
12
12
|
status: F
|
|
@@ -14,7 +14,7 @@ function S({ state: S, columns: C, t: w, showSubtasks: T, onSave: E, onDelete: D
|
|
|
14
14
|
id: "",
|
|
15
15
|
title: "",
|
|
16
16
|
status: C[0]?.id ?? ""
|
|
17
|
-
}), [R, z] =
|
|
17
|
+
}), [R, z] = g("");
|
|
18
18
|
function B() {
|
|
19
19
|
let e = R.trim();
|
|
20
20
|
if (!e) return;
|
|
@@ -58,24 +58,24 @@ function S({ state: S, columns: C, t: w, showSubtasks: T, onSave: E, onDelete: D
|
|
|
58
58
|
}));
|
|
59
59
|
}
|
|
60
60
|
let G = A ? w.dialogAddTitle : j ? w.dialogEditTitle : w.dialogDeleteTitle;
|
|
61
|
-
return /* @__PURE__ */ y(
|
|
61
|
+
return /* @__PURE__ */ y(i, {
|
|
62
62
|
open: !!S,
|
|
63
63
|
onClose: O,
|
|
64
64
|
maxWidth: "xs",
|
|
65
65
|
fullWidth: !0,
|
|
66
|
-
children: [/* @__PURE__ */ v(
|
|
66
|
+
children: [/* @__PURE__ */ v(c, { children: G }), M && P ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(o, { children: /* @__PURE__ */ v(s, { children: w.dialogDeleteConfirm.replace("{title}", P.title) }) }), /* @__PURE__ */ y(a, { children: [/* @__PURE__ */ v(n, {
|
|
67
67
|
onClick: O,
|
|
68
68
|
children: w.dialogCancel
|
|
69
|
-
}), /* @__PURE__ */ v(
|
|
69
|
+
}), /* @__PURE__ */ v(n, {
|
|
70
70
|
color: "error",
|
|
71
71
|
startIcon: /* @__PURE__ */ v(x, {}),
|
|
72
72
|
onClick: () => D(P.id),
|
|
73
73
|
children: w.dialogDelete
|
|
74
|
-
})] })] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(
|
|
74
|
+
})] })] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(o, { children: /* @__PURE__ */ y(p, {
|
|
75
75
|
spacing: 2,
|
|
76
76
|
sx: { pt: .5 },
|
|
77
77
|
children: [
|
|
78
|
-
/* @__PURE__ */ v(
|
|
78
|
+
/* @__PURE__ */ v(m, {
|
|
79
79
|
label: w.dialogFieldTitle,
|
|
80
80
|
value: I.title,
|
|
81
81
|
onChange: (e) => W("title", e.target.value),
|
|
@@ -85,7 +85,7 @@ function S({ state: S, columns: C, t: w, showSubtasks: T, onSave: E, onDelete: D
|
|
|
85
85
|
autoFocus: !0,
|
|
86
86
|
onKeyDown: (e) => e.key === "Enter" && U()
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */ v(
|
|
88
|
+
/* @__PURE__ */ v(m, {
|
|
89
89
|
label: w.dialogFieldDescription,
|
|
90
90
|
value: I.description ?? "",
|
|
91
91
|
onChange: (e) => W("description", e.target.value || void 0),
|
|
@@ -94,14 +94,14 @@ function S({ state: S, columns: C, t: w, showSubtasks: T, onSave: E, onDelete: D
|
|
|
94
94
|
multiline: !0,
|
|
95
95
|
rows: 3
|
|
96
96
|
}),
|
|
97
|
-
/* @__PURE__ */ v(
|
|
97
|
+
/* @__PURE__ */ v(m, {
|
|
98
98
|
label: w.dialogFieldAssignee,
|
|
99
99
|
value: I.assignee ?? "",
|
|
100
100
|
onChange: (e) => W("assignee", e.target.value || void 0),
|
|
101
101
|
fullWidth: !0,
|
|
102
102
|
size: "small"
|
|
103
103
|
}),
|
|
104
|
-
/* @__PURE__ */ v(
|
|
104
|
+
/* @__PURE__ */ v(m, {
|
|
105
105
|
label: w.dialogFieldDueDate,
|
|
106
106
|
type: "date",
|
|
107
107
|
value: I.dueDate ? I.dueDate.toISOString().split("T")[0] : "",
|
|
@@ -110,20 +110,20 @@ function S({ state: S, columns: C, t: w, showSubtasks: T, onSave: E, onDelete: D
|
|
|
110
110
|
size: "small",
|
|
111
111
|
slotProps: { inputLabel: { shrink: !0 } }
|
|
112
112
|
}),
|
|
113
|
-
/* @__PURE__ */ v(
|
|
113
|
+
/* @__PURE__ */ v(m, {
|
|
114
114
|
select: !0,
|
|
115
115
|
label: w.dialogFieldStatus,
|
|
116
116
|
value: I.status,
|
|
117
117
|
onChange: (e) => W("status", e.target.value),
|
|
118
118
|
fullWidth: !0,
|
|
119
119
|
size: "small",
|
|
120
|
-
children: C.map((e) => /* @__PURE__ */ v(
|
|
120
|
+
children: C.map((e) => /* @__PURE__ */ v(f, {
|
|
121
121
|
value: e.id,
|
|
122
122
|
children: e.label
|
|
123
123
|
}, e.id))
|
|
124
124
|
}),
|
|
125
|
-
T && /* @__PURE__ */ y(
|
|
126
|
-
/* @__PURE__ */ v(
|
|
125
|
+
T && /* @__PURE__ */ y(t, { children: [
|
|
126
|
+
/* @__PURE__ */ v(h, {
|
|
127
127
|
variant: "caption",
|
|
128
128
|
color: "text.secondary",
|
|
129
129
|
sx: {
|
|
@@ -132,41 +132,41 @@ function S({ state: S, columns: C, t: w, showSubtasks: T, onSave: E, onDelete: D
|
|
|
132
132
|
},
|
|
133
133
|
children: w.dialogFieldSubtasks
|
|
134
134
|
}),
|
|
135
|
-
/* @__PURE__ */ v(
|
|
135
|
+
/* @__PURE__ */ v(p, {
|
|
136
136
|
spacing: .25,
|
|
137
|
-
children: (I.subtasks ?? []).map((
|
|
137
|
+
children: (I.subtasks ?? []).map((e) => /* @__PURE__ */ y(t, {
|
|
138
138
|
sx: {
|
|
139
139
|
display: "flex",
|
|
140
140
|
alignItems: "center"
|
|
141
141
|
},
|
|
142
|
-
children: [/* @__PURE__ */ v(
|
|
142
|
+
children: [/* @__PURE__ */ v(l, {
|
|
143
143
|
sx: {
|
|
144
144
|
flex: 1,
|
|
145
145
|
m: 0
|
|
146
146
|
},
|
|
147
|
-
control: /* @__PURE__ */ v(
|
|
147
|
+
control: /* @__PURE__ */ v(r, {
|
|
148
148
|
size: "small",
|
|
149
|
-
checked:
|
|
150
|
-
onChange: () => V(
|
|
149
|
+
checked: e.done,
|
|
150
|
+
onChange: () => V(e.id),
|
|
151
151
|
sx: { p: .5 }
|
|
152
152
|
}),
|
|
153
|
-
label: /* @__PURE__ */ v(
|
|
153
|
+
label: /* @__PURE__ */ v(h, {
|
|
154
154
|
variant: "body2",
|
|
155
155
|
sx: {
|
|
156
|
-
textDecoration:
|
|
157
|
-
color:
|
|
156
|
+
textDecoration: e.done ? "line-through" : "none",
|
|
157
|
+
color: e.done ? "text.disabled" : "text.primary"
|
|
158
158
|
},
|
|
159
|
-
children:
|
|
159
|
+
children: e.title
|
|
160
160
|
})
|
|
161
|
-
}), /* @__PURE__ */ v(
|
|
161
|
+
}), /* @__PURE__ */ v(u, {
|
|
162
162
|
size: "small",
|
|
163
|
-
onClick: () => H(
|
|
164
|
-
"aria-label": `Remove ${
|
|
163
|
+
onClick: () => H(e.id),
|
|
164
|
+
"aria-label": `Remove ${e.title}`,
|
|
165
165
|
children: /* @__PURE__ */ v(b, { fontSize: "small" })
|
|
166
166
|
})]
|
|
167
|
-
},
|
|
167
|
+
}, e.id))
|
|
168
168
|
}),
|
|
169
|
-
/* @__PURE__ */ v(
|
|
169
|
+
/* @__PURE__ */ v(m, {
|
|
170
170
|
size: "small",
|
|
171
171
|
placeholder: w.dialogSubtaskAdd,
|
|
172
172
|
value: R,
|
|
@@ -176,33 +176,33 @@ function S({ state: S, columns: C, t: w, showSubtasks: T, onSave: E, onDelete: D
|
|
|
176
176
|
},
|
|
177
177
|
fullWidth: !0,
|
|
178
178
|
sx: { mt: 1 },
|
|
179
|
-
slotProps: { input: { endAdornment: /* @__PURE__ */ v(
|
|
179
|
+
slotProps: { input: { endAdornment: /* @__PURE__ */ v(d, {
|
|
180
180
|
position: "end",
|
|
181
|
-
children: /* @__PURE__ */ v(
|
|
181
|
+
children: /* @__PURE__ */ v(u, {
|
|
182
182
|
size: "small",
|
|
183
183
|
onClick: B,
|
|
184
184
|
disabled: !R.trim(),
|
|
185
185
|
"aria-label": w.dialogSubtaskAdd,
|
|
186
|
-
children: /* @__PURE__ */ v(
|
|
186
|
+
children: /* @__PURE__ */ v(e, { fontSize: "small" })
|
|
187
187
|
})
|
|
188
188
|
}) } }
|
|
189
189
|
})
|
|
190
190
|
] })
|
|
191
191
|
]
|
|
192
|
-
}) }), /* @__PURE__ */ y(
|
|
192
|
+
}) }), /* @__PURE__ */ y(a, {
|
|
193
193
|
sx: { justifyContent: j ? "space-between" : "flex-end" },
|
|
194
|
-
children: [j && N && /* @__PURE__ */ v(
|
|
194
|
+
children: [j && N && /* @__PURE__ */ v(n, {
|
|
195
195
|
color: "error",
|
|
196
196
|
startIcon: /* @__PURE__ */ v(x, {}),
|
|
197
197
|
onClick: () => k(N),
|
|
198
198
|
children: w.dialogDelete
|
|
199
|
-
}), /* @__PURE__ */ y(
|
|
199
|
+
}), /* @__PURE__ */ y(p, {
|
|
200
200
|
direction: "row",
|
|
201
201
|
spacing: 1,
|
|
202
|
-
children: [/* @__PURE__ */ v(
|
|
202
|
+
children: [/* @__PURE__ */ v(n, {
|
|
203
203
|
onClick: O,
|
|
204
204
|
children: w.dialogCancel
|
|
205
|
-
}), /* @__PURE__ */ v(
|
|
205
|
+
}), /* @__PURE__ */ v(n, {
|
|
206
206
|
variant: "contained",
|
|
207
207
|
onClick: U,
|
|
208
208
|
disabled: !I.title.trim(),
|
|
@@ -12,8 +12,11 @@ type KanbanBoardColumnProps = {
|
|
|
12
12
|
chipVariant: "outlined" | "filled";
|
|
13
13
|
t: Required<KanbanBoardTranslation>;
|
|
14
14
|
enableBuiltinDialogs: boolean;
|
|
15
|
+
enableColumnManagement: boolean;
|
|
15
16
|
onCardClick: (task: KanbanTask) => void;
|
|
16
17
|
onAddClick: (columnId: string) => void;
|
|
18
|
+
onColumnRename: (columnId: string, newLabel: string) => void;
|
|
19
|
+
onColumnDeleteRequest: (columnId: string) => void;
|
|
17
20
|
};
|
|
18
|
-
export declare function KanbanBoardColumn({ column, tasks, totalCount, showPriority, showAssignee, showDueDate, showDueDateWarning, showSubtasks, chipVariant, t, enableBuiltinDialogs, onCardClick, onAddClick, }: KanbanBoardColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function KanbanBoardColumn({ column, tasks, totalCount, showPriority, showAssignee, showDueDate, showDueDateWarning, showSubtasks, chipVariant, t, enableBuiltinDialogs, enableColumnManagement, onCardClick, onAddClick, onColumnRename, onColumnDeleteRequest, }: KanbanBoardColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
export {};
|
|
@@ -2,13 +2,24 @@ import { kanbanBoardClasses as e } from "./kanbanBoardClasses.js";
|
|
|
2
2
|
import { KanbanBoardCard as t } from "./KanbanBoardCard.js";
|
|
3
3
|
import { useDroppable as n } from "@dnd-kit/core";
|
|
4
4
|
import { SortableContext as r, verticalListSortingStrategy as i } from "@dnd-kit/sortable";
|
|
5
|
-
import
|
|
6
|
-
import l from "@mui/
|
|
7
|
-
import {
|
|
5
|
+
import a from "@mui/icons-material/Add";
|
|
6
|
+
import { Box as o, Button as s, Chip as c, IconButton as l, TextField as u, Tooltip as d, Typography as f } from "@mui/material";
|
|
7
|
+
import { useState as p } from "react";
|
|
8
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
+
import g from "@mui/icons-material/DeleteOutlined";
|
|
10
|
+
import _ from "@mui/icons-material/EditOutlined";
|
|
8
11
|
//#region src/components/kanban-board/KanbanBoardColumn.tsx
|
|
9
|
-
function
|
|
10
|
-
let { setNodeRef:
|
|
11
|
-
|
|
12
|
+
function v({ column: v, tasks: y, totalCount: b, showPriority: x, showAssignee: S, showDueDate: C, showDueDateWarning: w, showSubtasks: T, chipVariant: E, t: D, enableBuiltinDialogs: O, enableColumnManagement: k, onCardClick: A, onAddClick: j, onColumnRename: M, onColumnDeleteRequest: N }) {
|
|
13
|
+
let { setNodeRef: P, isOver: F } = n({ id: v.id }), [I, L] = p(!1), [R, z] = p(v.label);
|
|
14
|
+
function B() {
|
|
15
|
+
let e = R.trim();
|
|
16
|
+
e && e !== v.label ? M(v.id, e) : z(v.label), L(!1);
|
|
17
|
+
}
|
|
18
|
+
function V() {
|
|
19
|
+
z(v.label), L(!0);
|
|
20
|
+
}
|
|
21
|
+
let H = v.wipLimit !== void 0 && b > v.wipLimit, U = v.wipLimit === void 0 ? `${y.length}` : `${y.length} / ${v.wipLimit}`, W = v.color ?? "primary.main";
|
|
22
|
+
return /* @__PURE__ */ h(o, {
|
|
12
23
|
className: e.column,
|
|
13
24
|
sx: {
|
|
14
25
|
display: "flex",
|
|
@@ -23,7 +34,7 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
|
|
|
23
34
|
borderColor: "divider"
|
|
24
35
|
},
|
|
25
36
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ h(o, {
|
|
27
38
|
className: e.columnHeader,
|
|
28
39
|
sx: {
|
|
29
40
|
px: 2,
|
|
@@ -33,38 +44,86 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
|
|
|
33
44
|
gap: 1,
|
|
34
45
|
borderBottom: "1px solid",
|
|
35
46
|
borderColor: "divider",
|
|
36
|
-
borderTop: `3px solid ${
|
|
47
|
+
borderTop: `3px solid ${v.color ?? "transparent"}`,
|
|
37
48
|
bgcolor: (e) => e.palette.mode === "dark" ? "grey.800" : "grey.300"
|
|
38
49
|
},
|
|
39
|
-
children: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
children: [
|
|
51
|
+
I ? /* @__PURE__ */ m(u, {
|
|
52
|
+
autoFocus: !0,
|
|
53
|
+
size: "small",
|
|
54
|
+
value: R,
|
|
55
|
+
onChange: (e) => z(e.target.value),
|
|
56
|
+
onBlur: B,
|
|
57
|
+
onKeyDown: (e) => {
|
|
58
|
+
e.key === "Enter" && (e.preventDefault(), B()), e.key === "Escape" && (z(v.label), L(!1));
|
|
59
|
+
},
|
|
60
|
+
sx: {
|
|
61
|
+
flex: 1,
|
|
62
|
+
"& .MuiInputBase-input": {
|
|
63
|
+
fontWeight: 700,
|
|
64
|
+
fontSize: "0.875rem",
|
|
65
|
+
py: .5
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
slotProps: { htmlInput: { "aria-label": D.columnRenameTooltip } }
|
|
69
|
+
}) : /* @__PURE__ */ m(f, {
|
|
70
|
+
className: e.columnTitle,
|
|
71
|
+
variant: "subtitle2",
|
|
72
|
+
sx: {
|
|
73
|
+
flex: 1,
|
|
74
|
+
fontWeight: 700
|
|
75
|
+
},
|
|
76
|
+
children: v.label
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ m(c, {
|
|
79
|
+
className: e.columnCount,
|
|
80
|
+
label: U,
|
|
81
|
+
size: "small",
|
|
82
|
+
color: H ? "error" : "default",
|
|
83
|
+
sx: {
|
|
84
|
+
height: 20,
|
|
85
|
+
fontSize: "0.7rem",
|
|
86
|
+
...!H && v.color && {
|
|
87
|
+
bgcolor: v.color,
|
|
88
|
+
color: "#fff"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"aria-label": `${y.length} cards${v.wipLimit ? ` of ${v.wipLimit} limit` : ""}${y.length === b ? "" : ` (${b} total)`}`
|
|
92
|
+
}),
|
|
93
|
+
k && !I && /* @__PURE__ */ h(o, {
|
|
94
|
+
className: e.columnActions,
|
|
95
|
+
sx: {
|
|
96
|
+
display: "flex",
|
|
97
|
+
gap: .25
|
|
98
|
+
},
|
|
99
|
+
children: [/* @__PURE__ */ m(d, {
|
|
100
|
+
title: D.columnRenameTooltip,
|
|
101
|
+
children: /* @__PURE__ */ m(l, {
|
|
102
|
+
size: "small",
|
|
103
|
+
onClick: V,
|
|
104
|
+
sx: { p: .25 },
|
|
105
|
+
children: /* @__PURE__ */ m(_, { sx: { fontSize: 18 } })
|
|
106
|
+
})
|
|
107
|
+
}), /* @__PURE__ */ m(d, {
|
|
108
|
+
title: D.columnDeleteTooltip,
|
|
109
|
+
children: /* @__PURE__ */ m(l, {
|
|
110
|
+
size: "small",
|
|
111
|
+
onClick: () => N(v.id),
|
|
112
|
+
sx: {
|
|
113
|
+
p: .25,
|
|
114
|
+
color: "error.main"
|
|
115
|
+
},
|
|
116
|
+
children: /* @__PURE__ */ m(g, { sx: { fontSize: 18 } })
|
|
117
|
+
})
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
]
|
|
62
121
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
items:
|
|
122
|
+
/* @__PURE__ */ m(r, {
|
|
123
|
+
items: y.map((e) => e.id),
|
|
65
124
|
strategy: i,
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
ref:
|
|
125
|
+
children: /* @__PURE__ */ h(o, {
|
|
126
|
+
ref: P,
|
|
68
127
|
className: e.columnBody,
|
|
69
128
|
sx: {
|
|
70
129
|
flex: 1,
|
|
@@ -73,10 +132,10 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
|
|
|
73
132
|
"&::-webkit-scrollbar": { display: "none" },
|
|
74
133
|
p: 1,
|
|
75
134
|
minHeight: 80,
|
|
76
|
-
bgcolor: (e) =>
|
|
135
|
+
bgcolor: (e) => F ? e.palette.action.selected : e.palette.mode === "dark" ? e.palette.grey[900] : e.palette.grey[100],
|
|
77
136
|
transition: "background-color 0.15s"
|
|
78
137
|
},
|
|
79
|
-
children: [
|
|
138
|
+
children: [y.length === 0 && !F && /* @__PURE__ */ m(f, {
|
|
80
139
|
variant: "caption",
|
|
81
140
|
color: "text.disabled",
|
|
82
141
|
sx: {
|
|
@@ -84,38 +143,38 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
|
|
|
84
143
|
textAlign: "center",
|
|
85
144
|
mt: 2
|
|
86
145
|
},
|
|
87
|
-
children:
|
|
88
|
-
}),
|
|
146
|
+
children: D.noCardsLabel
|
|
147
|
+
}), y.map((e) => /* @__PURE__ */ m(t, {
|
|
89
148
|
task: e,
|
|
90
|
-
showPriority:
|
|
91
|
-
showAssignee:
|
|
92
|
-
showDueDate:
|
|
93
|
-
showDueDateWarning:
|
|
94
|
-
showSubtasks:
|
|
95
|
-
enableBuiltinDialogs:
|
|
96
|
-
chipVariant:
|
|
97
|
-
t:
|
|
98
|
-
onCardClick:
|
|
149
|
+
showPriority: x,
|
|
150
|
+
showAssignee: S,
|
|
151
|
+
showDueDate: C,
|
|
152
|
+
showDueDateWarning: w,
|
|
153
|
+
showSubtasks: T,
|
|
154
|
+
enableBuiltinDialogs: O,
|
|
155
|
+
chipVariant: E,
|
|
156
|
+
t: D,
|
|
157
|
+
onCardClick: A
|
|
99
158
|
}, e.id))]
|
|
100
159
|
})
|
|
101
160
|
}),
|
|
102
|
-
|
|
161
|
+
O && /* @__PURE__ */ m(o, {
|
|
103
162
|
sx: {
|
|
104
163
|
p: 1,
|
|
105
164
|
borderTop: "1px solid",
|
|
106
165
|
borderColor: "divider"
|
|
107
166
|
},
|
|
108
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ m(s, {
|
|
109
168
|
className: e.addButton,
|
|
110
|
-
startIcon: /* @__PURE__ */
|
|
169
|
+
startIcon: /* @__PURE__ */ m(a, {}),
|
|
111
170
|
size: "small",
|
|
112
171
|
fullWidth: !0,
|
|
113
|
-
onClick: () =>
|
|
172
|
+
onClick: () => j(v.id),
|
|
114
173
|
sx: {
|
|
115
174
|
justifyContent: "flex-start",
|
|
116
|
-
color:
|
|
175
|
+
color: W,
|
|
117
176
|
border: "1px dashed",
|
|
118
|
-
borderColor:
|
|
177
|
+
borderColor: W,
|
|
119
178
|
borderRadius: 1,
|
|
120
179
|
py: .75,
|
|
121
180
|
fontWeight: 600,
|
|
@@ -125,11 +184,11 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
|
|
|
125
184
|
borderStyle: "dashed"
|
|
126
185
|
}
|
|
127
186
|
},
|
|
128
|
-
children:
|
|
187
|
+
children: D.addCardLabel
|
|
129
188
|
})
|
|
130
189
|
})
|
|
131
190
|
]
|
|
132
191
|
});
|
|
133
192
|
}
|
|
134
193
|
//#endregion
|
|
135
|
-
export {
|
|
194
|
+
export { v as KanbanBoardColumn };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KanbanBoardTranslation, KanbanColumn } from "./KanbanBoard.types";
|
|
2
|
+
export type KanbanColumnDialogState = {
|
|
3
|
+
mode: "add";
|
|
4
|
+
} | {
|
|
5
|
+
mode: "delete";
|
|
6
|
+
column: KanbanColumn;
|
|
7
|
+
cardCount: number;
|
|
8
|
+
};
|
|
9
|
+
type Props = {
|
|
10
|
+
state: KanbanColumnDialogState | null;
|
|
11
|
+
t: Required<KanbanBoardTranslation>;
|
|
12
|
+
onAdd: (column: KanbanColumn) => void;
|
|
13
|
+
onDelete: (columnId: string) => void;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function KanbanBoardColumnDialog({ state, t, onAdd, onDelete, onClose }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Box as e, Button as t, Dialog as n, DialogActions as r, DialogContent as i, DialogTitle as a, TextField as o, Typography as s } from "@mui/material";
|
|
2
|
+
import { useState as c } from "react";
|
|
3
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/kanban-board/KanbanBoardColumnDialog.tsx
|
|
5
|
+
function d({ state: d, t: f, onAdd: p, onDelete: m, onClose: h }) {
|
|
6
|
+
let [g, _] = c("");
|
|
7
|
+
if (!d) return null;
|
|
8
|
+
function v() {
|
|
9
|
+
let e = g.trim();
|
|
10
|
+
e && (p({
|
|
11
|
+
id: crypto.randomUUID(),
|
|
12
|
+
label: e
|
|
13
|
+
}), _(""));
|
|
14
|
+
}
|
|
15
|
+
if (d.mode === "add") return /* @__PURE__ */ u(n, {
|
|
16
|
+
open: !0,
|
|
17
|
+
onClose: h,
|
|
18
|
+
maxWidth: "xs",
|
|
19
|
+
fullWidth: !0,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ l(a, { children: f.columnAddLabel }),
|
|
22
|
+
/* @__PURE__ */ l(i, { children: /* @__PURE__ */ l(o, {
|
|
23
|
+
autoFocus: !0,
|
|
24
|
+
fullWidth: !0,
|
|
25
|
+
size: "small",
|
|
26
|
+
placeholder: f.columnAddPlaceholder,
|
|
27
|
+
value: g,
|
|
28
|
+
onChange: (e) => _(e.target.value),
|
|
29
|
+
onKeyDown: (e) => {
|
|
30
|
+
e.key === "Enter" && v(), e.key === "Escape" && h();
|
|
31
|
+
},
|
|
32
|
+
sx: { mt: 1 }
|
|
33
|
+
}) }),
|
|
34
|
+
/* @__PURE__ */ u(r, { children: [/* @__PURE__ */ l(t, {
|
|
35
|
+
onClick: h,
|
|
36
|
+
children: f.dialogCancel
|
|
37
|
+
}), /* @__PURE__ */ l(t, {
|
|
38
|
+
variant: "contained",
|
|
39
|
+
onClick: v,
|
|
40
|
+
disabled: !g.trim(),
|
|
41
|
+
children: f.dialogSave
|
|
42
|
+
})] })
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
let y = f.columnDeleteConfirm.replace("{label}", d.column.label), b = d.cardCount > 0;
|
|
46
|
+
return /* @__PURE__ */ u(n, {
|
|
47
|
+
open: !0,
|
|
48
|
+
onClose: h,
|
|
49
|
+
maxWidth: "xs",
|
|
50
|
+
fullWidth: !0,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ l(a, { children: y }),
|
|
53
|
+
b && /* @__PURE__ */ l(i, { children: /* @__PURE__ */ l(e, {
|
|
54
|
+
sx: {
|
|
55
|
+
display: "flex",
|
|
56
|
+
flexDirection: "column",
|
|
57
|
+
gap: 1
|
|
58
|
+
},
|
|
59
|
+
children: /* @__PURE__ */ l(s, {
|
|
60
|
+
variant: "body2",
|
|
61
|
+
color: "text.secondary",
|
|
62
|
+
children: f.columnDeleteCardsWarning.replace("{count}", String(d.cardCount))
|
|
63
|
+
})
|
|
64
|
+
}) }),
|
|
65
|
+
/* @__PURE__ */ u(r, { children: [/* @__PURE__ */ l(t, {
|
|
66
|
+
onClick: h,
|
|
67
|
+
children: f.dialogCancel
|
|
68
|
+
}), /* @__PURE__ */ l(t, {
|
|
69
|
+
color: "error",
|
|
70
|
+
variant: "contained",
|
|
71
|
+
onClick: () => m(d.column.id),
|
|
72
|
+
children: f.dialogDelete
|
|
73
|
+
})] })
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { d as KanbanBoardColumnDialog };
|
|
@@ -54,4 +54,8 @@ export declare const kanbanBoardClasses: {
|
|
|
54
54
|
readonly cardSubtasks: "MuiTsKanbanBoard-cardSubtasks";
|
|
55
55
|
/** The LinearProgress bar inside the subtask row. */
|
|
56
56
|
readonly cardSubtasksBar: "MuiTsKanbanBoard-cardSubtasksBar";
|
|
57
|
+
/** The edit / delete icon row that appears on column header hover (`enableColumnManagement`). */
|
|
58
|
+
readonly columnActions: "MuiTsKanbanBoard-columnActions";
|
|
59
|
+
/** The "Add column" ghost button at the end of the columns row (`enableColumnManagement`). */
|
|
60
|
+
readonly columnAddButton: "MuiTsKanbanBoard-columnAddButton";
|
|
57
61
|
};
|
|
@@ -17,7 +17,9 @@ var e = {
|
|
|
17
17
|
searchFieldWrapper: "MuiTsKanbanBoard-searchFieldWrapper",
|
|
18
18
|
searchField: "MuiTsKanbanBoard-searchField",
|
|
19
19
|
cardSubtasks: "MuiTsKanbanBoard-cardSubtasks",
|
|
20
|
-
cardSubtasksBar: "MuiTsKanbanBoard-cardSubtasksBar"
|
|
20
|
+
cardSubtasksBar: "MuiTsKanbanBoard-cardSubtasksBar",
|
|
21
|
+
columnActions: "MuiTsKanbanBoard-columnActions",
|
|
22
|
+
columnAddButton: "MuiTsKanbanBoard-columnAddButton"
|
|
21
23
|
};
|
|
22
24
|
//#endregion
|
|
23
25
|
export { e as kanbanBoardClasses };
|