@declarion/react 0.255.0 → 0.302.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/detail-layout/DetailHighlights.js +40 -40
- package/dist-lib/components/detail-layout/useQuickAdd.js +45 -47
- package/dist-lib/components/fields/EnumField.js +25 -25
- package/dist-lib/components/fields/cells/factories/badge.js +14 -27
- package/dist-lib/components/fields/cells/factories/statusPill.js +13 -26
- package/dist-lib/components/fields/cells/factories/tagList.js +13 -26
- package/dist-lib/components/pages/SmartDetailPage.impl.js +416 -415
- package/dist-lib/components/pages/auth/AuthShell.js +57 -76
- package/dist-lib/components/pages/list/ListCardRow.js +66 -66
- package/dist-lib/components/pages/list/columns.js +89 -89
- package/dist-lib/components/pages/profile/Profile.impl.js +130 -126
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +107 -109
- package/dist-lib/components/params/ParamsBlock.js +42 -37
- package/dist-lib/components/params/param-editors.js +20 -33
- package/dist-lib/components/primitives/Pill.js +36 -15
- package/dist-lib/components/shared/StatusGroupsDisplay.js +49 -49
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useDeclaredEnum.js +38 -0
- package/dist-lib/index.d.ts +34 -12
- package/dist-lib/index.js +123 -122
- package/dist-lib/lib/evidence-verdict.js +6 -5
- package/dist-lib/lib/fill-from.js +15 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/{useResponsiveMode-CgwjOaEE.d.ts → useResponsiveMode-CBSHZBY5.d.ts} +1 -0
- package/package.json +1 -1
|
@@ -21,28 +21,28 @@ import { FileDraftScope as x, useFileDraftScope as S } from "../../file-widgets/
|
|
|
21
21
|
import { buildFilesPayload as C } from "../../file-widgets/payload.js";
|
|
22
22
|
import { getFileFieldValue as w, renderSchemaField as T } from "../../file-widgets/host.js";
|
|
23
23
|
import { singleFileFromValue as E } from "../../file-widgets/value.js";
|
|
24
|
-
import { DynamicIcon as
|
|
25
|
-
import { toast as
|
|
26
|
-
import { useSchema as
|
|
27
|
-
import { useBrandingChrome as
|
|
28
|
-
import { useCurrentScreen as
|
|
24
|
+
import { DynamicIcon as ee } from "../../shared/DynamicIcon.js";
|
|
25
|
+
import { toast as D } from "../../../lib/toast.js";
|
|
26
|
+
import { useSchema as O } from "../../../hooks/useSchema.js";
|
|
27
|
+
import { useBrandingChrome as k } from "../../../hooks/useBrandingChrome.js";
|
|
28
|
+
import { useCurrentScreen as A } from "../../../hooks/useCurrentScreen.js";
|
|
29
29
|
import { useObject as te } from "../../../hooks/useObject.js";
|
|
30
30
|
import { useResponsiveMode as j } from "../../../hooks/useResponsiveMode.js";
|
|
31
31
|
import { AssociatedBlock as M } from "../../detail-layout/AssociatedBlock.js";
|
|
32
32
|
import { ParamsBlock as N } from "../../params/ParamsBlock.js";
|
|
33
33
|
import { ErrorLine as P } from "../../params/param-editors.js";
|
|
34
|
-
import { useAllParams as F } from "../../../hooks/useParams.js";
|
|
35
|
-
import { useText as
|
|
36
|
-
import { failureTitle as
|
|
37
|
-
import { LANGUAGE_PARAMETER as
|
|
38
|
-
import { activeRoleLabel as
|
|
39
|
-
import { Fragment as
|
|
40
|
-
import { Fragment as
|
|
34
|
+
import { useAllParams as F, useEffectiveParam as I } from "../../../hooks/useParams.js";
|
|
35
|
+
import { useText as L } from "../../../hooks/useText.js";
|
|
36
|
+
import { failureTitle as R } from "../../../lib/failure.js";
|
|
37
|
+
import { LANGUAGE_PARAMETER as z, pluralText as ne } from "../../../lib/language.js";
|
|
38
|
+
import { activeRoleLabel as re } from "../../../lib/role-label.js";
|
|
39
|
+
import { Fragment as B, useId as V, useState as H } from "react";
|
|
40
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
41
41
|
// src/components/pages/profile/Profile.impl.tsx
|
|
42
|
-
var
|
|
43
|
-
function
|
|
44
|
-
let a = t(), c = v((e) => e.user), l = v((e) => e.activeTenant), u = v((e) => e.refreshMe), { data: b } =
|
|
45
|
-
entity:
|
|
42
|
+
var K = "avatar", q = "user_messenger_account", ie = "profile.blocks", ae = "profile.parameters";
|
|
43
|
+
function J() {
|
|
44
|
+
let a = t(), c = v((e) => e.user), l = v((e) => e.activeTenant), u = v((e) => e.refreshMe), { data: b } = O(), S = A(), C = k("custom"), w = L(), E = te(e, c?.id), j = E.data?.data, M = I(ie).value ?? void 0, N = (e) => !M || M.includes(e), P = I(ae).value ?? void 0, [F, R] = H(!1), [z, B] = H(!1), V = b?.entities[e], K = c?.display_name || c?.email || w("profile.user_fallback", "User"), q = (e) => w(c?.role_names?.[e]) || e, J = re(c, w), Z = l?.env ? `${l.name} · ${l.env}` : l?.name ?? "—", $ = (e) => V && T({
|
|
45
|
+
entity: V,
|
|
46
46
|
entityCode: "profile",
|
|
47
47
|
fieldName: e,
|
|
48
48
|
record: {
|
|
@@ -52,33 +52,33 @@ function ne() {
|
|
|
52
52
|
mode: "display",
|
|
53
53
|
t: w
|
|
54
54
|
});
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
header: /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ G(U, { children: [
|
|
56
|
+
/* @__PURE__ */ G(d, {
|
|
57
|
+
header: /* @__PURE__ */ W("div", {
|
|
58
58
|
"data-testid": "profile-hero",
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
-
icon:
|
|
61
|
-
name:
|
|
59
|
+
children: /* @__PURE__ */ W(f, {
|
|
60
|
+
icon: V?.display.icon ? /* @__PURE__ */ W(ee, {
|
|
61
|
+
name: V.display.icon,
|
|
62
62
|
size: 16
|
|
63
63
|
}) : void 0,
|
|
64
|
-
title:
|
|
64
|
+
title: K,
|
|
65
65
|
mode: "display",
|
|
66
66
|
showTitle: C.isVisible("show_title"),
|
|
67
|
-
highlights: /* @__PURE__ */
|
|
67
|
+
highlights: /* @__PURE__ */ G("div", {
|
|
68
68
|
className: "flex flex-wrap gap-1",
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ W(o, {
|
|
71
71
|
tone: "violet",
|
|
72
72
|
size: "xs",
|
|
73
73
|
dot: !0,
|
|
74
|
-
children:
|
|
74
|
+
children: J
|
|
75
75
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ W(o, {
|
|
77
77
|
tone: "slate",
|
|
78
78
|
size: "xs",
|
|
79
|
-
children:
|
|
79
|
+
children: Z
|
|
80
80
|
}),
|
|
81
|
-
c?.is_active && /* @__PURE__ */
|
|
81
|
+
c?.is_active && /* @__PURE__ */ W(o, {
|
|
82
82
|
tone: "emerald",
|
|
83
83
|
size: "xs",
|
|
84
84
|
dot: !0,
|
|
@@ -86,100 +86,103 @@ function ne() {
|
|
|
86
86
|
})
|
|
87
87
|
]
|
|
88
88
|
}),
|
|
89
|
-
right: C.isVisible("show_actions") && /* @__PURE__ */
|
|
90
|
-
icon: /* @__PURE__ */
|
|
91
|
-
onClick: () =>
|
|
89
|
+
right: C.isVisible("show_actions") && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(n, {
|
|
90
|
+
icon: /* @__PURE__ */ W(i.edit, { size: 13 }),
|
|
91
|
+
onClick: () => B(!0),
|
|
92
92
|
children: w("profile.edit", "Edit profile")
|
|
93
|
-
}), /* @__PURE__ */
|
|
94
|
-
icon: /* @__PURE__ */
|
|
93
|
+
}), /* @__PURE__ */ W(n, {
|
|
94
|
+
icon: /* @__PURE__ */ W(i.settings, { size: 13 }),
|
|
95
95
|
onClick: () => a("/preferences", { topLevel: !0 }),
|
|
96
96
|
children: w("profile.preferences", "Preferences")
|
|
97
97
|
})] })
|
|
98
98
|
})
|
|
99
99
|
}),
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ W(s, {
|
|
102
102
|
title: w("profile.personal.title", "Personal info"),
|
|
103
|
-
icon: /* @__PURE__ */
|
|
104
|
-
children: /* @__PURE__ */
|
|
103
|
+
icon: /* @__PURE__ */ W(i.users, { size: 14 }),
|
|
104
|
+
children: /* @__PURE__ */ W("div", {
|
|
105
105
|
"data-testid": "profile-personal-info-grid",
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
c &&
|
|
106
|
+
children: /* @__PURE__ */ G(m, { children: [
|
|
107
|
+
c && V && j && /* @__PURE__ */ W(p, {
|
|
108
108
|
label: w("profile.avatar", "Avatar"),
|
|
109
|
-
children: /* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ W(x, { children: /* @__PURE__ */ W(oe, {
|
|
110
110
|
userId: c.id,
|
|
111
|
-
entity:
|
|
111
|
+
entity: V,
|
|
112
112
|
record: j,
|
|
113
113
|
onCommitted: async () => {
|
|
114
114
|
await E.refetch();
|
|
115
115
|
}
|
|
116
116
|
}, Y(j)) })
|
|
117
117
|
}),
|
|
118
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ W(p, {
|
|
119
119
|
label: w("profile.display_name", "Display name"),
|
|
120
|
-
children:
|
|
120
|
+
children: $("display_name")
|
|
121
121
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ W(p, {
|
|
123
123
|
label: w("profile.personal.email", "Email"),
|
|
124
124
|
"data-testid": "profile-email",
|
|
125
|
-
children:
|
|
125
|
+
children: $("email")
|
|
126
126
|
}),
|
|
127
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ W(p, {
|
|
128
128
|
label: w("profile.personal.timezone", "Timezone"),
|
|
129
|
-
children:
|
|
129
|
+
children: ce()
|
|
130
130
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ W(Q, {})
|
|
132
132
|
] })
|
|
133
133
|
})
|
|
134
134
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ W(s, {
|
|
136
136
|
title: w("profile.security.title", "Security"),
|
|
137
|
-
icon: /* @__PURE__ */
|
|
138
|
-
children: /* @__PURE__ */
|
|
137
|
+
icon: /* @__PURE__ */ W(i.shield, { size: 14 }),
|
|
138
|
+
children: /* @__PURE__ */ W(m, { children: /* @__PURE__ */ W(p, {
|
|
139
139
|
label: w("profile.security.password", "Password"),
|
|
140
140
|
hint: w("profile.security.password_hint", "Update at any time"),
|
|
141
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ W(n, {
|
|
142
142
|
size: "xs",
|
|
143
|
-
onClick: () =>
|
|
143
|
+
onClick: () => R(!0),
|
|
144
144
|
children: w("profile.security.password_change", "Change")
|
|
145
145
|
})
|
|
146
146
|
}) })
|
|
147
147
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
148
|
+
N("access") && /* @__PURE__ */ W(s, {
|
|
149
149
|
title: w("profile.access.title", "Access"),
|
|
150
|
-
icon: /* @__PURE__ */
|
|
151
|
-
children: /* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
150
|
+
icon: /* @__PURE__ */ W(i.key, { size: 14 }),
|
|
151
|
+
children: /* @__PURE__ */ G(m, { children: [
|
|
152
|
+
/* @__PURE__ */ W(p, {
|
|
153
153
|
label: w("profile.access.role", "Role"),
|
|
154
|
-
children: /* @__PURE__ */
|
|
154
|
+
children: /* @__PURE__ */ W(o, {
|
|
155
155
|
tone: "violet",
|
|
156
156
|
size: "xs",
|
|
157
157
|
dot: !0,
|
|
158
|
-
children:
|
|
158
|
+
children: J
|
|
159
159
|
})
|
|
160
160
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ W(p, {
|
|
162
162
|
label: w("profile.access.groups", "Groups"),
|
|
163
|
-
children: c?.roles && c.roles.length > 0 ? /* @__PURE__ */
|
|
163
|
+
children: c?.roles && c.roles.length > 0 ? /* @__PURE__ */ W("div", {
|
|
164
164
|
className: "flex flex-wrap gap-1",
|
|
165
|
-
children: c.roles.map((e) => /* @__PURE__ */
|
|
165
|
+
children: c.roles.map((e) => /* @__PURE__ */ W(r, { children: q(e) }, e))
|
|
166
166
|
}) : g
|
|
167
167
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ W(p, {
|
|
169
169
|
label: w("profile.access.permissions", "Permissions"),
|
|
170
|
-
children: c?.permissions?.includes("*") ? w("profile.access.permissions_all", "All") :
|
|
170
|
+
children: c?.permissions?.includes("*") ? w("profile.access.permissions_all", "All") : ne(w, "profile.access.permissions_from_roles", c?.permissions?.length ?? 0, {
|
|
171
171
|
one: "{count} from roles",
|
|
172
172
|
other: "{count} from roles"
|
|
173
173
|
})
|
|
174
174
|
})
|
|
175
175
|
] })
|
|
176
176
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
c?.id && /* @__PURE__ */
|
|
180
|
-
|
|
177
|
+
N("api_keys") && /* @__PURE__ */ W(le, { userId: c?.id }),
|
|
178
|
+
N("messenger_accounts") && /* @__PURE__ */ W(ue, { userId: c?.id }),
|
|
179
|
+
c?.id && N("parameters") && /* @__PURE__ */ W(X, {
|
|
180
|
+
userId: c.id,
|
|
181
|
+
only: P
|
|
182
|
+
}),
|
|
183
|
+
S?.screen && b && V && j && /* @__PURE__ */ W(h, {
|
|
181
184
|
screen: S.screen,
|
|
182
|
-
entity:
|
|
185
|
+
entity: V,
|
|
183
186
|
entityCode: "profile",
|
|
184
187
|
record: j,
|
|
185
188
|
recordId: c?.id,
|
|
@@ -187,32 +190,32 @@ function ne() {
|
|
|
187
190
|
})
|
|
188
191
|
]
|
|
189
192
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
open:
|
|
193
|
+
/* @__PURE__ */ W(se, {
|
|
194
|
+
open: z,
|
|
192
195
|
initialName: c?.display_name ?? "",
|
|
193
196
|
userId: c?.id ?? "",
|
|
194
|
-
onClose: () =>
|
|
197
|
+
onClose: () => B(!1),
|
|
195
198
|
onSaved: async () => {
|
|
196
|
-
await u(),
|
|
199
|
+
await u(), B(!1);
|
|
197
200
|
}
|
|
198
201
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
open:
|
|
201
|
-
onClose: () =>
|
|
202
|
+
/* @__PURE__ */ W(_, {
|
|
203
|
+
open: F,
|
|
204
|
+
onClose: () => R(!1),
|
|
202
205
|
onSubmit: async ({ current: e, next: t }) => {
|
|
203
|
-
await y(e, t),
|
|
206
|
+
await y(e, t), D.success(w("profile.password.changed", "Password changed. Sign in again to continue."));
|
|
204
207
|
}
|
|
205
208
|
})
|
|
206
209
|
] });
|
|
207
210
|
}
|
|
208
211
|
function Y(e) {
|
|
209
|
-
return E(w(e,
|
|
212
|
+
return E(w(e, K))?.id ?? "";
|
|
210
213
|
}
|
|
211
|
-
function
|
|
212
|
-
let a =
|
|
214
|
+
function oe({ userId: t, entity: n, record: r, onCommitted: i }) {
|
|
215
|
+
let a = L(), o = L("errors"), s = S(), [c, l] = H(!1), [u, d] = H(0), f = async (c) => {
|
|
213
216
|
let u = C({
|
|
214
217
|
entity: n,
|
|
215
|
-
formData: { [
|
|
218
|
+
formData: { [K]: c },
|
|
216
219
|
record: r,
|
|
217
220
|
isNew: !1
|
|
218
221
|
});
|
|
@@ -220,19 +223,19 @@ function re({ userId: t, entity: n, record: r, onCommitted: i }) {
|
|
|
220
223
|
l(!0);
|
|
221
224
|
try {
|
|
222
225
|
await b(e, { id: t }, { $files: u });
|
|
223
|
-
let n = Y({ [
|
|
224
|
-
n && s.markCommitted(n), await i(),
|
|
226
|
+
let n = Y({ [K]: c });
|
|
227
|
+
n && s.markCommitted(n), await i(), D.success(a("profile.avatar.updated", "Avatar updated."));
|
|
225
228
|
} catch (e) {
|
|
226
|
-
await s.flushAllDrafts(), d((e) => e + 1),
|
|
229
|
+
await s.flushAllDrafts(), d((e) => e + 1), D.error(R(o, e));
|
|
227
230
|
} finally {
|
|
228
231
|
l(!1);
|
|
229
232
|
}
|
|
230
233
|
}
|
|
231
234
|
};
|
|
232
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ W(B, { children: T({
|
|
233
236
|
entity: n,
|
|
234
237
|
entityCode: e,
|
|
235
|
-
fieldName:
|
|
238
|
+
fieldName: K,
|
|
236
239
|
record: r,
|
|
237
240
|
mode: "edit",
|
|
238
241
|
onChange: (e) => void f(e),
|
|
@@ -241,13 +244,13 @@ function re({ userId: t, entity: n, record: r, onCommitted: i }) {
|
|
|
241
244
|
fieldId: "profile-avatar"
|
|
242
245
|
}) }, u);
|
|
243
246
|
}
|
|
244
|
-
function
|
|
245
|
-
let f = j().isPhone, p =
|
|
247
|
+
function se({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
|
|
248
|
+
let f = j().isPhone, p = L(), m = L("errors"), h = V(), [g, _] = H(r), [v, y] = H(!1), [x, S] = H(null);
|
|
246
249
|
if (!t) return null;
|
|
247
250
|
let C = () => {
|
|
248
251
|
_(r), S(null), s();
|
|
249
252
|
};
|
|
250
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
251
254
|
onClick: C,
|
|
252
255
|
style: {
|
|
253
256
|
position: "fixed",
|
|
@@ -256,7 +259,7 @@ function ie({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
|
|
|
256
259
|
zIndex: 60,
|
|
257
260
|
backdropFilter: "blur(2px)"
|
|
258
261
|
}
|
|
259
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ G("div", {
|
|
260
263
|
"data-testid": "edit-profile-dialog",
|
|
261
264
|
style: {
|
|
262
265
|
position: "fixed",
|
|
@@ -273,7 +276,7 @@ function ie({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
|
|
|
273
276
|
overflow: "hidden"
|
|
274
277
|
},
|
|
275
278
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ G("div", {
|
|
277
280
|
style: {
|
|
278
281
|
padding: "14px 18px 0",
|
|
279
282
|
display: "flex",
|
|
@@ -281,7 +284,7 @@ function ie({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
|
|
|
281
284
|
gap: 10
|
|
282
285
|
},
|
|
283
286
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ W("span", {
|
|
285
288
|
style: {
|
|
286
289
|
width: 28,
|
|
287
290
|
height: 28,
|
|
@@ -292,18 +295,18 @@ function ie({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
|
|
|
292
295
|
alignItems: "center",
|
|
293
296
|
justifyContent: "center"
|
|
294
297
|
},
|
|
295
|
-
children: /* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */ W(i.edit, { size: 15 })
|
|
296
299
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ G("div", {
|
|
298
301
|
style: { flex: 1 },
|
|
299
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ W("div", {
|
|
300
303
|
style: {
|
|
301
304
|
fontSize: 14,
|
|
302
305
|
fontWeight: 600,
|
|
303
306
|
color: "var(--text)"
|
|
304
307
|
},
|
|
305
308
|
children: p("profile.edit", "Edit profile")
|
|
306
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ W("div", {
|
|
307
310
|
style: {
|
|
308
311
|
fontSize: 11.5,
|
|
309
312
|
color: "var(--text-3)"
|
|
@@ -311,33 +314,33 @@ function ie({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
|
|
|
311
314
|
children: p("profile.edit.subtitle", "Update your display name.")
|
|
312
315
|
})]
|
|
313
316
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
icon: /* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ W(a, {
|
|
318
|
+
icon: /* @__PURE__ */ W(i.x, { size: 14 }),
|
|
316
319
|
title: p("profile.edit.close", "Close"),
|
|
317
320
|
onClick: C
|
|
318
321
|
})
|
|
319
322
|
]
|
|
320
323
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ G("div", {
|
|
322
325
|
style: {
|
|
323
326
|
padding: "12px 18px 16px",
|
|
324
327
|
display: "flex",
|
|
325
328
|
flexDirection: "column",
|
|
326
329
|
gap: 12
|
|
327
330
|
},
|
|
328
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W(c, {
|
|
329
332
|
required: !0,
|
|
330
333
|
htmlFor: h,
|
|
331
334
|
children: p("profile.display_name", "Display name")
|
|
332
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ W(l, {
|
|
333
336
|
id: h,
|
|
334
337
|
value: g,
|
|
335
338
|
onChange: _,
|
|
336
339
|
placeholder: p("profile.edit.name_placeholder", "Your name"),
|
|
337
340
|
autoFocus: !0
|
|
338
|
-
})] }), x && /* @__PURE__ */
|
|
341
|
+
})] }), x && /* @__PURE__ */ W(P, { text: x })]
|
|
339
342
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ G("div", {
|
|
341
344
|
style: {
|
|
342
345
|
padding: "10px 16px",
|
|
343
346
|
borderTop: "1px solid var(--divider)",
|
|
@@ -348,14 +351,14 @@ function ie({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
|
|
|
348
351
|
flexWrap: f ? "wrap" : "nowrap"
|
|
349
352
|
},
|
|
350
353
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ W("div", { style: { flex: 1 } }),
|
|
355
|
+
/* @__PURE__ */ W(n, {
|
|
353
356
|
onClick: C,
|
|
354
357
|
children: p("dialog.cancel", "Cancel")
|
|
355
358
|
}),
|
|
356
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ W(n, {
|
|
357
360
|
kind: "primary",
|
|
358
|
-
icon:
|
|
361
|
+
icon: W(v ? u : i.check, { size: 13 }),
|
|
359
362
|
onClick: async () => {
|
|
360
363
|
if (!g.trim()) S(p("profile.edit.name_required", "Display name is required."));
|
|
361
364
|
else {
|
|
@@ -363,7 +366,7 @@ function ie({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
|
|
|
363
366
|
try {
|
|
364
367
|
await b(e, { id: o }, { display_name: g.trim() }), await d();
|
|
365
368
|
} catch (e) {
|
|
366
|
-
S(
|
|
369
|
+
S(R(m, e));
|
|
367
370
|
} finally {
|
|
368
371
|
y(!1);
|
|
369
372
|
}
|
|
@@ -377,51 +380,52 @@ function ie({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
|
|
|
377
380
|
]
|
|
378
381
|
})] });
|
|
379
382
|
}
|
|
380
|
-
function
|
|
383
|
+
function ce() {
|
|
381
384
|
try {
|
|
382
385
|
return Intl.DateTimeFormat().resolvedOptions().timeZone || "—";
|
|
383
386
|
} catch {
|
|
384
387
|
return "—";
|
|
385
388
|
}
|
|
386
389
|
}
|
|
387
|
-
function X({ userId: t }) {
|
|
388
|
-
let { data:
|
|
389
|
-
return /* @__PURE__ */
|
|
390
|
+
function X({ userId: t, only: n }) {
|
|
391
|
+
let { data: r } = O(), i = Z(r);
|
|
392
|
+
return /* @__PURE__ */ W(N, {
|
|
390
393
|
carrierEntityCode: e,
|
|
391
|
-
carrierScope:
|
|
392
|
-
rowId: t
|
|
394
|
+
carrierScope: i,
|
|
395
|
+
rowId: t,
|
|
396
|
+
only: n
|
|
393
397
|
});
|
|
394
398
|
}
|
|
395
399
|
function Z(e) {
|
|
396
400
|
return e?.entities.profile?.params_scope ?? "profile";
|
|
397
401
|
}
|
|
398
402
|
function Q() {
|
|
399
|
-
let e =
|
|
403
|
+
let e = L(), { data: t } = O(), n = F().data?.params.find((e) => e.code === z);
|
|
400
404
|
if (n?.scopes?.includes(Z(t))) return null;
|
|
401
405
|
let r = typeof n?.value == "string" ? n.value : e.language, i = t?.languages?.find((e) => e.code === r);
|
|
402
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ W(p, {
|
|
403
407
|
label: e(n?.name),
|
|
404
|
-
children: n ? i?.name[i.code] || e(i?.name) || r : /* @__PURE__ */
|
|
408
|
+
children: n ? i?.name[i.code] || e(i?.name) || r : /* @__PURE__ */ W(u, { size: 12 })
|
|
405
409
|
});
|
|
406
410
|
}
|
|
407
|
-
function
|
|
408
|
-
return /* @__PURE__ */
|
|
411
|
+
function le({ userId: e }) {
|
|
412
|
+
return /* @__PURE__ */ W($, {
|
|
409
413
|
userId: e,
|
|
410
414
|
associated: "api_key"
|
|
411
415
|
});
|
|
412
416
|
}
|
|
413
|
-
function
|
|
414
|
-
let { data: t } =
|
|
415
|
-
return t?.entities[
|
|
417
|
+
function ue({ userId: e }) {
|
|
418
|
+
let { data: t } = O();
|
|
419
|
+
return t?.entities[q] ? /* @__PURE__ */ W($, {
|
|
416
420
|
userId: e,
|
|
417
|
-
associated:
|
|
421
|
+
associated: q
|
|
418
422
|
}) : null;
|
|
419
423
|
}
|
|
420
424
|
function $({ userId: t, associated: n }) {
|
|
421
|
-
let { data: r } =
|
|
425
|
+
let { data: r } = O();
|
|
422
426
|
if (!t || !r) return null;
|
|
423
427
|
let i = r.entities[e];
|
|
424
|
-
return i ? /* @__PURE__ */
|
|
428
|
+
return i ? /* @__PURE__ */ W(M, {
|
|
425
429
|
node: {
|
|
426
430
|
associated: n,
|
|
427
431
|
foreign_key: "user_id",
|
|
@@ -438,4 +442,4 @@ function $({ userId: t, associated: n }) {
|
|
|
438
442
|
}
|
|
439
443
|
}) : null;
|
|
440
444
|
}
|
|
441
|
-
export {
|
|
445
|
+
export { J as Profile, Q as ProfileLanguageRow, X as ProfileParamsBlock };
|