@declarion/react 0.358.0 → 0.359.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/components/fields/ErrorField.js +27 -0
- package/dist-lib/components/fields/JsonField.js +101 -57
- package/dist-lib/components/fields/cells/factories/errorTitle.js +11 -0
- package/dist-lib/components/fields/cells/factories/json.js +1 -0
- package/dist-lib/components/fields/cells/registry.js +8 -6
- package/dist-lib/components/fields/index.js +53 -51
- package/dist-lib/components/list/QuickPeek.js +51 -55
- package/dist-lib/components/pages/list/cardProjection.js +1 -0
- package/dist-lib/components/pages/list/filter-meta.js +44 -41
- package/dist-lib/components/pages/list/useListFilterPresentation.js +25 -22
- package/dist-lib/components/primitives/Avatar.js +1 -1
- package/dist-lib/hooks/useScreenTab.js +20 -8
- package/dist-lib/index.d.ts +4 -2
- package/dist-lib/lib/error-options.js +8 -0
- package/dist-lib/lib/filter-evaluator.js +2 -1
- package/dist-lib/types/fieldType.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Select as e } from "../primitives/Fields.js";
|
|
2
|
+
import { useSchema as t } from "../../hooks/useSchema.js";
|
|
3
|
+
import { useText as n } from "../../hooks/useText.js";
|
|
4
|
+
import { coerceDisplayString as r } from "../../lib/display-value.js";
|
|
5
|
+
import { errorOptions as i } from "../../lib/error-options.js";
|
|
6
|
+
import { EMPTY_CELL as a } from "./cells/factories/emptyCell.js";
|
|
7
|
+
import { Fragment as o, jsx as s } from "react/jsx-runtime";
|
|
8
|
+
// src/components/fields/ErrorField.tsx
|
|
9
|
+
var c = "__declarion_error_null__";
|
|
10
|
+
function l({ field: l, value: u, mode: d, onChange: f, fieldId: p, labelId: m, t: h }) {
|
|
11
|
+
let { data: g } = t(), _ = n("errors"), v = u != null && u !== "" ? r(u) : "";
|
|
12
|
+
if (d === "display") return v ? /* @__PURE__ */ s(o, { children: _(v, v) }) : a;
|
|
13
|
+
let y = [...l.required ? [] : [{
|
|
14
|
+
value: c,
|
|
15
|
+
label: h("field.enum.none", "— None —")
|
|
16
|
+
}], ...i(g?.errors, h)];
|
|
17
|
+
return /* @__PURE__ */ s(e, {
|
|
18
|
+
id: p,
|
|
19
|
+
"aria-labelledby": m,
|
|
20
|
+
"aria-required": l.required || void 0,
|
|
21
|
+
value: v || c,
|
|
22
|
+
options: y,
|
|
23
|
+
onChange: (e) => f?.(e === c ? null : e),
|
|
24
|
+
placeholder: h("field.select_placeholder", "Select…")
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export { l as ErrorField };
|
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
import { IconBtn as e } from "../primitives/IconBtn.js";
|
|
2
2
|
import { Icon as t } from "../primitives/Icons.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useSchema as n } from "../../hooks/useSchema.js";
|
|
4
|
+
import { useText as r } from "../../hooks/useText.js";
|
|
5
|
+
import { coerceDisplayString as i } from "../../lib/display-value.js";
|
|
6
|
+
import { Suspense as a, lazy as o, useState as s } from "react";
|
|
7
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
8
|
// src/components/fields/JsonField.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
var d = o(() => import("./JsonEditor.js").then((e) => ({ default: e.JsonEditor })));
|
|
10
|
+
function f() {
|
|
11
|
+
return /* @__PURE__ */ l("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function p(e) {
|
|
13
14
|
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function m(e) {
|
|
16
17
|
return Array.isArray(e) && e.every((e) => [
|
|
17
18
|
"string",
|
|
18
19
|
"number",
|
|
19
20
|
"boolean"
|
|
20
21
|
].includes(typeof e));
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
23
|
+
function h({ value: e, mode: t, onChange: n, fieldId: r, entityCode: i, fieldName: o }) {
|
|
24
|
+
let s = T(i, o);
|
|
25
|
+
return t === "display" ? p(e) ? /* @__PURE__ */ l("span", {
|
|
24
26
|
style: {
|
|
25
27
|
fontSize: 12.5,
|
|
26
28
|
color: "var(--text-4)"
|
|
27
29
|
},
|
|
28
30
|
children: "—"
|
|
29
|
-
}) :
|
|
31
|
+
}) : s && typeof e == "object" && !Array.isArray(e) ? /* @__PURE__ */ l(D, {
|
|
32
|
+
value: e,
|
|
33
|
+
body: /* @__PURE__ */ l(E, { value: e })
|
|
34
|
+
}) : m(e) ? /* @__PURE__ */ l("ul", {
|
|
30
35
|
className: "mono",
|
|
31
36
|
style: {
|
|
32
37
|
margin: 0,
|
|
@@ -35,17 +40,17 @@ function m({ value: e, mode: t, onChange: n, fieldId: r }) {
|
|
|
35
40
|
fontSize: 12.5,
|
|
36
41
|
lineHeight: 1.7
|
|
37
42
|
},
|
|
38
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
39
|
-
}) : /* @__PURE__ */
|
|
40
|
-
fallback: /* @__PURE__ */
|
|
41
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: e.map((e, t) => /* @__PURE__ */ l("li", { children: String(e) }, t))
|
|
44
|
+
}) : /* @__PURE__ */ l(D, { value: e }) : /* @__PURE__ */ l(a, {
|
|
45
|
+
fallback: /* @__PURE__ */ l(f, {}),
|
|
46
|
+
children: /* @__PURE__ */ l(d, {
|
|
42
47
|
value: e,
|
|
43
48
|
onChange: n,
|
|
44
49
|
id: r
|
|
45
50
|
})
|
|
46
51
|
});
|
|
47
52
|
}
|
|
48
|
-
var
|
|
53
|
+
var g = {
|
|
49
54
|
display: "flex",
|
|
50
55
|
flexDirection: "column",
|
|
51
56
|
gap: 6,
|
|
@@ -53,72 +58,103 @@ var h = {
|
|
|
53
58
|
borderRadius: "var(--radius-md)",
|
|
54
59
|
padding: 12,
|
|
55
60
|
background: "var(--surface-2)"
|
|
56
|
-
},
|
|
61
|
+
}, _ = {
|
|
57
62
|
display: "flex",
|
|
58
63
|
flexDirection: "column",
|
|
59
64
|
gap: 8
|
|
60
|
-
},
|
|
65
|
+
}, v = {
|
|
61
66
|
display: "flex",
|
|
62
67
|
flexWrap: "wrap",
|
|
63
68
|
alignItems: "baseline",
|
|
64
69
|
gap: 8
|
|
65
|
-
},
|
|
70
|
+
}, y = {
|
|
66
71
|
fontSize: 11.5,
|
|
67
72
|
fontWeight: 500,
|
|
68
73
|
color: "var(--text-3)",
|
|
69
74
|
width: 120,
|
|
70
75
|
flexShrink: 0,
|
|
71
76
|
overflowWrap: "anywhere"
|
|
72
|
-
},
|
|
73
|
-
...
|
|
77
|
+
}, b = {
|
|
78
|
+
..._,
|
|
74
79
|
paddingLeft: 10,
|
|
75
80
|
borderLeft: "2px solid var(--border)"
|
|
76
|
-
},
|
|
81
|
+
}, x = {
|
|
77
82
|
minWidth: 0,
|
|
78
83
|
flex: "1 1 14rem",
|
|
79
84
|
fontSize: 12.5,
|
|
80
85
|
overflowWrap: "anywhere"
|
|
81
|
-
},
|
|
86
|
+
}, S = {
|
|
82
87
|
display: "flex",
|
|
83
88
|
justifyContent: "flex-end"
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
}, C = {
|
|
90
|
+
fontSize: 12.5,
|
|
91
|
+
fontWeight: 500
|
|
92
|
+
}, w = /* @__PURE__ */ new Set([
|
|
93
|
+
"type",
|
|
94
|
+
"status",
|
|
95
|
+
"title",
|
|
96
|
+
"detail",
|
|
97
|
+
"instance",
|
|
98
|
+
"retryable"
|
|
99
|
+
]);
|
|
100
|
+
function T(e, t) {
|
|
101
|
+
let { data: r } = n(), i = e ? r?.entities[e] : void 0;
|
|
102
|
+
return i ? [...i.fields].some(([, e]) => e.type === "error" && e.source === `$row.${t}.type`) : !1;
|
|
103
|
+
}
|
|
104
|
+
function E({ value: e }) {
|
|
105
|
+
let t = r("errors"), n = typeof e.type == "string" ? e.type : "", i = n.startsWith("/errors/") ? n.slice(8) : n, a = Object.fromEntries(Object.entries(e).filter(([e]) => !w.has(e)));
|
|
106
|
+
return /* @__PURE__ */ u("div", {
|
|
107
|
+
style: _,
|
|
108
|
+
children: [
|
|
109
|
+
i ? /* @__PURE__ */ l("span", {
|
|
110
|
+
style: C,
|
|
111
|
+
children: t(i, i)
|
|
112
|
+
}) : null,
|
|
113
|
+
typeof e.detail == "string" && e.detail ? /* @__PURE__ */ l("span", {
|
|
114
|
+
style: x,
|
|
115
|
+
children: e.detail
|
|
116
|
+
}) : null,
|
|
117
|
+
Object.keys(a).length > 0 ? /* @__PURE__ */ l(O, { value: a }) : null
|
|
118
|
+
]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function D({ value: n, body: i }) {
|
|
122
|
+
let o = r(), [c, p] = s(!1), m = c ? o("field.json.hide_source", "Hide JSON") : o("field.json.show_source", "Show JSON");
|
|
123
|
+
return /* @__PURE__ */ u("div", {
|
|
124
|
+
style: g,
|
|
125
|
+
children: [/* @__PURE__ */ l("div", {
|
|
126
|
+
style: S,
|
|
127
|
+
children: /* @__PURE__ */ l(e, {
|
|
92
128
|
size: 22,
|
|
93
|
-
icon: /* @__PURE__ */
|
|
129
|
+
icon: /* @__PURE__ */ l(t.code, { size: 13 }),
|
|
94
130
|
onClick: (e) => {
|
|
95
|
-
e.stopPropagation(),
|
|
131
|
+
e.stopPropagation(), p((e) => !e);
|
|
96
132
|
},
|
|
97
|
-
title:
|
|
98
|
-
"aria-label":
|
|
99
|
-
"aria-pressed":
|
|
133
|
+
title: m,
|
|
134
|
+
"aria-label": m,
|
|
135
|
+
"aria-pressed": c
|
|
100
136
|
})
|
|
101
|
-
}),
|
|
102
|
-
fallback: /* @__PURE__ */
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
-
value:
|
|
137
|
+
}), c ? /* @__PURE__ */ l(a, {
|
|
138
|
+
fallback: /* @__PURE__ */ l(f, {}),
|
|
139
|
+
children: /* @__PURE__ */ l(d, {
|
|
140
|
+
value: n,
|
|
105
141
|
readOnly: !0
|
|
106
142
|
})
|
|
107
|
-
}) : /* @__PURE__ */
|
|
143
|
+
}) : i ?? /* @__PURE__ */ l(k, { value: n })]
|
|
108
144
|
});
|
|
109
145
|
}
|
|
110
|
-
function
|
|
146
|
+
function O({ value: e, nested: t }) {
|
|
111
147
|
let n = Array.isArray(e) ? e.map((e, t) => [String(t + 1), e]) : Object.entries(e);
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
style: t ?
|
|
114
|
-
children: n.map(([e, t]) => /* @__PURE__ */
|
|
115
|
-
style:
|
|
116
|
-
children: [/* @__PURE__ */
|
|
117
|
-
style:
|
|
148
|
+
return /* @__PURE__ */ l("div", {
|
|
149
|
+
style: t ? b : _,
|
|
150
|
+
children: n.map(([e, t]) => /* @__PURE__ */ u("div", {
|
|
151
|
+
style: v,
|
|
152
|
+
children: [/* @__PURE__ */ l("span", {
|
|
153
|
+
style: y,
|
|
118
154
|
children: e
|
|
119
|
-
}), /* @__PURE__ */
|
|
120
|
-
style:
|
|
121
|
-
children: /* @__PURE__ */
|
|
155
|
+
}), /* @__PURE__ */ l("div", {
|
|
156
|
+
style: x,
|
|
157
|
+
children: /* @__PURE__ */ l(k, {
|
|
122
158
|
value: t,
|
|
123
159
|
nested: !0
|
|
124
160
|
})
|
|
@@ -126,13 +162,21 @@ function C({ value: e, nested: t }) {
|
|
|
126
162
|
}, e))
|
|
127
163
|
});
|
|
128
164
|
}
|
|
129
|
-
function
|
|
130
|
-
|
|
165
|
+
function k({ value: e, nested: t }) {
|
|
166
|
+
let n = r();
|
|
167
|
+
return p(e) ? /* @__PURE__ */ l("span", {
|
|
131
168
|
style: { color: "var(--text-4)" },
|
|
132
169
|
children: "—"
|
|
133
|
-
}) :
|
|
170
|
+
}) : m(e) ? /* @__PURE__ */ l(c, { children: e.map((e) => A(e, n.language)).join(", ") }) : typeof e == "object" ? /* @__PURE__ */ l(O, {
|
|
134
171
|
value: e,
|
|
135
172
|
nested: t
|
|
136
|
-
}) : /* @__PURE__ */ c
|
|
173
|
+
}) : /* @__PURE__ */ l(c, { children: A(e, n.language) });
|
|
174
|
+
}
|
|
175
|
+
function A(e, t) {
|
|
176
|
+
if (typeof e == "number" && Number.isFinite(e) && !Number.isInteger(e)) {
|
|
177
|
+
let n = Math.abs(e) < 1 ? { maximumSignificantDigits: 4 } : { maximumFractionDigits: 4 };
|
|
178
|
+
return new Intl.NumberFormat(t, n).format(e);
|
|
179
|
+
}
|
|
180
|
+
return i(e);
|
|
137
181
|
}
|
|
138
|
-
export {
|
|
182
|
+
export { h as JsonField, p as isEmptyJsonValue };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useText as e } from "../../../../hooks/useText.js";
|
|
2
|
+
import { coerceDisplayString as t } from "../../../../lib/display-value.js";
|
|
3
|
+
import { EMPTY_CELL as n } from "./emptyCell.js";
|
|
4
|
+
import { Fragment as r, jsx as i } from "react/jsx-runtime";
|
|
5
|
+
// src/components/fields/cells/factories/errorTitle.tsx
|
|
6
|
+
function a({ code: t }) {
|
|
7
|
+
let n = e("errors");
|
|
8
|
+
return /* @__PURE__ */ i(r, { children: n(t, t) });
|
|
9
|
+
}
|
|
10
|
+
var o = () => (e) => e == null || e === "" ? n : /* @__PURE__ */ i(a, { code: t(e) });
|
|
11
|
+
export { o as errorFactory };
|
|
@@ -21,8 +21,9 @@ import { passwordMaskFactory as x } from "./factories/passwordMask.js";
|
|
|
21
21
|
import { richTextPreviewFactory as S } from "./factories/richTextPreview.js";
|
|
22
22
|
import { multilangInlineFactory as C } from "./factories/multilangInline.js";
|
|
23
23
|
import { fileReferenceFactory as w } from "./factories/fileReference.js";
|
|
24
|
+
import { errorFactory as T } from "./factories/errorTitle.js";
|
|
24
25
|
// src/components/fields/cells/registry.ts
|
|
25
|
-
var
|
|
26
|
+
var E = {
|
|
26
27
|
text: e,
|
|
27
28
|
bool_pill: t,
|
|
28
29
|
badge: n,
|
|
@@ -48,12 +49,13 @@ var T = {
|
|
|
48
49
|
markdown: b,
|
|
49
50
|
password_mask: x,
|
|
50
51
|
rich_text_preview: S,
|
|
51
|
-
multilang_inline: C
|
|
52
|
+
multilang_inline: C,
|
|
53
|
+
error: T
|
|
52
54
|
};
|
|
53
|
-
Object.keys(
|
|
54
|
-
function
|
|
55
|
-
let t = e.field.display?.widget ?? "text", n =
|
|
55
|
+
Object.keys(E).sort();
|
|
56
|
+
function D(e) {
|
|
57
|
+
let t = e.field.display?.widget ?? "text", n = E[t];
|
|
56
58
|
if (!n) throw Error(`resolveCellRenderer: no factory registered for widget "${t}" (field "${e.fieldName}"). The engine must stamp a smart default at YAML-load time; an unknown widget here indicates an out-of-sync allow-list.`);
|
|
57
59
|
return n(e);
|
|
58
60
|
}
|
|
59
|
-
export {
|
|
61
|
+
export { D as resolveCellRenderer };
|
|
@@ -2,69 +2,71 @@ import { FIELD_TYPES as e } from "../../types/fieldType.js";
|
|
|
2
2
|
import { StringField as t } from "./StringField.js";
|
|
3
3
|
import { TextField as n } from "./TextField.js";
|
|
4
4
|
import { EnumField as r } from "./EnumField.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
5
|
+
import { ErrorField as i } from "./ErrorField.js";
|
|
6
|
+
import { EmailField as a } from "./EmailField.js";
|
|
7
|
+
import { UrlField as o } from "./UrlField.js";
|
|
8
|
+
import { PhoneField as s } from "./PhoneField.js";
|
|
9
|
+
import { TimestampField as c } from "./TimestampField.js";
|
|
10
|
+
import { BoolField as l } from "./BoolField.js";
|
|
11
|
+
import { NumberField as u } from "./NumberField.js";
|
|
12
|
+
import { RefField as d } from "./RefField.js";
|
|
13
|
+
import { JsonField as f } from "./JsonField.js";
|
|
14
|
+
import { MultilangField as p } from "./MultilangField.js";
|
|
15
|
+
import { MultilangTextField as m } from "./MultilangTextField.js";
|
|
16
|
+
import { MultilangArrayField as h } from "./MultilangArrayField.js";
|
|
17
|
+
import { StructureField as g } from "./StructureField.js";
|
|
18
|
+
import { SecretField as _ } from "./SecretField.js";
|
|
19
|
+
import { PasswordField as v } from "./PasswordField.js";
|
|
20
|
+
import { StringArrayField as y } from "./StringArrayField.js";
|
|
21
|
+
import { IntArrayField as b } from "./IntArrayField.js";
|
|
22
|
+
import { RichTextField as x } from "./RichTextField.js";
|
|
23
|
+
import { FileReferenceField as S } from "./FileReferenceField.js";
|
|
24
|
+
import { resolveCellRenderer as C } from "./cells/registry.js";
|
|
25
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
25
26
|
// src/components/fields/index.tsx
|
|
26
|
-
var
|
|
27
|
+
var T = {
|
|
27
28
|
string: t,
|
|
28
29
|
text: n,
|
|
29
|
-
rich_text:
|
|
30
|
-
int:
|
|
31
|
-
float:
|
|
32
|
-
decimal:
|
|
33
|
-
bool:
|
|
34
|
-
timestamp:
|
|
35
|
-
date:
|
|
36
|
-
time:
|
|
30
|
+
rich_text: x,
|
|
31
|
+
int: u,
|
|
32
|
+
float: u,
|
|
33
|
+
decimal: u,
|
|
34
|
+
bool: l,
|
|
35
|
+
timestamp: c,
|
|
36
|
+
date: c,
|
|
37
|
+
time: c,
|
|
37
38
|
enum: r,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
error: i,
|
|
40
|
+
email: a,
|
|
41
|
+
url: o,
|
|
42
|
+
phone: s,
|
|
41
43
|
uuid: t,
|
|
42
44
|
bytes: t,
|
|
43
|
-
ref:
|
|
44
|
-
file_ref:
|
|
45
|
+
ref: d,
|
|
46
|
+
file_ref: S,
|
|
45
47
|
folder_ref: t,
|
|
46
|
-
json:
|
|
48
|
+
json: f,
|
|
47
49
|
tags: t,
|
|
48
|
-
string_array:
|
|
49
|
-
int_array:
|
|
50
|
-
uuid_array:
|
|
51
|
-
multilang:
|
|
52
|
-
multilang_text:
|
|
53
|
-
multilang_array:
|
|
54
|
-
structure:
|
|
55
|
-
secret:
|
|
56
|
-
password:
|
|
50
|
+
string_array: y,
|
|
51
|
+
int_array: b,
|
|
52
|
+
uuid_array: y,
|
|
53
|
+
multilang: p,
|
|
54
|
+
multilang_text: m,
|
|
55
|
+
multilang_array: h,
|
|
56
|
+
structure: g,
|
|
57
|
+
secret: _,
|
|
58
|
+
password: v
|
|
57
59
|
};
|
|
58
|
-
for (let t of e) if (!
|
|
59
|
-
function
|
|
60
|
-
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */
|
|
60
|
+
for (let t of e) if (!T[t]) throw Error(`editRegistry: missing entry for FieldType "${t}". The FieldType union and editRegistry must cover every field type the server declares.`);
|
|
61
|
+
function E(e) {
|
|
62
|
+
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ w(g, { ...e });
|
|
61
63
|
if (e.mode === "edit") {
|
|
62
|
-
let t =
|
|
64
|
+
let t = T[e.field.type];
|
|
63
65
|
if (!t) throw Error(`renderField: no edit-mode renderer for FieldType "${e.field.type}" (field "${e.fieldName}"). editRegistry must be total over FieldType; check types/fieldType.ts and components/fields/index.tsx.`);
|
|
64
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ w(t, { ...e });
|
|
65
67
|
}
|
|
66
68
|
if (!e.field.display?.widget) throw Error(`renderField: display mode requires a non-empty field.display.widget (field "${e.fieldName}", type "${e.field.type}"). The engine must stamp a smart default; an empty widget here means the field bypassed ResolveDefaultWidgets.`);
|
|
67
|
-
return
|
|
69
|
+
return C({
|
|
68
70
|
field: e.field,
|
|
69
71
|
fieldName: e.fieldName,
|
|
70
72
|
surface: e.surface ?? "detail",
|
|
@@ -77,4 +79,4 @@ function T(e) {
|
|
|
77
79
|
detailScreen: e.detailScreen
|
|
78
80
|
})(e.value, e.record ?? {});
|
|
79
81
|
}
|
|
80
|
-
export {
|
|
82
|
+
export { T as editRegistry, E as renderField };
|
|
@@ -20,43 +20,43 @@ var w = {
|
|
|
20
20
|
tab: "Tab",
|
|
21
21
|
esc: "Esc"
|
|
22
22
|
};
|
|
23
|
-
function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarName: j, fields: M, refs: N, screen:
|
|
24
|
-
let
|
|
25
|
-
h(
|
|
26
|
-
let
|
|
23
|
+
function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarName: j, fields: M, refs: N, screen: te, actions: P, screenActionLayout: F, entityActionLayout: I, executeAction: L, onClose: R, onOpen: z, onSave: B }) {
|
|
24
|
+
let V = p(), H = m(T), [U, W] = b({ ...O }), [G, K] = b(!1);
|
|
25
|
+
h(G);
|
|
26
|
+
let q = y(null), { run: J } = a(), Y = d(T, te, U);
|
|
27
27
|
_(() => {
|
|
28
|
-
|
|
28
|
+
W({ ...O }), K(!1);
|
|
29
29
|
}, [O]), _(() => {
|
|
30
|
-
|
|
30
|
+
q.current?.focus();
|
|
31
31
|
}, []);
|
|
32
|
-
let
|
|
33
|
-
let e =
|
|
34
|
-
return s(
|
|
32
|
+
let X = v(() => {
|
|
33
|
+
let e = Y?.action_layout ?? F ?? I ?? c(P, "quick_peek"), t = l(e, P, void 0, "quick_peek");
|
|
34
|
+
return s(V, t, P, void 0, U, [], H, f(T, U));
|
|
35
35
|
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
I,
|
|
39
|
-
L,
|
|
36
|
+
V,
|
|
37
|
+
Y?.action_layout,
|
|
40
38
|
F,
|
|
41
|
-
|
|
39
|
+
I,
|
|
40
|
+
P,
|
|
41
|
+
U,
|
|
42
42
|
T,
|
|
43
|
-
|
|
44
|
-
]),
|
|
45
|
-
|
|
43
|
+
H
|
|
44
|
+
]), Z = ({ code: e, action: t }) => {
|
|
45
|
+
J({
|
|
46
46
|
action: t,
|
|
47
|
-
title:
|
|
48
|
-
row:
|
|
49
|
-
execute: (n) =>
|
|
47
|
+
title: V(t.display?.name) || e,
|
|
48
|
+
row: U,
|
|
49
|
+
execute: (n) => L(e, t, n)
|
|
50
50
|
});
|
|
51
|
-
},
|
|
51
|
+
}, Q = (e, t) => {
|
|
52
52
|
let n = {
|
|
53
|
-
...
|
|
53
|
+
...U,
|
|
54
54
|
[e]: t
|
|
55
55
|
};
|
|
56
|
-
|
|
57
|
-
},
|
|
56
|
+
W(n), K(!0), B?.(n);
|
|
57
|
+
}, ne = Y?.quick_peek?.width ?? 480, $ = M.some((e) => !e.readOnly);
|
|
58
58
|
return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("div", {
|
|
59
|
-
onClick:
|
|
59
|
+
onClick: R,
|
|
60
60
|
style: {
|
|
61
61
|
position: "fixed",
|
|
62
62
|
inset: 0,
|
|
@@ -64,19 +64,19 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
64
64
|
zIndex: 40
|
|
65
65
|
}
|
|
66
66
|
}), /* @__PURE__ */ C("aside", {
|
|
67
|
-
ref:
|
|
67
|
+
ref: q,
|
|
68
68
|
role: "dialog",
|
|
69
|
-
"aria-label":
|
|
69
|
+
"aria-label": V("list.peek.dialog", "Quick peek"),
|
|
70
70
|
tabIndex: -1,
|
|
71
71
|
onKeyDown: (e) => {
|
|
72
|
-
e.key === "Escape" &&
|
|
72
|
+
e.key === "Escape" && R();
|
|
73
73
|
},
|
|
74
74
|
style: {
|
|
75
75
|
position: "fixed",
|
|
76
76
|
top: "var(--topbar-h)",
|
|
77
77
|
right: 0,
|
|
78
78
|
bottom: "var(--tabbar-h)",
|
|
79
|
-
width:
|
|
79
|
+
width: ne,
|
|
80
80
|
background: "var(--surface)",
|
|
81
81
|
borderLeft: "1px solid var(--border)",
|
|
82
82
|
zIndex: 41,
|
|
@@ -124,13 +124,13 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
124
124
|
}),
|
|
125
125
|
/* @__PURE__ */ S(r, {
|
|
126
126
|
icon: /* @__PURE__ */ S(n.external, { size: 13 }),
|
|
127
|
-
title:
|
|
128
|
-
onClick: () =>
|
|
127
|
+
title: G ? V("list.peek.open_in_tab_dirty", "Open in tab (keeps unsaved changes)") : V("list.peek.open_in_tab", "Open in tab"),
|
|
128
|
+
onClick: () => z(G ? U : null)
|
|
129
129
|
}),
|
|
130
130
|
/* @__PURE__ */ S(r, {
|
|
131
131
|
icon: /* @__PURE__ */ S(n.x, { size: 14 }),
|
|
132
|
-
title:
|
|
133
|
-
onClick:
|
|
132
|
+
title: V("list.peek.close", "Close"),
|
|
133
|
+
onClick: R
|
|
134
134
|
})
|
|
135
135
|
]
|
|
136
136
|
}),
|
|
@@ -154,35 +154,31 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
154
154
|
alignItems: "center",
|
|
155
155
|
gap: 6
|
|
156
156
|
},
|
|
157
|
-
children: [
|
|
158
|
-
/* @__PURE__ */ S(n.sparkle, { size: 12 }),
|
|
159
|
-
" ",
|
|
160
|
-
H("list.peek.hint", "Inline quick-edit — click any field to change.")
|
|
161
|
-
] }), g(H("list.peek.keys_hint", "{tab} to move, {esc} to close."), {
|
|
157
|
+
children: [$ && /* @__PURE__ */ S(n.sparkle, { size: 12 }), /* @__PURE__ */ C("span", { children: [$ && /* @__PURE__ */ C(x, { children: [V("list.peek.hint", "Inline quick-edit — click any field to change."), " "] }), g(V("list.peek.keys_hint", "{tab} to move, {esc} to close."), {
|
|
162
158
|
tab: /* @__PURE__ */ S(i, { children: w.tab }),
|
|
163
159
|
esc: /* @__PURE__ */ S(i, { children: w.esc })
|
|
164
|
-
})]
|
|
160
|
+
})] })]
|
|
165
161
|
}), M.map((e) => /* @__PURE__ */ S(E, {
|
|
166
162
|
label: e.label,
|
|
167
163
|
children: e.kind === "file" ? ee({
|
|
168
164
|
entity: T,
|
|
169
165
|
entityCode: D,
|
|
170
166
|
fieldName: e.key,
|
|
171
|
-
record:
|
|
167
|
+
record: U,
|
|
172
168
|
mode: e.readOnly ? "display" : "edit",
|
|
173
|
-
onChange: (t) =>
|
|
169
|
+
onChange: (t) => Q(e.key, t),
|
|
174
170
|
refs: N,
|
|
175
171
|
disabled: e.readOnly,
|
|
176
|
-
t:
|
|
172
|
+
t: V
|
|
177
173
|
}) : /* @__PURE__ */ S(o, {
|
|
178
174
|
field: e.field,
|
|
179
175
|
fieldName: e.key,
|
|
180
176
|
label: e.label,
|
|
181
|
-
value:
|
|
182
|
-
record:
|
|
177
|
+
value: U[e.key],
|
|
178
|
+
record: U,
|
|
183
179
|
refs: N,
|
|
184
180
|
readOnly: e.readOnly,
|
|
185
|
-
onCommit: (t) =>
|
|
181
|
+
onCommit: (t) => Q(e.key, t)
|
|
186
182
|
})
|
|
187
183
|
}, e.key))]
|
|
188
184
|
}),
|
|
@@ -195,7 +191,7 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
195
191
|
alignItems: "center"
|
|
196
192
|
},
|
|
197
193
|
children: [
|
|
198
|
-
|
|
194
|
+
G && /* @__PURE__ */ C("span", {
|
|
199
195
|
style: {
|
|
200
196
|
fontSize: 11,
|
|
201
197
|
color: "var(--warn)",
|
|
@@ -208,7 +204,7 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
208
204
|
height: 6,
|
|
209
205
|
borderRadius: 999,
|
|
210
206
|
background: "var(--warn)"
|
|
211
|
-
} }),
|
|
207
|
+
} }), V("list.peek.unsaved", "Unsaved")]
|
|
212
208
|
}),
|
|
213
209
|
/* @__PURE__ */ S("div", {
|
|
214
210
|
style: {
|
|
@@ -217,24 +213,24 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
217
213
|
display: "flex",
|
|
218
214
|
justifyContent: "flex-end"
|
|
219
215
|
},
|
|
220
|
-
children:
|
|
221
|
-
layout:
|
|
222
|
-
row:
|
|
223
|
-
onRun: (e, t) =>
|
|
216
|
+
children: X.length > 0 && /* @__PURE__ */ S(u, {
|
|
217
|
+
layout: X,
|
|
218
|
+
row: U,
|
|
219
|
+
onRun: (e, t) => Z({
|
|
224
220
|
code: e,
|
|
225
221
|
action: t
|
|
226
222
|
}),
|
|
227
223
|
kind: "toolbar",
|
|
228
|
-
entityActions:
|
|
224
|
+
entityActions: P,
|
|
229
225
|
align: "trailing",
|
|
230
|
-
ariaLabel:
|
|
226
|
+
ariaLabel: V("list.peek.actions", "Quick peek actions")
|
|
231
227
|
})
|
|
232
228
|
}),
|
|
233
229
|
/* @__PURE__ */ S(t, {
|
|
234
230
|
kind: "primary",
|
|
235
231
|
icon: /* @__PURE__ */ S(n.edit, { size: 13 }),
|
|
236
|
-
onClick: () =>
|
|
237
|
-
children:
|
|
232
|
+
onClick: () => z(G ? U : null),
|
|
233
|
+
children: V("list.peek.open_full", "Open full")
|
|
238
234
|
})
|
|
239
235
|
]
|
|
240
236
|
})
|
|
@@ -1,74 +1,77 @@
|
|
|
1
1
|
import { effectiveSpecialValues as e, fieldDisplayName as t } from "../../../types/schema.js";
|
|
2
|
+
import { errorOptions as n } from "../../../lib/error-options.js";
|
|
2
3
|
// src/components/pages/list/filter-meta.ts
|
|
3
|
-
function
|
|
4
|
+
function r(e, t, n, r, i) {
|
|
4
5
|
if (!t || !n) return [];
|
|
5
|
-
let
|
|
6
|
-
return
|
|
6
|
+
let o = t.filter_operators ?? {}, s = (t.filters ?? []).filter((e) => o[e]?.length);
|
|
7
|
+
return a({
|
|
7
8
|
t: e,
|
|
8
9
|
screen: t,
|
|
9
10
|
entity: n,
|
|
10
|
-
entities: r
|
|
11
|
-
|
|
11
|
+
entities: r,
|
|
12
|
+
errors: i
|
|
13
|
+
}, s, o);
|
|
12
14
|
}
|
|
13
|
-
function
|
|
14
|
-
return !t || !n ? [] :
|
|
15
|
+
function i(e, t, n, r, i) {
|
|
16
|
+
return !t || !n ? [] : a({
|
|
15
17
|
t: e,
|
|
16
18
|
screen: t,
|
|
17
19
|
entity: n,
|
|
18
|
-
entities: r
|
|
20
|
+
entities: r,
|
|
21
|
+
errors: i
|
|
19
22
|
}, Object.keys(n.filter_operators), n.filter_operators);
|
|
20
23
|
}
|
|
21
|
-
function
|
|
22
|
-
let
|
|
23
|
-
for (let
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
26
|
-
let e =
|
|
24
|
+
function a({ t: r, screen: i, entity: a, entities: o, errors: s }, c, l) {
|
|
25
|
+
let u = [];
|
|
26
|
+
for (let d of c) {
|
|
27
|
+
let c = l[d];
|
|
28
|
+
if (d.startsWith("$status.")) {
|
|
29
|
+
let e = d.slice(8), t = a.status_groups?.[e];
|
|
27
30
|
if (!t) continue;
|
|
28
|
-
|
|
29
|
-
code:
|
|
30
|
-
label:
|
|
31
|
+
u.push({
|
|
32
|
+
code: d,
|
|
33
|
+
label: r(t.name) || e,
|
|
31
34
|
type: "status",
|
|
32
|
-
operators:
|
|
35
|
+
operators: c,
|
|
33
36
|
options: t.statuses.map((e) => ({
|
|
34
37
|
value: e.code,
|
|
35
|
-
label:
|
|
38
|
+
label: r(e.name) || e.code,
|
|
36
39
|
color: e.color
|
|
37
40
|
}))
|
|
38
41
|
});
|
|
39
42
|
continue;
|
|
40
43
|
}
|
|
41
|
-
if (
|
|
42
|
-
let e =
|
|
44
|
+
if (d.startsWith("$property.")) {
|
|
45
|
+
let e = d.slice(10), t = a.properties?.[e];
|
|
43
46
|
if (!t) continue;
|
|
44
|
-
|
|
45
|
-
code:
|
|
46
|
-
label:
|
|
47
|
+
u.push({
|
|
48
|
+
code: d,
|
|
49
|
+
label: r(t.name) || e,
|
|
47
50
|
type: "property",
|
|
48
|
-
operators:
|
|
51
|
+
operators: c
|
|
49
52
|
});
|
|
50
53
|
continue;
|
|
51
54
|
}
|
|
52
|
-
let
|
|
53
|
-
if (!
|
|
54
|
-
let
|
|
55
|
+
let f = a.fields.get(d);
|
|
56
|
+
if (!f) continue;
|
|
57
|
+
let p = t(r, f, d, o), m = f.type === "error" ? n(s, r) : f.values?.map((e) => ({
|
|
55
58
|
value: e.code,
|
|
56
|
-
label:
|
|
59
|
+
label: r(e.name) || e.code,
|
|
57
60
|
color: e.color
|
|
58
|
-
})),
|
|
59
|
-
|
|
60
|
-
code:
|
|
61
|
-
label:
|
|
62
|
-
type:
|
|
63
|
-
operators:
|
|
64
|
-
options:
|
|
65
|
-
ref:
|
|
66
|
-
specialValues:
|
|
61
|
+
})), h = e(f.special_values, i?.special_values?.[d]);
|
|
62
|
+
u.push({
|
|
63
|
+
code: d,
|
|
64
|
+
label: p,
|
|
65
|
+
type: f.type,
|
|
66
|
+
operators: c,
|
|
67
|
+
options: m,
|
|
68
|
+
ref: f.ref,
|
|
69
|
+
specialValues: h.length > 0 ? h : void 0
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
|
-
return
|
|
72
|
+
return u;
|
|
70
73
|
}
|
|
71
|
-
function
|
|
74
|
+
function o(e, n, r, i) {
|
|
72
75
|
if (i.startsWith("$status.")) {
|
|
73
76
|
let t = n.status_groups?.[i.slice(8)];
|
|
74
77
|
return t && e(t.name) || i;
|
|
@@ -80,4 +83,4 @@ function a(e, n, r, i) {
|
|
|
80
83
|
let a = n.fields.get(i);
|
|
81
84
|
return a ? t(e, a, i, r) : i;
|
|
82
85
|
}
|
|
83
|
-
export {
|
|
86
|
+
export { i as buildFilterDisplayMeta, r as buildFilterFieldMeta, o as filterFieldLabel };
|
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
import { useText as e } from "../../../hooks/useText.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useSchema as t } from "../../../hooks/useSchema.js";
|
|
3
|
+
import { useJsonSnapshot as n } from "../../../hooks/useJsonSnapshot.js";
|
|
4
|
+
import { buildFilterDisplayMeta as r, buildFilterFieldMeta as i, filterFieldLabel as a } from "./filter-meta.js";
|
|
5
|
+
import { visibleFilters as o } from "./visible-filters.js";
|
|
6
|
+
import { useCallback as s, useMemo as c } from "react";
|
|
6
7
|
// src/components/pages/list/useListFilterPresentation.ts
|
|
7
|
-
function
|
|
8
|
-
let
|
|
8
|
+
function l(l, u, d, f) {
|
|
9
|
+
let p = e(), m = t().data?.errors, h = n(f);
|
|
9
10
|
return {
|
|
10
|
-
visibleFilterState:
|
|
11
|
-
filters:
|
|
11
|
+
visibleFilterState: c(() => u ? o(h, u.filter_operators) : {
|
|
12
|
+
filters: h,
|
|
12
13
|
omitted: !1
|
|
13
|
-
}, [
|
|
14
|
-
filterFieldMeta:
|
|
15
|
-
|
|
16
|
-
c,
|
|
14
|
+
}, [h, u]),
|
|
15
|
+
filterFieldMeta: c(() => i(p, l, u, d, m), [
|
|
16
|
+
p,
|
|
17
17
|
l,
|
|
18
|
-
u
|
|
18
|
+
u,
|
|
19
|
+
d,
|
|
20
|
+
m
|
|
19
21
|
]),
|
|
20
|
-
allFilterFieldMeta:
|
|
21
|
-
|
|
22
|
-
c,
|
|
22
|
+
allFilterFieldMeta: c(() => r(p, l, u, d, m), [
|
|
23
|
+
p,
|
|
23
24
|
l,
|
|
24
|
-
u
|
|
25
|
+
u,
|
|
26
|
+
d,
|
|
27
|
+
m
|
|
25
28
|
]),
|
|
26
|
-
filterFieldName:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
filterFieldName: s((e) => u ? a(p, u, d, e) : e, [
|
|
30
|
+
p,
|
|
31
|
+
u,
|
|
32
|
+
d
|
|
30
33
|
])
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
|
-
export {
|
|
36
|
+
export { l as useListFilterPresentation };
|
|
@@ -11,7 +11,7 @@ var t = [
|
|
|
11
11
|
"slate"
|
|
12
12
|
];
|
|
13
13
|
function n({ name: n, size: r = 22, color: i }) {
|
|
14
|
-
let a = n.split(/\s+/).map((e) => e[0]).slice(0, 2).join("").toUpperCase(), o = t[n.split("").reduce((e, t) => e + t.charCodeAt(0), 0) % t.length], s = i || `var(--pill-${o}-bg)`;
|
|
14
|
+
let a = n.split(/\s+/).filter((e) => /^[\p{L}\p{N}]/u.test(e)).map((e) => e[0]).slice(0, 2).join("").toUpperCase(), o = t[n.split("").reduce((e, t) => e + t.charCodeAt(0), 0) % t.length], s = i || `var(--pill-${o}-bg)`;
|
|
15
15
|
return /* @__PURE__ */ e("span", {
|
|
16
16
|
style: {
|
|
17
17
|
display: "inline-flex",
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useEmbed as e } from "../embed/EmbedContext.js";
|
|
2
|
+
import { useScreenTabRegistration as t } from "./useRegisterScreenTab.js";
|
|
3
|
+
import { useTabSearchMirror as n } from "./useTabSearchMirror.js";
|
|
4
|
+
import { useTabStore as r } from "../stores/tabs.js";
|
|
5
|
+
import { useEffect as i, useRef as a } from "react";
|
|
6
|
+
import { useLocation as o, useSearchParams as s } from "react-router";
|
|
5
7
|
// src/hooks/useScreenTab.ts
|
|
6
|
-
function
|
|
7
|
-
let
|
|
8
|
-
|
|
8
|
+
function c(c) {
|
|
9
|
+
let l = o(), [u] = s(), d = c?.route ?? l.pathname, f = a(u.toString());
|
|
10
|
+
t(d, c?.title ?? d, c?.icon, f.current), n(d);
|
|
11
|
+
let p = c?.title, m = e();
|
|
12
|
+
i(() => {
|
|
13
|
+
if (!p || m.enabled) return;
|
|
14
|
+
let e = r.getState().findTabByPathname(d);
|
|
15
|
+
e && (e.title !== p || e.derivedTitle) && r.getState().updateTabTitle(e.id, p);
|
|
16
|
+
}, [
|
|
17
|
+
d,
|
|
18
|
+
p,
|
|
19
|
+
m.enabled
|
|
20
|
+
]);
|
|
9
21
|
}
|
|
10
|
-
export {
|
|
22
|
+
export { c as useScreenTab };
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -854,7 +854,9 @@ interface UseScreenTabOptions {
|
|
|
854
854
|
/** The tab's route. Defaults to the live `location.pathname` - the right value
|
|
855
855
|
* for a param-less custom screen, which is the common case. */
|
|
856
856
|
route?: string;
|
|
857
|
-
/** Tab title. Defaults to the route when omitted.
|
|
857
|
+
/** Tab title. Defaults to the route when omitted. A changed title renames the
|
|
858
|
+
* open tab, so a record's name that loads after mount reaches the tab and the
|
|
859
|
+
* breadcrumb. */
|
|
858
860
|
title?: string;
|
|
859
861
|
/** Tab icon name (resolved by the icon registry). */
|
|
860
862
|
icon?: string;
|
|
@@ -2290,7 +2292,7 @@ export declare function useAgentConversation(initialConversationId?: string, age
|
|
|
2290
2292
|
};
|
|
2291
2293
|
/** Metadata needed to evaluate a record-only filter condition. */
|
|
2292
2294
|
interface FilterRecordField {
|
|
2293
|
-
type: "string" | "text" | "rich_text" | "email" | "url" | "phone" | "enum" | "int" | "float" | "decimal" | "date" | "timestamp" | "time" | "bool" | "ref" | "uuid" | (string & {});
|
|
2295
|
+
type: "string" | "text" | "rich_text" | "email" | "url" | "phone" | "enum" | "error" | "int" | "float" | "decimal" | "date" | "timestamp" | "time" | "bool" | "ref" | "uuid" | (string & {});
|
|
2294
2296
|
}
|
|
2295
2297
|
type FilterRecordFields = Readonly<Record<string, FilterRecordField>>;
|
|
2296
2298
|
type FilterRecord = Readonly<Record<string, unknown>>;
|
|
@@ -22,6 +22,7 @@ var e = /* @__PURE__ */ new Set([
|
|
|
22
22
|
url: r,
|
|
23
23
|
phone: r,
|
|
24
24
|
enum: i,
|
|
25
|
+
error: i,
|
|
25
26
|
int: a,
|
|
26
27
|
float: a,
|
|
27
28
|
decimal: a,
|
|
@@ -83,7 +84,7 @@ function p(e, t, n, r) {
|
|
|
83
84
|
function m(r, i, a) {
|
|
84
85
|
if (t.has(r)) return typeof i != "number" || typeof a != "number" || !Number.isFinite(i) || !Number.isFinite(a) ? void 0 : i === a ? 0 : i < a ? -1 : 1;
|
|
85
86
|
if (n.has(r)) return typeof i != "string" || typeof a != "string" || !h(r, i) || !h(r, a) ? void 0 : i === a ? 0 : i < a ? -1 : 1;
|
|
86
|
-
if (e.has(r) || r === "enum" || r === "ref" || r === "uuid") return typeof i != "string" || typeof a != "string" ? void 0 : i === a ? 0 : i < a ? -1 : 1;
|
|
87
|
+
if (e.has(r) || r === "enum" || r === "error" || r === "ref" || r === "uuid") return typeof i != "string" || typeof a != "string" ? void 0 : i === a ? 0 : i < a ? -1 : 1;
|
|
87
88
|
if (r === "bool") return typeof i != "boolean" || typeof a != "boolean" ? void 0 : i === a ? 0 : i ? 1 : -1;
|
|
88
89
|
}
|
|
89
90
|
function h(e, t) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/types/fieldType.ts
|
|
2
|
-
var e = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.file_ref.float.folder_ref.int.int_array.json.multilang.multilang_array.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
|
|
2
|
+
var e = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.error.file_ref.float.folder_ref.int.int_array.json.multilang.multilang_array.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
|
|
3
3
|
export { e as FIELD_TYPES };
|