@alfadocs/ui-kit 0.84.0 → 0.85.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/_chunks/{ai-consent-banner-DUhr1yNj.js → ai-consent-banner-BXD7W6FI.js} +2 -2
- package/dist/_chunks/{alert-KJbsPYkI.js → alert-Cxaqd-QO.js} +12 -12
- package/dist/_chunks/{audio-recorder-Cc3KuL9y.js → audio-recorder-BjnB7V8n.js} +2 -2
- package/dist/_chunks/{booking-CLmeXtGv.js → booking-BvCu2XWY.js} +2 -2
- package/dist/_chunks/{document-preview-nwfulDEs.js → document-preview-DXl9migE.js} +2 -2
- package/dist/_chunks/{document-scanner-B6h1Ir56.js → document-scanner-cS_ispQs.js} +3 -3
- package/dist/_chunks/{entity-summary--vP698Jn.js → entity-summary-BILN4wEG.js} +2 -2
- package/dist/_chunks/{field-value-DHG6gEKS.js → field-value-BRVbZJej.js} +133 -144
- package/dist/_chunks/{file-manager-DLJlinIO.js → file-manager-B9LZzT5E.js} +129 -129
- package/dist/_chunks/{file-upload-DENvuhfs.js → file-upload-CwxdqkMK.js} +134 -146
- package/dist/_chunks/{freemium-paywall-CmV642PA.js → freemium-paywall-Dr2342_S.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-Br2yebEK.js → marketplace-app-shell-Chcj4q4z.js} +2 -2
- package/dist/_chunks/message-square-Bye4ATvx.js +20 -0
- package/dist/_chunks/{notes-panel-Cvdp818a.js → notes-panel-BLjlYBt-.js} +2 -2
- package/dist/_chunks/{patient-details-COvYWp2e.js → patient-details-B9LCdyWW.js} +2 -2
- package/dist/_chunks/{patient-search-BaUJ_Y-N.js → patient-search-vtRTSdf6.js} +2 -2
- package/dist/_chunks/{patient-summary-card-D6kgdTNn.js → patient-summary-card-vn1H4xWj.js} +2 -2
- package/dist/_chunks/{patient-table-BHzmUbzu.js → patient-table-B6AKMTm3.js} +182 -196
- package/dist/_chunks/{payment-form-DL9xk9BA.js → payment-form-BoGxEmGn.js} +2 -2
- package/dist/_chunks/{payment-request-card-d-RmzsUd.js → payment-request-card-CygO1anM.js} +72 -70
- package/dist/_chunks/{pdf-viewer-DF3VMaPo.js → pdf-viewer-CcOuR2wj.js} +2 -2
- package/dist/_chunks/{practice-results-BCr7jMt1.js → practice-results-yKbwIxqa.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-CxF9pVxd.js → radiograph-panel.agent-M9XD4ze4.js} +2 -2
- package/dist/_chunks/{rich-text-editor-CCWjNkbx.js → rich-text-editor-RRkBN_WB.js} +2 -2
- package/dist/_chunks/{session-countdown-C8AsE072.js → session-countdown-Bc70VXN1.js} +58 -48
- package/dist/_chunks/{sign-document-Bfk0WpWV.js → sign-document-DI561d1C.js} +2 -2
- package/dist/_chunks/{signature-request-CEOrCDyk.js → signature-request-D_6jgDZd.js} +60 -77
- package/dist/_chunks/{task-tray-Br3vc0O1.js → task-tray-CLIqIXUZ.js} +58 -70
- package/dist/_chunks/{toast.agent-uV8CeAy6.js → toast.agent-Iw2jWdce.js} +2 -2
- package/dist/_chunks/{warning-stack-BlG_Ujy3.js → warning-stack-CAHQ0xxS.js} +2 -2
- package/dist/_chunks/{workflow-map-C643Q43h.js → workflow-map-SIfAhmWz.js} +2 -2
- package/dist/agent-catalog.json +1 -1
- package/dist/components/ai-consent-banner/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/select/select.d.ts +8 -5
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/index.js +434 -445
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +5 -3
- package/dist/_chunks/circle-x-W8Enq3i4.js +0 -16
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { useMemo as O, useCallback as D, useState as
|
|
1
|
+
import { useMemo as O, useCallback as D, useState as E, cloneElement as X } from "react";
|
|
2
2
|
import { u as J } from "./use-controllable-state-BiY4xTzM.js";
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useTranslation as
|
|
3
|
+
import { jsxs as I, jsx as r, Fragment as Q } from "react/jsx-runtime";
|
|
4
|
+
import { useTranslation as P } from "react-i18next";
|
|
5
5
|
import { B as W } from "./button-CPGiR_bH.js";
|
|
6
|
-
import { I as
|
|
7
|
-
import { C as
|
|
6
|
+
import { I as j } from "./icon-button-C_kbcd7I.js";
|
|
7
|
+
import { C as $ } from "./checkbox-BuZ1u__2.js";
|
|
8
8
|
import { P as T } from "./popover-Cc0a69sw.js";
|
|
9
9
|
import { S as Y } from "./separator-CYU_bGFn.js";
|
|
10
|
-
import {
|
|
11
|
-
import { G as
|
|
12
|
-
import { B as
|
|
13
|
-
import { L as
|
|
14
|
-
import { T as
|
|
15
|
-
import { H as
|
|
16
|
-
import { C as
|
|
10
|
+
import { S as Z } from "./settings-d25ju_6L.js";
|
|
11
|
+
import { G as ee } from "./grip-vertical-onSb1JXO.js";
|
|
12
|
+
import { B as H } from "./badge-DCOqV9mI.js";
|
|
13
|
+
import { L as te } from "./link-CPb_pZPr.js";
|
|
14
|
+
import { T as ne } from "./transaction-chip-DJCstquX.js";
|
|
15
|
+
import { H as re } from "./hash-CSQ9SChR.js";
|
|
16
|
+
import { C as ae } from "./calendar-days-BGWklvE-.js";
|
|
17
|
+
import { c as U } from "./createLucideIcon-DhHxpK9K.js";
|
|
17
18
|
import { U as se } from "./user-B12p7bVF.js";
|
|
18
19
|
/**
|
|
19
20
|
* @license lucide-react v1.22.0 - ISC
|
|
@@ -21,7 +22,7 @@ import { U as se } from "./user-B12p7bVF.js";
|
|
|
21
22
|
* This source code is licensed under the ISC license.
|
|
22
23
|
* See the LICENSE file in the root directory of this source tree.
|
|
23
24
|
*/
|
|
24
|
-
const
|
|
25
|
+
const ie = [
|
|
25
26
|
["path", { d: "M5 22h14", key: "ehvnwv" }],
|
|
26
27
|
["path", { d: "M5 2h14", key: "pdyrp9" }],
|
|
27
28
|
[
|
|
@@ -35,62 +36,50 @@ const ae = [
|
|
|
35
36
|
"path",
|
|
36
37
|
{ d: "M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2", key: "1vvvr6" }
|
|
37
38
|
]
|
|
38
|
-
],
|
|
39
|
+
], oe = U("hourglass", ie);
|
|
39
40
|
/**
|
|
40
41
|
* @license lucide-react v1.22.0 - ISC
|
|
41
42
|
*
|
|
42
43
|
* This source code is licensed under the ISC license.
|
|
43
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
44
45
|
*/
|
|
45
|
-
const
|
|
46
|
+
const le = [
|
|
46
47
|
["path", { d: "M16 3h5v5", key: "1806ms" }],
|
|
47
48
|
["path", { d: "m21 3-6.75 6.75", key: "pv0uzu" }],
|
|
48
49
|
["circle", { cx: "10", cy: "14", r: "6", key: "1qwbdc" }]
|
|
49
|
-
], ce =
|
|
50
|
-
/**
|
|
51
|
-
* @license lucide-react v1.22.0 - ISC
|
|
52
|
-
*
|
|
53
|
-
* This source code is licensed under the ISC license.
|
|
54
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
-
*/
|
|
56
|
-
const le = [
|
|
57
|
-
["path", { d: "M14 17H5", key: "gfn3mx" }],
|
|
58
|
-
["path", { d: "M19 7h-9", key: "6i9tg" }],
|
|
59
|
-
["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
|
|
60
|
-
["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
|
|
61
|
-
], de = P("settings-2", le);
|
|
50
|
+
], ce = U("mars", le);
|
|
62
51
|
/**
|
|
63
52
|
* @license lucide-react v1.22.0 - ISC
|
|
64
53
|
*
|
|
65
54
|
* This source code is licensed under the ISC license.
|
|
66
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
56
|
*/
|
|
68
|
-
const
|
|
57
|
+
const de = [
|
|
69
58
|
["path", { d: "M12 15v7", key: "t2xh3l" }],
|
|
70
59
|
["path", { d: "M9 19h6", key: "456am0" }],
|
|
71
60
|
["circle", { cx: "12", cy: "9", r: "6", key: "1nw4tq" }]
|
|
72
|
-
],
|
|
61
|
+
], ue = U("venus", de);
|
|
73
62
|
function G(e) {
|
|
74
63
|
return e.flatMap((d) => d.fields.map((t) => t.id));
|
|
75
64
|
}
|
|
76
|
-
function
|
|
77
|
-
const t = d ?? G(e), m = new Map(t.map((
|
|
78
|
-
return e.map((
|
|
79
|
-
section:
|
|
80
|
-
fields:
|
|
65
|
+
function ze(e, d) {
|
|
66
|
+
const t = d ?? G(e), m = new Map(t.map((s, y) => [s, y]));
|
|
67
|
+
return e.map((s) => ({
|
|
68
|
+
section: s,
|
|
69
|
+
fields: s.fields.filter((y) => m.has(y.id)).sort(
|
|
81
70
|
(y, S) => m.get(y.id) - m.get(S.id)
|
|
82
71
|
)
|
|
83
72
|
}));
|
|
84
73
|
}
|
|
85
|
-
function
|
|
86
|
-
const
|
|
74
|
+
function Pe(e, { value: d, defaultValue: t, onChange: m } = {}) {
|
|
75
|
+
const s = O(
|
|
87
76
|
() => G(e),
|
|
88
77
|
[e]
|
|
89
78
|
), [y, S] = J({
|
|
90
79
|
value: d,
|
|
91
|
-
defaultValue: t ??
|
|
80
|
+
defaultValue: t ?? s,
|
|
92
81
|
onChange: m
|
|
93
|
-
}), i = y ?? t ??
|
|
82
|
+
}), i = y ?? t ?? s, x = O(() => {
|
|
94
83
|
const p = /* @__PURE__ */ new Map();
|
|
95
84
|
for (const f of e)
|
|
96
85
|
for (const g of f.fields)
|
|
@@ -101,7 +90,7 @@ function ze(e, { value: d, defaultValue: t, onChange: m } = {}) {
|
|
|
101
90
|
S(p.filter((f) => x.has(f)));
|
|
102
91
|
},
|
|
103
92
|
[S, x]
|
|
104
|
-
),
|
|
93
|
+
), M = D(
|
|
105
94
|
(p) => {
|
|
106
95
|
u(
|
|
107
96
|
i.includes(p) ? i.filter((f) => f !== p) : [...i, p]
|
|
@@ -113,7 +102,7 @@ function ze(e, { value: d, defaultValue: t, onChange: m } = {}) {
|
|
|
113
102
|
var w;
|
|
114
103
|
const g = ((w = e.find((o) => o.id === p)) == null ? void 0 : w.fields.map((o) => o.id)) ?? [], V = new Set(g);
|
|
115
104
|
if (f) {
|
|
116
|
-
const o = g.filter((
|
|
105
|
+
const o = g.filter((l) => !i.includes(l));
|
|
117
106
|
u([...i, ...o]);
|
|
118
107
|
} else
|
|
119
108
|
u(i.filter((o) => !V.has(o)));
|
|
@@ -126,94 +115,94 @@ function ze(e, { value: d, defaultValue: t, onChange: m } = {}) {
|
|
|
126
115
|
const g = (A = x.get(p)) == null ? void 0 : A.sectionId, V = (n = x.get(f)) == null ? void 0 : n.sectionId;
|
|
127
116
|
if (!g || g !== V) return;
|
|
128
117
|
const w = new Set(
|
|
129
|
-
((C = e.find((
|
|
130
|
-
), o = i.filter((
|
|
131
|
-
if (
|
|
132
|
-
const [
|
|
133
|
-
o.splice(v, 0,
|
|
118
|
+
((C = e.find((c) => c.id === g)) == null ? void 0 : C.fields.map((c) => c.id)) ?? []
|
|
119
|
+
), o = i.filter((c) => w.has(c)), l = o.indexOf(p), v = o.indexOf(f);
|
|
120
|
+
if (l < 0 || v < 0) return;
|
|
121
|
+
const [b] = o.splice(l, 1);
|
|
122
|
+
o.splice(v, 0, b);
|
|
134
123
|
let h = 0;
|
|
135
|
-
const
|
|
136
|
-
(
|
|
124
|
+
const B = i.map(
|
|
125
|
+
(c) => w.has(c) ? o[h++] : c
|
|
137
126
|
);
|
|
138
|
-
u(
|
|
127
|
+
u(B);
|
|
139
128
|
},
|
|
140
129
|
[x, e, i, u]
|
|
141
|
-
),
|
|
142
|
-
u(t ??
|
|
143
|
-
}, [t,
|
|
130
|
+
), _ = D(() => {
|
|
131
|
+
u(t ?? s);
|
|
132
|
+
}, [t, s, u]);
|
|
144
133
|
return {
|
|
145
134
|
visible: i,
|
|
146
|
-
catalogueIds:
|
|
135
|
+
catalogueIds: s,
|
|
147
136
|
fieldById: x,
|
|
148
137
|
setOrder: u,
|
|
149
|
-
toggleField:
|
|
138
|
+
toggleField: M,
|
|
150
139
|
toggleSection: L,
|
|
151
140
|
moveFieldOnto: N,
|
|
152
|
-
reset:
|
|
141
|
+
reset: _
|
|
153
142
|
};
|
|
154
143
|
}
|
|
155
|
-
function
|
|
144
|
+
function Le({
|
|
156
145
|
sections: e,
|
|
157
146
|
visible: d,
|
|
158
147
|
onToggleField: t,
|
|
159
148
|
onToggleSection: m,
|
|
160
|
-
onMoveFieldOnto:
|
|
149
|
+
onMoveFieldOnto: s,
|
|
161
150
|
onReset: y,
|
|
162
151
|
label: S
|
|
163
152
|
}) {
|
|
164
|
-
const { t: i } =
|
|
165
|
-
const
|
|
166
|
-
for (const
|
|
167
|
-
for (const h of
|
|
168
|
-
|
|
169
|
-
return { sectionOfField:
|
|
153
|
+
const { t: i } = P(), x = O(() => new Set(d), [d]), [u, M] = E(null), [L, N] = E(null), [_, p] = E(""), { sectionOfField: f, labelOfField: g } = O(() => {
|
|
154
|
+
const l = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
|
|
155
|
+
for (const b of e)
|
|
156
|
+
for (const h of b.fields)
|
|
157
|
+
l.set(h.id, b.id), v.set(h.id, h.label);
|
|
158
|
+
return { sectionOfField: l, labelOfField: v };
|
|
170
159
|
}, [e]), V = u ? f.get(u) : void 0, w = D(() => {
|
|
171
|
-
|
|
160
|
+
M(null), N(null);
|
|
172
161
|
}, []), o = D(
|
|
173
|
-
(
|
|
162
|
+
(l, v, b) => {
|
|
174
163
|
p(
|
|
175
164
|
i("fieldPicker.moved", {
|
|
176
|
-
field: g.get(
|
|
165
|
+
field: g.get(l) ?? "",
|
|
177
166
|
position: v + 1,
|
|
178
|
-
count:
|
|
167
|
+
count: b,
|
|
179
168
|
defaultValue: "Moved {{field}} to position {{position}} of {{count}}"
|
|
180
169
|
})
|
|
181
170
|
);
|
|
182
171
|
},
|
|
183
172
|
[i, g]
|
|
184
173
|
);
|
|
185
|
-
return /* @__PURE__ */
|
|
174
|
+
return /* @__PURE__ */ I(T.Root, { children: [
|
|
186
175
|
/* @__PURE__ */ r(T.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
|
|
187
|
-
|
|
176
|
+
j,
|
|
188
177
|
{
|
|
189
178
|
size: "sm",
|
|
190
179
|
intent: "outline",
|
|
191
|
-
icon: /* @__PURE__ */ r(
|
|
180
|
+
icon: /* @__PURE__ */ r(Z, { "aria-hidden": "true" }),
|
|
192
181
|
"aria-label": S ?? i("fieldPicker.trigger", { defaultValue: "Customize fields" }),
|
|
193
182
|
className: "ds:shrink-0"
|
|
194
183
|
}
|
|
195
184
|
) }),
|
|
196
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ I(T.Content, { align: "end", size: "sm", children: [
|
|
197
186
|
/* @__PURE__ */ r(T.Heading, { children: i("fieldPicker.title", { defaultValue: "Customize fields" }) }),
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
e.map((
|
|
200
|
-
const v =
|
|
187
|
+
/* @__PURE__ */ I("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:mt-[var(--spacing-xs)]", children: [
|
|
188
|
+
e.map((l) => {
|
|
189
|
+
const v = l.fields.map((n) => n.id), b = v.filter(
|
|
201
190
|
(n) => x.has(n)
|
|
202
191
|
).length, h = d.filter(
|
|
203
192
|
(n) => v.includes(n)
|
|
204
|
-
),
|
|
205
|
-
return /* @__PURE__ */
|
|
193
|
+
), B = b === 0 ? !1 : b === v.length ? !0 : "indeterminate", A = !!l.heading;
|
|
194
|
+
return /* @__PURE__ */ I(
|
|
206
195
|
"div",
|
|
207
196
|
{
|
|
208
197
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
209
198
|
children: [
|
|
210
199
|
A ? /* @__PURE__ */ r(
|
|
211
|
-
|
|
200
|
+
$,
|
|
212
201
|
{
|
|
213
202
|
size: "sm",
|
|
214
|
-
label:
|
|
215
|
-
checked:
|
|
216
|
-
onCheckedChange: (n) => m(
|
|
203
|
+
label: l.heading,
|
|
204
|
+
checked: B,
|
|
205
|
+
onCheckedChange: (n) => m(l.id, n === !0)
|
|
217
206
|
}
|
|
218
207
|
) : null,
|
|
219
208
|
/* @__PURE__ */ r(
|
|
@@ -223,26 +212,26 @@ function Pe({
|
|
|
223
212
|
"ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
224
213
|
A ? "ds:ps-[var(--spacing-md)]" : "ds:ps-0"
|
|
225
214
|
].join(" "),
|
|
226
|
-
children:
|
|
227
|
-
const C = x.has(n.id),
|
|
228
|
-
return /* @__PURE__ */
|
|
215
|
+
children: l.fields.map((n) => {
|
|
216
|
+
const C = x.has(n.id), c = h.indexOf(n.id), k = h.length, q = u === n.id, K = L === n.id && u !== null && u !== n.id && V === l.id;
|
|
217
|
+
return /* @__PURE__ */ I(
|
|
229
218
|
"li",
|
|
230
219
|
{
|
|
231
220
|
...C ? {
|
|
232
221
|
draggable: !0,
|
|
233
|
-
onDragStart: (
|
|
234
|
-
|
|
222
|
+
onDragStart: (a) => {
|
|
223
|
+
M(n.id), a.dataTransfer.effectAllowed = "move", a.dataTransfer.setData("text/plain", n.id);
|
|
235
224
|
},
|
|
236
|
-
onDragOver: (
|
|
237
|
-
u === null || V !==
|
|
225
|
+
onDragOver: (a) => {
|
|
226
|
+
u === null || V !== l.id || (a.preventDefault(), a.dataTransfer.dropEffect = "move", N(n.id));
|
|
238
227
|
},
|
|
239
228
|
onDragLeave: () => N(
|
|
240
|
-
(
|
|
229
|
+
(a) => a === n.id ? null : a
|
|
241
230
|
),
|
|
242
|
-
onDrop: (
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
|
|
231
|
+
onDrop: (a) => {
|
|
232
|
+
a.preventDefault();
|
|
233
|
+
const F = a.dataTransfer.getData("text/plain");
|
|
234
|
+
F && F !== n.id && f.get(F) === l.id && (s(F, n.id), o(F, c, k)), w();
|
|
246
235
|
},
|
|
247
236
|
onDragEnd: w
|
|
248
237
|
} : {},
|
|
@@ -253,7 +242,7 @@ function Pe({
|
|
|
253
242
|
].filter(Boolean).join(" "),
|
|
254
243
|
children: [
|
|
255
244
|
/* @__PURE__ */ r(
|
|
256
|
-
|
|
245
|
+
$,
|
|
257
246
|
{
|
|
258
247
|
size: "sm",
|
|
259
248
|
label: n.label,
|
|
@@ -262,40 +251,40 @@ function Pe({
|
|
|
262
251
|
}
|
|
263
252
|
),
|
|
264
253
|
C ? /* @__PURE__ */ r(
|
|
265
|
-
|
|
254
|
+
j,
|
|
266
255
|
{
|
|
267
256
|
size: "sm",
|
|
268
257
|
intent: "ghost",
|
|
269
|
-
icon: /* @__PURE__ */ r(
|
|
258
|
+
icon: /* @__PURE__ */ r(ee, { "aria-hidden": "true" }),
|
|
270
259
|
"aria-label": i("fieldPicker.reorder", {
|
|
271
260
|
field: n.label,
|
|
272
261
|
defaultValue: "Reorder {{field}}. Press Alt + Up or Alt + Down to move."
|
|
273
262
|
}),
|
|
274
263
|
"aria-keyshortcuts": "Alt+ArrowUp Alt+ArrowDown Alt+Home Alt+End",
|
|
275
264
|
className: "ds:shrink-0 ds:cursor-grab ds:active:cursor-grabbing",
|
|
276
|
-
onKeyDown: (
|
|
277
|
-
if (
|
|
278
|
-
if (
|
|
279
|
-
if (
|
|
280
|
-
|
|
265
|
+
onKeyDown: (a) => {
|
|
266
|
+
if (a.altKey) {
|
|
267
|
+
if (a.key === "ArrowUp") {
|
|
268
|
+
if (c <= 0) return;
|
|
269
|
+
a.preventDefault(), s(
|
|
281
270
|
n.id,
|
|
282
|
-
h[
|
|
283
|
-
), o(n.id,
|
|
284
|
-
} else if (
|
|
285
|
-
if (
|
|
286
|
-
|
|
271
|
+
h[c - 1]
|
|
272
|
+
), o(n.id, c - 1, k);
|
|
273
|
+
} else if (a.key === "ArrowDown") {
|
|
274
|
+
if (c >= k - 1) return;
|
|
275
|
+
a.preventDefault(), s(
|
|
287
276
|
n.id,
|
|
288
|
-
h[
|
|
289
|
-
), o(n.id,
|
|
290
|
-
} else if (
|
|
291
|
-
if (
|
|
292
|
-
|
|
293
|
-
} else if (
|
|
294
|
-
if (
|
|
295
|
-
|
|
277
|
+
h[c + 1]
|
|
278
|
+
), o(n.id, c + 1, k);
|
|
279
|
+
} else if (a.key === "Home") {
|
|
280
|
+
if (c <= 0) return;
|
|
281
|
+
a.preventDefault(), s(n.id, h[0]), o(n.id, 0, k);
|
|
282
|
+
} else if (a.key === "End") {
|
|
283
|
+
if (c >= k - 1) return;
|
|
284
|
+
a.preventDefault(), s(
|
|
296
285
|
n.id,
|
|
297
|
-
h[
|
|
298
|
-
), o(n.id,
|
|
286
|
+
h[k - 1]
|
|
287
|
+
), o(n.id, k - 1, k);
|
|
299
288
|
}
|
|
300
289
|
}
|
|
301
290
|
}
|
|
@@ -310,28 +299,28 @@ function Pe({
|
|
|
310
299
|
)
|
|
311
300
|
]
|
|
312
301
|
},
|
|
313
|
-
|
|
302
|
+
l.id
|
|
314
303
|
);
|
|
315
304
|
}),
|
|
316
305
|
/* @__PURE__ */ r(Y, { orientation: "horizontal" }),
|
|
317
306
|
/* @__PURE__ */ r(W, { type: "button", size: "sm", intent: "ghost", onClick: y, children: i("fieldPicker.reset", { defaultValue: "Reset to defaults" }) })
|
|
318
307
|
] }),
|
|
319
|
-
/* @__PURE__ */ r("span", { role: "status", className: "ds:sr-only", children:
|
|
308
|
+
/* @__PURE__ */ r("span", { role: "status", className: "ds:sr-only", children: _ })
|
|
320
309
|
] })
|
|
321
310
|
] });
|
|
322
311
|
}
|
|
323
|
-
const R = "ds:text-[color:var(--foreground)]",
|
|
312
|
+
const R = "ds:text-[color:var(--foreground)]", me = {
|
|
324
313
|
m: "Male",
|
|
325
314
|
f: "Female",
|
|
326
315
|
x: "Other"
|
|
327
316
|
};
|
|
328
|
-
function
|
|
317
|
+
function z({
|
|
329
318
|
icon: e,
|
|
330
319
|
mono: d,
|
|
331
320
|
children: t
|
|
332
321
|
}) {
|
|
333
322
|
return /* @__PURE__ */ r(
|
|
334
|
-
|
|
323
|
+
H,
|
|
335
324
|
{
|
|
336
325
|
variant: "neutral",
|
|
337
326
|
className: d ? "ds:font-mono" : void 0,
|
|
@@ -342,26 +331,26 @@ function _({
|
|
|
342
331
|
}
|
|
343
332
|
);
|
|
344
333
|
}
|
|
345
|
-
function
|
|
346
|
-
const { t: d } =
|
|
347
|
-
defaultValue:
|
|
334
|
+
function pe({ code: e }) {
|
|
335
|
+
const { t: d } = P(), t = e.toLowerCase(), m = d(`patientField.sex.${t}`, {
|
|
336
|
+
defaultValue: me[t] ?? e
|
|
348
337
|
});
|
|
349
|
-
return t === "f" ? /* @__PURE__ */ r(
|
|
338
|
+
return t === "f" ? /* @__PURE__ */ r(H, { variant: "accentSoft", leading: /* @__PURE__ */ r(ue, {}), children: m }) : t === "m" ? /* @__PURE__ */ r(H, { variant: "info", leading: /* @__PURE__ */ r(ce, {}), children: m }) : /* @__PURE__ */ r(z, { icon: /* @__PURE__ */ r(se, {}), children: m });
|
|
350
339
|
}
|
|
351
|
-
function
|
|
352
|
-
const { t: d } =
|
|
353
|
-
return /* @__PURE__ */ r(
|
|
340
|
+
function fe({ years: e }) {
|
|
341
|
+
const { t: d } = P();
|
|
342
|
+
return /* @__PURE__ */ r(z, { icon: /* @__PURE__ */ r(oe, {}), children: d("patientField.age", {
|
|
354
343
|
count: e,
|
|
355
344
|
defaultValue: "{{count}} years old"
|
|
356
345
|
}) });
|
|
357
346
|
}
|
|
358
|
-
function
|
|
359
|
-
const { i18n: d } =
|
|
347
|
+
function _e({ field: e }) {
|
|
348
|
+
const { i18n: d } = P();
|
|
360
349
|
if (e.kind === "email" || e.kind === "phone") {
|
|
361
350
|
const t = typeof e.value == "string" ? e.value : e.copyText ?? (typeof e.editValue == "string" ? e.editValue : "");
|
|
362
351
|
if (t) {
|
|
363
352
|
const m = e.kind === "email" ? `mailto:${t.trim()}` : `tel:${t.replace(/[^+\d]/g, "")}`;
|
|
364
|
-
return /* @__PURE__ */ r(
|
|
353
|
+
return /* @__PURE__ */ r(te, { href: m, children: t });
|
|
365
354
|
}
|
|
366
355
|
}
|
|
367
356
|
if (e.value != null)
|
|
@@ -370,27 +359,27 @@ function Le({ field: e }) {
|
|
|
370
359
|
return null;
|
|
371
360
|
switch (e.kind) {
|
|
372
361
|
case "sex":
|
|
373
|
-
return /* @__PURE__ */ r(
|
|
362
|
+
return /* @__PURE__ */ r(pe, { code: String(e.editValue ?? "") });
|
|
374
363
|
case "age": {
|
|
375
364
|
const t = typeof e.editValue == "number" ? e.editValue : Number(e.editValue);
|
|
376
|
-
return Number.isFinite(t) ? /* @__PURE__ */ r(
|
|
365
|
+
return Number.isFinite(t) ? /* @__PURE__ */ r(fe, { years: t }) : null;
|
|
377
366
|
}
|
|
378
367
|
case "dob": {
|
|
379
|
-
const t = e.editValue, m = t instanceof Date ? t : new Date(String(t ?? "")),
|
|
368
|
+
const t = e.editValue, m = t instanceof Date ? t : new Date(String(t ?? "")), s = Number.isNaN(m.getTime()) ? String(t ?? "") : new Intl.DateTimeFormat(d.language, {
|
|
380
369
|
day: "numeric",
|
|
381
370
|
month: "short",
|
|
382
371
|
year: "numeric"
|
|
383
372
|
}).format(m);
|
|
384
|
-
return
|
|
373
|
+
return s ? /* @__PURE__ */ r(z, { icon: /* @__PURE__ */ r(ae, {}), children: s }) : null;
|
|
385
374
|
}
|
|
386
375
|
case "fiscalCode": {
|
|
387
376
|
const t = e.copyText ?? (typeof e.editValue == "string" ? e.editValue : "");
|
|
388
|
-
return t ? /* @__PURE__ */ r(
|
|
377
|
+
return t ? /* @__PURE__ */ r(z, { icon: /* @__PURE__ */ r(re, {}), mono: !0, children: t }) : null;
|
|
389
378
|
}
|
|
390
379
|
case "discount": {
|
|
391
380
|
const t = typeof e.editValue == "number" ? e.editValue : Number(e.editValue);
|
|
392
381
|
return Number.isFinite(t) ? /* @__PURE__ */ r(
|
|
393
|
-
|
|
382
|
+
ne,
|
|
394
383
|
{
|
|
395
384
|
state: "discount",
|
|
396
385
|
amount: Math.abs(t),
|
|
@@ -404,12 +393,12 @@ function Le({ field: e }) {
|
|
|
404
393
|
}
|
|
405
394
|
}
|
|
406
395
|
export {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
396
|
+
fe as A,
|
|
397
|
+
Le as F,
|
|
398
|
+
z as N,
|
|
399
|
+
pe as S,
|
|
400
|
+
_e as a,
|
|
401
|
+
ze as r,
|
|
402
|
+
Pe as u
|
|
414
403
|
};
|
|
415
|
-
//# sourceMappingURL=field-value-
|
|
404
|
+
//# sourceMappingURL=field-value-BRVbZJej.js.map
|