@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
|
@@ -2,82 +2,86 @@ import { Icon as e } from "../primitives/Icons.js";
|
|
|
2
2
|
import { Btn as t } from "../primitives/Btn.js";
|
|
3
3
|
import { Chip as n } from "../primitives/Chip.js";
|
|
4
4
|
import { TextInput as r } from "../primitives/Fields.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { isNumberDraft as i } from "../../lib/number-text.js";
|
|
6
|
+
import { useState as a } from "react";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/fields/IntArrayField.tsx
|
|
8
|
-
function
|
|
9
|
+
function c(e) {
|
|
9
10
|
return Array.isArray(e) ? e.filter((e) => e != null).map(Number).filter((e) => !isNaN(e)) : [];
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
if (
|
|
12
|
+
function l({ field: l, fieldName: u, value: d, mode: f, onChange: p, fieldId: m, t: h }) {
|
|
13
|
+
let g = c(d), [_, v] = a("");
|
|
14
|
+
if (f === "display") return g.length === 0 ? /* @__PURE__ */ o("span", {
|
|
14
15
|
style: {
|
|
15
16
|
fontSize: 12.5,
|
|
16
17
|
color: "var(--text-4)"
|
|
17
18
|
},
|
|
18
19
|
children: "—"
|
|
19
|
-
}) : /* @__PURE__ */
|
|
20
|
+
}) : /* @__PURE__ */ o("div", {
|
|
20
21
|
style: {
|
|
21
22
|
display: "flex",
|
|
22
23
|
flexWrap: "wrap",
|
|
23
24
|
gap: 4
|
|
24
25
|
},
|
|
25
|
-
children:
|
|
26
|
+
children: g.map((e, t) => /* @__PURE__ */ o(n, {
|
|
26
27
|
tone: "slate",
|
|
27
28
|
children: e
|
|
28
29
|
}, t))
|
|
29
30
|
});
|
|
30
|
-
let
|
|
31
|
-
let e =
|
|
31
|
+
let y = () => {
|
|
32
|
+
let e = _.trim();
|
|
32
33
|
if (!e) return;
|
|
33
34
|
let t = Number(e);
|
|
34
|
-
!isNaN(t) && Number.isInteger(t) && (
|
|
35
|
-
},
|
|
36
|
-
|
|
35
|
+
!isNaN(t) && Number.isInteger(t) && (p?.([...g, t]), v(""));
|
|
36
|
+
}, b = (e) => {
|
|
37
|
+
p?.(g.filter((t, n) => n !== e));
|
|
37
38
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ s("div", {
|
|
39
40
|
style: {
|
|
40
41
|
display: "flex",
|
|
41
42
|
flexDirection: "column",
|
|
42
43
|
gap: 6
|
|
43
44
|
},
|
|
44
|
-
children: [
|
|
45
|
+
children: [g.length > 0 && /* @__PURE__ */ o("div", {
|
|
45
46
|
style: {
|
|
46
47
|
display: "flex",
|
|
47
48
|
flexWrap: "wrap",
|
|
48
49
|
gap: 4
|
|
49
50
|
},
|
|
50
|
-
children:
|
|
51
|
+
children: g.map((e, t) => /* @__PURE__ */ o(n, {
|
|
51
52
|
tone: "slate",
|
|
52
|
-
onRemove: () =>
|
|
53
|
+
onRemove: () => b(t),
|
|
53
54
|
children: e
|
|
54
55
|
}, t))
|
|
55
|
-
}), /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ s("div", {
|
|
56
57
|
style: {
|
|
57
58
|
display: "flex",
|
|
58
59
|
gap: 4
|
|
59
60
|
},
|
|
60
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ o("div", {
|
|
61
62
|
style: { flex: 1 },
|
|
62
|
-
children: /* @__PURE__ */
|
|
63
|
-
id:
|
|
64
|
-
name:
|
|
65
|
-
"aria-required":
|
|
66
|
-
type: "
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
children: /* @__PURE__ */ o(r, {
|
|
64
|
+
id: m,
|
|
65
|
+
name: u,
|
|
66
|
+
"aria-required": l.required || void 0,
|
|
67
|
+
type: "text",
|
|
68
|
+
inputMode: "numeric",
|
|
69
|
+
value: _,
|
|
70
|
+
onChange: (e) => {
|
|
71
|
+
i(e, !0) && v(e);
|
|
72
|
+
},
|
|
69
73
|
onKeyDown: (e) => {
|
|
70
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
74
|
+
e.key === "Enter" && (e.preventDefault(), y());
|
|
71
75
|
},
|
|
72
|
-
placeholder:
|
|
76
|
+
placeholder: h("field.array.add_number", "Add number…")
|
|
73
77
|
})
|
|
74
|
-
}), /* @__PURE__ */
|
|
75
|
-
icon: /* @__PURE__ */
|
|
76
|
-
onClick:
|
|
77
|
-
children:
|
|
78
|
+
}), /* @__PURE__ */ o(t, {
|
|
79
|
+
icon: /* @__PURE__ */ o(e.plus, { size: 13 }),
|
|
80
|
+
onClick: y,
|
|
81
|
+
children: h("field.array.add", "Add")
|
|
78
82
|
})]
|
|
79
83
|
})]
|
|
80
84
|
});
|
|
81
85
|
}
|
|
82
86
|
//#endregion
|
|
83
|
-
export {
|
|
87
|
+
export { l as IntArrayField };
|
|
@@ -1,64 +1,37 @@
|
|
|
1
1
|
import { coerceDisplayString as e } from "../../lib/display-value.js";
|
|
2
2
|
import { TextInput as t } from "../primitives/Fields.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { isNumberDraft as n, numberTextValue as r } from "../../lib/number-text.js";
|
|
4
|
+
import { useState as i } from "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/fields/NumberField.tsx
|
|
6
|
-
function
|
|
7
|
-
let p =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
color: "var(--text-4)"
|
|
13
|
-
},
|
|
14
|
-
children: "—"
|
|
15
|
-
});
|
|
16
|
-
let e;
|
|
17
|
-
if (m && typeof s == "string") e = n(s, new Intl.NumberFormat(f.language));
|
|
18
|
-
else {
|
|
19
|
-
let t = Number(s);
|
|
20
|
-
e = isNaN(t) ? null : new Intl.NumberFormat(f.language).format(t);
|
|
21
|
-
}
|
|
22
|
-
return e == null ? /* @__PURE__ */ r("span", {
|
|
23
|
-
style: { fontSize: 12.5 },
|
|
24
|
-
children: "—"
|
|
25
|
-
}) : /* @__PURE__ */ i("span", {
|
|
26
|
-
className: "num",
|
|
27
|
-
style: {
|
|
28
|
-
fontSize: 12.5,
|
|
29
|
-
fontVariantNumeric: "tabular-nums"
|
|
30
|
-
},
|
|
31
|
-
children: [e, _ && /* @__PURE__ */ r("span", {
|
|
32
|
-
style: {
|
|
33
|
-
color: "var(--text-3)",
|
|
34
|
-
marginLeft: 4
|
|
35
|
-
},
|
|
36
|
-
children: _
|
|
37
|
-
})]
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return m ? /* @__PURE__ */ r(t, {
|
|
41
|
-
id: d,
|
|
42
|
-
name: o,
|
|
43
|
-
"aria-required": a.required || void 0,
|
|
7
|
+
function o({ field: o, fieldName: l, value: u, onChange: d, fieldId: f }) {
|
|
8
|
+
let p = o.type === "int", m = u == null ? "" : e(u), [h, g] = i(m), [_, v] = i(m);
|
|
9
|
+
return m !== _ && (v(m), c(o, r(h), r(m)) || g(m)), /* @__PURE__ */ a(t, {
|
|
10
|
+
id: f,
|
|
11
|
+
name: l,
|
|
12
|
+
"aria-required": o.required || void 0,
|
|
44
13
|
type: "text",
|
|
45
|
-
inputMode: "decimal",
|
|
46
|
-
|
|
47
|
-
value: s == null ? "" : e(s),
|
|
48
|
-
onChange: (e) => {
|
|
49
|
-
e === "" ? l?.(null) : l?.(e);
|
|
50
|
-
}
|
|
51
|
-
}) : /* @__PURE__ */ r(t, {
|
|
52
|
-
id: d,
|
|
53
|
-
name: o,
|
|
54
|
-
"aria-required": a.required || void 0,
|
|
55
|
-
type: "number",
|
|
56
|
-
step: a.type === "float" ? "0.01" : "1",
|
|
57
|
-
value: s == null ? "" : e(s),
|
|
14
|
+
inputMode: p ? "numeric" : "decimal",
|
|
15
|
+
value: h,
|
|
58
16
|
onChange: (e) => {
|
|
59
|
-
|
|
17
|
+
if (!n(e, p)) return;
|
|
18
|
+
g(e);
|
|
19
|
+
let t = r(e);
|
|
20
|
+
d?.(t == null ? null : s(o, t));
|
|
21
|
+
},
|
|
22
|
+
onBlur: () => {
|
|
23
|
+
let e = r(h) ?? "";
|
|
24
|
+
e !== h && g(e);
|
|
60
25
|
}
|
|
61
26
|
});
|
|
62
27
|
}
|
|
28
|
+
function s(e, t) {
|
|
29
|
+
if (e.type === "decimal") return t;
|
|
30
|
+
let n = Number(t);
|
|
31
|
+
return e.type === "int" && !Number.isSafeInteger(n) ? t : n;
|
|
32
|
+
}
|
|
33
|
+
function c(e, t, n) {
|
|
34
|
+
return t == null || n == null || e.type === "decimal" ? t === n : Number(t) === Number(n);
|
|
35
|
+
}
|
|
63
36
|
//#endregion
|
|
64
|
-
export {
|
|
37
|
+
export { o as NumberField };
|
|
@@ -1,110 +1,71 @@
|
|
|
1
1
|
import { coerceDisplayString as e } from "../../lib/display-value.js";
|
|
2
|
-
import { civilDateAsLocal as t,
|
|
3
|
-
import { specialValueMarker as
|
|
4
|
-
import { Btn as
|
|
5
|
-
import { TextInput as s } from "../primitives/Fields.js";
|
|
2
|
+
import { civilDateAsLocal as t, formatWireDateTime as n } from "../../lib/timestamp.js";
|
|
3
|
+
import { specialValueMarker as r, specialValueMarkerCode as i } from "../../types/schema.js";
|
|
4
|
+
import { Btn as a } from "../primitives/Btn.js";
|
|
5
|
+
import { DateInput as o, TextInput as s } from "../primitives/Fields.js";
|
|
6
6
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/fields/TimestampField.tsx
|
|
8
|
-
var d = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
minute: "2-digit"
|
|
16
|
-
};
|
|
17
|
-
function p(e, n) {
|
|
18
|
-
let r = t(e);
|
|
19
|
-
return r ? new Intl.DateTimeFormat(n, d).format(r) : e;
|
|
20
|
-
}
|
|
21
|
-
function m(e, t, r) {
|
|
22
|
-
return t ? p(e, r) : n(e, f, r);
|
|
23
|
-
}
|
|
24
|
-
function h(e, t, n) {
|
|
25
|
-
if (t) return p(e, n);
|
|
26
|
-
let r = new Date(e);
|
|
27
|
-
return isNaN(r.getTime()) ? e : new Intl.DateTimeFormat(n, f).format(r);
|
|
28
|
-
}
|
|
29
|
-
function g(e) {
|
|
30
|
-
if (e.endsWith("Z")) return "UTC";
|
|
31
|
-
let t = e.match(/([+-]\d{2}:\d{2})$/);
|
|
32
|
-
if (!t) return null;
|
|
33
|
-
let n = t[1].charAt(0), r = parseInt(t[1].substring(1, 3), 10), i = parseInt(t[1].substring(4, 6), 10);
|
|
34
|
-
return r === 0 && i === 0 ? "UTC" : `UTC${n}${r}${i > 0 ? `:${String(i).padStart(2, "0")}` : ""}`;
|
|
35
|
-
}
|
|
36
|
-
function _(e) {
|
|
37
|
-
let t = e.match(/([+-]\d{2}:\d{2})$/), n = e.endsWith("Z"), r = new Date(e);
|
|
38
|
-
if (isNaN(r.getTime())) return "";
|
|
39
|
-
if (n) return `${r.getUTCFullYear()}-${String(r.getUTCMonth() + 1).padStart(2, "0")}-${String(r.getUTCDate()).padStart(2, "0")}T${String(r.getUTCHours()).padStart(2, "0")}:${String(r.getUTCMinutes()).padStart(2, "0")}`;
|
|
8
|
+
var d = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
|
|
9
|
+
function f(e) {
|
|
10
|
+
if (!d.test(e)) return "";
|
|
11
|
+
let t = e.match(/([+-]\d{2}:\d{2})$/), n = new Date(e);
|
|
12
|
+
if (isNaN(n.getTime())) return "";
|
|
13
|
+
if (!t && !e.endsWith("Z")) return e.slice(0, 16).replace(" ", "T");
|
|
14
|
+
let r = 0;
|
|
40
15
|
if (t) {
|
|
41
|
-
let e = t[1].charAt(0) === "+" ? 1 : -1, n = parseInt(t[1].substring(1, 3), 10), i = parseInt(t[1].substring(4, 6), 10)
|
|
42
|
-
|
|
16
|
+
let e = t[1].charAt(0) === "+" ? 1 : -1, n = parseInt(t[1].substring(1, 3), 10), i = parseInt(t[1].substring(4, 6), 10);
|
|
17
|
+
r = e * (n * 60 + i) * 60 * 1e3;
|
|
43
18
|
}
|
|
44
|
-
return
|
|
19
|
+
return new Date(n.getTime() + r).toISOString().slice(0, 16);
|
|
45
20
|
}
|
|
46
|
-
function
|
|
21
|
+
function p(e) {
|
|
22
|
+
if (!d.test(e)) return "";
|
|
47
23
|
let t = new Date(e);
|
|
48
|
-
|
|
24
|
+
if (isNaN(t.getTime())) return "";
|
|
25
|
+
let n = (e) => String(e).padStart(2, "0");
|
|
26
|
+
return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`;
|
|
49
27
|
}
|
|
50
|
-
function
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
color: "var(--text-4)"
|
|
57
|
-
},
|
|
58
|
-
children: "—"
|
|
59
|
-
});
|
|
60
|
-
let t = e(f), n = C ? m(t, S, x.language) : h(t, S, x.language), r = C && !S ? g(t) : null;
|
|
61
|
-
return /* @__PURE__ */ u("span", {
|
|
62
|
-
style: { fontSize: 12.5 },
|
|
63
|
-
children: [n, r && /* @__PURE__ */ l("span", {
|
|
64
|
-
style: {
|
|
65
|
-
marginLeft: 4,
|
|
66
|
-
color: "var(--text-3)"
|
|
67
|
-
},
|
|
68
|
-
children: r
|
|
69
|
-
})]
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
let E = f && w === null ? e(f) : "", D = E ? S ? t(E) ? E : "" : C ? _(E) : v(E) : "";
|
|
73
|
-
return /* @__PURE__ */ u(c, { children: [T.length > 0 && /* @__PURE__ */ l("div", {
|
|
28
|
+
function m(e) {
|
|
29
|
+
let t = /^(\d{2}:\d{2})(?::(\d{2}))?/.exec(e);
|
|
30
|
+
return t ? t[2] && t[2] !== "00" ? `${t[1]}:${t[2]}` : t[1] : "";
|
|
31
|
+
}
|
|
32
|
+
function h({ field: d, fieldName: h, value: g, onChange: _, fieldId: v, t: y }) {
|
|
33
|
+
let b = !!d.timezone, x = i(g), S = d.special_values ?? [], C = g && x === null ? e(g) : "", w = S.length > 0 && /* @__PURE__ */ l("div", {
|
|
74
34
|
role: "group",
|
|
75
|
-
"aria-label":
|
|
35
|
+
"aria-label": h,
|
|
76
36
|
style: {
|
|
77
37
|
display: "flex",
|
|
78
38
|
flexWrap: "wrap",
|
|
79
39
|
gap: 6,
|
|
80
40
|
marginBottom: 6
|
|
81
41
|
},
|
|
82
|
-
children:
|
|
42
|
+
children: S.map((e) => /* @__PURE__ */ l(a, {
|
|
83
43
|
size: "xs",
|
|
84
|
-
active:
|
|
85
|
-
"aria-pressed":
|
|
86
|
-
onClick: () =>
|
|
87
|
-
children:
|
|
44
|
+
active: x === e.code,
|
|
45
|
+
"aria-pressed": x === e.code,
|
|
46
|
+
onClick: () => _?.(x === e.code ? null : r(e.code)),
|
|
47
|
+
children: y(e.label) || e.code
|
|
88
48
|
}, e.code))
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
49
|
+
});
|
|
50
|
+
if (d.type === "time") return /* @__PURE__ */ u(c, { children: [w, /* @__PURE__ */ l(s, {
|
|
51
|
+
id: v,
|
|
52
|
+
name: h,
|
|
53
|
+
"aria-required": d.required || void 0,
|
|
54
|
+
type: "time",
|
|
55
|
+
value: C ? m(C) : "",
|
|
56
|
+
onChange: (e) => _?.(e || null)
|
|
57
|
+
})] });
|
|
58
|
+
let T = d.type === "date" ? "date" : "datetime", E = C ? T === "date" ? t(C) ? C : "" : b ? f(C) : p(C) : null;
|
|
59
|
+
return /* @__PURE__ */ u(c, { children: [w, /* @__PURE__ */ l(o, {
|
|
60
|
+
kind: T,
|
|
61
|
+
id: v,
|
|
62
|
+
name: h,
|
|
63
|
+
ariaRequired: d.required,
|
|
64
|
+
value: E,
|
|
65
|
+
onChange: (e, t) => {
|
|
66
|
+
e === null ? _?.(t.trim() === "" ? null : t) : _?.(T === "date" || b ? e : n(new Date(e)));
|
|
106
67
|
}
|
|
107
68
|
})] });
|
|
108
69
|
}
|
|
109
70
|
//#endregion
|
|
110
|
-
export {
|
|
71
|
+
export { h as TimestampField };
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { coerceDisplayString as e } from "../../../../lib/display-value.js";
|
|
2
|
-
import {
|
|
2
|
+
import { formatCivilDateText as t } from "../../../../lib/date-text.js";
|
|
3
|
+
import { EMPTY_CELL as n } from "./emptyCell.js";
|
|
3
4
|
//#region src/components/fields/cells/factories/date.ts
|
|
4
|
-
var
|
|
5
|
-
if (
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, r = ({ t: n }) => {
|
|
11
|
-
let r = new Intl.DateTimeFormat(n.language, {
|
|
5
|
+
var r = () => (n) => {
|
|
6
|
+
if (n == null || n === "") return "—";
|
|
7
|
+
let r = typeof n == "string" ? n : e(n);
|
|
8
|
+
return t(r) ?? r;
|
|
9
|
+
}, i = ({ t }) => {
|
|
10
|
+
let r = new Intl.DateTimeFormat(t.language, {
|
|
12
11
|
hour: "numeric",
|
|
13
12
|
minute: "2-digit",
|
|
14
13
|
timeZone: "UTC"
|
|
15
|
-
}), i = new Intl.DateTimeFormat(
|
|
14
|
+
}), i = new Intl.DateTimeFormat(t.language, {
|
|
16
15
|
hour: "numeric",
|
|
17
16
|
minute: "2-digit",
|
|
18
17
|
second: "2-digit",
|
|
19
18
|
timeZone: "UTC"
|
|
20
19
|
});
|
|
21
|
-
return (
|
|
22
|
-
if (
|
|
23
|
-
let a = typeof
|
|
20
|
+
return (t) => {
|
|
21
|
+
if (t == null || t === "") return n;
|
|
22
|
+
let a = typeof t == "string" ? t : e(t), o = /^(\d{2}):(\d{2})(?::(\d{2}))?/.exec(a);
|
|
24
23
|
if (!o) return a;
|
|
25
24
|
let [, s, c, l = "00"] = o, u = new Date(Date.UTC(2e3, 0, 1, Number(s), Number(c), Number(l)));
|
|
26
25
|
return (l === "00" ? r : i).format(u);
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
28
|
//#endregion
|
|
30
|
-
export {
|
|
29
|
+
export { r as dateFactory, i as timeFactory };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EMPTY_CELL as e } from "./emptyCell.js";
|
|
2
|
+
import { formatDecimalText as t } from "../../../../lib/decimal-text.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/fields/cells/factories/number.tsx
|
|
5
5
|
var i = {
|
|
@@ -15,12 +15,12 @@ var i = {
|
|
|
15
15
|
maximumFractionDigits: Math.min(c.scale ?? 2, 6)
|
|
16
16
|
}), p = c.type === "decimal", m = c.unit ? c.unit.display || c.unit.storage : void 0;
|
|
17
17
|
return (s, c) => {
|
|
18
|
-
if (s == null) return
|
|
18
|
+
if (s == null) return e;
|
|
19
19
|
let u = c.$units?.[l] || (m && !m.startsWith("$") ? m : void 0), h;
|
|
20
20
|
if (f) {
|
|
21
21
|
let e = Number(s);
|
|
22
22
|
h = Number.isFinite(e) ? f.format(e) : null;
|
|
23
|
-
} else if (p && typeof s == "string") h =
|
|
23
|
+
} else if (p && typeof s == "string") h = t(s, d);
|
|
24
24
|
else {
|
|
25
25
|
let e = typeof s == "number" ? s : Number(s);
|
|
26
26
|
h = Number.isFinite(e) ? d.format(e) : null;
|
|
@@ -123,7 +123,7 @@ function v(v) {
|
|
|
123
123
|
]), $ = C === "display";
|
|
124
124
|
return !D && O !== "uploading" ? /* @__PURE__ */ g("div", {
|
|
125
125
|
"data-testid": `file-widget-${b}`,
|
|
126
|
-
className: "flex items-center gap-3 rounded-md border border-dashed border-border bg-surface p-3",
|
|
126
|
+
className: $ ? "flex items-center gap-3" : "flex items-center gap-3 rounded-md border border-dashed border-border bg-surface p-3",
|
|
127
127
|
children: [
|
|
128
128
|
/* @__PURE__ */ h(_, {}),
|
|
129
129
|
/* @__PURE__ */ g("div", {
|