@object-ui/plugin-kanban 2.0.0 → 3.0.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 +8 -8
- package/CHANGELOG.md +20 -0
- package/dist/{KanbanEnhanced-BMreTWOT.js → KanbanEnhanced-BPIKjTDv.js} +7 -7
- package/dist/KanbanImpl-BfOKAnJS.js +194 -0
- package/dist/{index-a4_RI-v7.js → index-CWGTi2xn.js} +241 -220
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +4 -4
- package/dist/{sortable.esm-ZHwgFQIO.js → sortable.esm-CNNHgHk5.js} +1 -0
- package/dist/src/KanbanImpl.d.ts +2 -1
- package/dist/src/KanbanImpl.d.ts.map +1 -1
- package/dist/src/ObjectKanban.EdgeCases.stories.d.ts +26 -0
- package/dist/src/ObjectKanban.EdgeCases.stories.d.ts.map +1 -0
- package/dist/src/ObjectKanban.d.ts +2 -0
- package/dist/src/ObjectKanban.d.ts.map +1 -1
- package/dist/src/ObjectKanban.stories.d.ts +24 -0
- package/dist/src/ObjectKanban.stories.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/KanbanImpl.tsx +82 -20
- package/src/ObjectKanban.EdgeCases.stories.tsx +168 -0
- package/src/ObjectKanban.stories.tsx +152 -0
- package/src/ObjectKanban.tsx +43 -2
- package/src/__tests__/KanbanEnhanced.test.tsx +1 -0
- package/src/__tests__/accessibility.test.tsx +296 -0
- package/src/__tests__/dnd-undo-integration.test.tsx +525 -0
- package/src/__tests__/performance-benchmark.test.tsx +306 -0
- package/src/__tests__/view-states.test.tsx +403 -0
- package/src/index.tsx +2 -0
- package/dist/KanbanImpl--kTNN_B8.js +0 -144
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ComponentRegistry as
|
|
3
|
-
import { useDataScope as de,
|
|
4
|
-
import { Skeleton as
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"),
|
|
11
|
-
function m(
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
for (var
|
|
16
|
-
|
|
17
|
-
} else
|
|
18
|
-
return
|
|
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
19
|
$$typeof: r,
|
|
20
|
-
type:
|
|
21
|
-
key:
|
|
22
|
-
ref:
|
|
23
|
-
props:
|
|
20
|
+
type: g,
|
|
21
|
+
key: d,
|
|
22
|
+
ref: s !== void 0 ? s : null,
|
|
23
|
+
props: i
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
return
|
|
26
|
+
return O.Fragment = b, O.jsx = m, O.jsxs = m, O;
|
|
27
27
|
}
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
function
|
|
31
|
-
return
|
|
28
|
+
var A = {};
|
|
29
|
+
var ee;
|
|
30
|
+
function ge() {
|
|
31
|
+
return ee || (ee = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
32
32
|
function r(e) {
|
|
33
33
|
if (e == null) return null;
|
|
34
34
|
if (typeof e == "function")
|
|
35
35
|
return e.$$typeof === ie ? null : e.displayName || e.name || null;
|
|
36
36
|
if (typeof e == "string") return e;
|
|
37
37
|
switch (e) {
|
|
38
|
-
case
|
|
38
|
+
case y:
|
|
39
39
|
return "Fragment";
|
|
40
|
-
case
|
|
40
|
+
case Y:
|
|
41
41
|
return "Profiler";
|
|
42
|
-
case
|
|
42
|
+
case F:
|
|
43
43
|
return "StrictMode";
|
|
44
|
-
case
|
|
44
|
+
case v:
|
|
45
45
|
return "Suspense";
|
|
46
|
-
case
|
|
46
|
+
case n:
|
|
47
47
|
return "SuspenseList";
|
|
48
48
|
case se:
|
|
49
49
|
return "Activity";
|
|
@@ -52,18 +52,18 @@ function me() {
|
|
|
52
52
|
switch (typeof e.tag == "number" && console.error(
|
|
53
53
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
54
54
|
), e.$$typeof) {
|
|
55
|
-
case
|
|
55
|
+
case S:
|
|
56
56
|
return "Portal";
|
|
57
|
-
case
|
|
57
|
+
case L:
|
|
58
58
|
return e.displayName || "Context";
|
|
59
|
-
case
|
|
59
|
+
case x:
|
|
60
60
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
61
|
-
case
|
|
61
|
+
case a:
|
|
62
62
|
var t = e.render;
|
|
63
63
|
return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
64
|
-
case
|
|
64
|
+
case _:
|
|
65
65
|
return t = e.displayName || null, t !== null ? t : r(e.type) || "Memo";
|
|
66
|
-
case
|
|
66
|
+
case I:
|
|
67
67
|
t = e._payload, e = e._init;
|
|
68
68
|
try {
|
|
69
69
|
return r(e(t));
|
|
@@ -72,29 +72,29 @@ function me() {
|
|
|
72
72
|
}
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function b(e) {
|
|
76
76
|
return "" + e;
|
|
77
77
|
}
|
|
78
78
|
function m(e) {
|
|
79
79
|
try {
|
|
80
|
-
|
|
80
|
+
b(e);
|
|
81
81
|
var t = !1;
|
|
82
82
|
} catch {
|
|
83
83
|
t = !0;
|
|
84
84
|
}
|
|
85
85
|
if (t) {
|
|
86
86
|
t = console;
|
|
87
|
-
var
|
|
88
|
-
return
|
|
87
|
+
var l = t.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
88
|
+
return l.call(
|
|
89
89
|
t,
|
|
90
90
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
91
91
|
u
|
|
92
|
-
),
|
|
92
|
+
), b(e);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
if (e ===
|
|
97
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
95
|
+
function g(e) {
|
|
96
|
+
if (e === y) return "<>";
|
|
97
|
+
if (typeof e == "object" && e !== null && e.$$typeof === I)
|
|
98
98
|
return "<...>";
|
|
99
99
|
try {
|
|
100
100
|
var t = r(e);
|
|
@@ -103,49 +103,49 @@ function me() {
|
|
|
103
103
|
return "<...>";
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
var e =
|
|
106
|
+
function s() {
|
|
107
|
+
var e = $.A;
|
|
108
108
|
return e === null ? null : e.getOwner();
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function i() {
|
|
111
111
|
return Error("react-stack-top-frame");
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
if (
|
|
113
|
+
function d(e) {
|
|
114
|
+
if (q.call(e, "key")) {
|
|
115
115
|
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
116
116
|
if (t && t.isReactWarning) return !1;
|
|
117
117
|
}
|
|
118
118
|
return e.key !== void 0;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
function
|
|
122
|
-
|
|
120
|
+
function o(e, t) {
|
|
121
|
+
function l() {
|
|
122
|
+
z || (z = !0, console.error(
|
|
123
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
124
|
t
|
|
125
125
|
));
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
get:
|
|
127
|
+
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
128
|
+
get: l,
|
|
129
129
|
configurable: !0
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function f() {
|
|
133
133
|
var e = r(this.type);
|
|
134
|
-
return
|
|
134
|
+
return W[e] || (W[e] = !0, console.error(
|
|
135
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
136
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
var c =
|
|
138
|
+
function T(e, t, l, u, h, B) {
|
|
139
|
+
var c = l.ref;
|
|
140
140
|
return e = {
|
|
141
|
-
$$typeof:
|
|
141
|
+
$$typeof: k,
|
|
142
142
|
type: e,
|
|
143
143
|
key: t,
|
|
144
|
-
props:
|
|
144
|
+
props: l,
|
|
145
145
|
_owner: u
|
|
146
146
|
}, (c !== void 0 ? c : null) !== null ? Object.defineProperty(e, "ref", {
|
|
147
147
|
enumerable: !1,
|
|
148
|
-
get:
|
|
148
|
+
get: f
|
|
149
149
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
150
150
|
configurable: !1,
|
|
151
151
|
enumerable: !1,
|
|
@@ -160,33 +160,33 @@ function me() {
|
|
|
160
160
|
configurable: !1,
|
|
161
161
|
enumerable: !1,
|
|
162
162
|
writable: !0,
|
|
163
|
-
value:
|
|
163
|
+
value: h
|
|
164
164
|
}), Object.defineProperty(e, "_debugTask", {
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
writable: !0,
|
|
168
|
-
value:
|
|
168
|
+
value: B
|
|
169
169
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function E(e, t, l, u, h, B) {
|
|
172
172
|
var c = t.children;
|
|
173
173
|
if (c !== void 0)
|
|
174
174
|
if (u)
|
|
175
175
|
if (ue(c)) {
|
|
176
176
|
for (u = 0; u < c.length; u++)
|
|
177
|
-
|
|
177
|
+
N(c[u]);
|
|
178
178
|
Object.freeze && Object.freeze(c);
|
|
179
179
|
} else
|
|
180
180
|
console.error(
|
|
181
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
182
|
);
|
|
183
|
-
else
|
|
184
|
-
if (
|
|
183
|
+
else N(c);
|
|
184
|
+
if (q.call(t, "key")) {
|
|
185
185
|
c = r(e);
|
|
186
|
-
var
|
|
186
|
+
var R = Object.keys(t).filter(function(ce) {
|
|
187
187
|
return ce !== "key";
|
|
188
188
|
});
|
|
189
|
-
u = 0 <
|
|
189
|
+
u = 0 < R.length ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}", X[c + u] || (R = 0 < R.length ? "{" + R.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
190
190
|
`A props object containing a "key" prop is being spread into JSX:
|
|
191
191
|
let props = %s;
|
|
192
192
|
<%s {...props} />
|
|
@@ -195,203 +195,224 @@ React keys must be passed directly to JSX without using spread:
|
|
|
195
195
|
<%s key={someKey} {...props} />`,
|
|
196
196
|
u,
|
|
197
197
|
c,
|
|
198
|
-
|
|
198
|
+
R,
|
|
199
199
|
c
|
|
200
|
-
),
|
|
200
|
+
), X[c + u] = !0);
|
|
201
201
|
}
|
|
202
|
-
if (c = null,
|
|
203
|
-
|
|
204
|
-
for (var
|
|
205
|
-
|
|
206
|
-
} else
|
|
207
|
-
return c &&
|
|
208
|
-
|
|
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
209
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
210
|
-
),
|
|
210
|
+
), T(
|
|
211
211
|
e,
|
|
212
212
|
c,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
l,
|
|
214
|
+
s(),
|
|
215
|
+
h,
|
|
216
|
+
B
|
|
217
217
|
);
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
|
|
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
221
|
}
|
|
222
|
-
function
|
|
223
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
222
|
+
function C(e) {
|
|
223
|
+
return typeof e == "object" && e !== null && e.$$typeof === k;
|
|
224
224
|
}
|
|
225
|
-
var
|
|
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
226
|
return null;
|
|
227
227
|
};
|
|
228
|
-
|
|
228
|
+
j = {
|
|
229
229
|
react_stack_bottom_frame: function(e) {
|
|
230
230
|
return e();
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
|
-
var
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
)(),
|
|
237
|
-
|
|
238
|
-
var u = 1e4 >
|
|
239
|
-
return
|
|
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
240
|
e,
|
|
241
241
|
t,
|
|
242
|
-
|
|
242
|
+
l,
|
|
243
243
|
!1,
|
|
244
|
-
u ? Error("react-stack-top-frame") :
|
|
245
|
-
u ?
|
|
244
|
+
u ? Error("react-stack-top-frame") : J,
|
|
245
|
+
u ? V(g(e)) : G
|
|
246
246
|
);
|
|
247
|
-
},
|
|
248
|
-
var u = 1e4 >
|
|
249
|
-
return
|
|
247
|
+
}, A.jsxs = function(e, t, l) {
|
|
248
|
+
var u = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
249
|
+
return E(
|
|
250
250
|
e,
|
|
251
251
|
t,
|
|
252
|
-
|
|
252
|
+
l,
|
|
253
253
|
!0,
|
|
254
|
-
u ? Error("react-stack-top-frame") :
|
|
255
|
-
u ?
|
|
254
|
+
u ? Error("react-stack-top-frame") : J,
|
|
255
|
+
u ? V(g(e)) : G
|
|
256
256
|
);
|
|
257
257
|
};
|
|
258
|
-
})()),
|
|
258
|
+
})()), A;
|
|
259
259
|
}
|
|
260
|
-
var
|
|
261
|
-
function
|
|
262
|
-
return
|
|
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
263
|
}
|
|
264
|
-
var
|
|
265
|
-
const
|
|
264
|
+
var p = ve();
|
|
265
|
+
const ne = ({
|
|
266
266
|
schema: r,
|
|
267
|
-
dataSource:
|
|
267
|
+
dataSource: b,
|
|
268
268
|
className: m,
|
|
269
|
-
|
|
269
|
+
onRowClick: g,
|
|
270
|
+
onCardClick: s,
|
|
271
|
+
...i
|
|
270
272
|
}) => {
|
|
271
|
-
const [
|
|
272
|
-
|
|
273
|
-
let
|
|
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;
|
|
274
276
|
return (async () => {
|
|
275
|
-
if (!(!
|
|
277
|
+
if (!(!b || !r.objectName))
|
|
276
278
|
try {
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
} catch (
|
|
280
|
-
console.warn("Failed to fetch object def",
|
|
279
|
+
const n = await b.getObjectSchema(r.objectName);
|
|
280
|
+
a && T(n);
|
|
281
|
+
} catch (n) {
|
|
282
|
+
console.warn("Failed to fetch object def", n);
|
|
281
283
|
}
|
|
282
284
|
})(), () => {
|
|
283
|
-
|
|
285
|
+
a = !1;
|
|
284
286
|
};
|
|
285
|
-
}, [r.objectName,
|
|
286
|
-
let
|
|
287
|
-
const
|
|
288
|
-
if (!(!
|
|
289
|
-
|
|
287
|
+
}, [r.objectName, b]), H(() => {
|
|
288
|
+
let a = !0;
|
|
289
|
+
const v = async () => {
|
|
290
|
+
if (!(!b || !r.objectName)) {
|
|
291
|
+
a && N(!0);
|
|
290
292
|
try {
|
|
291
|
-
const
|
|
293
|
+
const n = await b.find(r.objectName, {
|
|
292
294
|
options: { $top: 100 },
|
|
293
295
|
$filter: r.filter
|
|
294
296
|
});
|
|
295
|
-
let
|
|
296
|
-
Array.isArray(
|
|
297
|
-
} catch (
|
|
298
|
-
console.error("[ObjectKanban] Fetch error:",
|
|
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);
|
|
299
301
|
} finally {
|
|
300
|
-
|
|
302
|
+
a && N(!1);
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
305
|
};
|
|
304
|
-
return r.objectName && !
|
|
305
|
-
|
|
306
|
+
return r.objectName && !k && !r.data && !i.data && v(), () => {
|
|
307
|
+
a = !1;
|
|
306
308
|
};
|
|
307
|
-
}, [r.objectName,
|
|
308
|
-
const
|
|
309
|
-
if (!Array.isArray(
|
|
310
|
-
let
|
|
311
|
-
if (!
|
|
312
|
-
if (
|
|
313
|
-
const
|
|
314
|
-
|
|
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]);
|
|
315
317
|
}
|
|
316
|
-
!
|
|
318
|
+
!a && f.NAME_FIELD_KEY && (a = f.NAME_FIELD_KEY);
|
|
317
319
|
}
|
|
318
|
-
const
|
|
319
|
-
return
|
|
320
|
-
...
|
|
320
|
+
const v = a || "name";
|
|
321
|
+
return S.map((n) => ({
|
|
322
|
+
...n,
|
|
321
323
|
// Ensure id exists
|
|
322
|
-
id:
|
|
324
|
+
id: n.id || n._id,
|
|
323
325
|
// Map title
|
|
324
|
-
title:
|
|
326
|
+
title: n[v] || n.title || "Untitled"
|
|
325
327
|
}));
|
|
326
|
-
}, [
|
|
328
|
+
}, [S, r, f]), F = Z(() => {
|
|
327
329
|
if (r.columns && r.columns.length > 0)
|
|
328
330
|
if (typeof r.columns[0] == "string") {
|
|
329
331
|
if (!r.groupBy)
|
|
330
|
-
return r.columns.map((
|
|
331
|
-
id:
|
|
332
|
-
title:
|
|
332
|
+
return r.columns.map((a) => ({
|
|
333
|
+
id: a,
|
|
334
|
+
title: a
|
|
333
335
|
}));
|
|
334
336
|
} else
|
|
335
337
|
return r.columns;
|
|
336
|
-
if (r.groupBy &&
|
|
337
|
-
return
|
|
338
|
-
id:
|
|
339
|
-
title:
|
|
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
|
|
340
342
|
}));
|
|
341
|
-
if (r.groupBy &&
|
|
342
|
-
const
|
|
343
|
-
return Array.from(
|
|
344
|
-
id: String(
|
|
345
|
-
title: String(
|
|
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)
|
|
346
348
|
}));
|
|
347
349
|
}
|
|
348
350
|
return [];
|
|
349
|
-
}, [r.columns, r.groupBy,
|
|
351
|
+
}, [r.columns, r.groupBy, y, f]), Y = {
|
|
350
352
|
...r,
|
|
351
|
-
data:
|
|
352
|
-
columns:
|
|
353
|
+
data: y,
|
|
354
|
+
columns: F,
|
|
353
355
|
className: m || r.className
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
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);
|
|
366
386
|
});
|
|
367
|
-
const
|
|
368
|
-
const
|
|
369
|
-
return
|
|
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;
|
|
370
390
|
}, {});
|
|
371
|
-
return m.map((
|
|
372
|
-
...
|
|
391
|
+
return m.map((o) => ({
|
|
392
|
+
...o,
|
|
373
393
|
cards: [
|
|
374
|
-
...
|
|
394
|
+
...o.cards || [],
|
|
375
395
|
// Preserve static cards
|
|
376
|
-
...
|
|
396
|
+
...d[o.id] || []
|
|
377
397
|
// Add dynamic cards
|
|
378
398
|
]
|
|
379
399
|
}));
|
|
380
400
|
}
|
|
381
401
|
return m;
|
|
382
402
|
}, [r]);
|
|
383
|
-
return /* @__PURE__ */
|
|
384
|
-
|
|
403
|
+
return /* @__PURE__ */ p.jsx(te, { fallback: /* @__PURE__ */ p.jsx(ae, { className: "w-full h-[600px]" }), children: /* @__PURE__ */ p.jsx(
|
|
404
|
+
ye,
|
|
385
405
|
{
|
|
386
|
-
columns:
|
|
406
|
+
columns: b,
|
|
387
407
|
onCardMove: r.onCardMove,
|
|
408
|
+
onCardClick: r.onCardClick,
|
|
388
409
|
className: r.className
|
|
389
410
|
}
|
|
390
411
|
) });
|
|
391
412
|
};
|
|
392
|
-
|
|
413
|
+
M.register(
|
|
393
414
|
"kanban-ui",
|
|
394
|
-
|
|
415
|
+
U,
|
|
395
416
|
{
|
|
396
417
|
namespace: "plugin-kanban",
|
|
397
418
|
label: "Kanban Board",
|
|
@@ -485,32 +506,32 @@ P.register(
|
|
|
485
506
|
}
|
|
486
507
|
}
|
|
487
508
|
);
|
|
488
|
-
const
|
|
489
|
-
kanban:
|
|
490
|
-
"kanban-enhanced":
|
|
491
|
-
"object-kanban":
|
|
509
|
+
const ke = {
|
|
510
|
+
kanban: U,
|
|
511
|
+
"kanban-enhanced": oe,
|
|
512
|
+
"object-kanban": ne
|
|
492
513
|
};
|
|
493
|
-
|
|
514
|
+
M.register(
|
|
494
515
|
"kanban-enhanced",
|
|
495
516
|
({ schema: r }) => {
|
|
496
|
-
const
|
|
497
|
-
const { columns: m = [], data:
|
|
498
|
-
if (
|
|
499
|
-
const
|
|
500
|
-
const
|
|
501
|
-
return
|
|
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;
|
|
502
523
|
}, {});
|
|
503
|
-
return m.map((
|
|
504
|
-
...
|
|
505
|
-
cards: [...
|
|
524
|
+
return m.map((d) => ({
|
|
525
|
+
...d,
|
|
526
|
+
cards: [...d.cards || [], ...i[d.id] || []]
|
|
506
527
|
}));
|
|
507
528
|
}
|
|
508
529
|
return m;
|
|
509
530
|
}, [r]);
|
|
510
|
-
return /* @__PURE__ */
|
|
511
|
-
|
|
531
|
+
return /* @__PURE__ */ p.jsx(te, { fallback: /* @__PURE__ */ p.jsx(ae, { className: "w-full h-[600px]" }), children: /* @__PURE__ */ p.jsx(
|
|
532
|
+
oe,
|
|
512
533
|
{
|
|
513
|
-
columns:
|
|
534
|
+
columns: b,
|
|
514
535
|
onCardMove: r.onCardMove,
|
|
515
536
|
onColumnToggle: r.onColumnToggle,
|
|
516
537
|
enableVirtualScrolling: r.enableVirtualScrolling,
|
|
@@ -540,13 +561,13 @@ P.register(
|
|
|
540
561
|
}
|
|
541
562
|
}
|
|
542
563
|
);
|
|
543
|
-
const
|
|
544
|
-
const { dataSource: m } =
|
|
545
|
-
return /* @__PURE__ */
|
|
564
|
+
const le = ({ schema: r, ...b }) => {
|
|
565
|
+
const { dataSource: m } = be() || {};
|
|
566
|
+
return /* @__PURE__ */ p.jsx(ne, { schema: r, dataSource: m, ...b });
|
|
546
567
|
};
|
|
547
|
-
|
|
568
|
+
M.register(
|
|
548
569
|
"object-kanban",
|
|
549
|
-
|
|
570
|
+
le,
|
|
550
571
|
{
|
|
551
572
|
namespace: "plugin-kanban",
|
|
552
573
|
label: "Object Kanban",
|
|
@@ -557,9 +578,9 @@ P.register(
|
|
|
557
578
|
]
|
|
558
579
|
}
|
|
559
580
|
);
|
|
560
|
-
|
|
581
|
+
M.register(
|
|
561
582
|
"kanban",
|
|
562
|
-
|
|
583
|
+
le,
|
|
563
584
|
{
|
|
564
585
|
namespace: "view",
|
|
565
586
|
label: "Kanban Board",
|
|
@@ -571,9 +592,9 @@ P.register(
|
|
|
571
592
|
}
|
|
572
593
|
);
|
|
573
594
|
export {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
595
|
+
U as K,
|
|
596
|
+
ne as O,
|
|
597
|
+
le as a,
|
|
598
|
+
p as j,
|
|
599
|
+
ke as k
|
|
579
600
|
};
|