@revolist/ui 4.0.5-rc → 4.0.6-rc
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/MIGRATION.md +36 -0
- package/OWNERSHIP.md +10 -10
- package/README.md +6 -4
- package/_chunks/{calendar-DsXIhybL.js → calendar-QWDyYzdo.js} +1 -1
- package/_chunks/{chart-frame-CuZABXVI.js → chart-frame-hcOlnQ1K.js} +13 -9
- package/_chunks/{choice-chips-BhP8MZjs.js → choice-chips-A6WR-WJe.js} +1 -1
- package/_chunks/{color-picker-B4TQvxxB.js → color-picker-BK4W1nd6.js} +1 -1
- package/_chunks/{component-qKctqdzk.js → component-CMkF17YZ.js} +5 -5
- package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-BKd7U8OW.js} +0 -8
- package/_chunks/{configurator-actions-C19O1rda.js → configurator-actions-By8WSL2m.js} +3 -3
- package/_chunks/{control-BkWukVt9.js → control-mlH7l0Uq.js} +30 -5
- package/_chunks/{controls-BLQnWEd7.js → controls-FUU-MUKC.js} +26 -33
- package/_chunks/{date-control-Cgw5PwlZ.js → date-control-Dup_P3w5.js} +1 -1
- package/_chunks/{date-time-B8rK5gpC.js → date-time-9z6pAG5T.js} +304 -281
- package/_chunks/dialog.parts-Bi7YbXqS.js +131 -0
- package/_chunks/{duration-DwFXonEV.js → duration-D7oRjsmP.js} +5 -2
- package/_chunks/{editor-popup-BaaxL89T.js → editor-popup-ByU7qiub.js} +8 -7
- package/_chunks/{field-configurator-1eQP0tKy.js → field-configurator-BCINdXpU.js} +1 -1
- package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-Bk4O_T7T.js} +1 -1
- package/_chunks/{icon-toolbar-xbqa0hu9.js → icon-toolbar-DSjOdwM7.js} +39 -33
- package/_chunks/mount-Cw2zk58T.js +266 -0
- package/_chunks/{native.view-ByyZ1CT5.js → native-Blr3byjO.js} +1 -1
- package/_chunks/{native-control-DO0d1kgx.js → native-control-pFMuHf3G.js} +106 -98
- package/_chunks/{number-input-s9ddPwX6.js → number-input-DqXV6vgP.js} +2 -2
- package/_chunks/{picker-AY05b41W.js → picker-gEGTu1Ki.js} +2 -2
- package/_chunks/{popup-UXGCiv3n.js → popup-C35Isk7p.js} +19 -8
- package/_chunks/{rating-choice-BEs_QFZC.js → rating-choice-DbxdUJr-.js} +1 -1
- package/_chunks/{reorder-list-A49l172e.js → reorder-list-B0_13Sja.js} +1 -1
- package/_chunks/{request-trail-DCOfa5zw.js → request-trail-CCSK6TJA.js} +2 -2
- package/_chunks/{rich-text-xfMWadGi.js → rich-text-5rnc8lpI.js} +3 -3
- package/_variables.scss +33 -32
- package/ai/index.js +2 -2
- package/ai/results/_style.scss +3 -0
- package/assignee/assignee.scss +5 -1
- package/assignee/index.js +2 -2
- package/avatar/index.d.ts +25 -2
- package/avatar/index.js +1 -1
- package/brush-range/component.d.ts +1 -3
- package/brush-range/component.js +8 -9
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.style.scss +1 -1
- package/buttons/svg-button.js +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/index.js +2 -2
- package/checkbox/checkbox.scss +1 -22
- package/choice-chips/index.js +1 -1
- package/color-palette/color-picker.js +1 -1
- package/color-palette/common-palettes.d.ts +1 -1
- package/color-palette/common-palettes.js +1 -1
- package/color-palette/native.d.ts +15 -2
- package/component-catalog.d.ts +3 -6
- package/configurator-actions.js +1 -1
- package/configurator-aggregation-list.js +1 -1
- package/configurator-drop-zone.d.ts +1 -1
- package/configurator-drop-zone.js +1 -1
- package/control-presentation.d.ts +8 -2
- package/control-presentation.js +1 -1
- package/controls.js +1 -1
- package/core/editor-popup-position.d.ts +6 -2
- package/core/editor-popup.d.ts +4 -0
- package/core/editor-popup.js +1 -1
- package/date-time/attach.d.ts +1 -1
- package/date-time/field.d.ts +3 -2
- package/date-time/index.js +1 -1
- package/date-time/style.scss +16 -2
- package/date-time/types.d.ts +5 -1
- package/dialog/dialog-action-footer.d.ts +17 -2
- package/dialog/dialog.dom.d.ts +15 -2
- package/dialog/dialog.dom.js +3 -3
- package/dialog/dialog.parts.d.ts +1 -1
- package/dialog/dialog.parts.js +1 -1
- package/distribution-chart/_distribution-chart.scss +14 -0
- package/distribution-chart/area-chart.js +1 -1
- package/distribution-chart/bar-chart.js +1 -1
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/line-chart.js +1 -1
- package/dropdown/content.js +1 -1
- package/dropdown/control.js +1 -1
- package/dropdown/editor-dropdown.style.scss +5 -0
- package/dropdown/index.js +2 -2
- package/dropdown/lookup-field.d.ts +5 -0
- package/dropdown/lookup-field.js +1 -1
- package/dropdown/popup.js +1 -1
- package/duration/index.js +1 -1
- package/editor-actions.js +1 -1
- package/field-configurator.d.ts +8 -0
- package/field-configurator.js +1 -1
- package/filter/filters/slider/_slider.scss +8 -8
- package/filter/filters/slider/single.js +1 -1
- package/filter-badge.js +1 -1
- package/filter-controls.d.ts +0 -1
- package/filter-controls.js +5 -6
- package/form-controls/index.d.ts +10 -2
- package/form-controls/index.js +3 -3
- package/formatting/index.d.ts +1 -1
- package/formatting/index.js +1 -1
- package/framework.js +202 -205
- package/icon-toolbar.d.ts +5 -1
- package/icon-toolbar.js +1 -1
- package/masked-input/index.js +1 -1
- package/native-control.js +1 -1
- package/native-controls.d.ts +54 -2
- package/native-styles.css +1 -1
- package/native.js +29 -29
- package/number-input/index.js +1 -1
- package/package.json +1 -1
- package/pagination.js +11 -11
- package/pdf-viewer/index.js +1 -1
- package/preact.d.ts +1 -6
- package/preact.js +60 -60
- package/rating-choice.js +1 -1
- package/react-control.d.ts +2 -0
- package/react-control.js +2 -2
- package/react.d.ts +0 -6
- package/react.js +54 -54
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-popup.js +1 -1
- package/rich-text/index.js +1 -1
- package/search-input/index.js +1 -1
- package/search-input/native.d.ts +21 -2
- package/select.js +1 -1
- package/styles/_alert.scss +18 -4
- package/styles/_editor-slider.scss +0 -2
- package/styles/_field-configurator.scss +2 -1
- package/styles/_fields-grid.scss +2 -0
- package/styles/_palette.scss +0 -24
- package/styles/_primitives.scss +3 -1
- package/styles.css +1 -1
- package/styles.scss +2 -2
- package/surfaces.d.ts +34 -3
- package/surfaces.js +2 -2
- package/svelte.js +3 -3
- package/switch/index.js +1 -1
- package/time-grid.d.ts +0 -1
- package/time-grid.js +4 -4
- package/timeline-track/index.js +1 -1
- package/ui.css +1 -1
- package/vue.d.ts +2 -21
- package/vue.js +83 -89
- package/_chunks/dialog.parts-BSbvnEwX.js +0 -134
- package/_chunks/mount-D1i5DLRn.js +0 -266
- package/avatar/index.view.d.ts +0 -25
- package/color-palette/native.view.d.ts +0 -15
- package/control-presentation.view.d.ts +0 -8
- package/dialog/dialog-action-footer.view.d.ts +0 -20
- package/dialog/dialog.dom.view.d.ts +0 -15
- package/form-controls/index.view.d.ts +0 -10
- package/formatting/control-tooltip.d.ts +0 -2
- package/native-controls.view.d.ts +0 -54
- package/search-input/native.view.d.ts +0 -21
- package/surfaces.view.d.ts +0 -33
- /package/styles/{legacy-pagination.css → pagination.css} +0 -0
- /package/styles/{legacy-rating.css → rating.css} +0 -0
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
import { i as e } from "./preact.module-BBM36DnO.js";
|
|
2
|
-
import { a as t,
|
|
3
|
-
import { t as
|
|
4
|
-
import { createPreactElement as
|
|
5
|
-
import { createControlId as
|
|
6
|
-
import { SvgIcon as
|
|
7
|
-
import { n as
|
|
2
|
+
import { a as t, i as n, n as r, r as i, t as a } from "./hooks.module-CG3gN83z.js";
|
|
3
|
+
import { t as o } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
+
import { createPreactElement as s, releasePreactElement as c } from "../preact-mount.js";
|
|
5
|
+
import { createControlId as l } from "../core/control-id.js";
|
|
6
|
+
import { SvgIcon as u } from "../icons/icon.js";
|
|
7
|
+
import { n as d } from "./native-control-pFMuHf3G.js";
|
|
8
8
|
import "./chevron-down-GbplLa6s.js";
|
|
9
|
-
import { L as
|
|
10
|
-
import { EditorList as
|
|
11
|
-
import { t as
|
|
12
|
-
import { i as
|
|
13
|
-
import { f as
|
|
14
|
-
import { n as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { n as
|
|
18
|
-
import { EditorActions as
|
|
9
|
+
import { L as f, t as p } from "./controls-FUU-MUKC.js";
|
|
10
|
+
import { EditorList as m, EditorListItem as h } from "../editor-layout/index.js";
|
|
11
|
+
import { t as g } from "./clock-BOhPNlW3.js";
|
|
12
|
+
import { i as _, s as v } from "./iso-B0YHBK7m.js";
|
|
13
|
+
import { f as y, h as b, m as x, p as S } from "./model-mPO2tG2f.js";
|
|
14
|
+
import { n as C, t as w } from "./date-control-Dup_P3w5.js";
|
|
15
|
+
import { t as T } from "./picker-gEGTu1Ki.js";
|
|
16
|
+
import { t as E } from "./editor-popup-ByU7qiub.js";
|
|
17
|
+
import { n as D } from "./editor-commit-Bq3wSgvr.js";
|
|
18
|
+
import { EditorActions as O } from "../editor-actions.js";
|
|
19
19
|
//#region ../dates/src/date-controls.ts
|
|
20
|
-
var
|
|
21
|
-
function
|
|
20
|
+
var k = /^(\d{4})-(\d{2})-(\d{2})$/, A = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/, j = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
21
|
+
function M(e, t, n = "minute") {
|
|
22
22
|
if (Number.isNaN(t.getTime())) return "";
|
|
23
|
-
let r = `${
|
|
23
|
+
let r = `${P(t.getHours())}:${P(t.getMinutes())}${n === "second" ? `:${P(t.getSeconds())}` : ""}`;
|
|
24
24
|
if (e === "time") return r;
|
|
25
|
-
let i =
|
|
25
|
+
let i = _(t);
|
|
26
26
|
return e === "date" ? i : `${i}T${r}`;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function N(e, t, n = /* @__PURE__ */ new Date()) {
|
|
29
29
|
if (e === "time") {
|
|
30
|
-
let e =
|
|
30
|
+
let e = j.exec(t);
|
|
31
31
|
if (!e) return;
|
|
32
32
|
let r = Number(e[1]), i = Number(e[2]), a = Number(e[3] ?? 0);
|
|
33
33
|
if (r > 23 || i > 59 || a > 59 || Number.isNaN(n.getTime())) return;
|
|
34
34
|
let o = new Date(n.getTime());
|
|
35
35
|
return o.setHours(r, i, a, 0), o;
|
|
36
36
|
}
|
|
37
|
-
let r = e === "date" ?
|
|
37
|
+
let r = e === "date" ? k.exec(t) : A.exec(t);
|
|
38
38
|
if (!r) return;
|
|
39
39
|
let i = Number(r[1]), a = Number(r[2]), o = Number(r[3]), s = Number(r[4] ?? 0), c = Number(r[5] ?? 0), l = Number(r[6] ?? 0), u = Number((r[7] ?? "").padEnd(3, "0")), d = /* @__PURE__ */ new Date(0);
|
|
40
40
|
if (d.setFullYear(i, a - 1, o), d.setHours(s, c, l, u), !(a < 1 || a > 12 || o < 1 || d.getFullYear() !== i || d.getMonth() !== a - 1 || d.getDate() !== o || d.getHours() !== s || d.getMinutes() !== c || d.getSeconds() !== l || d.getMilliseconds() !== u)) return d;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function P(e) {
|
|
43
43
|
return String(e).padStart(2, "0");
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region ../dates/src/civil-time.ts
|
|
47
|
-
var
|
|
48
|
-
function
|
|
47
|
+
var F = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
48
|
+
function I(e) {
|
|
49
49
|
let t = /* @__PURE__ */ new Date(0);
|
|
50
50
|
return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, 0), t.getTime();
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
let t =
|
|
52
|
+
function L(e) {
|
|
53
|
+
let t = F.exec(e);
|
|
54
54
|
if (!t) return;
|
|
55
55
|
let n = {
|
|
56
56
|
year: Number(t[1]),
|
|
@@ -59,7 +59,7 @@ function R(e) {
|
|
|
59
59
|
hour: Number(t[4]),
|
|
60
60
|
minute: Number(t[5]),
|
|
61
61
|
second: Number(t[6] ?? 0)
|
|
62
|
-
}, r = new Date(
|
|
62
|
+
}, r = new Date(I(n)), i = {
|
|
63
63
|
year: r.getUTCFullYear(),
|
|
64
64
|
month: r.getUTCMonth() + 1,
|
|
65
65
|
day: r.getUTCDate(),
|
|
@@ -71,33 +71,33 @@ function R(e) {
|
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region ../dates/src/temporal-controls.ts
|
|
74
|
-
function
|
|
74
|
+
function R(e) {
|
|
75
75
|
return e.split("T")[0];
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function z(e) {
|
|
78
78
|
return e.includes("T") ? e.split("T")[1] : e;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return n === "datetime" ? `${e}T${t.includes("T") ?
|
|
80
|
+
function B(e, t, n) {
|
|
81
|
+
return n === "datetime" ? `${e}T${t.includes("T") ? z(t) : "00:00"}` : e;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
return n === "datetime" ? `${
|
|
83
|
+
function V(e, t, n) {
|
|
84
|
+
return n === "datetime" ? `${R(e)}T${t}` : t;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return e === "date" ?
|
|
86
|
+
function ee(e, t) {
|
|
87
|
+
return e === "date" ? v(t) : e === "datetime" ? !!L(t.replace(/(\d{2}:\d{2}:\d{2})\.\d{1,3}$/, "$1")) : !!N(e, t);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
let t =
|
|
89
|
+
function H(e) {
|
|
90
|
+
let t = N("time", e);
|
|
91
91
|
return t ? t.getHours() * 3600 + t.getMinutes() * 60 + t.getSeconds() : void 0;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
let n =
|
|
93
|
+
function U(e, t) {
|
|
94
|
+
let n = H(e);
|
|
95
95
|
if (n === void 0) return !1;
|
|
96
|
-
let r = t.min ?
|
|
96
|
+
let r = t.min ? H(t.min) : void 0, i = t.max ? H(t.max) : void 0;
|
|
97
97
|
return (r === void 0 || n >= r) && (i === void 0 || n <= i) && (t.step === void 0 || t.step > 0 && (n - (r ?? 0)) % t.step === 0);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
let i =
|
|
99
|
+
function W(e, t, n = "minute", r) {
|
|
100
|
+
let i = N("time", e);
|
|
101
101
|
return i ? new Intl.DateTimeFormat(r ?? (t === "12h" ? "en-US" : "en-GB"), {
|
|
102
102
|
hour: "2-digit",
|
|
103
103
|
minute: "2-digit",
|
|
@@ -105,7 +105,7 @@ function K(e, t, n = "minute", r) {
|
|
|
105
105
|
hourCycle: t === "12h" ? "h12" : "h23"
|
|
106
106
|
}).format(i) : e;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function G(e, t = "minute", n) {
|
|
109
109
|
if (e = e.replace(/[\u200e\u200f\u061c]/g, "").trim(), n) {
|
|
110
110
|
let t = new Intl.NumberFormat(n, { useGrouping: !1 });
|
|
111
111
|
for (let n = 0; n < 10; n++) e = e.split(t.format(n)).join(String(n));
|
|
@@ -126,29 +126,29 @@ function q(e, t = "minute", n) {
|
|
|
126
126
|
for (let t of i) t.type === "literal" && t.value.trim() && (e = e.split(t.value).join(":"));
|
|
127
127
|
e = e.replace(/^\s*(AM|PM)\s*(.*)$/i, "$2 $1");
|
|
128
128
|
}
|
|
129
|
-
let r =
|
|
130
|
-
if (r) return
|
|
129
|
+
let r = N("time", e.trim());
|
|
130
|
+
if (r) return M("time", r, t);
|
|
131
131
|
let i = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap])\.?m\.?$/i.exec(e.trim());
|
|
132
132
|
if (!i) return;
|
|
133
133
|
let a = Number(i[1]);
|
|
134
134
|
if (a < 1 || a > 12) return;
|
|
135
|
-
let o =
|
|
136
|
-
return o ?
|
|
135
|
+
let o = N("time", `${String(a % 12 + (i[4].toLowerCase() === "p" ? 12 : 0)).padStart(2, "0")}:${i[2]}:${i[3] ?? "00"}`);
|
|
136
|
+
return o ? M("time", o, t) : void 0;
|
|
137
137
|
}
|
|
138
138
|
//#endregion
|
|
139
139
|
//#region ../dates/src/time-selection.ts
|
|
140
|
-
function
|
|
141
|
-
let t = e.min ?
|
|
140
|
+
function K(e) {
|
|
141
|
+
let t = e.min ? H(e.min) : void 0, n = e.max ? H(e.max) : void 0, r = e.step ?? (e.precision === "second" ? 1 : 60);
|
|
142
142
|
if (!Number.isFinite(r) || r <= 0) return [];
|
|
143
143
|
let i = e.precision === "second" ? 1 : 60, a = [];
|
|
144
144
|
for (let e = 0; e < 86400; e += i) (t === void 0 || e >= t) && (n === void 0 || e <= n) && (e - (t ?? 0)) % r === 0 && a.push(e);
|
|
145
145
|
return a;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function q(e, t = "minute") {
|
|
148
148
|
let n = (e) => String(e).padStart(2, "0");
|
|
149
149
|
return `${n(Math.floor(e / 3600))}:${n(Math.floor(e / 60) % 60)}${t === "second" ? `:${n(e % 60)}` : ""}`;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function J(e, t) {
|
|
152
152
|
return e === "12h" || e === "locale" && !!new Intl.DateTimeFormat(t, { hour: "numeric" }).resolvedOptions().hour12;
|
|
153
153
|
}
|
|
154
154
|
function te(e, t) {
|
|
@@ -158,7 +158,7 @@ function te(e, t) {
|
|
|
158
158
|
}).formatToParts(new Date(2e3, 0, 1, e ? 13 : 1)).find((e) => e.type === "dayPeriod")?.value ?? (e ? "PM" : "AM");
|
|
159
159
|
}
|
|
160
160
|
function ne(e, t, n) {
|
|
161
|
-
let r =
|
|
161
|
+
let r = H(t), i = r ?? e[0] ?? 0, a = Math.floor(i / 3600), o = Math.floor(i / 60) % 60, s = i % 60, c = {
|
|
162
162
|
hour: /* @__PURE__ */ new Map(),
|
|
163
163
|
minute: /* @__PURE__ */ new Map(),
|
|
164
164
|
second: /* @__PURE__ */ new Map(),
|
|
@@ -184,7 +184,7 @@ function ne(e, t, n) {
|
|
|
184
184
|
}
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region src/date-time/types.ts
|
|
187
|
-
var
|
|
187
|
+
var Y = {
|
|
188
188
|
date: "Date",
|
|
189
189
|
dates: "Dates",
|
|
190
190
|
invalidDate: "Enter a valid date in the indicated format.",
|
|
@@ -207,86 +207,86 @@ var X = {
|
|
|
207
207
|
chooseDate: "Choose date",
|
|
208
208
|
chooseTime: "Choose time"
|
|
209
209
|
};
|
|
210
|
-
function
|
|
211
|
-
return (e === "time" ? t?.chooseTime
|
|
210
|
+
function X(e, t) {
|
|
211
|
+
return (e === "time" ? t?.chooseTime : t?.chooseDate) ?? (e === "time" ? Y.chooseTime : Y.chooseDate);
|
|
212
212
|
}
|
|
213
213
|
//#endregion
|
|
214
214
|
//#region src/date-time/validation.ts
|
|
215
215
|
function re(e, t, n = "") {
|
|
216
216
|
let { kind: r = "date", selection: i = "single", value: a, calendar: o = {} } = e, s = {
|
|
217
|
-
...
|
|
217
|
+
...Y,
|
|
218
218
|
...e.text
|
|
219
|
-
}, c = a && !Array.isArray(a) && typeof a == "object" ? a : void 0, l = typeof a == "string" ? a : "", u = c?.from ?? "", d = c?.to ?? "", f = e.required ?? o.required ?? !1, p = c ? [u, d] : Array.isArray(a) ? a : l ? [l] : [], m = (e) =>
|
|
219
|
+
}, c = a && !Array.isArray(a) && typeof a == "object" ? a : void 0, l = typeof a == "string" ? a : "", u = c?.from ?? "", d = c?.to ?? "", f = e.required ?? o.required ?? !1, p = c ? [u, d] : Array.isArray(a) ? a : l ? [l] : [], m = (e) => v(e) && (!o.minDate || e >= o.minDate) && (!o.maxDate || e <= o.maxDate) && !o.isDateDisabled?.(e) && !o.isMonthDisabled?.(y(e, o.calendarSystem)), h = (t) => ee(r, t) && (r === "time" || m(R(t))) && (r === "date" || U(z(t), {
|
|
220
220
|
min: e.minTime,
|
|
221
221
|
max: e.maxTime,
|
|
222
222
|
step: e.timeStep
|
|
223
|
-
})), g = c && d ?
|
|
223
|
+
})), g = c && d ? x(R(u), R(d)) : 0, _ = i === "multiple" ? p.length : g, b = !p.length && !f || i === "single" || (!o.min || _ >= o.min) && (o.max === void 0 || _ <= o.max), C = (() => {
|
|
224
224
|
if (r === "time" || !c?.to || !o.excludeDisabled || !p.every(h)) return !0;
|
|
225
225
|
if (g > 366e3) return !1;
|
|
226
|
-
for (let e =
|
|
226
|
+
for (let e = R(u); e <= R(d); e = S(e, 1)) if (!m(e)) return !1;
|
|
227
227
|
return !0;
|
|
228
228
|
})(), w = "", T = r === "time" || p.every((e) => {
|
|
229
|
-
let n =
|
|
230
|
-
if (!
|
|
229
|
+
let n = R(e);
|
|
230
|
+
if (!v(n)) return !1;
|
|
231
231
|
let r = o.validateSelection?.(n, {
|
|
232
232
|
month: o.month ?? t,
|
|
233
233
|
view: o.defaultView ?? "month",
|
|
234
234
|
referenceDate: o.referenceDate,
|
|
235
235
|
selection: c ? {
|
|
236
|
-
from:
|
|
237
|
-
to:
|
|
236
|
+
from: R(u),
|
|
237
|
+
to: R(d || u)
|
|
238
238
|
} : {
|
|
239
239
|
from: n,
|
|
240
240
|
to: n
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
243
|
return typeof r == "string" && (w = r), r !== !1 && typeof r != "string";
|
|
244
|
-
}), E = !n &&
|
|
244
|
+
}), E = !n && b && T && C && (!f || p.length > 0) && p.every(h) && (i !== "multiple" || new Set(p).size === p.length) && (!c || !!d && u <= d) && (i !== "multiple" || r === "date"), D = (t) => e.text?.[t] ?? e.text?.invalid ?? s[t] ?? s.invalid, O = r === "time" ? [] : p.map(R);
|
|
245
245
|
return {
|
|
246
246
|
valid: E,
|
|
247
|
-
errorMessage: n || w || (!p.length && f ? D("requiredValue") : c && (!u || !d) ? D("invalidRange") : O.some((e) => !
|
|
247
|
+
errorMessage: n || w || (!p.length && f ? D("requiredValue") : c && (!u || !d) ? D("invalidRange") : O.some((e) => !v(e)) ? D("invalidDate") : O.some((e) => o.minDate && e < o.minDate || o.maxDate && e > o.maxDate) ? D("outOfRange") : O.some((e) => !m(e)) || !C ? D("disabledDate") : c && (!d || u > d) ? D("invalidRange") : !b || i === "multiple" && new Set(p).size !== p.length ? D("selectionCount") : s.invalid),
|
|
248
248
|
validDate: m
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
251
|
//#endregion
|
|
252
252
|
//#region src/date-time/time-control.tsx
|
|
253
|
-
function ie({ value: e, label: t, format:
|
|
254
|
-
let [
|
|
255
|
-
if (
|
|
253
|
+
function ie({ value: e, label: t, format: r = "locale", precision: i = "minute", locale: a, min: s, max: c, step: l, onChange: u }) {
|
|
254
|
+
let [f, p] = n(!1), [m, h] = n("");
|
|
255
|
+
if (r === "locale") return /* @__PURE__ */ o(d, {
|
|
256
256
|
type: "time",
|
|
257
257
|
"aria-label": t,
|
|
258
258
|
value: e,
|
|
259
|
-
min:
|
|
259
|
+
min: s,
|
|
260
260
|
max: c,
|
|
261
261
|
step: l ?? (i === "second" ? 1 : 60),
|
|
262
262
|
onInput: (e) => u(e.currentTarget.value)
|
|
263
263
|
});
|
|
264
|
-
let g =
|
|
265
|
-
return /* @__PURE__ */
|
|
264
|
+
let g = W(e, r, i, a);
|
|
265
|
+
return /* @__PURE__ */ o(d, {
|
|
266
266
|
type: "text",
|
|
267
267
|
"aria-label": t,
|
|
268
|
-
value:
|
|
269
|
-
"aria-invalid": !!e && !
|
|
270
|
-
min:
|
|
268
|
+
value: f ? m : g,
|
|
269
|
+
"aria-invalid": !!e && !U(e, {
|
|
270
|
+
min: s,
|
|
271
271
|
max: c,
|
|
272
272
|
step: l
|
|
273
273
|
}),
|
|
274
|
-
placeholder:
|
|
274
|
+
placeholder: r === "12h" ? "09:00 AM" : "09:00",
|
|
275
275
|
onFocus: () => {
|
|
276
276
|
p(!0), h(g);
|
|
277
277
|
},
|
|
278
278
|
onBlur: () => p(!1),
|
|
279
279
|
onInput: (e) => {
|
|
280
280
|
let t = e.currentTarget.value;
|
|
281
|
-
h(t), u(t ?
|
|
281
|
+
h(t), u(t ? G(t, i, a) ?? t : "");
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
286
286
|
//#region src/date-time/time-selection.tsx
|
|
287
|
-
function ae({ label: e, accessibleLabel: t, values: n, selected: r, choices:
|
|
288
|
-
let u =
|
|
289
|
-
|
|
287
|
+
function ae({ label: e, accessibleLabel: t, values: n, selected: r, choices: s, display: c, onSelect: l }) {
|
|
288
|
+
let u = a(null), d = r !== void 0 && s.has(r), f = d ? r : n.find((e) => s.has(e));
|
|
289
|
+
i(() => {
|
|
290
290
|
let e = u.current;
|
|
291
291
|
if (!e) return;
|
|
292
292
|
let t = () => {
|
|
@@ -298,24 +298,24 @@ function ae({ label: e, accessibleLabel: t, values: n, selected: r, choices: i,
|
|
|
298
298
|
return n.observe(e), () => n.disconnect();
|
|
299
299
|
}, [r, f]);
|
|
300
300
|
let p = (e) => {
|
|
301
|
-
let t =
|
|
301
|
+
let t = s.get(Number(e));
|
|
302
302
|
t !== void 0 && l(t);
|
|
303
303
|
};
|
|
304
|
-
return /* @__PURE__ */
|
|
304
|
+
return /* @__PURE__ */ o("div", {
|
|
305
305
|
class: "rv-time-selection__column",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
306
|
+
children: [e && /* @__PURE__ */ o("span", {
|
|
307
307
|
class: "rv-time-selection__label",
|
|
308
308
|
children: e
|
|
309
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ o(m, {
|
|
310
310
|
label: t,
|
|
311
311
|
listRef: u,
|
|
312
312
|
variant: "plain",
|
|
313
313
|
className: "rv-time-selection__list",
|
|
314
314
|
onSelect: p,
|
|
315
|
-
children: n.map((e) => /* @__PURE__ */
|
|
315
|
+
children: n.map((e) => /* @__PURE__ */ o(h, {
|
|
316
316
|
value: String(e),
|
|
317
317
|
selected: r === e && d,
|
|
318
|
-
disabled: !
|
|
318
|
+
disabled: !s.has(e),
|
|
319
319
|
tabIndex: e === f ? 0 : -1,
|
|
320
320
|
onClick: () => p(String(e)),
|
|
321
321
|
children: c(e)
|
|
@@ -323,64 +323,64 @@ function ae({ label: e, accessibleLabel: t, values: n, selected: r, choices: i,
|
|
|
323
323
|
})]
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
let [_, v] =
|
|
326
|
+
function Z({ value: e, label: i, text: a, onChange: s, format: c = "locale", precision: l = "minute", locale: d, min: f, max: m, step: h, collapsible: g = !1 }) {
|
|
327
|
+
let [_, v] = n(!1), y = t(), b = J(c, d), x = r(() => K({
|
|
328
328
|
min: f,
|
|
329
|
-
max:
|
|
329
|
+
max: m,
|
|
330
330
|
step: h,
|
|
331
331
|
precision: l
|
|
332
332
|
}), [
|
|
333
333
|
f,
|
|
334
|
-
|
|
334
|
+
m,
|
|
335
335
|
h,
|
|
336
336
|
l
|
|
337
|
-
]), S =
|
|
337
|
+
]), S = r(() => ne(x, e, b), [
|
|
338
338
|
x,
|
|
339
339
|
e,
|
|
340
340
|
b
|
|
341
|
-
]), C =
|
|
341
|
+
]), C = r(() => new Intl.NumberFormat(d, {
|
|
342
342
|
minimumIntegerDigits: 2,
|
|
343
343
|
useGrouping: !1
|
|
344
|
-
}), [
|
|
345
|
-
label: t,
|
|
346
|
-
accessibleLabel: `${
|
|
347
|
-
values:
|
|
344
|
+
}), [d]), w = (e) => s(q(e, l)), T = (e, t, n, r = (e) => C.format(e)) => /* @__PURE__ */ o(ae, {
|
|
345
|
+
label: e === "period" ? void 0 : t,
|
|
346
|
+
accessibleLabel: `${i}: ${t}`,
|
|
347
|
+
values: n,
|
|
348
348
|
selected: S.hasValue ? S[e] : void 0,
|
|
349
349
|
choices: S.columns[e],
|
|
350
|
-
display:
|
|
350
|
+
display: r,
|
|
351
351
|
onSelect: w
|
|
352
352
|
}), E = (e, t = 0) => Array.from({ length: e }, (e, n) => t + n);
|
|
353
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ o("section", {
|
|
354
354
|
class: "rv-time-selection",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ o("div", {
|
|
356
356
|
class: "rv-time-selection__entry-row",
|
|
357
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ o("label", {
|
|
358
358
|
class: "rv-time-selection__entry",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ o("span", { children: i }), /* @__PURE__ */ o(ie, {
|
|
360
360
|
value: e,
|
|
361
|
-
label:
|
|
361
|
+
label: i,
|
|
362
362
|
format: c,
|
|
363
363
|
precision: l,
|
|
364
|
-
locale:
|
|
364
|
+
locale: d,
|
|
365
365
|
min: f,
|
|
366
|
-
max:
|
|
366
|
+
max: m,
|
|
367
367
|
step: h,
|
|
368
|
-
onChange:
|
|
368
|
+
onChange: s
|
|
369
369
|
})]
|
|
370
|
-
}), g && /* @__PURE__ */
|
|
370
|
+
}), g && /* @__PURE__ */ o(p, {
|
|
371
371
|
variant: "ghost",
|
|
372
372
|
className: "rv-time-selection__toggle",
|
|
373
373
|
"aria-label": a.chooseTime ?? a.time,
|
|
374
374
|
"aria-expanded": _,
|
|
375
375
|
"aria-controls": _ ? y : void 0,
|
|
376
376
|
onClick: () => v(!_),
|
|
377
|
-
children: /* @__PURE__ */
|
|
377
|
+
children: /* @__PURE__ */ o(u, { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\"/></svg>" })
|
|
378
378
|
})]
|
|
379
|
-
}), (!g || _) && /* @__PURE__ */
|
|
379
|
+
}), (!g || _) && /* @__PURE__ */ o("div", {
|
|
380
380
|
id: y,
|
|
381
381
|
class: "rv-time-selection__clock",
|
|
382
382
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ o("div", {
|
|
384
384
|
class: `rv-time-selection__columns${l === "second" ? " rv-time-selection__columns--seconds" : ""}`,
|
|
385
385
|
children: [
|
|
386
386
|
T("hour", a.hours, E(b ? 12 : 24, b ? S.period * 12 : 0), (e) => C.format(b ? e % 12 || 12 : e)),
|
|
@@ -388,11 +388,11 @@ function Q({ value: e, label: n, text: a, onChange: o, format: c = "locale", pre
|
|
|
388
388
|
l === "second" && T("second", a.seconds, E(60))
|
|
389
389
|
]
|
|
390
390
|
}),
|
|
391
|
-
b && /* @__PURE__ */
|
|
391
|
+
b && /* @__PURE__ */ o("div", {
|
|
392
392
|
class: "rv-time-selection__period",
|
|
393
|
-
children: T("period", a.dayPeriod, [0, 1], (e) => te(e,
|
|
393
|
+
children: T("period", a.dayPeriod, [0, 1], (e) => te(e, d))
|
|
394
394
|
}),
|
|
395
|
-
!x.length && /* @__PURE__ */
|
|
395
|
+
!x.length && /* @__PURE__ */ o("p", {
|
|
396
396
|
class: "rv-time-selection__empty",
|
|
397
397
|
role: "status",
|
|
398
398
|
children: a.noTimes
|
|
@@ -404,218 +404,218 @@ function Q({ value: e, label: n, text: a, onChange: o, format: c = "locale", pre
|
|
|
404
404
|
//#endregion
|
|
405
405
|
//#region src/date-time/picker.tsx
|
|
406
406
|
function oe(t) {
|
|
407
|
-
let { kind:
|
|
408
|
-
...
|
|
407
|
+
let { kind: r = "date", selection: a = "single", value: s, onChange: c, calendar: u = {} } = t, d = (u.numberOfMonths ?? 1) >= 2, m = {
|
|
408
|
+
...Y,
|
|
409
409
|
...t.text
|
|
410
|
-
}, [h] =
|
|
411
|
-
locale:
|
|
410
|
+
}, [h] = n(() => l("rv-date-error")), g = (e) => r === "date" ? e : R(e), _ = {
|
|
411
|
+
locale: u.locale,
|
|
412
412
|
...typeof t.dateInput == "object" ? t.dateInput : {}
|
|
413
|
-
}, [
|
|
414
|
-
|
|
415
|
-
let
|
|
416
|
-
|
|
417
|
-
}, W = (e) => {
|
|
418
|
-
U(e), i === "date" && a !== "multiple" && re({
|
|
413
|
+
}, [x, S] = n(t.endpoint === "to" ? "to" : void 0), [C, E] = n(""), D = s && !Array.isArray(s) && typeof s == "object" ? s : void 0, O = typeof s == "string" ? s : "", k = Array.isArray(s) ? s : [], A = D?.from ?? "", j = D?.to ?? "", M = R(r === "time" ? b() : t.endpoint === "to" ? j : A || O || k[0] || ""), [N, P] = n(() => u.defaultMonth ?? y(v(M) ? M : b(), u.calendarSystem)), F = t.required ?? u.required ?? !1, { valid: I, errorMessage: L, validDate: ee } = re(t, N, C);
|
|
414
|
+
i(() => t.onValidityChange?.(!!I), [I]);
|
|
415
|
+
let H = (e, n = !1) => {
|
|
416
|
+
E(""), c(e), (t.onValidChange || n) && re({
|
|
419
417
|
...t,
|
|
420
418
|
value: e
|
|
421
|
-
}, N).valid && t.onSelectionComplete?.(e);
|
|
422
|
-
},
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
419
|
+
}, N).valid && (t.onValidChange?.(e), n && t.onSelectionComplete?.(e));
|
|
420
|
+
}, U = (e) => {
|
|
421
|
+
H(e, r === "date" && a !== "multiple");
|
|
422
|
+
}, W = (e) => {
|
|
423
|
+
if (!ee(e)) return;
|
|
424
|
+
let t = y(e, u.calendarSystem);
|
|
425
|
+
t !== (u.month ?? N) && (P(t), u.onMonthChange?.(t));
|
|
426
|
+
}, G = (e, t) => {
|
|
427
427
|
if (typeof t != "string") return;
|
|
428
|
-
|
|
428
|
+
W(t);
|
|
429
429
|
let n = {
|
|
430
430
|
from: A,
|
|
431
431
|
to: j,
|
|
432
|
-
[e]: t ?
|
|
432
|
+
[e]: t ? B(t, e === "from" ? A : j, r) : ""
|
|
433
433
|
};
|
|
434
|
-
|
|
435
|
-
},
|
|
434
|
+
H(!n.from && !n.to ? null : n);
|
|
435
|
+
}, K = (e, n, r, i = !0) => /* @__PURE__ */ o("label", {
|
|
436
436
|
class: `rv-temporal-picker__time${i ? "" : " rv-temporal-picker__time--single"}`,
|
|
437
|
-
children: [i && /* @__PURE__ */
|
|
437
|
+
children: [i && /* @__PURE__ */ o("span", { children: n }), /* @__PURE__ */ o(ie, {
|
|
438
438
|
label: n,
|
|
439
|
-
value: e ?
|
|
439
|
+
value: e ? z(e) : "",
|
|
440
440
|
min: t.minTime,
|
|
441
441
|
max: t.maxTime,
|
|
442
442
|
step: t.timeStep,
|
|
443
443
|
precision: t.precision,
|
|
444
444
|
format: t.timeFormat,
|
|
445
|
-
locale:
|
|
445
|
+
locale: u.locale,
|
|
446
446
|
onChange: r
|
|
447
447
|
})]
|
|
448
|
-
}),
|
|
449
|
-
...
|
|
450
|
-
month:
|
|
448
|
+
}), q = {
|
|
449
|
+
...u,
|
|
450
|
+
month: u.month ?? N,
|
|
451
451
|
onMonthChange: (e) => {
|
|
452
|
-
P(e),
|
|
452
|
+
P(e), u.onMonthChange?.(e);
|
|
453
453
|
},
|
|
454
454
|
required: F,
|
|
455
455
|
onInvalidSelection: (e, t) => {
|
|
456
|
-
|
|
456
|
+
E(e || m.invalid), u.onInvalidSelection?.(e, t);
|
|
457
457
|
}
|
|
458
|
-
},
|
|
459
|
-
if (a === "multiple")
|
|
460
|
-
...
|
|
458
|
+
}, J;
|
|
459
|
+
if (a === "multiple") J = {
|
|
460
|
+
...q,
|
|
461
461
|
mode: "multiple",
|
|
462
|
-
selected: k.filter(
|
|
463
|
-
onSelectionChange: (e) =>
|
|
462
|
+
selected: k.filter(v),
|
|
463
|
+
onSelectionChange: (e) => U([...e])
|
|
464
464
|
};
|
|
465
|
-
else if (a === "range" && !
|
|
466
|
-
...
|
|
465
|
+
else if (a === "range" && !x) J = {
|
|
466
|
+
...q,
|
|
467
467
|
mode: "range",
|
|
468
|
-
selected: A &&
|
|
469
|
-
from:
|
|
470
|
-
...j &&
|
|
468
|
+
selected: A && v(R(A)) ? {
|
|
469
|
+
from: R(A),
|
|
470
|
+
...j && v(R(j)) ? { to: R(j) } : {}
|
|
471
471
|
} : void 0,
|
|
472
|
-
onSelectionChange: (e) =>
|
|
473
|
-
from:
|
|
474
|
-
...e.to ? { to:
|
|
472
|
+
onSelectionChange: (e) => U(e ? {
|
|
473
|
+
from: B(e.from, A, r),
|
|
474
|
+
...e.to ? { to: B(e.to, j, r) } : {}
|
|
475
475
|
} : null)
|
|
476
476
|
};
|
|
477
477
|
else {
|
|
478
|
-
let e = a === "range" ?
|
|
479
|
-
|
|
480
|
-
...
|
|
478
|
+
let e = a === "range" ? x === "to" ? j : A : O;
|
|
479
|
+
J = {
|
|
480
|
+
...q,
|
|
481
481
|
mode: "single",
|
|
482
|
-
selected: e &&
|
|
482
|
+
selected: e && v(R(e)) ? R(e) : void 0,
|
|
483
483
|
onSelectionChange: (t) => {
|
|
484
|
-
|
|
484
|
+
U(a === "range" ? t ? {
|
|
485
485
|
from: A,
|
|
486
486
|
to: j,
|
|
487
|
-
[
|
|
488
|
-
} : null : t ?
|
|
487
|
+
[x ?? "from"]: B(t, e, r)
|
|
488
|
+
} : null : t ? B(t, O, r) : null);
|
|
489
489
|
}
|
|
490
490
|
};
|
|
491
491
|
}
|
|
492
|
-
return /* @__PURE__ */
|
|
493
|
-
class: `rv-temporal-picker rv-temporal-picker--${
|
|
492
|
+
return /* @__PURE__ */ o("div", {
|
|
493
|
+
class: `rv-temporal-picker rv-temporal-picker--${r}${d ? " rv-temporal-picker--multi-month" : ""}`,
|
|
494
494
|
children: [
|
|
495
|
-
t.dateInput === !1 && a === "range" &&
|
|
495
|
+
t.dateInput === !1 && a === "range" && r !== "time" && /* @__PURE__ */ o("div", {
|
|
496
496
|
class: `rv-temporal-picker__endpoints ${t.classNames?.endpoints ?? ""}`,
|
|
497
|
-
children: [/* @__PURE__ */
|
|
498
|
-
"aria-label": `${
|
|
499
|
-
"aria-pressed":
|
|
497
|
+
children: [/* @__PURE__ */ o(p, {
|
|
498
|
+
"aria-label": `${m.startDate}: ${A}`,
|
|
499
|
+
"aria-pressed": x !== "to",
|
|
500
500
|
onClick: () => {
|
|
501
|
-
S(void 0), A && P(
|
|
501
|
+
S(void 0), A && P(y(R(A), u.calendarSystem)), E("");
|
|
502
502
|
},
|
|
503
|
-
children: A ?
|
|
504
|
-
}), /* @__PURE__ */
|
|
505
|
-
"aria-label": `${
|
|
506
|
-
"aria-pressed":
|
|
503
|
+
children: A ? R(A) : "—"
|
|
504
|
+
}), /* @__PURE__ */ o(p, {
|
|
505
|
+
"aria-label": `${m.endDate}: ${j}`,
|
|
506
|
+
"aria-pressed": x === "to",
|
|
507
507
|
onClick: () => {
|
|
508
|
-
S("to"), j && P(
|
|
508
|
+
S("to"), j && P(y(R(j), u.calendarSystem)), E("");
|
|
509
509
|
},
|
|
510
|
-
children: j ?
|
|
510
|
+
children: j ? R(j) : "—"
|
|
511
511
|
})]
|
|
512
512
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ o("div", {
|
|
514
514
|
class: "rv-temporal-picker__header",
|
|
515
|
-
children:
|
|
515
|
+
children: r !== "time" && t.dateInput !== !1 && /* @__PURE__ */ o("div", {
|
|
516
516
|
class: `rv-temporal-picker__dates ${a === "range" ? `rv-temporal-picker__endpoints ${t.classNames?.endpoints ?? ""}` : ""}`,
|
|
517
|
-
children: a === "range" ? /* @__PURE__ */
|
|
517
|
+
children: a === "range" ? /* @__PURE__ */ o(e, { children: [/* @__PURE__ */ o("div", {
|
|
518
518
|
class: "rv-temporal-picker__endpoint",
|
|
519
519
|
role: "group",
|
|
520
|
-
"aria-label":
|
|
521
|
-
children: [/* @__PURE__ */
|
|
522
|
-
label:
|
|
520
|
+
"aria-label": m.startDate,
|
|
521
|
+
children: [/* @__PURE__ */ o(w, {
|
|
522
|
+
label: m.startDate,
|
|
523
523
|
value: g(A),
|
|
524
524
|
options: _,
|
|
525
525
|
invalid: !I,
|
|
526
526
|
errorId: h,
|
|
527
527
|
onFocus: () => S(void 0),
|
|
528
|
-
onChange: (e) =>
|
|
529
|
-
}),
|
|
530
|
-
from:
|
|
528
|
+
onChange: (e) => G("from", e)
|
|
529
|
+
}), r === "datetime" && K(A, m.startTime, (e) => H({
|
|
530
|
+
from: V(A, e, r),
|
|
531
531
|
...j ? { to: j } : {}
|
|
532
532
|
}), !1)]
|
|
533
|
-
}), /* @__PURE__ */
|
|
533
|
+
}), /* @__PURE__ */ o("div", {
|
|
534
534
|
class: "rv-temporal-picker__endpoint",
|
|
535
535
|
role: "group",
|
|
536
|
-
"aria-label":
|
|
537
|
-
children: [/* @__PURE__ */
|
|
538
|
-
label:
|
|
536
|
+
"aria-label": m.endDate,
|
|
537
|
+
children: [/* @__PURE__ */ o(w, {
|
|
538
|
+
label: m.endDate,
|
|
539
539
|
value: g(j),
|
|
540
540
|
options: _,
|
|
541
541
|
invalid: !I,
|
|
542
542
|
errorId: h,
|
|
543
543
|
onFocus: () => S("to"),
|
|
544
|
-
onChange: (e) =>
|
|
545
|
-
}),
|
|
544
|
+
onChange: (e) => G("to", e)
|
|
545
|
+
}), r === "datetime" && K(j, m.endTime, (e) => H({
|
|
546
546
|
from: A,
|
|
547
|
-
to:
|
|
547
|
+
to: V(j, e, r)
|
|
548
548
|
}), !1)]
|
|
549
|
-
})] }) : /* @__PURE__ */
|
|
550
|
-
label: a === "multiple" ?
|
|
549
|
+
})] }) : /* @__PURE__ */ o(w, {
|
|
550
|
+
label: a === "multiple" ? m.dates : m.date,
|
|
551
551
|
value: a === "multiple" ? k : g(O),
|
|
552
552
|
multiple: a === "multiple",
|
|
553
553
|
options: _,
|
|
554
554
|
invalid: !I,
|
|
555
555
|
errorId: h,
|
|
556
556
|
onChange: (e) => {
|
|
557
|
-
typeof e == "string" &&
|
|
557
|
+
typeof e == "string" && W(e), H(Array.isArray(e) ? e : e ? B(e, O, r) : null);
|
|
558
558
|
}
|
|
559
559
|
})
|
|
560
560
|
})
|
|
561
561
|
}),
|
|
562
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ o("div", {
|
|
563
563
|
class: "rv-temporal-picker__body",
|
|
564
|
-
children: [
|
|
565
|
-
collapsible:
|
|
566
|
-
value:
|
|
567
|
-
label:
|
|
568
|
-
text:
|
|
564
|
+
children: [r !== "time" && /* @__PURE__ */ o(T, { ...J }), r !== "date" && a !== "range" && /* @__PURE__ */ o(Z, {
|
|
565
|
+
collapsible: r === "datetime" && d,
|
|
566
|
+
value: z(O),
|
|
567
|
+
label: m.time,
|
|
568
|
+
text: m,
|
|
569
569
|
format: t.timeFormat,
|
|
570
570
|
precision: t.precision,
|
|
571
|
-
locale:
|
|
571
|
+
locale: u.locale,
|
|
572
572
|
min: t.minTime,
|
|
573
573
|
max: t.maxTime,
|
|
574
574
|
step: t.timeStep,
|
|
575
|
-
onChange: (e) =>
|
|
575
|
+
onChange: (e) => H(V(O, e, r))
|
|
576
576
|
})]
|
|
577
577
|
}),
|
|
578
|
-
|
|
578
|
+
r !== "date" && a === "range" && (r === "time" || t.dateInput === !1) && /* @__PURE__ */ o("div", {
|
|
579
579
|
class: "rv-temporal-picker__times",
|
|
580
|
-
children: [
|
|
581
|
-
value:
|
|
582
|
-
label:
|
|
583
|
-
text:
|
|
580
|
+
children: [r === "time" ? /* @__PURE__ */ o(Z, {
|
|
581
|
+
value: z(A),
|
|
582
|
+
label: m.startTime,
|
|
583
|
+
text: m,
|
|
584
584
|
format: t.timeFormat,
|
|
585
585
|
precision: t.precision,
|
|
586
|
-
locale:
|
|
586
|
+
locale: u.locale,
|
|
587
587
|
min: t.minTime,
|
|
588
588
|
max: t.maxTime,
|
|
589
589
|
step: t.timeStep,
|
|
590
|
-
onChange: (e) =>
|
|
590
|
+
onChange: (e) => H({
|
|
591
591
|
from: e,
|
|
592
592
|
...j ? { to: j } : {}
|
|
593
593
|
})
|
|
594
|
-
}) :
|
|
595
|
-
from:
|
|
594
|
+
}) : K(A, m.startTime, (e) => H({
|
|
595
|
+
from: V(A, e, r),
|
|
596
596
|
...j ? { to: j } : {}
|
|
597
|
-
})),
|
|
598
|
-
value:
|
|
599
|
-
label:
|
|
600
|
-
text:
|
|
597
|
+
})), r === "time" ? /* @__PURE__ */ o(Z, {
|
|
598
|
+
value: z(j),
|
|
599
|
+
label: m.endTime,
|
|
600
|
+
text: m,
|
|
601
601
|
format: t.timeFormat,
|
|
602
602
|
precision: t.precision,
|
|
603
|
-
locale:
|
|
603
|
+
locale: u.locale,
|
|
604
604
|
min: t.minTime,
|
|
605
605
|
max: t.maxTime,
|
|
606
606
|
step: t.timeStep,
|
|
607
|
-
onChange: (e) =>
|
|
607
|
+
onChange: (e) => H({
|
|
608
608
|
from: A,
|
|
609
609
|
to: e
|
|
610
610
|
})
|
|
611
|
-
}) :
|
|
611
|
+
}) : K(j, m.endTime, (e) => H({
|
|
612
612
|
from: A,
|
|
613
|
-
to:
|
|
613
|
+
to: V(j, e, r)
|
|
614
614
|
}))]
|
|
615
615
|
}),
|
|
616
|
-
!I && /* @__PURE__ */
|
|
616
|
+
!I && /* @__PURE__ */ o(f, {
|
|
617
617
|
tone: "danger",
|
|
618
|
-
children: /* @__PURE__ */
|
|
618
|
+
children: /* @__PURE__ */ o("span", {
|
|
619
619
|
id: h,
|
|
620
620
|
children: L
|
|
621
621
|
})
|
|
@@ -625,111 +625,130 @@ function oe(t) {
|
|
|
625
625
|
}
|
|
626
626
|
//#endregion
|
|
627
627
|
//#region src/date-time/field.tsx
|
|
628
|
-
function
|
|
629
|
-
let [
|
|
630
|
-
|
|
631
|
-
},
|
|
632
|
-
let t =
|
|
633
|
-
return
|
|
634
|
-
},
|
|
635
|
-
return
|
|
628
|
+
function Q({ value: e, options: t, apply: r, cancel: i, onValidChange: a, clearable: s = !0 }) {
|
|
629
|
+
let [c, l] = n(e), [u, d] = n(!1), [p, m] = n(""), h = (e) => {
|
|
630
|
+
l(e), m("");
|
|
631
|
+
}, g = t.autoApply !== !1, _ = JSON.stringify(c) !== JSON.stringify(e), v = (e) => {
|
|
632
|
+
let t = r(e) || "";
|
|
633
|
+
return m(t), !t;
|
|
634
|
+
}, y = () => u ? v(c) : !1;
|
|
635
|
+
return D(() => !_ || y(), g), /* @__PURE__ */ o("div", {
|
|
636
636
|
class: `rv-temporal-draft${t.kind === "time" ? " rv-temporal-draft--time" : ""}`,
|
|
637
637
|
onKeyDown: (e) => {
|
|
638
|
-
e.key === "Enter" && !e.isComposing && (e.ctrlKey || e.metaKey ||
|
|
638
|
+
e.key === "Enter" && !e.isComposing && (e.ctrlKey || e.metaKey || g && e.target instanceof HTMLInputElement) && (e.preventDefault(), y());
|
|
639
639
|
},
|
|
640
640
|
children: [
|
|
641
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ o(oe, {
|
|
642
642
|
...t,
|
|
643
|
-
value:
|
|
644
|
-
onChange:
|
|
645
|
-
|
|
646
|
-
|
|
643
|
+
value: c,
|
|
644
|
+
onChange: h,
|
|
645
|
+
onValidChange: a,
|
|
646
|
+
onValidityChange: d,
|
|
647
|
+
onSelectionComplete: g ? v : void 0
|
|
647
648
|
}),
|
|
648
|
-
|
|
649
|
+
p && /* @__PURE__ */ o(f, {
|
|
649
650
|
tone: "danger",
|
|
650
|
-
children:
|
|
651
|
+
children: p
|
|
651
652
|
}),
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ o(O, {
|
|
653
654
|
text: t.actions,
|
|
654
|
-
showConfirm: t.showActions ?? !
|
|
655
|
-
disabled: !
|
|
656
|
-
apply:
|
|
655
|
+
showConfirm: t.showActions ?? !g,
|
|
656
|
+
disabled: !u,
|
|
657
|
+
apply: y,
|
|
657
658
|
cancel: i,
|
|
658
|
-
clear: !
|
|
659
|
+
clear: !s || (t.required ?? t.calendar?.required) ? void 0 : () => {
|
|
659
660
|
let e = t.selection === "multiple" ? [] : null;
|
|
660
|
-
|
|
661
|
+
h(e), g && v(e);
|
|
661
662
|
}
|
|
662
663
|
})
|
|
663
664
|
]
|
|
664
665
|
});
|
|
665
666
|
}
|
|
666
|
-
function se({ value: e, kind: t = "date", picker: n,
|
|
667
|
-
let
|
|
667
|
+
function se({ value: e, kind: t = "date", picker: n, livePickerUpdates: r, onValueChange: s, onInput: c, formatValue: l, parseValue: f, ...m }) {
|
|
668
|
+
let h = a(null), _ = a(), v = a({
|
|
668
669
|
value: e,
|
|
669
670
|
kind: t,
|
|
670
671
|
picker: n,
|
|
671
|
-
onValueChange:
|
|
672
|
-
input:
|
|
672
|
+
onValueChange: s,
|
|
673
|
+
input: m
|
|
673
674
|
});
|
|
674
|
-
return
|
|
675
|
+
return v.current = {
|
|
675
676
|
value: e,
|
|
676
677
|
kind: t,
|
|
677
678
|
picker: n,
|
|
678
|
-
onValueChange:
|
|
679
|
-
input:
|
|
680
|
-
},
|
|
681
|
-
(
|
|
682
|
-
}, [
|
|
679
|
+
onValueChange: s,
|
|
680
|
+
input: m
|
|
681
|
+
}, i(() => () => _.current?.close(), []), i(() => {
|
|
682
|
+
(m.disabled || m.readOnly) && _.current?.close();
|
|
683
|
+
}, [m.disabled, m.readOnly]), /* @__PURE__ */ o("span", {
|
|
683
684
|
class: "rv-date-time-field",
|
|
684
|
-
children: [/* @__PURE__ */
|
|
685
|
-
...
|
|
685
|
+
children: [/* @__PURE__ */ o(d, {
|
|
686
|
+
...m,
|
|
686
687
|
type: "text",
|
|
687
|
-
value:
|
|
688
|
-
placeholder:
|
|
688
|
+
value: l?.(e) ?? e,
|
|
689
|
+
placeholder: m.placeholder ?? (t === "date" ? "YYYY-MM-DD" : t === "time" ? "HH:mm" : "YYYY-MM-DDTHH:mm"),
|
|
689
690
|
onInput: (e) => {
|
|
690
|
-
|
|
691
|
-
let t =
|
|
692
|
-
t !== void 0 &&
|
|
691
|
+
c?.(e);
|
|
692
|
+
let t = f ? f(e.currentTarget.value) : e.currentTarget.value;
|
|
693
|
+
t !== void 0 && s?.(t);
|
|
693
694
|
}
|
|
694
|
-
}), /* @__PURE__ */
|
|
695
|
-
ref:
|
|
695
|
+
}), /* @__PURE__ */ o(p, {
|
|
696
|
+
ref: h,
|
|
696
697
|
variant: "ghost",
|
|
697
|
-
"aria-label":
|
|
698
|
-
disabled:
|
|
698
|
+
"aria-label": X(t, n?.text),
|
|
699
|
+
disabled: m.disabled || m.readOnly,
|
|
699
700
|
onClick: () => {
|
|
700
|
-
|
|
701
|
+
if (!h.current) return;
|
|
702
|
+
if (_.current) {
|
|
703
|
+
_.current.close();
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
let i, a = (e) => {
|
|
707
|
+
let t = typeof e == "string" ? e : "";
|
|
708
|
+
t === i || v.current.input.disabled || v.current.input.readOnly || (i = t, v.current.onValueChange?.(t));
|
|
709
|
+
};
|
|
710
|
+
_.current = E(h.current, (i) => /* @__PURE__ */ o(Q, {
|
|
701
711
|
value: e || null,
|
|
702
712
|
options: {
|
|
703
713
|
...n,
|
|
704
|
-
|
|
714
|
+
calendar: {
|
|
715
|
+
fixedWeeks: !0,
|
|
716
|
+
...n?.calendar
|
|
717
|
+
},
|
|
718
|
+
required: n?.required ?? m.required,
|
|
705
719
|
kind: t,
|
|
706
720
|
selection: "single"
|
|
707
721
|
},
|
|
708
|
-
cancel:
|
|
722
|
+
cancel: i,
|
|
723
|
+
onValidChange: r && n?.autoApply !== !1 ? a : void 0,
|
|
709
724
|
apply: (e) => {
|
|
710
|
-
|
|
725
|
+
a(e), i();
|
|
711
726
|
}
|
|
712
727
|
}), {
|
|
713
|
-
label:
|
|
728
|
+
label: X(t, n?.text),
|
|
729
|
+
fitViewport: t === "datetime",
|
|
714
730
|
className: t === "time" ? "rv-editor-popup--time" : t === "datetime" ? "rv-editor-popup--datetime" : void 0,
|
|
715
731
|
onClose: () => {
|
|
716
|
-
|
|
732
|
+
_.current = void 0;
|
|
717
733
|
}
|
|
718
|
-
})
|
|
734
|
+
});
|
|
719
735
|
},
|
|
720
|
-
children: /* @__PURE__ */
|
|
736
|
+
children: /* @__PURE__ */ o(u, { svg: t === "time" ? g : C })
|
|
721
737
|
})]
|
|
722
738
|
});
|
|
723
739
|
}
|
|
724
740
|
//#endregion
|
|
725
741
|
//#region src/date-time/attach.tsx
|
|
742
|
+
var $ = /* @__PURE__ */ new WeakMap();
|
|
726
743
|
function ce(e, t, n) {
|
|
727
|
-
|
|
744
|
+
$.get(e)?.();
|
|
745
|
+
let r, i = s(e.ownerDocument, /* @__PURE__ */ o(p, {
|
|
746
|
+
className: "rv-temporal-picker-trigger",
|
|
728
747
|
variant: "ghost",
|
|
729
748
|
disabled: e.disabled || e.readOnly,
|
|
730
|
-
"aria-label":
|
|
749
|
+
"aria-label": X(t.kind ?? "date", t.text),
|
|
731
750
|
onClick: () => {
|
|
732
|
-
e.disabled || e.readOnly || r
|
|
751
|
+
e.disabled || e.readOnly || (r ? r.close() : r = E(e, (r) => /* @__PURE__ */ o(Q, {
|
|
733
752
|
value: e.value || null,
|
|
734
753
|
options: {
|
|
735
754
|
...t,
|
|
@@ -741,25 +760,29 @@ function ce(e, t, n) {
|
|
|
741
760
|
!e.disabled && !e.readOnly && n(typeof t == "string" ? t : ""), r();
|
|
742
761
|
}
|
|
743
762
|
}), {
|
|
763
|
+
fitViewport: t.kind === "datetime",
|
|
744
764
|
className: t.kind === "time" ? "rv-editor-popup--time" : t.kind === "datetime" ? "rv-editor-popup--datetime" : void 0,
|
|
745
|
-
label:
|
|
765
|
+
label: X(t.kind ?? "date", t.text),
|
|
766
|
+
trigger: i,
|
|
746
767
|
onClose: () => {
|
|
747
768
|
r = void 0;
|
|
748
769
|
}
|
|
749
770
|
}));
|
|
750
771
|
},
|
|
751
|
-
children: /* @__PURE__ */
|
|
772
|
+
children: /* @__PURE__ */ o(u, { svg: t.kind === "time" ? g : C })
|
|
752
773
|
}));
|
|
753
774
|
e.after(i);
|
|
754
|
-
let a = e.ownerDocument.defaultView?.MutationObserver,
|
|
775
|
+
let a = e.ownerDocument.defaultView?.MutationObserver, l = a ? new a(() => {
|
|
755
776
|
i.disabled = e.disabled || e.readOnly, i.disabled && r?.close();
|
|
756
777
|
}) : void 0;
|
|
757
|
-
|
|
778
|
+
l?.observe(e, {
|
|
758
779
|
attributes: !0,
|
|
759
780
|
attributeFilter: ["disabled", "readonly"]
|
|
760
|
-
})
|
|
761
|
-
|
|
781
|
+
});
|
|
782
|
+
let d = () => {
|
|
783
|
+
$.get(e) === d && ($.delete(e), l?.disconnect(), r?.close(), c(i), i.remove());
|
|
762
784
|
};
|
|
785
|
+
return $.set(e, d), d;
|
|
763
786
|
}
|
|
764
787
|
//#endregion
|
|
765
788
|
//#region src/date-time/value.tsx
|
|
@@ -781,4 +804,4 @@ function le(e, t) {
|
|
|
781
804
|
}, `+${i}`) : null]);
|
|
782
805
|
}
|
|
783
806
|
//#endregion
|
|
784
|
-
export { oe as a,
|
|
807
|
+
export { oe as a, Q as i, ce as n, Y as o, se as r, X as s, le as t };
|