@thebuoyant-tsdev/mui-ts-library 3.34.0 → 3.35.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 +12 -2
- package/README.md +12 -2
- package/dist/components/gantt-chart/GanttTaskPanel.js +52 -52
- package/dist/components/kanban-board/KanbanBoard.d.ts +1 -1
- package/dist/components/kanban-board/KanbanBoard.js +71 -67
- package/dist/components/kanban-board/KanbanBoard.types.d.ts +18 -0
- package/dist/components/kanban-board/KanbanBoard.types.js +4 -1
- package/dist/components/kanban-board/KanbanBoardCard.d.ts +3 -1
- package/dist/components/kanban-board/KanbanBoardCard.js +151 -91
- package/dist/components/kanban-board/KanbanBoardCardDialog.d.ts +2 -1
- package/dist/components/kanban-board/KanbanBoardCardDialog.js +162 -66
- package/dist/components/kanban-board/KanbanBoardColumn.d.ts +2 -1
- package/dist/components/kanban-board/KanbanBoardColumn.js +30 -28
- 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/components/tag-selection/TagSelectionAutocomplete.js +4 -4
- package/dist/index.cjs +2 -2
- package/package.json +5 -2
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export type KanbanTaskPriority = "low" | "medium" | "high" | "critical";
|
|
2
|
+
export type KanbanSubtask = {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
done: boolean;
|
|
6
|
+
};
|
|
2
7
|
export type KanbanTask = {
|
|
3
8
|
id: string;
|
|
4
9
|
title: string;
|
|
@@ -11,6 +16,8 @@ export type KanbanTask = {
|
|
|
11
16
|
dueDate?: Date;
|
|
12
17
|
/** Optional priority level — shown as a colored dot next to the card title when `showPriority` is true. */
|
|
13
18
|
priority?: KanbanTaskPriority;
|
|
19
|
+
/** Optional checklist items — shown as a progress bar on the card and a checklist in the edit dialog. */
|
|
20
|
+
subtasks?: KanbanSubtask[];
|
|
14
21
|
};
|
|
15
22
|
export type KanbanColumn = {
|
|
16
23
|
/** Used as the key — must match `KanbanTask.status` values. */
|
|
@@ -39,6 +46,12 @@ export type KanbanBoardTranslation = {
|
|
|
39
46
|
noCardsLabel: string;
|
|
40
47
|
/** Placeholder text for the built-in search field (`showSearchField={true}`). */
|
|
41
48
|
searchFieldPlaceholder: string;
|
|
49
|
+
/** Section label for the subtask checklist in the edit/add dialog. */
|
|
50
|
+
dialogFieldSubtasks: string;
|
|
51
|
+
/** Placeholder for the "add subtask" input in the dialog. */
|
|
52
|
+
dialogSubtaskAdd: string;
|
|
53
|
+
/** Tooltip for the "+" button on the card's subtask progress bar. */
|
|
54
|
+
cardSubtaskAdd: string;
|
|
42
55
|
};
|
|
43
56
|
export declare const DEFAULT_KANBAN_BOARD_TRANSLATION: Required<KanbanBoardTranslation>;
|
|
44
57
|
export type KanbanBoardProps = {
|
|
@@ -94,6 +107,11 @@ export type KanbanBoardProps = {
|
|
|
94
107
|
* `"filled"` — solid background, more prominent.
|
|
95
108
|
*/
|
|
96
109
|
chipVariant?: "outlined" | "filled";
|
|
110
|
+
/**
|
|
111
|
+
* Show the subtask progress bar on cards and the subtask checklist in the edit/add dialog (default: true).
|
|
112
|
+
* Has no visual effect when a card has no `subtasks` field set.
|
|
113
|
+
*/
|
|
114
|
+
showSubtasks?: boolean;
|
|
97
115
|
/**
|
|
98
116
|
* When `true`, renders a built-in `size="small"` search field above the board columns.
|
|
99
117
|
* The board manages the search state internally — no extra wiring needed.
|
|
@@ -14,7 +14,10 @@ var e = {
|
|
|
14
14
|
dialogFieldDueDate: "Due date",
|
|
15
15
|
dialogFieldStatus: "Status",
|
|
16
16
|
noCardsLabel: "No cards",
|
|
17
|
-
searchFieldPlaceholder: "Search by title or assignee…"
|
|
17
|
+
searchFieldPlaceholder: "Search by title or assignee…",
|
|
18
|
+
dialogFieldSubtasks: "Subtasks",
|
|
19
|
+
dialogSubtaskAdd: "Add subtask",
|
|
20
|
+
cardSubtaskAdd: "Add subtask"
|
|
18
21
|
};
|
|
19
22
|
//#endregion
|
|
20
23
|
export { e as DEFAULT_KANBAN_BOARD_TRANSLATION };
|
|
@@ -5,11 +5,13 @@ type KanbanBoardCardProps = {
|
|
|
5
5
|
showAssignee: boolean;
|
|
6
6
|
showDueDate: boolean;
|
|
7
7
|
showDueDateWarning: boolean;
|
|
8
|
+
showSubtasks: boolean;
|
|
9
|
+
enableBuiltinDialogs: boolean;
|
|
8
10
|
chipVariant: "outlined" | "filled";
|
|
9
11
|
t: Required<KanbanBoardTranslation>;
|
|
10
12
|
onCardClick: (task: KanbanTask) => void;
|
|
11
13
|
/** True when this card is the drag overlay ghost — rendered without transform/listeners. */
|
|
12
14
|
isOverlay?: boolean;
|
|
13
15
|
};
|
|
14
|
-
export declare function KanbanBoardCard({ task, showPriority, showAssignee, showDueDate, showDueDateWarning, chipVariant, t, onCardClick, isOverlay, }: KanbanBoardCardProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function KanbanBoardCard({ task, showPriority, showAssignee, showDueDate, showDueDateWarning, showSubtasks, enableBuiltinDialogs, chipVariant, t, onCardClick, isOverlay, }: KanbanBoardCardProps): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { muiTsStateClasses as e } from "../../utils/muiTsClasses.js";
|
|
2
2
|
import { kanbanBoardClasses as t } from "./kanbanBoardClasses.js";
|
|
3
3
|
import { useSortable as n } from "@dnd-kit/sortable";
|
|
4
|
-
import { Box as r, Card as i, CardActionArea as a, CardContent as o, Chip as s,
|
|
5
|
-
import { CSS as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
4
|
+
import { Box as r, Card as i, CardActionArea as a, CardContent as o, Chip as s, IconButton as c, LinearProgress as l, Tooltip as u, Typography as d } from "@mui/material";
|
|
5
|
+
import { CSS as f } from "@dnd-kit/utilities";
|
|
6
|
+
import p from "@mui/icons-material/Add";
|
|
7
|
+
import m from "@mui/icons-material/CalendarToday";
|
|
8
|
+
import h from "@mui/icons-material/Person";
|
|
9
|
+
import { alpha as g } from "@mui/material/styles";
|
|
10
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/kanban-board/KanbanBoardCard.tsx
|
|
11
|
-
var
|
|
12
|
+
var y = {
|
|
12
13
|
low: "#4caf50",
|
|
13
14
|
medium: "#ff9800",
|
|
14
15
|
high: "#f44336",
|
|
15
16
|
critical: "#9c27b0"
|
|
16
|
-
},
|
|
17
|
+
}, b = {
|
|
17
18
|
fontSize: "0.7rem",
|
|
18
19
|
height: 22,
|
|
19
20
|
"& .MuiChip-icon": {
|
|
@@ -28,116 +29,175 @@ var h = {
|
|
|
28
29
|
pr: "10px"
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
|
-
function
|
|
32
|
-
let { attributes:
|
|
33
|
-
id:
|
|
34
|
-
disabled:
|
|
35
|
-
}),
|
|
36
|
-
transform:
|
|
37
|
-
transition:
|
|
38
|
-
opacity: +!
|
|
39
|
-
},
|
|
32
|
+
function x({ task: x, showPriority: S, showAssignee: C, showDueDate: w, showDueDateWarning: T, showSubtasks: E, enableBuiltinDialogs: D, chipVariant: O, t: k, onCardClick: A, isOverlay: j = !1 }) {
|
|
33
|
+
let { attributes: M, listeners: N, setNodeRef: P, transform: F, transition: I, isDragging: L } = n({
|
|
34
|
+
id: x.id,
|
|
35
|
+
disabled: j
|
|
36
|
+
}), R = j ? void 0 : {
|
|
37
|
+
transform: f.Transform.toString(F),
|
|
38
|
+
transition: I,
|
|
39
|
+
opacity: +!L
|
|
40
|
+
}, z = C && !!x.assignee || w && !!x.dueDate, B = E && !!x.subtasks?.length, V = x.subtasks?.length ?? 0, H = x.subtasks?.filter((e) => e.done).length ?? 0, U = x.dueDate ? x.dueDate.toLocaleDateString(void 0, {
|
|
40
41
|
day: "2-digit",
|
|
41
42
|
month: "short",
|
|
42
43
|
year: "numeric"
|
|
43
|
-
}) : null,
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
ref:
|
|
48
|
-
style:
|
|
44
|
+
}) : null, W = /* @__PURE__ */ new Date();
|
|
45
|
+
W.setHours(0, 0, 0, 0);
|
|
46
|
+
let G = T && !!x.dueDate && x.dueDate < W;
|
|
47
|
+
return /* @__PURE__ */ _(i, {
|
|
48
|
+
ref: j ? void 0 : P,
|
|
49
|
+
style: R,
|
|
49
50
|
elevation: 0,
|
|
50
|
-
className: [t.card,
|
|
51
|
+
className: [t.card, L && e.selected].filter(Boolean).join(" "),
|
|
51
52
|
sx: {
|
|
52
53
|
mb: 1,
|
|
53
54
|
border: "1px solid",
|
|
54
|
-
borderColor:
|
|
55
|
-
borderLeft:
|
|
55
|
+
borderColor: G && !x.color ? "error.light" : "divider",
|
|
56
|
+
borderLeft: x.color ? `4px solid ${x.color}` : G ? (e) => `4px solid ${e.palette.error.main}` : void 0,
|
|
56
57
|
userSelect: "none",
|
|
57
|
-
cursor:
|
|
58
|
-
bgcolor: (e) =>
|
|
58
|
+
cursor: j ? "grabbing" : "grab",
|
|
59
|
+
bgcolor: (e) => G ? e.palette.mode === "dark" ? g(e.palette.error.main, .12) : g(e.palette.error.main, .04) : e.palette.mode === "dark" ? e.palette.grey[800] : e.palette.background.paper,
|
|
59
60
|
boxShadow: (e) => e.palette.mode === "dark" ? "0 1px 3px rgba(0,0,0,0.4)" : "0 1px 3px rgba(0,0,0,0.08)",
|
|
60
61
|
transition: "box-shadow 0.15s ease, transform 0.15s ease",
|
|
61
|
-
...!
|
|
62
|
+
...!L && !j && { "&:hover": {
|
|
62
63
|
boxShadow: (e) => e.palette.mode === "dark" ? "0 4px 14px rgba(0,0,0,0.5)" : "0 4px 14px rgba(0,0,0,0.12)",
|
|
63
64
|
transform: "translateY(-1px)"
|
|
64
65
|
} },
|
|
65
66
|
"&:active": { cursor: "grabbing" }
|
|
66
67
|
},
|
|
67
|
-
...
|
|
68
|
-
...
|
|
69
|
-
...
|
|
68
|
+
...j ? {} : {
|
|
69
|
+
...M,
|
|
70
|
+
...N
|
|
70
71
|
},
|
|
71
|
-
onClick: () => !
|
|
72
|
-
"aria-label":
|
|
73
|
-
children: /* @__PURE__ */
|
|
72
|
+
onClick: () => !L && A(x),
|
|
73
|
+
"aria-label": x.title,
|
|
74
|
+
children: /* @__PURE__ */ _(a, {
|
|
74
75
|
component: "div",
|
|
75
76
|
sx: { cursor: "inherit" },
|
|
76
|
-
children: /* @__PURE__ */
|
|
77
|
+
children: /* @__PURE__ */ v(o, {
|
|
77
78
|
sx: {
|
|
78
79
|
p: 1.5,
|
|
79
80
|
"&:last-child": { pb: 1.5 }
|
|
80
81
|
},
|
|
81
|
-
children: [
|
|
82
|
-
|
|
83
|
-
display: "flex",
|
|
84
|
-
alignItems: "flex-start",
|
|
85
|
-
gap: .75,
|
|
86
|
-
mb: +!!N
|
|
87
|
-
},
|
|
88
|
-
children: [v && _.priority && /* @__PURE__ */ p(r, {
|
|
89
|
-
className: t.cardPriorityDot,
|
|
90
|
-
role: "img",
|
|
91
|
-
"aria-label": `Priority: ${_.priority}`,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ v(r, {
|
|
92
84
|
sx: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
85
|
+
display: "flex",
|
|
86
|
+
alignItems: "flex-start",
|
|
87
|
+
gap: .75,
|
|
88
|
+
mb: z || B ? 1 : 0
|
|
89
|
+
},
|
|
90
|
+
children: [S && x.priority && /* @__PURE__ */ _(r, {
|
|
91
|
+
className: t.cardPriorityDot,
|
|
92
|
+
role: "img",
|
|
93
|
+
"aria-label": `Priority: ${x.priority}`,
|
|
94
|
+
sx: {
|
|
95
|
+
width: 8,
|
|
96
|
+
height: 8,
|
|
97
|
+
minWidth: 8,
|
|
98
|
+
borderRadius: "50%",
|
|
99
|
+
bgcolor: y[x.priority],
|
|
100
|
+
mt: "5px",
|
|
101
|
+
flexShrink: 0
|
|
102
|
+
}
|
|
103
|
+
}), /* @__PURE__ */ _(d, {
|
|
104
|
+
className: t.cardTitle,
|
|
105
|
+
variant: "body2",
|
|
106
|
+
sx: {
|
|
107
|
+
lineHeight: 1.4,
|
|
108
|
+
fontWeight: 700,
|
|
109
|
+
letterSpacing: "-0.01em"
|
|
110
|
+
},
|
|
111
|
+
children: x.title
|
|
112
|
+
})]
|
|
113
|
+
}),
|
|
114
|
+
z && /* @__PURE__ */ v(r, {
|
|
115
|
+
className: t.cardMeta,
|
|
116
|
+
sx: {
|
|
117
|
+
display: "flex",
|
|
118
|
+
gap: 1,
|
|
119
|
+
flexWrap: "wrap",
|
|
120
|
+
alignItems: "center"
|
|
121
|
+
},
|
|
122
|
+
children: [C && x.assignee && /* @__PURE__ */ _(s, {
|
|
123
|
+
className: t.cardAssignee,
|
|
124
|
+
icon: /* @__PURE__ */ _(h, {}),
|
|
125
|
+
label: x.assignee,
|
|
126
|
+
size: "small",
|
|
127
|
+
variant: O,
|
|
128
|
+
"aria-label": `${k.dialogFieldAssignee}: ${x.assignee}`,
|
|
129
|
+
sx: b
|
|
130
|
+
}), w && U && /* @__PURE__ */ _(s, {
|
|
131
|
+
className: t.cardDueDate,
|
|
132
|
+
icon: /* @__PURE__ */ _(m, {}),
|
|
133
|
+
label: U,
|
|
134
|
+
size: "small",
|
|
135
|
+
variant: O,
|
|
136
|
+
color: G ? "error" : "default",
|
|
137
|
+
"aria-label": `${k.dialogFieldDueDate}: ${U}`,
|
|
138
|
+
sx: b
|
|
139
|
+
})]
|
|
140
|
+
}),
|
|
141
|
+
B && /* @__PURE__ */ v(r, {
|
|
142
|
+
className: t.cardSubtasks,
|
|
104
143
|
sx: {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
144
|
+
display: "flex",
|
|
145
|
+
alignItems: "center",
|
|
146
|
+
gap: 1,
|
|
147
|
+
mt: z ? .75 : 0
|
|
108
148
|
},
|
|
109
|
-
children:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ _(l, {
|
|
151
|
+
className: t.cardSubtasksBar,
|
|
152
|
+
variant: "determinate",
|
|
153
|
+
value: H / V * 100,
|
|
154
|
+
sx: {
|
|
155
|
+
flex: 1,
|
|
156
|
+
height: 4,
|
|
157
|
+
borderRadius: 2
|
|
158
|
+
},
|
|
159
|
+
"aria-label": `${H} of ${V} subtasks done`
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ v(d, {
|
|
162
|
+
variant: "caption",
|
|
163
|
+
sx: {
|
|
164
|
+
whiteSpace: "nowrap",
|
|
165
|
+
color: "text.secondary",
|
|
166
|
+
fontSize: "0.65rem",
|
|
167
|
+
lineHeight: 1
|
|
168
|
+
},
|
|
169
|
+
children: [
|
|
170
|
+
H,
|
|
171
|
+
" / ",
|
|
172
|
+
V,
|
|
173
|
+
" ✓"
|
|
174
|
+
]
|
|
175
|
+
}),
|
|
176
|
+
D && !j && /* @__PURE__ */ _(u, {
|
|
177
|
+
title: k.cardSubtaskAdd,
|
|
178
|
+
placement: "top",
|
|
179
|
+
arrow: !0,
|
|
180
|
+
children: /* @__PURE__ */ _(c, {
|
|
181
|
+
size: "small",
|
|
182
|
+
"aria-label": k.cardSubtaskAdd,
|
|
183
|
+
onClick: (e) => {
|
|
184
|
+
e.stopPropagation(), A(x);
|
|
185
|
+
},
|
|
186
|
+
sx: {
|
|
187
|
+
p: .25,
|
|
188
|
+
opacity: 0,
|
|
189
|
+
transition: "opacity 0.15s",
|
|
190
|
+
[`.${t.card}:hover &`]: { opacity: 1 }
|
|
191
|
+
},
|
|
192
|
+
children: /* @__PURE__ */ _(p, { sx: { fontSize: "0.85rem" } })
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
})
|
|
197
|
+
]
|
|
138
198
|
})
|
|
139
199
|
})
|
|
140
200
|
});
|
|
141
201
|
}
|
|
142
202
|
//#endregion
|
|
143
|
-
export {
|
|
203
|
+
export { x as KanbanBoardCard };
|
|
@@ -13,11 +13,12 @@ type KanbanBoardCardDialogProps = {
|
|
|
13
13
|
state: KanbanDialogState | null;
|
|
14
14
|
columns: KanbanColumn[];
|
|
15
15
|
t: Required<KanbanBoardTranslation>;
|
|
16
|
+
showSubtasks: boolean;
|
|
16
17
|
onSave: (task: KanbanTask) => void;
|
|
17
18
|
onDelete: (taskId: string) => void;
|
|
18
19
|
onClose: () => void;
|
|
19
20
|
/** Switch from edit to delete confirmation — handled in parent. */
|
|
20
21
|
onRequestDelete: (task: KanbanTask) => void;
|
|
21
22
|
};
|
|
22
|
-
export declare function KanbanBoardCardDialog({ state, columns, t, onSave, onDelete, onClose, onRequestDelete }: KanbanBoardCardDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function KanbanBoardCardDialog({ state, columns, t, showSubtasks, onSave, onDelete, onClose, onRequestDelete }: KanbanBoardCardDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -1,120 +1,216 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { Box as e, Button as t, Checkbox as n, Dialog as r, DialogActions as i, DialogContent as a, DialogContentText as o, DialogTitle as s, FormControlLabel as c, IconButton as l, InputAdornment as u, MenuItem as d, Stack as f, TextField as p, Typography as m } from "@mui/material";
|
|
2
|
+
import { useState as h } from "react";
|
|
3
|
+
import g from "@mui/icons-material/Add";
|
|
4
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
5
|
+
import b from "@mui/icons-material/Close";
|
|
6
|
+
import x from "@mui/icons-material/Delete";
|
|
5
7
|
//#region src/components/kanban-board/KanbanBoardCardDialog.tsx
|
|
6
|
-
function
|
|
7
|
-
let
|
|
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] = h(() => j && N ? { ...N } : A && F ? {
|
|
8
10
|
id: "",
|
|
9
11
|
title: "",
|
|
10
|
-
status:
|
|
12
|
+
status: F
|
|
11
13
|
} : {
|
|
12
14
|
id: "",
|
|
13
15
|
title: "",
|
|
14
|
-
status:
|
|
15
|
-
});
|
|
16
|
-
function
|
|
17
|
-
let e =
|
|
18
|
-
e
|
|
19
|
-
|
|
16
|
+
status: C[0]?.id ?? ""
|
|
17
|
+
}), [R, z] = h("");
|
|
18
|
+
function B() {
|
|
19
|
+
let e = R.trim();
|
|
20
|
+
if (!e) return;
|
|
21
|
+
let t = {
|
|
22
|
+
id: crypto.randomUUID(),
|
|
23
|
+
title: e,
|
|
24
|
+
done: !1
|
|
25
|
+
};
|
|
26
|
+
L((e) => ({
|
|
27
|
+
...e,
|
|
28
|
+
subtasks: [...e.subtasks ?? [], t]
|
|
29
|
+
})), z("");
|
|
30
|
+
}
|
|
31
|
+
function V(e) {
|
|
32
|
+
L((t) => ({
|
|
33
|
+
...t,
|
|
34
|
+
subtasks: t.subtasks?.map((t) => t.id === e ? {
|
|
35
|
+
...t,
|
|
36
|
+
done: !t.done
|
|
37
|
+
} : t)
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
function H(e) {
|
|
41
|
+
L((t) => ({
|
|
42
|
+
...t,
|
|
43
|
+
subtasks: t.subtasks?.filter((t) => t.id !== e)
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
function U() {
|
|
47
|
+
let e = I.title.trim();
|
|
48
|
+
e && E({
|
|
49
|
+
...I,
|
|
20
50
|
title: e,
|
|
21
|
-
id:
|
|
51
|
+
id: j ? I.id : crypto.randomUUID()
|
|
22
52
|
});
|
|
23
53
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
54
|
+
function W(e, t) {
|
|
55
|
+
L((n) => ({
|
|
26
56
|
...n,
|
|
27
57
|
[e]: t
|
|
28
58
|
}));
|
|
29
59
|
}
|
|
30
|
-
let
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
open: !!
|
|
33
|
-
onClose:
|
|
60
|
+
let G = A ? w.dialogAddTitle : j ? w.dialogEditTitle : w.dialogDeleteTitle;
|
|
61
|
+
return /* @__PURE__ */ y(r, {
|
|
62
|
+
open: !!S,
|
|
63
|
+
onClose: O,
|
|
34
64
|
maxWidth: "xs",
|
|
35
65
|
fullWidth: !0,
|
|
36
|
-
children: [/* @__PURE__ */
|
|
37
|
-
onClick:
|
|
38
|
-
children:
|
|
39
|
-
}), /* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ v(s, { children: G }), M && P ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(a, { children: /* @__PURE__ */ v(o, { children: w.dialogDeleteConfirm.replace("{title}", P.title) }) }), /* @__PURE__ */ y(i, { children: [/* @__PURE__ */ v(t, {
|
|
67
|
+
onClick: O,
|
|
68
|
+
children: w.dialogCancel
|
|
69
|
+
}), /* @__PURE__ */ v(t, {
|
|
40
70
|
color: "error",
|
|
41
|
-
startIcon: /* @__PURE__ */
|
|
42
|
-
onClick: () =>
|
|
43
|
-
children:
|
|
44
|
-
})] })] }) : /* @__PURE__ */
|
|
71
|
+
startIcon: /* @__PURE__ */ v(x, {}),
|
|
72
|
+
onClick: () => D(P.id),
|
|
73
|
+
children: w.dialogDelete
|
|
74
|
+
})] })] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(a, { children: /* @__PURE__ */ y(f, {
|
|
45
75
|
spacing: 2,
|
|
46
76
|
sx: { pt: .5 },
|
|
47
77
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
label:
|
|
50
|
-
value:
|
|
51
|
-
onChange: (e) =>
|
|
78
|
+
/* @__PURE__ */ v(p, {
|
|
79
|
+
label: w.dialogFieldTitle,
|
|
80
|
+
value: I.title,
|
|
81
|
+
onChange: (e) => W("title", e.target.value),
|
|
52
82
|
required: !0,
|
|
53
83
|
fullWidth: !0,
|
|
54
84
|
size: "small",
|
|
55
85
|
autoFocus: !0,
|
|
56
|
-
onKeyDown: (e) => e.key === "Enter" &&
|
|
86
|
+
onKeyDown: (e) => e.key === "Enter" && U()
|
|
57
87
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
label:
|
|
60
|
-
value:
|
|
61
|
-
onChange: (e) =>
|
|
88
|
+
/* @__PURE__ */ v(p, {
|
|
89
|
+
label: w.dialogFieldDescription,
|
|
90
|
+
value: I.description ?? "",
|
|
91
|
+
onChange: (e) => W("description", e.target.value || void 0),
|
|
62
92
|
fullWidth: !0,
|
|
63
93
|
size: "small",
|
|
64
94
|
multiline: !0,
|
|
65
95
|
rows: 3
|
|
66
96
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
label:
|
|
69
|
-
value:
|
|
70
|
-
onChange: (e) =>
|
|
97
|
+
/* @__PURE__ */ v(p, {
|
|
98
|
+
label: w.dialogFieldAssignee,
|
|
99
|
+
value: I.assignee ?? "",
|
|
100
|
+
onChange: (e) => W("assignee", e.target.value || void 0),
|
|
71
101
|
fullWidth: !0,
|
|
72
102
|
size: "small"
|
|
73
103
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
label:
|
|
104
|
+
/* @__PURE__ */ v(p, {
|
|
105
|
+
label: w.dialogFieldDueDate,
|
|
76
106
|
type: "date",
|
|
77
|
-
value:
|
|
78
|
-
onChange: (e) =>
|
|
107
|
+
value: I.dueDate ? I.dueDate.toISOString().split("T")[0] : "",
|
|
108
|
+
onChange: (e) => W("dueDate", e.target.value ? /* @__PURE__ */ new Date(e.target.value + "T00:00:00") : void 0),
|
|
79
109
|
fullWidth: !0,
|
|
80
110
|
size: "small",
|
|
81
111
|
slotProps: { inputLabel: { shrink: !0 } }
|
|
82
112
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ v(p, {
|
|
84
114
|
select: !0,
|
|
85
|
-
label:
|
|
86
|
-
value:
|
|
87
|
-
onChange: (e) =>
|
|
115
|
+
label: w.dialogFieldStatus,
|
|
116
|
+
value: I.status,
|
|
117
|
+
onChange: (e) => W("status", e.target.value),
|
|
88
118
|
fullWidth: !0,
|
|
89
119
|
size: "small",
|
|
90
|
-
children:
|
|
120
|
+
children: C.map((e) => /* @__PURE__ */ v(d, {
|
|
91
121
|
value: e.id,
|
|
92
122
|
children: e.label
|
|
93
123
|
}, e.id))
|
|
94
|
-
})
|
|
124
|
+
}),
|
|
125
|
+
T && /* @__PURE__ */ y(e, { children: [
|
|
126
|
+
/* @__PURE__ */ v(m, {
|
|
127
|
+
variant: "caption",
|
|
128
|
+
color: "text.secondary",
|
|
129
|
+
sx: {
|
|
130
|
+
display: "block",
|
|
131
|
+
mb: .5
|
|
132
|
+
},
|
|
133
|
+
children: w.dialogFieldSubtasks
|
|
134
|
+
}),
|
|
135
|
+
/* @__PURE__ */ v(f, {
|
|
136
|
+
spacing: .25,
|
|
137
|
+
children: (I.subtasks ?? []).map((t) => /* @__PURE__ */ y(e, {
|
|
138
|
+
sx: {
|
|
139
|
+
display: "flex",
|
|
140
|
+
alignItems: "center"
|
|
141
|
+
},
|
|
142
|
+
children: [/* @__PURE__ */ v(c, {
|
|
143
|
+
sx: {
|
|
144
|
+
flex: 1,
|
|
145
|
+
m: 0
|
|
146
|
+
},
|
|
147
|
+
control: /* @__PURE__ */ v(n, {
|
|
148
|
+
size: "small",
|
|
149
|
+
checked: t.done,
|
|
150
|
+
onChange: () => V(t.id),
|
|
151
|
+
sx: { p: .5 }
|
|
152
|
+
}),
|
|
153
|
+
label: /* @__PURE__ */ v(m, {
|
|
154
|
+
variant: "body2",
|
|
155
|
+
sx: {
|
|
156
|
+
textDecoration: t.done ? "line-through" : "none",
|
|
157
|
+
color: t.done ? "text.disabled" : "text.primary"
|
|
158
|
+
},
|
|
159
|
+
children: t.title
|
|
160
|
+
})
|
|
161
|
+
}), /* @__PURE__ */ v(l, {
|
|
162
|
+
size: "small",
|
|
163
|
+
onClick: () => H(t.id),
|
|
164
|
+
"aria-label": `Remove ${t.title}`,
|
|
165
|
+
children: /* @__PURE__ */ v(b, { fontSize: "small" })
|
|
166
|
+
})]
|
|
167
|
+
}, t.id))
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ v(p, {
|
|
170
|
+
size: "small",
|
|
171
|
+
placeholder: w.dialogSubtaskAdd,
|
|
172
|
+
value: R,
|
|
173
|
+
onChange: (e) => z(e.target.value),
|
|
174
|
+
onKeyDown: (e) => {
|
|
175
|
+
e.key === "Enter" && (e.preventDefault(), B());
|
|
176
|
+
},
|
|
177
|
+
fullWidth: !0,
|
|
178
|
+
sx: { mt: 1 },
|
|
179
|
+
slotProps: { input: { endAdornment: /* @__PURE__ */ v(u, {
|
|
180
|
+
position: "end",
|
|
181
|
+
children: /* @__PURE__ */ v(l, {
|
|
182
|
+
size: "small",
|
|
183
|
+
onClick: B,
|
|
184
|
+
disabled: !R.trim(),
|
|
185
|
+
"aria-label": w.dialogSubtaskAdd,
|
|
186
|
+
children: /* @__PURE__ */ v(g, { fontSize: "small" })
|
|
187
|
+
})
|
|
188
|
+
}) } }
|
|
189
|
+
})
|
|
190
|
+
] })
|
|
95
191
|
]
|
|
96
|
-
}) }), /* @__PURE__ */
|
|
97
|
-
sx: { justifyContent:
|
|
98
|
-
children: [
|
|
192
|
+
}) }), /* @__PURE__ */ y(i, {
|
|
193
|
+
sx: { justifyContent: j ? "space-between" : "flex-end" },
|
|
194
|
+
children: [j && N && /* @__PURE__ */ v(t, {
|
|
99
195
|
color: "error",
|
|
100
|
-
startIcon: /* @__PURE__ */
|
|
101
|
-
onClick: () =>
|
|
102
|
-
children:
|
|
103
|
-
}), /* @__PURE__ */ f
|
|
196
|
+
startIcon: /* @__PURE__ */ v(x, {}),
|
|
197
|
+
onClick: () => k(N),
|
|
198
|
+
children: w.dialogDelete
|
|
199
|
+
}), /* @__PURE__ */ y(f, {
|
|
104
200
|
direction: "row",
|
|
105
201
|
spacing: 1,
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
-
onClick:
|
|
108
|
-
children:
|
|
109
|
-
}), /* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ v(t, {
|
|
203
|
+
onClick: O,
|
|
204
|
+
children: w.dialogCancel
|
|
205
|
+
}), /* @__PURE__ */ v(t, {
|
|
110
206
|
variant: "contained",
|
|
111
|
-
onClick:
|
|
112
|
-
disabled: !
|
|
113
|
-
children:
|
|
207
|
+
onClick: U,
|
|
208
|
+
disabled: !I.title.trim(),
|
|
209
|
+
children: w.dialogSave
|
|
114
210
|
})]
|
|
115
211
|
})]
|
|
116
212
|
})] })]
|
|
117
213
|
});
|
|
118
214
|
}
|
|
119
215
|
//#endregion
|
|
120
|
-
export {
|
|
216
|
+
export { S as KanbanBoardCardDialog };
|