@mngh/jalali-datepicker 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/JalaliDatePicker.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +443 -420
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import e, { createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
2
2
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal as d } from "react-dom";
|
|
3
4
|
//#region src/core/constants.ts
|
|
4
|
-
var
|
|
5
|
+
var f = [
|
|
5
6
|
"فروردین",
|
|
6
7
|
"اردیبهشت",
|
|
7
8
|
"خرداد",
|
|
@@ -14,7 +15,7 @@ var d = [
|
|
|
14
15
|
"دی",
|
|
15
16
|
"بهمن",
|
|
16
17
|
"اسفند"
|
|
17
|
-
],
|
|
18
|
+
], p = [
|
|
18
19
|
"Farvardin",
|
|
19
20
|
"Ordibehesht",
|
|
20
21
|
"Khordad",
|
|
@@ -27,7 +28,7 @@ var d = [
|
|
|
27
28
|
"Dey",
|
|
28
29
|
"Bahman",
|
|
29
30
|
"Esfand"
|
|
30
|
-
],
|
|
31
|
+
], m = [
|
|
31
32
|
"ش",
|
|
32
33
|
"ی",
|
|
33
34
|
"د",
|
|
@@ -35,7 +36,7 @@ var d = [
|
|
|
35
36
|
"چ",
|
|
36
37
|
"پ",
|
|
37
38
|
"ج"
|
|
38
|
-
],
|
|
39
|
+
], h = [
|
|
39
40
|
"شنبه",
|
|
40
41
|
"یکشنبه",
|
|
41
42
|
"دوشنبه",
|
|
@@ -46,7 +47,7 @@ var d = [
|
|
|
46
47
|
];
|
|
47
48
|
//#endregion
|
|
48
49
|
//#region src/core/jalali-math.ts
|
|
49
|
-
function
|
|
50
|
+
function g(e) {
|
|
50
51
|
let t = [
|
|
51
52
|
-61,
|
|
52
53
|
9,
|
|
@@ -80,11 +81,11 @@ function h(e) {
|
|
|
80
81
|
let a = (i + 1) % 33 - 1;
|
|
81
82
|
return a === -1 && (a = 4), a % 4 == 0;
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function _(e, t) {
|
|
84
85
|
if (t < 0 || t > 11) throw RangeError("Month index must be between 0 (Farvardin) and 11 (Esfand).");
|
|
85
|
-
return t <= 5 ? 31 : t <= 10 ||
|
|
86
|
+
return t <= 5 ? 31 : t <= 10 || g(e) ? 30 : 29;
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function v(e, t, n) {
|
|
88
89
|
let r = [
|
|
89
90
|
0,
|
|
90
91
|
31,
|
|
@@ -107,7 +108,7 @@ function _(e, t, n) {
|
|
|
107
108
|
day: o
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function y(e, t, n) {
|
|
111
112
|
let r, i, a, o = e + 1595, s = -355668 + 365 * o + Math.floor(o / 33) * 8 + Math.floor((o % 33 + 3) / 4) + n + (t < 6 ? t * 31 : (t - 6) * 30 + 186);
|
|
112
113
|
r = 400 * Math.floor(s / 146097), s %= 146097, s > 36524 && (r += 100 * Math.floor(--s / 36524), s %= 36524, s >= 365 && s++), r += 4 * Math.floor(s / 1461), s %= 1461, s > 365 && (r += Math.floor((s - 1) / 365), s = (s - 1) % 365), a = s + 1;
|
|
113
114
|
let c = [
|
|
@@ -129,30 +130,30 @@ function v(e, t, n) {
|
|
|
129
130
|
let l = new Date(r, i - 1, a);
|
|
130
131
|
return l.setHours(0, 0, 0, 0), l;
|
|
131
132
|
}
|
|
132
|
-
function
|
|
133
|
+
function b() {
|
|
133
134
|
let e = /* @__PURE__ */ new Date();
|
|
134
|
-
return
|
|
135
|
+
return v(e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
+
function x(e, t) {
|
|
137
138
|
return !e || !t ? !1 : e.year === t.year && e.month === t.month && e.day === t.day;
|
|
138
139
|
}
|
|
139
140
|
//#endregion
|
|
140
141
|
//#region src/core/calendar-grid.ts
|
|
141
|
-
function x(e) {
|
|
142
|
-
return e instanceof Date ? _(e.getFullYear(), e.getMonth() + 1, e.getDate()) : e;
|
|
143
|
-
}
|
|
144
142
|
function S(e) {
|
|
145
|
-
|
|
143
|
+
return e instanceof Date ? v(e.getFullYear(), e.getMonth() + 1, e.getDate()) : e;
|
|
144
|
+
}
|
|
145
|
+
function C(e) {
|
|
146
|
+
let { year: t, month: n, firstDayOfWeek: r = 0, selectedDate: i, minDate: a, maxDate: o, isDateDisabled: s } = e, c = [], l = b(), u = i ? S(i) : null, d = a ? S(a) : null, f = o ? S(o) : null, p = ((y(t, n, 1).getDay() + 1) % 7 - r + 7) % 7, m = n === 0 ? 11 : n - 1, h = n === 0 ? t - 1 : t, g = _(h, m);
|
|
146
147
|
for (let e = p - 1; e >= 0; e--) {
|
|
147
148
|
let t = {
|
|
148
149
|
year: h,
|
|
149
150
|
month: m,
|
|
150
|
-
day:
|
|
151
|
+
day: g - e
|
|
151
152
|
};
|
|
152
153
|
c.push(E(t, !1));
|
|
153
154
|
}
|
|
154
|
-
let
|
|
155
|
-
for (let e = 1; e <=
|
|
155
|
+
let v = _(t, n);
|
|
156
|
+
for (let e = 1; e <= v; e++) {
|
|
156
157
|
let r = {
|
|
157
158
|
year: t,
|
|
158
159
|
month: n,
|
|
@@ -170,13 +171,13 @@ function S(e) {
|
|
|
170
171
|
c.push(E(t, !1));
|
|
171
172
|
}
|
|
172
173
|
function E(e, t) {
|
|
173
|
-
let n =
|
|
174
|
+
let n = y(e.year, e.month, e.day), r = x(e, l), i = u ? x(e, u) : !1, a = !1;
|
|
174
175
|
if (d) {
|
|
175
|
-
let e =
|
|
176
|
+
let e = y(d.year, d.month, d.day);
|
|
176
177
|
n.getTime() < e.getTime() && (a = !0);
|
|
177
178
|
}
|
|
178
179
|
if (f) {
|
|
179
|
-
let e =
|
|
180
|
+
let e = y(f.year, f.month, f.day);
|
|
180
181
|
n.getTime() > e.getTime() && (a = !0);
|
|
181
182
|
}
|
|
182
183
|
return s && s(e, n) && (a = !0), {
|
|
@@ -193,34 +194,34 @@ function S(e) {
|
|
|
193
194
|
}
|
|
194
195
|
//#endregion
|
|
195
196
|
//#region src/core/jalali-helpers.ts
|
|
196
|
-
function
|
|
197
|
-
return
|
|
197
|
+
function w(e) {
|
|
198
|
+
return v(e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
198
199
|
}
|
|
199
|
-
function
|
|
200
|
-
let i =
|
|
200
|
+
function T(e, t = 0, n = 0, r = 0) {
|
|
201
|
+
let i = y(e.year, e.month, e.day);
|
|
201
202
|
return i.setHours(t, n, r, 0), i;
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
-
return (
|
|
204
|
+
function E(e, t, n) {
|
|
205
|
+
return (y(e, t, n).getDay() + 1) % 7;
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
-
let n =
|
|
208
|
-
return n.setDate(n.getDate() + t),
|
|
207
|
+
function D(e, t) {
|
|
208
|
+
let n = y(e.year, e.month, e.day);
|
|
209
|
+
return n.setDate(n.getDate() + t), v(n.getFullYear(), n.getMonth() + 1, n.getDate());
|
|
209
210
|
}
|
|
210
|
-
var
|
|
211
|
-
function
|
|
211
|
+
var O = D;
|
|
212
|
+
function k(e, t) {
|
|
212
213
|
return e.year === t.year ? e.month === t.month ? e.day === t.day ? 0 : e.day < t.day ? -1 : 1 : e.month < t.month ? -1 : 1 : e.year < t.year ? -1 : 1;
|
|
213
214
|
}
|
|
214
|
-
function
|
|
215
|
-
let i =
|
|
215
|
+
function ee(e, t, n, r = !0) {
|
|
216
|
+
let i = k(t, n) <= 0 ? t : n, a = k(t, n) <= 0 ? n : t, o = k(e, i), s = k(e, a);
|
|
216
217
|
return r ? o >= 0 && s <= 0 : o > 0 && s < 0;
|
|
217
218
|
}
|
|
218
219
|
function A(e) {
|
|
219
|
-
let t =
|
|
220
|
-
return [t,
|
|
220
|
+
let t = D(e, -E(e.year, e.month, e.day));
|
|
221
|
+
return [t, D(t, 6)];
|
|
221
222
|
}
|
|
222
223
|
function j(e) {
|
|
223
|
-
let t =
|
|
224
|
+
let t = _(e.year, e.month);
|
|
224
225
|
return [{
|
|
225
226
|
year: e.year,
|
|
226
227
|
month: e.month,
|
|
@@ -235,7 +236,7 @@ function j(e) {
|
|
|
235
236
|
//#region src/core/date-availability.ts
|
|
236
237
|
function M(e, t = {}) {
|
|
237
238
|
let { minDate: n, maxDate: r, isDateDisabled: i } = t;
|
|
238
|
-
return n &&
|
|
239
|
+
return n && k(e, n) < 0 || r && k(e, r) > 0 ? !1 : !i?.(e);
|
|
239
240
|
}
|
|
240
241
|
function N(e, t, n = {}) {
|
|
241
242
|
let r = {
|
|
@@ -245,9 +246,9 @@ function N(e, t, n = {}) {
|
|
|
245
246
|
}, i = {
|
|
246
247
|
year: e,
|
|
247
248
|
month: t,
|
|
248
|
-
day:
|
|
249
|
+
day: _(e, t)
|
|
249
250
|
};
|
|
250
|
-
if (n.minDate &&
|
|
251
|
+
if (n.minDate && k(i, n.minDate) < 0 || n.maxDate && k(r, n.maxDate) > 0) return !1;
|
|
251
252
|
if (!n.isDateDisabled) return !0;
|
|
252
253
|
for (let r = 1; r <= i.day; r += 1) if (M({
|
|
253
254
|
year: e,
|
|
@@ -262,8 +263,8 @@ function P(e, t = {}) {
|
|
|
262
263
|
}
|
|
263
264
|
//#endregion
|
|
264
265
|
//#region src/hooks/useJalaliDatePicker.ts
|
|
265
|
-
function
|
|
266
|
-
let { mode: t = "single", value: r, defaultValue: i, initialViewDate: o, onChange: c, minDate: l, maxDate: u, isDateDisabled: d, firstDayOfWeek: f = 0 } = e, p = a(() =>
|
|
266
|
+
function te(e = {}) {
|
|
267
|
+
let { mode: t = "single", value: r, defaultValue: i, initialViewDate: o, onChange: c, minDate: l, maxDate: u, isDateDisabled: d, firstDayOfWeek: f = 0 } = e, p = a(() => b(), []), [m, h] = s(() => i === void 0 ? t === "single" ? null : t === "range" ? [null, null] : [] : i), g = r === void 0 ? m : r, [_, v] = s(() => o ? o.year : i && !Array.isArray(i) ? i.year : p.year), [y, S] = s(() => o ? o.month : i && !Array.isArray(i) ? i.month : p.month), [w, T] = s(null), E = n((e) => M(e, {
|
|
267
268
|
minDate: l,
|
|
268
269
|
maxDate: u,
|
|
269
270
|
isDateDisabled: d
|
|
@@ -272,15 +273,15 @@ function F(e = {}) {
|
|
|
272
273
|
u,
|
|
273
274
|
d
|
|
274
275
|
]), D = n((e, t) => {
|
|
275
|
-
v(e),
|
|
276
|
+
v(e), S(t);
|
|
276
277
|
}, []), O = n(() => {
|
|
277
|
-
|
|
278
|
-
}, [
|
|
279
|
-
|
|
280
|
-
}, [
|
|
281
|
-
let e =
|
|
282
|
-
v(e.year),
|
|
283
|
-
}, []),
|
|
278
|
+
y === 0 ? (v((e) => e - 1), S(11)) : S((e) => e - 1);
|
|
279
|
+
}, [y]), k = n(() => {
|
|
280
|
+
y === 11 ? (v((e) => e + 1), S(0)) : S((e) => e + 1);
|
|
281
|
+
}, [y]), A = n(() => {
|
|
282
|
+
let e = b();
|
|
283
|
+
v(e.year), S(e.month);
|
|
284
|
+
}, []), j = n((e) => {
|
|
284
285
|
if (!E(e)) return;
|
|
285
286
|
let n;
|
|
286
287
|
if (t === "single") n = e;
|
|
@@ -289,7 +290,7 @@ function F(e = {}) {
|
|
|
289
290
|
n = !t || t && r ? [e, null] : e.year < t.year || e.year === t.year && e.month < t.month || e.year === t.year && e.month === t.month && e.day < t.day ? [e, t] : [t, e];
|
|
290
291
|
} else {
|
|
291
292
|
let t = g || [];
|
|
292
|
-
n = t.some((t) =>
|
|
293
|
+
n = t.some((t) => x(t, e)) ? t.filter((t) => !x(t, e)) : [...t, e];
|
|
293
294
|
}
|
|
294
295
|
r === void 0 && h(n), c?.(n);
|
|
295
296
|
}, [
|
|
@@ -298,14 +299,14 @@ function F(e = {}) {
|
|
|
298
299
|
r,
|
|
299
300
|
c,
|
|
300
301
|
E
|
|
301
|
-
]),
|
|
302
|
-
if (t === "single") return
|
|
302
|
+
]), N = n((e) => {
|
|
303
|
+
if (t === "single") return x(g, e);
|
|
303
304
|
if (t === "range") {
|
|
304
305
|
let [t, n] = g || [null, null];
|
|
305
|
-
return !!(t &&
|
|
306
|
+
return !!(t && x(t, e) || n && x(n, e));
|
|
306
307
|
}
|
|
307
|
-
return (g || []).some((t) =>
|
|
308
|
-
}, [t, g]),
|
|
308
|
+
return (g || []).some((t) => x(t, e));
|
|
309
|
+
}, [t, g]), P = n(() => {
|
|
309
310
|
let e = t === "single" ? null : t === "range" ? [null, null] : [];
|
|
310
311
|
r === void 0 && h(e), c?.(e);
|
|
311
312
|
}, [
|
|
@@ -316,11 +317,11 @@ function F(e = {}) {
|
|
|
316
317
|
return {
|
|
317
318
|
selected: g,
|
|
318
319
|
viewYear: _,
|
|
319
|
-
viewMonth:
|
|
320
|
+
viewMonth: y,
|
|
320
321
|
grid: a(() => {
|
|
321
|
-
let e =
|
|
322
|
+
let e = C({
|
|
322
323
|
year: _,
|
|
323
|
-
month:
|
|
324
|
+
month: y,
|
|
324
325
|
firstDayOfWeek: f,
|
|
325
326
|
minDate: l,
|
|
326
327
|
maxDate: u,
|
|
@@ -330,14 +331,14 @@ function F(e = {}) {
|
|
|
330
331
|
let t = g;
|
|
331
332
|
return e.map((e) => ({
|
|
332
333
|
...e,
|
|
333
|
-
isSelected: t ?
|
|
334
|
+
isSelected: t ? x(e.jalali, t) : !1
|
|
334
335
|
}));
|
|
335
336
|
}
|
|
336
337
|
if (t === "range") {
|
|
337
338
|
let [t, n] = g || [null, null], r = n ?? (t && w ? w : null);
|
|
338
339
|
return e.map((e) => {
|
|
339
|
-
let n = t ?
|
|
340
|
-
return t && r && (a =
|
|
340
|
+
let n = t ? x(e.jalali, t) : !1, i = r ? x(e.jalali, r) : !1, a = !1;
|
|
341
|
+
return t && r && (a = ee(e.jalali, t, r)), {
|
|
341
342
|
...e,
|
|
342
343
|
isSelected: n || i,
|
|
343
344
|
isInRange: a,
|
|
@@ -350,13 +351,13 @@ function F(e = {}) {
|
|
|
350
351
|
let t = g || [];
|
|
351
352
|
return e.map((e) => ({
|
|
352
353
|
...e,
|
|
353
|
-
isSelected: t.some((t) =>
|
|
354
|
+
isSelected: t.some((t) => x(t, e.jalali))
|
|
354
355
|
}));
|
|
355
356
|
}
|
|
356
357
|
return e;
|
|
357
358
|
}, [
|
|
358
359
|
_,
|
|
359
|
-
|
|
360
|
+
y,
|
|
360
361
|
f,
|
|
361
362
|
l,
|
|
362
363
|
u,
|
|
@@ -366,19 +367,19 @@ function F(e = {}) {
|
|
|
366
367
|
w
|
|
367
368
|
]),
|
|
368
369
|
goToPrevMonth: O,
|
|
369
|
-
goToNextMonth:
|
|
370
|
-
goToToday:
|
|
370
|
+
goToNextMonth: k,
|
|
371
|
+
goToToday: A,
|
|
371
372
|
setView: D,
|
|
372
|
-
selectDate:
|
|
373
|
-
isDateSelected:
|
|
373
|
+
selectDate: j,
|
|
374
|
+
isDateSelected: N,
|
|
374
375
|
setHoverDate: T,
|
|
375
376
|
hoverDate: w,
|
|
376
|
-
clear:
|
|
377
|
+
clear: P
|
|
377
378
|
};
|
|
378
379
|
}
|
|
379
380
|
//#endregion
|
|
380
381
|
//#region src/a11y/keyboard-navigation.ts
|
|
381
|
-
function
|
|
382
|
+
function F(e) {
|
|
382
383
|
let { currentFocused: t, key: n, isRtl: r = !0 } = e, { year: i, month: a, day: o } = t, s = !1, c = !0, l = r ? 1 : -1, u = r ? -1 : 1;
|
|
383
384
|
switch (n) {
|
|
384
385
|
case "ArrowRight":
|
|
@@ -397,7 +398,7 @@ function I(e) {
|
|
|
397
398
|
o = 1;
|
|
398
399
|
break;
|
|
399
400
|
case "End":
|
|
400
|
-
o =
|
|
401
|
+
o = _(i, a);
|
|
401
402
|
break;
|
|
402
403
|
case "PageUp":
|
|
403
404
|
a === 0 ? (--i, a = 11) : --a, s = !0;
|
|
@@ -411,8 +412,8 @@ function I(e) {
|
|
|
411
412
|
handled: !1
|
|
412
413
|
};
|
|
413
414
|
}
|
|
414
|
-
for (; o < 1;) a === 0 ? (--i, a = 11) : --a, o +=
|
|
415
|
-
for (; o >
|
|
415
|
+
for (; o < 1;) a === 0 ? (--i, a = 11) : --a, o += _(i, a), s = !0;
|
|
416
|
+
for (; o > _(i, a);) o -= _(i, a), a === 11 ? (i += 1, a = 0) : a += 1, s = !0;
|
|
416
417
|
return {
|
|
417
418
|
nextDate: {
|
|
418
419
|
year: i,
|
|
@@ -425,13 +426,13 @@ function I(e) {
|
|
|
425
426
|
}
|
|
426
427
|
//#endregion
|
|
427
428
|
//#region src/a11y/aria-helpers.ts
|
|
428
|
-
function
|
|
429
|
-
let t =
|
|
429
|
+
function I(e) {
|
|
430
|
+
let t = h[(y(e.year, e.month, e.day).getDay() + 1) % 7], n = f[e.month];
|
|
430
431
|
return `${t}، ${e.day} ${n} ${e.year}`;
|
|
431
432
|
}
|
|
432
433
|
//#endregion
|
|
433
434
|
//#region src/a11y/useCalendarKeyboard.ts
|
|
434
|
-
function
|
|
435
|
+
function ne(e) {
|
|
435
436
|
let { viewYear: t, viewMonth: r, selectedDate: i, onSelectDate: a, onViewChange: o, isRtl: c = !0 } = e, [l, u] = s(() => i ?? {
|
|
436
437
|
year: t,
|
|
437
438
|
month: r,
|
|
@@ -445,7 +446,7 @@ function R(e) {
|
|
|
445
446
|
e.preventDefault(), a(l);
|
|
446
447
|
return;
|
|
447
448
|
}
|
|
448
|
-
let t =
|
|
449
|
+
let t = F({
|
|
449
450
|
currentFocused: l,
|
|
450
451
|
key: e.key,
|
|
451
452
|
isRtl: c
|
|
@@ -457,12 +458,12 @@ function R(e) {
|
|
|
457
458
|
a,
|
|
458
459
|
o
|
|
459
460
|
]),
|
|
460
|
-
getCellTabIndex: n((e) =>
|
|
461
|
+
getCellTabIndex: n((e) => x(e, l) ? 0 : -1, [l])
|
|
461
462
|
};
|
|
462
463
|
}
|
|
463
464
|
//#endregion
|
|
464
465
|
//#region src/formatters/persian-digits.ts
|
|
465
|
-
var
|
|
466
|
+
var re = [
|
|
466
467
|
"۰",
|
|
467
468
|
"۱",
|
|
468
469
|
"۲",
|
|
@@ -473,7 +474,7 @@ var ee = [
|
|
|
473
474
|
"۷",
|
|
474
475
|
"۸",
|
|
475
476
|
"۹"
|
|
476
|
-
],
|
|
477
|
+
], L = {
|
|
477
478
|
"۰": "0",
|
|
478
479
|
"۱": "1",
|
|
479
480
|
"۲": "2",
|
|
@@ -495,22 +496,22 @@ var ee = [
|
|
|
495
496
|
"٨": "8",
|
|
496
497
|
"٩": "9"
|
|
497
498
|
};
|
|
498
|
-
function
|
|
499
|
-
return String(e).replace(/[0-9]/g, (e) =>
|
|
499
|
+
function R(e) {
|
|
500
|
+
return String(e).replace(/[0-9]/g, (e) => re[+e]);
|
|
500
501
|
}
|
|
501
|
-
function
|
|
502
|
-
return e.replace(/[۰-۹٠-٩]/g, (e) =>
|
|
502
|
+
function z(e) {
|
|
503
|
+
return e.replace(/[۰-۹٠-٩]/g, (e) => L[e] ?? e);
|
|
503
504
|
}
|
|
504
505
|
//#endregion
|
|
505
506
|
//#region src/formatters/jalali-formatter.ts
|
|
506
|
-
function
|
|
507
|
+
function B(e, t = "YYYY/MM/DD", n = {}) {
|
|
507
508
|
if (!e) return "";
|
|
508
|
-
let { digitType: r = "persian" } = n, i = (
|
|
509
|
-
return r === "persian" && (p = p.replace(/\d+/g, (e) =>
|
|
509
|
+
let { digitType: r = "persian" } = n, i = (y(e.year, e.month, e.day).getDay() + 1) % 7, a = String(e.year), o = a.slice(-2), s = e.month + 1, c = s < 10 ? `0${s}` : String(s), l = f[e.month], u = e.day < 10 ? `0${e.day}` : String(e.day), d = h[i], p = t.replace(/\bYYYY\b/g, a).replace(/\bYY\b/g, o).replace(/\bMMMM\b/g, l).replace(/\bMM\b/g, c).replace(/\bM\b/g, String(s)).replace(/\bdddd\b/g, d).replace(/\bDD\b/g, u).replace(/\bD\b/g, String(e.day));
|
|
510
|
+
return r === "persian" && (p = p.replace(/\d+/g, (e) => R(e))), p;
|
|
510
511
|
}
|
|
511
512
|
//#endregion
|
|
512
513
|
//#region src/theme/tokens.ts
|
|
513
|
-
var
|
|
514
|
+
var V = {
|
|
514
515
|
mode: "light",
|
|
515
516
|
colors: {
|
|
516
517
|
primary: "#4f46e5",
|
|
@@ -539,7 +540,7 @@ var H = {
|
|
|
539
540
|
md: "0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04)",
|
|
540
541
|
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05)"
|
|
541
542
|
}
|
|
542
|
-
},
|
|
543
|
+
}, ie = {
|
|
543
544
|
mode: "dark",
|
|
544
545
|
colors: {
|
|
545
546
|
primary: "#6366f1",
|
|
@@ -568,14 +569,14 @@ var H = {
|
|
|
568
569
|
md: "0 4px 6px -1px rgba(0, 0, 0, 0.4)",
|
|
569
570
|
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.5)"
|
|
570
571
|
}
|
|
571
|
-
},
|
|
572
|
-
theme:
|
|
572
|
+
}, ae = t({
|
|
573
|
+
theme: V,
|
|
573
574
|
mode: "light"
|
|
574
|
-
}),
|
|
575
|
-
theme:
|
|
575
|
+
}), H = () => r(ae) || {
|
|
576
|
+
theme: V,
|
|
576
577
|
mode: "light"
|
|
577
|
-
},
|
|
578
|
-
let r = t === "dark" ?
|
|
578
|
+
}, U = ({ children: e, mode: t = "light", customTheme: n }) => {
|
|
579
|
+
let r = t === "dark" ? ie : V, i = a(() => n ? {
|
|
579
580
|
mode: t,
|
|
580
581
|
theme: {
|
|
581
582
|
...r,
|
|
@@ -602,7 +603,7 @@ var H = {
|
|
|
602
603
|
n,
|
|
603
604
|
t
|
|
604
605
|
]);
|
|
605
|
-
return /* @__PURE__ */ l(
|
|
606
|
+
return /* @__PURE__ */ l(ae.Provider, {
|
|
606
607
|
value: i,
|
|
607
608
|
children: e
|
|
608
609
|
});
|
|
@@ -614,8 +615,8 @@ function W(...e) {
|
|
|
614
615
|
}
|
|
615
616
|
//#endregion
|
|
616
617
|
//#region src/components/Header.tsx
|
|
617
|
-
var
|
|
618
|
-
let { theme: h } =
|
|
618
|
+
var oe = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick: i, isPickerOpen: a = !1, digitType: o = "persian", direction: c = "rtl", isPrevDisabled: d = !1, isNextDisabled: f = !1, classNames: p, styles: m }) => {
|
|
619
|
+
let { theme: h } = H(), [g, _] = s(null), v = o === "persian" ? R(e) : String(e), y = (e, t) => ({
|
|
619
620
|
width: "32px",
|
|
620
621
|
height: "32px",
|
|
621
622
|
padding: 0,
|
|
@@ -743,9 +744,9 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
743
744
|
})
|
|
744
745
|
]
|
|
745
746
|
});
|
|
746
|
-
},
|
|
747
|
+
}, se = ({ firstDayOfWeek: t = 0, classNames: n, styles: r }) => {
|
|
747
748
|
let i = e.useMemo(() => {
|
|
748
|
-
let e = [...
|
|
749
|
+
let e = [...m];
|
|
749
750
|
return [...e.slice(t), ...e.slice(0, t)];
|
|
750
751
|
}, [t]);
|
|
751
752
|
return /* @__PURE__ */ l("div", {
|
|
@@ -784,18 +785,18 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
784
785
|
}, e);
|
|
785
786
|
})
|
|
786
787
|
});
|
|
787
|
-
},
|
|
788
|
-
let [m, h] = s(!1), [g, _] = s(!1), { jalali: v, dayNumber: y, isCurrentMonth: b, isToday: x, isSelected: S, isDisabled: C, isInRange: w, isRangeStart: T, isRangeEnd: E } = e, D = t === "persian" ?
|
|
788
|
+
}, ce = ({ cell: e, digitType: t = "persian", isHoliday: n = !1, holidayTitle: r, events: i = [], tabIndex: a = -1, classNames: o, styles: c, onSelect: d, onHover: f, onFocus: p }) => {
|
|
789
|
+
let [m, h] = s(!1), [g, _] = s(!1), { jalali: v, dayNumber: y, isCurrentMonth: b, isToday: x, isSelected: S, isDisabled: C, isInRange: w, isRangeStart: T, isRangeEnd: E } = e, D = t === "persian" ? R(y) : z(y.toString()), O = !C && b, k = (e) => {
|
|
789
790
|
e.stopPropagation(), O && d(v);
|
|
790
|
-
},
|
|
791
|
+
}, ee = () => {
|
|
791
792
|
h(!0), O && f && f(v);
|
|
792
|
-
},
|
|
793
|
+
}, A = () => {
|
|
793
794
|
h(!1), _(!1), f && f(null);
|
|
794
|
-
},
|
|
795
|
+
}, j = () => {
|
|
795
796
|
O && p && p(v);
|
|
796
|
-
},
|
|
797
|
-
S ||
|
|
798
|
-
let
|
|
797
|
+
}, M = "transparent", N = b ? "var(--pdp-text-primary, #0f172a)" : "var(--pdp-text-disabled, #cbd5e1)", P = T || E;
|
|
798
|
+
S || P ? (M = "var(--pdp-primary, #4f46e5)", N = "#ffffff") : w ? M = "var(--pdp-range-between-bg, rgba(79, 70, 229, 0.12))" : m && O && (M = "var(--pdp-hover-bg, #f1f5f9)"), n && b && !C && !S && !P && (N = "var(--pdp-holiday-color, #e11d48)"), C && (M = "var(--pdp-disabled-bg, #f1f5f9)", N = "var(--pdp-text-disabled, #94a3b8)");
|
|
799
|
+
let te = W(o?.dayCell, x && o?.todayCell, S && o?.selectedCell, w && o?.rangeBetweenCell, T && o?.rangeStartCell, E && o?.rangeEndCell, C && o?.disabledCell, !b && o?.outsideMonthCell, n && o?.holidayCell), F = {
|
|
799
800
|
...x ? c?.todayCell : void 0,
|
|
800
801
|
...S ? c?.selectedCell : void 0,
|
|
801
802
|
...w ? c?.rangeBetweenCell : void 0,
|
|
@@ -804,8 +805,8 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
804
805
|
...b ? void 0 : c?.outsideMonthCell,
|
|
805
806
|
...n ? c?.holidayCell : void 0,
|
|
806
807
|
...C ? c?.disabledCell : void 0
|
|
807
|
-
},
|
|
808
|
-
return O && (g ?
|
|
808
|
+
}, I = "scale(1)";
|
|
809
|
+
return O && (g ? I = "scale(0.92)" : m && !w && (I = "scale(1.08)")), /* @__PURE__ */ u("div", {
|
|
809
810
|
style: {
|
|
810
811
|
position: "relative",
|
|
811
812
|
display: "flex",
|
|
@@ -818,8 +819,8 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
818
819
|
padding: 0,
|
|
819
820
|
boxSizing: "border-box"
|
|
820
821
|
},
|
|
821
|
-
onMouseEnter:
|
|
822
|
-
onMouseLeave:
|
|
822
|
+
onMouseEnter: ee,
|
|
823
|
+
onMouseLeave: A,
|
|
823
824
|
children: [/* @__PURE__ */ u("button", {
|
|
824
825
|
type: "button",
|
|
825
826
|
role: "gridcell",
|
|
@@ -829,10 +830,10 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
829
830
|
"aria-selected": S,
|
|
830
831
|
"aria-label": `${v.year}/${v.month + 1}/${v.day}${r ? ` - ${r}` : ""}`,
|
|
831
832
|
onClick: k,
|
|
832
|
-
onFocus:
|
|
833
|
+
onFocus: j,
|
|
833
834
|
onMouseDown: () => O && _(!0),
|
|
834
835
|
onMouseUp: () => O && _(!1),
|
|
835
|
-
className:
|
|
836
|
+
className: te,
|
|
836
837
|
style: {
|
|
837
838
|
width: "100%",
|
|
838
839
|
height: "100%",
|
|
@@ -842,8 +843,8 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
842
843
|
justifyContent: "center",
|
|
843
844
|
borderRadius: T ? "0 8px 8px 0" : E ? "8px 0 0 8px" : w ? "0" : "8px",
|
|
844
845
|
border: x && !S ? "1px solid var(--pdp-primary, #4f46e5)" : "none",
|
|
845
|
-
backgroundColor:
|
|
846
|
-
color:
|
|
846
|
+
backgroundColor: M,
|
|
847
|
+
color: N,
|
|
847
848
|
cursor: C ? "not-allowed" : O ? "pointer" : "default",
|
|
848
849
|
fontSize: "13px",
|
|
849
850
|
fontWeight: S || x ? 700 : 500,
|
|
@@ -852,14 +853,14 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
852
853
|
padding: 0,
|
|
853
854
|
margin: 0,
|
|
854
855
|
boxSizing: "border-box",
|
|
855
|
-
transform:
|
|
856
|
+
transform: I,
|
|
856
857
|
boxShadow: m && O && !w && !S ? "0 2px 6px rgba(0, 0, 0, 0.08)" : "none",
|
|
857
858
|
transition: "transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.14s ease, color 0.14s ease, box-shadow 0.16s ease",
|
|
858
859
|
zIndex: m && O ? 2 : 1,
|
|
859
860
|
opacity: C ? .42 : b ? 1 : .55,
|
|
860
861
|
filter: C ? "grayscale(0.65)" : void 0,
|
|
861
862
|
...c?.dayCell,
|
|
862
|
-
...
|
|
863
|
+
...F
|
|
863
864
|
},
|
|
864
865
|
children: [/* @__PURE__ */ l("span", { children: D }), i.length > 0 && /* @__PURE__ */ l("div", {
|
|
865
866
|
style: {
|
|
@@ -925,7 +926,7 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
925
926
|
]
|
|
926
927
|
})]
|
|
927
928
|
});
|
|
928
|
-
},
|
|
929
|
+
}, le = ({ currentYear: e, currentMonth: t, onSelectMonth: n, onSelectYear: r, minDate: i, maxDate: a, isDateDisabled: o, classNames: c, styles: d }) => {
|
|
929
930
|
let [p, m] = s("months"), [h, g] = s(() => Math.floor(e / 10) * 10), [_, v] = s(e), y = Array.from({ length: 12 }, (e, t) => h - 1 + t), b = {
|
|
930
931
|
minDate: i,
|
|
931
932
|
maxDate: a,
|
|
@@ -984,7 +985,7 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
984
985
|
boxSizing: "border-box",
|
|
985
986
|
justifyContent: "space-between",
|
|
986
987
|
userSelect: "none",
|
|
987
|
-
...
|
|
988
|
+
...d?.calendar
|
|
988
989
|
},
|
|
989
990
|
children: [/* @__PURE__ */ u("div", {
|
|
990
991
|
style: {
|
|
@@ -1006,7 +1007,7 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
1006
1007
|
...D,
|
|
1007
1008
|
cursor: C ? "not-allowed" : "pointer",
|
|
1008
1009
|
opacity: C ? .38 : 1,
|
|
1009
|
-
...C ?
|
|
1010
|
+
...C ? d?.disabledNavButton : void 0
|
|
1010
1011
|
},
|
|
1011
1012
|
onMouseEnter: (e) => {
|
|
1012
1013
|
e.currentTarget.style.backgroundColor = "var(--pdp-hover-bg, #f1f5f9)";
|
|
@@ -1051,7 +1052,7 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
1051
1052
|
onMouseLeave: (e) => {
|
|
1052
1053
|
p === "months" && (e.currentTarget.style.backgroundColor = "var(--pdp-surface-subtle, #f1f5f9)", e.currentTarget.style.borderColor = "var(--pdp-surface-border, #e2e8f0)");
|
|
1053
1054
|
},
|
|
1054
|
-
children: [/* @__PURE__ */ l("span", { children: p === "months" ?
|
|
1055
|
+
children: [/* @__PURE__ */ l("span", { children: p === "months" ? R(_) : `${R(h)} - ${R(h + 9)}` }), p === "months" && /* @__PURE__ */ l("svg", {
|
|
1055
1056
|
width: "13",
|
|
1056
1057
|
height: "13",
|
|
1057
1058
|
viewBox: "0 0 24 24",
|
|
@@ -1075,7 +1076,7 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
1075
1076
|
...D,
|
|
1076
1077
|
cursor: w ? "not-allowed" : "pointer",
|
|
1077
1078
|
opacity: w ? .38 : 1,
|
|
1078
|
-
...w ?
|
|
1079
|
+
...w ? d?.disabledNavButton : void 0
|
|
1079
1080
|
},
|
|
1080
1081
|
onMouseEnter: (e) => {
|
|
1081
1082
|
e.currentTarget.style.backgroundColor = "var(--pdp-hover-bg, #f1f5f9)";
|
|
@@ -1105,7 +1106,7 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
1105
1106
|
flex: 1,
|
|
1106
1107
|
alignItems: "center"
|
|
1107
1108
|
},
|
|
1108
|
-
children: p === "months" ?
|
|
1109
|
+
children: p === "months" ? f.map((r, i) => {
|
|
1109
1110
|
let a = i === t && _ === e, o = !S(_, i);
|
|
1110
1111
|
return /* @__PURE__ */ l("button", {
|
|
1111
1112
|
type: "button",
|
|
@@ -1120,9 +1121,9 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
1120
1121
|
fontWeight: a ? 700 : 500,
|
|
1121
1122
|
cursor: o ? "not-allowed" : "pointer",
|
|
1122
1123
|
opacity: o ? .35 : 1,
|
|
1123
|
-
...
|
|
1124
|
-
...a ?
|
|
1125
|
-
...o ?
|
|
1124
|
+
...d?.monthButton ?? {},
|
|
1125
|
+
...a ? d?.selectedMonthButton : void 0,
|
|
1126
|
+
...o ? d?.disabledMonthButton : void 0
|
|
1126
1127
|
},
|
|
1127
1128
|
onMouseEnter: (e) => {
|
|
1128
1129
|
a || (e.currentTarget.style.backgroundColor = "var(--pdp-hover-bg, #f1f5f9)");
|
|
@@ -1149,9 +1150,9 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
1149
1150
|
fontWeight: i ? 700 : 500,
|
|
1150
1151
|
cursor: a ? "not-allowed" : "pointer",
|
|
1151
1152
|
opacity: a ? .3 : n ? .4 : 1,
|
|
1152
|
-
...
|
|
1153
|
-
...i ?
|
|
1154
|
-
...a ?
|
|
1153
|
+
...d?.yearButton ?? {},
|
|
1154
|
+
...i ? d?.selectedYearButton : void 0,
|
|
1155
|
+
...a ? d?.disabledYearButton : void 0
|
|
1155
1156
|
},
|
|
1156
1157
|
onMouseEnter: (e) => {
|
|
1157
1158
|
i || (e.currentTarget.style.backgroundColor = "var(--pdp-hover-bg, #f1f5f9)");
|
|
@@ -1159,7 +1160,7 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
1159
1160
|
onMouseLeave: (e) => {
|
|
1160
1161
|
i || (e.currentTarget.style.backgroundColor = "transparent");
|
|
1161
1162
|
},
|
|
1162
|
-
children:
|
|
1163
|
+
children: R(e)
|
|
1163
1164
|
}, e);
|
|
1164
1165
|
})
|
|
1165
1166
|
})]
|
|
@@ -1167,11 +1168,11 @@ var G = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick:
|
|
|
1167
1168
|
};
|
|
1168
1169
|
//#endregion
|
|
1169
1170
|
//#region src/plugins/time-picker/time-utils.ts
|
|
1170
|
-
function
|
|
1171
|
+
function G(e, t = "persian") {
|
|
1171
1172
|
let n = e < 10 ? `0${e}` : `${e}`;
|
|
1172
|
-
return t === "persian" ?
|
|
1173
|
+
return t === "persian" ? R(n) : n;
|
|
1173
1174
|
}
|
|
1174
|
-
function
|
|
1175
|
+
function ue() {
|
|
1175
1176
|
let e = /* @__PURE__ */ new Date();
|
|
1176
1177
|
return {
|
|
1177
1178
|
hour: e.getHours(),
|
|
@@ -1179,34 +1180,34 @@ function ce() {
|
|
|
1179
1180
|
second: e.getSeconds()
|
|
1180
1181
|
};
|
|
1181
1182
|
}
|
|
1182
|
-
function
|
|
1183
|
+
function K(e) {
|
|
1183
1184
|
return {
|
|
1184
1185
|
hour: Math.max(0, Math.min(23, e.hour)),
|
|
1185
1186
|
minute: Math.max(0, Math.min(59, e.minute)),
|
|
1186
1187
|
second: e.second === void 0 ? void 0 : Math.max(0, Math.min(59, e.second))
|
|
1187
1188
|
};
|
|
1188
1189
|
}
|
|
1189
|
-
function
|
|
1190
|
+
function de(e, t = !1, n = "persian") {
|
|
1190
1191
|
if (!e) return "";
|
|
1191
|
-
let r =
|
|
1192
|
-
return t && e.second !== void 0 ? `${r}:${i}:${
|
|
1192
|
+
let r = G(e.hour, n), i = G(e.minute, n);
|
|
1193
|
+
return t && e.second !== void 0 ? `${r}:${i}:${G(e.second, n)}` : `${r}:${i}`;
|
|
1193
1194
|
}
|
|
1194
1195
|
//#endregion
|
|
1195
1196
|
//#region src/components/footer/CalendarFooter.tsx
|
|
1196
|
-
var
|
|
1197
|
-
let { theme: _ } =
|
|
1197
|
+
var fe = ({ selectedDate: e, selectedRange: t, selectedDates: n, selectedTime: r, showSeconds: i = !1, mode: a = "single", digitType: o = "persian", showStatusText: s = !0, showActions: c = !0, onToday: d, onClear: f, onConfirm: p, direction: m = "rtl", classNames: h, styles: g }) => {
|
|
1198
|
+
let { theme: _ } = H(), v = (() => {
|
|
1198
1199
|
if (a === "single") {
|
|
1199
1200
|
if (!e) return "تاریخی انتخاب نشده";
|
|
1200
|
-
let t =
|
|
1201
|
+
let t = B(e, "YYYY/MM/DD", { digitType: o }), n = r ? de(r, i, o) : "";
|
|
1201
1202
|
return n ? `${t}، ${n}` : t;
|
|
1202
1203
|
}
|
|
1203
1204
|
if (a === "range") {
|
|
1204
1205
|
let [e, n] = t ?? [null, null];
|
|
1205
1206
|
if (!e) return "بازهای انتخاب نشده";
|
|
1206
|
-
let r =
|
|
1207
|
-
return n ? `${r} تا ${
|
|
1207
|
+
let r = B(e, "YYYY/MM/DD", { digitType: o });
|
|
1208
|
+
return n ? `${r} تا ${B(n, "YYYY/MM/DD", { digitType: o })}` : `${r} تا …`;
|
|
1208
1209
|
}
|
|
1209
|
-
let s = n?.length ?? 0, c = o === "persian" ?
|
|
1210
|
+
let s = n?.length ?? 0, c = o === "persian" ? R(s) : String(s);
|
|
1210
1211
|
return s ? `${c} تاریخ انتخاب شده` : "تاریخی انتخاب نشده";
|
|
1211
1212
|
})(), y = {
|
|
1212
1213
|
minHeight: "34px",
|
|
@@ -1295,7 +1296,7 @@ var ue = ({ selectedDate: e, selectedRange: t, selectedDates: n, selectedTime: r
|
|
|
1295
1296
|
]
|
|
1296
1297
|
})]
|
|
1297
1298
|
});
|
|
1298
|
-
},
|
|
1299
|
+
}, pe = ({ value: e, onChange: t, minuteStep: n = 1, hourStep: r = 1, showSeconds: a = !1, digitType: d = "persian", classNames: f, styles: p }) => {
|
|
1299
1300
|
let [m, h] = s(null), g = o(null), _ = Array.from({ length: Math.ceil(24 / r) }, (e, t) => t * r), v = Array.from({ length: Math.ceil(60 / n) }, (e, t) => t * n), y = Array.from({ length: 60 }, (e, t) => t);
|
|
1300
1301
|
i(() => {
|
|
1301
1302
|
let e = (e) => {
|
|
@@ -1307,7 +1308,7 @@ var ue = ({ selectedDate: e, selectedRange: t, selectedDates: n, selectedTime: r
|
|
|
1307
1308
|
}, []);
|
|
1308
1309
|
let b = (e) => {
|
|
1309
1310
|
let t = String(e).padStart(2, "0");
|
|
1310
|
-
return d === "persian" ?
|
|
1311
|
+
return d === "persian" ? R(t) : t;
|
|
1311
1312
|
}, x = (e, t, n, r) => {
|
|
1312
1313
|
let i = m === e;
|
|
1313
1314
|
return /* @__PURE__ */ u("div", {
|
|
@@ -1441,12 +1442,12 @@ var ue = ({ selectedDate: e, selectedRange: t, selectedDates: n, selectedTime: r
|
|
|
1441
1442
|
};
|
|
1442
1443
|
//#endregion
|
|
1443
1444
|
//#region src/components/masked-input/mask-utils.ts
|
|
1444
|
-
function
|
|
1445
|
-
let n =
|
|
1446
|
-
return n.length > 0 && (r = n.slice(0, 4)), n.length >= 5 && (r += `/${n.slice(4, 6)}`), n.length >= 7 && (r += `/${n.slice(6, 8)}`), t === "persian" ?
|
|
1445
|
+
function me(e, t = "persian") {
|
|
1446
|
+
let n = z(e).replace(/\D/g, "").slice(0, 8), r = "";
|
|
1447
|
+
return n.length > 0 && (r = n.slice(0, 4)), n.length >= 5 && (r += `/${n.slice(4, 6)}`), n.length >= 7 && (r += `/${n.slice(6, 8)}`), t === "persian" ? R(r) : r;
|
|
1447
1448
|
}
|
|
1448
|
-
function
|
|
1449
|
-
let i =
|
|
1449
|
+
function he(e, t, n, r) {
|
|
1450
|
+
let i = z(e).trim();
|
|
1450
1451
|
if (!i) return {
|
|
1451
1452
|
isValid: !0,
|
|
1452
1453
|
date: null
|
|
@@ -1463,7 +1464,7 @@ function pe(e, t, n, r) {
|
|
|
1463
1464
|
date: null,
|
|
1464
1465
|
error: "INVALID_MONTH"
|
|
1465
1466
|
};
|
|
1466
|
-
let l = s - 1, u =
|
|
1467
|
+
let l = s - 1, u = _(o, l);
|
|
1467
1468
|
if (c < 1 || c > u) return {
|
|
1468
1469
|
isValid: !1,
|
|
1469
1470
|
date: null,
|
|
@@ -1474,11 +1475,11 @@ function pe(e, t, n, r) {
|
|
|
1474
1475
|
month: l,
|
|
1475
1476
|
day: c
|
|
1476
1477
|
};
|
|
1477
|
-
return t &&
|
|
1478
|
+
return t && k(d, t) < 0 ? {
|
|
1478
1479
|
isValid: !1,
|
|
1479
1480
|
date: d,
|
|
1480
1481
|
error: "OUT_OF_MIN_BOUNDS"
|
|
1481
|
-
} : n &&
|
|
1482
|
+
} : n && k(d, n) > 0 ? {
|
|
1482
1483
|
isValid: !1,
|
|
1483
1484
|
date: d,
|
|
1484
1485
|
error: "OUT_OF_MAX_BOUNDS"
|
|
@@ -1493,19 +1494,19 @@ function pe(e, t, n, r) {
|
|
|
1493
1494
|
}
|
|
1494
1495
|
//#endregion
|
|
1495
1496
|
//#region src/components/masked-input/MaskedDateInput.tsx
|
|
1496
|
-
var
|
|
1497
|
-
let { theme: w } =
|
|
1497
|
+
var ge = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a, digitType: c = "persian", minDate: d, maxDate: f, isDateDisabled: p, clearable: m = !0, placeholder: h = "۱۴۰۵/۰۱/۱۵", disabled: g = !1, direction: _ = "rtl", wrapperClassName: v, wrapperStyle: y, clearButtonClassName: b, clearButtonStyle: x, style: S, ...C }) => {
|
|
1498
|
+
let { theme: w } = H(), [T, E] = s(t), D = e === void 0 ? T : e, [O, k] = s(() => D ? B(D, "YYYY/MM/DD", { digitType: c }) : ""), [ee, A] = s(!1), j = o(null);
|
|
1498
1499
|
i(() => {
|
|
1499
|
-
e !== void 0 && (k(e ?
|
|
1500
|
+
e !== void 0 && (k(e ? B(e, "YYYY/MM/DD", { digitType: c }) : ""), A(!1));
|
|
1500
1501
|
}, [e, c]);
|
|
1501
|
-
let
|
|
1502
|
-
let n = t.target.value, i =
|
|
1502
|
+
let M = (t) => {
|
|
1503
|
+
let n = t.target.value, i = me(n, c);
|
|
1503
1504
|
if (k(i), i.length === 10 || i.length === 0) {
|
|
1504
|
-
let t =
|
|
1505
|
-
t.isValid ? (
|
|
1506
|
-
} else
|
|
1507
|
-
},
|
|
1508
|
-
k(""),
|
|
1505
|
+
let t = he(i, d, f, p);
|
|
1506
|
+
t.isValid ? (A(!1), a?.(null), e === void 0 && E(t.date), r?.(t.date)) : (A(!0), a?.(t.error));
|
|
1507
|
+
} else A(!1), a?.(null);
|
|
1508
|
+
}, N = n(() => {
|
|
1509
|
+
k(""), A(!1), a?.(null), e === void 0 && E(null), r?.(null), j.current?.focus();
|
|
1509
1510
|
}, [
|
|
1510
1511
|
e,
|
|
1511
1512
|
r,
|
|
@@ -1523,13 +1524,13 @@ var me = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a,
|
|
|
1523
1524
|
...y
|
|
1524
1525
|
},
|
|
1525
1526
|
children: [/* @__PURE__ */ l("input", {
|
|
1526
|
-
ref:
|
|
1527
|
+
ref: j,
|
|
1527
1528
|
type: "text",
|
|
1528
1529
|
inputMode: "numeric",
|
|
1529
1530
|
disabled: g,
|
|
1530
1531
|
placeholder: c === "persian" ? h : "1405/01/15",
|
|
1531
1532
|
value: O,
|
|
1532
|
-
onChange:
|
|
1533
|
+
onChange: M,
|
|
1533
1534
|
style: {
|
|
1534
1535
|
width: "180px",
|
|
1535
1536
|
maxWidth: "100%",
|
|
@@ -1538,7 +1539,7 @@ var me = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a,
|
|
|
1538
1539
|
padding: "8px 12px",
|
|
1539
1540
|
paddingInlineEnd: m && O ? "32px" : "12px",
|
|
1540
1541
|
borderRadius: w.radii.sm,
|
|
1541
|
-
border: `1px solid ${
|
|
1542
|
+
border: `1px solid ${ee ? w.colors.holiday : w.colors.border}`,
|
|
1542
1543
|
backgroundColor: w.colors.background,
|
|
1543
1544
|
color: w.colors.textPrimary,
|
|
1544
1545
|
fontSize: "14px",
|
|
@@ -1553,7 +1554,7 @@ var me = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a,
|
|
|
1553
1554
|
}), m && O && !g && /* @__PURE__ */ l("button", {
|
|
1554
1555
|
type: "button",
|
|
1555
1556
|
"aria-label": "پاک کردن",
|
|
1556
|
-
onClick:
|
|
1557
|
+
onClick: N,
|
|
1557
1558
|
className: b,
|
|
1558
1559
|
style: {
|
|
1559
1560
|
position: "absolute",
|
|
@@ -1576,12 +1577,12 @@ var me = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a,
|
|
|
1576
1577
|
};
|
|
1577
1578
|
//#endregion
|
|
1578
1579
|
//#region src/events/event-utils.ts
|
|
1579
|
-
function
|
|
1580
|
-
return !t || t.length === 0 ? [] : t.filter((t) =>
|
|
1580
|
+
function _e(e, t) {
|
|
1581
|
+
return !t || t.length === 0 ? [] : t.filter((t) => x(t.date, e));
|
|
1581
1582
|
}
|
|
1582
1583
|
//#endregion
|
|
1583
1584
|
//#region src/holidays/iran-holidays.ts
|
|
1584
|
-
var
|
|
1585
|
+
var ve = {
|
|
1585
1586
|
"0-1": "جشن نوروز / سال نو",
|
|
1586
1587
|
"0-2": "عید نوروز",
|
|
1587
1588
|
"0-3": "عید نوروز",
|
|
@@ -1593,10 +1594,10 @@ var ge = {
|
|
|
1593
1594
|
"10-22": "پیروزی انقلاب اسلامی",
|
|
1594
1595
|
"11-29": "روز ملی شدن صنعت نفت"
|
|
1595
1596
|
};
|
|
1596
|
-
function
|
|
1597
|
-
return
|
|
1597
|
+
function q(e) {
|
|
1598
|
+
return y(e.year, e.month, e.day).getDay() === 5;
|
|
1598
1599
|
}
|
|
1599
|
-
function
|
|
1600
|
+
function ye(e, t) {
|
|
1600
1601
|
if (t && t.length > 0) {
|
|
1601
1602
|
let n = t.find((t) => t.date.year === e.year && t.date.month === e.month && t.date.day === e.day);
|
|
1602
1603
|
if (n) return {
|
|
@@ -1606,11 +1607,11 @@ function _e(e, t) {
|
|
|
1606
1607
|
};
|
|
1607
1608
|
}
|
|
1608
1609
|
let n = `${e.month}-${e.day}`;
|
|
1609
|
-
return
|
|
1610
|
-
title:
|
|
1610
|
+
return ve[n] ? {
|
|
1611
|
+
title: ve[n],
|
|
1611
1612
|
type: "solar",
|
|
1612
1613
|
isOff: !0
|
|
1613
|
-
} :
|
|
1614
|
+
} : q(e) ? {
|
|
1614
1615
|
title: "جمعه (تعطیل پایان هفته)",
|
|
1615
1616
|
type: "solar",
|
|
1616
1617
|
isOff: !0
|
|
@@ -1618,12 +1619,12 @@ function _e(e, t) {
|
|
|
1618
1619
|
}
|
|
1619
1620
|
//#endregion
|
|
1620
1621
|
//#region src/components/JalaliDatePicker.tsx
|
|
1621
|
-
function
|
|
1622
|
-
let [
|
|
1622
|
+
function be({ mode: e = "single", value: t, defaultValue: r, onChange: p, minDate: m, maxDate: h, isDateDisabled: g, firstDayOfWeek: _ = 0, variant: v = "popover", placeholder: y = "YYYY/MM/DD", digitType: b = "persian", className: S, style: E, classNames: D, styles: O, showFooter: k = !0, showStatusText: A = !0, allowClear: j = !0, enableTime: M = !1, timeValue: P, defaultTimeValue: F, onTimeChange: I, minuteStep: re = 1, hourStep: L = 1, showSeconds: z = !1, numberOfMonths: V = 1, useMaskedInput: ie = !1, events: ae, showHolidays: H = !1, customHolidays: U, zIndex: W = 9999 }) {
|
|
1623
|
+
let [G, K] = s(v === "inline"), [me, he] = s(!1), ve = o(null), q = o(null), [be, xe] = s(null), J = v === "modal";
|
|
1623
1624
|
i(() => {
|
|
1624
|
-
|
|
1625
|
-
}, [
|
|
1626
|
-
let
|
|
1625
|
+
v === "inline" && K(!0);
|
|
1626
|
+
}, [v]);
|
|
1627
|
+
let Se = a(() => F || (t instanceof Date ? {
|
|
1627
1628
|
hour: t.getHours(),
|
|
1628
1629
|
minute: t.getMinutes(),
|
|
1629
1630
|
second: t.getSeconds()
|
|
@@ -1631,140 +1632,160 @@ function ve({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
|
|
|
1631
1632
|
hour: r.getHours(),
|
|
1632
1633
|
minute: r.getMinutes(),
|
|
1633
1634
|
second: r.getSeconds()
|
|
1634
|
-
} :
|
|
1635
|
-
|
|
1635
|
+
} : ue()), [
|
|
1636
|
+
F,
|
|
1636
1637
|
t,
|
|
1637
1638
|
r
|
|
1638
|
-
]), [
|
|
1639
|
+
]), [Ce, we] = s(Se), Y = P === void 0 ? Ce : P ?? ue();
|
|
1639
1640
|
i(() => {
|
|
1640
|
-
if (
|
|
1641
|
+
if (v === "inline" || !G) return;
|
|
1641
1642
|
let e = (e) => {
|
|
1642
|
-
|
|
1643
|
+
ve.current && !ve.current.contains(e.target) && !q.current?.contains(e.target) && (K(!1), he(!1));
|
|
1643
1644
|
};
|
|
1644
1645
|
return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e, { passive: !0 }), () => {
|
|
1645
1646
|
document.removeEventListener("mousedown", e), document.removeEventListener("touchstart", e);
|
|
1646
1647
|
};
|
|
1647
|
-
}, [
|
|
1648
|
-
|
|
1648
|
+
}, [v, G]), i(() => {
|
|
1649
|
+
if (v !== "popover" || !G) {
|
|
1650
|
+
xe(null);
|
|
1651
|
+
return;
|
|
1652
|
+
}
|
|
1653
|
+
let e = () => {
|
|
1654
|
+
let e = ve.current, t = q.current;
|
|
1655
|
+
if (!e || !t) return;
|
|
1656
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = Math.max(0, window.innerHeight - n.bottom - 6 - 12), a = Math.max(0, n.top - 6 - 12), o = r.height > i && a > i, s = Math.max(120, o ? a : i), c = Math.min(r.height, s), l = o ? Math.max(12, n.top - 6 - c) : n.bottom + 6, u = Math.max(12, window.innerWidth - r.width - 12), d = Math.min(Math.max(12, n.left), u);
|
|
1657
|
+
xe((e) => e?.top === l && e.left === d && e.maxHeight === s ? e : {
|
|
1658
|
+
top: l,
|
|
1659
|
+
left: d,
|
|
1660
|
+
maxHeight: s
|
|
1661
|
+
});
|
|
1662
|
+
};
|
|
1663
|
+
e();
|
|
1664
|
+
let t = typeof ResizeObserver > "u" ? null : new ResizeObserver(e);
|
|
1665
|
+
return q.current && t?.observe(q.current), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
1666
|
+
t?.disconnect(), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
1667
|
+
};
|
|
1668
|
+
}, [v, G]);
|
|
1669
|
+
let Te = a(() => {
|
|
1649
1670
|
if (t !== void 0) {
|
|
1650
1671
|
if (!t) return null;
|
|
1651
|
-
if (t instanceof Date) return
|
|
1672
|
+
if (t instanceof Date) return w(t);
|
|
1652
1673
|
if (Array.isArray(t)) {
|
|
1653
1674
|
if (e === "range") {
|
|
1654
1675
|
let [e, n] = t;
|
|
1655
|
-
return [e ?
|
|
1676
|
+
return [e ? w(e) : null, n ? w(n) : null];
|
|
1656
1677
|
}
|
|
1657
|
-
if (e === "multiple") return t.map((e) =>
|
|
1678
|
+
if (e === "multiple") return t.map((e) => w(e));
|
|
1658
1679
|
}
|
|
1659
1680
|
return null;
|
|
1660
1681
|
}
|
|
1661
|
-
}, [t, e]),
|
|
1682
|
+
}, [t, e]), Ee = a(() => {
|
|
1662
1683
|
if (r !== void 0) {
|
|
1663
1684
|
if (!r) return null;
|
|
1664
|
-
if (r instanceof Date) return
|
|
1685
|
+
if (r instanceof Date) return w(r);
|
|
1665
1686
|
if (Array.isArray(r)) {
|
|
1666
1687
|
if (e === "range") {
|
|
1667
1688
|
let [e, t] = r;
|
|
1668
|
-
return [e ?
|
|
1689
|
+
return [e ? w(e) : null, t ? w(t) : null];
|
|
1669
1690
|
}
|
|
1670
|
-
if (e === "multiple") return r.map((e) =>
|
|
1691
|
+
if (e === "multiple") return r.map((e) => w(e));
|
|
1671
1692
|
}
|
|
1672
1693
|
return null;
|
|
1673
1694
|
}
|
|
1674
|
-
}, [r, e]),
|
|
1695
|
+
}, [r, e]), De = a(() => m ? w(m) : void 0, [m]), Oe = a(() => h ? w(h) : void 0, [h]), ke = n((e) => g ? g(T(e)) : !1, [g]), Ae = n((t, n) => {
|
|
1675
1696
|
if (!t) return null;
|
|
1676
|
-
let r = n ?? Y, i = M ? r.hour : 0, a = M ? r.minute : 0, o = M &&
|
|
1677
|
-
if (e === "single" && !Array.isArray(t)) return
|
|
1697
|
+
let r = n ?? Y, i = M ? r.hour : 0, a = M ? r.minute : 0, o = M && z ? r.second ?? 0 : 0;
|
|
1698
|
+
if (e === "single" && !Array.isArray(t)) return T(t, i, a, o);
|
|
1678
1699
|
if (e === "range" && Array.isArray(t)) {
|
|
1679
1700
|
let [e, n] = t;
|
|
1680
|
-
return [e ?
|
|
1701
|
+
return [e ? T(e, 0, 0, 0) : null, n ? T(n, 23, 59, 59) : null];
|
|
1681
1702
|
}
|
|
1682
|
-
return e === "multiple" && Array.isArray(t) ? t.map((e) =>
|
|
1703
|
+
return e === "multiple" && Array.isArray(t) ? t.map((e) => T(e, i, a, o)) : null;
|
|
1683
1704
|
}, [
|
|
1684
1705
|
e,
|
|
1685
1706
|
M,
|
|
1686
1707
|
Y,
|
|
1687
|
-
|
|
1688
|
-
]), { selected: X, viewYear: Z, viewMonth: Q, grid:
|
|
1708
|
+
z
|
|
1709
|
+
]), { selected: X, viewYear: Z, viewMonth: Q, grid: je, goToPrevMonth: Me, goToNextMonth: Ne, setView: Pe, goToToday: Fe, selectDate: Ie, setHoverDate: Le, hoverDate: Re, clear: ze } = te({
|
|
1689
1710
|
mode: e,
|
|
1690
|
-
value:
|
|
1691
|
-
defaultValue:
|
|
1692
|
-
minDate:
|
|
1693
|
-
maxDate:
|
|
1694
|
-
firstDayOfWeek:
|
|
1695
|
-
isDateDisabled:
|
|
1711
|
+
value: Te,
|
|
1712
|
+
defaultValue: Ee,
|
|
1713
|
+
minDate: De,
|
|
1714
|
+
maxDate: Oe,
|
|
1715
|
+
firstDayOfWeek: _,
|
|
1716
|
+
isDateDisabled: g ? ke : void 0,
|
|
1696
1717
|
onChange: (e) => {
|
|
1697
|
-
|
|
1718
|
+
p?.(Ae(e));
|
|
1698
1719
|
}
|
|
1699
|
-
}),
|
|
1700
|
-
P === void 0 &&
|
|
1720
|
+
}), Be = n((e) => {
|
|
1721
|
+
P === void 0 && we(e), I?.(e), X && p && p(Ae(X, e));
|
|
1701
1722
|
}, [
|
|
1702
1723
|
P,
|
|
1703
|
-
|
|
1724
|
+
I,
|
|
1704
1725
|
X,
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
]),
|
|
1708
|
-
|
|
1709
|
-
},
|
|
1710
|
-
e.stopPropagation(),
|
|
1711
|
-
}, { handleKeyDown:
|
|
1726
|
+
p,
|
|
1727
|
+
Ae
|
|
1728
|
+
]), Ve = e === "single" ? X : null, He = (t) => {
|
|
1729
|
+
Ie(t), v === "popover" && e === "single" && !M && K(!1);
|
|
1730
|
+
}, Ue = (e) => {
|
|
1731
|
+
e.stopPropagation(), ze();
|
|
1732
|
+
}, { handleKeyDown: We, getCellTabIndex: Ge, setFocusedDate: Ke } = ne({
|
|
1712
1733
|
viewYear: Z,
|
|
1713
1734
|
viewMonth: Q,
|
|
1714
|
-
selectedDate:
|
|
1715
|
-
onSelectDate:
|
|
1716
|
-
onViewChange:
|
|
1735
|
+
selectedDate: Ve,
|
|
1736
|
+
onSelectDate: He,
|
|
1737
|
+
onViewChange: Pe,
|
|
1717
1738
|
isRtl: !0
|
|
1718
1739
|
});
|
|
1719
1740
|
i(() => {
|
|
1720
|
-
if (!J || !
|
|
1741
|
+
if (!J || !G) return;
|
|
1721
1742
|
let e = document.body.style.overflow;
|
|
1722
1743
|
document.body.style.overflow = "hidden";
|
|
1723
1744
|
let t = (e) => {
|
|
1724
|
-
e.key === "Escape" &&
|
|
1745
|
+
e.key === "Escape" && K(!1);
|
|
1725
1746
|
};
|
|
1726
1747
|
return window.addEventListener("keydown", t), () => {
|
|
1727
1748
|
document.body.style.overflow = e, window.removeEventListener("keydown", t);
|
|
1728
1749
|
};
|
|
1729
|
-
}, [J,
|
|
1750
|
+
}, [J, G]);
|
|
1730
1751
|
let $ = a(() => Q === 11 ? {
|
|
1731
1752
|
year: Z + 1,
|
|
1732
1753
|
month: 0
|
|
1733
1754
|
} : {
|
|
1734
1755
|
year: Z,
|
|
1735
1756
|
month: Q + 1
|
|
1736
|
-
}, [Z, Q]),
|
|
1757
|
+
}, [Z, Q]), qe = a(() => Q === 0 ? {
|
|
1737
1758
|
year: Z - 1,
|
|
1738
1759
|
month: 11
|
|
1739
1760
|
} : {
|
|
1740
1761
|
year: Z,
|
|
1741
1762
|
month: Q - 1
|
|
1742
|
-
}, [Z, Q]),
|
|
1743
|
-
minDate:
|
|
1744
|
-
maxDate:
|
|
1745
|
-
}),
|
|
1763
|
+
}, [Z, Q]), Je = !N(qe.year, qe.month, {
|
|
1764
|
+
minDate: De,
|
|
1765
|
+
maxDate: Oe
|
|
1766
|
+
}), Ye = V === 2 ? $.month === 11 ? {
|
|
1746
1767
|
year: $.year + 1,
|
|
1747
1768
|
month: 0
|
|
1748
1769
|
} : {
|
|
1749
1770
|
year: $.year,
|
|
1750
1771
|
month: $.month + 1
|
|
1751
|
-
} : $,
|
|
1752
|
-
minDate:
|
|
1753
|
-
maxDate:
|
|
1754
|
-
}),
|
|
1755
|
-
if (
|
|
1756
|
-
let t =
|
|
1772
|
+
} : $, Xe = !N(Ye.year, Ye.month, {
|
|
1773
|
+
minDate: De,
|
|
1774
|
+
maxDate: Oe
|
|
1775
|
+
}), Ze = a(() => {
|
|
1776
|
+
if (V !== 2) return [];
|
|
1777
|
+
let t = C({
|
|
1757
1778
|
year: $.year,
|
|
1758
1779
|
month: $.month,
|
|
1759
|
-
firstDayOfWeek:
|
|
1760
|
-
minDate:
|
|
1761
|
-
maxDate:
|
|
1780
|
+
firstDayOfWeek: _,
|
|
1781
|
+
minDate: De,
|
|
1782
|
+
maxDate: Oe
|
|
1762
1783
|
});
|
|
1763
1784
|
if (e !== "range") return t;
|
|
1764
|
-
let [n, r] = X || [null, null], i = r ?? (n &&
|
|
1785
|
+
let [n, r] = X || [null, null], i = r ?? (n && Re ? Re : null);
|
|
1765
1786
|
return t.map((e) => {
|
|
1766
|
-
let t = n ?
|
|
1767
|
-
return n && i && (a =
|
|
1787
|
+
let t = n ? x(e.jalali, n) : !1, r = i ? x(e.jalali, i) : !1, a = !1;
|
|
1788
|
+
return n && i && (a = ee(e.jalali, n, i)), {
|
|
1768
1789
|
...e,
|
|
1769
1790
|
isSelected: t || r,
|
|
1770
1791
|
isInRange: a,
|
|
@@ -1773,101 +1794,103 @@ function ve({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
|
|
|
1773
1794
|
};
|
|
1774
1795
|
});
|
|
1775
1796
|
}, [
|
|
1776
|
-
|
|
1797
|
+
V,
|
|
1777
1798
|
$,
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1799
|
+
_,
|
|
1800
|
+
De,
|
|
1801
|
+
Oe,
|
|
1781
1802
|
e,
|
|
1782
1803
|
X,
|
|
1783
|
-
|
|
1784
|
-
]),
|
|
1804
|
+
Re
|
|
1805
|
+
]), Qe = a(() => {
|
|
1785
1806
|
if (!X) return "";
|
|
1786
1807
|
if (e === "single") {
|
|
1787
|
-
let e =
|
|
1788
|
-
return M && Y ? `${e} ${
|
|
1808
|
+
let e = B(X, "YYYY/MM/DD", { digitType: b });
|
|
1809
|
+
return M && Y ? `${e} ${de(Y, z, b)}` : e;
|
|
1789
1810
|
}
|
|
1790
1811
|
if (e === "range") {
|
|
1791
1812
|
let [e, t] = X || [null, null];
|
|
1792
|
-
if (e && t) return `${
|
|
1793
|
-
if (e) return `${
|
|
1813
|
+
if (e && t) return `${B(e, "YYYY/MM/DD", { digitType: b })} - ${B(t, "YYYY/MM/DD", { digitType: b })}`;
|
|
1814
|
+
if (e) return `${B(e, "YYYY/MM/DD", { digitType: b })} - ...`;
|
|
1794
1815
|
}
|
|
1795
|
-
return e === "multiple" && Array.isArray(X) ? `${
|
|
1816
|
+
return e === "multiple" && Array.isArray(X) ? `${R(X.length)} تاریخ انتخاب شده` : "";
|
|
1796
1817
|
}, [
|
|
1797
1818
|
X,
|
|
1798
1819
|
e,
|
|
1799
|
-
|
|
1820
|
+
b,
|
|
1800
1821
|
M,
|
|
1801
1822
|
Y,
|
|
1802
|
-
|
|
1803
|
-
]),
|
|
1804
|
-
className:
|
|
1823
|
+
z
|
|
1824
|
+
]), $e = !!(e === "single" ? X : e === "range" ? X?.[0] : X?.length), et = (e, t, n, r = !0, i = !0) => /* @__PURE__ */ u("div", {
|
|
1825
|
+
className: D?.calendarPane,
|
|
1805
1826
|
style: {
|
|
1806
1827
|
width: "calc(7 * var(--pdp-cell-size, 34px) + 6 * 4px)",
|
|
1807
1828
|
maxWidth: "100%",
|
|
1808
1829
|
minWidth: 0,
|
|
1809
1830
|
flex: "1 1 calc(7 * var(--pdp-cell-size, 34px) + 6 * 4px)",
|
|
1810
|
-
...
|
|
1831
|
+
...O?.calendarPane
|
|
1811
1832
|
},
|
|
1812
1833
|
children: [
|
|
1813
|
-
/* @__PURE__ */ l(
|
|
1834
|
+
/* @__PURE__ */ l(oe, {
|
|
1814
1835
|
year: e,
|
|
1815
|
-
monthName:
|
|
1816
|
-
onPrevMonth: r ?
|
|
1817
|
-
onNextMonth: i ?
|
|
1818
|
-
onTitleClick: () =>
|
|
1819
|
-
isPickerOpen:
|
|
1820
|
-
isPrevDisabled: !r ||
|
|
1821
|
-
isNextDisabled: !i ||
|
|
1822
|
-
classNames:
|
|
1823
|
-
styles:
|
|
1836
|
+
monthName: f[t],
|
|
1837
|
+
onPrevMonth: r ? Me : () => {},
|
|
1838
|
+
onNextMonth: i ? Ne : () => {},
|
|
1839
|
+
onTitleClick: () => he((e) => !e),
|
|
1840
|
+
isPickerOpen: me,
|
|
1841
|
+
isPrevDisabled: !r || Je,
|
|
1842
|
+
isNextDisabled: !i || Xe,
|
|
1843
|
+
classNames: D,
|
|
1844
|
+
styles: O
|
|
1824
1845
|
}),
|
|
1825
|
-
/* @__PURE__ */ l(
|
|
1826
|
-
firstDayOfWeek:
|
|
1827
|
-
classNames:
|
|
1828
|
-
styles:
|
|
1846
|
+
/* @__PURE__ */ l(se, {
|
|
1847
|
+
firstDayOfWeek: _,
|
|
1848
|
+
classNames: D,
|
|
1849
|
+
styles: O
|
|
1829
1850
|
}),
|
|
1830
1851
|
/* @__PURE__ */ l("div", {
|
|
1831
1852
|
role: "grid",
|
|
1832
|
-
"aria-label": `${
|
|
1833
|
-
className:
|
|
1853
|
+
"aria-label": `${f[t]} ${R(e)}`,
|
|
1854
|
+
className: D?.grid,
|
|
1834
1855
|
style: {
|
|
1835
1856
|
display: "grid",
|
|
1836
1857
|
gridTemplateColumns: "repeat(7, minmax(0, 1fr))",
|
|
1837
1858
|
gap: "4px",
|
|
1838
1859
|
justifyContent: "center",
|
|
1839
1860
|
alignItems: "center",
|
|
1840
|
-
...
|
|
1861
|
+
...O?.grid
|
|
1841
1862
|
},
|
|
1842
1863
|
children: n.map((e, t) => {
|
|
1843
|
-
let n =
|
|
1844
|
-
return /* @__PURE__ */ l(
|
|
1864
|
+
let n = H ? ye(e.jalali, U) : null, r = _e(e.jalali, ae);
|
|
1865
|
+
return /* @__PURE__ */ l(ce, {
|
|
1845
1866
|
cell: e,
|
|
1846
|
-
digitType:
|
|
1867
|
+
digitType: b,
|
|
1847
1868
|
isHoliday: !!n,
|
|
1848
1869
|
holidayTitle: n?.title,
|
|
1849
1870
|
events: r,
|
|
1850
|
-
classNames:
|
|
1851
|
-
styles:
|
|
1852
|
-
tabIndex:
|
|
1853
|
-
onSelect:
|
|
1854
|
-
onHover:
|
|
1855
|
-
onFocus:
|
|
1871
|
+
classNames: D,
|
|
1872
|
+
styles: O,
|
|
1873
|
+
tabIndex: Ge(e.jalali),
|
|
1874
|
+
onSelect: He,
|
|
1875
|
+
onHover: Le,
|
|
1876
|
+
onFocus: Ke
|
|
1856
1877
|
}, t);
|
|
1857
1878
|
})
|
|
1858
1879
|
})
|
|
1859
1880
|
]
|
|
1860
|
-
}),
|
|
1881
|
+
}), tt = /* @__PURE__ */ l("div", {
|
|
1882
|
+
ref: q,
|
|
1861
1883
|
role: J ? "dialog" : "region",
|
|
1862
1884
|
"aria-modal": J ? !0 : void 0,
|
|
1863
1885
|
"aria-label": "تقویم شمسی",
|
|
1864
|
-
onKeyDown:
|
|
1886
|
+
onKeyDown: We,
|
|
1865
1887
|
onClick: (e) => e.stopPropagation(),
|
|
1866
|
-
className:
|
|
1888
|
+
className: D?.calendar,
|
|
1867
1889
|
style: {
|
|
1868
|
-
position:
|
|
1869
|
-
top:
|
|
1870
|
-
left:
|
|
1890
|
+
position: v === "popover" ? "fixed" : J ? "relative" : "static",
|
|
1891
|
+
top: v === "popover" ? be?.top ?? 0 : void 0,
|
|
1892
|
+
left: v === "popover" ? be?.left ?? 0 : void 0,
|
|
1893
|
+
visibility: v === "popover" && !be ? "hidden" : "visible",
|
|
1871
1894
|
zIndex: J ? W + 1 : W,
|
|
1872
1895
|
padding: "12px",
|
|
1873
1896
|
backgroundColor: "var(--pdp-surface-bg, #ffffff)",
|
|
@@ -1875,9 +1898,9 @@ function ve({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
|
|
|
1875
1898
|
border: "1px solid var(--pdp-surface-border, #e2e8f0)",
|
|
1876
1899
|
boxShadow: J ? "0 20px 25px -5px rgb(0 0 0 / 0.3)" : "0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",
|
|
1877
1900
|
width: "max-content",
|
|
1878
|
-
maxWidth:
|
|
1879
|
-
maxHeight: J ? "calc(100dvh - 32px)" : void 0,
|
|
1880
|
-
overflowY: J ? "auto" : void 0,
|
|
1901
|
+
maxWidth: v === "inline" ? "100%" : "calc(100vw - 24px)",
|
|
1902
|
+
maxHeight: J ? "calc(100dvh - 32px)" : v === "popover" ? be?.maxHeight : void 0,
|
|
1903
|
+
overflowY: J || v === "popover" ? "auto" : void 0,
|
|
1881
1904
|
overflowX: "hidden",
|
|
1882
1905
|
userSelect: "none",
|
|
1883
1906
|
display: "flex",
|
|
@@ -1885,23 +1908,23 @@ function ve({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
|
|
|
1885
1908
|
gap: "8px",
|
|
1886
1909
|
direction: "rtl",
|
|
1887
1910
|
boxSizing: "border-box",
|
|
1888
|
-
...
|
|
1911
|
+
...O?.calendar
|
|
1889
1912
|
},
|
|
1890
|
-
children:
|
|
1913
|
+
children: me ? /* @__PURE__ */ l(le, {
|
|
1891
1914
|
currentYear: Z,
|
|
1892
1915
|
currentMonth: Q,
|
|
1893
1916
|
onSelectMonth: (e) => {
|
|
1894
|
-
|
|
1917
|
+
Pe(Z, e), he(!1);
|
|
1895
1918
|
},
|
|
1896
|
-
onSelectYear: (e) =>
|
|
1897
|
-
minDate:
|
|
1898
|
-
maxDate:
|
|
1899
|
-
isDateDisabled:
|
|
1900
|
-
classNames:
|
|
1901
|
-
styles:
|
|
1919
|
+
onSelectYear: (e) => Pe(e, Q),
|
|
1920
|
+
minDate: De,
|
|
1921
|
+
maxDate: Oe,
|
|
1922
|
+
isDateDisabled: g ? ke : void 0,
|
|
1923
|
+
classNames: D,
|
|
1924
|
+
styles: O
|
|
1902
1925
|
}) : /* @__PURE__ */ u(c, { children: [
|
|
1903
1926
|
/* @__PURE__ */ u("div", {
|
|
1904
|
-
className:
|
|
1927
|
+
className: D?.calendarPanes,
|
|
1905
1928
|
style: {
|
|
1906
1929
|
display: "flex",
|
|
1907
1930
|
flexDirection: "row",
|
|
@@ -1912,63 +1935,63 @@ function ve({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
|
|
|
1912
1935
|
width: "100%",
|
|
1913
1936
|
minWidth: 0,
|
|
1914
1937
|
boxSizing: "border-box",
|
|
1915
|
-
...
|
|
1938
|
+
...O?.calendarPanes
|
|
1916
1939
|
},
|
|
1917
|
-
children: [
|
|
1940
|
+
children: [et(Z, Q, je, !0, V === 1), V === 2 && /* @__PURE__ */ l(c, { children: et($.year, $.month, Ze, !1, !0) })]
|
|
1918
1941
|
}),
|
|
1919
|
-
M && /* @__PURE__ */ l(
|
|
1942
|
+
M && /* @__PURE__ */ l(pe, {
|
|
1920
1943
|
value: Y,
|
|
1921
|
-
onChange:
|
|
1922
|
-
minuteStep:
|
|
1923
|
-
hourStep:
|
|
1924
|
-
showSeconds:
|
|
1925
|
-
digitType:
|
|
1926
|
-
classNames:
|
|
1927
|
-
styles:
|
|
1944
|
+
onChange: Be,
|
|
1945
|
+
minuteStep: re,
|
|
1946
|
+
hourStep: L,
|
|
1947
|
+
showSeconds: z,
|
|
1948
|
+
digitType: b,
|
|
1949
|
+
classNames: D,
|
|
1950
|
+
styles: O
|
|
1928
1951
|
}),
|
|
1929
|
-
|
|
1952
|
+
k && /* @__PURE__ */ l(fe, {
|
|
1930
1953
|
mode: e,
|
|
1931
|
-
digitType:
|
|
1954
|
+
digitType: b,
|
|
1932
1955
|
showStatusText: A,
|
|
1933
1956
|
selectedDate: e === "single" ? X : null,
|
|
1934
1957
|
selectedRange: e === "range" ? X : void 0,
|
|
1935
1958
|
selectedDates: e === "multiple" ? X : void 0,
|
|
1936
1959
|
selectedTime: M ? Y : void 0,
|
|
1937
|
-
onToday:
|
|
1938
|
-
classNames:
|
|
1939
|
-
styles:
|
|
1960
|
+
onToday: Fe,
|
|
1961
|
+
classNames: D,
|
|
1962
|
+
styles: O
|
|
1940
1963
|
})
|
|
1941
1964
|
] })
|
|
1942
1965
|
});
|
|
1943
1966
|
return /* @__PURE__ */ u("div", {
|
|
1944
|
-
ref:
|
|
1945
|
-
className:
|
|
1967
|
+
ref: ve,
|
|
1968
|
+
className: S ?? D?.root,
|
|
1946
1969
|
style: {
|
|
1947
1970
|
position: "relative",
|
|
1948
1971
|
display: "inline-block",
|
|
1949
1972
|
maxWidth: "100%",
|
|
1950
1973
|
verticalAlign: "top",
|
|
1951
|
-
zIndex:
|
|
1952
|
-
...
|
|
1953
|
-
...
|
|
1974
|
+
zIndex: G && v === "popover" ? W : 1,
|
|
1975
|
+
...E,
|
|
1976
|
+
...O?.root
|
|
1954
1977
|
},
|
|
1955
|
-
children: [
|
|
1956
|
-
value:
|
|
1957
|
-
digitType:
|
|
1958
|
-
placeholder:
|
|
1978
|
+
children: [v !== "inline" && (ie && e === "single" && v === "popover" ? /* @__PURE__ */ l(ge, {
|
|
1979
|
+
value: Ve,
|
|
1980
|
+
digitType: b,
|
|
1981
|
+
placeholder: y,
|
|
1959
1982
|
onChange: (e) => {
|
|
1960
|
-
e ? (
|
|
1983
|
+
e ? (Ie(e), Pe(e.year, e.month)) : ze();
|
|
1961
1984
|
},
|
|
1962
|
-
onClick: () =>
|
|
1963
|
-
className:
|
|
1985
|
+
onClick: () => K(!0),
|
|
1986
|
+
className: D?.input,
|
|
1964
1987
|
style: {
|
|
1965
1988
|
direction: "ltr",
|
|
1966
1989
|
textAlign: "left",
|
|
1967
|
-
...
|
|
1990
|
+
...O?.input
|
|
1968
1991
|
}
|
|
1969
1992
|
}) : /* @__PURE__ */ u("div", {
|
|
1970
1993
|
onClick: (e) => {
|
|
1971
|
-
e.stopPropagation(),
|
|
1994
|
+
e.stopPropagation(), K((e) => !e);
|
|
1972
1995
|
},
|
|
1973
1996
|
style: {
|
|
1974
1997
|
position: "relative",
|
|
@@ -1982,9 +2005,9 @@ function ve({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
|
|
|
1982
2005
|
children: [/* @__PURE__ */ l("input", {
|
|
1983
2006
|
type: "text",
|
|
1984
2007
|
readOnly: !0,
|
|
1985
|
-
placeholder:
|
|
1986
|
-
value:
|
|
1987
|
-
className:
|
|
2008
|
+
placeholder: y,
|
|
2009
|
+
value: Qe,
|
|
2010
|
+
className: D?.input,
|
|
1988
2011
|
style: {
|
|
1989
2012
|
direction: "ltr",
|
|
1990
2013
|
textAlign: "left",
|
|
@@ -1999,11 +2022,11 @@ function ve({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
|
|
|
1999
2022
|
width: "100%",
|
|
2000
2023
|
maxWidth: "100%",
|
|
2001
2024
|
boxSizing: "border-box",
|
|
2002
|
-
...
|
|
2025
|
+
...O?.input
|
|
2003
2026
|
}
|
|
2004
|
-
}), j &&
|
|
2027
|
+
}), j && $e && /* @__PURE__ */ l("button", {
|
|
2005
2028
|
type: "button",
|
|
2006
|
-
onClick:
|
|
2029
|
+
onClick: Ue,
|
|
2007
2030
|
"aria-label": "Clear value",
|
|
2008
2031
|
style: {
|
|
2009
2032
|
position: "absolute",
|
|
@@ -2030,10 +2053,10 @@ function ve({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
|
|
|
2030
2053
|
},
|
|
2031
2054
|
children: "✕"
|
|
2032
2055
|
})]
|
|
2033
|
-
})),
|
|
2056
|
+
})), G && (v === "inline" ? tt : typeof document < "u" ? d(J ? /* @__PURE__ */ l("div", {
|
|
2034
2057
|
role: "presentation",
|
|
2035
|
-
onClick: () =>
|
|
2036
|
-
className:
|
|
2058
|
+
onClick: () => K(!1),
|
|
2059
|
+
className: D?.modalBackdrop,
|
|
2037
2060
|
style: {
|
|
2038
2061
|
position: "fixed",
|
|
2039
2062
|
top: 0,
|
|
@@ -2050,80 +2073,80 @@ function ve({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
|
|
|
2050
2073
|
boxSizing: "border-box",
|
|
2051
2074
|
overflowY: "auto",
|
|
2052
2075
|
direction: "rtl",
|
|
2053
|
-
...
|
|
2076
|
+
...O?.modalBackdrop
|
|
2054
2077
|
},
|
|
2055
|
-
children:
|
|
2056
|
-
}) :
|
|
2078
|
+
children: tt
|
|
2079
|
+
}) : tt, document.body) : null)]
|
|
2057
2080
|
});
|
|
2058
2081
|
}
|
|
2059
2082
|
//#endregion
|
|
2060
2083
|
//#region src/components/dual-calendar/DualMonthCalendar.tsx
|
|
2061
|
-
var
|
|
2062
|
-
let { theme: w } =
|
|
2084
|
+
var xe = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDate: i, firstDayOfWeek: o = 0, digitType: c = "persian", minDate: d, maxDate: p, isDateDisabled: m, direction: h = "rtl", className: g, style: _, classNames: v, styles: y }) => {
|
|
2085
|
+
let { theme: w } = H(), [T, E] = s(t), D = e === void 0 ? T : e, [O, A] = s(null), j = (e) => c === "persian" ? R(e) : String(e), M = a(() => b(), []), [P, te] = s(() => i || (D[0] ? {
|
|
2063
2086
|
year: D[0].year,
|
|
2064
2087
|
month: D[0].month
|
|
2065
2088
|
} : {
|
|
2066
|
-
year:
|
|
2067
|
-
month:
|
|
2068
|
-
})),
|
|
2069
|
-
year:
|
|
2089
|
+
year: M.year,
|
|
2090
|
+
month: M.month
|
|
2091
|
+
})), F = a(() => P.month === 11 ? {
|
|
2092
|
+
year: P.year + 1,
|
|
2070
2093
|
month: 0
|
|
2071
2094
|
} : {
|
|
2072
|
-
year:
|
|
2073
|
-
month:
|
|
2074
|
-
}, [
|
|
2075
|
-
year:
|
|
2095
|
+
year: P.year,
|
|
2096
|
+
month: P.month + 1
|
|
2097
|
+
}, [P]), I = a(() => P.month === 0 ? {
|
|
2098
|
+
year: P.year - 1,
|
|
2076
2099
|
month: 11
|
|
2077
2100
|
} : {
|
|
2078
|
-
year:
|
|
2079
|
-
month:
|
|
2080
|
-
}, [
|
|
2081
|
-
minDate:
|
|
2082
|
-
maxDate:
|
|
2083
|
-
}),
|
|
2084
|
-
year:
|
|
2101
|
+
year: P.year,
|
|
2102
|
+
month: P.month - 1
|
|
2103
|
+
}, [P]), ne = a(() => d ? S(d) : void 0, [d]), re = a(() => p ? S(p) : void 0, [p]), L = !N(I.year, I.month, {
|
|
2104
|
+
minDate: ne,
|
|
2105
|
+
maxDate: re
|
|
2106
|
+
}), z = F.month === 11 ? {
|
|
2107
|
+
year: F.year + 1,
|
|
2085
2108
|
month: 0
|
|
2086
2109
|
} : {
|
|
2087
|
-
year:
|
|
2088
|
-
month:
|
|
2089
|
-
},
|
|
2090
|
-
minDate:
|
|
2091
|
-
maxDate:
|
|
2092
|
-
}),
|
|
2093
|
-
|
|
2110
|
+
year: F.year,
|
|
2111
|
+
month: F.month + 1
|
|
2112
|
+
}, B = !N(z.year, z.month, {
|
|
2113
|
+
minDate: ne,
|
|
2114
|
+
maxDate: re
|
|
2115
|
+
}), V = () => {
|
|
2116
|
+
L || te((e) => e.month === 0 ? {
|
|
2094
2117
|
year: e.year - 1,
|
|
2095
2118
|
month: 11
|
|
2096
2119
|
} : {
|
|
2097
2120
|
year: e.year,
|
|
2098
2121
|
month: e.month - 1
|
|
2099
2122
|
});
|
|
2100
|
-
},
|
|
2101
|
-
|
|
2123
|
+
}, ie = () => {
|
|
2124
|
+
B || te((e) => e.month === 11 ? {
|
|
2102
2125
|
year: e.year + 1,
|
|
2103
2126
|
month: 0
|
|
2104
2127
|
} : {
|
|
2105
2128
|
year: e.year,
|
|
2106
2129
|
month: e.month + 1
|
|
2107
2130
|
});
|
|
2108
|
-
},
|
|
2131
|
+
}, ae = n((t) => {
|
|
2109
2132
|
let [n, i] = D, a;
|
|
2110
|
-
!n || n && i ? a = [t, null] : (a =
|
|
2133
|
+
!n || n && i ? a = [t, null] : (a = k(t, n) < 0 ? [t, n] : [n, t], A(null)), e === void 0 && E(a), r?.(a);
|
|
2111
2134
|
}, [
|
|
2112
2135
|
D,
|
|
2113
2136
|
e,
|
|
2114
2137
|
r
|
|
2115
|
-
]),
|
|
2116
|
-
let n =
|
|
2138
|
+
]), U = n((e, t) => {
|
|
2139
|
+
let n = C({
|
|
2117
2140
|
year: e,
|
|
2118
2141
|
month: t,
|
|
2119
2142
|
firstDayOfWeek: o,
|
|
2120
|
-
minDate:
|
|
2143
|
+
minDate: d,
|
|
2121
2144
|
maxDate: p,
|
|
2122
2145
|
isDateDisabled: m
|
|
2123
|
-
}), [r, i] = D, a = i ?? (r &&
|
|
2146
|
+
}), [r, i] = D, a = i ?? (r && O ? O : null);
|
|
2124
2147
|
return n.map((e) => {
|
|
2125
|
-
let t = r ?
|
|
2126
|
-
return r && a && (i =
|
|
2148
|
+
let t = r ? x(e.jalali, r) : !1, n = a ? x(e.jalali, a) : !1, i = !1;
|
|
2149
|
+
return r && a && (i = ee(e.jalali, r, a)), {
|
|
2127
2150
|
...e,
|
|
2128
2151
|
isSelected: t || n,
|
|
2129
2152
|
isInRange: i,
|
|
@@ -2133,20 +2156,20 @@ var ye = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
|
|
|
2133
2156
|
});
|
|
2134
2157
|
}, [
|
|
2135
2158
|
o,
|
|
2136
|
-
|
|
2159
|
+
d,
|
|
2137
2160
|
p,
|
|
2138
2161
|
m,
|
|
2139
2162
|
D,
|
|
2140
|
-
|
|
2141
|
-
]),
|
|
2142
|
-
|
|
2163
|
+
O
|
|
2164
|
+
]), oe = a(() => U(P.year, P.month), [
|
|
2165
|
+
U,
|
|
2166
|
+
P.year,
|
|
2167
|
+
P.month
|
|
2168
|
+
]), le = a(() => U(F.year, F.month), [
|
|
2169
|
+
U,
|
|
2143
2170
|
F.year,
|
|
2144
2171
|
F.month
|
|
2145
|
-
]),
|
|
2146
|
-
G,
|
|
2147
|
-
L.year,
|
|
2148
|
-
L.month
|
|
2149
|
-
]), ce = (e, t, n, r) => /* @__PURE__ */ u("div", {
|
|
2172
|
+
]), G = (e, t, n, r) => /* @__PURE__ */ u("div", {
|
|
2150
2173
|
dir: h,
|
|
2151
2174
|
className: v?.calendarPane,
|
|
2152
2175
|
style: {
|
|
@@ -2157,7 +2180,7 @@ var ye = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
|
|
|
2157
2180
|
maxWidth: "100%",
|
|
2158
2181
|
minWidth: 0,
|
|
2159
2182
|
flex: "1 1 var(--pdp-calendar-pane-width, 276px)",
|
|
2160
|
-
...
|
|
2183
|
+
...y?.calendarPane
|
|
2161
2184
|
},
|
|
2162
2185
|
children: [
|
|
2163
2186
|
/* @__PURE__ */ u("div", {
|
|
@@ -2168,16 +2191,16 @@ var ye = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
|
|
|
2168
2191
|
justifyContent: "space-between",
|
|
2169
2192
|
padding: "0 4px",
|
|
2170
2193
|
height: "32px",
|
|
2171
|
-
...
|
|
2194
|
+
...y?.header
|
|
2172
2195
|
},
|
|
2173
2196
|
children: [
|
|
2174
2197
|
r ? /* @__PURE__ */ l("button", {
|
|
2175
2198
|
type: "button",
|
|
2176
2199
|
"aria-label": "ماه قبل",
|
|
2177
|
-
onClick:
|
|
2178
|
-
disabled:
|
|
2179
|
-
"aria-disabled":
|
|
2180
|
-
className: W(v?.navButton,
|
|
2200
|
+
onClick: V,
|
|
2201
|
+
disabled: L,
|
|
2202
|
+
"aria-disabled": L,
|
|
2203
|
+
className: W(v?.navButton, L && v?.disabledNavButton),
|
|
2181
2204
|
style: {
|
|
2182
2205
|
width: "28px",
|
|
2183
2206
|
height: "28px",
|
|
@@ -2185,10 +2208,10 @@ var ye = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
|
|
|
2185
2208
|
border: `1px solid ${w.colors.border}`,
|
|
2186
2209
|
backgroundColor: w.colors.background,
|
|
2187
2210
|
color: w.colors.textPrimary,
|
|
2188
|
-
cursor:
|
|
2189
|
-
opacity:
|
|
2190
|
-
...
|
|
2191
|
-
...
|
|
2211
|
+
cursor: L ? "not-allowed" : "pointer",
|
|
2212
|
+
opacity: L ? .38 : 1,
|
|
2213
|
+
...y?.navButton,
|
|
2214
|
+
...L ? y?.disabledNavButton : void 0
|
|
2192
2215
|
},
|
|
2193
2216
|
children: h === "rtl" ? "›" : "‹"
|
|
2194
2217
|
}) : /* @__PURE__ */ l("div", { style: { width: "28px" } }),
|
|
@@ -2199,18 +2222,18 @@ var ye = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
|
|
|
2199
2222
|
color: w.colors.textPrimary
|
|
2200
2223
|
},
|
|
2201
2224
|
children: [
|
|
2202
|
-
|
|
2225
|
+
f[t],
|
|
2203
2226
|
" ",
|
|
2204
|
-
|
|
2227
|
+
j(e)
|
|
2205
2228
|
]
|
|
2206
2229
|
}),
|
|
2207
2230
|
r ? /* @__PURE__ */ l("div", { style: { width: "28px" } }) : /* @__PURE__ */ l("button", {
|
|
2208
2231
|
type: "button",
|
|
2209
2232
|
"aria-label": "ماه بعد",
|
|
2210
|
-
onClick:
|
|
2211
|
-
disabled:
|
|
2212
|
-
"aria-disabled":
|
|
2213
|
-
className: W(v?.navButton,
|
|
2233
|
+
onClick: ie,
|
|
2234
|
+
disabled: B,
|
|
2235
|
+
"aria-disabled": B,
|
|
2236
|
+
className: W(v?.navButton, B && v?.disabledNavButton),
|
|
2214
2237
|
style: {
|
|
2215
2238
|
width: "28px",
|
|
2216
2239
|
height: "28px",
|
|
@@ -2218,23 +2241,23 @@ var ye = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
|
|
|
2218
2241
|
border: `1px solid ${w.colors.border}`,
|
|
2219
2242
|
backgroundColor: w.colors.background,
|
|
2220
2243
|
color: w.colors.textPrimary,
|
|
2221
|
-
cursor:
|
|
2222
|
-
opacity:
|
|
2223
|
-
...
|
|
2224
|
-
...
|
|
2244
|
+
cursor: B ? "not-allowed" : "pointer",
|
|
2245
|
+
opacity: B ? .38 : 1,
|
|
2246
|
+
...y?.navButton,
|
|
2247
|
+
...B ? y?.disabledNavButton : void 0
|
|
2225
2248
|
},
|
|
2226
2249
|
children: h === "rtl" ? "‹" : "›"
|
|
2227
2250
|
})
|
|
2228
2251
|
]
|
|
2229
2252
|
}),
|
|
2230
|
-
/* @__PURE__ */ l(
|
|
2253
|
+
/* @__PURE__ */ l(se, {
|
|
2231
2254
|
firstDayOfWeek: o,
|
|
2232
2255
|
classNames: v,
|
|
2233
|
-
styles:
|
|
2256
|
+
styles: y
|
|
2234
2257
|
}),
|
|
2235
2258
|
/* @__PURE__ */ l("div", {
|
|
2236
2259
|
role: "grid",
|
|
2237
|
-
"aria-label": `${
|
|
2260
|
+
"aria-label": `${f[t]} ${j(e)}`,
|
|
2238
2261
|
dir: h,
|
|
2239
2262
|
className: v?.grid,
|
|
2240
2263
|
style: {
|
|
@@ -2243,16 +2266,16 @@ var ye = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
|
|
|
2243
2266
|
minWidth: 0,
|
|
2244
2267
|
gridTemplateColumns: "repeat(7, minmax(0, 1fr))",
|
|
2245
2268
|
gap: "var(--pdp-cell-gap, 4px)",
|
|
2246
|
-
...
|
|
2269
|
+
...y?.grid
|
|
2247
2270
|
},
|
|
2248
|
-
children: n.map((e) => /* @__PURE__ */ l(
|
|
2271
|
+
children: n.map((e) => /* @__PURE__ */ l(ce, {
|
|
2249
2272
|
cell: e,
|
|
2250
2273
|
digitType: c,
|
|
2251
2274
|
classNames: v,
|
|
2252
|
-
styles:
|
|
2275
|
+
styles: y,
|
|
2253
2276
|
tabIndex: 0,
|
|
2254
|
-
onSelect:
|
|
2255
|
-
onHover:
|
|
2277
|
+
onSelect: ae,
|
|
2278
|
+
onHover: A
|
|
2256
2279
|
}, `${e.jalali.year}-${e.jalali.month}-${e.jalali.day}`))
|
|
2257
2280
|
})
|
|
2258
2281
|
]
|
|
@@ -2279,12 +2302,12 @@ var ye = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
|
|
|
2279
2302
|
width: "calc(var(--pdp-calendar-pane-width, 276px) + var(--pdp-calendar-pane-width, 276px) + 56px)",
|
|
2280
2303
|
maxWidth: "100%",
|
|
2281
2304
|
..._,
|
|
2282
|
-
...
|
|
2305
|
+
...y?.calendar
|
|
2283
2306
|
},
|
|
2284
|
-
children: [
|
|
2307
|
+
children: [G(P.year, P.month, oe, !0), G(F.year, F.month, le, !1)]
|
|
2285
2308
|
});
|
|
2286
2309
|
};
|
|
2287
2310
|
//#endregion
|
|
2288
|
-
export {
|
|
2311
|
+
export { U as DatePickerThemeProvider, ce as DayCell, xe as DualMonthCalendar, oe as Header, p as JALALI_MONTH_NAMES_EN, be as JalaliDatePicker, ge as MaskedDateInput, le as MonthYearPicker, f as PERSIAN_MONTH_NAMES, h as PERSIAN_WEEK_DAYS_LONG, m as PERSIAN_WEEK_DAYS_SHORT, pe as TimePicker, se as Weekdays, D as addDaysToJalali, O as addJalaliDays, me as applyDateMask, F as calculateNextFocusedDate, K as clampTime, k as compareJalaliDates, ie as darkTheme, B as formatJalaliDate, G as formatTimeSegment, de as formatTimeString, C as generateJalaliCalendarGrid, I as getAriaDayLabel, ue as getCurrentTime, _ as getDaysInJalaliMonth, _e as getEventsForDate, E as getJalaliDayOfWeek, j as getJalaliMonthRange, A as getJalaliWeekRange, ye as getOfficialHoliday, b as getTodayJalali, v as gregorianToJalali, ee as isJalaliDateBetween, M as isJalaliDateSelectable, q as isJalaliFriday, g as isJalaliLeapYear, N as isJalaliMonthSelectable, P as isJalaliYearSelectable, x as isSameJalaliDay, y as jalaliToGregorian, T as jalaliToJsDate, w as jsDateToJalali, V as lightTheme, he as parseAndValidateJalaliString, S as toJalaliDate, z as toLatinDigits, R as toPersianDigits, ne as useCalendarKeyboard, te as useJalaliDatePicker, H as useTheme };
|
|
2289
2312
|
|
|
2290
2313
|
//# sourceMappingURL=index.mjs.map
|