@semcore/date-picker 4.56.1 → 4.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,139 +1,139 @@
1
- import U from "@babel/runtime/helpers/esm/classCallCheck";
2
- import q from "@babel/runtime/helpers/esm/createClass";
3
- import c from "@babel/runtime/helpers/esm/assertThisInitialized";
1
+ import G from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import U from "@babel/runtime/helpers/esm/createClass";
3
+ import u from "@babel/runtime/helpers/esm/assertThisInitialized";
4
4
  import J from "@babel/runtime/helpers/esm/inherits";
5
5
  import Q from "@babel/runtime/helpers/esm/createSuper";
6
6
  import g from "@babel/runtime/helpers/esm/defineProperty";
7
- import R from "@babel/runtime/helpers/esm/slicedToArray";
7
+ import T from "@babel/runtime/helpers/esm/slicedToArray";
8
8
  import { sstyled as W } from "@semcore/utils/lib/core/index";
9
- import { CORE_INSTANCE as z, sstyled as X, assignProps as w, Component as Z } from "@semcore/core";
9
+ import { CORE_INSTANCE as M, sstyled as X, assignProps as E, Component as Z } from "@semcore/core";
10
10
  import r from "react";
11
- import v from "dayjs";
12
- import Y from "@semcore/button";
13
- import { Flex as f, Box as N } from "@semcore/flex-box";
14
- import F from "@semcore/divider";
11
+ import h from "dayjs";
12
+ import N from "@semcore/button";
13
+ import { Flex as S, Box as A } from "@semcore/flex-box";
14
+ import z from "@semcore/divider";
15
15
  import ee from "@semcore/dropdown";
16
16
  import ae from "@semcore/utils/lib/enhances/i18nEnhance";
17
- import { localizedMessages as K } from "../translations/__intergalactic-dynamic-locales.mjs";
17
+ import { localizedMessages as F } from "../translations/__intergalactic-dynamic-locales.mjs";
18
18
  import { includesDate as te } from "../utils/includesDate.mjs";
19
19
  import { formatMMYY as re, formatDDMMYY as _e } from "../utils/formatDate.mjs";
20
20
  var ie = (
21
21
  /*__reshadow_css_start__*/
22
22
  (W.insert(
23
23
  /*__inner_css_start__*/
24
- ".___SPopper_e0y8u_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_e0y8u_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_e0y8u_gg_:active,.___SPopper_e0y8u_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_e0y8u_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_e0y8u_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_e0y8u_gg_,.___STitle_e0y8u_gg_{display:flex;align-items:center}.___STitle_e0y8u_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_e0y8u_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_e0y8u_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_e0y8u_gg_ .___SInner_e0y8u_gg_{justify-content:flex-start}.___SInputMask_e0y8u_gg_{color:var(--intergalactic-text-primary, #191b23);line-height:normal;padding-right:var(--intergalactic-spacing-2x, 8px);transition:width calc(var(--intergalactic-duration-medium, 300)*1ms) ease,min-width calc(var(--intergalactic-duration-medium, 300)*1ms) ease}.___SInputMask_e0y8u_gg_.__animationsDisabled_e0y8u_gg_{transition:none}.___SInputMask_e0y8u_gg_ .___SValue_e0y8u_gg_{letter-spacing:0}.___SIndicator_e0y8u_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SRangeIndicator_e0y8u_gg_{border-radius:50%;flex-shrink:0}.___SRangeIndicator_e0y8u_gg_._range_value_e0y8u_gg_{background-color:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SRangeIndicator_e0y8u_gg_._range_compare_e0y8u_gg_{background-color:var(--intergalactic-date-picker-cell-comparison-active, #8649e1)}.___SRangeIndicator_e0y8u_gg_.__disabled_e0y8u_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SHumanizedDate_e0y8u_gg_{position:absolute;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.___SMask_e0y8u_gg_{letter-spacing:0;white-space:nowrap;overflow:hidden}.___SDateRange_e0y8u_gg_ .___SMask_e0y8u_gg_,.___SDateRange_e0y8u_gg_ .___SValue_e0y8u_gg_,.___SSingleDateInput_e0y8u_gg_ .___SMask_e0y8u_gg_,.___SSingleDateInput_e0y8u_gg_ .___SValue_e0y8u_gg_{opacity:0}.___SSingleDateInput_e0y8u_gg_:focus-within .___SHumanizedDate_e0y8u_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_e0y8u_gg_:focus-within .___SMask_e0y8u_gg_,.___SSingleDateInput_e0y8u_gg_:focus-within .___SValue_e0y8u_gg_{opacity:1}.___SDateRange_e0y8u_gg_:focus-within .___SHumanizedDate_e0y8u_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_e0y8u_gg_:focus-within .___SMask_e0y8u_gg_,.___SDateRange_e0y8u_gg_:focus-within .___SValue_e0y8u_gg_{opacity:1}.___SInputMask_e0y8u_gg_.__noHumanizedDate_e0y8u_gg_ .___SMask_e0y8u_gg_,.___SInputMask_e0y8u_gg_.__noHumanizedDate_e0y8u_gg_ .___SValue_e0y8u_gg_{opacity:1}.___SDateRange_e0y8u_gg_ .___SInputMask_e0y8u_gg_:focus-within .___SMask_e0y8u_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_e0y8u_gg_:focus-within .___SRangeSep_e0y8u_gg_,.___SRangeSep_e0y8u_gg_.__fulfilled_e0y8u_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SRangeComparatorHeader_e0y8u_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SRangeCalendar_e0y8u_gg_,.___SRangeComparatorHeader_e0y8u_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___SFooter_e0y8u_gg_{border-top:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SFooter_e0y8u_gg_,.___SPeriodsList_e0y8u_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___STooltip_e0y8u_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SCompareToggle_e0y8u_gg_{white-space:nowrap}@media (prefers-reduced-motion){.___SInputMask_e0y8u_gg_{transition:none}}",
25
- "e0y8u_gg_"
24
+ ".___SPopper_182qj_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_182qj_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_182qj_gg_:active,.___SPopper_182qj_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_182qj_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_182qj_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_182qj_gg_,.___STitle_182qj_gg_{display:flex;align-items:center}.___STitle_182qj_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_182qj_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_182qj_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_182qj_gg_ .___SInner_182qj_gg_{justify-content:flex-start}.___SInputMask_182qj_gg_{color:var(--intergalactic-text-primary, #191b23);line-height:normal;padding-right:var(--intergalactic-spacing-2x, 8px);transition:width calc(var(--intergalactic-duration-medium, 300)*1ms) ease,min-width calc(var(--intergalactic-duration-medium, 300)*1ms) ease}.___SInputMask_182qj_gg_.__animationsDisabled_182qj_gg_{transition:none}.___SInputMask_182qj_gg_ .___SValue_182qj_gg_{letter-spacing:0}.___SIndicator_182qj_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SRangeIndicator_182qj_gg_{border-radius:50%;flex-shrink:0}.___SRangeIndicator_182qj_gg_._range_value_182qj_gg_{background-color:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SRangeIndicator_182qj_gg_._range_compare_182qj_gg_{background-color:var(--intergalactic-date-picker-cell-comparison-active, #8649e1)}.___SRangeIndicator_182qj_gg_.__disabled_182qj_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SHumanizedDate_182qj_gg_{position:absolute;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.___SMask_182qj_gg_{letter-spacing:0;white-space:nowrap;overflow:hidden}.___SDateRange_182qj_gg_ .___SMask_182qj_gg_,.___SDateRange_182qj_gg_ .___SValue_182qj_gg_,.___SSingleDateInput_182qj_gg_ .___SMask_182qj_gg_,.___SSingleDateInput_182qj_gg_ .___SValue_182qj_gg_{opacity:0}.___SSingleDateInput_182qj_gg_:focus-within .___SHumanizedDate_182qj_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_182qj_gg_:focus-within .___SMask_182qj_gg_,.___SSingleDateInput_182qj_gg_:focus-within .___SValue_182qj_gg_{opacity:1}.___SDateRange_182qj_gg_:focus-within .___SHumanizedDate_182qj_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_182qj_gg_:focus-within .___SMask_182qj_gg_,.___SDateRange_182qj_gg_:focus-within .___SValue_182qj_gg_{opacity:1}.___SInputMask_182qj_gg_.__noHumanizedDate_182qj_gg_ .___SMask_182qj_gg_,.___SInputMask_182qj_gg_.__noHumanizedDate_182qj_gg_ .___SValue_182qj_gg_{opacity:1}.___SDateRange_182qj_gg_ .___SInputMask_182qj_gg_:focus-within .___SMask_182qj_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_182qj_gg_:focus-within .___SRangeSep_182qj_gg_,.___SRangeSep_182qj_gg_.__fulfilled_182qj_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SRangeComparatorHeader_182qj_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SRangeCalendar_182qj_gg_,.___SRangeComparatorHeader_182qj_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___SFooter_182qj_gg_{border-top:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SFooter_182qj_gg_,.___SPeriodsList_182qj_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___STooltip_182qj_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SCompareToggle_182qj_gg_{white-space:nowrap}@media (prefers-reduced-motion){.___SInputMask_182qj_gg_{transition:none}}",
25
+ "182qj_gg_"
26
26
  ), {
27
- __SHeader: "___SHeader_e0y8u_gg_",
28
- __STitle: "___STitle_e0y8u_gg_",
29
- __SToday: "___SToday_e0y8u_gg_",
30
- __SPeriod: "___SPeriod_e0y8u_gg_",
31
- __SButton: "___SButton_e0y8u_gg_",
32
- __SInner: "___SInner_e0y8u_gg_",
33
- __SInputMask: "___SInputMask_e0y8u_gg_",
34
- _animationsDisabled: "__animationsDisabled_e0y8u_gg_",
35
- __SValue: "___SValue_e0y8u_gg_",
36
- __SIndicator: "___SIndicator_e0y8u_gg_",
37
- __SRangeIndicator: "___SRangeIndicator_e0y8u_gg_",
38
- _range_value: "_range_value_e0y8u_gg_",
39
- _range_compare: "_range_compare_e0y8u_gg_",
40
- _disabled: "__disabled_e0y8u_gg_",
41
- __SHumanizedDate: "___SHumanizedDate_e0y8u_gg_",
42
- __SMask: "___SMask_e0y8u_gg_",
43
- __SSingleDateInput: "___SSingleDateInput_e0y8u_gg_",
44
- __SDateRange: "___SDateRange_e0y8u_gg_",
45
- _noHumanizedDate: "__noHumanizedDate_e0y8u_gg_",
46
- __SRangeSep: "___SRangeSep_e0y8u_gg_",
47
- _fulfilled: "__fulfilled_e0y8u_gg_",
48
- __SRangeComparatorHeader: "___SRangeComparatorHeader_e0y8u_gg_",
49
- __SRangeCalendar: "___SRangeCalendar_e0y8u_gg_",
50
- __SFooter: "___SFooter_e0y8u_gg_",
51
- __SPeriodsList: "___SPeriodsList_e0y8u_gg_",
52
- __STooltip: "___STooltip_e0y8u_gg_",
53
- __SCompareToggle: "___SCompareToggle_e0y8u_gg_",
54
- __SPopper: "___SPopper_e0y8u_gg_"
27
+ __SHeader: "___SHeader_182qj_gg_",
28
+ __STitle: "___STitle_182qj_gg_",
29
+ __SToday: "___SToday_182qj_gg_",
30
+ __SPeriod: "___SPeriod_182qj_gg_",
31
+ __SButton: "___SButton_182qj_gg_",
32
+ __SInner: "___SInner_182qj_gg_",
33
+ __SInputMask: "___SInputMask_182qj_gg_",
34
+ _animationsDisabled: "__animationsDisabled_182qj_gg_",
35
+ __SValue: "___SValue_182qj_gg_",
36
+ __SIndicator: "___SIndicator_182qj_gg_",
37
+ __SRangeIndicator: "___SRangeIndicator_182qj_gg_",
38
+ _range_value: "_range_value_182qj_gg_",
39
+ _range_compare: "_range_compare_182qj_gg_",
40
+ _disabled: "__disabled_182qj_gg_",
41
+ __SHumanizedDate: "___SHumanizedDate_182qj_gg_",
42
+ __SMask: "___SMask_182qj_gg_",
43
+ __SSingleDateInput: "___SSingleDateInput_182qj_gg_",
44
+ __SDateRange: "___SDateRange_182qj_gg_",
45
+ _noHumanizedDate: "__noHumanizedDate_182qj_gg_",
46
+ __SRangeSep: "___SRangeSep_182qj_gg_",
47
+ _fulfilled: "__fulfilled_182qj_gg_",
48
+ __SRangeComparatorHeader: "___SRangeComparatorHeader_182qj_gg_",
49
+ __SRangeCalendar: "___SRangeCalendar_182qj_gg_",
50
+ __SFooter: "___SFooter_182qj_gg_",
51
+ __SPeriodsList: "___SPeriodsList_182qj_gg_",
52
+ __STooltip: "___STooltip_182qj_gg_",
53
+ __SCompareToggle: "___SCompareToggle_182qj_gg_",
54
+ __SPopper: "___SPopper_182qj_gg_"
55
55
  })
56
56
  ), ne = ["INPUT"], le = ["ArrowDown", "Enter", " "], oe = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
57
- function b(p) {
58
- if (!Array.isArray(p)) return null;
59
- var d = R(p, 2), s = d[0], a = d[1], e = a === void 0 ? s : a;
57
+ function D(c) {
58
+ if (!Array.isArray(c)) return null;
59
+ var p = T(c, 2), s = p[0], a = p[1], e = a === void 0 ? s : a;
60
60
  return e;
61
61
  }
62
- var x = /* @__PURE__ */ function(p) {
63
- J(s, p);
64
- var d = Q(s);
62
+ var q = /* @__PURE__ */ function(c) {
63
+ J(s, c);
64
+ var p = Q(s);
65
65
  function s() {
66
66
  var a;
67
- U(this, s);
67
+ G(this, s);
68
68
  for (var e = arguments.length, i = new Array(e), n = 0; n < e; n++)
69
69
  i[n] = arguments[n];
70
- return a = d.call.apply(d, [this].concat(i)), g(c(a), "popperRef", /* @__PURE__ */ r.createRef()), g(c(a), "unitRefs", {}), g(c(a), "navigateStep", void 0), g(c(a), "keyDiff", void 0), g(c(a), "keyStep", void 0), g(c(a), "navigateView", function(t) {
71
- var _ = a.asProps.displayedPeriod, l = t >= 1 ? "add" : "subtract", o = v(_)[l](1, a.navigateStep).toDate();
70
+ return a = p.call.apply(p, [this].concat(i)), g(u(a), "popperRef", /* @__PURE__ */ r.createRef()), g(u(a), "unitRefs", {}), g(u(a), "navigateStep", void 0), g(u(a), "keyDiff", void 0), g(u(a), "keyStep", void 0), g(u(a), "navigateView", function(t) {
71
+ var _ = a.asProps.displayedPeriod, l = t >= 1 ? "add" : "subtract", o = h(_)[l](1, a.navigateStep).toDate();
72
72
  a.handlers.displayedPeriod(o);
73
- }), g(c(a), "bindHandlerNavigateClick", function(t) {
73
+ }), g(u(a), "bindHandlerNavigateClick", function(t) {
74
74
  return function() {
75
75
  return a.navigateView(t);
76
76
  };
77
- }), g(c(a), "handlerKeyDown", function(t) {
77
+ }), g(u(a), "handlerKeyDown", function(t) {
78
78
  return function(_) {
79
- var l = a.asProps, o = l.displayedPeriod, u = l.highlighted, h = l.preselectedValue, k = l.visible, S = _.key;
80
- t === "trigger" && le.includes(S) && (_.stopPropagation(), a.handlers.visible(!k), setTimeout(function() {
81
- var C = a.popperRef.current;
82
- C && C.focus();
79
+ var l = a.asProps, o = l.displayedPeriod, d = l.highlighted, m = l.preselectedValue, x = l.visible, P = _.key;
80
+ t === "trigger" && le.includes(P) && (_.stopPropagation(), a.handlers.visible(!x), setTimeout(function() {
81
+ var k = a.popperRef.current;
82
+ k && k.focus();
83
83
  }, 0));
84
- var P = a.keyDiff[S], B = function(j) {
85
- var M = R(j, 2), L = M[0], G = M[1], y = G || L, T = o == null ? void 0 : o.getDate(), E = y == null ? void 0 : y.getDate();
86
- a.navigateStep === "month" && (T = o == null ? void 0 : o.getMonth(), E = y == null ? void 0 : y.getMonth()), a.navigateStep === "year" && (T = o == null ? void 0 : o.getYear(), E = y == null ? void 0 : y.getYear());
87
- var A = E - T;
88
- return A < 0 || A > 1 ? y : o;
84
+ var y = a.keyDiff[P], Y = function($) {
85
+ var V = T($, 2), O = V[0], L = V[1], v = L || O, I = o == null ? void 0 : o.getDate(), C = v == null ? void 0 : v.getDate();
86
+ a.navigateStep === "month" && (I = o == null ? void 0 : o.getMonth(), C = v == null ? void 0 : v.getMonth()), a.navigateStep === "year" && (I = o == null ? void 0 : o.getYear(), C = v == null ? void 0 : v.getYear());
87
+ var H = C - I;
88
+ return H < 0 || H > 1 ? v : o;
89
89
  };
90
90
  if (t === "popper" && _.key === "Enter" && (_.metaKey || _.ctrlKey))
91
91
  return a.handleApplyClick();
92
- if (t === "popper" && _.key === " " && u.length) {
93
- var V = u[1] || u[0];
94
- a.isDisabled(V) || a.handleChange(V), _.preventDefault();
92
+ if (t === "popper" && _.key === " " && d.length) {
93
+ var R = d[1] || d[0];
94
+ a.isDisabled(R) || a.handleChange(R), _.preventDefault();
95
95
  }
96
- var D = void 0;
97
- if (P) {
96
+ var j = void 0;
97
+ if (y) {
98
98
  if (ne.includes(_.target.tagName)) return;
99
- if (u.length) {
100
- var m;
101
- h.length === 1 ? (m = [h[0], v(u[1] || u[0]).add(P, a.keyStep).toDate()], D = m[1]) : (m = [v(u[0]).add(P, a.keyStep).toDate()], D = m[0]), a.handlers.highlighted(m), a.handlers.displayedPeriod(B(m));
99
+ if (d.length) {
100
+ var f;
101
+ m.length === 1 ? (f = [m[0], h(d[1] || d[0]).add(y, a.keyStep).toDate()], j = f[1]) : (f = [h(d[0]).add(y, a.keyStep).toDate()], j = f[0]), a.handlers.highlighted(f), a.handlers.displayedPeriod(Y(f));
102
102
  } else {
103
- var H = [o || v().toDate()];
104
- a.handlers.highlighted(H), D = H[0];
103
+ var w = [o || h().toDate()];
104
+ a.handlers.highlighted(w), j = w[0];
105
105
  }
106
- if (_.preventDefault(), D) {
107
- var I, $ = a.keyStep === "month" ? re : _e, O = $(D, a.asProps.locale);
108
- (I = a.unitRefs[O]) === null || I === void 0 || I.focus();
106
+ if (_.preventDefault(), j) {
107
+ var b, K = a.keyStep === "month" ? re : _e, B = K(j, a.asProps.locale);
108
+ (b = a.unitRefs[B]) === null || b === void 0 || b.focus();
109
109
  }
110
110
  }
111
111
  };
112
- }), g(c(a), "handleApply", function(t) {
113
- var _ = R(t, 2), l = _[0], o = _[1], u = o === void 0 ? l : o;
114
- a.handleChange([]), a.handlers.value([l, u]), a.handlers.visible(!1);
115
- }), g(c(a), "handleChange", function(t) {
112
+ }), g(u(a), "handleApply", function(t) {
113
+ var _ = T(t, 2), l = _[0], o = _[1], d = o === void 0 ? l : o;
114
+ a.handleChange([]), a.handlers.value([l, d]), a.handlers.visible(!1);
115
+ }), g(u(a), "handleChange", function(t) {
116
116
  var _ = a.asProps.preselectedValue, l = [];
117
117
  Array.isArray(t) ? _ = t : _.length ? _.length >= 2 ? (_ = [t], l = [t]) : _[0] > t ? _ = [t, _[0]] : _ = [_[0], t] : (_ = [t], l = [t]), a.handlers.preselectedValue(_), a.handlers.highlighted(l);
118
- }), g(c(a), "handleApplyClick", function() {
118
+ }), g(u(a), "handleApplyClick", function() {
119
119
  var t = a.asProps, _ = t.value, l = t.preselectedValue;
120
120
  return a.handleApply(l.length ? l : _);
121
121
  }), a;
122
122
  }
123
- return q(s, [{
123
+ return U(s, [{
124
124
  key: "uncontrolledProps",
125
125
  value: function() {
126
126
  var e = this;
127
127
  return {
128
128
  displayedPeriod: null,
129
129
  visible: [null, function(i) {
130
- var n = e.asProps, t = n.value, _ = n.displayedPeriod, l = b(t ?? void 0);
130
+ var n = e.asProps, t = n.value, _ = n.displayedPeriod, l = D(t ?? void 0);
131
131
  if (i || (e.handlers.highlighted([]), e.handlers.preselectedValue([])), i) {
132
132
  if (l && l !== _)
133
133
  e.handlers.displayedPeriod(l);
134
134
  else if (!l) {
135
- var o = e.props, u = o.displayedPeriod, h = o.defaultDisplayedPeriod;
136
- e.handlers.displayedPeriod(u || h);
135
+ var o = e.props, d = o.displayedPeriod, m = o.defaultDisplayedPeriod;
136
+ e.handlers.displayedPeriod(d || m);
137
137
  }
138
138
  }
139
139
  }],
@@ -142,7 +142,7 @@ var x = /* @__PURE__ */ function(p) {
142
142
  value: [null, function(i) {
143
143
  if (i[0] !== null || i[1] !== null) {
144
144
  var n, t;
145
- e.handlers.displayedPeriod(b([(n = i[0]) !== null && n !== void 0 ? n : void 0, (t = i[1]) !== null && t !== void 0 ? t : void 0]));
145
+ e.handlers.displayedPeriod(D([(n = i[0]) !== null && n !== void 0 ? n : void 0, (t = i[1]) !== null && t !== void 0 ? t : void 0]));
146
146
  }
147
147
  }]
148
148
  };
@@ -151,7 +151,7 @@ var x = /* @__PURE__ */ function(p) {
151
151
  key: "isDisabled",
152
152
  value: function(e) {
153
153
  var i = this.asProps.disabled;
154
- return i.some(te(v(e), "date"));
154
+ return i.some(te(h(e), "date"));
155
155
  }
156
156
  }, {
157
157
  key: "getDefaultPeriods",
@@ -172,32 +172,32 @@ var x = /* @__PURE__ */ function(p) {
172
172
  }, {
173
173
  key: "getPopperProps",
174
174
  value: function() {
175
- var e = this[z], i = this.asProps, n = i.periods, t = n === void 0 ? this.getDefaultPeriods() : n, _ = i.unclearable, l = /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Apply, null), !_ && /* @__PURE__ */ r.createElement(e.Reset, {
175
+ var e = this[M], i = this.asProps, n = i.periods, t = n === void 0 ? this.getDefaultPeriods() : n, _ = i.unclearable, l = /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Apply, null), !_ && /* @__PURE__ */ r.createElement(e.Reset, {
176
176
  ml: 2
177
177
  }));
178
178
  return {
179
179
  tabIndex: 0,
180
180
  ref: this.popperRef,
181
181
  onKeyDown: this.handlerKeyDown("popper"),
182
- children: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(f, null, /* @__PURE__ */ r.createElement(f, null, /* @__PURE__ */ r.createElement(N, {
182
+ children: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(S, null, /* @__PURE__ */ r.createElement(S, null, /* @__PURE__ */ r.createElement(A, {
183
183
  mr: 2
184
- }, /* @__PURE__ */ r.createElement(e.Header, null, /* @__PURE__ */ r.createElement(e.Prev, null), /* @__PURE__ */ r.createElement(e.Title, null)), /* @__PURE__ */ r.createElement(e.Calendar, null)), /* @__PURE__ */ r.createElement(N, {
184
+ }, /* @__PURE__ */ r.createElement(e.Header, null, /* @__PURE__ */ r.createElement(e.Prev, null), /* @__PURE__ */ r.createElement(e.Title, null)), /* @__PURE__ */ r.createElement(e.Calendar, null)), /* @__PURE__ */ r.createElement(A, {
185
185
  ml: 2
186
186
  }, /* @__PURE__ */ r.createElement(e.Header, null, /* @__PURE__ */ r.createElement(e.Title, {
187
187
  "aria-live": void 0
188
- }), /* @__PURE__ */ r.createElement(e.Next, null)), /* @__PURE__ */ r.createElement(e.Calendar, null))), t.length > 0 && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(F, {
188
+ }), /* @__PURE__ */ r.createElement(e.Next, null)), /* @__PURE__ */ r.createElement(e.Calendar, null))), t.length > 0 && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(z, {
189
189
  m: "-16px 16px",
190
190
  orientation: "vertical",
191
191
  h: "auto"
192
- }), /* @__PURE__ */ r.createElement(f, {
192
+ }), /* @__PURE__ */ r.createElement(S, {
193
193
  direction: "column"
194
- }, /* @__PURE__ */ r.createElement(e.Period, null), /* @__PURE__ */ r.createElement(f, {
194
+ }, /* @__PURE__ */ r.createElement(e.Period, null), /* @__PURE__ */ r.createElement(S, {
195
195
  mt: "auto"
196
- }, l)))), t.length === 0 && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(F, {
196
+ }, l)))), t.length === 0 && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(z, {
197
197
  m: "16px -16px",
198
198
  orientation: "horizontal",
199
199
  w: "auto"
200
- }), /* @__PURE__ */ r.createElement(f, null, /* @__PURE__ */ r.createElement(e.Period, null), /* @__PURE__ */ r.createElement(f, {
200
+ }), /* @__PURE__ */ r.createElement(S, null, /* @__PURE__ */ r.createElement(e.Period, null), /* @__PURE__ */ r.createElement(S, {
201
201
  mt: "auto"
202
202
  }, l))))
203
203
  };
@@ -205,7 +205,7 @@ var x = /* @__PURE__ */ function(p) {
205
205
  }, {
206
206
  key: "getHeaderProps",
207
207
  value: function() {
208
- var e = this[z];
208
+ var e = this[M];
209
209
  return {
210
210
  children: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Prev, null), /* @__PURE__ */ r.createElement(e.Title, null), /* @__PURE__ */ r.createElement(e.Next, null))
211
211
  };
@@ -218,7 +218,7 @@ var x = /* @__PURE__ */ function(p) {
218
218
  children: new Intl.DateTimeFormat(t, {
219
219
  month: "long",
220
220
  year: "numeric"
221
- }).format(v(_).add(i, this.navigateStep).startOf(this.navigateStep).toDate())
221
+ }).format(h(_).add(i, this.navigateStep).startOf(this.navigateStep).toDate())
222
222
  };
223
223
  }
224
224
  }, {
@@ -244,18 +244,18 @@ var x = /* @__PURE__ */ function(p) {
244
244
  }, {
245
245
  key: "getCalendarProps",
246
246
  value: function(e, i) {
247
- var n = this.asProps, t = n.locale, _ = n.displayedPeriod, l = n.disabled, o = n.value, u = n.highlighted, h = n.onHighlightedChange, k = n.onVisibleChange, S = n.preselectedValue, P = n.getI18nText;
247
+ var n = this.asProps, t = n.locale, _ = n.displayedPeriod, l = n.disabled, o = n.value, d = n.highlighted, m = n.onHighlightedChange, x = n.onVisibleChange, P = n.preselectedValue, y = n.getI18nText;
248
248
  return {
249
249
  locale: t,
250
- displayedPeriod: v(_).add(i, this.navigateStep).startOf(this.navigateStep).toDate(),
250
+ displayedPeriod: h(_).add(i, this.navigateStep).startOf(this.navigateStep).toDate(),
251
251
  disabled: l,
252
- highlighted: u,
253
- onHighlightedChange: h,
254
- onVisibleChange: k,
255
- value: S.length ? S : o,
252
+ highlighted: d,
253
+ onHighlightedChange: m,
254
+ onVisibleChange: x,
255
+ value: P.length ? P : o,
256
256
  onChange: this.handleChange,
257
257
  unitRefs: this.unitRefs,
258
- getI18nText: P,
258
+ getI18nText: y,
259
259
  actionsDescribing: i === 0 ? "range" : null,
260
260
  tabIndex: i === 0 ? 0 : -1
261
261
  };
@@ -263,7 +263,7 @@ var x = /* @__PURE__ */ function(p) {
263
263
  }, {
264
264
  key: "getPeriodProps",
265
265
  value: function() {
266
- var e = this.asProps, i = e.periods, n = i === void 0 ? this.getDefaultPeriods() : i, t = e.value, _ = e.onHighlightedChange, l = e.onDisplayedPeriodChange, o = e.preselectedValue, u = e.getI18nText;
266
+ var e = this.asProps, i = e.periods, n = i === void 0 ? this.getDefaultPeriods() : i, t = e.value, _ = e.onHighlightedChange, l = e.onDisplayedPeriodChange, o = e.preselectedValue, d = e.getI18nText;
267
267
  return {
268
268
  periods: n,
269
269
  value: o.length ? o : t,
@@ -271,7 +271,7 @@ var x = /* @__PURE__ */ function(p) {
271
271
  onHighlightedChange: _,
272
272
  onDisplayedPeriodChange: l,
273
273
  role: "listbox",
274
- "aria-label": u("periods")
274
+ "aria-label": d("periods")
275
275
  };
276
276
  }
277
277
  }, {
@@ -298,7 +298,7 @@ var x = /* @__PURE__ */ function(p) {
298
298
  key: "render",
299
299
  value: function() {
300
300
  var e = this.asProps, i, n = this.asProps, t = n.Children, _ = n.styles, l = n["aria-label"];
301
- return /* @__PURE__ */ r.createElement(r.Fragment, null, (i = X(_), /* @__PURE__ */ r.createElement(ee, w({
301
+ return /* @__PURE__ */ r.createElement(r.Fragment, null, (i = X(_), /* @__PURE__ */ r.createElement(ee, E({
302
302
  "use:aria-label": l,
303
303
  __excludeProps: ["onChange", "value"]
304
304
  }, e), /* @__PURE__ */ r.createElement(t, i.cn("Children", {})))));
@@ -308,9 +308,9 @@ var x = /* @__PURE__ */ function(p) {
308
308
  value: function(e) {
309
309
  var i = e.value, n = e.defaultValue;
310
310
  return {
311
- i18n: K,
311
+ i18n: F,
312
312
  locale: "en",
313
- defaultDisplayedPeriod: b(i) || b(n) || oe,
313
+ defaultDisplayedPeriod: D(i) || D(n) || oe,
314
314
  defaultValue: [],
315
315
  defaultHighlighted: [],
316
316
  defaultVisible: !1,
@@ -321,32 +321,32 @@ var x = /* @__PURE__ */ function(p) {
321
321
  }
322
322
  }]), s;
323
323
  }(Z);
324
- g(x, "displayName", "DatePicker");
325
- g(x, "style", ie);
326
- g(x, "enhance", [ae(K)]);
327
- g(x, "add", function(p, d, s) {
328
- return v(p).add(d, s).toDate();
324
+ g(q, "displayName", "DatePicker");
325
+ g(q, "style", ie);
326
+ g(q, "enhance", [ae(F)]);
327
+ g(q, "add", function(c, p, s) {
328
+ return h(c).add(p, s).toDate();
329
329
  });
330
- g(x, "subtract", function(p, d, s) {
331
- return v(p).subtract(d, s).toDate();
330
+ g(q, "subtract", function(c, p, s) {
331
+ return h(c).subtract(p, s).toDate();
332
332
  });
333
- function Te(p) {
334
- var d = arguments[0], s = p.getI18nText;
335
- return /* @__PURE__ */ r.createElement(Y, w({
333
+ function Ie(c) {
334
+ var p = arguments[0], s = c.getI18nText;
335
+ return /* @__PURE__ */ r.createElement(N, E({
336
336
  use: "primary",
337
337
  children: s("apply")
338
- }, d));
338
+ }, p));
339
339
  }
340
- function Ee(p) {
341
- var d = arguments[0], s = p.getI18nText;
342
- return /* @__PURE__ */ r.createElement(Y, w({
340
+ function Ce(c) {
341
+ var p = arguments[0], s = c.getI18nText;
342
+ return /* @__PURE__ */ r.createElement(N, E({
343
343
  use: "tertiary",
344
344
  theme: "muted",
345
345
  children: s("reset")
346
- }, d));
346
+ }, p));
347
347
  }
348
348
  export {
349
- Te as Apply,
350
- Ee as Reset,
351
- x as default
349
+ Ie as Apply,
350
+ Ce as Reset,
351
+ q as default
352
352
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/date-picker",
3
3
  "description": "Semrush DatePicker Component",
4
- "version": "4.56.1",
4
+ "version": "4.57.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -15,16 +15,16 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@semcore/utils": "4.48.2",
18
- "@semcore/base-trigger": "4.52.2",
18
+ "@semcore/base-trigger": "4.53.0",
19
19
  "@semcore/button": "5.43.1",
20
20
  "@semcore/divider": "4.40.2",
21
21
  "@semcore/dropdown": "4.43.2",
22
22
  "@semcore/flex-box": "5.41.2",
23
- "@semcore/icon": "4.60.2",
23
+ "@semcore/icon": "4.61.0",
24
24
  "@semcore/input": "4.42.2",
25
25
  "@semcore/input-mask": "5.43.2",
26
26
  "@semcore/neighbor-location": "4.40.2",
27
- "@semcore/typography": "5.52.2",
27
+ "@semcore/typography": "5.53.0",
28
28
  "@semcore/checkbox": "7.44.2",
29
29
  "@semcore/popper": "5.46.2",
30
30
  "@semcore/tooltip": "6.49.2",