@object-ui/plugin-kanban 3.0.3 → 3.1.1
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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +10 -0
- package/dist/{KanbanEnhanced-BPIKjTDv.js → KanbanEnhanced-CXDSLlGR.js} +338 -324
- package/dist/KanbanImpl-4dgoNPtI.js +350 -0
- package/dist/index-CyNcIIS1.js +1077 -0
- package/dist/index.js +9 -4
- package/dist/index.umd.cjs +4 -4
- package/dist/src/CardTemplates.d.ts +25 -0
- package/dist/src/CardTemplates.d.ts.map +1 -0
- package/dist/src/InlineQuickAdd.d.ts +29 -0
- package/dist/src/InlineQuickAdd.d.ts.map +1 -0
- package/dist/src/KanbanEnhanced.d.ts +12 -1
- package/dist/src/KanbanEnhanced.d.ts.map +1 -1
- package/dist/src/KanbanImpl.d.ts +15 -1
- package/dist/src/KanbanImpl.d.ts.map +1 -1
- package/dist/src/ObjectKanban.d.ts.map +1 -1
- package/dist/src/index.d.ts +22 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +97 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/useColumnWidths.d.ts +30 -0
- package/dist/src/useColumnWidths.d.ts.map +1 -0
- package/dist/src/useCrossSwimlaneMove.d.ts +46 -0
- package/dist/src/useCrossSwimlaneMove.d.ts.map +1 -0
- package/dist/src/useQuickAddReorder.d.ts +28 -0
- package/dist/src/useQuickAddReorder.d.ts.map +1 -0
- package/package.json +9 -9
- package/src/CardTemplates.tsx +123 -0
- package/src/InlineQuickAdd.tsx +189 -0
- package/src/KanbanEnhanced.tsx +140 -9
- package/src/KanbanImpl.tsx +266 -23
- package/src/ObjectKanban.tsx +39 -24
- package/src/__tests__/KanbanGrouping.test.tsx +164 -0
- package/src/__tests__/KanbanSwimlanes.test.tsx +194 -0
- package/src/__tests__/ObjectKanbanTitle.test.tsx +93 -0
- package/src/__tests__/SwimlanePersistence.test.tsx +159 -0
- package/src/__tests__/performance-benchmark.test.tsx +14 -14
- package/src/__tests__/phase13-features.test.tsx +387 -0
- package/src/index.tsx +49 -6
- package/src/types.ts +106 -1
- package/src/useColumnWidths.ts +125 -0
- package/src/useCrossSwimlaneMove.ts +116 -0
- package/src/useQuickAddReorder.ts +107 -0
- package/dist/KanbanImpl-BfOKAnJS.js +0 -194
- package/dist/index-CWGTi2xn.js +0 -600
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { c as U, j as a, C as Q, P as X } from "./index-CyNcIIS1.js";
|
|
2
|
+
import * as v from "react";
|
|
3
|
+
import { flushSync as Z } from "react-dom";
|
|
4
|
+
import { u as ee, a as te, D as se, c as ne, b as ie, d as re, P as oe, e as Y, S as le, v as ae, C as ce } from "./sortable.esm-CNNHgHk5.js";
|
|
5
|
+
import { Button as G, Badge as L, Card as de, CardHeader as he, CardTitle as ue, CardDescription as fe, CardContent as me, Input as ge } from "@object-ui/components";
|
|
6
|
+
const pe = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], ve = U("chevron-right", pe);
|
|
7
|
+
const xe = [
|
|
8
|
+
[
|
|
9
|
+
"path",
|
|
10
|
+
{
|
|
11
|
+
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
12
|
+
key: "wmoenq"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
16
|
+
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
17
|
+
], be = U("triangle-alert", xe);
|
|
18
|
+
function A(n, l, e) {
|
|
8
19
|
let s = e.initialDeps ?? [], t, i = !0;
|
|
9
20
|
function o() {
|
|
10
|
-
var r,
|
|
11
|
-
let
|
|
12
|
-
e.key && ((r = e.debug) != null && r.call(e)) && (
|
|
13
|
-
const
|
|
14
|
-
if (!(
|
|
21
|
+
var r, d, h;
|
|
22
|
+
let u;
|
|
23
|
+
e.key && ((r = e.debug) != null && r.call(e)) && (u = Date.now());
|
|
24
|
+
const m = n();
|
|
25
|
+
if (!(m.length !== s.length || m.some((w, p) => s[p] !== w)))
|
|
15
26
|
return t;
|
|
16
|
-
s =
|
|
17
|
-
let
|
|
18
|
-
if (e.key && ((
|
|
19
|
-
const w = Math.round((Date.now() -
|
|
20
|
-
for (
|
|
21
|
-
|
|
22
|
-
return
|
|
27
|
+
s = m;
|
|
28
|
+
let g;
|
|
29
|
+
if (e.key && ((d = e.debug) != null && d.call(e)) && (g = Date.now()), t = l(...m), e.key && ((h = e.debug) != null && h.call(e))) {
|
|
30
|
+
const w = Math.round((Date.now() - u) * 100) / 100, p = Math.round((Date.now() - g) * 100) / 100, E = p / 16, z = (C, D) => {
|
|
31
|
+
for (C = String(C); C.length < D; )
|
|
32
|
+
C = " " + C;
|
|
33
|
+
return C;
|
|
23
34
|
};
|
|
24
35
|
console.info(
|
|
25
|
-
`%c⏱ ${
|
|
36
|
+
`%c⏱ ${z(p, 5)} /${z(w, 5)} ms`,
|
|
26
37
|
`
|
|
27
38
|
font-size: .6rem;
|
|
28
39
|
font-weight: bold;
|
|
29
40
|
color: hsl(${Math.max(
|
|
30
41
|
0,
|
|
31
|
-
Math.min(120 - 120 *
|
|
42
|
+
Math.min(120 - 120 * E, 120)
|
|
32
43
|
)}deg 100% 31%);`,
|
|
33
44
|
e?.key
|
|
34
45
|
);
|
|
@@ -39,25 +50,25 @@ function N(n, l, e) {
|
|
|
39
50
|
s = r;
|
|
40
51
|
}, o;
|
|
41
52
|
}
|
|
42
|
-
function
|
|
53
|
+
function P(n, l) {
|
|
43
54
|
if (n === void 0)
|
|
44
55
|
throw new Error("Unexpected undefined");
|
|
45
56
|
return n;
|
|
46
57
|
}
|
|
47
|
-
const
|
|
58
|
+
const Ce = (n, l) => Math.abs(n - l) < 1.01, ye = (n, l, e) => {
|
|
48
59
|
let s;
|
|
49
60
|
return function(...t) {
|
|
50
61
|
n.clearTimeout(s), s = n.setTimeout(() => l.apply(this, t), e);
|
|
51
62
|
};
|
|
52
|
-
},
|
|
63
|
+
}, H = (n) => {
|
|
53
64
|
const { offsetWidth: l, offsetHeight: e } = n;
|
|
54
65
|
return { width: l, height: e };
|
|
55
|
-
},
|
|
66
|
+
}, we = (n) => n, Se = (n) => {
|
|
56
67
|
const l = Math.max(n.startIndex - n.overscan, 0), e = Math.min(n.endIndex + n.overscan, n.count - 1), s = [];
|
|
57
68
|
for (let t = l; t <= e; t++)
|
|
58
69
|
s.push(t);
|
|
59
70
|
return s;
|
|
60
|
-
},
|
|
71
|
+
}, Ee = (n, l) => {
|
|
61
72
|
const e = n.scrollElement;
|
|
62
73
|
if (!e)
|
|
63
74
|
return;
|
|
@@ -65,32 +76,32 @@ const me = (n, l) => Math.abs(n - l) < 1.01, ge = (n, l, e) => {
|
|
|
65
76
|
if (!s)
|
|
66
77
|
return;
|
|
67
78
|
const t = (o) => {
|
|
68
|
-
const { width: r, height:
|
|
69
|
-
l({ width: Math.round(r), height: Math.round(
|
|
79
|
+
const { width: r, height: d } = o;
|
|
80
|
+
l({ width: Math.round(r), height: Math.round(d) });
|
|
70
81
|
};
|
|
71
|
-
if (t(
|
|
82
|
+
if (t(H(e)), !s.ResizeObserver)
|
|
72
83
|
return () => {
|
|
73
84
|
};
|
|
74
85
|
const i = new s.ResizeObserver((o) => {
|
|
75
86
|
const r = () => {
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
80
|
-
t({ width:
|
|
87
|
+
const d = o[0];
|
|
88
|
+
if (d?.borderBoxSize) {
|
|
89
|
+
const h = d.borderBoxSize[0];
|
|
90
|
+
if (h) {
|
|
91
|
+
t({ width: h.inlineSize, height: h.blockSize });
|
|
81
92
|
return;
|
|
82
93
|
}
|
|
83
94
|
}
|
|
84
|
-
t(
|
|
95
|
+
t(H(e));
|
|
85
96
|
};
|
|
86
97
|
n.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
|
|
87
98
|
});
|
|
88
99
|
return i.observe(e, { box: "border-box" }), () => {
|
|
89
100
|
i.unobserve(e);
|
|
90
101
|
};
|
|
91
|
-
},
|
|
102
|
+
}, $ = {
|
|
92
103
|
passive: !0
|
|
93
|
-
},
|
|
104
|
+
}, q = typeof window > "u" ? !0 : "onscrollend" in window, Ie = (n, l) => {
|
|
94
105
|
const e = n.scrollElement;
|
|
95
106
|
if (!e)
|
|
96
107
|
return;
|
|
@@ -98,23 +109,23 @@ const me = (n, l) => Math.abs(n - l) < 1.01, ge = (n, l, e) => {
|
|
|
98
109
|
if (!s)
|
|
99
110
|
return;
|
|
100
111
|
let t = 0;
|
|
101
|
-
const i = n.options.useScrollendEvent &&
|
|
102
|
-
} :
|
|
112
|
+
const i = n.options.useScrollendEvent && q ? () => {
|
|
113
|
+
} : ye(
|
|
103
114
|
s,
|
|
104
115
|
() => {
|
|
105
116
|
l(t, !1);
|
|
106
117
|
},
|
|
107
118
|
n.options.isScrollingResetDelay
|
|
108
|
-
), o = (
|
|
109
|
-
const { horizontal:
|
|
110
|
-
t =
|
|
111
|
-
}, r = o(!0),
|
|
112
|
-
e.addEventListener("scroll", r,
|
|
113
|
-
const
|
|
114
|
-
return
|
|
115
|
-
e.removeEventListener("scroll", r),
|
|
119
|
+
), o = (u) => () => {
|
|
120
|
+
const { horizontal: m, isRtl: c } = n.options;
|
|
121
|
+
t = m ? e.scrollLeft * (c && -1 || 1) : e.scrollTop, i(), l(t, u);
|
|
122
|
+
}, r = o(!0), d = o(!1);
|
|
123
|
+
e.addEventListener("scroll", r, $);
|
|
124
|
+
const h = n.options.useScrollendEvent && q;
|
|
125
|
+
return h && e.addEventListener("scrollend", d, $), () => {
|
|
126
|
+
e.removeEventListener("scroll", r), h && e.removeEventListener("scrollend", d);
|
|
116
127
|
};
|
|
117
|
-
},
|
|
128
|
+
}, ze = (n, l, e) => {
|
|
118
129
|
if (l?.borderBoxSize) {
|
|
119
130
|
const s = l.borderBoxSize[0];
|
|
120
131
|
if (s)
|
|
@@ -123,7 +134,7 @@ const me = (n, l) => Math.abs(n - l) < 1.01, ge = (n, l, e) => {
|
|
|
123
134
|
);
|
|
124
135
|
}
|
|
125
136
|
return n[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
126
|
-
},
|
|
137
|
+
}, Me = (n, {
|
|
127
138
|
adjustments: l = 0,
|
|
128
139
|
behavior: e
|
|
129
140
|
}, s) => {
|
|
@@ -134,7 +145,7 @@ const me = (n, l) => Math.abs(n - l) < 1.01, ge = (n, l, e) => {
|
|
|
134
145
|
behavior: e
|
|
135
146
|
});
|
|
136
147
|
};
|
|
137
|
-
class
|
|
148
|
+
class Oe {
|
|
138
149
|
constructor(l) {
|
|
139
150
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.currentScrollToIndex = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
140
151
|
let e = null;
|
|
@@ -172,11 +183,11 @@ class ye {
|
|
|
172
183
|
scrollPaddingStart: 0,
|
|
173
184
|
scrollPaddingEnd: 0,
|
|
174
185
|
horizontal: !1,
|
|
175
|
-
getItemKey:
|
|
176
|
-
rangeExtractor:
|
|
186
|
+
getItemKey: we,
|
|
187
|
+
rangeExtractor: Se,
|
|
177
188
|
onChange: () => {
|
|
178
189
|
},
|
|
179
|
-
measureElement:
|
|
190
|
+
measureElement: ze,
|
|
180
191
|
initialRect: { width: 0, height: 0 },
|
|
181
192
|
scrollMargin: 0,
|
|
182
193
|
gap: 0,
|
|
@@ -193,7 +204,7 @@ class ye {
|
|
|
193
204
|
}, this.notify = (e) => {
|
|
194
205
|
var s, t;
|
|
195
206
|
(t = (s = this.options).onChange) == null || t.call(s, this, e);
|
|
196
|
-
}, this.maybeNotify =
|
|
207
|
+
}, this.maybeNotify = A(
|
|
197
208
|
() => (this.calculateRange(), [
|
|
198
209
|
this.isScrolling,
|
|
199
210
|
this.range ? this.range.startIndex : null,
|
|
@@ -244,14 +255,14 @@ class ye {
|
|
|
244
255
|
const r = e[o];
|
|
245
256
|
if (t.has(r.lane))
|
|
246
257
|
continue;
|
|
247
|
-
const
|
|
258
|
+
const d = i.get(
|
|
248
259
|
r.lane
|
|
249
260
|
);
|
|
250
|
-
if (
|
|
261
|
+
if (d == null || r.end > d.end ? i.set(r.lane, r) : r.end < d.end && t.set(r.lane, !0), t.size === this.options.lanes)
|
|
251
262
|
break;
|
|
252
263
|
}
|
|
253
264
|
return i.size === this.options.lanes ? Array.from(i.values()).sort((o, r) => o.end === r.end ? o.index - r.index : o.end - r.end)[0] : void 0;
|
|
254
|
-
}, this.getMeasurementOptions =
|
|
265
|
+
}, this.getMeasurementOptions = A(
|
|
255
266
|
() => [
|
|
256
267
|
this.options.count,
|
|
257
268
|
this.options.paddingStart,
|
|
@@ -271,61 +282,61 @@ class ye {
|
|
|
271
282
|
{
|
|
272
283
|
key: !1
|
|
273
284
|
}
|
|
274
|
-
), this.getMeasurements =
|
|
285
|
+
), this.getMeasurements = A(
|
|
275
286
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
276
|
-
({ count: e, paddingStart: s, scrollMargin: t, getItemKey: i, enabled: o, lanes: r },
|
|
287
|
+
({ count: e, paddingStart: s, scrollMargin: t, getItemKey: i, enabled: o, lanes: r }, d) => {
|
|
277
288
|
if (!o)
|
|
278
289
|
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
279
290
|
if (this.laneAssignments.size > e)
|
|
280
|
-
for (const
|
|
281
|
-
|
|
282
|
-
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((
|
|
283
|
-
this.itemSizeCache.set(
|
|
291
|
+
for (const c of this.laneAssignments.keys())
|
|
292
|
+
c >= e && this.laneAssignments.delete(c);
|
|
293
|
+
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((c) => {
|
|
294
|
+
this.itemSizeCache.set(c.key, c.size);
|
|
284
295
|
}));
|
|
285
|
-
const
|
|
296
|
+
const h = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
286
297
|
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1);
|
|
287
|
-
const
|
|
298
|
+
const u = this.measurementsCache.slice(0, h), m = new Array(r).fill(
|
|
288
299
|
void 0
|
|
289
300
|
);
|
|
290
|
-
for (let
|
|
291
|
-
const
|
|
292
|
-
|
|
301
|
+
for (let c = 0; c < h; c++) {
|
|
302
|
+
const g = u[c];
|
|
303
|
+
g && (m[g.lane] = c);
|
|
293
304
|
}
|
|
294
|
-
for (let
|
|
295
|
-
const
|
|
296
|
-
let p,
|
|
305
|
+
for (let c = h; c < e; c++) {
|
|
306
|
+
const g = i(c), w = this.laneAssignments.get(c);
|
|
307
|
+
let p, E;
|
|
297
308
|
if (w !== void 0 && this.options.lanes > 1) {
|
|
298
309
|
p = w;
|
|
299
|
-
const
|
|
300
|
-
|
|
310
|
+
const S = m[p], f = S !== void 0 ? u[S] : void 0;
|
|
311
|
+
E = f ? f.end + this.options.gap : s + t;
|
|
301
312
|
} else {
|
|
302
|
-
const
|
|
303
|
-
|
|
313
|
+
const S = this.options.lanes === 1 ? u[c - 1] : this.getFurthestMeasurement(u, c);
|
|
314
|
+
E = S ? S.end + this.options.gap : s + t, p = S ? S.lane : c % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(c, p);
|
|
304
315
|
}
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
index:
|
|
308
|
-
start:
|
|
309
|
-
size:
|
|
310
|
-
end:
|
|
311
|
-
key:
|
|
316
|
+
const z = d.get(g), C = typeof z == "number" ? z : this.options.estimateSize(c), D = E + C;
|
|
317
|
+
u[c] = {
|
|
318
|
+
index: c,
|
|
319
|
+
start: E,
|
|
320
|
+
size: C,
|
|
321
|
+
end: D,
|
|
322
|
+
key: g,
|
|
312
323
|
lane: p
|
|
313
|
-
},
|
|
324
|
+
}, m[p] = c;
|
|
314
325
|
}
|
|
315
|
-
return this.measurementsCache =
|
|
326
|
+
return this.measurementsCache = u, u;
|
|
316
327
|
},
|
|
317
328
|
{
|
|
318
329
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
319
330
|
debug: () => this.options.debug
|
|
320
331
|
}
|
|
321
|
-
), this.calculateRange =
|
|
332
|
+
), this.calculateRange = A(
|
|
322
333
|
() => [
|
|
323
334
|
this.getMeasurements(),
|
|
324
335
|
this.getSize(),
|
|
325
336
|
this.getScrollOffset(),
|
|
326
337
|
this.options.lanes
|
|
327
338
|
],
|
|
328
|
-
(e, s, t, i) => this.range = e.length > 0 && s > 0 ?
|
|
339
|
+
(e, s, t, i) => this.range = e.length > 0 && s > 0 ? je({
|
|
329
340
|
measurements: e,
|
|
330
341
|
outerSize: s,
|
|
331
342
|
scrollOffset: t,
|
|
@@ -335,7 +346,7 @@ class ye {
|
|
|
335
346
|
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
336
347
|
debug: () => this.options.debug
|
|
337
348
|
}
|
|
338
|
-
), this.getVirtualIndexes =
|
|
349
|
+
), this.getVirtualIndexes = A(
|
|
339
350
|
() => {
|
|
340
351
|
let e = null, s = null;
|
|
341
352
|
const t = this.calculateRange();
|
|
@@ -385,13 +396,13 @@ class ye {
|
|
|
385
396
|
return;
|
|
386
397
|
}
|
|
387
398
|
this._measureElement(e, void 0);
|
|
388
|
-
}, this.getVirtualItems =
|
|
399
|
+
}, this.getVirtualItems = A(
|
|
389
400
|
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
390
401
|
(e, s) => {
|
|
391
402
|
const t = [];
|
|
392
403
|
for (let i = 0, o = e.length; i < o; i++) {
|
|
393
|
-
const r = e[i],
|
|
394
|
-
t.push(
|
|
404
|
+
const r = e[i], d = s[r];
|
|
405
|
+
t.push(d);
|
|
395
406
|
}
|
|
396
407
|
return t;
|
|
397
408
|
},
|
|
@@ -402,11 +413,11 @@ class ye {
|
|
|
402
413
|
), this.getVirtualItemForOffset = (e) => {
|
|
403
414
|
const s = this.getMeasurements();
|
|
404
415
|
if (s.length !== 0)
|
|
405
|
-
return
|
|
406
|
-
s[
|
|
416
|
+
return P(
|
|
417
|
+
s[J(
|
|
407
418
|
0,
|
|
408
419
|
s.length - 1,
|
|
409
|
-
(t) =>
|
|
420
|
+
(t) => P(s[t]).start,
|
|
410
421
|
e
|
|
411
422
|
)]
|
|
412
423
|
);
|
|
@@ -456,28 +467,29 @@ class ye {
|
|
|
456
467
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
457
468
|
), e = Math.max(0, Math.min(e, this.options.count - 1)), this.currentScrollToIndex = e;
|
|
458
469
|
let i = 0;
|
|
459
|
-
const o = 10, r = (
|
|
470
|
+
const o = 10, r = (h) => {
|
|
460
471
|
if (!this.targetWindow) return;
|
|
461
|
-
const
|
|
462
|
-
if (!
|
|
472
|
+
const u = this.getOffsetForIndex(e, h);
|
|
473
|
+
if (!u) {
|
|
463
474
|
console.warn("Failed to get offset for index:", e);
|
|
464
475
|
return;
|
|
465
476
|
}
|
|
466
|
-
const [
|
|
467
|
-
this._scrollToOffset(
|
|
468
|
-
|
|
477
|
+
const [m, c] = u;
|
|
478
|
+
this._scrollToOffset(m, { adjustments: void 0, behavior: t }), this.targetWindow.requestAnimationFrame(() => {
|
|
479
|
+
if (!this.targetWindow) return;
|
|
480
|
+
const g = () => {
|
|
469
481
|
if (this.currentScrollToIndex !== e) return;
|
|
470
|
-
const w = this.getScrollOffset(), p = this.getOffsetForIndex(e,
|
|
482
|
+
const w = this.getScrollOffset(), p = this.getOffsetForIndex(e, c);
|
|
471
483
|
if (!p) {
|
|
472
484
|
console.warn("Failed to get offset for index:", e);
|
|
473
485
|
return;
|
|
474
486
|
}
|
|
475
|
-
|
|
487
|
+
Ce(p[0], w) || d(c);
|
|
476
488
|
};
|
|
477
|
-
this.isDynamicMode() ? this.targetWindow.requestAnimationFrame(
|
|
489
|
+
this.isDynamicMode() ? this.targetWindow.requestAnimationFrame(g) : g();
|
|
478
490
|
});
|
|
479
|
-
},
|
|
480
|
-
this.targetWindow && this.currentScrollToIndex === e && (i++, i < o ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", i, o), this.targetWindow.requestAnimationFrame(() => r(
|
|
491
|
+
}, d = (h) => {
|
|
492
|
+
this.targetWindow && this.currentScrollToIndex === e && (i++, i < o ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", i, o), this.targetWindow.requestAnimationFrame(() => r(h))) : console.warn(
|
|
481
493
|
`Failed to scroll to index ${e} after ${o} attempts.`
|
|
482
494
|
));
|
|
483
495
|
};
|
|
@@ -520,7 +532,7 @@ class ye {
|
|
|
520
532
|
}, this.setOptions(l);
|
|
521
533
|
}
|
|
522
534
|
}
|
|
523
|
-
const
|
|
535
|
+
const J = (n, l, e, s) => {
|
|
524
536
|
for (; n <= l; ) {
|
|
525
537
|
const t = (n + l) / 2 | 0, i = e(t);
|
|
526
538
|
if (i < s)
|
|
@@ -532,19 +544,19 @@ const Y = (n, l, e, s) => {
|
|
|
532
544
|
}
|
|
533
545
|
return n > 0 ? n - 1 : 0;
|
|
534
546
|
};
|
|
535
|
-
function
|
|
547
|
+
function je({
|
|
536
548
|
measurements: n,
|
|
537
549
|
outerSize: l,
|
|
538
550
|
scrollOffset: e,
|
|
539
551
|
lanes: s
|
|
540
552
|
}) {
|
|
541
|
-
const t = n.length - 1, i = (
|
|
553
|
+
const t = n.length - 1, i = (d) => n[d].start;
|
|
542
554
|
if (n.length <= s)
|
|
543
555
|
return {
|
|
544
556
|
startIndex: 0,
|
|
545
557
|
endIndex: t
|
|
546
558
|
};
|
|
547
|
-
let o =
|
|
559
|
+
let o = J(
|
|
548
560
|
0,
|
|
549
561
|
t,
|
|
550
562
|
i,
|
|
@@ -554,167 +566,122 @@ function Se({
|
|
|
554
566
|
for (; r < t && n[r].end < e + l; )
|
|
555
567
|
r++;
|
|
556
568
|
else if (s > 1) {
|
|
557
|
-
const
|
|
558
|
-
for (; r < t &&
|
|
559
|
-
const
|
|
560
|
-
|
|
569
|
+
const d = Array(s).fill(0);
|
|
570
|
+
for (; r < t && d.some((u) => u < e + l); ) {
|
|
571
|
+
const u = n[r];
|
|
572
|
+
d[u.lane] = u.end, r++;
|
|
561
573
|
}
|
|
562
|
-
const
|
|
563
|
-
for (; o >= 0 &&
|
|
564
|
-
const
|
|
565
|
-
|
|
574
|
+
const h = Array(s).fill(e + l);
|
|
575
|
+
for (; o >= 0 && h.some((u) => u >= e); ) {
|
|
576
|
+
const u = n[o];
|
|
577
|
+
h[u.lane] = u.start, o--;
|
|
566
578
|
}
|
|
567
579
|
o = Math.max(0, o - o % s), r = Math.min(t, r + (s - 1 - r % s));
|
|
568
580
|
}
|
|
569
581
|
return { startIndex: o, endIndex: r };
|
|
570
582
|
}
|
|
571
|
-
const
|
|
572
|
-
function
|
|
583
|
+
const K = typeof document < "u" ? v.useLayoutEffect : v.useEffect;
|
|
584
|
+
function Ne({
|
|
573
585
|
useFlushSync: n = !0,
|
|
574
586
|
...l
|
|
575
587
|
}) {
|
|
576
|
-
const e =
|
|
588
|
+
const e = v.useReducer(() => ({}), {})[1], s = {
|
|
577
589
|
...l,
|
|
578
590
|
onChange: (i, o) => {
|
|
579
591
|
var r;
|
|
580
|
-
n && o ?
|
|
592
|
+
n && o ? Z(e) : e(), (r = l.onChange) == null || r.call(l, i, o);
|
|
581
593
|
}
|
|
582
|
-
}, [t] =
|
|
583
|
-
() => new
|
|
594
|
+
}, [t] = v.useState(
|
|
595
|
+
() => new Oe(s)
|
|
584
596
|
);
|
|
585
|
-
return t.setOptions(s),
|
|
597
|
+
return t.setOptions(s), K(() => t._didMount(), []), K(() => t._willUpdate()), t;
|
|
586
598
|
}
|
|
587
|
-
function
|
|
588
|
-
return
|
|
589
|
-
observeElementRect:
|
|
590
|
-
observeElementOffset:
|
|
591
|
-
scrollToFn:
|
|
599
|
+
function ke(n) {
|
|
600
|
+
return Ne({
|
|
601
|
+
observeElementRect: Ee,
|
|
602
|
+
observeElementOffset: Ie,
|
|
603
|
+
scrollToFn: Me,
|
|
592
604
|
...n
|
|
593
605
|
});
|
|
594
606
|
}
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
);
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
const je = (n) => {
|
|
617
|
-
for (const l in n)
|
|
618
|
-
if (l.startsWith("aria-") || l === "role" || l === "title")
|
|
619
|
-
return !0;
|
|
620
|
-
return !1;
|
|
621
|
-
};
|
|
622
|
-
const Ne = K(
|
|
623
|
-
({
|
|
624
|
-
color: n = "currentColor",
|
|
625
|
-
size: l = 24,
|
|
626
|
-
strokeWidth: e = 2,
|
|
627
|
-
absoluteStrokeWidth: s,
|
|
628
|
-
className: t = "",
|
|
629
|
-
children: i,
|
|
630
|
-
iconNode: o,
|
|
631
|
-
...r
|
|
632
|
-
}, a) => R(
|
|
633
|
-
"svg",
|
|
634
|
-
{
|
|
635
|
-
ref: a,
|
|
636
|
-
...Ie,
|
|
637
|
-
width: l,
|
|
638
|
-
height: l,
|
|
639
|
-
stroke: n,
|
|
640
|
-
strokeWidth: s ? Number(e) * 24 / Number(l) : e,
|
|
641
|
-
className: G("lucide", t),
|
|
642
|
-
...!i && !je(r) && { "aria-hidden": "true" },
|
|
643
|
-
...r
|
|
644
|
-
},
|
|
645
|
-
[
|
|
646
|
-
...o.map(([c, d]) => R(c, d)),
|
|
647
|
-
...Array.isArray(i) ? i : [i]
|
|
648
|
-
]
|
|
649
|
-
)
|
|
650
|
-
);
|
|
651
|
-
const L = (n, l) => {
|
|
652
|
-
const e = K(
|
|
653
|
-
({ className: s, ...t }, i) => R(Ne, {
|
|
654
|
-
ref: i,
|
|
655
|
-
iconNode: l,
|
|
656
|
-
className: G(
|
|
657
|
-
`lucide-${Oe(U(n))}`,
|
|
658
|
-
`lucide-${n}`,
|
|
659
|
-
s
|
|
660
|
-
),
|
|
661
|
-
...t
|
|
662
|
-
})
|
|
663
|
-
);
|
|
664
|
-
return e.displayName = U(n), e;
|
|
665
|
-
};
|
|
666
|
-
const Ae = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ke = L("chevron-down", Ae);
|
|
667
|
-
const _e = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], De = L("chevron-right", _e);
|
|
668
|
-
const Re = [
|
|
669
|
-
[
|
|
670
|
-
"path",
|
|
671
|
-
{
|
|
672
|
-
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
673
|
-
key: "wmoenq"
|
|
607
|
+
const V = (...n) => n.filter(Boolean).join(" ");
|
|
608
|
+
function Ae(n, l) {
|
|
609
|
+
if (!l || l.length === 0) return {};
|
|
610
|
+
for (const e of l) {
|
|
611
|
+
const s = n[e.field];
|
|
612
|
+
if (s == null) continue;
|
|
613
|
+
let t = !1;
|
|
614
|
+
const i = String(s);
|
|
615
|
+
switch (e.operator) {
|
|
616
|
+
case "equals":
|
|
617
|
+
t = i === String(e.value);
|
|
618
|
+
break;
|
|
619
|
+
case "not_equals":
|
|
620
|
+
t = i !== String(e.value);
|
|
621
|
+
break;
|
|
622
|
+
case "contains":
|
|
623
|
+
t = i.toLowerCase().includes(String(e.value).toLowerCase());
|
|
624
|
+
break;
|
|
625
|
+
case "in":
|
|
626
|
+
t = Array.isArray(e.value) && e.value.includes(i);
|
|
627
|
+
break;
|
|
674
628
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
629
|
+
if (t)
|
|
630
|
+
return {
|
|
631
|
+
...e.backgroundColor ? { backgroundColor: e.backgroundColor } : {},
|
|
632
|
+
...e.borderColor ? { borderColor: e.borderColor } : {}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
return {};
|
|
636
|
+
}
|
|
637
|
+
function W({ card: n, conditionalFormatting: l }) {
|
|
680
638
|
const {
|
|
681
|
-
attributes:
|
|
682
|
-
listeners:
|
|
683
|
-
setNodeRef:
|
|
684
|
-
transform:
|
|
685
|
-
transition:
|
|
686
|
-
isDragging:
|
|
687
|
-
} =
|
|
688
|
-
transform:
|
|
689
|
-
transition:
|
|
690
|
-
opacity:
|
|
691
|
-
};
|
|
692
|
-
return /* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
|
|
695
|
-
|
|
639
|
+
attributes: e,
|
|
640
|
+
listeners: s,
|
|
641
|
+
setNodeRef: t,
|
|
642
|
+
transform: i,
|
|
643
|
+
transition: o,
|
|
644
|
+
isDragging: r
|
|
645
|
+
} = Y({ id: n.id }), d = {
|
|
646
|
+
transform: ce.Transform.toString(i),
|
|
647
|
+
transition: o,
|
|
648
|
+
opacity: r ? 0.5 : void 0
|
|
649
|
+
}, h = Ae(n, l);
|
|
650
|
+
return /* @__PURE__ */ a.jsx("div", { ref: t, style: d, ...e, ...s, children: /* @__PURE__ */ a.jsxs(de, { className: "mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group", style: h, children: [
|
|
651
|
+
n.coverImage && /* @__PURE__ */ a.jsx("div", { className: "w-full h-32 overflow-hidden rounded-t-lg", children: /* @__PURE__ */ a.jsx(
|
|
652
|
+
"img",
|
|
653
|
+
{
|
|
654
|
+
src: n.coverImage,
|
|
655
|
+
alt: "",
|
|
656
|
+
className: "w-full h-full object-cover",
|
|
657
|
+
loading: "lazy"
|
|
658
|
+
}
|
|
659
|
+
) }),
|
|
660
|
+
/* @__PURE__ */ a.jsxs(he, { className: "p-4", children: [
|
|
661
|
+
/* @__PURE__ */ a.jsx(ue, { className: "text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors", children: n.title }),
|
|
662
|
+
n.description && /* @__PURE__ */ a.jsx(fe, { className: "text-xs text-muted-foreground font-mono", children: n.description })
|
|
696
663
|
] }),
|
|
697
|
-
n.badges && n.badges.length > 0 && /* @__PURE__ */
|
|
664
|
+
n.badges && n.badges.length > 0 && /* @__PURE__ */ a.jsx(me, { className: "p-4 pt-0", children: /* @__PURE__ */ a.jsx("div", { className: "flex flex-wrap gap-1", children: n.badges.map((u, m) => /* @__PURE__ */ a.jsx(L, { variant: u.variant || "default", className: "text-xs", children: u.label }, m)) }) })
|
|
698
665
|
] }) });
|
|
699
666
|
}
|
|
700
|
-
function
|
|
701
|
-
const
|
|
667
|
+
function De({ cards: n, parentRef: l, conditionalFormatting: e }) {
|
|
668
|
+
const s = ke({
|
|
702
669
|
count: n.length,
|
|
703
670
|
getScrollElement: () => l.current,
|
|
704
671
|
estimateSize: () => 120,
|
|
705
672
|
overscan: 5
|
|
706
673
|
});
|
|
707
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ a.jsx(
|
|
708
675
|
"div",
|
|
709
676
|
{
|
|
710
677
|
style: {
|
|
711
|
-
height: `${
|
|
678
|
+
height: `${s.getTotalSize()}px`,
|
|
712
679
|
width: "100%",
|
|
713
680
|
position: "relative"
|
|
714
681
|
},
|
|
715
|
-
children:
|
|
716
|
-
const
|
|
717
|
-
return /* @__PURE__ */
|
|
682
|
+
children: s.getVirtualItems().map((t) => {
|
|
683
|
+
const i = n[t.index];
|
|
684
|
+
return /* @__PURE__ */ a.jsx(
|
|
718
685
|
"div",
|
|
719
686
|
{
|
|
720
687
|
style: {
|
|
@@ -722,173 +689,220 @@ function Te({ cards: n, parentRef: l }) {
|
|
|
722
689
|
top: 0,
|
|
723
690
|
left: 0,
|
|
724
691
|
width: "100%",
|
|
725
|
-
transform: `translateY(${
|
|
692
|
+
transform: `translateY(${t.start}px)`
|
|
726
693
|
},
|
|
727
|
-
children: /* @__PURE__ */
|
|
694
|
+
children: /* @__PURE__ */ a.jsx(W, { card: i, conditionalFormatting: e })
|
|
728
695
|
},
|
|
729
|
-
|
|
696
|
+
i.id
|
|
730
697
|
);
|
|
731
698
|
})
|
|
732
699
|
}
|
|
733
700
|
);
|
|
734
701
|
}
|
|
735
|
-
function
|
|
702
|
+
function Re({ columnId: n, onAdd: l }) {
|
|
703
|
+
const [e, s] = v.useState(!1), [t, i] = v.useState(""), o = v.useRef(null), r = () => {
|
|
704
|
+
const h = t.trim();
|
|
705
|
+
h && (l(n, h), i("")), s(!1);
|
|
706
|
+
}, d = (h) => {
|
|
707
|
+
h.key === "Enter" ? (h.preventDefault(), r()) : h.key === "Escape" && (i(""), s(!1));
|
|
708
|
+
};
|
|
709
|
+
return e ? /* @__PURE__ */ a.jsx("div", { className: "mt-2 space-y-2", children: /* @__PURE__ */ a.jsx(
|
|
710
|
+
ge,
|
|
711
|
+
{
|
|
712
|
+
ref: o,
|
|
713
|
+
value: t,
|
|
714
|
+
onChange: (h) => i(h.target.value),
|
|
715
|
+
onKeyDown: d,
|
|
716
|
+
onBlur: r,
|
|
717
|
+
placeholder: "Enter card title...",
|
|
718
|
+
className: "text-sm",
|
|
719
|
+
autoFocus: !0
|
|
720
|
+
}
|
|
721
|
+
) }) : /* @__PURE__ */ a.jsxs(
|
|
722
|
+
G,
|
|
723
|
+
{
|
|
724
|
+
variant: "ghost",
|
|
725
|
+
size: "sm",
|
|
726
|
+
className: "w-full mt-2 text-muted-foreground hover:text-foreground",
|
|
727
|
+
onClick: () => {
|
|
728
|
+
s(!0), setTimeout(() => o.current?.focus(), 0);
|
|
729
|
+
},
|
|
730
|
+
children: [
|
|
731
|
+
/* @__PURE__ */ a.jsx(X, { className: "h-4 w-4 mr-1" }),
|
|
732
|
+
"Add Card"
|
|
733
|
+
]
|
|
734
|
+
}
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
function _e({
|
|
736
738
|
column: n,
|
|
737
739
|
cards: l,
|
|
738
740
|
onToggle: e,
|
|
739
|
-
enableVirtual: s
|
|
741
|
+
enableVirtual: s,
|
|
742
|
+
quickAdd: t,
|
|
743
|
+
onQuickAdd: i,
|
|
744
|
+
conditionalFormatting: o
|
|
740
745
|
}) {
|
|
741
|
-
const
|
|
746
|
+
const r = l || [], d = v.useRef(null), { setNodeRef: h } = Y({
|
|
742
747
|
id: n.id,
|
|
743
748
|
data: {
|
|
744
749
|
type: "column"
|
|
745
750
|
}
|
|
746
|
-
}),
|
|
747
|
-
return /* @__PURE__ */
|
|
751
|
+
}), u = n.limit && r.length >= n.limit, m = n.limit && r.length >= n.limit * 0.8;
|
|
752
|
+
return /* @__PURE__ */ a.jsxs(
|
|
748
753
|
"div",
|
|
749
754
|
{
|
|
750
|
-
ref:
|
|
751
|
-
className:
|
|
755
|
+
ref: h,
|
|
756
|
+
className: V(
|
|
752
757
|
"flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all",
|
|
753
758
|
n.collapsed ? "w-16" : "w-80",
|
|
754
759
|
n.className
|
|
755
760
|
),
|
|
756
761
|
children: [
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
-
|
|
762
|
+
/* @__PURE__ */ a.jsxs("div", { className: "p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between", children: [
|
|
763
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
764
|
+
/* @__PURE__ */ a.jsx(
|
|
765
|
+
G,
|
|
761
766
|
{
|
|
762
767
|
variant: "ghost",
|
|
763
768
|
size: "sm",
|
|
764
769
|
className: "h-6 w-6 p-0",
|
|
765
770
|
onClick: () => e(!n.collapsed),
|
|
766
|
-
children: n.collapsed ? /* @__PURE__ */
|
|
771
|
+
children: n.collapsed ? /* @__PURE__ */ a.jsx(ve, { className: "h-4 w-4" }) : /* @__PURE__ */ a.jsx(Q, { className: "h-4 w-4" })
|
|
767
772
|
}
|
|
768
773
|
),
|
|
769
|
-
!n.collapsed && /* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
774
|
+
!n.collapsed && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
775
|
+
/* @__PURE__ */ a.jsx("h3", { className: "font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate", children: n.title }),
|
|
776
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
777
|
+
/* @__PURE__ */ a.jsxs("span", { className: V(
|
|
773
778
|
"font-mono text-xs",
|
|
774
|
-
|
|
779
|
+
u ? "text-destructive" : m ? "text-yellow-500" : "text-muted-foreground"
|
|
775
780
|
), children: [
|
|
776
|
-
|
|
781
|
+
r.length,
|
|
777
782
|
n.limit && ` / ${n.limit}`
|
|
778
783
|
] }),
|
|
779
|
-
|
|
780
|
-
|
|
784
|
+
u && /* @__PURE__ */ a.jsx(L, { variant: "destructive", className: "text-xs", children: "Full" }),
|
|
785
|
+
m && !u && /* @__PURE__ */ a.jsx(be, { className: "h-3 w-3 text-yellow-500" })
|
|
781
786
|
] })
|
|
782
787
|
] })
|
|
783
788
|
] }),
|
|
784
|
-
n.collapsed && /* @__PURE__ */
|
|
785
|
-
/* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
789
|
+
n.collapsed && /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
|
|
790
|
+
/* @__PURE__ */ a.jsx("span", { className: "font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180", children: n.title }),
|
|
791
|
+
/* @__PURE__ */ a.jsx(L, { variant: "secondary", className: "text-xs", children: r.length })
|
|
787
792
|
] })
|
|
788
793
|
] }),
|
|
789
|
-
!n.collapsed && /* @__PURE__ */
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
794
|
+
!n.collapsed && /* @__PURE__ */ a.jsxs("div", { ref: d, className: "flex-1 p-4 overflow-y-auto", style: { maxHeight: "600px" }, children: [
|
|
795
|
+
/* @__PURE__ */ a.jsx(
|
|
796
|
+
le,
|
|
797
|
+
{
|
|
798
|
+
items: r.map((c) => c.id),
|
|
799
|
+
strategy: ae,
|
|
800
|
+
children: s ? /* @__PURE__ */ a.jsx(De, { cards: r, parentRef: d, conditionalFormatting: o }) : /* @__PURE__ */ a.jsx("div", { className: "space-y-2", children: r.map((c) => /* @__PURE__ */ a.jsx(W, { card: c, conditionalFormatting: o }, c.id)) })
|
|
801
|
+
}
|
|
802
|
+
),
|
|
803
|
+
t && i && /* @__PURE__ */ a.jsx(Re, { columnId: n.id, onAdd: i })
|
|
804
|
+
] })
|
|
797
805
|
]
|
|
798
806
|
}
|
|
799
807
|
);
|
|
800
808
|
}
|
|
801
|
-
function
|
|
809
|
+
function We({
|
|
802
810
|
columns: n,
|
|
803
811
|
onCardMove: l,
|
|
804
812
|
onColumnToggle: e,
|
|
805
813
|
enableVirtualScrolling: s = !1,
|
|
806
814
|
virtualScrollThreshold: t = 50,
|
|
807
|
-
className: i
|
|
815
|
+
className: i,
|
|
816
|
+
quickAdd: o,
|
|
817
|
+
onQuickAdd: r,
|
|
818
|
+
conditionalFormatting: d
|
|
808
819
|
}) {
|
|
809
|
-
const [
|
|
820
|
+
const [h, u] = v.useState(null), m = v.useMemo(() => (n || []).map((f) => ({
|
|
810
821
|
...f,
|
|
811
822
|
cards: f.cards || []
|
|
812
|
-
})), [n]), [c,
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
}, [
|
|
816
|
-
const
|
|
817
|
-
|
|
823
|
+
})), [n]), [c, g] = v.useState(m);
|
|
824
|
+
v.useEffect(() => {
|
|
825
|
+
g(m);
|
|
826
|
+
}, [m]);
|
|
827
|
+
const w = ee(
|
|
828
|
+
te(oe, {
|
|
818
829
|
activationConstraint: {
|
|
819
830
|
distance: 8
|
|
820
831
|
}
|
|
821
832
|
})
|
|
822
|
-
),
|
|
823
|
-
const { active:
|
|
824
|
-
|
|
825
|
-
},
|
|
826
|
-
const { active:
|
|
827
|
-
if (
|
|
828
|
-
const
|
|
829
|
-
if (
|
|
830
|
-
const M =
|
|
831
|
-
if (!(!M || !
|
|
832
|
-
if (M.id ===
|
|
833
|
-
const O = [...M.cards],
|
|
834
|
-
|
|
835
|
-
(
|
|
836
|
-
(
|
|
833
|
+
), p = (f) => {
|
|
834
|
+
const { active: x } = f, b = z(x.id);
|
|
835
|
+
u(b);
|
|
836
|
+
}, E = (f) => {
|
|
837
|
+
const { active: x, over: b } = f;
|
|
838
|
+
if (u(null), !b) return;
|
|
839
|
+
const y = x.id, j = b.id;
|
|
840
|
+
if (y === j) return;
|
|
841
|
+
const M = C(y), N = C(j) || D(j);
|
|
842
|
+
if (!(!M || !N))
|
|
843
|
+
if (M.id === N.id) {
|
|
844
|
+
const O = [...M.cards], k = O.findIndex((I) => I.id === y), T = O.findIndex((I) => I.id === j), B = re(O, k, T);
|
|
845
|
+
g(
|
|
846
|
+
(I) => I.map(
|
|
847
|
+
(R) => R.id === M.id ? { ...R, cards: B } : R
|
|
837
848
|
)
|
|
838
849
|
);
|
|
839
850
|
} else {
|
|
840
|
-
const O = [...M.cards],
|
|
841
|
-
|
|
842
|
-
(
|
|
843
|
-
), l && l(
|
|
851
|
+
const O = [...M.cards], k = [...N.cards], T = O.findIndex((_) => _.id === y), I = j === N.id ? k.length : k.findIndex((_) => _.id === j), [R] = O.splice(T, 1);
|
|
852
|
+
k.splice(I, 0, R), g(
|
|
853
|
+
(_) => _.map((F) => F.id === M.id ? { ...F, cards: O } : F.id === N.id ? { ...F, cards: k } : F)
|
|
854
|
+
), l && l(y, M.id, N.id, I);
|
|
844
855
|
}
|
|
845
|
-
},
|
|
856
|
+
}, z = v.useCallback(
|
|
846
857
|
(f) => {
|
|
847
|
-
for (const
|
|
848
|
-
const
|
|
849
|
-
if (
|
|
858
|
+
for (const x of c) {
|
|
859
|
+
const b = x.cards.find((y) => y.id === f);
|
|
860
|
+
if (b) return b;
|
|
850
861
|
}
|
|
851
862
|
return null;
|
|
852
863
|
},
|
|
853
864
|
[c]
|
|
854
|
-
),
|
|
855
|
-
(f) => c.find((
|
|
865
|
+
), C = v.useCallback(
|
|
866
|
+
(f) => c.find((x) => x.cards.some((b) => b.id === f)) || null,
|
|
856
867
|
[c]
|
|
857
|
-
),
|
|
858
|
-
(f) => c.find((
|
|
868
|
+
), D = v.useCallback(
|
|
869
|
+
(f) => c.find((x) => x.id === f) || null,
|
|
859
870
|
[c]
|
|
860
|
-
),
|
|
861
|
-
|
|
862
|
-
(
|
|
863
|
-
), e?.(f,
|
|
871
|
+
), S = v.useCallback((f, x) => {
|
|
872
|
+
g(
|
|
873
|
+
(b) => b.map((y) => y.id === f ? { ...y, collapsed: x } : y)
|
|
874
|
+
), e?.(f, x);
|
|
864
875
|
}, [e]);
|
|
865
|
-
return /* @__PURE__ */
|
|
866
|
-
|
|
876
|
+
return /* @__PURE__ */ a.jsxs(
|
|
877
|
+
se,
|
|
867
878
|
{
|
|
868
|
-
sensors:
|
|
869
|
-
collisionDetection:
|
|
870
|
-
onDragStart:
|
|
871
|
-
onDragEnd:
|
|
879
|
+
sensors: w,
|
|
880
|
+
collisionDetection: ne,
|
|
881
|
+
onDragStart: p,
|
|
882
|
+
onDragEnd: E,
|
|
872
883
|
children: [
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
const
|
|
875
|
-
return /* @__PURE__ */
|
|
876
|
-
|
|
884
|
+
/* @__PURE__ */ a.jsx("div", { className: V("flex gap-4 overflow-x-auto p-4", i), children: c.map((f) => {
|
|
885
|
+
const x = s && f.cards.length > t;
|
|
886
|
+
return /* @__PURE__ */ a.jsx(
|
|
887
|
+
_e,
|
|
877
888
|
{
|
|
878
889
|
column: f,
|
|
879
890
|
cards: f.cards,
|
|
880
|
-
onToggle: (
|
|
881
|
-
enableVirtual:
|
|
891
|
+
onToggle: (b) => S(f.id, b),
|
|
892
|
+
enableVirtual: x,
|
|
893
|
+
quickAdd: o,
|
|
894
|
+
onQuickAdd: r,
|
|
895
|
+
conditionalFormatting: d
|
|
882
896
|
},
|
|
883
897
|
f.id
|
|
884
898
|
);
|
|
885
899
|
}) }),
|
|
886
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ a.jsx(ie, { children: h ? /* @__PURE__ */ a.jsx(W, { card: h, conditionalFormatting: d }) : null })
|
|
887
901
|
]
|
|
888
902
|
}
|
|
889
903
|
);
|
|
890
904
|
}
|
|
891
905
|
export {
|
|
892
|
-
|
|
893
|
-
|
|
906
|
+
We as KanbanEnhanced,
|
|
907
|
+
We as default
|
|
894
908
|
};
|