@declarion/react 0.66.1 → 0.80.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
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { formatDateText as e, isDateDraft as t, parseDateText as n } from "../../lib/date-text.js";
|
|
2
|
+
import { Icon as r } from "./Icons.js";
|
|
3
|
+
import { Btn as i } from "./Btn.js";
|
|
4
|
+
import { IconBtn as a } from "./IconBtn.js";
|
|
5
|
+
import { Dropdown as o } from "./Dropdown.js";
|
|
6
|
+
import { Chip as s } from "./Chip.js";
|
|
7
|
+
import { useText as c } from "../../hooks/useText.js";
|
|
8
|
+
import { BoolToggle as l } from "./BoolToggle.js";
|
|
9
|
+
import { MenuItem as u } from "./MenuItem.js";
|
|
10
|
+
import { useId as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
11
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/primitives/Fields.tsx
|
|
12
|
-
var
|
|
13
|
+
var v = ({ children: e, required: t, hint: n, htmlFor: i, id: a }) => /* @__PURE__ */ _("div", {
|
|
13
14
|
style: {
|
|
14
15
|
display: "flex",
|
|
15
16
|
alignItems: "center",
|
|
@@ -21,30 +22,30 @@ var m = ({ children: t, required: n, hint: r, htmlFor: i, id: a }) => /* @__PURE
|
|
|
21
22
|
letterSpacing: "0.01em"
|
|
22
23
|
},
|
|
23
24
|
children: [
|
|
24
|
-
i ? /* @__PURE__ */
|
|
25
|
+
i ? /* @__PURE__ */ g("label", {
|
|
25
26
|
id: a,
|
|
26
27
|
htmlFor: i,
|
|
27
|
-
children:
|
|
28
|
-
}) : /* @__PURE__ */
|
|
28
|
+
children: e
|
|
29
|
+
}) : /* @__PURE__ */ g("span", {
|
|
29
30
|
id: a,
|
|
30
|
-
children:
|
|
31
|
+
children: e
|
|
31
32
|
}),
|
|
32
|
-
|
|
33
|
+
t && /* @__PURE__ */ g("span", {
|
|
33
34
|
"aria-hidden": "true",
|
|
34
35
|
style: { color: "var(--danger)" },
|
|
35
36
|
children: "*"
|
|
36
37
|
}),
|
|
37
|
-
|
|
38
|
-
title:
|
|
38
|
+
n && /* @__PURE__ */ g("span", {
|
|
39
|
+
title: n,
|
|
39
40
|
style: {
|
|
40
41
|
cursor: "help",
|
|
41
42
|
color: "var(--text-4)",
|
|
42
43
|
display: "flex"
|
|
43
44
|
},
|
|
44
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ g(r.info, { size: 11 })
|
|
45
46
|
})
|
|
46
47
|
]
|
|
47
|
-
}),
|
|
48
|
+
}), y = {
|
|
48
49
|
width: "100%",
|
|
49
50
|
height: "var(--control-height)",
|
|
50
51
|
padding: "0 10px",
|
|
@@ -57,33 +58,37 @@ var m = ({ children: t, required: n, hint: r, htmlFor: i, id: a }) => /* @__PURE
|
|
|
57
58
|
outline: "none",
|
|
58
59
|
transition: "border-color .12s, box-shadow .12s"
|
|
59
60
|
};
|
|
60
|
-
function
|
|
61
|
-
let [
|
|
62
|
-
return /* @__PURE__ */
|
|
61
|
+
function b({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style: a, onFocus: o, onBlur: s, ...c }) {
|
|
62
|
+
let [l, u] = m(!1);
|
|
63
|
+
return /* @__PURE__ */ _("div", {
|
|
63
64
|
style: {
|
|
64
65
|
display: "flex",
|
|
65
66
|
alignItems: "center",
|
|
66
67
|
gap: 6,
|
|
67
|
-
...
|
|
68
|
+
...y,
|
|
68
69
|
padding: r || i ? "0 8px" : "0 10px",
|
|
69
|
-
borderColor:
|
|
70
|
-
boxShadow:
|
|
70
|
+
borderColor: l ? "var(--accent)" : "var(--border)",
|
|
71
|
+
boxShadow: l ? "0 0 0 3px var(--accent-ring)" : "none",
|
|
71
72
|
...a
|
|
72
73
|
},
|
|
73
74
|
children: [
|
|
74
|
-
r && /* @__PURE__ */
|
|
75
|
+
r && /* @__PURE__ */ g("span", {
|
|
75
76
|
style: {
|
|
76
77
|
color: "var(--text-3)",
|
|
77
78
|
display: "flex"
|
|
78
79
|
},
|
|
79
80
|
children: r
|
|
80
81
|
}),
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ g("input", {
|
|
82
83
|
value: e ?? "",
|
|
83
84
|
onChange: (e) => t?.(e.target.value),
|
|
84
85
|
placeholder: n,
|
|
85
|
-
onFocus: () =>
|
|
86
|
-
|
|
86
|
+
onFocus: (e) => {
|
|
87
|
+
u(!0), o?.(e);
|
|
88
|
+
},
|
|
89
|
+
onBlur: (e) => {
|
|
90
|
+
u(!1), s?.(e);
|
|
91
|
+
},
|
|
87
92
|
style: {
|
|
88
93
|
border: 0,
|
|
89
94
|
outline: 0,
|
|
@@ -94,9 +99,9 @@ function g({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
94
99
|
padding: 0,
|
|
95
100
|
minWidth: 0
|
|
96
101
|
},
|
|
97
|
-
...
|
|
102
|
+
...c
|
|
98
103
|
}),
|
|
99
|
-
i && /* @__PURE__ */
|
|
104
|
+
i && /* @__PURE__ */ g("span", {
|
|
100
105
|
style: {
|
|
101
106
|
color: "var(--text-3)",
|
|
102
107
|
display: "flex"
|
|
@@ -106,8 +111,8 @@ function g({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
106
111
|
]
|
|
107
112
|
});
|
|
108
113
|
}
|
|
109
|
-
function
|
|
110
|
-
let [c, l] =
|
|
114
|
+
function x({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a, name: o, ariaRequired: s }) {
|
|
115
|
+
let [c, l] = m(!1), u = i ? {
|
|
111
116
|
flex: 1,
|
|
112
117
|
height: "100%",
|
|
113
118
|
minHeight: 0,
|
|
@@ -116,7 +121,7 @@ function _({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a,
|
|
|
116
121
|
height: "auto",
|
|
117
122
|
resize: "vertical"
|
|
118
123
|
};
|
|
119
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ g("textarea", {
|
|
120
125
|
id: a,
|
|
121
126
|
name: o,
|
|
122
127
|
"aria-required": s || void 0,
|
|
@@ -127,55 +132,55 @@ function _({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a,
|
|
|
127
132
|
onFocus: () => l(!0),
|
|
128
133
|
onBlur: () => l(!1),
|
|
129
134
|
style: {
|
|
130
|
-
...
|
|
135
|
+
...y,
|
|
131
136
|
padding: "8px 10px",
|
|
132
137
|
lineHeight: 1.5,
|
|
133
|
-
...
|
|
138
|
+
...u,
|
|
134
139
|
borderColor: c ? "var(--accent)" : "var(--border)",
|
|
135
140
|
boxShadow: c ? "0 0 0 3px var(--accent-ring)" : "none",
|
|
136
141
|
fontFamily: "inherit"
|
|
137
142
|
}
|
|
138
143
|
});
|
|
139
144
|
}
|
|
140
|
-
var
|
|
141
|
-
function
|
|
145
|
+
var S = 20, C = 100;
|
|
146
|
+
function w(e) {
|
|
142
147
|
return typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : e.value;
|
|
143
148
|
}
|
|
144
|
-
function
|
|
145
|
-
let
|
|
146
|
-
T(e),
|
|
147
|
-
}, M =
|
|
148
|
-
if (k) return
|
|
149
|
-
let e =
|
|
150
|
-
return e ?
|
|
149
|
+
function T({ value: e, options: t, onChange: n, placeholder: i, onSearchChange: a, ...s }) {
|
|
150
|
+
let l = c(), [d, v] = m(!1), [x, T] = m(""), E = p(null), D = t.find((t) => !t.heading && !t.divider && t.value === e), O = t.filter((e) => !e.heading && !e.divider).length, k = !!a, A = k || O > S, j = (e) => {
|
|
151
|
+
T(e), a?.(e);
|
|
152
|
+
}, M = f(() => {
|
|
153
|
+
if (k) return t.slice(0, C);
|
|
154
|
+
let e = x.trim().toLowerCase();
|
|
155
|
+
return e ? t.filter((t) => !t.heading && !t.divider && w(t).toLowerCase().includes(e)).slice(0, C) : t.slice(0, C);
|
|
151
156
|
}, [
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
t,
|
|
158
|
+
x,
|
|
154
159
|
k
|
|
155
160
|
]);
|
|
156
|
-
return /* @__PURE__ */
|
|
157
|
-
...
|
|
161
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("button", {
|
|
162
|
+
...s,
|
|
158
163
|
type: "button",
|
|
159
164
|
ref: E,
|
|
160
165
|
"aria-haspopup": "listbox",
|
|
161
|
-
"aria-expanded":
|
|
166
|
+
"aria-expanded": d,
|
|
162
167
|
onClick: () => {
|
|
163
|
-
|
|
168
|
+
v((e) => {
|
|
164
169
|
let t = !e;
|
|
165
170
|
return t && j(""), t;
|
|
166
171
|
});
|
|
167
172
|
},
|
|
168
173
|
style: {
|
|
169
|
-
...
|
|
174
|
+
...y,
|
|
170
175
|
display: "flex",
|
|
171
176
|
alignItems: "center",
|
|
172
177
|
justifyContent: "space-between",
|
|
173
178
|
textAlign: "left",
|
|
174
179
|
cursor: "pointer",
|
|
175
|
-
...
|
|
180
|
+
...s.style,
|
|
176
181
|
color: D ? "var(--text)" : "var(--text-placeholder)"
|
|
177
182
|
},
|
|
178
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ g("span", {
|
|
179
184
|
style: {
|
|
180
185
|
display: "flex",
|
|
181
186
|
alignItems: "center",
|
|
@@ -184,8 +189,8 @@ function x({ value: t, options: n, onChange: i, placeholder: o, onSearchChange:
|
|
|
184
189
|
textOverflow: "ellipsis",
|
|
185
190
|
whiteSpace: "nowrap"
|
|
186
191
|
},
|
|
187
|
-
children: D ? D.label :
|
|
188
|
-
}), /* @__PURE__ */
|
|
192
|
+
children: D ? D.label : i ?? l("control.select.placeholder", "Select…")
|
|
193
|
+
}), /* @__PURE__ */ g(r.down, {
|
|
189
194
|
size: 12,
|
|
190
195
|
cls: "",
|
|
191
196
|
style: {
|
|
@@ -193,17 +198,17 @@ function x({ value: t, options: n, onChange: i, placeholder: o, onSearchChange:
|
|
|
193
198
|
flexShrink: 0
|
|
194
199
|
}
|
|
195
200
|
})]
|
|
196
|
-
}), /* @__PURE__ */
|
|
197
|
-
open:
|
|
201
|
+
}), /* @__PURE__ */ _(o, {
|
|
202
|
+
open: d,
|
|
198
203
|
anchor: E.current,
|
|
199
|
-
onClose: () =>
|
|
204
|
+
onClose: () => v(!1),
|
|
200
205
|
width: E.current?.offsetWidth,
|
|
201
206
|
style: {
|
|
202
207
|
maxHeight: "min(360px, calc(var(--app-height) - 24px))",
|
|
203
208
|
overflowY: "auto"
|
|
204
209
|
},
|
|
205
210
|
children: [
|
|
206
|
-
A && /* @__PURE__ */
|
|
211
|
+
A && /* @__PURE__ */ g("div", {
|
|
207
212
|
style: {
|
|
208
213
|
padding: 6,
|
|
209
214
|
position: "sticky",
|
|
@@ -211,18 +216,18 @@ function x({ value: t, options: n, onChange: i, placeholder: o, onSearchChange:
|
|
|
211
216
|
background: "var(--surface)",
|
|
212
217
|
zIndex: 1
|
|
213
218
|
},
|
|
214
|
-
children: /* @__PURE__ */
|
|
215
|
-
value:
|
|
219
|
+
children: /* @__PURE__ */ g(b, {
|
|
220
|
+
value: x,
|
|
216
221
|
onChange: j,
|
|
217
|
-
placeholder:
|
|
218
|
-
prefix: /* @__PURE__ */
|
|
222
|
+
placeholder: l("control.search", "Search…"),
|
|
223
|
+
prefix: /* @__PURE__ */ g(r.search, { size: 12 }),
|
|
219
224
|
autoFocus: !0
|
|
220
225
|
})
|
|
221
226
|
}),
|
|
222
|
-
M.map((
|
|
227
|
+
M.map((t, r) => t.divider ? /* @__PURE__ */ g("div", { style: {
|
|
223
228
|
borderTop: "1px solid var(--divider)",
|
|
224
229
|
margin: "4px 0"
|
|
225
|
-
} }, `divider-${
|
|
230
|
+
} }, `divider-${r}`) : t.heading ? /* @__PURE__ */ g("div", {
|
|
226
231
|
style: {
|
|
227
232
|
padding: "6px 10px 2px",
|
|
228
233
|
fontSize: 10.5,
|
|
@@ -231,47 +236,47 @@ function x({ value: t, options: n, onChange: i, placeholder: o, onSearchChange:
|
|
|
231
236
|
textTransform: "uppercase",
|
|
232
237
|
letterSpacing: "0.06em"
|
|
233
238
|
},
|
|
234
|
-
children:
|
|
235
|
-
}, `heading-${
|
|
239
|
+
children: t.label
|
|
240
|
+
}, `heading-${r}`) : /* @__PURE__ */ g(u, {
|
|
236
241
|
onClick: () => {
|
|
237
|
-
|
|
242
|
+
n(t.value), v(!1);
|
|
238
243
|
},
|
|
239
|
-
active:
|
|
240
|
-
children:
|
|
241
|
-
},
|
|
242
|
-
M.length === 0 && /* @__PURE__ */
|
|
244
|
+
active: t.value === e,
|
|
245
|
+
children: t.label
|
|
246
|
+
}, t.value)),
|
|
247
|
+
M.length === 0 && /* @__PURE__ */ g("div", {
|
|
243
248
|
style: {
|
|
244
249
|
padding: "8px 10px",
|
|
245
250
|
fontSize: 12.5,
|
|
246
251
|
color: "var(--text-3)"
|
|
247
252
|
},
|
|
248
|
-
children:
|
|
253
|
+
children: l("control.no_matches", "No matches")
|
|
249
254
|
})
|
|
250
255
|
]
|
|
251
256
|
})] });
|
|
252
257
|
}
|
|
253
|
-
function
|
|
254
|
-
let
|
|
258
|
+
function E({ value: e = [], options: t, onChange: n, placeholder: i, ...a }) {
|
|
259
|
+
let s = c(), [l, d] = m(!1), [v, x] = m(""), T = p(null), E = t.filter((e) => !e.heading && !e.divider), D = E.length > S, O = e.map((e) => E.find((t) => t.value === e) ?? {
|
|
255
260
|
value: e,
|
|
256
261
|
label: e
|
|
257
|
-
}), k =
|
|
258
|
-
let e =
|
|
259
|
-
return e ?
|
|
260
|
-
}, [
|
|
261
|
-
return /* @__PURE__ */
|
|
262
|
-
...
|
|
262
|
+
}), k = f(() => {
|
|
263
|
+
let e = v.trim().toLowerCase();
|
|
264
|
+
return e ? t.filter((t) => !t.heading && !t.divider && w(t).toLowerCase().includes(e)).slice(0, C) : t.slice(0, C);
|
|
265
|
+
}, [t, v]), A = (t) => n(e.includes(t) ? e.filter((e) => e !== t) : [...e, t]);
|
|
266
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("button", {
|
|
267
|
+
...a,
|
|
263
268
|
type: "button",
|
|
264
269
|
ref: T,
|
|
265
270
|
"aria-haspopup": "listbox",
|
|
266
|
-
"aria-expanded":
|
|
271
|
+
"aria-expanded": l,
|
|
267
272
|
onClick: () => {
|
|
268
|
-
|
|
273
|
+
d((e) => {
|
|
269
274
|
let t = !e;
|
|
270
|
-
return t &&
|
|
275
|
+
return t && x(""), t;
|
|
271
276
|
});
|
|
272
277
|
},
|
|
273
278
|
style: {
|
|
274
|
-
...
|
|
279
|
+
...y,
|
|
275
280
|
height: "auto",
|
|
276
281
|
minHeight: "var(--control-height)",
|
|
277
282
|
display: "flex",
|
|
@@ -281,15 +286,15 @@ function S({ value: t = [], options: n, onChange: i, placeholder: o, ...m }) {
|
|
|
281
286
|
padding: O.length ? "3px 8px" : "0 10px",
|
|
282
287
|
textAlign: "left",
|
|
283
288
|
cursor: "pointer",
|
|
284
|
-
...
|
|
289
|
+
...a.style
|
|
285
290
|
},
|
|
286
|
-
children: [O.length === 0 ? /* @__PURE__ */
|
|
291
|
+
children: [O.length === 0 ? /* @__PURE__ */ g("span", {
|
|
287
292
|
style: {
|
|
288
293
|
flex: 1,
|
|
289
294
|
color: "var(--text-placeholder)"
|
|
290
295
|
},
|
|
291
|
-
children:
|
|
292
|
-
}) : O.map((
|
|
296
|
+
children: i ?? s("control.select.placeholder", "Select…")
|
|
297
|
+
}) : O.map((e) => /* @__PURE__ */ _("span", {
|
|
293
298
|
style: {
|
|
294
299
|
display: "inline-flex",
|
|
295
300
|
alignItems: "center",
|
|
@@ -303,18 +308,18 @@ function S({ value: t = [], options: n, onChange: i, placeholder: o, ...m }) {
|
|
|
303
308
|
color: "var(--text-2)",
|
|
304
309
|
maxWidth: "100%"
|
|
305
310
|
},
|
|
306
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ g("span", {
|
|
307
312
|
style: {
|
|
308
313
|
overflow: "hidden",
|
|
309
314
|
textOverflow: "ellipsis",
|
|
310
315
|
whiteSpace: "nowrap"
|
|
311
316
|
},
|
|
312
|
-
children:
|
|
313
|
-
}), /* @__PURE__ */
|
|
317
|
+
children: e.label
|
|
318
|
+
}), /* @__PURE__ */ g("span", {
|
|
314
319
|
role: "button",
|
|
315
|
-
"aria-label":
|
|
316
|
-
onClick: (
|
|
317
|
-
|
|
320
|
+
"aria-label": s("control.remove_value", "Remove {value}", { value: w(e) }),
|
|
321
|
+
onClick: (t) => {
|
|
322
|
+
t.stopPropagation(), A(e.value);
|
|
318
323
|
},
|
|
319
324
|
style: {
|
|
320
325
|
display: "flex",
|
|
@@ -322,9 +327,9 @@ function S({ value: t = [], options: n, onChange: i, placeholder: o, ...m }) {
|
|
|
322
327
|
cursor: "pointer",
|
|
323
328
|
flexShrink: 0
|
|
324
329
|
},
|
|
325
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ g(r.x, { size: 12 })
|
|
326
331
|
})]
|
|
327
|
-
},
|
|
332
|
+
}, e.value)), /* @__PURE__ */ g(r.down, {
|
|
328
333
|
size: 12,
|
|
329
334
|
cls: "",
|
|
330
335
|
style: {
|
|
@@ -333,17 +338,17 @@ function S({ value: t = [], options: n, onChange: i, placeholder: o, ...m }) {
|
|
|
333
338
|
flexShrink: 0
|
|
334
339
|
}
|
|
335
340
|
})]
|
|
336
|
-
}), /* @__PURE__ */
|
|
337
|
-
open:
|
|
341
|
+
}), /* @__PURE__ */ _(o, {
|
|
342
|
+
open: l,
|
|
338
343
|
anchor: T.current,
|
|
339
|
-
onClose: () =>
|
|
344
|
+
onClose: () => d(!1),
|
|
340
345
|
width: T.current?.offsetWidth,
|
|
341
346
|
style: {
|
|
342
347
|
maxHeight: "min(360px, calc(var(--app-height) - 24px))",
|
|
343
348
|
overflowY: "auto"
|
|
344
349
|
},
|
|
345
350
|
children: [
|
|
346
|
-
D && /* @__PURE__ */
|
|
351
|
+
D && /* @__PURE__ */ g("div", {
|
|
347
352
|
style: {
|
|
348
353
|
padding: 6,
|
|
349
354
|
position: "sticky",
|
|
@@ -351,20 +356,20 @@ function S({ value: t = [], options: n, onChange: i, placeholder: o, ...m }) {
|
|
|
351
356
|
background: "var(--surface)",
|
|
352
357
|
zIndex: 1
|
|
353
358
|
},
|
|
354
|
-
children: /* @__PURE__ */
|
|
355
|
-
value:
|
|
356
|
-
onChange:
|
|
357
|
-
placeholder:
|
|
358
|
-
prefix: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ g(b, {
|
|
360
|
+
value: v,
|
|
361
|
+
onChange: x,
|
|
362
|
+
placeholder: s("control.search", "Search…"),
|
|
363
|
+
prefix: /* @__PURE__ */ g(r.search, { size: 12 }),
|
|
359
364
|
autoFocus: !0
|
|
360
365
|
})
|
|
361
366
|
}),
|
|
362
|
-
k.map((
|
|
363
|
-
if (
|
|
367
|
+
k.map((t, n) => {
|
|
368
|
+
if (t.divider) return /* @__PURE__ */ g("div", { style: {
|
|
364
369
|
borderTop: "1px solid var(--divider)",
|
|
365
370
|
margin: "4px 0"
|
|
366
|
-
} }, `divider-${
|
|
367
|
-
if (
|
|
371
|
+
} }, `divider-${n}`);
|
|
372
|
+
if (t.heading) return /* @__PURE__ */ g("div", {
|
|
368
373
|
style: {
|
|
369
374
|
padding: "6px 10px 2px",
|
|
370
375
|
fontSize: 10.5,
|
|
@@ -373,70 +378,143 @@ function S({ value: t = [], options: n, onChange: i, placeholder: o, ...m }) {
|
|
|
373
378
|
textTransform: "uppercase",
|
|
374
379
|
letterSpacing: "0.06em"
|
|
375
380
|
},
|
|
376
|
-
children:
|
|
377
|
-
}, `heading-${
|
|
378
|
-
let i =
|
|
379
|
-
return /* @__PURE__ */
|
|
381
|
+
children: t.label
|
|
382
|
+
}, `heading-${n}`);
|
|
383
|
+
let i = e.includes(t.value);
|
|
384
|
+
return /* @__PURE__ */ g(u, {
|
|
380
385
|
active: i,
|
|
381
|
-
icon: i ? /* @__PURE__ */
|
|
386
|
+
icon: i ? /* @__PURE__ */ g(r.check, { size: 13 }) : /* @__PURE__ */ g("span", { style: {
|
|
382
387
|
display: "inline-block",
|
|
383
388
|
width: 13
|
|
384
389
|
} }),
|
|
385
|
-
onClick: () => A(
|
|
386
|
-
children:
|
|
387
|
-
},
|
|
390
|
+
onClick: () => A(t.value),
|
|
391
|
+
children: t.label
|
|
392
|
+
}, t.value);
|
|
388
393
|
}),
|
|
389
|
-
k.length === 0 && /* @__PURE__ */
|
|
394
|
+
k.length === 0 && /* @__PURE__ */ g("div", {
|
|
390
395
|
style: {
|
|
391
396
|
padding: "8px 10px",
|
|
392
397
|
fontSize: 12.5,
|
|
393
398
|
color: "var(--text-3)"
|
|
394
399
|
},
|
|
395
|
-
children:
|
|
400
|
+
children: s("control.no_matches", "No matches")
|
|
396
401
|
})
|
|
397
402
|
]
|
|
398
403
|
})] });
|
|
399
404
|
}
|
|
400
|
-
function
|
|
401
|
-
let
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
function D({ kind: i, value: o, onChange: s, id: l, name: u, ariaRequired: f }) {
|
|
406
|
+
let h = c(), v = `${d()}-error`, y = p(null), x = o ? e(i, o) : "", [S, C] = m(x), [w, T] = m(o), [E, D] = m(!1);
|
|
407
|
+
o !== w && (T(o), (o === null ? S !== "" : n(i, S) !== (o || null)) && (C(x), D(!1)));
|
|
408
|
+
let O = i === "date" ? {
|
|
409
|
+
placeholder: h("control.date.placeholder", "DD-MM-YYYY"),
|
|
410
|
+
invalid: h("control.date.invalid", "Enter the date as DD-MM-YYYY.")
|
|
411
|
+
} : {
|
|
412
|
+
placeholder: h("control.datetime.placeholder", "DD-MM-YYYY HH:mm"),
|
|
413
|
+
invalid: h("control.datetime.invalid", "Enter the date and time as DD-MM-YYYY HH:mm.")
|
|
414
|
+
}, k = h("control.date.pick", "Choose a date");
|
|
415
|
+
return /* @__PURE__ */ _("div", {
|
|
416
|
+
style: {
|
|
417
|
+
display: "flex",
|
|
418
|
+
flexDirection: "column",
|
|
419
|
+
gap: 4
|
|
420
|
+
},
|
|
421
|
+
children: [/* @__PURE__ */ g(b, {
|
|
422
|
+
id: l,
|
|
423
|
+
name: u,
|
|
424
|
+
"aria-required": f || void 0,
|
|
425
|
+
"aria-invalid": E || void 0,
|
|
426
|
+
"aria-describedby": E ? v : void 0,
|
|
427
|
+
type: "text",
|
|
428
|
+
inputMode: i === "date" ? "numeric" : void 0,
|
|
429
|
+
autoComplete: "off",
|
|
430
|
+
placeholder: O.placeholder,
|
|
431
|
+
value: S,
|
|
432
|
+
onChange: (e) => {
|
|
433
|
+
t(e) && (C(e), D(!1), s(e.trim() === "" ? null : n(i, e), e));
|
|
434
|
+
},
|
|
435
|
+
onBlur: () => {
|
|
436
|
+
if (S.trim() === "") return;
|
|
437
|
+
let t = n(i, S);
|
|
438
|
+
t ? C(e(i, t)) : D(!0);
|
|
439
|
+
},
|
|
440
|
+
suffix: /* @__PURE__ */ _("span", {
|
|
441
|
+
style: {
|
|
442
|
+
position: "relative",
|
|
443
|
+
display: "flex"
|
|
444
|
+
},
|
|
445
|
+
children: [/* @__PURE__ */ g(a, {
|
|
446
|
+
icon: /* @__PURE__ */ g(r.calendar, { size: 13 }),
|
|
447
|
+
title: k,
|
|
448
|
+
size: 22,
|
|
449
|
+
onClick: () => {
|
|
450
|
+
let e = y.current;
|
|
451
|
+
if (e) try {
|
|
452
|
+
e.showPicker();
|
|
453
|
+
} catch {
|
|
454
|
+
e.focus(), e.click();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}), /* @__PURE__ */ g("input", {
|
|
458
|
+
ref: y,
|
|
459
|
+
type: i === "date" ? "date" : "datetime-local",
|
|
460
|
+
tabIndex: -1,
|
|
461
|
+
"aria-hidden": "true",
|
|
462
|
+
value: o ?? "",
|
|
463
|
+
onChange: (t) => {
|
|
464
|
+
let n = t.target.value, r = n ? e(i, n) : "";
|
|
465
|
+
C(r), D(!1), s(n || null, r);
|
|
466
|
+
},
|
|
467
|
+
style: {
|
|
468
|
+
position: "absolute",
|
|
469
|
+
inset: 0,
|
|
470
|
+
width: "100%",
|
|
471
|
+
height: "100%",
|
|
472
|
+
opacity: 0,
|
|
473
|
+
pointerEvents: "none",
|
|
474
|
+
border: 0,
|
|
475
|
+
padding: 0
|
|
476
|
+
}
|
|
477
|
+
})]
|
|
478
|
+
})
|
|
479
|
+
}), E && /* @__PURE__ */ g("span", {
|
|
480
|
+
id: v,
|
|
481
|
+
role: "alert",
|
|
482
|
+
className: "text-xs text-destructive",
|
|
483
|
+
children: O.invalid
|
|
484
|
+
})]
|
|
407
485
|
});
|
|
408
486
|
}
|
|
409
|
-
function
|
|
487
|
+
function O(e) {
|
|
410
488
|
if (!e) return 0;
|
|
411
489
|
let t = 0;
|
|
412
490
|
return e.length >= 8 && t++, e.length >= 12 && t++, /[A-Z]/.test(e) && /[a-z]/.test(e) && t++, /\d/.test(e) && t++, /[^A-Za-z0-9]/.test(e) && t++, Math.min(4, t);
|
|
413
491
|
}
|
|
414
|
-
var
|
|
492
|
+
var k = [
|
|
415
493
|
(e) => e("control.password.strength.too_short", "Too short"),
|
|
416
494
|
(e) => e("control.password.strength.weak", "Weak"),
|
|
417
495
|
(e) => e("control.password.strength.fair", "Fair"),
|
|
418
496
|
(e) => e("control.password.strength.good", "Good"),
|
|
419
497
|
(e) => e("control.password.strength.strong", "Strong")
|
|
420
|
-
],
|
|
498
|
+
], A = [
|
|
421
499
|
"var(--danger)",
|
|
422
500
|
"var(--danger)",
|
|
423
501
|
"var(--warning, #B45309)",
|
|
424
502
|
"var(--accent)",
|
|
425
503
|
"var(--success, #3FBF8F)"
|
|
426
504
|
];
|
|
427
|
-
function
|
|
428
|
-
let l =
|
|
429
|
-
return /* @__PURE__ */
|
|
430
|
-
id:
|
|
431
|
-
name:
|
|
432
|
-
"aria-required":
|
|
433
|
-
type:
|
|
434
|
-
value:
|
|
435
|
-
onChange:
|
|
436
|
-
placeholder:
|
|
437
|
-
suffix: /* @__PURE__ */
|
|
505
|
+
function j({ value: e, onChange: t, placeholder: n, showStrength: i, id: a, name: o, ariaRequired: s }) {
|
|
506
|
+
let l = c(), [u, d] = m(!1), f = e || "", p = O(f);
|
|
507
|
+
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(b, {
|
|
508
|
+
id: a,
|
|
509
|
+
name: o,
|
|
510
|
+
"aria-required": s || void 0,
|
|
511
|
+
type: u ? "text" : "password",
|
|
512
|
+
value: f,
|
|
513
|
+
onChange: t,
|
|
514
|
+
placeholder: n ?? l("control.password.placeholder", "Enter password"),
|
|
515
|
+
suffix: /* @__PURE__ */ g("button", {
|
|
438
516
|
type: "button",
|
|
439
|
-
"aria-label":
|
|
517
|
+
"aria-label": u ? l("control.password.hide", "Hide password") : l("control.password.show", "Show password"),
|
|
440
518
|
style: {
|
|
441
519
|
background: "none",
|
|
442
520
|
border: 0,
|
|
@@ -445,17 +523,17 @@ function D({ value: t, onChange: n, placeholder: r, showStrength: i, id: o, name
|
|
|
445
523
|
color: "var(--text-3)",
|
|
446
524
|
display: "flex"
|
|
447
525
|
},
|
|
448
|
-
onClick: () =>
|
|
449
|
-
children:
|
|
526
|
+
onClick: () => d((e) => !e),
|
|
527
|
+
children: g(u ? r.eyeOff : r.eye, { size: 14 })
|
|
450
528
|
})
|
|
451
|
-
}), i && /* @__PURE__ */
|
|
529
|
+
}), i && /* @__PURE__ */ _("div", {
|
|
452
530
|
style: {
|
|
453
531
|
marginTop: 6,
|
|
454
532
|
display: "flex",
|
|
455
533
|
alignItems: "center",
|
|
456
534
|
gap: 8
|
|
457
535
|
},
|
|
458
|
-
children: [/* @__PURE__ */
|
|
536
|
+
children: [/* @__PURE__ */ g("div", {
|
|
459
537
|
style: {
|
|
460
538
|
display: "flex",
|
|
461
539
|
gap: 3,
|
|
@@ -466,29 +544,29 @@ function D({ value: t, onChange: n, placeholder: r, showStrength: i, id: o, name
|
|
|
466
544
|
1,
|
|
467
545
|
2,
|
|
468
546
|
3
|
|
469
|
-
].map((e) => /* @__PURE__ */
|
|
547
|
+
].map((e) => /* @__PURE__ */ g("span", { style: {
|
|
470
548
|
flex: 1,
|
|
471
549
|
height: 3,
|
|
472
550
|
borderRadius: 999,
|
|
473
|
-
background: e <
|
|
551
|
+
background: e < p ? A[p] : "var(--surface-3)",
|
|
474
552
|
transition: "background .15s"
|
|
475
553
|
} }, e))
|
|
476
|
-
}), /* @__PURE__ */
|
|
554
|
+
}), /* @__PURE__ */ g("span", {
|
|
477
555
|
style: {
|
|
478
556
|
fontSize: 10.5,
|
|
479
557
|
color: "var(--text-3)",
|
|
480
558
|
minWidth: 54,
|
|
481
559
|
textAlign: "right"
|
|
482
560
|
},
|
|
483
|
-
children:
|
|
561
|
+
children: f ? k[p](l) : ""
|
|
484
562
|
})]
|
|
485
563
|
})] });
|
|
486
564
|
}
|
|
487
|
-
function
|
|
488
|
-
let n =
|
|
489
|
-
return /* @__PURE__ */
|
|
565
|
+
function M({ value: e = [], onChange: t }) {
|
|
566
|
+
let n = c(), [r, i] = m("");
|
|
567
|
+
return /* @__PURE__ */ _("div", {
|
|
490
568
|
style: {
|
|
491
|
-
...
|
|
569
|
+
...y,
|
|
492
570
|
height: "auto",
|
|
493
571
|
minHeight: "var(--control-height)",
|
|
494
572
|
display: "flex",
|
|
@@ -497,15 +575,15 @@ function O({ value: e = [], onChange: t }) {
|
|
|
497
575
|
padding: "4px 6px",
|
|
498
576
|
alignItems: "center"
|
|
499
577
|
},
|
|
500
|
-
children: [e.map((n, r) => /* @__PURE__ */
|
|
578
|
+
children: [e.map((n, r) => /* @__PURE__ */ g(s, {
|
|
501
579
|
tone: "slate",
|
|
502
580
|
onRemove: () => t(e.filter((e, t) => t !== r)),
|
|
503
581
|
children: n
|
|
504
|
-
}, r)), /* @__PURE__ */
|
|
582
|
+
}, r)), /* @__PURE__ */ g("input", {
|
|
505
583
|
value: r,
|
|
506
|
-
onChange: (e) =>
|
|
584
|
+
onChange: (e) => i(e.target.value),
|
|
507
585
|
onKeyDown: (n) => {
|
|
508
|
-
n.key === "Enter" && r.trim() && (t([...e, r.trim()]),
|
|
586
|
+
n.key === "Enter" && r.trim() && (t([...e, r.trim()]), i(""), n.preventDefault()), n.key === "Backspace" && !r && e.length && t(e.slice(0, -1));
|
|
509
587
|
},
|
|
510
588
|
placeholder: e.length ? "" : n("control.tags.placeholder", "Add tag… (Enter)"),
|
|
511
589
|
style: {
|
|
@@ -520,17 +598,17 @@ function O({ value: e = [], onChange: t }) {
|
|
|
520
598
|
})]
|
|
521
599
|
});
|
|
522
600
|
}
|
|
523
|
-
var
|
|
524
|
-
function
|
|
525
|
-
let
|
|
526
|
-
return /* @__PURE__ */
|
|
601
|
+
var N = "JSON";
|
|
602
|
+
function P({ value: e, onChange: t }) {
|
|
603
|
+
let n = c();
|
|
604
|
+
return /* @__PURE__ */ _("div", {
|
|
527
605
|
style: {
|
|
528
606
|
border: "1px solid var(--border)",
|
|
529
607
|
borderRadius: "var(--radius-md)",
|
|
530
608
|
background: "var(--surface-2)",
|
|
531
609
|
overflow: "hidden"
|
|
532
610
|
},
|
|
533
|
-
children: [/* @__PURE__ */
|
|
611
|
+
children: [/* @__PURE__ */ _("div", {
|
|
534
612
|
style: {
|
|
535
613
|
padding: "6px 10px",
|
|
536
614
|
background: "var(--surface-3)",
|
|
@@ -540,7 +618,7 @@ function A({ value: e, onChange: n }) {
|
|
|
540
618
|
gap: 8
|
|
541
619
|
},
|
|
542
620
|
children: [
|
|
543
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ g("span", {
|
|
544
622
|
className: "mono",
|
|
545
623
|
style: {
|
|
546
624
|
fontSize: 10.5,
|
|
@@ -548,24 +626,24 @@ function A({ value: e, onChange: n }) {
|
|
|
548
626
|
textTransform: "uppercase",
|
|
549
627
|
letterSpacing: "0.04em"
|
|
550
628
|
},
|
|
551
|
-
children:
|
|
629
|
+
children: N
|
|
552
630
|
}),
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ g("span", { style: { flex: 1 } }),
|
|
632
|
+
/* @__PURE__ */ g(i, {
|
|
555
633
|
size: "xs",
|
|
556
634
|
kind: "ghost",
|
|
557
|
-
children:
|
|
635
|
+
children: n("control.json.format", "Format")
|
|
558
636
|
}),
|
|
559
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ g(i, {
|
|
560
638
|
size: "xs",
|
|
561
639
|
kind: "ghost",
|
|
562
|
-
children:
|
|
640
|
+
children: n("control.json.validate", "Validate")
|
|
563
641
|
})
|
|
564
642
|
]
|
|
565
|
-
}), /* @__PURE__ */
|
|
643
|
+
}), /* @__PURE__ */ g("textarea", {
|
|
566
644
|
className: "mono",
|
|
567
645
|
value: e || "",
|
|
568
|
-
onChange: (e) =>
|
|
646
|
+
onChange: (e) => t?.(e.target.value),
|
|
569
647
|
style: {
|
|
570
648
|
width: "100%",
|
|
571
649
|
minHeight: 140,
|
|
@@ -581,31 +659,31 @@ function A({ value: e, onChange: n }) {
|
|
|
581
659
|
})]
|
|
582
660
|
});
|
|
583
661
|
}
|
|
584
|
-
function
|
|
585
|
-
let
|
|
586
|
-
return /* @__PURE__ */
|
|
662
|
+
function F({ value: e, entity: t = "company", onChange: n, items: i = [], id: a, ariaLabelledby: s, ariaRequired: l }) {
|
|
663
|
+
let d = c(), [f, v] = m(!1), x = p(null);
|
|
664
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("button", {
|
|
587
665
|
type: "button",
|
|
588
|
-
id:
|
|
589
|
-
"aria-labelledby":
|
|
590
|
-
"aria-required":
|
|
666
|
+
id: a,
|
|
667
|
+
"aria-labelledby": s,
|
|
668
|
+
"aria-required": l || void 0,
|
|
591
669
|
ref: x,
|
|
592
|
-
onClick: () =>
|
|
670
|
+
onClick: () => v(!0),
|
|
593
671
|
style: {
|
|
594
|
-
...
|
|
672
|
+
...y,
|
|
595
673
|
display: "flex",
|
|
596
674
|
alignItems: "center",
|
|
597
675
|
justifyContent: "space-between",
|
|
598
676
|
textAlign: "left",
|
|
599
677
|
cursor: "pointer"
|
|
600
678
|
},
|
|
601
|
-
children: [/* @__PURE__ */
|
|
679
|
+
children: [/* @__PURE__ */ _("span", {
|
|
602
680
|
style: {
|
|
603
681
|
display: "flex",
|
|
604
682
|
alignItems: "center",
|
|
605
683
|
gap: 8,
|
|
606
684
|
overflow: "hidden"
|
|
607
685
|
},
|
|
608
|
-
children: [/* @__PURE__ */
|
|
686
|
+
children: [/* @__PURE__ */ g("span", {
|
|
609
687
|
style: {
|
|
610
688
|
width: 18,
|
|
611
689
|
height: 18,
|
|
@@ -616,39 +694,39 @@ function j({ value: t, entity: n = "company", onChange: i, items: o = [], id: c,
|
|
|
616
694
|
alignItems: "center",
|
|
617
695
|
justifyContent: "center"
|
|
618
696
|
},
|
|
619
|
-
children: /* @__PURE__ */
|
|
620
|
-
}), /* @__PURE__ */
|
|
621
|
-
style: { color:
|
|
622
|
-
children:
|
|
697
|
+
children: /* @__PURE__ */ g(r.link, { size: 11 })
|
|
698
|
+
}), /* @__PURE__ */ g("span", {
|
|
699
|
+
style: { color: e ? "var(--accent)" : "var(--text-placeholder)" },
|
|
700
|
+
children: e || d("control.ref.link_to", "Link to {entity}…", { entity: t })
|
|
623
701
|
})]
|
|
624
|
-
}), /* @__PURE__ */
|
|
702
|
+
}), /* @__PURE__ */ g(r.search, {
|
|
625
703
|
size: 12,
|
|
626
704
|
cls: "",
|
|
627
705
|
style: { color: "var(--text-3)" }
|
|
628
706
|
})]
|
|
629
|
-
}), /* @__PURE__ */
|
|
630
|
-
open:
|
|
707
|
+
}), /* @__PURE__ */ _(o, {
|
|
708
|
+
open: f,
|
|
631
709
|
anchor: x.current,
|
|
632
|
-
onClose: () =>
|
|
710
|
+
onClose: () => v(!1),
|
|
633
711
|
width: x.current?.offsetWidth,
|
|
634
|
-
children: [/* @__PURE__ */
|
|
712
|
+
children: [/* @__PURE__ */ g("div", {
|
|
635
713
|
style: { padding: 4 },
|
|
636
|
-
children: /* @__PURE__ */
|
|
637
|
-
placeholder:
|
|
638
|
-
prefix: /* @__PURE__ */
|
|
714
|
+
children: /* @__PURE__ */ g(b, {
|
|
715
|
+
placeholder: d("control.ref.search", "Search {entity}…", { entity: t }),
|
|
716
|
+
prefix: /* @__PURE__ */ g(r.search, { size: 12 }),
|
|
639
717
|
style: { marginBottom: 4 }
|
|
640
718
|
})
|
|
641
|
-
}),
|
|
642
|
-
icon: /* @__PURE__ */
|
|
719
|
+
}), i.slice(0, 6).map((e) => /* @__PURE__ */ g(u, {
|
|
720
|
+
icon: /* @__PURE__ */ g(r.building, { size: 13 }),
|
|
643
721
|
onClick: () => {
|
|
644
|
-
|
|
722
|
+
n?.(e.name), v(!1);
|
|
645
723
|
},
|
|
646
|
-
children:
|
|
647
|
-
},
|
|
724
|
+
children: e.name
|
|
725
|
+
}, e.id))]
|
|
648
726
|
})] });
|
|
649
727
|
}
|
|
650
|
-
function
|
|
651
|
-
return /* @__PURE__ */
|
|
728
|
+
function I({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
729
|
+
return /* @__PURE__ */ _("div", {
|
|
652
730
|
style: {
|
|
653
731
|
display: "flex",
|
|
654
732
|
flexDirection: r ? "column" : "row",
|
|
@@ -656,7 +734,7 @@ function M({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
|
656
734
|
minHeight: 24,
|
|
657
735
|
alignItems: "baseline"
|
|
658
736
|
},
|
|
659
|
-
children: [/* @__PURE__ */
|
|
737
|
+
children: [/* @__PURE__ */ g("div", {
|
|
660
738
|
style: {
|
|
661
739
|
width: r ? "auto" : 140,
|
|
662
740
|
flexShrink: 0,
|
|
@@ -666,7 +744,7 @@ function M({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
|
666
744
|
letterSpacing: "0.01em"
|
|
667
745
|
},
|
|
668
746
|
children: e
|
|
669
|
-
}), /* @__PURE__ */
|
|
747
|
+
}), /* @__PURE__ */ g("div", {
|
|
670
748
|
className: n ? "mono num" : "num",
|
|
671
749
|
style: {
|
|
672
750
|
flex: 1,
|
|
@@ -680,50 +758,50 @@ function M({ label: e, children: t, mono: n, wide: r, empty: i }) {
|
|
|
680
758
|
})]
|
|
681
759
|
});
|
|
682
760
|
}
|
|
683
|
-
function
|
|
684
|
-
let
|
|
685
|
-
|
|
686
|
-
},
|
|
687
|
-
|
|
761
|
+
function L({ value: e, onChange: t, type: n = "text", options: i }) {
|
|
762
|
+
let o = c(), [s, u] = m(!1), [d, f] = m(e), p = () => {
|
|
763
|
+
d !== void 0 && t?.(d), u(!1);
|
|
764
|
+
}, v = () => {
|
|
765
|
+
f(e), u(!1);
|
|
688
766
|
};
|
|
689
|
-
return
|
|
767
|
+
return s ? /* @__PURE__ */ _("div", {
|
|
690
768
|
style: {
|
|
691
769
|
display: "flex",
|
|
692
770
|
alignItems: "center",
|
|
693
771
|
gap: 4
|
|
694
772
|
},
|
|
695
773
|
onKeyDown: (e) => {
|
|
696
|
-
e.key === "Enter" &&
|
|
774
|
+
e.key === "Enter" && p(), e.key === "Escape" && v();
|
|
697
775
|
},
|
|
698
|
-
children: [
|
|
699
|
-
value:
|
|
700
|
-
options:
|
|
776
|
+
children: [n === "select" ? /* @__PURE__ */ g(T, {
|
|
777
|
+
value: d,
|
|
778
|
+
options: i || [],
|
|
701
779
|
onChange: (e) => {
|
|
702
|
-
|
|
780
|
+
f(e), t?.(e), u(!1);
|
|
703
781
|
}
|
|
704
|
-
}) :
|
|
705
|
-
value:
|
|
782
|
+
}) : n === "bool" ? /* @__PURE__ */ g(l, {
|
|
783
|
+
value: d === "true",
|
|
706
784
|
onChange: (e) => {
|
|
707
|
-
let
|
|
708
|
-
|
|
785
|
+
let n = String(e);
|
|
786
|
+
f(n), t?.(n), u(!1);
|
|
709
787
|
}
|
|
710
|
-
}) : /* @__PURE__ */
|
|
711
|
-
value:
|
|
712
|
-
onChange:
|
|
788
|
+
}) : /* @__PURE__ */ g(b, {
|
|
789
|
+
value: d ?? "",
|
|
790
|
+
onChange: f,
|
|
713
791
|
autoFocus: !0
|
|
714
|
-
}),
|
|
792
|
+
}), n !== "select" && n !== "bool" && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(a, {
|
|
715
793
|
size: 24,
|
|
716
|
-
icon: /* @__PURE__ */
|
|
717
|
-
onClick:
|
|
718
|
-
title:
|
|
719
|
-
}), /* @__PURE__ */
|
|
794
|
+
icon: /* @__PURE__ */ g(r.check, { size: 13 }),
|
|
795
|
+
onClick: p,
|
|
796
|
+
title: o("dialog.save", "Save")
|
|
797
|
+
}), /* @__PURE__ */ g(a, {
|
|
720
798
|
size: 24,
|
|
721
|
-
icon: /* @__PURE__ */
|
|
722
|
-
onClick:
|
|
723
|
-
title:
|
|
799
|
+
icon: /* @__PURE__ */ g(r.x, { size: 13 }),
|
|
800
|
+
onClick: v,
|
|
801
|
+
title: o("dialog.cancel", "Cancel")
|
|
724
802
|
})] })]
|
|
725
|
-
}) : /* @__PURE__ */
|
|
726
|
-
onClick: () =>
|
|
803
|
+
}) : /* @__PURE__ */ g("div", {
|
|
804
|
+
onClick: () => u(!0),
|
|
727
805
|
style: {
|
|
728
806
|
padding: "4px 6px",
|
|
729
807
|
margin: "-4px -6px",
|
|
@@ -741,11 +819,11 @@ function N({ value: t, onChange: r, type: i = "text", options: s }) {
|
|
|
741
819
|
onMouseLeave: (e) => {
|
|
742
820
|
e.currentTarget.style.borderColor = "transparent";
|
|
743
821
|
},
|
|
744
|
-
children:
|
|
822
|
+
children: e || /* @__PURE__ */ g("span", {
|
|
745
823
|
style: { color: "var(--text-4)" },
|
|
746
|
-
children:
|
|
824
|
+
children: o("control.click_to_edit", "Click to edit")
|
|
747
825
|
})
|
|
748
826
|
});
|
|
749
827
|
}
|
|
750
828
|
//#endregion
|
|
751
|
-
export {
|
|
829
|
+
export { D as DateInput, v as FieldLabel, P as JsonField, E as MultiSelect, j as PasswordInput, L as QuickEditCell, F as RefField, T as Select, M as TagsInput, x as TextArea, b as TextInput, I as ViewField };
|