@middag-io/react 0.41.1 → 0.43.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-ChfKYVSc.js} +3735 -2633
- package/dist-lib/{FormPanelBlock-mIvZ0IFE.js → FormPanelBlock-Cu2ATcpu.js} +71 -71
- package/dist-lib/{PhoneField-DZQc97Eo.js → PhoneField-CP13cgq1.js} +2867 -2870
- package/dist-lib/base/blocks/TabsBlock.d.ts.map +1 -1
- package/dist-lib/base/form/fields/EntityPickerField.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 +345 -343
- 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/{combobox-RfE54yDL.js → combobox-Dk1Mr_PH.js} +1055 -1058
- package/dist-lib/contracts/generated/contract-schema.d.ts +1 -1
- package/dist-lib/contracts/generated/contract-types.d.ts +2 -1
- package/dist-lib/contracts/generated/contract-types.d.ts.map +1 -1
- package/dist-lib/contracts/generated/index.d.ts +1 -1
- 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/middag-react.js +21380 -7914
- 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/{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/chunks/{subpath-52vC0Fzu.js → subpath-oMCFwhdB.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,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
|