@declarion/react 0.36.5 → 0.37.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-lib/{DraggableChildrenTable-BfErdVdt.js → DraggableChildrenTable-_ZZcNOIn.js} +2 -2
- package/dist-lib/{Grid-D0ckegd1.js → Grid-k1alUfJH.js} +2 -2
- package/dist-lib/{LayoutRenderer-BGeN0rwC.js → LayoutRenderer-C3pdqkHp.js} +6 -6
- package/dist-lib/{MarkdownRenderer-14LG1clY.js → MarkdownRenderer-jhYOLGsz.js} +1 -1
- package/dist-lib/{RefreshControl-Bpd9kw0G.js → RefreshControl-BscVr98E.js} +1 -1
- package/dist-lib/{SmartDetailPage.impl-BaXAi7OH.js → SmartDetailPage.impl-Ycy0dZkv.js} +5 -5
- package/dist-lib/{SmartRecordListPage.impl-CgiZWbF3.js → SmartRecordListPage.impl-W41z1hiJ.js} +4 -4
- package/dist-lib/components/pages/auth/AuthShell.d.ts +17 -0
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +1 -1
- package/dist-lib/index.d.ts +2 -0
- package/dist-lib/index.js +430 -423
- package/dist-lib/{registry-KMbQkTF6.js → registry-D6uzF1n6.js} +72 -63
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/schema.d.ts +15 -5
- package/dist-lib/{useCurrentScreen-Bgp6_vne.js → useCurrentScreen-CD6xJlyU.js} +44 -14
- package/dist-lib/{useProperties-DMT162ot.js → useProperties-BK4ilgGN.js} +3 -3
- package/dist-lib/{value-CUVtVjKI.js → value-DFxS49M5.js} +1 -1
- package/dist-lib/vite/fingerprint-plugin.d.ts +1 -1
- package/package.json +12 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-BWO6QtNF.js";
|
|
2
|
-
import { $ as n, C as r, E as i, F as a, Gn as o, Hn as s, K as c, Kn as l, Nn as u, O as d, On as f, Pn as p, S as m, T as h, U as g, Wn as _, a as v, an as y, at as b, bn as x, cn as S, ct as C, dt as w, en as T, f as E, fn as D, g as O, gn as k, gt as A, h as j, ht as M, i as N, it as P, j as F, jn as I, jt as L, k as R, ln as z, nt as B, o as ee, on as V, ot as te, p as ne, pn as H, q as U, rt as re, sn as ie, un as W, ut as ae, vn as oe, w as se, x as ce, xn as le, y as ue, zn as de } from "./useCurrentScreen-
|
|
3
|
-
import { a as fe, c as pe, d as me, f as he, i as ge, l as _e, n as ve, o as ye, p as be, r as xe, s as Se, t as Ce, u as we } from "./value-
|
|
2
|
+
import { $ as n, C as r, E as i, F as a, Gn as o, Hn as s, K as c, Kn as l, Nn as u, O as d, On as f, Pn as p, S as m, T as h, U as g, Wn as _, a as v, an as y, at as b, bn as x, cn as S, ct as C, dt as w, en as T, f as E, fn as D, g as O, gn as k, gt as A, h as j, ht as M, i as N, it as P, j as F, jn as I, jt as L, k as R, ln as z, nt as B, o as ee, on as V, ot as te, p as ne, pn as H, q as U, rt as re, sn as ie, un as W, ut as ae, vn as oe, w as se, x as ce, xn as le, y as ue, zn as de } from "./useCurrentScreen-CD6xJlyU.js";
|
|
3
|
+
import { a as fe, c as pe, d as me, f as he, i as ge, l as _e, n as ve, o as ye, p as be, r as xe, s as Se, t as Ce, u as we } from "./value-DFxS49M5.js";
|
|
4
4
|
import { n as Te, r as Ee, t as De } from "./dataTableStyles-vwD1mVOP.js";
|
|
5
5
|
import { Component as Oe, Suspense as ke, lazy as Ae, useCallback as G, useEffect as K, useId as je, useLayoutEffect as Me, useMemo as q, useRef as J, useState as Y } from "react";
|
|
6
6
|
import { parsePath as Ne, useNavigate as Pe } from "react-router-dom";
|
|
@@ -1142,7 +1142,7 @@ function nn(e) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
//#endregion
|
|
1144
1144
|
//#region src/components/file-widgets/GridLazy.tsx
|
|
1145
|
-
var rn = Ae(() => import("./Grid-
|
|
1145
|
+
var rn = Ae(() => import("./Grid-k1alUfJH.js").then((e) => ({ default: e.Grid })));
|
|
1146
1146
|
function an() {
|
|
1147
1147
|
return /* @__PURE__ */ Z("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
|
|
1148
1148
|
}
|
|
@@ -2199,7 +2199,7 @@ function $n(e) {
|
|
|
2199
2199
|
return t ?? e;
|
|
2200
2200
|
}
|
|
2201
2201
|
function er(e) {
|
|
2202
|
-
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e !== "" : typeof e
|
|
2202
|
+
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e !== "" : typeof e != "number" || e !== 0;
|
|
2203
2203
|
}
|
|
2204
2204
|
function tr(e, t, n) {
|
|
2205
2205
|
switch (n) {
|
|
@@ -2406,7 +2406,7 @@ function Cr(e, t) {
|
|
|
2406
2406
|
//#endregion
|
|
2407
2407
|
//#region src/components/shared/ActionButton.tsx
|
|
2408
2408
|
function wr({ actionCode: n, action: r, entityCode: i, objectIds: a = [], row: s, variant: c = "outline", size: u = "default", onSuccess: d, onBatchStart: f, onBatchError: p, onBatchPartial: m }) {
|
|
2409
|
-
let [h, _] = Y(!1), [y, b] = Y(!1), [x, S] = Y(!1), [C, w] = Y(null), T = qn(i), { data: D } = A(), O = It(), k = sr(r), j = ar(r), M = !!r.confirmation && Object.keys(r.confirmation).length > 0, N = s
|
|
2409
|
+
let [h, _] = Y(!1), [y, b] = Y(!1), [x, S] = Y(!1), [C, w] = Y(null), T = qn(i), { data: D } = A(), O = It(), k = sr(r), j = ar(r), M = !!r.confirmation && Object.keys(r.confirmation).length > 0, N = !s || Xn(r.conditions, s), P = G(async () => {
|
|
2410
2410
|
if (!(!r.association || a.length === 0)) {
|
|
2411
2411
|
S(!0);
|
|
2412
2412
|
try {
|
|
@@ -2609,7 +2609,7 @@ function Tr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
|
|
|
2609
2609
|
a,
|
|
2610
2610
|
a && c && t.length > 0 && /* @__PURE__ */ Z(p, { divider: !0 }),
|
|
2611
2611
|
t.map(({ code: t, action: a }) => {
|
|
2612
|
-
let o = r
|
|
2612
|
+
let o = !r || Xn(a.conditions, r), s = W(a.display?.name) || t, c = a.display?.icon, l = c && e[c] ? e[c] : void 0;
|
|
2613
2613
|
return /* @__PURE__ */ Z(p, {
|
|
2614
2614
|
icon: l ? /* @__PURE__ */ Z(l, { size: 12 }) : null,
|
|
2615
2615
|
danger: a.destructive,
|
|
@@ -3045,25 +3045,28 @@ function Hr({ layout: t, entityActions: n, globalActions: r, onRun: i, trailingN
|
|
|
3045
3045
|
});
|
|
3046
3046
|
}
|
|
3047
3047
|
var Ur = "__overflow_trigger__", Wr = 90, Gr = 80;
|
|
3048
|
-
function Kr(e
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3048
|
+
function Kr(e) {
|
|
3049
|
+
return e + 8;
|
|
3050
|
+
}
|
|
3051
|
+
function qr(e, t, n, r, i, a, o, s) {
|
|
3052
|
+
let { primary: c, regular: l, destructive: u } = Nr(e, i, a), d = c.length > 0 ? c.reduce((e, t) => e + (r.get($(t)) ?? 0), 0) : 0, f = u.length > 0 ? u.reduce((e, t) => e + (r.get($(t)) ?? Gr), 0) : 0, p = t - n - d - f, m = r.get(Ur) ?? Wr, h = 0, g = [], _ = [], v = !1;
|
|
3053
|
+
for (let e of l) {
|
|
3054
|
+
let t = r.get($(e)) ?? 0;
|
|
3052
3055
|
if (o) {
|
|
3053
|
-
o(e) ? (
|
|
3056
|
+
o(e) ? (g.push(e), h += t) : (_.push(e), v = !0);
|
|
3054
3057
|
continue;
|
|
3055
3058
|
}
|
|
3056
|
-
let n =
|
|
3057
|
-
|
|
3059
|
+
let n = l.length - g.length - _.length - 1 > 0 || _.length > 0 ? m : 0, i = s && !s.has($(e)) ? Kr(m) : 0;
|
|
3060
|
+
h + t + n + i <= p ? (g.push(e), h += t) : (_.push(e), v = !0);
|
|
3058
3061
|
}
|
|
3059
3062
|
return {
|
|
3060
|
-
primaryInline:
|
|
3061
|
-
inline:
|
|
3062
|
-
overflow:
|
|
3063
|
-
destructiveInline:
|
|
3063
|
+
primaryInline: c,
|
|
3064
|
+
inline: g,
|
|
3065
|
+
overflow: v ? _ : [],
|
|
3066
|
+
destructiveInline: u
|
|
3064
3067
|
};
|
|
3065
3068
|
}
|
|
3066
|
-
function
|
|
3069
|
+
function $(e) {
|
|
3067
3070
|
return e.kind === "action" ? `action:${e.code}` : `group:${e.name ? W(e.name) : ""}`;
|
|
3068
3071
|
}
|
|
3069
3072
|
function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedRightWidth: o = 0, measurementOverride: c, ariaLabel: u = "Actions", align: d = "trailing", constrain: f = !0, row: p, widgetContext: m, onActionClick: h }) {
|
|
@@ -3085,7 +3088,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3085
3088
|
let n = e.dataset.nodeKey;
|
|
3086
3089
|
n && t.set(n, e.getBoundingClientRect().width || e.offsetWidth);
|
|
3087
3090
|
}), x(t), C(!0);
|
|
3088
|
-
}, [N]);
|
|
3091
|
+
}, [N]), F = q(() => JSON.stringify(n.map((e) => $(e))), [n]);
|
|
3089
3092
|
Me(() => {
|
|
3090
3093
|
if (N) {
|
|
3091
3094
|
C(!0);
|
|
@@ -3097,7 +3100,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3097
3100
|
});
|
|
3098
3101
|
return () => cancelAnimationFrame(e);
|
|
3099
3102
|
}, [
|
|
3100
|
-
|
|
3103
|
+
F,
|
|
3101
3104
|
P,
|
|
3102
3105
|
N
|
|
3103
3106
|
]), K(() => {
|
|
@@ -3136,7 +3139,11 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3136
3139
|
});
|
|
3137
3140
|
return t.observe(e), y(e.getBoundingClientRect().width), () => t.disconnect();
|
|
3138
3141
|
}, [N]);
|
|
3139
|
-
let
|
|
3142
|
+
let I = J(void 0);
|
|
3143
|
+
K(() => {
|
|
3144
|
+
I.current = void 0;
|
|
3145
|
+
}, [F]);
|
|
3146
|
+
let L = q(() => N || !f ? qr(n, 2 ** 53 - 1, o, b, r, i, c) : S ? v === 0 ? qr(n, 2 ** 53 - 1, o, b, r, i, c) : qr(n, v, o, b, r, i, c, I.current) : {
|
|
3140
3147
|
primaryInline: [],
|
|
3141
3148
|
inline: [],
|
|
3142
3149
|
overflow: [],
|
|
@@ -3153,8 +3160,10 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3153
3160
|
i,
|
|
3154
3161
|
c
|
|
3155
3162
|
]);
|
|
3156
|
-
if (
|
|
3157
|
-
|
|
3163
|
+
if (K(() => {
|
|
3164
|
+
I.current = new Set([...L.inline, ...L.primaryInline].map($));
|
|
3165
|
+
}, [L]), M === 0) return null;
|
|
3166
|
+
let R = L.overflow.length > 0;
|
|
3158
3167
|
return /* @__PURE__ */ Q("div", {
|
|
3159
3168
|
ref: g,
|
|
3160
3169
|
role: "toolbar",
|
|
@@ -3190,7 +3199,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3190
3199
|
tabIndex: -1,
|
|
3191
3200
|
children: "Actions"
|
|
3192
3201
|
}, Ur), n.map((n) => {
|
|
3193
|
-
let a =
|
|
3202
|
+
let a = $(n);
|
|
3194
3203
|
if (n.kind === "action") {
|
|
3195
3204
|
let e = Pr(n.code, r, i), o = Fr(n.code, r, i), s = Ir(n.code, r, i);
|
|
3196
3205
|
return /* @__PURE__ */ Z(l, {
|
|
@@ -3214,7 +3223,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3214
3223
|
}
|
|
3215
3224
|
})]
|
|
3216
3225
|
}),
|
|
3217
|
-
|
|
3226
|
+
L.primaryInline.map((e) => /* @__PURE__ */ Z(Rr, {
|
|
3218
3227
|
leaf: e,
|
|
3219
3228
|
entityActions: r,
|
|
3220
3229
|
globalActions: i,
|
|
@@ -3224,9 +3233,9 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3224
3233
|
row: p,
|
|
3225
3234
|
widgetContext: m,
|
|
3226
3235
|
onActionClick: h
|
|
3227
|
-
},
|
|
3228
|
-
|
|
3229
|
-
let t =
|
|
3236
|
+
}, $(e))),
|
|
3237
|
+
L.inline.map((e) => {
|
|
3238
|
+
let t = $(e);
|
|
3230
3239
|
return e.kind === "action" ? /* @__PURE__ */ Z(Rr, {
|
|
3231
3240
|
leaf: e,
|
|
3232
3241
|
entityActions: r,
|
|
@@ -3246,7 +3255,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3246
3255
|
onLoadingChange: T
|
|
3247
3256
|
}, t);
|
|
3248
3257
|
}),
|
|
3249
|
-
|
|
3258
|
+
R && /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(l, {
|
|
3250
3259
|
ref: O,
|
|
3251
3260
|
kind: "default",
|
|
3252
3261
|
iconRight: /* @__PURE__ */ Z(e.down, { size: 10 }),
|
|
@@ -3263,7 +3272,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3263
3272
|
children: /* @__PURE__ */ Z("div", {
|
|
3264
3273
|
role: "menu",
|
|
3265
3274
|
"aria-label": "More actions",
|
|
3266
|
-
children:
|
|
3275
|
+
children: L.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(Br, {
|
|
3267
3276
|
leaf: e,
|
|
3268
3277
|
entityActions: r,
|
|
3269
3278
|
globalActions: i,
|
|
@@ -3280,10 +3289,10 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3280
3289
|
onRun: j,
|
|
3281
3290
|
loading: w,
|
|
3282
3291
|
onLoadingChange: T
|
|
3283
|
-
},
|
|
3292
|
+
}, $(e)))
|
|
3284
3293
|
})
|
|
3285
3294
|
})] }),
|
|
3286
|
-
|
|
3295
|
+
L.destructiveInline.map((e) => /* @__PURE__ */ Z(Rr, {
|
|
3287
3296
|
leaf: e,
|
|
3288
3297
|
entityActions: r,
|
|
3289
3298
|
globalActions: i,
|
|
@@ -3293,7 +3302,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3293
3302
|
row: p,
|
|
3294
3303
|
widgetContext: m,
|
|
3295
3304
|
onActionClick: h
|
|
3296
|
-
},
|
|
3305
|
+
}, $(e)))
|
|
3297
3306
|
]
|
|
3298
3307
|
});
|
|
3299
3308
|
}
|
|
@@ -3484,7 +3493,7 @@ function ii({ node: e, ctx: t }) {
|
|
|
3484
3493
|
});
|
|
3485
3494
|
}
|
|
3486
3495
|
function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
3487
|
-
let s = n.columns && n.columns.length > 0 ? n.columns.filter((e) => e
|
|
3496
|
+
let s = n.columns && n.columns.length > 0 ? n.columns.filter((e) => e !== o && !!a.fields.get(e)) : a.fields.names().filter((e) => {
|
|
3488
3497
|
if (e === o) return !1;
|
|
3489
3498
|
let t = a.fields.get(e);
|
|
3490
3499
|
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
@@ -4806,11 +4815,11 @@ function Ei(e) {
|
|
|
4806
4815
|
//#region src/lib/field-classification.ts
|
|
4807
4816
|
function Di(e, t) {
|
|
4808
4817
|
let n = e?.field_access?.[t];
|
|
4809
|
-
return n
|
|
4818
|
+
return !n || n.read === "granted";
|
|
4810
4819
|
}
|
|
4811
4820
|
function Oi(e, t) {
|
|
4812
4821
|
let n = e?.field_access?.[t];
|
|
4813
|
-
return n
|
|
4822
|
+
return !n || n.write === "granted";
|
|
4814
4823
|
}
|
|
4815
4824
|
function ki(e, t) {
|
|
4816
4825
|
return e?.field_access?.[t]?.classification;
|
|
@@ -4884,7 +4893,7 @@ function Ui(e) {
|
|
|
4884
4893
|
return qi(t, a.columns, a.source);
|
|
4885
4894
|
}
|
|
4886
4895
|
function Wi(e) {
|
|
4887
|
-
let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new
|
|
4896
|
+
let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new Ta(), p = r === "cards" ? a.renderFields : Zi(t, i, { explicit: !0 });
|
|
4888
4897
|
for (let e of p) f.addField(e, "render"), xa(t, e, f, "render");
|
|
4889
4898
|
let m = ca(t, f), h = pa(t, [
|
|
4890
4899
|
o,
|
|
@@ -4892,12 +4901,12 @@ function Wi(e) {
|
|
|
4892
4901
|
c
|
|
4893
4902
|
], f), g = ma(t, l, f), _ = ha(t, n, d, f);
|
|
4894
4903
|
if (u) for (let e of m) f.addField(e, "detail_handoff");
|
|
4895
|
-
let v = new
|
|
4904
|
+
let v = new wa();
|
|
4896
4905
|
for (let e of m) v.add(e);
|
|
4897
4906
|
for (let e of h) v.add(e);
|
|
4898
4907
|
for (let e of g) v.add(e);
|
|
4899
4908
|
for (let e of _) v.add(e);
|
|
4900
|
-
let y = new
|
|
4909
|
+
let y = new wa();
|
|
4901
4910
|
for (let e of p) ba(t, e, y, f);
|
|
4902
4911
|
for (let e of v.values()) ba(t, e, y, f);
|
|
4903
4912
|
let b = y.values(), x = Sa(f);
|
|
@@ -4918,7 +4927,7 @@ function Gi(e, t, n) {
|
|
|
4918
4927
|
if (r && r.length > 0) return Zi(e, r, { explicit: !0 });
|
|
4919
4928
|
let i = t.quick_peek?.sections;
|
|
4920
4929
|
if (i && i.length > 0) {
|
|
4921
|
-
let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new
|
|
4930
|
+
let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new wa();
|
|
4922
4931
|
ga(r?.items, new Set(i.map(String)), a);
|
|
4923
4932
|
let o = Zi(e, a.values(), { explicit: !0 });
|
|
4924
4933
|
if (o.length > 0) return o;
|
|
@@ -4944,7 +4953,7 @@ function qi(e, t, n) {
|
|
|
4944
4953
|
let r = Zi(e, t, { explicit: !1 }), i = Pi, a = Qi(e, e?.display?.display_field, { explicit: !1 }), o = a ?? $i(e, r, {
|
|
4945
4954
|
allowLong: !1,
|
|
4946
4955
|
allowAuto: !1
|
|
4947
|
-
}), s = a !== void 0, c = o ? /* @__PURE__ */ new Set([o]) : void 0, l = r.find((t) => c?.has(t)
|
|
4956
|
+
}), s = a !== void 0, c = o ? /* @__PURE__ */ new Set([o]) : void 0, l = r.find((t) => !c?.has(t) && ta(e, t)), u = new Set([o, l].filter((e) => !!e)), d = ra(e, r).filter((e) => !u.has(e)).slice(0, Fi);
|
|
4948
4957
|
for (let e of d) u.add(e);
|
|
4949
4958
|
let f = r.filter((t) => !u.has(t) && ia(e, t)).slice(0, Ii);
|
|
4950
4959
|
for (let e of f) u.add(e);
|
|
@@ -4962,7 +4971,7 @@ function qi(e, t, n) {
|
|
|
4962
4971
|
});
|
|
4963
4972
|
}
|
|
4964
4973
|
function Ji(e) {
|
|
4965
|
-
let t = new
|
|
4974
|
+
let t = new wa(), n = [], r = (r, i) => {
|
|
4966
4975
|
!r || t.has(r) || (t.add(r), n.push({
|
|
4967
4976
|
field: r,
|
|
4968
4977
|
bucket: i,
|
|
@@ -5015,7 +5024,7 @@ function Xi(e) {
|
|
|
5015
5024
|
return t;
|
|
5016
5025
|
}
|
|
5017
5026
|
function Zi(e, t, n) {
|
|
5018
|
-
let r = new
|
|
5027
|
+
let r = new wa();
|
|
5019
5028
|
for (let i of t) {
|
|
5020
5029
|
let t = Qi(e, i, n);
|
|
5021
5030
|
t && r.add(t);
|
|
@@ -5052,7 +5061,7 @@ function na(e, t) {
|
|
|
5052
5061
|
return n.kind === "field" && Bi.has(n.field.type);
|
|
5053
5062
|
}
|
|
5054
5063
|
function ra(e, t) {
|
|
5055
|
-
let n = new
|
|
5064
|
+
let n = new wa();
|
|
5056
5065
|
for (let e of t) (e.startsWith("$status.") || e.startsWith("$property.")) && n.add(e);
|
|
5057
5066
|
for (let r of t) na(e, r) && n.add(r);
|
|
5058
5067
|
return n.values();
|
|
@@ -5075,7 +5084,7 @@ function sa(e, t) {
|
|
|
5075
5084
|
}
|
|
5076
5085
|
function ca(e, t) {
|
|
5077
5086
|
if (!e) return [];
|
|
5078
|
-
let n = new
|
|
5087
|
+
let n = new wa();
|
|
5079
5088
|
for (let r of z(e)) n.add(r), t.addField(r, "identity");
|
|
5080
5089
|
let r = Qi(e, e.display.display_field, { explicit: !0 });
|
|
5081
5090
|
r && (n.add(r), t.addField(r, "display"), xa(e, r, t, "display"));
|
|
@@ -5087,7 +5096,7 @@ function ca(e, t) {
|
|
|
5087
5096
|
}
|
|
5088
5097
|
function la(e) {
|
|
5089
5098
|
if (!e) return [];
|
|
5090
|
-
let t = new
|
|
5099
|
+
let t = new wa(), n = 0;
|
|
5091
5100
|
for (; n < e.length;) {
|
|
5092
5101
|
let r = e.indexOf("${", n);
|
|
5093
5102
|
if (r < 0) break;
|
|
@@ -5118,7 +5127,7 @@ function ua(e, t) {
|
|
|
5118
5127
|
return -1;
|
|
5119
5128
|
}
|
|
5120
5129
|
function da(e) {
|
|
5121
|
-
let t = new
|
|
5130
|
+
let t = new wa(), n = 0;
|
|
5122
5131
|
for (; n < e.length;) {
|
|
5123
5132
|
let r = e.indexOf("row.", n);
|
|
5124
5133
|
if (r < 0) break;
|
|
@@ -5136,7 +5145,7 @@ function fa(e) {
|
|
|
5136
5145
|
return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 95;
|
|
5137
5146
|
}
|
|
5138
5147
|
function pa(e, t, n) {
|
|
5139
|
-
let r = new
|
|
5148
|
+
let r = new wa();
|
|
5140
5149
|
for (let i of t) for (let t of i ?? []) for (let i of [
|
|
5141
5150
|
...t.action.visible_if ?? [],
|
|
5142
5151
|
...t.action.enabled_if ?? [],
|
|
@@ -5148,7 +5157,7 @@ function pa(e, t, n) {
|
|
|
5148
5157
|
return r.values();
|
|
5149
5158
|
}
|
|
5150
5159
|
function ma(e, t, n) {
|
|
5151
|
-
let r = typeof t == "string" ? bi(t) : t ?? [], i = new
|
|
5160
|
+
let r = typeof t == "string" ? bi(t) : t ?? [], i = new wa();
|
|
5152
5161
|
for (let t of r) {
|
|
5153
5162
|
let r = Qi(e, t.field, { explicit: !0 });
|
|
5154
5163
|
r && (i.add(r), n.addField(r, "sort"), xa(e, r, n, "sort"));
|
|
@@ -5244,7 +5253,7 @@ function Ca(e, t) {
|
|
|
5244
5253
|
file: r
|
|
5245
5254
|
} : { kind: "missing" };
|
|
5246
5255
|
}
|
|
5247
|
-
var
|
|
5256
|
+
var wa = class {
|
|
5248
5257
|
#e = [];
|
|
5249
5258
|
#t = /* @__PURE__ */ new Set();
|
|
5250
5259
|
add(e) {
|
|
@@ -5256,7 +5265,7 @@ var $ = class {
|
|
|
5256
5265
|
values() {
|
|
5257
5266
|
return [...this.#e];
|
|
5258
5267
|
}
|
|
5259
|
-
},
|
|
5268
|
+
}, Ta = class {
|
|
5260
5269
|
#e = /* @__PURE__ */ new Map();
|
|
5261
5270
|
#t = /* @__PURE__ */ new Map();
|
|
5262
5271
|
addField(e, t) {
|
|
@@ -5279,7 +5288,7 @@ var $ = class {
|
|
|
5279
5288
|
}
|
|
5280
5289
|
r.includes(n) || r.push(n);
|
|
5281
5290
|
}
|
|
5282
|
-
},
|
|
5291
|
+
}, Ea = class extends Oe {
|
|
5283
5292
|
constructor(e) {
|
|
5284
5293
|
super(e), this.state = {
|
|
5285
5294
|
hasError: !1,
|
|
@@ -5347,15 +5356,15 @@ var $ = class {
|
|
|
5347
5356
|
};
|
|
5348
5357
|
//#endregion
|
|
5349
5358
|
//#region src/hooks/useObject.ts
|
|
5350
|
-
function
|
|
5359
|
+
function Da(e, t) {
|
|
5351
5360
|
return [
|
|
5352
5361
|
"entity-item",
|
|
5353
5362
|
e,
|
|
5354
5363
|
t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]])
|
|
5355
5364
|
];
|
|
5356
5365
|
}
|
|
5357
|
-
function
|
|
5358
|
-
let n =
|
|
5366
|
+
function Oa(e, t) {
|
|
5367
|
+
let n = Da(e, t), r = n[2];
|
|
5359
5368
|
return Le({
|
|
5360
5369
|
queryKey: n,
|
|
5361
5370
|
queryFn: () => C(e, t),
|
|
@@ -5364,15 +5373,15 @@ function Da(e, t) {
|
|
|
5364
5373
|
}
|
|
5365
5374
|
//#endregion
|
|
5366
5375
|
//#region src/components/detail-layout/widgets/registry.ts
|
|
5367
|
-
var
|
|
5368
|
-
function
|
|
5369
|
-
|
|
5370
|
-
}
|
|
5371
|
-
function Aa(e) {
|
|
5372
|
-
return Oa.get(e);
|
|
5376
|
+
var ka = /* @__PURE__ */ new Map();
|
|
5377
|
+
function Aa(e, t) {
|
|
5378
|
+
ka.set(e, t);
|
|
5373
5379
|
}
|
|
5374
5380
|
function ja(e) {
|
|
5375
|
-
return
|
|
5381
|
+
return ka.get(e);
|
|
5382
|
+
}
|
|
5383
|
+
function Ma(e) {
|
|
5384
|
+
return ka.has(e);
|
|
5376
5385
|
}
|
|
5377
5386
|
//#endregion
|
|
5378
|
-
export { xn as $, xr as A, Yn as B, xi as C, Zr as D, ii as E, vr as F, Wn as G, Un as H, ir as I, Fn as J, Rn as K, cr as L, lr as M, Cr as N, Xr as O, Sr as P, yn as Q, rr as R, Si as S, Ue as St, _i as T, Gn as U, $n as V, Kn as W, Mn as X, In as Y, Nn as Z, Ei as _, ht as _t,
|
|
5387
|
+
export { xn as $, xr as A, Yn as B, xi as C, Zr as D, ii as E, vr as F, Wn as G, Un as H, ir as I, Fn as J, Rn as K, cr as L, lr as M, Cr as N, Xr as O, Sr as P, yn as Q, rr as R, Si as S, Ue as St, _i as T, Gn as U, $n as V, Kn as W, Mn as X, In as Y, Nn as Z, Ei as _, ht as _t, Oa as a, en as at, bi as b, st as bt, Wi as c, zt as ct, Ni as d, It as dt, wn as et, ki as f, Ot as ft, Oi as g, xt as gt, Mi as h, Tt as ht, Da as i, tn as it, br as j, wr as k, Gi as l, Bt as lt, Di as m, Dt as mt, Ma as n, Sn as nt, Ea as o, Wt as ot, Ai as p, Et as pt, Ln as q, Aa as r, nn as rt, Ui as s, Ut as st, ja as t, Cn as tt, ji as u, Rt as ut, wi as v, wt as vt, vi as w, Ti as x, We as xt, Ci as y, rt as yt, yr as z };
|
package/dist-lib/testing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ln as e, _t as t, at as n, ft as r, mt as i, pt as a, r as o, t as s } from "./useCurrentScreen-
|
|
1
|
+
import { Ln as e, _t as t, at as n, ft as r, mt as i, pt as a, r as o, t as s } from "./useCurrentScreen-CD6xJlyU.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { MemoryRouter as l } from "react-router-dom";
|
|
4
4
|
import { QueryClient as u, QueryClientProvider as d } from "@tanstack/react-query";
|
|
@@ -52,11 +52,25 @@ export declare function fieldDisplayName(field: EntityField, fieldName: string,
|
|
|
52
52
|
export interface RefDisplay {
|
|
53
53
|
field: string;
|
|
54
54
|
}
|
|
55
|
+
/** A single declarative filter condition ({field, op, value}). Shared by
|
|
56
|
+
* ViewDefinition.filters (screen views) and RefConfig.options_filter (ref
|
|
57
|
+
* dropdown option narrowing); mirrors engine.ViewFilter. Structurally a subset
|
|
58
|
+
* of the wire FilterNodeParam, so it can feed a list query's `filters`. */
|
|
59
|
+
export interface FilterCondition {
|
|
60
|
+
field: string;
|
|
61
|
+
op: string;
|
|
62
|
+
value?: unknown;
|
|
63
|
+
}
|
|
55
64
|
export interface RefConfig {
|
|
56
65
|
entity: string;
|
|
57
66
|
field?: string;
|
|
58
67
|
display?: RefDisplay;
|
|
59
68
|
fields?: string[];
|
|
69
|
+
/** Narrows the option set offered by this ref's entity-select dropdown (edit
|
|
70
|
+
* combobox or action-param picker) to rows matching these conditions - e.g.
|
|
71
|
+
* only `is_active = true`. Read-side only (not a write/security boundary);
|
|
72
|
+
* mirrors engine RefConfig.OptionsFilter. */
|
|
73
|
+
options_filter?: FilterCondition[];
|
|
60
74
|
}
|
|
61
75
|
/** One declared filter-only option ({code, label}). `code` is stored into the
|
|
62
76
|
* filter when chosen (a literal or a `$user.*` token resolved server-side);
|
|
@@ -694,11 +708,7 @@ export interface ViewDefinition {
|
|
|
694
708
|
name: LocalizedString;
|
|
695
709
|
description?: LocalizedString;
|
|
696
710
|
icon?: string;
|
|
697
|
-
filters?:
|
|
698
|
-
field: string;
|
|
699
|
-
op: string;
|
|
700
|
-
value?: unknown;
|
|
701
|
-
}>;
|
|
711
|
+
filters?: FilterCondition[];
|
|
702
712
|
columns?: string[];
|
|
703
713
|
sort?: string;
|
|
704
714
|
}
|
|
@@ -1456,7 +1456,7 @@ function Ct() {
|
|
|
1456
1456
|
return H.parentOrigin;
|
|
1457
1457
|
}
|
|
1458
1458
|
function wt() {
|
|
1459
|
-
return H.current
|
|
1459
|
+
return !H.current || Date.now() >= H.current.expiresAt - yt;
|
|
1460
1460
|
}
|
|
1461
1461
|
function Tt(e) {
|
|
1462
1462
|
if (!e.token || typeof e.token != "string") return;
|
|
@@ -2755,7 +2755,7 @@ var Z = {
|
|
|
2755
2755
|
update: Ur,
|
|
2756
2756
|
dismiss: (e) => g.dismiss(e),
|
|
2757
2757
|
dismissAll: () => g.dismiss()
|
|
2758
|
-
}, Wr = a(() => import("./MarkdownRenderer-
|
|
2758
|
+
}, Wr = a(() => import("./MarkdownRenderer-jhYOLGsz.js").then((e) => ({ default: e.MarkdownRenderer })));
|
|
2759
2759
|
function Gr() {
|
|
2760
2760
|
return /* @__PURE__ */ v("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
|
|
2761
2761
|
}
|
|
@@ -3351,7 +3351,8 @@ function ji({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3351
3351
|
let m = e?.entity, h = ki(m), g = i ?? e?.display?.field ?? h?.display?.display_field ?? "$display", _ = u(() => h ? z(h)[0] ?? "id" : "id", [h]), y = e?.field || _, [b, x] = f(""), S = Oi(b, 300), { data: C, isLoading: w } = Ei(m, {
|
|
3352
3352
|
per_page: Ai,
|
|
3353
3353
|
sort: g ? `${g}:asc` : void 0,
|
|
3354
|
-
search: S || void 0
|
|
3354
|
+
search: S || void 0,
|
|
3355
|
+
filters: e?.options_filter
|
|
3355
3356
|
}), T = u(() => C?.data ?? [], [C?.data]), E = t == null ? "" : I(t), D = u(() => T.some((e) => String(e[y]) === E), [
|
|
3356
3357
|
T,
|
|
3357
3358
|
y,
|
|
@@ -3479,7 +3480,7 @@ function Pi() {
|
|
|
3479
3480
|
return /* @__PURE__ */ v("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
|
|
3480
3481
|
}
|
|
3481
3482
|
function Fi(e) {
|
|
3482
|
-
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object"
|
|
3483
|
+
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
|
|
3483
3484
|
}
|
|
3484
3485
|
function Ii({ value: e, mode: t, onChange: r, fieldId: i }) {
|
|
3485
3486
|
return t === "display" ? Fi(e) ? /* @__PURE__ */ v("span", {
|
|
@@ -4759,7 +4760,7 @@ function eo(e) {
|
|
|
4759
4760
|
let t = e.split(".");
|
|
4760
4761
|
if (t.length < 3) return !0;
|
|
4761
4762
|
let n = t[0].toLowerCase();
|
|
4762
|
-
return /^(com|org|net|edu|gov)$/.test(n) ? !1 :
|
|
4763
|
+
return /^(com|org|net|edu|gov)$/.test(n) ? !1 : !/^(io|app|dev)$/.test(n) || $a(t[t.length - 1]);
|
|
4763
4764
|
}
|
|
4764
4765
|
function to(e) {
|
|
4765
4766
|
if (Za.test(e)) return e;
|
|
@@ -6217,6 +6218,16 @@ function Xs({ field: t }) {
|
|
|
6217
6218
|
fontWeight: 500,
|
|
6218
6219
|
textDecoration: "none",
|
|
6219
6220
|
whiteSpace: "nowrap"
|
|
6221
|
+
}, p = i && !r, m = {
|
|
6222
|
+
flex: 1,
|
|
6223
|
+
minWidth: 0,
|
|
6224
|
+
display: "inline-flex",
|
|
6225
|
+
alignItems: "center",
|
|
6226
|
+
gap: 6,
|
|
6227
|
+
color: "var(--accent)",
|
|
6228
|
+
textDecoration: "underline",
|
|
6229
|
+
fontSize: 12.5,
|
|
6230
|
+
lineHeight: 1.4
|
|
6220
6231
|
};
|
|
6221
6232
|
return /* @__PURE__ */ y("div", {
|
|
6222
6233
|
style: {
|
|
@@ -6233,7 +6244,7 @@ function Xs({ field: t }) {
|
|
|
6233
6244
|
},
|
|
6234
6245
|
children: t.label
|
|
6235
6246
|
}),
|
|
6236
|
-
|
|
6247
|
+
r && a && /* @__PURE__ */ y("button", {
|
|
6237
6248
|
type: "button",
|
|
6238
6249
|
onClick: u,
|
|
6239
6250
|
disabled: o,
|
|
@@ -6242,13 +6253,7 @@ function Xs({ field: t }) {
|
|
|
6242
6253
|
cursor: o ? "default" : "pointer"
|
|
6243
6254
|
},
|
|
6244
6255
|
children: [v(o ? e.loader : e.download, { size: 14 }), /* @__PURE__ */ v("span", { children: o ? "Downloading…" : "Download" })]
|
|
6245
|
-
})
|
|
6246
|
-
href: a,
|
|
6247
|
-
target: "_blank",
|
|
6248
|
-
rel: "noopener noreferrer",
|
|
6249
|
-
style: d,
|
|
6250
|
-
children: [/* @__PURE__ */ v(e.download, { size: 14 }), /* @__PURE__ */ v("span", { children: t.value })]
|
|
6251
|
-
}) : null,
|
|
6256
|
+
}),
|
|
6252
6257
|
c && /* @__PURE__ */ v("div", {
|
|
6253
6258
|
style: {
|
|
6254
6259
|
fontSize: 11.5,
|
|
@@ -6256,7 +6261,32 @@ function Xs({ field: t }) {
|
|
|
6256
6261
|
},
|
|
6257
6262
|
children: c
|
|
6258
6263
|
}),
|
|
6259
|
-
/* @__PURE__ */ y("div", {
|
|
6264
|
+
p && a ? /* @__PURE__ */ y("div", {
|
|
6265
|
+
style: {
|
|
6266
|
+
display: "flex",
|
|
6267
|
+
alignItems: "center",
|
|
6268
|
+
gap: 8,
|
|
6269
|
+
minWidth: 0
|
|
6270
|
+
},
|
|
6271
|
+
children: [/* @__PURE__ */ y("a", {
|
|
6272
|
+
href: a,
|
|
6273
|
+
target: "_blank",
|
|
6274
|
+
rel: "noopener noreferrer",
|
|
6275
|
+
style: m,
|
|
6276
|
+
title: t.value,
|
|
6277
|
+
children: [/* @__PURE__ */ v(e.link, {
|
|
6278
|
+
size: 14,
|
|
6279
|
+
style: { flexShrink: 0 }
|
|
6280
|
+
}), /* @__PURE__ */ v("span", {
|
|
6281
|
+
style: {
|
|
6282
|
+
overflow: "hidden",
|
|
6283
|
+
textOverflow: "ellipsis",
|
|
6284
|
+
whiteSpace: "nowrap"
|
|
6285
|
+
},
|
|
6286
|
+
children: t.value
|
|
6287
|
+
})]
|
|
6288
|
+
}), t.copyable && /* @__PURE__ */ v(ti, { value: t.value })]
|
|
6289
|
+
}) : /* @__PURE__ */ y("div", {
|
|
6260
6290
|
style: {
|
|
6261
6291
|
position: "relative",
|
|
6262
6292
|
width: "100%"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as e, $t as t, Mt as n, U as r, bn as i, jt as a, ot as o, un as s } from "./useCurrentScreen-
|
|
2
|
-
import { vt as c } from "./registry-
|
|
1
|
+
import { $ as e, $t as t, Mt as n, U as r, bn as i, jt as a, ot as o, un as s } from "./useCurrentScreen-CD6xJlyU.js";
|
|
2
|
+
import { vt as c } from "./registry-D6uzF1n6.js";
|
|
3
3
|
import { useEffect as l, useMemo as u } from "react";
|
|
4
4
|
import { useSearchParams as d } from "react-router-dom";
|
|
5
5
|
import { useInfiniteQuery as f, useMutation as p, useQueryClient as m } from "@tanstack/react-query";
|
|
@@ -199,7 +199,7 @@ function O(e, t, n) {
|
|
|
199
199
|
preview: t.preview,
|
|
200
200
|
limit: t.limit,
|
|
201
201
|
after: e ?? void 0,
|
|
202
|
-
count: e
|
|
202
|
+
count: !e || void 0
|
|
203
203
|
}),
|
|
204
204
|
getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
|
|
205
205
|
initialPageParam: void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bt as e, Ut as t, zt as n } from "./useCurrentScreen-
|
|
1
|
+
import { Bt as e, Ut as t, zt as n } from "./useCurrentScreen-CD6xJlyU.js";
|
|
2
2
|
import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
3
3
|
//#region src/embed/file-src.ts
|
|
4
4
|
var s = "/api/files";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@declarion/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "React SDK for Declarion, the schema-driven business apps platform.",
|
|
@@ -58,20 +58,20 @@
|
|
|
58
58
|
"@dnd-kit/sortable": "^10.0.0",
|
|
59
59
|
"@dnd-kit/utilities": "^3.2.2",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
|
-
"@radix-ui/react-alert-dialog": "^1.1.
|
|
62
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
63
|
-
"@radix-ui/react-dropdown-menu": "^2.1.
|
|
61
|
+
"@radix-ui/react-alert-dialog": "^1.1.19",
|
|
62
|
+
"@radix-ui/react-dialog": "^1.1.19",
|
|
63
|
+
"@radix-ui/react-dropdown-menu": "^2.1.20",
|
|
64
64
|
"@radix-ui/react-label": "^2.1.11",
|
|
65
|
-
"@radix-ui/react-select": "^2.3.
|
|
65
|
+
"@radix-ui/react-select": "^2.3.3",
|
|
66
66
|
"@radix-ui/react-separator": "^1.1.11",
|
|
67
67
|
"@radix-ui/react-slot": "^1.3.0",
|
|
68
68
|
"@tanstack/react-query": "^5.101.2",
|
|
69
69
|
"@tanstack/react-table": "^8.21.3",
|
|
70
|
-
"@tanstack/react-virtual": "^3.14.
|
|
70
|
+
"@tanstack/react-virtual": "^3.14.6",
|
|
71
71
|
"class-variance-authority": "^0.7.1",
|
|
72
72
|
"clsx": "^2.1.1",
|
|
73
73
|
"date-fns": "^4.4.0",
|
|
74
|
-
"lucide-react": "^1.
|
|
74
|
+
"lucide-react": "^1.24.0",
|
|
75
75
|
"mdast-util-to-string": "^4.0.0",
|
|
76
76
|
"monaco-editor": "^0.55.1",
|
|
77
77
|
"react-markdown": "^10.1.0",
|
|
@@ -100,18 +100,18 @@
|
|
|
100
100
|
"@vitejs/plugin-react": "^6.0.3",
|
|
101
101
|
"@vitest/coverage-v8": "^4.1.10",
|
|
102
102
|
"axe-core": "^4.12.1",
|
|
103
|
-
"eslint": "^10.
|
|
103
|
+
"eslint": "^10.7.0",
|
|
104
104
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
105
105
|
"jsdom": "^29.1.1",
|
|
106
|
-
"msw": "^2.
|
|
106
|
+
"msw": "^2.15.0",
|
|
107
107
|
"publint": "^0.3.0",
|
|
108
108
|
"react": "^19.2.7",
|
|
109
109
|
"react-dom": "^19.2.7",
|
|
110
110
|
"tailwindcss": "^4.3.2",
|
|
111
|
-
"tsc-alias": "^1.9.
|
|
111
|
+
"tsc-alias": "^1.9.1",
|
|
112
112
|
"typescript": "^6.0.3",
|
|
113
|
-
"typescript-eslint": "^8.
|
|
114
|
-
"vite": "^8.1.
|
|
113
|
+
"typescript-eslint": "^8.64.0",
|
|
114
|
+
"vite": "^8.1.4",
|
|
115
115
|
"vitest": "^4.1.10"
|
|
116
116
|
},
|
|
117
117
|
"scripts": {
|