@semcore/date-picker 4.57.0 → 4.57.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/components/Calendar.js +24 -22
  3. package/lib/cjs/components/Calendar.js.map +1 -1
  4. package/lib/cjs/components/DateRangeComparatorAbstract.js +32 -30
  5. package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
  6. package/lib/cjs/components/InputTrigger.js +32 -30
  7. package/lib/cjs/components/InputTrigger.js.map +1 -1
  8. package/lib/cjs/components/PickerAbstract.js +32 -30
  9. package/lib/cjs/components/PickerAbstract.js.map +1 -1
  10. package/lib/cjs/components/RangePickerAbstract.js +32 -30
  11. package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
  12. package/lib/es6/components/Calendar.js +24 -22
  13. package/lib/es6/components/Calendar.js.map +1 -1
  14. package/lib/es6/components/DateRangeComparatorAbstract.js +32 -30
  15. package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
  16. package/lib/es6/components/InputTrigger.js +32 -30
  17. package/lib/es6/components/InputTrigger.js.map +1 -1
  18. package/lib/es6/components/PickerAbstract.js +32 -30
  19. package/lib/es6/components/PickerAbstract.js.map +1 -1
  20. package/lib/es6/components/RangePickerAbstract.js +32 -30
  21. package/lib/es6/components/RangePickerAbstract.js.map +1 -1
  22. package/lib/esm/DatePicker.mjs +114 -103
  23. package/lib/esm/DateRangeComparator.mjs +166 -149
  24. package/lib/esm/DateRangePicker.mjs +85 -77
  25. package/lib/esm/MonthDateRangeComparator.mjs +187 -169
  26. package/lib/esm/MonthPicker.mjs +78 -71
  27. package/lib/esm/MonthRangePicker.mjs +94 -85
  28. package/lib/esm/components/ButtonTrigger.mjs +16 -15
  29. package/lib/esm/components/Calendar.mjs +409 -287
  30. package/lib/esm/components/DateRangeComparatorAbstract.mjs +458 -330
  31. package/lib/esm/components/InputTrigger.mjs +762 -519
  32. package/lib/esm/components/PickerAbstract.mjs +196 -149
  33. package/lib/esm/components/RangePickerAbstract.mjs +310 -221
  34. package/lib/esm/components/index.mjs +127 -109
  35. package/lib/esm/index.mjs +13 -13
  36. package/lib/esm/style/calendar.shadow.css +259 -0
  37. package/lib/esm/style/date-picker.shadow.css +179 -0
  38. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +32 -32
  39. package/lib/esm/translations/de.json.mjs +83 -56
  40. package/lib/esm/translations/en.json.mjs +95 -64
  41. package/lib/esm/translations/es.json.mjs +83 -56
  42. package/lib/esm/translations/fr.json.mjs +83 -56
  43. package/lib/esm/translations/it.json.mjs +83 -56
  44. package/lib/esm/translations/ja.json.mjs +83 -56
  45. package/lib/esm/translations/ko.json.mjs +83 -56
  46. package/lib/esm/translations/nl.json.mjs +83 -56
  47. package/lib/esm/translations/pl.json.mjs +83 -56
  48. package/lib/esm/translations/pt.json.mjs +83 -56
  49. package/lib/esm/translations/ru.json.mjs +35 -24
  50. package/lib/esm/translations/sv.json.mjs +83 -56
  51. package/lib/esm/translations/tr.json.mjs +83 -56
  52. package/lib/esm/translations/vi.json.mjs +83 -56
  53. package/lib/esm/translations/zh.json.mjs +83 -56
  54. package/lib/esm/utils/cronTabScheduler.mjs +58 -52
  55. package/lib/esm/utils/datesIntersects.mjs +15 -11
  56. package/lib/esm/utils/formatDate.mjs +25 -18
  57. package/lib/esm/utils/includesDate.mjs +13 -9
  58. package/lib/esm/utils/shortDateRangeFormat.mjs +53 -31
  59. package/package.json +15 -15
@@ -1,352 +1,441 @@
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
- import J from "@babel/runtime/helpers/esm/inherits";
5
- import Q from "@babel/runtime/helpers/esm/createSuper";
6
- import g from "@babel/runtime/helpers/esm/defineProperty";
7
- import T from "@babel/runtime/helpers/esm/slicedToArray";
8
- import { sstyled as W } from "@semcore/utils/lib/core/index";
9
- import { CORE_INSTANCE as M, sstyled as X, assignProps as E, Component as Z } from "@semcore/core";
10
- import r from "react";
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
- import ee from "@semcore/dropdown";
16
- import ae from "@semcore/utils/lib/enhances/i18nEnhance";
17
- import { localizedMessages as F } from "../translations/__intergalactic-dynamic-locales.mjs";
18
- import { includesDate as te } from "../utils/includesDate.mjs";
19
- import { formatMMYY as re, formatDDMMYY as _e } from "../utils/formatDate.mjs";
20
- var ie = (
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
+ import { sstyled } from "@semcore/utils/lib/core/index";
9
+ import { CORE_INSTANCE, sstyled as sstyled$1, assignProps, Component } from "@semcore/core";
10
+ import React from "react";
11
+ import dayjs from "dayjs";
12
+ import Button from "@semcore/button";
13
+ import { Flex, Box } from "@semcore/flex-box";
14
+ import Divider from "@semcore/divider";
15
+ import Dropdown from "@semcore/dropdown";
16
+ import i18nEnhance from "@semcore/utils/lib/enhances/i18nEnhance";
17
+ import { localizedMessages } from "../translations/__intergalactic-dynamic-locales.mjs";
18
+ import { includesDate } from "../utils/includesDate.mjs";
19
+ import { formatMMYY, formatDDMMYY } from "../utils/formatDate.mjs";
20
+ /*!__reshadow-styles__:"../style/date-picker.shadow.css"*/
21
+ var style = (
21
22
  /*__reshadow_css_start__*/
22
- (W.insert(
23
+ (sstyled.insert(
23
24
  /*__inner_css_start__*/
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
- ), {
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_"
25
+ ".___SPopper_svfjr_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_svfjr_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_svfjr_gg_:active,.___SPopper_svfjr_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_svfjr_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_svfjr_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_svfjr_gg_,.___STitle_svfjr_gg_{display:flex;align-items:center}.___STitle_svfjr_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_svfjr_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_svfjr_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_svfjr_gg_ .___SInner_svfjr_gg_{justify-content:flex-start}.___SInputMask_svfjr_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_svfjr_gg_.__animationsDisabled_svfjr_gg_{transition:none}.___SInputMask_svfjr_gg_ .___SValue_svfjr_gg_{letter-spacing:0}.___SIndicator_svfjr_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SRangeIndicator_svfjr_gg_{border-radius:50%;flex-shrink:0}.___SRangeIndicator_svfjr_gg_._range_value_svfjr_gg_{background-color:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SRangeIndicator_svfjr_gg_._range_compare_svfjr_gg_{background-color:var(--intergalactic-date-picker-cell-comparison-active, #8649e1)}.___SRangeIndicator_svfjr_gg_.__disabled_svfjr_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SHumanizedDate_svfjr_gg_{position:absolute;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.___SMask_svfjr_gg_{letter-spacing:0;white-space:nowrap;overflow:hidden}.___SDateRange_svfjr_gg_ .___SMask_svfjr_gg_,.___SDateRange_svfjr_gg_ .___SValue_svfjr_gg_,.___SSingleDateInput_svfjr_gg_ .___SMask_svfjr_gg_,.___SSingleDateInput_svfjr_gg_ .___SValue_svfjr_gg_{opacity:0}.___SSingleDateInput_svfjr_gg_:focus-within .___SHumanizedDate_svfjr_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_svfjr_gg_:focus-within .___SMask_svfjr_gg_,.___SSingleDateInput_svfjr_gg_:focus-within .___SValue_svfjr_gg_{opacity:1}.___SDateRange_svfjr_gg_:focus-within .___SHumanizedDate_svfjr_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_svfjr_gg_:focus-within .___SMask_svfjr_gg_,.___SDateRange_svfjr_gg_:focus-within .___SValue_svfjr_gg_{opacity:1}.___SInputMask_svfjr_gg_.__noHumanizedDate_svfjr_gg_ .___SMask_svfjr_gg_,.___SInputMask_svfjr_gg_.__noHumanizedDate_svfjr_gg_ .___SValue_svfjr_gg_{opacity:1}.___SDateRange_svfjr_gg_ .___SInputMask_svfjr_gg_:focus-within .___SMask_svfjr_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_svfjr_gg_:focus-within .___SRangeSep_svfjr_gg_,.___SRangeSep_svfjr_gg_.__fulfilled_svfjr_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SRangeComparatorHeader_svfjr_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SRangeCalendar_svfjr_gg_,.___SRangeComparatorHeader_svfjr_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___SFooter_svfjr_gg_{border-top:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SFooter_svfjr_gg_,.___SPeriodsList_svfjr_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___STooltip_svfjr_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SCompareToggle_svfjr_gg_{white-space:nowrap}@media (prefers-reduced-motion){.___SInputMask_svfjr_gg_{transition:none}}",
26
+ /*__inner_css_end__*/
27
+ "svfjr_gg_"
28
+ ), /*__reshadow_css_end__*/
29
+ {
30
+ "__SHeader": "___SHeader_svfjr_gg_",
31
+ "__STitle": "___STitle_svfjr_gg_",
32
+ "__SToday": "___SToday_svfjr_gg_",
33
+ "__SPeriod": "___SPeriod_svfjr_gg_",
34
+ "__SButton": "___SButton_svfjr_gg_",
35
+ "__SInner": "___SInner_svfjr_gg_",
36
+ "__SInputMask": "___SInputMask_svfjr_gg_",
37
+ "_animationsDisabled": "__animationsDisabled_svfjr_gg_",
38
+ "__SValue": "___SValue_svfjr_gg_",
39
+ "__SIndicator": "___SIndicator_svfjr_gg_",
40
+ "__SRangeIndicator": "___SRangeIndicator_svfjr_gg_",
41
+ "_range_value": "_range_value_svfjr_gg_",
42
+ "_range_compare": "_range_compare_svfjr_gg_",
43
+ "_disabled": "__disabled_svfjr_gg_",
44
+ "__SHumanizedDate": "___SHumanizedDate_svfjr_gg_",
45
+ "__SMask": "___SMask_svfjr_gg_",
46
+ "__SSingleDateInput": "___SSingleDateInput_svfjr_gg_",
47
+ "__SDateRange": "___SDateRange_svfjr_gg_",
48
+ "_noHumanizedDate": "__noHumanizedDate_svfjr_gg_",
49
+ "__SRangeSep": "___SRangeSep_svfjr_gg_",
50
+ "_fulfilled": "__fulfilled_svfjr_gg_",
51
+ "__SRangeComparatorHeader": "___SRangeComparatorHeader_svfjr_gg_",
52
+ "__SRangeCalendar": "___SRangeCalendar_svfjr_gg_",
53
+ "__SFooter": "___SFooter_svfjr_gg_",
54
+ "__SPeriodsList": "___SPeriodsList_svfjr_gg_",
55
+ "__STooltip": "___STooltip_svfjr_gg_",
56
+ "__SCompareToggle": "___SCompareToggle_svfjr_gg_",
57
+ "__SPopper": "___SPopper_svfjr_gg_"
55
58
  })
56
- ), ne = ["INPUT"], le = ["ArrowDown", "Enter", " "], oe = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
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
- return e;
59
+ );
60
+ var INTERACTION_TAGS = ["INPUT"];
61
+ var INTERACTION_KEYS = ["ArrowDown", "Enter", " "];
62
+ var defaultDisplayedPeriod = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
63
+ function getEndDate(value) {
64
+ if (!Array.isArray(value)) return null;
65
+ var _value = _slicedToArray(value, 2), startDate = _value[0], _value$ = _value[1], endDate = _value$ === void 0 ? startDate : _value$;
66
+ return endDate;
61
67
  }
62
- var q = /* @__PURE__ */ function(c) {
63
- J(s, c);
64
- var p = Q(s);
65
- function s() {
66
- var a;
67
- G(this, s);
68
- for (var e = arguments.length, i = new Array(e), n = 0; n < e; n++)
69
- i[n] = arguments[n];
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
- a.handlers.displayedPeriod(o);
73
- }), g(u(a), "bindHandlerNavigateClick", function(t) {
68
+ var RangePickerAbstract = /* @__PURE__ */ function(_Component) {
69
+ _inherits(RangePickerAbstract2, _Component);
70
+ var _super = _createSuper(RangePickerAbstract2);
71
+ function RangePickerAbstract2() {
72
+ var _this;
73
+ _classCallCheck(this, RangePickerAbstract2);
74
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
75
+ args[_key] = arguments[_key];
76
+ }
77
+ _this = _super.call.apply(_super, [this].concat(args));
78
+ _defineProperty(_assertThisInitialized(_this), "popperRef", /* @__PURE__ */ React.createRef());
79
+ _defineProperty(_assertThisInitialized(_this), "unitRefs", {});
80
+ _defineProperty(_assertThisInitialized(_this), "navigateStep", void 0);
81
+ _defineProperty(_assertThisInitialized(_this), "keyDiff", void 0);
82
+ _defineProperty(_assertThisInitialized(_this), "keyStep", void 0);
83
+ _defineProperty(_assertThisInitialized(_this), "navigateView", function(direction) {
84
+ var displayedPeriod = _this.asProps.displayedPeriod;
85
+ var action = direction >= 1 ? "add" : "subtract";
86
+ var date = dayjs(displayedPeriod)[action](1, _this.navigateStep).toDate();
87
+ _this.handlers.displayedPeriod(date);
88
+ });
89
+ _defineProperty(_assertThisInitialized(_this), "bindHandlerNavigateClick", function(direction) {
74
90
  return function() {
75
- return a.navigateView(t);
91
+ return _this.navigateView(direction);
76
92
  };
77
- }), g(u(a), "handlerKeyDown", function(t) {
78
- return function(_) {
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
- }, 0));
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;
93
+ });
94
+ _defineProperty(_assertThisInitialized(_this), "handlerKeyDown", function(place) {
95
+ return function(e) {
96
+ var _this$asProps = _this.asProps, displayedPeriod = _this$asProps.displayedPeriod, highlighted = _this$asProps.highlighted, preselectedValue = _this$asProps.preselectedValue, visible = _this$asProps.visible;
97
+ var key = e.key;
98
+ if (place === "trigger" && INTERACTION_KEYS.includes(key)) {
99
+ e.stopPropagation();
100
+ _this.handlers.visible(!visible);
101
+ setTimeout(function() {
102
+ var popper = _this.popperRef.current;
103
+ if (popper) {
104
+ popper.focus();
105
+ }
106
+ }, 0);
107
+ }
108
+ var day = _this.keyDiff[key];
109
+ var setNextDisplayedPeriod = function setNextDisplayedPeriod2(next_highlighted2) {
110
+ var _next_highlighted = _slicedToArray(next_highlighted2, 2), startPeriod = _next_highlighted[0], endPeriod = _next_highlighted[1];
111
+ var highlightedPeriod = endPeriod || startPeriod;
112
+ var displayedPeriodNormalized = displayedPeriod === null || displayedPeriod === void 0 ? void 0 : displayedPeriod.getDate();
113
+ var highlightedPeriodNormalized = highlightedPeriod === null || highlightedPeriod === void 0 ? void 0 : highlightedPeriod.getDate();
114
+ if (_this.navigateStep === "month") {
115
+ displayedPeriodNormalized = displayedPeriod === null || displayedPeriod === void 0 ? void 0 : displayedPeriod.getMonth();
116
+ highlightedPeriodNormalized = highlightedPeriod === null || highlightedPeriod === void 0 ? void 0 : highlightedPeriod.getMonth();
117
+ }
118
+ if (_this.navigateStep === "year") {
119
+ displayedPeriodNormalized = displayedPeriod === null || displayedPeriod === void 0 ? void 0 : displayedPeriod.getYear();
120
+ highlightedPeriodNormalized = highlightedPeriod === null || highlightedPeriod === void 0 ? void 0 : highlightedPeriod.getYear();
121
+ }
122
+ var offset = highlightedPeriodNormalized - displayedPeriodNormalized;
123
+ if (offset < 0 || offset > 1) {
124
+ return highlightedPeriod;
125
+ }
126
+ return displayedPeriod;
89
127
  };
90
- if (t === "popper" && _.key === "Enter" && (_.metaKey || _.ctrlKey))
91
- return a.handleApplyClick();
92
- if (t === "popper" && _.key === " " && d.length) {
93
- var R = d[1] || d[0];
94
- a.isDisabled(R) || a.handleChange(R), _.preventDefault();
128
+ if (place === "popper" && e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
129
+ return _this.handleApplyClick();
130
+ }
131
+ if (place === "popper" && e.key === " " && highlighted.length) {
132
+ var highlightedDate = highlighted[1] || highlighted[0];
133
+ if (!_this.isDisabled(highlightedDate)) {
134
+ _this.handleChange(highlightedDate);
135
+ }
136
+ e.preventDefault();
95
137
  }
96
- var j = void 0;
97
- if (y) {
98
- if (ne.includes(_.target.tagName)) return;
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));
138
+ var changedDate = void 0;
139
+ if (day) {
140
+ if (INTERACTION_TAGS.includes(e.target.tagName)) return;
141
+ if (highlighted.length) {
142
+ var next_highlighted;
143
+ if (preselectedValue.length === 1) {
144
+ next_highlighted = [preselectedValue[0], dayjs(highlighted[1] || highlighted[0]).add(day, _this.keyStep).toDate()];
145
+ changedDate = next_highlighted[1];
146
+ } else {
147
+ next_highlighted = [dayjs(highlighted[0]).add(day, _this.keyStep).toDate()];
148
+ changedDate = next_highlighted[0];
149
+ }
150
+ _this.handlers.highlighted(next_highlighted);
151
+ _this.handlers.displayedPeriod(setNextDisplayedPeriod(next_highlighted));
102
152
  } else {
103
- var w = [o || h().toDate()];
104
- a.handlers.highlighted(w), j = w[0];
153
+ var _highlighted = [displayedPeriod ? displayedPeriod : dayjs().toDate()];
154
+ _this.handlers.highlighted(_highlighted);
155
+ changedDate = _highlighted[0];
105
156
  }
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();
157
+ e.preventDefault();
158
+ if (changedDate) {
159
+ var _this$unitRefs$format;
160
+ var formatter = _this.keyStep === "month" ? formatMMYY : formatDDMMYY;
161
+ var formattedDate = formatter(changedDate, _this.asProps.locale);
162
+ (_this$unitRefs$format = _this.unitRefs[formattedDate]) === null || _this$unitRefs$format === void 0 ? void 0 : _this$unitRefs$format.focus();
109
163
  }
110
164
  }
111
165
  };
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
- var _ = a.asProps.preselectedValue, l = [];
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(u(a), "handleApplyClick", function() {
119
- var t = a.asProps, _ = t.value, l = t.preselectedValue;
120
- return a.handleApply(l.length ? l : _);
121
- }), a;
166
+ });
167
+ _defineProperty(_assertThisInitialized(_this), "handleApply", function(value) {
168
+ var _value2 = _slicedToArray(value, 2), startDate = _value2[0], _value2$ = _value2[1], endDate = _value2$ === void 0 ? startDate : _value2$;
169
+ _this.handleChange([]);
170
+ _this.handlers.value([startDate, endDate]);
171
+ _this.handlers.visible(false);
172
+ });
173
+ _defineProperty(_assertThisInitialized(_this), "handleChange", function(date) {
174
+ var preselectedValue = _this.asProps.preselectedValue;
175
+ var highlighted = [];
176
+ if (Array.isArray(date)) {
177
+ preselectedValue = date;
178
+ } else if (!preselectedValue.length) {
179
+ preselectedValue = [date];
180
+ highlighted = [date];
181
+ } else if (preselectedValue.length >= 2) {
182
+ preselectedValue = [date];
183
+ highlighted = [date];
184
+ } else if (preselectedValue[0] > date) {
185
+ preselectedValue = [date, preselectedValue[0]];
186
+ } else {
187
+ preselectedValue = [preselectedValue[0], date];
188
+ }
189
+ _this.handlers.preselectedValue(preselectedValue);
190
+ _this.handlers.highlighted(highlighted);
191
+ });
192
+ _defineProperty(_assertThisInitialized(_this), "handleApplyClick", function() {
193
+ var _this$asProps2 = _this.asProps, value = _this$asProps2.value, preselectedValue = _this$asProps2.preselectedValue;
194
+ return _this.handleApply(preselectedValue.length ? preselectedValue : value);
195
+ });
196
+ return _this;
122
197
  }
123
- return U(s, [{
198
+ _createClass(RangePickerAbstract2, [{
124
199
  key: "uncontrolledProps",
125
- value: function() {
126
- var e = this;
200
+ value: function uncontrolledProps() {
201
+ var _this2 = this;
127
202
  return {
128
203
  displayedPeriod: null,
129
- visible: [null, function(i) {
130
- var n = e.asProps, t = n.value, _ = n.displayedPeriod, l = D(t ?? void 0);
131
- if (i || (e.handlers.highlighted([]), e.handlers.preselectedValue([])), i) {
132
- if (l && l !== _)
133
- e.handlers.displayedPeriod(l);
134
- else if (!l) {
135
- var o = e.props, d = o.displayedPeriod, m = o.defaultDisplayedPeriod;
136
- e.handlers.displayedPeriod(d || m);
204
+ visible: [null, function(visible) {
205
+ var _this2$asProps = _this2.asProps, value = _this2$asProps.value, displayedPeriod = _this2$asProps.displayedPeriod;
206
+ var endDate = getEndDate(value !== null && value !== void 0 ? value : void 0);
207
+ if (!visible) {
208
+ _this2.handlers.highlighted([]);
209
+ _this2.handlers.preselectedValue([]);
210
+ }
211
+ if (visible) {
212
+ if (endDate && endDate !== displayedPeriod) {
213
+ _this2.handlers.displayedPeriod(endDate);
214
+ } else if (!endDate) {
215
+ var _this2$props = _this2.props, _displayedPeriod = _this2$props.displayedPeriod, _defaultDisplayedPeriod = _this2$props.defaultDisplayedPeriod;
216
+ _this2.handlers.displayedPeriod(_displayedPeriod || _defaultDisplayedPeriod);
137
217
  }
138
218
  }
139
219
  }],
140
220
  highlighted: null,
141
221
  preselectedValue: null,
142
- value: [null, function(i) {
143
- if (i[0] !== null || i[1] !== null) {
144
- var n, t;
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]));
222
+ value: [null, function(value) {
223
+ if (value[0] !== null || value[1] !== null) {
224
+ var _value$2, _value$3;
225
+ _this2.handlers.displayedPeriod(getEndDate([(_value$2 = value[0]) !== null && _value$2 !== void 0 ? _value$2 : void 0, (_value$3 = value[1]) !== null && _value$3 !== void 0 ? _value$3 : void 0]));
146
226
  }
147
227
  }]
148
228
  };
149
229
  }
150
230
  }, {
151
231
  key: "isDisabled",
152
- value: function(e) {
153
- var i = this.asProps.disabled;
154
- return i.some(te(h(e), "date"));
232
+ value: function isDisabled(date) {
233
+ var disabled = this.asProps.disabled;
234
+ return disabled.some(includesDate(dayjs(date), "date"));
155
235
  }
156
236
  }, {
157
237
  key: "getDefaultPeriods",
158
- value: function() {
238
+ value: function getDefaultPeriods() {
159
239
  return [];
160
240
  }
161
241
  }, {
162
242
  key: "getButtonTriggerProps",
163
- value: function() {
164
- var e = this.asProps, i = e.value, n = e.size, t = e.visible;
243
+ value: function getButtonTriggerProps() {
244
+ var _this$asProps3 = this.asProps, value = _this$asProps3.value, size = _this$asProps3.size, visible = _this$asProps3.visible;
165
245
  return {
166
- popoverVisible: t,
167
- size: n,
168
- empty: !i[0] && !i[1],
246
+ popoverVisible: visible,
247
+ size,
248
+ empty: !value[0] && !value[1],
169
249
  onKeyDown: this.handlerKeyDown("trigger")
170
250
  };
171
251
  }
172
252
  }, {
173
253
  key: "getPopperProps",
174
- value: function() {
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, {
254
+ value: function getPopperProps() {
255
+ var Picker = this[CORE_INSTANCE];
256
+ var _this$asProps4 = this.asProps, _this$asProps4$period = _this$asProps4.periods, periods = _this$asProps4$period === void 0 ? this.getDefaultPeriods() : _this$asProps4$period, unclearable = _this$asProps4.unclearable;
257
+ var buttons = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Picker.Apply, null), !unclearable && /* @__PURE__ */ React.createElement(Picker.Reset, {
176
258
  ml: 2
177
259
  }));
178
260
  return {
179
261
  tabIndex: 0,
180
262
  ref: this.popperRef,
181
263
  onKeyDown: this.handlerKeyDown("popper"),
182
- children: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(S, null, /* @__PURE__ */ r.createElement(S, null, /* @__PURE__ */ r.createElement(A, {
264
+ children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Flex, null, /* @__PURE__ */ React.createElement(Flex, null, /* @__PURE__ */ React.createElement(Box, {
183
265
  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(A, {
266
+ }, /* @__PURE__ */ React.createElement(Picker.Header, null, /* @__PURE__ */ React.createElement(Picker.Prev, null), /* @__PURE__ */ React.createElement(Picker.Title, null)), /* @__PURE__ */ React.createElement(Picker.Calendar, null)), /* @__PURE__ */ React.createElement(Box, {
185
267
  ml: 2
186
- }, /* @__PURE__ */ r.createElement(e.Header, null, /* @__PURE__ */ r.createElement(e.Title, {
268
+ }, /* @__PURE__ */ React.createElement(Picker.Header, null, /* @__PURE__ */ React.createElement(Picker.Title, {
187
269
  "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(z, {
270
+ }), /* @__PURE__ */ React.createElement(Picker.Next, null)), /* @__PURE__ */ React.createElement(Picker.Calendar, null))), periods.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Divider, {
189
271
  m: "-16px 16px",
190
272
  orientation: "vertical",
191
273
  h: "auto"
192
- }), /* @__PURE__ */ r.createElement(S, {
274
+ }), /* @__PURE__ */ React.createElement(Flex, {
193
275
  direction: "column"
194
- }, /* @__PURE__ */ r.createElement(e.Period, null), /* @__PURE__ */ r.createElement(S, {
276
+ }, /* @__PURE__ */ React.createElement(Picker.Period, null), /* @__PURE__ */ React.createElement(Flex, {
195
277
  mt: "auto"
196
- }, l)))), t.length === 0 && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(z, {
278
+ }, buttons)))), periods.length === 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Divider, {
197
279
  m: "16px -16px",
198
280
  orientation: "horizontal",
199
281
  w: "auto"
200
- }), /* @__PURE__ */ r.createElement(S, null, /* @__PURE__ */ r.createElement(e.Period, null), /* @__PURE__ */ r.createElement(S, {
282
+ }), /* @__PURE__ */ React.createElement(Flex, null, /* @__PURE__ */ React.createElement(Picker.Period, null), /* @__PURE__ */ React.createElement(Flex, {
201
283
  mt: "auto"
202
- }, l))))
284
+ }, buttons))))
203
285
  };
204
286
  }
205
287
  }, {
206
288
  key: "getHeaderProps",
207
- value: function() {
208
- var e = this[M];
289
+ value: function getHeaderProps() {
290
+ var Picker = this[CORE_INSTANCE];
209
291
  return {
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))
292
+ children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Picker.Prev, null), /* @__PURE__ */ React.createElement(Picker.Title, null), /* @__PURE__ */ React.createElement(Picker.Next, null))
211
293
  };
212
294
  }
213
295
  }, {
214
296
  key: "getTitleProps",
215
- value: function(e, i) {
216
- var n = this.asProps, t = n.locale, _ = n.displayedPeriod;
297
+ value: function getTitleProps(props, index) {
298
+ var _this$asProps5 = this.asProps, locale = _this$asProps5.locale, displayedPeriod = _this$asProps5.displayedPeriod;
217
299
  return {
218
- children: new Intl.DateTimeFormat(t, {
300
+ children: new Intl.DateTimeFormat(locale, {
219
301
  month: "long",
220
302
  year: "numeric"
221
- }).format(h(_).add(i, this.navigateStep).startOf(this.navigateStep).toDate())
303
+ }).format(dayjs(displayedPeriod).add(index, this.navigateStep).startOf(this.navigateStep).toDate())
222
304
  };
223
305
  }
224
306
  }, {
225
307
  key: "getNextProps",
226
- value: function() {
227
- var e = this.asProps.getI18nText, i = this.navigateStep;
308
+ value: function getNextProps() {
309
+ var getI18nText = this.asProps.getI18nText;
310
+ var navigateStep = this.navigateStep;
228
311
  return {
229
312
  onClick: this.bindHandlerNavigateClick(1),
230
- getI18nText: e,
231
- "aria-label": e(i === "month" ? "nextMonth" : "nextYear")
313
+ getI18nText,
314
+ "aria-label": navigateStep === "month" ? getI18nText("nextMonth") : getI18nText("nextYear")
232
315
  };
233
316
  }
234
317
  }, {
235
318
  key: "getPrevProps",
236
- value: function() {
237
- var e = this.asProps.getI18nText, i = this.navigateStep;
319
+ value: function getPrevProps() {
320
+ var getI18nText = this.asProps.getI18nText;
321
+ var navigateStep = this.navigateStep;
238
322
  return {
239
323
  onClick: this.bindHandlerNavigateClick(-1),
240
- getI18nText: e,
241
- "aria-label": e(i === "month" ? "prevMonth" : "prevYear")
324
+ getI18nText,
325
+ "aria-label": navigateStep === "month" ? getI18nText("prevMonth") : getI18nText("prevYear")
242
326
  };
243
327
  }
244
328
  }, {
245
329
  key: "getCalendarProps",
246
- value: function(e, i) {
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;
330
+ value: function getCalendarProps(_props, index) {
331
+ var _this$asProps6 = this.asProps, locale = _this$asProps6.locale, displayedPeriod = _this$asProps6.displayedPeriod, disabled = _this$asProps6.disabled, value = _this$asProps6.value, highlighted = _this$asProps6.highlighted, onHighlightedChange = _this$asProps6.onHighlightedChange, onVisibleChange = _this$asProps6.onVisibleChange, preselectedValue = _this$asProps6.preselectedValue, getI18nText = _this$asProps6.getI18nText;
248
332
  return {
249
- locale: t,
250
- displayedPeriod: h(_).add(i, this.navigateStep).startOf(this.navigateStep).toDate(),
251
- disabled: l,
252
- highlighted: d,
253
- onHighlightedChange: m,
254
- onVisibleChange: x,
255
- value: P.length ? P : o,
333
+ locale,
334
+ displayedPeriod: dayjs(displayedPeriod).add(index, this.navigateStep).startOf(this.navigateStep).toDate(),
335
+ disabled,
336
+ highlighted,
337
+ onHighlightedChange,
338
+ onVisibleChange,
339
+ value: preselectedValue.length ? preselectedValue : value,
256
340
  onChange: this.handleChange,
257
341
  unitRefs: this.unitRefs,
258
- getI18nText: y,
259
- actionsDescribing: i === 0 ? "range" : null,
260
- tabIndex: i === 0 ? 0 : -1
342
+ getI18nText,
343
+ actionsDescribing: index === 0 ? "range" : null,
344
+ tabIndex: index === 0 ? 0 : -1
261
345
  };
262
346
  }
263
347
  }, {
264
348
  key: "getPeriodProps",
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, d = e.getI18nText;
349
+ value: function getPeriodProps() {
350
+ var _this$asProps7 = this.asProps, _this$asProps7$period = _this$asProps7.periods, periods = _this$asProps7$period === void 0 ? this.getDefaultPeriods() : _this$asProps7$period, value = _this$asProps7.value, onHighlightedChange = _this$asProps7.onHighlightedChange, onDisplayedPeriodChange = _this$asProps7.onDisplayedPeriodChange, preselectedValue = _this$asProps7.preselectedValue, getI18nText = _this$asProps7.getI18nText;
267
351
  return {
268
- periods: n,
269
- value: o.length ? o : t,
352
+ periods,
353
+ value: preselectedValue.length ? preselectedValue : value,
270
354
  onChange: this.handleApply,
271
- onHighlightedChange: _,
272
- onDisplayedPeriodChange: l,
355
+ onHighlightedChange,
356
+ onDisplayedPeriodChange,
273
357
  role: "listbox",
274
- "aria-label": d("periods")
358
+ "aria-label": getI18nText("periods")
275
359
  };
276
360
  }
277
361
  }, {
278
362
  key: "getApplyProps",
279
- value: function() {
280
- var e = this.asProps.getI18nText;
363
+ value: function getApplyProps() {
364
+ var getI18nText = this.asProps.getI18nText;
281
365
  return {
282
- getI18nText: e,
366
+ getI18nText,
283
367
  onClick: this.handleApplyClick
284
368
  };
285
369
  }
286
370
  }, {
287
371
  key: "getResetProps",
288
- value: function() {
289
- var e = this, i = this.asProps.getI18nText;
372
+ value: function getResetProps() {
373
+ var _this3 = this;
374
+ var getI18nText = this.asProps.getI18nText;
290
375
  return {
291
- getI18nText: i,
292
- onClick: function() {
293
- return e.handleApply([]);
376
+ getI18nText,
377
+ onClick: function onClick() {
378
+ return _this3.handleApply([]);
294
379
  }
295
380
  };
296
381
  }
297
382
  }, {
298
383
  key: "render",
299
- value: function() {
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, E({
302
- "use:aria-label": l,
303
- __excludeProps: ["onChange", "value"]
304
- }, e), /* @__PURE__ */ r.createElement(t, i.cn("Children", {})))));
384
+ value: function render() {
385
+ var _ref = this.asProps, _ref4;
386
+ var _this$asProps8 = this.asProps, Children = _this$asProps8.Children, styles = _this$asProps8.styles, providedAriaLabel = _this$asProps8["aria-label"];
387
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, (_ref4 = sstyled$1(styles), /* @__PURE__ */ React.createElement(Dropdown, assignProps({
388
+ "use:aria-label": providedAriaLabel,
389
+ "__excludeProps": ["onChange", "value"]
390
+ }, _ref), /* @__PURE__ */ React.createElement(Children, _ref4.cn("Children", {})))));
305
391
  }
306
392
  }], [{
307
393
  key: "defaultProps",
308
- value: function(e) {
309
- var i = e.value, n = e.defaultValue;
394
+ value: function defaultProps(_ref5) {
395
+ var value = _ref5.value, defaultValue = _ref5.defaultValue;
310
396
  return {
311
- i18n: F,
397
+ i18n: localizedMessages,
312
398
  locale: "en",
313
- defaultDisplayedPeriod: D(i) || D(n) || oe,
399
+ defaultDisplayedPeriod: getEndDate(value) || getEndDate(defaultValue) || defaultDisplayedPeriod,
314
400
  defaultValue: [],
315
401
  defaultHighlighted: [],
316
- defaultVisible: !1,
402
+ defaultVisible: false,
317
403
  defaultPreselectedValue: [],
318
404
  disabled: [],
319
405
  size: "m"
320
406
  };
321
407
  }
322
- }]), s;
323
- }(Z);
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();
408
+ }]);
409
+ return RangePickerAbstract2;
410
+ }(Component);
411
+ _defineProperty(RangePickerAbstract, "displayName", "DatePicker");
412
+ _defineProperty(RangePickerAbstract, "style", style);
413
+ _defineProperty(RangePickerAbstract, "enhance", [i18nEnhance(localizedMessages)]);
414
+ _defineProperty(RangePickerAbstract, "add", function(date, amount, unit) {
415
+ return dayjs(date).add(amount, unit).toDate();
329
416
  });
330
- g(q, "subtract", function(c, p, s) {
331
- return h(c).subtract(p, s).toDate();
417
+ _defineProperty(RangePickerAbstract, "subtract", function(date, amount, unit) {
418
+ return dayjs(date).subtract(amount, unit).toDate();
332
419
  });
333
- function Ie(c) {
334
- var p = arguments[0], s = c.getI18nText;
335
- return /* @__PURE__ */ r.createElement(N, E({
336
- use: "primary",
337
- children: s("apply")
338
- }, p));
420
+ function Apply(props) {
421
+ var _ref2 = arguments[0];
422
+ var getI18nText = props.getI18nText;
423
+ return /* @__PURE__ */ React.createElement(Button, assignProps({
424
+ "use": "primary",
425
+ "children": getI18nText("apply")
426
+ }, _ref2));
339
427
  }
340
- function Ce(c) {
341
- var p = arguments[0], s = c.getI18nText;
342
- return /* @__PURE__ */ r.createElement(N, E({
343
- use: "tertiary",
344
- theme: "muted",
345
- children: s("reset")
346
- }, p));
428
+ function Reset(props) {
429
+ var _ref3 = arguments[0];
430
+ var getI18nText = props.getI18nText;
431
+ return /* @__PURE__ */ React.createElement(Button, assignProps({
432
+ "use": "tertiary",
433
+ "theme": "muted",
434
+ "children": getI18nText("reset")
435
+ }, _ref3));
347
436
  }
348
437
  export {
349
- Ie as Apply,
350
- Ce as Reset,
351
- q as default
438
+ Apply,
439
+ Reset,
440
+ RangePickerAbstract as default
352
441
  };