@stenajs-webui/calendar 17.27.1 → 17.28.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/CHANGELOG.md +12 -0
- package/dist/index.es.js +112 -112
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v17.28.1 (Fri Nov 25 2022)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Fix variable used before declaration error [#531](https://github.com/StenaIT/stenajs-webui/pull/531) ([@lindskogen](https://github.com/lindskogen))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Johan Lindskogen ([@lindskogen](https://github.com/lindskogen))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v17.13.3 (Tue Aug 30 2022)
|
|
2
14
|
|
|
3
15
|
#### 🏠 Internal
|
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){"use strict";try{var r=document.createElement("style");r.appendChild(document.createTextNode("._calendar_1w0de_1{--swui-calendar-day-width: 40px;--swui-calendar-day-height: 38px;--swui-calendar-day-border-radius: 4px;--swui-calendar-week-number-bg-color: transparent;--swui-calendar-week-number-text-color: var(--lhds-color-ui-500);--swui-calendar-week-number-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-wrapper-selected-border: var(--swui-primary-action-color);--swui-calendar-wrapper-selected-background: var(--swui-primary-action-color);--swui-calendar-wrapper-range-border: var(--lhds-color-blue-100);--swui-calendar-wrapper-range-background: var(--lhds-color-blue-100);--swui-calendar-wrapper-today-border: var(--lhds-color-ui-200);--swui-calendar-wrapper-today-background: var(--lhds-color-ui-200);--swui-calendar-text-selected-color: #fff;--swui-calendar-text-disabled-color: var(--swui-text-disabled-color);--swui-calendar-text-in-other-month-color: var(--swui-text-disabled-color)}._calendar_1w0de_1 table{border-spacing:0 4px}._calendar_1w0de_1 span{line-height:100%}._calendar_1w0de_1 tr td:last-child{border-top-right-radius:var(--swui-calendar-day-border-radius);border-bottom-right-radius:var(--swui-calendar-day-border-radius)}._calendar_1w0de_1 tr td:nth-child(2){border-top-left-radius:var(--swui-calendar-day-border-radius);border-bottom-left-radius:var(--swui-calendar-day-border-radius)}._calendar_1w0de_1 td{padding:0;width:var(--swui-calendar-day-width);height:var(--swui-calendar-day-height)}._timePicker_1w05d_1{overflow:hidden;width:180px}._timePickerColumn_1w05d_6{overflow-y:hidden;flex:1}._timePickerColumn_1w05d_6:hover{overflow-y:scroll}")),document.head.appendChild(r)}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { FlatButton as
|
|
3
|
-
import { Box as
|
|
2
|
+
import { FlatButton as A, stenaAngleLeft as Ot, stenaAngleRight as $t, PrimaryButton as lt, stenaCalendar as ht, Icon as qt, stenaClock as Qt, stenaAngleDown as De, stenaArrowRight as he } from "@stenajs-webui/elements";
|
|
3
|
+
import { Box as N, Text as et, Clickable as Pt, Row as R, Space as $, Spacing as ge, Indent as gt, Column as B, SeparatorLine as ye, parseIntElseUndefined as _t, useBoolean as Yt, useDelayedFalse as Lt } from "@stenajs-webui/core";
|
|
4
4
|
import { isAfter as nt, eachDayOfInterval as Bt, isSameDay as z, endOfMonth as Xt, startOfMonth as Zt, min as me, addDays as q, max as we, subDays as Dt, format as W, getISOWeek as pt, getDate as It, startOfISOWeek as pe, addWeeks as be, getMonth as tt, getYear as yt, getISODay as ke, addHours as Se, isBefore as Me, parse as ot, addMonths as Ee, addYears as Re, subMonths as Ae, subYears as Te, isValid as xe } from "date-fns";
|
|
5
5
|
import { last as Ce, chunk as Ft, range as zt, debounce as Ie } from "lodash";
|
|
6
6
|
import * as vt from "react";
|
|
@@ -275,15 +275,15 @@ const Jt = (t, e, n) => {
|
|
|
275
275
|
backgroundColor: c,
|
|
276
276
|
prefix: s
|
|
277
277
|
}) => {
|
|
278
|
-
const l = /* @__PURE__ */ E(
|
|
278
|
+
const l = /* @__PURE__ */ E(N, {
|
|
279
279
|
width: e.width,
|
|
280
280
|
height: e.height,
|
|
281
281
|
justifyContent: "center",
|
|
282
282
|
alignItems: "center",
|
|
283
|
-
children: [r && /* @__PURE__ */ i(
|
|
283
|
+
children: [r && /* @__PURE__ */ i(N, {
|
|
284
284
|
position: "absolute",
|
|
285
285
|
children: r
|
|
286
|
-
}), /* @__PURE__ */ i(
|
|
286
|
+
}), /* @__PURE__ */ i(N, {
|
|
287
287
|
position: "absolute",
|
|
288
288
|
children: /* @__PURE__ */ E(et, {
|
|
289
289
|
color: t ? e.WeekNumber.clickableTextColor : e.WeekNumber.textColor,
|
|
@@ -291,7 +291,7 @@ const Jt = (t, e, n) => {
|
|
|
291
291
|
})
|
|
292
292
|
})]
|
|
293
293
|
});
|
|
294
|
-
return /* @__PURE__ */ i(
|
|
294
|
+
return /* @__PURE__ */ i(N, {
|
|
295
295
|
background: c || e.WeekNumber.backgroundColor,
|
|
296
296
|
position: "relative",
|
|
297
297
|
children: t ? /* @__PURE__ */ i(Pt, {
|
|
@@ -345,7 +345,7 @@ const Ve = ({
|
|
|
345
345
|
day: e,
|
|
346
346
|
theme: n
|
|
347
347
|
}) => {
|
|
348
|
-
const r = /* @__PURE__ */ i(
|
|
348
|
+
const r = /* @__PURE__ */ i(N, {
|
|
349
349
|
width: n.width,
|
|
350
350
|
height: n.height,
|
|
351
351
|
justifyContent: "center",
|
|
@@ -373,7 +373,7 @@ const Ve = ({
|
|
|
373
373
|
extraDayContent: d,
|
|
374
374
|
defaultHighlights: a
|
|
375
375
|
}) {
|
|
376
|
-
const f = /* @__PURE__ */ i(
|
|
376
|
+
const f = /* @__PURE__ */ i(N, {
|
|
377
377
|
width: "100%",
|
|
378
378
|
height: "100%",
|
|
379
379
|
justifyContent: "center",
|
|
@@ -443,13 +443,13 @@ function en({
|
|
|
443
443
|
}) {
|
|
444
444
|
const w = k.WeekNumber.show;
|
|
445
445
|
return /* @__PURE__ */ i(mt, {
|
|
446
|
-
children: /* @__PURE__ */ E(
|
|
446
|
+
children: /* @__PURE__ */ E(N, {
|
|
447
447
|
alignItems: "stretch",
|
|
448
448
|
children: [/* @__PURE__ */ E(R, {
|
|
449
449
|
justifyContent: "space-between",
|
|
450
450
|
alignItems: "center",
|
|
451
451
|
height: "32px",
|
|
452
|
-
children: [/* @__PURE__ */ i(
|
|
452
|
+
children: [/* @__PURE__ */ i(N, {
|
|
453
453
|
alignItems: "center",
|
|
454
454
|
children: D
|
|
455
455
|
}), /* @__PURE__ */ E(R, {
|
|
@@ -457,7 +457,7 @@ function en({
|
|
|
457
457
|
children: [/* @__PURE__ */ i(R, {
|
|
458
458
|
width: "104px",
|
|
459
459
|
justifyContent: "center",
|
|
460
|
-
children: a ? /* @__PURE__ */ i(
|
|
460
|
+
children: a ? /* @__PURE__ */ i(A, {
|
|
461
461
|
onClick: () => a(t),
|
|
462
462
|
label: t.name
|
|
463
463
|
}) : /* @__PURE__ */ i(et, {
|
|
@@ -466,14 +466,14 @@ function en({
|
|
|
466
466
|
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(R, {
|
|
467
467
|
width: "64px",
|
|
468
468
|
justifyContent: "center",
|
|
469
|
-
children: f ? /* @__PURE__ */ i(
|
|
469
|
+
children: f ? /* @__PURE__ */ i(A, {
|
|
470
470
|
onClick: () => f(t.year),
|
|
471
471
|
label: String(t.year)
|
|
472
472
|
}) : /* @__PURE__ */ i(et, {
|
|
473
473
|
children: t.year
|
|
474
474
|
})
|
|
475
475
|
})]
|
|
476
|
-
}), /* @__PURE__ */ i(
|
|
476
|
+
}), /* @__PURE__ */ i(N, {
|
|
477
477
|
alignItems: "center",
|
|
478
478
|
children: m
|
|
479
479
|
})]
|
|
@@ -481,7 +481,7 @@ function en({
|
|
|
481
481
|
children: /* @__PURE__ */ E("tbody", {
|
|
482
482
|
children: [/* @__PURE__ */ E("tr", {
|
|
483
483
|
children: [w && /* @__PURE__ */ i("td", {
|
|
484
|
-
children: /* @__PURE__ */ i(
|
|
484
|
+
children: /* @__PURE__ */ i(N, {
|
|
485
485
|
width: k.width,
|
|
486
486
|
height: k.height,
|
|
487
487
|
justifyContent: "center",
|
|
@@ -545,10 +545,10 @@ function cn({
|
|
|
545
545
|
const w = C(() => c ? ot(c, "yyyy-MM-dd", new Date()) : void 0, [c]), y = C(() => s ? ot(s, "yyyy-MM-dd", new Date()) : void 0, [s]);
|
|
546
546
|
return /* @__PURE__ */ i("div", {
|
|
547
547
|
className: rn.calendar,
|
|
548
|
-
children: t.map((M,
|
|
548
|
+
children: t.map((M, T) => /* @__PURE__ */ i(ge, {
|
|
549
549
|
children: /* @__PURE__ */ i(R, {
|
|
550
|
-
children: M.map((x,
|
|
551
|
-
children: [
|
|
550
|
+
children: M.map((x, I) => /* @__PURE__ */ E(vt.Fragment, {
|
|
551
|
+
children: [I > 0 && /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(en, {
|
|
552
552
|
month: x,
|
|
553
553
|
dayComponent: e,
|
|
554
554
|
userDataPerWeek: n && n[x.monthString],
|
|
@@ -570,7 +570,7 @@ function cn({
|
|
|
570
570
|
})]
|
|
571
571
|
}, x.name))
|
|
572
572
|
})
|
|
573
|
-
},
|
|
573
|
+
}, T))
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
576
|
function Ut(t) {
|
|
@@ -633,18 +633,18 @@ const sn = (t, e, n) => {
|
|
|
633
633
|
}) => /* @__PURE__ */ E("div", {
|
|
634
634
|
children: [t, /* @__PURE__ */ i(gt, {
|
|
635
635
|
children: /* @__PURE__ */ E(R, {
|
|
636
|
-
children: [/* @__PURE__ */ i(
|
|
636
|
+
children: [/* @__PURE__ */ i(A, {
|
|
637
637
|
onClick: r,
|
|
638
638
|
leftIcon: Vt
|
|
639
|
-
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(
|
|
639
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
|
|
640
640
|
onClick: e,
|
|
641
641
|
leftIcon: Ot
|
|
642
642
|
}), /* @__PURE__ */ i(gt, {
|
|
643
643
|
num: 2
|
|
644
|
-
}), /* @__PURE__ */ i(
|
|
644
|
+
}), /* @__PURE__ */ i(A, {
|
|
645
645
|
onClick: n,
|
|
646
646
|
leftIcon: $t
|
|
647
|
-
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(
|
|
647
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
|
|
648
648
|
onClick: c,
|
|
649
649
|
leftIcon: te
|
|
650
650
|
})]
|
|
@@ -667,7 +667,7 @@ const sn = (t, e, n) => {
|
|
|
667
667
|
children: t === n ? /* @__PURE__ */ i(lt, {
|
|
668
668
|
label: r,
|
|
669
669
|
onClick: () => e && e(n)
|
|
670
|
-
}) : /* @__PURE__ */ i(
|
|
670
|
+
}) : /* @__PURE__ */ i(A, {
|
|
671
671
|
label: r,
|
|
672
672
|
onClick: () => e && e(n)
|
|
673
673
|
})
|
|
@@ -712,14 +712,14 @@ const sn = (t, e, n) => {
|
|
|
712
712
|
justifyContent: "space-between",
|
|
713
713
|
alignItems: "center",
|
|
714
714
|
width: "200px",
|
|
715
|
-
children: [/* @__PURE__ */ i(
|
|
715
|
+
children: [/* @__PURE__ */ i(A, {
|
|
716
716
|
size: "small",
|
|
717
717
|
leftIcon: Ot,
|
|
718
718
|
disabled: e === 0,
|
|
719
719
|
onClick: () => n(e - 1)
|
|
720
720
|
}), /* @__PURE__ */ i(et, {
|
|
721
721
|
children: c.label
|
|
722
|
-
}), /* @__PURE__ */ i(
|
|
722
|
+
}), /* @__PURE__ */ i(A, {
|
|
723
723
|
size: "small",
|
|
724
724
|
leftIcon: $t,
|
|
725
725
|
disabled: e === r.length - 1,
|
|
@@ -749,7 +749,7 @@ const sn = (t, e, n) => {
|
|
|
749
749
|
children: t === n ? /* @__PURE__ */ i(lt, {
|
|
750
750
|
label: r,
|
|
751
751
|
onClick: () => e == null ? void 0 : e(n)
|
|
752
|
-
}) : /* @__PURE__ */ i(
|
|
752
|
+
}) : /* @__PURE__ */ i(A, {
|
|
753
753
|
label: r,
|
|
754
754
|
onClick: () => e == null ? void 0 : e(n)
|
|
755
755
|
})
|
|
@@ -768,7 +768,7 @@ const sn = (t, e, n) => {
|
|
|
768
768
|
}, [t]), /* @__PURE__ */ E(R, {
|
|
769
769
|
children: [/* @__PURE__ */ i(B, {
|
|
770
770
|
justifyContent: "center",
|
|
771
|
-
children: /* @__PURE__ */ i(
|
|
771
|
+
children: /* @__PURE__ */ i(A, {
|
|
772
772
|
leftIcon: Ne,
|
|
773
773
|
onClick: () => c(r - 3)
|
|
774
774
|
})
|
|
@@ -782,7 +782,7 @@ const sn = (t, e, n) => {
|
|
|
782
782
|
}, l[0]))
|
|
783
783
|
}), /* @__PURE__ */ i(B, {
|
|
784
784
|
justifyContent: "center",
|
|
785
|
-
children: /* @__PURE__ */ i(
|
|
785
|
+
children: /* @__PURE__ */ i(A, {
|
|
786
786
|
leftIcon: He,
|
|
787
787
|
onClick: () => c(r + 3)
|
|
788
788
|
})
|
|
@@ -845,7 +845,7 @@ const sn = (t, e, n) => {
|
|
|
845
845
|
}
|
|
846
846
|
});
|
|
847
847
|
default:
|
|
848
|
-
return /* @__PURE__ */ i(
|
|
848
|
+
return /* @__PURE__ */ i(N, {
|
|
849
849
|
children: /* @__PURE__ */ i(lt, {
|
|
850
850
|
label: "Show calendar",
|
|
851
851
|
onClick: () => c("calendar")
|
|
@@ -897,11 +897,11 @@ function F({
|
|
|
897
897
|
onSelectPreset: l,
|
|
898
898
|
headerLeftContent: /* @__PURE__ */ E(R, {
|
|
899
899
|
alignItems: "center",
|
|
900
|
-
children: [!o && /* @__PURE__ */ i(
|
|
900
|
+
children: [!o && /* @__PURE__ */ i(A, {
|
|
901
901
|
size: "small",
|
|
902
902
|
onClick: u,
|
|
903
903
|
leftIcon: Vt
|
|
904
|
-
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(
|
|
904
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
|
|
905
905
|
size: "small",
|
|
906
906
|
onClick: f,
|
|
907
907
|
leftIcon: Ot
|
|
@@ -909,11 +909,11 @@ function F({
|
|
|
909
909
|
}),
|
|
910
910
|
headerRightContent: /* @__PURE__ */ E(R, {
|
|
911
911
|
alignItems: "center",
|
|
912
|
-
children: [/* @__PURE__ */ i(
|
|
912
|
+
children: [/* @__PURE__ */ i(A, {
|
|
913
913
|
size: "small",
|
|
914
914
|
onClick: a,
|
|
915
915
|
leftIcon: $t
|
|
916
|
-
}), /* @__PURE__ */ i($, {}), !o && /* @__PURE__ */ i(
|
|
916
|
+
}), /* @__PURE__ */ i($, {}), !o && /* @__PURE__ */ i(A, {
|
|
917
917
|
size: "small",
|
|
918
918
|
onClick: h,
|
|
919
919
|
leftIcon: te
|
|
@@ -1239,7 +1239,7 @@ const St = "bottom", de = () => {
|
|
|
1239
1239
|
tippyRef: y,
|
|
1240
1240
|
onChangePanel: M
|
|
1241
1241
|
} = de();
|
|
1242
|
-
return /* @__PURE__ */ i(
|
|
1242
|
+
return /* @__PURE__ */ i(N, {
|
|
1243
1243
|
width: h,
|
|
1244
1244
|
children: /* @__PURE__ */ i(bt, {
|
|
1245
1245
|
arrow: !1,
|
|
@@ -1264,7 +1264,7 @@ const St = "bottom", de = () => {
|
|
|
1264
1264
|
type: "date",
|
|
1265
1265
|
contentRight: /* @__PURE__ */ i(R, {
|
|
1266
1266
|
alignItems: "center",
|
|
1267
|
-
children: /* @__PURE__ */ i(
|
|
1267
|
+
children: /* @__PURE__ */ i(A, {
|
|
1268
1268
|
size: "small",
|
|
1269
1269
|
disabled: m,
|
|
1270
1270
|
leftIcon: ht,
|
|
@@ -1324,38 +1324,38 @@ function Mr({
|
|
|
1324
1324
|
maxDate: h = Mt,
|
|
1325
1325
|
disabled: u
|
|
1326
1326
|
}) {
|
|
1327
|
-
const [D, m] = S(
|
|
1327
|
+
const [D, m] = S("calendar"), {
|
|
1328
|
+
hideCalendar: k,
|
|
1329
|
+
showCalendarEndDate: p,
|
|
1330
|
+
showCalendarStartDate: b,
|
|
1331
|
+
showingCalendar: w,
|
|
1332
|
+
focusedInput: y,
|
|
1333
|
+
startDateInputRef: M,
|
|
1334
|
+
endDateInputRef: T,
|
|
1335
|
+
onClickDay: x,
|
|
1336
|
+
startDateIsAfterEnd: I
|
|
1337
|
+
} = Hn(c, s), [O, Y] = S(() => {
|
|
1328
1338
|
var _;
|
|
1329
|
-
return (_ =
|
|
1330
|
-
}),
|
|
1331
|
-
hideCalendar: b,
|
|
1332
|
-
showCalendarEndDate: w,
|
|
1333
|
-
showCalendarStartDate: y,
|
|
1334
|
-
showingCalendar: M,
|
|
1335
|
-
focusedInput: A,
|
|
1336
|
-
startDateInputRef: x,
|
|
1337
|
-
endDateInputRef: N,
|
|
1338
|
-
onClickDay: O,
|
|
1339
|
-
startDateIsAfterEnd: H
|
|
1340
|
-
} = Hn(c, s), j = C(() => wt(void 0, c == null ? void 0 : c.startDate, c == null ? void 0 : c.endDate), [c]);
|
|
1339
|
+
return (_ = y && (c == null ? void 0 : c[y])) != null ? _ : new Date();
|
|
1340
|
+
}), j = C(() => wt(void 0, c == null ? void 0 : c.startDate, c == null ? void 0 : c.endDate), [c]);
|
|
1341
1341
|
return /* @__PURE__ */ i(bt, {
|
|
1342
1342
|
arrow: !1,
|
|
1343
1343
|
lazy: !0,
|
|
1344
1344
|
disabled: u,
|
|
1345
|
-
visible:
|
|
1345
|
+
visible: w,
|
|
1346
1346
|
zIndex: l,
|
|
1347
1347
|
placement: St,
|
|
1348
1348
|
appendTo: r != null ? r : "parent",
|
|
1349
|
-
onClickOutside:
|
|
1349
|
+
onClickOutside: k,
|
|
1350
1350
|
content: /* @__PURE__ */ i(F, {
|
|
1351
1351
|
...a,
|
|
1352
|
-
dateInFocus:
|
|
1353
|
-
setDateInFocus:
|
|
1352
|
+
dateInFocus: O,
|
|
1353
|
+
setDateInFocus: Y,
|
|
1354
1354
|
statePerMonth: j,
|
|
1355
1355
|
theme: d,
|
|
1356
|
-
onClickDay:
|
|
1357
|
-
currentPanel:
|
|
1358
|
-
setCurrentPanel:
|
|
1356
|
+
onClickDay: x,
|
|
1357
|
+
currentPanel: D,
|
|
1358
|
+
setCurrentPanel: m,
|
|
1359
1359
|
minDate: f,
|
|
1360
1360
|
maxDate: h
|
|
1361
1361
|
}),
|
|
@@ -1363,28 +1363,28 @@ function Mr({
|
|
|
1363
1363
|
alignItems: "center",
|
|
1364
1364
|
children: [/* @__PURE__ */ i(rt, {
|
|
1365
1365
|
iconLeft: ht,
|
|
1366
|
-
onFocus:
|
|
1366
|
+
onFocus: b,
|
|
1367
1367
|
value: c != null && c.startDate ? W(c.startDate, t) : "",
|
|
1368
1368
|
placeholder: e,
|
|
1369
1369
|
width: o,
|
|
1370
1370
|
disabled: u,
|
|
1371
|
-
inputRef:
|
|
1371
|
+
inputRef: M,
|
|
1372
1372
|
size: 9,
|
|
1373
|
-
variant:
|
|
1373
|
+
variant: I ? "error" : void 0
|
|
1374
1374
|
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(qt, {
|
|
1375
1375
|
icon: Ue,
|
|
1376
1376
|
color: ee("--lhds-color-ui-500"),
|
|
1377
1377
|
size: 14
|
|
1378
1378
|
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(rt, {
|
|
1379
1379
|
iconLeft: ht,
|
|
1380
|
-
onFocus:
|
|
1380
|
+
onFocus: p,
|
|
1381
1381
|
value: c != null && c.endDate ? W(c.endDate, t) : "",
|
|
1382
1382
|
placeholder: n,
|
|
1383
1383
|
width: o,
|
|
1384
1384
|
disabled: u,
|
|
1385
|
-
inputRef:
|
|
1385
|
+
inputRef: T,
|
|
1386
1386
|
size: 9,
|
|
1387
|
-
variant:
|
|
1387
|
+
variant: I ? "error" : void 0
|
|
1388
1388
|
})]
|
|
1389
1389
|
})
|
|
1390
1390
|
});
|
|
@@ -1412,14 +1412,14 @@ const Er = ({
|
|
|
1412
1412
|
onChangePanel: y
|
|
1413
1413
|
} = de(), M = g(() => {
|
|
1414
1414
|
b(!p);
|
|
1415
|
-
}, [b, p]),
|
|
1415
|
+
}, [b, p]), T = g(() => {
|
|
1416
1416
|
b(!1);
|
|
1417
1417
|
}, [b]), x = g((P) => {
|
|
1418
1418
|
c && c(P);
|
|
1419
|
-
}, [c]),
|
|
1419
|
+
}, [c]), I = g((P) => {
|
|
1420
1420
|
P && (x(W(P, n)), e && setTimeout(() => b(!p), 200));
|
|
1421
|
-
}, [x, n, e, b, p]), O = !!o && !/^[-/\\.0-9]+$/.test(o),
|
|
1422
|
-
return /* @__PURE__ */ i(
|
|
1421
|
+
}, [x, n, e, b, p]), O = !!o && !/^[-/\\.0-9]+$/.test(o), Y = !!o && xe(ot(o, n, new Date())), _ = !!o && o.length >= n.length && !Y || O;
|
|
1422
|
+
return /* @__PURE__ */ i(N, {
|
|
1423
1423
|
width: d,
|
|
1424
1424
|
children: /* @__PURE__ */ i(bt, {
|
|
1425
1425
|
arrow: !1,
|
|
@@ -1428,13 +1428,13 @@ const Er = ({
|
|
|
1428
1428
|
zIndex: a,
|
|
1429
1429
|
appendTo: l != null ? l : "parent",
|
|
1430
1430
|
placement: St,
|
|
1431
|
-
onClickOutside:
|
|
1431
|
+
onClickOutside: T,
|
|
1432
1432
|
tippyRef: w,
|
|
1433
1433
|
content: /* @__PURE__ */ i(le, {
|
|
1434
1434
|
...t,
|
|
1435
|
-
onChange:
|
|
1435
|
+
onChange: I,
|
|
1436
1436
|
onChangePanel: y,
|
|
1437
|
-
value: o &&
|
|
1437
|
+
value: o && Y ? ot(o, n, new Date()) : void 0,
|
|
1438
1438
|
minDate: u,
|
|
1439
1439
|
maxDate: D,
|
|
1440
1440
|
theme: f
|
|
@@ -1446,7 +1446,7 @@ const Er = ({
|
|
|
1446
1446
|
contentRight: h ? void 0 : /* @__PURE__ */ i(R, {
|
|
1447
1447
|
alignItems: "center",
|
|
1448
1448
|
indent: 0.5,
|
|
1449
|
-
children: /* @__PURE__ */ i(
|
|
1449
|
+
children: /* @__PURE__ */ i(A, {
|
|
1450
1450
|
size: "small",
|
|
1451
1451
|
disabled: k.disabled,
|
|
1452
1452
|
leftIcon: ht,
|
|
@@ -1579,11 +1579,11 @@ const Er = ({
|
|
|
1579
1579
|
maxRight: w,
|
|
1580
1580
|
onClickLeft: y,
|
|
1581
1581
|
onClickRight: M,
|
|
1582
|
-
onClickCalendar:
|
|
1582
|
+
onClickCalendar: T,
|
|
1583
1583
|
onClickArrowDown: x,
|
|
1584
|
-
onBlurLeft:
|
|
1584
|
+
onBlurLeft: I,
|
|
1585
1585
|
onBlurRight: O,
|
|
1586
|
-
onFocusLeft:
|
|
1586
|
+
onFocusLeft: Y,
|
|
1587
1587
|
onFocusRight: j,
|
|
1588
1588
|
inputRefLeft: _,
|
|
1589
1589
|
inputRefRight: P,
|
|
@@ -1596,18 +1596,18 @@ const Er = ({
|
|
|
1596
1596
|
widthRight: ut,
|
|
1597
1597
|
disabled: v
|
|
1598
1598
|
}) => {
|
|
1599
|
-
const L = J(0),
|
|
1599
|
+
const L = J(0), H = C(() => Ie((G) => {
|
|
1600
1600
|
G === 0 && (K == null || K());
|
|
1601
1601
|
}, 10), [K]), Et = g((G) => {
|
|
1602
|
-
L.current++,
|
|
1603
|
-
}, [
|
|
1604
|
-
L.current++,
|
|
1605
|
-
}, [j, L,
|
|
1606
|
-
L.current--,
|
|
1607
|
-
}, [
|
|
1608
|
-
L.current--,
|
|
1609
|
-
}, [O, L,
|
|
1610
|
-
return /* @__PURE__ */ i(
|
|
1602
|
+
L.current++, H(L.current), Y && Y(G);
|
|
1603
|
+
}, [Y, L, H]), Rt = g((G) => {
|
|
1604
|
+
L.current++, H(L.current), j && j(G);
|
|
1605
|
+
}, [j, L, H]), At = g((G) => {
|
|
1606
|
+
L.current--, H(L.current), I && I(G);
|
|
1607
|
+
}, [I, L, H]), ue = g((G) => {
|
|
1608
|
+
L.current--, H(L.current), O && O(G);
|
|
1609
|
+
}, [O, L, H]);
|
|
1610
|
+
return /* @__PURE__ */ i(N, {
|
|
1611
1611
|
children: /* @__PURE__ */ E(Ye, {
|
|
1612
1612
|
disableContentPaddingRight: !0,
|
|
1613
1613
|
disabled: v,
|
|
@@ -1616,9 +1616,9 @@ const Er = ({
|
|
|
1616
1616
|
alignItems: "center",
|
|
1617
1617
|
children: [/* @__PURE__ */ i(gt, {
|
|
1618
1618
|
num: 0.5,
|
|
1619
|
-
children: /* @__PURE__ */ i(
|
|
1619
|
+
children: /* @__PURE__ */ i(A, {
|
|
1620
1620
|
leftIcon: ht,
|
|
1621
|
-
onClick:
|
|
1621
|
+
onClick: T,
|
|
1622
1622
|
disabled: v,
|
|
1623
1623
|
size: "small"
|
|
1624
1624
|
})
|
|
@@ -1630,7 +1630,7 @@ const Er = ({
|
|
|
1630
1630
|
})
|
|
1631
1631
|
}), /* @__PURE__ */ i(gt, {
|
|
1632
1632
|
num: 0.5,
|
|
1633
|
-
children: /* @__PURE__ */ i(
|
|
1633
|
+
children: /* @__PURE__ */ i(A, {
|
|
1634
1634
|
leftIcon: De,
|
|
1635
1635
|
onClick: x,
|
|
1636
1636
|
disabled: v,
|
|
@@ -1639,7 +1639,7 @@ const Er = ({
|
|
|
1639
1639
|
})]
|
|
1640
1640
|
}) : null]
|
|
1641
1641
|
}),
|
|
1642
|
-
children: [/* @__PURE__ */ i(
|
|
1642
|
+
children: [/* @__PURE__ */ i(N, {
|
|
1643
1643
|
width: ft,
|
|
1644
1644
|
children: /* @__PURE__ */ i(rt, {
|
|
1645
1645
|
onEsc: n,
|
|
@@ -1669,7 +1669,7 @@ const Er = ({
|
|
|
1669
1669
|
size: 12,
|
|
1670
1670
|
color: ee("--lhds-color-ui-500")
|
|
1671
1671
|
})
|
|
1672
|
-
}), /* @__PURE__ */ i(
|
|
1672
|
+
}), /* @__PURE__ */ i(N, {
|
|
1673
1673
|
width: ut,
|
|
1674
1674
|
children: /* @__PURE__ */ i(rt, {
|
|
1675
1675
|
onEsc: n,
|
|
@@ -1760,7 +1760,7 @@ const Er = ({
|
|
|
1760
1760
|
children: n ? /* @__PURE__ */ i(lt, {
|
|
1761
1761
|
label: String(e),
|
|
1762
1762
|
onClick: () => t && t(e)
|
|
1763
|
-
}) : /* @__PURE__ */ i(
|
|
1763
|
+
}) : /* @__PURE__ */ i(A, {
|
|
1764
1764
|
label: String(e),
|
|
1765
1765
|
onClick: () => t && t(e)
|
|
1766
1766
|
})
|
|
@@ -1849,8 +1849,8 @@ const Er = ({
|
|
|
1849
1849
|
if (t)
|
|
1850
1850
|
y.setHours(t.getHours()), y.setMinutes(t.getMinutes()), e == null || e(y), f(void 0);
|
|
1851
1851
|
else if (o) {
|
|
1852
|
-
const { minute: M, hour:
|
|
1853
|
-
y.setHours(
|
|
1852
|
+
const { minute: M, hour: T } = Tt(o);
|
|
1853
|
+
y.setHours(T != null ? T : 0), y.setMinutes(M != null ? M : 0), e == null || e(y), f(void 0);
|
|
1854
1854
|
} else
|
|
1855
1855
|
f(y);
|
|
1856
1856
|
n(y), h.current && (h.current.valueAsDate = y);
|
|
@@ -1973,12 +1973,12 @@ const Er = ({
|
|
|
1973
1973
|
dateInFocus: w,
|
|
1974
1974
|
setDateInFocus: y,
|
|
1975
1975
|
isTimePickerVisible: M,
|
|
1976
|
-
hideTimePicker:
|
|
1976
|
+
hideTimePicker: T,
|
|
1977
1977
|
localTime: x,
|
|
1978
|
-
localDate:
|
|
1978
|
+
localDate: I
|
|
1979
1979
|
} = m, {
|
|
1980
1980
|
showCalendar: O,
|
|
1981
|
-
hideCalendar:
|
|
1981
|
+
hideCalendar: Y,
|
|
1982
1982
|
inputLeftChangeHandler: j,
|
|
1983
1983
|
inputRightChangeHandler: _,
|
|
1984
1984
|
onChangeTime: P,
|
|
@@ -1990,15 +1990,15 @@ const Er = ({
|
|
|
1990
1990
|
onClickDay: at,
|
|
1991
1991
|
onClickCalendarButton: ft,
|
|
1992
1992
|
onClickArrowButton: ut
|
|
1993
|
-
} = Gn(st, u, O,
|
|
1993
|
+
} = Gn(st, u, O, Y, m);
|
|
1994
1994
|
_n(t, y, u);
|
|
1995
1995
|
const v = C(() => {
|
|
1996
|
-
const At = t ||
|
|
1996
|
+
const At = t || I;
|
|
1997
1997
|
return At ? X(void 0, At, ["singleSelected", "selected"]) : {};
|
|
1998
|
-
}, [
|
|
1999
|
-
|
|
2000
|
-
}, [
|
|
2001
|
-
return /* @__PURE__ */ i(
|
|
1998
|
+
}, [I, t]), L = g(() => {
|
|
1999
|
+
Y(), T();
|
|
2000
|
+
}, [Y, T]), H = C(() => t ? Wn(t) : x, [t, x]), Et = Lt(b, 300), Rt = Lt(M, 300);
|
|
2001
|
+
return /* @__PURE__ */ i(N, {
|
|
2002
2002
|
onKeyDown: dt,
|
|
2003
2003
|
children: /* @__PURE__ */ i(bt, {
|
|
2004
2004
|
arrow: !1,
|
|
@@ -2022,14 +2022,14 @@ const Er = ({
|
|
|
2022
2022
|
overflow: "hidden",
|
|
2023
2023
|
height: "250px",
|
|
2024
2024
|
children: /* @__PURE__ */ i(jn, {
|
|
2025
|
-
value:
|
|
2025
|
+
value: H != null ? H : "",
|
|
2026
2026
|
onValueChange: P
|
|
2027
2027
|
})
|
|
2028
2028
|
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(R, {
|
|
2029
2029
|
justifyContent: "flex-end",
|
|
2030
2030
|
children: /* @__PURE__ */ i(lt, {
|
|
2031
2031
|
label: "Done",
|
|
2032
|
-
onClick:
|
|
2032
|
+
onClick: T
|
|
2033
2033
|
})
|
|
2034
2034
|
})]
|
|
2035
2035
|
}) : null
|
|
@@ -2055,7 +2055,7 @@ const Er = ({
|
|
|
2055
2055
|
onClickRight: it,
|
|
2056
2056
|
inputRefLeft: u,
|
|
2057
2057
|
inputRefRight: D,
|
|
2058
|
-
valueRight:
|
|
2058
|
+
valueRight: H != null ? H : "",
|
|
2059
2059
|
widthLeft: o,
|
|
2060
2060
|
widthRight: d,
|
|
2061
2061
|
minLeft: l,
|
|
@@ -2186,17 +2186,17 @@ const Er = ({
|
|
|
2186
2186
|
o
|
|
2187
2187
|
]), k = g(
|
|
2188
2188
|
(y) => {
|
|
2189
|
-
var M,
|
|
2189
|
+
var M, T, x, I;
|
|
2190
2190
|
h === "startDate" ? e != null && nt(y.date, e) ? (n == null || n({
|
|
2191
2191
|
startDate: y.date,
|
|
2192
2192
|
endDate: void 0
|
|
2193
2193
|
}), f("endDate"), (M = c.current) == null || M.focus()) : (n == null || n({
|
|
2194
2194
|
startDate: y.date,
|
|
2195
2195
|
endDate: e
|
|
2196
|
-
}), o === "startDate" ? (f("endDate"), (
|
|
2196
|
+
}), o === "startDate" ? (f("endDate"), (T = c.current) == null || T.focus()) : setTimeout(l, 50)) : h === "endDate" && (t ? nt(t, y.date) ? (n == null || n({
|
|
2197
2197
|
startDate: y.date,
|
|
2198
2198
|
endDate: void 0
|
|
2199
|
-
}), f("endDate"), (
|
|
2199
|
+
}), f("endDate"), (I = c.current) == null || I.focus()) : (n == null || n({
|
|
2200
2200
|
startDate: t,
|
|
2201
2201
|
endDate: y.date
|
|
2202
2202
|
}), setTimeout(l, 50)) : (n == null || n({
|
|
@@ -2265,12 +2265,12 @@ function Tr({
|
|
|
2265
2265
|
dateInFocus: w,
|
|
2266
2266
|
setDateInFocus: y,
|
|
2267
2267
|
isCalendarVisible: M,
|
|
2268
|
-
currentPanel:
|
|
2268
|
+
currentPanel: T,
|
|
2269
2269
|
setCurrentPanel: x
|
|
2270
2270
|
} = b, {
|
|
2271
|
-
showCalendar:
|
|
2271
|
+
showCalendar: I,
|
|
2272
2272
|
hideCalendar: O,
|
|
2273
|
-
inputLeftChangeHandler:
|
|
2273
|
+
inputLeftChangeHandler: Y,
|
|
2274
2274
|
inputRightChangeHandler: j
|
|
2275
2275
|
} = Qn(D, m, e, b), {
|
|
2276
2276
|
onKeyDownHandler: _,
|
|
@@ -2279,10 +2279,10 @@ function Tr({
|
|
|
2279
2279
|
onClickDay: dt,
|
|
2280
2280
|
onClickCalendarButton: it,
|
|
2281
2281
|
onClickArrowButton: K
|
|
2282
|
-
} = Zn(D, m, e, k, p,
|
|
2282
|
+
} = Zn(D, m, e, k, p, I, O, b);
|
|
2283
2283
|
qn(D, m, y, k, p);
|
|
2284
2284
|
const at = C(() => D && m && nt(D, m), [D, m]), ft = C(() => We(d == null ? void 0 : d.statePerMonth, D, m, w), [d == null ? void 0 : d.statePerMonth, D, m, w]), ut = Lt(M, 300);
|
|
2285
|
-
return /* @__PURE__ */ i(
|
|
2285
|
+
return /* @__PURE__ */ i(N, {
|
|
2286
2286
|
onKeyDown: _,
|
|
2287
2287
|
children: /* @__PURE__ */ i(bt, {
|
|
2288
2288
|
arrow: !1,
|
|
@@ -2295,7 +2295,7 @@ function Tr({
|
|
|
2295
2295
|
onClickDay: dt,
|
|
2296
2296
|
dateInFocus: w,
|
|
2297
2297
|
setDateInFocus: y,
|
|
2298
|
-
currentPanel:
|
|
2298
|
+
currentPanel: T,
|
|
2299
2299
|
setCurrentPanel: x,
|
|
2300
2300
|
minDate: l,
|
|
2301
2301
|
maxDate: o,
|
|
@@ -2313,7 +2313,7 @@ function Tr({
|
|
|
2313
2313
|
typeRight: "date",
|
|
2314
2314
|
placeholderLeft: "Start date",
|
|
2315
2315
|
placeholderRight: "End date",
|
|
2316
|
-
onChangeLeft:
|
|
2316
|
+
onChangeLeft: Y,
|
|
2317
2317
|
onChangeRight: j,
|
|
2318
2318
|
onClickArrowDown: K,
|
|
2319
2319
|
onClickCalendar: it,
|