@middag-io/react 0.42.0 → 0.44.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-x0Ot_z_i.js → DateField-lPZsiWfC.js} +5 -5
- package/dist-lib/{DateRangeField-DbWZ2f92.js → DateRangeField-B7zWB48D.js} +12 -8
- package/dist-lib/{DocumentField-fwq79IWM.js → DocumentField-DutGscEM.js} +3 -3
- package/dist-lib/{FormField-BDWkyFcl.js → FormField-Bj43PjHH.js} +3755 -2628
- package/dist-lib/{FormPanelBlock-mIvZ0IFE.js → FormPanelBlock-C6eDfGoI.js} +463 -462
- package/dist-lib/{PhoneField-DZQc97Eo.js → PhoneField-CP13cgq1.js} +2867 -2870
- package/dist-lib/base/blocks/FormPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/form/FormField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/EntityPickerField.d.ts.map +1 -1
- package/dist-lib/base/layout/BlockRegion.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/ConfirmationDialog/index.d.ts.map +1 -1
- package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
- package/dist-lib/base/shell/BasicShell.js +1 -1
- package/dist-lib/base/shell/partials/EditablePanelProvider.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/EditablePanelProvider.js +55 -54
- package/dist-lib/base/shell/partials/InlineEditablePanel.js +144 -140
- package/dist-lib/base/shell/partials/PageActionButton.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/PageActionButton.js +2 -1
- package/dist-lib/base/utils/time.js +26 -26
- package/dist-lib/{button-CxyXN3nw.js → button-PJdZDEA8.js} +4 -4
- package/dist-lib/{calendar-BStHDcu3.js → calendar-CFrEYtPR.js} +22 -21
- package/dist-lib/{chevron-right-t5ALKicc.js → chevron-right-Dt7yZRj6.js} +1 -1
- package/dist-lib/chunks/{subpath-BhcZoWUz.js → subpath-BYl-9lKg.js} +1 -1
- package/dist-lib/chunks/subpath-D0ykpYEG.js +154 -0
- package/dist-lib/{combobox-RfE54yDL.js → combobox-Dk1Mr_PH.js} +1055 -1058
- package/dist-lib/{dist-tanBwm1t.js → dist-CJ4YN5HQ.js} +5 -5
- package/dist-lib/{dist-BUns-jcX.js → dist-Cwj39GRS.js} +1 -1
- package/dist-lib/{dist-axU0pUop.js → dist-CyQnd0TP.js} +4 -4
- package/dist-lib/{dist-EdxoDTPy.js → dist-DUhG8dAI.js} +2 -2
- package/dist-lib/{document-validation-BSjTDZhG.js → document-validation-D1y_WEv5.js} +4 -4
- package/dist-lib/{floating-ui.react-dom-CNntavPo.js → floating-ui.react-dom-BASAHo_L.js} +3 -3
- package/dist-lib/i18n/I18nProvider.js +1 -1
- package/dist-lib/i18n/instance.js +1 -1
- package/dist-lib/i18n/register-strings.js +1 -1
- package/dist-lib/index.d.ts +1 -0
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/{input-DpHIBsEp.js → input-D1w5GXsE.js} +1 -1
- package/dist-lib/lib/host-pending.d.ts +32 -0
- package/dist-lib/lib/host-pending.d.ts.map +1 -0
- package/dist-lib/lib/host-pending.js +35 -0
- package/dist-lib/lib/test-ids.d.ts +25 -0
- package/dist-lib/lib/test-ids.d.ts.map +1 -0
- package/dist-lib/lib/test-ids.js +25 -0
- package/dist-lib/middag-react.css +1 -1
- package/dist-lib/middag-react.js +22154 -8666
- package/dist-lib/{popover-CD3HfW3f.js → popover-7VNShhWQ.js} +6 -6
- package/dist-lib/primitives/reui/chart.js +12 -12
- package/dist-lib/primitives/reui/data-grid/data-grid-column-header.js +2 -2
- package/dist-lib/primitives/reui/data-grid/data-grid-pagination.js +28 -28
- package/dist-lib/primitives/reui/data-grid/data-grid-scroll-area.js +2 -2
- package/dist-lib/primitives/reui/data-grid/data-grid-table-dnd-rows.js +1 -1
- package/dist-lib/primitives/reui/data-grid/data-grid-table-dnd.js +2 -2
- package/dist-lib/primitives/reui/data-grid/data-grid-table-virtual.js +1 -1
- package/dist-lib/primitives/reui/data-grid/data-grid-table.js +5 -5
- package/dist-lib/primitives/reui/data-grid-pagination.js +28 -28
- package/dist-lib/primitives/reui/date-selector.js +5 -1
- package/dist-lib/primitives/reui/filters.js +24 -24
- package/dist-lib/primitives/reui/scrollspy.js +3 -1
- package/dist-lib/primitives/reui/stepper.js +23 -23
- package/dist-lib/primitives/reui/tree.js +7 -7
- package/dist-lib/{chunk-DeC0fbbY.js → rolldown-runtime-CWhphoD1.js} +1 -1
- package/dist-lib/{scroll-area-C_NPU_rI.js → scroll-area-CcAvV3Hh.js} +14 -8
- package/dist-lib/{skeleton-DXDJbb2L.js → skeleton-DP7igcN6.js} +1 -1
- package/dist-lib/{use-mobile-B18-3oTE.js → use-mobile-CqtqNcAV.js} +5 -5
- package/dist-lib/{utils-CpaZ5_iF.js → utils-DXlQmFY8.js} +2 -2
- package/package.json +4 -1
- package/dist-lib/MarkdownContent-DgypTiL-.js +0 -13507
- package/dist-lib/chunks/subpath-52vC0Fzu.js +0 -146
- /package/dist-lib/{HugeiconsIcon-CKqc2W1S.js → HugeiconsIcon-C9KGSkIu.js} +0 -0
- /package/dist-lib/chunks/{subpath-B9beWkb2.js → subpath-AeMdleNB.js} +0 -0
- /package/dist-lib/chunks/{subpath-55YUOrvG.js → subpath-CJyJeTlw.js} +0 -0
- /package/dist-lib/chunks/{subpath--GXsYu-v.js → subpath-DjkzcIPp.js} +0 -0
- /package/dist-lib/chunks/{subpath-B30yU5uo.js → subpath-DoiyWIYV.js} +0 -0
- /package/dist-lib/chunks/{subpath-7b9-j7in.js → subpath-YbXSVoyF.js} +0 -0
- /package/dist-lib/{dist-3F0-lo64.js → dist-BxFR7CYi.js} +0 -0
- /package/dist-lib/{useTranslation-D-tjJhTn.js → useTranslation-u1Lygbup.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageActionButton.d.ts","sourceRoot":"","sources":["../../../../src/base/shell/partials/PageActionButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAKjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"PageActionButton.d.ts","sourceRoot":"","sources":["../../../../src/base/shell/partials/PageActionButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAKjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAgB5D,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,YAAY,CAkJjF"}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
//#region src/base/utils/time.ts
|
|
2
|
-
var e =
|
|
3
|
-
function
|
|
2
|
+
var e = 86400;
|
|
3
|
+
function t(e, t) {
|
|
4
4
|
return new Intl.DateTimeFormat(t, { timeStyle: "short" }).format(e);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function n(e, t) {
|
|
7
7
|
return new Intl.DateTimeFormat(t, {
|
|
8
8
|
day: "numeric",
|
|
9
9
|
month: "short"
|
|
10
10
|
}).format(e);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function r(e, t) {
|
|
13
13
|
return new Intl.DateTimeFormat(t, {
|
|
14
14
|
day: "numeric",
|
|
15
15
|
month: "short",
|
|
16
16
|
year: "numeric"
|
|
17
17
|
}).format(e);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function i(e, t, n) {
|
|
20
20
|
return new Intl.RelativeTimeFormat(n, { numeric: "auto" }).format(e, t);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function a(e, t) {
|
|
23
23
|
let n = new Date(t);
|
|
24
24
|
return n.setDate(n.getDate() - 1), e.getDate() === n.getDate() && e.getMonth() === n.getMonth() && e.getFullYear() === n.getFullYear();
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
if (!Number.isFinite(
|
|
28
|
-
let
|
|
29
|
-
if (
|
|
30
|
-
if (
|
|
31
|
-
let
|
|
32
|
-
return new Intl.RelativeTimeFormat(
|
|
26
|
+
function o(o, s = "en") {
|
|
27
|
+
if (!Number.isFinite(o)) return "";
|
|
28
|
+
let c = Date.now() / 1e3, l = Math.floor(c - o), u = /* @__PURE__ */ new Date(o * 1e3), d = /* @__PURE__ */ new Date();
|
|
29
|
+
if (l < 60) return i(0, "second", s);
|
|
30
|
+
if (l < 3600) {
|
|
31
|
+
let e = Math.floor(l / 60);
|
|
32
|
+
return new Intl.RelativeTimeFormat(s, { numeric: "always" }).format(-e, "minute");
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return l < e ? t(u, s) : a(u, d) ? `${i(-1, "day", s)}, ${t(u, s)}` : l < e * 30 ? `${n(u, s)}, ${t(u, s)}` : r(u, s);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function s(e) {
|
|
37
37
|
return Number.isFinite(e) ? (/* @__PURE__ */ new Date(e * 1e3)).toISOString() : "";
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function c(e, t = "relative", n = "en") {
|
|
40
40
|
if (!Number.isFinite(e)) return "";
|
|
41
|
-
let
|
|
41
|
+
let r = /* @__PURE__ */ new Date(e * 1e3);
|
|
42
42
|
switch (t) {
|
|
43
|
-
case "iso": return
|
|
44
|
-
case "date": return new Intl.DateTimeFormat(n, { dateStyle: "medium" }).format(
|
|
45
|
-
case "time": return new Intl.DateTimeFormat(n, { timeStyle: "short" }).format(
|
|
43
|
+
case "iso": return r.toISOString();
|
|
44
|
+
case "date": return new Intl.DateTimeFormat(n, { dateStyle: "medium" }).format(r);
|
|
45
|
+
case "time": return new Intl.DateTimeFormat(n, { timeStyle: "short" }).format(r);
|
|
46
46
|
case "datetime": return new Intl.DateTimeFormat(n, {
|
|
47
47
|
dateStyle: "medium",
|
|
48
48
|
timeStyle: "short"
|
|
49
|
-
}).format(
|
|
50
|
-
default: return
|
|
49
|
+
}).format(r);
|
|
50
|
+
default: return o(e, n);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function l(e, t = "en") {
|
|
54
54
|
if (!Number.isFinite(e)) return "";
|
|
55
|
-
let n = /* @__PURE__ */ new Date(e * 1e3),
|
|
56
|
-
return n.getDate() ===
|
|
55
|
+
let n = /* @__PURE__ */ new Date(e * 1e3), o = /* @__PURE__ */ new Date();
|
|
56
|
+
return n.getDate() === o.getDate() && n.getMonth() === o.getMonth() && n.getFullYear() === o.getFullYear() ? i(0, "day", t) : a(n, o) ? i(-1, "day", t) : r(n, t);
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
|
-
export {
|
|
59
|
+
export { l as formatDateGroupLabel, s as formatISO, o as formatRelativeTime, c as formatTimestamp };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, t } from "./utils-
|
|
1
|
+
import { n as e, t } from "./utils-DXlQmFY8.js";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { createContext as r, createElement as i, forwardRef as a, useContext as o } from "react";
|
|
4
4
|
import { Fragment as s, jsx as c } from "react/jsx-runtime";
|
|
@@ -97,7 +97,7 @@ function T(...e) {
|
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
//#region node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
100
|
-
|
|
100
|
+
// @__NO_SIDE_EFFECTS__
|
|
101
101
|
function E(e) {
|
|
102
102
|
let t = /* @__PURE__ */ O(e), r = n.forwardRef((e, r) => {
|
|
103
103
|
let { children: i, ...a } = e, o = n.Children.toArray(i), s = o.find(j);
|
|
@@ -118,7 +118,7 @@ function E(e) {
|
|
|
118
118
|
return r.displayName = `${e}.Slot`, r;
|
|
119
119
|
}
|
|
120
120
|
var D = /* @__PURE__ */ E("Slot");
|
|
121
|
-
|
|
121
|
+
// @__NO_SIDE_EFFECTS__
|
|
122
122
|
function O(e) {
|
|
123
123
|
let t = n.forwardRef((e, t) => {
|
|
124
124
|
let { children: r, ...i } = e;
|
|
@@ -131,7 +131,7 @@ function O(e) {
|
|
|
131
131
|
return t.displayName = `${e}.SlotClone`, t;
|
|
132
132
|
}
|
|
133
133
|
var k = Symbol("radix.slottable");
|
|
134
|
-
|
|
134
|
+
// @__NO_SIDE_EFFECTS__
|
|
135
135
|
function A(e) {
|
|
136
136
|
let t = ({ children: e }) => /* @__PURE__ */ c(s, { children: e });
|
|
137
137
|
return t.displayName = `${e}.Slottable`, t.__radixId = k, t;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as e } from "./
|
|
2
|
-
import { g as t, h as n, n as r, t as i } from "./button-
|
|
3
|
-
import { t as a } from "./chevron-right-
|
|
4
|
-
import { t as o } from "./utils-
|
|
1
|
+
import { n as e } from "./rolldown-runtime-CWhphoD1.js";
|
|
2
|
+
import { g as t, h as n, n as r, t as i } from "./button-PJdZDEA8.js";
|
|
3
|
+
import { t as a } from "./chevron-right-Dt7yZRj6.js";
|
|
4
|
+
import { t as o } from "./utils-DXlQmFY8.js";
|
|
5
5
|
import * as s from "react";
|
|
6
6
|
import c, { createContext as l, useCallback as u, useContext as d, useEffect as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
7
7
|
import { jsx as _ } from "react/jsx-runtime";
|
|
@@ -807,7 +807,7 @@ var P = {
|
|
|
807
807
|
night: "night"
|
|
808
808
|
}, We = {
|
|
809
809
|
G: function(e, t, n) {
|
|
810
|
-
let r = e.getFullYear() > 0
|
|
810
|
+
let r = +(e.getFullYear() > 0);
|
|
811
811
|
switch (t) {
|
|
812
812
|
case "G":
|
|
813
813
|
case "GG":
|
|
@@ -2932,7 +2932,7 @@ var Hn = {
|
|
|
2932
2932
|
return this.format(t, o);
|
|
2933
2933
|
}
|
|
2934
2934
|
};
|
|
2935
|
-
U.yearFirstLocales = new Set([
|
|
2935
|
+
U.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
2936
2936
|
"eu",
|
|
2937
2937
|
"hu",
|
|
2938
2938
|
"ja",
|
|
@@ -3104,22 +3104,22 @@ function sr(e) {
|
|
|
3104
3104
|
type: "button",
|
|
3105
3105
|
className: s[G.PreviousMonthButton],
|
|
3106
3106
|
tabIndex: r ? void 0 : -1,
|
|
3107
|
-
"aria-disabled": r
|
|
3107
|
+
"aria-disabled": !r || void 0,
|
|
3108
3108
|
"aria-label": l(r),
|
|
3109
3109
|
onClick: p
|
|
3110
3110
|
}, c.createElement(o.Chevron, {
|
|
3111
|
-
disabled: r
|
|
3111
|
+
disabled: !r || void 0,
|
|
3112
3112
|
className: s[G.Chevron],
|
|
3113
3113
|
orientation: "left"
|
|
3114
3114
|
})), c.createElement(o.NextMonthButton, {
|
|
3115
3115
|
type: "button",
|
|
3116
3116
|
className: s[G.NextMonthButton],
|
|
3117
3117
|
tabIndex: i ? void 0 : -1,
|
|
3118
|
-
"aria-disabled": i
|
|
3118
|
+
"aria-disabled": !i || void 0,
|
|
3119
3119
|
"aria-label": d(i),
|
|
3120
3120
|
onClick: f
|
|
3121
3121
|
}, c.createElement(o.Chevron, {
|
|
3122
|
-
disabled: i
|
|
3122
|
+
disabled: !i || void 0,
|
|
3123
3123
|
orientation: "right",
|
|
3124
3124
|
className: s[G.Chevron]
|
|
3125
3125
|
})));
|
|
@@ -3227,7 +3227,7 @@ var br = /* @__PURE__ */ e({
|
|
|
3227
3227
|
//#region node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js
|
|
3228
3228
|
function Y(e, t, n = !1, r = W) {
|
|
3229
3229
|
let { from: i, to: a } = e, { differenceInCalendarDays: o, isSameDay: s } = r;
|
|
3230
|
-
return i && a ? (o(a, i) < 0 && ([i, a] = [a, i]), o(t, i) >=
|
|
3230
|
+
return i && a ? (o(a, i) < 0 && ([i, a] = [a, i]), o(t, i) >= +!!n && o(a, t) >= +!!n) : !n && a ? s(a, t) : !n && i ? s(i, t) : !1;
|
|
3231
3231
|
}
|
|
3232
3232
|
//#endregion
|
|
3233
3233
|
//#region node_modules/react-day-picker/dist/esm/utils/typeguards.js
|
|
@@ -3263,7 +3263,7 @@ function X(e, t, n = W) {
|
|
|
3263
3263
|
let n = a(t.before, e), r = a(t.after, e), i = n > 0, s = r < 0;
|
|
3264
3264
|
return o(t.before, t.after) ? s && i : i || s;
|
|
3265
3265
|
}
|
|
3266
|
-
return Cr(t) ? a(e, t.after) > 0 : wr(t) ? a(t.before, e) > 0 : typeof t == "function"
|
|
3266
|
+
return Cr(t) ? a(e, t.after) > 0 : wr(t) ? a(t.before, e) > 0 : typeof t == "function" && t(e);
|
|
3267
3267
|
});
|
|
3268
3268
|
}
|
|
3269
3269
|
//#endregion
|
|
@@ -3770,7 +3770,8 @@ function Di(e, t) {
|
|
|
3770
3770
|
function Oi(e, t) {
|
|
3771
3771
|
let [n, r] = Ci(e, t), { startOfMonth: i, endOfMonth: a } = t, o = xi(e, n, r, t), [s, c] = Di(o, e.month ? o : void 0);
|
|
3772
3772
|
f(() => {
|
|
3773
|
-
|
|
3773
|
+
let i = xi(e, n, r, t);
|
|
3774
|
+
c(i);
|
|
3774
3775
|
}, [e.timeZone]);
|
|
3775
3776
|
let { months: l, weeks: u, days: d, previousMonth: p, nextMonth: h } = m(() => {
|
|
3776
3777
|
let i = bi(s, r, { numberOfMonths: e.numberOfMonths }, t), o = Si(i, vi(i, e.endMonth ? a(e.endMonth) : void 0, {
|
|
@@ -4176,11 +4177,11 @@ function Gi(e) {
|
|
|
4176
4177
|
}, [x]), Re = u((e, t) => (n) => {
|
|
4177
4178
|
ee?.(e.date, t, n);
|
|
4178
4179
|
}, [ee]), ze = u((e) => (t) => {
|
|
4179
|
-
let n = Number(t.target.value);
|
|
4180
|
-
j(
|
|
4180
|
+
let n = Number(t.target.value), r = o.setMonth(o.startOfMonth(e), n);
|
|
4181
|
+
j(r);
|
|
4181
4182
|
}, [o, j]), Be = u((e) => (t) => {
|
|
4182
|
-
let n = Number(t.target.value);
|
|
4183
|
-
j(
|
|
4183
|
+
let n = Number(t.target.value), r = o.setYear(o.startOfMonth(e), n);
|
|
4184
|
+
j(r);
|
|
4184
4185
|
}, [o, j]), { className: Ve, style: He } = m(() => ({
|
|
4185
4186
|
className: [l[G.Root], t.className].filter(Boolean).join(" "),
|
|
4186
4187
|
style: {
|
|
@@ -4251,12 +4252,12 @@ function Gi(e) {
|
|
|
4251
4252
|
type: "button",
|
|
4252
4253
|
className: l[G.PreviousMonthButton],
|
|
4253
4254
|
tabIndex: k ? void 0 : -1,
|
|
4254
|
-
"aria-disabled": k
|
|
4255
|
+
"aria-disabled": !k || void 0,
|
|
4255
4256
|
"aria-label": we(k),
|
|
4256
4257
|
onClick: M,
|
|
4257
4258
|
"data-animated-button": t.animate ? "true" : void 0
|
|
4258
4259
|
}, c.createElement(r.Chevron, {
|
|
4259
|
-
disabled: k
|
|
4260
|
+
disabled: !k || void 0,
|
|
4260
4261
|
className: l[G.Chevron],
|
|
4261
4262
|
orientation: t.dir === "rtl" ? "right" : "left"
|
|
4262
4263
|
})), c.createElement(r.MonthCaption, {
|
|
@@ -4316,12 +4317,12 @@ function Gi(e) {
|
|
|
4316
4317
|
type: "button",
|
|
4317
4318
|
className: l[G.NextMonthButton],
|
|
4318
4319
|
tabIndex: A ? void 0 : -1,
|
|
4319
|
-
"aria-disabled": A
|
|
4320
|
+
"aria-disabled": !A || void 0,
|
|
4320
4321
|
"aria-label": Te(A),
|
|
4321
4322
|
onClick: Me,
|
|
4322
4323
|
"data-animated-button": t.animate ? "true" : void 0
|
|
4323
4324
|
}, c.createElement(r.Chevron, {
|
|
4324
|
-
disabled: A
|
|
4325
|
+
disabled: !A || void 0,
|
|
4325
4326
|
className: l[G.Chevron],
|
|
4326
4327
|
orientation: t.dir === "rtl" ? "left" : "right"
|
|
4327
4328
|
})), n === g - 1 && p === "after" && !t.hideNavigation && c.createElement(r.Nav, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Input as e } from "../primitives/reui/input.js";
|
|
2
2
|
import { useTranslation as t } from "../i18n/useTranslation.js";
|
|
3
|
-
import "./subpath-
|
|
3
|
+
import "./subpath-YbXSVoyF.js";
|
|
4
4
|
import { useCallback as n, useMemo as r } from "react";
|
|
5
5
|
import { jsx as i } from "react/jsx-runtime";
|
|
6
6
|
//#region src/base/form/fields/DocumentField.tsx
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Button as e } from "../primitives/reui/button.js";
|
|
2
|
+
import { Dialog as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogTitle as o } from "../primitives/reui/dialog.js";
|
|
3
|
+
import { renderLabel as s } from "../i18n/render-label.js";
|
|
4
|
+
import { useTranslation as c } from "../i18n/useTranslation.js";
|
|
5
|
+
import { TEST_IDS as l, actionTestId as u } from "../lib/test-ids.js";
|
|
6
|
+
import { resolveActionTarget as d } from "../lib/actions/resolve-action-target.js";
|
|
7
|
+
import { useCallback as f, useState as p } from "react";
|
|
8
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
import { Link as _ } from "@inertiajs/react";
|
|
10
|
+
import { router as v } from "@inertiajs/core";
|
|
11
|
+
//#region src/base/partials/ConfirmationDialog/index.tsx
|
|
12
|
+
function y({ className: e }) {
|
|
13
|
+
return /* @__PURE__ */ g("svg", {
|
|
14
|
+
className: `animate-spin ${e ?? ""}`,
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
+
fill: "none",
|
|
17
|
+
viewBox: "0 0 24 24",
|
|
18
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
19
|
+
className: "opacity-25",
|
|
20
|
+
cx: "12",
|
|
21
|
+
cy: "12",
|
|
22
|
+
r: "10",
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeWidth: "4"
|
|
25
|
+
}), /* @__PURE__ */ h("path", {
|
|
26
|
+
className: "opacity-75",
|
|
27
|
+
fill: "currentColor",
|
|
28
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function b({ open: s, onClose: u, onConfirm: d, title: f, message: p, intent: m = "default", confirmLabel: _, cancelLabel: v, waiting: b = !1, waitingMessage: x }) {
|
|
33
|
+
let { t: S } = c(), C = m === "danger" ? "destructive" : "default";
|
|
34
|
+
return /* @__PURE__ */ h(t, {
|
|
35
|
+
open: s,
|
|
36
|
+
onOpenChange: (e) => {
|
|
37
|
+
!e && !b && u();
|
|
38
|
+
},
|
|
39
|
+
children: /* @__PURE__ */ g(n, {
|
|
40
|
+
"data-testid": l.confirmDialog,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ g(a, { children: [/* @__PURE__ */ h(o, { children: f }), /* @__PURE__ */ h(r, { children: /* @__PURE__ */ h("span", { dangerouslySetInnerHTML: { __html: p } }) })] }),
|
|
43
|
+
b && x && /* @__PURE__ */ g("div", {
|
|
44
|
+
className: "text-muted-foreground flex items-center gap-2 py-2",
|
|
45
|
+
children: [/* @__PURE__ */ h(y, { className: "size-4" }), /* @__PURE__ */ h("span", {
|
|
46
|
+
className: "text-sm",
|
|
47
|
+
children: x
|
|
48
|
+
})]
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ g(i, { children: [/* @__PURE__ */ h(e, {
|
|
51
|
+
type: "button",
|
|
52
|
+
variant: "outline",
|
|
53
|
+
onClick: u,
|
|
54
|
+
disabled: b,
|
|
55
|
+
"data-testid": l.confirmDialogCancel,
|
|
56
|
+
children: v ?? S("middag.ui.cancel")
|
|
57
|
+
}), /* @__PURE__ */ g(e, {
|
|
58
|
+
type: "button",
|
|
59
|
+
variant: C,
|
|
60
|
+
onClick: d,
|
|
61
|
+
disabled: b,
|
|
62
|
+
"data-testid": l.confirmDialogConfirm,
|
|
63
|
+
children: [b && /* @__PURE__ */ h(y, { className: "mr-2 size-4" }), _ ?? S("middag.ui.confirm")]
|
|
64
|
+
})] })
|
|
65
|
+
]
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/base/shell/partials/PageActionButton.tsx
|
|
71
|
+
var x = {
|
|
72
|
+
primary: "default",
|
|
73
|
+
secondary: "outline",
|
|
74
|
+
danger: "destructive",
|
|
75
|
+
ghost: "ghost"
|
|
76
|
+
};
|
|
77
|
+
function S({ action: t }) {
|
|
78
|
+
let { t: n } = c(), [r, i] = p(!1), [a, o] = p(!1), [l, y] = p(!1), S = d(t), C = x[t.intent] ?? "outline", w = S.kind === "link", T = r || t.loading === !0, E = f(() => {
|
|
79
|
+
if (!S.url) return;
|
|
80
|
+
if (w) {
|
|
81
|
+
v.visit(S.url);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
i(!0);
|
|
85
|
+
let e = {
|
|
86
|
+
preserveState: !0,
|
|
87
|
+
preserveScroll: !0,
|
|
88
|
+
onFinish: () => {
|
|
89
|
+
t.confirmation?.waitForPolling || i(!1);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
S.method === "delete" ? v.delete(S.url, e) : v[S.method](S.url, {}, e), t.confirmation?.waitForPolling && y(!0);
|
|
93
|
+
}, [
|
|
94
|
+
t,
|
|
95
|
+
S,
|
|
96
|
+
w
|
|
97
|
+
]), D = t.confirmation, O = f(() => {
|
|
98
|
+
D ? o(!0) : E();
|
|
99
|
+
}, [D, E]), k = f(() => {
|
|
100
|
+
E(), t.confirmation?.waitForPolling || o(!1);
|
|
101
|
+
}, [t, E]), A = f(() => {
|
|
102
|
+
o(!1), y(!1), r || i(!1);
|
|
103
|
+
}, [r]), j = s(t.label, n);
|
|
104
|
+
return w && S.url && !D && !t.loading ? /* @__PURE__ */ h(e, {
|
|
105
|
+
"data-testid": u(t.id),
|
|
106
|
+
variant: C,
|
|
107
|
+
size: "sm",
|
|
108
|
+
asChild: !0,
|
|
109
|
+
disabled: t.disabled,
|
|
110
|
+
"aria-disabled": t.disabled,
|
|
111
|
+
children: /* @__PURE__ */ h(_, {
|
|
112
|
+
href: S.url,
|
|
113
|
+
children: j
|
|
114
|
+
})
|
|
115
|
+
}) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g(e, {
|
|
116
|
+
"data-testid": u(t.id),
|
|
117
|
+
variant: C,
|
|
118
|
+
size: "sm",
|
|
119
|
+
onClick: O,
|
|
120
|
+
disabled: t.disabled || T,
|
|
121
|
+
"aria-disabled": t.disabled || T,
|
|
122
|
+
children: [T && /* @__PURE__ */ g("svg", {
|
|
123
|
+
className: "mr-2 size-3.5 animate-spin",
|
|
124
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
125
|
+
fill: "none",
|
|
126
|
+
viewBox: "0 0 24 24",
|
|
127
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
128
|
+
className: "opacity-25",
|
|
129
|
+
cx: "12",
|
|
130
|
+
cy: "12",
|
|
131
|
+
r: "10",
|
|
132
|
+
stroke: "currentColor",
|
|
133
|
+
strokeWidth: "4"
|
|
134
|
+
}), /* @__PURE__ */ h("path", {
|
|
135
|
+
className: "opacity-75",
|
|
136
|
+
fill: "currentColor",
|
|
137
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
138
|
+
})]
|
|
139
|
+
}), j]
|
|
140
|
+
}), D && /* @__PURE__ */ h(b, {
|
|
141
|
+
open: a,
|
|
142
|
+
onClose: A,
|
|
143
|
+
onConfirm: k,
|
|
144
|
+
title: s(D.title, n),
|
|
145
|
+
message: s(D.message, n),
|
|
146
|
+
intent: D.intent,
|
|
147
|
+
confirmLabel: D.confirmLabel ? s(D.confirmLabel, n) : void 0,
|
|
148
|
+
cancelLabel: D.cancelLabel ? s(D.cancelLabel, n) : void 0,
|
|
149
|
+
waiting: l,
|
|
150
|
+
waitingMessage: D.waitingMessage ? s(D.waitingMessage, n) : void 0
|
|
151
|
+
})] });
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
export { S as t };
|