@middag-io/react 0.28.0 → 0.29.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/{DateField-CU9qDJwH.js → DateField-BCCidKwl.js} +1 -1
- package/dist-lib/{DocumentField-COJZZV5_.js → DocumentField-5uXJyXlL.js} +1 -1
- package/dist-lib/{FormPanelBlock-Cd_uiDze.js → FormPanelBlock-DJ0T69X7.js} +366 -365
- package/dist-lib/MarkdownContent-CN-ZN_69.js +2 -0
- package/dist-lib/{MarkdownContent-DZf86c3J.js → MarkdownContent-aIIUC0Fl.js} +1 -1
- package/dist-lib/{PhoneField-fFUyYj--.js → PhoneField-DpHb6FQE.js} +44 -40
- package/dist-lib/app/providers/index.d.ts +2 -4
- package/dist-lib/app/providers/index.d.ts.map +1 -1
- package/dist-lib/app/providers/inertia-error-reporter.d.ts.map +1 -1
- package/dist-lib/base/blocks/ActionGridBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/ActivityTimelineBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/CardGridBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/DetailPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/EmptyStateBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/FormPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/MarkdownPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/form/FormField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/MultiSelectField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/NativeSelectField.d.ts.map +1 -1
- package/dist-lib/base/form/form-schema-builder.d.ts +2 -1
- package/dist-lib/base/form/form-schema-builder.d.ts.map +1 -1
- package/dist-lib/base/layout/DashboardLayout.d.ts.map +1 -1
- package/dist-lib/base/partials/ActionBar/index.d.ts.map +1 -1
- package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
- package/dist-lib/base/partials/FormSection/index.d.ts.map +1 -1
- package/dist-lib/base/shell/BasicShell.d.ts.map +1 -1
- package/dist-lib/base/shell/ImmersiveShell.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/PageActionButton.d.ts.map +1 -1
- package/dist-lib/{combobox-BbYGWCFO.js → combobox-DZ_qm1VH.js} +1486 -1571
- package/dist-lib/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
- package/dist-lib/contracts/block-data/actions.d.ts +2 -1
- package/dist-lib/contracts/block-data/actions.d.ts.map +1 -1
- package/dist-lib/contracts/block-data/form.d.ts +14 -1
- package/dist-lib/contracts/block-data/form.d.ts.map +1 -1
- package/dist-lib/i18n/I18nProvider.d.ts +15 -0
- package/dist-lib/i18n/I18nProvider.d.ts.map +1 -0
- package/dist-lib/i18n/host-resolver.d.ts +11 -0
- package/dist-lib/i18n/host-resolver.d.ts.map +1 -0
- package/dist-lib/i18n/instance.d.ts +13 -0
- package/dist-lib/i18n/instance.d.ts.map +1 -0
- package/dist-lib/i18n/register-strings.d.ts +4 -0
- package/dist-lib/i18n/register-strings.d.ts.map +1 -0
- package/dist-lib/i18n/render-label.d.ts +14 -0
- package/dist-lib/i18n/render-label.d.ts.map +1 -0
- package/dist-lib/i18n/resolve-field-error.d.ts +9 -0
- package/dist-lib/i18n/resolve-field-error.d.ts.map +1 -0
- package/dist-lib/i18n/useHostString.d.ts +2 -0
- package/dist-lib/i18n/useHostString.d.ts.map +1 -0
- package/dist-lib/i18n/useTranslation.d.ts +12 -0
- package/dist-lib/i18n/useTranslation.d.ts.map +1 -0
- package/dist-lib/index.d.ts +9 -4
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/middag-react.css +1 -1
- package/dist-lib/middag-react.js +5546 -3622
- package/dist-lib/{FormSection-B6Tcbwrf.js → resolve-field-error-bG2_dMOY.js} +441 -431
- package/dist-lib/useTranslation-CHN-BFba.js +321 -0
- package/package.json +2 -1
- package/dist-lib/MarkdownContent-BeNHDP09.js +0 -2
- package/dist-lib/app/providers/i18n-defaults.d.ts +0 -19
- package/dist-lib/app/providers/i18n-defaults.d.ts.map +0 -1
- package/dist-lib/app/providers/i18n.d.ts +0 -55
- package/dist-lib/app/providers/i18n.d.ts.map +0 -1
- package/dist-lib/app/providers/locales/pt-BR.d.ts +0 -15
- package/dist-lib/app/providers/locales/pt-BR.d.ts.map +0 -1
- package/dist-lib/i18n-D5Nt1tut.js +0 -326
- package/dist-lib/lib/i18n/render-label.d.ts +0 -31
- package/dist-lib/lib/i18n/render-label.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-Yj2czlvU.js";
|
|
2
2
|
import { a as t, c as n, g as r, h as i, i as a, l as o, m as s, o as c, p as l, r as u, s as d, t as f, u as p } from "./button-Ba1PcsOx.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { A as m, B as h, C as g, D as _, E as v, F as y, G as b, H as x, I as S, J as C, K as w, L as T, M as E, N as D, O, P as k, Q as A, R as j, S as M, T as N, U as P, V as F, W as ee, X as I, Y as te, Z as ne, _ as re, a as ie, b as ae, d as oe, f as se, g as ce, h as le, i as ue, j as de, k as fe, m as pe, n as me, o as he, p as ge, q as _e, r as ve, t as ye, u as be, v as xe, w as Se, x as Ce, y as we, z as Te } from "./combobox-DZ_qm1VH.js";
|
|
4
|
+
import { r as Ee, t as De } from "./useTranslation-CHN-BFba.js";
|
|
5
5
|
import { $ as Oe, C as L, G as ke, J as Ae, K as je, ft as Me, l as Ne, p as Pe, pt as Fe, st as Ie, t as R, u as Le, v as Re } from "./HugeiconsIcon-CKqc2W1S.js";
|
|
6
6
|
import { i as ze, n as Be, r as Ve, t as He } from "./dist-DuO9WodV.js";
|
|
7
7
|
import { n as Ue, t as We } from "./dist-B-MyAb3x.js";
|
|
@@ -3529,7 +3529,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
3529
3529
|
...e,
|
|
3530
3530
|
[t]: r
|
|
3531
3531
|
};
|
|
3532
|
-
}, {}), al =
|
|
3532
|
+
}, {}), al = Ee();
|
|
3533
3533
|
function ol() {
|
|
3534
3534
|
return (0, al.useSyncExternalStore)(sl, () => !0, () => !1);
|
|
3535
3535
|
}
|
|
@@ -4204,22 +4204,22 @@ var Vu = "SelectContent", Hu = z.forwardRef((e, n) => {
|
|
|
4204
4204
|
});
|
|
4205
4205
|
Hu.displayName = Vu;
|
|
4206
4206
|
var Uu = 10, [Wu, Gu] = Tu(Vu), Ku = "SelectContentImpl", qu = p("SelectContent.RemoveScroll"), Ju = z.forwardRef((e, t) => {
|
|
4207
|
-
let { __scopeSelect: n, position: r = "item-aligned", onCloseAutoFocus: i, onEscapeKeyDown: a, onPointerDownOutside: o, side: s, sideOffset: u, align: d, alignOffset: f, arrowPadding: p, collisionBoundary: m, collisionPadding: h, sticky: g, hideWhenDetached: _, avoidCollisions: v, ...y } = e, b = ku(Vu, n), [x, S] = z.useState(null), [C, w] = z.useState(null), T = l(t, (e) => S(e)), [E, D] = z.useState(null), [O, k] = z.useState(null), A = Cu(n), [j,
|
|
4207
|
+
let { __scopeSelect: n, position: r = "item-aligned", onCloseAutoFocus: i, onEscapeKeyDown: a, onPointerDownOutside: o, side: s, sideOffset: u, align: d, alignOffset: f, arrowPadding: p, collisionBoundary: m, collisionPadding: h, sticky: g, hideWhenDetached: _, avoidCollisions: v, ...y } = e, b = ku(Vu, n), [x, S] = z.useState(null), [C, w] = z.useState(null), T = l(t, (e) => S(e)), [E, D] = z.useState(null), [O, k] = z.useState(null), A = Cu(n), [j, M] = z.useState(!1), N = z.useRef(!1);
|
|
4208
4208
|
z.useEffect(() => {
|
|
4209
4209
|
if (x) return nt(x);
|
|
4210
4210
|
}, [x]), Qe();
|
|
4211
|
-
let
|
|
4211
|
+
let P = z.useCallback((e) => {
|
|
4212
4212
|
let [t, ...n] = A().map((e) => e.ref.current), [r] = n.slice(-1), i = document.activeElement;
|
|
4213
4213
|
for (let n of e) if (n === i || (n?.scrollIntoView({ block: "nearest" }), n === t && C && (C.scrollTop = 0), n === r && C && (C.scrollTop = C.scrollHeight), n?.focus(), document.activeElement !== i)) return;
|
|
4214
|
-
}, [A, C]),
|
|
4215
|
-
|
|
4214
|
+
}, [A, C]), F = z.useCallback(() => P([E, x]), [
|
|
4215
|
+
P,
|
|
4216
4216
|
E,
|
|
4217
4217
|
x
|
|
4218
4218
|
]);
|
|
4219
4219
|
z.useEffect(() => {
|
|
4220
|
-
j &&
|
|
4221
|
-
}, [j,
|
|
4222
|
-
let { onOpenChange:
|
|
4220
|
+
j && F();
|
|
4221
|
+
}, [j, F]);
|
|
4222
|
+
let { onOpenChange: ee, triggerPointerDownPosRef: I } = b;
|
|
4223
4223
|
z.useEffect(() => {
|
|
4224
4224
|
if (x) {
|
|
4225
4225
|
let e = {
|
|
@@ -4231,7 +4231,7 @@ var Uu = 10, [Wu, Gu] = Tu(Vu), Ku = "SelectContentImpl", qu = p("SelectContent.
|
|
|
4231
4231
|
y: Math.abs(Math.round(t.pageY) - (I.current?.y ?? 0))
|
|
4232
4232
|
};
|
|
4233
4233
|
}, n = (n) => {
|
|
4234
|
-
e.x <= 10 && e.y <= 10 ? n.preventDefault() : x.contains(n.target) ||
|
|
4234
|
+
e.x <= 10 && e.y <= 10 ? n.preventDefault() : x.contains(n.target) || ee(!1), document.removeEventListener("pointermove", t), I.current = null;
|
|
4235
4235
|
};
|
|
4236
4236
|
return I.current !== null && (document.addEventListener("pointermove", t), document.addEventListener("pointerup", n, {
|
|
4237
4237
|
capture: !0,
|
|
@@ -4242,22 +4242,22 @@ var Uu = 10, [Wu, Gu] = Tu(Vu), Ku = "SelectContentImpl", qu = p("SelectContent.
|
|
|
4242
4242
|
}
|
|
4243
4243
|
}, [
|
|
4244
4244
|
x,
|
|
4245
|
-
|
|
4245
|
+
ee,
|
|
4246
4246
|
I
|
|
4247
4247
|
]), z.useEffect(() => {
|
|
4248
|
-
let e = () =>
|
|
4248
|
+
let e = () => ee(!1);
|
|
4249
4249
|
return window.addEventListener("blur", e), window.addEventListener("resize", e), () => {
|
|
4250
4250
|
window.removeEventListener("blur", e), window.removeEventListener("resize", e);
|
|
4251
4251
|
};
|
|
4252
|
-
}, [
|
|
4252
|
+
}, [ee]);
|
|
4253
4253
|
let [te, ne] = kd((e) => {
|
|
4254
4254
|
let t = A().filter((e) => !e.disabled), n = Ad(t, e, t.find((e) => e.ref.current === document.activeElement));
|
|
4255
4255
|
n && setTimeout(() => n.ref.current.focus());
|
|
4256
4256
|
}), re = z.useCallback((e, t, n) => {
|
|
4257
|
-
let r = !
|
|
4258
|
-
(b.value !== void 0 && b.value === t || r) && (D(e), r && (
|
|
4257
|
+
let r = !N.current && !n;
|
|
4258
|
+
(b.value !== void 0 && b.value === t || r) && (D(e), r && (N.current = !0));
|
|
4259
4259
|
}, [b.value]), ie = z.useCallback(() => x?.focus(), [x]), ae = z.useCallback((e, t, n) => {
|
|
4260
|
-
let r = !
|
|
4260
|
+
let r = !N.current && !n;
|
|
4261
4261
|
(b.value !== void 0 && b.value === t || r) && k(e);
|
|
4262
4262
|
}, [b.value]), oe = r === "popper" ? Qu : Xu, se = oe === Qu ? {
|
|
4263
4263
|
side: s,
|
|
@@ -4280,7 +4280,7 @@ var Uu = 10, [Wu, Gu] = Tu(Vu), Ku = "SelectContentImpl", qu = p("SelectContent.
|
|
|
4280
4280
|
selectedItem: E,
|
|
4281
4281
|
onItemLeave: ie,
|
|
4282
4282
|
itemTextRefCallback: ae,
|
|
4283
|
-
focusSelectedItem:
|
|
4283
|
+
focusSelectedItem: F,
|
|
4284
4284
|
selectedItemText: O,
|
|
4285
4285
|
position: r,
|
|
4286
4286
|
isPositioned: j,
|
|
@@ -4312,7 +4312,7 @@ var Uu = 10, [Wu, Gu] = Tu(Vu), Ku = "SelectContentImpl", qu = p("SelectContent.
|
|
|
4312
4312
|
onContextMenu: (e) => e.preventDefault(),
|
|
4313
4313
|
...y,
|
|
4314
4314
|
...se,
|
|
4315
|
-
onPlaced: () =>
|
|
4315
|
+
onPlaced: () => M(!0),
|
|
4316
4316
|
ref: T,
|
|
4317
4317
|
style: {
|
|
4318
4318
|
display: "flex",
|
|
@@ -4333,7 +4333,7 @@ var Uu = 10, [Wu, Gu] = Tu(Vu), Ku = "SelectContentImpl", qu = p("SelectContent.
|
|
|
4333
4333
|
let n = e.target, r = t.indexOf(n);
|
|
4334
4334
|
t = t.slice(r + 1);
|
|
4335
4335
|
}
|
|
4336
|
-
setTimeout(() =>
|
|
4336
|
+
setTimeout(() => P(t)), e.preventDefault();
|
|
4337
4337
|
}
|
|
4338
4338
|
})
|
|
4339
4339
|
})
|
|
@@ -5268,7 +5268,7 @@ function np({ className: t, children: n, showCloseButton: r = !0, ...i }) {
|
|
|
5268
5268
|
children: [n, r && /* @__PURE__ */ H(rl, {
|
|
5269
5269
|
"data-slot": "dialog-close",
|
|
5270
5270
|
className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
5271
|
-
children: [/* @__PURE__ */ V(
|
|
5271
|
+
children: [/* @__PURE__ */ V(ne, {}), /* @__PURE__ */ V("span", {
|
|
5272
5272
|
className: "sr-only",
|
|
5273
5273
|
children: "Close"
|
|
5274
5274
|
})]
|
|
@@ -5376,17 +5376,20 @@ function lp({ className: t, variant: n, size: r, radius: i, asChild: a = !1, ...
|
|
|
5376
5376
|
});
|
|
5377
5377
|
}
|
|
5378
5378
|
//#endregion
|
|
5379
|
-
//#region src/
|
|
5380
|
-
function up(e
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5379
|
+
//#region src/i18n/render-label.ts
|
|
5380
|
+
function up(e) {
|
|
5381
|
+
return typeof e == "object" && !!e && "key" in e && typeof e.key == "string";
|
|
5382
|
+
}
|
|
5383
|
+
function dp(e, t) {
|
|
5384
|
+
return e == null ? "" : typeof e == "string" ? e : t(e.key, {
|
|
5385
|
+
ns: e.domain || void 0,
|
|
5386
|
+
defaultValue: e.key,
|
|
5387
|
+
...e.params ?? {}
|
|
5388
|
+
});
|
|
5386
5389
|
}
|
|
5387
5390
|
//#endregion
|
|
5388
5391
|
//#region src/base/partials/EmptyPlaceholder/index.tsx
|
|
5389
|
-
var
|
|
5392
|
+
var fp = ut(() => import("./dist-axU0pUop.js").then((e) => ({ default: e.DotLottieReact }))), pp = {
|
|
5390
5393
|
"first-use": {
|
|
5391
5394
|
iconSize: 56,
|
|
5392
5395
|
padding: "py-20",
|
|
@@ -5418,14 +5421,14 @@ var dp = ut(() => import("./dist-axU0pUop.js").then((e) => ({ default: e.DotLott
|
|
|
5418
5421
|
maxDescWidth: "max-w-[320px]"
|
|
5419
5422
|
}
|
|
5420
5423
|
};
|
|
5421
|
-
function
|
|
5424
|
+
function mp(e, t) {
|
|
5422
5425
|
return e === "error" ? je : e === "permission" ? Me : t ? sp(t) : Pe;
|
|
5423
5426
|
}
|
|
5424
|
-
function
|
|
5427
|
+
function hp(e) {
|
|
5425
5428
|
return e === "error" ? "text-destructive" : "text-muted-foreground/50";
|
|
5426
5429
|
}
|
|
5427
|
-
function
|
|
5428
|
-
let c =
|
|
5430
|
+
function gp({ variant: t = "first-use", icon: n, lottieUrl: r, title: i, description: a, cta: o, ctaSecondary: s }) {
|
|
5431
|
+
let c = pp[t], l = mp(t, n), u = hp(t), d = t !== "permission" && o, p = c.iconSize * 1.8;
|
|
5429
5432
|
return /* @__PURE__ */ H("div", {
|
|
5430
5433
|
role: "status",
|
|
5431
5434
|
"aria-live": "polite",
|
|
@@ -5439,7 +5442,7 @@ function hp({ variant: t = "first-use", icon: n, lottieUrl: r, title: i, descrip
|
|
|
5439
5442
|
},
|
|
5440
5443
|
className: "mb-4"
|
|
5441
5444
|
}),
|
|
5442
|
-
children: /* @__PURE__ */ V(
|
|
5445
|
+
children: /* @__PURE__ */ V(fp, {
|
|
5443
5446
|
src: r,
|
|
5444
5447
|
loop: !0,
|
|
5445
5448
|
autoplay: !0,
|
|
@@ -5490,19 +5493,19 @@ function hp({ variant: t = "first-use", icon: n, lottieUrl: r, title: i, descrip
|
|
|
5490
5493
|
}
|
|
5491
5494
|
//#endregion
|
|
5492
5495
|
//#region src/components/reui/select.tsx
|
|
5493
|
-
function
|
|
5496
|
+
function _p({ ...e }) {
|
|
5494
5497
|
return /* @__PURE__ */ V(Md, {
|
|
5495
5498
|
"data-slot": "select",
|
|
5496
5499
|
...e
|
|
5497
5500
|
});
|
|
5498
5501
|
}
|
|
5499
|
-
function
|
|
5502
|
+
function vp({ ...e }) {
|
|
5500
5503
|
return /* @__PURE__ */ V(Pd, {
|
|
5501
5504
|
"data-slot": "select-value",
|
|
5502
5505
|
...e
|
|
5503
5506
|
});
|
|
5504
5507
|
}
|
|
5505
|
-
function
|
|
5508
|
+
function yp({ className: t, size: n = "default", children: r, ...a }) {
|
|
5506
5509
|
return /* @__PURE__ */ H(Nd, {
|
|
5507
5510
|
"data-slot": "select-trigger",
|
|
5508
5511
|
"data-size": n,
|
|
@@ -5514,7 +5517,7 @@ function vp({ className: t, size: n = "default", children: r, ...a }) {
|
|
|
5514
5517
|
})]
|
|
5515
5518
|
});
|
|
5516
5519
|
}
|
|
5517
|
-
function
|
|
5520
|
+
function bp({ className: t, children: n, position: r = "item-aligned", align: i = "center", ...a }) {
|
|
5518
5521
|
return /* @__PURE__ */ V(Id, { children: /* @__PURE__ */ H(Ld, {
|
|
5519
5522
|
"data-slot": "select-content",
|
|
5520
5523
|
className: e("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", t),
|
|
@@ -5522,16 +5525,16 @@ function yp({ className: t, children: n, position: r = "item-aligned", align: i
|
|
|
5522
5525
|
align: i,
|
|
5523
5526
|
...a,
|
|
5524
5527
|
children: [
|
|
5525
|
-
/* @__PURE__ */ V(
|
|
5528
|
+
/* @__PURE__ */ V(Sp, {}),
|
|
5526
5529
|
/* @__PURE__ */ V(Rd, {
|
|
5527
5530
|
className: e("p-1", r === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
5528
5531
|
children: n
|
|
5529
5532
|
}),
|
|
5530
|
-
/* @__PURE__ */ V(
|
|
5533
|
+
/* @__PURE__ */ V(Cp, {})
|
|
5531
5534
|
]
|
|
5532
5535
|
}) });
|
|
5533
5536
|
}
|
|
5534
|
-
function
|
|
5537
|
+
function xp({ className: t, children: n, ...r }) {
|
|
5535
5538
|
return /* @__PURE__ */ H(zd, {
|
|
5536
5539
|
"data-slot": "select-item",
|
|
5537
5540
|
className: e("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", t),
|
|
@@ -5539,11 +5542,11 @@ function bp({ className: t, children: n, ...r }) {
|
|
|
5539
5542
|
children: [/* @__PURE__ */ V("span", {
|
|
5540
5543
|
"data-slot": "select-item-indicator",
|
|
5541
5544
|
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
5542
|
-
children: /* @__PURE__ */ V(Vd, { children: /* @__PURE__ */ V(
|
|
5545
|
+
children: /* @__PURE__ */ V(Vd, { children: /* @__PURE__ */ V(A, { className: "size-4" }) })
|
|
5543
5546
|
}), /* @__PURE__ */ V(Bd, { children: n })]
|
|
5544
5547
|
});
|
|
5545
5548
|
}
|
|
5546
|
-
function
|
|
5549
|
+
function Sp({ className: t, ...n }) {
|
|
5547
5550
|
return /* @__PURE__ */ V(Hd, {
|
|
5548
5551
|
"data-slot": "select-scroll-up-button",
|
|
5549
5552
|
className: e("flex cursor-default items-center justify-center py-1", t),
|
|
@@ -5551,7 +5554,7 @@ function xp({ className: t, ...n }) {
|
|
|
5551
5554
|
children: /* @__PURE__ */ V(tc, { className: "size-4" })
|
|
5552
5555
|
});
|
|
5553
5556
|
}
|
|
5554
|
-
function
|
|
5557
|
+
function Cp({ className: t, ...n }) {
|
|
5555
5558
|
return /* @__PURE__ */ V(Ud, {
|
|
5556
5559
|
"data-slot": "select-scroll-down-button",
|
|
5557
5560
|
className: e("flex cursor-default items-center justify-center py-1", t),
|
|
@@ -5561,7 +5564,7 @@ function Sp({ className: t, ...n }) {
|
|
|
5561
5564
|
}
|
|
5562
5565
|
//#endregion
|
|
5563
5566
|
//#region src/components/reui/separator.tsx
|
|
5564
|
-
function
|
|
5567
|
+
function wp({ className: t, orientation: n = "horizontal", decorative: r = !0, ...i }) {
|
|
5565
5568
|
return /* @__PURE__ */ V(Xd, {
|
|
5566
5569
|
"data-slot": "separator",
|
|
5567
5570
|
decorative: r,
|
|
@@ -5572,7 +5575,7 @@ function Cp({ className: t, orientation: n = "horizontal", decorative: r = !0, .
|
|
|
5572
5575
|
}
|
|
5573
5576
|
//#endregion
|
|
5574
5577
|
//#region src/components/reui/checkbox.tsx
|
|
5575
|
-
function
|
|
5578
|
+
function Tp({ className: t, ...n }) {
|
|
5576
5579
|
return /* @__PURE__ */ V(Nl, {
|
|
5577
5580
|
"data-slot": "checkbox",
|
|
5578
5581
|
className: e("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary", t),
|
|
@@ -5580,13 +5583,13 @@ function wp({ className: t, ...n }) {
|
|
|
5580
5583
|
children: /* @__PURE__ */ V(Fl, {
|
|
5581
5584
|
"data-slot": "checkbox-indicator",
|
|
5582
5585
|
className: "grid place-content-center text-current transition-none",
|
|
5583
|
-
children: /* @__PURE__ */ V(
|
|
5586
|
+
children: /* @__PURE__ */ V(A, { className: "size-3.5" })
|
|
5584
5587
|
})
|
|
5585
5588
|
});
|
|
5586
5589
|
}
|
|
5587
5590
|
//#endregion
|
|
5588
5591
|
//#region src/base/utils/conditions.ts
|
|
5589
|
-
function
|
|
5592
|
+
function Ep(e, t) {
|
|
5590
5593
|
let n = t[e.field], r = e.value;
|
|
5591
5594
|
switch (e.operator) {
|
|
5592
5595
|
case "equals": return n === r;
|
|
@@ -5598,7 +5601,7 @@ function Tp(e, t) {
|
|
|
5598
5601
|
}
|
|
5599
5602
|
//#endregion
|
|
5600
5603
|
//#region src/components/reui/label.tsx
|
|
5601
|
-
function
|
|
5604
|
+
function Dp({ className: t, ...n }) {
|
|
5602
5605
|
return /* @__PURE__ */ V(Wl, {
|
|
5603
5606
|
"data-slot": "label",
|
|
5604
5607
|
className: e("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", t),
|
|
@@ -5607,11 +5610,11 @@ function Ep({ className: t, ...n }) {
|
|
|
5607
5610
|
}
|
|
5608
5611
|
//#endregion
|
|
5609
5612
|
//#region src/base/form/fields/CheckboxField.tsx
|
|
5610
|
-
function
|
|
5613
|
+
function Op({ id: e, value: t, onChange: n, label: r, disabled: i, required: a, error: o, helpTextId: s, errorId: c }) {
|
|
5611
5614
|
let l = [o ? c : void 0, s].filter(Boolean).join(" ") || void 0;
|
|
5612
5615
|
return /* @__PURE__ */ H("div", {
|
|
5613
5616
|
className: "flex items-center gap-2",
|
|
5614
|
-
children: [/* @__PURE__ */ V(
|
|
5617
|
+
children: [/* @__PURE__ */ V(Tp, {
|
|
5615
5618
|
id: e,
|
|
5616
5619
|
checked: !!t,
|
|
5617
5620
|
onCheckedChange: (e) => n(e === !0),
|
|
@@ -5619,7 +5622,7 @@ function Dp({ id: e, value: t, onChange: n, label: r, disabled: i, required: a,
|
|
|
5619
5622
|
"aria-invalid": o ? !0 : void 0,
|
|
5620
5623
|
"aria-required": a || void 0,
|
|
5621
5624
|
"aria-describedby": l
|
|
5622
|
-
}), r && /* @__PURE__ */ V(
|
|
5625
|
+
}), r && /* @__PURE__ */ V(Dp, {
|
|
5623
5626
|
htmlFor: e,
|
|
5624
5627
|
className: "text-sm font-normal",
|
|
5625
5628
|
children: r
|
|
@@ -5628,7 +5631,7 @@ function Dp({ id: e, value: t, onChange: n, label: r, disabled: i, required: a,
|
|
|
5628
5631
|
}
|
|
5629
5632
|
//#endregion
|
|
5630
5633
|
//#region src/base/form/fields/ColorField.tsx
|
|
5631
|
-
function
|
|
5634
|
+
function kp({ id: e, value: t, onChange: n, placeholder: r, disabled: i, required: a, error: o, helpTextId: s, errorId: c }) {
|
|
5632
5635
|
let l = [o ? c : void 0, s].filter(Boolean).join(" ") || void 0, u = B((e) => {
|
|
5633
5636
|
n(e.target.value);
|
|
5634
5637
|
}, [n]), d = B((e) => {
|
|
@@ -5660,7 +5663,7 @@ function Op({ id: e, value: t, onChange: n, placeholder: r, disabled: i, require
|
|
|
5660
5663
|
}
|
|
5661
5664
|
//#endregion
|
|
5662
5665
|
//#region src/base/form/fields/CurrencyField.tsx
|
|
5663
|
-
var
|
|
5666
|
+
var Ap = {
|
|
5664
5667
|
BRL: "R$",
|
|
5665
5668
|
USD: "$",
|
|
5666
5669
|
EUR: "€",
|
|
@@ -5675,8 +5678,8 @@ var kp = {
|
|
|
5675
5678
|
COP: "$",
|
|
5676
5679
|
PEN: "S/"
|
|
5677
5680
|
};
|
|
5678
|
-
function
|
|
5679
|
-
let { t: f, formatCurrency: p } = De(), [m, h] = gt(!1), [g, _] = gt(""), v = [s ? l : void 0, c].filter(Boolean).join(" ") || void 0, y = m ? g : t == null ? "" : p(t, r), b =
|
|
5681
|
+
function jp({ id: e, value: t, onChange: n, currency: r = "BRL", placeholder: i, disabled: a, required: o, error: s, helpTextId: c, errorId: l, min: u, max: d }) {
|
|
5682
|
+
let { t: f, formatCurrency: p } = De(), [m, h] = gt(!1), [g, _] = gt(""), v = [s ? l : void 0, c].filter(Boolean).join(" ") || void 0, y = m ? g : t == null ? "" : p(t, r), b = Ap[r] ?? r, x = B(() => {
|
|
5680
5683
|
h(!0), _(t == null ? "" : String(t));
|
|
5681
5684
|
}, [t]), S = B(() => {
|
|
5682
5685
|
h(!1);
|
|
@@ -5687,19 +5690,19 @@ function Ap({ id: e, value: t, onChange: n, currency: r = "BRL", placeholder: i,
|
|
|
5687
5690
|
n,
|
|
5688
5691
|
u,
|
|
5689
5692
|
d
|
|
5690
|
-
]),
|
|
5693
|
+
]), T = B((e) => {
|
|
5691
5694
|
_(e.target.value);
|
|
5692
5695
|
}, []);
|
|
5693
|
-
return /* @__PURE__ */ H(
|
|
5696
|
+
return /* @__PURE__ */ H(w, {
|
|
5694
5697
|
"data-disabled": a || void 0,
|
|
5695
|
-
children: [/* @__PURE__ */ V(
|
|
5698
|
+
children: [/* @__PURE__ */ V(_e, {
|
|
5696
5699
|
align: "inline-start",
|
|
5697
|
-
children: /* @__PURE__ */ V(
|
|
5698
|
-
}), /* @__PURE__ */ V(
|
|
5700
|
+
children: /* @__PURE__ */ V(te, { children: b })
|
|
5701
|
+
}), /* @__PURE__ */ V(C, {
|
|
5699
5702
|
id: e,
|
|
5700
5703
|
inputMode: "decimal",
|
|
5701
5704
|
value: m ? g : t == null ? "" : y.replace(b, "").trim(),
|
|
5702
|
-
onChange:
|
|
5705
|
+
onChange: T,
|
|
5703
5706
|
onFocus: x,
|
|
5704
5707
|
onBlur: S,
|
|
5705
5708
|
placeholder: i ?? f("middag.ui.form.currency_placeholder"),
|
|
@@ -5712,7 +5715,7 @@ function Ap({ id: e, value: t, onChange: n, currency: r = "BRL", placeholder: i,
|
|
|
5712
5715
|
}
|
|
5713
5716
|
//#endregion
|
|
5714
5717
|
//#region src/components/reui/avatar.tsx
|
|
5715
|
-
function
|
|
5718
|
+
function Mp({ className: t, size: n = "default", ...r }) {
|
|
5716
5719
|
return /* @__PURE__ */ V(bl, {
|
|
5717
5720
|
"data-slot": "avatar",
|
|
5718
5721
|
"data-size": n,
|
|
@@ -5720,14 +5723,14 @@ function jp({ className: t, size: n = "default", ...r }) {
|
|
|
5720
5723
|
...r
|
|
5721
5724
|
});
|
|
5722
5725
|
}
|
|
5723
|
-
function
|
|
5726
|
+
function Np({ className: t, ...n }) {
|
|
5724
5727
|
return /* @__PURE__ */ V(xl, {
|
|
5725
5728
|
"data-slot": "avatar-image",
|
|
5726
5729
|
className: e("aspect-square size-full", t),
|
|
5727
5730
|
...n
|
|
5728
5731
|
});
|
|
5729
5732
|
}
|
|
5730
|
-
function
|
|
5733
|
+
function Pp({ className: t, ...n }) {
|
|
5731
5734
|
return /* @__PURE__ */ V(Sl, {
|
|
5732
5735
|
"data-slot": "avatar-fallback",
|
|
5733
5736
|
className: e("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", t),
|
|
@@ -5736,7 +5739,7 @@ function Np({ className: t, ...n }) {
|
|
|
5736
5739
|
}
|
|
5737
5740
|
//#endregion
|
|
5738
5741
|
//#region node_modules/@base-ui/utils/esm/useForcedRerendering.js
|
|
5739
|
-
function
|
|
5742
|
+
function Fp() {
|
|
5740
5743
|
let [, e] = z.useState({});
|
|
5741
5744
|
return z.useCallback(() => {
|
|
5742
5745
|
e({});
|
|
@@ -5744,46 +5747,46 @@ function Pp() {
|
|
|
5744
5747
|
}
|
|
5745
5748
|
//#endregion
|
|
5746
5749
|
//#region node_modules/@base-ui/react/esm/internals/clamp.js
|
|
5747
|
-
function
|
|
5750
|
+
function Ip(e, t = -(2 ** 53 - 1), n = 2 ** 53 - 1) {
|
|
5748
5751
|
return Math.max(t, Math.min(e, n));
|
|
5749
5752
|
}
|
|
5750
5753
|
//#endregion
|
|
5751
5754
|
//#region node_modules/@base-ui/react/esm/utils/formatNumber.js
|
|
5752
|
-
var
|
|
5753
|
-
function
|
|
5755
|
+
var Lp = /* @__PURE__ */ new Map();
|
|
5756
|
+
function Rp(e, t) {
|
|
5754
5757
|
let n = JSON.stringify({
|
|
5755
5758
|
locale: e,
|
|
5756
5759
|
options: t
|
|
5757
|
-
}), r =
|
|
5760
|
+
}), r = Lp.get(n);
|
|
5758
5761
|
if (r) return r;
|
|
5759
5762
|
let i = new Intl.NumberFormat(e, t);
|
|
5760
|
-
return
|
|
5761
|
-
}
|
|
5762
|
-
function Rp(e, t, n) {
|
|
5763
|
-
return e == null ? "" : Lp(t, n).format(e);
|
|
5763
|
+
return Lp.set(n, i), i;
|
|
5764
5764
|
}
|
|
5765
5765
|
function zp(e, t, n) {
|
|
5766
|
-
return Rp(
|
|
5766
|
+
return e == null ? "" : Rp(t, n).format(e);
|
|
5767
|
+
}
|
|
5768
|
+
function Bp(e, t, n) {
|
|
5769
|
+
return zp(e, t, {
|
|
5767
5770
|
...n,
|
|
5768
5771
|
maximumFractionDigits: 20
|
|
5769
5772
|
});
|
|
5770
5773
|
}
|
|
5771
5774
|
//#endregion
|
|
5772
5775
|
//#region node_modules/@base-ui/react/esm/number-field/root/NumberFieldRootContext.js
|
|
5773
|
-
var
|
|
5774
|
-
process.env.NODE_ENV !== "production" && (
|
|
5775
|
-
function
|
|
5776
|
-
let e = z.useContext(
|
|
5776
|
+
var Vp = /* @__PURE__ */ z.createContext(void 0);
|
|
5777
|
+
process.env.NODE_ENV !== "production" && (Vp.displayName = "NumberFieldRootContext");
|
|
5778
|
+
function Hp() {
|
|
5779
|
+
let e = z.useContext(Vp);
|
|
5777
5780
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? F(43) : "Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.");
|
|
5778
5781
|
return e;
|
|
5779
5782
|
}
|
|
5780
5783
|
//#endregion
|
|
5781
5784
|
//#region node_modules/@base-ui/react/esm/number-field/utils/stateAttributesMapping.js
|
|
5782
|
-
var
|
|
5785
|
+
var Up = {
|
|
5783
5786
|
inputValue: () => null,
|
|
5784
5787
|
value: () => null,
|
|
5785
|
-
...
|
|
5786
|
-
},
|
|
5788
|
+
...le
|
|
5789
|
+
}, Wp = [
|
|
5787
5790
|
"零",
|
|
5788
5791
|
"〇",
|
|
5789
5792
|
"一",
|
|
@@ -5795,7 +5798,7 @@ var Hp = {
|
|
|
5795
5798
|
"七",
|
|
5796
5799
|
"八",
|
|
5797
5800
|
"九"
|
|
5798
|
-
],
|
|
5801
|
+
], Gp = {
|
|
5799
5802
|
零: "0",
|
|
5800
5803
|
〇: "0",
|
|
5801
5804
|
一: "1",
|
|
@@ -5807,7 +5810,7 @@ var Hp = {
|
|
|
5807
5810
|
七: "7",
|
|
5808
5811
|
八: "8",
|
|
5809
5812
|
九: "9"
|
|
5810
|
-
},
|
|
5813
|
+
}, Kp = [
|
|
5811
5814
|
"٠",
|
|
5812
5815
|
"١",
|
|
5813
5816
|
"٢",
|
|
@@ -5818,7 +5821,7 @@ var Hp = {
|
|
|
5818
5821
|
"٧",
|
|
5819
5822
|
"٨",
|
|
5820
5823
|
"٩"
|
|
5821
|
-
],
|
|
5824
|
+
], qp = [
|
|
5822
5825
|
"۰",
|
|
5823
5826
|
"۱",
|
|
5824
5827
|
"۲",
|
|
@@ -5829,7 +5832,7 @@ var Hp = {
|
|
|
5829
5832
|
"۷",
|
|
5830
5833
|
"۸",
|
|
5831
5834
|
"۹"
|
|
5832
|
-
],
|
|
5835
|
+
], Jp = [
|
|
5833
5836
|
"0",
|
|
5834
5837
|
"1",
|
|
5835
5838
|
"2",
|
|
@@ -5840,53 +5843,53 @@ var Hp = {
|
|
|
5840
5843
|
"7",
|
|
5841
5844
|
"8",
|
|
5842
5845
|
"9"
|
|
5843
|
-
],
|
|
5846
|
+
], Yp = [
|
|
5844
5847
|
"%",
|
|
5845
5848
|
"٪",
|
|
5846
5849
|
"%",
|
|
5847
5850
|
"﹪"
|
|
5848
|
-
],
|
|
5851
|
+
], Xp = ["‰", "؉"], Zp = [
|
|
5849
5852
|
"−",
|
|
5850
5853
|
"-",
|
|
5851
5854
|
"‒",
|
|
5852
5855
|
"–",
|
|
5853
5856
|
"—",
|
|
5854
5857
|
"﹣"
|
|
5855
|
-
],
|
|
5858
|
+
], Qp = ["+", "﹢"], $p = RegExp(`[${Kp.join("")}]`, "g"), em = RegExp(`[${qp.join("")}]`, "g"), tm = RegExp(`[${Jp.join("")}]`, "g"), nm = RegExp(`[${Wp.join("")}]`, "g"), rm = RegExp(`[${Yp.join("")}]`), im = RegExp(`[${Xp.join("")}]`), am = /[٠١٢٣٤٥٦٧٨٩]/, om = /[۰۱۲۳۴۵۶۷۸۹]/, sm = /[零〇一二三四五六七八九]/, cm = RegExp(`[${Jp.join("")}]`), lm = [
|
|
5856
5859
|
".",
|
|
5857
5860
|
",",
|
|
5858
5861
|
".",
|
|
5859
5862
|
",",
|
|
5860
5863
|
"٫",
|
|
5861
5864
|
"٬"
|
|
5862
|
-
],
|
|
5863
|
-
function
|
|
5864
|
-
let n =
|
|
5865
|
+
], um = /\p{Zs}/u, dm = ["+", ...Qp], fm = ["-", ...Zp], pm = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), mm = (e) => e.replace(/[-\\\]^]/g, (e) => `\\${e}`), hm = (e) => `[${e.map(mm).join("")}]`, gm = hm(["-"].concat(Zp)), _m = hm(["+"].concat(Qp)), vm = new RegExp(gm, "gu"), ym = new RegExp(_m, "gu"), bm = new RegExp(gm), xm = new RegExp(_m);
|
|
5866
|
+
function Sm(e, t) {
|
|
5867
|
+
let n = Rp(e, t).formatToParts(11111.1), r = {};
|
|
5865
5868
|
return n.forEach((e) => {
|
|
5866
5869
|
r[e.type] = e.value;
|
|
5867
|
-
}),
|
|
5870
|
+
}), Rp(e).formatToParts(.1).forEach((e) => {
|
|
5868
5871
|
e.type === "decimal" && (r[e.type] = e.value);
|
|
5869
5872
|
}), r;
|
|
5870
5873
|
}
|
|
5871
|
-
function
|
|
5874
|
+
function Cm(e, t, n) {
|
|
5872
5875
|
if (e == null) return null;
|
|
5873
5876
|
let r = String(e).replace(/\p{Cf}/gu, "").trim();
|
|
5874
|
-
r = r.replace(
|
|
5877
|
+
r = r.replace(vm, "-").replace(ym, "+");
|
|
5875
5878
|
let i = !1, a = r.match(/([+-])\s*$/);
|
|
5876
5879
|
a && (a[1] === "-" && (i = !0), r = r.replace(/([+-])\s*$/, ""));
|
|
5877
5880
|
let o = r.match(/^\s*([+-])/);
|
|
5878
5881
|
o && (o[1] === "-" && (i = !0), r = r.replace(/^\s*[+-]/, ""));
|
|
5879
5882
|
let s = t;
|
|
5880
|
-
s === void 0 && (
|
|
5881
|
-
let { group: c, decimal: l, currency: u } =
|
|
5882
|
-
c && (p = /\p{Zs}/u.test(c) ? /\p{Zs}/gu : c === "'" || c === "’" ? /['’]/g : new RegExp(
|
|
5883
|
+
s === void 0 && (am.test(r) || om.test(r) ? s = "ar" : sm.test(r) && (s = "zh"));
|
|
5884
|
+
let { group: c, decimal: l, currency: u } = Sm(s, n), d = Rp(s, n).formatToParts(1).filter((e) => e.type === "unit").map((e) => pm(e.value)), f = d.length ? new RegExp(d.join("|"), "g") : null, p = null;
|
|
5885
|
+
c && (p = /\p{Zs}/u.test(c) ? /\p{Zs}/gu : c === "'" || c === "’" ? /['’]/g : new RegExp(pm(c), "g"));
|
|
5883
5886
|
let m = [
|
|
5884
5887
|
{
|
|
5885
5888
|
regex: c ? p : null,
|
|
5886
5889
|
replacement: ""
|
|
5887
5890
|
},
|
|
5888
5891
|
{
|
|
5889
|
-
regex: l ? new RegExp(
|
|
5892
|
+
regex: l ? new RegExp(pm(l), "g") : null,
|
|
5890
5893
|
replacement: "."
|
|
5891
5894
|
},
|
|
5892
5895
|
{
|
|
@@ -5906,17 +5909,13 @@ function Sm(e, t, n) {
|
|
|
5906
5909
|
replacement: ""
|
|
5907
5910
|
},
|
|
5908
5911
|
{
|
|
5909
|
-
regex: u ? new RegExp(
|
|
5912
|
+
regex: u ? new RegExp(pm(u), "g") : null,
|
|
5910
5913
|
replacement: ""
|
|
5911
5914
|
},
|
|
5912
5915
|
{
|
|
5913
5916
|
regex: f,
|
|
5914
5917
|
replacement: ""
|
|
5915
5918
|
},
|
|
5916
|
-
{
|
|
5917
|
-
regex: Qp,
|
|
5918
|
-
replacement: (e) => String(Gp.indexOf(e))
|
|
5919
|
-
},
|
|
5920
5919
|
{
|
|
5921
5920
|
regex: $p,
|
|
5922
5921
|
replacement: (e) => String(Kp.indexOf(e))
|
|
@@ -5927,68 +5926,72 @@ function Sm(e, t, n) {
|
|
|
5927
5926
|
},
|
|
5928
5927
|
{
|
|
5929
5928
|
regex: tm,
|
|
5930
|
-
replacement: (e) =>
|
|
5929
|
+
replacement: (e) => String(Jp.indexOf(e))
|
|
5930
|
+
},
|
|
5931
|
+
{
|
|
5932
|
+
regex: nm,
|
|
5933
|
+
replacement: (e) => Gp[e]
|
|
5931
5934
|
}
|
|
5932
5935
|
].reduce((e, { regex: t, replacement: n }) => t ? e.replace(t, n) : e, r), h = m.lastIndexOf(".");
|
|
5933
5936
|
if (h !== -1 && (m = `${m.slice(0, h).replace(/\./g, "")}.${m.slice(h + 1).replace(/\./g, "")}`), /^[-+]?Infinity$/i.test(r) || /[∞]/.test(r)) return null;
|
|
5934
|
-
let g = (i ? "-" : "") + m, _ = parseFloat(g), v = n?.style, y = v === "unit" && n?.unit === "percent", b =
|
|
5935
|
-
return
|
|
5937
|
+
let g = (i ? "-" : "") + m, _ = parseFloat(g), v = n?.style, y = v === "unit" && n?.unit === "percent", b = rm.test(e) || v === "percent";
|
|
5938
|
+
return im.test(e) ? _ /= 1e3 : !y && b && (_ /= 100), Number.isNaN(_) ? null : _;
|
|
5936
5939
|
}
|
|
5937
5940
|
//#endregion
|
|
5938
5941
|
//#region node_modules/@base-ui/react/esm/number-field/utils/validate.js
|
|
5939
|
-
var
|
|
5940
|
-
function
|
|
5941
|
-
let t =
|
|
5942
|
+
var wm = 1e-10;
|
|
5943
|
+
function Tm(e) {
|
|
5944
|
+
let t = Rp("en-US").resolvedOptions(), n = e?.minimumFractionDigits ?? t.minimumFractionDigits ?? 0;
|
|
5942
5945
|
return {
|
|
5943
5946
|
maximumFractionDigits: Math.max(e?.maximumFractionDigits ?? t.maximumFractionDigits ?? 20, n),
|
|
5944
5947
|
minimumFractionDigits: n
|
|
5945
5948
|
};
|
|
5946
5949
|
}
|
|
5947
|
-
function
|
|
5950
|
+
function Em(e, t) {
|
|
5948
5951
|
if (!Number.isFinite(e)) return e;
|
|
5949
5952
|
let n = Math.min(Math.max(t, 0), 20);
|
|
5950
5953
|
return Number(e.toFixed(n));
|
|
5951
5954
|
}
|
|
5952
|
-
function
|
|
5953
|
-
let { maximumFractionDigits: n } =
|
|
5954
|
-
return
|
|
5955
|
+
function Dm(e, t) {
|
|
5956
|
+
let { maximumFractionDigits: n } = Tm(t);
|
|
5957
|
+
return Em(e, n);
|
|
5955
5958
|
}
|
|
5956
|
-
function
|
|
5959
|
+
function Om(e, t, n, r = "directional") {
|
|
5957
5960
|
if (n === 0) return e;
|
|
5958
|
-
let i = Math.abs(n), a = Math.sign(n), o = i *
|
|
5961
|
+
let i = Math.abs(n), a = Math.sign(n), o = i * wm * a, s = r === "nearest" ? n : i, c = (e - t + o) / s, l;
|
|
5959
5962
|
return l = r === "nearest" ? Math.round(c) : a > 0 ? Math.floor(c) : Math.ceil(c), t + l * (r === "nearest" ? n : i);
|
|
5960
5963
|
}
|
|
5961
|
-
function
|
|
5964
|
+
function km(e, { step: t, minWithDefault: n, maxWithDefault: r, minWithZeroDefault: i, format: a, snapOnStep: o, small: s, clamp: c }) {
|
|
5962
5965
|
if (e === null) return e;
|
|
5963
|
-
let l = c ?
|
|
5966
|
+
let l = c ? Ip(e, n, r) : e;
|
|
5964
5967
|
if (t != null && o) {
|
|
5965
|
-
if (t === 0) return
|
|
5968
|
+
if (t === 0) return Dm(l, a);
|
|
5966
5969
|
let e = i;
|
|
5967
|
-
return !s && n !== -(2 ** 53 - 1) && (e = n),
|
|
5970
|
+
return !s && n !== -(2 ** 53 - 1) && (e = n), Dm(Om(l, e, t, s ? "nearest" : "directional"), a);
|
|
5968
5971
|
}
|
|
5969
|
-
return
|
|
5972
|
+
return Dm(l, a);
|
|
5970
5973
|
}
|
|
5971
5974
|
//#endregion
|
|
5972
5975
|
//#region node_modules/@base-ui/react/esm/number-field/root/NumberFieldRoot.js
|
|
5973
|
-
var
|
|
5974
|
-
let { id: n, min: r, max: i, smallStep: a = .1, step: o = 1, largeStep: s = 10, required: c = !1, disabled: l = !1, readOnly: u = !1, form: d, name: f, defaultValue: p, value: m, onValueChange:
|
|
5976
|
+
var Am = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
5977
|
+
let { id: n, min: r, max: i, smallStep: a = .1, step: o = 1, largeStep: s = 10, required: c = !1, disabled: l = !1, readOnly: u = !1, form: d, name: f, defaultValue: p, value: m, onValueChange: _, onValueCommitted: y, allowWheelScrub: S = !1, snapOnStep: C = !1, allowOutOfRange: w = !1, format: T, locale: E, render: D, className: O, inputRef: k, style: A, ...F } = e, { setDirty: ee, validityData: I, disabled: te, setFilled: ne, invalid: ie, name: ae, state: oe, validation: se, shouldValidateOnChange: ce } = pe(), le = te || l, ue = ae ?? f, de = o === "any" ? 1 : o, [me, he] = z.useState(!1), ge = r ?? -(2 ** 53 - 1), _e = i ?? 2 ** 53 - 1, ve = r ?? 0, ye = T?.style, Se = z.useRef(null), Ce = h(k, se.inputRef), Ee = be({ id: n }), [De, Oe] = b({
|
|
5975
5978
|
controlled: m,
|
|
5976
5979
|
default: p,
|
|
5977
5980
|
name: "NumberField",
|
|
5978
5981
|
state: "value"
|
|
5979
|
-
}), L = De ?? null, ke =
|
|
5980
|
-
|
|
5982
|
+
}), L = De ?? null, ke = we(L);
|
|
5983
|
+
x(() => {
|
|
5981
5984
|
ne(L !== null);
|
|
5982
5985
|
}, [ne, L]);
|
|
5983
|
-
let Ae =
|
|
5984
|
-
Me.current = !1,
|
|
5985
|
-
}), Pe = z.useRef(!0), Fe = z.useRef(null), [Ie, R] = z.useState(() => m === void 0 ?
|
|
5986
|
-
let { decimal: e, group: t, currency: n, literal: r } =
|
|
5987
|
-
|
|
5986
|
+
let Ae = Fp(), je = we(T), Me = z.useRef(!1), Ne = P((e, t) => {
|
|
5987
|
+
Me.current = !1, y?.(e, t);
|
|
5988
|
+
}), Pe = z.useRef(!0), Fe = z.useRef(null), [Ie, R] = z.useState(() => m === void 0 ? zp(L, E, T) : jm(L, E, T)), [Le, Re] = z.useState("numeric"), ze = P(() => {
|
|
5989
|
+
let { decimal: e, group: t, currency: n, literal: r } = Sm(E, T), i = /* @__PURE__ */ new Set();
|
|
5990
|
+
lm.forEach((e) => i.add(e)), e && i.add(e), t && (i.add(t), um.test(t) && i.add(" "));
|
|
5988
5991
|
let a = ye === "percent" || ye === "unit" && T?.unit === "percent", o = ye === "percent" || ye === "unit" && T?.unit === "permille";
|
|
5989
|
-
return a &&
|
|
5992
|
+
return a && Yp.forEach((e) => i.add(e)), o && Xp.forEach((e) => i.add(e)), ye === "currency" && n && i.add(n), r && (Array.from(r).forEach((e) => i.add(e)), um.test(r) && i.add(" ")), dm.forEach((e) => i.add(e)), ge < 0 && fm.forEach((e) => i.add(e)), i;
|
|
5990
5993
|
}), Be = P((e) => e?.altKey ? a : e?.shiftKey ? s : de), Ve = P((e, t) => {
|
|
5991
|
-
let n = t.event, r = t.direction, i = t.reason, a = !w || !(i === "input-change" || i === "input-blur" || i === "input-paste" || i === "input-clear" || i === "none"), o =
|
|
5994
|
+
let n = t.event, r = t.direction, i = t.reason, a = !w || !(i === "input-change" || i === "input-blur" || i === "input-paste" || i === "input-clear" || i === "none"), o = km(e, {
|
|
5992
5995
|
step: r ? Be(n) * r : void 0,
|
|
5993
5996
|
format: je.current,
|
|
5994
5997
|
minWithDefault: ge,
|
|
@@ -5999,27 +6002,27 @@ var km = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
5999
6002
|
clamp: a
|
|
6000
6003
|
}), s = t.reason === "input-change" || t.reason === "input-clear" || t.reason === "input-blur" || t.reason === "input-paste" || t.reason === "none", c = o !== L || s && (e !== L || Pe.current === !1);
|
|
6001
6004
|
if (c) {
|
|
6002
|
-
if (Fe.current = o,
|
|
6003
|
-
Oe(o),
|
|
6005
|
+
if (Fe.current = o, _?.(o, t), t.isCanceled) return c;
|
|
6006
|
+
Oe(o), ee(o !== I.initialValue), Me.current = !0;
|
|
6004
6007
|
}
|
|
6005
|
-
return Pe.current && R(
|
|
6008
|
+
return Pe.current && R(zp(o, E, T)), Ae(), c;
|
|
6006
6009
|
}), He = P((e, { direction: t, currentValue: n, event: i, reason: a }) => {
|
|
6007
6010
|
let o = n ?? ke.current;
|
|
6008
|
-
return Ve(typeof o == "number" ? o + e * t : Math.max(0, r ?? 0),
|
|
6011
|
+
return Ve(typeof o == "number" ? o + e * t : Math.max(0, r ?? 0), fe(a, i, void 0, { direction: t }));
|
|
6009
6012
|
});
|
|
6010
|
-
|
|
6013
|
+
x(function() {
|
|
6011
6014
|
if (!Pe.current) return;
|
|
6012
|
-
let e = m === void 0 ?
|
|
6015
|
+
let e = m === void 0 ? zp(L, E, T) : jm(L, E, T);
|
|
6013
6016
|
e !== Ie && R(e);
|
|
6014
|
-
}),
|
|
6015
|
-
if (!
|
|
6017
|
+
}), x(function() {
|
|
6018
|
+
if (!v) return;
|
|
6016
6019
|
let e = "text";
|
|
6017
6020
|
ge >= 0 && (e = "decimal"), Re(e);
|
|
6018
6021
|
}, [ge, ye]), z.useEffect(function() {
|
|
6019
|
-
let e =
|
|
6020
|
-
if (le || u || !
|
|
6022
|
+
let e = Se.current;
|
|
6023
|
+
if (le || u || !S || !e) return;
|
|
6021
6024
|
function t(e) {
|
|
6022
|
-
e.ctrlKey || N(
|
|
6025
|
+
e.ctrlKey || N(g(Se.current)) !== Se.current || (e.preventDefault(), He(Be(e) ?? 1, {
|
|
6023
6026
|
direction: e.deltaY > 0 ? -1 : 1,
|
|
6024
6027
|
event: e,
|
|
6025
6028
|
reason: "wheel"
|
|
@@ -6027,7 +6030,7 @@ var km = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6027
6030
|
}
|
|
6028
6031
|
return M(e, "wheel", t);
|
|
6029
6032
|
}, [
|
|
6030
|
-
|
|
6033
|
+
S,
|
|
6031
6034
|
He,
|
|
6032
6035
|
le,
|
|
6033
6036
|
u,
|
|
@@ -6042,7 +6045,7 @@ var km = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6042
6045
|
required: c,
|
|
6043
6046
|
value: L,
|
|
6044
6047
|
inputValue: Ie,
|
|
6045
|
-
scrubbing:
|
|
6048
|
+
scrubbing: me
|
|
6046
6049
|
}), [
|
|
6047
6050
|
oe,
|
|
6048
6051
|
le,
|
|
@@ -6050,16 +6053,16 @@ var km = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6050
6053
|
c,
|
|
6051
6054
|
L,
|
|
6052
6055
|
Ie,
|
|
6053
|
-
|
|
6056
|
+
me
|
|
6054
6057
|
]), We = z.useMemo(() => ({
|
|
6055
|
-
inputRef:
|
|
6058
|
+
inputRef: Se,
|
|
6056
6059
|
inputValue: Ie,
|
|
6057
6060
|
value: L,
|
|
6058
6061
|
minWithDefault: ge,
|
|
6059
6062
|
maxWithDefault: _e,
|
|
6060
6063
|
disabled: le,
|
|
6061
6064
|
readOnly: u,
|
|
6062
|
-
id:
|
|
6065
|
+
id: Ee,
|
|
6063
6066
|
setValue: Ve,
|
|
6064
6067
|
incrementValue: He,
|
|
6065
6068
|
getStepAmount: Be,
|
|
@@ -6070,26 +6073,26 @@ var km = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6070
6073
|
hasPendingCommitRef: Me,
|
|
6071
6074
|
name: ue,
|
|
6072
6075
|
required: c,
|
|
6073
|
-
invalid:
|
|
6076
|
+
invalid: ie,
|
|
6074
6077
|
inputMode: Le,
|
|
6075
6078
|
getAllowedNonNumericKeys: ze,
|
|
6076
6079
|
min: r,
|
|
6077
6080
|
max: i,
|
|
6078
6081
|
setInputValue: R,
|
|
6079
6082
|
locale: E,
|
|
6080
|
-
isScrubbing:
|
|
6083
|
+
isScrubbing: me,
|
|
6081
6084
|
setIsScrubbing: he,
|
|
6082
6085
|
state: Ue,
|
|
6083
6086
|
onValueCommitted: Ne
|
|
6084
6087
|
}), [
|
|
6085
|
-
|
|
6088
|
+
Se,
|
|
6086
6089
|
Ie,
|
|
6087
6090
|
L,
|
|
6088
6091
|
ge,
|
|
6089
6092
|
_e,
|
|
6090
6093
|
le,
|
|
6091
6094
|
u,
|
|
6092
|
-
|
|
6095
|
+
Ee,
|
|
6093
6096
|
Ve,
|
|
6094
6097
|
He,
|
|
6095
6098
|
Be,
|
|
@@ -6097,33 +6100,33 @@ var km = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6097
6100
|
ke,
|
|
6098
6101
|
ue,
|
|
6099
6102
|
c,
|
|
6100
|
-
|
|
6103
|
+
ie,
|
|
6101
6104
|
Le,
|
|
6102
6105
|
ze,
|
|
6103
6106
|
r,
|
|
6104
6107
|
i,
|
|
6105
6108
|
R,
|
|
6106
6109
|
E,
|
|
6107
|
-
|
|
6110
|
+
me,
|
|
6108
6111
|
Ue,
|
|
6109
6112
|
Ne
|
|
6110
|
-
]), Ge =
|
|
6113
|
+
]), Ge = Te("div", e, {
|
|
6111
6114
|
ref: t,
|
|
6112
6115
|
state: Ue,
|
|
6113
|
-
props:
|
|
6114
|
-
stateAttributesMapping:
|
|
6116
|
+
props: F,
|
|
6117
|
+
stateAttributesMapping: Up
|
|
6115
6118
|
});
|
|
6116
|
-
return /* @__PURE__ */ H(
|
|
6119
|
+
return /* @__PURE__ */ H(Vp.Provider, {
|
|
6117
6120
|
value: We,
|
|
6118
6121
|
children: [Ge, /* @__PURE__ */ V("input", {
|
|
6119
6122
|
...se.getInputValidationProps({
|
|
6120
6123
|
onFocus() {
|
|
6121
|
-
|
|
6124
|
+
Se.current?.focus();
|
|
6122
6125
|
},
|
|
6123
6126
|
onChange(e) {
|
|
6124
6127
|
if (e.nativeEvent.defaultPrevented) return;
|
|
6125
|
-
let t = e.currentTarget.valueAsNumber, n = Number.isNaN(t) ? null : t, r =
|
|
6126
|
-
|
|
6128
|
+
let t = e.currentTarget.valueAsNumber, n = Number.isNaN(t) ? null : t, r = fe(j, e.nativeEvent);
|
|
6129
|
+
ee(n !== I.initialValue), Ve(n, r), ce() && se.commit(n);
|
|
6127
6130
|
}
|
|
6128
6131
|
}),
|
|
6129
6132
|
ref: Ce,
|
|
@@ -6138,30 +6141,30 @@ var km = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6138
6141
|
required: c,
|
|
6139
6142
|
"aria-hidden": !0,
|
|
6140
6143
|
tabIndex: -1,
|
|
6141
|
-
style: ue ?
|
|
6144
|
+
style: ue ? xe : re,
|
|
6142
6145
|
suppressHydrationWarning: !0
|
|
6143
6146
|
})]
|
|
6144
6147
|
});
|
|
6145
6148
|
});
|
|
6146
|
-
process.env.NODE_ENV !== "production" && (
|
|
6147
|
-
function
|
|
6148
|
-
return n?.maximumFractionDigits != null || n?.minimumFractionDigits != null ?
|
|
6149
|
+
process.env.NODE_ENV !== "production" && (Am.displayName = "NumberFieldRoot");
|
|
6150
|
+
function jm(e, t, n) {
|
|
6151
|
+
return n?.maximumFractionDigits != null || n?.minimumFractionDigits != null ? zp(e, t, n) : Bp(e, t, n);
|
|
6149
6152
|
}
|
|
6150
6153
|
//#endregion
|
|
6151
6154
|
//#region node_modules/@base-ui/react/esm/number-field/group/NumberFieldGroup.js
|
|
6152
|
-
var
|
|
6153
|
-
let { render: n, className: r, style: i, ...a } = e, { state: o } =
|
|
6154
|
-
return
|
|
6155
|
+
var Mm = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
6156
|
+
let { render: n, className: r, style: i, ...a } = e, { state: o } = Hp();
|
|
6157
|
+
return Te("div", e, {
|
|
6155
6158
|
ref: t,
|
|
6156
6159
|
state: o,
|
|
6157
6160
|
props: [{ role: "group" }, a],
|
|
6158
|
-
stateAttributesMapping:
|
|
6161
|
+
stateAttributesMapping: Up
|
|
6159
6162
|
});
|
|
6160
6163
|
});
|
|
6161
|
-
process.env.NODE_ENV !== "production" && (
|
|
6164
|
+
process.env.NODE_ENV !== "production" && (Mm.displayName = "NumberFieldGroup");
|
|
6162
6165
|
//#endregion
|
|
6163
6166
|
//#region node_modules/@base-ui/utils/esm/useInterval.js
|
|
6164
|
-
var
|
|
6167
|
+
var Nm = 0, Pm = class e extends ae {
|
|
6165
6168
|
static create() {
|
|
6166
6169
|
return new e();
|
|
6167
6170
|
}
|
|
@@ -6171,21 +6174,21 @@ var Mm = 0, Nm = class e extends oe {
|
|
|
6171
6174
|
}, e);
|
|
6172
6175
|
}
|
|
6173
6176
|
clear = () => {
|
|
6174
|
-
this.currentId !==
|
|
6177
|
+
this.currentId !== Nm && (clearInterval(this.currentId), this.currentId = Nm);
|
|
6175
6178
|
};
|
|
6176
6179
|
};
|
|
6177
|
-
function
|
|
6178
|
-
let e =
|
|
6179
|
-
return
|
|
6180
|
+
function Fm() {
|
|
6181
|
+
let e = ee(Pm.create).current;
|
|
6182
|
+
return O(e.disposeEffect), e;
|
|
6180
6183
|
}
|
|
6181
6184
|
//#endregion
|
|
6182
6185
|
//#region node_modules/@base-ui/react/esm/internals/usePressAndHold.js
|
|
6183
|
-
var
|
|
6184
|
-
function
|
|
6186
|
+
var Im = 60, Lm = 400, Rm = 8, zm = 50, Bm = 3;
|
|
6187
|
+
function Vm(e) {
|
|
6185
6188
|
return e === "touch" || e === "pen";
|
|
6186
6189
|
}
|
|
6187
|
-
function
|
|
6188
|
-
let { disabled: t, readOnly: n = !1, tick: r, onStop: i, tickDelay: a =
|
|
6190
|
+
function Hm(e) {
|
|
6191
|
+
let { disabled: t, readOnly: n = !1, tick: r, onStop: i, tickDelay: a = Im, startDelay: o = Lm, scrollDistance: s = Rm, elementRef: c } = e, l = Ce(), u = Fm(), d = Ce(), f = z.useRef(!1), p = z.useRef(0), m = z.useRef({
|
|
6189
6192
|
x: 0,
|
|
6190
6193
|
y: 0
|
|
6191
6194
|
}), h = z.useRef(!1), g = z.useRef(!1), _ = z.useRef(""), v = z.useRef(() => {}), y = P(() => {
|
|
@@ -6223,22 +6226,22 @@ function Vm(e) {
|
|
|
6223
6226
|
e.defaultPrevented || !r || t || n || (_.current = e.pointerType, g.current = !1, f.current = !0, m.current = {
|
|
6224
6227
|
x: e.clientX,
|
|
6225
6228
|
y: e.clientY
|
|
6226
|
-
},
|
|
6229
|
+
}, Vm(e.pointerType) ? d.start(zm, () => {
|
|
6227
6230
|
let t = p.current;
|
|
6228
|
-
p.current = 0, f.current && t <
|
|
6231
|
+
p.current = 0, f.current && t < Bm ? (b(e.nativeEvent), g.current = !0) : (g.current = !1, y());
|
|
6229
6232
|
}) : (e.preventDefault(), b(e.nativeEvent)));
|
|
6230
6233
|
},
|
|
6231
6234
|
onPointerUp(e) {
|
|
6232
|
-
|
|
6235
|
+
Vm(e.pointerType) && (f.current = !1);
|
|
6233
6236
|
},
|
|
6234
6237
|
onPointerMove(e) {
|
|
6235
|
-
if (t || n || !
|
|
6238
|
+
if (t || n || !Vm(e.pointerType) || !f.current) return;
|
|
6236
6239
|
p.current != null && (p.current += 1);
|
|
6237
6240
|
let { x: r, y: i } = m.current, a = r - e.clientX, o = i - e.clientY;
|
|
6238
6241
|
a ** 2 + o ** 2 > s ** 2 && y();
|
|
6239
6242
|
},
|
|
6240
6243
|
onMouseEnter(e) {
|
|
6241
|
-
e.defaultPrevented || t || n || !f.current || h.current ||
|
|
6244
|
+
e.defaultPrevented || t || n || !f.current || h.current || Vm(_.current) || b(e.nativeEvent);
|
|
6242
6245
|
},
|
|
6243
6246
|
onMouseLeave() {
|
|
6244
6247
|
h.current || y();
|
|
@@ -6247,22 +6250,22 @@ function Vm(e) {
|
|
|
6247
6250
|
h.current || y();
|
|
6248
6251
|
}
|
|
6249
6252
|
},
|
|
6250
|
-
shouldSkipClick: P((e) => e.defaultPrevented ? !0 :
|
|
6253
|
+
shouldSkipClick: P((e) => e.defaultPrevented ? !0 : Vm(_.current) ? g.current : e.detail !== 0)
|
|
6251
6254
|
};
|
|
6252
6255
|
}
|
|
6253
6256
|
//#endregion
|
|
6254
6257
|
//#region node_modules/@base-ui/react/esm/number-field/root/useNumberFieldButton.js
|
|
6255
|
-
function
|
|
6258
|
+
function Um(e) {
|
|
6256
6259
|
return e === "touch" || e === "pen";
|
|
6257
6260
|
}
|
|
6258
|
-
function
|
|
6259
|
-
let { allowInputSyncRef: t, disabled: n, formatOptionsRef: r, getStepAmount: i, id: a, incrementValue: o, inputRef: s, inputValue: c, isIncrement: l, locale: u, readOnly: d, setValue: f, valueRef: p, lastChangedValueRef:
|
|
6261
|
+
function Wm(e) {
|
|
6262
|
+
let { allowInputSyncRef: t, disabled: n, formatOptionsRef: r, getStepAmount: i, id: a, incrementValue: o, inputRef: s, inputValue: c, isIncrement: l, locale: u, readOnly: d, setValue: f, valueRef: p, lastChangedValueRef: h, onValueCommitted: g } = e, _ = l ? E : de;
|
|
6260
6263
|
function v(e) {
|
|
6261
6264
|
t.current = !0;
|
|
6262
|
-
let n =
|
|
6263
|
-
n !== null && (p.current = n, f(n,
|
|
6265
|
+
let n = Cm(c, u, r.current);
|
|
6266
|
+
n !== null && (p.current = n, f(n, fe(_, e, void 0, { direction: l ? 1 : -1 })));
|
|
6264
6267
|
}
|
|
6265
|
-
let { pointerHandlers: y, shouldSkipClick: b } =
|
|
6268
|
+
let { pointerHandlers: y, shouldSkipClick: b } = Hm({
|
|
6266
6269
|
disabled: n || d,
|
|
6267
6270
|
elementRef: s,
|
|
6268
6271
|
tickDelay: 60,
|
|
@@ -6276,7 +6279,7 @@ function Um(e) {
|
|
|
6276
6279
|
});
|
|
6277
6280
|
},
|
|
6278
6281
|
onStop(e) {
|
|
6279
|
-
g(
|
|
6282
|
+
g(h.current ?? p.current, m(_, e));
|
|
6280
6283
|
}
|
|
6281
6284
|
});
|
|
6282
6285
|
return {
|
|
@@ -6300,19 +6303,19 @@ function Um(e) {
|
|
|
6300
6303
|
event: e.nativeEvent,
|
|
6301
6304
|
reason: _
|
|
6302
6305
|
});
|
|
6303
|
-
let s =
|
|
6304
|
-
s !== a && g(s,
|
|
6306
|
+
let s = h.current ?? p.current;
|
|
6307
|
+
s !== a && g(s, m(_, e.nativeEvent));
|
|
6305
6308
|
},
|
|
6306
6309
|
onPointerDown(e) {
|
|
6307
6310
|
let t = !e.button || e.button === 0;
|
|
6308
|
-
e.defaultPrevented || d || !t || n || (v(e.nativeEvent),
|
|
6311
|
+
e.defaultPrevented || d || !t || n || (v(e.nativeEvent), Um(e.pointerType) || s.current?.focus(), y.onPointerDown(e));
|
|
6309
6312
|
}
|
|
6310
6313
|
};
|
|
6311
6314
|
}
|
|
6312
6315
|
//#endregion
|
|
6313
6316
|
//#region node_modules/@base-ui/react/esm/number-field/increment/NumberFieldIncrement.js
|
|
6314
|
-
var
|
|
6315
|
-
let { render: n, className: r, disabled: i = !1, nativeButton: a = !0, style: o, ...s } = e, { allowInputSyncRef: c, disabled: l, formatOptionsRef: u, getStepAmount: d, id: f, incrementValue: p, inputRef: m, inputValue: h, locale: g, maxWithDefault:
|
|
6317
|
+
var Gm = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
6318
|
+
let { render: n, className: r, disabled: i = !1, nativeButton: a = !0, style: o, ...s } = e, { allowInputSyncRef: c, disabled: l, formatOptionsRef: u, getStepAmount: d, id: f, incrementValue: p, inputRef: m, inputValue: h, locale: g, maxWithDefault: v, readOnly: y, setValue: b, state: x, value: S, valueRef: C, lastChangedValueRef: w, onValueCommitted: T } = Hp(), E = i || l || S != null && S >= v, D = Wm({
|
|
6316
6319
|
isIncrement: !0,
|
|
6317
6320
|
inputRef: m,
|
|
6318
6321
|
inputValue: h,
|
|
@@ -6328,7 +6331,7 @@ var Wm = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6328
6331
|
locale: g,
|
|
6329
6332
|
lastChangedValueRef: w,
|
|
6330
6333
|
onValueCommitted: T
|
|
6331
|
-
}), { getButtonProps: O, buttonRef: k } =
|
|
6334
|
+
}), { getButtonProps: O, buttonRef: k } = _({
|
|
6332
6335
|
disabled: E,
|
|
6333
6336
|
native: a,
|
|
6334
6337
|
focusableWhenDisabled: !0
|
|
@@ -6336,7 +6339,7 @@ var Wm = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6336
6339
|
...x,
|
|
6337
6340
|
disabled: E
|
|
6338
6341
|
}), [x, E]);
|
|
6339
|
-
return
|
|
6342
|
+
return Te("button", e, {
|
|
6340
6343
|
ref: [t, k],
|
|
6341
6344
|
state: A,
|
|
6342
6345
|
props: [
|
|
@@ -6344,19 +6347,19 @@ var Wm = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6344
6347
|
s,
|
|
6345
6348
|
O
|
|
6346
6349
|
],
|
|
6347
|
-
stateAttributesMapping:
|
|
6350
|
+
stateAttributesMapping: Up
|
|
6348
6351
|
});
|
|
6349
6352
|
});
|
|
6350
|
-
process.env.NODE_ENV !== "production" && (
|
|
6353
|
+
process.env.NODE_ENV !== "production" && (Gm.displayName = "NumberFieldIncrement");
|
|
6351
6354
|
//#endregion
|
|
6352
6355
|
//#region node_modules/@base-ui/react/esm/number-field/decrement/NumberFieldDecrement.js
|
|
6353
|
-
var
|
|
6354
|
-
let { render: n, className: r, disabled: i = !1, nativeButton: a = !0, style: o, ...s } = e, { allowInputSyncRef: c, disabled: l, formatOptionsRef: u, getStepAmount: d, id: f, incrementValue: p, inputRef: m, inputValue: h, minWithDefault: g, readOnly:
|
|
6356
|
+
var Km = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
6357
|
+
let { render: n, className: r, disabled: i = !1, nativeButton: a = !0, style: o, ...s } = e, { allowInputSyncRef: c, disabled: l, formatOptionsRef: u, getStepAmount: d, id: f, incrementValue: p, inputRef: m, inputValue: h, minWithDefault: g, readOnly: v, setValue: y, state: b, value: x, valueRef: S, locale: C, lastChangedValueRef: w, onValueCommitted: T } = Hp(), E = i || l || x != null && x <= g, D = Wm({
|
|
6355
6358
|
isIncrement: !1,
|
|
6356
6359
|
inputRef: m,
|
|
6357
6360
|
inputValue: h,
|
|
6358
6361
|
disabled: E,
|
|
6359
|
-
readOnly:
|
|
6362
|
+
readOnly: v,
|
|
6360
6363
|
id: f,
|
|
6361
6364
|
setValue: y,
|
|
6362
6365
|
getStepAmount: d,
|
|
@@ -6367,7 +6370,7 @@ var Gm = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6367
6370
|
locale: C,
|
|
6368
6371
|
lastChangedValueRef: w,
|
|
6369
6372
|
onValueCommitted: T
|
|
6370
|
-
}), { getButtonProps: O, buttonRef: k } =
|
|
6373
|
+
}), { getButtonProps: O, buttonRef: k } = _({
|
|
6371
6374
|
disabled: E,
|
|
6372
6375
|
native: a,
|
|
6373
6376
|
focusableWhenDisabled: !0
|
|
@@ -6375,7 +6378,7 @@ var Gm = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6375
6378
|
...b,
|
|
6376
6379
|
disabled: E
|
|
6377
6380
|
}), [b, E]);
|
|
6378
|
-
return
|
|
6381
|
+
return Te("button", e, {
|
|
6379
6382
|
ref: [t, k],
|
|
6380
6383
|
state: A,
|
|
6381
6384
|
props: [
|
|
@@ -6383,16 +6386,16 @@ var Gm = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
|
6383
6386
|
s,
|
|
6384
6387
|
O
|
|
6385
6388
|
],
|
|
6386
|
-
stateAttributesMapping:
|
|
6389
|
+
stateAttributesMapping: Up
|
|
6387
6390
|
});
|
|
6388
6391
|
});
|
|
6389
|
-
process.env.NODE_ENV !== "production" && (
|
|
6392
|
+
process.env.NODE_ENV !== "production" && (Km.displayName = "NumberFieldDecrement");
|
|
6390
6393
|
//#endregion
|
|
6391
6394
|
//#region node_modules/@base-ui/react/esm/number-field/input/NumberFieldInput.js
|
|
6392
|
-
var
|
|
6393
|
-
...
|
|
6394
|
-
...
|
|
6395
|
-
},
|
|
6395
|
+
var qm = {
|
|
6396
|
+
...le,
|
|
6397
|
+
...Up
|
|
6398
|
+
}, Jm = new Set([
|
|
6396
6399
|
"Backspace",
|
|
6397
6400
|
"Delete",
|
|
6398
6401
|
"ArrowLeft",
|
|
@@ -6400,88 +6403,88 @@ var Km = {
|
|
|
6400
6403
|
"Tab",
|
|
6401
6404
|
"Enter",
|
|
6402
6405
|
"Escape"
|
|
6403
|
-
]),
|
|
6404
|
-
let { render: n, className: r, style: i, ...a } = e, { allowInputSyncRef: o, disabled: s, formatOptionsRef: c, getAllowedNonNumericKeys: l, getStepAmount: u, id: d, incrementValue: f, inputMode: p, inputValue:
|
|
6405
|
-
return
|
|
6406
|
+
]), Ym = /* @__PURE__ */ z.forwardRef(function(e, t) {
|
|
6407
|
+
let { render: n, className: r, style: i, ...a } = e, { allowInputSyncRef: o, disabled: s, formatOptionsRef: c, getAllowedNonNumericKeys: l, getStepAmount: u, id: d, incrementValue: f, inputMode: p, inputValue: h, max: g, min: _, name: v, readOnly: b, required: x, setValue: C, state: w, setInputValue: E, locale: O, inputRef: A, value: j, onValueCommitted: M, lastChangedValueRef: N, hasPendingCommitRef: P, valueRef: F } = Hp(), { clearErrors: ee } = se(), { validationMode: I, setTouched: te, setFocused: ne, invalid: re, shouldValidateOnChange: ie, validation: ae } = pe(), { labelId: le } = oe(), ue = z.useRef(!1), de = z.useRef(!1);
|
|
6408
|
+
return ge(A, {
|
|
6406
6409
|
id: d,
|
|
6407
6410
|
value: j
|
|
6408
|
-
}),
|
|
6411
|
+
}), ce(j, (e) => {
|
|
6409
6412
|
let t = ie();
|
|
6410
|
-
if (
|
|
6413
|
+
if (ee(v), t && ae.commit(j), !(e === j || t)) {
|
|
6411
6414
|
if (de.current) {
|
|
6412
6415
|
de.current = !1;
|
|
6413
6416
|
return;
|
|
6414
6417
|
}
|
|
6415
6418
|
ae.commit(j, !0);
|
|
6416
6419
|
}
|
|
6417
|
-
}),
|
|
6418
|
-
ref: [t,
|
|
6420
|
+
}), Te("input", e, {
|
|
6421
|
+
ref: [t, A],
|
|
6419
6422
|
state: w,
|
|
6420
6423
|
props: [
|
|
6421
6424
|
{
|
|
6422
6425
|
id: d,
|
|
6423
6426
|
required: x,
|
|
6424
6427
|
disabled: s,
|
|
6425
|
-
readOnly:
|
|
6428
|
+
readOnly: b,
|
|
6426
6429
|
inputMode: p,
|
|
6427
|
-
value:
|
|
6430
|
+
value: h,
|
|
6428
6431
|
type: "text",
|
|
6429
6432
|
autoComplete: "off",
|
|
6430
6433
|
autoCorrect: "off",
|
|
6431
6434
|
spellCheck: "false",
|
|
6432
6435
|
"aria-roledescription": "Number field",
|
|
6433
6436
|
"aria-invalid": re || void 0,
|
|
6434
|
-
"aria-labelledby":
|
|
6437
|
+
"aria-labelledby": le,
|
|
6435
6438
|
suppressHydrationWarning: !0,
|
|
6436
6439
|
onFocus(e) {
|
|
6437
|
-
if (e.defaultPrevented ||
|
|
6440
|
+
if (e.defaultPrevented || b || s || (ne(!0), ue.current)) return;
|
|
6438
6441
|
ue.current = !0;
|
|
6439
6442
|
let t = e.currentTarget, n = t.value.length;
|
|
6440
6443
|
t.setSelectionRange(n, n);
|
|
6441
6444
|
},
|
|
6442
6445
|
onBlur(e) {
|
|
6443
|
-
if (e.defaultPrevented ||
|
|
6446
|
+
if (e.defaultPrevented || b || s) return;
|
|
6444
6447
|
te(!0), ne(!1);
|
|
6445
|
-
let t = !o.current, n =
|
|
6446
|
-
if (o.current = !0,
|
|
6447
|
-
|
|
6448
|
+
let t = !o.current, n = P.current;
|
|
6449
|
+
if (o.current = !0, h.trim() === "") {
|
|
6450
|
+
C(null, fe(y, e.nativeEvent)), I === "onBlur" && ae.commit(null), M(null, m(y, e.nativeEvent));
|
|
6448
6451
|
return;
|
|
6449
6452
|
}
|
|
6450
|
-
let r = c.current, i =
|
|
6453
|
+
let r = c.current, i = Cm(h, O, r);
|
|
6451
6454
|
if (i === null) return;
|
|
6452
|
-
let a = r?.maximumFractionDigits != null || r?.minimumFractionDigits != null, l = r?.maximumFractionDigits, u = a && typeof l == "number" ? Number(i.toFixed(l)) : i, d =
|
|
6453
|
-
I === "onBlur" && ae.commit(u), f && (de.current = !0,
|
|
6454
|
-
let g =
|
|
6455
|
-
!(!a && i === j &&
|
|
6455
|
+
let a = r?.maximumFractionDigits != null || r?.minimumFractionDigits != null, l = r?.maximumFractionDigits, u = a && typeof l == "number" ? Number(i.toFixed(l)) : i, d = m(D, e.nativeEvent), f = j !== u, p = t || f || n;
|
|
6456
|
+
I === "onBlur" && ae.commit(u), f && (de.current = !0, C(u, fe(D, e.nativeEvent))), p && M(u, d);
|
|
6457
|
+
let g = zp(u, O, r);
|
|
6458
|
+
!(!a && i === j && h === Bp(i, O, r)) && h !== g && E(g);
|
|
6456
6459
|
},
|
|
6457
6460
|
onChange(e) {
|
|
6458
6461
|
if (e.nativeEvent.defaultPrevented) return;
|
|
6459
6462
|
o.current = !1;
|
|
6460
6463
|
let t = e.currentTarget.value;
|
|
6461
6464
|
if (t.trim() === "") {
|
|
6462
|
-
|
|
6465
|
+
E(t), C(null, fe(y, e.nativeEvent));
|
|
6463
6466
|
return;
|
|
6464
6467
|
}
|
|
6465
6468
|
let n = l();
|
|
6466
6469
|
if (!Array.from(t).every((e) => {
|
|
6467
|
-
let t = e >= "0" && e <= "9", r =
|
|
6470
|
+
let t = e >= "0" && e <= "9", r = am.test(e), i = sm.test(e), a = om.test(e), o = cm.test(e), s = bm.test(e);
|
|
6468
6471
|
return t || r || i || a || o || s || n.has(e);
|
|
6469
6472
|
})) return;
|
|
6470
|
-
let r =
|
|
6471
|
-
|
|
6473
|
+
let r = Cm(t, O, c.current);
|
|
6474
|
+
E(t), r !== null && C(r, fe(k, e.nativeEvent));
|
|
6472
6475
|
},
|
|
6473
6476
|
onKeyDown(e) {
|
|
6474
|
-
if (e.defaultPrevented ||
|
|
6477
|
+
if (e.defaultPrevented || b || s) return;
|
|
6475
6478
|
let t = e.nativeEvent;
|
|
6476
6479
|
o.current = !0;
|
|
6477
|
-
let n = l(), r = n.has(e.key), { decimal: i, currency: a, percentSign: d } =
|
|
6478
|
-
if (ym.test(e.key) && Array.from(n).some((e) => ym.test(e || ""))) {
|
|
6479
|
-
let e = m.search(_m), t = e != null && e !== -1 && x(e);
|
|
6480
|
-
r = !(ym.test(m) || bm.test(m)) || b || t;
|
|
6481
|
-
}
|
|
6480
|
+
let n = l(), r = n.has(e.key), { decimal: i, currency: a, percentSign: d } = Sm(O, c.current), p = e.currentTarget.selectionStart, v = e.currentTarget.selectionEnd, y = p === 0 && v === h.length, x = (e) => p != null && v != null && e >= p && e < v;
|
|
6482
6481
|
if (bm.test(e.key) && Array.from(n).some((e) => bm.test(e || ""))) {
|
|
6483
|
-
let e =
|
|
6484
|
-
r = !(
|
|
6482
|
+
let e = h.search(vm), t = e != null && e !== -1 && x(e);
|
|
6483
|
+
r = !(bm.test(h) || xm.test(h)) || y || t;
|
|
6484
|
+
}
|
|
6485
|
+
if (xm.test(e.key) && Array.from(n).some((e) => xm.test(e || ""))) {
|
|
6486
|
+
let e = h.search(ym), t = e != null && e !== -1 && x(e);
|
|
6487
|
+
r = !(bm.test(h) || xm.test(h)) || y || t;
|
|
6485
6488
|
}
|
|
6486
6489
|
[
|
|
6487
6490
|
i,
|
|
@@ -6489,47 +6492,47 @@ var Km = {
|
|
|
6489
6492
|
d
|
|
6490
6493
|
].forEach((t) => {
|
|
6491
6494
|
if (e.key === t) {
|
|
6492
|
-
let e = x(
|
|
6493
|
-
r = !
|
|
6495
|
+
let e = x(h.indexOf(t));
|
|
6496
|
+
r = !h.includes(t) || y || e;
|
|
6494
6497
|
}
|
|
6495
6498
|
});
|
|
6496
|
-
let
|
|
6497
|
-
if (e.which === 229 || e.altKey || e.ctrlKey || e.metaKey || r ||
|
|
6498
|
-
let A =
|
|
6499
|
-
|
|
6500
|
-
let
|
|
6499
|
+
let S = e.key >= "0" && e.key <= "9", w = am.test(e.key), E = sm.test(e.key), D = cm.test(e.key), k = Jm.has(e.key);
|
|
6500
|
+
if (e.which === 229 || e.altKey || e.ctrlKey || e.metaKey || r || S || w || D || E || k) return;
|
|
6501
|
+
let A = Cm(h, O, c.current), j = u(e) ?? 1;
|
|
6502
|
+
Se(e);
|
|
6503
|
+
let P = m(T, t);
|
|
6501
6504
|
e.key === "ArrowUp" ? (f(j, {
|
|
6502
6505
|
direction: 1,
|
|
6503
6506
|
currentValue: A,
|
|
6504
6507
|
event: t,
|
|
6505
|
-
reason:
|
|
6506
|
-
}),
|
|
6508
|
+
reason: T
|
|
6509
|
+
}), M(N.current ?? F.current, P)) : e.key === "ArrowDown" ? (f(j, {
|
|
6507
6510
|
direction: -1,
|
|
6508
6511
|
currentValue: A,
|
|
6509
6512
|
event: t,
|
|
6510
|
-
reason:
|
|
6511
|
-
}),
|
|
6513
|
+
reason: T
|
|
6514
|
+
}), M(N.current ?? F.current, P)) : e.key === "Home" && _ != null ? (C(_, fe(T, t)), M(N.current ?? F.current, P)) : e.key === "End" && g != null && (C(g, fe(T, t)), M(N.current ?? F.current, P));
|
|
6512
6515
|
},
|
|
6513
6516
|
onPaste(e) {
|
|
6514
|
-
if (e.defaultPrevented ||
|
|
6517
|
+
if (e.defaultPrevented || b || s) return;
|
|
6515
6518
|
e.preventDefault();
|
|
6516
|
-
let t = (e.clipboardData || window.Clipboard).getData("text/plain"), n =
|
|
6517
|
-
n !== null && (o.current = !1,
|
|
6519
|
+
let t = (e.clipboardData || window.Clipboard).getData("text/plain"), n = Cm(t, O, c.current);
|
|
6520
|
+
n !== null && (o.current = !1, C(n, fe(S, e.nativeEvent)), E(t));
|
|
6518
6521
|
}
|
|
6519
6522
|
},
|
|
6520
6523
|
ae.getValidationProps(),
|
|
6521
6524
|
a
|
|
6522
6525
|
],
|
|
6523
|
-
stateAttributesMapping:
|
|
6526
|
+
stateAttributesMapping: qm
|
|
6524
6527
|
});
|
|
6525
6528
|
});
|
|
6526
|
-
process.env.NODE_ENV !== "production" && (
|
|
6529
|
+
process.env.NODE_ENV !== "production" && (Ym.displayName = "NumberFieldInput");
|
|
6527
6530
|
//#endregion
|
|
6528
6531
|
//#region src/base/form/fields/EntityPickerField.tsx
|
|
6529
|
-
function
|
|
6532
|
+
function Xm(e) {
|
|
6530
6533
|
return e.split(/\s+/).slice(0, 2).map((e) => e[0]?.toUpperCase() ?? "").join("");
|
|
6531
6534
|
}
|
|
6532
|
-
function
|
|
6535
|
+
function Zm({ id: e, value: t, onChange: n, options: r, initialOption: i, autocompleteHref: a, autocompleteMinChars: o = 2, entityAvatarField: s, entitySubtitleField: c, placeholder: l, disabled: u, required: d, error: f, helpTextId: p, errorId: m }) {
|
|
6533
6536
|
let { t: h } = De(), [g, _] = gt(i && t && i.value === t ? i.label : ""), [v, y] = gt([]), [b, x] = gt(!1), S = ht(void 0), C = !!a, w = [f ? m : void 0, p].filter(Boolean).join(" ") || void 0, T = mt(() => [], []), E = mt(() => r ?? T, [r, T]);
|
|
6534
6537
|
ft(() => {
|
|
6535
6538
|
if (C) return S.current && clearTimeout(S.current), g.length < o ? (S.current = setTimeout(() => y([]), 0), () => {
|
|
@@ -6577,12 +6580,12 @@ function Xm({ id: e, value: t, onChange: n, options: r, initialOption: i, autoco
|
|
|
6577
6580
|
C
|
|
6578
6581
|
]), A = B((e) => {
|
|
6579
6582
|
n(e ?? "");
|
|
6580
|
-
}, [n]), j = b ? h("middag.ui.form.entity_loading") : g.length < o && C ? h("middag.ui.form.entity_min_chars").replace("{min}", String(o)) : h("middag.ui.form.entity_no_results"),
|
|
6581
|
-
return /* @__PURE__ */ H(
|
|
6583
|
+
}, [n]), j = b ? h("middag.ui.form.entity_loading") : g.length < o && C ? h("middag.ui.form.entity_min_chars").replace("{min}", String(o)) : h("middag.ui.form.entity_no_results"), M = !!s || O.some((e) => e.avatarUrl);
|
|
6584
|
+
return /* @__PURE__ */ H(ye, {
|
|
6582
6585
|
items: k,
|
|
6583
6586
|
value: t || null,
|
|
6584
6587
|
onValueChange: A,
|
|
6585
|
-
children: [/* @__PURE__ */ V(
|
|
6588
|
+
children: [/* @__PURE__ */ V(ue, {
|
|
6586
6589
|
id: e,
|
|
6587
6590
|
placeholder: l ?? h("middag.ui.form.entity_search"),
|
|
6588
6591
|
disabled: u,
|
|
@@ -6593,20 +6596,20 @@ function Xm({ id: e, value: t, onChange: n, options: r, initialOption: i, autoco
|
|
|
6593
6596
|
showTrigger: !0,
|
|
6594
6597
|
value: g,
|
|
6595
6598
|
onChange: (e) => _(e.target.value)
|
|
6596
|
-
}), /* @__PURE__ */ H(
|
|
6599
|
+
}), /* @__PURE__ */ H(me, { children: [/* @__PURE__ */ V(ve, {
|
|
6597
6600
|
className: "px-4 py-3 text-sm",
|
|
6598
6601
|
children: j
|
|
6599
|
-
}), /* @__PURE__ */ V(
|
|
6602
|
+
}), /* @__PURE__ */ V(he, { children: k.map((e) => /* @__PURE__ */ H(ie, {
|
|
6600
6603
|
value: e.value,
|
|
6601
6604
|
className: "flex items-center gap-2.5 px-3 py-2",
|
|
6602
|
-
children: [
|
|
6605
|
+
children: [M && /* @__PURE__ */ H(Mp, {
|
|
6603
6606
|
className: "h-7 w-7 shrink-0",
|
|
6604
|
-
children: [e.avatarUrl && /* @__PURE__ */ V(
|
|
6607
|
+
children: [e.avatarUrl && /* @__PURE__ */ V(Np, {
|
|
6605
6608
|
src: e.avatarUrl,
|
|
6606
6609
|
alt: e.label
|
|
6607
|
-
}), /* @__PURE__ */ V(
|
|
6610
|
+
}), /* @__PURE__ */ V(Pp, {
|
|
6608
6611
|
className: "text-[10px]",
|
|
6609
|
-
children:
|
|
6612
|
+
children: Xm(e.label)
|
|
6610
6613
|
})]
|
|
6611
6614
|
}), /* @__PURE__ */ H("div", {
|
|
6612
6615
|
className: "min-w-0 flex-1",
|
|
@@ -6623,7 +6626,7 @@ function Xm({ id: e, value: t, onChange: n, options: r, initialOption: i, autoco
|
|
|
6623
6626
|
}
|
|
6624
6627
|
//#endregion
|
|
6625
6628
|
//#region src/lib/hooks/use-file-upload.ts
|
|
6626
|
-
var
|
|
6629
|
+
var Qm = (e = {}) => {
|
|
6627
6630
|
let { maxFiles: t = Infinity, maxSize: n = Infinity, accept: r = "*", multiple: i = !1, initialFiles: a = [], onFilesChange: o, onFilesAdded: s, onError: c } = e, [l, u] = gt({
|
|
6628
6631
|
files: a.map((e) => ({
|
|
6629
6632
|
file: e,
|
|
@@ -6634,8 +6637,8 @@ var Zm = (e = {}) => {
|
|
|
6634
6637
|
errors: []
|
|
6635
6638
|
}), d = ht(null), f = B((e) => {
|
|
6636
6639
|
if (e instanceof File) {
|
|
6637
|
-
if (e.size > n) return `File "${e.name}" exceeds the maximum size of ${
|
|
6638
|
-
} else if (e.size > n) return `File "${e.name}" exceeds the maximum size of ${
|
|
6640
|
+
if (e.size > n) return `File "${e.name}" exceeds the maximum size of ${$m(n)}.`;
|
|
6641
|
+
} else if (e.size > n) return `File "${e.name}" exceeds the maximum size of ${$m(n)}.`;
|
|
6639
6642
|
if (r !== "*") {
|
|
6640
6643
|
let t = r.split(",").map((e) => e.trim()), n = e instanceof File ? e.type || "" : e.type, i = `.${e instanceof File, e.name.split(".").pop()}`;
|
|
6641
6644
|
if (!t.some((e) => {
|
|
@@ -6676,7 +6679,7 @@ var Zm = (e = {}) => {
|
|
|
6676
6679
|
for (let e of r) {
|
|
6677
6680
|
if (i && l.files.some((t) => t.file.name === e.name && t.file.size === e.size)) return;
|
|
6678
6681
|
if (e.size > n) {
|
|
6679
|
-
a.push(i ? `Some files exceed the maximum size of ${
|
|
6682
|
+
a.push(i ? `Some files exceed the maximum size of ${$m(n)}.` : `File exceeds the maximum size of ${$m(n)}.`);
|
|
6680
6683
|
continue;
|
|
6681
6684
|
}
|
|
6682
6685
|
let t = f(e);
|
|
@@ -6775,7 +6778,7 @@ var Zm = (e = {}) => {
|
|
|
6775
6778
|
C
|
|
6776
6779
|
])
|
|
6777
6780
|
}];
|
|
6778
|
-
},
|
|
6781
|
+
}, $m = (e, t = 2) => {
|
|
6779
6782
|
if (e === 0) return "0 Bytes";
|
|
6780
6783
|
let n = 1024, r = t < 0 ? 0 : t, i = [
|
|
6781
6784
|
"Bytes",
|
|
@@ -6792,8 +6795,8 @@ var Zm = (e = {}) => {
|
|
|
6792
6795
|
};
|
|
6793
6796
|
//#endregion
|
|
6794
6797
|
//#region src/base/form/fields/FileUploadField.tsx
|
|
6795
|
-
function
|
|
6796
|
-
let { t: m } = De(), [{ files: h, isDragging: g, errors: _ }, { removeFile: v, handleDragEnter: y, handleDragLeave: b, handleDragOver: x, handleDrop: S, openFileDialog: C, getInputProps: w }] =
|
|
6798
|
+
function eh({ id: t, value: n, onChange: r, accept: i = "*", multiple: a = !1, maxFiles: o = 10, maxSize: s = 10 * 1024 * 1024, disabled: c, required: l, error: u, helpTextId: d, errorId: p }) {
|
|
6799
|
+
let { t: m } = De(), [{ files: h, isDragging: g, errors: _ }, { removeFile: v, handleDragEnter: y, handleDragLeave: b, handleDragOver: x, handleDrop: S, openFileDialog: C, getInputProps: w }] = Qm({
|
|
6797
6800
|
maxFiles: a ? o : 1,
|
|
6798
6801
|
maxSize: s,
|
|
6799
6802
|
accept: i,
|
|
@@ -6841,7 +6844,7 @@ function $m({ id: t, value: n, onChange: r, accept: i = "*", multiple: a = !1, m
|
|
|
6841
6844
|
children: [
|
|
6842
6845
|
m("middag.ui.form.file_max_size"),
|
|
6843
6846
|
" ",
|
|
6844
|
-
|
|
6847
|
+
$m(s)
|
|
6845
6848
|
]
|
|
6846
6849
|
})
|
|
6847
6850
|
]
|
|
@@ -6868,7 +6871,7 @@ function $m({ id: t, value: n, onChange: r, accept: i = "*", multiple: a = !1, m
|
|
|
6868
6871
|
children: e.file.name
|
|
6869
6872
|
}), /* @__PURE__ */ V("p", {
|
|
6870
6873
|
className: "text-muted-foreground text-xs",
|
|
6871
|
-
children:
|
|
6874
|
+
children: $m(e.file.size)
|
|
6872
6875
|
})]
|
|
6873
6876
|
}),
|
|
6874
6877
|
/* @__PURE__ */ V(f, {
|
|
@@ -6902,10 +6905,10 @@ function $m({ id: t, value: n, onChange: r, accept: i = "*", multiple: a = !1, m
|
|
|
6902
6905
|
}
|
|
6903
6906
|
//#endregion
|
|
6904
6907
|
//#region src/base/form/fields/MultiSelectField.tsx
|
|
6905
|
-
var
|
|
6906
|
-
function
|
|
6908
|
+
var th = 8;
|
|
6909
|
+
function nh({ id: e, value: t, onChange: n, options: r, placeholder: i, disabled: a, required: o, error: s, helpTextId: c, errorId: l }) {
|
|
6907
6910
|
let { t: u } = De(), d = t ?? [], f = [s ? l : void 0, c].filter(Boolean).join(" ") || void 0;
|
|
6908
|
-
return r.length <=
|
|
6911
|
+
return r.length <= th ? /* @__PURE__ */ V(rh, {
|
|
6909
6912
|
id: e,
|
|
6910
6913
|
options: r,
|
|
6911
6914
|
selected: d,
|
|
@@ -6915,7 +6918,7 @@ function th({ id: e, value: t, onChange: n, options: r, placeholder: i, disabled
|
|
|
6915
6918
|
error: s,
|
|
6916
6919
|
describedBy: f,
|
|
6917
6920
|
t: u
|
|
6918
|
-
}) : /* @__PURE__ */ V(
|
|
6921
|
+
}) : /* @__PURE__ */ V(ih, {
|
|
6919
6922
|
id: e,
|
|
6920
6923
|
options: r,
|
|
6921
6924
|
selected: d,
|
|
@@ -6928,7 +6931,7 @@ function th({ id: e, value: t, onChange: n, options: r, placeholder: i, disabled
|
|
|
6928
6931
|
t: u
|
|
6929
6932
|
});
|
|
6930
6933
|
}
|
|
6931
|
-
function
|
|
6934
|
+
function rh({ id: e, options: t, selected: n, onChange: r, disabled: i, required: a, error: o, describedBy: s, t: c }) {
|
|
6932
6935
|
let l = (e) => {
|
|
6933
6936
|
n.includes(e) ? r(n.filter((t) => t !== e)) : r([...n, e]);
|
|
6934
6937
|
};
|
|
@@ -6941,12 +6944,12 @@ function nh({ id: e, options: t, selected: n, onChange: r, disabled: i, required
|
|
|
6941
6944
|
className: "border-input max-h-48 space-y-2 overflow-y-auto rounded-md border p-3",
|
|
6942
6945
|
children: [t.map((t) => /* @__PURE__ */ H("div", {
|
|
6943
6946
|
className: "flex items-center gap-2",
|
|
6944
|
-
children: [/* @__PURE__ */ V(
|
|
6947
|
+
children: [/* @__PURE__ */ V(Tp, {
|
|
6945
6948
|
id: `${e}-${t.value}`,
|
|
6946
6949
|
checked: n.includes(t.value),
|
|
6947
6950
|
onCheckedChange: () => l(t.value),
|
|
6948
6951
|
disabled: i
|
|
6949
|
-
}), /* @__PURE__ */ V(
|
|
6952
|
+
}), /* @__PURE__ */ V(Dp, {
|
|
6950
6953
|
htmlFor: `${e}-${t.value}`,
|
|
6951
6954
|
className: "text-sm font-normal",
|
|
6952
6955
|
children: t.label
|
|
@@ -6957,7 +6960,7 @@ function nh({ id: e, options: t, selected: n, onChange: r, disabled: i, required
|
|
|
6957
6960
|
})]
|
|
6958
6961
|
});
|
|
6959
6962
|
}
|
|
6960
|
-
function
|
|
6963
|
+
function ih({ id: e, options: t, selected: n, onChange: r, placeholder: i, disabled: a, required: o, error: s, describedBy: c, t: l }) {
|
|
6961
6964
|
let [u, d] = gt(""), f = mt(() => {
|
|
6962
6965
|
if (!u) return t;
|
|
6963
6966
|
let e = u.toLowerCase();
|
|
@@ -6988,7 +6991,7 @@ function rh({ id: e, options: t, selected: n, onChange: r, placeholder: i, disab
|
|
|
6988
6991
|
type: "button",
|
|
6989
6992
|
onClick: () => m(e.value),
|
|
6990
6993
|
className: "text-muted-foreground hover:text-foreground ml-0.5 rounded-full",
|
|
6991
|
-
"aria-label": l("middag.ui.form.multiselect_remove"
|
|
6994
|
+
"aria-label": l("middag.ui.form.multiselect_remove", { label: e.label }),
|
|
6992
6995
|
children: /* @__PURE__ */ H("svg", {
|
|
6993
6996
|
viewBox: "0 0 24 24",
|
|
6994
6997
|
fill: "none",
|
|
@@ -7009,23 +7012,23 @@ function rh({ id: e, options: t, selected: n, onChange: r, placeholder: i, disab
|
|
|
7009
7012
|
})
|
|
7010
7013
|
})]
|
|
7011
7014
|
}, e.value))
|
|
7012
|
-
}), /* @__PURE__ */ H(
|
|
7015
|
+
}), /* @__PURE__ */ H(ye, {
|
|
7013
7016
|
items: f,
|
|
7014
7017
|
value: null,
|
|
7015
7018
|
onValueChange: h,
|
|
7016
|
-
children: [/* @__PURE__ */ V(
|
|
7019
|
+
children: [/* @__PURE__ */ V(ue, {
|
|
7017
7020
|
placeholder: i ?? l("middag.ui.form.multiselect_search"),
|
|
7018
7021
|
disabled: a,
|
|
7019
7022
|
showTrigger: !0,
|
|
7020
7023
|
value: u,
|
|
7021
7024
|
onChange: (e) => d(e.target.value)
|
|
7022
|
-
}), /* @__PURE__ */ H(
|
|
7025
|
+
}), /* @__PURE__ */ H(me, { children: [/* @__PURE__ */ V(ve, {
|
|
7023
7026
|
className: "px-4 py-3 text-sm",
|
|
7024
7027
|
children: l("middag.ui.form.entity_no_results")
|
|
7025
|
-
}), /* @__PURE__ */ V(
|
|
7028
|
+
}), /* @__PURE__ */ V(he, { children: f.map((e) => /* @__PURE__ */ H(ie, {
|
|
7026
7029
|
value: e.value,
|
|
7027
7030
|
className: "flex items-center gap-2",
|
|
7028
|
-
children: [/* @__PURE__ */ V(
|
|
7031
|
+
children: [/* @__PURE__ */ V(Tp, {
|
|
7029
7032
|
checked: n.includes(e.value),
|
|
7030
7033
|
tabIndex: -1,
|
|
7031
7034
|
className: "pointer-events-none"
|
|
@@ -7039,7 +7042,7 @@ function rh({ id: e, options: t, selected: n, onChange: r, placeholder: i, disab
|
|
|
7039
7042
|
}
|
|
7040
7043
|
//#endregion
|
|
7041
7044
|
//#region src/components/reui/native-select.tsx
|
|
7042
|
-
function
|
|
7045
|
+
function ah({ className: t, size: n = "default", ...r }) {
|
|
7043
7046
|
return /* @__PURE__ */ H("div", {
|
|
7044
7047
|
className: "group/native-select relative w-fit has-[select:disabled]:opacity-50",
|
|
7045
7048
|
"data-slot": "native-select-wrapper",
|
|
@@ -7055,7 +7058,7 @@ function ih({ className: t, size: n = "default", ...r }) {
|
|
|
7055
7058
|
})]
|
|
7056
7059
|
});
|
|
7057
7060
|
}
|
|
7058
|
-
function
|
|
7061
|
+
function oh({ className: t, ...n }) {
|
|
7059
7062
|
return /* @__PURE__ */ V("option", {
|
|
7060
7063
|
"data-slot": "native-select-option",
|
|
7061
7064
|
className: e("bg-[Canvas] text-[CanvasText]", t),
|
|
@@ -7064,11 +7067,11 @@ function ah({ className: t, ...n }) {
|
|
|
7064
7067
|
}
|
|
7065
7068
|
//#endregion
|
|
7066
7069
|
//#region src/base/form/fields/NativeSelectField.tsx
|
|
7067
|
-
function
|
|
7070
|
+
function sh({ id: e, value: t, onChange: n, options: r, placeholder: i, disabled: a, required: o, error: s, helpTextId: c, errorId: l }) {
|
|
7068
7071
|
let { t: u } = De(), d = [s ? l : void 0, c].filter(Boolean).join(" ") || void 0;
|
|
7069
7072
|
return /* @__PURE__ */ V("div", {
|
|
7070
7073
|
className: "w-full [&>div]:w-full",
|
|
7071
|
-
children: /* @__PURE__ */ H(
|
|
7074
|
+
children: /* @__PURE__ */ H(ah, {
|
|
7072
7075
|
id: e,
|
|
7073
7076
|
value: t ?? "",
|
|
7074
7077
|
onChange: (e) => n(e.target.value),
|
|
@@ -7076,11 +7079,11 @@ function oh({ id: e, value: t, onChange: n, options: r, placeholder: i, disabled
|
|
|
7076
7079
|
required: o,
|
|
7077
7080
|
"aria-invalid": s ? !0 : void 0,
|
|
7078
7081
|
"aria-describedby": d,
|
|
7079
|
-
children: [/* @__PURE__ */ V(
|
|
7082
|
+
children: [/* @__PURE__ */ V(oh, {
|
|
7080
7083
|
value: "",
|
|
7081
7084
|
disabled: o,
|
|
7082
7085
|
children: i ?? u("middag.ui.form.select_placeholder")
|
|
7083
|
-
}), r.map((e) => /* @__PURE__ */ V(
|
|
7086
|
+
}), r.map((e) => /* @__PURE__ */ V(oh, {
|
|
7084
7087
|
value: e.value,
|
|
7085
7088
|
children: e.label
|
|
7086
7089
|
}, e.value))]
|
|
@@ -7089,21 +7092,21 @@ function oh({ id: e, value: t, onChange: n, options: r, placeholder: i, disabled
|
|
|
7089
7092
|
}
|
|
7090
7093
|
//#endregion
|
|
7091
7094
|
//#region src/components/reui/number-field.tsx
|
|
7092
|
-
var
|
|
7095
|
+
var ch = lt(null), lh = s("relative flex w-full justify-between border border-input data-disabled:pointer-events-none data-disabled:opacity-50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive focus-within:has-aria-invalid:border-destructive focus-within:has-aria-invalid:ring-destructive/20 dark:focus-within:has-aria-invalid:ring-destructive/40 rounded-4xl bg-input/30 transition-colors focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]", {
|
|
7093
7096
|
variants: { size: {
|
|
7094
7097
|
sm: "h-8 text-sm",
|
|
7095
7098
|
default: "h-9 text-sm",
|
|
7096
7099
|
lg: "h-10 text-sm"
|
|
7097
7100
|
} },
|
|
7098
7101
|
defaultVariants: { size: "default" }
|
|
7099
|
-
}),
|
|
7102
|
+
}), uh = s("relative flex shrink-0 cursor-pointer items-center justify-center transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent", {
|
|
7100
7103
|
variants: { size: {
|
|
7101
7104
|
sm: "px-2 [&_svg:not([class*='size-'])]:size-3.5",
|
|
7102
7105
|
default: "px-2.5 [&_svg:not([class*='size-'])]:size-4",
|
|
7103
7106
|
lg: "px-3 [&_svg:not([class*='size-'])]:size-4"
|
|
7104
7107
|
} },
|
|
7105
7108
|
defaultVariants: { size: "default" }
|
|
7106
|
-
}),
|
|
7109
|
+
}), dh = s("w-full min-w-0 flex-1 bg-transparent text-center tabular-nums outline-none", {
|
|
7107
7110
|
variants: { size: {
|
|
7108
7111
|
sm: "px-2.5 py-1",
|
|
7109
7112
|
default: "px-3 py-1.5",
|
|
@@ -7111,14 +7114,14 @@ var sh = lt(null), ch = s("relative flex w-full justify-between border border-in
|
|
|
7111
7114
|
} },
|
|
7112
7115
|
defaultVariants: { size: "default" }
|
|
7113
7116
|
});
|
|
7114
|
-
function
|
|
7117
|
+
function fh({ id: t, className: n, size: r = "default", ...i }) {
|
|
7115
7118
|
let a = pt(), o = t ?? a, s = r ?? "default";
|
|
7116
|
-
return /* @__PURE__ */ V(
|
|
7119
|
+
return /* @__PURE__ */ V(ch.Provider, {
|
|
7117
7120
|
value: {
|
|
7118
7121
|
fieldId: o,
|
|
7119
7122
|
size: s
|
|
7120
7123
|
},
|
|
7121
|
-
children: /* @__PURE__ */ V(
|
|
7124
|
+
children: /* @__PURE__ */ V(Am, {
|
|
7122
7125
|
className: e("flex w-full flex-col items-start gap-2", n),
|
|
7123
7126
|
"data-size": s,
|
|
7124
7127
|
"data-slot": "number-field",
|
|
@@ -7127,20 +7130,20 @@ function dh({ id: t, className: n, size: r = "default", ...i }) {
|
|
|
7127
7130
|
})
|
|
7128
7131
|
});
|
|
7129
7132
|
}
|
|
7130
|
-
function
|
|
7131
|
-
let i = dt(
|
|
7133
|
+
function ph({ className: t, size: n, ...r }) {
|
|
7134
|
+
let i = dt(ch);
|
|
7132
7135
|
if (!i) throw Error("NumberFieldGroup must be used within a NumberField component.");
|
|
7133
|
-
return /* @__PURE__ */ V(
|
|
7134
|
-
className: e(
|
|
7136
|
+
return /* @__PURE__ */ V(Mm, {
|
|
7137
|
+
className: e(lh({ size: n ?? i.size }), t),
|
|
7135
7138
|
"data-slot": "number-field-group",
|
|
7136
7139
|
...r
|
|
7137
7140
|
});
|
|
7138
7141
|
}
|
|
7139
|
-
function
|
|
7140
|
-
let a = dt(
|
|
7142
|
+
function mh({ className: t, size: n, children: r, ...i }) {
|
|
7143
|
+
let a = dt(ch);
|
|
7141
7144
|
if (!a) throw Error("NumberFieldDecrement must be used within a NumberField component.");
|
|
7142
|
-
return /* @__PURE__ */ V(
|
|
7143
|
-
className: e(
|
|
7145
|
+
return /* @__PURE__ */ V(Km, {
|
|
7146
|
+
className: e(uh({ size: n ?? a.size }), "rounded-s-4xl border-e-0", t),
|
|
7144
7147
|
"data-slot": "number-field-decrement",
|
|
7145
7148
|
...i,
|
|
7146
7149
|
children: r ?? /* @__PURE__ */ V(R, {
|
|
@@ -7149,11 +7152,11 @@ function ph({ className: t, size: n, children: r, ...i }) {
|
|
|
7149
7152
|
})
|
|
7150
7153
|
});
|
|
7151
7154
|
}
|
|
7152
|
-
function
|
|
7153
|
-
let a = dt(
|
|
7155
|
+
function hh({ className: t, size: n, children: r, ...i }) {
|
|
7156
|
+
let a = dt(ch);
|
|
7154
7157
|
if (!a) throw Error("NumberFieldIncrement must be used within a NumberField component.");
|
|
7155
|
-
return /* @__PURE__ */ V(
|
|
7156
|
-
className: e(
|
|
7158
|
+
return /* @__PURE__ */ V(Gm, {
|
|
7159
|
+
className: e(uh({ size: n ?? a.size }), "rounded-e-4xl border-s-0", t),
|
|
7157
7160
|
"data-slot": "number-field-increment",
|
|
7158
7161
|
...i,
|
|
7159
7162
|
children: r ?? /* @__PURE__ */ V(R, {
|
|
@@ -7162,20 +7165,20 @@ function mh({ className: t, size: n, children: r, ...i }) {
|
|
|
7162
7165
|
})
|
|
7163
7166
|
});
|
|
7164
7167
|
}
|
|
7165
|
-
function
|
|
7166
|
-
let i = dt(
|
|
7168
|
+
function gh({ className: t, size: n, ...r }) {
|
|
7169
|
+
let i = dt(ch);
|
|
7167
7170
|
if (!i) throw Error("NumberFieldInput must be used within a NumberField component.");
|
|
7168
|
-
return /* @__PURE__ */ V(
|
|
7169
|
-
className: e(
|
|
7171
|
+
return /* @__PURE__ */ V(Ym, {
|
|
7172
|
+
className: e(dh({ size: n ?? i.size }), t),
|
|
7170
7173
|
"data-slot": "number-field-input",
|
|
7171
7174
|
...r
|
|
7172
7175
|
});
|
|
7173
7176
|
}
|
|
7174
7177
|
//#endregion
|
|
7175
7178
|
//#region src/base/form/fields/NumberField.tsx
|
|
7176
|
-
function
|
|
7179
|
+
function _h({ id: e, value: t, onChange: n, min: r, max: i, step: a = 1, disabled: o, required: s, error: c, helpTextId: l, errorId: u }) {
|
|
7177
7180
|
let d = [c ? u : void 0, l].filter(Boolean).join(" ") || void 0;
|
|
7178
|
-
return /* @__PURE__ */ V(
|
|
7181
|
+
return /* @__PURE__ */ V(fh, {
|
|
7179
7182
|
id: e,
|
|
7180
7183
|
value: t ?? void 0,
|
|
7181
7184
|
onValueChange: (e) => n(e ?? null),
|
|
@@ -7186,50 +7189,50 @@ function gh({ id: e, value: t, onChange: n, min: r, max: i, step: a = 1, disable
|
|
|
7186
7189
|
"aria-invalid": c ? !0 : void 0,
|
|
7187
7190
|
"aria-required": s || void 0,
|
|
7188
7191
|
"aria-describedby": d,
|
|
7189
|
-
children: /* @__PURE__ */ H(
|
|
7190
|
-
/* @__PURE__ */ V(
|
|
7191
|
-
/* @__PURE__ */ V(
|
|
7192
|
-
/* @__PURE__ */ V(
|
|
7192
|
+
children: /* @__PURE__ */ H(ph, { children: [
|
|
7193
|
+
/* @__PURE__ */ V(mh, {}),
|
|
7194
|
+
/* @__PURE__ */ V(gh, {}),
|
|
7195
|
+
/* @__PURE__ */ V(hh, {})
|
|
7193
7196
|
] })
|
|
7194
7197
|
});
|
|
7195
7198
|
}
|
|
7196
7199
|
//#endregion
|
|
7197
7200
|
//#region node_modules/input-otp/dist/index.mjs
|
|
7198
|
-
var
|
|
7201
|
+
var vh = Object.defineProperty, yh = Object.defineProperties, bh = Object.getOwnPropertyDescriptors, xh = Object.getOwnPropertySymbols, Sh = Object.prototype.hasOwnProperty, Ch = Object.prototype.propertyIsEnumerable, wh = (e, t, n) => t in e ? vh(e, t, {
|
|
7199
7202
|
enumerable: !0,
|
|
7200
7203
|
configurable: !0,
|
|
7201
7204
|
writable: !0,
|
|
7202
7205
|
value: n
|
|
7203
|
-
}) : e[t] = n,
|
|
7204
|
-
for (var n in t ||= {})
|
|
7205
|
-
if (
|
|
7206
|
+
}) : e[t] = n, Th = (e, t) => {
|
|
7207
|
+
for (var n in t ||= {}) Sh.call(t, n) && wh(e, n, t[n]);
|
|
7208
|
+
if (xh) for (var n of xh(t)) Ch.call(t, n) && wh(e, n, t[n]);
|
|
7206
7209
|
return e;
|
|
7207
|
-
},
|
|
7210
|
+
}, Eh = (e, t) => yh(e, bh(t)), Dh = (e, t) => {
|
|
7208
7211
|
var n = {};
|
|
7209
|
-
for (var r in e)
|
|
7210
|
-
if (e != null &&
|
|
7212
|
+
for (var r in e) Sh.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
7213
|
+
if (e != null && xh) for (var r of xh(e)) t.indexOf(r) < 0 && Ch.call(e, r) && (n[r] = e[r]);
|
|
7211
7214
|
return n;
|
|
7212
7215
|
};
|
|
7213
|
-
function
|
|
7216
|
+
function Oh(e) {
|
|
7214
7217
|
return [
|
|
7215
7218
|
setTimeout(e, 0),
|
|
7216
7219
|
setTimeout(e, 10),
|
|
7217
7220
|
setTimeout(e, 50)
|
|
7218
7221
|
];
|
|
7219
7222
|
}
|
|
7220
|
-
function
|
|
7223
|
+
function kh(e) {
|
|
7221
7224
|
let t = z.useRef();
|
|
7222
7225
|
return z.useEffect(() => {
|
|
7223
7226
|
t.current = e;
|
|
7224
7227
|
}), t.current;
|
|
7225
7228
|
}
|
|
7226
|
-
var
|
|
7229
|
+
var Ah = 18, jh = 40, Mh = `${jh}px`, Nh = [
|
|
7227
7230
|
"[data-lastpass-icon-root]",
|
|
7228
7231
|
"com-1password-button",
|
|
7229
7232
|
"[data-dashlanecreated]",
|
|
7230
7233
|
"[style$=\"2147483647 !important;\"]"
|
|
7231
7234
|
].join(",");
|
|
7232
|
-
function
|
|
7235
|
+
function Ph({ containerRef: e, inputRef: t, pushPasswordManagerStrategy: n, isFocused: r }) {
|
|
7233
7236
|
let [i, a] = z.useState(!1), [o, s] = z.useState(!1), [c, l] = z.useState(!1), u = z.useMemo(() => n === "none" ? !1 : (n === "increase-width" || n === "experimental-no-flickering") && i && o, [
|
|
7234
7237
|
i,
|
|
7235
7238
|
o,
|
|
@@ -7237,8 +7240,8 @@ function Nh({ containerRef: e, inputRef: t, pushPasswordManagerStrategy: n, isFo
|
|
|
7237
7240
|
]), d = z.useCallback(() => {
|
|
7238
7241
|
let r = e.current, i = t.current;
|
|
7239
7242
|
if (!r || !i || c || n === "none") return;
|
|
7240
|
-
let o = r, s = o.getBoundingClientRect().left + o.offsetWidth, u = o.getBoundingClientRect().top + o.offsetHeight / 2, d = s -
|
|
7241
|
-
document.querySelectorAll(
|
|
7243
|
+
let o = r, s = o.getBoundingClientRect().left + o.offsetWidth, u = o.getBoundingClientRect().top + o.offsetHeight / 2, d = s - Ah, f = u;
|
|
7244
|
+
document.querySelectorAll(Nh).length === 0 && document.elementFromPoint(d, f) === r || (a(!0), l(!0));
|
|
7242
7245
|
}, [
|
|
7243
7246
|
e,
|
|
7244
7247
|
t,
|
|
@@ -7249,7 +7252,7 @@ function Nh({ containerRef: e, inputRef: t, pushPasswordManagerStrategy: n, isFo
|
|
|
7249
7252
|
let t = e.current;
|
|
7250
7253
|
if (!t || n === "none") return;
|
|
7251
7254
|
function r() {
|
|
7252
|
-
s(window.innerWidth - t.getBoundingClientRect().right >=
|
|
7255
|
+
s(window.innerWidth - t.getBoundingClientRect().right >= jh);
|
|
7253
7256
|
}
|
|
7254
7257
|
r();
|
|
7255
7258
|
let i = setInterval(r, 1e3);
|
|
@@ -7273,11 +7276,11 @@ function Nh({ containerRef: e, inputRef: t, pushPasswordManagerStrategy: n, isFo
|
|
|
7273
7276
|
]), {
|
|
7274
7277
|
hasPWMBadge: i,
|
|
7275
7278
|
willPushPWMBadge: u,
|
|
7276
|
-
PWM_BADGE_SPACE_WIDTH:
|
|
7279
|
+
PWM_BADGE_SPACE_WIDTH: Mh
|
|
7277
7280
|
};
|
|
7278
7281
|
}
|
|
7279
|
-
var
|
|
7280
|
-
var n = e, { value: r, onChange: i, maxLength: a, textAlign: o = "left", pattern: s, placeholder: c, inputMode: l = "numeric", onComplete: u, pushPasswordManagerStrategy: d = "increase-width", pasteTransformer: f, containerClassName: p, noScriptCSSFallback: m =
|
|
7282
|
+
var Fh = z.createContext({}), Ih = z.forwardRef((e, t) => {
|
|
7283
|
+
var n = e, { value: r, onChange: i, maxLength: a, textAlign: o = "left", pattern: s, placeholder: c, inputMode: l = "numeric", onComplete: u, pushPasswordManagerStrategy: d = "increase-width", pasteTransformer: f, containerClassName: p, noScriptCSSFallback: m = Rh, render: h, children: g } = n, _ = Dh(n, [
|
|
7281
7284
|
"value",
|
|
7282
7285
|
"onChange",
|
|
7283
7286
|
"maxLength",
|
|
@@ -7293,7 +7296,7 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7293
7296
|
"render",
|
|
7294
7297
|
"children"
|
|
7295
7298
|
]), v;
|
|
7296
|
-
let [y, b] = z.useState(typeof _.defaultValue == "string" ? _.defaultValue : ""), x = r ?? y, S =
|
|
7299
|
+
let [y, b] = z.useState(typeof _.defaultValue == "string" ? _.defaultValue : ""), x = r ?? y, S = kh(x), C = z.useCallback((e) => {
|
|
7297
7300
|
i?.(e), b(e);
|
|
7298
7301
|
}, [i]), w = z.useMemo(() => s ? typeof s == "string" ? new RegExp(s) : s : null, [s]), T = z.useRef(null), E = z.useRef(null), D = z.useRef({
|
|
7299
7302
|
value: x,
|
|
@@ -7314,7 +7317,7 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7314
7317
|
];
|
|
7315
7318
|
function n() {
|
|
7316
7319
|
if (document.activeElement !== e) {
|
|
7317
|
-
|
|
7320
|
+
P(null), ee(null);
|
|
7318
7321
|
return;
|
|
7319
7322
|
}
|
|
7320
7323
|
let t = e.selectionStart, n = e.selectionEnd, r = e.selectionDirection, i = e.maxLength, a = e.value, o = O.current.prev, s = -1, c = -1, l;
|
|
@@ -7337,17 +7340,17 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7337
7340
|
s !== -1 && c !== -1 && s !== c && T.current.setSelectionRange(s, c, l);
|
|
7338
7341
|
}
|
|
7339
7342
|
let u = s === -1 ? t : s, d = c === -1 ? n : c, f = l ?? r;
|
|
7340
|
-
|
|
7343
|
+
P(u), ee(d), O.current.prev = [
|
|
7341
7344
|
u,
|
|
7342
7345
|
d,
|
|
7343
7346
|
f
|
|
7344
7347
|
];
|
|
7345
7348
|
}
|
|
7346
|
-
if (document.addEventListener("selectionchange", n, { capture: !0 }), n(), document.activeElement === e &&
|
|
7349
|
+
if (document.addEventListener("selectionchange", n, { capture: !0 }), n(), document.activeElement === e && M(!0), !document.getElementById("input-otp-style")) {
|
|
7347
7350
|
let e = document.createElement("style");
|
|
7348
7351
|
if (e.id = "input-otp-style", document.head.appendChild(e), e.sheet) {
|
|
7349
7352
|
let t = "background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";
|
|
7350
|
-
|
|
7353
|
+
Lh(e.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), Lh(e.sheet, `[data-input-otp]:autofill { ${t} }`), Lh(e.sheet, `[data-input-otp]:-webkit-autofill { ${t} }`), Lh(e.sheet, "@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"), Lh(e.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
|
|
7351
7354
|
}
|
|
7352
7355
|
}
|
|
7353
7356
|
let r = () => {
|
|
@@ -7359,13 +7362,13 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7359
7362
|
document.removeEventListener("selectionchange", n, { capture: !0 }), i.disconnect();
|
|
7360
7363
|
};
|
|
7361
7364
|
}, []);
|
|
7362
|
-
let [k, A] = z.useState(!1), [j,
|
|
7365
|
+
let [k, A] = z.useState(!1), [j, M] = z.useState(!1), [N, P] = z.useState(null), [F, ee] = z.useState(null);
|
|
7363
7366
|
z.useEffect(() => {
|
|
7364
|
-
|
|
7367
|
+
Oh(() => {
|
|
7365
7368
|
var e;
|
|
7366
7369
|
(e = T.current) == null || e.dispatchEvent(new Event("input"));
|
|
7367
7370
|
let t = T.current?.selectionStart, n = T.current?.selectionEnd, r = T.current?.selectionDirection;
|
|
7368
|
-
t !== null && n !== null && (
|
|
7371
|
+
t !== null && n !== null && (P(t), ee(n), O.current.prev = [
|
|
7369
7372
|
t,
|
|
7370
7373
|
n,
|
|
7371
7374
|
r
|
|
@@ -7379,7 +7382,7 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7379
7382
|
S,
|
|
7380
7383
|
x
|
|
7381
7384
|
]);
|
|
7382
|
-
let I =
|
|
7385
|
+
let I = Ph({
|
|
7383
7386
|
containerRef: E,
|
|
7384
7387
|
inputRef: T,
|
|
7385
7388
|
pushPasswordManagerStrategy: d,
|
|
@@ -7400,9 +7403,9 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7400
7403
|
var e;
|
|
7401
7404
|
if (T.current) {
|
|
7402
7405
|
let t = Math.min(T.current.value.length, a - 1), n = T.current.value.length;
|
|
7403
|
-
(e = T.current) == null || e.setSelectionRange(t, n),
|
|
7406
|
+
(e = T.current) == null || e.setSelectionRange(t, n), P(t), ee(n);
|
|
7404
7407
|
}
|
|
7405
|
-
|
|
7408
|
+
M(!0);
|
|
7406
7409
|
}, [a]), re = z.useCallback((e) => {
|
|
7407
7410
|
let t = T.current;
|
|
7408
7411
|
if (!f && (!D.current.isIOS || !e.clipboardData || !t)) return;
|
|
@@ -7412,7 +7415,7 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7412
7415
|
if (s.length > 0 && w && !w.test(s)) return;
|
|
7413
7416
|
t.value = s, C(s);
|
|
7414
7417
|
let c = Math.min(s.length, a - 1), l = s.length;
|
|
7415
|
-
t.setSelectionRange(c, l),
|
|
7418
|
+
t.setSelectionRange(c, l), P(c), ee(l);
|
|
7416
7419
|
}, [
|
|
7417
7420
|
a,
|
|
7418
7421
|
C,
|
|
@@ -7449,11 +7452,11 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7449
7452
|
I.PWM_BADGE_SPACE_WIDTH,
|
|
7450
7453
|
I.willPushPWMBadge,
|
|
7451
7454
|
o
|
|
7452
|
-
]), oe = z.useMemo(() => z.createElement("input", Th(
|
|
7455
|
+
]), oe = z.useMemo(() => z.createElement("input", Eh(Th({ autoComplete: _.autoComplete || "one-time-code" }, _), {
|
|
7453
7456
|
"data-input-otp": !0,
|
|
7454
7457
|
"data-input-otp-placeholder-shown": x.length === 0 || void 0,
|
|
7455
|
-
"data-input-otp-mss":
|
|
7456
|
-
"data-input-otp-mse":
|
|
7458
|
+
"data-input-otp-mss": N,
|
|
7459
|
+
"data-input-otp-mse": F,
|
|
7457
7460
|
inputMode: l,
|
|
7458
7461
|
pattern: w?.source,
|
|
7459
7462
|
"aria-placeholder": c,
|
|
@@ -7480,7 +7483,7 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7480
7483
|
},
|
|
7481
7484
|
onBlur: (e) => {
|
|
7482
7485
|
var t;
|
|
7483
|
-
|
|
7486
|
+
M(!1), (t = _.onBlur) == null || t.call(_, e);
|
|
7484
7487
|
}
|
|
7485
7488
|
})), [
|
|
7486
7489
|
te,
|
|
@@ -7489,14 +7492,14 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7489
7492
|
l,
|
|
7490
7493
|
ae,
|
|
7491
7494
|
a,
|
|
7492
|
-
|
|
7493
|
-
|
|
7495
|
+
F,
|
|
7496
|
+
N,
|
|
7494
7497
|
_,
|
|
7495
7498
|
w?.source,
|
|
7496
7499
|
x
|
|
7497
7500
|
]), se = z.useMemo(() => ({
|
|
7498
7501
|
slots: Array.from({ length: a }).map((e, t) => {
|
|
7499
|
-
let n = j &&
|
|
7502
|
+
let n = j && N !== null && F !== null && (N === F && t === N || t >= N && t < F), r = x[t] === void 0 ? null : x[t];
|
|
7500
7503
|
return {
|
|
7501
7504
|
char: r,
|
|
7502
7505
|
placeholderChar: x[0] === void 0 ? c?.[t] ?? null : null,
|
|
@@ -7510,11 +7513,11 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7510
7513
|
j,
|
|
7511
7514
|
k,
|
|
7512
7515
|
a,
|
|
7513
|
-
|
|
7514
|
-
|
|
7516
|
+
F,
|
|
7517
|
+
N,
|
|
7515
7518
|
_.disabled,
|
|
7516
7519
|
x
|
|
7517
|
-
]), ce = z.useMemo(() => h ? h(se) : z.createElement(
|
|
7520
|
+
]), ce = z.useMemo(() => h ? h(se) : z.createElement(Fh.Provider, { value: se }, g), [
|
|
7518
7521
|
g,
|
|
7519
7522
|
se,
|
|
7520
7523
|
h
|
|
@@ -7530,34 +7533,34 @@ var Ph = z.createContext({}), Fh = z.forwardRef((e, t) => {
|
|
|
7530
7533
|
pointerEvents: "none"
|
|
7531
7534
|
} }, oe)));
|
|
7532
7535
|
});
|
|
7533
|
-
|
|
7534
|
-
function
|
|
7536
|
+
Ih.displayName = "Input";
|
|
7537
|
+
function Lh(e, t) {
|
|
7535
7538
|
try {
|
|
7536
7539
|
e.insertRule(t);
|
|
7537
7540
|
} catch {
|
|
7538
7541
|
console.error("input-otp could not insert CSS rule:", t);
|
|
7539
7542
|
}
|
|
7540
7543
|
}
|
|
7541
|
-
var
|
|
7544
|
+
var Rh = "\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n@media (prefers-color-scheme: dark) {\n [data-input-otp] {\n --nojs-bg: black !important;\n --nojs-fg: white !important;\n }\n}", zh = "^\\d+$", Bh = "^[a-zA-Z0-9]+$";
|
|
7542
7545
|
//#endregion
|
|
7543
7546
|
//#region src/components/reui/input-otp.tsx
|
|
7544
|
-
function
|
|
7545
|
-
return /* @__PURE__ */ V(
|
|
7547
|
+
function Vh({ className: t, containerClassName: n, ...r }) {
|
|
7548
|
+
return /* @__PURE__ */ V(Ih, {
|
|
7546
7549
|
"data-slot": "input-otp",
|
|
7547
7550
|
containerClassName: e("flex items-center gap-2 has-disabled:opacity-50", n),
|
|
7548
7551
|
className: e("disabled:cursor-not-allowed", t),
|
|
7549
7552
|
...r
|
|
7550
7553
|
});
|
|
7551
7554
|
}
|
|
7552
|
-
function
|
|
7555
|
+
function Hh({ className: t, ...n }) {
|
|
7553
7556
|
return /* @__PURE__ */ V("div", {
|
|
7554
7557
|
"data-slot": "input-otp-group",
|
|
7555
7558
|
className: e("flex items-center", t),
|
|
7556
7559
|
...n
|
|
7557
7560
|
});
|
|
7558
7561
|
}
|
|
7559
|
-
function
|
|
7560
|
-
let { char: i, hasFakeCaret: a, isActive: o } = z.useContext(
|
|
7562
|
+
function Uh({ index: t, className: n, ...r }) {
|
|
7563
|
+
let { char: i, hasFakeCaret: a, isActive: o } = z.useContext(Fh)?.slots[t] ?? {};
|
|
7561
7564
|
return /* @__PURE__ */ H("div", {
|
|
7562
7565
|
"data-slot": "input-otp-slot",
|
|
7563
7566
|
"data-active": o,
|
|
@@ -7569,7 +7572,7 @@ function Hh({ index: t, className: n, ...r }) {
|
|
|
7569
7572
|
})]
|
|
7570
7573
|
});
|
|
7571
7574
|
}
|
|
7572
|
-
function
|
|
7575
|
+
function Wh({ ...e }) {
|
|
7573
7576
|
return /* @__PURE__ */ V("div", {
|
|
7574
7577
|
"data-slot": "input-otp-separator",
|
|
7575
7578
|
role: "separator",
|
|
@@ -7579,15 +7582,15 @@ function Uh({ ...e }) {
|
|
|
7579
7582
|
}
|
|
7580
7583
|
//#endregion
|
|
7581
7584
|
//#region src/base/form/fields/OtpField.tsx
|
|
7582
|
-
function
|
|
7585
|
+
function Gh(e, t) {
|
|
7583
7586
|
if (!t || t >= e) return [Array.from({ length: e }, (e, t) => t)];
|
|
7584
7587
|
let n = [];
|
|
7585
7588
|
for (let r = 0; r < e; r += t) n.push(Array.from({ length: Math.min(t, e - r) }, (e, t) => r + t));
|
|
7586
7589
|
return n;
|
|
7587
7590
|
}
|
|
7588
|
-
function
|
|
7589
|
-
let d = [c ? u : void 0, l].filter(Boolean).join(" ") || void 0, f = i === "alphanumeric" ?
|
|
7590
|
-
return /* @__PURE__ */ V(
|
|
7591
|
+
function Kh({ id: e, value: t, onChange: n, maxLength: r = 6, pattern: i = "digits", groupSize: a, disabled: o, required: s, error: c, helpTextId: l, errorId: u }) {
|
|
7592
|
+
let d = [c ? u : void 0, l].filter(Boolean).join(" ") || void 0, f = i === "alphanumeric" ? Bh : zh, p = Gh(r, a);
|
|
7593
|
+
return /* @__PURE__ */ V(Vh, {
|
|
7591
7594
|
id: e,
|
|
7592
7595
|
maxLength: r,
|
|
7593
7596
|
value: t ?? "",
|
|
@@ -7597,15 +7600,15 @@ function Gh({ id: e, value: t, onChange: n, maxLength: r = 6, pattern: i = "digi
|
|
|
7597
7600
|
"aria-invalid": c ? !0 : void 0,
|
|
7598
7601
|
"aria-required": s || void 0,
|
|
7599
7602
|
"aria-describedby": d,
|
|
7600
|
-
children: p.map((e, t) => /* @__PURE__ */ H(st, { children: [/* @__PURE__ */ V(
|
|
7603
|
+
children: p.map((e, t) => /* @__PURE__ */ H(st, { children: [/* @__PURE__ */ V(Hh, { children: e.map((e) => /* @__PURE__ */ V(Uh, {
|
|
7601
7604
|
index: e,
|
|
7602
7605
|
"aria-invalid": c ? !0 : void 0
|
|
7603
|
-
}, e)) }), t < p.length - 1 && /* @__PURE__ */ V(
|
|
7606
|
+
}, e)) }), t < p.length - 1 && /* @__PURE__ */ V(Wh, {})] }, e[0]))
|
|
7604
7607
|
});
|
|
7605
7608
|
}
|
|
7606
7609
|
//#endregion
|
|
7607
7610
|
//#region src/base/form/fields/PasswordField.tsx
|
|
7608
|
-
function
|
|
7611
|
+
function qh({ id: e, value: t, onChange: n, placeholder: r, disabled: i, required: a, error: o, helpTextId: s, errorId: c }) {
|
|
7609
7612
|
let [l, u] = gt(!1), d = [o ? c : void 0, s].filter(Boolean).join(" ") || void 0;
|
|
7610
7613
|
return /* @__PURE__ */ H("div", {
|
|
7611
7614
|
className: "relative",
|
|
@@ -7638,14 +7641,14 @@ function Kh({ id: e, value: t, onChange: n, placeholder: r, disabled: i, require
|
|
|
7638
7641
|
}
|
|
7639
7642
|
//#endregion
|
|
7640
7643
|
//#region src/components/reui/radio-group.tsx
|
|
7641
|
-
function
|
|
7644
|
+
function Jh({ className: t, ...n }) {
|
|
7642
7645
|
return /* @__PURE__ */ V(gu, {
|
|
7643
7646
|
"data-slot": "radio-group",
|
|
7644
7647
|
className: e("grid gap-3", t),
|
|
7645
7648
|
...n
|
|
7646
7649
|
});
|
|
7647
7650
|
}
|
|
7648
|
-
function
|
|
7651
|
+
function Yh({ className: t, ...n }) {
|
|
7649
7652
|
return /* @__PURE__ */ V(_u, {
|
|
7650
7653
|
"data-slot": "radio-group-item",
|
|
7651
7654
|
className: e("aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40", t),
|
|
@@ -7659,9 +7662,9 @@ function Jh({ className: t, ...n }) {
|
|
|
7659
7662
|
}
|
|
7660
7663
|
//#endregion
|
|
7661
7664
|
//#region src/base/form/fields/RadioField.tsx
|
|
7662
|
-
function
|
|
7665
|
+
function Xh({ id: e, value: t, onChange: n, options: r, disabled: i, required: a, error: o, helpTextId: s, errorId: c }) {
|
|
7663
7666
|
let l = [o ? c : void 0, s].filter(Boolean).join(" ") || void 0;
|
|
7664
|
-
return /* @__PURE__ */ V(
|
|
7667
|
+
return /* @__PURE__ */ V(Jh, {
|
|
7665
7668
|
id: e,
|
|
7666
7669
|
value: t ?? "",
|
|
7667
7670
|
onValueChange: n,
|
|
@@ -7673,10 +7676,10 @@ function Yh({ id: e, value: t, onChange: n, options: r, disabled: i, required: a
|
|
|
7673
7676
|
let n = `${e}-${t.value}`;
|
|
7674
7677
|
return /* @__PURE__ */ H("div", {
|
|
7675
7678
|
className: "flex items-center gap-2",
|
|
7676
|
-
children: [/* @__PURE__ */ V(
|
|
7679
|
+
children: [/* @__PURE__ */ V(Yh, {
|
|
7677
7680
|
value: t.value,
|
|
7678
7681
|
id: n
|
|
7679
|
-
}), /* @__PURE__ */ V(
|
|
7682
|
+
}), /* @__PURE__ */ V(Dp, {
|
|
7680
7683
|
htmlFor: n,
|
|
7681
7684
|
className: "text-sm font-normal",
|
|
7682
7685
|
children: t.label
|
|
@@ -7687,21 +7690,21 @@ function Yh({ id: e, value: t, onChange: n, options: r, disabled: i, required: a
|
|
|
7687
7690
|
}
|
|
7688
7691
|
//#endregion
|
|
7689
7692
|
//#region src/components/reui/rating.tsx
|
|
7690
|
-
var
|
|
7693
|
+
var Zh = s("flex items-center", {
|
|
7691
7694
|
variants: { size: {
|
|
7692
7695
|
sm: "gap-2",
|
|
7693
7696
|
default: "gap-2.5",
|
|
7694
7697
|
lg: "gap-3"
|
|
7695
7698
|
} },
|
|
7696
7699
|
defaultVariants: { size: "default" }
|
|
7697
|
-
}),
|
|
7700
|
+
}), Qh = s("", {
|
|
7698
7701
|
variants: { size: {
|
|
7699
7702
|
sm: "w-4 h-4",
|
|
7700
7703
|
default: "w-5 h-5",
|
|
7701
7704
|
lg: "w-6 h-6"
|
|
7702
7705
|
} },
|
|
7703
7706
|
defaultVariants: { size: "default" }
|
|
7704
|
-
}),
|
|
7707
|
+
}), $h = s("text-muted-foreground w-5", {
|
|
7705
7708
|
variants: { size: {
|
|
7706
7709
|
sm: "text-xs",
|
|
7707
7710
|
default: "text-sm",
|
|
@@ -7709,7 +7712,7 @@ var Xh = s("flex items-center", {
|
|
|
7709
7712
|
} },
|
|
7710
7713
|
defaultVariants: { size: "default" }
|
|
7711
7714
|
});
|
|
7712
|
-
function
|
|
7715
|
+
function eg({ rating: t, maxRating: n = 5, size: r, className: i, starClassName: a, showValue: o = !1, editable: s = !1, onRatingChange: c, ...l }) {
|
|
7713
7716
|
let [u, d] = gt(null), f = s && u !== null ? u : t, p = (e) => {
|
|
7714
7717
|
s && c && c(e);
|
|
7715
7718
|
}, m = (e) => {
|
|
@@ -7729,7 +7732,7 @@ function $h({ rating: t, maxRating: n = 5, size: r, className: i, starClassName:
|
|
|
7729
7732
|
icon: Fe,
|
|
7730
7733
|
strokeWidth: 2,
|
|
7731
7734
|
"data-slot": "rating-star-empty",
|
|
7732
|
-
className: e(
|
|
7735
|
+
className: e(Qh({ size: r }), "text-muted-foreground/30")
|
|
7733
7736
|
}), /* @__PURE__ */ V("div", {
|
|
7734
7737
|
className: "absolute inset-0 overflow-hidden",
|
|
7735
7738
|
style: { width: n ? "100%" : `${a}%` },
|
|
@@ -7737,7 +7740,7 @@ function $h({ rating: t, maxRating: n = 5, size: r, className: i, starClassName:
|
|
|
7737
7740
|
icon: Fe,
|
|
7738
7741
|
strokeWidth: 2,
|
|
7739
7742
|
"data-slot": "rating-star-filled",
|
|
7740
|
-
className: e(
|
|
7743
|
+
className: e(Qh({ size: r }), "fill-yellow-400 text-yellow-400")
|
|
7741
7744
|
})
|
|
7742
7745
|
})]
|
|
7743
7746
|
}, i));
|
|
@@ -7746,28 +7749,28 @@ function $h({ rating: t, maxRating: n = 5, size: r, className: i, starClassName:
|
|
|
7746
7749
|
};
|
|
7747
7750
|
return /* @__PURE__ */ H("div", {
|
|
7748
7751
|
"data-slot": "rating",
|
|
7749
|
-
className: e(
|
|
7752
|
+
className: e(Zh({ size: r }), i),
|
|
7750
7753
|
...l,
|
|
7751
7754
|
children: [/* @__PURE__ */ V("div", {
|
|
7752
7755
|
className: "flex items-center",
|
|
7753
7756
|
children: g()
|
|
7754
7757
|
}), o && /* @__PURE__ */ V("span", {
|
|
7755
7758
|
"data-slot": "rating-value",
|
|
7756
|
-
className: e(
|
|
7759
|
+
className: e($h({ size: r }), a),
|
|
7757
7760
|
children: f.toFixed(1)
|
|
7758
7761
|
})]
|
|
7759
7762
|
});
|
|
7760
7763
|
}
|
|
7761
7764
|
//#endregion
|
|
7762
7765
|
//#region src/base/form/fields/RatingField.tsx
|
|
7763
|
-
function
|
|
7766
|
+
function tg({ id: e, value: t, onChange: n, maxRating: r = 5, disabled: i, error: a, helpTextId: o, errorId: s }) {
|
|
7764
7767
|
let c = [a ? s : void 0, o].filter(Boolean).join(" ") || void 0;
|
|
7765
7768
|
return /* @__PURE__ */ V("div", {
|
|
7766
7769
|
id: e,
|
|
7767
7770
|
role: "radiogroup",
|
|
7768
7771
|
"aria-invalid": a ? !0 : void 0,
|
|
7769
7772
|
"aria-describedby": c,
|
|
7770
|
-
children: /* @__PURE__ */ V(
|
|
7773
|
+
children: /* @__PURE__ */ V(eg, {
|
|
7771
7774
|
rating: t ?? 0,
|
|
7772
7775
|
maxRating: r,
|
|
7773
7776
|
editable: !i,
|
|
@@ -7778,21 +7781,21 @@ function eg({ id: e, value: t, onChange: n, maxRating: r = 5, disabled: i, error
|
|
|
7778
7781
|
}
|
|
7779
7782
|
//#endregion
|
|
7780
7783
|
//#region src/base/form/fields/SelectField.tsx
|
|
7781
|
-
function
|
|
7784
|
+
function ng({ id: e, value: t, onChange: n, options: r, placeholder: i, disabled: a, required: o, error: s, helpTextId: c, errorId: l }) {
|
|
7782
7785
|
let { t: u } = De(), d = [s ? l : void 0, c].filter(Boolean).join(" ") || void 0;
|
|
7783
|
-
return /* @__PURE__ */ H(
|
|
7786
|
+
return /* @__PURE__ */ H(_p, {
|
|
7784
7787
|
value: t ?? "",
|
|
7785
7788
|
onValueChange: n,
|
|
7786
7789
|
disabled: a,
|
|
7787
7790
|
required: o,
|
|
7788
|
-
children: [/* @__PURE__ */ V(
|
|
7791
|
+
children: [/* @__PURE__ */ V(yp, {
|
|
7789
7792
|
id: e,
|
|
7790
7793
|
className: "w-full",
|
|
7791
7794
|
"aria-invalid": s ? !0 : void 0,
|
|
7792
7795
|
"aria-required": o || void 0,
|
|
7793
7796
|
"aria-describedby": d,
|
|
7794
|
-
children: /* @__PURE__ */ V(
|
|
7795
|
-
}), /* @__PURE__ */ V(
|
|
7797
|
+
children: /* @__PURE__ */ V(vp, { placeholder: i ?? u("middag.ui.form.select_placeholder") })
|
|
7798
|
+
}), /* @__PURE__ */ V(bp, { children: r.map((e) => /* @__PURE__ */ V(xp, {
|
|
7796
7799
|
value: e.value,
|
|
7797
7800
|
children: e.label
|
|
7798
7801
|
}, e.value)) })]
|
|
@@ -7800,7 +7803,7 @@ function tg({ id: e, value: t, onChange: n, options: r, placeholder: i, disabled
|
|
|
7800
7803
|
}
|
|
7801
7804
|
//#endregion
|
|
7802
7805
|
//#region src/components/reui/slider.tsx
|
|
7803
|
-
function
|
|
7806
|
+
function rg({ className: t, defaultValue: n, value: r, min: i = 0, max: a = 100, ...o }) {
|
|
7804
7807
|
let s = z.useMemo(() => Array.isArray(r) ? r : Array.isArray(n) ? n : [i, a], [
|
|
7805
7808
|
r,
|
|
7806
7809
|
n,
|
|
@@ -7830,11 +7833,11 @@ function ng({ className: t, defaultValue: n, value: r, min: i = 0, max: a = 100,
|
|
|
7830
7833
|
}
|
|
7831
7834
|
//#endregion
|
|
7832
7835
|
//#region src/base/form/fields/SliderField.tsx
|
|
7833
|
-
function
|
|
7836
|
+
function ig({ id: e, value: t, onChange: n, min: r = 0, max: i = 100, step: a = 1, multiple: o = !1, disabled: s, required: c, error: l, helpTextId: u, errorId: d }) {
|
|
7834
7837
|
let f = [l ? d : void 0, u].filter(Boolean).join(" ") || void 0, p = Array.isArray(t) ? t : t == null ? o ? [r, i] : [r] : [t], m = o ? p.join(" – ") : String(p[0] ?? r);
|
|
7835
7838
|
return /* @__PURE__ */ H("div", {
|
|
7836
7839
|
className: "flex items-center gap-4",
|
|
7837
|
-
children: [/* @__PURE__ */ V(
|
|
7840
|
+
children: [/* @__PURE__ */ V(rg, {
|
|
7838
7841
|
id: e,
|
|
7839
7842
|
value: p,
|
|
7840
7843
|
min: r,
|
|
@@ -7854,27 +7857,27 @@ function rg({ id: e, value: t, onChange: n, min: r = 0, max: i = 100, step: a =
|
|
|
7854
7857
|
}
|
|
7855
7858
|
//#endregion
|
|
7856
7859
|
//#region src/base/form/fields/SlugField.tsx
|
|
7857
|
-
function
|
|
7860
|
+
function ag(e) {
|
|
7858
7861
|
return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-");
|
|
7859
7862
|
}
|
|
7860
|
-
function
|
|
7863
|
+
function og({ id: e, value: t, onChange: n, sourceValue: r, placeholder: i, disabled: a, required: o, error: s, helpTextId: c, errorId: l, prefix: u }) {
|
|
7861
7864
|
let [d, f] = gt(!1), p = [s ? l : void 0, c].filter(Boolean).join(" ") || void 0;
|
|
7862
7865
|
ft(() => {
|
|
7863
|
-
!d && r !== void 0 && n(
|
|
7866
|
+
!d && r !== void 0 && n(ag(r));
|
|
7864
7867
|
}, [
|
|
7865
7868
|
r,
|
|
7866
7869
|
d,
|
|
7867
7870
|
n
|
|
7868
7871
|
]);
|
|
7869
7872
|
let m = B((e) => {
|
|
7870
|
-
f(!0), n(
|
|
7873
|
+
f(!0), n(ag(e.target.value));
|
|
7871
7874
|
}, [n]);
|
|
7872
|
-
return u ? /* @__PURE__ */ H(
|
|
7875
|
+
return u ? /* @__PURE__ */ H(w, {
|
|
7873
7876
|
"data-disabled": a || void 0,
|
|
7874
|
-
children: [/* @__PURE__ */ V(
|
|
7877
|
+
children: [/* @__PURE__ */ V(_e, {
|
|
7875
7878
|
align: "inline-start",
|
|
7876
|
-
children: /* @__PURE__ */ V(
|
|
7877
|
-
}), /* @__PURE__ */ V(
|
|
7879
|
+
children: /* @__PURE__ */ V(te, { children: u })
|
|
7880
|
+
}), /* @__PURE__ */ V(C, {
|
|
7878
7881
|
id: e,
|
|
7879
7882
|
type: "text",
|
|
7880
7883
|
value: t ?? "",
|
|
@@ -7885,9 +7888,9 @@ function ag({ id: e, value: t, onChange: n, sourceValue: r, placeholder: i, disa
|
|
|
7885
7888
|
"aria-required": o || void 0,
|
|
7886
7889
|
"aria-describedby": p
|
|
7887
7890
|
})]
|
|
7888
|
-
}) : /* @__PURE__ */ V(
|
|
7891
|
+
}) : /* @__PURE__ */ V(w, {
|
|
7889
7892
|
"data-disabled": a || void 0,
|
|
7890
|
-
children: /* @__PURE__ */ V(
|
|
7893
|
+
children: /* @__PURE__ */ V(C, {
|
|
7891
7894
|
id: e,
|
|
7892
7895
|
type: "text",
|
|
7893
7896
|
value: t ?? "",
|
|
@@ -7902,7 +7905,7 @@ function ag({ id: e, value: t, onChange: n, sourceValue: r, placeholder: i, disa
|
|
|
7902
7905
|
}
|
|
7903
7906
|
//#endregion
|
|
7904
7907
|
//#region src/base/form/fields/StaticField.tsx
|
|
7905
|
-
function
|
|
7908
|
+
function sg({ id: e, value: t }) {
|
|
7906
7909
|
return /* @__PURE__ */ V("p", {
|
|
7907
7910
|
id: e,
|
|
7908
7911
|
className: "border-input bg-muted/50 text-foreground rounded-md border px-3 py-2 text-sm",
|
|
@@ -7911,7 +7914,7 @@ function og({ id: e, value: t }) {
|
|
|
7911
7914
|
}
|
|
7912
7915
|
//#endregion
|
|
7913
7916
|
//#region src/components/reui/switch.tsx
|
|
7914
|
-
function
|
|
7917
|
+
function cg({ className: t, size: n = "default", ...r }) {
|
|
7915
7918
|
return /* @__PURE__ */ V(Zf, {
|
|
7916
7919
|
"data-slot": "switch",
|
|
7917
7920
|
"data-size": n,
|
|
@@ -7925,11 +7928,11 @@ function sg({ className: t, size: n = "default", ...r }) {
|
|
|
7925
7928
|
}
|
|
7926
7929
|
//#endregion
|
|
7927
7930
|
//#region src/base/form/fields/SwitchField.tsx
|
|
7928
|
-
function
|
|
7931
|
+
function lg({ id: e, value: t, onChange: n, label: r, disabled: i, required: a, error: o, helpTextId: s, errorId: c }) {
|
|
7929
7932
|
let l = [o ? c : void 0, s].filter(Boolean).join(" ") || void 0;
|
|
7930
7933
|
return /* @__PURE__ */ H("div", {
|
|
7931
7934
|
className: "flex items-center gap-2",
|
|
7932
|
-
children: [/* @__PURE__ */ V(
|
|
7935
|
+
children: [/* @__PURE__ */ V(cg, {
|
|
7933
7936
|
id: e,
|
|
7934
7937
|
checked: !!t,
|
|
7935
7938
|
onCheckedChange: n,
|
|
@@ -7937,7 +7940,7 @@ function cg({ id: e, value: t, onChange: n, label: r, disabled: i, required: a,
|
|
|
7937
7940
|
"aria-invalid": o ? !0 : void 0,
|
|
7938
7941
|
"aria-required": a || void 0,
|
|
7939
7942
|
"aria-describedby": l
|
|
7940
|
-
}), r && /* @__PURE__ */ V(
|
|
7943
|
+
}), r && /* @__PURE__ */ V(Dp, {
|
|
7941
7944
|
htmlFor: e,
|
|
7942
7945
|
className: "text-sm font-normal",
|
|
7943
7946
|
children: r
|
|
@@ -7946,7 +7949,7 @@ function cg({ id: e, value: t, onChange: n, label: r, disabled: i, required: a,
|
|
|
7946
7949
|
}
|
|
7947
7950
|
//#endregion
|
|
7948
7951
|
//#region src/base/form/fields/TagsField.tsx
|
|
7949
|
-
function
|
|
7952
|
+
function ug({ id: e, value: t, onChange: n, placeholder: r, disabled: i, required: a, error: o, helpTextId: s, errorId: c, maxTags: l }) {
|
|
7950
7953
|
let { t: u } = De(), [d, f] = gt(""), p = ht(null), m = mt(() => t ?? [], [t]), h = [o ? c : void 0, s].filter(Boolean).join(" ") || void 0, g = B((e) => {
|
|
7951
7954
|
let t = e.trim();
|
|
7952
7955
|
t && (m.includes(t) || l && m.length >= l || (n([...m, t]), f("")));
|
|
@@ -7997,9 +8000,9 @@ function lg({ id: e, value: t, onChange: n, placeholder: r, disabled: i, require
|
|
|
7997
8000
|
}
|
|
7998
8001
|
//#endregion
|
|
7999
8002
|
//#region src/base/form/fields/TextareaField.tsx
|
|
8000
|
-
function
|
|
8003
|
+
function dg({ id: e, value: t, onChange: n, placeholder: r, rows: i = 4, disabled: a, readOnly: o, required: s, error: c, helpTextId: l, errorId: u }) {
|
|
8001
8004
|
let d = [c ? u : void 0, l].filter(Boolean).join(" ") || void 0;
|
|
8002
|
-
return /* @__PURE__ */ V(
|
|
8005
|
+
return /* @__PURE__ */ V(I, {
|
|
8003
8006
|
id: e,
|
|
8004
8007
|
value: t ?? "",
|
|
8005
8008
|
onChange: (e) => n(e.target.value),
|
|
@@ -8014,7 +8017,7 @@ function ug({ id: e, value: t, onChange: n, placeholder: r, rows: i = 4, disable
|
|
|
8014
8017
|
}
|
|
8015
8018
|
//#endregion
|
|
8016
8019
|
//#region src/base/form/fields/TextField.tsx
|
|
8017
|
-
function
|
|
8020
|
+
function fg({ id: e, value: t, onChange: n, type: r = "text", placeholder: i, disabled: a, readOnly: o, required: s, error: c, helpTextId: l, errorId: u }) {
|
|
8018
8021
|
let d = [c ? u : void 0, l].filter(Boolean).join(" ") || void 0;
|
|
8019
8022
|
return /* @__PURE__ */ V(ot, {
|
|
8020
8023
|
id: e,
|
|
@@ -8031,7 +8034,7 @@ function dg({ id: e, value: t, onChange: n, type: r = "text", placeholder: i, di
|
|
|
8031
8034
|
}
|
|
8032
8035
|
//#endregion
|
|
8033
8036
|
//#region src/base/partials/FormSection/index.tsx
|
|
8034
|
-
function
|
|
8037
|
+
function pg({ id: t, title: n, description: r, children: i, defaultCollapsed: a = !1, hasErrors: o = !1, errorCount: s }) {
|
|
8035
8038
|
let { t: c } = De(), [l, u] = gt(a && !o), d = `${t}-content`, p = !!n, m = !l || o;
|
|
8036
8039
|
return /* @__PURE__ */ H("fieldset", {
|
|
8037
8040
|
className: "border-border space-y-5 rounded-lg border p-6",
|
|
@@ -8064,9 +8067,7 @@ function fg({ id: t, title: n, description: r, children: i, defaultCollapsed: a
|
|
|
8064
8067
|
className: "text-destructive text-xs",
|
|
8065
8068
|
children: [
|
|
8066
8069
|
"(",
|
|
8067
|
-
s,
|
|
8068
|
-
" ",
|
|
8069
|
-
c(s === 1 ? "middag.ui.form.error_one" : "middag.ui.form.error_other"),
|
|
8070
|
+
c("middag.ui.form.error", { count: s }),
|
|
8070
8071
|
")"
|
|
8071
8072
|
]
|
|
8072
8073
|
})]
|
|
@@ -8084,4 +8085,13 @@ function fg({ id: t, title: n, description: r, children: i, defaultCollapsed: a
|
|
|
8084
8085
|
});
|
|
8085
8086
|
}
|
|
8086
8087
|
//#endregion
|
|
8087
|
-
|
|
8088
|
+
//#region src/i18n/resolve-field-error.ts
|
|
8089
|
+
function mg(e, t) {
|
|
8090
|
+
return t(e.key, {
|
|
8091
|
+
ns: e.domain || "validators",
|
|
8092
|
+
defaultValue: e.message,
|
|
8093
|
+
...e.params ?? {}
|
|
8094
|
+
});
|
|
8095
|
+
}
|
|
8096
|
+
//#endregion
|
|
8097
|
+
export { Zc as $, _p as A, $f as B, jp as C, Ep as D, Dp as E, gp as F, ap as G, op as H, up as I, nl as J, rl as K, dp as L, xp as M, yp as N, Tp as O, vp as P, tl as Q, lp as R, Np as S, Op as T, ip as U, np as V, rp as W, Qc as X, $c as Y, Xc as Z, nh as _, hn as _t, ug as a, nc as at, Mp as b, og as c, ys as ct, tg as d, ss as dt, mc as et, Xh as f, xs as ft, sh as g, pn as gt, _h as h, hs as ht, dg as i, cc as it, bp as j, wp as k, ig as l, ds as lt, Kh as m, Bo as mt, pg as n, oc as nt, lg as o, ks as ot, qh as p, Ds as pt, el as q, fg as r, lc as rt, sg as s, ps as st, mg as t, sc as tt, ng as u, js as ut, eh as v, cn as vt, kp as w, Pp as x, Zm as y, sp as z };
|