@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.
@@ -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, Typography as c } from "@mui/material";
5
- import { CSS as l } from "@dnd-kit/utilities";
6
- import u from "@mui/icons-material/CalendarToday";
7
- import d from "@mui/icons-material/Person";
8
- import { alpha as f } from "@mui/material/styles";
9
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
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 h = {
12
+ var y = {
12
13
  low: "#4caf50",
13
14
  medium: "#ff9800",
14
15
  high: "#f44336",
15
16
  critical: "#9c27b0"
16
- }, g = {
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 _({ task: _, showPriority: v, showAssignee: y, showDueDate: b, showDueDateWarning: x, chipVariant: S, t: C, onCardClick: w, isOverlay: T = !1 }) {
32
- let { attributes: E, listeners: D, setNodeRef: O, transform: k, transition: A, isDragging: j } = n({
33
- id: _.id,
34
- disabled: T
35
- }), M = T ? void 0 : {
36
- transform: l.Transform.toString(k),
37
- transition: A,
38
- opacity: +!j
39
- }, N = y && !!_.assignee || b && !!_.dueDate, P = _.dueDate ? _.dueDate.toLocaleDateString(void 0, {
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, F = /* @__PURE__ */ new Date();
44
- F.setHours(0, 0, 0, 0);
45
- let I = x && !!_.dueDate && _.dueDate < F;
46
- return /* @__PURE__ */ p(i, {
47
- ref: T ? void 0 : O,
48
- style: M,
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, j && e.selected].filter(Boolean).join(" "),
51
+ className: [t.card, L && e.selected].filter(Boolean).join(" "),
51
52
  sx: {
52
53
  mb: 1,
53
54
  border: "1px solid",
54
- borderColor: I && !_.color ? "error.light" : "divider",
55
- borderLeft: _.color ? `4px solid ${_.color}` : I ? (e) => `4px solid ${e.palette.error.main}` : void 0,
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: T ? "grabbing" : "grab",
58
- bgcolor: (e) => I ? e.palette.mode === "dark" ? f(e.palette.error.main, .12) : f(e.palette.error.main, .04) : e.palette.mode === "dark" ? e.palette.grey[800] : e.palette.background.paper,
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
- ...!j && !T && { "&:hover": {
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
- ...T ? {} : {
68
- ...E,
69
- ...D
68
+ ...j ? {} : {
69
+ ...M,
70
+ ...N
70
71
  },
71
- onClick: () => !j && w(_),
72
- "aria-label": _.title,
73
- children: /* @__PURE__ */ p(a, {
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__ */ m(o, {
77
+ children: /* @__PURE__ */ v(o, {
77
78
  sx: {
78
79
  p: 1.5,
79
80
  "&:last-child": { pb: 1.5 }
80
81
  },
81
- children: [/* @__PURE__ */ m(r, {
82
- sx: {
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
- width: 8,
94
- height: 8,
95
- minWidth: 8,
96
- borderRadius: "50%",
97
- bgcolor: h[_.priority],
98
- mt: "5px",
99
- flexShrink: 0
100
- }
101
- }), /* @__PURE__ */ p(c, {
102
- className: t.cardTitle,
103
- variant: "body2",
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
- lineHeight: 1.4,
106
- fontWeight: 700,
107
- letterSpacing: "-0.01em"
144
+ display: "flex",
145
+ alignItems: "center",
146
+ gap: 1,
147
+ mt: z ? .75 : 0
108
148
  },
109
- children: _.title
110
- })]
111
- }), N && /* @__PURE__ */ m(r, {
112
- className: t.cardMeta,
113
- sx: {
114
- display: "flex",
115
- gap: 1,
116
- flexWrap: "wrap",
117
- alignItems: "center"
118
- },
119
- children: [y && _.assignee && /* @__PURE__ */ p(s, {
120
- className: t.cardAssignee,
121
- icon: /* @__PURE__ */ p(d, {}),
122
- label: _.assignee,
123
- size: "small",
124
- variant: S,
125
- "aria-label": `${C.dialogFieldAssignee}: ${_.assignee}`,
126
- sx: g
127
- }), b && P && /* @__PURE__ */ p(s, {
128
- className: t.cardDueDate,
129
- icon: /* @__PURE__ */ p(u, {}),
130
- label: P,
131
- size: "small",
132
- variant: S,
133
- color: I ? "error" : "default",
134
- "aria-label": `${C.dialogFieldDueDate}: ${P}`,
135
- sx: g
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 { _ as KanbanBoardCard };
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 { Button as e, Dialog as t, DialogActions as n, DialogContent as r, DialogContentText as i, DialogTitle as a, MenuItem as o, Stack as s, TextField as c } from "@mui/material";
2
- import { useState as l } from "react";
3
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
4
- import p from "@mui/icons-material/Delete";
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 m({ state: m, columns: h, t: g, onSave: _, onDelete: v, onClose: y, onRequestDelete: b }) {
7
- let x = m?.mode === "add", S = m?.mode === "edit", C = m?.mode === "delete", w = S ? m.task : null, T = C ? m.task : null, E = x ? m.columnId : null, [D, O] = l(() => S && w ? { ...w } : x && E ? {
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: E
12
+ status: F
11
13
  } : {
12
14
  id: "",
13
15
  title: "",
14
- status: h[0]?.id ?? ""
15
- });
16
- function k() {
17
- let e = D.title.trim();
18
- e && _({
19
- ...D,
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: S ? D.id : crypto.randomUUID()
51
+ id: j ? I.id : crypto.randomUUID()
22
52
  });
23
53
  }
24
- function A(e, t) {
25
- O((n) => ({
54
+ function W(e, t) {
55
+ L((n) => ({
26
56
  ...n,
27
57
  [e]: t
28
58
  }));
29
59
  }
30
- let j = x ? g.dialogAddTitle : S ? g.dialogEditTitle : g.dialogDeleteTitle;
31
- return /* @__PURE__ */ f(t, {
32
- open: !!m,
33
- onClose: y,
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__ */ d(a, { children: j }), C && T ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(r, { children: /* @__PURE__ */ d(i, { children: g.dialogDeleteConfirm.replace("{title}", T.title) }) }), /* @__PURE__ */ f(n, { children: [/* @__PURE__ */ d(e, {
37
- onClick: y,
38
- children: g.dialogCancel
39
- }), /* @__PURE__ */ d(e, {
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__ */ d(p, {}),
42
- onClick: () => v(T.id),
43
- children: g.dialogDelete
44
- })] })] }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(r, { children: /* @__PURE__ */ f(s, {
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__ */ d(c, {
49
- label: g.dialogFieldTitle,
50
- value: D.title,
51
- onChange: (e) => A("title", e.target.value),
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" && k()
86
+ onKeyDown: (e) => e.key === "Enter" && U()
57
87
  }),
58
- /* @__PURE__ */ d(c, {
59
- label: g.dialogFieldDescription,
60
- value: D.description ?? "",
61
- onChange: (e) => A("description", e.target.value || void 0),
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__ */ d(c, {
68
- label: g.dialogFieldAssignee,
69
- value: D.assignee ?? "",
70
- onChange: (e) => A("assignee", e.target.value || void 0),
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__ */ d(c, {
75
- label: g.dialogFieldDueDate,
104
+ /* @__PURE__ */ v(p, {
105
+ label: w.dialogFieldDueDate,
76
106
  type: "date",
77
- value: D.dueDate ? D.dueDate.toISOString().split("T")[0] : "",
78
- onChange: (e) => A("dueDate", e.target.value ? /* @__PURE__ */ new Date(e.target.value + "T00:00:00") : void 0),
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__ */ d(c, {
113
+ /* @__PURE__ */ v(p, {
84
114
  select: !0,
85
- label: g.dialogFieldStatus,
86
- value: D.status,
87
- onChange: (e) => A("status", e.target.value),
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: h.map((e) => /* @__PURE__ */ d(o, {
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__ */ f(n, {
97
- sx: { justifyContent: S ? "space-between" : "flex-end" },
98
- children: [S && w && /* @__PURE__ */ d(e, {
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__ */ d(p, {}),
101
- onClick: () => b(w),
102
- children: g.dialogDelete
103
- }), /* @__PURE__ */ f(s, {
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__ */ d(e, {
107
- onClick: y,
108
- children: g.dialogCancel
109
- }), /* @__PURE__ */ d(e, {
202
+ children: [/* @__PURE__ */ v(t, {
203
+ onClick: O,
204
+ children: w.dialogCancel
205
+ }), /* @__PURE__ */ v(t, {
110
206
  variant: "contained",
111
- onClick: k,
112
- disabled: !D.title.trim(),
113
- children: g.dialogSave
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 { m as KanbanBoardCardDialog };
216
+ export { S as KanbanBoardCardDialog };