@object-ui/plugin-kanban 3.0.2 → 3.1.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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +9 -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
package/dist/index-CWGTi2xn.js
DELETED
|
@@ -1,600 +0,0 @@
|
|
|
1
|
-
import w, { useState as P, useEffect as H, useMemo as Z, Suspense as te } from "react";
|
|
2
|
-
import { ComponentRegistry as M } from "@object-ui/core";
|
|
3
|
-
import { useDataScope as de, useNavigationOverlay as fe, useSchemaContext as be } from "@object-ui/react";
|
|
4
|
-
import { NavigationOverlay as me, Skeleton as ae } from "@object-ui/components";
|
|
5
|
-
var D = { exports: {} }, O = {};
|
|
6
|
-
var Q;
|
|
7
|
-
function pe() {
|
|
8
|
-
if (Q) return O;
|
|
9
|
-
Q = 1;
|
|
10
|
-
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), b = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
11
|
-
function m(g, s, i) {
|
|
12
|
-
var d = null;
|
|
13
|
-
if (i !== void 0 && (d = "" + i), s.key !== void 0 && (d = "" + s.key), "key" in s) {
|
|
14
|
-
i = {};
|
|
15
|
-
for (var o in s)
|
|
16
|
-
o !== "key" && (i[o] = s[o]);
|
|
17
|
-
} else i = s;
|
|
18
|
-
return s = i.ref, {
|
|
19
|
-
$$typeof: r,
|
|
20
|
-
type: g,
|
|
21
|
-
key: d,
|
|
22
|
-
ref: s !== void 0 ? s : null,
|
|
23
|
-
props: i
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
return O.Fragment = b, O.jsx = m, O.jsxs = m, O;
|
|
27
|
-
}
|
|
28
|
-
var A = {};
|
|
29
|
-
var ee;
|
|
30
|
-
function ge() {
|
|
31
|
-
return ee || (ee = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
32
|
-
function r(e) {
|
|
33
|
-
if (e == null) return null;
|
|
34
|
-
if (typeof e == "function")
|
|
35
|
-
return e.$$typeof === ie ? null : e.displayName || e.name || null;
|
|
36
|
-
if (typeof e == "string") return e;
|
|
37
|
-
switch (e) {
|
|
38
|
-
case y:
|
|
39
|
-
return "Fragment";
|
|
40
|
-
case Y:
|
|
41
|
-
return "Profiler";
|
|
42
|
-
case F:
|
|
43
|
-
return "StrictMode";
|
|
44
|
-
case v:
|
|
45
|
-
return "Suspense";
|
|
46
|
-
case n:
|
|
47
|
-
return "SuspenseList";
|
|
48
|
-
case se:
|
|
49
|
-
return "Activity";
|
|
50
|
-
}
|
|
51
|
-
if (typeof e == "object")
|
|
52
|
-
switch (typeof e.tag == "number" && console.error(
|
|
53
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
54
|
-
), e.$$typeof) {
|
|
55
|
-
case S:
|
|
56
|
-
return "Portal";
|
|
57
|
-
case L:
|
|
58
|
-
return e.displayName || "Context";
|
|
59
|
-
case x:
|
|
60
|
-
return (e._context.displayName || "Context") + ".Consumer";
|
|
61
|
-
case a:
|
|
62
|
-
var t = e.render;
|
|
63
|
-
return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
64
|
-
case _:
|
|
65
|
-
return t = e.displayName || null, t !== null ? t : r(e.type) || "Memo";
|
|
66
|
-
case I:
|
|
67
|
-
t = e._payload, e = e._init;
|
|
68
|
-
try {
|
|
69
|
-
return r(e(t));
|
|
70
|
-
} catch {
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
function b(e) {
|
|
76
|
-
return "" + e;
|
|
77
|
-
}
|
|
78
|
-
function m(e) {
|
|
79
|
-
try {
|
|
80
|
-
b(e);
|
|
81
|
-
var t = !1;
|
|
82
|
-
} catch {
|
|
83
|
-
t = !0;
|
|
84
|
-
}
|
|
85
|
-
if (t) {
|
|
86
|
-
t = console;
|
|
87
|
-
var l = t.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
88
|
-
return l.call(
|
|
89
|
-
t,
|
|
90
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
91
|
-
u
|
|
92
|
-
), b(e);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function g(e) {
|
|
96
|
-
if (e === y) return "<>";
|
|
97
|
-
if (typeof e == "object" && e !== null && e.$$typeof === I)
|
|
98
|
-
return "<...>";
|
|
99
|
-
try {
|
|
100
|
-
var t = r(e);
|
|
101
|
-
return t ? "<" + t + ">" : "<...>";
|
|
102
|
-
} catch {
|
|
103
|
-
return "<...>";
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function s() {
|
|
107
|
-
var e = $.A;
|
|
108
|
-
return e === null ? null : e.getOwner();
|
|
109
|
-
}
|
|
110
|
-
function i() {
|
|
111
|
-
return Error("react-stack-top-frame");
|
|
112
|
-
}
|
|
113
|
-
function d(e) {
|
|
114
|
-
if (q.call(e, "key")) {
|
|
115
|
-
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
116
|
-
if (t && t.isReactWarning) return !1;
|
|
117
|
-
}
|
|
118
|
-
return e.key !== void 0;
|
|
119
|
-
}
|
|
120
|
-
function o(e, t) {
|
|
121
|
-
function l() {
|
|
122
|
-
z || (z = !0, console.error(
|
|
123
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
124
|
-
t
|
|
125
|
-
));
|
|
126
|
-
}
|
|
127
|
-
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
128
|
-
get: l,
|
|
129
|
-
configurable: !0
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
function f() {
|
|
133
|
-
var e = r(this.type);
|
|
134
|
-
return W[e] || (W[e] = !0, console.error(
|
|
135
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
136
|
-
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
137
|
-
}
|
|
138
|
-
function T(e, t, l, u, h, B) {
|
|
139
|
-
var c = l.ref;
|
|
140
|
-
return e = {
|
|
141
|
-
$$typeof: k,
|
|
142
|
-
type: e,
|
|
143
|
-
key: t,
|
|
144
|
-
props: l,
|
|
145
|
-
_owner: u
|
|
146
|
-
}, (c !== void 0 ? c : null) !== null ? Object.defineProperty(e, "ref", {
|
|
147
|
-
enumerable: !1,
|
|
148
|
-
get: f
|
|
149
|
-
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
150
|
-
configurable: !1,
|
|
151
|
-
enumerable: !1,
|
|
152
|
-
writable: !0,
|
|
153
|
-
value: 0
|
|
154
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
155
|
-
configurable: !1,
|
|
156
|
-
enumerable: !1,
|
|
157
|
-
writable: !0,
|
|
158
|
-
value: null
|
|
159
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
160
|
-
configurable: !1,
|
|
161
|
-
enumerable: !1,
|
|
162
|
-
writable: !0,
|
|
163
|
-
value: h
|
|
164
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
165
|
-
configurable: !1,
|
|
166
|
-
enumerable: !1,
|
|
167
|
-
writable: !0,
|
|
168
|
-
value: B
|
|
169
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
170
|
-
}
|
|
171
|
-
function E(e, t, l, u, h, B) {
|
|
172
|
-
var c = t.children;
|
|
173
|
-
if (c !== void 0)
|
|
174
|
-
if (u)
|
|
175
|
-
if (ue(c)) {
|
|
176
|
-
for (u = 0; u < c.length; u++)
|
|
177
|
-
N(c[u]);
|
|
178
|
-
Object.freeze && Object.freeze(c);
|
|
179
|
-
} else
|
|
180
|
-
console.error(
|
|
181
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
182
|
-
);
|
|
183
|
-
else N(c);
|
|
184
|
-
if (q.call(t, "key")) {
|
|
185
|
-
c = r(e);
|
|
186
|
-
var R = Object.keys(t).filter(function(ce) {
|
|
187
|
-
return ce !== "key";
|
|
188
|
-
});
|
|
189
|
-
u = 0 < R.length ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}", X[c + u] || (R = 0 < R.length ? "{" + R.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
190
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
191
|
-
let props = %s;
|
|
192
|
-
<%s {...props} />
|
|
193
|
-
React keys must be passed directly to JSX without using spread:
|
|
194
|
-
let props = %s;
|
|
195
|
-
<%s key={someKey} {...props} />`,
|
|
196
|
-
u,
|
|
197
|
-
c,
|
|
198
|
-
R,
|
|
199
|
-
c
|
|
200
|
-
), X[c + u] = !0);
|
|
201
|
-
}
|
|
202
|
-
if (c = null, l !== void 0 && (m(l), c = "" + l), d(t) && (m(t.key), c = "" + t.key), "key" in t) {
|
|
203
|
-
l = {};
|
|
204
|
-
for (var K in t)
|
|
205
|
-
K !== "key" && (l[K] = t[K]);
|
|
206
|
-
} else l = t;
|
|
207
|
-
return c && o(
|
|
208
|
-
l,
|
|
209
|
-
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
210
|
-
), T(
|
|
211
|
-
e,
|
|
212
|
-
c,
|
|
213
|
-
l,
|
|
214
|
-
s(),
|
|
215
|
-
h,
|
|
216
|
-
B
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
function N(e) {
|
|
220
|
-
C(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === I && (e._payload.status === "fulfilled" ? C(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
221
|
-
}
|
|
222
|
-
function C(e) {
|
|
223
|
-
return typeof e == "object" && e !== null && e.$$typeof === k;
|
|
224
|
-
}
|
|
225
|
-
var j = w, k = /* @__PURE__ */ Symbol.for("react.transitional.element"), S = /* @__PURE__ */ Symbol.for("react.portal"), y = /* @__PURE__ */ Symbol.for("react.fragment"), F = /* @__PURE__ */ Symbol.for("react.strict_mode"), Y = /* @__PURE__ */ Symbol.for("react.profiler"), x = /* @__PURE__ */ Symbol.for("react.consumer"), L = /* @__PURE__ */ Symbol.for("react.context"), a = /* @__PURE__ */ Symbol.for("react.forward_ref"), v = /* @__PURE__ */ Symbol.for("react.suspense"), n = /* @__PURE__ */ Symbol.for("react.suspense_list"), _ = /* @__PURE__ */ Symbol.for("react.memo"), I = /* @__PURE__ */ Symbol.for("react.lazy"), se = /* @__PURE__ */ Symbol.for("react.activity"), ie = /* @__PURE__ */ Symbol.for("react.client.reference"), $ = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, ue = Array.isArray, V = console.createTask ? console.createTask : function() {
|
|
226
|
-
return null;
|
|
227
|
-
};
|
|
228
|
-
j = {
|
|
229
|
-
react_stack_bottom_frame: function(e) {
|
|
230
|
-
return e();
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
var z, W = {}, J = j.react_stack_bottom_frame.bind(
|
|
234
|
-
j,
|
|
235
|
-
i
|
|
236
|
-
)(), G = V(g(i)), X = {};
|
|
237
|
-
A.Fragment = y, A.jsx = function(e, t, l) {
|
|
238
|
-
var u = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
239
|
-
return E(
|
|
240
|
-
e,
|
|
241
|
-
t,
|
|
242
|
-
l,
|
|
243
|
-
!1,
|
|
244
|
-
u ? Error("react-stack-top-frame") : J,
|
|
245
|
-
u ? V(g(e)) : G
|
|
246
|
-
);
|
|
247
|
-
}, A.jsxs = function(e, t, l) {
|
|
248
|
-
var u = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
249
|
-
return E(
|
|
250
|
-
e,
|
|
251
|
-
t,
|
|
252
|
-
l,
|
|
253
|
-
!0,
|
|
254
|
-
u ? Error("react-stack-top-frame") : J,
|
|
255
|
-
u ? V(g(e)) : G
|
|
256
|
-
);
|
|
257
|
-
};
|
|
258
|
-
})()), A;
|
|
259
|
-
}
|
|
260
|
-
var re;
|
|
261
|
-
function ve() {
|
|
262
|
-
return re || (re = 1, process.env.NODE_ENV === "production" ? D.exports = pe() : D.exports = ge()), D.exports;
|
|
263
|
-
}
|
|
264
|
-
var p = ve();
|
|
265
|
-
const ne = ({
|
|
266
|
-
schema: r,
|
|
267
|
-
dataSource: b,
|
|
268
|
-
className: m,
|
|
269
|
-
onRowClick: g,
|
|
270
|
-
onCardClick: s,
|
|
271
|
-
...i
|
|
272
|
-
}) => {
|
|
273
|
-
const [d, o] = P([]), [f, T] = P(null), [E, N] = P(!1), [C, j] = P(null), k = de(r.bind);
|
|
274
|
-
H(() => {
|
|
275
|
-
let a = !0;
|
|
276
|
-
return (async () => {
|
|
277
|
-
if (!(!b || !r.objectName))
|
|
278
|
-
try {
|
|
279
|
-
const n = await b.getObjectSchema(r.objectName);
|
|
280
|
-
a && T(n);
|
|
281
|
-
} catch (n) {
|
|
282
|
-
console.warn("Failed to fetch object def", n);
|
|
283
|
-
}
|
|
284
|
-
})(), () => {
|
|
285
|
-
a = !1;
|
|
286
|
-
};
|
|
287
|
-
}, [r.objectName, b]), H(() => {
|
|
288
|
-
let a = !0;
|
|
289
|
-
const v = async () => {
|
|
290
|
-
if (!(!b || !r.objectName)) {
|
|
291
|
-
a && N(!0);
|
|
292
|
-
try {
|
|
293
|
-
const n = await b.find(r.objectName, {
|
|
294
|
-
options: { $top: 100 },
|
|
295
|
-
$filter: r.filter
|
|
296
|
-
});
|
|
297
|
-
let _ = [];
|
|
298
|
-
Array.isArray(n) ? _ = n : n && typeof n == "object" && (Array.isArray(n.value) ? _ = n.value : Array.isArray(n.data) && (_ = n.data)), console.log(`[ObjectKanban] Extracted data (length: ${_.length})`), a && o(_);
|
|
299
|
-
} catch (n) {
|
|
300
|
-
console.error("[ObjectKanban] Fetch error:", n), a && j(n);
|
|
301
|
-
} finally {
|
|
302
|
-
a && N(!1);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
return r.objectName && !k && !r.data && !i.data && v(), () => {
|
|
307
|
-
a = !1;
|
|
308
|
-
};
|
|
309
|
-
}, [r.objectName, b, k, r.data, r.filter, i.data]);
|
|
310
|
-
const S = i.data || k || r.data || d, y = Z(() => {
|
|
311
|
-
if (!Array.isArray(S)) return [];
|
|
312
|
-
let a = r.cardTitle || r.titleField;
|
|
313
|
-
if (!a && f) {
|
|
314
|
-
if (f.titleFormat) {
|
|
315
|
-
const n = /\{(.+?)\}/.exec(f.titleFormat);
|
|
316
|
-
n && (a = n[1]);
|
|
317
|
-
}
|
|
318
|
-
!a && f.NAME_FIELD_KEY && (a = f.NAME_FIELD_KEY);
|
|
319
|
-
}
|
|
320
|
-
const v = a || "name";
|
|
321
|
-
return S.map((n) => ({
|
|
322
|
-
...n,
|
|
323
|
-
// Ensure id exists
|
|
324
|
-
id: n.id || n._id,
|
|
325
|
-
// Map title
|
|
326
|
-
title: n[v] || n.title || "Untitled"
|
|
327
|
-
}));
|
|
328
|
-
}, [S, r, f]), F = Z(() => {
|
|
329
|
-
if (r.columns && r.columns.length > 0)
|
|
330
|
-
if (typeof r.columns[0] == "string") {
|
|
331
|
-
if (!r.groupBy)
|
|
332
|
-
return r.columns.map((a) => ({
|
|
333
|
-
id: a,
|
|
334
|
-
title: a
|
|
335
|
-
}));
|
|
336
|
-
} else
|
|
337
|
-
return r.columns;
|
|
338
|
-
if (r.groupBy && f?.fields?.[r.groupBy]?.options)
|
|
339
|
-
return f.fields[r.groupBy].options.map((a) => ({
|
|
340
|
-
id: a.value,
|
|
341
|
-
title: a.label
|
|
342
|
-
}));
|
|
343
|
-
if (r.groupBy && y.length > 0) {
|
|
344
|
-
const a = new Set(y.map((v) => v[r.groupBy]));
|
|
345
|
-
return Array.from(a).map((v) => ({
|
|
346
|
-
id: String(v),
|
|
347
|
-
title: String(v)
|
|
348
|
-
}));
|
|
349
|
-
}
|
|
350
|
-
return [];
|
|
351
|
-
}, [r.columns, r.groupBy, y, f]), Y = {
|
|
352
|
-
...r,
|
|
353
|
-
data: y,
|
|
354
|
-
columns: F,
|
|
355
|
-
className: m || r.className
|
|
356
|
-
}, x = fe({
|
|
357
|
-
navigation: r.navigation,
|
|
358
|
-
objectName: r.objectName,
|
|
359
|
-
onRowClick: g ?? s
|
|
360
|
-
});
|
|
361
|
-
if (C)
|
|
362
|
-
return /* @__PURE__ */ p.jsxs("div", { className: "p-4 border border-destructive/50 rounded bg-destructive/10 text-destructive", children: [
|
|
363
|
-
"Error loading kanban data: ",
|
|
364
|
-
C.message
|
|
365
|
-
] });
|
|
366
|
-
const L = r.objectName ? `${r.objectName.charAt(0).toUpperCase() + r.objectName.slice(1).replace(/_/g, " ")} Detail` : "Card Details";
|
|
367
|
-
return /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
|
368
|
-
/* @__PURE__ */ p.jsx(U, { schema: {
|
|
369
|
-
...Y,
|
|
370
|
-
onCardClick: (a) => {
|
|
371
|
-
x.handleClick(a), s?.(a);
|
|
372
|
-
}
|
|
373
|
-
} }),
|
|
374
|
-
x.isOverlay && /* @__PURE__ */ p.jsx(me, { ...x, title: L, children: (a) => /* @__PURE__ */ p.jsx("div", { className: "space-y-3", children: Object.entries(a).map(([v, n]) => /* @__PURE__ */ p.jsxs("div", { className: "flex flex-col", children: [
|
|
375
|
-
/* @__PURE__ */ p.jsx("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: v.replace(/_/g, " ") }),
|
|
376
|
-
/* @__PURE__ */ p.jsx("span", { className: "text-sm", children: String(n ?? "—") })
|
|
377
|
-
] }, v)) }) })
|
|
378
|
-
] });
|
|
379
|
-
}, ye = w.lazy(() => import("./KanbanImpl-BfOKAnJS.js")), oe = w.lazy(() => import("./KanbanEnhanced-BPIKjTDv.js")), U = ({ schema: r }) => {
|
|
380
|
-
const b = w.useMemo(() => {
|
|
381
|
-
const { columns: m = [], data: g, groupBy: s } = r;
|
|
382
|
-
if (g && s && Array.isArray(g)) {
|
|
383
|
-
const i = {};
|
|
384
|
-
m.forEach((o) => {
|
|
385
|
-
o.id && (i[String(o.id).toLowerCase()] = o.id), o.title && (i[String(o.title).toLowerCase()] = o.id);
|
|
386
|
-
});
|
|
387
|
-
const d = g.reduce((o, f) => {
|
|
388
|
-
const T = String(f[s] ?? ""), E = i[T.toLowerCase()] ?? T;
|
|
389
|
-
return o[E] || (o[E] = []), o[E].push(f), o;
|
|
390
|
-
}, {});
|
|
391
|
-
return m.map((o) => ({
|
|
392
|
-
...o,
|
|
393
|
-
cards: [
|
|
394
|
-
...o.cards || [],
|
|
395
|
-
// Preserve static cards
|
|
396
|
-
...d[o.id] || []
|
|
397
|
-
// Add dynamic cards
|
|
398
|
-
]
|
|
399
|
-
}));
|
|
400
|
-
}
|
|
401
|
-
return m;
|
|
402
|
-
}, [r]);
|
|
403
|
-
return /* @__PURE__ */ p.jsx(te, { fallback: /* @__PURE__ */ p.jsx(ae, { className: "w-full h-[600px]" }), children: /* @__PURE__ */ p.jsx(
|
|
404
|
-
ye,
|
|
405
|
-
{
|
|
406
|
-
columns: b,
|
|
407
|
-
onCardMove: r.onCardMove,
|
|
408
|
-
onCardClick: r.onCardClick,
|
|
409
|
-
className: r.className
|
|
410
|
-
}
|
|
411
|
-
) });
|
|
412
|
-
};
|
|
413
|
-
M.register(
|
|
414
|
-
"kanban-ui",
|
|
415
|
-
U,
|
|
416
|
-
{
|
|
417
|
-
namespace: "plugin-kanban",
|
|
418
|
-
label: "Kanban Board",
|
|
419
|
-
icon: "LayoutDashboard",
|
|
420
|
-
category: "plugin",
|
|
421
|
-
inputs: [
|
|
422
|
-
{
|
|
423
|
-
name: "columns",
|
|
424
|
-
type: "array",
|
|
425
|
-
label: "Columns",
|
|
426
|
-
description: "Array of { id, title, cards, limit, className }",
|
|
427
|
-
required: !0
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
name: "onCardMove",
|
|
431
|
-
type: "code",
|
|
432
|
-
label: "On Card Move",
|
|
433
|
-
description: "Callback when a card is moved",
|
|
434
|
-
advanced: !0
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
name: "className",
|
|
438
|
-
type: "string",
|
|
439
|
-
label: "CSS Class"
|
|
440
|
-
}
|
|
441
|
-
],
|
|
442
|
-
defaultProps: {
|
|
443
|
-
columns: [
|
|
444
|
-
{
|
|
445
|
-
id: "todo",
|
|
446
|
-
title: "To Do",
|
|
447
|
-
cards: [
|
|
448
|
-
{
|
|
449
|
-
id: "card-1",
|
|
450
|
-
title: "Task 1",
|
|
451
|
-
description: "This is the first task",
|
|
452
|
-
badges: [
|
|
453
|
-
{ label: "High Priority", variant: "destructive" },
|
|
454
|
-
{ label: "Feature", variant: "default" }
|
|
455
|
-
]
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
id: "card-2",
|
|
459
|
-
title: "Task 2",
|
|
460
|
-
description: "This is the second task",
|
|
461
|
-
badges: [
|
|
462
|
-
{ label: "Bug", variant: "destructive" }
|
|
463
|
-
]
|
|
464
|
-
}
|
|
465
|
-
]
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
id: "in-progress",
|
|
469
|
-
title: "In Progress",
|
|
470
|
-
limit: 3,
|
|
471
|
-
cards: [
|
|
472
|
-
{
|
|
473
|
-
id: "card-3",
|
|
474
|
-
title: "Task 3",
|
|
475
|
-
description: "Currently working on this",
|
|
476
|
-
badges: [
|
|
477
|
-
{ label: "In Progress", variant: "default" }
|
|
478
|
-
]
|
|
479
|
-
}
|
|
480
|
-
]
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
id: "done",
|
|
484
|
-
title: "Done",
|
|
485
|
-
cards: [
|
|
486
|
-
{
|
|
487
|
-
id: "card-4",
|
|
488
|
-
title: "Task 4",
|
|
489
|
-
description: "This task is completed",
|
|
490
|
-
badges: [
|
|
491
|
-
{ label: "Completed", variant: "outline" }
|
|
492
|
-
]
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
id: "card-5",
|
|
496
|
-
title: "Task 5",
|
|
497
|
-
description: "Another completed task",
|
|
498
|
-
badges: [
|
|
499
|
-
{ label: "Completed", variant: "outline" }
|
|
500
|
-
]
|
|
501
|
-
}
|
|
502
|
-
]
|
|
503
|
-
}
|
|
504
|
-
],
|
|
505
|
-
className: "w-full"
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
);
|
|
509
|
-
const ke = {
|
|
510
|
-
kanban: U,
|
|
511
|
-
"kanban-enhanced": oe,
|
|
512
|
-
"object-kanban": ne
|
|
513
|
-
};
|
|
514
|
-
M.register(
|
|
515
|
-
"kanban-enhanced",
|
|
516
|
-
({ schema: r }) => {
|
|
517
|
-
const b = w.useMemo(() => {
|
|
518
|
-
const { columns: m = [], data: g, groupBy: s } = r;
|
|
519
|
-
if (g && s && Array.isArray(g)) {
|
|
520
|
-
const i = g.reduce((d, o) => {
|
|
521
|
-
const f = o[s];
|
|
522
|
-
return d[f] || (d[f] = []), d[f].push(o), d;
|
|
523
|
-
}, {});
|
|
524
|
-
return m.map((d) => ({
|
|
525
|
-
...d,
|
|
526
|
-
cards: [...d.cards || [], ...i[d.id] || []]
|
|
527
|
-
}));
|
|
528
|
-
}
|
|
529
|
-
return m;
|
|
530
|
-
}, [r]);
|
|
531
|
-
return /* @__PURE__ */ p.jsx(te, { fallback: /* @__PURE__ */ p.jsx(ae, { className: "w-full h-[600px]" }), children: /* @__PURE__ */ p.jsx(
|
|
532
|
-
oe,
|
|
533
|
-
{
|
|
534
|
-
columns: b,
|
|
535
|
-
onCardMove: r.onCardMove,
|
|
536
|
-
onColumnToggle: r.onColumnToggle,
|
|
537
|
-
enableVirtualScrolling: r.enableVirtualScrolling,
|
|
538
|
-
virtualScrollThreshold: r.virtualScrollThreshold,
|
|
539
|
-
className: r.className
|
|
540
|
-
}
|
|
541
|
-
) });
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
namespace: "plugin-kanban",
|
|
545
|
-
label: "Kanban Board (Enhanced)",
|
|
546
|
-
icon: "LayoutGrid",
|
|
547
|
-
category: "plugin",
|
|
548
|
-
inputs: [
|
|
549
|
-
{ name: "columns", type: "array", label: "Columns", required: !0 },
|
|
550
|
-
{ name: "enableVirtualScrolling", type: "boolean", label: "Virtual Scrolling", defaultValue: !1 },
|
|
551
|
-
{ name: "virtualScrollThreshold", type: "number", label: "Virtual Scroll Threshold", defaultValue: 50 },
|
|
552
|
-
{ name: "onCardMove", type: "code", label: "On Card Move", advanced: !0 },
|
|
553
|
-
{ name: "onColumnToggle", type: "code", label: "On Column Toggle", advanced: !0 },
|
|
554
|
-
{ name: "className", type: "string", label: "CSS Class" }
|
|
555
|
-
],
|
|
556
|
-
defaultProps: {
|
|
557
|
-
columns: [],
|
|
558
|
-
enableVirtualScrolling: !1,
|
|
559
|
-
virtualScrollThreshold: 50,
|
|
560
|
-
className: "w-full"
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
);
|
|
564
|
-
const le = ({ schema: r, ...b }) => {
|
|
565
|
-
const { dataSource: m } = be() || {};
|
|
566
|
-
return /* @__PURE__ */ p.jsx(ne, { schema: r, dataSource: m, ...b });
|
|
567
|
-
};
|
|
568
|
-
M.register(
|
|
569
|
-
"object-kanban",
|
|
570
|
-
le,
|
|
571
|
-
{
|
|
572
|
-
namespace: "plugin-kanban",
|
|
573
|
-
label: "Object Kanban",
|
|
574
|
-
category: "view",
|
|
575
|
-
inputs: [
|
|
576
|
-
{ name: "objectName", type: "string", label: "Object Name", required: !0 },
|
|
577
|
-
{ name: "columns", type: "array", label: "Columns" }
|
|
578
|
-
]
|
|
579
|
-
}
|
|
580
|
-
);
|
|
581
|
-
M.register(
|
|
582
|
-
"kanban",
|
|
583
|
-
le,
|
|
584
|
-
{
|
|
585
|
-
namespace: "view",
|
|
586
|
-
label: "Kanban Board",
|
|
587
|
-
category: "view",
|
|
588
|
-
inputs: [
|
|
589
|
-
{ name: "objectName", type: "string", label: "Object Name", required: !0 },
|
|
590
|
-
{ name: "columns", type: "array", label: "Columns" }
|
|
591
|
-
]
|
|
592
|
-
}
|
|
593
|
-
);
|
|
594
|
-
export {
|
|
595
|
-
U as K,
|
|
596
|
-
ne as O,
|
|
597
|
-
le as a,
|
|
598
|
-
p as j,
|
|
599
|
-
ke as k
|
|
600
|
-
};
|