@declarion/react 0.66.1 → 0.81.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/README.md +1 -1
- package/dist-lib/api/auth.js +24 -14
- package/dist-lib/app.js +28 -23
- package/dist-lib/components/chrome/AssociationTabs.js +35 -38
- package/dist-lib/components/chrome/HighlightsStrip.js +2 -1
- package/dist-lib/components/chrome/RecordHeader.js +33 -38
- package/dist-lib/components/detail-layout/AssociatedBlock.js +10 -21
- package/dist-lib/components/detail-layout/ChildrenBlock.js +1 -8
- package/dist-lib/components/detail-layout/ChildrenCards.js +1 -8
- package/dist-lib/components/detail-layout/ChildrenList.js +1 -8
- package/dist-lib/components/detail-layout/ChildrenTable.js +1 -8
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +1 -8
- package/dist-lib/components/detail-layout/DetailAuditStrip.js +33 -29
- package/dist-lib/components/detail-layout/DetailHighlights.js +7 -2
- package/dist-lib/components/detail-layout/FieldsBlock.js +12 -9
- package/dist-lib/components/detail-layout/LayoutRenderer.js +10 -10
- package/dist-lib/components/detail-layout/LayoutTabs.js +49 -48
- package/dist-lib/components/detail-layout/SectionBlock.js +20 -28
- package/dist-lib/components/detail-layout/visibility.js +28 -0
- package/dist-lib/components/fields/IntArrayField.js +37 -33
- package/dist-lib/components/fields/NumberField.js +28 -55
- package/dist-lib/components/fields/RichTextField.js +1 -1
- package/dist-lib/components/fields/TimestampField.js +50 -89
- package/dist-lib/components/fields/cells/factories/date.js +13 -14
- package/dist-lib/components/fields/cells/factories/money.js +1 -1
- package/dist-lib/components/fields/cells/factories/number.js +4 -4
- package/dist-lib/components/file-widgets/DocumentCard.js +1 -1
- package/dist-lib/components/file-widgets/Grid.js +153 -152
- package/dist-lib/components/file-widgets/ImageWidget.js +90 -91
- package/dist-lib/components/file-widgets/LabeledSlots.js +1 -0
- package/dist-lib/components/file-widgets/helpers.js +15 -19
- package/dist-lib/components/file-widgets/host.js +33 -32
- package/dist-lib/components/file-widgets/upload.js +10 -6
- package/dist-lib/components/layout/Layout.js +125 -123
- package/dist-lib/components/pages/NoScreensPage.impl.js +14 -0
- package/dist-lib/components/pages/NoScreensPage.js +12 -0
- package/dist-lib/components/pages/SmartDetailPage.impl.js +451 -451
- package/dist-lib/components/pages/auth/AuthShell.js +62 -61
- package/dist-lib/components/pages/auth/CodeInput.js +63 -0
- package/dist-lib/components/pages/auth/SignIn.js +12 -4
- package/dist-lib/components/pages/auth/SignUp.impl.js +80 -103
- package/dist-lib/components/pages/auth/SignUpCode.js +122 -0
- package/dist-lib/components/pages/auth/TwoFA.impl.js +9 -55
- package/dist-lib/components/pages/list/cardProjection.js +135 -122
- package/dist-lib/components/pages/list/columns.js +58 -43
- package/dist-lib/components/pages/profile/Profile.impl.js +87 -104
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +1 -1
- package/dist-lib/components/params/ParamsBlock.js +6 -17
- package/dist-lib/components/params/param-editors.js +14 -10
- package/dist-lib/components/primitives/Fields.js +314 -236
- package/dist-lib/components/shared/MarkdownRenderer.js +44 -43
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useActiveTabFollowsRoute.js +49 -0
- package/dist-lib/hooks/useAuth.js +44 -37
- package/dist-lib/hooks/useDocumentTitle.js +20 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +1 -0
- package/dist-lib/hooks/useTabTitle.js +1 -1
- package/dist-lib/index.d.ts +21 -7
- package/dist-lib/lib/date-text.js +57 -0
- package/dist-lib/lib/number-text.js +9 -0
- package/dist-lib/lib/timestamp.js +29 -29
- package/dist-lib/stores/tabs.js +7 -5
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +1 -0
- package/dist-lib/{useResponsiveMode-DmrpMbZX.d.ts → useResponsiveMode-D3SKz5z4.d.ts} +20 -9
- package/package.json +11 -11
|
@@ -9,14 +9,7 @@ import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
|
9
9
|
//#region src/components/detail-layout/ChildrenCards.tsx
|
|
10
10
|
function l({ config: l, parentEntity: u, parentId: d, schema: f }) {
|
|
11
11
|
let p = f.entities[l.entity], m = r(), h = r("errors"), { data: g, isLoading: _, isError: v } = i(u, d, l.entity, l.foreign_key, l.sort, l.limit), y = g?.data ?? [], b = g?.$refs, x = l.columns, S = l.cards, C = S?.header_field ?? x[0], w = S?.badge_field, T = S?.columns_count ?? 3;
|
|
12
|
-
if (!p) return
|
|
13
|
-
style: {
|
|
14
|
-
fontSize: 12.5,
|
|
15
|
-
color: "var(--text-3)",
|
|
16
|
-
padding: "8px 0"
|
|
17
|
-
},
|
|
18
|
-
children: h("record.related_entity_not_found", "The related record type is not declared in this deployment.")
|
|
19
|
-
});
|
|
12
|
+
if (!p) return null;
|
|
20
13
|
let E = {
|
|
21
14
|
display: "grid",
|
|
22
15
|
gridTemplateColumns: `repeat(auto-fill, minmax(${T >= 4 ? 180 : 240}px, 1fr))`,
|
|
@@ -8,14 +8,7 @@ import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
|
8
8
|
//#region src/components/detail-layout/ChildrenList.tsx
|
|
9
9
|
function c({ config: c, parentEntity: l, parentId: u, schema: d }) {
|
|
10
10
|
let f = d.entities[c.entity], p = n(), m = n("errors"), { data: h, isLoading: g, isError: _ } = r(l, u, c.entity, c.foreign_key, c.sort, c.limit), v = h?.data ?? [], y = h?.$refs, b = c.columns;
|
|
11
|
-
if (!f) return
|
|
12
|
-
style: {
|
|
13
|
-
fontSize: 12.5,
|
|
14
|
-
color: "var(--text-3)",
|
|
15
|
-
padding: "8px 0"
|
|
16
|
-
},
|
|
17
|
-
children: m("record.related_entity_not_found", "The related record type is not declared in this deployment.")
|
|
18
|
-
});
|
|
11
|
+
if (!f) return null;
|
|
19
12
|
let x = /* @__PURE__ */ o(a, {
|
|
20
13
|
config: c,
|
|
21
14
|
parentEntity: l,
|
|
@@ -45,14 +45,7 @@ function w({ config: w, parentEntity: T, parentId: E, schema: D }) {
|
|
|
45
45
|
D.screens,
|
|
46
46
|
O
|
|
47
47
|
]);
|
|
48
|
-
if (!A) return
|
|
49
|
-
style: {
|
|
50
|
-
fontSize: 12.5,
|
|
51
|
-
color: "var(--text-3)",
|
|
52
|
-
padding: "8px 0"
|
|
53
|
-
},
|
|
54
|
-
children: k("record.related_entity_not_found", "The related record type is not declared in this deployment.")
|
|
55
|
-
});
|
|
48
|
+
if (!A) return null;
|
|
56
49
|
let Y = /* @__PURE__ */ S(g, {
|
|
57
50
|
config: w,
|
|
58
51
|
parentEntity: T,
|
|
@@ -85,14 +85,7 @@ function L({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
85
85
|
d
|
|
86
86
|
]);
|
|
87
87
|
let [J, Y] = C(null);
|
|
88
|
-
if (!s) return
|
|
89
|
-
style: {
|
|
90
|
-
fontSize: 12.5,
|
|
91
|
-
color: "var(--text-3)",
|
|
92
|
-
padding: "8px 0"
|
|
93
|
-
},
|
|
94
|
-
children: o("record.related_entity_not_found", "The related record type is not declared in this deployment.")
|
|
95
|
-
});
|
|
88
|
+
if (!s) return null;
|
|
96
89
|
let X = e.quick_add?.fields ?? [h?.content_field].filter(Boolean), Z = i(s.display?.name_plural) || i(s.display?.name) || e.entity, Q = f ? /* @__PURE__ */ D("div", {
|
|
97
90
|
style: {
|
|
98
91
|
display: "flex",
|
|
@@ -1,40 +1,44 @@
|
|
|
1
1
|
import { useText as e } from "../../hooks/useText.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { RecordIdBadge as t } from "../primitives/RecordIdBadge.js";
|
|
3
|
+
import { renderSchemaField as n } from "../file-widgets/host.js";
|
|
4
|
+
import { AuditMetaStrip as r } from "../chrome/AuditMetaStrip.js";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/detail-layout/DetailAuditStrip.tsx
|
|
6
|
-
function
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
function a({ screen: a, entity: o, entityCode: s, record: c, recordId: l, refs: u, schema: d }) {
|
|
8
|
+
let f = e(), p = a.audit, m = l ? [{
|
|
9
|
+
label: f("record.audit.id", "ID"),
|
|
10
|
+
by: /* @__PURE__ */ i(t, { value: l })
|
|
11
|
+
}] : [];
|
|
12
|
+
if (p?.enabled === !1) return /* @__PURE__ */ i(r, { lines: m });
|
|
13
|
+
let h = (e) => {
|
|
14
|
+
if (!e || !o.fields.get(e)) return;
|
|
15
|
+
let t = c[e];
|
|
16
|
+
if (t != null && t !== "") return n({
|
|
17
|
+
entity: o,
|
|
18
|
+
entityCode: s,
|
|
15
19
|
fieldName: e,
|
|
16
|
-
record:
|
|
20
|
+
record: c,
|
|
17
21
|
mode: "display",
|
|
18
|
-
refs:
|
|
19
|
-
entities:
|
|
20
|
-
screens:
|
|
22
|
+
refs: u,
|
|
23
|
+
entities: d.entities,
|
|
24
|
+
screens: d.screens,
|
|
21
25
|
surface: "list",
|
|
22
|
-
t:
|
|
26
|
+
t: f
|
|
23
27
|
});
|
|
24
|
-
},
|
|
25
|
-
label:
|
|
26
|
-
at:
|
|
27
|
-
by:
|
|
28
|
+
}, g = p?.lines && p.lines.length > 0 ? p.lines.map((e) => ({
|
|
29
|
+
label: f(e.label),
|
|
30
|
+
at: h(e.at),
|
|
31
|
+
by: h(e.by)
|
|
28
32
|
})) : [{
|
|
29
|
-
label:
|
|
30
|
-
at:
|
|
31
|
-
by:
|
|
33
|
+
label: f("record.audit.created", "Created"),
|
|
34
|
+
at: h("created_at"),
|
|
35
|
+
by: h("created_by")
|
|
32
36
|
}, {
|
|
33
|
-
label:
|
|
34
|
-
at:
|
|
35
|
-
by:
|
|
37
|
+
label: f("record.audit.updated", "Updated"),
|
|
38
|
+
at: h("updated_at"),
|
|
39
|
+
by: h("updated_by")
|
|
36
40
|
}];
|
|
37
|
-
return /* @__PURE__ */ r
|
|
41
|
+
return /* @__PURE__ */ i(r, { lines: [...m, ...g] });
|
|
38
42
|
}
|
|
39
43
|
//#endregion
|
|
40
|
-
export {
|
|
44
|
+
export { a as DetailAuditStrip };
|
|
@@ -6,7 +6,10 @@ import { copyableValue as a } from "./FieldRow.js";
|
|
|
6
6
|
import { HighlightsStrip as o } from "../chrome/HighlightsStrip.js";
|
|
7
7
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/detail-layout/DetailHighlights.tsx
|
|
9
|
-
function u(
|
|
9
|
+
function u(e, t) {
|
|
10
|
+
return new Set((e.highlights ?? []).filter((e) => t.fields.get(e) || t.files?.get(e)));
|
|
11
|
+
}
|
|
12
|
+
function d({ screen: u, entity: d, entityCode: f, record: p, refs: m, objectStatuses: h, schema: g }) {
|
|
10
13
|
let _ = t(), v = u.highlights;
|
|
11
14
|
if (!v || v.length === 0) return null;
|
|
12
15
|
let y = [];
|
|
@@ -15,6 +18,7 @@ function u({ screen: u, entity: d, entityCode: f, record: p, refs: m, objectStat
|
|
|
15
18
|
if (o) {
|
|
16
19
|
let n = h?.find((e) => e.group_code === t), r = n ? o.statuses.find((e) => e.code === n.status_code) : void 0;
|
|
17
20
|
y.push({
|
|
21
|
+
code: t,
|
|
18
22
|
label: _(o.name),
|
|
19
23
|
value: r ? /* @__PURE__ */ c(e, {
|
|
20
24
|
tone: r.color ?? "slate",
|
|
@@ -39,6 +43,7 @@ function u({ screen: u, entity: d, entityCode: f, record: p, refs: m, objectStat
|
|
|
39
43
|
t: _
|
|
40
44
|
}), o = a(d.fields.get(t), p[t]);
|
|
41
45
|
y.push({
|
|
46
|
+
code: t,
|
|
42
47
|
label: i(_, d, t, g.entities),
|
|
43
48
|
value: o ? /* @__PURE__ */ l(s, { children: [e, /* @__PURE__ */ c(n, {
|
|
44
49
|
value: o,
|
|
@@ -51,4 +56,4 @@ function u({ screen: u, entity: d, entityCode: f, record: p, refs: m, objectStat
|
|
|
51
56
|
return y.length === 0 ? null : /* @__PURE__ */ c(o, { items: y });
|
|
52
57
|
}
|
|
53
58
|
//#endregion
|
|
54
|
-
export {
|
|
59
|
+
export { d as DetailHighlights, u as highlightedFieldCodes };
|
|
@@ -6,12 +6,12 @@ import { ActionButton as s } from "../actions/ActionButton.js";
|
|
|
6
6
|
import { FieldRow as c, FieldsGrid as l, SPAN_FIELD_TYPES as u, copyableValue as d } from "./FieldRow.js";
|
|
7
7
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/detail-layout/FieldsBlock.tsx
|
|
9
|
-
function h({ fields:
|
|
10
|
-
let _ = e(), { entity: v, entityCode: y, record: b, mode: x, onFieldChange: S, schema: C } =
|
|
9
|
+
function h({ fields: o, ctx: h }) {
|
|
10
|
+
let _ = e(), { entity: v, entityCode: y, record: b, mode: x, onFieldChange: S, schema: C } = h, w = h.columns ?? 2, T = o.filter((e) => g(h, e.code)), E = w === 1 && o.length === 1;
|
|
11
11
|
return T.length === 0 ? null : /* @__PURE__ */ p(l, {
|
|
12
12
|
columns: w,
|
|
13
13
|
children: T.map((e) => {
|
|
14
|
-
let o = e.code, l = `${y ?? "field"}-${o}`,
|
|
14
|
+
let o = e.code, l = `${y ?? "field"}-${o}`, g = `${l}-label`, w = v.fields.get(o), T = !!(w?.auto || w?.readonly || w?.source), D = r(v, o), O = D?.read === "denied", k = D?.write === "denied", A = x === "display" ? O : k || O, j = T || x === "edit" && k ? "display" : x, M = A ? /* @__PURE__ */ p(t, {
|
|
15
15
|
tier: D.classification,
|
|
16
16
|
tierDef: n(C, v, o),
|
|
17
17
|
requiredPermission: D?.required_permission,
|
|
@@ -23,12 +23,12 @@ function h({ fields: h, ctx: g }) {
|
|
|
23
23
|
record: b,
|
|
24
24
|
mode: j,
|
|
25
25
|
onChange: S && !T ? (e) => S(o, e) : void 0,
|
|
26
|
-
refs:
|
|
26
|
+
refs: h.refs,
|
|
27
27
|
entities: C?.entities,
|
|
28
28
|
screens: C?.screens,
|
|
29
29
|
t: _,
|
|
30
30
|
fieldId: l,
|
|
31
|
-
labelId:
|
|
31
|
+
labelId: g,
|
|
32
32
|
structure: e.structure,
|
|
33
33
|
detailScreen: e.detail_screen
|
|
34
34
|
});
|
|
@@ -41,7 +41,7 @@ function h({ fields: h, ctx: g }) {
|
|
|
41
41
|
variant: "ghost",
|
|
42
42
|
size: "icon"
|
|
43
43
|
}, t)) }) : void 0, P = !!w && u.has(w.type), F = j === "display" ? d(w, b?.[o]) : void 0, I = _(w?.display?.description);
|
|
44
|
-
return E && (P || e.structure) ? /* @__PURE__ */ m("div", {
|
|
44
|
+
return E && (P || e.structure || v.files?.get(o)) ? /* @__PURE__ */ m("div", {
|
|
45
45
|
style: { gridColumn: "1 / -1" },
|
|
46
46
|
children: [M, j === "edit" && I && /* @__PURE__ */ p("div", {
|
|
47
47
|
style: {
|
|
@@ -56,12 +56,12 @@ function h({ fields: h, ctx: g }) {
|
|
|
56
56
|
"data-testid": `field-${o}`,
|
|
57
57
|
label: a(_, v, o, C.entities),
|
|
58
58
|
htmlFor: j === "edit" ? l : void 0,
|
|
59
|
-
labelId:
|
|
59
|
+
labelId: g,
|
|
60
60
|
labelTitle: I || void 0,
|
|
61
61
|
required: w?.required ?? !1,
|
|
62
62
|
mode: j,
|
|
63
63
|
span: P,
|
|
64
|
-
error:
|
|
64
|
+
error: h.fieldErrors?.[o],
|
|
65
65
|
hint: j === "edit" && I ? I : void 0,
|
|
66
66
|
actions: N,
|
|
67
67
|
copyValue: F,
|
|
@@ -70,5 +70,8 @@ function h({ fields: h, ctx: g }) {
|
|
|
70
70
|
})
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
+
function g(e, t) {
|
|
74
|
+
return e.mode === "display" ? e.headerFields?.has(t) ? !1 : !e.hideEmptyFields || o(e.entity, e.record, t) : !0;
|
|
75
|
+
}
|
|
73
76
|
//#endregion
|
|
74
|
-
export { h as FieldsBlock };
|
|
77
|
+
export { h as FieldsBlock, g as displaysField };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LayoutRow as e } from "./LayoutRow.js";
|
|
2
2
|
import { LayoutColumn as t } from "./LayoutColumn.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { FieldsBlock as n } from "./FieldsBlock.js";
|
|
4
|
+
import { LayoutTabs as r } from "./LayoutTabs.js";
|
|
5
|
+
import { SectionBlock as i } from "./SectionBlock.js";
|
|
6
|
+
import { ChildrenBlock as a } from "./ChildrenBlock.js";
|
|
7
|
+
import { AssociatedBlock as o } from "./AssociatedBlock.js";
|
|
8
8
|
import { PropertiesBlock as s } from "./PropertiesBlock.js";
|
|
9
9
|
import { StatusesBlock as c } from "./StatusesBlock.js";
|
|
10
10
|
import { WidgetHost as l } from "./widgets/WidgetHost.js";
|
|
@@ -24,19 +24,19 @@ function p({ node: u, ctx: f }) {
|
|
|
24
24
|
config: u.column,
|
|
25
25
|
node: u,
|
|
26
26
|
ctx: f
|
|
27
|
-
}) : u.tabs ? /* @__PURE__ */ d(
|
|
27
|
+
}) : u.tabs ? /* @__PURE__ */ d(r, {
|
|
28
28
|
config: u.tabs,
|
|
29
29
|
ctx: f
|
|
30
|
-
}) : u.section ? /* @__PURE__ */ d(
|
|
30
|
+
}) : u.section ? /* @__PURE__ */ d(i, {
|
|
31
31
|
config: u.section,
|
|
32
32
|
ctx: f
|
|
33
|
-
}) : u.children ? /* @__PURE__ */ d(
|
|
33
|
+
}) : u.children ? /* @__PURE__ */ d(a, {
|
|
34
34
|
node: u,
|
|
35
35
|
ctx: f
|
|
36
|
-
}) : u.associated ? /* @__PURE__ */ d(
|
|
36
|
+
}) : u.associated ? /* @__PURE__ */ d(o, {
|
|
37
37
|
node: u,
|
|
38
38
|
ctx: f
|
|
39
|
-
}) : u.fields ? /* @__PURE__ */ d(
|
|
39
|
+
}) : u.fields ? /* @__PURE__ */ d(n, {
|
|
40
40
|
fields: u.fields,
|
|
41
41
|
ctx: f
|
|
42
42
|
}) : u.properties == null ? u.statuses == null ? u.widget ? /* @__PURE__ */ d(l, {
|
|
@@ -2,24 +2,25 @@ import { useText as e } from "../../hooks/useText.js";
|
|
|
2
2
|
import { useResponsiveMode as t } from "../../hooks/useResponsiveMode.js";
|
|
3
3
|
import { DynamicIcon as n } from "../shared/DynamicIcon.js";
|
|
4
4
|
import { resolveBlockIcon as r, resolveBlockLabel as i } from "./blockMeta.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { layoutNodeShows as a } from "./visibility.js";
|
|
6
|
+
import { LayoutNodeRenderer as o } from "./LayoutRenderer.js";
|
|
7
|
+
import { useState as s } from "react";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/detail-layout/LayoutTabs.tsx
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
if (
|
|
12
|
-
if (
|
|
13
|
-
let e =
|
|
14
|
-
return /* @__PURE__ */
|
|
10
|
+
function u({ config: u, ctx: d }) {
|
|
11
|
+
let f = e(), p = u.items.filter((e) => a(e, d)), [m, h] = s(0), g = t(), _ = d.detailTabsPresentation ?? (g.isPhone ? "sections" : "scroll");
|
|
12
|
+
if (p.length === 0) return null;
|
|
13
|
+
if (_ === "sections") {
|
|
14
|
+
let e = p.map((e, t) => `detail-tab-section-${t}`);
|
|
15
|
+
return /* @__PURE__ */ l("div", {
|
|
15
16
|
style: {
|
|
16
17
|
display: "flex",
|
|
17
18
|
flexDirection: "column",
|
|
18
19
|
gap: 10,
|
|
19
20
|
minWidth: 0
|
|
20
21
|
},
|
|
21
|
-
children: [
|
|
22
|
-
"aria-label":
|
|
22
|
+
children: [p.length > 1 && /* @__PURE__ */ c("nav", {
|
|
23
|
+
"aria-label": f("record.tabs.sections", "Detail sections"),
|
|
23
24
|
style: {
|
|
24
25
|
display: "flex",
|
|
25
26
|
gap: 6,
|
|
@@ -27,9 +28,9 @@ function l({ config: l, ctx: u }) {
|
|
|
27
28
|
padding: "0 2px 2px",
|
|
28
29
|
WebkitOverflowScrolling: "touch"
|
|
29
30
|
},
|
|
30
|
-
children:
|
|
31
|
-
let o = i(t,
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
children: p.map((t, a) => {
|
|
32
|
+
let o = i(t, d, f), s = r(t, d);
|
|
33
|
+
return /* @__PURE__ */ l("button", {
|
|
33
34
|
type: "button",
|
|
34
35
|
onClick: () => document.getElementById(e[a])?.scrollIntoView({
|
|
35
36
|
block: "start",
|
|
@@ -51,10 +52,10 @@ function l({ config: l, ctx: u }) {
|
|
|
51
52
|
whiteSpace: "nowrap",
|
|
52
53
|
cursor: "pointer"
|
|
53
54
|
},
|
|
54
|
-
children: [
|
|
55
|
-
name:
|
|
55
|
+
children: [s && /* @__PURE__ */ c(n, {
|
|
56
|
+
name: s,
|
|
56
57
|
size: 13
|
|
57
|
-
}), /* @__PURE__ */
|
|
58
|
+
}), /* @__PURE__ */ c("span", {
|
|
58
59
|
style: {
|
|
59
60
|
overflow: "hidden",
|
|
60
61
|
textOverflow: "ellipsis"
|
|
@@ -63,10 +64,10 @@ function l({ config: l, ctx: u }) {
|
|
|
63
64
|
})]
|
|
64
65
|
}, a);
|
|
65
66
|
})
|
|
66
|
-
}),
|
|
67
|
-
let
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
id: e[
|
|
67
|
+
}), p.map((t, a) => {
|
|
68
|
+
let s = i(t, d, f), u = r(t, d);
|
|
69
|
+
return /* @__PURE__ */ l("section", {
|
|
70
|
+
id: e[a],
|
|
70
71
|
style: {
|
|
71
72
|
background: "var(--surface)",
|
|
72
73
|
border: "1px solid var(--border)",
|
|
@@ -76,7 +77,7 @@ function l({ config: l, ctx: u }) {
|
|
|
76
77
|
minWidth: 0,
|
|
77
78
|
scrollMarginTop: 12
|
|
78
79
|
},
|
|
79
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ l("div", {
|
|
80
81
|
style: {
|
|
81
82
|
display: "flex",
|
|
82
83
|
alignItems: "center",
|
|
@@ -87,31 +88,31 @@ function l({ config: l, ctx: u }) {
|
|
|
87
88
|
fontSize: 13,
|
|
88
89
|
fontWeight: 700
|
|
89
90
|
},
|
|
90
|
-
children: [
|
|
91
|
-
name:
|
|
91
|
+
children: [u && /* @__PURE__ */ c(n, {
|
|
92
|
+
name: u,
|
|
92
93
|
size: 14
|
|
93
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ c("span", {
|
|
94
95
|
style: { overflowWrap: "anywhere" },
|
|
95
|
-
children:
|
|
96
|
+
children: s
|
|
96
97
|
})]
|
|
97
|
-
}), /* @__PURE__ */
|
|
98
|
+
}), /* @__PURE__ */ c("div", {
|
|
98
99
|
style: {
|
|
99
100
|
padding: 14,
|
|
100
101
|
minWidth: 0
|
|
101
102
|
},
|
|
102
|
-
children: /* @__PURE__ */
|
|
103
|
+
children: /* @__PURE__ */ c(o, {
|
|
103
104
|
node: t,
|
|
104
105
|
ctx: {
|
|
105
|
-
...
|
|
106
|
+
...d,
|
|
106
107
|
withinCard: !0
|
|
107
108
|
}
|
|
108
109
|
})
|
|
109
110
|
})]
|
|
110
|
-
},
|
|
111
|
+
}, a);
|
|
111
112
|
})]
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ l("div", {
|
|
115
116
|
style: {
|
|
116
117
|
background: "var(--surface)",
|
|
117
118
|
border: "1px solid var(--border)",
|
|
@@ -120,7 +121,7 @@ function l({ config: l, ctx: u }) {
|
|
|
120
121
|
boxShadow: "var(--shadow-xs)",
|
|
121
122
|
flexShrink: 0
|
|
122
123
|
},
|
|
123
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ c("div", {
|
|
124
125
|
role: "tablist",
|
|
125
126
|
style: {
|
|
126
127
|
display: "flex",
|
|
@@ -130,13 +131,13 @@ function l({ config: l, ctx: u }) {
|
|
|
130
131
|
padding: "6px 10px 0 10px",
|
|
131
132
|
overflowX: "auto"
|
|
132
133
|
},
|
|
133
|
-
children:
|
|
134
|
-
let a = i(e,
|
|
135
|
-
return /* @__PURE__ */
|
|
134
|
+
children: p.map((e, t) => {
|
|
135
|
+
let a = i(e, d, f), o = r(e, d), s = t === m;
|
|
136
|
+
return /* @__PURE__ */ l("button", {
|
|
136
137
|
role: "tab",
|
|
137
|
-
"aria-selected":
|
|
138
|
+
"aria-selected": s,
|
|
138
139
|
onClick: (e) => {
|
|
139
|
-
e.stopPropagation(),
|
|
140
|
+
e.stopPropagation(), h(t);
|
|
140
141
|
},
|
|
141
142
|
style: {
|
|
142
143
|
position: "relative",
|
|
@@ -150,23 +151,23 @@ function l({ config: l, ctx: u }) {
|
|
|
150
151
|
fontSize: 12.5,
|
|
151
152
|
fontWeight: 500,
|
|
152
153
|
fontFamily: "inherit",
|
|
153
|
-
color:
|
|
154
|
+
color: s ? "var(--text)" : "var(--text-3)",
|
|
154
155
|
whiteSpace: "nowrap",
|
|
155
156
|
transition: "color .12s"
|
|
156
157
|
},
|
|
157
158
|
onMouseEnter: (e) => {
|
|
158
|
-
|
|
159
|
+
s || (e.currentTarget.style.color = "var(--text-2)");
|
|
159
160
|
},
|
|
160
161
|
onMouseLeave: (e) => {
|
|
161
|
-
|
|
162
|
+
s || (e.currentTarget.style.color = "var(--text-3)");
|
|
162
163
|
},
|
|
163
164
|
children: [
|
|
164
|
-
o && /* @__PURE__ */
|
|
165
|
+
o && /* @__PURE__ */ c(n, {
|
|
165
166
|
name: o,
|
|
166
167
|
size: 13
|
|
167
168
|
}),
|
|
168
169
|
a,
|
|
169
|
-
|
|
170
|
+
s && /* @__PURE__ */ c("span", { style: {
|
|
170
171
|
position: "absolute",
|
|
171
172
|
left: 4,
|
|
172
173
|
right: 4,
|
|
@@ -178,18 +179,18 @@ function l({ config: l, ctx: u }) {
|
|
|
178
179
|
]
|
|
179
180
|
}, t);
|
|
180
181
|
})
|
|
181
|
-
}), /* @__PURE__ */
|
|
182
|
+
}), /* @__PURE__ */ c("div", {
|
|
182
183
|
role: "tabpanel",
|
|
183
184
|
style: { padding: 14 },
|
|
184
|
-
children: /* @__PURE__ */
|
|
185
|
-
node:
|
|
185
|
+
children: /* @__PURE__ */ c(o, {
|
|
186
|
+
node: p[m],
|
|
186
187
|
ctx: {
|
|
187
|
-
...
|
|
188
|
+
...d,
|
|
188
189
|
withinCard: !0
|
|
189
190
|
}
|
|
190
|
-
},
|
|
191
|
+
}, m)
|
|
191
192
|
})]
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
//#endregion
|
|
195
|
-
export {
|
|
196
|
+
export { u as LayoutTabs };
|
|
@@ -1,48 +1,40 @@
|
|
|
1
1
|
import { useText as e } from "../../hooks/useText.js";
|
|
2
2
|
import { SectionCard as t } from "../primitives/SectionCard.js";
|
|
3
3
|
import { DynamicIcon as n } from "../shared/DynamicIcon.js";
|
|
4
|
-
import {
|
|
5
|
-
import { LayoutRenderer as
|
|
6
|
-
import { jsx as
|
|
4
|
+
import { sectionContext as r, sectionShows as i } from "./visibility.js";
|
|
5
|
+
import { LayoutRenderer as a } from "./LayoutRenderer.js";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/detail-layout/SectionBlock.tsx
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
if (
|
|
11
|
-
let _ = {
|
|
12
|
-
...o,
|
|
13
|
-
withinCard: !0,
|
|
14
|
-
...f ? { columns: f } : null,
|
|
15
|
-
...g ? { hideEmptyFields: g } : null
|
|
16
|
-
}, v = p ? /* @__PURE__ */ a(n, {
|
|
8
|
+
function s({ config: s, ctx: c }) {
|
|
9
|
+
let l = e(), { name: u, items: d, collapsed: f = !1, icon: p, badge: m, emphasis: h } = s, g = r(s, c);
|
|
10
|
+
if (!i(s, g)) return null;
|
|
11
|
+
let _ = p ? /* @__PURE__ */ o(n, {
|
|
17
12
|
name: p,
|
|
18
13
|
size: 14
|
|
19
|
-
}) : void 0,
|
|
20
|
-
text:
|
|
14
|
+
}) : void 0, v = m ? {
|
|
15
|
+
text: l(m.text),
|
|
21
16
|
tone: m.tone,
|
|
22
17
|
dot: m.dot
|
|
23
18
|
} : void 0;
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
title:
|
|
26
|
-
defaultOpen: !
|
|
27
|
-
icon:
|
|
28
|
-
badge:
|
|
19
|
+
return /* @__PURE__ */ o(t, {
|
|
20
|
+
title: l(u),
|
|
21
|
+
defaultOpen: !f,
|
|
22
|
+
icon: _,
|
|
23
|
+
badge: v,
|
|
29
24
|
emphasis: h,
|
|
30
|
-
headingLevel:
|
|
31
|
-
children: /* @__PURE__ */
|
|
25
|
+
headingLevel: c.withinCard ? 3 : 2,
|
|
26
|
+
children: /* @__PURE__ */ o("div", {
|
|
32
27
|
style: {
|
|
33
28
|
display: "flex",
|
|
34
29
|
flexDirection: "column",
|
|
35
30
|
gap: 12
|
|
36
31
|
},
|
|
37
|
-
children: /* @__PURE__ */ a
|
|
38
|
-
nodes:
|
|
39
|
-
ctx:
|
|
32
|
+
children: /* @__PURE__ */ o(a, {
|
|
33
|
+
nodes: d,
|
|
34
|
+
ctx: g
|
|
40
35
|
})
|
|
41
36
|
})
|
|
42
37
|
});
|
|
43
38
|
}
|
|
44
|
-
function s(e, t) {
|
|
45
|
-
return e.some((e) => !e.fields || e.fields.some((e) => r(t.entity, t.record, e.code)));
|
|
46
|
-
}
|
|
47
39
|
//#endregion
|
|
48
|
-
export {
|
|
40
|
+
export { s as SectionBlock };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { findChildRelation as e } from "../../lib/child-config.js";
|
|
2
|
+
import { displaysField as t } from "./FieldsBlock.js";
|
|
3
|
+
//#region src/components/detail-layout/visibility.ts
|
|
4
|
+
function n(a, o) {
|
|
5
|
+
if (a.children) {
|
|
6
|
+
let t = e(o.entity, a.children);
|
|
7
|
+
return !t || !!o.schema.entities[t.entity];
|
|
8
|
+
}
|
|
9
|
+
if (a.associated) return !!o.schema.entities[a.associated];
|
|
10
|
+
if (a.fields) return a.fields.some((e) => t(o, e.code));
|
|
11
|
+
if (a.section) return i(a.section, r(a.section, o));
|
|
12
|
+
let s = a.row ?? a.column ?? a.tabs;
|
|
13
|
+
return !s || s.items.some((e) => n(e, o));
|
|
14
|
+
}
|
|
15
|
+
function r(e, t) {
|
|
16
|
+
let n = e.hide_empty_fields === !0 && t.mode === "display";
|
|
17
|
+
return {
|
|
18
|
+
...t,
|
|
19
|
+
withinCard: !0,
|
|
20
|
+
...e.columns ? { columns: e.columns } : null,
|
|
21
|
+
...n ? { hideEmptyFields: n } : null
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function i(e, t) {
|
|
25
|
+
return e.items.length === 0 || e.items.some((e) => n(e, t));
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { n as layoutNodeShows, r as sectionContext, i as sectionShows };
|