@aiquants/period-slider 0.5.0 → 0.6.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 +111 -7
- package/dist/PeriodSlider.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +577 -575
- package/dist/styles/period-slider.css +1 -1
- package/dist/styles/period-slider.standalone.css +1 -1
- package/package.json +1 -1
- package/src/PeriodSlider.tsx +15 -7
- package/src/styles/period-slider.css +45 -27
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { addYears as
|
|
3
|
-
import { memo as sr, useId as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as v, jsxs as ce, Fragment as Wr } from "react/jsx-runtime";
|
|
2
|
+
import { addYears as Ra, addMonths as $a, addDays as Cr, format as Xt, getDaysInMonth as Cn, parseISO as In } from "date-fns";
|
|
3
|
+
import { memo as sr, useId as Pa, useRef as G, useMemo as P, useCallback as X, useState as xe, useEffect as Lt } from "react";
|
|
4
|
+
const Na = {
|
|
5
5
|
"blue-rose": {
|
|
6
6
|
macro: "#0284c7",
|
|
7
7
|
macroLight: "#38bdf8",
|
|
@@ -44,8 +44,8 @@ const Pa = {
|
|
|
44
44
|
microLight: "#71717a",
|
|
45
45
|
accent: "#27272a"
|
|
46
46
|
}
|
|
47
|
-
}, st = (e) => e instanceof Date && !Number.isNaN(e.getTime()),
|
|
48
|
-
if (!st(t)) throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${
|
|
47
|
+
}, st = (e) => e instanceof Date && !Number.isNaN(e.getTime()), ve = (e) => e instanceof Date ? Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString() : String(e), et = (e, t) => {
|
|
48
|
+
if (!st(t)) throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${ve(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
51
|
}, W = (e, t) => {
|
|
@@ -65,10 +65,10 @@ const Pa = {
|
|
|
65
65
|
const n = new Date(t * 24 * 60 * 60 * 1e3);
|
|
66
66
|
return r.setFullYear(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()), r;
|
|
67
67
|
}, Ue = (e, t, r) => {
|
|
68
|
-
if (!st(t)) throw new RangeError(`addUnit: d must be a valid Date (received: ${
|
|
69
|
-
return e === "year" ?
|
|
70
|
-
},
|
|
71
|
-
if (!st(r)) throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${
|
|
68
|
+
if (!st(t)) throw new RangeError(`addUnit: d must be a valid Date (received: ${ve(t)})`);
|
|
69
|
+
return e === "year" ? Ra(t, r) : e === "month" ? $a(t, r) : Cr(t, r);
|
|
70
|
+
}, vt = (e, t, r) => {
|
|
71
|
+
if (!st(r)) throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${ve(r)})`);
|
|
72
72
|
if (e === t)
|
|
73
73
|
return et(t, r);
|
|
74
74
|
const n = r.getFullYear(), a = r.getMonth();
|
|
@@ -79,23 +79,23 @@ const Pa = {
|
|
|
79
79
|
return new Date(n, 11, 31);
|
|
80
80
|
}
|
|
81
81
|
return e === "month" && t === "day" ? new Date(n, a + 1, 0) : et(t, r);
|
|
82
|
-
},
|
|
82
|
+
}, Ya = {
|
|
83
83
|
year: { year: "numeric" },
|
|
84
84
|
month: { year: "numeric", month: "2-digit" },
|
|
85
85
|
day: { year: "numeric", month: "2-digit", day: "2-digit" }
|
|
86
|
-
}, Hn = /* @__PURE__ */ new Map(),
|
|
86
|
+
}, Hn = /* @__PURE__ */ new Map(), ka = (e, t) => {
|
|
87
87
|
const r = `${e}\0${t}`, n = Hn.get(r);
|
|
88
88
|
if (n !== void 0) return n;
|
|
89
|
-
const a = new Intl.DateTimeFormat(t,
|
|
89
|
+
const a = new Intl.DateTimeFormat(t, Ya[e]);
|
|
90
90
|
return Hn.set(r, a), a;
|
|
91
|
-
},
|
|
91
|
+
}, Aa = (e, t) => {
|
|
92
92
|
const r = String(t.getFullYear()).padStart(4, "0");
|
|
93
93
|
if (e === "year") return r;
|
|
94
94
|
const n = String(t.getMonth() + 1).padStart(2, "0");
|
|
95
95
|
if (e === "month") return `${r}-${n}`;
|
|
96
96
|
const a = String(t.getDate()).padStart(2, "0");
|
|
97
97
|
return `${r}-${n}-${a}`;
|
|
98
|
-
}, _e = (e, t, r, n) => st(t) ? r ? r(t) : n === void 0 ?
|
|
98
|
+
}, _e = (e, t, r, n) => st(t) ? r ? r(t) : n === void 0 ? Aa(e, t) : ka(e, n).format(t) : "", Bt = (e, t, r, n) => _e(e, t, r, n), Pe = (e, t, r) => {
|
|
99
99
|
if (!e || e.length === 0 || e.length === 1) return 0;
|
|
100
100
|
const n = W(r, t);
|
|
101
101
|
let a = 0, l = e.length - 1;
|
|
@@ -116,7 +116,7 @@ const Pa = {
|
|
|
116
116
|
m < a || m > l || o.has(m) || o.set(m, h);
|
|
117
117
|
}
|
|
118
118
|
if (o.size === 0)
|
|
119
|
-
throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${
|
|
119
|
+
throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${ve(r)}, maxDate: ${ve(n)}, entries: ${e.length})`);
|
|
120
120
|
return Array.from(o.keys()).sort((c, h) => c - h).map((c) => o.get(c));
|
|
121
121
|
}, $r = (e, t, r, n) => {
|
|
122
122
|
const a = e.length - 1;
|
|
@@ -139,7 +139,7 @@ const Pa = {
|
|
|
139
139
|
}, On = (e, t, r, n, a, l, o) => {
|
|
140
140
|
let c = r, h = n;
|
|
141
141
|
return o ? (c = t, h = t) : e === "low" ? t > n ? (c = n, h = t) : c = t : t < r ? (h = r, c = t) : h = t, [Math.max(a, Math.min(l, c)), Math.max(a, Math.min(l, h))];
|
|
142
|
-
},
|
|
142
|
+
}, Ea = (e, t, r, n, a) => a ? "low" : e === "low" ? t > n ? "high" : "low" : t < r ? "low" : "high", Ca = ({ posDiffPct: e, startLowVal: t, startHighVal: r, rangeMin: n, rangeMax: a, isDiscrete: l, sortedAllowedDates: o, snapMode: c, unit: h }) => {
|
|
143
143
|
if (l) {
|
|
144
144
|
const U = o.length - 1;
|
|
145
145
|
if (U <= 0) return [0, 0];
|
|
@@ -148,20 +148,20 @@ const Pa = {
|
|
|
148
148
|
const A = o[0].getTime(), B = o[U].getTime(), L = o[re].getTime(), K = o[M].getTime() - L;
|
|
149
149
|
let H = L + e * (B - A), g = H + K;
|
|
150
150
|
H < A && (H = A, g = A + K), g > B && (g = B, H = B - K);
|
|
151
|
-
const R = Pe(o, new Date(H), h),
|
|
152
|
-
return [R, Math.max(R,
|
|
151
|
+
const R = Pe(o, new Date(H), h), k = Pe(o, new Date(g), h);
|
|
152
|
+
return [R, Math.max(R, k)];
|
|
153
153
|
}
|
|
154
154
|
const Q = Math.round(e * U);
|
|
155
155
|
let I = re + Q, ne = M + Q;
|
|
156
156
|
return I < 0 && (ne += -I, I = 0), ne > U && (I -= ne - U, ne = U), [Math.max(0, Math.min(U, I)), Math.max(0, Math.min(U, ne))];
|
|
157
157
|
}
|
|
158
|
-
const m = (U) => Math.max(n, Math.min(a, U)),
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
let u = t +
|
|
162
|
-
return u < n && (
|
|
163
|
-
},
|
|
164
|
-
let h = 0, m = !1,
|
|
158
|
+
const m = (U) => Math.max(n, Math.min(a, U)), N = a - n;
|
|
159
|
+
if (N <= 0) return [m(t), m(r)];
|
|
160
|
+
const x = Math.round(e * N);
|
|
161
|
+
let u = t + x, p = r + x;
|
|
162
|
+
return u < n && (p += n - u, u = n), p > a && (u -= p - a, p = a), [m(u), m(p)];
|
|
163
|
+
}, Ia = (e, t, r, n, a, l, o, c) => {
|
|
164
|
+
let h = 0, m = !1, N = !1;
|
|
165
165
|
switch (e) {
|
|
166
166
|
case "ArrowRight":
|
|
167
167
|
case "ArrowUp":
|
|
@@ -181,18 +181,18 @@ const Pa = {
|
|
|
181
181
|
m = !0;
|
|
182
182
|
break;
|
|
183
183
|
case "End":
|
|
184
|
-
|
|
184
|
+
N = !0;
|
|
185
185
|
break;
|
|
186
186
|
default:
|
|
187
187
|
return null;
|
|
188
188
|
}
|
|
189
189
|
if (o) {
|
|
190
|
-
let
|
|
191
|
-
return m ?
|
|
190
|
+
let p = r;
|
|
191
|
+
return m ? p = a : N ? p = l : p = Math.max(a, Math.min(l, r + h)), [p, p];
|
|
192
192
|
}
|
|
193
|
-
let
|
|
194
|
-
return t === "low" ? m ?
|
|
195
|
-
}, jn = 8, Wn = 2, Gn = 16,
|
|
193
|
+
let x = r, u = n;
|
|
194
|
+
return t === "low" ? m ? x = a : N ? x = n : x = Math.max(a, Math.min(n, r + h)) : m ? u = r : N ? u = l : u = Math.max(r, Math.min(l, n + h)), [x, u];
|
|
195
|
+
}, jn = 8, Wn = 2, Gn = 16, Ha = 12, Oa = 90, on = (e, t) => {
|
|
196
196
|
const r = t?.estimatedHeightPx ?? Gn, a = jn + (t?.anchorGapY ?? Wn) + r / 2, l = e === "top" ? -a : a;
|
|
197
197
|
return {
|
|
198
198
|
lowAngleDeg: 0,
|
|
@@ -205,11 +205,11 @@ const Pa = {
|
|
|
205
205
|
proximity: 0
|
|
206
206
|
};
|
|
207
207
|
}, Jn = (e, t, r, n = "top", a) => {
|
|
208
|
-
const l = a?.estimatedWidthPx, o = a?.estimatedHeightPx ?? Gn, c = a?.paddingPx ??
|
|
209
|
-
if (!(Number.isFinite(r) && r > 0) || l === void 0 || !Number.isFinite(l) || l <= 0) return
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
212
|
-
const
|
|
208
|
+
const l = a?.estimatedWidthPx, o = a?.estimatedHeightPx ?? Gn, c = a?.paddingPx ?? Ha, h = a?.maxAngleDeg ?? Oa, m = jn + (a?.anchorGapY ?? Wn), N = on(n, a);
|
|
209
|
+
if (!(Number.isFinite(r) && r > 0) || l === void 0 || !Number.isFinite(l) || l <= 0) return N;
|
|
210
|
+
const x = Math.max(0, t - e) / 100 * r, u = l + c;
|
|
211
|
+
if (x >= u) return N;
|
|
212
|
+
const p = Math.max(0, Math.min(1, (u - x) / u)), re = p * p * p * (p * (p * 6 - 15) + 10) * h, M = n === "top" ? -re : re, Q = re * Math.PI / 180, I = l / 2 * Math.abs(Math.sin(Q)) + o / 2 * Math.abs(Math.cos(Q)), ne = m + I, A = n === "top" ? -ne : +ne, B = l * Math.abs(Math.cos(Q)) + o * Math.abs(Math.sin(Q)), L = Math.max(0, (B + c - x) / 2);
|
|
213
213
|
return {
|
|
214
214
|
lowAngleDeg: M,
|
|
215
215
|
highAngleDeg: M,
|
|
@@ -217,20 +217,20 @@ const Pa = {
|
|
|
217
217
|
highOffsetX: L,
|
|
218
218
|
lowOffsetY: A,
|
|
219
219
|
highOffsetY: A,
|
|
220
|
-
isSlanted:
|
|
221
|
-
proximity:
|
|
220
|
+
isSlanted: p > 1e-3,
|
|
221
|
+
proximity: p
|
|
222
222
|
};
|
|
223
223
|
}, Zn = (e) => ({ ...e, lowOffsetX: 0, highOffsetX: 0 });
|
|
224
|
-
function
|
|
225
|
-
const m = o === "macro-top" || o === "macro-left",
|
|
226
|
-
if (m &&
|
|
227
|
-
const
|
|
228
|
-
return
|
|
224
|
+
function Fa(e, t, r, n, a, l, o = "macro-top", c = 0.05, h = !0) {
|
|
225
|
+
const m = o === "macro-top" || o === "macro-left", N = t <= 0;
|
|
226
|
+
if (m && N || !(m || N)) {
|
|
227
|
+
const p = Math.abs(e - r), U = Math.abs(e - n);
|
|
228
|
+
return p <= c && p <= U ? "macro-low" : U <= c && U < p ? "macro-high" : h && e >= r && e <= n ? "macro-connect" : p < U ? "macro-low" : "macro-high";
|
|
229
229
|
}
|
|
230
|
-
const
|
|
231
|
-
return
|
|
230
|
+
const x = Math.abs(e - a), u = Math.abs(e - l);
|
|
231
|
+
return x <= c && x <= u ? "micro-low" : u <= c && u < x ? "micro-high" : h && e >= a && e <= l ? "micro-connect" : x < u ? "micro-low" : "micro-high";
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Va(e, t, r, n, a) {
|
|
234
234
|
if (e === "macro-connect") {
|
|
235
235
|
const o = t - r, c = a - n, h = Math.max(0, Math.min(1 - c, n + o)), m = h + c;
|
|
236
236
|
return [h, m, "macro-connect"];
|
|
@@ -242,7 +242,7 @@ function Fa(e, t, r, n, a) {
|
|
|
242
242
|
const l = Math.max(0, Math.min(1, t));
|
|
243
243
|
return l < n ? [l, n, "macro-low"] : [n, l, "macro-high"];
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Ua(e, t, r, n, a) {
|
|
246
246
|
if (e === "micro-connect") {
|
|
247
247
|
const o = t - r, c = a - n, h = Math.max(0, Math.min(1 - c, n + o)), m = h + c;
|
|
248
248
|
return [h, m, "micro-connect"];
|
|
@@ -256,28 +256,28 @@ function Va(e, t, r, n, a) {
|
|
|
256
256
|
}
|
|
257
257
|
const ar = sr(({ type: e, isTop: t = !0, isVertical: r = !1, isLeft: n = !0 }) => {
|
|
258
258
|
let a, l;
|
|
259
|
-
return r ? (a = 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", l = `period-slider-knob period-slider-knob-svg is-vertical ${n ? "is-semicircle-left" : "is-semicircle-right"}`) : (a = 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", l = `period-slider-knob period-slider-knob-svg ${t ? "is-semicircle-top" : "is-semicircle-bottom"}`), /* @__PURE__ */
|
|
259
|
+
return r ? (a = 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", l = `period-slider-knob period-slider-knob-svg is-vertical ${n ? "is-semicircle-left" : "is-semicircle-right"}`) : (a = 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", l = `period-slider-knob period-slider-knob-svg ${t ? "is-semicircle-top" : "is-semicircle-bottom"}`), /* @__PURE__ */ v("svg", { className: l, 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__ */ v("path", { d: a, className: e === "macro" ? "period-slider-knob-path-macro" : "period-slider-knob-path-micro", shapeRendering: "geometricPrecision", strokeWidth: "1.25" }) });
|
|
260
260
|
});
|
|
261
261
|
ar.displayName = "VernierKnobSvg";
|
|
262
|
-
const
|
|
263
|
-
if (!st(e)) throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${
|
|
264
|
-
if (!st(t)) throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${
|
|
262
|
+
const Ba = (e, t) => {
|
|
263
|
+
if (!st(e)) throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${ve(e)})`);
|
|
264
|
+
if (!st(t)) throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${ve(t)})`);
|
|
265
265
|
if (t.getTime() <= e.getTime())
|
|
266
|
-
throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${
|
|
266
|
+
throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${ve(e)}, maxDate: ${ve(t)})`);
|
|
267
267
|
}, Er = (e, t) => {
|
|
268
268
|
if (!Array.isArray(t) || t.length !== 2)
|
|
269
|
-
throw new RangeError(`PeriodSlider: ${e} is required and must be a [start, end] Date tuple (received: ${
|
|
269
|
+
throw new RangeError(`PeriodSlider: ${e} is required and must be a [start, end] Date tuple (received: ${ve(t)})`);
|
|
270
270
|
const [r, n] = t;
|
|
271
|
-
if (!st(r)) throw new RangeError(`PeriodSlider: ${e}[0] must be a valid Date (received: ${
|
|
272
|
-
if (!st(n)) throw new RangeError(`PeriodSlider: ${e}[1] must be a valid Date (received: ${
|
|
271
|
+
if (!st(r)) throw new RangeError(`PeriodSlider: ${e}[0] must be a valid Date (received: ${ve(r)})`);
|
|
272
|
+
if (!st(n)) throw new RangeError(`PeriodSlider: ${e}[1] must be a valid Date (received: ${ve(n)})`);
|
|
273
273
|
if (n.getTime() < r.getTime())
|
|
274
|
-
throw new RangeError(`PeriodSlider: ${e} must not be inverted (start: ${
|
|
275
|
-
},
|
|
276
|
-
if (!st(t)) throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${
|
|
274
|
+
throw new RangeError(`PeriodSlider: ${e} must not be inverted (start: ${ve(r)}, end: ${ve(n)})`);
|
|
275
|
+
}, za = (e, t) => {
|
|
276
|
+
if (!st(t)) throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${ve(t)})`);
|
|
277
277
|
}, Gr = (e, t, r, n) => {
|
|
278
278
|
if (t.getTime() < r.getTime() || t.getTime() > n.getTime())
|
|
279
|
-
throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${
|
|
280
|
-
},
|
|
279
|
+
throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${ve(t)}, minDate: ${ve(r)}, maxDate: ${ve(n)})`);
|
|
280
|
+
}, _a = (e, t, r) => {
|
|
281
281
|
if (e.mode === "range") {
|
|
282
282
|
for (const n of ["range", "defaultRange"]) {
|
|
283
283
|
const a = e[n];
|
|
@@ -288,20 +288,20 @@ const Ua = (e, t) => {
|
|
|
288
288
|
if (e.mode === "point")
|
|
289
289
|
for (const n of ["value", "defaultValue"]) {
|
|
290
290
|
const a = e[n];
|
|
291
|
-
a !== void 0 && (
|
|
291
|
+
a !== void 0 && (za(n, a), Gr(n, a, t, r));
|
|
292
292
|
}
|
|
293
|
-
},
|
|
293
|
+
}, Xa = (e, t, r) => {
|
|
294
294
|
if (Er("macroRange", e), t !== void 0)
|
|
295
295
|
return Er("microRange", t), t;
|
|
296
296
|
if (r !== void 0)
|
|
297
297
|
return Er("defaultMicroRange", r), r;
|
|
298
298
|
throw new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)");
|
|
299
|
-
},
|
|
299
|
+
}, Nr = (e, t, r, n, a, l, o, c) => {
|
|
300
300
|
const h = Pe(e, n, t), m = Pe(e, a, t);
|
|
301
301
|
return o ? h : c ? m : Math.max(h, Math.min(m, Pe(e, r, t) + l));
|
|
302
302
|
}, Jr = (e) => {
|
|
303
303
|
e.timerId !== null && clearTimeout(e.timerId), e.timerId = null, e.emit = null;
|
|
304
|
-
},
|
|
304
|
+
}, Ka = (e, t) => {
|
|
305
305
|
try {
|
|
306
306
|
Intl.DateTimeFormat.supportedLocalesOf([t]);
|
|
307
307
|
} catch {
|
|
@@ -344,13 +344,13 @@ const Ua = (e, t) => {
|
|
|
344
344
|
lowStyle: Fn(m.lowOffsetX, m.lowOffsetY - c.lowOffsetY, m.lowAngleDeg),
|
|
345
345
|
highStyle: Fn(m.highOffsetX, m.highOffsetY - c.highOffsetY, m.highAngleDeg)
|
|
346
346
|
};
|
|
347
|
-
},
|
|
347
|
+
}, qa = {
|
|
348
348
|
horizontal: { decrease: "◀", increase: "▶" },
|
|
349
349
|
vertical: { decrease: "▼", increase: "▲" }
|
|
350
|
-
},
|
|
350
|
+
}, ja = {
|
|
351
351
|
horizontal: { decrease: "period-slider-stepper-prev", increase: "period-slider-stepper-next" },
|
|
352
352
|
vertical: { decrease: "period-slider-stepper-prev period-slider-stepper-down", increase: "period-slider-stepper-next period-slider-stepper-up" }
|
|
353
|
-
},
|
|
353
|
+
}, Wa = (e) => {
|
|
354
354
|
const {
|
|
355
355
|
unit: t,
|
|
356
356
|
minDate: r,
|
|
@@ -361,20 +361,20 @@ const Ua = (e, t) => {
|
|
|
361
361
|
className: c = "",
|
|
362
362
|
showStepper: h = !0,
|
|
363
363
|
tooltipStyle: m = "always",
|
|
364
|
-
labelPosition:
|
|
365
|
-
autoSlantLabels:
|
|
364
|
+
labelPosition: N = "top",
|
|
365
|
+
autoSlantLabels: x = !0,
|
|
366
366
|
isVertical: u = !1,
|
|
367
|
-
hideConnectBar:
|
|
367
|
+
hideConnectBar: p = !1,
|
|
368
368
|
showTicks: U = !1,
|
|
369
369
|
colorScheme: re = "blue-rose",
|
|
370
370
|
locale: M,
|
|
371
371
|
decreaseAriaLabel: Q = "Decrease",
|
|
372
372
|
increaseAriaLabel: I = "Increase"
|
|
373
373
|
} = e;
|
|
374
|
-
|
|
375
|
-
const ne = e.mode === "vernier" ?
|
|
374
|
+
Ba(r, n), _a(e, r, n), M !== void 0 && Ka("locale", M);
|
|
375
|
+
const ne = e.mode === "vernier" ? Xa(e.macroRange, e.microRange, e.defaultMicroRange) : null, A = Na[re], B = Pa(), L = G(e);
|
|
376
376
|
L.current = e;
|
|
377
|
-
const K = r.getTime(), H = n.getTime(), g =
|
|
377
|
+
const K = r.getTime(), H = n.getTime(), g = P(() => ir(a, t, r, n), [a, t, K, H]), R = g.length > 0, { rangeMin: k, rangeMax: F } = P(() => R ? { rangeMin: 0, rangeMax: g.length - 1 } : { rangeMin: W(t, r), rangeMax: W(t, n) }, [R, g, t, K, H]), $ = e.mode === "point", ae = X(
|
|
378
378
|
(i) => {
|
|
379
379
|
if (R) {
|
|
380
380
|
const s = Math.max(0, Math.min(g.length - 1, Math.round(i)));
|
|
@@ -383,35 +383,35 @@ const Ua = (e, t) => {
|
|
|
383
383
|
return le(t, Math.round(i));
|
|
384
384
|
},
|
|
385
385
|
[R, g, t]
|
|
386
|
-
),
|
|
386
|
+
), Se = X(
|
|
387
387
|
(i) => {
|
|
388
|
-
if (i === void 0) return
|
|
388
|
+
if (i === void 0) return k;
|
|
389
389
|
const s = et(t, i);
|
|
390
390
|
return R ? Pe(g, s, t) : W(t, s);
|
|
391
391
|
},
|
|
392
|
-
[R, g, t,
|
|
393
|
-
), [ee, oe] = xe(() => ne), se = e.mode !== "vernier" ? null : e.microRange !== void 0 ? e.microRange : ee, ge = e.mode === "range" ? e.range?.[0] ?? e.defaultRange?.[0] : e.mode === "vernier" ? se?.[0] : void 0, J = e.mode === "range" ? e.range?.[1] ?? e.defaultRange?.[1] : e.mode === "vernier" ? se?.[1] : void 0, j = e.mode === "point" ? e.value ?? e.defaultValue : void 0,
|
|
392
|
+
[R, g, t, k]
|
|
393
|
+
), [ee, oe] = xe(() => ne), se = e.mode !== "vernier" ? null : e.microRange !== void 0 ? e.microRange : ee, ge = e.mode === "range" ? e.range?.[0] ?? e.defaultRange?.[0] : e.mode === "vernier" ? se?.[0] : void 0, J = e.mode === "range" ? e.range?.[1] ?? e.defaultRange?.[1] : e.mode === "vernier" ? se?.[1] : void 0, j = e.mode === "point" ? e.value ?? e.defaultValue : void 0, ke = e.mode === "point" ? j?.getTime() : ge?.getTime(), pt = e.mode === "range" ? J?.getTime() : ke, [Fe, Ne] = P(() => {
|
|
394
394
|
if (e.mode === "point") {
|
|
395
|
-
const d =
|
|
395
|
+
const d = Se(j);
|
|
396
396
|
return [d, d];
|
|
397
397
|
}
|
|
398
|
-
const i =
|
|
398
|
+
const i = Se(ge), s = Se(J);
|
|
399
399
|
return [Math.min(i, s), Math.max(i, s)];
|
|
400
|
-
}, [e.mode,
|
|
400
|
+
}, [e.mode, ke, pt, Se, j, ge, J]), be = e.mode === "point" ? e.value !== void 0 : e.mode === "range" ? e.range !== void 0 : e.microRange !== void 0, [O, z] = xe(() => [Fe, Ne]), [Z, we] = xe(null), [S, ye] = xe(null), Be = G(null);
|
|
401
401
|
Be.current = S;
|
|
402
|
-
const [rt, ue] = xe("high"), [
|
|
403
|
-
St.current = [
|
|
404
|
-
const te = e.mode === "vernier", Mt = e.mode === "vernier" ? e.vernierOrientation ?? (u ? "macro-left" : "macro-top") : "macro-top",
|
|
402
|
+
const [rt, ue] = xe("high"), [pe, nt] = xe(null), [Kt, cr] = xe(null), de = Z ? Z[0] : be ? Fe : O[0], me = Z ? Z[1] : be ? Ne : O[1], St = G([de, me]);
|
|
403
|
+
St.current = [de, me];
|
|
404
|
+
const te = e.mode === "vernier", Mt = e.mode === "vernier" ? e.vernierOrientation ?? (u ? "macro-left" : "macro-top") : "macro-top", D = Mt === "macro-top" || Mt === "macro-left", ur = e.mode === "vernier" ? e.showVernierProjection ?? !0 : !1, dr = e.mode === "vernier" ? e.showVernierTicks ?? !0 : !1, Rt = e.mode === "vernier" ? e.showHairline ?? !0 : !1, E = te ? e.macroUnit ?? t : t, w = te ? e.microUnit ?? t : t, Ir = te ? e.macroIsDiscrete ?? !1 : R, $t = te ? e.microIsDiscrete ?? !1 : R, Hr = te ? e.macroAllowedDates ?? a : a, Or = te ? e.microAllowedDates ?? a : a, f = te ? e.formatMacroLabel ?? e.formatLabel : e.formatLabel, Y = te ? e.formatMicroLabel ?? e.formatLabel : e.formatLabel, Ae = e.mode === "vernier" ? e.macroRange[0].getTime() : void 0, Pt = e.mode === "vernier" ? e.macroRange[1].getTime() : void 0, Dt = ge?.getTime(), at = J?.getTime(), [Ee, mr] = xe(null), ct = G(null);
|
|
405
405
|
ct.current = Ee;
|
|
406
|
-
const [Re, qt] = xe("micro-high"), Ve =
|
|
406
|
+
const [Re, qt] = xe("micro-high"), Ve = P(() => W(E, r), [K, E]), Nt = P(() => {
|
|
407
407
|
const i = W(E, n);
|
|
408
408
|
if (te && i <= Ve)
|
|
409
|
-
throw new RangeError(`PeriodSlider: macroUnit "${E}" cannot distinguish minDate from maxDate (minDate: ${
|
|
409
|
+
throw new RangeError(`PeriodSlider: macroUnit "${E}" cannot distinguish minDate from maxDate (minDate: ${ve(r)}, maxDate: ${ve(n)})`);
|
|
410
410
|
return i;
|
|
411
|
-
}, [te, K, H, Ve, E]),
|
|
411
|
+
}, [te, K, H, Ve, E]), Te = P(() => te ? ir(Hr, E, r, n) : [], [te, Hr, E, K, H]), Ce = P(() => e.mode !== "vernier" ? Ve : W(E, e.macroRange[0]), [e.mode, Ae, Ve, E]), Ie = P(() => e.mode !== "vernier" ? Nt : W(E, e.macroRange[1]), [e.mode, Pt, Nt, E]), fr = P(() => le(E, Ce), [E, Ce]), hr = P(() => le(E, Ie), [E, Ie]), $e = P(() => e.mode !== "vernier" ? W(w, r) : Math.max(W(w, e.macroRange[0]), W(w, r)), [e.mode, Ae, w, K]), Ke = P(() => e.mode !== "vernier" ? W(w, n) : Math.min(W(w, vt(E, w, e.macroRange[1])), W(w, n)), [e.mode, Pt, E, w, H]), ie = P(() => te ? ir(Or, w, r, n).filter((s) => {
|
|
412
412
|
const d = W(w, s);
|
|
413
413
|
return d >= $e && d <= Ke;
|
|
414
|
-
}) : [], [te, Or, w, K, H, $e, Ke]),
|
|
414
|
+
}) : [], [te, Or, w, K, H, $e, Ke]), Yt = Ir && Te.length > 0, Je = $t && ie.length > 0, Me = P(() => se === null ? $e : W(w, se[0]), [Dt, $e, w, se]), De = P(() => se === null ? Ke : W(w, se[1]), [at, Ke, w, se]), ut = P(() => le(w, Me), [w, Me]), dt = P(() => le(w, De), [w, De]), jt = Math.max(1, Nt - Ve), Le = Yt ? $r(Te, E, l, fr) : Math.max(0, Math.min(1, (Ce - Ve) / jt)), He = Math.max(Le, Yt ? $r(Te, E, l, hr) : Math.min(1, (Ie - Ve) / jt)), Wt = Math.max(1, Ke - $e), ze = Je ? $r(ie, w, l, ut) : Math.max(0, Math.min(1, (Me - $e) / Wt)), ot = Math.max(ze, Je ? $r(ie, w, l, dt) : Math.min(1, (De - $e) / Wt)), Fr = G({ timerId: null, emit: null }), Vr = G({ timerId: null, emit: null }), Ur = G({ timerId: null, emit: null });
|
|
415
415
|
Lt(() => {
|
|
416
416
|
const i = [Fr, Vr, Ur];
|
|
417
417
|
return () => {
|
|
@@ -419,7 +419,7 @@ const Ua = (e, t) => {
|
|
|
419
419
|
Jr(s.current);
|
|
420
420
|
};
|
|
421
421
|
}, []);
|
|
422
|
-
const
|
|
422
|
+
const kt = X((i, s, d) => {
|
|
423
423
|
Jr(i);
|
|
424
424
|
const { debounceMs: b } = L.current;
|
|
425
425
|
if (d || !b || b <= 0) {
|
|
@@ -441,14 +441,14 @@ const Ua = (e, t) => {
|
|
|
441
441
|
const y = L.current;
|
|
442
442
|
y.mode === "point" ? y.onChangePoint?.(_) : y.mode === "range" && y.onChangeRange?.(_, C);
|
|
443
443
|
};
|
|
444
|
-
|
|
444
|
+
kt(Fr.current, q, d);
|
|
445
445
|
},
|
|
446
|
-
[ae,
|
|
446
|
+
[ae, kt]
|
|
447
447
|
), Et = X(
|
|
448
448
|
(i, s, d = !1) => {
|
|
449
449
|
if (L.current.mode !== "vernier") return;
|
|
450
450
|
const b = At(i), T = At(s);
|
|
451
|
-
|
|
451
|
+
kt(
|
|
452
452
|
Vr.current,
|
|
453
453
|
() => {
|
|
454
454
|
const V = L.current;
|
|
@@ -457,13 +457,13 @@ const Ua = (e, t) => {
|
|
|
457
457
|
d
|
|
458
458
|
);
|
|
459
459
|
},
|
|
460
|
-
[At,
|
|
460
|
+
[At, kt]
|
|
461
461
|
), qe = X(
|
|
462
462
|
(i, s, d = !1) => {
|
|
463
463
|
const b = L.current;
|
|
464
464
|
if (b.mode !== "vernier") return;
|
|
465
465
|
const T = At(i), V = At(s);
|
|
466
|
-
b.microRange === void 0 && oe([T, V]),
|
|
466
|
+
b.microRange === void 0 && oe([T, V]), kt(
|
|
467
467
|
Ur.current,
|
|
468
468
|
() => {
|
|
469
469
|
const _ = L.current;
|
|
@@ -472,7 +472,7 @@ const Ua = (e, t) => {
|
|
|
472
472
|
d
|
|
473
473
|
);
|
|
474
474
|
},
|
|
475
|
-
[At,
|
|
475
|
+
[At, kt]
|
|
476
476
|
), gr = X(
|
|
477
477
|
(i) => {
|
|
478
478
|
if (R && l === "time" && g.length > 1) {
|
|
@@ -481,12 +481,12 @@ const Ua = (e, t) => {
|
|
|
481
481
|
const C = g[b].getTime();
|
|
482
482
|
return Math.max(0, Math.min(100, (C - T) / _ * 100));
|
|
483
483
|
}
|
|
484
|
-
const s = F -
|
|
484
|
+
const s = F - k;
|
|
485
485
|
if (s <= 0) return 0;
|
|
486
|
-
const d = (i -
|
|
486
|
+
const d = (i - k) / s * 100;
|
|
487
487
|
return Math.max(0, Math.min(100, d));
|
|
488
488
|
},
|
|
489
|
-
[R, l, g,
|
|
489
|
+
[R, l, g, k, F]
|
|
490
490
|
), br = X(
|
|
491
491
|
(i) => {
|
|
492
492
|
const s = Math.max(0, Math.min(100, i));
|
|
@@ -498,10 +498,10 @@ const Ua = (e, t) => {
|
|
|
498
498
|
const b = Math.round(s / 100 * (g.length - 1));
|
|
499
499
|
return Math.max(0, Math.min(g.length - 1, b));
|
|
500
500
|
}
|
|
501
|
-
const d =
|
|
501
|
+
const d = k + s / 100 * (F - k);
|
|
502
502
|
return Math.round(d);
|
|
503
503
|
},
|
|
504
|
-
[R, l, g,
|
|
504
|
+
[R, l, g, k, F, t]
|
|
505
505
|
), it = G(null), [Ct, cn] = xe(0), [ea, Gt] = zt(), [ta, un] = zt(), [ra, dn] = zt(), [na, mn] = zt(), [aa, fn] = zt(), [oa, hn] = zt();
|
|
506
506
|
Lt(() => {
|
|
507
507
|
const i = it.current;
|
|
@@ -521,7 +521,7 @@ const Ua = (e, t) => {
|
|
|
521
521
|
}
|
|
522
522
|
return window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
|
|
523
523
|
}, [u]);
|
|
524
|
-
const
|
|
524
|
+
const xt = X(
|
|
525
525
|
(i, s, d) => {
|
|
526
526
|
const b = u ? d.height : d.width;
|
|
527
527
|
if (!(Number.isFinite(b) && b > 0)) return null;
|
|
@@ -533,25 +533,25 @@ const Ua = (e, t) => {
|
|
|
533
533
|
(i, s) => {
|
|
534
534
|
const d = it.current;
|
|
535
535
|
if (!d) return null;
|
|
536
|
-
const b =
|
|
536
|
+
const b = xt(i, s, d.getBoundingClientRect());
|
|
537
537
|
return b === null ? null : b * 100;
|
|
538
538
|
},
|
|
539
|
-
[
|
|
539
|
+
[xt]
|
|
540
540
|
), wr = G(null), zr = G(null), Qe = G(null), _r = G(null), Jt = G(null), bn = X(
|
|
541
541
|
(i) => {
|
|
542
542
|
if (o) return;
|
|
543
543
|
if (te) {
|
|
544
544
|
const y = zr.current;
|
|
545
545
|
if (!y || i.pointerId !== 0 && i.pointerId !== y.pointerId || !it.current) return;
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
546
|
+
const fe = xt(i.clientX, i.clientY, it.current.getBoundingClientRect());
|
|
547
|
+
if (fe === null) return;
|
|
548
548
|
if (y.handle === "macro-low" || y.handle === "macro-high" || y.handle === "macro-connect") {
|
|
549
|
-
const [je, ft,
|
|
550
|
-
|
|
549
|
+
const [je, ft, Ye] = Va(y.handle, fe, y.startPointerRatio, y.startMacroLowRatio, y.startMacroHighRatio);
|
|
550
|
+
Ye !== ct.current && (ct.current = Ye, mr(Ye), qt(Ye));
|
|
551
551
|
let he, We;
|
|
552
|
-
if (
|
|
553
|
-
const gt = Pr(
|
|
554
|
-
he =
|
|
552
|
+
if (Yt) {
|
|
553
|
+
const gt = Pr(Te, E, l, je), bt = Math.max(gt, Pr(Te, E, l, ft));
|
|
554
|
+
he = Te[gt], We = Te[bt];
|
|
555
555
|
} else {
|
|
556
556
|
const gt = Math.round(Ve + je * jt), bt = Math.round(Ve + ft * jt);
|
|
557
557
|
he = le(E, gt), We = le(E, bt);
|
|
@@ -560,7 +560,7 @@ const Ua = (e, t) => {
|
|
|
560
560
|
er !== _r.current && (_r.current = er, Et(he, We));
|
|
561
561
|
let lt, ht;
|
|
562
562
|
if (y.handle === "macro-connect") {
|
|
563
|
-
const gt = et(w, he), bt =
|
|
563
|
+
const gt = et(w, he), bt = vt(E, w, We);
|
|
564
564
|
let Ft, Vt;
|
|
565
565
|
if (E === "year") {
|
|
566
566
|
const wt = he.getFullYear() - y.startMacroLowDate.getFullYear();
|
|
@@ -576,14 +576,14 @@ const Ua = (e, t) => {
|
|
|
576
576
|
let rr = Ft.getTime(), nr = Vt.getTime();
|
|
577
577
|
rr < Ut && (rr = Ut, nr = Math.min(tr, rr + En)), nr > tr && (nr = tr, rr = Math.max(Ut, nr - En)), lt = et(w, new Date(rr)), ht = et(w, new Date(nr));
|
|
578
578
|
} else {
|
|
579
|
-
const gt = he.getTime(), bt =
|
|
579
|
+
const gt = he.getTime(), bt = vt(E, w, We).getTime(), Ft = y.initialMicroLowDate.getTime(), Vt = y.initialMicroHighDate.getTime(), Ut = Math.max(gt, Math.min(bt, Ft)), tr = Math.max(Ut, Math.min(bt, Vt));
|
|
580
580
|
lt = et(w, new Date(Ut)), ht = et(w, new Date(tr));
|
|
581
581
|
}
|
|
582
582
|
const An = `${lt.getTime()}_${ht.getTime()}`;
|
|
583
583
|
An !== Jt.current && (Jt.current = An, qe(lt, ht));
|
|
584
584
|
} else if (y.handle === "micro-low" || y.handle === "micro-high" || y.handle === "micro-connect") {
|
|
585
|
-
const [je, ft,
|
|
586
|
-
|
|
585
|
+
const [je, ft, Ye] = Ua(y.handle, fe, y.startPointerRatio, y.startMicroLowRatio, y.startMicroHighRatio);
|
|
586
|
+
Ye !== ct.current && (ct.current = Ye, mr(Ye), qt(Ye));
|
|
587
587
|
let he, We;
|
|
588
588
|
if (Je) {
|
|
589
589
|
const lt = Pr(ie, w, l, je), ht = Math.max(lt, Pr(ie, w, l, ft));
|
|
@@ -602,28 +602,28 @@ const Ua = (e, t) => {
|
|
|
602
602
|
const d = it.current.getBoundingClientRect(), b = u ? i.clientY : i.clientX, T = u ? d.height : d.width;
|
|
603
603
|
if (!(Number.isFinite(T) && T > 0)) return;
|
|
604
604
|
if (s.handle === "connect") {
|
|
605
|
-
const y = u ? (s.startPointerPos - b) / T : (b - s.startPointerPos) / T,
|
|
605
|
+
const y = u ? (s.startPointerPos - b) / T : (b - s.startPointerPos) / T, fe = Ca({
|
|
606
606
|
posDiffPct: y,
|
|
607
607
|
startLowVal: s.startLowVal,
|
|
608
608
|
startHighVal: s.startHighVal,
|
|
609
|
-
rangeMin:
|
|
609
|
+
rangeMin: k,
|
|
610
610
|
rangeMax: F,
|
|
611
611
|
isDiscrete: R,
|
|
612
612
|
sortedAllowedDates: g,
|
|
613
613
|
snapMode: l,
|
|
614
614
|
unit: t
|
|
615
615
|
});
|
|
616
|
-
if (Qe.current && Qe.current[0] ===
|
|
616
|
+
if (Qe.current && Qe.current[0] === fe[0] && Qe.current[1] === fe[1])
|
|
617
617
|
return;
|
|
618
|
-
Qe.current =
|
|
618
|
+
Qe.current = fe, we(fe), Ze(fe[0], fe[1], !1);
|
|
619
619
|
return;
|
|
620
620
|
}
|
|
621
|
-
const V =
|
|
621
|
+
const V = xt(i.clientX, i.clientY, d);
|
|
622
622
|
if (V === null) return;
|
|
623
|
-
const _ = br(V * 100), [C, q] = On(s.handle, _, s.startLowVal, s.startHighVal,
|
|
624
|
-
if ((!Qe.current || Qe.current[0] !== C || Qe.current[1] !== q) && (Qe.current = [C, q], we([C, q]), Ze(C, q, !1)),
|
|
625
|
-
const y =
|
|
626
|
-
Be.current !== y && (Be.current = y,
|
|
623
|
+
const _ = br(V * 100), [C, q] = On(s.handle, _, s.startLowVal, s.startHighVal, k, F, $);
|
|
624
|
+
if ((!Qe.current || Qe.current[0] !== C || Qe.current[1] !== q) && (Qe.current = [C, q], we([C, q]), Ze(C, q, !1)), !$ && (s.handle === "low" || s.handle === "high")) {
|
|
625
|
+
const y = Ea(s.handle, _, s.startLowVal, s.startHighVal, $);
|
|
626
|
+
Be.current !== y && (Be.current = y, ye(y), ue(y));
|
|
627
627
|
}
|
|
628
628
|
},
|
|
629
629
|
[
|
|
@@ -632,26 +632,26 @@ const Ua = (e, t) => {
|
|
|
632
632
|
u,
|
|
633
633
|
E,
|
|
634
634
|
w,
|
|
635
|
-
|
|
635
|
+
Yt,
|
|
636
636
|
Je,
|
|
637
|
-
|
|
637
|
+
Te,
|
|
638
638
|
ie,
|
|
639
639
|
Ve,
|
|
640
640
|
jt,
|
|
641
641
|
$e,
|
|
642
642
|
Wt,
|
|
643
|
-
|
|
643
|
+
k,
|
|
644
644
|
F,
|
|
645
645
|
R,
|
|
646
646
|
g,
|
|
647
647
|
l,
|
|
648
648
|
t,
|
|
649
|
-
|
|
649
|
+
xt,
|
|
650
650
|
br,
|
|
651
651
|
Ze,
|
|
652
652
|
Et,
|
|
653
653
|
qe,
|
|
654
|
-
|
|
654
|
+
$
|
|
655
655
|
]
|
|
656
656
|
), wn = X(
|
|
657
657
|
(i) => {
|
|
@@ -662,17 +662,17 @@ const Ua = (e, t) => {
|
|
|
662
662
|
const s = wr.current;
|
|
663
663
|
if (!s || i.pointerId !== 0 && i.pointerId !== s.pointerId) return;
|
|
664
664
|
const d = Qe.current ?? Z;
|
|
665
|
-
d && (Ze(d[0], d[1], !0), z(d)), Qe.current = null, we(null), wr.current = null, Be.current = null,
|
|
665
|
+
d && (Ze(d[0], d[1], !0), z(d)), Qe.current = null, we(null), wr.current = null, Be.current = null, ye(null);
|
|
666
666
|
},
|
|
667
667
|
[te, Z, Ze, Br]
|
|
668
|
-
),
|
|
669
|
-
|
|
670
|
-
const
|
|
671
|
-
|
|
668
|
+
), vn = G(bn);
|
|
669
|
+
vn.current = bn;
|
|
670
|
+
const pn = G(wn);
|
|
671
|
+
pn.current = wn;
|
|
672
672
|
const Mn = S !== null || Ee !== null;
|
|
673
673
|
Lt(() => {
|
|
674
674
|
if (!Mn) return;
|
|
675
|
-
const i = (d) =>
|
|
675
|
+
const i = (d) => vn.current(d), s = (d) => pn.current(d);
|
|
676
676
|
return window.addEventListener("pointermove", i), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", s), () => {
|
|
677
677
|
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", s), window.removeEventListener("pointercancel", s);
|
|
678
678
|
};
|
|
@@ -683,51 +683,51 @@ const Ua = (e, t) => {
|
|
|
683
683
|
pointerId: i,
|
|
684
684
|
handle: s,
|
|
685
685
|
startPointerPos: d,
|
|
686
|
-
startLowVal:
|
|
687
|
-
startHighVal:
|
|
688
|
-
}, Be.current = s,
|
|
686
|
+
startLowVal: de,
|
|
687
|
+
startHighVal: me
|
|
688
|
+
}, Be.current = s, ye(s), s !== "connect" && ue(s);
|
|
689
689
|
},
|
|
690
|
-
[
|
|
691
|
-
),
|
|
690
|
+
[de, me]
|
|
691
|
+
), Dn = X(
|
|
692
692
|
(i, s, d) => {
|
|
693
693
|
const b = L.current;
|
|
694
694
|
b.mode === "vernier" && (zr.current = {
|
|
695
695
|
pointerId: i,
|
|
696
696
|
handle: s,
|
|
697
697
|
startPointerRatio: d,
|
|
698
|
-
startMacroLowRatio:
|
|
698
|
+
startMacroLowRatio: Le,
|
|
699
699
|
startMacroHighRatio: He,
|
|
700
700
|
startMicroLowRatio: ze,
|
|
701
701
|
startMicroHighRatio: ot,
|
|
702
702
|
startMacroLowEnc: Ce,
|
|
703
703
|
startMacroHighEnc: Ie,
|
|
704
|
-
startMicroLowEnc:
|
|
705
|
-
startMicroHighEnc:
|
|
704
|
+
startMicroLowEnc: Me,
|
|
705
|
+
startMicroHighEnc: De,
|
|
706
706
|
startMacroLowDate: b.macroRange[0],
|
|
707
707
|
startMacroHighDate: b.macroRange[1],
|
|
708
708
|
initialMicroLowDate: ut,
|
|
709
709
|
initialMicroHighDate: dt
|
|
710
710
|
}, ct.current = s, mr(s), qt(s));
|
|
711
711
|
},
|
|
712
|
-
[
|
|
713
|
-
),
|
|
712
|
+
[Le, He, ze, ot, Ce, Ie, Me, De, ut, dt]
|
|
713
|
+
), xn = (i) => (s) => {
|
|
714
714
|
if (o) return;
|
|
715
715
|
s.stopPropagation(), s.preventDefault(), ue(i);
|
|
716
716
|
const d = u ? s.clientY : s.clientX;
|
|
717
717
|
Xr(s.pointerId, i, d);
|
|
718
718
|
}, yn = (i) => () => {
|
|
719
719
|
o || Be.current !== null || ue(i);
|
|
720
|
-
},
|
|
720
|
+
}, vr = (i) => () => {
|
|
721
721
|
o || ct.current !== null || qt(i);
|
|
722
722
|
}, It = (i) => (s) => {
|
|
723
723
|
if (o) return;
|
|
724
724
|
s.stopPropagation(), s.preventDefault();
|
|
725
725
|
const d = it.current;
|
|
726
726
|
if (!d) return;
|
|
727
|
-
const b =
|
|
728
|
-
b !== null &&
|
|
727
|
+
const b = xt(s.clientX, s.clientY, d.getBoundingClientRect());
|
|
728
|
+
b !== null && Dn(s.pointerId, i, b);
|
|
729
729
|
}, ia = (i) => {
|
|
730
|
-
if (o ||
|
|
730
|
+
if (o || p) return;
|
|
731
731
|
i.stopPropagation(), i.preventDefault();
|
|
732
732
|
const s = u ? i.clientY : i.clientX;
|
|
733
733
|
Xr(i.pointerId, "connect", s);
|
|
@@ -736,22 +736,22 @@ const Ua = (e, t) => {
|
|
|
736
736
|
if (te) {
|
|
737
737
|
const C = it.current;
|
|
738
738
|
if (!C) return;
|
|
739
|
-
const q = C.getBoundingClientRect(), y =
|
|
739
|
+
const q = C.getBoundingClientRect(), y = xt(i.clientX, i.clientY, q);
|
|
740
740
|
if (y === null) return;
|
|
741
|
-
const
|
|
742
|
-
|
|
741
|
+
const fe = u ? i.clientX - (q.left + q.width / 2) : i.clientY - (q.top + q.height / 2), je = Fa(y, fe, Le, He, ze, ot, Mt, void 0, !p);
|
|
742
|
+
Dn(i.pointerId, je, y);
|
|
743
743
|
return;
|
|
744
744
|
}
|
|
745
745
|
const s = gn(i.clientX, i.clientY);
|
|
746
746
|
if (s === null) return;
|
|
747
747
|
const d = br(s);
|
|
748
748
|
let b = "low";
|
|
749
|
-
if (
|
|
750
|
-
const C = Math.abs(d -
|
|
751
|
-
C < q ? b = "low" : q < C ? b = "high" : b = d >
|
|
749
|
+
if (!$) {
|
|
750
|
+
const C = Math.abs(d - de), q = Math.abs(d - me);
|
|
751
|
+
C < q ? b = "low" : q < C ? b = "high" : b = d > me ? "high" : "low";
|
|
752
752
|
}
|
|
753
753
|
ue(b);
|
|
754
|
-
const [T, V] = On(b, d,
|
|
754
|
+
const [T, V] = On(b, d, de, me, k, F, $);
|
|
755
755
|
we([T, V]), Ze(T, V, !0);
|
|
756
756
|
const _ = u ? i.clientY : i.clientX;
|
|
757
757
|
Xr(i.pointerId, b, _);
|
|
@@ -766,11 +766,11 @@ const Ua = (e, t) => {
|
|
|
766
766
|
}, Tn = (i) => (s) => {
|
|
767
767
|
if (o) return;
|
|
768
768
|
ue(i);
|
|
769
|
-
const d =
|
|
769
|
+
const d = Ia(s.key, i, de, me, k, F, $, 1);
|
|
770
770
|
d && (s.preventDefault(), be || z(d), Ze(d[0], d[1], !0));
|
|
771
|
-
},
|
|
772
|
-
const d = Math.max(W(w, i), W(w, r)), b = Math.min(W(w,
|
|
773
|
-
T ===
|
|
771
|
+
}, pr = (i, s) => {
|
|
772
|
+
const d = Math.max(W(w, i), W(w, r)), b = Math.min(W(w, vt(E, w, s)), W(w, n)), T = Math.max(d, Math.min(b, Me)), V = Math.max(T, Math.min(b, De));
|
|
773
|
+
T === Me && V === De || qe(le(w, T), le(w, V), !0);
|
|
774
774
|
}, Mr = (i) => (s) => {
|
|
775
775
|
if (o || !te || e.mode !== "vernier") return;
|
|
776
776
|
qt(i);
|
|
@@ -801,51 +801,51 @@ const Ua = (e, t) => {
|
|
|
801
801
|
}
|
|
802
802
|
if (s.preventDefault(), i === "macro-low") {
|
|
803
803
|
const V = le(E, Ce), _ = le(E, Ie);
|
|
804
|
-
if (
|
|
805
|
-
const y =
|
|
806
|
-
if (y === Pe(
|
|
807
|
-
const
|
|
808
|
-
Et(
|
|
804
|
+
if (Yt) {
|
|
805
|
+
const y = Nr(Te, E, V, Te[0], _, d, b, T);
|
|
806
|
+
if (y === Pe(Te, V, E)) return;
|
|
807
|
+
const fe = Te[y];
|
|
808
|
+
Et(fe, _, !0), pr(fe, _);
|
|
809
809
|
return;
|
|
810
810
|
}
|
|
811
811
|
let C;
|
|
812
812
|
if (b ? C = Ve : T ? C = Ie : C = Math.max(Ve, Math.min(Ie, Ce + d)), C === Ce) return;
|
|
813
813
|
const q = le(E, C);
|
|
814
|
-
Et(q, _, !0),
|
|
814
|
+
Et(q, _, !0), pr(q, _);
|
|
815
815
|
} else if (i === "macro-high") {
|
|
816
816
|
const V = le(E, Ce), _ = le(E, Ie);
|
|
817
|
-
if (
|
|
818
|
-
const y =
|
|
819
|
-
if (y === Pe(
|
|
820
|
-
const
|
|
821
|
-
Et(V,
|
|
817
|
+
if (Yt) {
|
|
818
|
+
const y = Nr(Te, E, _, V, Te[Te.length - 1], d, b, T);
|
|
819
|
+
if (y === Pe(Te, _, E)) return;
|
|
820
|
+
const fe = Te[y];
|
|
821
|
+
Et(V, fe, !0), pr(V, fe);
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
824
|
let C;
|
|
825
|
-
if (b ? C = Ce : T ? C =
|
|
825
|
+
if (b ? C = Ce : T ? C = Nt : C = Math.max(Ce, Math.min(Nt, Ie + d)), C === Ie) return;
|
|
826
826
|
const q = le(E, C);
|
|
827
|
-
Et(V, q, !0),
|
|
827
|
+
Et(V, q, !0), pr(V, q);
|
|
828
828
|
} else if (i === "micro-low") {
|
|
829
|
-
const V = le(w,
|
|
829
|
+
const V = le(w, Me), _ = le(w, De);
|
|
830
830
|
if (Je) {
|
|
831
|
-
const q =
|
|
831
|
+
const q = Nr(ie, w, V, ie[0], _, d, b, T);
|
|
832
832
|
if (q === Pe(ie, V, w)) return;
|
|
833
833
|
qe(ie[q], _, !0);
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
836
|
let C;
|
|
837
|
-
if (b ? C = $e : T ? C =
|
|
837
|
+
if (b ? C = $e : T ? C = De : C = Math.max($e, Math.min(De, Me + d)), C === Me) return;
|
|
838
838
|
qe(le(w, C), _, !0);
|
|
839
839
|
} else if (i === "micro-high") {
|
|
840
|
-
const V = le(w,
|
|
840
|
+
const V = le(w, Me), _ = le(w, De);
|
|
841
841
|
if (Je) {
|
|
842
|
-
const q =
|
|
842
|
+
const q = Nr(ie, w, _, V, ie[ie.length - 1], d, b, T);
|
|
843
843
|
if (q === Pe(ie, _, w)) return;
|
|
844
844
|
qe(V, ie[q], !0);
|
|
845
845
|
return;
|
|
846
846
|
}
|
|
847
847
|
let C;
|
|
848
|
-
if (b ? C =
|
|
848
|
+
if (b ? C = Me : T ? C = Ke : C = Math.max(Me, Math.min(Ke, De + d)), C === De) return;
|
|
849
849
|
qe(V, le(w, C), !0);
|
|
850
850
|
}
|
|
851
851
|
}, ua = X(
|
|
@@ -853,34 +853,34 @@ const Ua = (e, t) => {
|
|
|
853
853
|
const s = L.current;
|
|
854
854
|
if (!s.disabled)
|
|
855
855
|
if (s.mode === "point") {
|
|
856
|
-
const d = Math.max(
|
|
856
|
+
const d = Math.max(k, Math.min(F, de + i));
|
|
857
857
|
be || z([d, d]), Ze(d, d, !0);
|
|
858
858
|
} else if (s.mode === "vernier") {
|
|
859
859
|
if (Je) {
|
|
860
|
-
const y = ie.length - 1,
|
|
861
|
-
let
|
|
862
|
-
i < 0 &&
|
|
860
|
+
const y = ie.length - 1, fe = Pe(ie, ut, w), je = Pe(ie, dt, w), ft = je - fe;
|
|
861
|
+
let Ye = fe + i, he = je + i;
|
|
862
|
+
i < 0 && Ye < 0 ? (Ye = 0, he = Math.min(y, ft)) : i > 0 && he > y && (he = y, Ye = Math.max(0, y - ft)), (Ye !== fe || he !== je) && qe(ie[Ye], ie[he], !0);
|
|
863
863
|
return;
|
|
864
864
|
}
|
|
865
|
-
const d =
|
|
865
|
+
const d = Me, b = De, T = $e, V = Ke, _ = b - d;
|
|
866
866
|
let C = d + i, q = b + i;
|
|
867
867
|
i < 0 && C < T ? (C = T, q = Math.min(V, C + _)) : i > 0 && q > V && (q = V, C = Math.max(T, q - _)), (C !== d || q !== b) && qe(le(w, C), le(w, q), !0);
|
|
868
868
|
} else {
|
|
869
|
-
const d =
|
|
870
|
-
let b =
|
|
871
|
-
i < 0 && b <
|
|
869
|
+
const d = me - de;
|
|
870
|
+
let b = de + i, T = me + i;
|
|
871
|
+
i < 0 && b < k ? (b = k, T = Math.min(F, b + d)) : i > 0 && T > F && (T = F, b = Math.max(k, T - d)), b <= T && (be || z([b, T]), Ze(b, T, !0));
|
|
872
872
|
}
|
|
873
873
|
},
|
|
874
874
|
[
|
|
875
|
+
de,
|
|
875
876
|
me,
|
|
876
|
-
|
|
877
|
-
Y,
|
|
877
|
+
k,
|
|
878
878
|
F,
|
|
879
879
|
be,
|
|
880
880
|
Ze,
|
|
881
881
|
qe,
|
|
882
|
-
ve,
|
|
883
882
|
Me,
|
|
883
|
+
De,
|
|
884
884
|
$e,
|
|
885
885
|
Ke,
|
|
886
886
|
w,
|
|
@@ -889,17 +889,17 @@ const Ua = (e, t) => {
|
|
|
889
889
|
ut,
|
|
890
890
|
dt
|
|
891
891
|
]
|
|
892
|
-
), Ht = gr(
|
|
893
|
-
if (
|
|
894
|
-
const i = Jn(Ht, Ot, Ct,
|
|
895
|
-
return
|
|
896
|
-
}, [
|
|
897
|
-
() => Vn(
|
|
898
|
-
[
|
|
899
|
-
), Sr =
|
|
892
|
+
), Ht = gr(de), Ot = gr(me), Kr = ae(de), qr = ae(me), jr = P(() => $ ? Gt === null ? void 0 : { estimatedWidthPx: Gt.widthPx, estimatedHeightPx: Gt.heightPx } : Zr(Gt, un), [$, Gt, un]), Dr = !$ && de === me, Oe = P(() => {
|
|
893
|
+
if ($ || !x || u) return on(N, jr);
|
|
894
|
+
const i = Jn(Ht, Ot, Ct, N, jr);
|
|
895
|
+
return Dr ? Zn(i) : i;
|
|
896
|
+
}, [$, Dr, x, u, Ht, Ot, Ct, N, jr]), Zt = S === "low" || S !== "high" && rt === "low", Qt = !$ && (S === "high" || S !== "low" && rt === "high"), xr = Ce === Ie, yr = Me === De, da = xr && Re !== "macro-low", ma = xr && Re === "macro-low", fa = yr && Re !== "micro-low", ha = yr && Re === "micro-low", Ln = D ? "top" : "bottom", Sn = D ? "bottom" : "top", Rn = P(() => Zr(dn, mn), [dn, mn]), $n = P(() => Zr(fn, hn), [fn, hn]), Tr = x && !u, Lr = P(
|
|
897
|
+
() => Vn(Le, He, Ct, Ln, Rn, xr, Tr),
|
|
898
|
+
[Le, He, Ct, Ln, Rn, xr, Tr]
|
|
899
|
+
), Sr = P(
|
|
900
900
|
() => Vn(ze, ot, Ct, Sn, $n, yr, Tr),
|
|
901
901
|
[ze, ot, Ct, Sn, $n, yr, Tr]
|
|
902
|
-
), ga =
|
|
902
|
+
), ga = P(() => u ? {
|
|
903
903
|
"--ps-tooltip-origin": "100% 50%",
|
|
904
904
|
"--ps-tooltip-tx": "0px",
|
|
905
905
|
"--ps-tooltip-ty": "-50%",
|
|
@@ -909,7 +909,7 @@ const Ua = (e, t) => {
|
|
|
909
909
|
"--ps-tooltip-tx": `calc(-50% + ${Oe.lowOffsetX}px)`,
|
|
910
910
|
"--ps-tooltip-ty": `calc(-50% + ${Oe.lowOffsetY}px)`,
|
|
911
911
|
"--ps-tooltip-rot": `${Oe.lowAngleDeg}deg`
|
|
912
|
-
}, [u, Oe.lowOffsetX, Oe.lowOffsetY, Oe.lowAngleDeg]), ba =
|
|
912
|
+
}, [u, Oe.lowOffsetX, Oe.lowOffsetY, Oe.lowAngleDeg]), ba = P(() => u ? {
|
|
913
913
|
"--ps-tooltip-origin": "100% 50%",
|
|
914
914
|
"--ps-tooltip-tx": "0px",
|
|
915
915
|
"--ps-tooltip-ty": "-50%",
|
|
@@ -930,17 +930,17 @@ const Ua = (e, t) => {
|
|
|
930
930
|
width: `${Pn - Rr}%`,
|
|
931
931
|
top: "0",
|
|
932
932
|
bottom: "0"
|
|
933
|
-
},
|
|
934
|
-
const s = u ? "vertical" : "horizontal", d = i === "decrease", b =
|
|
935
|
-
return /* @__PURE__ */
|
|
933
|
+
}, va = Math.max(0.01, He - Le), Nn = Math.max(0.06, Math.min(0.25, 0.28 * Math.sqrt(va))), pa = u ? { bottom: `${Ht}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: Zt ? 40 : 30 } : { left: `${Ht}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: Zt ? 40 : 30 }, Ma = u ? { bottom: `${Ot}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: Qt ? 40 : 30 } : { left: `${Ot}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: Qt ? 40 : 30 }, Da = u ? { bottom: `${Kt}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${Kt}%`, top: "50%", transform: "translate(-50%, -50%)" }, Yn = pe !== null ? ae(pe) : null, xa = m !== "hover" && pe !== null && (pe === de || !$ && pe === me), ya = Je ? W(w, ie[0]) : $e, Ta = Je ? W(w, ie[ie.length - 1]) : Ke, La = o || (te ? Me <= ya : $ ? de <= k : de <= k && me <= k), Sa = o || (te ? De >= Ta : ($ || de >= F) && me >= F), mt = o ? "cursor-not-allowed opacity-50" : "cursor-pointer", kn = (i) => {
|
|
934
|
+
const s = u ? "vertical" : "horizontal", d = i === "decrease", b = ja[s][i];
|
|
935
|
+
return /* @__PURE__ */ v(
|
|
936
936
|
"button",
|
|
937
937
|
{
|
|
938
938
|
type: "button",
|
|
939
939
|
className: `period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${b} 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 ${mt}`,
|
|
940
940
|
onClick: () => ua(d ? -1 : 1),
|
|
941
|
-
disabled: d ?
|
|
941
|
+
disabled: d ? La : Sa,
|
|
942
942
|
"aria-label": d ? Q : I,
|
|
943
|
-
children:
|
|
943
|
+
children: qa[s][i]
|
|
944
944
|
}
|
|
945
945
|
);
|
|
946
946
|
};
|
|
@@ -953,11 +953,11 @@ const Ua = (e, t) => {
|
|
|
953
953
|
"data-unit": t,
|
|
954
954
|
"data-mode": e.mode,
|
|
955
955
|
"data-orientation": u ? "vertical" : "horizontal",
|
|
956
|
-
"data-label-position":
|
|
956
|
+
"data-label-position": N,
|
|
957
957
|
"data-color-scheme": re,
|
|
958
958
|
children: [
|
|
959
|
-
h &&
|
|
960
|
-
/* @__PURE__ */
|
|
959
|
+
h && kn(u ? "increase" : "decrease"),
|
|
960
|
+
/* @__PURE__ */ v(
|
|
961
961
|
"div",
|
|
962
962
|
{
|
|
963
963
|
ref: it,
|
|
@@ -970,35 +970,35 @@ const Ua = (e, t) => {
|
|
|
970
970
|
onPointerLeave: ca,
|
|
971
971
|
children: te ? /* @__PURE__ */ ce(Wr, { children: [
|
|
972
972
|
ur && (u ? /* @__PURE__ */ ce("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: [
|
|
973
|
-
/* @__PURE__ */
|
|
974
|
-
/* @__PURE__ */
|
|
975
|
-
/* @__PURE__ */
|
|
973
|
+
/* @__PURE__ */ v("defs", { children: /* @__PURE__ */ ce("linearGradient", { id: B, x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
974
|
+
/* @__PURE__ */ v("stop", { offset: "0%", stopColor: D ? A.macro : A.micro, stopOpacity: "0.28" }),
|
|
975
|
+
/* @__PURE__ */ v("stop", { offset: "100%", stopColor: D ? A.micro : A.macro, stopOpacity: Nn })
|
|
976
976
|
] }) }),
|
|
977
|
-
/* @__PURE__ */
|
|
977
|
+
/* @__PURE__ */ v("polygon", { points: D ? `12,${(1 - He) * 100} 12,${(1 - Le) * 100} 20,100 20,0` : `12,0 12,100 20,${(1 - Le) * 100} 20,${(1 - He) * 100}`, fill: `url(#${B})` })
|
|
978
978
|
] }) : /* @__PURE__ */ ce("svg", { className: "period-slider-vernier-projection", role: "presentation", "aria-hidden": "true", width: "100%", height: "32", viewBox: "0 0 100 32", preserveAspectRatio: "none", children: [
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ v("defs", { children: /* @__PURE__ */ ce("linearGradient", { id: B, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
980
|
+
/* @__PURE__ */ v("stop", { offset: "0%", stopColor: D ? A.macro : A.micro, stopOpacity: "0.28" }),
|
|
981
|
+
/* @__PURE__ */ v("stop", { offset: "100%", stopColor: D ? A.micro : A.macro, stopOpacity: Nn })
|
|
982
982
|
] }) }),
|
|
983
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ v("polygon", { points: D ? `${Le * 100},12 ${He * 100},12 100,20 0,20` : `0,12 100,12 ${He * 100},20 ${Le * 100},20`, fill: `url(#${B})` })
|
|
984
984
|
] })),
|
|
985
|
-
!
|
|
986
|
-
/* @__PURE__ */
|
|
985
|
+
!p && /* @__PURE__ */ ce(Wr, { children: [
|
|
986
|
+
/* @__PURE__ */ v(
|
|
987
987
|
"div",
|
|
988
988
|
{
|
|
989
989
|
"data-testid": "period-slider-connect-macro",
|
|
990
990
|
className: "period-slider-connect-macro",
|
|
991
991
|
style: u ? {
|
|
992
|
-
bottom: `calc(${
|
|
993
|
-
height: `calc(${Math.max(0, (He -
|
|
992
|
+
bottom: `calc(${Le * 100}% - 8px)`,
|
|
993
|
+
height: `calc(${Math.max(0, (He - Le) * 100)}% + 16px)`
|
|
994
994
|
} : {
|
|
995
|
-
left: `calc(${
|
|
996
|
-
width: `calc(${Math.max(0, (He -
|
|
995
|
+
left: `calc(${Le * 100}% - 8px)`,
|
|
996
|
+
width: `calc(${Math.max(0, (He - Le) * 100)}% + 16px)`
|
|
997
997
|
},
|
|
998
998
|
onPointerDown: It("macro-connect")
|
|
999
999
|
}
|
|
1000
1000
|
),
|
|
1001
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ v(
|
|
1002
1002
|
"div",
|
|
1003
1003
|
{
|
|
1004
1004
|
"data-testid": "period-slider-connect-micro",
|
|
@@ -1015,8 +1015,8 @@ const Ua = (e, t) => {
|
|
|
1015
1015
|
)
|
|
1016
1016
|
] }),
|
|
1017
1017
|
dr && /* @__PURE__ */ ce("div", { className: "period-slider-vernier-ticks pointer-events-none absolute inset-0", children: [
|
|
1018
|
-
[0.2, 0.4, 0.6, 0.8].map((i) => /* @__PURE__ */
|
|
1019
|
-
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((i) => /* @__PURE__ */
|
|
1018
|
+
[0.2, 0.4, 0.6, 0.8].map((i) => /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", "data-tick-scale": "macro", className: "period-slider-tick period-slider-tick-macro", style: u ? { bottom: `${i * 100}%` } : { left: `${i * 100}%` } }, `macro-tick-${i}`)),
|
|
1019
|
+
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((i) => /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", "data-tick-scale": "micro", className: "period-slider-tick period-slider-tick-micro", style: u ? { bottom: `${i * 100}%` } : { left: `${i * 100}%` } }, `micro-tick-${i}`))
|
|
1020
1020
|
] }),
|
|
1021
1021
|
/* @__PURE__ */ ce(
|
|
1022
1022
|
"div",
|
|
@@ -1030,34 +1030,34 @@ const Ua = (e, t) => {
|
|
|
1030
1030
|
"aria-valuenow": Ce,
|
|
1031
1031
|
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(fr, E) : Bt(E, fr, f, M),
|
|
1032
1032
|
"aria-orientation": u ? "vertical" : "horizontal",
|
|
1033
|
-
className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ?
|
|
1033
|
+
className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? D ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : D ? "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 ${mt}`,
|
|
1034
1034
|
style: u ? {
|
|
1035
|
-
bottom: `${
|
|
1036
|
-
left:
|
|
1037
|
-
right:
|
|
1038
|
-
transform:
|
|
1035
|
+
bottom: `${Le * 100}%`,
|
|
1036
|
+
left: D ? 0 : "auto",
|
|
1037
|
+
right: D ? "auto" : 0,
|
|
1038
|
+
transform: D ? "translate(-100%, 50%)" : "translate(100%, 50%)",
|
|
1039
1039
|
zIndex: Ee === "macro-low" || Re === "macro-low" ? 30 : 15
|
|
1040
1040
|
} : {
|
|
1041
|
-
left: `${
|
|
1042
|
-
top:
|
|
1043
|
-
bottom:
|
|
1044
|
-
transform:
|
|
1041
|
+
left: `${Le * 100}%`,
|
|
1042
|
+
top: D ? 0 : "auto",
|
|
1043
|
+
bottom: D ? "auto" : 0,
|
|
1044
|
+
transform: D ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
|
|
1045
1045
|
zIndex: Ee === "macro-low" || Re === "macro-low" ? 30 : 15
|
|
1046
1046
|
},
|
|
1047
1047
|
onPointerDown: It("macro-low"),
|
|
1048
1048
|
onKeyDown: Mr("macro-low"),
|
|
1049
|
-
onFocus:
|
|
1049
|
+
onFocus: vr("macro-low"),
|
|
1050
1050
|
"data-active": Ee === "macro-low" ? "true" : void 0,
|
|
1051
1051
|
"data-front": Re === "macro-low" ? "true" : void 0,
|
|
1052
|
-
"data-vernier-pos": u ?
|
|
1052
|
+
"data-vernier-pos": u ? D ? "left" : "right" : D ? "top" : "bottom",
|
|
1053
1053
|
"data-handle-type": "macro-low",
|
|
1054
1054
|
children: [
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
-
Rt && /* @__PURE__ */
|
|
1057
|
-
m !== "hover" && /* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ v(ar, { type: "macro", isTop: D, isVertical: u, isLeft: D }),
|
|
1056
|
+
Rt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
|
|
1057
|
+
m !== "hover" && /* @__PURE__ */ v(
|
|
1058
1058
|
"div",
|
|
1059
1059
|
{
|
|
1060
|
-
className: `period-slider-tooltip absolute whitespace-nowrap
|
|
1060
|
+
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1061
1061
|
"data-tooltip-style": m,
|
|
1062
1062
|
"data-duplicate": da ? "true" : void 0,
|
|
1063
1063
|
"data-slanted": Lr.slant.isSlanted ? "true" : void 0,
|
|
@@ -1077,38 +1077,38 @@ const Ua = (e, t) => {
|
|
|
1077
1077
|
"aria-label": e.macroUpperAriaLabel ?? "Macro range end",
|
|
1078
1078
|
"aria-disabled": o ? "true" : void 0,
|
|
1079
1079
|
"aria-valuemin": Ce,
|
|
1080
|
-
"aria-valuemax":
|
|
1080
|
+
"aria-valuemax": Nt,
|
|
1081
1081
|
"aria-valuenow": Ie,
|
|
1082
1082
|
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(hr, E) : Bt(E, hr, f, M),
|
|
1083
1083
|
"aria-orientation": u ? "vertical" : "horizontal",
|
|
1084
|
-
className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ?
|
|
1084
|
+
className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? D ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : D ? "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 ${mt}`,
|
|
1085
1085
|
style: u ? {
|
|
1086
1086
|
bottom: `${He * 100}%`,
|
|
1087
|
-
left:
|
|
1088
|
-
right:
|
|
1089
|
-
transform:
|
|
1087
|
+
left: D ? 0 : "auto",
|
|
1088
|
+
right: D ? "auto" : 0,
|
|
1089
|
+
transform: D ? "translate(-100%, 50%)" : "translate(100%, 50%)",
|
|
1090
1090
|
zIndex: Ee === "macro-high" || Re === "macro-high" ? 30 : 15
|
|
1091
1091
|
} : {
|
|
1092
1092
|
left: `${He * 100}%`,
|
|
1093
|
-
top:
|
|
1094
|
-
bottom:
|
|
1095
|
-
transform:
|
|
1093
|
+
top: D ? 0 : "auto",
|
|
1094
|
+
bottom: D ? "auto" : 0,
|
|
1095
|
+
transform: D ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
|
|
1096
1096
|
zIndex: Ee === "macro-high" || Re === "macro-high" ? 30 : 15
|
|
1097
1097
|
},
|
|
1098
1098
|
onPointerDown: It("macro-high"),
|
|
1099
1099
|
onKeyDown: Mr("macro-high"),
|
|
1100
|
-
onFocus:
|
|
1100
|
+
onFocus: vr("macro-high"),
|
|
1101
1101
|
"data-active": Ee === "macro-high" ? "true" : void 0,
|
|
1102
1102
|
"data-front": Re === "macro-high" ? "true" : void 0,
|
|
1103
|
-
"data-vernier-pos": u ?
|
|
1103
|
+
"data-vernier-pos": u ? D ? "left" : "right" : D ? "top" : "bottom",
|
|
1104
1104
|
"data-handle-type": "macro-high",
|
|
1105
1105
|
children: [
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
Rt && /* @__PURE__ */
|
|
1108
|
-
m !== "hover" && /* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ v(ar, { type: "macro", isTop: D, isVertical: u, isLeft: D }),
|
|
1107
|
+
Rt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
|
|
1108
|
+
m !== "hover" && /* @__PURE__ */ v(
|
|
1109
1109
|
"div",
|
|
1110
1110
|
{
|
|
1111
|
-
className: `period-slider-tooltip absolute whitespace-nowrap
|
|
1111
|
+
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1112
1112
|
"data-tooltip-style": m,
|
|
1113
1113
|
"data-duplicate": ma ? "true" : void 0,
|
|
1114
1114
|
"data-slanted": Lr.slant.isSlanted ? "true" : void 0,
|
|
@@ -1128,44 +1128,44 @@ const Ua = (e, t) => {
|
|
|
1128
1128
|
"aria-label": e.lowerAriaLabel ?? "Micro range start",
|
|
1129
1129
|
"aria-disabled": o ? "true" : void 0,
|
|
1130
1130
|
"aria-valuemin": $e,
|
|
1131
|
-
"aria-valuemax":
|
|
1132
|
-
"aria-valuenow":
|
|
1133
|
-
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(ut, w) : Bt(w, ut,
|
|
1131
|
+
"aria-valuemax": De,
|
|
1132
|
+
"aria-valuenow": Me,
|
|
1133
|
+
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(ut, w) : Bt(w, ut, Y, M),
|
|
1134
1134
|
"aria-orientation": u ? "vertical" : "horizontal",
|
|
1135
|
-
className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ?
|
|
1135
|
+
className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? D ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : D ? "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 ${mt}`,
|
|
1136
1136
|
style: u ? {
|
|
1137
1137
|
bottom: `${ze * 100}%`,
|
|
1138
|
-
left:
|
|
1139
|
-
right:
|
|
1140
|
-
transform:
|
|
1138
|
+
left: D ? "auto" : 0,
|
|
1139
|
+
right: D ? 0 : "auto",
|
|
1140
|
+
transform: D ? "translate(100%, 50%)" : "translate(-100%, 50%)",
|
|
1141
1141
|
zIndex: Ee === "micro-low" || Re === "micro-low" ? 30 : 20
|
|
1142
1142
|
} : {
|
|
1143
1143
|
left: `${ze * 100}%`,
|
|
1144
|
-
top:
|
|
1145
|
-
bottom:
|
|
1146
|
-
transform:
|
|
1144
|
+
top: D ? "auto" : 0,
|
|
1145
|
+
bottom: D ? 0 : "auto",
|
|
1146
|
+
transform: D ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
|
|
1147
1147
|
zIndex: Ee === "micro-low" || Re === "micro-low" ? 30 : 20
|
|
1148
1148
|
},
|
|
1149
1149
|
onPointerDown: It("micro-low"),
|
|
1150
1150
|
onKeyDown: Mr("micro-low"),
|
|
1151
|
-
onFocus:
|
|
1151
|
+
onFocus: vr("micro-low"),
|
|
1152
1152
|
"data-active": Ee === "micro-low" ? "true" : void 0,
|
|
1153
1153
|
"data-front": Re === "micro-low" ? "true" : void 0,
|
|
1154
|
-
"data-vernier-pos": u ?
|
|
1154
|
+
"data-vernier-pos": u ? D ? "right" : "left" : D ? "bottom" : "top",
|
|
1155
1155
|
"data-handle-type": "micro-low",
|
|
1156
1156
|
children: [
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
Rt && /* @__PURE__ */
|
|
1159
|
-
m !== "hover" && /* @__PURE__ */
|
|
1157
|
+
/* @__PURE__ */ v(ar, { type: "micro", isTop: !D, isVertical: u, isLeft: !D }),
|
|
1158
|
+
Rt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
|
|
1159
|
+
m !== "hover" && /* @__PURE__ */ v(
|
|
1160
1160
|
"div",
|
|
1161
1161
|
{
|
|
1162
|
-
className: `period-slider-tooltip absolute whitespace-nowrap
|
|
1162
|
+
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1163
1163
|
"data-tooltip-style": m,
|
|
1164
1164
|
"data-duplicate": fa ? "true" : void 0,
|
|
1165
1165
|
"data-slanted": Sr.slant.isSlanted ? "true" : void 0,
|
|
1166
1166
|
ref: aa,
|
|
1167
1167
|
style: Sr.lowStyle,
|
|
1168
|
-
children: _e(w, ut,
|
|
1168
|
+
children: _e(w, ut, Y, M)
|
|
1169
1169
|
}
|
|
1170
1170
|
)
|
|
1171
1171
|
]
|
|
@@ -1178,63 +1178,65 @@ const Ua = (e, t) => {
|
|
|
1178
1178
|
role: "slider",
|
|
1179
1179
|
"aria-label": e.upperAriaLabel ?? "Micro range end",
|
|
1180
1180
|
"aria-disabled": o ? "true" : void 0,
|
|
1181
|
-
"aria-valuemin":
|
|
1181
|
+
"aria-valuemin": Me,
|
|
1182
1182
|
"aria-valuemax": Ke,
|
|
1183
|
-
"aria-valuenow":
|
|
1184
|
-
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(dt, w) : Bt(w, dt,
|
|
1183
|
+
"aria-valuenow": De,
|
|
1184
|
+
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(dt, w) : Bt(w, dt, Y, M),
|
|
1185
1185
|
"aria-orientation": u ? "vertical" : "horizontal",
|
|
1186
|
-
className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ?
|
|
1186
|
+
className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? D ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : D ? "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 ${mt}`,
|
|
1187
1187
|
style: u ? {
|
|
1188
1188
|
bottom: `${ot * 100}%`,
|
|
1189
|
-
left:
|
|
1190
|
-
right:
|
|
1191
|
-
transform:
|
|
1189
|
+
left: D ? "auto" : 0,
|
|
1190
|
+
right: D ? 0 : "auto",
|
|
1191
|
+
transform: D ? "translate(100%, 50%)" : "translate(-100%, 50%)",
|
|
1192
1192
|
zIndex: Ee === "micro-high" || Re === "micro-high" ? 30 : 20
|
|
1193
1193
|
} : {
|
|
1194
1194
|
left: `${ot * 100}%`,
|
|
1195
|
-
top:
|
|
1196
|
-
bottom:
|
|
1197
|
-
transform:
|
|
1195
|
+
top: D ? "auto" : 0,
|
|
1196
|
+
bottom: D ? 0 : "auto",
|
|
1197
|
+
transform: D ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
|
|
1198
1198
|
zIndex: Ee === "micro-high" || Re === "micro-high" ? 30 : 20
|
|
1199
1199
|
},
|
|
1200
1200
|
onPointerDown: It("micro-high"),
|
|
1201
1201
|
onKeyDown: Mr("micro-high"),
|
|
1202
|
-
onFocus:
|
|
1202
|
+
onFocus: vr("micro-high"),
|
|
1203
1203
|
"data-active": Ee === "micro-high" ? "true" : void 0,
|
|
1204
1204
|
"data-front": Re === "micro-high" ? "true" : void 0,
|
|
1205
|
-
"data-vernier-pos": u ?
|
|
1205
|
+
"data-vernier-pos": u ? D ? "right" : "left" : D ? "bottom" : "top",
|
|
1206
1206
|
"data-handle-type": "micro-high",
|
|
1207
1207
|
children: [
|
|
1208
|
-
/* @__PURE__ */
|
|
1209
|
-
Rt && /* @__PURE__ */
|
|
1210
|
-
m !== "hover" && /* @__PURE__ */
|
|
1208
|
+
/* @__PURE__ */ v(ar, { type: "micro", isTop: !D, isVertical: u, isLeft: !D }),
|
|
1209
|
+
Rt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
|
|
1210
|
+
m !== "hover" && /* @__PURE__ */ v(
|
|
1211
1211
|
"div",
|
|
1212
1212
|
{
|
|
1213
|
-
className: `period-slider-tooltip absolute whitespace-nowrap
|
|
1213
|
+
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1214
1214
|
"data-tooltip-style": m,
|
|
1215
1215
|
"data-duplicate": ha ? "true" : void 0,
|
|
1216
1216
|
"data-slanted": Sr.slant.isSlanted ? "true" : void 0,
|
|
1217
1217
|
ref: oa,
|
|
1218
1218
|
style: Sr.highStyle,
|
|
1219
|
-
children: _e(w, dt,
|
|
1219
|
+
children: _e(w, dt, Y, M)
|
|
1220
1220
|
}
|
|
1221
1221
|
)
|
|
1222
1222
|
]
|
|
1223
1223
|
}
|
|
1224
1224
|
)
|
|
1225
1225
|
] }) : /* @__PURE__ */ ce(Wr, { children: [
|
|
1226
|
-
!
|
|
1227
|
-
U && R && g.length > 1 && /* @__PURE__ */
|
|
1226
|
+
!p && /* @__PURE__ */ v("div", { "data-testid": "period-slider-connect", className: "period-slider-connect absolute rounded-full", style: wa, onPointerDown: ia }),
|
|
1227
|
+
U && R && g.length > 1 && /* @__PURE__ */ v("div", { className: "period-slider-ticks pointer-events-none absolute inset-0", children: g.map((i, s) => {
|
|
1228
1228
|
const d = W(t, i), b = gr(s), T = u ? { bottom: `${b}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${b}%`, top: "50%", transform: "translate(-50%, -50%)" };
|
|
1229
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ v("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: T }, `tick-${d}`);
|
|
1230
1230
|
}) }),
|
|
1231
|
-
!o &&
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1231
|
+
!o && pe !== null && Kt !== null && S === null && Yn && /* @__PURE__ */ ce("div", { "data-testid": "period-slider-hover-guide", className: "period-slider-hover-guide pointer-events-none absolute h-2 w-2", style: Da, children: [
|
|
1232
|
+
/* @__PURE__ */ v("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" }),
|
|
1233
|
+
/* @__PURE__ */ v(
|
|
1234
1234
|
"div",
|
|
1235
1235
|
{
|
|
1236
|
-
|
|
1237
|
-
|
|
1236
|
+
"data-testid": "period-slider-hover-tooltip",
|
|
1237
|
+
"data-duplicate": xa ? "true" : void 0,
|
|
1238
|
+
className: `period-slider-hover-tooltip ${N === "bottom" && !u ? "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`,
|
|
1239
|
+
children: _e(t, Yn, e.formatLabel, M)
|
|
1238
1240
|
}
|
|
1239
1241
|
)
|
|
1240
1242
|
] }),
|
|
@@ -1243,37 +1245,37 @@ const Ua = (e, t) => {
|
|
|
1243
1245
|
{
|
|
1244
1246
|
tabIndex: o ? -1 : 0,
|
|
1245
1247
|
role: "slider",
|
|
1246
|
-
"aria-label":
|
|
1248
|
+
"aria-label": $ ? e.pointAriaLabel ?? "Selected date" : e.lowerAriaLabel ?? "Range start",
|
|
1247
1249
|
"aria-disabled": o ? "true" : void 0,
|
|
1248
|
-
"aria-valuemin":
|
|
1249
|
-
"aria-valuemax":
|
|
1250
|
-
"aria-valuenow":
|
|
1250
|
+
"aria-valuemin": k,
|
|
1251
|
+
"aria-valuemax": $ ? F : me,
|
|
1252
|
+
"aria-valuenow": de,
|
|
1251
1253
|
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Kr, t) : Bt(t, Kr, e.formatLabel, M),
|
|
1252
1254
|
"aria-orientation": u ? "vertical" : "horizontal",
|
|
1253
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 ${mt}`,
|
|
1254
|
-
style:
|
|
1255
|
-
onPointerDown:
|
|
1256
|
+
style: pa,
|
|
1257
|
+
onPointerDown: xn("low"),
|
|
1256
1258
|
onKeyDown: Tn("low"),
|
|
1257
1259
|
onFocus: yn("low"),
|
|
1258
1260
|
"data-active": S === "low" ? "true" : void 0,
|
|
1259
1261
|
"data-front": Zt ? "true" : void 0,
|
|
1260
1262
|
children: [
|
|
1261
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ v(
|
|
1262
1264
|
"div",
|
|
1263
1265
|
{
|
|
1264
1266
|
"data-testid": "period-slider-knob",
|
|
1265
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)] ${S === "low" ? "" : "shadow-md"}`
|
|
1266
1268
|
}
|
|
1267
1269
|
),
|
|
1268
|
-
m !== "hover" && /* @__PURE__ */
|
|
1270
|
+
m !== "hover" && /* @__PURE__ */ v(
|
|
1269
1271
|
"div",
|
|
1270
1272
|
{
|
|
1271
|
-
className: `period-slider-tooltip absolute whitespace-nowrap
|
|
1273
|
+
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1272
1274
|
"data-tooltip-style": m,
|
|
1273
|
-
"data-label-position":
|
|
1275
|
+
"data-label-position": N,
|
|
1274
1276
|
"data-slanted": Oe.isSlanted ? "true" : void 0,
|
|
1275
1277
|
"data-front": Zt ? "true" : void 0,
|
|
1276
|
-
"data-duplicate":
|
|
1278
|
+
"data-duplicate": Dr && !Zt ? "true" : void 0,
|
|
1277
1279
|
ref: ea,
|
|
1278
1280
|
style: ga,
|
|
1279
1281
|
children: _e(t, Kr, e.formatLabel, M)
|
|
@@ -1282,42 +1284,42 @@ const Ua = (e, t) => {
|
|
|
1282
1284
|
]
|
|
1283
1285
|
}
|
|
1284
1286
|
),
|
|
1285
|
-
|
|
1287
|
+
!$ && /* @__PURE__ */ ce(
|
|
1286
1288
|
"div",
|
|
1287
1289
|
{
|
|
1288
1290
|
tabIndex: o ? -1 : 0,
|
|
1289
1291
|
role: "slider",
|
|
1290
1292
|
"aria-label": e.upperAriaLabel ?? "Range end",
|
|
1291
1293
|
"aria-disabled": o ? "true" : void 0,
|
|
1292
|
-
"aria-valuemin":
|
|
1294
|
+
"aria-valuemin": de,
|
|
1293
1295
|
"aria-valuemax": F,
|
|
1294
|
-
"aria-valuenow":
|
|
1296
|
+
"aria-valuenow": me,
|
|
1295
1297
|
"aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(qr, t) : Bt(t, qr, e.formatLabel, M),
|
|
1296
1298
|
"aria-orientation": u ? "vertical" : "horizontal",
|
|
1297
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 ${mt}`,
|
|
1298
1300
|
style: Ma,
|
|
1299
|
-
onPointerDown:
|
|
1301
|
+
onPointerDown: xn("high"),
|
|
1300
1302
|
onKeyDown: Tn("high"),
|
|
1301
1303
|
onFocus: yn("high"),
|
|
1302
1304
|
"data-active": S === "high" ? "true" : void 0,
|
|
1303
1305
|
"data-front": Qt ? "true" : void 0,
|
|
1304
1306
|
children: [
|
|
1305
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ v(
|
|
1306
1308
|
"div",
|
|
1307
1309
|
{
|
|
1308
1310
|
"data-testid": "period-slider-knob",
|
|
1309
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)] ${S === "high" ? "" : "shadow-md"}`
|
|
1310
1312
|
}
|
|
1311
1313
|
),
|
|
1312
|
-
m !== "hover" && /* @__PURE__ */
|
|
1314
|
+
m !== "hover" && /* @__PURE__ */ v(
|
|
1313
1315
|
"div",
|
|
1314
1316
|
{
|
|
1315
|
-
className: `period-slider-tooltip absolute whitespace-nowrap
|
|
1317
|
+
className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
|
|
1316
1318
|
"data-tooltip-style": m,
|
|
1317
|
-
"data-label-position":
|
|
1319
|
+
"data-label-position": N,
|
|
1318
1320
|
"data-slanted": Oe.isSlanted ? "true" : void 0,
|
|
1319
1321
|
"data-front": Qt ? "true" : void 0,
|
|
1320
|
-
"data-duplicate":
|
|
1322
|
+
"data-duplicate": Dr && !Qt ? "true" : void 0,
|
|
1321
1323
|
ref: ta,
|
|
1322
1324
|
style: ba,
|
|
1323
1325
|
children: _e(t, qr, e.formatLabel, M)
|
|
@@ -1329,7 +1331,7 @@ const Ua = (e, t) => {
|
|
|
1329
1331
|
] })
|
|
1330
1332
|
}
|
|
1331
1333
|
),
|
|
1332
|
-
h &&
|
|
1334
|
+
h && kn(u ? "decrease" : "increase")
|
|
1333
1335
|
]
|
|
1334
1336
|
}
|
|
1335
1337
|
);
|
|
@@ -1339,7 +1341,7 @@ const Ua = (e, t) => {
|
|
|
1339
1341
|
for (let r = 0; r < e.length; r++)
|
|
1340
1342
|
if (e[r].getTime() !== t[r].getTime()) return !1;
|
|
1341
1343
|
return !0;
|
|
1342
|
-
},
|
|
1344
|
+
}, Ga = (e, t) => {
|
|
1343
1345
|
if (e === t) return !0;
|
|
1344
1346
|
if (!(e && t)) return !1;
|
|
1345
1347
|
const r = Object.keys(e), n = Object.keys(t);
|
|
@@ -1347,15 +1349,15 @@ const Ua = (e, t) => {
|
|
|
1347
1349
|
for (const a of r)
|
|
1348
1350
|
if (e[a] !== t[a]) return !1;
|
|
1349
1351
|
return !0;
|
|
1350
|
-
},
|
|
1351
|
-
|
|
1352
|
+
}, Ja = (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 || !Ga(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 || !Qr(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.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.onChangeMacroRange !== t.onChangeMacroRange || !Qr(e.macroAllowedDates, t.macroAllowedDates) || !Qr(e.microAllowedDates, t.microAllowedDates)) : !1, Za = sr(Wa, Ja);
|
|
1353
|
+
Za.displayName = "PeriodSlider";
|
|
1352
1354
|
const tt = (e) => {
|
|
1353
1355
|
const t = new Date(e);
|
|
1354
1356
|
return t.setHours(0, 0, 0, 0), t;
|
|
1355
1357
|
}, or = (e, t) => {
|
|
1356
1358
|
if (Number.isNaN(t.getTime()))
|
|
1357
1359
|
throw new RangeError(`DateSelector: "${e}" must be a valid Date (received ${String(t)})`);
|
|
1358
|
-
},
|
|
1360
|
+
}, Qa = (e) => {
|
|
1359
1361
|
if (e !== void 0)
|
|
1360
1362
|
try {
|
|
1361
1363
|
Intl.DateTimeFormat.supportedLocalesOf([e]);
|
|
@@ -1365,31 +1367,31 @@ const tt = (e) => {
|
|
|
1365
1367
|
}, Tt = (e, t, r) => {
|
|
1366
1368
|
const n = new Date(e, t - 1, r);
|
|
1367
1369
|
return n.setFullYear(e), n.setHours(0, 0, 0, 0), n;
|
|
1368
|
-
}, Un = (e) => Tt(e, 1, 1),
|
|
1370
|
+
}, Un = (e) => Tt(e, 1, 1), eo = (e) => Tt(e, 12, 31), to = {
|
|
1369
1371
|
year: { year: "numeric" },
|
|
1370
1372
|
month: { month: "2-digit" },
|
|
1371
1373
|
day: { day: "2-digit" }
|
|
1372
|
-
},
|
|
1374
|
+
}, ro = {
|
|
1373
1375
|
year: 4,
|
|
1374
1376
|
month: 2,
|
|
1375
1377
|
day: 2
|
|
1376
|
-
},
|
|
1378
|
+
}, no = {
|
|
1377
1379
|
year: (e) => e.getFullYear(),
|
|
1378
1380
|
month: (e) => e.getMonth() + 1,
|
|
1379
1381
|
day: (e) => e.getDate()
|
|
1380
|
-
}, Bn = /* @__PURE__ */ new Map(),
|
|
1382
|
+
}, Bn = /* @__PURE__ */ new Map(), ao = (e, t) => {
|
|
1381
1383
|
const r = `${e}\0${t}`, n = Bn.get(r);
|
|
1382
1384
|
if (n !== void 0) return n;
|
|
1383
|
-
const a = new Intl.DateTimeFormat(t,
|
|
1385
|
+
const a = new Intl.DateTimeFormat(t, to[e]);
|
|
1384
1386
|
return Bn.set(r, a), a;
|
|
1385
|
-
}, en = (e, t, r) => r === void 0 ? String(
|
|
1387
|
+
}, en = (e, t, r) => r === void 0 ? String(no[e](t)).padStart(ro[e], "0") : ao(e, r).format(t), oo = (e, t, r) => {
|
|
1386
1388
|
const n = t?.getTime() ?? null, a = r?.getTime() ?? null, l = /* @__PURE__ */ new Map();
|
|
1387
1389
|
return e.forEach((o, c) => {
|
|
1388
1390
|
or(`allowedDates[${c}]`, o);
|
|
1389
1391
|
const h = tt(o), m = h.getTime();
|
|
1390
1392
|
n !== null && m < n || a !== null && m > a || l.has(m) || l.set(m, h);
|
|
1391
1393
|
}), Array.from(l.keys()).sort((o, c) => o - c).map((o) => l.get(o));
|
|
1392
|
-
},
|
|
1394
|
+
}, io = (e, t) => {
|
|
1393
1395
|
const r = [];
|
|
1394
1396
|
let n = tt(e);
|
|
1395
1397
|
const a = tt(t).getTime();
|
|
@@ -1401,7 +1403,7 @@ const tt = (e) => {
|
|
|
1401
1403
|
for (let n = e.length - 1; n >= 0; n--)
|
|
1402
1404
|
r.push({ label: _e("day", e[n], void 0, t), value: Xt(e[n], "yyyy-MM-dd") });
|
|
1403
1405
|
return r;
|
|
1404
|
-
},
|
|
1406
|
+
}, lo = (e) => {
|
|
1405
1407
|
const {
|
|
1406
1408
|
value: t,
|
|
1407
1409
|
initialDate: r,
|
|
@@ -1412,10 +1414,10 @@ const tt = (e) => {
|
|
|
1412
1414
|
minDate: c,
|
|
1413
1415
|
maxDate: h,
|
|
1414
1416
|
allowedDates: m,
|
|
1415
|
-
variant:
|
|
1416
|
-
className:
|
|
1417
|
+
variant: N = "date",
|
|
1418
|
+
className: x = "",
|
|
1417
1419
|
style: u,
|
|
1418
|
-
disabled:
|
|
1420
|
+
disabled: p = !1,
|
|
1419
1421
|
prevDateAriaLabel: U = "Previous day",
|
|
1420
1422
|
nextDateAriaLabel: re = "Next day",
|
|
1421
1423
|
selectAriaLabel: M = "Date",
|
|
@@ -1427,90 +1429,90 @@ const tt = (e) => {
|
|
|
1427
1429
|
formatMonthOption: L,
|
|
1428
1430
|
formatDayOption: K
|
|
1429
1431
|
} = e;
|
|
1430
|
-
if (
|
|
1432
|
+
if (Qa(A), t !== void 0 && or("value", t), r !== void 0 && or("initialDate", r), c !== void 0 && or("minDate", c), h !== void 0 && or("maxDate", h), l !== void 0 && !Number.isInteger(l))
|
|
1431
1433
|
throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(l)})`);
|
|
1432
1434
|
if (o !== void 0 && !Number.isInteger(o))
|
|
1433
1435
|
throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(o)})`);
|
|
1434
|
-
if (
|
|
1436
|
+
if (N === "split-dropdown" && m !== void 0)
|
|
1435
1437
|
throw new RangeError('DateSelector: variant="split-dropdown" cannot honour "allowedDates"; use variant="dropdown" or variant="date" for a discrete date set');
|
|
1436
1438
|
const H = t ?? r;
|
|
1437
1439
|
if (H === void 0)
|
|
1438
1440
|
throw new RangeError("DateSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected date is never inferred from the wall clock.");
|
|
1439
|
-
const [g, R] = xe(() => tt(H)),
|
|
1440
|
-
const f = c ? tt(c) : null,
|
|
1441
|
-
return f === null ?
|
|
1442
|
-
}, [ae, l]), oe =
|
|
1443
|
-
const f = h ? tt(h) : null,
|
|
1444
|
-
return f === null ?
|
|
1445
|
-
}, [
|
|
1441
|
+
const [g, R] = xe(() => tt(H)), k = t !== void 0, F = t?.getTime(), $ = P(() => t !== void 0 ? tt(t) : g, [F, g]), ae = c?.getTime(), Se = h?.getTime(), ee = P(() => {
|
|
1442
|
+
const f = c ? tt(c) : null, Y = l !== void 0 ? Un(l) : null;
|
|
1443
|
+
return f === null ? Y : Y === null || f.getTime() >= Y.getTime() ? f : Y;
|
|
1444
|
+
}, [ae, l]), oe = P(() => {
|
|
1445
|
+
const f = h ? tt(h) : null, Y = o !== void 0 ? eo(o) : null;
|
|
1446
|
+
return f === null ? Y : Y === null || f.getTime() <= Y.getTime() ? f : Y;
|
|
1447
|
+
}, [Se, o]), se = ee?.getTime() ?? null, ge = oe?.getTime() ?? null;
|
|
1446
1448
|
if (ee !== null && oe !== null && ee.getTime() > oe.getTime())
|
|
1447
1449
|
throw new RangeError(`DateSelector: the resolved range is empty (min ${Xt(ee, "yyyy-MM-dd")} is after max ${Xt(oe, "yyyy-MM-dd")})`);
|
|
1448
|
-
if (
|
|
1449
|
-
throw new RangeError(`DateSelector: variant="${
|
|
1450
|
-
const J = m === void 0 ? null : m.map((f) => f.getTime()).join(","), j =
|
|
1451
|
-
const
|
|
1452
|
-
return j !== null ? j.some((Ae) => Ae.getTime() ===
|
|
1453
|
-
},
|
|
1450
|
+
if (N !== "date" && m === void 0 && (ee === null || oe === null))
|
|
1451
|
+
throw new RangeError(`DateSelector: variant="${N}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${N === "dropdown" ? ' or supply "allowedDates"' : ""}`);
|
|
1452
|
+
const J = m === void 0 ? null : m.map((f) => f.getTime()).join(","), j = P(() => m === void 0 ? null : oo(m, ee, oe), [J, se, ge]), ke = (f) => {
|
|
1453
|
+
const Y = f.getTime();
|
|
1454
|
+
return j !== null ? j.some((Ae) => Ae.getTime() === Y) : !(se !== null && Y < se || ge !== null && Y > ge);
|
|
1455
|
+
}, pt = H.getTime();
|
|
1454
1456
|
Lt(() => {
|
|
1455
|
-
|
|
1456
|
-
}, [
|
|
1457
|
+
k || R(tt(H));
|
|
1458
|
+
}, [k, pt]);
|
|
1457
1459
|
const Fe = (f) => {
|
|
1458
|
-
if (
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
},
|
|
1460
|
+
if (p) return;
|
|
1461
|
+
const Y = tt(f);
|
|
1462
|
+
ke(Y) && (k || R(Y), n?.(Y));
|
|
1463
|
+
}, Ne = $.getTime(), be = ke($), O = P(() => {
|
|
1462
1464
|
if (j !== null) {
|
|
1463
|
-
for (let
|
|
1464
|
-
if (j[
|
|
1465
|
+
for (let Y = j.length - 1; Y >= 0; Y--)
|
|
1466
|
+
if (j[Y].getTime() < Ne) return j[Y];
|
|
1465
1467
|
return null;
|
|
1466
1468
|
}
|
|
1467
|
-
const f = Cr(new Date(
|
|
1468
|
-
return
|
|
1469
|
-
}, [j,
|
|
1469
|
+
const f = Cr(new Date(Ne), -1);
|
|
1470
|
+
return ke(f) ? f : null;
|
|
1471
|
+
}, [j, Ne, se, ge]), z = P(() => {
|
|
1470
1472
|
if (j !== null) {
|
|
1471
|
-
for (const
|
|
1472
|
-
if (
|
|
1473
|
+
for (const Y of j)
|
|
1474
|
+
if (Y.getTime() > Ne) return Y;
|
|
1473
1475
|
return null;
|
|
1474
1476
|
}
|
|
1475
|
-
const f = Cr(new Date(
|
|
1476
|
-
return
|
|
1477
|
-
}, [j,
|
|
1477
|
+
const f = Cr(new Date(Ne), 1);
|
|
1478
|
+
return ke(f) ? f : null;
|
|
1479
|
+
}, [j, Ne, se, ge]), Z = p || O === null, we = p || z === null, S = () => {
|
|
1478
1480
|
O !== null && Fe(O);
|
|
1479
|
-
},
|
|
1481
|
+
}, ye = () => {
|
|
1480
1482
|
z !== null && Fe(z);
|
|
1481
1483
|
}, Be = (f) => {
|
|
1482
1484
|
if (f.target.value) {
|
|
1483
|
-
const
|
|
1484
|
-
Number.isNaN(
|
|
1485
|
+
const Y = In(f.target.value);
|
|
1486
|
+
Number.isNaN(Y.getTime()) || Fe(Y);
|
|
1485
1487
|
}
|
|
1486
1488
|
}, rt = (f) => {
|
|
1487
1489
|
if (f.target.value) {
|
|
1488
|
-
const
|
|
1489
|
-
Number.isNaN(
|
|
1490
|
+
const Y = In(f.target.value);
|
|
1491
|
+
Number.isNaN(Y.getTime()) || Fe(Y);
|
|
1490
1492
|
}
|
|
1491
|
-
}, ue =
|
|
1492
|
-
if (
|
|
1493
|
+
}, ue = $.getFullYear(), pe = $.getMonth() + 1, nt = $.getDate(), Kt = P(() => N !== "dropdown" ? [] : j !== null ? zn(j, A) : ee === null || oe === null ? [] : zn(io(ee, oe), A), [N, j, se, ge, A]), cr = P(() => {
|
|
1494
|
+
if (N !== "split-dropdown" || ee === null || oe === null) return [];
|
|
1493
1495
|
const f = [];
|
|
1494
|
-
for (let
|
|
1495
|
-
f.push(
|
|
1496
|
+
for (let Y = oe.getFullYear(); Y >= ee.getFullYear(); Y--)
|
|
1497
|
+
f.push(Y);
|
|
1496
1498
|
return f;
|
|
1497
|
-
}, [
|
|
1498
|
-
if (
|
|
1499
|
-
const f = ee,
|
|
1499
|
+
}, [N, se, ge]), de = P(() => {
|
|
1500
|
+
if (N !== "split-dropdown" || ee === null || oe === null) return [];
|
|
1501
|
+
const f = ee, Y = oe, Ae = ue === f.getFullYear() ? f.getMonth() + 1 : 1, Pt = ue === Y.getFullYear() ? Y.getMonth() + 1 : 12, Dt = [];
|
|
1500
1502
|
for (let at = Ae; at <= Pt; at++)
|
|
1501
|
-
|
|
1502
|
-
return
|
|
1503
|
-
}, [
|
|
1504
|
-
if (
|
|
1505
|
-
const f = ee,
|
|
1503
|
+
Dt.push(at);
|
|
1504
|
+
return Dt;
|
|
1505
|
+
}, [N, se, ge, ue]), me = P(() => {
|
|
1506
|
+
if (N !== "split-dropdown" || ee === null || oe === null) return [];
|
|
1507
|
+
const f = ee, Y = oe, Ae = ue === f.getFullYear() && pe === f.getMonth() + 1 ? f.getDate() : 1, Pt = ue === Y.getFullYear() && pe === Y.getMonth() + 1 ? Y.getDate() : Cn(new Date(Ne)), Dt = [];
|
|
1506
1508
|
for (let at = Ae; at <= Pt; at++)
|
|
1507
|
-
|
|
1508
|
-
return
|
|
1509
|
-
}, [
|
|
1510
|
-
St(f,
|
|
1511
|
-
}, Mt = (f) => B ? B(f) : en("year", Un(f), A),
|
|
1512
|
-
return /* @__PURE__ */ ce("div", { className: `inline-flex items-center ${
|
|
1513
|
-
/* @__PURE__ */
|
|
1509
|
+
Dt.push(at);
|
|
1510
|
+
return Dt;
|
|
1511
|
+
}, [N, se, ge, Ne, ue, pe]), St = (f, Y, Ae) => Ae > Cn(Tt(f, Y, 1)) ? !1 : ke(Tt(f, Y, Ae)), te = (f, Y, Ae) => {
|
|
1512
|
+
St(f, Y, Ae) && Fe(Tt(f, Y, Ae));
|
|
1513
|
+
}, Mt = (f) => B ? B(f) : en("year", Un(f), A), D = (f) => L ? L(f) : en("month", Tt(ue, f, 1), A), ur = (f) => K ? K(f) : en("day", Tt(ue, pe, f), A), dr = Xt($, "yyyy-MM-dd"), Rt = _e("day", $, void 0, A), E = ee ? Xt(ee, "yyyy-MM-dd") : void 0, w = oe ? Xt(oe, "yyyy-MM-dd") : void 0, Ir = be ? dr : "", $t = "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400";
|
|
1514
|
+
return /* @__PURE__ */ ce("div", { className: `inline-flex items-center ${N === "split-dropdown" ? "w-auto" : "w-38"} ${x}`, style: u, "data-variant": N, "data-out-of-range": be ? void 0 : "true", children: [
|
|
1515
|
+
/* @__PURE__ */ v(
|
|
1514
1516
|
"button",
|
|
1515
1517
|
{
|
|
1516
1518
|
type: "button",
|
|
@@ -1518,24 +1520,24 @@ const tt = (e) => {
|
|
|
1518
1520
|
disabled: Z,
|
|
1519
1521
|
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",
|
|
1520
1522
|
onClick: S,
|
|
1521
|
-
children: /* @__PURE__ */
|
|
1523
|
+
children: /* @__PURE__ */ v("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" })
|
|
1522
1524
|
}
|
|
1523
1525
|
),
|
|
1524
|
-
|
|
1525
|
-
be ? null : /* @__PURE__ */
|
|
1526
|
-
Kt.map((f) => /* @__PURE__ */
|
|
1527
|
-
] }) :
|
|
1526
|
+
N === "dropdown" ? /* @__PURE__ */ ce("select", { "aria-label": M, disabled: p, 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: Ir, onChange: rt, children: [
|
|
1527
|
+
be ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: $t, children: Rt }),
|
|
1528
|
+
Kt.map((f) => /* @__PURE__ */ v("option", { value: f.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: f.label }, f.value))
|
|
1529
|
+
] }) : N === "split-dropdown" ? /* @__PURE__ */ ce("div", { className: "mx-1 my-auto inline-flex items-center gap-1", children: [
|
|
1528
1530
|
/* @__PURE__ */ ce(
|
|
1529
1531
|
"select",
|
|
1530
1532
|
{
|
|
1531
1533
|
"aria-label": Q,
|
|
1532
|
-
disabled:
|
|
1534
|
+
disabled: p,
|
|
1533
1535
|
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",
|
|
1534
1536
|
value: be ? ue : "",
|
|
1535
|
-
onChange: (f) => te(Number(f.target.value),
|
|
1537
|
+
onChange: (f) => te(Number(f.target.value), pe, nt),
|
|
1536
1538
|
children: [
|
|
1537
|
-
be ? null : /* @__PURE__ */
|
|
1538
|
-
cr.map((f) => /* @__PURE__ */
|
|
1539
|
+
be ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: $t, children: Mt(ue) }),
|
|
1540
|
+
cr.map((f) => /* @__PURE__ */ v("option", { value: f, disabled: !St(f, pe, nt), className: "dark:bg-slate-700 dark:text-slate-100", children: Mt(f) }, f))
|
|
1539
1541
|
]
|
|
1540
1542
|
}
|
|
1541
1543
|
),
|
|
@@ -1543,13 +1545,13 @@ const tt = (e) => {
|
|
|
1543
1545
|
"select",
|
|
1544
1546
|
{
|
|
1545
1547
|
"aria-label": I,
|
|
1546
|
-
disabled:
|
|
1548
|
+
disabled: p,
|
|
1547
1549
|
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",
|
|
1548
|
-
value: be ?
|
|
1550
|
+
value: be ? pe : "",
|
|
1549
1551
|
onChange: (f) => te(ue, Number(f.target.value), nt),
|
|
1550
1552
|
children: [
|
|
1551
|
-
be ? null : /* @__PURE__ */
|
|
1552
|
-
|
|
1553
|
+
be ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: $t, children: D(pe) }),
|
|
1554
|
+
de.map((f) => /* @__PURE__ */ v("option", { value: f, disabled: !St(ue, f, nt), className: "dark:bg-slate-700 dark:text-slate-100", children: D(f) }, f))
|
|
1553
1555
|
]
|
|
1554
1556
|
}
|
|
1555
1557
|
),
|
|
@@ -1557,21 +1559,21 @@ const tt = (e) => {
|
|
|
1557
1559
|
"select",
|
|
1558
1560
|
{
|
|
1559
1561
|
"aria-label": ne,
|
|
1560
|
-
disabled:
|
|
1562
|
+
disabled: p,
|
|
1561
1563
|
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",
|
|
1562
1564
|
value: be ? nt : "",
|
|
1563
|
-
onChange: (f) => te(ue,
|
|
1565
|
+
onChange: (f) => te(ue, pe, Number(f.target.value)),
|
|
1564
1566
|
children: [
|
|
1565
|
-
be ? null : /* @__PURE__ */
|
|
1566
|
-
|
|
1567
|
+
be ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: $t, children: ur(nt) }),
|
|
1568
|
+
me.map((f) => /* @__PURE__ */ v("option", { value: f, className: "dark:bg-slate-700 dark:text-slate-100", children: ur(f) }, f))
|
|
1567
1569
|
]
|
|
1568
1570
|
}
|
|
1569
1571
|
)
|
|
1570
|
-
] }) : /* @__PURE__ */
|
|
1572
|
+
] }) : /* @__PURE__ */ v(
|
|
1571
1573
|
"input",
|
|
1572
1574
|
{
|
|
1573
1575
|
"aria-label": M,
|
|
1574
|
-
disabled:
|
|
1576
|
+
disabled: p,
|
|
1575
1577
|
className: "mx-1 my-auto w-28 rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-gray-900 text-xs 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",
|
|
1576
1578
|
value: dr,
|
|
1577
1579
|
min: E,
|
|
@@ -1580,21 +1582,21 @@ const tt = (e) => {
|
|
|
1580
1582
|
type: "date"
|
|
1581
1583
|
}
|
|
1582
1584
|
),
|
|
1583
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ v(
|
|
1584
1586
|
"button",
|
|
1585
1587
|
{
|
|
1586
1588
|
type: "button",
|
|
1587
1589
|
"aria-label": re,
|
|
1588
1590
|
disabled: we,
|
|
1589
1591
|
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",
|
|
1590
|
-
onClick:
|
|
1591
|
-
children: /* @__PURE__ */
|
|
1592
|
+
onClick: ye,
|
|
1593
|
+
children: /* @__PURE__ */ v("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" })
|
|
1592
1594
|
}
|
|
1593
1595
|
),
|
|
1594
1596
|
a
|
|
1595
1597
|
] });
|
|
1596
|
-
}, _t = (e) => e === void 0 ? null : tt(e).getTime(),
|
|
1597
|
-
|
|
1598
|
+
}, _t = (e) => e === void 0 ? null : tt(e).getTime(), so = sr(lo, (e, t) => !(_t(e.value ?? e.initialDate) !== _t(t.value ?? t.initialDate) || _t(e.minDate) !== _t(t.minDate) || _t(e.maxDate) !== _t(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));
|
|
1599
|
+
so.displayName = "DateSelector";
|
|
1598
1600
|
function Ge(e, t) {
|
|
1599
1601
|
const r = e + Math.floor(t / 12), n = (t % 12 + 12) % 12, a = new Date(r, n, 1);
|
|
1600
1602
|
return a.setFullYear(r), a;
|
|
@@ -1602,7 +1604,7 @@ function Ge(e, t) {
|
|
|
1602
1604
|
function yt(e) {
|
|
1603
1605
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`;
|
|
1604
1606
|
}
|
|
1605
|
-
function
|
|
1607
|
+
function Yr(e, t) {
|
|
1606
1608
|
if (e !== void 0 && (!(e instanceof Date) || Number.isNaN(e.getTime())))
|
|
1607
1609
|
throw new RangeError(`MonthSelector: \`${t}\` must be a valid Date, received ${String(e)}.`);
|
|
1608
1610
|
}
|
|
@@ -1610,7 +1612,7 @@ function _n(e, t) {
|
|
|
1610
1612
|
if (e !== void 0 && !Number.isInteger(e))
|
|
1611
1613
|
throw new RangeError(`MonthSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
|
|
1612
1614
|
}
|
|
1613
|
-
function
|
|
1615
|
+
function co(e) {
|
|
1614
1616
|
if (e !== void 0)
|
|
1615
1617
|
try {
|
|
1616
1618
|
Intl.DateTimeFormat.supportedLocalesOf([e]);
|
|
@@ -1618,24 +1620,24 @@ function so(e) {
|
|
|
1618
1620
|
throw new RangeError(`MonthSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`);
|
|
1619
1621
|
}
|
|
1620
1622
|
}
|
|
1621
|
-
function
|
|
1623
|
+
function uo(e, t) {
|
|
1622
1624
|
const r = e === void 0 ? null : Ge(e, 0), n = t === void 0 ? null : Ge(t.getFullYear(), t.getMonth());
|
|
1623
1625
|
return r !== null && n !== null ? r >= n ? r : n : r !== null ? r : n;
|
|
1624
1626
|
}
|
|
1625
|
-
function
|
|
1627
|
+
function mo(e, t) {
|
|
1626
1628
|
const r = e === void 0 ? null : Ge(e, 11), n = t === void 0 ? null : Ge(t.getFullYear(), t.getMonth());
|
|
1627
1629
|
return r !== null && n !== null ? r <= n ? r : n : r !== null ? r : n;
|
|
1628
1630
|
}
|
|
1629
1631
|
function Qn(e, t) {
|
|
1630
1632
|
return { label: _e("month", e, void 0, t), value: yt(e) };
|
|
1631
1633
|
}
|
|
1632
|
-
function
|
|
1634
|
+
function fo(e, t, r) {
|
|
1633
1635
|
const n = e.getFullYear() * 12 + e.getMonth(), a = t.getFullYear() * 12 + t.getMonth(), l = [];
|
|
1634
1636
|
for (let o = a; o >= n; o--)
|
|
1635
1637
|
l.push(Qn(Ge(Math.floor(o / 12), o % 12), r));
|
|
1636
1638
|
return l;
|
|
1637
1639
|
}
|
|
1638
|
-
const
|
|
1640
|
+
const ho = (e) => {
|
|
1639
1641
|
const {
|
|
1640
1642
|
value: t,
|
|
1641
1643
|
initialDate: r,
|
|
@@ -1646,66 +1648,66 @@ const fo = (e) => {
|
|
|
1646
1648
|
maxYear: c,
|
|
1647
1649
|
minDate: h,
|
|
1648
1650
|
maxDate: m,
|
|
1649
|
-
isWarning:
|
|
1650
|
-
className:
|
|
1651
|
+
isWarning: N = !1,
|
|
1652
|
+
className: x = "",
|
|
1651
1653
|
style: u,
|
|
1652
|
-
disabled:
|
|
1654
|
+
disabled: p = !1,
|
|
1653
1655
|
prevMonthAriaLabel: U = "Previous month",
|
|
1654
1656
|
nextMonthAriaLabel: re = "Next month",
|
|
1655
1657
|
selectAriaLabel: M = "Month",
|
|
1656
1658
|
locale: Q
|
|
1657
1659
|
} = e;
|
|
1658
|
-
|
|
1660
|
+
co(Q), Yr(t, "value"), Yr(r, "initialDate"), Yr(h, "minDate"), Yr(m, "maxDate"), _n(o, "minYear"), _n(c, "maxYear");
|
|
1659
1661
|
const I = t ?? r;
|
|
1660
1662
|
if (I === void 0)
|
|
1661
1663
|
throw new RangeError("MonthSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected month is never inferred from the wall clock.");
|
|
1662
|
-
const [ne, A] = xe(() => Ge(I.getFullYear(), I.getMonth())), B = t !== void 0, L =
|
|
1664
|
+
const [ne, A] = xe(() => Ge(I.getFullYear(), I.getMonth())), B = t !== void 0, L = P(() => t !== void 0 ? Ge(t.getFullYear(), t.getMonth()) : ne, [t?.getTime(), ne]), K = h?.getTime(), H = m?.getTime(), g = P(() => uo(o, h), [o, K]), R = P(() => mo(c, m), [c, H]);
|
|
1663
1665
|
if (g !== null && R !== null && g > R)
|
|
1664
1666
|
throw new RangeError(`MonthSelector: the resolved lower bound ${yt(g)} is after the resolved upper bound ${yt(R)}.`);
|
|
1665
1667
|
if (l === "dropdown" && (g === null || R === null))
|
|
1666
1668
|
throw new RangeError('MonthSelector: variant="dropdown" requires a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`); the option window is never invented.');
|
|
1667
|
-
const
|
|
1669
|
+
const k = g !== null && L < g || R !== null && L > R, F = I.getTime();
|
|
1668
1670
|
Lt(() => {
|
|
1669
1671
|
if (B) return;
|
|
1670
1672
|
const S = Ge(I.getFullYear(), I.getMonth());
|
|
1671
|
-
A((
|
|
1673
|
+
A((ye) => ye.getTime() === S.getTime() ? ye : S);
|
|
1672
1674
|
}, [B, F]);
|
|
1673
|
-
const
|
|
1674
|
-
if (
|
|
1675
|
-
if (
|
|
1675
|
+
const $ = (S) => (g === null || S >= g) && (R === null || S <= R), ae = (S) => {
|
|
1676
|
+
if (p) return;
|
|
1677
|
+
if (!$(S))
|
|
1676
1678
|
throw new RangeError(`MonthSelector: refusing to emit ${yt(S)}, which lies outside the declared bounds.`);
|
|
1677
1679
|
B || A(S);
|
|
1678
|
-
const
|
|
1679
|
-
n?.(S,
|
|
1680
|
-
},
|
|
1680
|
+
const ye = S.getFullYear() * 100 + (S.getMonth() + 1);
|
|
1681
|
+
n?.(S, ye);
|
|
1682
|
+
}, Se = P(() => {
|
|
1681
1683
|
const S = Ge(L.getFullYear(), L.getMonth() - 1);
|
|
1682
|
-
return
|
|
1683
|
-
}, [L, g?.getTime(), R?.getTime()]), ee =
|
|
1684
|
+
return $(S) ? S : null;
|
|
1685
|
+
}, [L, g?.getTime(), R?.getTime()]), ee = P(() => {
|
|
1684
1686
|
const S = Ge(L.getFullYear(), L.getMonth() + 1);
|
|
1685
|
-
return
|
|
1686
|
-
}, [L, g?.getTime(), R?.getTime()]), oe =
|
|
1687
|
-
|
|
1687
|
+
return $(S) ? S : null;
|
|
1688
|
+
}, [L, g?.getTime(), R?.getTime()]), oe = p || Se === null, se = p || ee === null, ge = () => {
|
|
1689
|
+
Se !== null && ae(Se);
|
|
1688
1690
|
}, J = () => {
|
|
1689
1691
|
ee !== null && ae(ee);
|
|
1690
1692
|
}, j = (S) => {
|
|
1691
1693
|
if (!S) return;
|
|
1692
|
-
const [
|
|
1694
|
+
const [ye, Be] = S.split("-"), rt = Number(ye), ue = Number(Be) - 1;
|
|
1693
1695
|
if (!(Number.isInteger(rt) && Number.isInteger(ue))) return;
|
|
1694
|
-
const
|
|
1695
|
-
|
|
1696
|
-
},
|
|
1696
|
+
const pe = Ge(rt, ue);
|
|
1697
|
+
$(pe) && ae(pe);
|
|
1698
|
+
}, ke = (S) => {
|
|
1697
1699
|
j(S.target.value);
|
|
1698
|
-
},
|
|
1700
|
+
}, pt = (S) => {
|
|
1699
1701
|
j(S.target.value);
|
|
1700
|
-
}, Fe = yt(L),
|
|
1702
|
+
}, Fe = yt(L), Ne = g ? yt(g) : void 0, be = R ? yt(R) : void 0, O = P(() => {
|
|
1701
1703
|
if (l !== "dropdown" || g === null || R === null) return [];
|
|
1702
|
-
const S =
|
|
1703
|
-
if (!
|
|
1704
|
-
const
|
|
1705
|
-
return [...S,
|
|
1706
|
-
}, [l, g?.getTime(), R?.getTime(),
|
|
1707
|
-
return /* @__PURE__ */ ce("div", { className: `inline-flex w-38 items-center ${
|
|
1708
|
-
/* @__PURE__ */
|
|
1704
|
+
const S = fo(g, R, Q);
|
|
1705
|
+
if (!k) return S;
|
|
1706
|
+
const ye = Qn(L, Q);
|
|
1707
|
+
return [...S, ye].sort((Be, rt) => rt.value.localeCompare(Be.value));
|
|
1708
|
+
}, [l, g?.getTime(), R?.getTime(), k, L, Q]), z = N ? "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", Z = `mx-1 my-auto w-28 rounded-md border py-0.5 px-1 text-xs dark:placeholder:text-gray-400 disabled:opacity-50 ${z}`, we = `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 ${z}`;
|
|
1709
|
+
return /* @__PURE__ */ ce("div", { className: `inline-flex w-38 items-center ${x}`, style: u, children: [
|
|
1710
|
+
/* @__PURE__ */ v(
|
|
1709
1711
|
"button",
|
|
1710
1712
|
{
|
|
1711
1713
|
type: "button",
|
|
@@ -1713,11 +1715,11 @@ const fo = (e) => {
|
|
|
1713
1715
|
disabled: oe,
|
|
1714
1716
|
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",
|
|
1715
1717
|
onClick: ge,
|
|
1716
|
-
children: /* @__PURE__ */
|
|
1718
|
+
children: /* @__PURE__ */ v("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" })
|
|
1717
1719
|
}
|
|
1718
1720
|
),
|
|
1719
|
-
l === "dropdown" ? /* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
+
l === "dropdown" ? /* @__PURE__ */ v("select", { "aria-label": M, disabled: p, className: we, value: Fe, onChange: pt, children: O.map((S) => /* @__PURE__ */ v("option", { value: S.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: S.label }, S.value)) }) : /* @__PURE__ */ v("input", { "aria-label": M, disabled: p, className: Z, value: Fe, min: Ne, max: be, onChange: ke, type: "month" }),
|
|
1722
|
+
/* @__PURE__ */ v(
|
|
1721
1723
|
"button",
|
|
1722
1724
|
{
|
|
1723
1725
|
type: "button",
|
|
@@ -1725,12 +1727,12 @@ const fo = (e) => {
|
|
|
1725
1727
|
disabled: se,
|
|
1726
1728
|
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",
|
|
1727
1729
|
onClick: J,
|
|
1728
|
-
children: /* @__PURE__ */
|
|
1730
|
+
children: /* @__PURE__ */ v("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" })
|
|
1729
1731
|
}
|
|
1730
1732
|
),
|
|
1731
1733
|
a
|
|
1732
1734
|
] });
|
|
1733
|
-
},
|
|
1735
|
+
}, go = sr(ho, (e, t) => {
|
|
1734
1736
|
const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, a = r ? r.getFullYear() * 12 + r.getMonth() : null, l = n ? n.getFullYear() * 12 + n.getMonth() : null;
|
|
1735
1737
|
if (a !== l || 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;
|
|
1736
1738
|
const o = e.minDate ? e.minDate.getFullYear() * 12 + e.minDate.getMonth() : null, c = t.minDate ? t.minDate.getFullYear() * 12 + t.minDate.getMonth() : null;
|
|
@@ -1738,7 +1740,7 @@ const fo = (e) => {
|
|
|
1738
1740
|
const h = e.maxDate ? e.maxDate.getFullYear() * 12 + e.maxDate.getMonth() : null, m = t.maxDate ? t.maxDate.getFullYear() * 12 + t.maxDate.getMonth() : null;
|
|
1739
1741
|
return !(h !== m || e.onChange !== t.onChange || e.children !== t.children || e.prevMonthAriaLabel !== t.prevMonthAriaLabel || e.nextMonthAriaLabel !== t.nextMonthAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.locale !== t.locale);
|
|
1740
1742
|
});
|
|
1741
|
-
|
|
1743
|
+
go.displayName = "MonthSelector";
|
|
1742
1744
|
function lr(e, t, r) {
|
|
1743
1745
|
if (!(r instanceof Date) || Number.isNaN(r.getTime()))
|
|
1744
1746
|
throw new RangeError(`${e}: ${t} is required and must be a valid Date (received: ${String(r)})`);
|
|
@@ -1763,8 +1765,8 @@ function nn(e, t, r, n, a, l) {
|
|
|
1763
1765
|
function Xe(e, t, r) {
|
|
1764
1766
|
return e < t ? t : e > r ? r : e;
|
|
1765
1767
|
}
|
|
1766
|
-
function
|
|
1767
|
-
const a =
|
|
1768
|
+
function kr(e, t, r, n) {
|
|
1769
|
+
const a = vt(t, r, n[1]);
|
|
1768
1770
|
return [Xe(e[0], n[0], a), Xe(e[1], n[0], a)];
|
|
1769
1771
|
}
|
|
1770
1772
|
function an(e, t, r, n) {
|
|
@@ -1778,29 +1780,29 @@ function sn(e) {
|
|
|
1778
1780
|
function xo(e) {
|
|
1779
1781
|
const { unit: t, minDate: r, maxDate: n, initialRange: a, onChangeRange: l, ...o } = e;
|
|
1780
1782
|
ln("usePeriodSliderRange", r, n), tn("usePeriodSliderRange", "initialRange", a), nn("usePeriodSliderRange", "initialRange", a, r, n, "[minDate, maxDate]");
|
|
1781
|
-
const c = sn(o), h = G(a), [m,
|
|
1782
|
-
let
|
|
1783
|
+
const c = sn(o), h = G(a), [m, N] = xe(a);
|
|
1784
|
+
let x = m;
|
|
1783
1785
|
const u = [Xe(m[0], r, n), Xe(m[1], r, n)];
|
|
1784
|
-
(u[0] !== m[0] || u[1] !== m[1]) && (
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1786
|
+
(u[0] !== m[0] || u[1] !== m[1]) && (x = u, N(u));
|
|
1787
|
+
const p = G(x);
|
|
1788
|
+
p.current = x;
|
|
1787
1789
|
const U = G({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
|
|
1788
1790
|
U.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
|
|
1789
1791
|
const re = G(l);
|
|
1790
1792
|
re.current = l;
|
|
1791
1793
|
const M = X((g) => {
|
|
1792
|
-
const { minDate: R, maxDate:
|
|
1793
|
-
F.getTime() === ae[0].getTime() &&
|
|
1794
|
+
const { minDate: R, maxDate: k } = U.current, F = Xe(g[0], R, k), $ = Xe(g[1], R, k), ae = p.current;
|
|
1795
|
+
F.getTime() === ae[0].getTime() && $.getTime() === ae[1].getTime() || (p.current = [F, $], N([F, $]), re.current?.(F, $));
|
|
1794
1796
|
}, []), Q = X(
|
|
1795
1797
|
(g) => {
|
|
1796
|
-
const R =
|
|
1797
|
-
M([g,
|
|
1798
|
+
const R = p.current, k = g.getTime() > R[1].getTime() ? g : R[1];
|
|
1799
|
+
M([g, k]);
|
|
1798
1800
|
},
|
|
1799
1801
|
[M]
|
|
1800
1802
|
), I = X(
|
|
1801
1803
|
(g) => {
|
|
1802
|
-
const R =
|
|
1803
|
-
M([
|
|
1804
|
+
const R = p.current, k = g.getTime() < R[0].getTime() ? g : R[0];
|
|
1805
|
+
M([k, g]);
|
|
1804
1806
|
},
|
|
1805
1807
|
[M]
|
|
1806
1808
|
), ne = X(
|
|
@@ -1810,51 +1812,51 @@ function xo(e) {
|
|
|
1810
1812
|
[M]
|
|
1811
1813
|
), A = X(
|
|
1812
1814
|
(g) => {
|
|
1813
|
-
const { minDate: R, maxDate:
|
|
1815
|
+
const { minDate: R, maxDate: k, allowedDates: F } = U.current, $ = p.current, ae = ir(F, t, R, k);
|
|
1814
1816
|
if (ae.length > 0) {
|
|
1815
|
-
M([an(ae, t,
|
|
1817
|
+
M([an(ae, t, $[0], g), an(ae, t, $[1], g)]);
|
|
1816
1818
|
return;
|
|
1817
1819
|
}
|
|
1818
|
-
M([Ue(t,
|
|
1820
|
+
M([Ue(t, $[0], g), Ue(t, $[1], g)]);
|
|
1819
1821
|
},
|
|
1820
1822
|
[t, M]
|
|
1821
1823
|
), B = X(() => {
|
|
1822
1824
|
M(h.current);
|
|
1823
|
-
}, [M]), L =
|
|
1825
|
+
}, [M]), L = P(
|
|
1824
1826
|
() => ({
|
|
1825
|
-
value:
|
|
1827
|
+
value: x[0],
|
|
1826
1828
|
onChange: Q,
|
|
1827
1829
|
minDate: r,
|
|
1828
|
-
maxDate:
|
|
1830
|
+
maxDate: x[1],
|
|
1829
1831
|
unit: t
|
|
1830
1832
|
}),
|
|
1831
|
-
[
|
|
1832
|
-
), K =
|
|
1833
|
+
[x[0], x[1], Q, r, t]
|
|
1834
|
+
), K = P(
|
|
1833
1835
|
() => ({
|
|
1834
|
-
value:
|
|
1836
|
+
value: x[1],
|
|
1835
1837
|
onChange: I,
|
|
1836
|
-
minDate:
|
|
1838
|
+
minDate: x[0],
|
|
1837
1839
|
maxDate: n,
|
|
1838
1840
|
unit: t
|
|
1839
1841
|
}),
|
|
1840
|
-
[
|
|
1841
|
-
), H =
|
|
1842
|
+
[x[0], x[1], I, n, t]
|
|
1843
|
+
), H = P(
|
|
1842
1844
|
() => ({
|
|
1843
1845
|
...c,
|
|
1844
1846
|
mode: "range",
|
|
1845
1847
|
unit: t,
|
|
1846
|
-
range:
|
|
1848
|
+
range: x,
|
|
1847
1849
|
minDate: r,
|
|
1848
1850
|
maxDate: n,
|
|
1849
1851
|
onChangeRange: ne
|
|
1850
1852
|
}),
|
|
1851
|
-
[c, t,
|
|
1853
|
+
[c, t, x, r, n, ne]
|
|
1852
1854
|
);
|
|
1853
1855
|
return {
|
|
1854
|
-
range:
|
|
1855
|
-
lowerDate:
|
|
1856
|
-
upperDate:
|
|
1857
|
-
setRange:
|
|
1856
|
+
range: x,
|
|
1857
|
+
lowerDate: x[0],
|
|
1858
|
+
upperDate: x[1],
|
|
1859
|
+
setRange: N,
|
|
1858
1860
|
setLowerDate: Q,
|
|
1859
1861
|
setUpperDate: I,
|
|
1860
1862
|
shiftRange: A,
|
|
@@ -1864,73 +1866,73 @@ function xo(e) {
|
|
|
1864
1866
|
sliderProps: H
|
|
1865
1867
|
};
|
|
1866
1868
|
}
|
|
1867
|
-
function
|
|
1869
|
+
function yo(e) {
|
|
1868
1870
|
const { unit: t, minDate: r, maxDate: n, initialValue: a, onChangePoint: l, ...o } = e;
|
|
1869
1871
|
ln("usePeriodSliderPoint", r, n), lr("usePeriodSliderPoint", "initialValue", a), rn("usePeriodSliderPoint", "initialValue", a, r, n, "[minDate, maxDate]");
|
|
1870
|
-
const c = sn(o), h = G(a), [m,
|
|
1871
|
-
let
|
|
1872
|
+
const c = sn(o), h = G(a), [m, N] = xe(a);
|
|
1873
|
+
let x = m;
|
|
1872
1874
|
const u = Xe(m, r, n);
|
|
1873
|
-
u !== m && (
|
|
1874
|
-
const
|
|
1875
|
-
|
|
1875
|
+
u !== m && (x = u, N(u));
|
|
1876
|
+
const p = G(x);
|
|
1877
|
+
p.current = x;
|
|
1876
1878
|
const U = G({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
|
|
1877
1879
|
U.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
|
|
1878
1880
|
const re = G(l);
|
|
1879
1881
|
re.current = l;
|
|
1880
1882
|
const M = X((B) => {
|
|
1881
1883
|
const { minDate: L, maxDate: K } = U.current, H = Xe(B, L, K);
|
|
1882
|
-
H.getTime() !==
|
|
1884
|
+
H.getTime() !== p.current.getTime() && (p.current = H, N(H), re.current?.(H));
|
|
1883
1885
|
}, []), Q = X(
|
|
1884
1886
|
(B) => {
|
|
1885
1887
|
const { minDate: L, maxDate: K, allowedDates: H } = U.current, g = ir(H, t, L, K);
|
|
1886
1888
|
if (g.length > 0) {
|
|
1887
|
-
M(an(g, t,
|
|
1889
|
+
M(an(g, t, p.current, B));
|
|
1888
1890
|
return;
|
|
1889
1891
|
}
|
|
1890
|
-
M(Ue(t,
|
|
1892
|
+
M(Ue(t, p.current, B));
|
|
1891
1893
|
},
|
|
1892
1894
|
[t, M]
|
|
1893
1895
|
), I = X(() => {
|
|
1894
1896
|
M(h.current);
|
|
1895
|
-
}, [M]), ne =
|
|
1897
|
+
}, [M]), ne = P(
|
|
1896
1898
|
() => ({
|
|
1897
|
-
value:
|
|
1899
|
+
value: x,
|
|
1898
1900
|
onChange: M,
|
|
1899
1901
|
minDate: r,
|
|
1900
1902
|
maxDate: n,
|
|
1901
1903
|
unit: t
|
|
1902
1904
|
}),
|
|
1903
|
-
[
|
|
1904
|
-
), A =
|
|
1905
|
+
[x, M, r, n, t]
|
|
1906
|
+
), A = P(
|
|
1905
1907
|
() => ({
|
|
1906
1908
|
...c,
|
|
1907
1909
|
mode: "point",
|
|
1908
1910
|
unit: t,
|
|
1909
|
-
value:
|
|
1911
|
+
value: x,
|
|
1910
1912
|
minDate: r,
|
|
1911
1913
|
maxDate: n,
|
|
1912
1914
|
onChangePoint: M
|
|
1913
1915
|
}),
|
|
1914
|
-
[c, t,
|
|
1916
|
+
[c, t, x, r, n, M]
|
|
1915
1917
|
);
|
|
1916
1918
|
return {
|
|
1917
|
-
value:
|
|
1918
|
-
setValue:
|
|
1919
|
+
value: x,
|
|
1920
|
+
setValue: N,
|
|
1919
1921
|
shiftValue: Q,
|
|
1920
1922
|
resetValue: I,
|
|
1921
1923
|
selectorProps: ne,
|
|
1922
1924
|
sliderProps: A
|
|
1923
1925
|
};
|
|
1924
1926
|
}
|
|
1925
|
-
function
|
|
1926
|
-
const { unit: t, minDate: r, maxDate: n, initialMacroRange: a, initialMicroRange: l, macroUnit: o = t, microUnit: c = t, onChangeMacroRange: h, onChangeMicroRange: m, ...
|
|
1927
|
-
ln("useVernierSlider", r, n), tn("useVernierSlider", "initialMacroRange", a), tn("useVernierSlider", "initialMicroRange", l), nn("useVernierSlider", "initialMacroRange", a, r, n, "[minDate, maxDate]"), nn("useVernierSlider", "initialMicroRange", l, a[0],
|
|
1928
|
-
const
|
|
1927
|
+
function To(e) {
|
|
1928
|
+
const { unit: t, minDate: r, maxDate: n, initialMacroRange: a, initialMicroRange: l, macroUnit: o = t, microUnit: c = t, onChangeMacroRange: h, onChangeMicroRange: m, ...N } = e;
|
|
1929
|
+
ln("useVernierSlider", r, n), tn("useVernierSlider", "initialMacroRange", a), tn("useVernierSlider", "initialMicroRange", l), nn("useVernierSlider", "initialMacroRange", a, r, n, "[minDate, maxDate]"), nn("useVernierSlider", "initialMicroRange", l, a[0], vt(o, c, a[1]), "the initial macro window");
|
|
1930
|
+
const x = sn(N), u = G(a), p = G(l), [U, re] = xe(a), [M, Q] = xe(l);
|
|
1929
1931
|
let I = U;
|
|
1930
1932
|
const ne = [Xe(U[0], r, n), Xe(U[1], r, n)];
|
|
1931
1933
|
(ne[0] !== U[0] || ne[1] !== U[1]) && (I = ne, re(ne));
|
|
1932
1934
|
let A = M;
|
|
1933
|
-
const B =
|
|
1935
|
+
const B = kr(M, o, c, I);
|
|
1934
1936
|
(B[0] !== M[0] || B[1] !== M[1]) && (A = B, Q(B));
|
|
1935
1937
|
const L = G(I);
|
|
1936
1938
|
L.current = I;
|
|
@@ -1942,27 +1944,27 @@ function yo(e) {
|
|
|
1942
1944
|
g.current = h;
|
|
1943
1945
|
const R = G(m);
|
|
1944
1946
|
R.current = m;
|
|
1945
|
-
const
|
|
1947
|
+
const k = X((O, z) => {
|
|
1946
1948
|
const Z = L.current, we = K.current;
|
|
1947
1949
|
(O[0].getTime() !== Z[0].getTime() || O[1].getTime() !== Z[1].getTime()) && (L.current = O, re(O), g.current?.(O[0], O[1])), (z[0].getTime() !== we[0].getTime() || z[1].getTime() !== we[1].getTime()) && (K.current = z, Q(z), R.current?.(z[0], z[1]));
|
|
1948
1950
|
}, []), F = X(
|
|
1949
1951
|
(O, z) => {
|
|
1950
1952
|
const { minDate: Z, maxDate: we } = H.current, S = [Xe(O, Z, we), Xe(z, Z, we)];
|
|
1951
|
-
|
|
1953
|
+
k(S, kr(K.current, o, c, S));
|
|
1952
1954
|
},
|
|
1953
|
-
[o, c,
|
|
1954
|
-
),
|
|
1955
|
+
[o, c, k]
|
|
1956
|
+
), $ = X(
|
|
1955
1957
|
(O, z) => {
|
|
1956
|
-
|
|
1958
|
+
k(L.current, kr([O, z], o, c, L.current));
|
|
1957
1959
|
},
|
|
1958
|
-
[o, c,
|
|
1960
|
+
[o, c, k]
|
|
1959
1961
|
), ae = X(
|
|
1960
1962
|
(O) => {
|
|
1961
1963
|
const z = L.current[1], Z = O > z ? O : z;
|
|
1962
1964
|
F(O, Z);
|
|
1963
1965
|
},
|
|
1964
1966
|
[F]
|
|
1965
|
-
),
|
|
1967
|
+
), Se = X(
|
|
1966
1968
|
(O) => {
|
|
1967
1969
|
const z = L.current[0], Z = O < z ? O : z;
|
|
1968
1970
|
F(Z, O);
|
|
@@ -1971,31 +1973,31 @@ function yo(e) {
|
|
|
1971
1973
|
), ee = X(
|
|
1972
1974
|
(O) => {
|
|
1973
1975
|
const z = K.current[1], Z = O > z ? O : z;
|
|
1974
|
-
|
|
1976
|
+
$(O, Z);
|
|
1975
1977
|
},
|
|
1976
|
-
[
|
|
1978
|
+
[$]
|
|
1977
1979
|
), oe = X(
|
|
1978
1980
|
(O) => {
|
|
1979
1981
|
const z = K.current[0], Z = O < z ? O : z;
|
|
1980
|
-
|
|
1982
|
+
$(Z, O);
|
|
1981
1983
|
},
|
|
1982
|
-
[
|
|
1984
|
+
[$]
|
|
1983
1985
|
), se = X(
|
|
1984
1986
|
(O) => {
|
|
1985
|
-
const { minDate: z, maxDate: Z } = H.current, we = L.current, S = Ue(o, we[0], O),
|
|
1986
|
-
S < z ||
|
|
1987
|
+
const { minDate: z, maxDate: Z } = H.current, we = L.current, S = Ue(o, we[0], O), ye = Ue(o, we[1], O);
|
|
1988
|
+
S < z || ye > Z || F(S, ye);
|
|
1987
1989
|
},
|
|
1988
1990
|
[o, F]
|
|
1989
1991
|
), ge = X(
|
|
1990
1992
|
(O) => {
|
|
1991
1993
|
const z = L.current, Z = K.current, we = Ue(c, Z[0], O), S = Ue(c, Z[1], O);
|
|
1992
|
-
we < z[0] || S >
|
|
1994
|
+
we < z[0] || S > vt(o, c, z[1]) || $(we, S);
|
|
1993
1995
|
},
|
|
1994
|
-
[o, c,
|
|
1996
|
+
[o, c, $]
|
|
1995
1997
|
), J = X(() => {
|
|
1996
1998
|
const O = u.current;
|
|
1997
|
-
|
|
1998
|
-
}, [o, c,
|
|
1999
|
+
k(O, kr(p.current, o, c, O));
|
|
2000
|
+
}, [o, c, k]), j = P(() => vt(o, c, I[1]), [o, c, I[1]]), ke = P(
|
|
1999
2001
|
() => ({
|
|
2000
2002
|
value: I[0],
|
|
2001
2003
|
onChange: ae,
|
|
@@ -2004,16 +2006,16 @@ function yo(e) {
|
|
|
2004
2006
|
unit: o
|
|
2005
2007
|
}),
|
|
2006
2008
|
[I, ae, r, o]
|
|
2007
|
-
),
|
|
2009
|
+
), pt = P(
|
|
2008
2010
|
() => ({
|
|
2009
2011
|
value: I[1],
|
|
2010
|
-
onChange:
|
|
2012
|
+
onChange: Se,
|
|
2011
2013
|
minDate: I[0],
|
|
2012
2014
|
maxDate: n,
|
|
2013
2015
|
unit: o
|
|
2014
2016
|
}),
|
|
2015
|
-
[I,
|
|
2016
|
-
), Fe =
|
|
2017
|
+
[I, Se, n, o]
|
|
2018
|
+
), Fe = P(
|
|
2017
2019
|
() => ({
|
|
2018
2020
|
value: A[0],
|
|
2019
2021
|
onChange: ee,
|
|
@@ -2022,7 +2024,7 @@ function yo(e) {
|
|
|
2022
2024
|
unit: c
|
|
2023
2025
|
}),
|
|
2024
2026
|
[A, ee, I, c]
|
|
2025
|
-
),
|
|
2027
|
+
), Ne = P(
|
|
2026
2028
|
() => ({
|
|
2027
2029
|
value: A[1],
|
|
2028
2030
|
onChange: oe,
|
|
@@ -2031,9 +2033,9 @@ function yo(e) {
|
|
|
2031
2033
|
unit: c
|
|
2032
2034
|
}),
|
|
2033
2035
|
[A, oe, j, c]
|
|
2034
|
-
), be =
|
|
2036
|
+
), be = P(
|
|
2035
2037
|
() => ({
|
|
2036
|
-
...
|
|
2038
|
+
...x,
|
|
2037
2039
|
mode: "vernier",
|
|
2038
2040
|
unit: t,
|
|
2039
2041
|
macroUnit: o,
|
|
@@ -2043,9 +2045,9 @@ function yo(e) {
|
|
|
2043
2045
|
macroRange: I,
|
|
2044
2046
|
microRange: A,
|
|
2045
2047
|
onChangeMacroRange: F,
|
|
2046
|
-
onChangeMicroRange:
|
|
2048
|
+
onChangeMicroRange: $
|
|
2047
2049
|
}),
|
|
2048
|
-
[
|
|
2050
|
+
[x, t, o, c, r, n, I, A, F, $]
|
|
2049
2051
|
);
|
|
2050
2052
|
return {
|
|
2051
2053
|
macroRange: I,
|
|
@@ -2053,16 +2055,16 @@ function yo(e) {
|
|
|
2053
2055
|
microRange: A,
|
|
2054
2056
|
setMicroRange: Q,
|
|
2055
2057
|
setMacroLowerDate: ae,
|
|
2056
|
-
setMacroUpperDate:
|
|
2058
|
+
setMacroUpperDate: Se,
|
|
2057
2059
|
setMicroLowerDate: ee,
|
|
2058
2060
|
setMicroUpperDate: oe,
|
|
2059
2061
|
shiftMacroRange: se,
|
|
2060
2062
|
shiftMicroRange: ge,
|
|
2061
2063
|
resetVernier: J,
|
|
2062
|
-
macroStartSelectorProps:
|
|
2063
|
-
macroEndSelectorProps:
|
|
2064
|
+
macroStartSelectorProps: ke,
|
|
2065
|
+
macroEndSelectorProps: pt,
|
|
2064
2066
|
microStartSelectorProps: Fe,
|
|
2065
|
-
microEndSelectorProps:
|
|
2067
|
+
microEndSelectorProps: Ne,
|
|
2066
2068
|
sliderProps: be
|
|
2067
2069
|
};
|
|
2068
2070
|
}
|
|
@@ -2078,7 +2080,7 @@ function Kn(e, t) {
|
|
|
2078
2080
|
if (e !== void 0 && !Number.isInteger(e))
|
|
2079
2081
|
throw new RangeError(`YearSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
|
|
2080
2082
|
}
|
|
2081
|
-
function
|
|
2083
|
+
function bo(e) {
|
|
2082
2084
|
if (e !== void 0)
|
|
2083
2085
|
try {
|
|
2084
2086
|
Intl.DateTimeFormat.supportedLocalesOf([e]);
|
|
@@ -2090,13 +2092,13 @@ function qn(e, t, r) {
|
|
|
2090
2092
|
const n = e === void 0 ? null : e, a = t === void 0 ? null : t.getFullYear();
|
|
2091
2093
|
return n !== null && a !== null ? r(n, a) : n !== null ? n : a;
|
|
2092
2094
|
}
|
|
2093
|
-
const
|
|
2094
|
-
const { value: t, initialDate: r, onChange: n, children: a, minYear: l, maxYear: o, minDate: c, maxDate: h, className: m = "", style:
|
|
2095
|
-
Ar(t, "value"), Ar(r, "initialDate"), Ar(c, "minDate"), Ar(h, "maxDate"), Kn(l, "minYear"), Kn(o, "maxYear"),
|
|
2095
|
+
const wo = (e) => {
|
|
2096
|
+
const { value: t, initialDate: r, onChange: n, children: a, minYear: l, maxYear: o, minDate: c, maxDate: h, className: m = "", style: N, disabled: x = !1, prevYearAriaLabel: u = "Previous year", nextYearAriaLabel: p = "Next year", selectAriaLabel: U = "Year", locale: re } = e;
|
|
2097
|
+
Ar(t, "value"), Ar(r, "initialDate"), Ar(c, "minDate"), Ar(h, "maxDate"), Kn(l, "minYear"), Kn(o, "maxYear"), bo(re);
|
|
2096
2098
|
const M = t ?? r;
|
|
2097
2099
|
if (M === void 0)
|
|
2098
2100
|
throw new RangeError("YearSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected year is never inferred from the wall clock.");
|
|
2099
|
-
const [Q, I] = xe(() => M.getFullYear()), ne = c?.getTime(), A = h?.getTime(), B =
|
|
2101
|
+
const [Q, I] = xe(() => M.getFullYear()), ne = c?.getTime(), A = h?.getTime(), B = P(() => qn(l, c, Math.max), [l, ne]), L = P(() => qn(o, h, Math.min), [o, A]);
|
|
2100
2102
|
if (B === null || L === null)
|
|
2101
2103
|
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.");
|
|
2102
2104
|
if (B > L)
|
|
@@ -2105,39 +2107,39 @@ const bo = (e) => {
|
|
|
2105
2107
|
Lt(() => {
|
|
2106
2108
|
K || I(M.getFullYear());
|
|
2107
2109
|
}, [K, R]);
|
|
2108
|
-
const
|
|
2109
|
-
if (!
|
|
2110
|
-
if (!
|
|
2110
|
+
const k = (J) => J >= B && J <= L, F = (J) => {
|
|
2111
|
+
if (!x) {
|
|
2112
|
+
if (!k(J))
|
|
2111
2113
|
throw new RangeError(`YearSelector: refusing to emit ${J}, which lies outside the declared bounds ${B}-${L}.`);
|
|
2112
2114
|
K || I(J), n?.(Xn(J), J);
|
|
2113
2115
|
}
|
|
2114
|
-
},
|
|
2115
|
-
|
|
2116
|
+
}, $ = k(H - 1) ? H - 1 : null, ae = k(H + 1) ? H + 1 : null, Se = x || $ === null, ee = x || ae === null, oe = () => {
|
|
2117
|
+
$ !== null && F($);
|
|
2116
2118
|
}, se = () => {
|
|
2117
2119
|
ae !== null && F(ae);
|
|
2118
|
-
}, ge =
|
|
2120
|
+
}, ge = P(() => {
|
|
2119
2121
|
const J = [];
|
|
2120
2122
|
for (let j = L; j >= B; j--)
|
|
2121
2123
|
J.push(j);
|
|
2122
|
-
return g && (J.push(H), J.sort((j,
|
|
2124
|
+
return g && (J.push(H), J.sort((j, ke) => ke - j)), J;
|
|
2123
2125
|
}, [B, L, g, H]);
|
|
2124
|
-
return /* @__PURE__ */ ce("div", { className: `inline-flex w-32 items-center ${m}`, style:
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ ce("div", { className: `inline-flex w-32 items-center ${m}`, style: N, children: [
|
|
2127
|
+
/* @__PURE__ */ v(
|
|
2126
2128
|
"button",
|
|
2127
2129
|
{
|
|
2128
2130
|
type: "button",
|
|
2129
2131
|
"aria-label": u,
|
|
2130
|
-
disabled:
|
|
2132
|
+
disabled: Se,
|
|
2131
2133
|
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",
|
|
2132
2134
|
onClick: oe,
|
|
2133
|
-
children: /* @__PURE__ */
|
|
2135
|
+
children: /* @__PURE__ */ v("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" })
|
|
2134
2136
|
}
|
|
2135
2137
|
),
|
|
2136
|
-
/* @__PURE__ */
|
|
2138
|
+
/* @__PURE__ */ v(
|
|
2137
2139
|
"select",
|
|
2138
2140
|
{
|
|
2139
2141
|
"aria-label": U,
|
|
2140
|
-
disabled:
|
|
2142
|
+
disabled: x,
|
|
2141
2143
|
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",
|
|
2142
2144
|
value: H,
|
|
2143
2145
|
onChange: (J) => {
|
|
@@ -2145,52 +2147,52 @@ const bo = (e) => {
|
|
|
2145
2147
|
const j = Number(J.target.value);
|
|
2146
2148
|
Number.isInteger(j) && F(j);
|
|
2147
2149
|
},
|
|
2148
|
-
children: ge.map((J) => /* @__PURE__ */
|
|
2150
|
+
children: ge.map((J) => /* @__PURE__ */ v("option", { value: J, 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: _e("year", Xn(J), void 0, re) }, J))
|
|
2149
2151
|
}
|
|
2150
2152
|
),
|
|
2151
|
-
/* @__PURE__ */
|
|
2153
|
+
/* @__PURE__ */ v(
|
|
2152
2154
|
"button",
|
|
2153
2155
|
{
|
|
2154
2156
|
type: "button",
|
|
2155
|
-
"aria-label":
|
|
2157
|
+
"aria-label": p,
|
|
2156
2158
|
disabled: ee,
|
|
2157
2159
|
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
2160
|
onClick: se,
|
|
2159
|
-
children: /* @__PURE__ */
|
|
2161
|
+
children: /* @__PURE__ */ v("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" })
|
|
2160
2162
|
}
|
|
2161
2163
|
),
|
|
2162
2164
|
a
|
|
2163
2165
|
] });
|
|
2164
|
-
},
|
|
2166
|
+
}, vo = sr(wo, (e, t) => {
|
|
2165
2167
|
const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, a = r ? r.getFullYear() : null, l = n ? n.getFullYear() : null;
|
|
2166
2168
|
return !(a !== l || 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);
|
|
2167
2169
|
});
|
|
2168
|
-
|
|
2170
|
+
vo.displayName = "YearSelector";
|
|
2169
2171
|
export {
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2172
|
+
Na as COLOR_SCHEME_PALETTES,
|
|
2173
|
+
so as DateSelector,
|
|
2174
|
+
go as MonthSelector,
|
|
2175
|
+
Za as PeriodSlider,
|
|
2176
|
+
vo as YearSelector,
|
|
2175
2177
|
Ue as addUnit,
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
+
Ga as areStylesEqual,
|
|
2179
|
+
Ca as calculateConnectDragValues,
|
|
2178
2180
|
On as calculateHandleDragValues,
|
|
2179
|
-
|
|
2181
|
+
Ia as calculateKeyboardActionValues,
|
|
2180
2182
|
Jn as calculateLabelSlant,
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
+
Va as calculateVernierMacroDrag,
|
|
2184
|
+
Ua as calculateVernierMicroDrag,
|
|
2183
2185
|
le as decode,
|
|
2184
2186
|
W as encode,
|
|
2185
2187
|
Pe as findNearestDateIndex,
|
|
2186
2188
|
_e as formatLabel,
|
|
2187
2189
|
Bt as formatScreenReaderLabel,
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
+
Ea as getActiveDragHandle,
|
|
2191
|
+
vt as getMacroWindowEndDate,
|
|
2190
2192
|
ir as getSortedAllowedDates,
|
|
2191
2193
|
et as normalizeDateByUnit,
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
+
Fa as resolveVernierTargetHandle,
|
|
2195
|
+
yo as usePeriodSliderPoint,
|
|
2194
2196
|
xo as usePeriodSliderRange,
|
|
2195
|
-
|
|
2197
|
+
To as useVernierSlider
|
|
2196
2198
|
};
|