@baishuyun/ui-base 6.25.0 → 6.26.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/dist/Amap/index.js +1 -1
- package/dist/Calendar/{Calendar-DpMZOADo.js → Calendar-DDzn7R81.js} +1 -1
- package/dist/Calendar/index.js +3 -3
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/{CheckBox-Cc-7FP-b.js → CheckBox-CtOSHKM0.js} +1 -1
- package/dist/CheckBox/{CheckBox-BGbMzNLG.js → CheckBox-DOdRLFKI.js} +2 -2
- package/dist/CheckBox/index.js +3 -3
- package/dist/ColorPicker/{ColorPicker-C45iWNv0.js → ColorPicker-CpvEY9_p.js} +1 -1
- package/dist/ColorPicker/index.js +2 -2
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DatePicker/{DatePicker-MpFoHCHr.js → DatePicker-jrgAcolw.js} +1 -1
- package/dist/DatePicker/{DatePickerPanel-C4n3podg.js → DatePickerPanel-Ci4quU-q.js} +1 -1
- package/dist/DatePicker/index.js +2 -2
- package/dist/DropDown/index.js +1 -1
- package/dist/Editor/index.js +14 -14
- package/dist/FieldCard/FieldCard-CcLl0Fix.js +186 -0
- package/dist/FieldCard/index.js +3 -0
- package/dist/Gantt/index.js +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/index.js +1 -1
- package/dist/Kanban/index.js +448 -389
- package/dist/Loading/index.js +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/NotFoundContent/index.js +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/ScrollBar/index.js +1 -1
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/{Select-9XzkUm0W.js → Select-C_g3oAkv.js} +9 -4
- package/dist/Select/index.js +5 -5
- package/dist/Table/index.js +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/Tree/index.js +3 -3
- package/dist/components/CheckBox/interface.d.ts +4 -0
- package/dist/components/Editor/interface.d.ts +4 -0
- package/dist/components/FieldCard/FieldCard.d.ts +8 -0
- package/dist/components/FieldCard/FieldCardSkeleton.d.ts +2 -0
- package/dist/components/FieldCard/index.d.ts +2 -0
- package/dist/components/FieldCard/interface.d.ts +61 -0
- package/dist/components/FieldCard/style/index.d.ts +1 -0
- package/dist/components/FieldCard/style/resolveFieldCardThemeVars.d.ts +5 -0
- package/dist/components/Kanban/Kanban.d.ts +1 -1
- package/dist/components/Kanban/KanbanCardItem.d.ts +22 -6
- package/dist/components/Kanban/KanbanCardList.d.ts +10 -3
- package/dist/components/Kanban/KanbanColumnView.d.ts +10 -6
- package/dist/components/Kanban/index.d.ts +2 -2
- package/dist/components/Kanban/interface.d.ts +100 -31
- package/dist/components/Kanban/resolveDrop.d.ts +0 -1
- package/dist/components/Kanban/selection.d.ts +2 -2
- package/dist/components/Kanban/style/index.d.ts +1 -0
- package/dist/components/Kanban/style/resolveKanbanThemeVars.d.ts +12 -0
- package/dist/index.js +8 -8
- package/dist/style.css +1 -1
- package/dist/vendors/{Tree-BkxKK0Sf.js → Tree-f0FxoFIC.js} +1 -1
- package/dist/vendors/{version-Nw7Mc7qj.js → version-DUd4fmF6.js} +1 -1
- package/package.json +1 -1
- package/dist/components/Kanban/KanbanCardFace.d.ts +0 -14
package/dist/Kanban/index.js
CHANGED
|
@@ -1,164 +1,168 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
1
|
+
import "../vendors/version-DUd4fmF6.js";
|
|
2
2
|
import "../ScrollBar/style-D26azwz6.js";
|
|
3
3
|
import { t as e } from "../Icon/Icon-CcKDWNGy.js";
|
|
4
4
|
import "../vendors/LocaleContext-CsTLO_Y2.js";
|
|
5
5
|
import { t } from "../vendors/useLocale-3oUjPb-k.js";
|
|
6
|
-
import "../
|
|
7
|
-
import
|
|
8
|
-
import { t as r } from "../
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
columnCheck: "
|
|
45
|
-
columnCheckVisible: "
|
|
46
|
-
cardDragging: "
|
|
47
|
-
dropIndicator: "
|
|
48
|
-
cardOverlay: "
|
|
49
|
-
columnOverlay: "
|
|
50
|
-
paging: "
|
|
51
|
-
|
|
52
|
-
add: "_add_1ql5o_155"
|
|
6
|
+
import { t as n } from "../vendors/cssVars-UpriQzph.js";
|
|
7
|
+
import "../CheckBox/CheckBox-DOdRLFKI.js";
|
|
8
|
+
import { t as r } from "../CheckBox/CheckBox-CtOSHKM0.js";
|
|
9
|
+
import { t as i } from "../ScrollBar/ScrollBar-IMTuAOF5.js";
|
|
10
|
+
import { t as a } from "../FieldCard/FieldCard-CcLl0Fix.js";
|
|
11
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
12
|
+
import { useCallback as l, useEffect as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
13
|
+
import h from "clsx";
|
|
14
|
+
import { useControllableValue as g } from "ahooks";
|
|
15
|
+
import { useVirtualizer as _ } from "@tanstack/react-virtual";
|
|
16
|
+
import { DndContext as v, DragOverlay as y, MeasuringStrategy as b, PointerSensor as x, closestCenter as S, pointerWithin as C, rectIntersection as w, useDndContext as T, useDndMonitor as ee, useDraggable as E, useDroppable as D, useSensor as O, useSensors as k } from "@dnd-kit/core";
|
|
17
|
+
import { SortableContext as A, horizontalListSortingStrategy as j, useSortable as M } from "@dnd-kit/sortable";
|
|
18
|
+
import { CSS as N } from "@dnd-kit/utilities";
|
|
19
|
+
//#region src/components/Kanban/interface.ts
|
|
20
|
+
var P = {
|
|
21
|
+
small: 200,
|
|
22
|
+
middle: 260,
|
|
23
|
+
large: 340
|
|
24
|
+
}, F = 80, I = { uncheckedBg: "#fff" }, L = {
|
|
25
|
+
root: "_root_1rtd0_1",
|
|
26
|
+
board: "_board_1rtd0_8",
|
|
27
|
+
column: "_column_1rtd0_19",
|
|
28
|
+
columnCollapsed: "_columnCollapsed_1rtd0_32",
|
|
29
|
+
columnDragging: "_columnDragging_1rtd0_38",
|
|
30
|
+
header: "_header_1rtd0_42",
|
|
31
|
+
toggle: "_toggle_1rtd0_54",
|
|
32
|
+
headerCollapsed: "_headerCollapsed_1rtd0_54",
|
|
33
|
+
headerDraggable: "_headerDraggable_1rtd0_67",
|
|
34
|
+
titleRow: "_titleRow_1rtd0_71",
|
|
35
|
+
title: "_title_1rtd0_71",
|
|
36
|
+
count: "_count_1rtd0_91",
|
|
37
|
+
collapsedTitle: "_collapsedTitle_1rtd0_115",
|
|
38
|
+
list: "_list_1rtd0_127",
|
|
39
|
+
listScroll: "_listScroll_1rtd0_134",
|
|
40
|
+
listFill: "_listFill_1rtd0_135",
|
|
41
|
+
addAnchor: "_addAnchor_1rtd0_140",
|
|
42
|
+
cardSlot: "_cardSlot_1rtd0_146",
|
|
43
|
+
card: "_card_1rtd0_146",
|
|
44
|
+
columnCheck: "_columnCheck_1rtd0_158",
|
|
45
|
+
columnCheckVisible: "_columnCheckVisible_1rtd0_176",
|
|
46
|
+
cardDragging: "_cardDragging_1rtd0_183",
|
|
47
|
+
dropIndicator: "_dropIndicator_1rtd0_191",
|
|
48
|
+
cardOverlay: "_cardOverlay_1rtd0_202",
|
|
49
|
+
columnOverlay: "_columnOverlay_1rtd0_207",
|
|
50
|
+
paging: "_paging_1rtd0_214",
|
|
51
|
+
add: "_add_1rtd0_140"
|
|
53
52
|
};
|
|
54
53
|
//#endregion
|
|
55
|
-
//#region src/components/Kanban/
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
children: [
|
|
66
|
-
|
|
67
|
-
children: [c ? /* @__PURE__ */ a("div", {
|
|
68
|
-
className: j.shellCheck,
|
|
54
|
+
//#region src/components/Kanban/KanbanCardItem.tsx
|
|
55
|
+
function R({ card: e, selected: t, loading: n, checkable: i, coverLayout: o, fieldLayout: l = "vertical", size: u = "middle", checkboxTheme: d, onChecked: f }) {
|
|
56
|
+
return /* @__PURE__ */ c(a, {
|
|
57
|
+
title: e.title,
|
|
58
|
+
cover: e.cover,
|
|
59
|
+
coverLayout: o,
|
|
60
|
+
size: u,
|
|
61
|
+
layout: l,
|
|
62
|
+
selected: t,
|
|
63
|
+
loading: n,
|
|
64
|
+
children: [
|
|
65
|
+
i ? /* @__PURE__ */ s(a.Check, {
|
|
69
66
|
"data-kanban-no-drag": "",
|
|
70
67
|
"data-testid": `kanban-card-check-${e.id}`,
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
children: /* @__PURE__ */ s(r, {
|
|
69
|
+
theme: d ?? I,
|
|
70
|
+
checked: t,
|
|
71
|
+
onChange: (t) => f(e.id, t)
|
|
74
72
|
})
|
|
75
|
-
}) : null,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
}) : null,
|
|
74
|
+
e.fields?.map((e, t) => /* @__PURE__ */ s(a.Meta, {
|
|
75
|
+
label: e.label,
|
|
76
|
+
icon: e.icon,
|
|
77
|
+
value: e.value
|
|
78
|
+
}, e.key ?? t)),
|
|
79
|
+
e.footer ? /* @__PURE__ */ s(a.Footer, {
|
|
80
|
+
"data-kanban-no-drag": "",
|
|
81
|
+
children: e.footer
|
|
82
|
+
}) : null
|
|
83
|
+
]
|
|
80
84
|
});
|
|
81
85
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
function N(e, t) {
|
|
85
|
-
if (e.length === 0) return !1;
|
|
86
|
-
let n = new Set(t), r = new Set(e), i = e.some((e) => !n.has(e)), a = t.some((e) => !r.has(e));
|
|
87
|
-
return i && !a;
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/components/Kanban/KanbanCardItem.tsx
|
|
91
|
-
function P({ card: e, columnId: t, index: n, draggable: r, droppable: i, selected: s, loading: c, checkable: l, onChecked: u, renderCardBody: d }) {
|
|
92
|
-
let f = r && !c, { attributes: p, listeners: m, setNodeRef: h, isDragging: g } = C({
|
|
86
|
+
function z({ card: e, columnId: t, index: n, selected: r, loading: i, checkable: a, cardDraggable: o, coverLayout: l, fieldLayout: u, size: d, checkboxTheme: f, onItemClick: p, onChecked: m }) {
|
|
87
|
+
let h = o && !i, { attributes: g, listeners: _, setNodeRef: v, isDragging: y } = E({
|
|
93
88
|
id: e.id,
|
|
94
|
-
disabled: !
|
|
89
|
+
disabled: !h,
|
|
95
90
|
data: {
|
|
96
91
|
type: "card",
|
|
97
92
|
columnId: t,
|
|
98
93
|
index: n
|
|
99
94
|
}
|
|
100
|
-
}), { setNodeRef:
|
|
95
|
+
}), { setNodeRef: b, isOver: x } = D({
|
|
101
96
|
id: `card:${t}:${e.id}`,
|
|
102
|
-
disabled: !i,
|
|
103
97
|
data: {
|
|
104
98
|
type: "card",
|
|
105
99
|
columnId: t,
|
|
106
100
|
index: n
|
|
107
101
|
}
|
|
108
|
-
}), { active:
|
|
109
|
-
return /* @__PURE__ */
|
|
102
|
+
}), { active: S } = T(), C = S?.data.current, w = x && C?.type === "card" && C.columnId !== t;
|
|
103
|
+
return /* @__PURE__ */ c("div", {
|
|
110
104
|
ref: (e) => {
|
|
111
|
-
|
|
105
|
+
v(e), b(e);
|
|
112
106
|
},
|
|
113
|
-
className: `${
|
|
107
|
+
className: `${L.card} ${y ? L.cardDragging : ""}`,
|
|
114
108
|
style: {
|
|
115
|
-
paddingTop:
|
|
109
|
+
paddingTop: w ? 12 : 0,
|
|
116
110
|
transition: "opacity 0.2s ease, padding 0.2s ease"
|
|
117
111
|
},
|
|
118
112
|
"data-testid": `kanban-card-${e.id}`,
|
|
119
113
|
"data-card-id": e.id,
|
|
120
|
-
"data-loading":
|
|
121
|
-
"data-selected":
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
"data-loading": i ? "true" : "false",
|
|
115
|
+
"data-selected": r ? "true" : "false",
|
|
116
|
+
onClick: (n) => {
|
|
117
|
+
i || n.target instanceof Element && n.target.closest("[data-kanban-no-drag]") || p?.(e.id, t);
|
|
118
|
+
},
|
|
119
|
+
...g,
|
|
120
|
+
...h ? _ : void 0,
|
|
121
|
+
children: [w ? /* @__PURE__ */ s("div", { className: L.dropIndicator }) : null, /* @__PURE__ */ s(R, {
|
|
125
122
|
card: e,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
selected: r,
|
|
124
|
+
loading: i,
|
|
125
|
+
checkable: a,
|
|
126
|
+
coverLayout: l,
|
|
127
|
+
fieldLayout: u,
|
|
128
|
+
size: d,
|
|
129
|
+
checkboxTheme: f,
|
|
130
|
+
onChecked: m
|
|
133
131
|
})]
|
|
134
132
|
});
|
|
135
133
|
}
|
|
136
134
|
//#endregion
|
|
135
|
+
//#region src/components/Kanban/columnListMotion.ts
|
|
136
|
+
function B(e, t) {
|
|
137
|
+
if (e.length === 0) return !1;
|
|
138
|
+
let n = new Set(t), r = new Set(e), i = e.some((e) => !n.has(e)), a = t.some((e) => !r.has(e));
|
|
139
|
+
return i && !a;
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
137
142
|
//#region src/components/Kanban/KanbanCardList.tsx
|
|
138
|
-
var
|
|
139
|
-
function
|
|
140
|
-
let [
|
|
143
|
+
var V = 20, H = 48, U = 12, W = 200, te = 54, ne = 34;
|
|
144
|
+
function G({ column: e, estimate: n, selectedIds: r, loadingIds: a, checkable: o, cardDraggable: f, coverLayout: h, fieldLayout: g, size: v, checkboxTheme: y, onItemClick: b, onChecked: x, footer: S, onReachEnd: C }) {
|
|
145
|
+
let [w, T] = m(null), [E, O] = m(0), k = p(!1), A = p([]), j = p(/* @__PURE__ */ new Map()), M = p(0), N = p(null), P = e.items.map((e) => e.id), F = P.join("\0"), I = B(A.current, P), [R, G] = m(!1), re = I || R ? `transform ${W}ms ease` : void 0, K = I || R ? `height ${W}ms ease` : void 0, { setNodeRef: ie } = D({
|
|
141
146
|
id: `column-body:${e.id}`,
|
|
142
|
-
disabled: !U,
|
|
143
147
|
data: {
|
|
144
148
|
type: "column-body",
|
|
145
149
|
columnId: e.id,
|
|
146
|
-
index: e.
|
|
150
|
+
index: e.items.length
|
|
147
151
|
}
|
|
148
|
-
}),
|
|
149
|
-
count: e.
|
|
150
|
-
getScrollElement: () =>
|
|
151
|
-
estimateSize: () =>
|
|
152
|
+
}), q = _({
|
|
153
|
+
count: e.items.length,
|
|
154
|
+
getScrollElement: () => w,
|
|
155
|
+
estimateSize: () => n,
|
|
152
156
|
overscan: 6,
|
|
153
|
-
getItemKey: (t) => e.
|
|
157
|
+
getItemKey: (t) => e.items[t]?.id ?? t
|
|
154
158
|
});
|
|
155
|
-
|
|
156
|
-
let t = /* @__PURE__ */ new Map();
|
|
157
|
-
for (let n of
|
|
158
|
-
let r = e
|
|
159
|
-
r && t.set(r
|
|
159
|
+
d(() => {
|
|
160
|
+
let e = F === "" ? [] : F.split("\0"), t = /* @__PURE__ */ new Map();
|
|
161
|
+
for (let n of q.getVirtualItems()) {
|
|
162
|
+
let r = e[n.index];
|
|
163
|
+
r && t.set(r, n.start);
|
|
160
164
|
}
|
|
161
|
-
let n =
|
|
165
|
+
let n = q.getTotalSize(), r = N.current, i = B(A.current, e);
|
|
162
166
|
if (i && r) {
|
|
163
167
|
let e = /* @__PURE__ */ new Map();
|
|
164
168
|
r.querySelectorAll("[data-card-id]").forEach((t) => {
|
|
@@ -166,267 +170,307 @@ function B({ column: e, estimate: t, selectedIds: n, loadingIds: i, checkable: u
|
|
|
166
170
|
n && t.parentElement && e.set(n, t.parentElement);
|
|
167
171
|
});
|
|
168
172
|
for (let [n, r] of t) {
|
|
169
|
-
let t =
|
|
173
|
+
let t = j.current.get(n), i = e.get(n);
|
|
170
174
|
t === void 0 || t === r || !i || (i.style.transition = "none", i.style.transform = `translateY(${t}px)`);
|
|
171
175
|
}
|
|
172
|
-
|
|
176
|
+
M.current !== n && (r.style.transition = "none", r.style.height = `${M.current}px`), r.offsetHeight;
|
|
173
177
|
for (let [n, r] of t) {
|
|
174
|
-
let t =
|
|
175
|
-
t === void 0 || t === r || !i || (i.style.transition = `transform ${
|
|
178
|
+
let t = j.current.get(n), i = e.get(n);
|
|
179
|
+
t === void 0 || t === r || !i || (i.style.transition = `transform ${W}ms ease`, i.style.transform = `translateY(${r}px)`);
|
|
176
180
|
}
|
|
177
|
-
|
|
181
|
+
M.current !== n && (r.style.transition = `height ${W}ms ease`, r.style.height = `${n}px`);
|
|
178
182
|
}
|
|
179
|
-
|
|
180
|
-
}, [
|
|
181
|
-
if (!
|
|
182
|
-
let e = window.setTimeout(() =>
|
|
183
|
+
A.current = e, j.current = t, M.current = n, i && G(!0);
|
|
184
|
+
}, [F, q]), u(() => {
|
|
185
|
+
if (!R) return;
|
|
186
|
+
let e = window.setTimeout(() => G(!1), W);
|
|
183
187
|
return () => window.clearTimeout(e);
|
|
184
|
-
}, [
|
|
185
|
-
let
|
|
186
|
-
|
|
187
|
-
}, [
|
|
188
|
-
|
|
188
|
+
}, [R]);
|
|
189
|
+
let J = l((e) => {
|
|
190
|
+
ie(e), T(e), O(e?.clientHeight ?? 0);
|
|
191
|
+
}, [ie]), { t: ae } = t(), Y = p(e.paging?.loading), oe = p(e.items.length);
|
|
192
|
+
u(() => {
|
|
193
|
+
let t = Y.current && !e.paging?.loading, n = oe.current !== e.items.length;
|
|
194
|
+
(t || n) && (k.current = !1), Y.current = e.paging?.loading, oe.current = e.items.length;
|
|
195
|
+
}, [
|
|
196
|
+
e.id,
|
|
197
|
+
e.items.length,
|
|
198
|
+
e.paging?.loading
|
|
199
|
+
]);
|
|
200
|
+
let X = l((t) => {
|
|
201
|
+
if (!C || e.paging?.loading || e.paging?.noMore) return;
|
|
189
202
|
let n = t.target;
|
|
190
203
|
if (n instanceof HTMLElement) {
|
|
191
|
-
if (n.scrollHeight - n.scrollTop - n.clientHeight >
|
|
192
|
-
|
|
204
|
+
if (n.scrollHeight - n.scrollTop - n.clientHeight > V) {
|
|
205
|
+
k.current = !1;
|
|
193
206
|
return;
|
|
194
207
|
}
|
|
195
|
-
|
|
208
|
+
k.current || (k.current = !0, C(e.id));
|
|
196
209
|
}
|
|
197
210
|
}, [
|
|
198
211
|
e.id,
|
|
199
|
-
e.paging?.
|
|
212
|
+
e.paging?.noMore,
|
|
200
213
|
e.paging?.loading,
|
|
201
|
-
|
|
214
|
+
C
|
|
202
215
|
]);
|
|
203
|
-
|
|
204
|
-
if (!
|
|
205
|
-
let e = new ResizeObserver(() =>
|
|
206
|
-
return e.observe(
|
|
207
|
-
}, [
|
|
208
|
-
let
|
|
209
|
-
return
|
|
216
|
+
u(() => {
|
|
217
|
+
if (!w) return;
|
|
218
|
+
let e = new ResizeObserver(() => O(w.clientHeight));
|
|
219
|
+
return e.observe(w), () => e.disconnect();
|
|
220
|
+
}, [w]);
|
|
221
|
+
let se = !!e.paging?.loading, ce = !!(e.paging?.noMore && !e.paging?.loading), le = se || ce, ue = q.getTotalSize(), de = ue, Z = ue + (le ? ne : 0), Q = !!S && E > 0 && Z + te > E, $ = Z + (S && !Q ? te : 0);
|
|
222
|
+
return ee({ onDragMove(t) {
|
|
210
223
|
let n = t.active.data.current;
|
|
211
|
-
if (!
|
|
224
|
+
if (!w || n?.type !== "card" || n.columnId === e.id) return;
|
|
212
225
|
let r = t.active.rect.current.translated;
|
|
213
226
|
if (!r) return;
|
|
214
|
-
let i =
|
|
215
|
-
a < i.top +
|
|
216
|
-
} }), /* @__PURE__ */
|
|
217
|
-
className:
|
|
218
|
-
children: [/* @__PURE__ */
|
|
219
|
-
className:
|
|
220
|
-
viewportRef:
|
|
221
|
-
onScroll:
|
|
227
|
+
let i = w.getBoundingClientRect(), a = r.top + r.height / 2;
|
|
228
|
+
a < i.top + H ? w.scrollTop -= U : a > i.bottom - H && (w.scrollTop += U);
|
|
229
|
+
} }), /* @__PURE__ */ c("div", {
|
|
230
|
+
className: L.list,
|
|
231
|
+
children: [/* @__PURE__ */ s(i, {
|
|
232
|
+
className: Q ? L.listScroll : L.listFill,
|
|
233
|
+
viewportRef: J,
|
|
234
|
+
onScroll: X,
|
|
222
235
|
options: { overflow: {
|
|
223
236
|
x: "hidden",
|
|
224
237
|
y: "scroll"
|
|
225
238
|
} },
|
|
226
|
-
children: /* @__PURE__ */
|
|
227
|
-
ref:
|
|
239
|
+
children: /* @__PURE__ */ c("div", {
|
|
240
|
+
ref: N,
|
|
228
241
|
style: {
|
|
229
|
-
height:
|
|
242
|
+
height: $,
|
|
230
243
|
position: "relative",
|
|
231
244
|
width: "100%",
|
|
232
|
-
transition:
|
|
245
|
+
transition: K
|
|
233
246
|
},
|
|
234
|
-
children: [
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
"
|
|
238
|
-
|
|
239
|
-
|
|
247
|
+
children: [
|
|
248
|
+
q.getVirtualItems().map((t) => {
|
|
249
|
+
let n = e.items[t.index];
|
|
250
|
+
return n ? /* @__PURE__ */ s("div", {
|
|
251
|
+
"data-index": t.index,
|
|
252
|
+
ref: q.measureElement,
|
|
253
|
+
className: L.cardSlot,
|
|
254
|
+
style: {
|
|
255
|
+
position: "absolute",
|
|
256
|
+
top: 0,
|
|
257
|
+
left: 0,
|
|
258
|
+
width: "100%",
|
|
259
|
+
transform: `translateY(${t.start}px)`,
|
|
260
|
+
transition: re
|
|
261
|
+
},
|
|
262
|
+
children: /* @__PURE__ */ s(z, {
|
|
263
|
+
card: n,
|
|
264
|
+
columnId: e.id,
|
|
265
|
+
index: t.index,
|
|
266
|
+
selected: r.has(n.id),
|
|
267
|
+
loading: a.has(n.id),
|
|
268
|
+
checkable: o,
|
|
269
|
+
cardDraggable: f,
|
|
270
|
+
coverLayout: h,
|
|
271
|
+
fieldLayout: g,
|
|
272
|
+
size: v,
|
|
273
|
+
checkboxTheme: y,
|
|
274
|
+
onItemClick: b,
|
|
275
|
+
onChecked: x
|
|
276
|
+
})
|
|
277
|
+
}, n.id) : null;
|
|
278
|
+
}),
|
|
279
|
+
se ? /* @__PURE__ */ s("div", {
|
|
280
|
+
className: L.paging,
|
|
281
|
+
style: {
|
|
282
|
+
position: "absolute",
|
|
283
|
+
top: de,
|
|
284
|
+
left: 0,
|
|
285
|
+
right: 0
|
|
286
|
+
},
|
|
287
|
+
"data-testid": `kanban-paging-loading-${e.id}`,
|
|
288
|
+
children: ae("kanban.loadingMore")
|
|
289
|
+
}) : null,
|
|
290
|
+
ce ? /* @__PURE__ */ s("div", {
|
|
291
|
+
className: L.paging,
|
|
240
292
|
style: {
|
|
241
293
|
position: "absolute",
|
|
242
|
-
top:
|
|
294
|
+
top: de,
|
|
243
295
|
left: 0,
|
|
244
|
-
|
|
245
|
-
transform: `translateY(${t.start}px)`,
|
|
246
|
-
transition: H
|
|
296
|
+
right: 0
|
|
247
297
|
},
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
onChecked: m,
|
|
258
|
-
renderCardBody: h
|
|
259
|
-
})
|
|
260
|
-
}, r.id) : null;
|
|
261
|
-
}), g && !J ? /* @__PURE__ */ a("div", {
|
|
262
|
-
className: j.addAnchor,
|
|
263
|
-
style: { top: q },
|
|
264
|
-
children: g
|
|
265
|
-
}) : null]
|
|
298
|
+
"data-testid": `kanban-paging-noMore-${e.id}`,
|
|
299
|
+
children: ae("kanban.noMore")
|
|
300
|
+
}) : null,
|
|
301
|
+
S && !Q ? /* @__PURE__ */ s("div", {
|
|
302
|
+
className: L.addAnchor,
|
|
303
|
+
style: { top: Z },
|
|
304
|
+
children: S
|
|
305
|
+
}) : null
|
|
306
|
+
]
|
|
266
307
|
})
|
|
267
|
-
}),
|
|
308
|
+
}), Q ? S : null]
|
|
268
309
|
});
|
|
269
310
|
}
|
|
270
311
|
//#endregion
|
|
271
312
|
//#region src/components/Kanban/selection.ts
|
|
272
|
-
function
|
|
273
|
-
|
|
274
|
-
return n && !r ? [...e, t] : !n && r ? e.filter((e) => e !== t) : [...e];
|
|
313
|
+
function re(e, t, n) {
|
|
314
|
+
return n === e.includes(t) ? e : n ? [...e, t] : e.filter((e) => e !== t);
|
|
275
315
|
}
|
|
276
|
-
function
|
|
316
|
+
function K(e, t) {
|
|
277
317
|
if (t.length === 0) return "unchecked";
|
|
278
318
|
let n = 0;
|
|
279
319
|
for (let r of t) e.has(r) && (n += 1);
|
|
280
320
|
return n === 0 ? "unchecked" : n === t.length ? "checked" : "indeterminate";
|
|
281
321
|
}
|
|
282
|
-
function
|
|
283
|
-
if (t.length === 0) return
|
|
322
|
+
function ie(e, t, n) {
|
|
323
|
+
if (t.length === 0) return e;
|
|
284
324
|
if (!n) {
|
|
285
325
|
let n = new Set(t);
|
|
286
|
-
return e.filter((e) => !n.has(e));
|
|
326
|
+
return e.some((e) => n.has(e)) ? e.filter((e) => !n.has(e)) : e;
|
|
287
327
|
}
|
|
328
|
+
if (t.every((t) => e.includes(t))) return e;
|
|
288
329
|
let r = new Set(e);
|
|
289
330
|
for (let e of t) r.add(e);
|
|
290
331
|
return [...r];
|
|
291
332
|
}
|
|
292
333
|
//#endregion
|
|
293
334
|
//#region src/components/Kanban/KanbanColumnView.tsx
|
|
294
|
-
var
|
|
295
|
-
function
|
|
296
|
-
let { t:
|
|
297
|
-
id:
|
|
298
|
-
disabled: !
|
|
335
|
+
var q = 120, J = 40;
|
|
336
|
+
function ae({ column: n, columnWidth: i, collapsed: a, selectedIds: l, loadingIds: u, cardCheckable: d, columnCheckable: f, cardDraggable: p, coverLayout: m, fieldLayout: h, size: g, checkboxTheme: _, onItemClick: v, onCardChecked: y, onColumnChecked: b, onToggleCollapse: x, onReachEnd: S, onColumnAdd: C }) {
|
|
337
|
+
let { t: w } = t(), { active: ee } = T(), E = ee?.data.current?.type === "card", D = n.sortable !== !1 && !E, { setNodeRef: O, attributes: k, listeners: A, isDragging: j, transform: P, transition: F } = M({
|
|
338
|
+
id: n.id,
|
|
339
|
+
disabled: !D,
|
|
299
340
|
data: {
|
|
300
341
|
type: "column",
|
|
301
|
-
columnId:
|
|
302
|
-
index:
|
|
342
|
+
columnId: n.id,
|
|
343
|
+
index: n.items.length
|
|
303
344
|
}
|
|
304
|
-
}),
|
|
305
|
-
className: `${
|
|
345
|
+
}), R = n.items.map((e) => e.id), z = K(l, R), B = f ? /* @__PURE__ */ s("div", {
|
|
346
|
+
className: `${L.columnCheck} ${z === "unchecked" ? "" : L.columnCheckVisible}`,
|
|
306
347
|
"data-kanban-no-drag": "",
|
|
307
|
-
"data-testid": `kanban-column-check-${
|
|
308
|
-
"data-check":
|
|
309
|
-
children: /* @__PURE__ */
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
348
|
+
"data-testid": `kanban-column-check-${n.id}`,
|
|
349
|
+
"data-check": z,
|
|
350
|
+
children: /* @__PURE__ */ s(r, {
|
|
351
|
+
theme: _ ?? I,
|
|
352
|
+
checked: z === "checked",
|
|
353
|
+
indeterminate: z === "indeterminate",
|
|
354
|
+
onChange: (e) => b(R, e)
|
|
313
355
|
})
|
|
314
356
|
}) : null;
|
|
315
|
-
return /* @__PURE__ */
|
|
316
|
-
ref:
|
|
317
|
-
className: `${
|
|
357
|
+
return /* @__PURE__ */ c("div", {
|
|
358
|
+
ref: O,
|
|
359
|
+
className: `${L.column} ${a ? L.columnCollapsed : ""} ${j ? L.columnDragging : ""}`,
|
|
318
360
|
style: {
|
|
319
|
-
width:
|
|
320
|
-
transform:
|
|
321
|
-
transition:
|
|
361
|
+
width: a ? J : i,
|
|
362
|
+
transform: N.Transform.toString(P),
|
|
363
|
+
transition: F
|
|
322
364
|
},
|
|
323
|
-
"data-testid": `kanban-column-${
|
|
324
|
-
"data-column-id":
|
|
325
|
-
"data-sortable":
|
|
326
|
-
children: [/* @__PURE__ */
|
|
327
|
-
className: `${
|
|
328
|
-
...
|
|
329
|
-
...
|
|
330
|
-
children: [
|
|
331
|
-
className:
|
|
365
|
+
"data-testid": `kanban-column-${n.id}`,
|
|
366
|
+
"data-column-id": n.id,
|
|
367
|
+
"data-sortable": D ? "true" : "false",
|
|
368
|
+
children: [/* @__PURE__ */ c("div", {
|
|
369
|
+
className: `${L.header} ${a ? L.headerCollapsed : ""} ${D ? L.headerDraggable : ""}`,
|
|
370
|
+
...k,
|
|
371
|
+
...D ? A : void 0,
|
|
372
|
+
children: [a ? /* @__PURE__ */ c("div", {
|
|
373
|
+
className: L.collapsedTitle,
|
|
332
374
|
children: [
|
|
333
|
-
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
className:
|
|
337
|
-
"data-testid": `kanban-count-${
|
|
338
|
-
children:
|
|
375
|
+
B,
|
|
376
|
+
/* @__PURE__ */ s("span", { children: n.title }),
|
|
377
|
+
/* @__PURE__ */ s("span", {
|
|
378
|
+
className: L.count,
|
|
379
|
+
"data-testid": `kanban-count-${n.id}`,
|
|
380
|
+
children: n.total
|
|
339
381
|
})
|
|
340
382
|
]
|
|
341
|
-
}) : /* @__PURE__ */
|
|
342
|
-
className:
|
|
383
|
+
}) : /* @__PURE__ */ c("div", {
|
|
384
|
+
className: L.titleRow,
|
|
343
385
|
children: [
|
|
344
|
-
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
className:
|
|
347
|
-
children:
|
|
386
|
+
B,
|
|
387
|
+
/* @__PURE__ */ s("div", {
|
|
388
|
+
className: L.title,
|
|
389
|
+
children: n.title
|
|
348
390
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
className:
|
|
351
|
-
"data-testid": `kanban-count-${
|
|
352
|
-
children:
|
|
391
|
+
/* @__PURE__ */ s("span", {
|
|
392
|
+
className: L.count,
|
|
393
|
+
"data-testid": `kanban-count-${n.id}`,
|
|
394
|
+
children: n.total
|
|
353
395
|
})
|
|
354
396
|
]
|
|
355
|
-
}), /* @__PURE__ */
|
|
397
|
+
}), /* @__PURE__ */ s("button", {
|
|
356
398
|
type: "button",
|
|
357
|
-
className:
|
|
399
|
+
className: L.toggle,
|
|
358
400
|
"data-kanban-no-drag": "",
|
|
359
|
-
"aria-label":
|
|
360
|
-
onClick: () =>
|
|
361
|
-
children: /* @__PURE__ */
|
|
362
|
-
name:
|
|
401
|
+
"aria-label": w(a ? "kanban.expand" : "kanban.collapse"),
|
|
402
|
+
onClick: () => x?.(n.id),
|
|
403
|
+
children: /* @__PURE__ */ s(e, {
|
|
404
|
+
name: a ? "magnify" : "reduction",
|
|
363
405
|
size: 16
|
|
364
406
|
})
|
|
365
407
|
})]
|
|
366
|
-
}),
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
408
|
+
}), a ? null : /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s(G, {
|
|
409
|
+
column: n,
|
|
410
|
+
estimate: q,
|
|
411
|
+
selectedIds: l,
|
|
412
|
+
loadingIds: u,
|
|
413
|
+
checkable: d,
|
|
414
|
+
cardDraggable: p,
|
|
415
|
+
coverLayout: m,
|
|
416
|
+
fieldLayout: h,
|
|
417
|
+
size: g,
|
|
418
|
+
checkboxTheme: _,
|
|
419
|
+
onItemClick: v,
|
|
420
|
+
onChecked: y,
|
|
421
|
+
onReachEnd: S,
|
|
422
|
+
footer: n.addable ? /* @__PURE__ */ s("div", {
|
|
423
|
+
className: L.add,
|
|
424
|
+
children: /* @__PURE__ */ s("button", {
|
|
425
|
+
type: "button",
|
|
426
|
+
"data-kanban-no-drag": "",
|
|
427
|
+
"aria-label": w("kanban.add"),
|
|
428
|
+
"data-testid": `kanban-add-${n.id}`,
|
|
429
|
+
onClick: () => C?.(n.id),
|
|
430
|
+
children: /* @__PURE__ */ s(e, {
|
|
431
|
+
name: "add",
|
|
432
|
+
size: 16
|
|
388
433
|
})
|
|
389
|
-
})
|
|
390
|
-
}),
|
|
391
|
-
r.paging?.loading ? /* @__PURE__ */ a("div", {
|
|
392
|
-
className: j.paging,
|
|
393
|
-
"data-testid": `kanban-paging-loading-${r.id}`,
|
|
394
|
-
children: S("kanban.loadingMore")
|
|
395
|
-
}) : null,
|
|
396
|
-
r.paging?.nomore && !r.paging.loading ? /* @__PURE__ */ a("div", {
|
|
397
|
-
className: j.paging,
|
|
398
|
-
"data-testid": `kanban-paging-nomore-${r.id}`,
|
|
399
|
-
children: S("kanban.noMore")
|
|
400
|
-
}) : null,
|
|
401
|
-
I ? /* @__PURE__ */ a("div", {
|
|
402
|
-
className: j.footer,
|
|
403
|
-
children: I
|
|
434
|
+
})
|
|
404
435
|
}) : null
|
|
405
|
-
|
|
436
|
+
}) })]
|
|
406
437
|
});
|
|
407
438
|
}
|
|
408
439
|
//#endregion
|
|
409
440
|
//#region src/components/Kanban/KanbanPointerSensor.ts
|
|
410
|
-
var
|
|
441
|
+
var Y = "[data-kanban-no-drag]", oe = class extends x {
|
|
411
442
|
static activators = [{
|
|
412
443
|
eventName: "onPointerDown",
|
|
413
444
|
handler: ({ nativeEvent: e }, t) => {
|
|
414
445
|
if (e.isPrimary === !1 || (e.button ?? 0) !== 0) return !1;
|
|
415
446
|
let n = e.target;
|
|
416
|
-
return n instanceof Element && n.closest(
|
|
447
|
+
return n instanceof Element && n.closest(Y) ? !1 : (t.onActivation?.({ event: e }), !0);
|
|
417
448
|
}
|
|
418
449
|
}];
|
|
450
|
+
}, X = (e) => {
|
|
451
|
+
if (!(e == null || e === "")) return typeof e == "number" ? `${e}px` : String(e);
|
|
452
|
+
}, se = (e) => {
|
|
453
|
+
let t = e?.colorPrimary, n = e?.checkbox?.colorPrimary ?? t;
|
|
454
|
+
return {
|
|
455
|
+
...I,
|
|
456
|
+
...e?.checkbox,
|
|
457
|
+
...n ? { colorPrimary: n } : {}
|
|
458
|
+
};
|
|
459
|
+
}, ce = (e) => {
|
|
460
|
+
if (!e) return {};
|
|
461
|
+
let t = {}, r = e.colorPrimary;
|
|
462
|
+
return n(t, "--bsy-kanban-color-primary", r), n(t, "--bsy-kanban-column-bg", e.columnBg), n(t, "--bsy-kanban-column-title-color", e.columnTitleColor), n(t, "--bsy-kanban-column-count-color", e.columnCountColor), n(t, "--bsy-kanban-column-border-radius", X(e.columnBorderRadius)), n(t, "--bsy-field-card-color-primary", r), n(t, "--bsy-field-card-bg", e.cardBg), n(t, "--bsy-field-card-title-color", e.cardTitleColor), n(t, "--bsy-field-card-label-color", e.cardLabelColor), n(t, "--bsy-field-card-value-color", e.cardValueColor), n(t, "--bsy-field-card-hover-border", e.cardHoverBorderColor ?? r), n(t, "--bsy-field-card-selected-border", e.cardSelectedBorderColor ?? r), n(t, "--bsy-field-card-border-radius", X(e.cardBorderRadius)), n(t, "--bsy-kanban-drop-indicator-color", e.dropIndicatorColor ?? r), n(t, "--bsy-kanban-collapse-icon-color", e.collapseIconColor), n(t, "--bsy-kanban-collapse-icon-hover-color", e.collapseIconHoverColor ?? r), n(t, "--bsy-kanban-add-btn-bg", e.addBtnBg), n(t, "--bsy-kanban-add-btn-hover-bg", e.addBtnHoverBg), n(t, "--bsy-kanban-add-btn-color", e.addBtnColor), n(t, "--bsy-kanban-paging-color", e.pagingTextColor), t;
|
|
419
463
|
};
|
|
420
464
|
//#endregion
|
|
421
465
|
//#region src/components/Kanban/resolveDrop.ts
|
|
422
|
-
function
|
|
466
|
+
function le(e) {
|
|
423
467
|
return e.activeType === "column" ? e.overType !== "column" || !e.overColumnId || e.activeId === e.overColumnId || !e.sortableIds.has(e.activeId) || !e.sortableIds.has(e.overColumnId) ? null : {
|
|
424
468
|
kind: "column",
|
|
425
469
|
payload: {
|
|
426
470
|
activeId: e.activeId,
|
|
427
471
|
overId: e.overColumnId
|
|
428
472
|
}
|
|
429
|
-
} : e.activeType !== "card" || !e.fromColumnId || !e.overColumnId || e.fromColumnId === e.overColumnId ||
|
|
473
|
+
} : e.activeType !== "card" || !e.fromColumnId || !e.overColumnId || e.fromColumnId === e.overColumnId || e.overType !== "card" && e.overType !== "column-body" && e.overType !== "column" || typeof e.overIndex != "number" ? null : {
|
|
430
474
|
kind: "card",
|
|
431
475
|
payload: {
|
|
432
476
|
cardId: e.activeId,
|
|
@@ -437,34 +481,43 @@ function q(e) {
|
|
|
437
481
|
};
|
|
438
482
|
}
|
|
439
483
|
//#endregion
|
|
440
|
-
//#region src/components/Kanban/
|
|
441
|
-
var
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
let
|
|
484
|
+
//#region src/components/Kanban/Kanban.tsx
|
|
485
|
+
var ue = { droppable: { strategy: b.Always } };
|
|
486
|
+
function de(e) {
|
|
487
|
+
return {
|
|
488
|
+
onChange: e?.onChange,
|
|
489
|
+
...e?.selectedItemKeys === void 0 ? {} : { selectedItemKeys: e.selectedItemKeys },
|
|
490
|
+
...e?.defaultSelectedItemKeys === void 0 ? {} : { defaultSelectedItemKeys: e.defaultSelectedItemKeys }
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
function Z({ columns: e, columnSize: t = "middle", columnWidth: n, coverLayout: r, fieldLayout: i = "vertical", itemSelection: a, cardDraggable: o = !0, loadingCardIds: u, onItemClick: d, onCardMove: _, onColumnReorder: b, onColumnAdd: x, onReachEnd: T, className: ee, style: E, theme: D }) {
|
|
494
|
+
let [M, N] = m(null), F = a?.checkable ?? !1, I = a?.columnCheckable ?? !1, [z, B] = g(de(a), {
|
|
495
|
+
defaultValue: [],
|
|
496
|
+
valuePropName: "selectedItemKeys",
|
|
497
|
+
defaultValuePropName: "defaultSelectedItemKeys",
|
|
498
|
+
trigger: "onChange"
|
|
499
|
+
}), V = f(() => ce(D), [D]), H = f(() => se(D), [D]), U = p(null), W = k(O(oe, { activationConstraint: { distance: 8 } })), te = r?.position === "left" || r?.position === "right", ne = n ?? P[t] + (te ? 80 : 0), G = f(() => new Set(z), [z]), K = l((e, t) => {
|
|
500
|
+
let n = re(z, e, t);
|
|
501
|
+
n !== z && B(n);
|
|
502
|
+
}, [z, B]), q = l((e, t) => {
|
|
503
|
+
let n = ie(z, e, t);
|
|
504
|
+
n !== z && B(n);
|
|
505
|
+
}, [z, B]), J = f(() => new Set(u ?? []), [u]), [Y, X] = m([]), Z = f(() => new Set(Y), [Y]), Q = l((e) => {
|
|
506
|
+
X((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
507
|
+
}, []), $ = f(() => e.filter((e) => e.sortable !== !1).map((e) => e.id), [e]), fe = f(() => new Set($), [$]), pe = l((e) => {
|
|
508
|
+
if (U.current === "column") return S(e).filter((t) => e.droppableContainers.find((e) => e.id === t.id)?.data.current?.type === "column");
|
|
509
|
+
let t = C(e), n = (n) => t.find((t) => e.droppableContainers.find((e) => e.id === t.id)?.data.current?.type === n), r = n("card");
|
|
457
510
|
if (r) return [r];
|
|
458
511
|
let i = n("column-body");
|
|
459
512
|
if (i) return [i];
|
|
460
513
|
let a = n("column");
|
|
461
|
-
return a ? [a] :
|
|
462
|
-
}, []),
|
|
514
|
+
return a ? [a] : w(e);
|
|
515
|
+
}, []), me = l((t) => {
|
|
463
516
|
let n = t.active.data.current;
|
|
464
517
|
if (n?.type === "column" && n.columnId) {
|
|
465
518
|
U.current = "column";
|
|
466
519
|
let e = document.querySelector(`[data-column-id="${n.columnId}"]`), r = e instanceof HTMLElement ? e.getBoundingClientRect().height : void 0;
|
|
467
|
-
|
|
520
|
+
N({
|
|
468
521
|
type: "column",
|
|
469
522
|
id: String(t.active.id),
|
|
470
523
|
columnId: n.columnId,
|
|
@@ -473,120 +526,126 @@ function Y({ columns: e, columnSize: t = "middle", columnWidth: n, estimateCardS
|
|
|
473
526
|
return;
|
|
474
527
|
}
|
|
475
528
|
if (n?.type === "card" && n.columnId) {
|
|
476
|
-
let r = e.find((e) => e.id === n.columnId)?.
|
|
477
|
-
U.current = "card",
|
|
529
|
+
let r = e.find((e) => e.id === n.columnId)?.items.find((e) => e.id === String(t.active.id));
|
|
530
|
+
U.current = "card", N({
|
|
478
531
|
type: "card",
|
|
479
532
|
id: String(t.active.id),
|
|
480
533
|
columnId: n.columnId,
|
|
481
534
|
card: r
|
|
482
535
|
});
|
|
483
536
|
}
|
|
484
|
-
}, [e]),
|
|
485
|
-
let t = e.active.data.current, n = e.over?.data.current, r =
|
|
537
|
+
}, [e]), he = l((e) => {
|
|
538
|
+
let t = e.active.data.current, n = e.over?.data.current, r = le({
|
|
486
539
|
activeType: t?.type ?? null,
|
|
487
540
|
activeId: String(e.active.id),
|
|
488
541
|
fromColumnId: t?.columnId,
|
|
489
542
|
overType: n?.type ?? null,
|
|
490
543
|
overColumnId: n?.columnId,
|
|
491
544
|
overIndex: n?.index,
|
|
492
|
-
sortableIds:
|
|
493
|
-
droppableIds: se
|
|
545
|
+
sortableIds: fe
|
|
494
546
|
});
|
|
495
|
-
U.current = null,
|
|
547
|
+
U.current = null, N(null), r?.kind === "card" && _?.(r.payload), r?.kind === "column" && b?.(r.payload);
|
|
496
548
|
}, [
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return /* @__PURE__ */ o(m, {
|
|
549
|
+
_,
|
|
550
|
+
b,
|
|
551
|
+
fe
|
|
552
|
+
]), ge = l(() => {
|
|
553
|
+
U.current = null, N(null);
|
|
554
|
+
}, []), _e = M?.type === "column" ? e.find((e) => e.id === M.columnId) : void 0;
|
|
555
|
+
return /* @__PURE__ */ c(v, {
|
|
505
556
|
sensors: W,
|
|
506
|
-
collisionDetection:
|
|
507
|
-
measuring:
|
|
508
|
-
autoScroll:
|
|
509
|
-
onDragStart:
|
|
510
|
-
onDragEnd:
|
|
511
|
-
onDragCancel:
|
|
512
|
-
children: [/* @__PURE__ */
|
|
513
|
-
className:
|
|
557
|
+
collisionDetection: pe,
|
|
558
|
+
measuring: ue,
|
|
559
|
+
autoScroll: M?.type === "column",
|
|
560
|
+
onDragStart: me,
|
|
561
|
+
onDragEnd: he,
|
|
562
|
+
onDragCancel: ge,
|
|
563
|
+
children: [/* @__PURE__ */ s("div", {
|
|
564
|
+
className: h(L.root, ee),
|
|
565
|
+
style: {
|
|
566
|
+
...V,
|
|
567
|
+
...E
|
|
568
|
+
},
|
|
514
569
|
"data-testid": "kanban-root",
|
|
515
|
-
children: e.length === 0 ? /* @__PURE__ */
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
children: /* @__PURE__ */ a("div", {
|
|
522
|
-
className: j.board,
|
|
523
|
-
children: e.map((e) => /* @__PURE__ */ a(G, {
|
|
570
|
+
children: e.length === 0 ? null : /* @__PURE__ */ s(A, {
|
|
571
|
+
items: $,
|
|
572
|
+
strategy: j,
|
|
573
|
+
children: /* @__PURE__ */ s("div", {
|
|
574
|
+
className: L.board,
|
|
575
|
+
children: e.map((e) => /* @__PURE__ */ s(ae, {
|
|
524
576
|
column: e,
|
|
525
|
-
columnWidth:
|
|
526
|
-
collapsed:
|
|
527
|
-
selectedIds:
|
|
528
|
-
loadingIds:
|
|
529
|
-
cardCheckable:
|
|
530
|
-
columnCheckable:
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
577
|
+
columnWidth: ne,
|
|
578
|
+
collapsed: Z.has(e.id),
|
|
579
|
+
selectedIds: G,
|
|
580
|
+
loadingIds: J,
|
|
581
|
+
cardCheckable: F,
|
|
582
|
+
columnCheckable: I,
|
|
583
|
+
cardDraggable: o,
|
|
584
|
+
coverLayout: r,
|
|
585
|
+
fieldLayout: i,
|
|
586
|
+
size: t,
|
|
587
|
+
checkboxTheme: H,
|
|
588
|
+
onItemClick: d,
|
|
589
|
+
onCardChecked: K,
|
|
590
|
+
onColumnChecked: q,
|
|
591
|
+
onToggleCollapse: Q,
|
|
592
|
+
onReachEnd: T,
|
|
593
|
+
onColumnAdd: x
|
|
539
594
|
}, e.id))
|
|
540
595
|
})
|
|
541
596
|
})
|
|
542
|
-
}), /* @__PURE__ */
|
|
597
|
+
}), /* @__PURE__ */ c(y, {
|
|
543
598
|
dropAnimation: {
|
|
544
599
|
duration: 250,
|
|
545
600
|
easing: "cubic-bezier(0.25, 1, 0.5, 1)"
|
|
546
601
|
},
|
|
547
|
-
children: [
|
|
548
|
-
className:
|
|
602
|
+
children: [M?.type === "card" && M.card ? /* @__PURE__ */ s("div", {
|
|
603
|
+
className: L.cardOverlay,
|
|
604
|
+
style: V,
|
|
549
605
|
"data-testid": "kanban-card-overlay",
|
|
550
|
-
children: /* @__PURE__ */
|
|
551
|
-
card:
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
606
|
+
children: /* @__PURE__ */ s(R, {
|
|
607
|
+
card: M.card,
|
|
608
|
+
selected: G.has(M.card.id),
|
|
609
|
+
loading: J.has(M.card.id),
|
|
610
|
+
checkable: F,
|
|
611
|
+
coverLayout: r,
|
|
612
|
+
fieldLayout: i,
|
|
613
|
+
size: t,
|
|
614
|
+
checkboxTheme: H,
|
|
615
|
+
onChecked: K
|
|
559
616
|
})
|
|
560
|
-
}) : null,
|
|
561
|
-
className: `${
|
|
617
|
+
}) : null, _e ? /* @__PURE__ */ c("div", {
|
|
618
|
+
className: `${L.column} ${L.columnOverlay}`,
|
|
562
619
|
style: {
|
|
563
|
-
width:
|
|
564
|
-
height:
|
|
620
|
+
width: ne,
|
|
621
|
+
height: M?.overlayHeight,
|
|
622
|
+
...V
|
|
565
623
|
},
|
|
566
624
|
"data-testid": "kanban-column-overlay",
|
|
567
|
-
children: [/* @__PURE__ */
|
|
568
|
-
className:
|
|
569
|
-
children: /* @__PURE__ */
|
|
570
|
-
className:
|
|
571
|
-
children: [/* @__PURE__ */
|
|
572
|
-
className:
|
|
573
|
-
children:
|
|
574
|
-
}), /* @__PURE__ */
|
|
575
|
-
className:
|
|
576
|
-
children:
|
|
625
|
+
children: [/* @__PURE__ */ s("div", {
|
|
626
|
+
className: L.header,
|
|
627
|
+
children: /* @__PURE__ */ c("div", {
|
|
628
|
+
className: L.titleRow,
|
|
629
|
+
children: [/* @__PURE__ */ s("div", {
|
|
630
|
+
className: L.title,
|
|
631
|
+
children: _e.title
|
|
632
|
+
}), /* @__PURE__ */ s("span", {
|
|
633
|
+
className: L.count,
|
|
634
|
+
children: _e.total
|
|
577
635
|
})]
|
|
578
636
|
})
|
|
579
|
-
}), /* @__PURE__ */
|
|
580
|
-
className:
|
|
581
|
-
children: /* @__PURE__ */
|
|
637
|
+
}), /* @__PURE__ */ s("div", { children: _e.items.map((e) => /* @__PURE__ */ s("div", {
|
|
638
|
+
className: L.cardSlot,
|
|
639
|
+
children: /* @__PURE__ */ s(R, {
|
|
582
640
|
card: e,
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
641
|
+
selected: G.has(e.id),
|
|
642
|
+
loading: J.has(e.id),
|
|
643
|
+
checkable: F,
|
|
644
|
+
coverLayout: r,
|
|
645
|
+
fieldLayout: i,
|
|
646
|
+
size: t,
|
|
647
|
+
checkboxTheme: H,
|
|
648
|
+
onChecked: K
|
|
590
649
|
})
|
|
591
650
|
}, e.id)) })]
|
|
592
651
|
}) : null]
|
|
@@ -594,4 +653,4 @@ function Y({ columns: e, columnSize: t = "middle", columnWidth: n, estimateCardS
|
|
|
594
653
|
});
|
|
595
654
|
}
|
|
596
655
|
//#endregion
|
|
597
|
-
export {
|
|
656
|
+
export { P as KANBAN_COLUMN_WIDTH, F as KANBAN_COVER_SIDE_EXTRA, Z as default };
|