laif-ds 0.2.69 → 0.2.70
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/dist/components/ui/app-kanban.js +155 -112
- package/dist/components/ui/kanban.js +414 -285
- package/dist/components/ui/textarea.js +21 -20
- package/dist/index.d.ts +1 -0
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,151 +1,194 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { KanbanBoardProvider as
|
|
5
|
-
import { stringToHexColor as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { jsx as o, jsxs as l, Fragment as H } from "react/jsx-runtime";
|
|
3
|
+
import { useState as I, useMemo as P } from "react";
|
|
4
|
+
import { KanbanBoardProvider as A, KanbanBoard as F, KanbanBoardColumn as J, KanbanBoardColumnHeader as R, KanbanBoardColumnList as W, KanbanBoardColumnListItem as q, KanbanBoardCard as E, KanbanBoardCardTitle as G, KanbanBoardCardDescription as Q } from "./kanban.js";
|
|
5
|
+
import { stringToHexColor as U, cn as B, hexToRgba as K } from "../../lib/utils.js";
|
|
6
|
+
import { Button as V } from "./button.js";
|
|
7
|
+
import { Icon as X } from "./icon.js";
|
|
8
|
+
import Y from "../../node_modules/lucide-react/dist/esm/icons/lock.js";
|
|
9
|
+
import Z from "../../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
10
|
+
function ne({
|
|
11
|
+
columns: p,
|
|
12
|
+
initialTasks: w,
|
|
12
13
|
onTaskMove: m,
|
|
13
14
|
onTaskEdit: x,
|
|
14
|
-
onTaskCreate:
|
|
15
|
-
taskActions:
|
|
16
|
-
renderTaskContent:
|
|
17
|
-
className:
|
|
18
|
-
allowTaskCreate:
|
|
15
|
+
onTaskCreate: h,
|
|
16
|
+
taskActions: D,
|
|
17
|
+
renderTaskContent: g,
|
|
18
|
+
className: j,
|
|
19
|
+
allowTaskCreate: z = !0
|
|
19
20
|
}) {
|
|
20
|
-
const [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
const [N, C] = I(w), b = P(
|
|
22
|
+
() => new Set(p.filter((e) => e.disabled).map((e) => e.id)),
|
|
23
|
+
[p]
|
|
24
|
+
), y = (e) => {
|
|
25
|
+
const i = {};
|
|
26
|
+
for (const r of Object.keys(e))
|
|
27
|
+
i[r] = [...e[r]];
|
|
28
|
+
return i;
|
|
29
|
+
}, O = (e, i) => {
|
|
30
|
+
C((r) => {
|
|
31
|
+
const d = y(r);
|
|
32
|
+
let a, n;
|
|
33
|
+
for (const s of Object.keys(d)) {
|
|
34
|
+
const c = d[s].findIndex((f) => f.id === e);
|
|
31
35
|
if (c !== -1) {
|
|
32
|
-
n = s, [
|
|
36
|
+
n = s, [a] = d[s].splice(c, 1);
|
|
33
37
|
break;
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
|
-
return !
|
|
40
|
+
return !a || n === i || n && b.has(n) || b.has(i) ? r : (d[i] || (d[i] = []), d[i].push(a), n && m && m(e, n, i), d);
|
|
37
41
|
});
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
const n =
|
|
41
|
-
(
|
|
42
|
+
}, L = (e, i, r, d) => {
|
|
43
|
+
C((a) => {
|
|
44
|
+
const n = y(a), s = Object.keys(n).find(
|
|
45
|
+
(t) => n[t].some((S) => S.id === e)
|
|
42
46
|
);
|
|
43
|
-
if (!s) return
|
|
47
|
+
if (!s) return a;
|
|
44
48
|
const c = n[s].findIndex(
|
|
45
|
-
(
|
|
49
|
+
(t) => t.id === e
|
|
46
50
|
);
|
|
47
|
-
if (c === -1)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
if (c === -1 || b.has(s) || b.has(r))
|
|
52
|
+
return a;
|
|
53
|
+
const [f] = n[s].splice(c, 1);
|
|
54
|
+
n[r] || (n[r] = []);
|
|
55
|
+
const u = n[r].findIndex(
|
|
56
|
+
(t) => t.id === i
|
|
52
57
|
);
|
|
53
|
-
if (
|
|
54
|
-
n[
|
|
58
|
+
if (u === -1)
|
|
59
|
+
n[r].push(f);
|
|
55
60
|
else {
|
|
56
|
-
const
|
|
57
|
-
n[
|
|
61
|
+
const t = d === "top" ? u : u + 1;
|
|
62
|
+
n[r].splice(t, 0, f);
|
|
58
63
|
}
|
|
59
|
-
return s !==
|
|
64
|
+
return s !== r && m && m(e, s, r), n;
|
|
60
65
|
});
|
|
61
|
-
},
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
const
|
|
66
|
+
}, v = (e) => JSON.parse(e);
|
|
67
|
+
return /* @__PURE__ */ o(A, { children: /* @__PURE__ */ o(F, { className: j, children: p.map((e) => {
|
|
68
|
+
const i = U(e.label), r = !!e.disabled;
|
|
64
69
|
return /* @__PURE__ */ l(
|
|
65
|
-
|
|
70
|
+
J,
|
|
66
71
|
{
|
|
67
|
-
columnId:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
columnId: e.id,
|
|
73
|
+
disabled: r,
|
|
74
|
+
onDropOverColumn: (d) => {
|
|
75
|
+
if (r) return;
|
|
76
|
+
const a = v(d);
|
|
77
|
+
O(a.id, e.id);
|
|
71
78
|
},
|
|
72
|
-
className:
|
|
79
|
+
className: B(
|
|
80
|
+
"group/column relative transition-all duration-200",
|
|
81
|
+
!r && "hover:-translate-y-0.5 hover:shadow-lg"
|
|
82
|
+
),
|
|
73
83
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ o(R, { className: "sticky top-0 z-10 mb-2 rounded-xl border border-d-border/60 bg-d-sidebar/90 px-2.5 py-2 backdrop-blur", children: /* @__PURE__ */ l("div", { className: "flex w-full items-center justify-between", children: [
|
|
75
85
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
76
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ l(
|
|
77
87
|
"div",
|
|
78
88
|
{
|
|
79
|
-
className: "flex items-center gap-1.5 rounded-
|
|
89
|
+
className: "flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-semibold shadow-sm",
|
|
80
90
|
style: {
|
|
81
|
-
backgroundColor:
|
|
82
|
-
color:
|
|
91
|
+
backgroundColor: K(i, 0.15),
|
|
92
|
+
color: i,
|
|
93
|
+
borderColor: K(i, 0.35)
|
|
83
94
|
},
|
|
84
|
-
children:
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ o(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
className: "size-1.5 rounded-full",
|
|
100
|
+
style: { backgroundColor: i }
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ o("span", { className: "max-w-[150px] truncate", children: e.label })
|
|
104
|
+
]
|
|
85
105
|
}
|
|
86
106
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ o("span", { className: "text-d-muted-foreground inline-flex items-center rounded-full border border-d-border/60 bg-d-muted/40 px-2 py-0.5 text-[11px] font-medium", children: N[e.id]?.length ?? 0 })
|
|
88
108
|
] }),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
109
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
|
|
110
|
+
r && /* @__PURE__ */ o(
|
|
111
|
+
"span",
|
|
112
|
+
{
|
|
113
|
+
className: "text-d-muted-foreground inline-flex size-6 items-center justify-center",
|
|
114
|
+
title: "Colonna bloccata",
|
|
115
|
+
"aria-label": "Colonna bloccata",
|
|
116
|
+
children: /* @__PURE__ */ o(Y, { className: "size-3.5" })
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
z && h && /* @__PURE__ */ o(
|
|
120
|
+
V,
|
|
121
|
+
{
|
|
122
|
+
variant: "ghost",
|
|
123
|
+
size: "icon",
|
|
124
|
+
className: "text-d-muted-foreground hover:text-d-foreground h-6 w-6",
|
|
125
|
+
onClick: () => h(e.id),
|
|
126
|
+
children: /* @__PURE__ */ o(Z, { className: "size-3.5" })
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] })
|
|
99
130
|
] }) }),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
131
|
+
/* @__PURE__ */ o(
|
|
132
|
+
W,
|
|
102
133
|
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const n = C(o);
|
|
108
|
-
O(
|
|
109
|
-
n.id,
|
|
110
|
-
e.id,
|
|
111
|
-
r.id,
|
|
112
|
-
t
|
|
113
|
-
);
|
|
114
|
-
},
|
|
115
|
-
children: /* @__PURE__ */ i(
|
|
116
|
-
J,
|
|
134
|
+
className: "px-1.5 pb-3",
|
|
135
|
+
dropDisabled: r,
|
|
136
|
+
children: N[e.id]?.map((d) => /* @__PURE__ */ o(
|
|
137
|
+
q,
|
|
117
138
|
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
139
|
+
cardId: d.id,
|
|
140
|
+
dropDisabled: r,
|
|
141
|
+
className: "mb-2 border-0 last:mb-0",
|
|
142
|
+
onDropOverListItem: (a, n) => {
|
|
143
|
+
if (r || n === "none") return;
|
|
144
|
+
const s = v(a);
|
|
145
|
+
L(
|
|
146
|
+
s.id,
|
|
147
|
+
d.id,
|
|
148
|
+
e.id,
|
|
149
|
+
n
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
children: /* @__PURE__ */ o(
|
|
153
|
+
E,
|
|
154
|
+
{
|
|
155
|
+
data: d,
|
|
156
|
+
dragDisabled: r,
|
|
157
|
+
className: B(
|
|
158
|
+
"group/card relative rounded-xl border border-transparent shadow-sm transition-all duration-200",
|
|
159
|
+
!r && "hover:-translate-y-0.5 hover:border-d-border/60 hover:shadow-lg"
|
|
133
160
|
),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
161
|
+
backgroundColor: i,
|
|
162
|
+
onEdit: x ? () => x(d, e.id) : void 0,
|
|
163
|
+
actions: D?.(d, e.id),
|
|
164
|
+
meta: d.meta,
|
|
165
|
+
children: g ? g(d, e.id) : /* @__PURE__ */ l(H, { children: [
|
|
166
|
+
/* @__PURE__ */ l("div", { className: "mb-1 flex items-start gap-2", children: [
|
|
167
|
+
d.icon && /* @__PURE__ */ o(
|
|
168
|
+
X,
|
|
169
|
+
{
|
|
170
|
+
name: d.icon,
|
|
171
|
+
size: "sm",
|
|
172
|
+
className: "text-d-muted-foreground mt-0.5 shrink-0"
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
/* @__PURE__ */ o(G, { className: "flex-1 text-sm leading-snug font-semibold", children: d.title })
|
|
176
|
+
] }),
|
|
177
|
+
d.description && /* @__PURE__ */ o(Q, { className: "text-d-muted-foreground mt-1.5 line-clamp-2 text-xs leading-relaxed", children: d.description })
|
|
178
|
+
] })
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
},
|
|
182
|
+
d.id
|
|
183
|
+
))
|
|
184
|
+
}
|
|
185
|
+
)
|
|
143
186
|
]
|
|
144
187
|
},
|
|
145
|
-
|
|
188
|
+
e.id
|
|
146
189
|
);
|
|
147
190
|
}) }) });
|
|
148
191
|
}
|
|
149
192
|
export {
|
|
150
|
-
|
|
193
|
+
ne as AppKanban
|
|
151
194
|
};
|