@thebuoyant-tsdev/mui-ts-library 3.30.0 → 3.32.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 +21 -0
- package/README.md +21 -0
- package/dist/components/kanban-board/KanbanBoard.d.ts +1 -1
- package/dist/components/kanban-board/KanbanBoard.js +61 -56
- package/dist/components/kanban-board/KanbanBoard.types.d.ts +17 -0
- package/dist/components/kanban-board/KanbanBoardCard.d.ts +3 -1
- package/dist/components/kanban-board/KanbanBoardCard.js +87 -48
- package/dist/components/kanban-board/KanbanBoardColumn.d.ts +3 -1
- package/dist/components/kanban-board/KanbanBoardColumn.js +23 -19
- package/dist/components/kanban-board/kanbanBoardClasses.d.ts +2 -0
- package/dist/components/kanban-board/kanbanBoardClasses.js +1 -0
- package/dist/index.cjs +2 -2
- package/package.json +1 -1
package/README.de.md
CHANGED
|
@@ -555,6 +555,27 @@ Dieses Projekt folgt [Semantic Versioning](https://semver.org/):
|
|
|
555
555
|
|
|
556
556
|
## Changelog
|
|
557
557
|
|
|
558
|
+
### [3.32.0] — 2026-07-18
|
|
559
|
+
|
|
560
|
+
**Hinzugefügt**
|
|
561
|
+
- **KanbanBoard — `priority`-Feld + `showPriority`-Prop**: `priority?: "low" | "medium" | "high" | "critical"` auf `KanbanTask` — als farbiger Punkt neben dem Kartentitel. `showPriority={false}` blendet alle Punkte aus. Neuer Typ-Export: `KanbanTaskPriority`. Siehe [Vollständiger Changelog](https://github.com/thebuoyant/mui-ts-library/blob/main/CHANGELOG.de.md) für Details.
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
### [3.31.0] — 2026-07-18
|
|
566
|
+
|
|
567
|
+
**Hinzugefügt**
|
|
568
|
+
- **KanbanBoard — `showDueDateWarning`**: Überfällige Karten (dueDate in der Vergangenheit) erhalten automatisch roten Chip, Hintergrundton und linken Rahmen. `showDueDateWarning={false}` zum Deaktivieren. Siehe [Vollständiger Changelog](https://github.com/thebuoyant/mui-ts-library/blob/main/CHANGELOG.de.md) für Details.
|
|
569
|
+
- **KanbanBoard — `width`-Prop**: `width?: number | string` (Standard `"100%"`).
|
|
570
|
+
|
|
571
|
+
**Behoben**
|
|
572
|
+
- **KanbanBoard — Spalten-Scroll**: Karten in einer hohen Spalte scrollen jetzt korrekt statt still abgeschnitten zu werden.
|
|
573
|
+
|
|
574
|
+
**Geändert**
|
|
575
|
+
- **KanbanBoard — Kartenoptik poliert**: Expliziter `1px`-Rahmen, kontrollierter Box-Shadow mit Hover-Lift, ausgeblendeter Scrollbalken, `fontWeight: 700`-Titel. Siehe [Vollständiger Changelog](https://github.com/thebuoyant/mui-ts-library/blob/main/CHANGELOG.de.md) für Details.
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
558
579
|
### [3.30.0] — 2026-07-17
|
|
559
580
|
|
|
560
581
|
**Hinzugefügt**
|
package/README.md
CHANGED
|
@@ -555,6 +555,27 @@ This project follows [Semantic Versioning](https://semver.org/):
|
|
|
555
555
|
|
|
556
556
|
## Changelog
|
|
557
557
|
|
|
558
|
+
### [3.32.0] — 2026-07-18
|
|
559
|
+
|
|
560
|
+
**Added**
|
|
561
|
+
- **KanbanBoard — `priority` field + `showPriority` prop**: `priority?: "low" | "medium" | "high" | "critical"` on `KanbanTask` — shown as a colored dot next to the card title. `showPriority={false}` to hide all dots. New type export: `KanbanTaskPriority`. See [Full Changelog](https://github.com/thebuoyant/mui-ts-library/blob/main/CHANGELOG.md) for details.
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
### [3.31.0] — 2026-07-18
|
|
566
|
+
|
|
567
|
+
**Added**
|
|
568
|
+
- **KanbanBoard — `showDueDateWarning`**: Overdue cards (dueDate in the past) auto-highlight with a red chip, background tint, and left border. `showDueDateWarning={false}` to opt out. See [Full Changelog](https://github.com/thebuoyant/mui-ts-library/blob/main/CHANGELOG.md) for details.
|
|
569
|
+
- **KanbanBoard — `width` prop**: `width?: number | string` (default `"100%"`).
|
|
570
|
+
|
|
571
|
+
**Fixed**
|
|
572
|
+
- **KanbanBoard — column scroll**: Cards in a tall column now scroll correctly instead of being silently clipped.
|
|
573
|
+
|
|
574
|
+
**Changed**
|
|
575
|
+
- **KanbanBoard — card visual polish**: Explicit `1px` border, controlled box-shadow with hover lift, hidden scrollbar, `fontWeight: 700` title. See [Full Changelog](https://github.com/thebuoyant/mui-ts-library/blob/main/CHANGELOG.md) for details.
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
558
579
|
### [3.30.0] — 2026-07-17
|
|
559
580
|
|
|
560
581
|
**Added**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type KanbanBoardProps } from "./KanbanBoard.types";
|
|
2
|
-
export declare function KanbanBoard({ tasks, columns, onTasksChange, onCardClick, enableBuiltinDialogs, onTaskCreated, onTaskUpdated, onTaskDeleted, onTaskMoved, showAssignee, showDueDate, chipVariant, height, translation, }: KanbanBoardProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function KanbanBoard({ tasks, columns, onTasksChange, onCardClick, enableBuiltinDialogs, onTaskCreated, onTaskUpdated, onTaskDeleted, onTaskMoved, showPriority, showAssignee, showDueDate, showDueDateWarning, chipVariant, width, height, translation, }: KanbanBoardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,62 +9,62 @@ import { Box as m } from "@mui/material";
|
|
|
9
9
|
import { useEffect as h, useState as g } from "react";
|
|
10
10
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/kanban-board/KanbanBoard.tsx
|
|
12
|
-
function y({ tasks: y, columns: b, onTasksChange: x, onCardClick: S, enableBuiltinDialogs: C = !0, onTaskCreated: w, onTaskUpdated: T, onTaskDeleted: E, onTaskMoved: D,
|
|
13
|
-
let
|
|
12
|
+
function y({ tasks: y, columns: b, onTasksChange: x, onCardClick: S, enableBuiltinDialogs: C = !0, onTaskCreated: w, onTaskUpdated: T, onTaskDeleted: E, onTaskMoved: D, showPriority: O = !0, showAssignee: k = !0, showDueDate: A = !0, showDueDateWarning: j = !0, chipVariant: M = "outlined", width: N = "100%", height: P = "100%", translation: F }) {
|
|
13
|
+
let I = {
|
|
14
14
|
...t,
|
|
15
|
-
...
|
|
16
|
-
}, [
|
|
15
|
+
...F
|
|
16
|
+
}, [L, R] = g(y);
|
|
17
17
|
h(() => {
|
|
18
|
-
|
|
18
|
+
R(y);
|
|
19
19
|
}, [y]);
|
|
20
|
-
let [
|
|
21
|
-
function
|
|
22
|
-
L
|
|
20
|
+
let [z, B] = g(null), [V, H] = g(null), U = d(u(c, { activationConstraint: { distance: 8 } }), u(s, { coordinateGetter: p }));
|
|
21
|
+
function W({ active: e }) {
|
|
22
|
+
B(L.find((t) => t.id === e.id) ?? null);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function G({ active: e, over: t }) {
|
|
25
25
|
if (!t) return;
|
|
26
|
-
let n = e.id, r = t.id, i =
|
|
26
|
+
let n = e.id, r = t.id, i = L.find((e) => e.id === n);
|
|
27
27
|
if (!i) return;
|
|
28
|
-
let a = b.find((e) => e.id === r), o =
|
|
29
|
-
!s || i.status === s ||
|
|
28
|
+
let a = b.find((e) => e.id === r), o = L.find((e) => e.id === r), s = a?.id ?? o?.status;
|
|
29
|
+
!s || i.status === s || R((e) => e.map((e) => e.id === n ? {
|
|
30
30
|
...e,
|
|
31
31
|
status: s
|
|
32
32
|
} : e));
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
let n =
|
|
36
|
-
if (
|
|
37
|
-
|
|
34
|
+
function K({ active: e, over: t }) {
|
|
35
|
+
let n = z?.status;
|
|
36
|
+
if (B(null), !t) {
|
|
37
|
+
R(y);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
let r = e.id, i = t.id, a =
|
|
41
|
-
if (s = a !== -1 && o !== -1 && a !== o ? f(
|
|
40
|
+
let r = e.id, i = t.id, a = L.findIndex((e) => e.id === r), o = L.findIndex((e) => e.id === i), s;
|
|
41
|
+
if (s = a !== -1 && o !== -1 && a !== o ? f(L, a, o) : [...L], R(s), x?.(s), n) {
|
|
42
42
|
let e = s.find((e) => e.id === r);
|
|
43
43
|
e && e.status !== n && D?.(e, n, e.status);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
C ?
|
|
46
|
+
function q(e) {
|
|
47
|
+
C ? H({
|
|
48
48
|
mode: "edit",
|
|
49
49
|
task: e
|
|
50
50
|
}) : S?.(e);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
52
|
+
function J(e) {
|
|
53
|
+
H({
|
|
54
54
|
mode: "add",
|
|
55
55
|
columnId: e
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
let t = !
|
|
60
|
-
|
|
58
|
+
function Y(e) {
|
|
59
|
+
let t = !L.find((t) => t.id === e.id), n = t ? [...L, e] : L.map((t) => t.id === e.id ? e : t);
|
|
60
|
+
R(n), x?.(n), t ? w?.(e) : T?.(e), H(null);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
let t =
|
|
64
|
-
|
|
62
|
+
function X(e) {
|
|
63
|
+
let t = L.filter((t) => t.id !== e);
|
|
64
|
+
R(t), x?.(t), E?.(e), H(null);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
66
|
+
function Z(e) {
|
|
67
|
+
H({
|
|
68
68
|
mode: "delete",
|
|
69
69
|
task: e
|
|
70
70
|
});
|
|
@@ -72,17 +72,18 @@ function y({ tasks: y, columns: b, onTasksChange: x, onCardClick: S, enableBuilt
|
|
|
72
72
|
return /* @__PURE__ */ v(m, {
|
|
73
73
|
className: e.root,
|
|
74
74
|
sx: {
|
|
75
|
-
|
|
75
|
+
width: N,
|
|
76
|
+
height: P,
|
|
76
77
|
display: "flex",
|
|
77
78
|
flexDirection: "column",
|
|
78
79
|
overflow: "hidden"
|
|
79
80
|
},
|
|
80
81
|
children: [/* @__PURE__ */ v(a, {
|
|
81
|
-
sensors:
|
|
82
|
+
sensors: U,
|
|
82
83
|
collisionDetection: l,
|
|
83
|
-
onDragStart:
|
|
84
|
-
onDragOver:
|
|
85
|
-
onDragEnd:
|
|
84
|
+
onDragStart: W,
|
|
85
|
+
onDragOver: G,
|
|
86
|
+
onDragEnd: K,
|
|
86
87
|
children: [/* @__PURE__ */ _(m, {
|
|
87
88
|
className: e.columns,
|
|
88
89
|
sx: {
|
|
@@ -92,37 +93,41 @@ function y({ tasks: y, columns: b, onTasksChange: x, onCardClick: S, enableBuilt
|
|
|
92
93
|
p: 2,
|
|
93
94
|
overflowX: "auto",
|
|
94
95
|
overflowY: "hidden",
|
|
95
|
-
alignItems: "
|
|
96
|
+
alignItems: "stretch"
|
|
96
97
|
},
|
|
97
98
|
children: b.map((e) => /* @__PURE__ */ _(i, {
|
|
98
99
|
column: e,
|
|
99
|
-
tasks:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
tasks: L.filter((t) => t.status === e.id),
|
|
101
|
+
showPriority: O,
|
|
102
|
+
showAssignee: k,
|
|
103
|
+
showDueDate: A,
|
|
104
|
+
showDueDateWarning: j,
|
|
105
|
+
chipVariant: M,
|
|
106
|
+
t: I,
|
|
104
107
|
enableBuiltinDialogs: C,
|
|
105
|
-
onCardClick:
|
|
106
|
-
onAddClick:
|
|
108
|
+
onCardClick: q,
|
|
109
|
+
onAddClick: J
|
|
107
110
|
}, e.id))
|
|
108
|
-
}), /* @__PURE__ */ _(o, { children:
|
|
109
|
-
task:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
}), /* @__PURE__ */ _(o, { children: z && /* @__PURE__ */ _(n, {
|
|
112
|
+
task: z,
|
|
113
|
+
showPriority: O,
|
|
114
|
+
showAssignee: k,
|
|
115
|
+
showDueDate: A,
|
|
116
|
+
showDueDateWarning: j,
|
|
117
|
+
chipVariant: M,
|
|
118
|
+
t: I,
|
|
114
119
|
onCardClick: () => {},
|
|
115
120
|
isOverlay: !0
|
|
116
121
|
}) })]
|
|
117
122
|
}), C && /* @__PURE__ */ _(r, {
|
|
118
|
-
state:
|
|
123
|
+
state: V,
|
|
119
124
|
columns: b,
|
|
120
|
-
t:
|
|
121
|
-
onSave:
|
|
122
|
-
onDelete:
|
|
123
|
-
onRequestDelete:
|
|
124
|
-
onClose: () =>
|
|
125
|
-
},
|
|
125
|
+
t: I,
|
|
126
|
+
onSave: Y,
|
|
127
|
+
onDelete: X,
|
|
128
|
+
onRequestDelete: Z,
|
|
129
|
+
onClose: () => H(null)
|
|
130
|
+
}, V ? `${V.mode}-${V.mode === "add" ? V.columnId : V.task.id}` : "closed")]
|
|
126
131
|
});
|
|
127
132
|
}
|
|
128
133
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type KanbanTaskPriority = "low" | "medium" | "high" | "critical";
|
|
1
2
|
export type KanbanTask = {
|
|
2
3
|
id: string;
|
|
3
4
|
title: string;
|
|
@@ -8,6 +9,8 @@ export type KanbanTask = {
|
|
|
8
9
|
/** Overrides the column's default card color for this individual card. Any CSS color value. */
|
|
9
10
|
color?: string;
|
|
10
11
|
dueDate?: Date;
|
|
12
|
+
/** Optional priority level — shown as a colored dot next to the card title when `showPriority` is true. */
|
|
13
|
+
priority?: KanbanTaskPriority;
|
|
11
14
|
};
|
|
12
15
|
export type KanbanColumn = {
|
|
13
16
|
/** Used as the key — must match `KanbanTask.status` values. */
|
|
@@ -67,16 +70,30 @@ export type KanbanBoardProps = {
|
|
|
67
70
|
* so consumers can issue a targeted API call without diffing the full list.
|
|
68
71
|
*/
|
|
69
72
|
onTaskMoved?: (task: KanbanTask, fromColumnId: string, toColumnId: string) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Show the priority dot on cards (default: true).
|
|
75
|
+
* Has no visual effect when a card has no `priority` field set.
|
|
76
|
+
*/
|
|
77
|
+
showPriority?: boolean;
|
|
70
78
|
/** Show the assignee label on cards (default: true). */
|
|
71
79
|
showAssignee?: boolean;
|
|
72
80
|
/** Show the due date on cards (default: true). */
|
|
73
81
|
showDueDate?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Highlight cards whose `dueDate` is in the past (default: true).
|
|
84
|
+
* When true, the due-date chip turns red (`color="error"`) and the card
|
|
85
|
+
* receives a subtle red background tint and left border stripe.
|
|
86
|
+
* Has no effect when `showDueDate` is false or when the card has no `dueDate`.
|
|
87
|
+
*/
|
|
88
|
+
showDueDateWarning?: boolean;
|
|
74
89
|
/**
|
|
75
90
|
* MUI Chip variant for assignee and due-date chips on cards.
|
|
76
91
|
* `"outlined"` (default) — subtle border, transparent background.
|
|
77
92
|
* `"filled"` — solid background, more prominent.
|
|
78
93
|
*/
|
|
79
94
|
chipVariant?: "outlined" | "filled";
|
|
95
|
+
/** Width of the board. Default: "100%". */
|
|
96
|
+
width?: number | string;
|
|
80
97
|
/** Height of the board. Default: "100%". */
|
|
81
98
|
height?: number | string;
|
|
82
99
|
/** Override any label or message — unset keys fall back to English defaults. */
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { KanbanBoardTranslation, KanbanTask } from "./KanbanBoard.types";
|
|
2
2
|
type KanbanBoardCardProps = {
|
|
3
3
|
task: KanbanTask;
|
|
4
|
+
showPriority: boolean;
|
|
4
5
|
showAssignee: boolean;
|
|
5
6
|
showDueDate: boolean;
|
|
7
|
+
showDueDateWarning: boolean;
|
|
6
8
|
chipVariant: "outlined" | "filled";
|
|
7
9
|
t: Required<KanbanBoardTranslation>;
|
|
8
10
|
onCardClick: (task: KanbanTask) => void;
|
|
9
11
|
/** True when this card is the drag overlay ghost — rendered without transform/listeners. */
|
|
10
12
|
isOverlay?: boolean;
|
|
11
13
|
};
|
|
12
|
-
export declare function KanbanBoardCard({ task, showAssignee, showDueDate, chipVariant, t, onCardClick, isOverlay, }: KanbanBoardCardProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function KanbanBoardCard({ task, showPriority, showAssignee, showDueDate, showDueDateWarning, chipVariant, t, onCardClick, isOverlay, }: KanbanBoardCardProps): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export {};
|
|
@@ -5,9 +5,15 @@ import { Box as r, Card as i, CardActionArea as a, CardContent as o, Chip as s,
|
|
|
5
5
|
import { CSS as l } from "@dnd-kit/utilities";
|
|
6
6
|
import u from "@mui/icons-material/CalendarToday";
|
|
7
7
|
import d from "@mui/icons-material/Person";
|
|
8
|
-
import {
|
|
8
|
+
import { alpha as f } from "@mui/material/styles";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/kanban-board/KanbanBoardCard.tsx
|
|
10
|
-
var
|
|
11
|
+
var h = {
|
|
12
|
+
low: "#4caf50",
|
|
13
|
+
medium: "#ff9800",
|
|
14
|
+
high: "#f44336",
|
|
15
|
+
critical: "#9c27b0"
|
|
16
|
+
}, g = {
|
|
11
17
|
fontSize: "0.7rem",
|
|
12
18
|
height: 22,
|
|
13
19
|
"& .MuiChip-icon": {
|
|
@@ -22,78 +28,111 @@ var m = {
|
|
|
22
28
|
pr: "10px"
|
|
23
29
|
}
|
|
24
30
|
};
|
|
25
|
-
function
|
|
26
|
-
let { attributes:
|
|
27
|
-
id:
|
|
28
|
-
disabled:
|
|
29
|
-
}),
|
|
30
|
-
transform: l.Transform.toString(
|
|
31
|
-
transition:
|
|
32
|
-
opacity: +!
|
|
33
|
-
|
|
34
|
-
}, k = g && !!h.assignee || _ && !!h.dueDate, A = h.dueDate ? h.dueDate.toLocaleDateString(void 0, {
|
|
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, {
|
|
35
40
|
day: "2-digit",
|
|
36
41
|
month: "short",
|
|
37
42
|
year: "numeric"
|
|
38
|
-
}) : null;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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,
|
|
49
|
+
elevation: 0,
|
|
50
|
+
className: [t.card, j && e.selected].filter(Boolean).join(" "),
|
|
43
51
|
sx: {
|
|
44
52
|
mb: 1,
|
|
45
|
-
|
|
53
|
+
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,
|
|
46
56
|
userSelect: "none",
|
|
47
|
-
|
|
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,
|
|
59
|
+
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
|
+
transition: "box-shadow 0.15s ease, transform 0.15s ease",
|
|
61
|
+
...!j && !T && { "&:hover": {
|
|
62
|
+
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
|
+
transform: "translateY(-1px)"
|
|
64
|
+
} },
|
|
48
65
|
"&:active": { cursor: "grabbing" }
|
|
49
66
|
},
|
|
50
|
-
...
|
|
51
|
-
...
|
|
52
|
-
...
|
|
67
|
+
...T ? {} : {
|
|
68
|
+
...E,
|
|
69
|
+
...D
|
|
53
70
|
},
|
|
54
|
-
onClick: () => !
|
|
55
|
-
"aria-label":
|
|
56
|
-
children: /* @__PURE__ */
|
|
71
|
+
onClick: () => !j && w(_),
|
|
72
|
+
"aria-label": _.title,
|
|
73
|
+
children: /* @__PURE__ */ p(a, {
|
|
57
74
|
component: "div",
|
|
58
75
|
sx: { cursor: "inherit" },
|
|
59
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ m(o, {
|
|
60
77
|
sx: {
|
|
61
78
|
p: 1.5,
|
|
62
79
|
"&:last-child": { pb: 1.5 }
|
|
63
80
|
},
|
|
64
|
-
children: [/* @__PURE__ */
|
|
65
|
-
className: t.cardTitle,
|
|
66
|
-
variant: "body2",
|
|
81
|
+
children: [/* @__PURE__ */ m(r, {
|
|
67
82
|
sx: {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
83
|
+
display: "flex",
|
|
84
|
+
alignItems: "flex-start",
|
|
85
|
+
gap: .75,
|
|
86
|
+
mb: +!!N
|
|
71
87
|
},
|
|
72
|
-
children:
|
|
73
|
-
|
|
88
|
+
children: [v && _.priority && /* @__PURE__ */ p(r, {
|
|
89
|
+
className: t.cardPriorityDot,
|
|
90
|
+
role: "img",
|
|
91
|
+
"aria-label": `Priority: ${_.priority}`,
|
|
92
|
+
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",
|
|
104
|
+
sx: {
|
|
105
|
+
lineHeight: 1.4,
|
|
106
|
+
fontWeight: 700,
|
|
107
|
+
letterSpacing: "-0.01em"
|
|
108
|
+
},
|
|
109
|
+
children: _.title
|
|
110
|
+
})]
|
|
111
|
+
}), N && /* @__PURE__ */ m(r, {
|
|
74
112
|
className: t.cardMeta,
|
|
75
113
|
sx: {
|
|
76
114
|
display: "flex",
|
|
77
|
-
gap:
|
|
115
|
+
gap: 1,
|
|
78
116
|
flexWrap: "wrap",
|
|
79
117
|
alignItems: "center"
|
|
80
118
|
},
|
|
81
|
-
children: [
|
|
119
|
+
children: [y && _.assignee && /* @__PURE__ */ p(s, {
|
|
82
120
|
className: t.cardAssignee,
|
|
83
|
-
icon: /* @__PURE__ */
|
|
84
|
-
label:
|
|
121
|
+
icon: /* @__PURE__ */ p(d, {}),
|
|
122
|
+
label: _.assignee,
|
|
85
123
|
size: "small",
|
|
86
|
-
variant:
|
|
87
|
-
"aria-label": `${
|
|
88
|
-
sx:
|
|
89
|
-
}),
|
|
124
|
+
variant: S,
|
|
125
|
+
"aria-label": `${C.dialogFieldAssignee}: ${_.assignee}`,
|
|
126
|
+
sx: g
|
|
127
|
+
}), b && P && /* @__PURE__ */ p(s, {
|
|
90
128
|
className: t.cardDueDate,
|
|
91
|
-
icon: /* @__PURE__ */
|
|
92
|
-
label:
|
|
129
|
+
icon: /* @__PURE__ */ p(u, {}),
|
|
130
|
+
label: P,
|
|
93
131
|
size: "small",
|
|
94
|
-
variant:
|
|
95
|
-
"
|
|
96
|
-
|
|
132
|
+
variant: S,
|
|
133
|
+
color: I ? "error" : "default",
|
|
134
|
+
"aria-label": `${C.dialogFieldDueDate}: ${P}`,
|
|
135
|
+
sx: g
|
|
97
136
|
})]
|
|
98
137
|
})]
|
|
99
138
|
})
|
|
@@ -101,4 +140,4 @@ function h({ task: h, showAssignee: g, showDueDate: _, chipVariant: v, t: y, onC
|
|
|
101
140
|
});
|
|
102
141
|
}
|
|
103
142
|
//#endregion
|
|
104
|
-
export {
|
|
143
|
+
export { _ as KanbanBoardCard };
|
|
@@ -2,13 +2,15 @@ import type { KanbanBoardTranslation, KanbanColumn, KanbanTask } from "./KanbanB
|
|
|
2
2
|
type KanbanBoardColumnProps = {
|
|
3
3
|
column: KanbanColumn;
|
|
4
4
|
tasks: KanbanTask[];
|
|
5
|
+
showPriority: boolean;
|
|
5
6
|
showAssignee: boolean;
|
|
6
7
|
showDueDate: boolean;
|
|
8
|
+
showDueDateWarning: boolean;
|
|
7
9
|
chipVariant: "outlined" | "filled";
|
|
8
10
|
t: Required<KanbanBoardTranslation>;
|
|
9
11
|
enableBuiltinDialogs: boolean;
|
|
10
12
|
onCardClick: (task: KanbanTask) => void;
|
|
11
13
|
onAddClick: (columnId: string) => void;
|
|
12
14
|
};
|
|
13
|
-
export declare function KanbanBoardColumn({ column, tasks, showAssignee, showDueDate, chipVariant, t, enableBuiltinDialogs, onCardClick, onAddClick, }: KanbanBoardColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function KanbanBoardColumn({ column, tasks, showPriority, showAssignee, showDueDate, showDueDateWarning, chipVariant, t, enableBuiltinDialogs, onCardClick, onAddClick, }: KanbanBoardColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export {};
|
|
@@ -6,8 +6,8 @@ import { Box as a, Button as o, Chip as s, Typography as c } from "@mui/material
|
|
|
6
6
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
7
|
import d from "@mui/icons-material/Add";
|
|
8
8
|
//#region src/components/kanban-board/KanbanBoardColumn.tsx
|
|
9
|
-
function f({ column: f, tasks: p,
|
|
10
|
-
let { setNodeRef:
|
|
9
|
+
function f({ column: f, tasks: p, showPriority: m, showAssignee: h, showDueDate: g, showDueDateWarning: _, chipVariant: v, t: y, enableBuiltinDialogs: b, onCardClick: x, onAddClick: S }) {
|
|
10
|
+
let { setNodeRef: C, isOver: w } = n({ id: f.id }), T = f.wipLimit !== void 0 && p.length > f.wipLimit, E = f.wipLimit === void 0 ? `${p.length}` : `${p.length} / ${f.wipLimit}`, D = f.color ?? "primary.main";
|
|
11
11
|
return /* @__PURE__ */ u(a, {
|
|
12
12
|
className: e.column,
|
|
13
13
|
sx: {
|
|
@@ -46,13 +46,13 @@ function f({ column: f, tasks: p, showAssignee: m, showDueDate: h, chipVariant:
|
|
|
46
46
|
children: f.label
|
|
47
47
|
}), /* @__PURE__ */ l(s, {
|
|
48
48
|
className: e.columnCount,
|
|
49
|
-
label:
|
|
49
|
+
label: E,
|
|
50
50
|
size: "small",
|
|
51
|
-
color:
|
|
51
|
+
color: T ? "error" : "default",
|
|
52
52
|
sx: {
|
|
53
53
|
height: 20,
|
|
54
54
|
fontSize: "0.7rem",
|
|
55
|
-
...!
|
|
55
|
+
...!T && f.color && {
|
|
56
56
|
bgcolor: f.color,
|
|
57
57
|
color: "#fff"
|
|
58
58
|
}
|
|
@@ -64,17 +64,19 @@ function f({ column: f, tasks: p, showAssignee: m, showDueDate: h, chipVariant:
|
|
|
64
64
|
items: p.map((e) => e.id),
|
|
65
65
|
strategy: i,
|
|
66
66
|
children: /* @__PURE__ */ u(a, {
|
|
67
|
-
ref:
|
|
67
|
+
ref: C,
|
|
68
68
|
className: e.columnBody,
|
|
69
69
|
sx: {
|
|
70
70
|
flex: 1,
|
|
71
71
|
overflowY: "auto",
|
|
72
|
+
scrollbarWidth: "none",
|
|
73
|
+
"&::-webkit-scrollbar": { display: "none" },
|
|
72
74
|
p: 1,
|
|
73
75
|
minHeight: 80,
|
|
74
|
-
bgcolor: (e) =>
|
|
76
|
+
bgcolor: (e) => w ? e.palette.action.selected : e.palette.mode === "dark" ? e.palette.grey[900] : e.palette.grey[100],
|
|
75
77
|
transition: "background-color 0.15s"
|
|
76
78
|
},
|
|
77
|
-
children: [p.length === 0 && !
|
|
79
|
+
children: [p.length === 0 && !w && /* @__PURE__ */ l(c, {
|
|
78
80
|
variant: "caption",
|
|
79
81
|
color: "text.disabled",
|
|
80
82
|
sx: {
|
|
@@ -82,18 +84,20 @@ function f({ column: f, tasks: p, showAssignee: m, showDueDate: h, chipVariant:
|
|
|
82
84
|
textAlign: "center",
|
|
83
85
|
mt: 2
|
|
84
86
|
},
|
|
85
|
-
children:
|
|
87
|
+
children: y.noCardsLabel
|
|
86
88
|
}), p.map((e) => /* @__PURE__ */ l(t, {
|
|
87
89
|
task: e,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
showPriority: m,
|
|
91
|
+
showAssignee: h,
|
|
92
|
+
showDueDate: g,
|
|
93
|
+
showDueDateWarning: _,
|
|
94
|
+
chipVariant: v,
|
|
95
|
+
t: y,
|
|
96
|
+
onCardClick: x
|
|
93
97
|
}, e.id))]
|
|
94
98
|
})
|
|
95
99
|
}),
|
|
96
|
-
|
|
100
|
+
b && /* @__PURE__ */ l(a, {
|
|
97
101
|
sx: {
|
|
98
102
|
p: 1,
|
|
99
103
|
borderTop: "1px solid",
|
|
@@ -104,12 +108,12 @@ function f({ column: f, tasks: p, showAssignee: m, showDueDate: h, chipVariant:
|
|
|
104
108
|
startIcon: /* @__PURE__ */ l(d, {}),
|
|
105
109
|
size: "small",
|
|
106
110
|
fullWidth: !0,
|
|
107
|
-
onClick: () =>
|
|
111
|
+
onClick: () => S(f.id),
|
|
108
112
|
sx: {
|
|
109
113
|
justifyContent: "flex-start",
|
|
110
|
-
color:
|
|
114
|
+
color: D,
|
|
111
115
|
border: "1px dashed",
|
|
112
|
-
borderColor:
|
|
116
|
+
borderColor: D,
|
|
113
117
|
borderRadius: 1,
|
|
114
118
|
py: .75,
|
|
115
119
|
fontWeight: 600,
|
|
@@ -119,7 +123,7 @@ function f({ column: f, tasks: p, showAssignee: m, showDueDate: h, chipVariant:
|
|
|
119
123
|
borderStyle: "dashed"
|
|
120
124
|
}
|
|
121
125
|
},
|
|
122
|
-
children:
|
|
126
|
+
children: y.addCardLabel
|
|
123
127
|
})
|
|
124
128
|
})
|
|
125
129
|
]
|
|
@@ -42,6 +42,8 @@ export declare const kanbanBoardClasses: {
|
|
|
42
42
|
readonly cardAssignee: "MuiTsKanbanBoard-cardAssignee";
|
|
43
43
|
/** The due date label on a card. */
|
|
44
44
|
readonly cardDueDate: "MuiTsKanbanBoard-cardDueDate";
|
|
45
|
+
/** The priority indicator dot on a card. */
|
|
46
|
+
readonly cardPriorityDot: "MuiTsKanbanBoard-cardPriorityDot";
|
|
45
47
|
/** The "+ Add card" button at the bottom of each column. */
|
|
46
48
|
readonly addButton: "MuiTsKanbanBoard-addButton";
|
|
47
49
|
};
|
|
@@ -12,6 +12,7 @@ var e = {
|
|
|
12
12
|
cardMeta: "MuiTsKanbanBoard-cardMeta",
|
|
13
13
|
cardAssignee: "MuiTsKanbanBoard-cardAssignee",
|
|
14
14
|
cardDueDate: "MuiTsKanbanBoard-cardDueDate",
|
|
15
|
+
cardPriorityDot: "MuiTsKanbanBoard-cardPriorityDot",
|
|
15
16
|
addButton: "MuiTsKanbanBoard-addButton"
|
|
16
17
|
};
|
|
17
18
|
//#endregion
|