@baishuyun/ui-base 6.24.8 → 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/{Amap-BGEbAxHf.js → Amap-DC0ZSpys.js} +1 -1
- package/dist/Amap/index.js +4 -4
- package/dist/Calendar/{Calendar-CFa2J6jE.js → Calendar-DDzn7R81.js} +2 -2
- package/dist/Calendar/index.js +5 -5
- 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-DCM3izKF.js → ColorPicker-CpvEY9_p.js} +2 -2
- package/dist/ColorPicker/index.js +4 -4
- package/dist/ConfigProvider/index.js +3 -3
- package/dist/DatePicker/{DatePicker-Digb83UQ.js → DatePicker-jrgAcolw.js} +2 -2
- package/dist/DatePicker/{DatePickerPanel-hMDsc-qd.js → DatePickerPanel-Ci4quU-q.js} +3 -3
- package/dist/DatePicker/index.js +4 -4
- package/dist/DropDown/{DropDown-Ds0X5fxe.js → DropDown-B3VFy5GF.js} +2 -2
- package/dist/DropDown/index.js +5 -5
- package/dist/Editor/index.js +18 -18
- package/dist/FieldCard/FieldCard-CcLl0Fix.js +186 -0
- package/dist/FieldCard/index.js +3 -0
- package/dist/Gantt/index.js +6 -6
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/{InputTag-BT-IXf5k.js → InputTag-C1WA6sDA.js} +1 -1
- package/dist/InputTag/index.js +4 -4
- package/dist/Kanban/index.js +656 -0
- package/dist/Loading/{Loading-Cherk9Ax.js → Loading-Dm4i0lYd.js} +1 -1
- package/dist/Loading/index.js +4 -4
- 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-DFXTqfwb.js → Select-C_g3oAkv.js} +11 -6
- package/dist/Select/{SelectInputSearch-BEYleN-o.js → SelectInputSearch-BMJQw4ll.js} +1 -1
- package/dist/Select/index.js +8 -8
- package/dist/Table/{Table-8ac6xLZv.js → Table-zYD3a8yk.js} +1 -1
- package/dist/Table/index.js +4 -4
- package/dist/Tabs/{Tabs-Db3uC4yK.js → Tabs-DQAgk4py.js} +1 -1
- package/dist/Tabs/index.js +4 -4
- 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 +3 -0
- package/dist/components/Kanban/KanbanCardItem.d.ts +32 -0
- package/dist/components/Kanban/KanbanCardList.d.ts +22 -0
- package/dist/components/Kanban/KanbanColumnView.d.ts +25 -0
- package/dist/components/Kanban/KanbanPointerSensor.d.ts +13 -0
- package/dist/components/Kanban/columnListMotion.d.ts +2 -0
- package/dist/components/Kanban/index.d.ts +3 -0
- package/dist/components/Kanban/interface.d.ts +140 -0
- package/dist/components/Kanban/resolveDrop.d.ts +23 -0
- package/dist/components/Kanban/selection.d.ts +5 -0
- package/dist/components/Kanban/style/index.d.ts +1 -0
- package/dist/components/Kanban/style/resolveKanbanThemeVars.d.ts +12 -0
- package/dist/index.js +18 -18
- package/dist/locale/lang/en-US.json.d.ts +7 -0
- package/dist/locale/lang/zh-CN.json.d.ts +7 -0
- package/dist/locale/lang/zh-TW.json.d.ts +7 -0
- package/dist/style.css +1 -1
- package/dist/vendors/{ConfigProvider-DtF-EYRn.js → ConfigProvider-BDmu_0qa.js} +15 -1
- package/dist/vendors/{LocaleContext-DXQoOKM2.js → LocaleContext-CsTLO_Y2.js} +7 -0
- package/dist/vendors/{Tree-BkxKK0Sf.js → Tree-f0FxoFIC.js} +1 -1
- package/dist/vendors/{useLocale-Be4e7Xfn.js → useLocale-3oUjPb-k.js} +1 -1
- package/dist/vendors/{version-BmFHvNYa.js → version-DUd4fmF6.js} +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
import "../vendors/version-DUd4fmF6.js";
|
|
2
|
+
import "../ScrollBar/style-D26azwz6.js";
|
|
3
|
+
import { t as e } from "../Icon/Icon-CcKDWNGy.js";
|
|
4
|
+
import "../vendors/LocaleContext-CsTLO_Y2.js";
|
|
5
|
+
import { t } from "../vendors/useLocale-3oUjPb-k.js";
|
|
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"
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
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, {
|
|
66
|
+
"data-kanban-no-drag": "",
|
|
67
|
+
"data-testid": `kanban-card-check-${e.id}`,
|
|
68
|
+
children: /* @__PURE__ */ s(r, {
|
|
69
|
+
theme: d ?? I,
|
|
70
|
+
checked: t,
|
|
71
|
+
onChange: (t) => f(e.id, t)
|
|
72
|
+
})
|
|
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
|
+
]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
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({
|
|
88
|
+
id: e.id,
|
|
89
|
+
disabled: !h,
|
|
90
|
+
data: {
|
|
91
|
+
type: "card",
|
|
92
|
+
columnId: t,
|
|
93
|
+
index: n
|
|
94
|
+
}
|
|
95
|
+
}), { setNodeRef: b, isOver: x } = D({
|
|
96
|
+
id: `card:${t}:${e.id}`,
|
|
97
|
+
data: {
|
|
98
|
+
type: "card",
|
|
99
|
+
columnId: t,
|
|
100
|
+
index: n
|
|
101
|
+
}
|
|
102
|
+
}), { active: S } = T(), C = S?.data.current, w = x && C?.type === "card" && C.columnId !== t;
|
|
103
|
+
return /* @__PURE__ */ c("div", {
|
|
104
|
+
ref: (e) => {
|
|
105
|
+
v(e), b(e);
|
|
106
|
+
},
|
|
107
|
+
className: `${L.card} ${y ? L.cardDragging : ""}`,
|
|
108
|
+
style: {
|
|
109
|
+
paddingTop: w ? 12 : 0,
|
|
110
|
+
transition: "opacity 0.2s ease, padding 0.2s ease"
|
|
111
|
+
},
|
|
112
|
+
"data-testid": `kanban-card-${e.id}`,
|
|
113
|
+
"data-card-id": e.id,
|
|
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, {
|
|
122
|
+
card: e,
|
|
123
|
+
selected: r,
|
|
124
|
+
loading: i,
|
|
125
|
+
checkable: a,
|
|
126
|
+
coverLayout: l,
|
|
127
|
+
fieldLayout: u,
|
|
128
|
+
size: d,
|
|
129
|
+
checkboxTheme: f,
|
|
130
|
+
onChecked: m
|
|
131
|
+
})]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
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
|
|
142
|
+
//#region src/components/Kanban/KanbanCardList.tsx
|
|
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({
|
|
146
|
+
id: `column-body:${e.id}`,
|
|
147
|
+
data: {
|
|
148
|
+
type: "column-body",
|
|
149
|
+
columnId: e.id,
|
|
150
|
+
index: e.items.length
|
|
151
|
+
}
|
|
152
|
+
}), q = _({
|
|
153
|
+
count: e.items.length,
|
|
154
|
+
getScrollElement: () => w,
|
|
155
|
+
estimateSize: () => n,
|
|
156
|
+
overscan: 6,
|
|
157
|
+
getItemKey: (t) => e.items[t]?.id ?? t
|
|
158
|
+
});
|
|
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);
|
|
164
|
+
}
|
|
165
|
+
let n = q.getTotalSize(), r = N.current, i = B(A.current, e);
|
|
166
|
+
if (i && r) {
|
|
167
|
+
let e = /* @__PURE__ */ new Map();
|
|
168
|
+
r.querySelectorAll("[data-card-id]").forEach((t) => {
|
|
169
|
+
let n = t.dataset.cardId;
|
|
170
|
+
n && t.parentElement && e.set(n, t.parentElement);
|
|
171
|
+
});
|
|
172
|
+
for (let [n, r] of t) {
|
|
173
|
+
let t = j.current.get(n), i = e.get(n);
|
|
174
|
+
t === void 0 || t === r || !i || (i.style.transition = "none", i.style.transform = `translateY(${t}px)`);
|
|
175
|
+
}
|
|
176
|
+
M.current !== n && (r.style.transition = "none", r.style.height = `${M.current}px`), r.offsetHeight;
|
|
177
|
+
for (let [n, r] of t) {
|
|
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)`);
|
|
180
|
+
}
|
|
181
|
+
M.current !== n && (r.style.transition = `height ${W}ms ease`, r.style.height = `${n}px`);
|
|
182
|
+
}
|
|
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);
|
|
187
|
+
return () => window.clearTimeout(e);
|
|
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;
|
|
202
|
+
let n = t.target;
|
|
203
|
+
if (n instanceof HTMLElement) {
|
|
204
|
+
if (n.scrollHeight - n.scrollTop - n.clientHeight > V) {
|
|
205
|
+
k.current = !1;
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
k.current || (k.current = !0, C(e.id));
|
|
209
|
+
}
|
|
210
|
+
}, [
|
|
211
|
+
e.id,
|
|
212
|
+
e.paging?.noMore,
|
|
213
|
+
e.paging?.loading,
|
|
214
|
+
C
|
|
215
|
+
]);
|
|
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) {
|
|
223
|
+
let n = t.active.data.current;
|
|
224
|
+
if (!w || n?.type !== "card" || n.columnId === e.id) return;
|
|
225
|
+
let r = t.active.rect.current.translated;
|
|
226
|
+
if (!r) return;
|
|
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,
|
|
235
|
+
options: { overflow: {
|
|
236
|
+
x: "hidden",
|
|
237
|
+
y: "scroll"
|
|
238
|
+
} },
|
|
239
|
+
children: /* @__PURE__ */ c("div", {
|
|
240
|
+
ref: N,
|
|
241
|
+
style: {
|
|
242
|
+
height: $,
|
|
243
|
+
position: "relative",
|
|
244
|
+
width: "100%",
|
|
245
|
+
transition: K
|
|
246
|
+
},
|
|
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,
|
|
292
|
+
style: {
|
|
293
|
+
position: "absolute",
|
|
294
|
+
top: de,
|
|
295
|
+
left: 0,
|
|
296
|
+
right: 0
|
|
297
|
+
},
|
|
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
|
+
]
|
|
307
|
+
})
|
|
308
|
+
}), Q ? S : null]
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/components/Kanban/selection.ts
|
|
313
|
+
function re(e, t, n) {
|
|
314
|
+
return n === e.includes(t) ? e : n ? [...e, t] : e.filter((e) => e !== t);
|
|
315
|
+
}
|
|
316
|
+
function K(e, t) {
|
|
317
|
+
if (t.length === 0) return "unchecked";
|
|
318
|
+
let n = 0;
|
|
319
|
+
for (let r of t) e.has(r) && (n += 1);
|
|
320
|
+
return n === 0 ? "unchecked" : n === t.length ? "checked" : "indeterminate";
|
|
321
|
+
}
|
|
322
|
+
function ie(e, t, n) {
|
|
323
|
+
if (t.length === 0) return e;
|
|
324
|
+
if (!n) {
|
|
325
|
+
let n = new Set(t);
|
|
326
|
+
return e.some((e) => n.has(e)) ? e.filter((e) => !n.has(e)) : e;
|
|
327
|
+
}
|
|
328
|
+
if (t.every((t) => e.includes(t))) return e;
|
|
329
|
+
let r = new Set(e);
|
|
330
|
+
for (let e of t) r.add(e);
|
|
331
|
+
return [...r];
|
|
332
|
+
}
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region src/components/Kanban/KanbanColumnView.tsx
|
|
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,
|
|
340
|
+
data: {
|
|
341
|
+
type: "column",
|
|
342
|
+
columnId: n.id,
|
|
343
|
+
index: n.items.length
|
|
344
|
+
}
|
|
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}`,
|
|
347
|
+
"data-kanban-no-drag": "",
|
|
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)
|
|
355
|
+
})
|
|
356
|
+
}) : null;
|
|
357
|
+
return /* @__PURE__ */ c("div", {
|
|
358
|
+
ref: O,
|
|
359
|
+
className: `${L.column} ${a ? L.columnCollapsed : ""} ${j ? L.columnDragging : ""}`,
|
|
360
|
+
style: {
|
|
361
|
+
width: a ? J : i,
|
|
362
|
+
transform: N.Transform.toString(P),
|
|
363
|
+
transition: F
|
|
364
|
+
},
|
|
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,
|
|
374
|
+
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
|
|
381
|
+
})
|
|
382
|
+
]
|
|
383
|
+
}) : /* @__PURE__ */ c("div", {
|
|
384
|
+
className: L.titleRow,
|
|
385
|
+
children: [
|
|
386
|
+
B,
|
|
387
|
+
/* @__PURE__ */ s("div", {
|
|
388
|
+
className: L.title,
|
|
389
|
+
children: n.title
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ s("span", {
|
|
392
|
+
className: L.count,
|
|
393
|
+
"data-testid": `kanban-count-${n.id}`,
|
|
394
|
+
children: n.total
|
|
395
|
+
})
|
|
396
|
+
]
|
|
397
|
+
}), /* @__PURE__ */ s("button", {
|
|
398
|
+
type: "button",
|
|
399
|
+
className: L.toggle,
|
|
400
|
+
"data-kanban-no-drag": "",
|
|
401
|
+
"aria-label": w(a ? "kanban.expand" : "kanban.collapse"),
|
|
402
|
+
onClick: () => x?.(n.id),
|
|
403
|
+
children: /* @__PURE__ */ s(e, {
|
|
404
|
+
name: a ? "magnify" : "reduction",
|
|
405
|
+
size: 16
|
|
406
|
+
})
|
|
407
|
+
})]
|
|
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
|
|
433
|
+
})
|
|
434
|
+
})
|
|
435
|
+
}) : null
|
|
436
|
+
}) })]
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/components/Kanban/KanbanPointerSensor.ts
|
|
441
|
+
var Y = "[data-kanban-no-drag]", oe = class extends x {
|
|
442
|
+
static activators = [{
|
|
443
|
+
eventName: "onPointerDown",
|
|
444
|
+
handler: ({ nativeEvent: e }, t) => {
|
|
445
|
+
if (e.isPrimary === !1 || (e.button ?? 0) !== 0) return !1;
|
|
446
|
+
let n = e.target;
|
|
447
|
+
return n instanceof Element && n.closest(Y) ? !1 : (t.onActivation?.({ event: e }), !0);
|
|
448
|
+
}
|
|
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;
|
|
463
|
+
};
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/components/Kanban/resolveDrop.ts
|
|
466
|
+
function le(e) {
|
|
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 : {
|
|
468
|
+
kind: "column",
|
|
469
|
+
payload: {
|
|
470
|
+
activeId: e.activeId,
|
|
471
|
+
overId: e.overColumnId
|
|
472
|
+
}
|
|
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 : {
|
|
474
|
+
kind: "card",
|
|
475
|
+
payload: {
|
|
476
|
+
cardId: e.activeId,
|
|
477
|
+
fromColumnId: e.fromColumnId,
|
|
478
|
+
toColumnId: e.overColumnId,
|
|
479
|
+
toIndex: e.overIndex
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
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");
|
|
510
|
+
if (r) return [r];
|
|
511
|
+
let i = n("column-body");
|
|
512
|
+
if (i) return [i];
|
|
513
|
+
let a = n("column");
|
|
514
|
+
return a ? [a] : w(e);
|
|
515
|
+
}, []), me = l((t) => {
|
|
516
|
+
let n = t.active.data.current;
|
|
517
|
+
if (n?.type === "column" && n.columnId) {
|
|
518
|
+
U.current = "column";
|
|
519
|
+
let e = document.querySelector(`[data-column-id="${n.columnId}"]`), r = e instanceof HTMLElement ? e.getBoundingClientRect().height : void 0;
|
|
520
|
+
N({
|
|
521
|
+
type: "column",
|
|
522
|
+
id: String(t.active.id),
|
|
523
|
+
columnId: n.columnId,
|
|
524
|
+
overlayHeight: r
|
|
525
|
+
});
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
if (n?.type === "card" && n.columnId) {
|
|
529
|
+
let r = e.find((e) => e.id === n.columnId)?.items.find((e) => e.id === String(t.active.id));
|
|
530
|
+
U.current = "card", N({
|
|
531
|
+
type: "card",
|
|
532
|
+
id: String(t.active.id),
|
|
533
|
+
columnId: n.columnId,
|
|
534
|
+
card: r
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
}, [e]), he = l((e) => {
|
|
538
|
+
let t = e.active.data.current, n = e.over?.data.current, r = le({
|
|
539
|
+
activeType: t?.type ?? null,
|
|
540
|
+
activeId: String(e.active.id),
|
|
541
|
+
fromColumnId: t?.columnId,
|
|
542
|
+
overType: n?.type ?? null,
|
|
543
|
+
overColumnId: n?.columnId,
|
|
544
|
+
overIndex: n?.index,
|
|
545
|
+
sortableIds: fe
|
|
546
|
+
});
|
|
547
|
+
U.current = null, N(null), r?.kind === "card" && _?.(r.payload), r?.kind === "column" && b?.(r.payload);
|
|
548
|
+
}, [
|
|
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, {
|
|
556
|
+
sensors: W,
|
|
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
|
+
},
|
|
569
|
+
"data-testid": "kanban-root",
|
|
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, {
|
|
576
|
+
column: e,
|
|
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
|
|
594
|
+
}, e.id))
|
|
595
|
+
})
|
|
596
|
+
})
|
|
597
|
+
}), /* @__PURE__ */ c(y, {
|
|
598
|
+
dropAnimation: {
|
|
599
|
+
duration: 250,
|
|
600
|
+
easing: "cubic-bezier(0.25, 1, 0.5, 1)"
|
|
601
|
+
},
|
|
602
|
+
children: [M?.type === "card" && M.card ? /* @__PURE__ */ s("div", {
|
|
603
|
+
className: L.cardOverlay,
|
|
604
|
+
style: V,
|
|
605
|
+
"data-testid": "kanban-card-overlay",
|
|
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
|
|
616
|
+
})
|
|
617
|
+
}) : null, _e ? /* @__PURE__ */ c("div", {
|
|
618
|
+
className: `${L.column} ${L.columnOverlay}`,
|
|
619
|
+
style: {
|
|
620
|
+
width: ne,
|
|
621
|
+
height: M?.overlayHeight,
|
|
622
|
+
...V
|
|
623
|
+
},
|
|
624
|
+
"data-testid": "kanban-column-overlay",
|
|
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
|
|
635
|
+
})]
|
|
636
|
+
})
|
|
637
|
+
}), /* @__PURE__ */ s("div", { children: _e.items.map((e) => /* @__PURE__ */ s("div", {
|
|
638
|
+
className: L.cardSlot,
|
|
639
|
+
children: /* @__PURE__ */ s(R, {
|
|
640
|
+
card: e,
|
|
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
|
|
649
|
+
})
|
|
650
|
+
}, e.id)) })]
|
|
651
|
+
}) : null]
|
|
652
|
+
})]
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
//#endregion
|
|
656
|
+
export { P as KANBAN_COLUMN_WIDTH, F as KANBAN_COVER_SIDE_EXTRA, Z as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../vendors/useLocale-
|
|
1
|
+
import { t as e } from "../vendors/useLocale-3oUjPb-k.js";
|
|
2
2
|
import { LoadingOutlined as t } from "@ant-design/icons";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Loading/Loading.tsx
|
package/dist/Loading/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
2
|
-
import "../vendors/LocaleContext-
|
|
3
|
-
import "../vendors/useLocale-
|
|
4
|
-
import { t as e } from "./Loading-
|
|
1
|
+
import "../vendors/version-DUd4fmF6.js";
|
|
2
|
+
import "../vendors/LocaleContext-CsTLO_Y2.js";
|
|
3
|
+
import "../vendors/useLocale-3oUjPb-k.js";
|
|
4
|
+
import { t as e } from "./Loading-Dm4i0lYd.js";
|
|
5
5
|
export { e as default };
|
package/dist/Modal/index.js
CHANGED
package/dist/Overlay/index.js
CHANGED
package/dist/Radio/index.js
CHANGED