@baishuyun/ui-base 6.24.7 → 6.25.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-3Kv_WGxD.js → Calendar-DpMZOADo.js} +301 -292
- package/dist/Calendar/index.js +5 -5
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/index.js +1 -1
- package/dist/ColorPicker/{ColorPicker-DCM3izKF.js → ColorPicker-C45iWNv0.js} +1 -1
- package/dist/ColorPicker/index.js +4 -4
- package/dist/ConfigProvider/index.js +3 -3
- package/dist/DatePicker/{DatePicker-Dlw6OaT8.js → DatePicker-MpFoHCHr.js} +2 -2
- package/dist/DatePicker/{DatePickerPanel-Ohx9pcvr.js → DatePickerPanel-C4n3podg.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 +6 -6
- 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 +597 -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-9XzkUm0W.js} +2 -2
- package/dist/Select/{SelectInputSearch-BEYleN-o.js → SelectInputSearch-BMJQw4ll.js} +1 -1
- package/dist/Select/index.js +5 -5
- 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 +1 -1
- package/dist/components/Calendar/utils/dateUtils.d.ts +10 -7
- package/dist/components/Kanban/Kanban.d.ts +3 -0
- package/dist/components/Kanban/KanbanCardFace.d.ts +14 -0
- package/dist/components/Kanban/KanbanCardItem.d.ts +16 -0
- package/dist/components/Kanban/KanbanCardList.d.ts +15 -0
- package/dist/components/Kanban/KanbanColumnView.d.ts +21 -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 +71 -0
- package/dist/components/Kanban/resolveDrop.d.ts +24 -0
- package/dist/components/Kanban/selection.d.ts +5 -0
- package/dist/index.js +15 -15
- 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/{useLocale-Be4e7Xfn.js → useLocale-3oUjPb-k.js} +1 -1
- package/dist/vendors/{version-CxNabWr4.js → version-Nw7Mc7qj.js} +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
import "../vendors/version-Nw7Mc7qj.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 "../CheckBox/CheckBox-BGbMzNLG.js";
|
|
7
|
+
import { t as n } from "../CheckBox/CheckBox-Cc-7FP-b.js";
|
|
8
|
+
import { t as r } from "../ScrollBar/ScrollBar-IMTuAOF5.js";
|
|
9
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
10
|
+
import { useCallback as s, useEffect as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
11
|
+
import { useVirtualizer as p } from "@tanstack/react-virtual";
|
|
12
|
+
import { DndContext as m, DragOverlay as h, MeasuringStrategy as g, PointerSensor as _, closestCenter as v, pointerWithin as y, rectIntersection as b, useDndContext as x, useDndMonitor as S, useDraggable as C, useDroppable as w, useSensor as T, useSensors as E } from "@dnd-kit/core";
|
|
13
|
+
import { SortableContext as D, horizontalListSortingStrategy as O, useSortable as k } from "@dnd-kit/sortable";
|
|
14
|
+
import { CSS as A } from "@dnd-kit/utilities";
|
|
15
|
+
var j = {
|
|
16
|
+
root: "_root_1ql5o_1",
|
|
17
|
+
board: "_board_1ql5o_8",
|
|
18
|
+
empty: "_empty_1ql5o_20",
|
|
19
|
+
column: "_column_1ql5o_26",
|
|
20
|
+
columnCollapsed: "_columnCollapsed_1ql5o_39",
|
|
21
|
+
columnDragging: "_columnDragging_1ql5o_45",
|
|
22
|
+
header: "_header_1ql5o_49",
|
|
23
|
+
toggle: "_toggle_1ql5o_61",
|
|
24
|
+
headerCollapsed: "_headerCollapsed_1ql5o_61",
|
|
25
|
+
headerDraggable: "_headerDraggable_1ql5o_74",
|
|
26
|
+
titleRow: "_titleRow_1ql5o_78",
|
|
27
|
+
title: "_title_1ql5o_78",
|
|
28
|
+
count: "_count_1ql5o_98",
|
|
29
|
+
collapsedBody: "_collapsedBody_1ql5o_122",
|
|
30
|
+
collapsedTitle: "_collapsedTitle_1ql5o_130",
|
|
31
|
+
list: "_list_1ql5o_142",
|
|
32
|
+
listScroll: "_listScroll_1ql5o_149",
|
|
33
|
+
listFill: "_listFill_1ql5o_150",
|
|
34
|
+
addAnchor: "_addAnchor_1ql5o_155",
|
|
35
|
+
cardSlot: "_cardSlot_1ql5o_161",
|
|
36
|
+
card: "_card_1ql5o_161",
|
|
37
|
+
shell: "_shell_1ql5o_171",
|
|
38
|
+
shellSelected: "_shellSelected_1ql5o_186",
|
|
39
|
+
shellLoading: "_shellLoading_1ql5o_193",
|
|
40
|
+
shellTitleRow: "_shellTitleRow_1ql5o_197",
|
|
41
|
+
shellCheck: "_shellCheck_1ql5o_205",
|
|
42
|
+
shellCheckable: "_shellCheckable_1ql5o_218",
|
|
43
|
+
shellTitle: "_shellTitle_1ql5o_197",
|
|
44
|
+
columnCheck: "_columnCheck_1ql5o_240",
|
|
45
|
+
columnCheckVisible: "_columnCheckVisible_1ql5o_252",
|
|
46
|
+
cardDragging: "_cardDragging_1ql5o_256",
|
|
47
|
+
dropIndicator: "_dropIndicator_1ql5o_264",
|
|
48
|
+
cardOverlay: "_cardOverlay_1ql5o_275",
|
|
49
|
+
columnOverlay: "_columnOverlay_1ql5o_280",
|
|
50
|
+
paging: "_paging_1ql5o_287",
|
|
51
|
+
footer: "_footer_1ql5o_295",
|
|
52
|
+
add: "_add_1ql5o_155"
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/Kanban/KanbanCardFace.tsx
|
|
56
|
+
function M({ card: e, columnId: t, selected: r, loading: i, overlay: s, checkable: c, onChecked: l, renderCardBody: u }) {
|
|
57
|
+
let d = u?.(e, {
|
|
58
|
+
columnId: t,
|
|
59
|
+
overlay: s,
|
|
60
|
+
selected: r,
|
|
61
|
+
loading: i
|
|
62
|
+
});
|
|
63
|
+
return /* @__PURE__ */ o("div", {
|
|
64
|
+
className: `${j.shell} ${r ? j.shellSelected : ""} ${i ? j.shellLoading : ""} ${c ? j.shellCheckable : ""}`,
|
|
65
|
+
children: [/* @__PURE__ */ o("div", {
|
|
66
|
+
className: j.shellTitleRow,
|
|
67
|
+
children: [c ? /* @__PURE__ */ a("div", {
|
|
68
|
+
className: j.shellCheck,
|
|
69
|
+
"data-kanban-no-drag": "",
|
|
70
|
+
"data-testid": `kanban-card-check-${e.id}`,
|
|
71
|
+
children: /* @__PURE__ */ a(n, {
|
|
72
|
+
checked: r,
|
|
73
|
+
onChange: (t) => l(e.id, t)
|
|
74
|
+
})
|
|
75
|
+
}) : null, /* @__PURE__ */ a("div", {
|
|
76
|
+
className: j.shellTitle,
|
|
77
|
+
children: e.title
|
|
78
|
+
})]
|
|
79
|
+
}), d]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/components/Kanban/columnListMotion.ts
|
|
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({
|
|
93
|
+
id: e.id,
|
|
94
|
+
disabled: !f,
|
|
95
|
+
data: {
|
|
96
|
+
type: "card",
|
|
97
|
+
columnId: t,
|
|
98
|
+
index: n
|
|
99
|
+
}
|
|
100
|
+
}), { setNodeRef: _, isOver: v } = w({
|
|
101
|
+
id: `card:${t}:${e.id}`,
|
|
102
|
+
disabled: !i,
|
|
103
|
+
data: {
|
|
104
|
+
type: "card",
|
|
105
|
+
columnId: t,
|
|
106
|
+
index: n
|
|
107
|
+
}
|
|
108
|
+
}), { active: y } = x(), b = y?.data.current, S = v && b?.type === "card" && b.columnId !== t;
|
|
109
|
+
return /* @__PURE__ */ o("div", {
|
|
110
|
+
ref: (e) => {
|
|
111
|
+
h(e), _(e);
|
|
112
|
+
},
|
|
113
|
+
className: `${j.card} ${g ? j.cardDragging : ""}`,
|
|
114
|
+
style: {
|
|
115
|
+
paddingTop: S ? 12 : 0,
|
|
116
|
+
transition: "opacity 0.2s ease, padding 0.2s ease"
|
|
117
|
+
},
|
|
118
|
+
"data-testid": `kanban-card-${e.id}`,
|
|
119
|
+
"data-card-id": e.id,
|
|
120
|
+
"data-loading": c ? "true" : "false",
|
|
121
|
+
"data-selected": s ? "true" : "false",
|
|
122
|
+
...p,
|
|
123
|
+
...f ? m : void 0,
|
|
124
|
+
children: [S ? /* @__PURE__ */ a("div", { className: j.dropIndicator }) : null, /* @__PURE__ */ a(M, {
|
|
125
|
+
card: e,
|
|
126
|
+
columnId: t,
|
|
127
|
+
selected: s,
|
|
128
|
+
loading: c,
|
|
129
|
+
overlay: !1,
|
|
130
|
+
checkable: l,
|
|
131
|
+
onChecked: u,
|
|
132
|
+
renderCardBody: d
|
|
133
|
+
})]
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/components/Kanban/KanbanCardList.tsx
|
|
138
|
+
var F = 20, I = 48, L = 12, R = 200, z = 54;
|
|
139
|
+
function B({ column: e, estimate: t, selectedIds: n, loadingIds: i, checkable: u, onChecked: m, renderCardBody: h, footer: g, onReachEnd: _ }) {
|
|
140
|
+
let [v, y] = f(null), [b, x] = f(0), C = d(!1), T = d([]), E = d(/* @__PURE__ */ new Map()), D = d(0), O = d(null), k = e.cards.map((e) => e.id), A = k.join("\0"), M = N(T.current, k), [B, V] = f(!1), H = M || B ? `transform ${R}ms ease` : void 0, ee = M || B ? `height ${R}ms ease` : void 0, U = e.droppable !== !1, { setNodeRef: W } = w({
|
|
141
|
+
id: `column-body:${e.id}`,
|
|
142
|
+
disabled: !U,
|
|
143
|
+
data: {
|
|
144
|
+
type: "column-body",
|
|
145
|
+
columnId: e.id,
|
|
146
|
+
index: e.cards.length
|
|
147
|
+
}
|
|
148
|
+
}), G = p({
|
|
149
|
+
count: e.cards.length,
|
|
150
|
+
getScrollElement: () => v,
|
|
151
|
+
estimateSize: () => t,
|
|
152
|
+
overscan: 6,
|
|
153
|
+
getItemKey: (t) => e.cards[t]?.id ?? t
|
|
154
|
+
});
|
|
155
|
+
l(() => {
|
|
156
|
+
let t = /* @__PURE__ */ new Map();
|
|
157
|
+
for (let n of G.getVirtualItems()) {
|
|
158
|
+
let r = e.cards[n.index];
|
|
159
|
+
r && t.set(r.id, n.start);
|
|
160
|
+
}
|
|
161
|
+
let n = G.getTotalSize(), r = O.current, i = N(T.current, k);
|
|
162
|
+
if (i && r) {
|
|
163
|
+
let e = /* @__PURE__ */ new Map();
|
|
164
|
+
r.querySelectorAll("[data-card-id]").forEach((t) => {
|
|
165
|
+
let n = t.dataset.cardId;
|
|
166
|
+
n && t.parentElement && e.set(n, t.parentElement);
|
|
167
|
+
});
|
|
168
|
+
for (let [n, r] of t) {
|
|
169
|
+
let t = E.current.get(n), i = e.get(n);
|
|
170
|
+
t === void 0 || t === r || !i || (i.style.transition = "none", i.style.transform = `translateY(${t}px)`);
|
|
171
|
+
}
|
|
172
|
+
D.current !== n && (r.style.transition = "none", r.style.height = `${D.current}px`), r.offsetHeight;
|
|
173
|
+
for (let [n, r] of t) {
|
|
174
|
+
let t = E.current.get(n), i = e.get(n);
|
|
175
|
+
t === void 0 || t === r || !i || (i.style.transition = `transform ${R}ms ease`, i.style.transform = `translateY(${r}px)`);
|
|
176
|
+
}
|
|
177
|
+
D.current !== n && (r.style.transition = `height ${R}ms ease`, r.style.height = `${n}px`);
|
|
178
|
+
}
|
|
179
|
+
T.current = k, E.current = t, D.current = n, i && V(!0);
|
|
180
|
+
}, [A, G]), c(() => {
|
|
181
|
+
if (!B) return;
|
|
182
|
+
let e = window.setTimeout(() => V(!1), R);
|
|
183
|
+
return () => window.clearTimeout(e);
|
|
184
|
+
}, [B]);
|
|
185
|
+
let K = s((e) => {
|
|
186
|
+
W(e), y(e), x(e?.clientHeight ?? 0);
|
|
187
|
+
}, [W]), te = s((t) => {
|
|
188
|
+
if (!_ || e.paging?.loading || e.paging?.nomore) return;
|
|
189
|
+
let n = t.target;
|
|
190
|
+
if (n instanceof HTMLElement) {
|
|
191
|
+
if (n.scrollHeight - n.scrollTop - n.clientHeight > F) {
|
|
192
|
+
C.current = !1;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
C.current || (C.current = !0, _(e.id));
|
|
196
|
+
}
|
|
197
|
+
}, [
|
|
198
|
+
e.id,
|
|
199
|
+
e.paging?.nomore,
|
|
200
|
+
e.paging?.loading,
|
|
201
|
+
_
|
|
202
|
+
]);
|
|
203
|
+
c(() => {
|
|
204
|
+
if (!v) return;
|
|
205
|
+
let e = new ResizeObserver(() => x(v.clientHeight));
|
|
206
|
+
return e.observe(v), () => e.disconnect();
|
|
207
|
+
}, [v]);
|
|
208
|
+
let q = G.getTotalSize(), J = !!g && b > 0 && q + z > b, ne = q + (g && !J ? z : 0);
|
|
209
|
+
return S({ onDragMove(t) {
|
|
210
|
+
let n = t.active.data.current;
|
|
211
|
+
if (!v || n?.type !== "card" || n.columnId === e.id) return;
|
|
212
|
+
let r = t.active.rect.current.translated;
|
|
213
|
+
if (!r) return;
|
|
214
|
+
let i = v.getBoundingClientRect(), a = r.top + r.height / 2;
|
|
215
|
+
a < i.top + I ? v.scrollTop -= L : a > i.bottom - I && (v.scrollTop += L);
|
|
216
|
+
} }), /* @__PURE__ */ o("div", {
|
|
217
|
+
className: j.list,
|
|
218
|
+
children: [/* @__PURE__ */ a(r, {
|
|
219
|
+
className: J ? j.listScroll : j.listFill,
|
|
220
|
+
viewportRef: K,
|
|
221
|
+
onScroll: te,
|
|
222
|
+
options: { overflow: {
|
|
223
|
+
x: "hidden",
|
|
224
|
+
y: "scroll"
|
|
225
|
+
} },
|
|
226
|
+
children: /* @__PURE__ */ o("div", {
|
|
227
|
+
ref: O,
|
|
228
|
+
style: {
|
|
229
|
+
height: ne,
|
|
230
|
+
position: "relative",
|
|
231
|
+
width: "100%",
|
|
232
|
+
transition: ee
|
|
233
|
+
},
|
|
234
|
+
children: [G.getVirtualItems().map((t) => {
|
|
235
|
+
let r = e.cards[t.index];
|
|
236
|
+
return r ? /* @__PURE__ */ a("div", {
|
|
237
|
+
"data-index": t.index,
|
|
238
|
+
ref: G.measureElement,
|
|
239
|
+
className: j.cardSlot,
|
|
240
|
+
style: {
|
|
241
|
+
position: "absolute",
|
|
242
|
+
top: 0,
|
|
243
|
+
left: 0,
|
|
244
|
+
width: "100%",
|
|
245
|
+
transform: `translateY(${t.start}px)`,
|
|
246
|
+
transition: H
|
|
247
|
+
},
|
|
248
|
+
children: /* @__PURE__ */ a(P, {
|
|
249
|
+
card: r,
|
|
250
|
+
columnId: e.id,
|
|
251
|
+
index: t.index,
|
|
252
|
+
draggable: e.cardDraggable !== !1,
|
|
253
|
+
droppable: U,
|
|
254
|
+
selected: n.has(r.id),
|
|
255
|
+
loading: i.has(r.id),
|
|
256
|
+
checkable: u,
|
|
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]
|
|
266
|
+
})
|
|
267
|
+
}), J ? g : null]
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/components/Kanban/selection.ts
|
|
272
|
+
function V(e, t, n) {
|
|
273
|
+
let r = e.includes(t);
|
|
274
|
+
return n && !r ? [...e, t] : !n && r ? e.filter((e) => e !== t) : [...e];
|
|
275
|
+
}
|
|
276
|
+
function H(e, t) {
|
|
277
|
+
if (t.length === 0) return "unchecked";
|
|
278
|
+
let n = 0;
|
|
279
|
+
for (let r of t) e.has(r) && (n += 1);
|
|
280
|
+
return n === 0 ? "unchecked" : n === t.length ? "checked" : "indeterminate";
|
|
281
|
+
}
|
|
282
|
+
function ee(e, t, n) {
|
|
283
|
+
if (t.length === 0) return [...e];
|
|
284
|
+
if (!n) {
|
|
285
|
+
let n = new Set(t);
|
|
286
|
+
return e.filter((e) => !n.has(e));
|
|
287
|
+
}
|
|
288
|
+
let r = new Set(e);
|
|
289
|
+
for (let e of t) r.add(e);
|
|
290
|
+
return [...r];
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region src/components/Kanban/KanbanColumnView.tsx
|
|
294
|
+
var U = 120, W = 40;
|
|
295
|
+
function G({ column: r, columnWidth: s, collapsed: c, selectedIds: l, loadingIds: u, cardCheckable: d, columnCheckable: f, onCardChecked: p, onColumnChecked: m, estimateCardSize: h, onToggleCollapse: g, onReachEnd: _, onColumnAdd: v, renderCardBody: y, renderColumnFooter: b }) {
|
|
296
|
+
let { t: S } = t(), { active: C } = x(), w = C?.data.current?.type === "card", T = r.sortable !== !1 && !w, { setNodeRef: E, attributes: D, listeners: O, isDragging: M, transform: N, transition: P } = k({
|
|
297
|
+
id: r.id,
|
|
298
|
+
disabled: !T,
|
|
299
|
+
data: {
|
|
300
|
+
type: "column",
|
|
301
|
+
columnId: r.id,
|
|
302
|
+
index: r.cards.length
|
|
303
|
+
}
|
|
304
|
+
}), F = h?.(r) ?? U, I = b?.(r), L = r.cards.map((e) => e.id), R = H(l, L), z = f ? /* @__PURE__ */ a("div", {
|
|
305
|
+
className: `${j.columnCheck} ${R === "unchecked" ? "" : j.columnCheckVisible}`,
|
|
306
|
+
"data-kanban-no-drag": "",
|
|
307
|
+
"data-testid": `kanban-column-check-${r.id}`,
|
|
308
|
+
"data-check": R,
|
|
309
|
+
children: /* @__PURE__ */ a(n, {
|
|
310
|
+
checked: R === "checked",
|
|
311
|
+
indeterminate: R === "indeterminate",
|
|
312
|
+
onChange: (e) => m(L, e)
|
|
313
|
+
})
|
|
314
|
+
}) : null;
|
|
315
|
+
return /* @__PURE__ */ o("div", {
|
|
316
|
+
ref: E,
|
|
317
|
+
className: `${j.column} ${c ? j.columnCollapsed : ""} ${M ? j.columnDragging : ""}`,
|
|
318
|
+
style: {
|
|
319
|
+
width: c ? W : s,
|
|
320
|
+
transform: A.Transform.toString(N),
|
|
321
|
+
transition: P
|
|
322
|
+
},
|
|
323
|
+
"data-testid": `kanban-column-${r.id}`,
|
|
324
|
+
"data-column-id": r.id,
|
|
325
|
+
"data-sortable": T ? "true" : "false",
|
|
326
|
+
children: [/* @__PURE__ */ o("div", {
|
|
327
|
+
className: `${j.header} ${c ? j.headerCollapsed : ""} ${T ? j.headerDraggable : ""}`,
|
|
328
|
+
...D,
|
|
329
|
+
...T ? O : void 0,
|
|
330
|
+
children: [c ? /* @__PURE__ */ o("div", {
|
|
331
|
+
className: j.collapsedTitle,
|
|
332
|
+
children: [
|
|
333
|
+
z,
|
|
334
|
+
/* @__PURE__ */ a("span", { children: r.title }),
|
|
335
|
+
/* @__PURE__ */ a("span", {
|
|
336
|
+
className: j.count,
|
|
337
|
+
"data-testid": `kanban-count-${r.id}`,
|
|
338
|
+
children: r.count
|
|
339
|
+
})
|
|
340
|
+
]
|
|
341
|
+
}) : /* @__PURE__ */ o("div", {
|
|
342
|
+
className: j.titleRow,
|
|
343
|
+
children: [
|
|
344
|
+
z,
|
|
345
|
+
/* @__PURE__ */ a("div", {
|
|
346
|
+
className: j.title,
|
|
347
|
+
children: r.title
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ a("span", {
|
|
350
|
+
className: j.count,
|
|
351
|
+
"data-testid": `kanban-count-${r.id}`,
|
|
352
|
+
children: r.count
|
|
353
|
+
})
|
|
354
|
+
]
|
|
355
|
+
}), /* @__PURE__ */ a("button", {
|
|
356
|
+
type: "button",
|
|
357
|
+
className: j.toggle,
|
|
358
|
+
"data-kanban-no-drag": "",
|
|
359
|
+
"aria-label": S(c ? "kanban.expand" : "kanban.collapse"),
|
|
360
|
+
onClick: () => g?.(r.id),
|
|
361
|
+
children: /* @__PURE__ */ a(e, {
|
|
362
|
+
name: c ? "magnify" : "reduction",
|
|
363
|
+
size: 16
|
|
364
|
+
})
|
|
365
|
+
})]
|
|
366
|
+
}), c ? null : /* @__PURE__ */ o(i, { children: [
|
|
367
|
+
/* @__PURE__ */ a(B, {
|
|
368
|
+
column: r,
|
|
369
|
+
estimate: F,
|
|
370
|
+
selectedIds: l,
|
|
371
|
+
loadingIds: u,
|
|
372
|
+
checkable: d,
|
|
373
|
+
onChecked: p,
|
|
374
|
+
renderCardBody: y,
|
|
375
|
+
onReachEnd: _,
|
|
376
|
+
footer: r.addable ? /* @__PURE__ */ a("div", {
|
|
377
|
+
className: j.add,
|
|
378
|
+
children: /* @__PURE__ */ a("button", {
|
|
379
|
+
type: "button",
|
|
380
|
+
"data-kanban-no-drag": "",
|
|
381
|
+
"aria-label": S("kanban.add"),
|
|
382
|
+
"data-testid": `kanban-add-${r.id}`,
|
|
383
|
+
onClick: () => v?.(r.id),
|
|
384
|
+
children: /* @__PURE__ */ a(e, {
|
|
385
|
+
name: "add",
|
|
386
|
+
size: 16
|
|
387
|
+
})
|
|
388
|
+
})
|
|
389
|
+
}) : null
|
|
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
|
|
404
|
+
}) : null
|
|
405
|
+
] })]
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/components/Kanban/KanbanPointerSensor.ts
|
|
410
|
+
var K = "[data-kanban-no-drag]", te = class extends _ {
|
|
411
|
+
static activators = [{
|
|
412
|
+
eventName: "onPointerDown",
|
|
413
|
+
handler: ({ nativeEvent: e }, t) => {
|
|
414
|
+
if (e.isPrimary === !1 || (e.button ?? 0) !== 0) return !1;
|
|
415
|
+
let n = e.target;
|
|
416
|
+
return n instanceof Element && n.closest(K) ? !1 : (t.onActivation?.({ event: e }), !0);
|
|
417
|
+
}
|
|
418
|
+
}];
|
|
419
|
+
};
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/components/Kanban/resolveDrop.ts
|
|
422
|
+
function q(e) {
|
|
423
|
+
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
|
+
kind: "column",
|
|
425
|
+
payload: {
|
|
426
|
+
activeId: e.activeId,
|
|
427
|
+
overId: e.overColumnId
|
|
428
|
+
}
|
|
429
|
+
} : e.activeType !== "card" || !e.fromColumnId || !e.overColumnId || e.fromColumnId === e.overColumnId || !e.droppableIds.has(e.overColumnId) || e.overType !== "card" && e.overType !== "column-body" && e.overType !== "column" || typeof e.overIndex != "number" ? null : {
|
|
430
|
+
kind: "card",
|
|
431
|
+
payload: {
|
|
432
|
+
cardId: e.activeId,
|
|
433
|
+
fromColumnId: e.fromColumnId,
|
|
434
|
+
toColumnId: e.overColumnId,
|
|
435
|
+
toIndex: e.overIndex
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/components/Kanban/interface.ts
|
|
441
|
+
var J = {
|
|
442
|
+
small: 200,
|
|
443
|
+
middle: 260,
|
|
444
|
+
large: 340
|
|
445
|
+
}, ne = { droppable: { strategy: g.Always } };
|
|
446
|
+
function Y({ columns: e, columnSize: t = "middle", columnWidth: n, estimateCardSize: r, collapsedIds: i, onToggleCollapse: c, selectedCardIds: l, defaultSelectedCardIds: p, onSelectedCardIdsChange: g, cardCheckable: _ = !1, columnCheckable: x = !1, loadingCardIds: S, onCardMove: C, onColumnReorder: w, onColumnAdd: k, onReachEnd: A, renderCardBody: N, renderColumnFooter: P, emptyOverlay: F }) {
|
|
447
|
+
let [I, L] = f(null), [R, z] = f(() => p ?? []), B = l !== void 0, H = B ? l : R, U = d(null), W = E(T(te, { activationConstraint: { distance: 8 } })), K = n ?? J[t], Y = u(() => new Set(H), [H]), X = s((e) => {
|
|
448
|
+
B || z(e), g?.(e);
|
|
449
|
+
}, [B, g]), Z = s((e, t) => {
|
|
450
|
+
X(V(H, e, t));
|
|
451
|
+
}, [X, H]), re = s((e, t) => {
|
|
452
|
+
let n = ee(H, e, t);
|
|
453
|
+
n.length === H.length && n.every((e, t) => e === H[t]) || X(n);
|
|
454
|
+
}, [X, H]), Q = u(() => new Set(S ?? []), [S]), ie = u(() => new Set(i ?? []), [i]), ae = u(() => e.filter((e) => e.sortable !== !1).map((e) => e.id), [e]), oe = u(() => new Set(ae), [ae]), se = u(() => new Set(e.filter((e) => e.droppable !== !1).map((e) => e.id)), [e]), ce = s((e) => {
|
|
455
|
+
if (U.current === "column") return v(e).filter((t) => e.droppableContainers.find((e) => e.id === t.id)?.data.current?.type === "column");
|
|
456
|
+
let t = y(e), n = (n) => t.find((t) => e.droppableContainers.find((e) => e.id === t.id)?.data.current?.type === n), r = n("card");
|
|
457
|
+
if (r) return [r];
|
|
458
|
+
let i = n("column-body");
|
|
459
|
+
if (i) return [i];
|
|
460
|
+
let a = n("column");
|
|
461
|
+
return a ? [a] : b(e);
|
|
462
|
+
}, []), le = s((t) => {
|
|
463
|
+
let n = t.active.data.current;
|
|
464
|
+
if (n?.type === "column" && n.columnId) {
|
|
465
|
+
U.current = "column";
|
|
466
|
+
let e = document.querySelector(`[data-column-id="${n.columnId}"]`), r = e instanceof HTMLElement ? e.getBoundingClientRect().height : void 0;
|
|
467
|
+
L({
|
|
468
|
+
type: "column",
|
|
469
|
+
id: String(t.active.id),
|
|
470
|
+
columnId: n.columnId,
|
|
471
|
+
overlayHeight: r
|
|
472
|
+
});
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if (n?.type === "card" && n.columnId) {
|
|
476
|
+
let r = e.find((e) => e.id === n.columnId)?.cards.find((e) => e.id === String(t.active.id));
|
|
477
|
+
U.current = "card", L({
|
|
478
|
+
type: "card",
|
|
479
|
+
id: String(t.active.id),
|
|
480
|
+
columnId: n.columnId,
|
|
481
|
+
card: r
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
}, [e]), ue = s((e) => {
|
|
485
|
+
let t = e.active.data.current, n = e.over?.data.current, r = q({
|
|
486
|
+
activeType: t?.type ?? null,
|
|
487
|
+
activeId: String(e.active.id),
|
|
488
|
+
fromColumnId: t?.columnId,
|
|
489
|
+
overType: n?.type ?? null,
|
|
490
|
+
overColumnId: n?.columnId,
|
|
491
|
+
overIndex: n?.index,
|
|
492
|
+
sortableIds: oe,
|
|
493
|
+
droppableIds: se
|
|
494
|
+
});
|
|
495
|
+
U.current = null, L(null), r?.kind === "card" && C?.(r.payload), r?.kind === "column" && w?.(r.payload);
|
|
496
|
+
}, [
|
|
497
|
+
se,
|
|
498
|
+
C,
|
|
499
|
+
w,
|
|
500
|
+
oe
|
|
501
|
+
]), de = s(() => {
|
|
502
|
+
U.current = null, L(null);
|
|
503
|
+
}, []), $ = I?.type === "column" ? e.find((e) => e.id === I.columnId) : void 0;
|
|
504
|
+
return /* @__PURE__ */ o(m, {
|
|
505
|
+
sensors: W,
|
|
506
|
+
collisionDetection: ce,
|
|
507
|
+
measuring: ne,
|
|
508
|
+
autoScroll: I?.type === "column",
|
|
509
|
+
onDragStart: le,
|
|
510
|
+
onDragEnd: ue,
|
|
511
|
+
onDragCancel: de,
|
|
512
|
+
children: [/* @__PURE__ */ a("div", {
|
|
513
|
+
className: j.root,
|
|
514
|
+
"data-testid": "kanban-root",
|
|
515
|
+
children: e.length === 0 ? /* @__PURE__ */ a("div", {
|
|
516
|
+
className: j.empty,
|
|
517
|
+
children: F
|
|
518
|
+
}) : /* @__PURE__ */ a(D, {
|
|
519
|
+
items: ae,
|
|
520
|
+
strategy: O,
|
|
521
|
+
children: /* @__PURE__ */ a("div", {
|
|
522
|
+
className: j.board,
|
|
523
|
+
children: e.map((e) => /* @__PURE__ */ a(G, {
|
|
524
|
+
column: e,
|
|
525
|
+
columnWidth: K,
|
|
526
|
+
collapsed: ie.has(e.id),
|
|
527
|
+
selectedIds: Y,
|
|
528
|
+
loadingIds: Q,
|
|
529
|
+
cardCheckable: _,
|
|
530
|
+
columnCheckable: x,
|
|
531
|
+
onCardChecked: Z,
|
|
532
|
+
onColumnChecked: re,
|
|
533
|
+
estimateCardSize: r,
|
|
534
|
+
onToggleCollapse: c,
|
|
535
|
+
onReachEnd: A,
|
|
536
|
+
onColumnAdd: k,
|
|
537
|
+
renderCardBody: N,
|
|
538
|
+
renderColumnFooter: P
|
|
539
|
+
}, e.id))
|
|
540
|
+
})
|
|
541
|
+
})
|
|
542
|
+
}), /* @__PURE__ */ o(h, {
|
|
543
|
+
dropAnimation: {
|
|
544
|
+
duration: 250,
|
|
545
|
+
easing: "cubic-bezier(0.25, 1, 0.5, 1)"
|
|
546
|
+
},
|
|
547
|
+
children: [I?.type === "card" && I.card ? /* @__PURE__ */ a("div", {
|
|
548
|
+
className: j.cardOverlay,
|
|
549
|
+
"data-testid": "kanban-card-overlay",
|
|
550
|
+
children: /* @__PURE__ */ a(M, {
|
|
551
|
+
card: I.card,
|
|
552
|
+
columnId: I.columnId,
|
|
553
|
+
selected: Y.has(I.card.id),
|
|
554
|
+
loading: Q.has(I.card.id),
|
|
555
|
+
overlay: !0,
|
|
556
|
+
checkable: _,
|
|
557
|
+
onChecked: Z,
|
|
558
|
+
renderCardBody: N
|
|
559
|
+
})
|
|
560
|
+
}) : null, $ ? /* @__PURE__ */ o("div", {
|
|
561
|
+
className: `${j.column} ${j.columnOverlay}`,
|
|
562
|
+
style: {
|
|
563
|
+
width: K,
|
|
564
|
+
height: I?.overlayHeight
|
|
565
|
+
},
|
|
566
|
+
"data-testid": "kanban-column-overlay",
|
|
567
|
+
children: [/* @__PURE__ */ a("div", {
|
|
568
|
+
className: j.header,
|
|
569
|
+
children: /* @__PURE__ */ o("div", {
|
|
570
|
+
className: j.titleRow,
|
|
571
|
+
children: [/* @__PURE__ */ a("div", {
|
|
572
|
+
className: j.title,
|
|
573
|
+
children: $.title
|
|
574
|
+
}), /* @__PURE__ */ a("span", {
|
|
575
|
+
className: j.count,
|
|
576
|
+
children: $.count
|
|
577
|
+
})]
|
|
578
|
+
})
|
|
579
|
+
}), /* @__PURE__ */ a("div", { children: $.cards.map((e) => /* @__PURE__ */ a("div", {
|
|
580
|
+
className: j.cardSlot,
|
|
581
|
+
children: /* @__PURE__ */ a(M, {
|
|
582
|
+
card: e,
|
|
583
|
+
columnId: $.id,
|
|
584
|
+
selected: Y.has(e.id),
|
|
585
|
+
loading: Q.has(e.id),
|
|
586
|
+
overlay: !0,
|
|
587
|
+
checkable: _,
|
|
588
|
+
onChecked: Z,
|
|
589
|
+
renderCardBody: N
|
|
590
|
+
})
|
|
591
|
+
}, e.id)) })]
|
|
592
|
+
}) : null]
|
|
593
|
+
})]
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
//#endregion
|
|
597
|
+
export { J as KANBAN_COLUMN_WIDTH, Y 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-Nw7Mc7qj.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
package/dist/ScrollBar/index.js
CHANGED
package/dist/Segmented/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as e } from "../Icon/Icon-CcKDWNGy.js";
|
|
2
2
|
import { a as t, i as n } from "../Overlay/OverlayContext-CVSFoyqN.js";
|
|
3
|
-
import { t as r } from "../vendors/useLocale-
|
|
3
|
+
import { t as r } from "../vendors/useLocale-3oUjPb-k.js";
|
|
4
4
|
import { n as i, r as a } from "../vendors/animations-ISccYUE3.js";
|
|
5
5
|
import { t as o } from "../vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
|
|
6
6
|
import { t as s } from "../vendors/cssVars-UpriQzph.js";
|
|
7
|
-
import { t as c } from "./SelectInputSearch-
|
|
7
|
+
import { t as c } from "./SelectInputSearch-BMJQw4ll.js";
|
|
8
8
|
import { n as l, t as u } from "../vendors/Tree-BkxKK0Sf.js";
|
|
9
9
|
import { n as d } from "../CheckBox/CheckBox-BGbMzNLG.js";
|
|
10
10
|
import { t as f } from "../CheckBox/CheckBox-Cc-7FP-b.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../Icon/Icon-CcKDWNGy.js";
|
|
2
|
-
import { t } from "../vendors/useLocale-
|
|
2
|
+
import { t } from "../vendors/useLocale-3oUjPb-k.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
import { useRef as i } from "react";
|
|
5
5
|
//#region src/components/Select/SelectInputSearch/SelectInputSearch.tsx
|