@aiquants/period-slider 0.7.0 → 0.9.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/README.md +137 -25
- package/dist/MonthSelector.d.ts.map +1 -1
- package/dist/PeriodSlider.d.ts +144 -16
- package/dist/PeriodSlider.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1743 -1431
- package/dist/styles/period-slider.css +1 -1
- package/dist/styles/period-slider.standalone.css +1 -1
- package/dist/usePeriodSlider.d.ts +96 -10
- package/dist/usePeriodSlider.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/DateSelector.tsx +1 -1
- package/src/MonthSelector.tsx +4 -1
- package/src/PeriodSlider.tsx +751 -218
- package/src/index.ts +14 -3
- package/src/styles/period-slider.css +25 -0
- package/src/usePeriodSlider.ts +510 -45
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { addYears as
|
|
3
|
-
import { memo as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as T, jsxs as pe, Fragment as Mn } from "react/jsx-runtime";
|
|
2
|
+
import { addYears as na, addMonths as oa, addDays as zr, format as ir, getDaysInMonth as no, parseISO as oo } from "date-fns";
|
|
3
|
+
import { memo as Lr, useId as aa, useRef as Z, useMemo as v, useCallback as F, useState as Le, useEffect as Nt } from "react";
|
|
4
|
+
const ia = {
|
|
5
5
|
"blue-rose": {
|
|
6
6
|
macro: "#0284c7",
|
|
7
7
|
macroLight: "#38bdf8",
|
|
@@ -44,124 +44,132 @@ const Na = {
|
|
|
44
44
|
microLight: "#71717a",
|
|
45
45
|
accent: "#27272a"
|
|
46
46
|
}
|
|
47
|
-
},
|
|
48
|
-
if (!
|
|
47
|
+
}, lt = (e) => e instanceof Date && !Number.isNaN(e.getTime()), xe = (e) => e instanceof Date ? Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString() : String(e), tt = (e, t) => {
|
|
48
|
+
if (!lt(t)) throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${xe(t)})`);
|
|
49
49
|
const r = new Date(t.getTime());
|
|
50
50
|
return e === "year" ? (r.setMonth(0, 1), r.setHours(0, 0, 0, 0)) : (e === "month" && r.setDate(1), r.setHours(0, 0, 0, 0)), r;
|
|
51
|
-
},
|
|
52
|
-
const r =
|
|
51
|
+
}, ge = (e, t) => {
|
|
52
|
+
const r = tt(e, t), n = r.getFullYear(), o = r.getMonth() + 1, s = r.getDate();
|
|
53
53
|
if (e === "year") return n;
|
|
54
|
-
if (e === "month") return n * 12 + (
|
|
54
|
+
if (e === "month") return n * 12 + (o - 1);
|
|
55
55
|
const i = /* @__PURE__ */ new Date(0);
|
|
56
|
-
return i.setUTCFullYear(n,
|
|
57
|
-
},
|
|
56
|
+
return i.setUTCFullYear(n, o - 1, s), i.setUTCHours(0, 0, 0, 0), Math.floor(i.getTime() / (1440 * 60 * 1e3));
|
|
57
|
+
}, ce = (e, t) => {
|
|
58
58
|
const r = /* @__PURE__ */ new Date(0);
|
|
59
59
|
if (r.setHours(0, 0, 0, 0), e === "year")
|
|
60
60
|
return r.setFullYear(t, 0, 1), r;
|
|
61
61
|
if (e === "month") {
|
|
62
|
-
const
|
|
63
|
-
return r.setFullYear(
|
|
62
|
+
const o = Math.floor(t / 12), s = t - o * 12;
|
|
63
|
+
return r.setFullYear(o, s, 1), r;
|
|
64
64
|
}
|
|
65
65
|
const n = new Date(t * 24 * 60 * 60 * 1e3);
|
|
66
66
|
return r.setFullYear(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()), r;
|
|
67
|
-
},
|
|
68
|
-
if (!
|
|
69
|
-
return e === "year" ?
|
|
70
|
-
},
|
|
71
|
-
if (!
|
|
67
|
+
}, Oe = (e, t, r) => {
|
|
68
|
+
if (!lt(t)) throw new RangeError(`addUnit: d must be a valid Date (received: ${xe(t)})`);
|
|
69
|
+
return e === "year" ? na(t, r) : e === "month" ? oa(t, r) : zr(t, r);
|
|
70
|
+
}, la = (e, t, r) => {
|
|
71
|
+
if (!lt(r)) throw new RangeError(`getMacroWindowStartDate: d must be a valid Date (received: ${xe(r)})`);
|
|
72
|
+
return tt(t, tt(e, r));
|
|
73
|
+
}, sa = (e, t, r) => {
|
|
74
|
+
if (!lt(r)) throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${xe(r)})`);
|
|
72
75
|
if (e === t)
|
|
73
|
-
return
|
|
74
|
-
const n = r.getFullYear(),
|
|
76
|
+
return tt(t, r);
|
|
77
|
+
const n = r.getFullYear(), o = r.getMonth();
|
|
75
78
|
if (e === "year") {
|
|
76
79
|
if (t === "month")
|
|
77
80
|
return new Date(n, 11, 1);
|
|
78
81
|
if (t === "day")
|
|
79
82
|
return new Date(n, 11, 31);
|
|
80
83
|
}
|
|
81
|
-
return e === "month" && t === "day" ? new Date(n,
|
|
82
|
-
},
|
|
84
|
+
return e === "month" && t === "day" ? new Date(n, o + 1, 0) : tt(t, r);
|
|
85
|
+
}, ao = (e, t, r) => e < t ? t : e > r ? r : e, yt = (e, t, r, n, o) => {
|
|
86
|
+
if (Rr("macroRange", r, "resolveMacroWindow"), !lt(n)) throw new RangeError(`resolveMacroWindow: minDate must be a valid Date (received: ${xe(n)})`);
|
|
87
|
+
if (!lt(o)) throw new RangeError(`resolveMacroWindow: maxDate must be a valid Date (received: ${xe(o)})`);
|
|
88
|
+
if (o.getTime() < n.getTime()) throw new RangeError(`resolveMacroWindow: maxDate must not precede minDate (minDate: ${xe(n)}, maxDate: ${xe(o)})`);
|
|
89
|
+
return [tt(t, ao(la(e, t, r[0]), n, o)), tt(t, ao(sa(e, t, r[1]), n, o))];
|
|
90
|
+
}, ca = {
|
|
83
91
|
year: { year: "numeric" },
|
|
84
92
|
month: { year: "numeric", month: "2-digit" },
|
|
85
93
|
day: { year: "numeric", month: "2-digit", day: "2-digit" }
|
|
86
|
-
},
|
|
87
|
-
const r = `${e}\0${t}`, n =
|
|
94
|
+
}, io = /* @__PURE__ */ new Map(), ua = (e, t) => {
|
|
95
|
+
const r = `${e}\0${t}`, n = io.get(r);
|
|
88
96
|
if (n !== void 0) return n;
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
},
|
|
97
|
+
const o = new Intl.DateTimeFormat(t, ca[e]);
|
|
98
|
+
return io.set(r, o), o;
|
|
99
|
+
}, da = (e, t) => {
|
|
92
100
|
const r = String(t.getFullYear()).padStart(4, "0");
|
|
93
101
|
if (e === "year") return r;
|
|
94
102
|
const n = String(t.getMonth() + 1).padStart(2, "0");
|
|
95
103
|
if (e === "month") return `${r}-${n}`;
|
|
96
|
-
const
|
|
97
|
-
return `${r}-${n}-${
|
|
98
|
-
},
|
|
104
|
+
const o = String(t.getDate()).padStart(2, "0");
|
|
105
|
+
return `${r}-${n}-${o}`;
|
|
106
|
+
}, et = (e, t, r, n) => lt(t) ? r ? r(t) : n === void 0 ? da(e, t) : ua(e, n).format(t) : "", nr = (e, t, r, n) => et(e, t, r, n), Me = (e, t, r) => {
|
|
99
107
|
if (!e || e.length === 0 || e.length === 1) return 0;
|
|
100
|
-
const n =
|
|
101
|
-
let
|
|
102
|
-
if (n <=
|
|
103
|
-
if (n >=
|
|
104
|
-
for (;
|
|
105
|
-
const h =
|
|
108
|
+
const n = ge(r, t);
|
|
109
|
+
let o = 0, s = e.length - 1;
|
|
110
|
+
if (n <= ge(r, e[o])) return 0;
|
|
111
|
+
if (n >= ge(r, e[s])) return s;
|
|
112
|
+
for (; o <= s; ) {
|
|
113
|
+
const h = o + s >> 1, m = ge(r, e[h]);
|
|
106
114
|
if (m === n) return h;
|
|
107
|
-
m < n ?
|
|
115
|
+
m < n ? o = h + 1 : s = h - 1;
|
|
108
116
|
}
|
|
109
|
-
const i = Math.abs(
|
|
110
|
-
return i < c ?
|
|
111
|
-
},
|
|
117
|
+
const i = Math.abs(ge(r, e[o]) - n), c = Math.abs(ge(r, e[s]) - n);
|
|
118
|
+
return i < c ? o : s;
|
|
119
|
+
}, kt = (e, t, r, n) => {
|
|
112
120
|
if (!Array.isArray(e) || e.length === 0) return [];
|
|
113
|
-
const
|
|
121
|
+
const o = ge(t, r), s = ge(t, n), i = /* @__PURE__ */ new Map();
|
|
114
122
|
for (const c of e) {
|
|
115
|
-
const h =
|
|
116
|
-
m <
|
|
123
|
+
const h = tt(t, c), m = ge(t, h);
|
|
124
|
+
m < o || m > s || i.has(m) || i.set(m, h);
|
|
117
125
|
}
|
|
118
126
|
if (i.size === 0)
|
|
119
|
-
throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${
|
|
127
|
+
throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${xe(r)}, maxDate: ${xe(n)}, entries: ${e.length})`);
|
|
120
128
|
return Array.from(i.keys()).sort((c, h) => c - h).map((c) => i.get(c));
|
|
121
|
-
},
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
const
|
|
129
|
+
}, Fr = (e, t, r, n) => {
|
|
130
|
+
const o = e.length - 1;
|
|
131
|
+
if (o <= 0) return 0;
|
|
132
|
+
const s = Me(e, n, t);
|
|
125
133
|
if (r === "time") {
|
|
126
|
-
const i = e[0].getTime(), c = e[
|
|
127
|
-
return c <= 0 ? 0 : Math.max(0, Math.min(1, (e[
|
|
134
|
+
const i = e[0].getTime(), c = e[o].getTime() - i;
|
|
135
|
+
return c <= 0 ? 0 : Math.max(0, Math.min(1, (e[s].getTime() - i) / c));
|
|
128
136
|
}
|
|
129
|
-
return
|
|
130
|
-
},
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
137
|
+
return s / o;
|
|
138
|
+
}, Ur = (e, t, r, n) => {
|
|
139
|
+
const o = e.length - 1;
|
|
140
|
+
if (o <= 0) return 0;
|
|
141
|
+
const s = Math.max(0, Math.min(1, n));
|
|
134
142
|
if (r === "time") {
|
|
135
|
-
const i = e[0].getTime(), c = e[
|
|
136
|
-
return c <= 0 ? 0 :
|
|
143
|
+
const i = e[0].getTime(), c = e[o].getTime() - i;
|
|
144
|
+
return c <= 0 ? 0 : Me(e, new Date(i + s * c), t);
|
|
137
145
|
}
|
|
138
|
-
return Math.max(0, Math.min(
|
|
139
|
-
},
|
|
146
|
+
return Math.max(0, Math.min(o, Math.round(s * o)));
|
|
147
|
+
}, lo = (e, t, r, n, o, s, i) => {
|
|
140
148
|
let c = r, h = n;
|
|
141
|
-
return i ? (c = t, h = t) : e === "low" ? t > n ? (c = n, h = t) : c = t : t < r ? (h = r, c = t) : h = t, [Math.max(
|
|
142
|
-
},
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
149
|
+
return i ? (c = t, h = t) : e === "low" ? t > n ? (c = n, h = t) : c = t : t < r ? (h = r, c = t) : h = t, [Math.max(o, Math.min(s, c)), Math.max(o, Math.min(s, h))];
|
|
150
|
+
}, ma = (e, t, r, n, o) => o ? "low" : e === "low" ? t > n ? "high" : "low" : t < r ? "low" : "high", fa = ({ posDiffPct: e, startLowVal: t, startHighVal: r, rangeMin: n, rangeMax: o, isDiscrete: s, sortedAllowedDates: i, snapMode: c, unit: h }) => {
|
|
151
|
+
if (s) {
|
|
152
|
+
const re = i.length - 1;
|
|
153
|
+
if (re <= 0) return [0, 0];
|
|
154
|
+
const ae = Math.max(0, Math.min(re, Math.round(t))), $ = Math.max(ae, Math.min(re, Math.round(r)));
|
|
147
155
|
if (c === "time") {
|
|
148
|
-
const
|
|
149
|
-
let
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
return [
|
|
156
|
+
const V = i[0].getTime(), z = i[re].getTime(), ne = i[ae].getTime(), j = i[$].getTime() - ne;
|
|
157
|
+
let W = ne + e * (z - V), p = W + j;
|
|
158
|
+
W < V && (W = V, p = V + j), p > z && (p = z, W = z - j);
|
|
159
|
+
const M = Me(i, new Date(W), h), x = Me(i, new Date(p), h);
|
|
160
|
+
return [M, Math.max(M, x)];
|
|
153
161
|
}
|
|
154
|
-
const
|
|
155
|
-
let
|
|
156
|
-
return
|
|
162
|
+
const de = Math.round(e * re);
|
|
163
|
+
let ie = ae + de, P = $ + de;
|
|
164
|
+
return ie < 0 && (P += -ie, ie = 0), P > re && (ie -= P - re, P = re), [Math.max(0, Math.min(re, ie)), Math.max(0, Math.min(re, P))];
|
|
157
165
|
}
|
|
158
|
-
const m = (
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
let
|
|
162
|
-
return
|
|
163
|
-
},
|
|
164
|
-
let h = 0, m = !1,
|
|
166
|
+
const m = (re) => Math.max(n, Math.min(o, re)), R = o - n;
|
|
167
|
+
if (R <= 0) return [m(t), m(r)];
|
|
168
|
+
const S = Math.round(e * R);
|
|
169
|
+
let l = t + S, I = r + S;
|
|
170
|
+
return l < n && (I += n - l, l = n), I > o && (l -= I - o, I = o), [m(l), m(I)];
|
|
171
|
+
}, ga = (e, t, r, n, o, s, i, c) => {
|
|
172
|
+
let h = 0, m = !1, R = !1;
|
|
165
173
|
switch (e) {
|
|
166
174
|
case "ArrowRight":
|
|
167
175
|
case "ArrowUp":
|
|
@@ -181,601 +189,649 @@ const Na = {
|
|
|
181
189
|
m = !0;
|
|
182
190
|
break;
|
|
183
191
|
case "End":
|
|
184
|
-
|
|
192
|
+
R = !0;
|
|
185
193
|
break;
|
|
186
194
|
default:
|
|
187
195
|
return null;
|
|
188
196
|
}
|
|
189
197
|
if (i) {
|
|
190
|
-
let
|
|
191
|
-
return m ?
|
|
198
|
+
let I = r;
|
|
199
|
+
return m ? I = o : R ? I = s : I = Math.max(o, Math.min(s, r + h)), [I, I];
|
|
192
200
|
}
|
|
193
|
-
let
|
|
194
|
-
return t === "low" ? m ?
|
|
195
|
-
},
|
|
196
|
-
const r = t?.estimatedHeightPx ??
|
|
201
|
+
let S = r, l = n;
|
|
202
|
+
return t === "low" ? m ? S = o : R ? S = n : S = Math.max(o, Math.min(n, r + h)) : m ? l = r : R ? l = s : l = Math.max(r, Math.min(s, n + h)), [S, l];
|
|
203
|
+
}, vo = 8, Do = 2, po = 16, ha = 12, ba = 90, Tn = (e, t) => {
|
|
204
|
+
const r = t?.estimatedHeightPx ?? po, o = vo + (t?.anchorGapY ?? Do) + r / 2, s = e === "top" ? -o : o;
|
|
197
205
|
return {
|
|
198
206
|
lowAngleDeg: 0,
|
|
199
207
|
highAngleDeg: 0,
|
|
200
208
|
lowOffsetX: 0,
|
|
201
209
|
highOffsetX: 0,
|
|
202
|
-
lowOffsetY:
|
|
203
|
-
highOffsetY:
|
|
210
|
+
lowOffsetY: s,
|
|
211
|
+
highOffsetY: s,
|
|
204
212
|
isSlanted: !1,
|
|
205
213
|
proximity: 0
|
|
206
214
|
};
|
|
207
|
-
},
|
|
208
|
-
const
|
|
209
|
-
if (!(Number.isFinite(r) && r > 0) ||
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
212
|
-
const
|
|
215
|
+
}, xo = (e, t, r, n = "top", o) => {
|
|
216
|
+
const s = o?.estimatedWidthPx, i = o?.estimatedHeightPx ?? po, c = o?.paddingPx ?? ha, h = o?.maxAngleDeg ?? ba, m = vo + (o?.anchorGapY ?? Do), R = Tn(n, o);
|
|
217
|
+
if (!(Number.isFinite(r) && r > 0) || s === void 0 || !Number.isFinite(s) || s <= 0) return R;
|
|
218
|
+
const S = Math.max(0, t - e) / 100 * r, l = s + c;
|
|
219
|
+
if (S >= l) return R;
|
|
220
|
+
const I = Math.max(0, Math.min(1, (l - S) / l)), ae = I * I * I * (I * (I * 6 - 15) + 10) * h, $ = n === "top" ? -ae : ae, de = ae * Math.PI / 180, ie = s / 2 * Math.abs(Math.sin(de)) + i / 2 * Math.abs(Math.cos(de)), P = m + ie, V = n === "top" ? -P : +P, z = s * Math.abs(Math.cos(de)) + i * Math.abs(Math.sin(de)), ne = Math.max(0, (z + c - S) / 2);
|
|
213
221
|
return {
|
|
214
|
-
lowAngleDeg:
|
|
215
|
-
highAngleDeg:
|
|
216
|
-
lowOffsetX: -
|
|
217
|
-
highOffsetX:
|
|
218
|
-
lowOffsetY:
|
|
219
|
-
highOffsetY:
|
|
220
|
-
isSlanted:
|
|
221
|
-
proximity:
|
|
222
|
+
lowAngleDeg: $,
|
|
223
|
+
highAngleDeg: $,
|
|
224
|
+
lowOffsetX: -ne,
|
|
225
|
+
highOffsetX: ne,
|
|
226
|
+
lowOffsetY: V,
|
|
227
|
+
highOffsetY: V,
|
|
228
|
+
isSlanted: I > 1e-3,
|
|
229
|
+
proximity: I
|
|
222
230
|
};
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
231
|
+
}, yo = (e) => ({ ...e, lowOffsetX: 0, highOffsetX: 0 }), To = (e, t) => {
|
|
232
|
+
const r = t === "macro-top" || t === "macro-left", n = e <= 0;
|
|
233
|
+
return r && n || !(r || n) ? "macro" : "micro";
|
|
234
|
+
}, wa = (e, t, r) => {
|
|
235
|
+
const n = Math.abs(e) > Math.abs(t) ? e : t;
|
|
236
|
+
return !Number.isFinite(n) || n === 0 ? 0 : (r ? n < 0 : n > 0) ? 1 : -1;
|
|
237
|
+
};
|
|
238
|
+
function Ma(e, t, r, n, o, s, i = "macro-top", c = 0.05, h = !0, m = "range") {
|
|
239
|
+
if (To(t, i) === "macro") {
|
|
240
|
+
const l = Math.abs(e - r), I = Math.abs(e - n);
|
|
241
|
+
return l <= c && l <= I ? "macro-low" : I <= c && I < l ? "macro-high" : h && e >= r && e <= n ? "macro-connect" : l < I ? "macro-low" : "macro-high";
|
|
229
242
|
}
|
|
230
|
-
|
|
231
|
-
|
|
243
|
+
if (m === "point")
|
|
244
|
+
return "micro-point";
|
|
245
|
+
const R = Math.abs(e - o), S = Math.abs(e - s);
|
|
246
|
+
return R <= c && R <= S ? "micro-low" : S <= c && S < R ? "micro-high" : h && e >= o && e <= s ? "micro-connect" : R < S ? "micro-low" : "micro-high";
|
|
232
247
|
}
|
|
233
|
-
function
|
|
248
|
+
function va(e, t, r, n, o) {
|
|
234
249
|
if (e === "macro-connect") {
|
|
235
|
-
const i = t - r, c =
|
|
250
|
+
const i = t - r, c = o - n, h = Math.max(0, Math.min(1 - c, n + i)), m = h + c;
|
|
236
251
|
return [h, m, "macro-connect"];
|
|
237
252
|
}
|
|
238
253
|
if (e === "macro-low") {
|
|
239
254
|
const i = Math.max(0, Math.min(1, t));
|
|
240
|
-
return i >
|
|
255
|
+
return i > o ? [o, i, "macro-high"] : [i, o, "macro-low"];
|
|
241
256
|
}
|
|
242
|
-
const
|
|
243
|
-
return
|
|
257
|
+
const s = Math.max(0, Math.min(1, t));
|
|
258
|
+
return s < n ? [s, n, "macro-low"] : [n, s, "macro-high"];
|
|
244
259
|
}
|
|
245
|
-
function
|
|
260
|
+
function Da(e, t, r, n, o) {
|
|
261
|
+
if (e === "micro-point") {
|
|
262
|
+
const i = Math.max(0, Math.min(1, t));
|
|
263
|
+
return [i, i, "micro-point"];
|
|
264
|
+
}
|
|
246
265
|
if (e === "micro-connect") {
|
|
247
|
-
const i = t - r, c =
|
|
266
|
+
const i = t - r, c = o - n, h = Math.max(0, Math.min(1 - c, n + i)), m = h + c;
|
|
248
267
|
return [h, m, "micro-connect"];
|
|
249
268
|
}
|
|
250
269
|
if (e === "micro-low") {
|
|
251
270
|
const i = Math.max(0, Math.min(1, t));
|
|
252
|
-
return i >
|
|
271
|
+
return i > o ? [o, i, "micro-high"] : [i, o, "micro-low"];
|
|
253
272
|
}
|
|
254
|
-
const
|
|
255
|
-
return
|
|
273
|
+
const s = Math.max(0, Math.min(1, t));
|
|
274
|
+
return s < n ? [s, n, "micro-low"] : [n, s, "micro-high"];
|
|
256
275
|
}
|
|
257
|
-
const
|
|
258
|
-
let
|
|
259
|
-
return r ? (
|
|
276
|
+
const yr = Lr(({ type: e, isTop: t = !0, isVertical: r = !1, isLeft: n = !0 }) => {
|
|
277
|
+
let o, s;
|
|
278
|
+
return r ? (o = n ? "M 7.375 0.625 A 7.375 7.375 0 0 0 7.375 15.375 Z" : "M 0.625 0.625 A 7.375 7.375 0 0 1 0.625 15.375 Z", s = `period-slider-knob period-slider-knob-svg is-vertical ${n ? "is-semicircle-left" : "is-semicircle-right"}`) : (o = t ? "M 0.625 7.375 A 7.375 7.375 0 0 1 15.375 7.375 Z" : "M 0.625 0.625 A 7.375 7.375 0 0 0 15.375 0.625 Z", s = `period-slider-knob period-slider-knob-svg ${t ? "is-semicircle-top" : "is-semicircle-bottom"}`), /* @__PURE__ */ T("svg", { className: s, width: r ? "8" : "16", height: r ? "16" : "8", viewBox: r ? "0 0 8 16" : "0 0 16 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ T("path", { d: o, className: e === "macro" ? "period-slider-knob-path-macro" : "period-slider-knob-path-micro", shapeRendering: "geometricPrecision", strokeWidth: "1.25" }) });
|
|
260
279
|
});
|
|
261
|
-
|
|
262
|
-
const
|
|
263
|
-
if (!
|
|
264
|
-
if (!
|
|
280
|
+
yr.displayName = "VernierKnobSvg";
|
|
281
|
+
const pa = (e, t) => {
|
|
282
|
+
if (!lt(e)) throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${xe(e)})`);
|
|
283
|
+
if (!lt(t)) throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${xe(t)})`);
|
|
265
284
|
if (t.getTime() <= e.getTime())
|
|
266
|
-
throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${
|
|
267
|
-
},
|
|
285
|
+
throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${xe(e)}, maxDate: ${xe(t)})`);
|
|
286
|
+
}, Rr = (e, t, r = "PeriodSlider") => {
|
|
268
287
|
if (!Array.isArray(t) || t.length !== 2)
|
|
269
|
-
throw new RangeError(
|
|
270
|
-
const [
|
|
271
|
-
if (!
|
|
272
|
-
if (!
|
|
273
|
-
if (
|
|
274
|
-
throw new RangeError(
|
|
275
|
-
},
|
|
276
|
-
if (!
|
|
277
|
-
},
|
|
288
|
+
throw new RangeError(`${r}: ${e} is required and must be a [start, end] Date tuple (received: ${xe(t)})`);
|
|
289
|
+
const [n, o] = t;
|
|
290
|
+
if (!lt(n)) throw new RangeError(`${r}: ${e}[0] must be a valid Date (received: ${xe(n)})`);
|
|
291
|
+
if (!lt(o)) throw new RangeError(`${r}: ${e}[1] must be a valid Date (received: ${xe(o)})`);
|
|
292
|
+
if (o.getTime() < n.getTime())
|
|
293
|
+
throw new RangeError(`${r}: ${e} must not be inverted (start: ${xe(n)}, end: ${xe(o)})`);
|
|
294
|
+
}, yn = (e, t) => {
|
|
295
|
+
if (!lt(t)) throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${xe(t)})`);
|
|
296
|
+
}, xt = (e, t, r, n) => {
|
|
278
297
|
if (t.getTime() < r.getTime() || t.getTime() > n.getTime())
|
|
279
|
-
throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${
|
|
280
|
-
},
|
|
298
|
+
throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${xe(t)}, minDate: ${xe(r)}, maxDate: ${xe(n)})`);
|
|
299
|
+
}, xa = (e, t, r) => {
|
|
281
300
|
if (e.mode === "range") {
|
|
282
301
|
for (const n of ["range", "defaultRange"]) {
|
|
283
|
-
const
|
|
284
|
-
|
|
302
|
+
const o = e[n];
|
|
303
|
+
o !== void 0 && (Rr(n, o), xt(`${n}[0]`, o[0], t, r), xt(`${n}[1]`, o[1], t, r));
|
|
285
304
|
}
|
|
286
305
|
return;
|
|
287
306
|
}
|
|
288
307
|
if (e.mode === "point")
|
|
289
308
|
for (const n of ["value", "defaultValue"]) {
|
|
290
|
-
const
|
|
291
|
-
|
|
309
|
+
const o = e[n];
|
|
310
|
+
o !== void 0 && (yn(n, o), xt(n, o, t, r));
|
|
292
311
|
}
|
|
293
|
-
},
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
if (
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
312
|
+
}, ya = (e, t, r) => {
|
|
313
|
+
Rr("macroRange", e.macroRange);
|
|
314
|
+
const n = e.microRange !== void 0 || e.defaultMicroRange !== void 0 || e.onChangeMicroRange !== void 0, o = e.microValue !== void 0 || e.defaultMicroValue !== void 0 || e.onChangeMicroPoint !== void 0;
|
|
315
|
+
if (n && o)
|
|
316
|
+
throw new RangeError("PeriodSlider: vernier mode takes either a micro range (microRange / defaultMicroRange / onChangeMicroRange) or a micro point (microValue / defaultMicroValue / onChangeMicroPoint), never both");
|
|
317
|
+
if (o) {
|
|
318
|
+
if (e.microValue !== void 0)
|
|
319
|
+
return yn("microValue", e.microValue), xt("microValue", e.microValue, t, r), { shape: "point", selection: [e.microValue, e.microValue] };
|
|
320
|
+
if (e.defaultMicroValue !== void 0)
|
|
321
|
+
return yn("defaultMicroValue", e.defaultMicroValue), xt("defaultMicroValue", e.defaultMicroValue, t, r), { shape: "point", selection: [e.defaultMicroValue, e.defaultMicroValue] };
|
|
322
|
+
throw new RangeError("PeriodSlider: vernier point mode requires a micro selection; supply microValue (controlled) or defaultMicroValue (uncontrolled)");
|
|
323
|
+
}
|
|
324
|
+
if (e.microRange !== void 0)
|
|
325
|
+
return Rr("microRange", e.microRange), xt("microRange[0]", e.microRange[0], t, r), xt("microRange[1]", e.microRange[1], t, r), { shape: "range", selection: e.microRange };
|
|
326
|
+
if (e.defaultMicroRange !== void 0)
|
|
327
|
+
return Rr("defaultMicroRange", e.defaultMicroRange), xt("defaultMicroRange[0]", e.defaultMicroRange[0], t, r), xt("defaultMicroRange[1]", e.defaultMicroRange[1], t, r), { shape: "range", selection: e.defaultMicroRange };
|
|
328
|
+
throw n ? new RangeError("PeriodSlider: vernier range mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)") : new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange / defaultMicroRange for a period, or microValue / defaultMicroValue for a point");
|
|
329
|
+
}, pr = (e, t, r, n, o, s, i, c) => {
|
|
330
|
+
const h = Me(e, n, t), m = Me(e, o, t);
|
|
331
|
+
return i ? h : c ? m : Math.max(h, Math.min(m, Me(e, r, t) + s));
|
|
332
|
+
}, vn = (e) => {
|
|
303
333
|
e.timerId !== null && clearTimeout(e.timerId), e.timerId = null, e.emit = null;
|
|
304
|
-
},
|
|
334
|
+
}, Ta = (e, t) => {
|
|
305
335
|
try {
|
|
306
336
|
Intl.DateTimeFormat.supportedLocalesOf([t]);
|
|
307
337
|
} catch {
|
|
308
338
|
throw new RangeError(`PeriodSlider: ${e} must be a valid BCP 47 language tag (received: ${JSON.stringify(t)})`);
|
|
309
339
|
}
|
|
310
|
-
},
|
|
311
|
-
const [e, t] =
|
|
312
|
-
if (r.current?.disconnect(), r.current = null,
|
|
340
|
+
}, or = () => {
|
|
341
|
+
const [e, t] = Le(null), r = Z(null), n = F((o) => {
|
|
342
|
+
if (r.current?.disconnect(), r.current = null, o === null) {
|
|
313
343
|
t(null);
|
|
314
344
|
return;
|
|
315
345
|
}
|
|
316
346
|
if (typeof ResizeObserver > "u") return;
|
|
317
|
-
const
|
|
347
|
+
const s = new ResizeObserver((i) => {
|
|
318
348
|
for (const c of i) {
|
|
319
349
|
const h = c.borderBoxSize?.[0];
|
|
320
350
|
h !== void 0 && t((m) => m !== null && Math.abs(m.widthPx - h.inlineSize) < 0.5 && Math.abs(m.heightPx - h.blockSize) < 0.5 ? m : { widthPx: h.inlineSize, heightPx: h.blockSize });
|
|
321
351
|
}
|
|
322
352
|
});
|
|
323
|
-
|
|
353
|
+
s.observe(o), r.current = s;
|
|
324
354
|
}, []);
|
|
325
|
-
return
|
|
355
|
+
return Nt(
|
|
326
356
|
() => () => {
|
|
327
357
|
r.current?.disconnect(), r.current = null;
|
|
328
358
|
},
|
|
329
359
|
[]
|
|
330
360
|
), [n, e];
|
|
331
|
-
},
|
|
361
|
+
}, Dn = (e, t) => {
|
|
332
362
|
if (!(e === null || t === null))
|
|
333
363
|
return { estimatedWidthPx: Math.max(e.widthPx, t.widthPx), estimatedHeightPx: Math.max(e.heightPx, t.heightPx) };
|
|
334
|
-
},
|
|
364
|
+
}, so = (e, t, r) => ({
|
|
335
365
|
"--ps-tooltip-tx": `calc(-50% + ${e}px)`,
|
|
336
366
|
"--ps-tooltip-ty": `${t}px`,
|
|
337
367
|
"--ps-tooltip-rot": `${r}deg`
|
|
338
|
-
}),
|
|
339
|
-
const c =
|
|
368
|
+
}), co = (e, t, r, n, o, s, i) => {
|
|
369
|
+
const c = Tn(n, o);
|
|
340
370
|
if (!i) return { slant: c, lowStyle: void 0, highStyle: void 0 };
|
|
341
|
-
const h =
|
|
371
|
+
const h = xo(e * 100, t * 100, r, n, o), m = s ? yo(h) : h;
|
|
342
372
|
return {
|
|
343
373
|
slant: m,
|
|
344
|
-
lowStyle:
|
|
345
|
-
highStyle:
|
|
374
|
+
lowStyle: so(m.lowOffsetX, m.lowOffsetY - c.lowOffsetY, m.lowAngleDeg),
|
|
375
|
+
highStyle: so(m.highOffsetX, m.highOffsetY - c.highOffsetY, m.highAngleDeg)
|
|
346
376
|
};
|
|
347
|
-
},
|
|
377
|
+
}, Ra = {
|
|
348
378
|
horizontal: { decrease: "◀", increase: "▶" },
|
|
349
379
|
vertical: { decrease: "▼", increase: "▲" }
|
|
350
|
-
},
|
|
380
|
+
}, La = {
|
|
351
381
|
horizontal: { decrease: "period-slider-stepper-prev", increase: "period-slider-stepper-next" },
|
|
352
382
|
vertical: { decrease: "period-slider-stepper-prev period-slider-stepper-down", increase: "period-slider-stepper-next period-slider-stepper-up" }
|
|
353
|
-
},
|
|
383
|
+
}, Sa = (e) => {
|
|
354
384
|
const {
|
|
355
385
|
unit: t,
|
|
356
386
|
minDate: r,
|
|
357
387
|
maxDate: n,
|
|
358
|
-
allowedDates:
|
|
359
|
-
snapMode:
|
|
388
|
+
allowedDates: o,
|
|
389
|
+
snapMode: s = "index",
|
|
360
390
|
disabled: i = !1,
|
|
361
391
|
className: c = "",
|
|
362
392
|
showStepper: h = !0,
|
|
363
393
|
tooltipStyle: m = "always",
|
|
364
|
-
labelPosition:
|
|
365
|
-
autoSlantLabels:
|
|
366
|
-
isVertical:
|
|
367
|
-
hideConnectBar:
|
|
368
|
-
showTicks:
|
|
369
|
-
colorScheme:
|
|
370
|
-
locale:
|
|
371
|
-
decreaseAriaLabel:
|
|
372
|
-
increaseAriaLabel:
|
|
394
|
+
labelPosition: R = "top",
|
|
395
|
+
autoSlantLabels: S = !0,
|
|
396
|
+
isVertical: l = !1,
|
|
397
|
+
hideConnectBar: I = !1,
|
|
398
|
+
showTicks: re = !1,
|
|
399
|
+
colorScheme: ae = "blue-rose",
|
|
400
|
+
locale: $,
|
|
401
|
+
decreaseAriaLabel: de = "Decrease",
|
|
402
|
+
increaseAriaLabel: ie = "Increase"
|
|
373
403
|
} = e;
|
|
374
|
-
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
const
|
|
378
|
-
(
|
|
379
|
-
if (
|
|
380
|
-
const
|
|
381
|
-
return
|
|
404
|
+
pa(r, n), xa(e, r, n), $ !== void 0 && Ta("locale", $);
|
|
405
|
+
const P = e.mode === "vernier" ? ya(e, r, n) : null, V = P !== null && P.shape === "point", z = ia[ae], ne = aa(), j = Z(e);
|
|
406
|
+
j.current = e;
|
|
407
|
+
const W = r.getTime(), p = n.getTime(), M = v(() => kt(o, t, r, n), [o, t, W, p]), x = M.length > 0, { rangeMin: k, rangeMax: A } = v(() => x ? { rangeMin: 0, rangeMax: M.length - 1 } : { rangeMin: ge(t, r), rangeMax: ge(t, n) }, [x, M, t, W, p]), J = e.mode === "point", fe = F(
|
|
408
|
+
(a) => {
|
|
409
|
+
if (x) {
|
|
410
|
+
const u = Math.max(0, Math.min(M.length - 1, Math.round(a)));
|
|
411
|
+
return M[u];
|
|
382
412
|
}
|
|
383
|
-
return
|
|
413
|
+
return ce(t, Math.round(a));
|
|
384
414
|
},
|
|
385
|
-
[
|
|
386
|
-
),
|
|
387
|
-
(
|
|
388
|
-
if (
|
|
389
|
-
const
|
|
390
|
-
return
|
|
415
|
+
[x, M, t]
|
|
416
|
+
), _ = F(
|
|
417
|
+
(a) => {
|
|
418
|
+
if (a === void 0) return k;
|
|
419
|
+
const u = tt(t, a);
|
|
420
|
+
return x ? Me(M, u, t) : ge(t, u);
|
|
391
421
|
},
|
|
392
|
-
[
|
|
393
|
-
), [
|
|
422
|
+
[x, M, t, k]
|
|
423
|
+
), [Q, ue] = Le(() => P === null ? null : P.selection);
|
|
424
|
+
let K = Q ?? (P === null ? null : P.selection);
|
|
425
|
+
if (V && K !== null && K[0].getTime() !== K[1].getTime()) {
|
|
426
|
+
const a = [K[0], K[0]];
|
|
427
|
+
K = a, ue(a);
|
|
428
|
+
}
|
|
429
|
+
const X = e.mode === "vernier" ? e.microValue?.getTime() : void 0, oe = v(() => e.mode !== "vernier" || e.microValue === void 0 ? null : [e.microValue, e.microValue], [e.mode, X]), le = e.mode !== "vernier" ? null : V ? oe ?? K : e.microRange !== void 0 ? e.microRange : K, Xe = e.mode === "range" ? e.range?.[0] ?? e.defaultRange?.[0] : e.mode === "vernier" ? le?.[0] : void 0, Ae = e.mode === "range" ? e.range?.[1] ?? e.defaultRange?.[1] : e.mode === "vernier" ? le?.[1] : void 0, Ie = e.mode === "point" ? e.value ?? e.defaultValue : void 0, Se = e.mode === "point" ? Ie?.getTime() : Xe?.getTime(), Ze = e.mode === "range" ? Ae?.getTime() : Se, [Je, st] = v(() => {
|
|
394
430
|
if (e.mode === "point") {
|
|
395
|
-
const d =
|
|
431
|
+
const d = _(Ie);
|
|
396
432
|
return [d, d];
|
|
397
433
|
}
|
|
398
|
-
const
|
|
399
|
-
return [Math.min(
|
|
400
|
-
}, [e.mode,
|
|
401
|
-
|
|
402
|
-
const [
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
const [
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
const
|
|
434
|
+
const a = _(Xe), u = _(Ae);
|
|
435
|
+
return [Math.min(a, u), Math.max(a, u)];
|
|
436
|
+
}, [e.mode, Se, Ze, _, Ie, Xe, Ae]), Fe = e.mode === "point" ? e.value !== void 0 : e.mode === "range" ? e.range !== void 0 : V ? e.microValue !== void 0 : e.microRange !== void 0, [dt, q] = Le(() => [Je, st]), [te, be] = Le(null), [g, L] = Le(null), O = Z(null);
|
|
437
|
+
O.current = g;
|
|
438
|
+
const [De, C] = Le("high"), [G, Ce] = Le(null), [He, Ue] = Le(null), he = te ? te[0] : Fe ? Je : dt[0], ve = te ? te[1] : Fe ? st : dt[1], cr = Z([he, ve]);
|
|
439
|
+
cr.current = [he, ve];
|
|
440
|
+
const we = e.mode === "vernier", Yt = e.mode === "vernier" ? e.vernierOrientation ?? (l ? "macro-left" : "macro-top") : "macro-top", N = Yt === "macro-top" || Yt === "macro-left", Jr = e.mode === "vernier" ? e.showVernierProjection ?? !0 : !1, Qr = e.mode === "vernier" ? e.showVernierTicks ?? !0 : !1, Mt = e.mode === "vernier" ? e.showHairline ?? !0 : !1, U = we ? e.macroUnit ?? t : t, w = we ? e.microUnit ?? t : t, b = we ? e.macroIsDiscrete ?? !1 : x, E = we ? e.microIsDiscrete ?? !1 : x, Ke = we ? e.macroAllowedDates ?? o : o, Wt = we ? e.microAllowedDates ?? o : o, mt = we ? e.formatMacroLabel ?? e.formatLabel : e.formatLabel, rt = we ? e.formatMicroLabel ?? e.formatLabel : e.formatLabel, Ro = e.mode === "vernier" ? e.macroRange[0].getTime() : void 0, Lo = e.mode === "vernier" ? e.macroRange[1].getTime() : void 0, So = Xe?.getTime(), $o = Ae?.getTime(), [qe, Sr] = Le(null), Tt = Z(null);
|
|
441
|
+
Tt.current = qe;
|
|
442
|
+
const [ur, Bt] = Le(() => V ? "micro-point" : "micro-high");
|
|
443
|
+
let Ye = ur;
|
|
444
|
+
const en = V ? ur === "micro-low" || ur === "micro-high" || ur === "micro-connect" ? "micro-point" : null : ur === "micro-point" ? "micro-high" : null;
|
|
445
|
+
en !== null && (Ye = en, Bt(en));
|
|
446
|
+
const $e = v(() => ge(U, r), [W, U]), nt = v(() => {
|
|
447
|
+
const a = ge(U, n);
|
|
448
|
+
if (we && a <= $e)
|
|
449
|
+
throw new RangeError(`PeriodSlider: macroUnit "${U}" cannot distinguish minDate from maxDate (minDate: ${xe(r)}, maxDate: ${xe(n)})`);
|
|
450
|
+
return a;
|
|
451
|
+
}, [we, W, p, $e, U]), Te = v(() => we ? kt(Ke, U, r, n) : [], [we, Ke, U, W, p]), We = v(() => e.mode !== "vernier" ? $e : Math.max($e, Math.min(nt, ge(U, e.macroRange[0]))), [e.mode, Ro, $e, nt, U]), Be = v(() => e.mode !== "vernier" ? nt : Math.max($e, Math.min(nt, ge(U, e.macroRange[1]))), [e.mode, Lo, $e, nt, U]), vt = v(() => ce(U, We), [U, We]), Et = v(() => ce(U, Be), [U, Be]), $r = v(() => e.mode !== "vernier" ? [r, n] : yt(U, w, [vt, Et], r, n), [e.mode, vt, Et, U, w, W, p]), ye = v(() => ge(w, $r[0]), [w, $r]), Pe = v(() => ge(w, $r[1]), [w, $r]), tn = v(() => we ? kt(Wt, w, r, n) : [], [we, Wt, w, W, p]), rn = (a, u) => tn.filter((d) => {
|
|
452
|
+
const f = ge(w, d);
|
|
453
|
+
return f >= a && f <= u;
|
|
454
|
+
}), se = v(() => rn(ye, Pe), [tn, w, ye, Pe]), Vt = b && Te.length > 0, ot = E && se.length > 0, Rt = (a, u, d, f) => u.length > 0 ? ge(w, u[Me(u, a, w)]) : Math.max(d, Math.min(f, ge(w, a))), zt = ot ? se : [], Ne = v(() => le === null ? ye : Rt(le[0], zt, ye, Pe), [So, ye, Pe, w, le, zt]), ze = v(() => le === null ? Pe : Rt(le[1], zt, ye, Pe), [$o, ye, Pe, w, le, zt]), Lt = v(() => ce(w, Ne), [w, Ne]), St = v(() => ce(w, ze), [w, ze]), dr = Math.max(1, nt - $e), Ee = Vt ? Fr(Te, U, s, vt) : Math.max(0, Math.min(1, (We - $e) / dr)), je = Math.max(Ee, Vt ? Fr(Te, U, s, Et) : Math.min(1, (Be - $e) / dr)), mr = Math.max(1, Pe - ye), at = ot ? Fr(se, w, s, Lt) : Math.max(0, Math.min(1, (Ne - ye) / mr)), Dt = Math.max(at, ot ? Fr(se, w, s, St) : Math.min(1, (ze - ye) / mr)), nn = Z({ timerId: null, emit: null }), on = Z({ timerId: null, emit: null }), an = Z({ timerId: null, emit: null });
|
|
455
|
+
Nt(() => {
|
|
456
|
+
const a = [nn, on, an];
|
|
417
457
|
return () => {
|
|
418
|
-
for (const
|
|
419
|
-
|
|
458
|
+
for (const u of a)
|
|
459
|
+
vn(u.current);
|
|
420
460
|
};
|
|
421
461
|
}, []);
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
const { debounceMs:
|
|
425
|
-
if (d || !
|
|
426
|
-
|
|
462
|
+
const _t = F((a, u, d) => {
|
|
463
|
+
vn(a);
|
|
464
|
+
const { debounceMs: f } = j.current;
|
|
465
|
+
if (d || !f || f <= 0) {
|
|
466
|
+
u();
|
|
427
467
|
return;
|
|
428
468
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
},
|
|
432
|
-
}, []),
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
}, []),
|
|
436
|
-
(
|
|
437
|
-
const [
|
|
438
|
-
if ((
|
|
469
|
+
a.emit = u, a.timerId = setTimeout(() => {
|
|
470
|
+
a.timerId = null, a.emit = null, u();
|
|
471
|
+
}, f);
|
|
472
|
+
}, []), ln = F((a) => {
|
|
473
|
+
const u = a.emit;
|
|
474
|
+
vn(a), u?.();
|
|
475
|
+
}, []), Xt = F((a) => new Date(Math.min(Math.max(a.getTime(), W), p)), [W, p]), ft = F(
|
|
476
|
+
(a, u, d = !1) => {
|
|
477
|
+
const [f, y] = cr.current;
|
|
478
|
+
if ((j.current.mode === "point" ? a === f : a === f && u === y) && nn.current.timerId === null)
|
|
439
479
|
return;
|
|
440
|
-
const
|
|
441
|
-
const
|
|
442
|
-
|
|
480
|
+
const H = fe(a), Y = fe(u), ee = () => {
|
|
481
|
+
const D = j.current;
|
|
482
|
+
D.mode === "point" ? D.onChangePoint?.(H) : D.mode === "range" && D.onChangeRange?.(H, Y);
|
|
443
483
|
};
|
|
444
|
-
|
|
484
|
+
_t(nn.current, ee, d);
|
|
445
485
|
},
|
|
446
|
-
[
|
|
447
|
-
),
|
|
448
|
-
(
|
|
449
|
-
if (
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
|
|
486
|
+
[fe, _t]
|
|
487
|
+
), $t = F(
|
|
488
|
+
(a, u, d = !1) => {
|
|
489
|
+
if (j.current.mode !== "vernier") return;
|
|
490
|
+
const f = Xt(a), y = Xt(u);
|
|
491
|
+
_t(
|
|
492
|
+
on.current,
|
|
453
493
|
() => {
|
|
454
|
-
const B =
|
|
455
|
-
B.mode === "vernier" && B.onChangeMacroRange?.(
|
|
494
|
+
const B = j.current;
|
|
495
|
+
B.mode === "vernier" && B.onChangeMacroRange?.(f, y);
|
|
456
496
|
},
|
|
457
497
|
d
|
|
458
498
|
);
|
|
459
499
|
},
|
|
460
|
-
[
|
|
461
|
-
),
|
|
462
|
-
(
|
|
463
|
-
const
|
|
464
|
-
if (
|
|
465
|
-
const
|
|
466
|
-
|
|
467
|
-
|
|
500
|
+
[Xt, _t]
|
|
501
|
+
), Qe = F(
|
|
502
|
+
(a, u, d = !1) => {
|
|
503
|
+
const f = j.current;
|
|
504
|
+
if (f.mode !== "vernier") return;
|
|
505
|
+
const y = Xt(a), B = Xt(u);
|
|
506
|
+
(V ? f.microValue === void 0 : f.microRange === void 0) && ue([y, B]), _t(
|
|
507
|
+
an.current,
|
|
468
508
|
() => {
|
|
469
|
-
const
|
|
470
|
-
|
|
509
|
+
const H = j.current;
|
|
510
|
+
if (H.mode === "vernier") {
|
|
511
|
+
if (V) {
|
|
512
|
+
H.onChangeMicroPoint?.(y);
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
H.onChangeMicroRange?.(y, B);
|
|
516
|
+
}
|
|
471
517
|
},
|
|
472
518
|
d
|
|
473
519
|
);
|
|
474
520
|
},
|
|
475
|
-
[
|
|
476
|
-
),
|
|
477
|
-
(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
521
|
+
[Xt, _t, V]
|
|
522
|
+
), Rn = F(
|
|
523
|
+
(a, u = !1) => {
|
|
524
|
+
Qe(a, a, u);
|
|
525
|
+
},
|
|
526
|
+
[Qe]
|
|
527
|
+
), Pr = F(
|
|
528
|
+
(a) => {
|
|
529
|
+
if (x && s === "time" && M.length > 1) {
|
|
530
|
+
const f = Math.max(0, Math.min(M.length - 1, Math.round(a))), y = M[0].getTime(), H = M[M.length - 1].getTime() - y;
|
|
531
|
+
if (H <= 0) return 0;
|
|
532
|
+
const Y = M[f].getTime();
|
|
533
|
+
return Math.max(0, Math.min(100, (Y - y) / H * 100));
|
|
483
534
|
}
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
486
|
-
const d = (
|
|
535
|
+
const u = A - k;
|
|
536
|
+
if (u <= 0) return 0;
|
|
537
|
+
const d = (a - k) / u * 100;
|
|
487
538
|
return Math.max(0, Math.min(100, d));
|
|
488
539
|
},
|
|
489
|
-
[
|
|
490
|
-
),
|
|
491
|
-
(
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
494
|
-
if (
|
|
495
|
-
const
|
|
496
|
-
return
|
|
540
|
+
[x, s, M, k, A]
|
|
541
|
+
), Ar = F(
|
|
542
|
+
(a) => {
|
|
543
|
+
const u = Math.max(0, Math.min(100, a));
|
|
544
|
+
if (x) {
|
|
545
|
+
if (s === "time" && M.length > 1) {
|
|
546
|
+
const y = M[0].getTime(), H = M[M.length - 1].getTime() - y, Y = y + u / 100 * H;
|
|
547
|
+
return Me(M, new Date(Y), t);
|
|
497
548
|
}
|
|
498
|
-
const
|
|
499
|
-
return Math.max(0, Math.min(
|
|
549
|
+
const f = Math.round(u / 100 * (M.length - 1));
|
|
550
|
+
return Math.max(0, Math.min(M.length - 1, f));
|
|
500
551
|
}
|
|
501
|
-
const d =
|
|
552
|
+
const d = k + u / 100 * (A - k);
|
|
502
553
|
return Math.round(d);
|
|
503
554
|
},
|
|
504
|
-
[
|
|
505
|
-
),
|
|
506
|
-
|
|
507
|
-
const
|
|
508
|
-
if (!
|
|
509
|
-
const
|
|
510
|
-
const d =
|
|
511
|
-
|
|
555
|
+
[x, s, M, k, A, t]
|
|
556
|
+
), ct = Z(null), [Kt, Ln] = Le(0), [Po, fr] = or(), [Ao, Sn] = or(), [Io, $n] = or(), [Co, Pn] = or(), [No, An] = or(), [ko, In] = or();
|
|
557
|
+
Nt(() => {
|
|
558
|
+
const a = ct.current;
|
|
559
|
+
if (!a) return;
|
|
560
|
+
const u = () => {
|
|
561
|
+
const d = a.getBoundingClientRect(), f = l ? d.height : d.width;
|
|
562
|
+
f > 0 && Ln((y) => Math.abs(y - f) < 0.5 ? y : f);
|
|
512
563
|
};
|
|
513
|
-
if (
|
|
514
|
-
const d = new ResizeObserver((
|
|
515
|
-
for (const
|
|
516
|
-
const B =
|
|
517
|
-
B > 0 &&
|
|
564
|
+
if (u(), typeof ResizeObserver < "u") {
|
|
565
|
+
const d = new ResizeObserver((f) => {
|
|
566
|
+
for (const y of f) {
|
|
567
|
+
const B = l ? y.contentRect.height : y.contentRect.width;
|
|
568
|
+
B > 0 && Ln((H) => Math.abs(H - B) < 0.5 ? H : B);
|
|
518
569
|
}
|
|
519
570
|
});
|
|
520
|
-
return d.observe(
|
|
571
|
+
return d.observe(a), () => d.disconnect();
|
|
521
572
|
}
|
|
522
|
-
return window.addEventListener("resize",
|
|
523
|
-
}, [
|
|
524
|
-
const
|
|
525
|
-
(
|
|
526
|
-
const
|
|
527
|
-
if (!(Number.isFinite(
|
|
528
|
-
const
|
|
529
|
-
return Number.isFinite(
|
|
573
|
+
return window.addEventListener("resize", u), () => window.removeEventListener("resize", u);
|
|
574
|
+
}, [l]);
|
|
575
|
+
const Ht = F(
|
|
576
|
+
(a, u, d) => {
|
|
577
|
+
const f = l ? d.height : d.width;
|
|
578
|
+
if (!(Number.isFinite(f) && f > 0)) return null;
|
|
579
|
+
const y = l ? d.bottom - u : a - d.left;
|
|
580
|
+
return Number.isFinite(y) ? Math.max(0, Math.min(1, y / f)) : null;
|
|
530
581
|
},
|
|
531
|
-
[
|
|
532
|
-
),
|
|
533
|
-
(
|
|
534
|
-
const d =
|
|
582
|
+
[l]
|
|
583
|
+
), Cn = F(
|
|
584
|
+
(a, u) => {
|
|
585
|
+
const d = ct.current;
|
|
535
586
|
if (!d) return null;
|
|
536
|
-
const
|
|
537
|
-
return
|
|
587
|
+
const f = Ht(a, u, d.getBoundingClientRect());
|
|
588
|
+
return f === null ? null : f * 100;
|
|
538
589
|
},
|
|
539
|
-
[
|
|
540
|
-
),
|
|
541
|
-
(
|
|
590
|
+
[Ht]
|
|
591
|
+
), Ir = Z(null), sn = Z(null), gt = Z(null), cn = Z(null), gr = Z(null), Nn = F(
|
|
592
|
+
(a) => {
|
|
542
593
|
if (i) return;
|
|
543
|
-
if (
|
|
544
|
-
const
|
|
545
|
-
if (!
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
if (
|
|
549
|
-
const [
|
|
550
|
-
ke !==
|
|
551
|
-
let
|
|
552
|
-
if (
|
|
553
|
-
const
|
|
554
|
-
|
|
594
|
+
if (we) {
|
|
595
|
+
const D = sn.current;
|
|
596
|
+
if (!D || a.pointerId !== 0 && a.pointerId !== D.pointerId || !ct.current) return;
|
|
597
|
+
const me = Ht(a.clientX, a.clientY, ct.current.getBoundingClientRect());
|
|
598
|
+
if (me === null) return;
|
|
599
|
+
if (D.handle === "macro-low" || D.handle === "macro-high" || D.handle === "macro-connect") {
|
|
600
|
+
const [Ve, ut, ke] = va(D.handle, me, D.startPointerRatio, D.startMacroLowRatio, D.startMacroHighRatio);
|
|
601
|
+
ke !== Tt.current && (Tt.current = ke, Sr(ke), Bt(ke));
|
|
602
|
+
let Re, bt;
|
|
603
|
+
if (Vt) {
|
|
604
|
+
const At = Ur(Te, U, s, Ve), It = Math.max(At, Ur(Te, U, s, ut));
|
|
605
|
+
Re = Te[At], bt = Te[It];
|
|
555
606
|
} else {
|
|
556
|
-
const
|
|
557
|
-
|
|
607
|
+
const At = Math.round($e + Ve * dr), It = Math.round($e + ut * dr);
|
|
608
|
+
Re = ce(U, At), bt = ce(U, It);
|
|
558
609
|
}
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
610
|
+
const wr = `${Re.getTime()}_${bt.getTime()}`;
|
|
611
|
+
wr !== cn.current && (cn.current = wr, $t(Re, bt));
|
|
612
|
+
const [pt, Ot] = yt(U, w, [Re, bt], r, n), bn = ge(w, pt), wn = ge(w, Ot), Qn = E ? rn(bn, wn) : [];
|
|
613
|
+
let Jt, Qt;
|
|
614
|
+
if (D.handle === "macro-connect") {
|
|
615
|
+
const At = pt, It = Ot;
|
|
616
|
+
let er, tr;
|
|
617
|
+
if (U === "year") {
|
|
618
|
+
const Ct = Re.getFullYear() - D.startMacroLowDate.getFullYear();
|
|
619
|
+
er = Oe("year", D.initialMicroLowDate, Ct), tr = Oe("year", D.initialMicroHighDate, Ct);
|
|
620
|
+
} else if (U === "month") {
|
|
621
|
+
const Ct = (Re.getFullYear() - D.startMacroLowDate.getFullYear()) * 12 + (Re.getMonth() - D.startMacroLowDate.getMonth());
|
|
622
|
+
er = Oe("month", D.initialMicroLowDate, Ct), tr = Oe("month", D.initialMicroHighDate, Ct);
|
|
571
623
|
} else {
|
|
572
|
-
const
|
|
573
|
-
|
|
624
|
+
const Ct = Math.round((Re.getTime() - D.startMacroLowDate.getTime()) / 864e5);
|
|
625
|
+
er = Oe("day", D.initialMicroLowDate, Ct), tr = Oe("day", D.initialMicroHighDate, Ct);
|
|
574
626
|
}
|
|
575
|
-
const
|
|
576
|
-
let
|
|
577
|
-
|
|
627
|
+
const rr = At.getTime(), Mr = It.getTime(), ro = D.initialMicroHighDate.getTime() - D.initialMicroLowDate.getTime();
|
|
628
|
+
let vr = er.getTime(), Dr = tr.getTime();
|
|
629
|
+
vr < rr && (vr = rr, Dr = Math.min(Mr, vr + ro)), Dr > Mr && (Dr = Mr, vr = Math.max(rr, Dr - ro)), Jt = tt(w, new Date(vr)), Qt = tt(w, new Date(Dr));
|
|
578
630
|
} else {
|
|
579
|
-
const
|
|
580
|
-
|
|
631
|
+
const At = pt.getTime(), It = Ot.getTime(), er = D.initialMicroLowDate.getTime(), tr = D.initialMicroHighDate.getTime(), rr = Math.max(At, Math.min(It, er)), Mr = Math.max(rr, Math.min(It, tr));
|
|
632
|
+
Jt = tt(w, new Date(rr)), Qt = tt(w, new Date(Mr));
|
|
581
633
|
}
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
634
|
+
const eo = Rt(Jt, Qn, bn, wn), ra = Math.max(eo, Rt(Qt, Qn, bn, wn));
|
|
635
|
+
Jt = ce(w, eo), Qt = ce(w, ra);
|
|
636
|
+
const to = `${Jt.getTime()}_${Qt.getTime()}`;
|
|
637
|
+
to !== gr.current && (gr.current = to, Qe(Jt, Qt));
|
|
638
|
+
} else if (D.handle === "micro-low" || D.handle === "micro-high" || D.handle === "micro-connect" || D.handle === "micro-point") {
|
|
639
|
+
const [Ve, ut, ke] = Da(D.handle, me, D.startPointerRatio, D.startMicroLowRatio, D.startMicroHighRatio);
|
|
640
|
+
ke !== Tt.current && (Tt.current = ke, Sr(ke), Bt(ke));
|
|
641
|
+
let Re, bt;
|
|
642
|
+
if (ot) {
|
|
643
|
+
const pt = Ur(se, w, s, Ve), Ot = Math.max(pt, Ur(se, w, s, ut));
|
|
644
|
+
Re = se[pt], bt = se[Ot];
|
|
591
645
|
} else {
|
|
592
|
-
const
|
|
593
|
-
|
|
646
|
+
const pt = Rt(ce(w, Math.round(ye + Ve * mr)), zt, ye, Pe), Ot = Math.max(pt, Rt(ce(w, Math.round(ye + ut * mr)), zt, ye, Pe));
|
|
647
|
+
Re = ce(w, pt), bt = ce(w, Ot);
|
|
594
648
|
}
|
|
595
|
-
const
|
|
596
|
-
|
|
649
|
+
const wr = `${Re.getTime()}_${bt.getTime()}`;
|
|
650
|
+
wr !== gr.current && (gr.current = wr, Qe(Re, bt));
|
|
597
651
|
}
|
|
598
652
|
return;
|
|
599
653
|
}
|
|
600
|
-
const
|
|
601
|
-
if (!
|
|
602
|
-
const d =
|
|
603
|
-
if (!(Number.isFinite(
|
|
604
|
-
if (
|
|
605
|
-
const
|
|
606
|
-
posDiffPct:
|
|
607
|
-
startLowVal:
|
|
608
|
-
startHighVal:
|
|
609
|
-
rangeMin:
|
|
610
|
-
rangeMax:
|
|
611
|
-
isDiscrete:
|
|
612
|
-
sortedAllowedDates:
|
|
613
|
-
snapMode:
|
|
654
|
+
const u = Ir.current;
|
|
655
|
+
if (!u || a.pointerId !== 0 && a.pointerId !== u.pointerId || !ct.current) return;
|
|
656
|
+
const d = ct.current.getBoundingClientRect(), f = l ? a.clientY : a.clientX, y = l ? d.height : d.width;
|
|
657
|
+
if (!(Number.isFinite(y) && y > 0)) return;
|
|
658
|
+
if (u.handle === "connect") {
|
|
659
|
+
const D = l ? (u.startPointerPos - f) / y : (f - u.startPointerPos) / y, me = fa({
|
|
660
|
+
posDiffPct: D,
|
|
661
|
+
startLowVal: u.startLowVal,
|
|
662
|
+
startHighVal: u.startHighVal,
|
|
663
|
+
rangeMin: k,
|
|
664
|
+
rangeMax: A,
|
|
665
|
+
isDiscrete: x,
|
|
666
|
+
sortedAllowedDates: M,
|
|
667
|
+
snapMode: s,
|
|
614
668
|
unit: t
|
|
615
669
|
});
|
|
616
|
-
if (
|
|
670
|
+
if (gt.current && gt.current[0] === me[0] && gt.current[1] === me[1])
|
|
617
671
|
return;
|
|
618
|
-
|
|
672
|
+
gt.current = me, be(me), ft(me[0], me[1], !1);
|
|
619
673
|
return;
|
|
620
674
|
}
|
|
621
|
-
const B =
|
|
675
|
+
const B = Ht(a.clientX, a.clientY, d);
|
|
622
676
|
if (B === null) return;
|
|
623
|
-
const
|
|
624
|
-
if ((!
|
|
625
|
-
const
|
|
626
|
-
|
|
677
|
+
const H = Ar(B * 100), [Y, ee] = lo(u.handle, H, u.startLowVal, u.startHighVal, k, A, J);
|
|
678
|
+
if ((!gt.current || gt.current[0] !== Y || gt.current[1] !== ee) && (gt.current = [Y, ee], be([Y, ee]), ft(Y, ee, !1)), !J && (u.handle === "low" || u.handle === "high")) {
|
|
679
|
+
const D = ma(u.handle, H, u.startLowVal, u.startHighVal, J);
|
|
680
|
+
O.current !== D && (O.current = D, L(D), C(D));
|
|
627
681
|
}
|
|
628
682
|
},
|
|
629
683
|
[
|
|
630
684
|
i,
|
|
631
|
-
|
|
632
|
-
|
|
685
|
+
we,
|
|
686
|
+
l,
|
|
687
|
+
U,
|
|
688
|
+
w,
|
|
689
|
+
Vt,
|
|
690
|
+
ot,
|
|
633
691
|
E,
|
|
634
|
-
|
|
635
|
-
At,
|
|
636
|
-
et,
|
|
637
|
-
Le,
|
|
638
|
-
ce,
|
|
639
|
-
Fe,
|
|
640
|
-
Wt,
|
|
641
|
-
Pe,
|
|
642
|
-
Gt,
|
|
692
|
+
W,
|
|
643
693
|
p,
|
|
694
|
+
Te,
|
|
695
|
+
se,
|
|
696
|
+
tn,
|
|
697
|
+
$e,
|
|
698
|
+
dr,
|
|
699
|
+
ye,
|
|
700
|
+
mr,
|
|
644
701
|
k,
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
702
|
+
A,
|
|
703
|
+
x,
|
|
704
|
+
M,
|
|
705
|
+
s,
|
|
648
706
|
t,
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
707
|
+
Ht,
|
|
708
|
+
Ar,
|
|
709
|
+
ft,
|
|
710
|
+
$t,
|
|
711
|
+
Qe,
|
|
712
|
+
J
|
|
655
713
|
]
|
|
656
|
-
),
|
|
657
|
-
(
|
|
658
|
-
if (
|
|
659
|
-
|
|
714
|
+
), kn = F(
|
|
715
|
+
(a) => {
|
|
716
|
+
if (we) {
|
|
717
|
+
cn.current = null, gr.current = null, sn.current = null, Tt.current = null, Sr(null), ln(on.current), ln(an.current);
|
|
660
718
|
return;
|
|
661
719
|
}
|
|
662
|
-
const
|
|
663
|
-
if (!
|
|
664
|
-
const d =
|
|
665
|
-
d && (
|
|
720
|
+
const u = Ir.current;
|
|
721
|
+
if (!u || a.pointerId !== 0 && a.pointerId !== u.pointerId) return;
|
|
722
|
+
const d = gt.current ?? te;
|
|
723
|
+
d && (ft(d[0], d[1], !0), q(d)), gt.current = null, be(null), Ir.current = null, O.current = null, L(null);
|
|
666
724
|
},
|
|
667
|
-
[
|
|
668
|
-
),
|
|
669
|
-
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
const
|
|
673
|
-
|
|
674
|
-
if (!
|
|
675
|
-
const
|
|
676
|
-
return window.addEventListener("pointermove",
|
|
677
|
-
window.removeEventListener("pointermove",
|
|
725
|
+
[we, te, ft, ln]
|
|
726
|
+
), Yn = Z(Nn);
|
|
727
|
+
Yn.current = Nn;
|
|
728
|
+
const En = Z(kn);
|
|
729
|
+
En.current = kn;
|
|
730
|
+
const Vn = g !== null || qe !== null;
|
|
731
|
+
Nt(() => {
|
|
732
|
+
if (!Vn) return;
|
|
733
|
+
const a = (d) => Yn.current(d), u = (d) => En.current(d);
|
|
734
|
+
return window.addEventListener("pointermove", a), window.addEventListener("pointerup", u), window.addEventListener("pointercancel", u), () => {
|
|
735
|
+
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", u), window.removeEventListener("pointercancel", u);
|
|
678
736
|
};
|
|
679
|
-
}, [
|
|
680
|
-
const
|
|
681
|
-
(
|
|
682
|
-
|
|
683
|
-
pointerId:
|
|
684
|
-
handle:
|
|
737
|
+
}, [Vn]);
|
|
738
|
+
const un = F(
|
|
739
|
+
(a, u, d) => {
|
|
740
|
+
Ir.current = {
|
|
741
|
+
pointerId: a,
|
|
742
|
+
handle: u,
|
|
685
743
|
startPointerPos: d,
|
|
686
|
-
startLowVal:
|
|
687
|
-
startHighVal:
|
|
688
|
-
},
|
|
744
|
+
startLowVal: he,
|
|
745
|
+
startHighVal: ve
|
|
746
|
+
}, O.current = u, L(u), u !== "connect" && C(u);
|
|
689
747
|
},
|
|
690
|
-
[
|
|
691
|
-
),
|
|
692
|
-
(
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
handle: s,
|
|
748
|
+
[he, ve]
|
|
749
|
+
), Hn = F(
|
|
750
|
+
(a, u, d) => {
|
|
751
|
+
j.current.mode === "vernier" && (sn.current = {
|
|
752
|
+
pointerId: a,
|
|
753
|
+
handle: u,
|
|
697
754
|
startPointerRatio: d,
|
|
698
|
-
startMacroLowRatio:
|
|
699
|
-
startMacroHighRatio:
|
|
700
|
-
startMicroLowRatio:
|
|
701
|
-
startMicroHighRatio:
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
initialMicroHighDate: ft
|
|
710
|
-
}, dt.current = s, fr(s), jt(s));
|
|
755
|
+
startMacroLowRatio: Ee,
|
|
756
|
+
startMacroHighRatio: je,
|
|
757
|
+
startMicroLowRatio: at,
|
|
758
|
+
startMicroHighRatio: Dt,
|
|
759
|
+
// 平行移動量は暦差分で求めるため、基準は表示しているマクロ値 (期間先頭・定義域内) でなければならない。
|
|
760
|
+
// 生の Props を基準にすると、期間の途中や定義域の外を指す開始日で日差分が半端になり、
|
|
761
|
+
// 動いていない押下でも丸めで 1 単位ずれる
|
|
762
|
+
startMacroLowDate: vt,
|
|
763
|
+
initialMicroLowDate: Lt,
|
|
764
|
+
initialMicroHighDate: St
|
|
765
|
+
}, Tt.current = u, Sr(u), Bt(u));
|
|
711
766
|
},
|
|
712
|
-
[
|
|
713
|
-
),
|
|
767
|
+
[Ee, je, at, Dt, vt, Lt, St]
|
|
768
|
+
), On = (a) => (u) => {
|
|
714
769
|
if (i) return;
|
|
715
|
-
|
|
716
|
-
const d =
|
|
717
|
-
|
|
718
|
-
},
|
|
719
|
-
i ||
|
|
720
|
-
},
|
|
721
|
-
i ||
|
|
722
|
-
},
|
|
770
|
+
u.stopPropagation(), u.preventDefault(), C(a);
|
|
771
|
+
const d = l ? u.clientY : u.clientX;
|
|
772
|
+
un(u.pointerId, a, d);
|
|
773
|
+
}, Fn = (a) => () => {
|
|
774
|
+
i || O.current !== null || C(a);
|
|
775
|
+
}, Cr = (a) => () => {
|
|
776
|
+
i || Tt.current !== null || Bt(a);
|
|
777
|
+
}, qt = (a) => (u) => {
|
|
723
778
|
if (i) return;
|
|
724
|
-
|
|
725
|
-
const d =
|
|
779
|
+
u.stopPropagation(), u.preventDefault();
|
|
780
|
+
const d = ct.current;
|
|
726
781
|
if (!d) return;
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
},
|
|
730
|
-
if (i ||
|
|
731
|
-
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
},
|
|
782
|
+
const f = Ht(u.clientX, u.clientY, d.getBoundingClientRect());
|
|
783
|
+
f !== null && Hn(u.pointerId, a, f);
|
|
784
|
+
}, Yo = (a) => {
|
|
785
|
+
if (i || I) return;
|
|
786
|
+
a.stopPropagation(), a.preventDefault();
|
|
787
|
+
const u = l ? a.clientY : a.clientX;
|
|
788
|
+
un(a.pointerId, "connect", u);
|
|
789
|
+
}, Eo = (a) => {
|
|
735
790
|
if (i) return;
|
|
736
|
-
if (
|
|
737
|
-
const
|
|
738
|
-
if (!
|
|
739
|
-
const
|
|
740
|
-
if (
|
|
741
|
-
const
|
|
742
|
-
|
|
791
|
+
if (we) {
|
|
792
|
+
const Y = ct.current;
|
|
793
|
+
if (!Y) return;
|
|
794
|
+
const ee = Y.getBoundingClientRect(), D = Ht(a.clientX, a.clientY, ee);
|
|
795
|
+
if (D === null) return;
|
|
796
|
+
const me = l ? a.clientX - (ee.left + ee.width / 2) : a.clientY - (ee.top + ee.height / 2), Ve = Ma(D, me, Ee, je, at, Dt, Yt, void 0, !I, V ? "point" : "range");
|
|
797
|
+
Hn(a.pointerId, Ve, D);
|
|
743
798
|
return;
|
|
744
799
|
}
|
|
745
|
-
const
|
|
746
|
-
if (
|
|
747
|
-
const d =
|
|
748
|
-
let
|
|
749
|
-
if (!
|
|
750
|
-
const
|
|
751
|
-
|
|
800
|
+
const u = Cn(a.clientX, a.clientY);
|
|
801
|
+
if (u === null) return;
|
|
802
|
+
const d = Ar(u);
|
|
803
|
+
let f = "low";
|
|
804
|
+
if (!J) {
|
|
805
|
+
const Y = Math.abs(d - he), ee = Math.abs(d - ve);
|
|
806
|
+
Y < ee ? f = "low" : ee < Y ? f = "high" : f = d > ve ? "high" : "low";
|
|
752
807
|
}
|
|
753
|
-
|
|
754
|
-
const [
|
|
755
|
-
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
},
|
|
759
|
-
if (i ||
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
762
|
-
const d =
|
|
763
|
-
|
|
764
|
-
},
|
|
765
|
-
|
|
766
|
-
},
|
|
808
|
+
C(f);
|
|
809
|
+
const [y, B] = lo(f, d, he, ve, k, A, J);
|
|
810
|
+
be([y, B]), ft(y, B, !0);
|
|
811
|
+
const H = l ? a.clientY : a.clientX;
|
|
812
|
+
un(a.pointerId, f, H);
|
|
813
|
+
}, Vo = (a) => {
|
|
814
|
+
if (i || g !== null) return;
|
|
815
|
+
const u = Cn(a.clientX, a.clientY);
|
|
816
|
+
if (u === null) return;
|
|
817
|
+
const d = Ar(u);
|
|
818
|
+
Ce(d), Ue(Pr(d));
|
|
819
|
+
}, Ho = () => {
|
|
820
|
+
Ce(null), Ue(null);
|
|
821
|
+
}, Un = (a) => (u) => {
|
|
767
822
|
if (i) return;
|
|
768
|
-
|
|
769
|
-
const d =
|
|
770
|
-
d && (
|
|
771
|
-
},
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
823
|
+
C(a);
|
|
824
|
+
const d = ga(u.key, a, he, ve, k, A, J, 1);
|
|
825
|
+
d && (u.preventDefault(), Fe || q(d), ft(d[0], d[1], !0));
|
|
826
|
+
}, jt = (a, u) => {
|
|
827
|
+
if (le === null) return;
|
|
828
|
+
const [d, f] = yt(U, w, [a, u], r, n), y = ge(w, d), B = ge(w, f), H = E ? rn(y, B) : [], Y = ge(w, le[0]), ee = ge(w, le[1]), D = Rt(le[0], H, y, B), me = Math.max(D, Rt(le[1], H, y, B));
|
|
829
|
+
D === Y && me === ee || Qe(ce(w, D), ce(w, me), !0);
|
|
830
|
+
}, Nr = (a) => (u) => {
|
|
831
|
+
if (i || !we || e.mode !== "vernier") return;
|
|
832
|
+
Bt(a);
|
|
833
|
+
let d = 0, f = !1, y = !1;
|
|
834
|
+
switch (u.key) {
|
|
779
835
|
case "ArrowRight":
|
|
780
836
|
case "ArrowUp":
|
|
781
837
|
d = 1;
|
|
@@ -791,538 +847,587 @@ const Ba = (e, t) => {
|
|
|
791
847
|
d = -5;
|
|
792
848
|
break;
|
|
793
849
|
case "Home":
|
|
794
|
-
|
|
850
|
+
f = !0;
|
|
795
851
|
break;
|
|
796
852
|
case "End":
|
|
797
|
-
|
|
853
|
+
y = !0;
|
|
798
854
|
break;
|
|
799
855
|
default:
|
|
800
856
|
return;
|
|
801
857
|
}
|
|
802
|
-
if (
|
|
803
|
-
const B =
|
|
804
|
-
if (
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
807
|
-
const
|
|
808
|
-
|
|
858
|
+
if (u.preventDefault(), a === "macro-low") {
|
|
859
|
+
const B = ce(U, We), H = ce(U, Be);
|
|
860
|
+
if (Vt) {
|
|
861
|
+
const D = pr(Te, U, B, Te[0], H, d, f, y);
|
|
862
|
+
if (D === Me(Te, B, U)) return;
|
|
863
|
+
const me = Te[D];
|
|
864
|
+
$t(me, H, !0), jt(me, H);
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
let Y;
|
|
868
|
+
if (f ? Y = $e : y ? Y = Be : Y = Math.max($e, Math.min(Be, We + d)), Y === We) return;
|
|
869
|
+
const ee = ce(U, Y);
|
|
870
|
+
$t(ee, H, !0), jt(ee, H);
|
|
871
|
+
} else if (a === "macro-high") {
|
|
872
|
+
const B = ce(U, We), H = ce(U, Be);
|
|
873
|
+
if (Vt) {
|
|
874
|
+
const D = pr(Te, U, H, B, Te[Te.length - 1], d, f, y);
|
|
875
|
+
if (D === Me(Te, H, U)) return;
|
|
876
|
+
const me = Te[D];
|
|
877
|
+
$t(B, me, !0), jt(B, me);
|
|
809
878
|
return;
|
|
810
879
|
}
|
|
811
|
-
let
|
|
812
|
-
if (
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
} else if (
|
|
816
|
-
const B =
|
|
817
|
-
if (
|
|
818
|
-
const
|
|
819
|
-
if (
|
|
820
|
-
|
|
821
|
-
It(B, be, !0), Mr(B, be);
|
|
880
|
+
let Y;
|
|
881
|
+
if (f ? Y = We : y ? Y = nt : Y = Math.max(We, Math.min(nt, Be + d)), Y === Be) return;
|
|
882
|
+
const ee = ce(U, Y);
|
|
883
|
+
$t(B, ee, !0), jt(B, ee);
|
|
884
|
+
} else if (a === "micro-low") {
|
|
885
|
+
const B = ce(w, Ne), H = ce(w, ze);
|
|
886
|
+
if (ot) {
|
|
887
|
+
const ee = pr(se, w, B, se[0], H, d, f, y);
|
|
888
|
+
if (ee === Me(se, B, w)) return;
|
|
889
|
+
Qe(se[ee], H, !0);
|
|
822
890
|
return;
|
|
823
891
|
}
|
|
824
|
-
let
|
|
825
|
-
if (
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
je(ce[j], K, !0);
|
|
892
|
+
let Y;
|
|
893
|
+
if (f ? Y = ye : y ? Y = ze : Y = Math.max(ye, Math.min(ze, Ne + d)), Y === Ne) return;
|
|
894
|
+
Qe(ce(w, Y), H, !0);
|
|
895
|
+
} else if (a === "micro-high") {
|
|
896
|
+
const B = ce(w, Ne), H = ce(w, ze);
|
|
897
|
+
if (ot) {
|
|
898
|
+
const ee = pr(se, w, H, B, se[se.length - 1], d, f, y);
|
|
899
|
+
if (ee === Me(se, H, w)) return;
|
|
900
|
+
Qe(B, se[ee], !0);
|
|
834
901
|
return;
|
|
835
902
|
}
|
|
836
|
-
let
|
|
837
|
-
if (
|
|
838
|
-
|
|
839
|
-
} else if (
|
|
840
|
-
const B =
|
|
841
|
-
if (
|
|
842
|
-
const
|
|
843
|
-
if (
|
|
844
|
-
|
|
903
|
+
let Y;
|
|
904
|
+
if (f ? Y = Ne : y ? Y = Pe : Y = Math.max(Ne, Math.min(Pe, ze + d)), Y === ze) return;
|
|
905
|
+
Qe(B, ce(w, Y), !0);
|
|
906
|
+
} else if (a === "micro-point") {
|
|
907
|
+
const B = ce(w, Ne);
|
|
908
|
+
if (ot) {
|
|
909
|
+
const Y = pr(se, w, B, se[0], se[se.length - 1], d, f, y);
|
|
910
|
+
if (Y === Me(se, B, w)) return;
|
|
911
|
+
Rn(se[Y], !0);
|
|
845
912
|
return;
|
|
846
913
|
}
|
|
847
|
-
let
|
|
848
|
-
if (
|
|
849
|
-
|
|
914
|
+
let H;
|
|
915
|
+
if (f ? H = ye : y ? H = Pe : H = Math.max(ye, Math.min(Pe, Ne + d)), H === Ne) return;
|
|
916
|
+
Rn(ce(w, H), !0);
|
|
917
|
+
}
|
|
918
|
+
}, Oo = (a) => {
|
|
919
|
+
if (e.mode !== "vernier") return;
|
|
920
|
+
if (Vt) {
|
|
921
|
+
const H = Te.length - 1, Y = Me(Te, vt, U), ee = Me(Te, Et, U), D = ee - Y;
|
|
922
|
+
let me = Y + a, Ve = ee + a;
|
|
923
|
+
if (a < 0 && me < 0 ? (me = 0, Ve = Math.min(H, D)) : a > 0 && Ve > H && (Ve = H, me = Math.max(0, H - D)), me === Y && Ve === ee) return;
|
|
924
|
+
const ut = Te[me], ke = Te[Ve];
|
|
925
|
+
$t(ut, ke, !0), jt(ut, ke);
|
|
926
|
+
return;
|
|
850
927
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
928
|
+
const u = Be - We;
|
|
929
|
+
let d = We + a, f = Be + a;
|
|
930
|
+
if (a < 0 && d < $e ? (d = $e, f = Math.min(nt, d + u)) : a > 0 && f > nt && (f = nt, d = Math.max($e, f - u)), d === We && f === Be) return;
|
|
931
|
+
const y = ce(U, d), B = ce(U, f);
|
|
932
|
+
$t(y, B, !0), jt(y, B);
|
|
933
|
+
}, dn = F(
|
|
934
|
+
(a) => {
|
|
935
|
+
const u = j.current;
|
|
936
|
+
if (!u.disabled)
|
|
937
|
+
if (u.mode === "point") {
|
|
938
|
+
const d = Math.max(k, Math.min(A, he + a));
|
|
939
|
+
Fe || q([d, d]), ft(d, d, !0);
|
|
940
|
+
} else if (u.mode === "vernier") {
|
|
941
|
+
if (ot) {
|
|
942
|
+
const D = se.length - 1, me = Me(se, Lt, w), Ve = Me(se, St, w), ut = Ve - me;
|
|
943
|
+
let ke = me + a, Re = Ve + a;
|
|
944
|
+
a < 0 && ke < 0 ? (ke = 0, Re = Math.min(D, ut)) : a > 0 && Re > D && (Re = D, ke = Math.max(0, D - ut)), (ke !== me || Re !== Ve) && Qe(se[ke], se[Re], !0);
|
|
863
945
|
return;
|
|
864
946
|
}
|
|
865
|
-
const d =
|
|
866
|
-
let
|
|
867
|
-
|
|
947
|
+
const d = Ne, f = ze, y = ye, B = Pe, H = f - d;
|
|
948
|
+
let Y = d + a, ee = f + a;
|
|
949
|
+
a < 0 && Y < y ? (Y = y, ee = Math.min(B, Y + H)) : a > 0 && ee > B && (ee = B, Y = Math.max(y, ee - H)), (Y !== d || ee !== f) && Qe(ce(w, Y), ce(w, ee), !0);
|
|
868
950
|
} else {
|
|
869
|
-
const d =
|
|
870
|
-
let
|
|
871
|
-
|
|
951
|
+
const d = ve - he;
|
|
952
|
+
let f = he + a, y = ve + a;
|
|
953
|
+
a < 0 && f < k ? (f = k, y = Math.min(A, f + d)) : a > 0 && y > A && (y = A, f = Math.max(k, y - d)), f <= y && (Fe || q([f, y]), ft(f, y, !0));
|
|
872
954
|
}
|
|
873
955
|
},
|
|
874
956
|
[
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
p,
|
|
957
|
+
he,
|
|
958
|
+
ve,
|
|
878
959
|
k,
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
960
|
+
A,
|
|
961
|
+
Fe,
|
|
962
|
+
ft,
|
|
963
|
+
Qe,
|
|
964
|
+
Ne,
|
|
965
|
+
ze,
|
|
883
966
|
ye,
|
|
884
967
|
Pe,
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
ft
|
|
968
|
+
w,
|
|
969
|
+
ot,
|
|
970
|
+
se,
|
|
971
|
+
Lt,
|
|
972
|
+
St
|
|
891
973
|
]
|
|
892
|
-
),
|
|
893
|
-
if (
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
974
|
+
), Wn = (a) => {
|
|
975
|
+
if (i || !a.shiftKey) return;
|
|
976
|
+
const u = wa(a.deltaX, a.deltaY, l);
|
|
977
|
+
if (u === 0) return;
|
|
978
|
+
if (a.preventDefault(), !we) {
|
|
979
|
+
dn(u);
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
const d = ct.current;
|
|
983
|
+
if (!d) return;
|
|
984
|
+
const f = d.getBoundingClientRect(), y = l ? a.clientX - (f.left + f.width / 2) : a.clientY - (f.top + f.height / 2);
|
|
985
|
+
if (To(y, Yt) === "macro") {
|
|
986
|
+
Oo(u);
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
dn(u);
|
|
990
|
+
}, Bn = Z(Wn);
|
|
991
|
+
Bn.current = Wn, Nt(() => {
|
|
992
|
+
const a = ct.current;
|
|
993
|
+
if (!a) return;
|
|
994
|
+
const u = (d) => Bn.current(d);
|
|
995
|
+
return a.addEventListener("wheel", u, { passive: !1 }), () => a.removeEventListener("wheel", u);
|
|
996
|
+
}, []);
|
|
997
|
+
const Gt = Pr(he), Zt = Pr(ve), mn = fe(he), fn = fe(ve), gn = v(() => J ? fr === null ? void 0 : { estimatedWidthPx: fr.widthPx, estimatedHeightPx: fr.heightPx } : Dn(fr, Sn), [J, fr, Sn]), kr = !J && he === ve, Ge = v(() => {
|
|
998
|
+
if (J || !S || l) return Tn(R, gn);
|
|
999
|
+
const a = xo(Gt, Zt, Kt, R, gn);
|
|
1000
|
+
return kr ? yo(a) : a;
|
|
1001
|
+
}, [J, kr, S, l, Gt, Zt, Kt, R, gn]), hr = g === "low" || g !== "high" && De === "low", br = !J && (g === "high" || g !== "low" && De === "high"), Yr = We === Be, Er = !V && Ne === ze, Fo = Yr && Ye !== "macro-low", Uo = Yr && Ye === "macro-low", Wo = Er && Ye !== "micro-low", Bo = Er && Ye === "micro-low", zn = N ? "top" : "bottom", _n = N ? "bottom" : "top", Xn = v(() => Dn($n, Pn), [$n, Pn]), Kn = v(() => Dn(An, In), [An, In]), hn = S && !l, Vr = v(
|
|
1002
|
+
() => co(Ee, je, Kt, zn, Xn, Yr, hn),
|
|
1003
|
+
[Ee, je, Kt, zn, Xn, Yr, hn]
|
|
1004
|
+
), qn = hn && !V, Hr = v(
|
|
1005
|
+
() => co(at, Dt, Kt, _n, Kn, Er, qn),
|
|
1006
|
+
[at, Dt, Kt, _n, Kn, Er, qn]
|
|
1007
|
+
), zo = v(() => l ? {
|
|
903
1008
|
"--ps-tooltip-origin": "100% 50%",
|
|
904
1009
|
"--ps-tooltip-tx": "0px",
|
|
905
1010
|
"--ps-tooltip-ty": "-50%",
|
|
906
1011
|
"--ps-tooltip-rot": "0deg"
|
|
907
1012
|
} : {
|
|
908
1013
|
"--ps-tooltip-origin": "50% 50%",
|
|
909
|
-
"--ps-tooltip-tx": `calc(-50% + ${
|
|
910
|
-
"--ps-tooltip-ty": `calc(-50% + ${
|
|
911
|
-
"--ps-tooltip-rot": `${
|
|
912
|
-
}, [
|
|
1014
|
+
"--ps-tooltip-tx": `calc(-50% + ${Ge.lowOffsetX}px)`,
|
|
1015
|
+
"--ps-tooltip-ty": `calc(-50% + ${Ge.lowOffsetY}px)`,
|
|
1016
|
+
"--ps-tooltip-rot": `${Ge.lowAngleDeg}deg`
|
|
1017
|
+
}, [l, Ge.lowOffsetX, Ge.lowOffsetY, Ge.lowAngleDeg]), _o = v(() => l ? {
|
|
913
1018
|
"--ps-tooltip-origin": "100% 50%",
|
|
914
1019
|
"--ps-tooltip-tx": "0px",
|
|
915
1020
|
"--ps-tooltip-ty": "-50%",
|
|
916
1021
|
"--ps-tooltip-rot": "0deg"
|
|
917
1022
|
} : {
|
|
918
1023
|
"--ps-tooltip-origin": "50% 50%",
|
|
919
|
-
"--ps-tooltip-tx": `calc(-50% + ${
|
|
920
|
-
"--ps-tooltip-ty": `calc(-50% + ${
|
|
921
|
-
"--ps-tooltip-rot": `${
|
|
922
|
-
}, [
|
|
923
|
-
bottom: `${
|
|
924
|
-
height: `${
|
|
1024
|
+
"--ps-tooltip-tx": `calc(-50% + ${Ge.highOffsetX}px)`,
|
|
1025
|
+
"--ps-tooltip-ty": `calc(-50% + ${Ge.highOffsetY}px)`,
|
|
1026
|
+
"--ps-tooltip-rot": `${Ge.highAngleDeg}deg`
|
|
1027
|
+
}, [l, Ge.highOffsetX, Ge.highOffsetY, Ge.highAngleDeg]), Or = Math.min(Gt, Zt), jn = Math.max(Gt, Zt), Xo = l ? {
|
|
1028
|
+
bottom: `${Or}%`,
|
|
1029
|
+
height: `${jn - Or}%`,
|
|
925
1030
|
top: "auto",
|
|
926
1031
|
left: "0",
|
|
927
1032
|
right: "0"
|
|
928
1033
|
} : {
|
|
929
|
-
left: `${
|
|
930
|
-
width: `${
|
|
1034
|
+
left: `${Or}%`,
|
|
1035
|
+
width: `${jn - Or}%`,
|
|
931
1036
|
top: "0",
|
|
932
1037
|
bottom: "0"
|
|
933
|
-
},
|
|
934
|
-
const
|
|
935
|
-
return /* @__PURE__ */
|
|
1038
|
+
}, Ko = Math.max(0.01, je - Ee), Gn = Math.max(0.06, Math.min(0.25, 0.28 * Math.sqrt(Ko))), qo = l ? { bottom: `${Gt}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: hr ? 40 : 30 } : { left: `${Gt}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: hr ? 40 : 30 }, jo = l ? { bottom: `${Zt}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: br ? 40 : 30 } : { left: `${Zt}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: br ? 40 : 30 }, Go = l ? { bottom: `${He}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${He}%`, top: "50%", transform: "translate(-50%, -50%)" }, Zn = G !== null ? fe(G) : null, Zo = m !== "hover" && G !== null && (G === he || !J && G === ve), Jo = ot ? ge(w, se[0]) : ye, Qo = ot ? ge(w, se[se.length - 1]) : Pe, ea = i || (we ? Ne <= Jo : J ? he <= k : he <= k && ve <= k), ta = i || (we ? ze >= Qo : (J || he >= A) && ve >= A), ht = V ? "micro-point" : "micro-low", Pt = i ? "cursor-not-allowed opacity-50" : "cursor-pointer", Jn = (a) => {
|
|
1039
|
+
const u = l ? "vertical" : "horizontal", d = a === "decrease", f = La[u][a];
|
|
1040
|
+
return /* @__PURE__ */ T(
|
|
936
1041
|
"button",
|
|
937
1042
|
{
|
|
938
1043
|
type: "button",
|
|
939
|
-
className: `period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${
|
|
940
|
-
onClick: () =>
|
|
941
|
-
disabled: d ?
|
|
942
|
-
"aria-label": d ?
|
|
943
|
-
children:
|
|
1044
|
+
className: `period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${f} flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-slate-300 bg-white font-bold text-[10px] text-slate-700 leading-none shadow-2xs transition-all hover:bg-slate-100 hover:text-indigo-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 active:scale-95 disabled:cursor-not-allowed disabled:opacity-30 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 ${Pt}`,
|
|
1045
|
+
onClick: () => dn(d ? -1 : 1),
|
|
1046
|
+
disabled: d ? ea : ta,
|
|
1047
|
+
"aria-label": d ? de : ie,
|
|
1048
|
+
children: Ra[u][a]
|
|
944
1049
|
}
|
|
945
1050
|
);
|
|
946
1051
|
};
|
|
947
|
-
return /* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ pe(
|
|
948
1053
|
"div",
|
|
949
1054
|
{
|
|
950
1055
|
style: e.style,
|
|
951
|
-
className: `period-slider flex select-none items-center gap-2 ${
|
|
1056
|
+
className: `period-slider flex select-none items-center gap-2 ${l ? "flex-col" : "flex-row"} ${c}`,
|
|
952
1057
|
"data-disabled": i ? "true" : void 0,
|
|
953
1058
|
"data-unit": t,
|
|
954
1059
|
"data-mode": e.mode,
|
|
955
|
-
"data-orientation":
|
|
956
|
-
"data-label-position":
|
|
957
|
-
"data-color-scheme":
|
|
1060
|
+
"data-orientation": l ? "vertical" : "horizontal",
|
|
1061
|
+
"data-label-position": R,
|
|
1062
|
+
"data-color-scheme": ae,
|
|
958
1063
|
children: [
|
|
959
|
-
h &&
|
|
960
|
-
/* @__PURE__ */
|
|
1064
|
+
h && Jn(l ? "increase" : "decrease"),
|
|
1065
|
+
/* @__PURE__ */ T(
|
|
961
1066
|
"div",
|
|
962
1067
|
{
|
|
963
|
-
ref:
|
|
1068
|
+
ref: ct,
|
|
964
1069
|
"data-testid": "period-slider-track",
|
|
965
|
-
"data-orientation":
|
|
966
|
-
"data-vernier-orientation":
|
|
967
|
-
className: `period-slider-track relative flex-1 touch-none rounded-full bg-slate-200 dark:bg-slate-700 ${
|
|
968
|
-
onPointerDown:
|
|
969
|
-
onPointerMove:
|
|
970
|
-
onPointerLeave:
|
|
971
|
-
children:
|
|
972
|
-
|
|
973
|
-
/* @__PURE__ */
|
|
974
|
-
/* @__PURE__ */
|
|
975
|
-
/* @__PURE__ */
|
|
1070
|
+
"data-orientation": l ? "vertical" : "horizontal",
|
|
1071
|
+
"data-vernier-orientation": we ? Yt : void 0,
|
|
1072
|
+
className: `period-slider-track relative flex-1 touch-none rounded-full bg-slate-200 dark:bg-slate-700 ${l ? "h-48 w-2" : "h-2 w-full"} ${Pt}`,
|
|
1073
|
+
onPointerDown: Eo,
|
|
1074
|
+
onPointerMove: Vo,
|
|
1075
|
+
onPointerLeave: Ho,
|
|
1076
|
+
children: we ? /* @__PURE__ */ pe(Mn, { children: [
|
|
1077
|
+
Jr && (l ? /* @__PURE__ */ pe("svg", { className: "period-slider-vernier-projection is-vertical", role: "presentation", "aria-hidden": "true", width: "32", height: "100%", viewBox: "0 0 32 100", preserveAspectRatio: "none", children: [
|
|
1078
|
+
/* @__PURE__ */ T("defs", { children: /* @__PURE__ */ pe("linearGradient", { id: ne, x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
1079
|
+
/* @__PURE__ */ T("stop", { offset: "0%", stopColor: N ? z.macro : z.micro, stopOpacity: "0.28" }),
|
|
1080
|
+
/* @__PURE__ */ T("stop", { offset: "100%", stopColor: N ? z.micro : z.macro, stopOpacity: Gn })
|
|
976
1081
|
] }) }),
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
] }) : /* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
1082
|
+
/* @__PURE__ */ T("polygon", { points: N ? `12,${(1 - je) * 100} 12,${(1 - Ee) * 100} 20,100 20,0` : `12,0 12,100 20,${(1 - Ee) * 100} 20,${(1 - je) * 100}`, fill: `url(#${ne})` })
|
|
1083
|
+
] }) : /* @__PURE__ */ pe("svg", { className: "period-slider-vernier-projection", role: "presentation", "aria-hidden": "true", width: "100%", height: "32", viewBox: "0 0 100 32", preserveAspectRatio: "none", children: [
|
|
1084
|
+
/* @__PURE__ */ T("defs", { children: /* @__PURE__ */ pe("linearGradient", { id: ne, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
1085
|
+
/* @__PURE__ */ T("stop", { offset: "0%", stopColor: N ? z.macro : z.micro, stopOpacity: "0.28" }),
|
|
1086
|
+
/* @__PURE__ */ T("stop", { offset: "100%", stopColor: N ? z.micro : z.macro, stopOpacity: Gn })
|
|
982
1087
|
] }) }),
|
|
983
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ T("polygon", { points: N ? `${Ee * 100},12 ${je * 100},12 100,20 0,20` : `0,12 100,12 ${je * 100},20 ${Ee * 100},20`, fill: `url(#${ne})` })
|
|
984
1089
|
] })),
|
|
985
|
-
!
|
|
986
|
-
/* @__PURE__ */
|
|
1090
|
+
!I && /* @__PURE__ */ pe(Mn, { children: [
|
|
1091
|
+
/* @__PURE__ */ T(
|
|
987
1092
|
"div",
|
|
988
1093
|
{
|
|
989
1094
|
"data-testid": "period-slider-connect-macro",
|
|
990
1095
|
className: "period-slider-connect-macro",
|
|
991
|
-
style:
|
|
992
|
-
bottom: `calc(${
|
|
993
|
-
height: `calc(${Math.max(0, (
|
|
1096
|
+
style: l ? {
|
|
1097
|
+
bottom: `calc(${Ee * 100}% - 8px)`,
|
|
1098
|
+
height: `calc(${Math.max(0, (je - Ee) * 100)}% + 16px)`
|
|
994
1099
|
} : {
|
|
995
|
-
left: `calc(${
|
|
996
|
-
width: `calc(${Math.max(0, (
|
|
1100
|
+
left: `calc(${Ee * 100}% - 8px)`,
|
|
1101
|
+
width: `calc(${Math.max(0, (je - Ee) * 100)}% + 16px)`
|
|
997
1102
|
},
|
|
998
|
-
onPointerDown:
|
|
1103
|
+
onPointerDown: qt("macro-connect")
|
|
999
1104
|
}
|
|
1000
1105
|
),
|
|
1001
|
-
/* @__PURE__ */
|
|
1106
|
+
!V && /* @__PURE__ */ T(
|
|
1002
1107
|
"div",
|
|
1003
1108
|
{
|
|
1004
1109
|
"data-testid": "period-slider-connect-micro",
|
|
1005
1110
|
className: "period-slider-connect-micro",
|
|
1006
|
-
style:
|
|
1007
|
-
bottom: `calc(${
|
|
1008
|
-
height: `calc(${Math.max(0, (
|
|
1111
|
+
style: l ? {
|
|
1112
|
+
bottom: `calc(${at * 100}% - 8px)`,
|
|
1113
|
+
height: `calc(${Math.max(0, (Dt - at) * 100)}% + 16px)`
|
|
1009
1114
|
} : {
|
|
1010
|
-
left: `calc(${
|
|
1011
|
-
width: `calc(${Math.max(0, (
|
|
1115
|
+
left: `calc(${at * 100}% - 8px)`,
|
|
1116
|
+
width: `calc(${Math.max(0, (Dt - at) * 100)}% + 16px)`
|
|
1012
1117
|
},
|
|
1013
|
-
onPointerDown:
|
|
1118
|
+
onPointerDown: qt("micro-connect")
|
|
1014
1119
|
}
|
|
1015
1120
|
)
|
|
1016
1121
|
] }),
|
|
1017
|
-
|
|
1018
|
-
[0.2, 0.4, 0.6, 0.8].map((
|
|
1019
|
-
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((
|
|
1122
|
+
Qr && /* @__PURE__ */ pe("div", { className: "period-slider-vernier-ticks pointer-events-none absolute inset-0", children: [
|
|
1123
|
+
[0.2, 0.4, 0.6, 0.8].map((a) => /* @__PURE__ */ T("div", { "data-testid": "period-slider-tick", "data-tick-scale": "macro", className: "period-slider-tick period-slider-tick-macro", style: l ? { bottom: `${a * 100}%` } : { left: `${a * 100}%` } }, `macro-tick-${a}`)),
|
|
1124
|
+
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((a) => /* @__PURE__ */ T("div", { "data-testid": "period-slider-tick", "data-tick-scale": "micro", className: "period-slider-tick period-slider-tick-micro", style: l ? { bottom: `${a * 100}%` } : { left: `${a * 100}%` } }, `micro-tick-${a}`))
|
|
1020
1125
|
] }),
|
|
1021
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ pe(
|
|
1022
1127
|
"div",
|
|
1023
1128
|
{
|
|
1024
1129
|
tabIndex: i ? -1 : 0,
|
|
1025
1130
|
role: "slider",
|
|
1026
1131
|
"aria-label": e.macroLowerAriaLabel ?? "Macro range start",
|
|
1027
1132
|
"aria-disabled": i ? "true" : void 0,
|
|
1028
|
-
"aria-valuemin":
|
|
1029
|
-
"aria-valuemax":
|
|
1030
|
-
"aria-valuenow":
|
|
1031
|
-
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(
|
|
1032
|
-
"aria-orientation":
|
|
1033
|
-
className: `period-slider-handle period-slider-handle-vernier ${
|
|
1034
|
-
style:
|
|
1035
|
-
bottom: `${
|
|
1036
|
-
left:
|
|
1037
|
-
right:
|
|
1038
|
-
transform:
|
|
1039
|
-
zIndex:
|
|
1133
|
+
"aria-valuemin": $e,
|
|
1134
|
+
"aria-valuemax": Be,
|
|
1135
|
+
"aria-valuenow": We,
|
|
1136
|
+
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(vt, U) : nr(U, vt, mt, $),
|
|
1137
|
+
"aria-orientation": l ? "vertical" : "horizontal",
|
|
1138
|
+
className: `period-slider-handle period-slider-handle-vernier ${l ? "is-vertical" : ""} group absolute touch-none ${l ? N ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : N ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${Pt}`,
|
|
1139
|
+
style: l ? {
|
|
1140
|
+
bottom: `${Ee * 100}%`,
|
|
1141
|
+
left: N ? 0 : "auto",
|
|
1142
|
+
right: N ? "auto" : 0,
|
|
1143
|
+
transform: N ? "translate(-100%, 50%)" : "translate(100%, 50%)",
|
|
1144
|
+
zIndex: qe === "macro-low" || Ye === "macro-low" ? 30 : 15
|
|
1040
1145
|
} : {
|
|
1041
|
-
left: `${
|
|
1042
|
-
top:
|
|
1043
|
-
bottom:
|
|
1044
|
-
transform:
|
|
1045
|
-
zIndex:
|
|
1146
|
+
left: `${Ee * 100}%`,
|
|
1147
|
+
top: N ? 0 : "auto",
|
|
1148
|
+
bottom: N ? "auto" : 0,
|
|
1149
|
+
transform: N ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
|
|
1150
|
+
zIndex: qe === "macro-low" || Ye === "macro-low" ? 30 : 15
|
|
1046
1151
|
},
|
|
1047
|
-
onPointerDown:
|
|
1048
|
-
onKeyDown:
|
|
1049
|
-
onFocus:
|
|
1050
|
-
"data-active":
|
|
1051
|
-
"data-front":
|
|
1052
|
-
"data-vernier-pos":
|
|
1152
|
+
onPointerDown: qt("macro-low"),
|
|
1153
|
+
onKeyDown: Nr("macro-low"),
|
|
1154
|
+
onFocus: Cr("macro-low"),
|
|
1155
|
+
"data-active": qe === "macro-low" ? "true" : void 0,
|
|
1156
|
+
"data-front": Ye === "macro-low" ? "true" : void 0,
|
|
1157
|
+
"data-vernier-pos": l ? N ? "left" : "right" : N ? "top" : "bottom",
|
|
1053
1158
|
"data-handle-type": "macro-low",
|
|
1054
1159
|
children: [
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
-
|
|
1057
|
-
m !== "hover" && /* @__PURE__ */
|
|
1160
|
+
/* @__PURE__ */ T(yr, { type: "macro", isTop: N, isVertical: l, isLeft: N }),
|
|
1161
|
+
Mt && /* @__PURE__ */ T("div", { className: "period-slider-hairline" }),
|
|
1162
|
+
m !== "hover" && /* @__PURE__ */ T(
|
|
1058
1163
|
"div",
|
|
1059
1164
|
{
|
|
1060
1165
|
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1061
1166
|
"data-tooltip-style": m,
|
|
1062
|
-
"data-duplicate":
|
|
1063
|
-
"data-slanted":
|
|
1064
|
-
ref:
|
|
1065
|
-
style:
|
|
1066
|
-
children:
|
|
1167
|
+
"data-duplicate": Fo ? "true" : void 0,
|
|
1168
|
+
"data-slanted": Vr.slant.isSlanted ? "true" : void 0,
|
|
1169
|
+
ref: Io,
|
|
1170
|
+
style: Vr.lowStyle,
|
|
1171
|
+
children: et(U, vt, mt, $)
|
|
1067
1172
|
}
|
|
1068
1173
|
)
|
|
1069
1174
|
]
|
|
1070
1175
|
}
|
|
1071
1176
|
),
|
|
1072
|
-
/* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ pe(
|
|
1073
1178
|
"div",
|
|
1074
1179
|
{
|
|
1075
1180
|
tabIndex: i ? -1 : 0,
|
|
1076
1181
|
role: "slider",
|
|
1077
1182
|
"aria-label": e.macroUpperAriaLabel ?? "Macro range end",
|
|
1078
1183
|
"aria-disabled": i ? "true" : void 0,
|
|
1079
|
-
"aria-valuemin":
|
|
1080
|
-
"aria-valuemax":
|
|
1081
|
-
"aria-valuenow":
|
|
1082
|
-
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(
|
|
1083
|
-
"aria-orientation":
|
|
1084
|
-
className: `period-slider-handle period-slider-handle-vernier ${
|
|
1085
|
-
style:
|
|
1086
|
-
bottom: `${
|
|
1087
|
-
left:
|
|
1088
|
-
right:
|
|
1089
|
-
transform:
|
|
1090
|
-
zIndex:
|
|
1184
|
+
"aria-valuemin": We,
|
|
1185
|
+
"aria-valuemax": nt,
|
|
1186
|
+
"aria-valuenow": Be,
|
|
1187
|
+
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Et, U) : nr(U, Et, mt, $),
|
|
1188
|
+
"aria-orientation": l ? "vertical" : "horizontal",
|
|
1189
|
+
className: `period-slider-handle period-slider-handle-vernier ${l ? "is-vertical" : ""} group absolute touch-none ${l ? N ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : N ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${Pt}`,
|
|
1190
|
+
style: l ? {
|
|
1191
|
+
bottom: `${je * 100}%`,
|
|
1192
|
+
left: N ? 0 : "auto",
|
|
1193
|
+
right: N ? "auto" : 0,
|
|
1194
|
+
transform: N ? "translate(-100%, 50%)" : "translate(100%, 50%)",
|
|
1195
|
+
zIndex: qe === "macro-high" || Ye === "macro-high" ? 30 : 15
|
|
1091
1196
|
} : {
|
|
1092
|
-
left: `${
|
|
1093
|
-
top:
|
|
1094
|
-
bottom:
|
|
1095
|
-
transform:
|
|
1096
|
-
zIndex:
|
|
1197
|
+
left: `${je * 100}%`,
|
|
1198
|
+
top: N ? 0 : "auto",
|
|
1199
|
+
bottom: N ? "auto" : 0,
|
|
1200
|
+
transform: N ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
|
|
1201
|
+
zIndex: qe === "macro-high" || Ye === "macro-high" ? 30 : 15
|
|
1097
1202
|
},
|
|
1098
|
-
onPointerDown:
|
|
1099
|
-
onKeyDown:
|
|
1100
|
-
onFocus:
|
|
1101
|
-
"data-active":
|
|
1102
|
-
"data-front":
|
|
1103
|
-
"data-vernier-pos":
|
|
1203
|
+
onPointerDown: qt("macro-high"),
|
|
1204
|
+
onKeyDown: Nr("macro-high"),
|
|
1205
|
+
onFocus: Cr("macro-high"),
|
|
1206
|
+
"data-active": qe === "macro-high" ? "true" : void 0,
|
|
1207
|
+
"data-front": Ye === "macro-high" ? "true" : void 0,
|
|
1208
|
+
"data-vernier-pos": l ? N ? "left" : "right" : N ? "top" : "bottom",
|
|
1104
1209
|
"data-handle-type": "macro-high",
|
|
1105
1210
|
children: [
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
|
|
1108
|
-
m !== "hover" && /* @__PURE__ */
|
|
1211
|
+
/* @__PURE__ */ T(yr, { type: "macro", isTop: N, isVertical: l, isLeft: N }),
|
|
1212
|
+
Mt && /* @__PURE__ */ T("div", { className: "period-slider-hairline" }),
|
|
1213
|
+
m !== "hover" && /* @__PURE__ */ T(
|
|
1109
1214
|
"div",
|
|
1110
1215
|
{
|
|
1111
1216
|
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1112
1217
|
"data-tooltip-style": m,
|
|
1113
|
-
"data-duplicate":
|
|
1114
|
-
"data-slanted":
|
|
1115
|
-
ref:
|
|
1116
|
-
style:
|
|
1117
|
-
children:
|
|
1218
|
+
"data-duplicate": Uo ? "true" : void 0,
|
|
1219
|
+
"data-slanted": Vr.slant.isSlanted ? "true" : void 0,
|
|
1220
|
+
ref: Co,
|
|
1221
|
+
style: Vr.highStyle,
|
|
1222
|
+
children: et(U, Et, mt, $)
|
|
1118
1223
|
}
|
|
1119
1224
|
)
|
|
1120
1225
|
]
|
|
1121
1226
|
}
|
|
1122
1227
|
),
|
|
1123
|
-
/* @__PURE__ */
|
|
1228
|
+
/* @__PURE__ */ pe(
|
|
1124
1229
|
"div",
|
|
1125
1230
|
{
|
|
1126
1231
|
tabIndex: i ? -1 : 0,
|
|
1127
1232
|
role: "slider",
|
|
1128
|
-
"aria-label": e.lowerAriaLabel ?? "Micro range start",
|
|
1233
|
+
"aria-label": V ? e.pointAriaLabel ?? "Micro selected date" : e.lowerAriaLabel ?? "Micro range start",
|
|
1129
1234
|
"aria-disabled": i ? "true" : void 0,
|
|
1130
|
-
"aria-valuemin":
|
|
1131
|
-
"aria-valuemax":
|
|
1132
|
-
"aria-valuenow":
|
|
1133
|
-
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(
|
|
1134
|
-
"aria-orientation":
|
|
1135
|
-
className: `period-slider-handle period-slider-handle-vernier ${
|
|
1136
|
-
style:
|
|
1137
|
-
bottom: `${
|
|
1138
|
-
left:
|
|
1139
|
-
right:
|
|
1140
|
-
transform:
|
|
1141
|
-
zIndex:
|
|
1235
|
+
"aria-valuemin": ye,
|
|
1236
|
+
"aria-valuemax": V ? Pe : ze,
|
|
1237
|
+
"aria-valuenow": Ne,
|
|
1238
|
+
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Lt, w) : nr(w, Lt, rt, $),
|
|
1239
|
+
"aria-orientation": l ? "vertical" : "horizontal",
|
|
1240
|
+
className: `period-slider-handle period-slider-handle-vernier ${l ? "is-vertical" : ""} group absolute touch-none ${l ? N ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : N ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${Pt}`,
|
|
1241
|
+
style: l ? {
|
|
1242
|
+
bottom: `${at * 100}%`,
|
|
1243
|
+
left: N ? "auto" : 0,
|
|
1244
|
+
right: N ? 0 : "auto",
|
|
1245
|
+
transform: N ? "translate(100%, 50%)" : "translate(-100%, 50%)",
|
|
1246
|
+
zIndex: qe === ht || Ye === ht ? 30 : 20
|
|
1142
1247
|
} : {
|
|
1143
|
-
left: `${
|
|
1144
|
-
top:
|
|
1145
|
-
bottom:
|
|
1146
|
-
transform:
|
|
1147
|
-
zIndex:
|
|
1248
|
+
left: `${at * 100}%`,
|
|
1249
|
+
top: N ? "auto" : 0,
|
|
1250
|
+
bottom: N ? 0 : "auto",
|
|
1251
|
+
transform: N ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
|
|
1252
|
+
zIndex: qe === ht || Ye === ht ? 30 : 20
|
|
1148
1253
|
},
|
|
1149
|
-
onPointerDown:
|
|
1150
|
-
onKeyDown:
|
|
1151
|
-
onFocus:
|
|
1152
|
-
"data-active":
|
|
1153
|
-
"data-front":
|
|
1154
|
-
"data-vernier-pos":
|
|
1155
|
-
"data-handle-type":
|
|
1254
|
+
onPointerDown: qt(ht),
|
|
1255
|
+
onKeyDown: Nr(ht),
|
|
1256
|
+
onFocus: Cr(ht),
|
|
1257
|
+
"data-active": qe === ht ? "true" : void 0,
|
|
1258
|
+
"data-front": Ye === ht ? "true" : void 0,
|
|
1259
|
+
"data-vernier-pos": l ? N ? "right" : "left" : N ? "bottom" : "top",
|
|
1260
|
+
"data-handle-type": ht,
|
|
1156
1261
|
children: [
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
|
|
1159
|
-
m !== "hover" && /* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ T(yr, { type: "micro", isTop: !N, isVertical: l, isLeft: !N }),
|
|
1263
|
+
Mt && /* @__PURE__ */ T("div", { className: "period-slider-hairline" }),
|
|
1264
|
+
m !== "hover" && /* @__PURE__ */ T(
|
|
1160
1265
|
"div",
|
|
1161
1266
|
{
|
|
1162
1267
|
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1163
1268
|
"data-tooltip-style": m,
|
|
1164
|
-
"data-duplicate":
|
|
1165
|
-
"data-slanted":
|
|
1166
|
-
ref:
|
|
1167
|
-
style:
|
|
1168
|
-
children:
|
|
1269
|
+
"data-duplicate": Wo ? "true" : void 0,
|
|
1270
|
+
"data-slanted": Hr.slant.isSlanted ? "true" : void 0,
|
|
1271
|
+
ref: No,
|
|
1272
|
+
style: Hr.lowStyle,
|
|
1273
|
+
children: et(w, Lt, rt, $)
|
|
1169
1274
|
}
|
|
1170
1275
|
)
|
|
1171
1276
|
]
|
|
1172
1277
|
}
|
|
1173
1278
|
),
|
|
1174
|
-
/* @__PURE__ */
|
|
1279
|
+
!V && /* @__PURE__ */ pe(
|
|
1175
1280
|
"div",
|
|
1176
1281
|
{
|
|
1177
1282
|
tabIndex: i ? -1 : 0,
|
|
1178
1283
|
role: "slider",
|
|
1179
1284
|
"aria-label": e.upperAriaLabel ?? "Micro range end",
|
|
1180
1285
|
"aria-disabled": i ? "true" : void 0,
|
|
1181
|
-
"aria-valuemin":
|
|
1182
|
-
"aria-valuemax":
|
|
1183
|
-
"aria-valuenow":
|
|
1184
|
-
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(
|
|
1185
|
-
"aria-orientation":
|
|
1186
|
-
className: `period-slider-handle period-slider-handle-vernier ${
|
|
1187
|
-
style:
|
|
1188
|
-
bottom: `${
|
|
1189
|
-
left:
|
|
1190
|
-
right:
|
|
1191
|
-
transform:
|
|
1192
|
-
zIndex:
|
|
1286
|
+
"aria-valuemin": Ne,
|
|
1287
|
+
"aria-valuemax": Pe,
|
|
1288
|
+
"aria-valuenow": ze,
|
|
1289
|
+
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(St, w) : nr(w, St, rt, $),
|
|
1290
|
+
"aria-orientation": l ? "vertical" : "horizontal",
|
|
1291
|
+
className: `period-slider-handle period-slider-handle-vernier ${l ? "is-vertical" : ""} group absolute touch-none ${l ? N ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : N ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${Pt}`,
|
|
1292
|
+
style: l ? {
|
|
1293
|
+
bottom: `${Dt * 100}%`,
|
|
1294
|
+
left: N ? "auto" : 0,
|
|
1295
|
+
right: N ? 0 : "auto",
|
|
1296
|
+
transform: N ? "translate(100%, 50%)" : "translate(-100%, 50%)",
|
|
1297
|
+
zIndex: qe === "micro-high" || Ye === "micro-high" ? 30 : 20
|
|
1193
1298
|
} : {
|
|
1194
|
-
left: `${
|
|
1195
|
-
top:
|
|
1196
|
-
bottom:
|
|
1197
|
-
transform:
|
|
1198
|
-
zIndex:
|
|
1299
|
+
left: `${Dt * 100}%`,
|
|
1300
|
+
top: N ? "auto" : 0,
|
|
1301
|
+
bottom: N ? 0 : "auto",
|
|
1302
|
+
transform: N ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
|
|
1303
|
+
zIndex: qe === "micro-high" || Ye === "micro-high" ? 30 : 20
|
|
1199
1304
|
},
|
|
1200
|
-
onPointerDown:
|
|
1201
|
-
onKeyDown:
|
|
1202
|
-
onFocus:
|
|
1203
|
-
"data-active":
|
|
1204
|
-
"data-front":
|
|
1205
|
-
"data-vernier-pos":
|
|
1305
|
+
onPointerDown: qt("micro-high"),
|
|
1306
|
+
onKeyDown: Nr("micro-high"),
|
|
1307
|
+
onFocus: Cr("micro-high"),
|
|
1308
|
+
"data-active": qe === "micro-high" ? "true" : void 0,
|
|
1309
|
+
"data-front": Ye === "micro-high" ? "true" : void 0,
|
|
1310
|
+
"data-vernier-pos": l ? N ? "right" : "left" : N ? "bottom" : "top",
|
|
1206
1311
|
"data-handle-type": "micro-high",
|
|
1207
1312
|
children: [
|
|
1208
|
-
/* @__PURE__ */
|
|
1209
|
-
|
|
1210
|
-
m !== "hover" && /* @__PURE__ */
|
|
1313
|
+
/* @__PURE__ */ T(yr, { type: "micro", isTop: !N, isVertical: l, isLeft: !N }),
|
|
1314
|
+
Mt && /* @__PURE__ */ T("div", { className: "period-slider-hairline" }),
|
|
1315
|
+
m !== "hover" && /* @__PURE__ */ T(
|
|
1211
1316
|
"div",
|
|
1212
1317
|
{
|
|
1213
1318
|
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1214
1319
|
"data-tooltip-style": m,
|
|
1215
|
-
"data-duplicate":
|
|
1216
|
-
"data-slanted":
|
|
1217
|
-
ref:
|
|
1218
|
-
style:
|
|
1219
|
-
children:
|
|
1320
|
+
"data-duplicate": Bo ? "true" : void 0,
|
|
1321
|
+
"data-slanted": Hr.slant.isSlanted ? "true" : void 0,
|
|
1322
|
+
ref: ko,
|
|
1323
|
+
style: Hr.highStyle,
|
|
1324
|
+
children: et(w, St, rt, $)
|
|
1220
1325
|
}
|
|
1221
1326
|
)
|
|
1222
1327
|
]
|
|
1223
1328
|
}
|
|
1224
1329
|
)
|
|
1225
|
-
] }) : /* @__PURE__ */
|
|
1226
|
-
!
|
|
1227
|
-
|
|
1228
|
-
const d =
|
|
1229
|
-
return /* @__PURE__ */
|
|
1330
|
+
] }) : /* @__PURE__ */ pe(Mn, { children: [
|
|
1331
|
+
!I && /* @__PURE__ */ T("div", { "data-testid": "period-slider-connect", className: "period-slider-connect absolute rounded-full", style: Xo, onPointerDown: Yo }),
|
|
1332
|
+
re && x && M.length > 1 && /* @__PURE__ */ T("div", { className: "period-slider-ticks pointer-events-none absolute inset-0", children: M.map((a, u) => {
|
|
1333
|
+
const d = ge(t, a), f = Pr(u), y = l ? { bottom: `${f}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${f}%`, top: "50%", transform: "translate(-50%, -50%)" };
|
|
1334
|
+
return /* @__PURE__ */ T("div", { "data-testid": "period-slider-tick", className: "period-slider-tick absolute h-1.5 w-1.5 rounded-full bg-slate-400/60 dark:bg-slate-500/60", style: y }, `tick-${d}`);
|
|
1230
1335
|
}) }),
|
|
1231
|
-
!i &&
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1336
|
+
!i && G !== null && He !== null && g === null && Zn && /* @__PURE__ */ pe("div", { "data-testid": "period-slider-hover-guide", className: "period-slider-hover-guide pointer-events-none absolute h-2 w-2", style: Go, children: [
|
|
1337
|
+
/* @__PURE__ */ T("div", { "data-testid": "period-slider-hover-dot", className: "period-slider-hover-dot h-full w-full rounded-full border border-white/80 bg-[var(--aqps-accent-light)] shadow-[0_0_6px_var(--aqps-accent-glow)] dark:border-slate-800" }),
|
|
1338
|
+
/* @__PURE__ */ T(
|
|
1234
1339
|
"div",
|
|
1235
1340
|
{
|
|
1236
1341
|
"data-testid": "period-slider-hover-tooltip",
|
|
1237
|
-
"data-duplicate":
|
|
1238
|
-
className: `period-slider-hover-tooltip ${
|
|
1239
|
-
children:
|
|
1342
|
+
"data-duplicate": Zo ? "true" : void 0,
|
|
1343
|
+
className: `period-slider-hover-tooltip ${R === "bottom" && !l ? "period-slider-hover-tooltip-bottom" : ""} rounded bg-slate-800/90 px-2 py-0.5 font-medium text-white text-xs shadow-lg backdrop-blur-xs dark:bg-slate-900/90`,
|
|
1344
|
+
children: et(t, Zn, e.formatLabel, $)
|
|
1240
1345
|
}
|
|
1241
1346
|
)
|
|
1242
1347
|
] }),
|
|
1243
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ pe(
|
|
1244
1349
|
"div",
|
|
1245
1350
|
{
|
|
1246
1351
|
tabIndex: i ? -1 : 0,
|
|
1247
1352
|
role: "slider",
|
|
1248
|
-
"aria-label":
|
|
1353
|
+
"aria-label": J ? e.pointAriaLabel ?? "Selected date" : e.lowerAriaLabel ?? "Range start",
|
|
1249
1354
|
"aria-disabled": i ? "true" : void 0,
|
|
1250
|
-
"aria-valuemin":
|
|
1251
|
-
"aria-valuemax":
|
|
1252
|
-
"aria-valuenow":
|
|
1253
|
-
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(
|
|
1254
|
-
"aria-orientation":
|
|
1255
|
-
className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${
|
|
1256
|
-
style:
|
|
1257
|
-
onPointerDown:
|
|
1258
|
-
onKeyDown:
|
|
1259
|
-
onFocus:
|
|
1260
|
-
"data-active":
|
|
1261
|
-
"data-front":
|
|
1355
|
+
"aria-valuemin": k,
|
|
1356
|
+
"aria-valuemax": J ? A : ve,
|
|
1357
|
+
"aria-valuenow": he,
|
|
1358
|
+
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(mn, t) : nr(t, mn, e.formatLabel, $),
|
|
1359
|
+
"aria-orientation": l ? "vertical" : "horizontal",
|
|
1360
|
+
className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${Pt}`,
|
|
1361
|
+
style: qo,
|
|
1362
|
+
onPointerDown: On("low"),
|
|
1363
|
+
onKeyDown: Un("low"),
|
|
1364
|
+
onFocus: Fn("low"),
|
|
1365
|
+
"data-active": g === "low" ? "true" : void 0,
|
|
1366
|
+
"data-front": hr ? "true" : void 0,
|
|
1262
1367
|
children: [
|
|
1263
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ T(
|
|
1264
1369
|
"div",
|
|
1265
1370
|
{
|
|
1266
1371
|
"data-testid": "period-slider-knob",
|
|
1267
|
-
className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${
|
|
1372
|
+
className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${g === "low" ? "" : "shadow-md"}`
|
|
1268
1373
|
}
|
|
1269
1374
|
),
|
|
1270
|
-
m !== "hover" && /* @__PURE__ */
|
|
1375
|
+
m !== "hover" && /* @__PURE__ */ T(
|
|
1271
1376
|
"div",
|
|
1272
1377
|
{
|
|
1273
1378
|
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1274
1379
|
"data-tooltip-style": m,
|
|
1275
|
-
"data-label-position":
|
|
1276
|
-
"data-slanted":
|
|
1277
|
-
"data-front":
|
|
1278
|
-
"data-duplicate":
|
|
1279
|
-
ref:
|
|
1280
|
-
style:
|
|
1281
|
-
children:
|
|
1380
|
+
"data-label-position": R,
|
|
1381
|
+
"data-slanted": Ge.isSlanted ? "true" : void 0,
|
|
1382
|
+
"data-front": hr ? "true" : void 0,
|
|
1383
|
+
"data-duplicate": kr && !hr ? "true" : void 0,
|
|
1384
|
+
ref: Po,
|
|
1385
|
+
style: zo,
|
|
1386
|
+
children: et(t, mn, e.formatLabel, $)
|
|
1282
1387
|
}
|
|
1283
1388
|
)
|
|
1284
1389
|
]
|
|
1285
1390
|
}
|
|
1286
1391
|
),
|
|
1287
|
-
!
|
|
1392
|
+
!J && /* @__PURE__ */ pe(
|
|
1288
1393
|
"div",
|
|
1289
1394
|
{
|
|
1290
1395
|
tabIndex: i ? -1 : 0,
|
|
1291
1396
|
role: "slider",
|
|
1292
1397
|
"aria-label": e.upperAriaLabel ?? "Range end",
|
|
1293
1398
|
"aria-disabled": i ? "true" : void 0,
|
|
1294
|
-
"aria-valuemin":
|
|
1295
|
-
"aria-valuemax":
|
|
1296
|
-
"aria-valuenow":
|
|
1297
|
-
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(
|
|
1298
|
-
"aria-orientation":
|
|
1299
|
-
className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${
|
|
1300
|
-
style:
|
|
1301
|
-
onPointerDown:
|
|
1302
|
-
onKeyDown:
|
|
1303
|
-
onFocus:
|
|
1304
|
-
"data-active":
|
|
1305
|
-
"data-front":
|
|
1399
|
+
"aria-valuemin": he,
|
|
1400
|
+
"aria-valuemax": A,
|
|
1401
|
+
"aria-valuenow": ve,
|
|
1402
|
+
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(fn, t) : nr(t, fn, e.formatLabel, $),
|
|
1403
|
+
"aria-orientation": l ? "vertical" : "horizontal",
|
|
1404
|
+
className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${Pt}`,
|
|
1405
|
+
style: jo,
|
|
1406
|
+
onPointerDown: On("high"),
|
|
1407
|
+
onKeyDown: Un("high"),
|
|
1408
|
+
onFocus: Fn("high"),
|
|
1409
|
+
"data-active": g === "high" ? "true" : void 0,
|
|
1410
|
+
"data-front": br ? "true" : void 0,
|
|
1306
1411
|
children: [
|
|
1307
|
-
/* @__PURE__ */
|
|
1412
|
+
/* @__PURE__ */ T(
|
|
1308
1413
|
"div",
|
|
1309
1414
|
{
|
|
1310
1415
|
"data-testid": "period-slider-knob",
|
|
1311
|
-
className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${
|
|
1416
|
+
className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${g === "high" ? "" : "shadow-md"}`
|
|
1312
1417
|
}
|
|
1313
1418
|
),
|
|
1314
|
-
m !== "hover" && /* @__PURE__ */
|
|
1419
|
+
m !== "hover" && /* @__PURE__ */ T(
|
|
1315
1420
|
"div",
|
|
1316
1421
|
{
|
|
1317
1422
|
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1318
1423
|
"data-tooltip-style": m,
|
|
1319
|
-
"data-label-position":
|
|
1320
|
-
"data-slanted":
|
|
1321
|
-
"data-front":
|
|
1322
|
-
"data-duplicate":
|
|
1323
|
-
ref:
|
|
1324
|
-
style:
|
|
1325
|
-
children:
|
|
1424
|
+
"data-label-position": R,
|
|
1425
|
+
"data-slanted": Ge.isSlanted ? "true" : void 0,
|
|
1426
|
+
"data-front": br ? "true" : void 0,
|
|
1427
|
+
"data-duplicate": kr && !br ? "true" : void 0,
|
|
1428
|
+
ref: Ao,
|
|
1429
|
+
style: _o,
|
|
1430
|
+
children: et(t, fn, e.formatLabel, $)
|
|
1326
1431
|
}
|
|
1327
1432
|
)
|
|
1328
1433
|
]
|
|
@@ -1331,288 +1436,288 @@ const Ba = (e, t) => {
|
|
|
1331
1436
|
] })
|
|
1332
1437
|
}
|
|
1333
1438
|
),
|
|
1334
|
-
h &&
|
|
1439
|
+
h && Jn(l ? "decrease" : "increase")
|
|
1335
1440
|
]
|
|
1336
1441
|
}
|
|
1337
1442
|
);
|
|
1338
|
-
},
|
|
1443
|
+
}, pn = (e, t) => {
|
|
1339
1444
|
if (e === t) return !0;
|
|
1340
1445
|
if (!(e && t) || e.length !== t.length) return !1;
|
|
1341
1446
|
for (let r = 0; r < e.length; r++)
|
|
1342
1447
|
if (e[r].getTime() !== t[r].getTime()) return !1;
|
|
1343
1448
|
return !0;
|
|
1344
|
-
},
|
|
1449
|
+
}, $a = (e, t) => {
|
|
1345
1450
|
if (e === t) return !0;
|
|
1346
1451
|
if (!(e && t)) return !1;
|
|
1347
1452
|
const r = Object.keys(e), n = Object.keys(t);
|
|
1348
1453
|
if (r.length !== n.length) return !1;
|
|
1349
|
-
for (const
|
|
1350
|
-
if (e[
|
|
1454
|
+
for (const o of r)
|
|
1455
|
+
if (e[o] !== t[o]) return !1;
|
|
1351
1456
|
return !0;
|
|
1352
|
-
},
|
|
1353
|
-
|
|
1354
|
-
const
|
|
1457
|
+
}, Pa = (e, t) => e === t ? !0 : e.mode !== t.mode || e.unit !== t.unit || e.minDate.getTime() !== t.minDate.getTime() || e.maxDate.getTime() !== t.maxDate.getTime() || e.labelPosition !== t.labelPosition || e.autoSlantLabels !== t.autoSlantLabels || e.isVertical !== t.isVertical || e.hideConnectBar !== t.hideConnectBar || e.showTicks !== t.showTicks || e.disabled !== t.disabled || e.showStepper !== t.showStepper || e.debounceMs !== t.debounceMs || e.tooltipStyle !== t.tooltipStyle || e.colorScheme !== t.colorScheme || e.className !== t.className || !$a(e.style, t.style) || e.snapMode !== t.snapMode || e.formatLabel !== t.formatLabel || e.locale !== t.locale || e.lowerAriaLabel !== t.lowerAriaLabel || e.upperAriaLabel !== t.upperAriaLabel || e.pointAriaLabel !== t.pointAriaLabel || e.macroLowerAriaLabel !== t.macroLowerAriaLabel || e.macroUpperAriaLabel !== t.macroUpperAriaLabel || e.decreaseAriaLabel !== t.decreaseAriaLabel || e.increaseAriaLabel !== t.increaseAriaLabel || e.formatAriaValueText !== t.formatAriaValueText || !pn(e.allowedDates, t.allowedDates) ? !1 : e.mode === "point" && t.mode === "point" ? !((e.value?.getTime() ?? null) !== (t.value?.getTime() ?? null) || (e.defaultValue?.getTime() ?? null) !== (t.defaultValue?.getTime() ?? null) || e.onChangePoint !== t.onChangePoint) : e.mode === "range" && t.mode === "range" ? !((e.range?.[0]?.getTime() ?? null) !== (t.range?.[0]?.getTime() ?? null) || (e.range?.[1]?.getTime() ?? null) !== (t.range?.[1]?.getTime() ?? null) || (e.defaultRange?.[0]?.getTime() ?? null) !== (t.defaultRange?.[0]?.getTime() ?? null) || (e.defaultRange?.[1]?.getTime() ?? null) !== (t.defaultRange?.[1]?.getTime() ?? null) || e.onChangeRange !== t.onChangeRange) : e.mode === "vernier" && t.mode === "vernier" ? !((e.microRange?.[0]?.getTime() ?? null) !== (t.microRange?.[0]?.getTime() ?? null) || (e.microRange?.[1]?.getTime() ?? null) !== (t.microRange?.[1]?.getTime() ?? null) || (e.defaultMicroRange?.[0]?.getTime() ?? null) !== (t.defaultMicroRange?.[0]?.getTime() ?? null) || (e.defaultMicroRange?.[1]?.getTime() ?? null) !== (t.defaultMicroRange?.[1]?.getTime() ?? null) || (e.microValue?.getTime() ?? null) !== (t.microValue?.getTime() ?? null) || (e.defaultMicroValue?.getTime() ?? null) !== (t.defaultMicroValue?.getTime() ?? null) || e.macroRange[0].getTime() !== t.macroRange[0].getTime() || e.macroRange[1].getTime() !== t.macroRange[1].getTime() || e.vernierOrientation !== t.vernierOrientation || e.showVernierProjection !== t.showVernierProjection || e.showVernierTicks !== t.showVernierTicks || e.showHairline !== t.showHairline || e.macroUnit !== t.macroUnit || e.microUnit !== t.microUnit || e.macroIsDiscrete !== t.macroIsDiscrete || e.microIsDiscrete !== t.microIsDiscrete || e.formatMacroLabel !== t.formatMacroLabel || e.formatMicroLabel !== t.formatMicroLabel || e.onChangeMicroRange !== t.onChangeMicroRange || e.onChangeMicroPoint !== t.onChangeMicroPoint || e.onChangeMacroRange !== t.onChangeMacroRange || !pn(e.macroAllowedDates, t.macroAllowedDates) || !pn(e.microAllowedDates, t.microAllowedDates)) : !1, Aa = Lr(Sa, Pa);
|
|
1458
|
+
Aa.displayName = "PeriodSlider";
|
|
1459
|
+
const wt = (e) => {
|
|
1355
1460
|
const t = new Date(e);
|
|
1356
1461
|
return t.setHours(0, 0, 0, 0), t;
|
|
1357
|
-
},
|
|
1462
|
+
}, Tr = (e, t) => {
|
|
1358
1463
|
if (Number.isNaN(t.getTime()))
|
|
1359
1464
|
throw new RangeError(`DateSelector: "${e}" must be a valid Date (received ${String(t)})`);
|
|
1360
|
-
},
|
|
1465
|
+
}, Ia = (e) => {
|
|
1361
1466
|
if (e !== void 0)
|
|
1362
1467
|
try {
|
|
1363
1468
|
Intl.DateTimeFormat.supportedLocalesOf([e]);
|
|
1364
1469
|
} catch {
|
|
1365
1470
|
throw new RangeError(`DateSelector: "locale" must be a valid BCP 47 language tag (received ${JSON.stringify(e)})`);
|
|
1366
1471
|
}
|
|
1367
|
-
},
|
|
1472
|
+
}, Ut = (e, t, r) => {
|
|
1368
1473
|
const n = new Date(e, t - 1, r);
|
|
1369
1474
|
return n.setFullYear(e), n.setHours(0, 0, 0, 0), n;
|
|
1370
|
-
},
|
|
1475
|
+
}, uo = (e) => Ut(e, 1, 1), Ca = (e) => Ut(e, 12, 31), Na = {
|
|
1371
1476
|
year: { year: "numeric" },
|
|
1372
1477
|
month: { month: "2-digit" },
|
|
1373
1478
|
day: { day: "2-digit" }
|
|
1374
|
-
},
|
|
1479
|
+
}, ka = {
|
|
1375
1480
|
year: 4,
|
|
1376
1481
|
month: 2,
|
|
1377
1482
|
day: 2
|
|
1378
|
-
},
|
|
1483
|
+
}, Ya = {
|
|
1379
1484
|
year: (e) => e.getFullYear(),
|
|
1380
1485
|
month: (e) => e.getMonth() + 1,
|
|
1381
1486
|
day: (e) => e.getDate()
|
|
1382
|
-
},
|
|
1383
|
-
const r = `${e}\0${t}`, n =
|
|
1487
|
+
}, mo = /* @__PURE__ */ new Map(), Ea = (e, t) => {
|
|
1488
|
+
const r = `${e}\0${t}`, n = mo.get(r);
|
|
1384
1489
|
if (n !== void 0) return n;
|
|
1385
|
-
const
|
|
1386
|
-
return
|
|
1387
|
-
},
|
|
1388
|
-
const n = t?.getTime() ?? null,
|
|
1490
|
+
const o = new Intl.DateTimeFormat(t, Na[e]);
|
|
1491
|
+
return mo.set(r, o), o;
|
|
1492
|
+
}, xn = (e, t, r) => r === void 0 ? String(Ya[e](t)).padStart(ka[e], "0") : Ea(e, r).format(t), Va = (e, t, r) => {
|
|
1493
|
+
const n = t?.getTime() ?? null, o = r?.getTime() ?? null, s = /* @__PURE__ */ new Map();
|
|
1389
1494
|
return e.forEach((i, c) => {
|
|
1390
|
-
|
|
1391
|
-
const h =
|
|
1392
|
-
n !== null && m < n ||
|
|
1393
|
-
}), Array.from(
|
|
1394
|
-
},
|
|
1495
|
+
Tr(`allowedDates[${c}]`, i);
|
|
1496
|
+
const h = wt(i), m = h.getTime();
|
|
1497
|
+
n !== null && m < n || o !== null && m > o || s.has(m) || s.set(m, h);
|
|
1498
|
+
}), Array.from(s.keys()).sort((i, c) => i - c).map((i) => s.get(i));
|
|
1499
|
+
}, Ha = (e, t) => {
|
|
1395
1500
|
const r = [];
|
|
1396
|
-
let n =
|
|
1397
|
-
const
|
|
1398
|
-
for (; n.getTime() <=
|
|
1399
|
-
r.push(n), n =
|
|
1501
|
+
let n = wt(e);
|
|
1502
|
+
const o = wt(t).getTime();
|
|
1503
|
+
for (; n.getTime() <= o; )
|
|
1504
|
+
r.push(n), n = zr(n, 1);
|
|
1400
1505
|
return r;
|
|
1401
|
-
},
|
|
1506
|
+
}, fo = (e, t) => {
|
|
1402
1507
|
const r = [];
|
|
1403
1508
|
for (let n = e.length - 1; n >= 0; n--)
|
|
1404
|
-
r.push({ label:
|
|
1509
|
+
r.push({ label: et("day", e[n], void 0, t), value: ir(e[n], "yyyy-MM-dd") });
|
|
1405
1510
|
return r;
|
|
1406
|
-
},
|
|
1511
|
+
}, Oa = (e) => {
|
|
1407
1512
|
const {
|
|
1408
1513
|
value: t,
|
|
1409
1514
|
initialDate: r,
|
|
1410
1515
|
onChange: n,
|
|
1411
|
-
children:
|
|
1412
|
-
minYear:
|
|
1516
|
+
children: o,
|
|
1517
|
+
minYear: s,
|
|
1413
1518
|
maxYear: i,
|
|
1414
1519
|
minDate: c,
|
|
1415
1520
|
maxDate: h,
|
|
1416
1521
|
allowedDates: m,
|
|
1417
|
-
variant:
|
|
1418
|
-
className:
|
|
1419
|
-
style:
|
|
1420
|
-
disabled:
|
|
1421
|
-
prevDateAriaLabel:
|
|
1422
|
-
nextDateAriaLabel:
|
|
1423
|
-
selectAriaLabel:
|
|
1424
|
-
yearAriaLabel:
|
|
1425
|
-
monthAriaLabel:
|
|
1426
|
-
dayAriaLabel:
|
|
1427
|
-
locale:
|
|
1522
|
+
variant: R = "date",
|
|
1523
|
+
className: S = "",
|
|
1524
|
+
style: l,
|
|
1525
|
+
disabled: I = !1,
|
|
1526
|
+
prevDateAriaLabel: re = "Previous day",
|
|
1527
|
+
nextDateAriaLabel: ae = "Next day",
|
|
1528
|
+
selectAriaLabel: $ = "Date",
|
|
1529
|
+
yearAriaLabel: de = "Year",
|
|
1530
|
+
monthAriaLabel: ie = "Month",
|
|
1531
|
+
dayAriaLabel: P = "Day",
|
|
1532
|
+
locale: V,
|
|
1428
1533
|
formatYearOption: z,
|
|
1429
|
-
formatMonthOption:
|
|
1430
|
-
formatDayOption:
|
|
1534
|
+
formatMonthOption: ne,
|
|
1535
|
+
formatDayOption: j
|
|
1431
1536
|
} = e;
|
|
1432
|
-
if (
|
|
1433
|
-
throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(
|
|
1537
|
+
if (Ia(V), t !== void 0 && Tr("value", t), r !== void 0 && Tr("initialDate", r), c !== void 0 && Tr("minDate", c), h !== void 0 && Tr("maxDate", h), s !== void 0 && !Number.isInteger(s))
|
|
1538
|
+
throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(s)})`);
|
|
1434
1539
|
if (i !== void 0 && !Number.isInteger(i))
|
|
1435
1540
|
throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(i)})`);
|
|
1436
|
-
if (
|
|
1541
|
+
if (R === "split-dropdown" && m !== void 0)
|
|
1437
1542
|
throw new RangeError('DateSelector: variant="split-dropdown" cannot honour "allowedDates"; use variant="dropdown" or variant="date" for a discrete date set');
|
|
1438
|
-
const
|
|
1439
|
-
if (
|
|
1543
|
+
const W = t ?? r;
|
|
1544
|
+
if (W === void 0)
|
|
1440
1545
|
throw new RangeError("DateSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected date is never inferred from the wall clock.");
|
|
1441
|
-
const [
|
|
1442
|
-
const
|
|
1443
|
-
return
|
|
1444
|
-
}, [
|
|
1445
|
-
const
|
|
1446
|
-
return
|
|
1447
|
-
}, [
|
|
1448
|
-
if (
|
|
1449
|
-
throw new RangeError(`DateSelector: the resolved range is empty (min ${
|
|
1450
|
-
if (
|
|
1451
|
-
throw new RangeError(`DateSelector: variant="${
|
|
1452
|
-
const
|
|
1453
|
-
const
|
|
1454
|
-
return
|
|
1455
|
-
},
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
}, [
|
|
1459
|
-
const
|
|
1460
|
-
if (
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1463
|
-
},
|
|
1464
|
-
if (
|
|
1465
|
-
for (let
|
|
1466
|
-
if (
|
|
1546
|
+
const [p, M] = Le(() => wt(W)), x = t !== void 0, k = t?.getTime(), A = v(() => t !== void 0 ? wt(t) : p, [k, p]), J = c?.getTime(), fe = h?.getTime(), _ = v(() => {
|
|
1547
|
+
const b = c ? wt(c) : null, E = s !== void 0 ? uo(s) : null;
|
|
1548
|
+
return b === null ? E : E === null || b.getTime() >= E.getTime() ? b : E;
|
|
1549
|
+
}, [J, s]), Q = v(() => {
|
|
1550
|
+
const b = h ? wt(h) : null, E = i !== void 0 ? Ca(i) : null;
|
|
1551
|
+
return b === null ? E : E === null || b.getTime() <= E.getTime() ? b : E;
|
|
1552
|
+
}, [fe, i]), ue = _?.getTime() ?? null, K = Q?.getTime() ?? null;
|
|
1553
|
+
if (_ !== null && Q !== null && _.getTime() > Q.getTime())
|
|
1554
|
+
throw new RangeError(`DateSelector: the resolved range is empty (min ${ir(_, "yyyy-MM-dd")} is after max ${ir(Q, "yyyy-MM-dd")})`);
|
|
1555
|
+
if (R !== "date" && m === void 0 && (_ === null || Q === null))
|
|
1556
|
+
throw new RangeError(`DateSelector: variant="${R}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${R === "dropdown" ? ' or supply "allowedDates"' : ""}`);
|
|
1557
|
+
const X = m === void 0 ? null : m.map((b) => b.getTime()).join(","), oe = v(() => m === void 0 ? null : Va(m, _, Q), [X, ue, K]), le = (b) => {
|
|
1558
|
+
const E = b.getTime();
|
|
1559
|
+
return oe !== null ? oe.some((Ke) => Ke.getTime() === E) : !(ue !== null && E < ue || K !== null && E > K);
|
|
1560
|
+
}, Xe = W.getTime();
|
|
1561
|
+
Nt(() => {
|
|
1562
|
+
x || M(wt(W));
|
|
1563
|
+
}, [x, Xe]);
|
|
1564
|
+
const Ae = (b) => {
|
|
1565
|
+
if (I) return;
|
|
1566
|
+
const E = wt(b);
|
|
1567
|
+
le(E) && (x || M(E), n?.(E));
|
|
1568
|
+
}, Ie = A.getTime(), Se = le(A), Ze = v(() => {
|
|
1569
|
+
if (oe !== null) {
|
|
1570
|
+
for (let E = oe.length - 1; E >= 0; E--)
|
|
1571
|
+
if (oe[E].getTime() < Ie) return oe[E];
|
|
1467
1572
|
return null;
|
|
1468
1573
|
}
|
|
1469
|
-
const
|
|
1470
|
-
return
|
|
1471
|
-
}, [
|
|
1472
|
-
if (
|
|
1473
|
-
for (const
|
|
1474
|
-
if (
|
|
1574
|
+
const b = zr(new Date(Ie), -1);
|
|
1575
|
+
return le(b) ? b : null;
|
|
1576
|
+
}, [oe, Ie, ue, K]), Je = v(() => {
|
|
1577
|
+
if (oe !== null) {
|
|
1578
|
+
for (const E of oe)
|
|
1579
|
+
if (E.getTime() > Ie) return E;
|
|
1475
1580
|
return null;
|
|
1476
1581
|
}
|
|
1477
|
-
const
|
|
1478
|
-
return
|
|
1479
|
-
}, [
|
|
1480
|
-
|
|
1481
|
-
},
|
|
1482
|
-
|
|
1483
|
-
},
|
|
1484
|
-
if (
|
|
1485
|
-
const
|
|
1486
|
-
Number.isNaN(
|
|
1582
|
+
const b = zr(new Date(Ie), 1);
|
|
1583
|
+
return le(b) ? b : null;
|
|
1584
|
+
}, [oe, Ie, ue, K]), st = I || Ze === null, Fe = I || Je === null, dt = () => {
|
|
1585
|
+
Ze !== null && Ae(Ze);
|
|
1586
|
+
}, q = () => {
|
|
1587
|
+
Je !== null && Ae(Je);
|
|
1588
|
+
}, te = (b) => {
|
|
1589
|
+
if (b.target.value) {
|
|
1590
|
+
const E = oo(b.target.value);
|
|
1591
|
+
Number.isNaN(E.getTime()) || Ae(E);
|
|
1487
1592
|
}
|
|
1488
|
-
},
|
|
1489
|
-
if (
|
|
1490
|
-
const
|
|
1491
|
-
Number.isNaN(
|
|
1593
|
+
}, be = (b) => {
|
|
1594
|
+
if (b.target.value) {
|
|
1595
|
+
const E = oo(b.target.value);
|
|
1596
|
+
Number.isNaN(E.getTime()) || Ae(E);
|
|
1492
1597
|
}
|
|
1493
|
-
},
|
|
1494
|
-
if (
|
|
1495
|
-
const
|
|
1496
|
-
for (let
|
|
1497
|
-
|
|
1498
|
-
return
|
|
1499
|
-
}, [
|
|
1500
|
-
if (
|
|
1501
|
-
const
|
|
1502
|
-
for (let
|
|
1503
|
-
|
|
1504
|
-
return
|
|
1505
|
-
}, [
|
|
1506
|
-
if (
|
|
1507
|
-
const
|
|
1508
|
-
for (let
|
|
1509
|
-
|
|
1510
|
-
return
|
|
1511
|
-
}, [
|
|
1512
|
-
|
|
1513
|
-
},
|
|
1514
|
-
return /* @__PURE__ */
|
|
1515
|
-
/* @__PURE__ */
|
|
1598
|
+
}, g = A.getFullYear(), L = A.getMonth() + 1, O = A.getDate(), De = v(() => R !== "dropdown" ? [] : oe !== null ? fo(oe, V) : _ === null || Q === null ? [] : fo(Ha(_, Q), V), [R, oe, ue, K, V]), C = v(() => {
|
|
1599
|
+
if (R !== "split-dropdown" || _ === null || Q === null) return [];
|
|
1600
|
+
const b = [];
|
|
1601
|
+
for (let E = Q.getFullYear(); E >= _.getFullYear(); E--)
|
|
1602
|
+
b.push(E);
|
|
1603
|
+
return b;
|
|
1604
|
+
}, [R, ue, K]), G = v(() => {
|
|
1605
|
+
if (R !== "split-dropdown" || _ === null || Q === null) return [];
|
|
1606
|
+
const b = _, E = Q, Ke = g === b.getFullYear() ? b.getMonth() + 1 : 1, Wt = g === E.getFullYear() ? E.getMonth() + 1 : 12, mt = [];
|
|
1607
|
+
for (let rt = Ke; rt <= Wt; rt++)
|
|
1608
|
+
mt.push(rt);
|
|
1609
|
+
return mt;
|
|
1610
|
+
}, [R, ue, K, g]), Ce = v(() => {
|
|
1611
|
+
if (R !== "split-dropdown" || _ === null || Q === null) return [];
|
|
1612
|
+
const b = _, E = Q, Ke = g === b.getFullYear() && L === b.getMonth() + 1 ? b.getDate() : 1, Wt = g === E.getFullYear() && L === E.getMonth() + 1 ? E.getDate() : no(new Date(Ie)), mt = [];
|
|
1613
|
+
for (let rt = Ke; rt <= Wt; rt++)
|
|
1614
|
+
mt.push(rt);
|
|
1615
|
+
return mt;
|
|
1616
|
+
}, [R, ue, K, Ie, g, L]), He = (b, E, Ke) => Ke > no(Ut(b, E, 1)) ? !1 : le(Ut(b, E, Ke)), Ue = (b, E, Ke) => {
|
|
1617
|
+
He(b, E, Ke) && Ae(Ut(b, E, Ke));
|
|
1618
|
+
}, he = (b) => z ? z(b) : xn("year", uo(b), V), ve = (b) => ne ? ne(b) : xn("month", Ut(g, b, 1), V), cr = (b) => j ? j(b) : xn("day", Ut(g, L, b), V), we = ir(A, "yyyy-MM-dd"), Yt = et("day", A, void 0, V), N = _ ? ir(_, "yyyy-MM-dd") : void 0, Jr = Q ? ir(Q, "yyyy-MM-dd") : void 0, Qr = Se ? we : "", Mt = "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400";
|
|
1619
|
+
return /* @__PURE__ */ pe("div", { className: `inline-flex items-center ${R === "split-dropdown" ? "w-auto" : "w-38"} ${S}`, style: l, "data-variant": R, "data-out-of-range": Se ? void 0 : "true", children: [
|
|
1620
|
+
/* @__PURE__ */ T(
|
|
1516
1621
|
"button",
|
|
1517
1622
|
{
|
|
1518
1623
|
type: "button",
|
|
1519
|
-
"aria-label":
|
|
1520
|
-
disabled:
|
|
1624
|
+
"aria-label": re,
|
|
1625
|
+
disabled: st,
|
|
1521
1626
|
className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
|
|
1522
|
-
onClick:
|
|
1523
|
-
children: /* @__PURE__ */
|
|
1627
|
+
onClick: dt,
|
|
1628
|
+
children: /* @__PURE__ */ T("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
|
|
1524
1629
|
}
|
|
1525
1630
|
),
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
] }) :
|
|
1530
|
-
/* @__PURE__ */
|
|
1631
|
+
R === "dropdown" ? /* @__PURE__ */ pe("select", { "aria-label": $, disabled: I, className: "mx-1 my-auto w-28 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", value: Qr, onChange: be, children: [
|
|
1632
|
+
Se ? null : /* @__PURE__ */ T("option", { value: "", disabled: !0, className: Mt, children: Yt }),
|
|
1633
|
+
De.map((b) => /* @__PURE__ */ T("option", { value: b.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: b.label }, b.value))
|
|
1634
|
+
] }) : R === "split-dropdown" ? /* @__PURE__ */ pe("div", { className: "mx-1 my-auto inline-flex items-center gap-1", children: [
|
|
1635
|
+
/* @__PURE__ */ pe(
|
|
1531
1636
|
"select",
|
|
1532
1637
|
{
|
|
1533
|
-
"aria-label":
|
|
1534
|
-
disabled:
|
|
1638
|
+
"aria-label": de,
|
|
1639
|
+
disabled: I,
|
|
1535
1640
|
className: "rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",
|
|
1536
|
-
value:
|
|
1537
|
-
onChange: (
|
|
1641
|
+
value: Se ? g : "",
|
|
1642
|
+
onChange: (b) => Ue(Number(b.target.value), L, O),
|
|
1538
1643
|
children: [
|
|
1539
|
-
|
|
1540
|
-
|
|
1644
|
+
Se ? null : /* @__PURE__ */ T("option", { value: "", disabled: !0, className: Mt, children: he(g) }),
|
|
1645
|
+
C.map((b) => /* @__PURE__ */ T("option", { value: b, disabled: !He(b, L, O), className: "dark:bg-slate-700 dark:text-slate-100", children: he(b) }, b))
|
|
1541
1646
|
]
|
|
1542
1647
|
}
|
|
1543
1648
|
),
|
|
1544
|
-
/* @__PURE__ */
|
|
1649
|
+
/* @__PURE__ */ pe(
|
|
1545
1650
|
"select",
|
|
1546
1651
|
{
|
|
1547
|
-
"aria-label":
|
|
1548
|
-
disabled:
|
|
1652
|
+
"aria-label": ie,
|
|
1653
|
+
disabled: I,
|
|
1549
1654
|
className: "rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",
|
|
1550
|
-
value:
|
|
1551
|
-
onChange: (
|
|
1655
|
+
value: Se ? L : "",
|
|
1656
|
+
onChange: (b) => Ue(g, Number(b.target.value), O),
|
|
1552
1657
|
children: [
|
|
1553
|
-
|
|
1554
|
-
|
|
1658
|
+
Se ? null : /* @__PURE__ */ T("option", { value: "", disabled: !0, className: Mt, children: ve(L) }),
|
|
1659
|
+
G.map((b) => /* @__PURE__ */ T("option", { value: b, disabled: !He(g, b, O), className: "dark:bg-slate-700 dark:text-slate-100", children: ve(b) }, b))
|
|
1555
1660
|
]
|
|
1556
1661
|
}
|
|
1557
1662
|
),
|
|
1558
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ pe(
|
|
1559
1664
|
"select",
|
|
1560
1665
|
{
|
|
1561
|
-
"aria-label":
|
|
1562
|
-
disabled:
|
|
1666
|
+
"aria-label": P,
|
|
1667
|
+
disabled: I,
|
|
1563
1668
|
className: "rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",
|
|
1564
|
-
value:
|
|
1565
|
-
onChange: (
|
|
1669
|
+
value: Se ? O : "",
|
|
1670
|
+
onChange: (b) => Ue(g, L, Number(b.target.value)),
|
|
1566
1671
|
children: [
|
|
1567
|
-
|
|
1568
|
-
|
|
1672
|
+
Se ? null : /* @__PURE__ */ T("option", { value: "", disabled: !0, className: Mt, children: cr(O) }),
|
|
1673
|
+
Ce.map((b) => /* @__PURE__ */ T("option", { value: b, className: "dark:bg-slate-700 dark:text-slate-100", children: cr(b) }, b))
|
|
1569
1674
|
]
|
|
1570
1675
|
}
|
|
1571
1676
|
)
|
|
1572
|
-
] }) : /* @__PURE__ */
|
|
1677
|
+
] }) : /* @__PURE__ */ T(
|
|
1573
1678
|
"input",
|
|
1574
1679
|
{
|
|
1575
|
-
"aria-label":
|
|
1576
|
-
disabled:
|
|
1577
|
-
className: "mx-1 my-auto w-28 rounded-md border border-gray-300 bg-gray-
|
|
1578
|
-
value:
|
|
1579
|
-
min:
|
|
1580
|
-
max:
|
|
1581
|
-
onChange:
|
|
1680
|
+
"aria-label": $,
|
|
1681
|
+
disabled: I,
|
|
1682
|
+
className: "period-slider-native-date-field mx-1 my-auto w-28 rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500 dark:placeholder:text-gray-400",
|
|
1683
|
+
value: we,
|
|
1684
|
+
min: N,
|
|
1685
|
+
max: Jr,
|
|
1686
|
+
onChange: te,
|
|
1582
1687
|
type: "date"
|
|
1583
1688
|
}
|
|
1584
1689
|
),
|
|
1585
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ T(
|
|
1586
1691
|
"button",
|
|
1587
1692
|
{
|
|
1588
1693
|
type: "button",
|
|
1589
|
-
"aria-label":
|
|
1590
|
-
disabled:
|
|
1694
|
+
"aria-label": ae,
|
|
1695
|
+
disabled: Fe,
|
|
1591
1696
|
className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
|
|
1592
|
-
onClick:
|
|
1593
|
-
children: /* @__PURE__ */
|
|
1697
|
+
onClick: q,
|
|
1698
|
+
children: /* @__PURE__ */ T("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
|
|
1594
1699
|
}
|
|
1595
1700
|
),
|
|
1596
|
-
|
|
1701
|
+
o
|
|
1597
1702
|
] });
|
|
1598
|
-
},
|
|
1599
|
-
|
|
1600
|
-
function
|
|
1601
|
-
const r = e + Math.floor(t / 12), n = (t % 12 + 12) % 12,
|
|
1602
|
-
return
|
|
1703
|
+
}, ar = (e) => e === void 0 ? null : wt(e).getTime(), Fa = Lr(Oa, (e, t) => !(ar(e.value ?? e.initialDate) !== ar(t.value ?? t.initialDate) || ar(e.minDate) !== ar(t.minDate) || ar(e.maxDate) !== ar(t.maxDate) || e.variant !== t.variant || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.minYear !== t.minYear || e.maxYear !== t.maxYear || e.onChange !== t.onChange || e.allowedDates !== t.allowedDates || e.children !== t.children || e.prevDateAriaLabel !== t.prevDateAriaLabel || e.nextDateAriaLabel !== t.nextDateAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.yearAriaLabel !== t.yearAriaLabel || e.monthAriaLabel !== t.monthAriaLabel || e.dayAriaLabel !== t.dayAriaLabel || e.locale !== t.locale || e.formatYearOption !== t.formatYearOption || e.formatMonthOption !== t.formatMonthOption || e.formatDayOption !== t.formatDayOption));
|
|
1704
|
+
Fa.displayName = "DateSelector";
|
|
1705
|
+
function it(e, t) {
|
|
1706
|
+
const r = e + Math.floor(t / 12), n = (t % 12 + 12) % 12, o = new Date(r, n, 1);
|
|
1707
|
+
return o.setFullYear(r), o;
|
|
1603
1708
|
}
|
|
1604
|
-
function
|
|
1709
|
+
function Ft(e) {
|
|
1605
1710
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`;
|
|
1606
1711
|
}
|
|
1607
|
-
function
|
|
1712
|
+
function xr(e, t) {
|
|
1608
1713
|
if (e !== void 0 && (!(e instanceof Date) || Number.isNaN(e.getTime())))
|
|
1609
1714
|
throw new RangeError(`MonthSelector: \`${t}\` must be a valid Date, received ${String(e)}.`);
|
|
1610
1715
|
}
|
|
1611
|
-
function
|
|
1716
|
+
function go(e, t) {
|
|
1612
1717
|
if (e !== void 0 && !Number.isInteger(e))
|
|
1613
1718
|
throw new RangeError(`MonthSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
|
|
1614
1719
|
}
|
|
1615
|
-
function
|
|
1720
|
+
function Ua(e) {
|
|
1616
1721
|
if (e !== void 0)
|
|
1617
1722
|
try {
|
|
1618
1723
|
Intl.DateTimeFormat.supportedLocalesOf([e]);
|
|
@@ -1620,491 +1725,693 @@ function co(e) {
|
|
|
1620
1725
|
throw new RangeError(`MonthSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`);
|
|
1621
1726
|
}
|
|
1622
1727
|
}
|
|
1623
|
-
function
|
|
1624
|
-
const r = e === void 0 ? null :
|
|
1728
|
+
function Wa(e, t) {
|
|
1729
|
+
const r = e === void 0 ? null : it(e, 0), n = t === void 0 ? null : it(t.getFullYear(), t.getMonth());
|
|
1625
1730
|
return r !== null && n !== null ? r >= n ? r : n : r !== null ? r : n;
|
|
1626
1731
|
}
|
|
1627
|
-
function
|
|
1628
|
-
const r = e === void 0 ? null :
|
|
1732
|
+
function Ba(e, t) {
|
|
1733
|
+
const r = e === void 0 ? null : it(e, 11), n = t === void 0 ? null : it(t.getFullYear(), t.getMonth());
|
|
1629
1734
|
return r !== null && n !== null ? r <= n ? r : n : r !== null ? r : n;
|
|
1630
1735
|
}
|
|
1631
|
-
function
|
|
1736
|
+
function za(e, t, r) {
|
|
1632
1737
|
const n = /* @__PURE__ */ new Map();
|
|
1633
|
-
for (const
|
|
1634
|
-
const
|
|
1635
|
-
t !== null &&
|
|
1738
|
+
for (const o of e) {
|
|
1739
|
+
const s = it(o.getFullYear(), o.getMonth());
|
|
1740
|
+
t !== null && s < t || r !== null && s > r || n.has(s.getTime()) || n.set(s.getTime(), s);
|
|
1636
1741
|
}
|
|
1637
|
-
return Array.from(n.values()).sort((
|
|
1742
|
+
return Array.from(n.values()).sort((o, s) => o.getTime() - s.getTime());
|
|
1638
1743
|
}
|
|
1639
|
-
function
|
|
1640
|
-
const r = e.getFullYear() * 12 + e.getMonth(), n = t.getFullYear() * 12 + t.getMonth(),
|
|
1641
|
-
for (let
|
|
1642
|
-
|
|
1643
|
-
return
|
|
1744
|
+
function _a(e, t) {
|
|
1745
|
+
const r = e.getFullYear() * 12 + e.getMonth(), n = t.getFullYear() * 12 + t.getMonth(), o = [];
|
|
1746
|
+
for (let s = r; s <= n; s++)
|
|
1747
|
+
o.push(it(Math.floor(s / 12), s % 12));
|
|
1748
|
+
return o;
|
|
1644
1749
|
}
|
|
1645
|
-
function
|
|
1750
|
+
function ho(e, t) {
|
|
1646
1751
|
const r = [];
|
|
1647
1752
|
for (let n = e.length - 1; n >= 0; n--)
|
|
1648
|
-
r.push({ label:
|
|
1753
|
+
r.push({ label: et("month", e[n], void 0, t), value: Ft(e[n]) });
|
|
1649
1754
|
return r;
|
|
1650
1755
|
}
|
|
1651
|
-
const
|
|
1756
|
+
const Xa = (e) => {
|
|
1652
1757
|
const {
|
|
1653
1758
|
value: t,
|
|
1654
1759
|
initialDate: r,
|
|
1655
1760
|
onChange: n,
|
|
1656
|
-
children:
|
|
1657
|
-
variant:
|
|
1761
|
+
children: o,
|
|
1762
|
+
variant: s = "date",
|
|
1658
1763
|
minYear: i,
|
|
1659
1764
|
maxYear: c,
|
|
1660
1765
|
minDate: h,
|
|
1661
1766
|
maxDate: m,
|
|
1662
|
-
allowedMonths:
|
|
1663
|
-
isWarning:
|
|
1664
|
-
className:
|
|
1665
|
-
style:
|
|
1666
|
-
disabled:
|
|
1667
|
-
prevMonthAriaLabel:
|
|
1668
|
-
nextMonthAriaLabel:
|
|
1669
|
-
selectAriaLabel:
|
|
1670
|
-
locale:
|
|
1767
|
+
allowedMonths: R,
|
|
1768
|
+
isWarning: S = !1,
|
|
1769
|
+
className: l = "",
|
|
1770
|
+
style: I,
|
|
1771
|
+
disabled: re = !1,
|
|
1772
|
+
prevMonthAriaLabel: ae = "Previous month",
|
|
1773
|
+
nextMonthAriaLabel: $ = "Next month",
|
|
1774
|
+
selectAriaLabel: de = "Month",
|
|
1775
|
+
locale: ie
|
|
1671
1776
|
} = e;
|
|
1672
|
-
|
|
1673
|
-
|
|
1777
|
+
Ua(ie), xr(t, "value"), xr(r, "initialDate"), xr(h, "minDate"), xr(m, "maxDate"), go(i, "minYear"), go(c, "maxYear"), R?.forEach((C, G) => {
|
|
1778
|
+
xr(C, `allowedMonths[${G}]`);
|
|
1674
1779
|
});
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1780
|
+
const P = t ?? r;
|
|
1781
|
+
if (P === void 0)
|
|
1677
1782
|
throw new RangeError("MonthSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected month is never inferred from the wall clock.");
|
|
1678
|
-
const [
|
|
1679
|
-
if (
|
|
1680
|
-
throw new RangeError(`MonthSelector: the resolved lower bound ${
|
|
1681
|
-
if (
|
|
1783
|
+
const [V, z] = Le(() => it(P.getFullYear(), P.getMonth())), ne = t !== void 0, j = v(() => t !== void 0 ? it(t.getFullYear(), t.getMonth()) : V, [t?.getTime(), V]), W = h?.getTime(), p = m?.getTime(), M = v(() => Wa(i, h), [i, W]), x = v(() => Ba(c, m), [c, p]), k = M?.getTime() ?? null, A = x?.getTime() ?? null;
|
|
1784
|
+
if (M !== null && x !== null && M > x)
|
|
1785
|
+
throw new RangeError(`MonthSelector: the resolved lower bound ${Ft(M)} is after the resolved upper bound ${Ft(x)}.`);
|
|
1786
|
+
if (s === "dropdown" && R === void 0 && (M === null || x === null))
|
|
1682
1787
|
throw new RangeError('MonthSelector: variant="dropdown" requires a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`), or `allowedMonths`; the option window is never invented.');
|
|
1683
|
-
const
|
|
1684
|
-
const
|
|
1685
|
-
return
|
|
1686
|
-
},
|
|
1687
|
-
|
|
1688
|
-
if (
|
|
1689
|
-
const
|
|
1690
|
-
z((
|
|
1691
|
-
}, [
|
|
1692
|
-
const
|
|
1693
|
-
if (
|
|
1694
|
-
if (!
|
|
1695
|
-
throw new RangeError(`MonthSelector: refusing to emit ${
|
|
1696
|
-
|
|
1697
|
-
const
|
|
1698
|
-
n?.(
|
|
1699
|
-
},
|
|
1700
|
-
if (
|
|
1701
|
-
for (let
|
|
1702
|
-
if (
|
|
1788
|
+
const J = R === void 0 ? null : R.map((C) => C.getTime()).join(","), fe = v(() => R === void 0 ? null : za(R, M, x), [J, k, A]), _ = (C) => {
|
|
1789
|
+
const G = C.getTime();
|
|
1790
|
+
return fe !== null ? fe.some((Ce) => Ce.getTime() === G) : !(k !== null && G < k || A !== null && G > A);
|
|
1791
|
+
}, Q = P.getTime();
|
|
1792
|
+
Nt(() => {
|
|
1793
|
+
if (ne) return;
|
|
1794
|
+
const C = it(P.getFullYear(), P.getMonth());
|
|
1795
|
+
z((G) => G.getTime() === C.getTime() ? G : C);
|
|
1796
|
+
}, [ne, Q]);
|
|
1797
|
+
const ue = (C) => {
|
|
1798
|
+
if (re) return;
|
|
1799
|
+
if (!_(C))
|
|
1800
|
+
throw new RangeError(`MonthSelector: refusing to emit ${Ft(C)}, which lies outside the selectable months.`);
|
|
1801
|
+
ne || z(C);
|
|
1802
|
+
const G = C.getFullYear() * 100 + (C.getMonth() + 1);
|
|
1803
|
+
n?.(C, G);
|
|
1804
|
+
}, K = j.getTime(), X = _(j), oe = v(() => {
|
|
1805
|
+
if (fe !== null) {
|
|
1806
|
+
for (let G = fe.length - 1; G >= 0; G--)
|
|
1807
|
+
if (fe[G].getTime() < K) return fe[G];
|
|
1703
1808
|
return null;
|
|
1704
1809
|
}
|
|
1705
|
-
const
|
|
1706
|
-
return
|
|
1707
|
-
}, [
|
|
1708
|
-
if (
|
|
1709
|
-
for (const
|
|
1710
|
-
if (
|
|
1810
|
+
const C = it(j.getFullYear(), j.getMonth() - 1);
|
|
1811
|
+
return _(C) ? C : null;
|
|
1812
|
+
}, [fe, K, k, A]), le = v(() => {
|
|
1813
|
+
if (fe !== null) {
|
|
1814
|
+
for (const G of fe)
|
|
1815
|
+
if (G.getTime() > K) return G;
|
|
1711
1816
|
return null;
|
|
1712
1817
|
}
|
|
1713
|
-
const
|
|
1714
|
-
return
|
|
1715
|
-
}, [
|
|
1716
|
-
|
|
1717
|
-
},
|
|
1718
|
-
|
|
1719
|
-
},
|
|
1720
|
-
if (!
|
|
1721
|
-
const [
|
|
1722
|
-
if (!(Number.isInteger(
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
},
|
|
1726
|
-
|
|
1727
|
-
},
|
|
1728
|
-
|
|
1729
|
-
},
|
|
1730
|
-
return /* @__PURE__ */
|
|
1731
|
-
/* @__PURE__ */
|
|
1818
|
+
const C = it(j.getFullYear(), j.getMonth() + 1);
|
|
1819
|
+
return _(C) ? C : null;
|
|
1820
|
+
}, [fe, K, k, A]), Xe = re || oe === null, Ae = re || le === null, Ie = () => {
|
|
1821
|
+
oe !== null && ue(oe);
|
|
1822
|
+
}, Se = () => {
|
|
1823
|
+
le !== null && ue(le);
|
|
1824
|
+
}, Ze = (C) => {
|
|
1825
|
+
if (!C) return;
|
|
1826
|
+
const [G, Ce] = C.split("-"), He = Number(G), Ue = Number(Ce) - 1;
|
|
1827
|
+
if (!(Number.isInteger(He) && Number.isInteger(Ue))) return;
|
|
1828
|
+
const he = it(He, Ue);
|
|
1829
|
+
_(he) && ue(he);
|
|
1830
|
+
}, Je = (C) => {
|
|
1831
|
+
Ze(C.target.value);
|
|
1832
|
+
}, st = (C) => {
|
|
1833
|
+
Ze(C.target.value);
|
|
1834
|
+
}, Fe = Ft(j), dt = et("month", j, void 0, ie), q = M ? Ft(M) : void 0, te = x ? Ft(x) : void 0, be = v(() => s !== "dropdown" ? [] : fe !== null ? ho(fe, ie) : M === null || x === null ? [] : ho(_a(M, x), ie), [s, fe, k, A, ie]), g = X ? Fe : "", L = S ? "border-amber-300 bg-amber-50 text-amber-900 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-200" : "border-gray-300 bg-gray-100 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", O = `period-slider-native-date-field mx-1 my-auto w-28 rounded-md border py-0.5 px-1 text-center font-mono text-xs tabular-nums dark:placeholder:text-gray-400 disabled:opacity-50 ${L}`, De = `mx-1 my-auto w-28 appearance-none rounded-md border px-1 py-0.5 text-center font-mono text-xs tabular-nums [text-align-last:center] [text-align:center] disabled:opacity-50 ${L}`;
|
|
1835
|
+
return /* @__PURE__ */ pe("div", { className: `inline-flex w-38 items-center ${l}`, style: I, "data-out-of-range": X ? void 0 : "true", children: [
|
|
1836
|
+
/* @__PURE__ */ T(
|
|
1732
1837
|
"button",
|
|
1733
1838
|
{
|
|
1734
1839
|
type: "button",
|
|
1735
|
-
"aria-label":
|
|
1736
|
-
disabled:
|
|
1840
|
+
"aria-label": ae,
|
|
1841
|
+
disabled: Xe,
|
|
1737
1842
|
className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
|
|
1738
|
-
onClick:
|
|
1739
|
-
children: /* @__PURE__ */
|
|
1843
|
+
onClick: Ie,
|
|
1844
|
+
children: /* @__PURE__ */ T("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
|
|
1740
1845
|
}
|
|
1741
1846
|
),
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
] }) : /* @__PURE__ */
|
|
1746
|
-
/* @__PURE__ */
|
|
1847
|
+
s === "dropdown" ? /* @__PURE__ */ pe("select", { "aria-label": de, disabled: re, className: De, value: g, onChange: st, children: [
|
|
1848
|
+
X ? null : /* @__PURE__ */ T("option", { value: "", disabled: !0, className: "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400", children: dt }),
|
|
1849
|
+
be.map((C) => /* @__PURE__ */ T("option", { value: C.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: C.label }, C.value))
|
|
1850
|
+
] }) : /* @__PURE__ */ T("input", { "aria-label": de, disabled: re, className: O, value: Fe, min: q, max: te, onChange: Je, type: "month" }),
|
|
1851
|
+
/* @__PURE__ */ T(
|
|
1747
1852
|
"button",
|
|
1748
1853
|
{
|
|
1749
1854
|
type: "button",
|
|
1750
|
-
"aria-label":
|
|
1751
|
-
disabled:
|
|
1855
|
+
"aria-label": $,
|
|
1856
|
+
disabled: Ae,
|
|
1752
1857
|
className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
|
|
1753
|
-
onClick:
|
|
1754
|
-
children: /* @__PURE__ */
|
|
1858
|
+
onClick: Se,
|
|
1859
|
+
children: /* @__PURE__ */ T("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
|
|
1755
1860
|
}
|
|
1756
1861
|
),
|
|
1757
|
-
|
|
1862
|
+
o
|
|
1758
1863
|
] });
|
|
1759
|
-
},
|
|
1760
|
-
const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate,
|
|
1761
|
-
if (
|
|
1864
|
+
}, Ka = Lr(Xa, (e, t) => {
|
|
1865
|
+
const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, o = r ? r.getFullYear() * 12 + r.getMonth() : null, s = n ? n.getFullYear() * 12 + n.getMonth() : null;
|
|
1866
|
+
if (o !== s || e.variant !== t.variant || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.isWarning !== t.isWarning || e.minYear !== t.minYear || e.maxYear !== t.maxYear) return !1;
|
|
1762
1867
|
const i = e.minDate ? e.minDate.getFullYear() * 12 + e.minDate.getMonth() : null, c = t.minDate ? t.minDate.getFullYear() * 12 + t.minDate.getMonth() : null;
|
|
1763
1868
|
if (i !== c) return !1;
|
|
1764
1869
|
const h = e.maxDate ? e.maxDate.getFullYear() * 12 + e.maxDate.getMonth() : null, m = t.maxDate ? t.maxDate.getFullYear() * 12 + t.maxDate.getMonth() : null;
|
|
1765
1870
|
return !(h !== m || e.allowedMonths !== t.allowedMonths || e.onChange !== t.onChange || e.children !== t.children || e.prevMonthAriaLabel !== t.prevMonthAriaLabel || e.nextMonthAriaLabel !== t.nextMonthAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.locale !== t.locale);
|
|
1766
1871
|
});
|
|
1767
|
-
|
|
1768
|
-
function
|
|
1872
|
+
Ka.displayName = "MonthSelector";
|
|
1873
|
+
function sr(e, t, r) {
|
|
1769
1874
|
if (!(r instanceof Date) || Number.isNaN(r.getTime()))
|
|
1770
1875
|
throw new RangeError(`${e}: ${t} is required and must be a valid Date (received: ${String(r)})`);
|
|
1771
1876
|
}
|
|
1772
|
-
function
|
|
1773
|
-
if (
|
|
1877
|
+
function Gr(e, t, r) {
|
|
1878
|
+
if (sr(e, "minDate", t), sr(e, "maxDate", r), r.getTime() <= t.getTime())
|
|
1774
1879
|
throw new RangeError(`${e}: maxDate must be strictly later than minDate (minDate: ${t.toISOString()}, maxDate: ${r.toISOString()})`);
|
|
1775
1880
|
}
|
|
1776
|
-
function
|
|
1881
|
+
function _r(e, t, r) {
|
|
1777
1882
|
if (!Array.isArray(r) || r.length !== 2)
|
|
1778
1883
|
throw new RangeError(`${e}: ${t} is required and must be a [lower, upper] Date tuple (received: ${String(r)})`);
|
|
1779
|
-
if (
|
|
1884
|
+
if (sr(e, `${t}[0]`, r[0]), sr(e, `${t}[1]`, r[1]), r[0].getTime() > r[1].getTime())
|
|
1780
1885
|
throw new RangeError(`${e}: ${t} upper must not be earlier than lower (lower: ${r[0].toISOString()}, upper: ${r[1].toISOString()})`);
|
|
1781
1886
|
}
|
|
1782
|
-
function
|
|
1783
|
-
if (r.getTime() < n.getTime() || r.getTime() >
|
|
1784
|
-
throw new RangeError(`${e}: ${t} must lie within ${
|
|
1887
|
+
function Xr(e, t, r, n, o, s) {
|
|
1888
|
+
if (r.getTime() < n.getTime() || r.getTime() > o.getTime())
|
|
1889
|
+
throw new RangeError(`${e}: ${t} must lie within ${s} (value: ${r.toISOString()}, lower: ${n.toISOString()}, upper: ${o.toISOString()})`);
|
|
1785
1890
|
}
|
|
1786
|
-
function
|
|
1787
|
-
|
|
1891
|
+
function Kr(e, t, r, n, o, s) {
|
|
1892
|
+
Xr(e, `${t}[0]`, r[0], n, o, s), Xr(e, `${t}[1]`, r[1], n, o, s);
|
|
1788
1893
|
}
|
|
1789
|
-
function
|
|
1894
|
+
function _e(e, t, r) {
|
|
1790
1895
|
return e < t ? t : e > r ? r : e;
|
|
1791
1896
|
}
|
|
1792
|
-
function
|
|
1793
|
-
|
|
1794
|
-
|
|
1897
|
+
function qr(e, t, r, n, o, s) {
|
|
1898
|
+
if (r !== !0) return [];
|
|
1899
|
+
const i = e[0].getTime(), c = e[1].getTime();
|
|
1900
|
+
return kt(n, t, o, s).filter((h) => h.getTime() >= i && h.getTime() <= c);
|
|
1901
|
+
}
|
|
1902
|
+
function lr(e, t, r, n) {
|
|
1903
|
+
if (n.length === 0) return _e(e, r[0], r[1]);
|
|
1904
|
+
const o = n[Me(n, e, t)];
|
|
1905
|
+
return o.getTime() === e.getTime() ? e : o;
|
|
1906
|
+
}
|
|
1907
|
+
function Wr(e, t, r, n) {
|
|
1908
|
+
const o = lr(e[0], t, r, n), s = lr(e[1], t, r, n);
|
|
1909
|
+
return [o, s < o ? o : s];
|
|
1795
1910
|
}
|
|
1796
|
-
function
|
|
1797
|
-
const
|
|
1798
|
-
return e[Math.max(0, Math.min(e.length - 1,
|
|
1911
|
+
function jr(e, t, r, n) {
|
|
1912
|
+
const o = Me(e, r, t) + n;
|
|
1913
|
+
return e[Math.max(0, Math.min(e.length - 1, o))];
|
|
1799
1914
|
}
|
|
1800
|
-
function
|
|
1801
|
-
const t = Z(e), r = t.current, n = e,
|
|
1802
|
-
return
|
|
1915
|
+
function Zr(e) {
|
|
1916
|
+
const t = Z(e), r = t.current, n = e, o = Object.keys(r), s = Object.keys(n);
|
|
1917
|
+
return o.length === s.length && s.every((c) => Object.is(r[c], n[c])) || (t.current = e), t.current;
|
|
1803
1918
|
}
|
|
1804
|
-
function
|
|
1805
|
-
const { unit: t, minDate: r, maxDate: n, initialRange:
|
|
1806
|
-
|
|
1807
|
-
const c =
|
|
1808
|
-
let
|
|
1809
|
-
const
|
|
1810
|
-
(
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1813
|
-
const
|
|
1814
|
-
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1817
|
-
const
|
|
1818
|
-
const { minDate:
|
|
1819
|
-
k.getTime() ===
|
|
1820
|
-
}, []),
|
|
1821
|
-
(
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1919
|
+
function ei(e) {
|
|
1920
|
+
const { unit: t, minDate: r, maxDate: n, initialRange: o, onChangeRange: s, ...i } = e;
|
|
1921
|
+
Gr("usePeriodSliderRange", r, n), _r("usePeriodSliderRange", "initialRange", o), Kr("usePeriodSliderRange", "initialRange", o, r, n, "[minDate, maxDate]");
|
|
1922
|
+
const c = Zr(i), h = Z(o), [m, R] = Le(o);
|
|
1923
|
+
let S = m;
|
|
1924
|
+
const l = [_e(m[0], r, n), _e(m[1], r, n)];
|
|
1925
|
+
(l[0] !== m[0] || l[1] !== m[1]) && (S = l, R(l));
|
|
1926
|
+
const I = Z(S);
|
|
1927
|
+
I.current = S;
|
|
1928
|
+
const re = Z({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
|
|
1929
|
+
re.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
|
|
1930
|
+
const ae = Z(s);
|
|
1931
|
+
ae.current = s;
|
|
1932
|
+
const $ = F((p) => {
|
|
1933
|
+
const { minDate: M, maxDate: x } = re.current, k = _e(p[0], M, x), A = _e(p[1], M, x), J = I.current;
|
|
1934
|
+
k.getTime() === J[0].getTime() && A.getTime() === J[1].getTime() || (I.current = [k, A], R([k, A]), ae.current?.(k, A));
|
|
1935
|
+
}, []), de = F(
|
|
1936
|
+
(p) => {
|
|
1937
|
+
const M = I.current, x = p.getTime() > M[1].getTime() ? p : M[1];
|
|
1938
|
+
$([p, x]);
|
|
1824
1939
|
},
|
|
1825
|
-
[
|
|
1826
|
-
),
|
|
1827
|
-
(
|
|
1828
|
-
const
|
|
1829
|
-
|
|
1940
|
+
[$]
|
|
1941
|
+
), ie = F(
|
|
1942
|
+
(p) => {
|
|
1943
|
+
const M = I.current, x = p.getTime() < M[0].getTime() ? p : M[0];
|
|
1944
|
+
$([x, p]);
|
|
1830
1945
|
},
|
|
1831
|
-
[
|
|
1832
|
-
),
|
|
1833
|
-
(
|
|
1834
|
-
|
|
1946
|
+
[$]
|
|
1947
|
+
), P = F(
|
|
1948
|
+
(p, M) => {
|
|
1949
|
+
$([p, M]);
|
|
1835
1950
|
},
|
|
1836
|
-
[
|
|
1837
|
-
),
|
|
1838
|
-
(
|
|
1839
|
-
const { minDate:
|
|
1840
|
-
if (
|
|
1841
|
-
|
|
1951
|
+
[$]
|
|
1952
|
+
), V = F(
|
|
1953
|
+
(p) => {
|
|
1954
|
+
const { minDate: M, maxDate: x, allowedDates: k } = re.current, A = I.current, J = kt(k, t, M, x);
|
|
1955
|
+
if (J.length > 0) {
|
|
1956
|
+
$([jr(J, t, A[0], p), jr(J, t, A[1], p)]);
|
|
1842
1957
|
return;
|
|
1843
1958
|
}
|
|
1844
|
-
|
|
1959
|
+
$([Oe(t, A[0], p), Oe(t, A[1], p)]);
|
|
1845
1960
|
},
|
|
1846
|
-
[t,
|
|
1847
|
-
), z =
|
|
1848
|
-
|
|
1849
|
-
}, [
|
|
1961
|
+
[t, $]
|
|
1962
|
+
), z = F(() => {
|
|
1963
|
+
$(h.current);
|
|
1964
|
+
}, [$]), ne = v(
|
|
1850
1965
|
() => ({
|
|
1851
|
-
value:
|
|
1852
|
-
onChange:
|
|
1966
|
+
value: S[0],
|
|
1967
|
+
onChange: de,
|
|
1853
1968
|
minDate: r,
|
|
1854
|
-
maxDate:
|
|
1969
|
+
maxDate: S[1],
|
|
1855
1970
|
unit: t
|
|
1856
1971
|
}),
|
|
1857
|
-
[
|
|
1858
|
-
),
|
|
1972
|
+
[S[0], S[1], de, r, t]
|
|
1973
|
+
), j = v(
|
|
1859
1974
|
() => ({
|
|
1860
|
-
value:
|
|
1861
|
-
onChange:
|
|
1862
|
-
minDate:
|
|
1975
|
+
value: S[1],
|
|
1976
|
+
onChange: ie,
|
|
1977
|
+
minDate: S[0],
|
|
1863
1978
|
maxDate: n,
|
|
1864
1979
|
unit: t
|
|
1865
1980
|
}),
|
|
1866
|
-
[
|
|
1867
|
-
),
|
|
1981
|
+
[S[0], S[1], ie, n, t]
|
|
1982
|
+
), W = v(
|
|
1868
1983
|
() => ({
|
|
1869
1984
|
...c,
|
|
1870
1985
|
mode: "range",
|
|
1871
1986
|
unit: t,
|
|
1872
|
-
range:
|
|
1987
|
+
range: S,
|
|
1873
1988
|
minDate: r,
|
|
1874
1989
|
maxDate: n,
|
|
1875
|
-
onChangeRange:
|
|
1990
|
+
onChangeRange: P
|
|
1876
1991
|
}),
|
|
1877
|
-
[c, t,
|
|
1992
|
+
[c, t, S, r, n, P]
|
|
1878
1993
|
);
|
|
1879
1994
|
return {
|
|
1880
|
-
range:
|
|
1881
|
-
lowerDate:
|
|
1882
|
-
upperDate:
|
|
1883
|
-
setRange:
|
|
1884
|
-
setLowerDate:
|
|
1885
|
-
setUpperDate:
|
|
1886
|
-
shiftRange:
|
|
1995
|
+
range: S,
|
|
1996
|
+
lowerDate: S[0],
|
|
1997
|
+
upperDate: S[1],
|
|
1998
|
+
setRange: R,
|
|
1999
|
+
setLowerDate: de,
|
|
2000
|
+
setUpperDate: ie,
|
|
2001
|
+
shiftRange: V,
|
|
1887
2002
|
resetRange: z,
|
|
1888
|
-
startSelectorProps:
|
|
1889
|
-
endSelectorProps:
|
|
1890
|
-
sliderProps:
|
|
2003
|
+
startSelectorProps: ne,
|
|
2004
|
+
endSelectorProps: j,
|
|
2005
|
+
sliderProps: W
|
|
1891
2006
|
};
|
|
1892
2007
|
}
|
|
1893
|
-
function
|
|
1894
|
-
const { unit: t, minDate: r, maxDate: n, initialValue:
|
|
1895
|
-
|
|
1896
|
-
const c =
|
|
1897
|
-
let
|
|
1898
|
-
const
|
|
1899
|
-
|
|
1900
|
-
const
|
|
1901
|
-
|
|
1902
|
-
const
|
|
1903
|
-
|
|
1904
|
-
const
|
|
1905
|
-
|
|
1906
|
-
const
|
|
1907
|
-
const { minDate:
|
|
1908
|
-
|
|
1909
|
-
}, []),
|
|
2008
|
+
function ti(e) {
|
|
2009
|
+
const { unit: t, minDate: r, maxDate: n, initialValue: o, onChangePoint: s, ...i } = e;
|
|
2010
|
+
Gr("usePeriodSliderPoint", r, n), sr("usePeriodSliderPoint", "initialValue", o), Xr("usePeriodSliderPoint", "initialValue", o, r, n, "[minDate, maxDate]");
|
|
2011
|
+
const c = Zr(i), h = Z(o), [m, R] = Le(o);
|
|
2012
|
+
let S = m;
|
|
2013
|
+
const l = _e(m, r, n);
|
|
2014
|
+
l !== m && (S = l, R(l));
|
|
2015
|
+
const I = Z(S);
|
|
2016
|
+
I.current = S;
|
|
2017
|
+
const re = Z({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
|
|
2018
|
+
re.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
|
|
2019
|
+
const ae = Z(s);
|
|
2020
|
+
ae.current = s;
|
|
2021
|
+
const $ = F((z) => {
|
|
2022
|
+
const { minDate: ne, maxDate: j } = re.current, W = _e(z, ne, j);
|
|
2023
|
+
W.getTime() !== I.current.getTime() && (I.current = W, R(W), ae.current?.(W));
|
|
2024
|
+
}, []), de = F(
|
|
1910
2025
|
(z) => {
|
|
1911
|
-
const { minDate:
|
|
1912
|
-
if (
|
|
1913
|
-
|
|
2026
|
+
const { minDate: ne, maxDate: j, allowedDates: W } = re.current, p = kt(W, t, ne, j);
|
|
2027
|
+
if (p.length > 0) {
|
|
2028
|
+
$(jr(p, t, I.current, z));
|
|
1914
2029
|
return;
|
|
1915
2030
|
}
|
|
1916
|
-
|
|
2031
|
+
$(Oe(t, I.current, z));
|
|
1917
2032
|
},
|
|
1918
|
-
[t,
|
|
1919
|
-
),
|
|
1920
|
-
|
|
1921
|
-
}, [
|
|
2033
|
+
[t, $]
|
|
2034
|
+
), ie = F(() => {
|
|
2035
|
+
$(h.current);
|
|
2036
|
+
}, [$]), P = v(
|
|
1922
2037
|
() => ({
|
|
1923
|
-
value:
|
|
1924
|
-
onChange:
|
|
2038
|
+
value: S,
|
|
2039
|
+
onChange: $,
|
|
1925
2040
|
minDate: r,
|
|
1926
2041
|
maxDate: n,
|
|
1927
2042
|
unit: t
|
|
1928
2043
|
}),
|
|
1929
|
-
[
|
|
1930
|
-
),
|
|
2044
|
+
[S, $, r, n, t]
|
|
2045
|
+
), V = v(
|
|
1931
2046
|
() => ({
|
|
1932
2047
|
...c,
|
|
1933
2048
|
mode: "point",
|
|
1934
2049
|
unit: t,
|
|
1935
|
-
value:
|
|
2050
|
+
value: S,
|
|
1936
2051
|
minDate: r,
|
|
1937
2052
|
maxDate: n,
|
|
1938
|
-
onChangePoint:
|
|
2053
|
+
onChangePoint: $
|
|
1939
2054
|
}),
|
|
1940
|
-
[c, t,
|
|
2055
|
+
[c, t, S, r, n, $]
|
|
1941
2056
|
);
|
|
1942
2057
|
return {
|
|
1943
|
-
value:
|
|
1944
|
-
setValue:
|
|
1945
|
-
shiftValue:
|
|
1946
|
-
resetValue:
|
|
1947
|
-
selectorProps:
|
|
1948
|
-
sliderProps:
|
|
2058
|
+
value: S,
|
|
2059
|
+
setValue: R,
|
|
2060
|
+
shiftValue: de,
|
|
2061
|
+
resetValue: ie,
|
|
2062
|
+
selectorProps: P,
|
|
2063
|
+
sliderProps: V
|
|
1949
2064
|
};
|
|
1950
2065
|
}
|
|
1951
|
-
function
|
|
1952
|
-
const { unit: t, minDate: r, maxDate: n, initialMacroRange:
|
|
1953
|
-
|
|
1954
|
-
const
|
|
1955
|
-
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1971
|
-
const
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
2066
|
+
function ri(e) {
|
|
2067
|
+
const { unit: t, minDate: r, maxDate: n, initialMacroRange: o, initialMicroRange: s, macroUnit: i = t, microUnit: c = t, onChangeMacroRange: h, onChangeMicroRange: m, ...R } = e;
|
|
2068
|
+
Gr("useVernierSliderRange", r, n), _r("useVernierSliderRange", "initialMacroRange", o), _r("useVernierSliderRange", "initialMicroRange", s), Kr("useVernierSliderRange", "initialMacroRange", o, r, n, "[minDate, maxDate]");
|
|
2069
|
+
const S = yt(i, c, o, r, n);
|
|
2070
|
+
Kr("useVernierSliderRange", "initialMicroRange", s, S[0], S[1], "the initial macro window");
|
|
2071
|
+
const l = Zr(R), I = Z(o), re = Z(s), [ae, $] = Le(o), [de, ie] = Le(s);
|
|
2072
|
+
let P = ae;
|
|
2073
|
+
const V = [_e(ae[0], r, n), _e(ae[1], r, n)];
|
|
2074
|
+
(V[0] !== ae[0] || V[1] !== ae[1]) && (P = V, $(V));
|
|
2075
|
+
const z = v(() => yt(i, c, P, r, n), [i, c, P, r, n]), ne = v(
|
|
2076
|
+
() => qr(z, c, l.microIsDiscrete, l.microAllowedDates ?? l.allowedDates, r, n),
|
|
2077
|
+
[z, c, l.microIsDiscrete, l.microAllowedDates, l.allowedDates, r, n]
|
|
2078
|
+
), j = v(
|
|
2079
|
+
() => l.macroIsDiscrete === !0 ? kt(l.macroAllowedDates ?? l.allowedDates, i, r, n) : [],
|
|
2080
|
+
[l.macroIsDiscrete, l.macroAllowedDates, l.allowedDates, i, r, n]
|
|
2081
|
+
), W = Z(j);
|
|
2082
|
+
W.current = j;
|
|
2083
|
+
let p = de;
|
|
2084
|
+
const M = Wr(de, c, z, ne);
|
|
2085
|
+
(M[0] !== de[0] || M[1] !== de[1]) && (p = M, ie(M));
|
|
2086
|
+
const x = Z(P);
|
|
2087
|
+
x.current = P;
|
|
2088
|
+
const k = Z(p);
|
|
2089
|
+
k.current = p;
|
|
2090
|
+
const A = Z({ minDate: r, maxDate: n, macroIsDiscrete: l.macroIsDiscrete, macroAllowedDates: l.macroAllowedDates, microIsDiscrete: l.microIsDiscrete, microAllowedDates: l.microAllowedDates, allowedDates: l.allowedDates });
|
|
2091
|
+
A.current = { minDate: r, maxDate: n, macroIsDiscrete: l.macroIsDiscrete, macroAllowedDates: l.macroAllowedDates, microIsDiscrete: l.microIsDiscrete, microAllowedDates: l.microAllowedDates, allowedDates: l.allowedDates };
|
|
2092
|
+
const J = Z(h);
|
|
2093
|
+
J.current = h;
|
|
2094
|
+
const fe = Z(m);
|
|
2095
|
+
fe.current = m;
|
|
2096
|
+
const _ = F(
|
|
2097
|
+
(g) => {
|
|
2098
|
+
const { minDate: L, maxDate: O } = A.current;
|
|
2099
|
+
return yt(i, c, g, L, O);
|
|
1978
2100
|
},
|
|
1979
|
-
[i, c
|
|
1980
|
-
),
|
|
1981
|
-
(
|
|
1982
|
-
|
|
2101
|
+
[i, c]
|
|
2102
|
+
), Q = F(
|
|
2103
|
+
(g) => {
|
|
2104
|
+
const { microIsDiscrete: L, microAllowedDates: O, allowedDates: De, minDate: C, maxDate: G } = A.current;
|
|
2105
|
+
return qr(g, c, L, O ?? De, C, G);
|
|
1983
2106
|
},
|
|
1984
|
-
[
|
|
1985
|
-
), ue =
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
2107
|
+
[c]
|
|
2108
|
+
), ue = F((g, L) => {
|
|
2109
|
+
const O = x.current, De = k.current;
|
|
2110
|
+
(g[0].getTime() !== O[0].getTime() || g[1].getTime() !== O[1].getTime()) && (x.current = g, $(g), J.current?.(g[0], g[1])), (L[0].getTime() !== De[0].getTime() || L[1].getTime() !== De[1].getTime()) && (k.current = L, ie(L), fe.current?.(L[0], L[1]));
|
|
2111
|
+
}, []), K = F(
|
|
2112
|
+
(g, L) => {
|
|
2113
|
+
const { minDate: O, maxDate: De } = A.current, C = [_e(g, O, De), _e(L, O, De)], G = _(C);
|
|
2114
|
+
ue(C, Wr(k.current, c, G, Q(G)));
|
|
1989
2115
|
},
|
|
1990
|
-
[
|
|
1991
|
-
),
|
|
1992
|
-
(
|
|
1993
|
-
const
|
|
1994
|
-
|
|
2116
|
+
[c, _, Q, ue]
|
|
2117
|
+
), X = F(
|
|
2118
|
+
(g, L) => {
|
|
2119
|
+
const O = _(x.current);
|
|
2120
|
+
ue(x.current, Wr([g, L], c, O, Q(O)));
|
|
1995
2121
|
},
|
|
1996
|
-
[
|
|
1997
|
-
),
|
|
1998
|
-
(
|
|
1999
|
-
const
|
|
2000
|
-
|
|
2122
|
+
[c, _, Q, ue]
|
|
2123
|
+
), oe = F(
|
|
2124
|
+
(g) => {
|
|
2125
|
+
const L = x.current[1], O = g > L ? g : L;
|
|
2126
|
+
K(g, O);
|
|
2001
2127
|
},
|
|
2002
|
-
[
|
|
2003
|
-
),
|
|
2004
|
-
(
|
|
2005
|
-
const
|
|
2006
|
-
|
|
2128
|
+
[K]
|
|
2129
|
+
), le = F(
|
|
2130
|
+
(g) => {
|
|
2131
|
+
const L = x.current[0], O = g < L ? g : L;
|
|
2132
|
+
K(O, g);
|
|
2007
2133
|
},
|
|
2008
|
-
[
|
|
2009
|
-
),
|
|
2010
|
-
(
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2134
|
+
[K]
|
|
2135
|
+
), Xe = F(
|
|
2136
|
+
(g) => {
|
|
2137
|
+
const L = k.current[1], O = g > L ? g : L;
|
|
2138
|
+
X(g, O);
|
|
2013
2139
|
},
|
|
2014
|
-
[
|
|
2015
|
-
),
|
|
2016
|
-
(
|
|
2017
|
-
const
|
|
2018
|
-
|
|
2140
|
+
[X]
|
|
2141
|
+
), Ae = F(
|
|
2142
|
+
(g) => {
|
|
2143
|
+
const L = k.current[0], O = g < L ? g : L;
|
|
2144
|
+
X(O, g);
|
|
2019
2145
|
},
|
|
2020
|
-
[
|
|
2021
|
-
),
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2146
|
+
[X]
|
|
2147
|
+
), Ie = F(
|
|
2148
|
+
(g) => {
|
|
2149
|
+
const { minDate: L, maxDate: O } = A.current, De = x.current, C = W.current;
|
|
2150
|
+
if (C.length > 0) {
|
|
2151
|
+
const He = Me(C, De[0], i) + g, Ue = Me(C, De[1], i) + g;
|
|
2152
|
+
if (He < 0 || Ue > C.length - 1) return;
|
|
2153
|
+
K(C[He], C[Ue]);
|
|
2154
|
+
return;
|
|
2155
|
+
}
|
|
2156
|
+
const G = Oe(i, De[0], g), Ce = Oe(i, De[1], g);
|
|
2157
|
+
G < L || Ce > O || K(G, Ce);
|
|
2158
|
+
},
|
|
2159
|
+
[i, K]
|
|
2160
|
+
), Se = F(
|
|
2161
|
+
(g) => {
|
|
2162
|
+
const L = x.current, O = k.current, De = _(L), [C, G] = De, Ce = Q(De);
|
|
2163
|
+
if (Ce.length > 0) {
|
|
2164
|
+
const he = Me(Ce, O[0], c) + g, ve = Me(Ce, O[1], c) + g;
|
|
2165
|
+
if (he < 0 || ve > Ce.length - 1) return;
|
|
2166
|
+
X(Ce[he], Ce[ve]);
|
|
2167
|
+
return;
|
|
2168
|
+
}
|
|
2169
|
+
const He = Oe(c, O[0], g), Ue = Oe(c, O[1], g);
|
|
2170
|
+
He < C || Ue > G || X(He, Ue);
|
|
2171
|
+
},
|
|
2172
|
+
[c, _, Q, X]
|
|
2173
|
+
), Ze = F(() => {
|
|
2174
|
+
const g = I.current, L = _(g);
|
|
2175
|
+
ue(g, Wr(re.current, c, L, Q(L)));
|
|
2176
|
+
}, [c, _, Q, ue]), [Je, st] = z, Fe = v(
|
|
2025
2177
|
() => ({
|
|
2026
|
-
value:
|
|
2027
|
-
onChange:
|
|
2178
|
+
value: P[0],
|
|
2179
|
+
onChange: oe,
|
|
2028
2180
|
minDate: r,
|
|
2029
|
-
maxDate:
|
|
2181
|
+
maxDate: P[1],
|
|
2030
2182
|
unit: i
|
|
2031
2183
|
}),
|
|
2032
|
-
[
|
|
2033
|
-
),
|
|
2184
|
+
[P, oe, r, i]
|
|
2185
|
+
), dt = v(
|
|
2034
2186
|
() => ({
|
|
2035
|
-
value:
|
|
2036
|
-
onChange:
|
|
2037
|
-
minDate:
|
|
2187
|
+
value: P[1],
|
|
2188
|
+
onChange: le,
|
|
2189
|
+
minDate: P[0],
|
|
2038
2190
|
maxDate: n,
|
|
2039
2191
|
unit: i
|
|
2040
2192
|
}),
|
|
2041
|
-
[
|
|
2042
|
-
),
|
|
2193
|
+
[P, le, n, i]
|
|
2194
|
+
), q = v(
|
|
2043
2195
|
() => ({
|
|
2044
|
-
value:
|
|
2045
|
-
onChange:
|
|
2046
|
-
minDate:
|
|
2047
|
-
maxDate:
|
|
2196
|
+
value: p[0],
|
|
2197
|
+
onChange: Xe,
|
|
2198
|
+
minDate: Je,
|
|
2199
|
+
maxDate: p[1],
|
|
2048
2200
|
unit: c
|
|
2049
2201
|
}),
|
|
2050
|
-
[
|
|
2051
|
-
),
|
|
2202
|
+
[p, Xe, Je, c]
|
|
2203
|
+
), te = v(
|
|
2052
2204
|
() => ({
|
|
2053
|
-
value:
|
|
2054
|
-
onChange:
|
|
2055
|
-
minDate:
|
|
2056
|
-
maxDate:
|
|
2205
|
+
value: p[1],
|
|
2206
|
+
onChange: Ae,
|
|
2207
|
+
minDate: p[0],
|
|
2208
|
+
maxDate: st,
|
|
2057
2209
|
unit: c
|
|
2058
2210
|
}),
|
|
2059
|
-
[
|
|
2060
|
-
),
|
|
2211
|
+
[p, Ae, st, c]
|
|
2212
|
+
), be = v(
|
|
2061
2213
|
() => ({
|
|
2062
|
-
...
|
|
2214
|
+
...l,
|
|
2063
2215
|
mode: "vernier",
|
|
2064
2216
|
unit: t,
|
|
2065
2217
|
macroUnit: i,
|
|
2066
2218
|
microUnit: c,
|
|
2067
2219
|
minDate: r,
|
|
2068
2220
|
maxDate: n,
|
|
2069
|
-
macroRange:
|
|
2070
|
-
microRange:
|
|
2071
|
-
onChangeMacroRange:
|
|
2072
|
-
onChangeMicroRange:
|
|
2221
|
+
macroRange: P,
|
|
2222
|
+
microRange: p,
|
|
2223
|
+
onChangeMacroRange: K,
|
|
2224
|
+
onChangeMicroRange: X
|
|
2073
2225
|
}),
|
|
2074
|
-
[
|
|
2226
|
+
[l, t, i, c, r, n, P, p, K, X]
|
|
2075
2227
|
);
|
|
2076
2228
|
return {
|
|
2077
|
-
macroRange:
|
|
2078
|
-
setMacroRange:
|
|
2079
|
-
microRange:
|
|
2080
|
-
setMicroRange:
|
|
2081
|
-
setMacroLowerDate:
|
|
2082
|
-
setMacroUpperDate:
|
|
2083
|
-
setMicroLowerDate:
|
|
2084
|
-
setMicroUpperDate:
|
|
2085
|
-
shiftMacroRange:
|
|
2086
|
-
shiftMicroRange:
|
|
2087
|
-
resetVernier:
|
|
2088
|
-
macroStartSelectorProps:
|
|
2089
|
-
macroEndSelectorProps:
|
|
2090
|
-
microStartSelectorProps:
|
|
2091
|
-
microEndSelectorProps:
|
|
2092
|
-
sliderProps:
|
|
2229
|
+
macroRange: P,
|
|
2230
|
+
setMacroRange: $,
|
|
2231
|
+
microRange: p,
|
|
2232
|
+
setMicroRange: ie,
|
|
2233
|
+
setMacroLowerDate: oe,
|
|
2234
|
+
setMacroUpperDate: le,
|
|
2235
|
+
setMicroLowerDate: Xe,
|
|
2236
|
+
setMicroUpperDate: Ae,
|
|
2237
|
+
shiftMacroRange: Ie,
|
|
2238
|
+
shiftMicroRange: Se,
|
|
2239
|
+
resetVernier: Ze,
|
|
2240
|
+
macroStartSelectorProps: Fe,
|
|
2241
|
+
macroEndSelectorProps: dt,
|
|
2242
|
+
microStartSelectorProps: q,
|
|
2243
|
+
microEndSelectorProps: te,
|
|
2244
|
+
sliderProps: be
|
|
2093
2245
|
};
|
|
2094
2246
|
}
|
|
2095
|
-
function
|
|
2247
|
+
function ni(e) {
|
|
2248
|
+
const { unit: t, minDate: r, maxDate: n, initialMacroRange: o, initialMicroValue: s, macroUnit: i = t, microUnit: c = t, onChangeMacroRange: h, onChangeMicroPoint: m, ...R } = e;
|
|
2249
|
+
Gr("useVernierSliderPoint", r, n), _r("useVernierSliderPoint", "initialMacroRange", o), sr("useVernierSliderPoint", "initialMicroValue", s), Kr("useVernierSliderPoint", "initialMacroRange", o, r, n, "[minDate, maxDate]");
|
|
2250
|
+
const S = yt(i, c, o, r, n);
|
|
2251
|
+
Xr("useVernierSliderPoint", "initialMicroValue", s, S[0], S[1], "the initial macro window");
|
|
2252
|
+
const l = Zr(R), I = Z(o), re = Z(s), [ae, $] = Le(o), [de, ie] = Le(s);
|
|
2253
|
+
let P = ae;
|
|
2254
|
+
const V = [_e(ae[0], r, n), _e(ae[1], r, n)];
|
|
2255
|
+
(V[0] !== ae[0] || V[1] !== ae[1]) && (P = V, $(V));
|
|
2256
|
+
const z = v(() => yt(i, c, P, r, n), [i, c, P, r, n]), ne = v(
|
|
2257
|
+
() => qr(z, c, l.microIsDiscrete, l.microAllowedDates ?? l.allowedDates, r, n),
|
|
2258
|
+
[z, c, l.microIsDiscrete, l.microAllowedDates, l.allowedDates, r, n]
|
|
2259
|
+
), j = v(
|
|
2260
|
+
() => l.macroIsDiscrete === !0 ? kt(l.macroAllowedDates ?? l.allowedDates, i, r, n) : [],
|
|
2261
|
+
[l.macroIsDiscrete, l.macroAllowedDates, l.allowedDates, i, r, n]
|
|
2262
|
+
), W = Z(j);
|
|
2263
|
+
W.current = j;
|
|
2264
|
+
let p = de;
|
|
2265
|
+
const M = lr(de, c, z, ne);
|
|
2266
|
+
M !== de && (p = M, ie(M));
|
|
2267
|
+
const x = Z(P);
|
|
2268
|
+
x.current = P;
|
|
2269
|
+
const k = Z(p);
|
|
2270
|
+
k.current = p;
|
|
2271
|
+
const A = Z({ minDate: r, maxDate: n, macroIsDiscrete: l.macroIsDiscrete, macroAllowedDates: l.macroAllowedDates, microIsDiscrete: l.microIsDiscrete, microAllowedDates: l.microAllowedDates, allowedDates: l.allowedDates });
|
|
2272
|
+
A.current = { minDate: r, maxDate: n, macroIsDiscrete: l.macroIsDiscrete, macroAllowedDates: l.macroAllowedDates, microIsDiscrete: l.microIsDiscrete, microAllowedDates: l.microAllowedDates, allowedDates: l.allowedDates };
|
|
2273
|
+
const J = Z(h);
|
|
2274
|
+
J.current = h;
|
|
2275
|
+
const fe = Z(m);
|
|
2276
|
+
fe.current = m;
|
|
2277
|
+
const _ = F(
|
|
2278
|
+
(q) => {
|
|
2279
|
+
const { minDate: te, maxDate: be } = A.current;
|
|
2280
|
+
return yt(i, c, q, te, be);
|
|
2281
|
+
},
|
|
2282
|
+
[i, c]
|
|
2283
|
+
), Q = F(
|
|
2284
|
+
(q) => {
|
|
2285
|
+
const { microIsDiscrete: te, microAllowedDates: be, allowedDates: g, minDate: L, maxDate: O } = A.current;
|
|
2286
|
+
return qr(q, c, te, be ?? g, L, O);
|
|
2287
|
+
},
|
|
2288
|
+
[c]
|
|
2289
|
+
), ue = F((q, te) => {
|
|
2290
|
+
const be = x.current, g = k.current;
|
|
2291
|
+
(q[0].getTime() !== be[0].getTime() || q[1].getTime() !== be[1].getTime()) && (x.current = q, $(q), J.current?.(q[0], q[1])), te.getTime() !== g.getTime() && (k.current = te, ie(te), fe.current?.(te));
|
|
2292
|
+
}, []), K = F(
|
|
2293
|
+
(q, te) => {
|
|
2294
|
+
const { minDate: be, maxDate: g } = A.current, L = [_e(q, be, g), _e(te, be, g)], O = _(L);
|
|
2295
|
+
ue(L, lr(k.current, c, O, Q(O)));
|
|
2296
|
+
},
|
|
2297
|
+
[c, _, Q, ue]
|
|
2298
|
+
), X = F(
|
|
2299
|
+
(q) => {
|
|
2300
|
+
const te = _(x.current);
|
|
2301
|
+
ue(x.current, lr(q, c, te, Q(te)));
|
|
2302
|
+
},
|
|
2303
|
+
[c, _, Q, ue]
|
|
2304
|
+
), oe = F(
|
|
2305
|
+
(q) => {
|
|
2306
|
+
const te = x.current[1], be = q > te ? q : te;
|
|
2307
|
+
K(q, be);
|
|
2308
|
+
},
|
|
2309
|
+
[K]
|
|
2310
|
+
), le = F(
|
|
2311
|
+
(q) => {
|
|
2312
|
+
const te = x.current[0], be = q < te ? q : te;
|
|
2313
|
+
K(be, q);
|
|
2314
|
+
},
|
|
2315
|
+
[K]
|
|
2316
|
+
), Xe = F(
|
|
2317
|
+
(q) => {
|
|
2318
|
+
const { minDate: te, maxDate: be } = A.current, g = x.current, L = W.current;
|
|
2319
|
+
if (L.length > 0) {
|
|
2320
|
+
const C = Me(L, g[0], i) + q, G = Me(L, g[1], i) + q;
|
|
2321
|
+
if (C < 0 || G > L.length - 1) return;
|
|
2322
|
+
K(L[C], L[G]);
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
2325
|
+
const O = Oe(i, g[0], q), De = Oe(i, g[1], q);
|
|
2326
|
+
O < te || De > be || K(O, De);
|
|
2327
|
+
},
|
|
2328
|
+
[i, K]
|
|
2329
|
+
), Ae = F(
|
|
2330
|
+
(q) => {
|
|
2331
|
+
const te = x.current, be = _(te), g = Q(be);
|
|
2332
|
+
if (g.length > 0) {
|
|
2333
|
+
X(jr(g, c, k.current, q));
|
|
2334
|
+
return;
|
|
2335
|
+
}
|
|
2336
|
+
X(Oe(c, k.current, q));
|
|
2337
|
+
},
|
|
2338
|
+
[c, _, Q, X]
|
|
2339
|
+
), Ie = F(() => {
|
|
2340
|
+
const q = I.current, te = _(q);
|
|
2341
|
+
ue(q, lr(re.current, c, te, Q(te)));
|
|
2342
|
+
}, [c, _, Q, ue]), [Se, Ze] = z, Je = v(
|
|
2343
|
+
() => ({
|
|
2344
|
+
value: P[0],
|
|
2345
|
+
onChange: oe,
|
|
2346
|
+
minDate: r,
|
|
2347
|
+
maxDate: P[1],
|
|
2348
|
+
unit: i
|
|
2349
|
+
}),
|
|
2350
|
+
[P, oe, r, i]
|
|
2351
|
+
), st = v(
|
|
2352
|
+
() => ({
|
|
2353
|
+
value: P[1],
|
|
2354
|
+
onChange: le,
|
|
2355
|
+
minDate: P[0],
|
|
2356
|
+
maxDate: n,
|
|
2357
|
+
unit: i
|
|
2358
|
+
}),
|
|
2359
|
+
[P, le, n, i]
|
|
2360
|
+
), Fe = v(
|
|
2361
|
+
() => ({
|
|
2362
|
+
value: p,
|
|
2363
|
+
onChange: X,
|
|
2364
|
+
minDate: Se,
|
|
2365
|
+
maxDate: Ze,
|
|
2366
|
+
unit: c
|
|
2367
|
+
}),
|
|
2368
|
+
[p, X, Se, Ze, c]
|
|
2369
|
+
), dt = v(
|
|
2370
|
+
() => ({
|
|
2371
|
+
...l,
|
|
2372
|
+
mode: "vernier",
|
|
2373
|
+
unit: t,
|
|
2374
|
+
macroUnit: i,
|
|
2375
|
+
microUnit: c,
|
|
2376
|
+
minDate: r,
|
|
2377
|
+
maxDate: n,
|
|
2378
|
+
macroRange: P,
|
|
2379
|
+
microValue: p,
|
|
2380
|
+
onChangeMacroRange: K,
|
|
2381
|
+
onChangeMicroPoint: X
|
|
2382
|
+
}),
|
|
2383
|
+
[l, t, i, c, r, n, P, p, K, X]
|
|
2384
|
+
);
|
|
2385
|
+
return {
|
|
2386
|
+
macroRange: P,
|
|
2387
|
+
setMacroRange: $,
|
|
2388
|
+
microValue: p,
|
|
2389
|
+
setMicroValue: ie,
|
|
2390
|
+
setMacroLowerDate: oe,
|
|
2391
|
+
setMacroUpperDate: le,
|
|
2392
|
+
setMicroDate: X,
|
|
2393
|
+
shiftMacroRange: Xe,
|
|
2394
|
+
shiftMicroValue: Ae,
|
|
2395
|
+
resetVernier: Ie,
|
|
2396
|
+
macroStartSelectorProps: Je,
|
|
2397
|
+
macroEndSelectorProps: st,
|
|
2398
|
+
microSelectorProps: Fe,
|
|
2399
|
+
sliderProps: dt
|
|
2400
|
+
};
|
|
2401
|
+
}
|
|
2402
|
+
function bo(e) {
|
|
2096
2403
|
const t = new Date(e, 0, 1);
|
|
2097
2404
|
return t.setFullYear(e), t;
|
|
2098
2405
|
}
|
|
2099
|
-
function
|
|
2406
|
+
function Br(e, t) {
|
|
2100
2407
|
if (e !== void 0 && (!(e instanceof Date) || Number.isNaN(e.getTime())))
|
|
2101
2408
|
throw new RangeError(`YearSelector: \`${t}\` must be a valid Date, received ${String(e)}.`);
|
|
2102
2409
|
}
|
|
2103
|
-
function
|
|
2410
|
+
function wo(e, t) {
|
|
2104
2411
|
if (e !== void 0 && !Number.isInteger(e))
|
|
2105
2412
|
throw new RangeError(`YearSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
|
|
2106
2413
|
}
|
|
2107
|
-
function
|
|
2414
|
+
function qa(e) {
|
|
2108
2415
|
if (e !== void 0)
|
|
2109
2416
|
try {
|
|
2110
2417
|
Intl.DateTimeFormat.supportedLocalesOf([e]);
|
|
@@ -2112,111 +2419,116 @@ function wo(e) {
|
|
|
2112
2419
|
throw new RangeError(`YearSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`);
|
|
2113
2420
|
}
|
|
2114
2421
|
}
|
|
2115
|
-
function
|
|
2116
|
-
const n = e === void 0 ? null : e,
|
|
2117
|
-
return n !== null &&
|
|
2422
|
+
function Mo(e, t, r) {
|
|
2423
|
+
const n = e === void 0 ? null : e, o = t === void 0 ? null : t.getFullYear();
|
|
2424
|
+
return n !== null && o !== null ? r(n, o) : n !== null ? n : o;
|
|
2118
2425
|
}
|
|
2119
|
-
const
|
|
2120
|
-
const { value: t, initialDate: r, onChange: n, children:
|
|
2121
|
-
|
|
2122
|
-
const
|
|
2123
|
-
if (
|
|
2426
|
+
const ja = (e) => {
|
|
2427
|
+
const { value: t, initialDate: r, onChange: n, children: o, minYear: s, maxYear: i, minDate: c, maxDate: h, className: m = "", style: R, disabled: S = !1, prevYearAriaLabel: l = "Previous year", nextYearAriaLabel: I = "Next year", selectAriaLabel: re = "Year", locale: ae } = e;
|
|
2428
|
+
Br(t, "value"), Br(r, "initialDate"), Br(c, "minDate"), Br(h, "maxDate"), wo(s, "minYear"), wo(i, "maxYear"), qa(ae);
|
|
2429
|
+
const $ = t ?? r;
|
|
2430
|
+
if ($ === void 0)
|
|
2124
2431
|
throw new RangeError("YearSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected year is never inferred from the wall clock.");
|
|
2125
|
-
const [
|
|
2126
|
-
if (z === null ||
|
|
2432
|
+
const [de, ie] = Le(() => $.getFullYear()), P = c?.getTime(), V = h?.getTime(), z = v(() => Mo(s, c, Math.max), [s, P]), ne = v(() => Mo(i, h, Math.min), [i, V]);
|
|
2433
|
+
if (z === null || ne === null)
|
|
2127
2434
|
throw new RangeError("YearSelector: a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`) are both required; the year option list is never invented.");
|
|
2128
|
-
if (z >
|
|
2129
|
-
throw new RangeError(`YearSelector: the resolved lower bound ${z} is after the resolved upper bound ${
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
}, [
|
|
2134
|
-
const
|
|
2135
|
-
if (!
|
|
2136
|
-
if (!
|
|
2137
|
-
throw new RangeError(`YearSelector: refusing to emit ${
|
|
2138
|
-
|
|
2435
|
+
if (z > ne)
|
|
2436
|
+
throw new RangeError(`YearSelector: the resolved lower bound ${z} is after the resolved upper bound ${ne}.`);
|
|
2437
|
+
const j = t !== void 0, W = t !== void 0 ? t.getFullYear() : de, p = W < z || W > ne, M = $.getTime();
|
|
2438
|
+
Nt(() => {
|
|
2439
|
+
j || ie($.getFullYear());
|
|
2440
|
+
}, [j, M]);
|
|
2441
|
+
const x = (X) => X >= z && X <= ne, k = (X) => {
|
|
2442
|
+
if (!S) {
|
|
2443
|
+
if (!x(X))
|
|
2444
|
+
throw new RangeError(`YearSelector: refusing to emit ${X}, which lies outside the declared bounds ${z}-${ne}.`);
|
|
2445
|
+
j || ie(X), n?.(bo(X), X);
|
|
2139
2446
|
}
|
|
2140
|
-
},
|
|
2141
|
-
|
|
2142
|
-
},
|
|
2143
|
-
|
|
2144
|
-
},
|
|
2145
|
-
const
|
|
2146
|
-
for (let
|
|
2147
|
-
|
|
2148
|
-
return
|
|
2149
|
-
}, [z,
|
|
2150
|
-
return /* @__PURE__ */
|
|
2151
|
-
/* @__PURE__ */
|
|
2447
|
+
}, A = x(W - 1) ? W - 1 : null, J = x(W + 1) ? W + 1 : null, fe = S || A === null, _ = S || J === null, Q = () => {
|
|
2448
|
+
A !== null && k(A);
|
|
2449
|
+
}, ue = () => {
|
|
2450
|
+
J !== null && k(J);
|
|
2451
|
+
}, K = v(() => {
|
|
2452
|
+
const X = [];
|
|
2453
|
+
for (let oe = ne; oe >= z; oe--)
|
|
2454
|
+
X.push(oe);
|
|
2455
|
+
return p && (X.push(W), X.sort((oe, le) => le - oe)), X;
|
|
2456
|
+
}, [z, ne, p, W]);
|
|
2457
|
+
return /* @__PURE__ */ pe("div", { className: `inline-flex w-32 items-center ${m}`, style: R, children: [
|
|
2458
|
+
/* @__PURE__ */ T(
|
|
2152
2459
|
"button",
|
|
2153
2460
|
{
|
|
2154
2461
|
type: "button",
|
|
2155
|
-
"aria-label":
|
|
2156
|
-
disabled:
|
|
2462
|
+
"aria-label": l,
|
|
2463
|
+
disabled: fe,
|
|
2157
2464
|
className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
|
|
2158
|
-
onClick:
|
|
2159
|
-
children: /* @__PURE__ */
|
|
2465
|
+
onClick: Q,
|
|
2466
|
+
children: /* @__PURE__ */ T("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
|
|
2160
2467
|
}
|
|
2161
2468
|
),
|
|
2162
|
-
/* @__PURE__ */
|
|
2469
|
+
/* @__PURE__ */ T(
|
|
2163
2470
|
"select",
|
|
2164
2471
|
{
|
|
2165
|
-
"aria-label":
|
|
2166
|
-
disabled:
|
|
2472
|
+
"aria-label": re,
|
|
2473
|
+
disabled: S,
|
|
2167
2474
|
className: "mx-1 my-auto w-18 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",
|
|
2168
|
-
value:
|
|
2169
|
-
onChange: (
|
|
2170
|
-
if (!
|
|
2171
|
-
const
|
|
2172
|
-
Number.isInteger(
|
|
2475
|
+
value: W,
|
|
2476
|
+
onChange: (X) => {
|
|
2477
|
+
if (!X.target.value) return;
|
|
2478
|
+
const oe = Number(X.target.value);
|
|
2479
|
+
Number.isInteger(oe) && k(oe);
|
|
2173
2480
|
},
|
|
2174
|
-
children:
|
|
2481
|
+
children: K.map((X) => /* @__PURE__ */ T("option", { value: X, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: et("year", bo(X), void 0, ae) }, X))
|
|
2175
2482
|
}
|
|
2176
2483
|
),
|
|
2177
|
-
/* @__PURE__ */
|
|
2484
|
+
/* @__PURE__ */ T(
|
|
2178
2485
|
"button",
|
|
2179
2486
|
{
|
|
2180
2487
|
type: "button",
|
|
2181
|
-
"aria-label":
|
|
2182
|
-
disabled:
|
|
2488
|
+
"aria-label": I,
|
|
2489
|
+
disabled: _,
|
|
2183
2490
|
className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
|
|
2184
|
-
onClick:
|
|
2185
|
-
children: /* @__PURE__ */
|
|
2491
|
+
onClick: ue,
|
|
2492
|
+
children: /* @__PURE__ */ T("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
|
|
2186
2493
|
}
|
|
2187
2494
|
),
|
|
2188
|
-
|
|
2495
|
+
o
|
|
2189
2496
|
] });
|
|
2190
|
-
},
|
|
2191
|
-
const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate,
|
|
2192
|
-
return !(
|
|
2497
|
+
}, Ga = Lr(ja, (e, t) => {
|
|
2498
|
+
const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, o = r ? r.getFullYear() : null, s = n ? n.getFullYear() : null;
|
|
2499
|
+
return !(o !== s || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.minYear !== t.minYear || e.maxYear !== t.maxYear || e.minDate?.getFullYear() !== t.minDate?.getFullYear() || e.maxDate?.getFullYear() !== t.maxDate?.getFullYear() || e.onChange !== t.onChange || e.children !== t.children || e.prevYearAriaLabel !== t.prevYearAriaLabel || e.nextYearAriaLabel !== t.nextYearAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.locale !== t.locale);
|
|
2193
2500
|
});
|
|
2194
|
-
|
|
2501
|
+
Ga.displayName = "YearSelector";
|
|
2195
2502
|
export {
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2503
|
+
ia as COLOR_SCHEME_PALETTES,
|
|
2504
|
+
Fa as DateSelector,
|
|
2505
|
+
Ka as MonthSelector,
|
|
2506
|
+
Aa as PeriodSlider,
|
|
2507
|
+
Ga as YearSelector,
|
|
2508
|
+
Oe as addUnit,
|
|
2509
|
+
$a as areStylesEqual,
|
|
2510
|
+
fa as calculateConnectDragValues,
|
|
2511
|
+
lo as calculateHandleDragValues,
|
|
2512
|
+
ga as calculateKeyboardActionValues,
|
|
2513
|
+
xo as calculateLabelSlant,
|
|
2514
|
+
va as calculateVernierMacroDrag,
|
|
2515
|
+
Da as calculateVernierMicroDrag,
|
|
2516
|
+
ce as decode,
|
|
2517
|
+
ge as encode,
|
|
2518
|
+
Me as findNearestDateIndex,
|
|
2519
|
+
et as formatLabel,
|
|
2520
|
+
nr as formatScreenReaderLabel,
|
|
2521
|
+
ma as getActiveDragHandle,
|
|
2522
|
+
sa as getMacroWindowEndDate,
|
|
2523
|
+
la as getMacroWindowStartDate,
|
|
2524
|
+
kt as getSortedAllowedDates,
|
|
2525
|
+
tt as normalizeDateByUnit,
|
|
2526
|
+
yt as resolveMacroWindow,
|
|
2527
|
+
To as resolveVernierRailZone,
|
|
2528
|
+
Ma as resolveVernierTargetHandle,
|
|
2529
|
+
wa as resolveWheelStep,
|
|
2530
|
+
ti as usePeriodSliderPoint,
|
|
2531
|
+
ei as usePeriodSliderRange,
|
|
2532
|
+
ni as useVernierSliderPoint,
|
|
2533
|
+
ri as useVernierSliderRange
|
|
2222
2534
|
};
|