haze-ui 1.27.0 → 1.28.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/components/Calendar/Calendar.js +222 -151
- package/dist/components/Cascader/Cascader.js +180 -146
- package/dist/components/Chart/Chart.js +12 -9
- package/dist/components/Chart/chart-elements.js +118 -42
- package/dist/components/CodeBlock/CodeBlock.js +39 -9
- package/dist/components/Combobox/Combobox.js +107 -99
- package/dist/components/DataTable/DataTable.js +224 -221
- package/dist/components/DataTable/csv.js +29 -0
- package/dist/components/DataTable/index.js +3 -2
- package/dist/components/DateRangePicker/DateRangePicker.js +31 -16
- package/dist/components/DateRangePicker/presets.js +43 -0
- package/dist/components/Datepicker/Datepicker.js +12 -11
- package/dist/components/Datepicker/DatepickerCore.js +72 -51
- package/dist/components/Datepicker/datetime.js +23 -0
- package/dist/components/Descriptions/Descriptions.js +46 -0
- package/dist/components/Descriptions/index.js +3 -0
- package/dist/components/DiffViewer/DiffViewer.js +31 -30
- package/dist/components/FilePreview/FilePreview.js +135 -0
- package/dist/components/FilePreview/file-preview-format.js +23 -0
- package/dist/components/FilePreview/index.js +3 -0
- package/dist/components/FloatButton/FloatButton.js +42 -0
- package/dist/components/FloatButton/FloatButtonGroup.js +58 -0
- package/dist/components/FloatButton/float-button-context.js +9 -0
- package/dist/components/FloatButton/float-button-glyphs.js +26 -0
- package/dist/components/FloatButton/float-button-styles.js +14 -0
- package/dist/components/FloatButton/index.js +4 -0
- package/dist/components/InlineCompletion/InlineCompletion.js +81 -0
- package/dist/components/InlineCompletion/index.js +3 -0
- package/dist/components/JsonView/JsonView.js +209 -0
- package/dist/components/JsonView/index.js +3 -0
- package/dist/components/JsonView/json-view-utils.js +24 -0
- package/dist/components/LocaleProvider/index.js +5 -4
- package/dist/components/LocaleProvider/ja-jp.js +222 -0
- package/dist/components/LocaleProvider/locale.js +42 -4
- package/dist/components/LocaleProvider/useStrings.js +13 -11
- package/dist/components/LocaleProvider/zh-cn.js +42 -4
- package/dist/components/Masonry/Masonry.js +29 -0
- package/dist/components/Masonry/index.js +3 -0
- package/dist/components/Masonry/masonry-distribute.js +15 -0
- package/dist/components/Select/Select.js +14 -13
- package/dist/components/Select/SelectCore.js +27 -26
- package/dist/components/Select/SelectFloating.js +76 -68
- package/dist/components/Signature/Signature.js +165 -0
- package/dist/components/Signature/index.js +3 -0
- package/dist/components/Signature/signature-points.js +28 -0
- package/dist/components/Sources/Sources.js +109 -0
- package/dist/components/Sources/index.js +3 -0
- package/dist/components/TagGroup/SortableTagGroup.js +26 -0
- package/dist/components/TagGroup/TagGroup.js +7 -21
- package/dist/components/TagGroup/TagGroupItem.js +1 -1
- package/dist/components/TagGroup/index.js +2 -1
- package/dist/components/TagGroup/tag-group-styles.js +7 -0
- package/dist/components/TagInput/SortableTagInput.js +24 -0
- package/dist/components/TagInput/SortableTagInputCore.js +52 -0
- package/dist/components/TagInput/TagInput.js +9 -10
- package/dist/components/TagInput/TagInputCore.js +61 -84
- package/dist/components/TagInput/index.js +3 -1
- package/dist/components/TagInput/tag-input-styles.js +7 -0
- package/dist/components/Toast/Toast.js +44 -43
- package/dist/components/Tree/Tree.js +184 -121
- package/dist/components/Tree/TreeItem.js +91 -57
- package/dist/components/Tree/utils.js +57 -1
- package/dist/components/Upload/Upload.js +12 -9
- package/dist/components/Upload/UploadCore.js +130 -124
- package/dist/components/Upload/UploadList.js +164 -36
- package/dist/css/bottom-sheet.css +1 -1
- package/dist/css/cascader.css +1 -1
- package/dist/css/datepicker.css +1 -1
- package/dist/css/descriptions.css +2 -0
- package/dist/css/dialog.css +1 -1
- package/dist/css/drawer.css +1 -1
- package/dist/css/file-preview.css +2 -0
- package/dist/css/float-button.css +2 -0
- package/dist/css/inline-completion.css +2 -0
- package/dist/css/json-view.css +2 -0
- package/dist/css/masonry.css +2 -0
- package/dist/css/signature.css +2 -0
- package/dist/css/sources.css +2 -0
- package/dist/css/tag-group.css +2 -2
- package/dist/css/tag-input.css +2 -3
- package/dist/css/tree.css +2 -2
- package/dist/css/upload.css +1 -1
- package/dist/css-manifest.json +15 -0
- package/dist/haze-ui.css +20 -13
- package/dist/headless/index.js +18 -6
- package/dist/hooks/useDarkMode.js +27 -0
- package/dist/index.js +207 -192
- package/dist/registry.json +210 -34
- package/dist/types/components/Cascader/Cascader.d.ts +20 -1
- package/dist/types/components/Chart/Chart.d.ts +27 -13
- package/dist/types/components/Chart/chart-elements.d.ts +62 -10
- package/dist/types/components/Chart/index.d.ts +1 -1
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +19 -2
- package/dist/types/components/CodeBlock/index.d.ts +1 -1
- package/dist/types/components/Combobox/Combobox.d.ts +11 -1
- package/dist/types/components/DataTable/DataTable.d.ts +36 -1
- package/dist/types/components/DataTable/csv.d.ts +36 -0
- package/dist/types/components/DataTable/features.d.ts +6 -0
- package/dist/types/components/DataTable/index.d.ts +2 -0
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +15 -3
- package/dist/types/components/DateRangePicker/index.d.ts +1 -1
- package/dist/types/components/DateRangePicker/presets.d.ts +23 -0
- package/dist/types/components/Datepicker/Datepicker.d.ts +5 -1
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +6 -1
- package/dist/types/components/Datepicker/datetime.d.ts +27 -0
- package/dist/types/components/Descriptions/Descriptions.d.ts +30 -0
- package/dist/types/components/Descriptions/index.d.ts +2 -0
- package/dist/types/components/FilePreview/FilePreview.d.ts +35 -0
- package/dist/types/components/FilePreview/file-preview-format.d.ts +20 -0
- package/dist/types/components/FilePreview/index.d.ts +2 -0
- package/dist/types/components/FloatButton/FloatButton.d.ts +43 -0
- package/dist/types/components/FloatButton/FloatButtonGroup.d.ts +33 -0
- package/dist/types/components/FloatButton/float-button-context.d.ts +11 -0
- package/dist/types/components/FloatButton/float-button-glyphs.d.ts +3 -0
- package/dist/types/components/FloatButton/float-button-styles.d.ts +58 -0
- package/dist/types/components/FloatButton/index.d.ts +4 -0
- package/dist/types/components/InlineCompletion/InlineCompletion.d.ts +29 -0
- package/dist/types/components/InlineCompletion/index.d.ts +2 -0
- package/dist/types/components/JsonView/JsonView.d.ts +26 -0
- package/dist/types/components/JsonView/index.d.ts +2 -0
- package/dist/types/components/JsonView/json-view-utils.d.ts +22 -0
- package/dist/types/components/LocaleProvider/index.d.ts +1 -0
- package/dist/types/components/LocaleProvider/ja-jp.d.ts +13 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +44 -0
- package/dist/types/components/Masonry/Masonry.d.ts +34 -0
- package/dist/types/components/Masonry/index.d.ts +2 -0
- package/dist/types/components/Masonry/masonry-distribute.d.ts +16 -0
- package/dist/types/components/Select/Select.d.ts +13 -1
- package/dist/types/components/Select/SelectCore.d.ts +10 -1
- package/dist/types/components/Select/SelectFloating.d.ts +12 -1
- package/dist/types/components/Signature/Signature.d.ts +51 -0
- package/dist/types/components/Signature/index.d.ts +2 -0
- package/dist/types/components/Signature/signature-points.d.ts +31 -0
- package/dist/types/components/Sources/Sources.d.ts +37 -0
- package/dist/types/components/Sources/index.d.ts +2 -0
- package/dist/types/components/TagGroup/SortableTagGroup.d.ts +20 -0
- package/dist/types/components/TagGroup/TagGroup.d.ts +4 -13
- package/dist/types/components/TagGroup/index.d.ts +2 -0
- package/dist/types/components/TagGroup/tag-group-styles.d.ts +7 -0
- package/dist/types/components/TagInput/SortableTagInput.d.ts +34 -0
- package/dist/types/components/TagInput/SortableTagInputCore.d.ts +18 -0
- package/dist/types/components/TagInput/TagInput.d.ts +1 -8
- package/dist/types/components/TagInput/TagInputCore.d.ts +4 -10
- package/dist/types/components/TagInput/index.d.ts +4 -0
- package/dist/types/components/TagInput/tag-input-styles.d.ts +12 -0
- package/dist/types/components/Tree/Tree.d.ts +1 -1
- package/dist/types/components/Tree/TreeItem.d.ts +11 -1
- package/dist/types/components/Tree/types.d.ts +25 -0
- package/dist/types/components/Tree/utils.d.ts +41 -0
- package/dist/types/components/Upload/Upload.d.ts +10 -1
- package/dist/types/components/Upload/UploadCore.d.ts +21 -1
- package/dist/types/components/Upload/UploadList.d.ts +8 -2
- package/dist/types/headless/index.d.ts +221 -4
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useDarkMode.d.ts +40 -0
- package/dist/types/index.d.ts +28 -11
- package/dist/types/utils/sortable-handle.d.ts +25 -0
- package/dist/types/utils/sortable-shared.d.ts +12 -24
- package/dist/utils/sortable-handle.js +12 -0
- package/dist/utils/sortable-shared.js +8 -16
- package/dist/utils/sortable.js +2 -1
- package/dist/utils/submenu.js +7 -5
- package/package.json +65 -5
|
@@ -5,11 +5,11 @@ import { getDirection as t } from "../../utils/direction.js";
|
|
|
5
5
|
import { useStrings as n } from "../LocaleProvider/useStrings.js";
|
|
6
6
|
import { addMonths as r, buildMonthCells as i, formatDate as a, formatMonthValue as o, formatQuarterValue as s, formatYearValue as c, getDaysInMonth as l, getISOWeekNumber as u, parseCivilDate as d, parseMonthValue as f, parseQuarterValue as ee, parseYearValue as p } from "./date.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { useControl as
|
|
8
|
+
import { Fragment as te, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
+
import { useEffect as ne, useRef as g, useState as _ } from "react";
|
|
10
|
+
import { useControl as re } from "react-use-control";
|
|
11
11
|
//#region src/lib/components/Calendar/Calendar.tsx
|
|
12
|
-
var
|
|
12
|
+
var ie = "haze-Calendar__calendarWrapper", ae = "haze-Calendar__header", v = "haze-Calendar__headerBtn", y = "haze-Calendar__headerTitle", oe = "haze-Calendar__titleBtn", se = "haze-Calendar__headerTrailing", ce = "haze-Calendar__grid", b = "haze-Calendar__rowContents", x = "haze-Calendar__cellContents", le = "haze-Calendar__weekday", ue = "haze-Calendar__weekNumber", S = "haze-Calendar__dayBtn", C = "haze-Calendar__daySelected", de = "haze-Calendar__dayInRange", fe = "haze-Calendar__dayOutside", pe = "haze-Calendar__monthPanels", me = "haze-Calendar__monthPanel", he = "haze-Calendar__paneHeader", ge = "haze-Calendar__quickSelect", _e = "haze-Calendar__quickToolbar", w = "haze-Calendar__quickGrid", ve = "haze-Calendar__quarterGrid", ye = [
|
|
13
13
|
"Su",
|
|
14
14
|
"Mo",
|
|
15
15
|
"Tu",
|
|
@@ -18,7 +18,7 @@ var ne = "haze-Calendar__calendarWrapper", re = "haze-Calendar__header", y = "ha
|
|
|
18
18
|
"Fr",
|
|
19
19
|
"Sa"
|
|
20
20
|
];
|
|
21
|
-
function
|
|
21
|
+
function be(e, t) {
|
|
22
22
|
if (t !== void 0) return t;
|
|
23
23
|
if (e === void 0) return 0;
|
|
24
24
|
try {
|
|
@@ -28,27 +28,27 @@ function ve(e, t) {
|
|
|
28
28
|
return 0;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
if (e === void 0) return Array.from({ length: 7 }, (e, n) =>
|
|
31
|
+
function xe(e, t) {
|
|
32
|
+
if (e === void 0) return Array.from({ length: 7 }, (e, n) => ye[(t + n) % 7]);
|
|
33
33
|
let n = new Intl.DateTimeFormat(e, { weekday: "short" }), r = Array.from({ length: 7 }, (e, t) => n.format(new Date(2024, 0, 7 + t)));
|
|
34
34
|
return Array.from({ length: 7 }, (e, n) => r[(t + n) % 7]);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function T(e) {
|
|
37
37
|
return Array.from(e?.querySelectorAll("button") ?? []);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function E(e, t, n) {
|
|
40
40
|
let r = t + n;
|
|
41
41
|
for (; r >= 0 && r < e.length && e[r].disabled;) r += n;
|
|
42
42
|
return r < 0 || r >= e.length ? null : r;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Se(e, n, i, o) {
|
|
45
45
|
return (s) => {
|
|
46
46
|
let c = e.current;
|
|
47
47
|
if (!c) return;
|
|
48
|
-
let u =
|
|
48
|
+
let u = T(c);
|
|
49
49
|
if (u.length === 0) return;
|
|
50
50
|
let d = u.indexOf(s.target.closest("button")), f = t(c) === "rtl" ? "ArrowLeft" : "ArrowRight", ee = f === "ArrowLeft" ? "ArrowRight" : "ArrowLeft", p = (e) => {
|
|
51
|
-
let t =
|
|
51
|
+
let t = E(u, d < 0 ? 0 : d, e);
|
|
52
52
|
t !== null && (s.preventDefault(), u[t].focus());
|
|
53
53
|
};
|
|
54
54
|
switch (s.key) {
|
|
@@ -65,12 +65,12 @@ function be(e, n, i, o) {
|
|
|
65
65
|
p(-7);
|
|
66
66
|
return;
|
|
67
67
|
case "Home": {
|
|
68
|
-
let e =
|
|
68
|
+
let e = E(u, (d < 0 ? 0 : d - d % 7) - 1, 1);
|
|
69
69
|
e !== null && (s.preventDefault(), u[e].focus());
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
case "End": {
|
|
73
|
-
let e =
|
|
73
|
+
let e = E(u, (d < 0 ? 6 : d - d % 7 + 6) + 1, -1);
|
|
74
74
|
e !== null && (s.preventDefault(), u[e].focus());
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
@@ -84,14 +84,14 @@ function be(e, n, i, o) {
|
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function D(e, n, r, i) {
|
|
88
88
|
return (a) => {
|
|
89
89
|
let o = e.current;
|
|
90
90
|
if (!o) return;
|
|
91
|
-
let s =
|
|
91
|
+
let s = T(o);
|
|
92
92
|
if (s.length === 0) return;
|
|
93
93
|
let c = s.indexOf(a.target.closest("button")), l = t(o) === "rtl" ? "ArrowLeft" : "ArrowRight", u = l === "ArrowLeft" ? "ArrowRight" : "ArrowLeft", d = (e) => {
|
|
94
|
-
let t =
|
|
94
|
+
let t = E(s, c < 0 ? 0 : c, e);
|
|
95
95
|
t !== null && (a.preventDefault(), s[t].focus());
|
|
96
96
|
};
|
|
97
97
|
switch (a.key) {
|
|
@@ -108,12 +108,12 @@ function xe(e, n, r, i) {
|
|
|
108
108
|
d(-n);
|
|
109
109
|
return;
|
|
110
110
|
case "Home": {
|
|
111
|
-
let e =
|
|
111
|
+
let e = E(s, (c < 0 ? 0 : c - c % n) - 1, 1);
|
|
112
112
|
e !== null && (a.preventDefault(), s[e].focus());
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
case "End": {
|
|
116
|
-
let e =
|
|
116
|
+
let e = E(s, (c < 0 ? n - 1 : Math.min(c - c % n + n - 1, s.length - 1)) + 1, -1);
|
|
117
117
|
e !== null && (a.preventDefault(), s[e].focus());
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
@@ -124,105 +124,115 @@ function xe(e, n, r, i) {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function O({ picker: t = "date", value:
|
|
128
|
-
let [P,
|
|
127
|
+
function O({ picker: t = "date", value: ye, min: E, max: O, disabledDate: k, locale: A, weekStartsOn: Ce, showWeekNumbers: j = !1, months: we = 1, rangeStart: M, rangeEnd: N, onSelect: Te, className: Ee, ...De }) {
|
|
128
|
+
let [P, Oe] = re(ye, ""), F = n("calendar"), I = g(null), ke = g(null), L = g(null), R = g(null), z = g(null), B = g(null), V = g(null), Ae = g(null), H = g(null), [U, W] = _(!1), [G, K] = _(0), [q, je] = _(!1), Me = t === "month" ? f(P) : t === "quarter" ? ee(P) : t === "year" ? p(P) : null, Ne = t === "date" ? P && d(P) || M && d(M) || /* @__PURE__ */ new Date() : Me ? new Date(Me.year, 0, 1) : /* @__PURE__ */ new Date(), [J, Pe] = _(Ne.getFullYear()), [Y, Fe] = _(Ne.getMonth()), Ie = be(A, Ce), Le = xe(A, Ie), Re = new Intl.DateTimeFormat(A ?? "default", {
|
|
129
129
|
month: "long",
|
|
130
130
|
year: "numeric"
|
|
131
|
-
}),
|
|
132
|
-
|
|
131
|
+
}), ze = new Intl.DateTimeFormat(A ?? "default", { month: "short" }), Be = Array.from({ length: 12 }, (e, t) => ze.format(new Date(2026, t, 15))), X = (e) => {
|
|
132
|
+
Pe(e.year), Fe(e.month);
|
|
133
133
|
};
|
|
134
|
-
|
|
134
|
+
ne(() => {
|
|
135
135
|
if (U) return;
|
|
136
136
|
let e = R.current;
|
|
137
137
|
e && (R.current = null, L.current?.querySelector(`[data-haze-day="${e}"]`)?.focus());
|
|
138
138
|
}, [
|
|
139
|
-
|
|
139
|
+
J,
|
|
140
140
|
Y,
|
|
141
141
|
U
|
|
142
|
-
]),
|
|
142
|
+
]), ne(() => {
|
|
143
143
|
if (!U) return;
|
|
144
144
|
let e = z.current;
|
|
145
145
|
z.current = null;
|
|
146
|
-
let t =
|
|
146
|
+
let t = T(H.current);
|
|
147
147
|
t.length !== 0 && (t[e ?? 0] ?? t[0]).focus();
|
|
148
|
-
}, [
|
|
148
|
+
}, [
|
|
149
|
+
U,
|
|
150
|
+
G,
|
|
151
|
+
q
|
|
152
|
+
]), ne(() => {
|
|
149
153
|
if (t === "date") return;
|
|
150
154
|
let e = B.current;
|
|
151
155
|
if (B.current = null, e === null) return;
|
|
152
|
-
let n =
|
|
156
|
+
let n = T(V.current);
|
|
153
157
|
(n[e] ?? n[0])?.focus();
|
|
154
|
-
}, [t,
|
|
155
|
-
let
|
|
156
|
-
z.current = Y, K(
|
|
157
|
-
},
|
|
158
|
-
W(!1),
|
|
159
|
-
},
|
|
160
|
-
W(!1),
|
|
158
|
+
}, [t, J]);
|
|
159
|
+
let Ve = () => {
|
|
160
|
+
z.current = Y, K(J), je(!1), W(!0);
|
|
161
|
+
}, He = () => {
|
|
162
|
+
W(!1), Ae.current?.focus();
|
|
163
|
+
}, Ue = (e) => {
|
|
164
|
+
W(!1), X({
|
|
161
165
|
year: G,
|
|
162
166
|
month: e
|
|
163
167
|
}), R.current = a(G, e, 1);
|
|
164
|
-
},
|
|
165
|
-
|
|
168
|
+
}, Z = Math.floor(G / 10) * 10, We = () => {
|
|
169
|
+
z.current = G - Z, je(!0);
|
|
170
|
+
}, Ge = () => {
|
|
171
|
+
je(!1), z.current = Y;
|
|
172
|
+
}, Ke = (e) => {
|
|
173
|
+
K(e), Ge();
|
|
174
|
+
}, Q = r(J, Y, we - 1), qe = Se(I, {
|
|
175
|
+
year: J,
|
|
166
176
|
month: Y
|
|
167
|
-
},
|
|
177
|
+
}, X, R), Je = Se(ke, Q, X, R), Ye = D(H, 3, (e) => K((t) => t + e), z), Xe = D(H, 3, (e) => K((t) => t + e * 10), z), Ze = t === "quarter" ? 4 : 3, Qe = (e) => Pe((n) => n + e * (t === "year" ? 10 : 1)), $e = D(V, Ze, Qe, B), et = () => X(r(J, Y, -1)), tt = () => X(r(J, Y, 1)), nt = () => {
|
|
168
178
|
let e = /* @__PURE__ */ new Date();
|
|
169
|
-
|
|
170
|
-
},
|
|
179
|
+
Pe(e.getFullYear()), Fe(e.getMonth());
|
|
180
|
+
}, rt = (e, t, n) => {
|
|
171
181
|
let r = a(e, t, n);
|
|
172
|
-
return
|
|
173
|
-
},
|
|
182
|
+
return E && r < E || O && r > O ? !0 : k?.(new Date(e, t, n)) ?? !1;
|
|
183
|
+
}, it = (e, t) => E && a(e, t, l(e, t)) < E || O && a(e, t, 1) > O ? !0 : k?.(new Date(e, t, 1)) ?? !1, at = (e, t) => {
|
|
174
184
|
let n = t * 3 - 3, r = t * 3 - 1;
|
|
175
|
-
return
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
let o = i(t.year, t.month,
|
|
185
|
+
return E && a(e, r, l(e, r)) < E || O && a(e, n, 1) > O ? !0 : k?.(new Date(e, n, 1)) ?? !1;
|
|
186
|
+
}, ot = (e) => E && a(e, 11, 31) < E || O && a(e, 0, 1) > O ? !0 : k?.(new Date(e, 0, 1)) ?? !1, st = (e) => {
|
|
187
|
+
Oe(e), Te?.(e);
|
|
188
|
+
}, ct = M !== void 0 && M !== "", lt = N !== void 0 && N !== "", ut = (e) => ct && e === M || lt && e === N, dt = (e) => ct && lt && e > M && e < N, ft = Re.format(new Date(J, Y)), $ = (t, n, r) => {
|
|
189
|
+
let o = i(t.year, t.month, Ie), s = [];
|
|
180
190
|
for (let e = 0; e < o.length; e += 7) s.push(o.slice(e, e + 7));
|
|
181
|
-
let c =
|
|
191
|
+
let c = Re.format(new Date(t.year, t.month));
|
|
182
192
|
return /* @__PURE__ */ h("div", {
|
|
183
193
|
ref: n,
|
|
184
194
|
style: j ? { gridTemplateColumns: "repeat(8, 1fr)" } : void 0,
|
|
185
195
|
role: "grid",
|
|
186
196
|
"aria-label": c,
|
|
187
197
|
onKeyDown: r,
|
|
188
|
-
className: e([
|
|
198
|
+
className: e([ce]),
|
|
189
199
|
children: [/* @__PURE__ */ h("div", {
|
|
190
200
|
role: "row",
|
|
191
|
-
className: e([
|
|
201
|
+
className: e([b]),
|
|
192
202
|
children: [j && /* @__PURE__ */ m("span", {
|
|
193
203
|
role: "columnheader",
|
|
194
|
-
className: e([
|
|
204
|
+
className: e([le]),
|
|
195
205
|
children: F.weekNumber
|
|
196
|
-
}),
|
|
206
|
+
}), Le.map((t, n) => /* @__PURE__ */ m("span", {
|
|
197
207
|
role: "columnheader",
|
|
198
|
-
className: e([
|
|
208
|
+
className: e([le]),
|
|
199
209
|
children: t
|
|
200
210
|
}, n))]
|
|
201
211
|
}), s.map((t, n) => /* @__PURE__ */ h("div", {
|
|
202
212
|
role: "row",
|
|
203
|
-
className: e([
|
|
213
|
+
className: e([b]),
|
|
204
214
|
children: [j && /* @__PURE__ */ m("span", {
|
|
205
215
|
role: "gridcell",
|
|
206
|
-
className: e([
|
|
216
|
+
className: e([ue]),
|
|
207
217
|
children: u(t[0].year, t[0].month, t[0].day)
|
|
208
218
|
}), t.map((t) => {
|
|
209
|
-
let n = a(t.year, t.month, t.day), r =
|
|
219
|
+
let n = a(t.year, t.month, t.day), r = ut(n), i = n === P || r;
|
|
210
220
|
return /* @__PURE__ */ m("span", {
|
|
211
221
|
role: "gridcell",
|
|
212
|
-
"aria-selected": i ||
|
|
213
|
-
className: e([
|
|
222
|
+
"aria-selected": i || dt(n),
|
|
223
|
+
className: e([x]),
|
|
214
224
|
children: /* @__PURE__ */ m("button", {
|
|
215
225
|
type: "button",
|
|
216
226
|
"data-haze-day": n,
|
|
217
|
-
disabled:
|
|
227
|
+
disabled: rt(t.year, t.month, t.day),
|
|
218
228
|
onClick: () => {
|
|
219
|
-
|
|
229
|
+
Oe(n), Te?.(n);
|
|
220
230
|
},
|
|
221
231
|
className: e([
|
|
222
|
-
|
|
223
|
-
i &&
|
|
224
|
-
!i &&
|
|
225
|
-
t.outside &&
|
|
232
|
+
S,
|
|
233
|
+
i && C,
|
|
234
|
+
!i && dt(n) && de,
|
|
235
|
+
t.outside && fe
|
|
226
236
|
]),
|
|
227
237
|
children: t.day
|
|
228
238
|
})
|
|
@@ -230,37 +240,98 @@ function O({ picker: t = "date", value: _e, min: D, max: O, disabledDate: k, loc
|
|
|
230
240
|
})]
|
|
231
241
|
}, n))]
|
|
232
242
|
});
|
|
233
|
-
},
|
|
234
|
-
onKeyDown:
|
|
235
|
-
className: e([
|
|
236
|
-
children: [/* @__PURE__ */
|
|
237
|
-
className: e([
|
|
238
|
-
children: [
|
|
243
|
+
}, pt = /* @__PURE__ */ h("div", {
|
|
244
|
+
onKeyDown: mt,
|
|
245
|
+
className: e([ge]),
|
|
246
|
+
children: [/* @__PURE__ */ m("div", {
|
|
247
|
+
className: e([_e]),
|
|
248
|
+
children: q ? /* @__PURE__ */ h(te, { children: [
|
|
249
|
+
/* @__PURE__ */ m("button", {
|
|
250
|
+
type: "button",
|
|
251
|
+
onClick: () => K((e) => e - 10),
|
|
252
|
+
"aria-label": F.previousDecade,
|
|
253
|
+
className: e([v]),
|
|
254
|
+
children: "‹"
|
|
255
|
+
}),
|
|
256
|
+
/* @__PURE__ */ h("span", {
|
|
257
|
+
className: e([y]),
|
|
258
|
+
children: [
|
|
259
|
+
Z,
|
|
260
|
+
" – ",
|
|
261
|
+
Z + 11
|
|
262
|
+
]
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ m("button", {
|
|
265
|
+
type: "button",
|
|
266
|
+
onClick: () => K((e) => e + 10),
|
|
267
|
+
"aria-label": F.nextDecade,
|
|
268
|
+
className: e([v]),
|
|
269
|
+
children: "›"
|
|
270
|
+
})
|
|
271
|
+
] }) : /* @__PURE__ */ h(te, { children: [
|
|
239
272
|
/* @__PURE__ */ m("button", {
|
|
240
273
|
type: "button",
|
|
241
274
|
onClick: () => K((e) => e - 1),
|
|
242
275
|
"aria-label": F.previousYear,
|
|
243
|
-
className: e([
|
|
276
|
+
className: e([v]),
|
|
244
277
|
children: "‹"
|
|
245
278
|
}),
|
|
246
|
-
/* @__PURE__ */ m("
|
|
247
|
-
|
|
279
|
+
/* @__PURE__ */ m("button", {
|
|
280
|
+
type: "button",
|
|
281
|
+
"aria-haspopup": "grid",
|
|
282
|
+
onClick: We,
|
|
283
|
+
className: e([oe, y]),
|
|
248
284
|
children: G
|
|
249
285
|
}),
|
|
250
286
|
/* @__PURE__ */ m("button", {
|
|
251
287
|
type: "button",
|
|
252
288
|
onClick: () => K((e) => e + 1),
|
|
253
289
|
"aria-label": F.nextYear,
|
|
254
|
-
className: e([
|
|
290
|
+
className: e([v]),
|
|
255
291
|
children: "›"
|
|
256
292
|
})
|
|
257
|
-
]
|
|
258
|
-
}), /* @__PURE__ */ m("div", {
|
|
293
|
+
] })
|
|
294
|
+
}), q ? /* @__PURE__ */ m("div", {
|
|
295
|
+
ref: H,
|
|
296
|
+
role: "grid",
|
|
297
|
+
"aria-label": F.selectYear,
|
|
298
|
+
onKeyDown: Xe,
|
|
299
|
+
className: e([w]),
|
|
300
|
+
children: [
|
|
301
|
+
0,
|
|
302
|
+
1,
|
|
303
|
+
2,
|
|
304
|
+
3
|
|
305
|
+
].map((t) => /* @__PURE__ */ m("div", {
|
|
306
|
+
role: "row",
|
|
307
|
+
className: e([b]),
|
|
308
|
+
children: [
|
|
309
|
+
0,
|
|
310
|
+
1,
|
|
311
|
+
2
|
|
312
|
+
].map((n) => {
|
|
313
|
+
let r = Z + t * 3 + n, i = r === J;
|
|
314
|
+
return /* @__PURE__ */ m("span", {
|
|
315
|
+
role: "gridcell",
|
|
316
|
+
"aria-selected": i,
|
|
317
|
+
className: e([x]),
|
|
318
|
+
children: /* @__PURE__ */ m("button", {
|
|
319
|
+
type: "button",
|
|
320
|
+
"data-haze-year": r,
|
|
321
|
+
disabled: ot(r),
|
|
322
|
+
onClick: () => Ke(r),
|
|
323
|
+
className: e([S, i && C]),
|
|
324
|
+
children: r
|
|
325
|
+
})
|
|
326
|
+
}, r);
|
|
327
|
+
})
|
|
328
|
+
}, t))
|
|
329
|
+
}) : /* @__PURE__ */ m("div", {
|
|
259
330
|
ref: H,
|
|
260
331
|
role: "grid",
|
|
261
332
|
"aria-label": F.selectMonth,
|
|
262
|
-
onKeyDown:
|
|
263
|
-
className: e([
|
|
333
|
+
onKeyDown: Ye,
|
|
334
|
+
className: e([w]),
|
|
264
335
|
children: [
|
|
265
336
|
0,
|
|
266
337
|
1,
|
|
@@ -268,39 +339,39 @@ function O({ picker: t = "date", value: _e, min: D, max: O, disabledDate: k, loc
|
|
|
268
339
|
3
|
|
269
340
|
].map((t) => /* @__PURE__ */ m("div", {
|
|
270
341
|
role: "row",
|
|
271
|
-
className: e([
|
|
342
|
+
className: e([b]),
|
|
272
343
|
children: [
|
|
273
344
|
0,
|
|
274
345
|
1,
|
|
275
346
|
2
|
|
276
347
|
].map((n) => {
|
|
277
|
-
let r = t * 3 + n, i = G ===
|
|
348
|
+
let r = t * 3 + n, i = G === J && r === Y;
|
|
278
349
|
return /* @__PURE__ */ m("span", {
|
|
279
350
|
role: "gridcell",
|
|
280
351
|
"aria-selected": i,
|
|
281
|
-
className: e([
|
|
352
|
+
className: e([x]),
|
|
282
353
|
children: /* @__PURE__ */ m("button", {
|
|
283
354
|
type: "button",
|
|
284
355
|
"data-haze-month": r,
|
|
285
|
-
onClick: () =>
|
|
286
|
-
className: e([
|
|
287
|
-
children:
|
|
356
|
+
onClick: () => Ue(r),
|
|
357
|
+
className: e([S, i && C]),
|
|
358
|
+
children: Be[r]
|
|
288
359
|
})
|
|
289
360
|
}, r);
|
|
290
361
|
})
|
|
291
362
|
}, t))
|
|
292
363
|
})]
|
|
293
364
|
});
|
|
294
|
-
function
|
|
295
|
-
e.key === "Escape" && (e.preventDefault(),
|
|
365
|
+
function mt(e) {
|
|
366
|
+
e.key === "Escape" && (e.preventDefault(), q ? Ge() : He());
|
|
296
367
|
}
|
|
297
368
|
if (t !== "date") {
|
|
298
|
-
let n = Math.floor(
|
|
369
|
+
let n = Math.floor(J / 10) * 10, r = t === "year" ? F.previousDecade : F.previousYear, i = t === "year" ? F.nextDecade : F.nextYear, a = t === "year" ? `${n} – ${n + 11}` : String(J), l = t === "month" ? /* @__PURE__ */ m("div", {
|
|
299
370
|
ref: V,
|
|
300
371
|
role: "grid",
|
|
301
372
|
"aria-label": F.selectMonth,
|
|
302
|
-
onKeyDown:
|
|
303
|
-
className: e([
|
|
373
|
+
onKeyDown: $e,
|
|
374
|
+
className: e([w]),
|
|
304
375
|
children: [
|
|
305
376
|
0,
|
|
306
377
|
1,
|
|
@@ -308,24 +379,24 @@ function O({ picker: t = "date", value: _e, min: D, max: O, disabledDate: k, loc
|
|
|
308
379
|
3
|
|
309
380
|
].map((t) => /* @__PURE__ */ m("div", {
|
|
310
381
|
role: "row",
|
|
311
|
-
className: e([
|
|
382
|
+
className: e([b]),
|
|
312
383
|
children: [
|
|
313
384
|
0,
|
|
314
385
|
1,
|
|
315
386
|
2
|
|
316
387
|
].map((n) => {
|
|
317
|
-
let r = t * 3 + n, i = P === o(
|
|
388
|
+
let r = t * 3 + n, i = P === o(J, r);
|
|
318
389
|
return /* @__PURE__ */ m("span", {
|
|
319
390
|
role: "gridcell",
|
|
320
391
|
"aria-selected": i,
|
|
321
|
-
className: e([
|
|
392
|
+
className: e([x]),
|
|
322
393
|
children: /* @__PURE__ */ m("button", {
|
|
323
394
|
type: "button",
|
|
324
395
|
"data-haze-month": r,
|
|
325
|
-
disabled:
|
|
326
|
-
onClick: () =>
|
|
327
|
-
className: e([
|
|
328
|
-
children:
|
|
396
|
+
disabled: it(J, r),
|
|
397
|
+
onClick: () => st(o(J, r)),
|
|
398
|
+
className: e([S, i && C]),
|
|
399
|
+
children: Be[r]
|
|
329
400
|
})
|
|
330
401
|
}, r);
|
|
331
402
|
})
|
|
@@ -334,28 +405,28 @@ function O({ picker: t = "date", value: _e, min: D, max: O, disabledDate: k, loc
|
|
|
334
405
|
ref: V,
|
|
335
406
|
role: "grid",
|
|
336
407
|
"aria-label": F.selectQuarter,
|
|
337
|
-
onKeyDown:
|
|
338
|
-
className: e([
|
|
408
|
+
onKeyDown: $e,
|
|
409
|
+
className: e([ve]),
|
|
339
410
|
children: m("div", {
|
|
340
411
|
role: "row",
|
|
341
|
-
className: e([
|
|
412
|
+
className: e([b]),
|
|
342
413
|
children: [
|
|
343
414
|
1,
|
|
344
415
|
2,
|
|
345
416
|
3,
|
|
346
417
|
4
|
|
347
418
|
].map((t) => {
|
|
348
|
-
let n = P === s(
|
|
419
|
+
let n = P === s(J, t);
|
|
349
420
|
return /* @__PURE__ */ m("span", {
|
|
350
421
|
role: "gridcell",
|
|
351
422
|
"aria-selected": n,
|
|
352
|
-
className: e([
|
|
423
|
+
className: e([x]),
|
|
353
424
|
children: /* @__PURE__ */ h("button", {
|
|
354
425
|
type: "button",
|
|
355
426
|
"data-haze-quarter": t,
|
|
356
|
-
disabled:
|
|
357
|
-
onClick: () =>
|
|
358
|
-
className: e([
|
|
427
|
+
disabled: at(J, t),
|
|
428
|
+
onClick: () => st(s(J, t)),
|
|
429
|
+
className: e([S, n && C]),
|
|
359
430
|
children: ["Q", t]
|
|
360
431
|
})
|
|
361
432
|
}, t);
|
|
@@ -365,8 +436,8 @@ function O({ picker: t = "date", value: _e, min: D, max: O, disabledDate: k, loc
|
|
|
365
436
|
ref: V,
|
|
366
437
|
role: "grid",
|
|
367
438
|
"aria-label": F.selectYear,
|
|
368
|
-
onKeyDown:
|
|
369
|
-
className: e([
|
|
439
|
+
onKeyDown: $e,
|
|
440
|
+
className: e([w]),
|
|
370
441
|
children: [
|
|
371
442
|
0,
|
|
372
443
|
1,
|
|
@@ -374,7 +445,7 @@ function O({ picker: t = "date", value: _e, min: D, max: O, disabledDate: k, loc
|
|
|
374
445
|
3
|
|
375
446
|
].map((t) => /* @__PURE__ */ m("div", {
|
|
376
447
|
role: "row",
|
|
377
|
-
className: e([
|
|
448
|
+
className: e([b]),
|
|
378
449
|
children: [
|
|
379
450
|
0,
|
|
380
451
|
1,
|
|
@@ -384,13 +455,13 @@ function O({ picker: t = "date", value: _e, min: D, max: O, disabledDate: k, loc
|
|
|
384
455
|
return /* @__PURE__ */ m("span", {
|
|
385
456
|
role: "gridcell",
|
|
386
457
|
"aria-selected": a,
|
|
387
|
-
className: e([
|
|
458
|
+
className: e([x]),
|
|
388
459
|
children: /* @__PURE__ */ m("button", {
|
|
389
460
|
type: "button",
|
|
390
461
|
"data-haze-year": i,
|
|
391
|
-
disabled:
|
|
392
|
-
onClick: () =>
|
|
393
|
-
className: e([
|
|
462
|
+
disabled: ot(i),
|
|
463
|
+
onClick: () => st(c(i)),
|
|
464
|
+
className: e([S, a && C]),
|
|
394
465
|
children: i
|
|
395
466
|
})
|
|
396
467
|
}, i);
|
|
@@ -399,34 +470,34 @@ function O({ picker: t = "date", value: _e, min: D, max: O, disabledDate: k, loc
|
|
|
399
470
|
});
|
|
400
471
|
return /* @__PURE__ */ h("div", {
|
|
401
472
|
ref: L,
|
|
402
|
-
...
|
|
403
|
-
className: e([
|
|
473
|
+
...De,
|
|
474
|
+
className: e([ie, Ee]),
|
|
404
475
|
children: [/* @__PURE__ */ h("div", {
|
|
405
|
-
className: e([
|
|
476
|
+
className: e([ae]),
|
|
406
477
|
children: [
|
|
407
478
|
/* @__PURE__ */ m("button", {
|
|
408
479
|
type: "button",
|
|
409
|
-
onClick: () =>
|
|
480
|
+
onClick: () => Qe(-1),
|
|
410
481
|
"aria-label": r,
|
|
411
|
-
className: e([
|
|
482
|
+
className: e([v]),
|
|
412
483
|
children: "‹"
|
|
413
484
|
}),
|
|
414
485
|
/* @__PURE__ */ m("span", {
|
|
415
|
-
className: e([
|
|
486
|
+
className: e([y]),
|
|
416
487
|
children: a
|
|
417
488
|
}),
|
|
418
489
|
/* @__PURE__ */ h("span", {
|
|
419
|
-
className: e([
|
|
490
|
+
className: e([se]),
|
|
420
491
|
children: [/* @__PURE__ */ m("button", {
|
|
421
492
|
type: "button",
|
|
422
|
-
onClick:
|
|
423
|
-
className: e([
|
|
493
|
+
onClick: nt,
|
|
494
|
+
className: e([v]),
|
|
424
495
|
children: F.today
|
|
425
496
|
}), /* @__PURE__ */ m("button", {
|
|
426
497
|
type: "button",
|
|
427
|
-
onClick: () =>
|
|
498
|
+
onClick: () => Qe(1),
|
|
428
499
|
"aria-label": i,
|
|
429
|
-
className: e([
|
|
500
|
+
className: e([v]),
|
|
430
501
|
children: "›"
|
|
431
502
|
})]
|
|
432
503
|
})
|
|
@@ -436,64 +507,64 @@ function O({ picker: t = "date", value: _e, min: D, max: O, disabledDate: k, loc
|
|
|
436
507
|
}
|
|
437
508
|
return /* @__PURE__ */ h("div", {
|
|
438
509
|
ref: L,
|
|
439
|
-
...
|
|
440
|
-
className: e([
|
|
510
|
+
...De,
|
|
511
|
+
className: e([ie, Ee]),
|
|
441
512
|
children: [/* @__PURE__ */ h("div", {
|
|
442
|
-
className: e([
|
|
513
|
+
className: e([ae]),
|
|
443
514
|
children: [
|
|
444
515
|
/* @__PURE__ */ m("button", {
|
|
445
516
|
type: "button",
|
|
446
|
-
onClick:
|
|
517
|
+
onClick: et,
|
|
447
518
|
"aria-label": F.previousMonth,
|
|
448
|
-
className: e([
|
|
519
|
+
className: e([v]),
|
|
449
520
|
children: "‹"
|
|
450
521
|
}),
|
|
451
522
|
/* @__PURE__ */ m("button", {
|
|
452
|
-
ref:
|
|
523
|
+
ref: Ae,
|
|
453
524
|
type: "button",
|
|
454
525
|
"aria-expanded": U,
|
|
455
|
-
onClick: U ?
|
|
456
|
-
className: e([
|
|
457
|
-
children:
|
|
526
|
+
onClick: U ? He : Ve,
|
|
527
|
+
className: e([oe, y]),
|
|
528
|
+
children: ft
|
|
458
529
|
}),
|
|
459
530
|
/* @__PURE__ */ h("span", {
|
|
460
|
-
className: e([
|
|
531
|
+
className: e([se]),
|
|
461
532
|
children: [/* @__PURE__ */ m("button", {
|
|
462
533
|
type: "button",
|
|
463
|
-
onClick:
|
|
464
|
-
className: e([
|
|
534
|
+
onClick: nt,
|
|
535
|
+
className: e([v]),
|
|
465
536
|
children: F.today
|
|
466
537
|
}), /* @__PURE__ */ m("button", {
|
|
467
538
|
type: "button",
|
|
468
|
-
onClick:
|
|
539
|
+
onClick: tt,
|
|
469
540
|
"aria-label": F.nextMonth,
|
|
470
|
-
className: e([
|
|
541
|
+
className: e([v]),
|
|
471
542
|
children: "›"
|
|
472
543
|
})]
|
|
473
544
|
})
|
|
474
545
|
]
|
|
475
|
-
}), U ?
|
|
476
|
-
className: e([
|
|
546
|
+
}), U ? pt : we === 2 ? /* @__PURE__ */ h("div", {
|
|
547
|
+
className: e([pe]),
|
|
477
548
|
children: [/* @__PURE__ */ m("div", {
|
|
478
|
-
className: e([
|
|
479
|
-
children:
|
|
480
|
-
year:
|
|
549
|
+
className: e([me]),
|
|
550
|
+
children: $({
|
|
551
|
+
year: J,
|
|
481
552
|
month: Y
|
|
482
|
-
}, I,
|
|
553
|
+
}, I, qe)
|
|
483
554
|
}), /* @__PURE__ */ h("div", {
|
|
484
|
-
className: e([
|
|
555
|
+
className: e([me]),
|
|
485
556
|
children: [/* @__PURE__ */ m("div", {
|
|
486
|
-
className: e([
|
|
557
|
+
className: e([he]),
|
|
487
558
|
children: /* @__PURE__ */ m("span", {
|
|
488
|
-
className: e([
|
|
489
|
-
children:
|
|
559
|
+
className: e([y]),
|
|
560
|
+
children: Re.format(new Date(Q.year, Q.month))
|
|
490
561
|
})
|
|
491
|
-
}),
|
|
562
|
+
}), $(Q, ke, Je)]
|
|
492
563
|
})]
|
|
493
|
-
}) :
|
|
494
|
-
year:
|
|
564
|
+
}) : $({
|
|
565
|
+
year: J,
|
|
495
566
|
month: Y
|
|
496
|
-
}, I,
|
|
567
|
+
}, I, qe)]
|
|
497
568
|
});
|
|
498
569
|
}
|
|
499
570
|
//#endregion
|