@declarion/react 0.54.0 → 0.56.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-CPoUY99R.js → DraggableChildrenTable-BV5sb8Uo.js} +32 -32
- package/dist-lib/{Grid--QAEby8k.js → Grid-DWgUPuZ3.js} +45 -45
- package/dist-lib/{JsonEditor-DoNmyrYd.js → JsonEditor-Dz1PQHC8.js} +2 -2
- package/dist-lib/{LayoutRenderer-BxZ7Nd9b.js → LayoutRenderer-C9AH9cXf.js} +716 -714
- package/dist-lib/{ListCardsBody-BPV4GPrv.js → ListCardsBody-DXcDg536.js} +29 -29
- package/dist-lib/{MarkdownRenderer-CIKuh_0i.js → MarkdownRenderer-CcSFc2N3.js} +1 -1
- package/dist-lib/{RefreshControl-DMLkZP3R.js → RefreshControl-CNtN8zSl.js} +41 -41
- package/dist-lib/{SmartDetailPage.impl-SnNu6Ug-.js → SmartDetailPage.impl-lskCd-WG.js} +492 -492
- package/dist-lib/{SmartListPage.impl-C73pR7Iw.js → SmartListPage.impl-CrGbdzyK.js} +744 -743
- package/dist-lib/{SmartRecordListPage.impl-rJjQZe1V.js → SmartRecordListPage.impl-Bkl9aZJ8.js} +129 -129
- package/dist-lib/{SortHeaderMenu-DQ_KrkWk.js → SortHeaderMenu-SYSAaqQJ.js} +1 -1
- package/dist-lib/{action-dispatch-DsuUS7ae.js → action-dispatch-CR4ajBtT.js} +179 -179
- package/dist-lib/api/auth.d.ts +1 -1
- package/dist-lib/api/batch.d.ts +1 -1
- package/dist-lib/api/data.d.ts +3 -3
- package/dist-lib/api/entities.d.ts +1 -1
- package/dist-lib/api/events.d.ts +13 -4
- package/dist-lib/api/params.d.ts +1 -1
- package/dist-lib/api/properties.d.ts +1 -1
- package/dist-lib/api/schema.d.ts +1 -1
- package/dist-lib/api/status.d.ts +1 -1
- package/dist-lib/{cardProjection-BadzqyeQ.js → cardProjection-CW5RIMko.js} +24 -24
- package/dist-lib/components/actions/ActionButton.d.ts +1 -1
- package/dist-lib/components/actions/ActionDialog.d.ts +1 -1
- package/dist-lib/components/actions/ActionRunner.d.ts +1 -1
- package/dist-lib/components/actions/ObjectActionBar.d.ts +3 -3
- package/dist-lib/components/actions/PropertyGridEditor.d.ts +2 -2
- package/dist-lib/components/actions/ResponsiveActionBar.d.ts +2 -2
- package/dist-lib/components/actions/RowActionsKebab.d.ts +1 -1
- package/dist-lib/components/agents/AgentConversationDrawer.d.ts +1 -1
- package/dist-lib/components/agents/AgentPicker.d.ts +1 -1
- package/dist-lib/components/agents/transcript-runs.d.ts +1 -1
- package/dist-lib/components/chrome/AssociationTabs.d.ts +1 -1
- package/dist-lib/components/chrome/Breadcrumbs.d.ts +1 -1
- package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +1 -1
- package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +2 -2
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +2 -2
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +3 -3
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +3 -3
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +3 -3
- package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/FieldsBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/LayoutColumn.d.ts +1 -1
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +3 -3
- package/dist-lib/components/detail-layout/LayoutRow.d.ts +1 -1
- package/dist-lib/components/detail-layout/LayoutTabs.d.ts +1 -1
- package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/QuickAddForm.d.ts +2 -2
- package/dist-lib/components/detail-layout/SectionBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/StatusesBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/TimelineComposer.d.ts +2 -2
- package/dist-lib/components/detail-layout/blockMeta.d.ts +1 -1
- package/dist-lib/components/detail-layout/useQuickAdd.d.ts +2 -2
- package/dist-lib/components/detail-layout/widgets/WidgetHost.d.ts +1 -1
- package/dist-lib/components/fields/RefCombobox.d.ts +2 -2
- package/dist-lib/components/fields/cells/factories/host-icons.d.ts +1 -1
- package/dist-lib/components/fields/cells/registry.d.ts +2 -2
- package/dist-lib/components/fields/index.d.ts +3 -3
- package/dist-lib/components/file-widgets/helpers.d.ts +1 -1
- package/dist-lib/components/file-widgets/host.d.ts +3 -3
- package/dist-lib/components/file-widgets/payload.d.ts +2 -2
- package/dist-lib/components/file-widgets/types.d.ts +1 -1
- package/dist-lib/components/file-widgets/useEmbedFileSrc.d.ts +1 -1
- package/dist-lib/components/filters/FilterChips.d.ts +1 -1
- package/dist-lib/components/filters/FilterDrawer.d.ts +3 -3
- package/dist-lib/components/layout/CommandPalette.d.ts +2 -2
- package/dist-lib/components/layout/Layout.d.ts +3 -3
- package/dist-lib/components/layout/Rail.d.ts +2 -2
- package/dist-lib/components/layout/Sidebar.d.ts +1 -1
- package/dist-lib/components/layout/TabStrip.d.ts +1 -1
- package/dist-lib/components/layout/TenantChip.d.ts +1 -1
- package/dist-lib/components/layout/TopBar.d.ts +1 -1
- package/dist-lib/components/layout/tab-close.d.ts +1 -1
- package/dist-lib/components/list/InlineEditCell.d.ts +1 -1
- package/dist-lib/components/list/PeekFieldCell.d.ts +2 -2
- package/dist-lib/components/list/QuickPeek.d.ts +3 -3
- package/dist-lib/components/list/ViewSwitcher.d.ts +1 -1
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
- package/dist-lib/components/pages/ExportMenu.d.ts +1 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +1 -1
- package/dist-lib/components/pages/auth/AuthShell.d.ts +1 -1
- package/dist-lib/components/pages/exportRequest.d.ts +1 -1
- package/dist-lib/components/pages/list/ListCardRow.d.ts +3 -3
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +3 -3
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +3 -3
- package/dist-lib/components/pages/list/ListHeader.d.ts +3 -3
- package/dist-lib/components/pages/list/ListNoRows.d.ts +1 -1
- package/dist-lib/components/pages/list/ListTable.d.ts +2 -2
- package/dist-lib/components/pages/list/ListTableRow.d.ts +1 -1
- package/dist-lib/components/pages/list/ListToolbar.d.ts +7 -5
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +1 -1
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +1 -1
- package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +1 -1
- package/dist-lib/components/pages/list/cardProjection.d.ts +2 -2
- package/dist-lib/components/pages/list/columns.d.ts +3 -3
- package/dist-lib/components/pages/list/filter-meta.d.ts +2 -2
- package/dist-lib/components/pages/list/sortable-header.d.ts +1 -1
- package/dist-lib/components/pages/list/table-features.d.ts +1 -1
- package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +4 -4
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +1 -1
- package/dist-lib/components/pages/list/useListQuery.d.ts +4 -8
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +4 -4
- package/dist-lib/components/pages/list/useListSelection.d.ts +2 -2
- package/dist-lib/components/pages/list/useListSort.d.ts +1 -1
- package/dist-lib/components/pages/list/useListViews.d.ts +3 -3
- package/dist-lib/components/pages/list/useRowMenu.d.ts +3 -3
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +1 -1
- package/dist-lib/components/params/param-editors.d.ts +1 -1
- package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +1 -1
- package/dist-lib/components/shared/MarkdownRenderer.d.ts +1 -1
- package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +2 -2
- package/dist-lib/embed/screen-location.d.ts +1 -1
- package/dist-lib/{field-classification-sMkkAEg9.js → field-classification-D6xQYn-h.js} +271 -400
- package/dist-lib/{format-count-B5SLlNOb.js → format-count-Dobmi-Ji.js} +238 -238
- package/dist-lib/hooks/useAgentConversation.d.ts +1 -1
- package/dist-lib/hooks/useAllEntityData.d.ts +1 -1
- package/dist-lib/hooks/useAssociatedData.d.ts +1 -1
- package/dist-lib/hooks/useBranding.d.ts +4 -4
- package/dist-lib/hooks/useBrandingChrome.d.ts +2 -2
- package/dist-lib/hooks/useChildrenData.d.ts +1 -1
- package/dist-lib/hooks/useCurrentScreen.d.ts +1 -1
- package/dist-lib/hooks/useCursorEntityData.d.ts +5 -5
- package/dist-lib/hooks/useEntity.d.ts +1 -1
- package/dist-lib/hooks/useEntityData.d.ts +8 -1
- package/dist-lib/hooks/useFilters.d.ts +1 -1
- package/dist-lib/hooks/useImpersonation.d.ts +1 -1
- package/dist-lib/hooks/useLiveObject.d.ts +2 -2
- package/dist-lib/hooks/useMutations.d.ts +3 -3
- package/dist-lib/hooks/useObject.d.ts +1 -1
- package/dist-lib/hooks/useParams.d.ts +2 -2
- package/dist-lib/hooks/useRealtimeThresholds.d.ts +1 -0
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +1 -1
- package/dist-lib/hooks/useResponsiveMode.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +1 -2
- package/dist-lib/hooks/useScreen.d.ts +1 -1
- package/dist-lib/hooks/useTimelineData.d.ts +2 -2
- package/dist-lib/hooks/useViews.d.ts +1 -1
- package/dist-lib/index.js +811 -811
- package/dist-lib/lib/action-dispatch.d.ts +2 -2
- package/dist-lib/lib/actions.d.ts +1 -1
- package/dist-lib/lib/brand-tokens.d.ts +1 -1
- package/dist-lib/lib/branding.d.ts +1 -1
- package/dist-lib/lib/child-config.d.ts +1 -1
- package/dist-lib/lib/children-validation.d.ts +2 -2
- package/dist-lib/lib/document-templates.d.ts +1 -1
- package/dist-lib/lib/evidence-verdict.d.ts +1 -1
- package/dist-lib/lib/mass-edit.d.ts +1 -1
- package/dist-lib/lib/messages.d.ts +2 -2
- package/dist-lib/lib/realtime-query-keys.d.ts +22 -0
- package/dist-lib/lib/realtime-reconcile.d.ts +1 -10
- package/dist-lib/lib/realtime-resync.d.ts +23 -0
- package/dist-lib/lib/rich-text.d.ts +1 -1
- package/dist-lib/lib/schema-routing.d.ts +1 -1
- package/dist-lib/lib/screen-back.d.ts +1 -1
- package/dist-lib/lib/size-value.d.ts +1 -1
- package/dist-lib/lib/toast.d.ts +2 -2
- package/dist-lib/lib/ui-actions.d.ts +1 -1
- package/dist-lib/lib/variants.d.ts +1 -1
- package/dist-lib/{peekDraftStore-CbHFwz_F.js → peekDraftStore-5wQ7lq_V.js} +17 -17
- package/dist-lib/{registry-D0RhCnEL.js → registry-CjgUaF7C.js} +511 -511
- package/dist-lib/stores/auth.d.ts +1 -1
- package/dist-lib/stores/preferences.d.ts +1 -1
- package/dist-lib/stores/realtime.d.ts +86 -19
- package/dist-lib/testing.d.ts +4 -4
- package/dist-lib/testing.js +40 -40
- package/dist-lib/types/api.d.ts +1 -1
- package/dist-lib/types/schema.d.ts +2 -2
- package/dist-lib/{useCurrentScreen-DVTXCj_K.js → useCurrentScreen-CzwzQpoW.js} +2476 -1967
- package/dist-lib/useListQuery-D7Hr5WM1.js +96 -0
- package/dist-lib/{useProperties-BcIz-MyO.js → useProperties-CqtCzFCr.js} +25 -25
- package/dist-lib/{useTabSearchMirror-UYCsopxP.js → useTabSearchMirror-C39U85cg.js} +13 -13
- package/dist-lib/{value-CQzGOI0F.js → value-Bo8C8WMU.js} +4 -4
- package/package.json +10 -10
- package/dist-lib/useListQuery-C2nq58YV.js +0 -90
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as C, c as w, d as T, f as E, i as D, l as O, n as ee, o as k, p as A, r as te, s as j, t as M, u as N } from "./value-
|
|
2
|
+
import { $n as n, B as r, Br as i, F as a, Lr as o, Or as s, P as c, Q as l, Vr as u, X as d, ct as f, dt as p, it as m, kr as h, lt as g, mt as _, nr as v, ot as y, st as b, tt as x, ut as S } from "./useCurrentScreen-CzwzQpoW.js";
|
|
3
|
+
import { a as C, c as w, d as T, f as E, i as D, l as O, n as ee, o as k, p as A, r as te, s as j, t as M, u as N } from "./value-Bo8C8WMU.js";
|
|
4
4
|
import { Fragment as P, Suspense as F, lazy as I, useCallback as L, useEffect as R, useLayoutEffect as z, useMemo as ne, useRef as B, useState as V } from "react";
|
|
5
5
|
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/file-widgets/registry.ts
|
|
@@ -36,7 +36,7 @@ function se(e) {
|
|
|
36
36
|
return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
|
|
37
37
|
}
|
|
38
38
|
function ce(e) {
|
|
39
|
-
let { field: t, fieldName: n, value: r, onChange: i, mode: a, alt: o, disabled: s, visual: c, uploadFieldCode: l, uploadSlotCode: u } = e, d = ee(r), [
|
|
39
|
+
let { field: t, fieldName: n, value: r, onChange: i, mode: a, alt: o, disabled: s, visual: c, uploadFieldCode: l, uploadSlotCode: u } = e, d = ee(r), [f, p] = V("idle"), [h, _] = V(null), [v, x] = V(null), [C, w] = V(null), [k, te] = V(!1), M = B(null), N = B(!1), P = B(null), { register: F, unregister: I, isDraft: z } = m();
|
|
40
40
|
R(() => () => {
|
|
41
41
|
M.current && M.current.abort();
|
|
42
42
|
}, []);
|
|
@@ -46,9 +46,9 @@ function ce(e) {
|
|
|
46
46
|
n,
|
|
47
47
|
d
|
|
48
48
|
]), G = (t.accepts ?? ["image/*"]).join(","), K = L(async (r) => {
|
|
49
|
-
let a =
|
|
49
|
+
let a = S(r, t.accepts, t.max_size_bytes);
|
|
50
50
|
if (a) {
|
|
51
|
-
|
|
51
|
+
x(a), p("error");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
let o = r;
|
|
@@ -59,13 +59,13 @@ function ce(e) {
|
|
|
59
59
|
});
|
|
60
60
|
o = new File([e], n, { type: e.type || r.type });
|
|
61
61
|
} catch (e) {
|
|
62
|
-
|
|
62
|
+
x({
|
|
63
63
|
code: "CROP_FAILED",
|
|
64
64
|
message: e instanceof Error ? e.message : "Crop failed"
|
|
65
|
-
}),
|
|
65
|
+
}), p("error");
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
x(null), N.current = !1, p("uploading"), _({
|
|
69
69
|
loaded: 0,
|
|
70
70
|
total: o.size,
|
|
71
71
|
pct: 0
|
|
@@ -73,19 +73,19 @@ function ce(e) {
|
|
|
73
73
|
let s = new AbortController();
|
|
74
74
|
M.current = s;
|
|
75
75
|
try {
|
|
76
|
-
let r = await
|
|
76
|
+
let r = await g({
|
|
77
77
|
file: o,
|
|
78
78
|
entityCode: e.entityCode,
|
|
79
79
|
fieldCode: l ?? n,
|
|
80
80
|
slotCode: u,
|
|
81
81
|
signal: s.signal,
|
|
82
|
-
onProgress:
|
|
82
|
+
onProgress: _
|
|
83
83
|
});
|
|
84
84
|
if (N.current) {
|
|
85
|
-
|
|
85
|
+
b(r.id).catch(() => {}), I(r.id);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
d && z(d.id) && (
|
|
88
|
+
d && z(d.id) && (b(d.id).catch(() => {}), I(d.id)), F(r.id, () => b(r.id)), w(r.id), p("idle"), _(null);
|
|
89
89
|
let a = {
|
|
90
90
|
id: r.id,
|
|
91
91
|
filename: r.filename,
|
|
@@ -99,15 +99,15 @@ function ce(e) {
|
|
|
99
99
|
};
|
|
100
100
|
i?.(t.mode === "array" ? [a] : a);
|
|
101
101
|
} catch (e) {
|
|
102
|
-
if (e instanceof
|
|
103
|
-
let t = e instanceof
|
|
102
|
+
if (e instanceof y && e.code === "ABORTED") return;
|
|
103
|
+
let t = e instanceof y ? {
|
|
104
104
|
code: e.code,
|
|
105
105
|
message: e.message
|
|
106
106
|
} : {
|
|
107
107
|
code: "UNKNOWN",
|
|
108
108
|
message: e instanceof Error ? e.message : "Upload failed"
|
|
109
109
|
};
|
|
110
|
-
|
|
110
|
+
x(t), p("error"), _(null);
|
|
111
111
|
}
|
|
112
112
|
}, [
|
|
113
113
|
t.accepts,
|
|
@@ -125,13 +125,13 @@ function ce(e) {
|
|
|
125
125
|
l,
|
|
126
126
|
u
|
|
127
127
|
]), q = L(() => {
|
|
128
|
-
|
|
128
|
+
f === "uploading" && M.current && (N.current = !0, M.current.abort(), M.current = null, p("idle"), _(null)), C && (b(C).catch(() => {}), I(C), w(null));
|
|
129
129
|
}, [
|
|
130
|
-
|
|
130
|
+
f,
|
|
131
131
|
C,
|
|
132
132
|
I
|
|
133
133
|
]), re = L(() => {
|
|
134
|
-
d && z(d.id) && (
|
|
134
|
+
d && z(d.id) && (b(d.id).catch(() => {}), I(d.id), w(null)), i?.(t.mode === "array" ? [] : null);
|
|
135
135
|
}, [
|
|
136
136
|
d,
|
|
137
137
|
t.mode,
|
|
@@ -139,7 +139,7 @@ function ce(e) {
|
|
|
139
139
|
i,
|
|
140
140
|
I
|
|
141
141
|
]), ie = L(() => {
|
|
142
|
-
|
|
142
|
+
x(null), p("idle"), P.current?.click();
|
|
143
143
|
}, []), J = L(() => {
|
|
144
144
|
s || P.current?.click();
|
|
145
145
|
}, [s]), ae = L((e) => {
|
|
@@ -194,9 +194,9 @@ function ce(e) {
|
|
|
194
194
|
role: "button",
|
|
195
195
|
"aria-label": H,
|
|
196
196
|
"aria-disabled": s || void 0,
|
|
197
|
-
"aria-busy":
|
|
198
|
-
"aria-invalid":
|
|
199
|
-
onClick:
|
|
197
|
+
"aria-busy": f === "uploading" || void 0,
|
|
198
|
+
"aria-invalid": f === "error" || void 0,
|
|
199
|
+
onClick: f === "idle" && !Z ? J : void 0,
|
|
200
200
|
onMouseDown: k ? Ce : void 0,
|
|
201
201
|
onKeyDown: ae,
|
|
202
202
|
onDragOver: se,
|
|
@@ -217,18 +217,18 @@ function ce(e) {
|
|
|
217
217
|
className: ue(c.shape),
|
|
218
218
|
style: { objectPosition: j(X) },
|
|
219
219
|
loading: "lazy"
|
|
220
|
-
}) :
|
|
220
|
+
}) : f === "uploading" ? null : /* @__PURE__ */ U(pe, {
|
|
221
221
|
shape: c.shape,
|
|
222
222
|
label: H,
|
|
223
223
|
placeholder: t.display?.placeholder
|
|
224
224
|
}),
|
|
225
|
-
|
|
225
|
+
f === "uploading" && /* @__PURE__ */ U(me, { pct: h?.pct ?? 0 }),
|
|
226
226
|
C && /* @__PURE__ */ U("span", {
|
|
227
227
|
className: "absolute right-1 top-1 h-2 w-2 rounded-full bg-warning",
|
|
228
228
|
"aria-hidden": "true",
|
|
229
229
|
"data-testid": "draft-indicator"
|
|
230
230
|
}),
|
|
231
|
-
Z &&
|
|
231
|
+
Z && f === "idle" && !s && /* @__PURE__ */ W("div", {
|
|
232
232
|
className: "absolute inset-0 flex items-center justify-center gap-2 bg-black/40 opacity-0 transition-opacity hover:opacity-100 focus-within:opacity-100",
|
|
233
233
|
children: [
|
|
234
234
|
t.display?.focal_point && /* @__PURE__ */ U("button", {
|
|
@@ -264,7 +264,7 @@ function ce(e) {
|
|
|
264
264
|
},
|
|
265
265
|
"data-testid": "focal-point-marker"
|
|
266
266
|
}),
|
|
267
|
-
|
|
267
|
+
f === "uploading" && /* @__PURE__ */ U("button", {
|
|
268
268
|
type: "button",
|
|
269
269
|
className: "absolute bottom-1 right-1 rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
270
270
|
onClick: (e) => {
|
|
@@ -273,13 +273,13 @@ function ce(e) {
|
|
|
273
273
|
"data-testid": "cancel-upload",
|
|
274
274
|
children: "Cancel"
|
|
275
275
|
}),
|
|
276
|
-
|
|
276
|
+
f === "error" && v && /* @__PURE__ */ W("div", {
|
|
277
277
|
className: "absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-destructive-soft px-2 py-1 text-xs text-destructive",
|
|
278
278
|
role: "alert",
|
|
279
279
|
children: [/* @__PURE__ */ U("span", {
|
|
280
280
|
className: "truncate",
|
|
281
|
-
title:
|
|
282
|
-
children:
|
|
281
|
+
title: v.message,
|
|
282
|
+
children: v.message
|
|
283
283
|
}), /* @__PURE__ */ U("button", {
|
|
284
284
|
type: "button",
|
|
285
285
|
className: "underline",
|
|
@@ -311,7 +311,7 @@ function fe(e) {
|
|
|
311
311
|
let t = e.replace(/\s/g, "").match(/^(\d+(?:\.\d+)?)[:/](\d+(?:\.\d+)?)$/);
|
|
312
312
|
if (!t) return;
|
|
313
313
|
let n = Number(t[1]), r = Number(t[2]);
|
|
314
|
-
if (
|
|
314
|
+
if (n && r) return n / r;
|
|
315
315
|
}
|
|
316
316
|
function pe({ shape: e, label: t, placeholder: n }) {
|
|
317
317
|
return n === "initials" ? /* @__PURE__ */ U("div", {
|
|
@@ -396,7 +396,7 @@ function X(e) {
|
|
|
396
396
|
}
|
|
397
397
|
//#endregion
|
|
398
398
|
//#region src/components/file-widgets/GridLazy.tsx
|
|
399
|
-
var _e = I(() => import("./Grid
|
|
399
|
+
var _e = I(() => import("./Grid-DWgUPuZ3.js").then((e) => ({ default: e.Grid })));
|
|
400
400
|
function Z() {
|
|
401
401
|
return /* @__PURE__ */ U("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
|
|
402
402
|
}
|
|
@@ -416,19 +416,19 @@ function ye({ contentType: e }) {
|
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
function be(e) {
|
|
419
|
-
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o, uploadFieldCode: s, uploadSlotCode: c } = e, l = ee(r), [u, d] = V("idle"), [
|
|
419
|
+
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o, uploadFieldCode: s, uploadSlotCode: c } = e, l = ee(r), [u, d] = V("idle"), [p, h] = V(null), [_, v] = V(null), [x, w] = V(!1), [T, E] = V(l?.filename ?? ""), D = B(null), O = B(!1), A = B(null), { register: j, unregister: M, isDraft: P } = m(), { open: F } = te();
|
|
420
420
|
R(() => () => {
|
|
421
421
|
D.current && D.current.abort();
|
|
422
422
|
}, []), R(() => {
|
|
423
423
|
E(l?.filename ?? "");
|
|
424
424
|
}, [l?.filename]);
|
|
425
425
|
let I = (t.accepts ?? []).join(","), z = L(async (r) => {
|
|
426
|
-
let a =
|
|
426
|
+
let a = S(r, t.accepts, t.max_size_bytes);
|
|
427
427
|
if (a) {
|
|
428
|
-
|
|
428
|
+
v(a), d("error");
|
|
429
429
|
return;
|
|
430
430
|
}
|
|
431
|
-
|
|
431
|
+
v(null), O.current = !1, d("uploading"), h({
|
|
432
432
|
loaded: 0,
|
|
433
433
|
total: r.size,
|
|
434
434
|
pct: 0
|
|
@@ -436,19 +436,19 @@ function be(e) {
|
|
|
436
436
|
let o = new AbortController();
|
|
437
437
|
D.current = o;
|
|
438
438
|
try {
|
|
439
|
-
let a = await
|
|
439
|
+
let a = await g({
|
|
440
440
|
file: r,
|
|
441
441
|
entityCode: e.entityCode,
|
|
442
442
|
fieldCode: s ?? n,
|
|
443
443
|
slotCode: c,
|
|
444
444
|
signal: o.signal,
|
|
445
|
-
onProgress:
|
|
445
|
+
onProgress: h
|
|
446
446
|
});
|
|
447
447
|
if (O.current) {
|
|
448
|
-
|
|
448
|
+
b(a.id).catch(() => {}), M(a.id);
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
|
-
l && P(l.id) && (
|
|
451
|
+
l && P(l.id) && (b(l.id).catch(() => {}), M(l.id)), j(a.id, () => b(a.id)), d("idle"), h(null);
|
|
452
452
|
let u = {
|
|
453
453
|
id: a.id,
|
|
454
454
|
filename: a.filename,
|
|
@@ -462,15 +462,15 @@ function be(e) {
|
|
|
462
462
|
};
|
|
463
463
|
i?.(t.mode === "array" ? [u] : u);
|
|
464
464
|
} catch (e) {
|
|
465
|
-
if (e instanceof
|
|
466
|
-
let t = e instanceof
|
|
465
|
+
if (e instanceof y && e.code === "ABORTED") return;
|
|
466
|
+
let t = e instanceof y ? {
|
|
467
467
|
code: e.code,
|
|
468
468
|
message: e.message
|
|
469
469
|
} : {
|
|
470
470
|
code: "UNKNOWN",
|
|
471
471
|
message: e instanceof Error ? e.message : "Upload failed"
|
|
472
472
|
};
|
|
473
|
-
|
|
473
|
+
v(t), d("error"), h(null);
|
|
474
474
|
}
|
|
475
475
|
}, [
|
|
476
476
|
t.accepts,
|
|
@@ -491,7 +491,7 @@ function be(e) {
|
|
|
491
491
|
let t = e.target.files?.[0];
|
|
492
492
|
e.target.value = "", t && z(t);
|
|
493
493
|
}, [z]), K = L(() => {
|
|
494
|
-
l && P(l.id) && (
|
|
494
|
+
l && P(l.id) && (b(l.id).catch(() => {}), M(l.id)), i?.(t.mode === "array" ? [] : null);
|
|
495
495
|
}, [
|
|
496
496
|
l,
|
|
497
497
|
t.mode,
|
|
@@ -499,11 +499,11 @@ function be(e) {
|
|
|
499
499
|
i,
|
|
500
500
|
M
|
|
501
501
|
]), q = L(() => {
|
|
502
|
-
u === "uploading" && D.current && (O.current = !0, D.current.abort(), D.current = null, d("idle"),
|
|
502
|
+
u === "uploading" && D.current && (O.current = !0, D.current.abort(), D.current = null, d("idle"), h(null));
|
|
503
503
|
}, [u]), re = L(() => {
|
|
504
504
|
l && F(l.id, "download", k(l));
|
|
505
505
|
}, [l, F]), ie = l ? C(l) : !1, J = L(() => {
|
|
506
|
-
|
|
506
|
+
l && C(l) && F(l.id, "preview", N(l));
|
|
507
507
|
}, [l, F]), ae = L(() => {
|
|
508
508
|
if (!l) {
|
|
509
509
|
w(!1);
|
|
@@ -552,10 +552,10 @@ function be(e) {
|
|
|
552
552
|
style: { display: "none" },
|
|
553
553
|
"data-testid": `file-input-${n}`
|
|
554
554
|
}),
|
|
555
|
-
u === "error" &&
|
|
555
|
+
u === "error" && _ && /* @__PURE__ */ U("div", {
|
|
556
556
|
className: "ml-auto text-xs text-destructive",
|
|
557
557
|
role: "alert",
|
|
558
|
-
children:
|
|
558
|
+
children: _.message
|
|
559
559
|
})
|
|
560
560
|
]
|
|
561
561
|
}) : /* @__PURE__ */ W("div", {
|
|
@@ -568,7 +568,7 @@ function be(e) {
|
|
|
568
568
|
/* @__PURE__ */ W("div", {
|
|
569
569
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
570
570
|
children: [
|
|
571
|
-
|
|
571
|
+
x && l ? /* @__PURE__ */ U("input", {
|
|
572
572
|
type: "text",
|
|
573
573
|
className: "rounded-sm border border-border bg-card px-1 py-0.5 text-sm text-foreground",
|
|
574
574
|
value: T,
|
|
@@ -591,7 +591,7 @@ function be(e) {
|
|
|
591
591
|
/* @__PURE__ */ W("div", {
|
|
592
592
|
className: "flex flex-wrap gap-2 text-xs text-muted-foreground",
|
|
593
593
|
children: [
|
|
594
|
-
l && /* @__PURE__ */ U("span", { children:
|
|
594
|
+
l && /* @__PURE__ */ U("span", { children: f(l.size_bytes) }),
|
|
595
595
|
l?.page_count != null && /* @__PURE__ */ W("span", { children: [l.page_count, " pages"] }),
|
|
596
596
|
l?.uploaded_at && /* @__PURE__ */ U("span", { children: xe(l.uploaded_at) }),
|
|
597
597
|
l?.uploaded_by && /* @__PURE__ */ W("span", { children: ["by ", l.uploaded_by] }),
|
|
@@ -604,20 +604,20 @@ function be(e) {
|
|
|
604
604
|
u === "uploading" && /* @__PURE__ */ W("div", {
|
|
605
605
|
className: "text-xs text-muted-foreground",
|
|
606
606
|
role: "progressbar",
|
|
607
|
-
"aria-valuenow":
|
|
607
|
+
"aria-valuenow": p?.pct ?? 0,
|
|
608
608
|
"aria-valuemin": 0,
|
|
609
609
|
"aria-valuemax": 100,
|
|
610
610
|
"data-testid": "upload-progress",
|
|
611
611
|
children: [
|
|
612
612
|
"Uploading ",
|
|
613
|
-
|
|
613
|
+
p?.pct ?? 0,
|
|
614
614
|
"%"
|
|
615
615
|
]
|
|
616
616
|
}),
|
|
617
|
-
u === "error" &&
|
|
617
|
+
u === "error" && _ && /* @__PURE__ */ U("div", {
|
|
618
618
|
className: "text-xs text-destructive",
|
|
619
619
|
role: "alert",
|
|
620
|
-
children:
|
|
620
|
+
children: _.message
|
|
621
621
|
})
|
|
622
622
|
]
|
|
623
623
|
}),
|
|
@@ -684,16 +684,16 @@ function Se(e) {
|
|
|
684
684
|
return e ? (e.split("/")[1] ?? e).toUpperCase().slice(0, 6) : "";
|
|
685
685
|
}
|
|
686
686
|
function Ce(e) {
|
|
687
|
-
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o } = e, s = M(r), [c, l] = V([]), { register: u, unregister: d, isDraft:
|
|
688
|
-
|
|
689
|
-
let
|
|
690
|
-
|
|
687
|
+
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o } = e, s = M(r), [c, l] = V([]), { register: u, unregister: d, isDraft: p } = m(), h = B(s);
|
|
688
|
+
h.current = s;
|
|
689
|
+
let _ = B(null), v = B(/* @__PURE__ */ new Set()), x = B([]);
|
|
690
|
+
x.current = c;
|
|
691
691
|
let { open: C } = te();
|
|
692
692
|
R(() => () => {
|
|
693
|
-
|
|
693
|
+
x.current.forEach((e) => e.abort());
|
|
694
694
|
}, []);
|
|
695
695
|
let w = (t.accepts ?? []).join(","), T = a === "display", E = L(async (r) => {
|
|
696
|
-
let a =
|
|
696
|
+
let a = S(r, t.accepts, t.max_size_bytes), o = `row-${Math.random().toString(36).slice(2)}-${Date.now()}`, s = new AbortController();
|
|
697
697
|
if (a) {
|
|
698
698
|
l((e) => [...e, {
|
|
699
699
|
localId: o,
|
|
@@ -716,7 +716,7 @@ function Ce(e) {
|
|
|
716
716
|
abort: () => s.abort()
|
|
717
717
|
}]);
|
|
718
718
|
try {
|
|
719
|
-
let t = await
|
|
719
|
+
let t = await g({
|
|
720
720
|
file: r,
|
|
721
721
|
entityCode: e.entityCode,
|
|
722
722
|
fieldCode: n,
|
|
@@ -726,11 +726,11 @@ function Ce(e) {
|
|
|
726
726
|
progress: e
|
|
727
727
|
} : t))
|
|
728
728
|
});
|
|
729
|
-
if (
|
|
730
|
-
|
|
729
|
+
if (v.current.delete(o)) {
|
|
730
|
+
b(t.id).catch(() => {}), d(t.id);
|
|
731
731
|
return;
|
|
732
732
|
}
|
|
733
|
-
u(t.id, () =>
|
|
733
|
+
u(t.id, () => b(t.id));
|
|
734
734
|
let a = {
|
|
735
735
|
id: t.id,
|
|
736
736
|
filename: t.filename,
|
|
@@ -741,14 +741,14 @@ function Ce(e) {
|
|
|
741
741
|
height: t.height,
|
|
742
742
|
url: t.url,
|
|
743
743
|
metadata: t.metadata
|
|
744
|
-
}, c = [...
|
|
745
|
-
|
|
744
|
+
}, c = [...h.current, a];
|
|
745
|
+
h.current = c, i?.(c), l((e) => e.filter((e) => e.localId !== o));
|
|
746
746
|
} catch (e) {
|
|
747
|
-
if (e instanceof
|
|
747
|
+
if (e instanceof y && e.code === "ABORTED") {
|
|
748
748
|
l((e) => e.filter((e) => e.localId !== o));
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
let t = e instanceof
|
|
751
|
+
let t = e instanceof y ? {
|
|
752
752
|
code: e.code,
|
|
753
753
|
message: e.message
|
|
754
754
|
} : {
|
|
@@ -773,14 +773,14 @@ function Ce(e) {
|
|
|
773
773
|
]), D = L((e) => {
|
|
774
774
|
Array.from(e).forEach((e) => void E(e));
|
|
775
775
|
}, [E]), O = L(() => {
|
|
776
|
-
o ||
|
|
776
|
+
o || _.current?.click();
|
|
777
777
|
}, [o]), ee = L((e) => {
|
|
778
778
|
let t = e.target.files;
|
|
779
779
|
e.target.value = "", t && t.length > 0 && D(t);
|
|
780
780
|
}, [D]), A = L((e) => {
|
|
781
|
-
|
|
781
|
+
p(e) && (b(e).catch(() => {}), d(e)), i?.(s.filter((t) => t.id !== e));
|
|
782
782
|
}, [
|
|
783
|
-
|
|
783
|
+
p,
|
|
784
784
|
s,
|
|
785
785
|
i,
|
|
786
786
|
d
|
|
@@ -814,7 +814,7 @@ function Ce(e) {
|
|
|
814
814
|
}),
|
|
815
815
|
/* @__PURE__ */ U("span", {
|
|
816
816
|
className: "flex-none text-xs text-muted-foreground",
|
|
817
|
-
children:
|
|
817
|
+
children: f(e.size_bytes)
|
|
818
818
|
}),
|
|
819
819
|
/* @__PURE__ */ U("button", {
|
|
820
820
|
type: "button",
|
|
@@ -861,7 +861,7 @@ function Ce(e) {
|
|
|
861
861
|
type: "button",
|
|
862
862
|
className: "flex-none rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
863
863
|
onClick: () => {
|
|
864
|
-
e.abort(),
|
|
864
|
+
e.abort(), v.current.add(e.localId), l((t) => t.filter((t) => t.localId !== e.localId));
|
|
865
865
|
},
|
|
866
866
|
children: e.error ? "Dismiss" : "Cancel"
|
|
867
867
|
})
|
|
@@ -876,7 +876,7 @@ function Ce(e) {
|
|
|
876
876
|
"data-testid": "add-files",
|
|
877
877
|
children: "Add files"
|
|
878
878
|
}), /* @__PURE__ */ U("input", {
|
|
879
|
-
ref:
|
|
879
|
+
ref: _,
|
|
880
880
|
type: "file",
|
|
881
881
|
accept: w || void 0,
|
|
882
882
|
multiple: !0,
|
|
@@ -991,17 +991,17 @@ function Me(e, t) {
|
|
|
991
991
|
function Ne(e, t, n) {
|
|
992
992
|
if (je(e, n)) return Me(t, n);
|
|
993
993
|
let r = e.fields.get(n);
|
|
994
|
-
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ?
|
|
994
|
+
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? p(t[n], Me(t, n)) : t[n];
|
|
995
995
|
}
|
|
996
996
|
function Pe(e, t, n) {
|
|
997
997
|
let r = e.fields.get(t);
|
|
998
|
-
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ?
|
|
998
|
+
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? _(n) : n;
|
|
999
999
|
}
|
|
1000
|
-
function Fe(e, t,
|
|
1001
|
-
let
|
|
1002
|
-
if (
|
|
1003
|
-
let
|
|
1004
|
-
return
|
|
1000
|
+
function Fe(e, t, r) {
|
|
1001
|
+
let i = je(e, t);
|
|
1002
|
+
if (i) return i.name || t;
|
|
1003
|
+
let a = e.fields.get(t);
|
|
1004
|
+
return a ? n(a, t, r) : t;
|
|
1005
1005
|
}
|
|
1006
1006
|
function Ie(e) {
|
|
1007
1007
|
let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, locale: f, fieldId: p, labelId: m, structure: h, detailScreen: g } = e, _ = je(t, r);
|
|
@@ -1025,7 +1025,7 @@ function Ie(e) {
|
|
|
1025
1025
|
...v,
|
|
1026
1026
|
structure: h
|
|
1027
1027
|
} : v;
|
|
1028
|
-
return y ?
|
|
1028
|
+
return y ? x({
|
|
1029
1029
|
field: y,
|
|
1030
1030
|
entityCode: n,
|
|
1031
1031
|
fieldName: r,
|
|
@@ -1053,7 +1053,7 @@ function Re(e) {
|
|
|
1053
1053
|
return e.widget ? "widget" : e.href ? "href" : e.handler ? "handler" : e.association ? "association" : e.ui_steps && e.ui_steps.length > 0 ? "ui_steps" : "unknown";
|
|
1054
1054
|
}
|
|
1055
1055
|
function ze(e, t, n, r, i) {
|
|
1056
|
-
let a = Re(t), o =
|
|
1056
|
+
let a = Re(t), o = l(n, r?.entity), s = r?.entityCode ?? "";
|
|
1057
1057
|
if (e === "__peek") return i?.({
|
|
1058
1058
|
code: e,
|
|
1059
1059
|
entity: s,
|
|
@@ -1122,7 +1122,7 @@ function Q(e, t, n) {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
function Ue(e, t, n) {
|
|
1124
1124
|
let r = Q(e, t, n);
|
|
1125
|
-
return
|
|
1125
|
+
return v(r?.display?.name) || e;
|
|
1126
1126
|
}
|
|
1127
1127
|
function We(e, t, n) {
|
|
1128
1128
|
return Q(e, t, n)?.display?.icon || void 0;
|
|
@@ -1130,27 +1130,27 @@ function We(e, t, n) {
|
|
|
1130
1130
|
function Ge(e) {
|
|
1131
1131
|
return `action-tooltip-${e}`;
|
|
1132
1132
|
}
|
|
1133
|
-
function Ke({ leaf: e, entityActions:
|
|
1134
|
-
let g = Q(e.code,
|
|
1135
|
-
if (!(!g || x ||
|
|
1136
|
-
|
|
1133
|
+
function Ke({ leaf: e, entityActions: n, globalActions: i, onRun: a, loading: o, onLoadingChange: c, measureRef: l, style: d, row: f, widgetContext: p, onActionClick: m, iconOnly: h = !1 }) {
|
|
1134
|
+
let g = Q(e.code, n, i), _ = Ue(e.code, n, i), v = We(e.code, n, i), y = g?.destructive ?? !1, b = !y && g?.display?.primary === !0, x = !e.enabled, S = x ? Ge(e.code) : void 0, C = L(async () => {
|
|
1135
|
+
if (!(!g || x || o)) {
|
|
1136
|
+
c(!0);
|
|
1137
1137
|
try {
|
|
1138
|
-
ze(e.code, g, f, p, m) || await Promise.resolve(
|
|
1138
|
+
ze(e.code, g, f, p, m) || await Promise.resolve(a(e.code, g));
|
|
1139
1139
|
} finally {
|
|
1140
|
-
|
|
1140
|
+
c(!1);
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
1143
|
}, [
|
|
1144
1144
|
g,
|
|
1145
1145
|
x,
|
|
1146
|
-
|
|
1147
|
-
|
|
1146
|
+
o,
|
|
1147
|
+
a,
|
|
1148
1148
|
e.code,
|
|
1149
|
-
|
|
1149
|
+
c,
|
|
1150
1150
|
f,
|
|
1151
1151
|
p,
|
|
1152
1152
|
m
|
|
1153
|
-
]), w =
|
|
1153
|
+
]), w = o ? /* @__PURE__ */ U(s, { size: 12 }) : v ? /* @__PURE__ */ U(t, {
|
|
1154
1154
|
name: v,
|
|
1155
1155
|
size: 12
|
|
1156
1156
|
}) : null;
|
|
@@ -1165,74 +1165,74 @@ function Ke({ leaf: e, entityActions: r, globalActions: a, onRun: s, loading: c,
|
|
|
1165
1165
|
clip: "rect(0,0,0,0)"
|
|
1166
1166
|
},
|
|
1167
1167
|
children: e.reason
|
|
1168
|
-
}), /* @__PURE__ */ U(
|
|
1169
|
-
ref:
|
|
1168
|
+
}), /* @__PURE__ */ U(u, {
|
|
1169
|
+
ref: l,
|
|
1170
1170
|
kind: b ? "primary" : "default",
|
|
1171
1171
|
danger: y,
|
|
1172
1172
|
icon: w,
|
|
1173
|
-
disabled: x ||
|
|
1173
|
+
disabled: x || o,
|
|
1174
1174
|
"aria-disabled": x ? "true" : void 0,
|
|
1175
1175
|
"aria-describedby": S,
|
|
1176
1176
|
"aria-label": h ? _ : void 0,
|
|
1177
|
-
title:
|
|
1177
|
+
title: r(g, _, x, e.reason, h),
|
|
1178
1178
|
onClick: C,
|
|
1179
1179
|
style: d,
|
|
1180
1180
|
children: h ? null : _
|
|
1181
1181
|
})] });
|
|
1182
1182
|
}
|
|
1183
|
-
function qe({ group:
|
|
1184
|
-
let
|
|
1185
|
-
|
|
1186
|
-
}, [
|
|
1187
|
-
return /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
1183
|
+
function qe({ group: n, entityActions: r, globalActions: i, onRun: a, loading: c, onLoadingChange: l, measureRef: d, style: f, row: p, widgetContext: m, onActionClick: h }) {
|
|
1184
|
+
let g = B(null), [_, y] = V(!1), b = n.name ? v(n.name) : "Actions", x = L((e) => {
|
|
1185
|
+
g.current = e, d?.(e);
|
|
1186
|
+
}, [d]), S = L((e, t) => (y(!1), a(e, t)), [a]);
|
|
1187
|
+
return /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(u, {
|
|
1188
1188
|
ref: x,
|
|
1189
1189
|
kind: "default",
|
|
1190
|
-
icon: c == null ?
|
|
1191
|
-
name:
|
|
1190
|
+
icon: c == null ? n.icon ? /* @__PURE__ */ U(t, {
|
|
1191
|
+
name: n.icon,
|
|
1192
1192
|
size: 12
|
|
1193
|
-
}) : void 0 : /* @__PURE__ */ U(
|
|
1193
|
+
}) : void 0 : /* @__PURE__ */ U(s, { size: 12 }),
|
|
1194
1194
|
iconRight: /* @__PURE__ */ U(e.down, { size: 10 }),
|
|
1195
1195
|
"aria-haspopup": "menu",
|
|
1196
|
-
"aria-expanded":
|
|
1196
|
+
"aria-expanded": _ ? "true" : "false",
|
|
1197
1197
|
title: b,
|
|
1198
1198
|
onClick: () => y((e) => !e),
|
|
1199
|
-
style:
|
|
1199
|
+
style: f,
|
|
1200
1200
|
children: b
|
|
1201
|
-
}), /* @__PURE__ */ U(
|
|
1202
|
-
open:
|
|
1203
|
-
anchor:
|
|
1201
|
+
}), /* @__PURE__ */ U(o, {
|
|
1202
|
+
open: _,
|
|
1203
|
+
anchor: g.current,
|
|
1204
1204
|
onClose: () => y(!1),
|
|
1205
1205
|
align: "start",
|
|
1206
1206
|
width: 200,
|
|
1207
1207
|
children: /* @__PURE__ */ U("div", {
|
|
1208
1208
|
role: "menu",
|
|
1209
1209
|
"aria-label": b,
|
|
1210
|
-
children:
|
|
1210
|
+
children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ U(Je, {
|
|
1211
1211
|
leaf: e,
|
|
1212
|
-
entityActions:
|
|
1213
|
-
globalActions:
|
|
1212
|
+
entityActions: r,
|
|
1213
|
+
globalActions: i,
|
|
1214
1214
|
onRun: S,
|
|
1215
1215
|
loading: c === e.code,
|
|
1216
|
-
onLoadingChange: (t) =>
|
|
1217
|
-
row:
|
|
1218
|
-
widgetContext:
|
|
1219
|
-
onActionClick:
|
|
1216
|
+
onLoadingChange: (t) => l(t ? e.code : null),
|
|
1217
|
+
row: p,
|
|
1218
|
+
widgetContext: m,
|
|
1219
|
+
onActionClick: h
|
|
1220
1220
|
}, e.code) : /* @__PURE__ */ U(Ye, {
|
|
1221
1221
|
group: e,
|
|
1222
|
-
entityActions:
|
|
1223
|
-
globalActions:
|
|
1222
|
+
entityActions: r,
|
|
1223
|
+
globalActions: i,
|
|
1224
1224
|
onRun: S,
|
|
1225
1225
|
loading: c,
|
|
1226
|
-
onLoadingChange:
|
|
1227
|
-
row:
|
|
1228
|
-
widgetContext:
|
|
1229
|
-
onActionClick:
|
|
1226
|
+
onLoadingChange: l,
|
|
1227
|
+
row: p,
|
|
1228
|
+
widgetContext: m,
|
|
1229
|
+
onActionClick: h
|
|
1230
1230
|
}, e.items[0]?.kind === "action" ? e.items[0].code : e.icon ?? "group"))
|
|
1231
1231
|
})
|
|
1232
1232
|
})] });
|
|
1233
1233
|
}
|
|
1234
|
-
function Je({ leaf: e, entityActions:
|
|
1235
|
-
let f = Q(e.code,
|
|
1234
|
+
function Je({ leaf: e, entityActions: n, globalActions: i, onRun: a, loading: o, onLoadingChange: c, row: l, widgetContext: u, onActionClick: d }) {
|
|
1235
|
+
let f = Q(e.code, n, i), p = Ue(e.code, n, i), m = We(e.code, n, i), h = f?.destructive ?? !1, g = !e.enabled, _ = g ? Ge(e.code) : void 0, v = o ? /* @__PURE__ */ U(s, { size: 12 }) : m ? /* @__PURE__ */ U(t, {
|
|
1236
1236
|
name: m,
|
|
1237
1237
|
size: 12
|
|
1238
1238
|
}) : null;
|
|
@@ -1251,12 +1251,12 @@ function Je({ leaf: e, entityActions: r, globalActions: a, onRun: o, loading: s,
|
|
|
1251
1251
|
role: "menuitem",
|
|
1252
1252
|
"aria-disabled": g ? "true" : void 0,
|
|
1253
1253
|
"aria-describedby": _,
|
|
1254
|
-
title:
|
|
1254
|
+
title: r(f, p, g, e.reason),
|
|
1255
1255
|
onClick: async () => {
|
|
1256
|
-
if (!(!f || g ||
|
|
1256
|
+
if (!(!f || g || o)) {
|
|
1257
1257
|
c(!0);
|
|
1258
1258
|
try {
|
|
1259
|
-
ze(e.code, f, l, u, d) || await Promise.resolve(
|
|
1259
|
+
ze(e.code, f, l, u, d) || await Promise.resolve(a(e.code, f));
|
|
1260
1260
|
} finally {
|
|
1261
1261
|
c(!1);
|
|
1262
1262
|
}
|
|
@@ -1292,7 +1292,7 @@ function Je({ leaf: e, entityActions: r, globalActions: a, onRun: o, loading: s,
|
|
|
1292
1292
|
})] });
|
|
1293
1293
|
}
|
|
1294
1294
|
function Ye({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
|
|
1295
|
-
let l = e.name ?
|
|
1295
|
+
let l = e.name ? v(e.name) : void 0;
|
|
1296
1296
|
return /* @__PURE__ */ W(H, { children: [l && /* @__PURE__ */ U("div", {
|
|
1297
1297
|
style: {
|
|
1298
1298
|
padding: "4px 10px 2px",
|
|
@@ -1325,21 +1325,21 @@ function Ye({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
1325
1325
|
onActionClick: c
|
|
1326
1326
|
}, e.icon ?? "nested"))] });
|
|
1327
1327
|
}
|
|
1328
|
-
function Xe({ layout: t, entityActions:
|
|
1329
|
-
let d = B(null), [f, p] = V(!1), [m, h] = V(null), g = L((e, t) => (p(!1),
|
|
1328
|
+
function Xe({ layout: t, entityActions: n, globalActions: r, onRun: a, row: c, widgetContext: l, onActionClick: u }) {
|
|
1329
|
+
let d = B(null), [f, p] = V(!1), [m, h] = V(null), g = L((e, t) => (p(!1), a(e, t)), [a]);
|
|
1330
1330
|
return Be(t) === 0 ? null : /* @__PURE__ */ W("div", {
|
|
1331
1331
|
"data-open": f ? "true" : void 0,
|
|
1332
1332
|
style: {
|
|
1333
1333
|
display: "inline-flex",
|
|
1334
1334
|
alignItems: "center"
|
|
1335
1335
|
},
|
|
1336
|
-
children: [/* @__PURE__ */ U(
|
|
1336
|
+
children: [/* @__PURE__ */ U(i, {
|
|
1337
1337
|
ref: d,
|
|
1338
|
-
icon: U(m == null ? e.more :
|
|
1338
|
+
icon: U(m == null ? e.more : s, { size: 14 }),
|
|
1339
1339
|
title: "Actions",
|
|
1340
1340
|
size: 28,
|
|
1341
1341
|
onClick: () => p((e) => !e)
|
|
1342
|
-
}), /* @__PURE__ */ U(
|
|
1342
|
+
}), /* @__PURE__ */ U(o, {
|
|
1343
1343
|
open: f,
|
|
1344
1344
|
anchor: d.current,
|
|
1345
1345
|
onClose: () => p(!1),
|
|
@@ -1347,13 +1347,13 @@ function Xe({ layout: t, entityActions: i, globalActions: a, onRun: o, row: s, w
|
|
|
1347
1347
|
width: 220,
|
|
1348
1348
|
children: /* @__PURE__ */ U(Qe, {
|
|
1349
1349
|
layout: t,
|
|
1350
|
-
entityActions:
|
|
1351
|
-
globalActions:
|
|
1350
|
+
entityActions: n,
|
|
1351
|
+
globalActions: r,
|
|
1352
1352
|
onRun: g,
|
|
1353
1353
|
loading: m,
|
|
1354
1354
|
onLoadingChange: h,
|
|
1355
|
-
row:
|
|
1356
|
-
widgetContext:
|
|
1355
|
+
row: c,
|
|
1356
|
+
widgetContext: l,
|
|
1357
1357
|
onActionClick: u
|
|
1358
1358
|
})
|
|
1359
1359
|
})]
|
|
@@ -1361,12 +1361,12 @@ function Xe({ layout: t, entityActions: i, globalActions: a, onRun: o, row: s, w
|
|
|
1361
1361
|
}
|
|
1362
1362
|
function Ze(e) {
|
|
1363
1363
|
let t = 0;
|
|
1364
|
-
for (let n of e) if (n.kind === "action" &&
|
|
1364
|
+
for (let n of e) if (n.kind === "action" && d(n.code)) t++;
|
|
1365
1365
|
else break;
|
|
1366
1366
|
return t;
|
|
1367
1367
|
}
|
|
1368
1368
|
function Qe({ layout: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c, ariaLabel: l = "Row actions" }) {
|
|
1369
|
-
let { normal: u, destructive: d } = Ve(e, t, n), f = Ze(u), p = u.slice(0, f), m = u.slice(f),
|
|
1369
|
+
let { normal: u, destructive: d } = Ve(e, t, n), f = Ze(u), p = u.slice(0, f), m = u.slice(f), g = d.length > 0, _ = m.length > 0, v = (e) => /* @__PURE__ */ U(Je, {
|
|
1370
1370
|
leaf: e,
|
|
1371
1371
|
entityActions: t,
|
|
1372
1372
|
globalActions: n,
|
|
@@ -1381,9 +1381,9 @@ function Qe({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
1381
1381
|
role: "menu",
|
|
1382
1382
|
"aria-label": l,
|
|
1383
1383
|
children: [
|
|
1384
|
-
p.map((e) => e.kind === "action" ?
|
|
1385
|
-
p.length > 0 &&
|
|
1386
|
-
m.map((e) => e.kind === "action" ?
|
|
1384
|
+
p.map((e) => e.kind === "action" ? v(e) : null),
|
|
1385
|
+
p.length > 0 && _ && /* @__PURE__ */ U(h, { divider: !0 }),
|
|
1386
|
+
m.map((e) => e.kind === "action" ? v(e) : /* @__PURE__ */ U(Ye, {
|
|
1387
1387
|
group: e,
|
|
1388
1388
|
entityActions: t,
|
|
1389
1389
|
globalActions: n,
|
|
@@ -1394,8 +1394,8 @@ function Qe({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
1394
1394
|
widgetContext: s,
|
|
1395
1395
|
onActionClick: c
|
|
1396
1396
|
}, e.icon ?? "group")),
|
|
1397
|
-
|
|
1398
|
-
d.map((e) =>
|
|
1397
|
+
g && /* @__PURE__ */ U(h, { divider: !0 }),
|
|
1398
|
+
d.map((e) => v(e))
|
|
1399
1399
|
]
|
|
1400
1400
|
});
|
|
1401
1401
|
}
|
|
@@ -1460,7 +1460,7 @@ function ft(e, t, n, r, i, a, o, s, c) {
|
|
|
1460
1460
|
};
|
|
1461
1461
|
}
|
|
1462
1462
|
function $(e) {
|
|
1463
|
-
return e.kind === "action" ? `action:${e.code}` : `group:${e.name ?
|
|
1463
|
+
return e.kind === "action" ? `action:${e.code}` : `group:${e.name ? v(e.name) : ""}`;
|
|
1464
1464
|
}
|
|
1465
1465
|
function pt(e) {
|
|
1466
1466
|
let t = e.parentElement;
|
|
@@ -1469,8 +1469,8 @@ function pt(e) {
|
|
|
1469
1469
|
let n = getComputedStyle(t);
|
|
1470
1470
|
return !(parseFloat(n.flexGrow) > 0 || n.display === "block" || n.display === "flow-root" || n.width !== "auto" || n.maxWidth !== "none");
|
|
1471
1471
|
}
|
|
1472
|
-
function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedRightWidth: a = 0, measurementOverride: s, ariaLabel: c = "Actions", align:
|
|
1473
|
-
let
|
|
1472
|
+
function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedRightWidth: a = 0, measurementOverride: s, ariaLabel: c = "Actions", align: l = "trailing", constrain: d = !0, row: f, widgetContext: p, onActionClick: m }) {
|
|
1473
|
+
let g = B(null), _ = B(null), [v, y] = V(0), [b, x] = V(/* @__PURE__ */ new Map()), [S, C] = V(!1), [w, T] = V(null), [E, D] = V(() => typeof document < "u" && document.documentElement.dir === "rtl");
|
|
1474
1474
|
R(() => {
|
|
1475
1475
|
if (typeof MutationObserver > "u") return;
|
|
1476
1476
|
let e = new MutationObserver((e) => {
|
|
@@ -1482,16 +1482,16 @@ function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1482
1482
|
}), () => e.disconnect();
|
|
1483
1483
|
}, []);
|
|
1484
1484
|
let O = B(null), [ee, k] = V(!1), A = L((e, t) => (k(!1), i(e, t)), [i]), te = Be(t), j = !!s, M = L(() => {
|
|
1485
|
-
if (j || !
|
|
1486
|
-
let e = Array.from(
|
|
1485
|
+
if (j || !_.current) return;
|
|
1486
|
+
let e = Array.from(_.current.children), t = /* @__PURE__ */ new Map();
|
|
1487
1487
|
e.forEach((e) => {
|
|
1488
1488
|
let n = e.dataset.nodeKey;
|
|
1489
1489
|
n && t.set(n, e.getBoundingClientRect().width || e.offsetWidth);
|
|
1490
|
-
}),
|
|
1490
|
+
}), x((e) => lt(e, t) ? e : t), C(!0);
|
|
1491
1491
|
}, [j]), N = ne(() => JSON.stringify(t.map((e) => $(e))), [t]);
|
|
1492
1492
|
R(() => {
|
|
1493
1493
|
if (j) return;
|
|
1494
|
-
let e =
|
|
1494
|
+
let e = _.current;
|
|
1495
1495
|
if (!e || typeof ResizeObserver > "u") return;
|
|
1496
1496
|
let t = new ResizeObserver(() => M());
|
|
1497
1497
|
t.observe(e);
|
|
@@ -1516,46 +1516,46 @@ function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1516
1516
|
M,
|
|
1517
1517
|
j
|
|
1518
1518
|
]), R(() => {
|
|
1519
|
-
if (j ||
|
|
1519
|
+
if (j || S) return;
|
|
1520
1520
|
let e = setTimeout(() => {
|
|
1521
1521
|
M(), C(!0);
|
|
1522
1522
|
}, 16);
|
|
1523
1523
|
return () => clearTimeout(e);
|
|
1524
1524
|
}, [
|
|
1525
|
-
|
|
1525
|
+
S,
|
|
1526
1526
|
M,
|
|
1527
1527
|
j
|
|
1528
1528
|
]), R(() => {
|
|
1529
|
-
if (j || !d || !
|
|
1530
|
-
let e =
|
|
1529
|
+
if (j || !d || !S || v === 0) return;
|
|
1530
|
+
let e = g.current;
|
|
1531
1531
|
if (!e || !pt(e)) return;
|
|
1532
1532
|
let t = [...e.children].filter((e) => e.getAttribute("aria-hidden") !== "true"), n = t.length > 1 ? (t.length - 1) * 4 : 0, r = t.reduce((e, t) => e + t.getBoundingClientRect().width, 0) + n;
|
|
1533
|
-
r > 0 && Math.abs(
|
|
1533
|
+
r > 0 && Math.abs(v - r) < 1 && console.error(`[declarion] ResponsiveActionBar is measuring itself: its container is ${Math.round(v)}px, exactly the width of what it just rendered. The slot holding this bar is sized by its own content, so it cannot tell the bar how much room there is. Give that slot \`flex: 1 1 auto; min-width: 0\` (and justify its content to the edge the buttons sit on), or pass \`constrain={false}\` if it genuinely has no row to take space from.`);
|
|
1534
1534
|
}, [
|
|
1535
1535
|
j,
|
|
1536
1536
|
d,
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1537
|
+
S,
|
|
1538
|
+
v,
|
|
1539
|
+
b
|
|
1540
1540
|
]), R(() => {
|
|
1541
1541
|
if (j) return;
|
|
1542
|
-
let e =
|
|
1542
|
+
let e = g.current;
|
|
1543
1543
|
if (!e) return;
|
|
1544
1544
|
if (typeof ResizeObserver > "u") {
|
|
1545
|
-
|
|
1545
|
+
y(e.getBoundingClientRect().width);
|
|
1546
1546
|
return;
|
|
1547
1547
|
}
|
|
1548
1548
|
let t = new ResizeObserver((e) => {
|
|
1549
1549
|
let t = e[0];
|
|
1550
|
-
t &&
|
|
1550
|
+
t && y(t.contentRect.width);
|
|
1551
1551
|
});
|
|
1552
|
-
return t.observe(e),
|
|
1552
|
+
return t.observe(e), y(e.getBoundingClientRect().width), () => t.disconnect();
|
|
1553
1553
|
}, [j]);
|
|
1554
1554
|
let F = B(void 0), I = B(void 0);
|
|
1555
1555
|
R(() => {
|
|
1556
1556
|
F.current = void 0, I.current = void 0;
|
|
1557
1557
|
}, [N]);
|
|
1558
|
-
let G = ne(() => j || !d ? ft(t, 2 ** 53 - 1, a,
|
|
1558
|
+
let G = ne(() => j || !d ? ft(t, 2 ** 53 - 1, a, b, n, r, s) : S ? v === 0 ? ft(t, 2 ** 53 - 1, a, b, n, r, s) : ft(t, v, a, b, n, r, s, F.current, I.current) : {
|
|
1559
1559
|
primaryInline: [],
|
|
1560
1560
|
inline: [],
|
|
1561
1561
|
overflow: [],
|
|
@@ -1564,29 +1564,29 @@ function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1564
1564
|
}, [
|
|
1565
1565
|
j,
|
|
1566
1566
|
d,
|
|
1567
|
-
|
|
1568
|
-
|
|
1567
|
+
S,
|
|
1568
|
+
v,
|
|
1569
1569
|
t,
|
|
1570
1570
|
a,
|
|
1571
|
-
|
|
1571
|
+
b,
|
|
1572
1572
|
n,
|
|
1573
1573
|
r,
|
|
1574
1574
|
s
|
|
1575
1575
|
]);
|
|
1576
1576
|
if (R(() => {
|
|
1577
|
-
|
|
1577
|
+
(S || j) && (F.current = new Set([
|
|
1578
1578
|
...G.primaryInline,
|
|
1579
1579
|
...G.inline,
|
|
1580
1580
|
...G.destructiveInline
|
|
1581
1581
|
].map($)), I.current = new Set(G.iconOnly));
|
|
1582
1582
|
}, [
|
|
1583
1583
|
G,
|
|
1584
|
-
|
|
1584
|
+
S,
|
|
1585
1585
|
j
|
|
1586
1586
|
]), te === 0) return null;
|
|
1587
1587
|
let K = G.overflow.length > 0, { normal: q, destructive: re } = Ve(G.overflow, n, r);
|
|
1588
1588
|
return /* @__PURE__ */ W("div", {
|
|
1589
|
-
ref:
|
|
1589
|
+
ref: g,
|
|
1590
1590
|
role: "toolbar",
|
|
1591
1591
|
"aria-label": c,
|
|
1592
1592
|
style: {
|
|
@@ -1595,16 +1595,16 @@ function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1595
1595
|
alignItems: "center",
|
|
1596
1596
|
gap: tt,
|
|
1597
1597
|
flexWrap: "wrap",
|
|
1598
|
-
visibility:
|
|
1598
|
+
visibility: S || j ? "visible" : "hidden",
|
|
1599
1599
|
position: "relative",
|
|
1600
1600
|
flex: d ? "1 1 auto" : "0 1 auto",
|
|
1601
|
-
justifyContent:
|
|
1601
|
+
justifyContent: l === "trailing" ? "flex-end" : "flex-start",
|
|
1602
1602
|
minWidth: 0,
|
|
1603
1603
|
boxSizing: "border-box"
|
|
1604
1604
|
},
|
|
1605
1605
|
children: [
|
|
1606
1606
|
/* @__PURE__ */ W("div", {
|
|
1607
|
-
ref:
|
|
1607
|
+
ref: _,
|
|
1608
1608
|
"aria-hidden": "true",
|
|
1609
1609
|
inert: !0,
|
|
1610
1610
|
style: {
|
|
@@ -1618,7 +1618,7 @@ function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1618
1618
|
width: "max-content",
|
|
1619
1619
|
flexWrap: "nowrap"
|
|
1620
1620
|
},
|
|
1621
|
-
children: [/* @__PURE__ */ U(
|
|
1621
|
+
children: [/* @__PURE__ */ U(u, {
|
|
1622
1622
|
"data-node-key": $e,
|
|
1623
1623
|
iconRight: /* @__PURE__ */ U(e.down, { size: 10 }),
|
|
1624
1624
|
tabIndex: -1,
|
|
@@ -1697,7 +1697,7 @@ function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1697
1697
|
onActionClick: m
|
|
1698
1698
|
}, t);
|
|
1699
1699
|
}),
|
|
1700
|
-
K && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
1700
|
+
K && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(u, {
|
|
1701
1701
|
ref: O,
|
|
1702
1702
|
kind: "default",
|
|
1703
1703
|
iconRight: /* @__PURE__ */ U(e.down, { size: 10 }),
|
|
@@ -1705,7 +1705,7 @@ function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1705
1705
|
"aria-expanded": ee ? "true" : "false",
|
|
1706
1706
|
onClick: () => k((e) => !e),
|
|
1707
1707
|
children: "Actions"
|
|
1708
|
-
}), /* @__PURE__ */ U(
|
|
1708
|
+
}), /* @__PURE__ */ U(o, {
|
|
1709
1709
|
open: ee,
|
|
1710
1710
|
anchor: O.current,
|
|
1711
1711
|
onClose: () => k(!1),
|
|
@@ -1718,7 +1718,7 @@ function mt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1718
1718
|
...q,
|
|
1719
1719
|
...re.length > 0 ? [null] : [],
|
|
1720
1720
|
...re
|
|
1721
|
-
].map((e, t) => e === null ? /* @__PURE__ */ U(
|
|
1721
|
+
].map((e, t) => e === null ? /* @__PURE__ */ U(h, { divider: !0 }, "destructive-divider") : e.kind === "action" ? /* @__PURE__ */ U(Je, {
|
|
1722
1722
|
leaf: e,
|
|
1723
1723
|
entityActions: n,
|
|
1724
1724
|
globalActions: r,
|
|
@@ -1979,7 +1979,7 @@ function Rt(e, t, n) {
|
|
|
1979
1979
|
//#endregion
|
|
1980
1980
|
//#region src/lib/action-dispatch.ts
|
|
1981
1981
|
function zt(e, t, n, r) {
|
|
1982
|
-
return
|
|
1982
|
+
return a(t) ? (c(t.ui_steps, n), null) : t.entity ? `${t.entity}.${e}` : r ? `${r}.${e}` : e;
|
|
1983
1983
|
}
|
|
1984
1984
|
//#endregion
|
|
1985
1985
|
export { K as C, re as S, ge as _, It as a, ae as b, gt as c, Me as d, Ne as f, X as g, Pe as h, Nt as i, Qe as l, Fe as m, Ft as n, Pt as o, Ie as p, Rt as r, wt as s, zt as t, je as u, he as v, q as x, Y as y };
|