@semcore/date-picker 16.2.4 → 17.0.0-prerelease.18

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 (107) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/DatePicker.js +116 -139
  3. package/lib/cjs/DatePicker.js.map +1 -1
  4. package/lib/cjs/DateRangeComparator.js +144 -149
  5. package/lib/cjs/DateRangeComparator.js.map +1 -1
  6. package/lib/cjs/DateRangePicker.js +86 -101
  7. package/lib/cjs/DateRangePicker.js.map +1 -1
  8. package/lib/cjs/MonthDateRangeComparator.js +173 -180
  9. package/lib/cjs/MonthDateRangeComparator.js.map +1 -1
  10. package/lib/cjs/MonthPicker.js +70 -87
  11. package/lib/cjs/MonthPicker.js.map +1 -1
  12. package/lib/cjs/MonthRangePicker.js +96 -111
  13. package/lib/cjs/MonthRangePicker.js.map +1 -1
  14. package/lib/cjs/components/ButtonTrigger.js +12 -11
  15. package/lib/cjs/components/ButtonTrigger.js.map +1 -1
  16. package/lib/cjs/components/Calendar.js +409 -466
  17. package/lib/cjs/components/Calendar.js.map +1 -1
  18. package/lib/cjs/components/DateRangeComparatorAbstract.js +574 -626
  19. package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
  20. package/lib/cjs/components/InputTrigger.js +585 -677
  21. package/lib/cjs/components/InputTrigger.js.map +1 -1
  22. package/lib/cjs/components/PickerAbstract.js +254 -273
  23. package/lib/cjs/components/PickerAbstract.js.map +1 -1
  24. package/lib/cjs/components/RangePickerAbstract.js +407 -439
  25. package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
  26. package/lib/cjs/components/index.js +92 -102
  27. package/lib/cjs/components/index.js.map +1 -1
  28. package/lib/cjs/index.d.js.map +1 -1
  29. package/lib/cjs/index.js +15 -15
  30. package/lib/cjs/index.js.map +1 -1
  31. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +17 -17
  32. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  33. package/lib/cjs/utils/cronTabScheduler.js +13 -22
  34. package/lib/cjs/utils/cronTabScheduler.js.map +1 -1
  35. package/lib/cjs/utils/datesIntersects.js +12 -19
  36. package/lib/cjs/utils/datesIntersects.js.map +1 -1
  37. package/lib/cjs/utils/formatDate.js +11 -9
  38. package/lib/cjs/utils/formatDate.js.map +1 -1
  39. package/lib/cjs/utils/includesDate.js +11 -16
  40. package/lib/cjs/utils/includesDate.js.map +1 -1
  41. package/lib/cjs/utils/isBetweenPlugin.js +6 -6
  42. package/lib/cjs/utils/isBetweenPlugin.js.map +1 -1
  43. package/lib/cjs/utils/shortDateRangeFormat.js +29 -33
  44. package/lib/cjs/utils/shortDateRangeFormat.js.map +1 -1
  45. package/lib/es6/DatePicker.js +117 -141
  46. package/lib/es6/DatePicker.js.map +1 -1
  47. package/lib/es6/DateRangeComparator.js +130 -135
  48. package/lib/es6/DateRangeComparator.js.map +1 -1
  49. package/lib/es6/DateRangePicker.js +87 -102
  50. package/lib/es6/DateRangePicker.js.map +1 -1
  51. package/lib/es6/MonthDateRangeComparator.js +159 -166
  52. package/lib/es6/MonthDateRangeComparator.js.map +1 -1
  53. package/lib/es6/MonthPicker.js +72 -89
  54. package/lib/es6/MonthPicker.js.map +1 -1
  55. package/lib/es6/MonthRangePicker.js +97 -112
  56. package/lib/es6/MonthRangePicker.js.map +1 -1
  57. package/lib/es6/components/ButtonTrigger.js +4 -3
  58. package/lib/es6/components/ButtonTrigger.js.map +1 -1
  59. package/lib/es6/components/Calendar.js +400 -457
  60. package/lib/es6/components/Calendar.js.map +1 -1
  61. package/lib/es6/components/DateRangeComparatorAbstract.js +552 -604
  62. package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
  63. package/lib/es6/components/InputTrigger.js +568 -660
  64. package/lib/es6/components/InputTrigger.js.map +1 -1
  65. package/lib/es6/components/PickerAbstract.js +246 -265
  66. package/lib/es6/components/PickerAbstract.js.map +1 -1
  67. package/lib/es6/components/RangePickerAbstract.js +397 -429
  68. package/lib/es6/components/RangePickerAbstract.js.map +1 -1
  69. package/lib/es6/components/index.js +74 -85
  70. package/lib/es6/components/index.js.map +1 -1
  71. package/lib/es6/index.d.js.map +1 -1
  72. package/lib/es6/translations/__intergalactic-dynamic-locales.js +16 -16
  73. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  74. package/lib/es6/utils/cronTabScheduler.js +13 -21
  75. package/lib/es6/utils/cronTabScheduler.js.map +1 -1
  76. package/lib/es6/utils/datesIntersects.js +10 -18
  77. package/lib/es6/utils/datesIntersects.js.map +1 -1
  78. package/lib/es6/utils/formatDate.js +6 -6
  79. package/lib/es6/utils/formatDate.js.map +1 -1
  80. package/lib/es6/utils/includesDate.js +10 -15
  81. package/lib/es6/utils/includesDate.js.map +1 -1
  82. package/lib/es6/utils/isBetweenPlugin.js +4 -4
  83. package/lib/es6/utils/isBetweenPlugin.js.map +1 -1
  84. package/lib/es6/utils/shortDateRangeFormat.js +27 -31
  85. package/lib/es6/utils/shortDateRangeFormat.js.map +1 -1
  86. package/lib/esm/DatePicker.mjs +109 -114
  87. package/lib/esm/DateRangeComparator.mjs +112 -105
  88. package/lib/esm/DateRangePicker.mjs +76 -80
  89. package/lib/esm/MonthDateRangeComparator.mjs +141 -134
  90. package/lib/esm/MonthPicker.mjs +65 -70
  91. package/lib/esm/MonthRangePicker.mjs +86 -88
  92. package/lib/esm/components/ButtonTrigger.mjs +4 -3
  93. package/lib/esm/components/Calendar.mjs +397 -423
  94. package/lib/esm/components/DateRangeComparatorAbstract.mjs +559 -516
  95. package/lib/esm/components/InputTrigger.mjs +550 -557
  96. package/lib/esm/components/PickerAbstract.mjs +249 -244
  97. package/lib/esm/components/RangePickerAbstract.mjs +400 -384
  98. package/lib/esm/components/index.mjs +73 -69
  99. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
  100. package/lib/esm/utils/cronTabScheduler.mjs +13 -18
  101. package/lib/esm/utils/datesIntersects.mjs +10 -14
  102. package/lib/esm/utils/formatDate.mjs +6 -6
  103. package/lib/esm/utils/includesDate.mjs +10 -13
  104. package/lib/esm/utils/isBetweenPlugin.mjs +4 -4
  105. package/lib/esm/utils/shortDateRangeFormat.mjs +27 -27
  106. package/lib/types/index.d.ts +2 -44
  107. package/package.json +16 -17
@@ -1,17 +1,11 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/esm/createClass";
5
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
6
- import _inherits from "@babel/runtime/helpers/esm/inherits";
7
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
2
  import { sstyled, assignProps, Component } from "@semcore/core";
3
+ import { Flex } from "@semcore/base-components";
9
4
  import { LinkTrigger } from "@semcore/base-trigger";
10
5
  import Button from "@semcore/button";
11
6
  import Checkbox from "@semcore/checkbox";
12
7
  import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
13
8
  import Dropdown from "@semcore/dropdown";
14
- import { Flex } from "@semcore/flex-box";
15
9
  import dayjs from "dayjs";
16
10
  import React from "react";
17
11
  import { localizedMessages } from "../translations/__intergalactic-dynamic-locales.mjs";
@@ -19,564 +13,592 @@ import { formatMMYY, formatDDMMYY } from "../utils/formatDate.mjs";
19
13
  import { includesDate } from "../utils/includesDate.mjs";
20
14
  import shortDateRangeFormat from "../utils/shortDateRangeFormat.mjs";
21
15
  /*!__reshadow-styles__:"../style/date-picker.shadow.css"*/
22
- var style = (
16
+ const style = (
23
17
  /*__reshadow_css_start__*/
24
18
  (sstyled.insert(
25
19
  /*__inner_css_start__*/
26
- ".___SPopper_gjj0p_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_gjj0p_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_gjj0p_gg_:active,.___SPopper_gjj0p_gg_:focus{-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_gjj0p_gg_:hover{-webkit-text-decoration:none;text-decoration:none}}.___SHeader_gjj0p_gg_,.___STitle_gjj0p_gg_{display:flex;align-items:center}.___STitle_gjj0p_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_gjj0p_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_gjj0p_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_gjj0p_gg_ .___SInner_gjj0p_gg_{justify-content:flex-start}.___SInputMask_gjj0p_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_gjj0p_gg_.__animationsDisabled_gjj0p_gg_{transition:none}.___SInputMask_gjj0p_gg_ .___SValue_gjj0p_gg_{letter-spacing:0}.___SInputMask_gjj0p_gg_ .___SValue_gjj0p_gg_:focus{outline:0}.___SIndicator_gjj0p_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SRangeIndicator_gjj0p_gg_{border-radius:50%;flex-shrink:0}.___SRangeIndicator_gjj0p_gg_._range_value_gjj0p_gg_{background-color:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SRangeIndicator_gjj0p_gg_._range_compare_gjj0p_gg_{background-color:var(--intergalactic-date-picker-cell-comparison-active, #8649e1)}.___SRangeIndicator_gjj0p_gg_.__disabled_gjj0p_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SHumanizedDate_gjj0p_gg_{position:absolute;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.___SMask_gjj0p_gg_{letter-spacing:0;white-space:nowrap;overflow:hidden}.___SDateRange_gjj0p_gg_ .___SMask_gjj0p_gg_,.___SDateRange_gjj0p_gg_ .___SValue_gjj0p_gg_,.___SSingleDateInput_gjj0p_gg_ .___SMask_gjj0p_gg_,.___SSingleDateInput_gjj0p_gg_ .___SValue_gjj0p_gg_{opacity:0}.___SSingleDateInput_gjj0p_gg_:focus-within .___SHumanizedDate_gjj0p_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_gjj0p_gg_:focus-within .___SMask_gjj0p_gg_,.___SSingleDateInput_gjj0p_gg_:focus-within .___SValue_gjj0p_gg_{opacity:1}.___SDateRange_gjj0p_gg_:focus-within .___SHumanizedDate_gjj0p_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_gjj0p_gg_:focus-within .___SMask_gjj0p_gg_,.___SDateRange_gjj0p_gg_:focus-within .___SValue_gjj0p_gg_{opacity:1}.___SInputMask_gjj0p_gg_.__noHumanizedDate_gjj0p_gg_ .___SMask_gjj0p_gg_,.___SInputMask_gjj0p_gg_.__noHumanizedDate_gjj0p_gg_ .___SValue_gjj0p_gg_{opacity:1}.___SDateRange_gjj0p_gg_ .___SInputMask_gjj0p_gg_:focus-within .___SMask_gjj0p_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_gjj0p_gg_:focus-within .___SRangeSep_gjj0p_gg_,.___SRangeSep_gjj0p_gg_.__fulfilled_gjj0p_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SRangeComparatorHeader_gjj0p_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SRangeCalendar_gjj0p_gg_,.___SRangeComparatorHeader_gjj0p_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___SFooter_gjj0p_gg_{border-top:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SFooter_gjj0p_gg_,.___SPeriodsList_gjj0p_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___STooltip_gjj0p_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SCompareToggle_gjj0p_gg_{white-space:nowrap}@media (prefers-reduced-motion){.___SInputMask_gjj0p_gg_{transition:none}}",
20
+ ".___SPopper_9ubmf_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_9ubmf_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_9ubmf_gg_:active,.___SPopper_9ubmf_gg_:focus{-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_9ubmf_gg_:hover{-webkit-text-decoration:none;text-decoration:none}}.___SHeader_9ubmf_gg_,.___STitle_9ubmf_gg_{display:flex;align-items:center}.___STitle_9ubmf_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_9ubmf_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_9ubmf_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_9ubmf_gg_ .___SInner_9ubmf_gg_{justify-content:flex-start}.___SInputMask_9ubmf_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_9ubmf_gg_.__animationsDisabled_9ubmf_gg_{transition:none}.___SInputMask_9ubmf_gg_ .___SValue_9ubmf_gg_{letter-spacing:0}.___SInputMask_9ubmf_gg_ .___SValue_9ubmf_gg_:focus{outline:0}.___SIndicator_9ubmf_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SRangeIndicator_9ubmf_gg_{border-radius:50%;flex-shrink:0}.___SRangeIndicator_9ubmf_gg_._range_value_9ubmf_gg_{background-color:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SRangeIndicator_9ubmf_gg_._range_compare_9ubmf_gg_{background-color:var(--intergalactic-date-picker-cell-comparison-active, #8649e1)}.___SRangeIndicator_9ubmf_gg_.__disabled_9ubmf_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SHumanizedDate_9ubmf_gg_{position:absolute;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.___SMask_9ubmf_gg_{letter-spacing:0;white-space:nowrap;overflow:hidden}.___SDateRange_9ubmf_gg_ .___SMask_9ubmf_gg_,.___SDateRange_9ubmf_gg_ .___SValue_9ubmf_gg_,.___SSingleDateInput_9ubmf_gg_ .___SMask_9ubmf_gg_,.___SSingleDateInput_9ubmf_gg_ .___SValue_9ubmf_gg_{opacity:0}.___SSingleDateInput_9ubmf_gg_:focus-within .___SHumanizedDate_9ubmf_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_9ubmf_gg_:focus-within .___SMask_9ubmf_gg_,.___SSingleDateInput_9ubmf_gg_:focus-within .___SValue_9ubmf_gg_{opacity:1}.___SDateRange_9ubmf_gg_:focus-within .___SHumanizedDate_9ubmf_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_9ubmf_gg_:focus-within .___SMask_9ubmf_gg_,.___SDateRange_9ubmf_gg_:focus-within .___SValue_9ubmf_gg_{opacity:1}.___SInputMask_9ubmf_gg_.__noHumanizedDate_9ubmf_gg_ .___SMask_9ubmf_gg_,.___SInputMask_9ubmf_gg_.__noHumanizedDate_9ubmf_gg_ .___SValue_9ubmf_gg_{opacity:1}.___SDateRange_9ubmf_gg_ .___SInputMask_9ubmf_gg_:focus-within .___SMask_9ubmf_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_9ubmf_gg_:focus-within .___SRangeSep_9ubmf_gg_,.___SRangeSep_9ubmf_gg_.__fulfilled_9ubmf_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SRangeComparatorHeader_9ubmf_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SRangeCalendar_9ubmf_gg_,.___SRangeComparatorHeader_9ubmf_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___SFooter_9ubmf_gg_{border-top:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SFooter_9ubmf_gg_,.___SPeriodsList_9ubmf_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___STooltip_9ubmf_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SCompareToggle_9ubmf_gg_{white-space:nowrap}@media (prefers-reduced-motion){.___SInputMask_9ubmf_gg_{transition:none}}",
27
21
  /*__inner_css_end__*/
28
- "gjj0p_gg_"
22
+ "9ubmf_gg_"
29
23
  ), /*__reshadow_css_end__*/
30
24
  {
31
- "__SHeader": "___SHeader_gjj0p_gg_",
32
- "__STitle": "___STitle_gjj0p_gg_",
33
- "__SToday": "___SToday_gjj0p_gg_",
34
- "__SPeriod": "___SPeriod_gjj0p_gg_",
35
- "__SButton": "___SButton_gjj0p_gg_",
36
- "__SInner": "___SInner_gjj0p_gg_",
37
- "__SInputMask": "___SInputMask_gjj0p_gg_",
38
- "_animationsDisabled": "__animationsDisabled_gjj0p_gg_",
39
- "__SIndicator": "___SIndicator_gjj0p_gg_",
40
- "__SRangeIndicator": "___SRangeIndicator_gjj0p_gg_",
41
- "_range_value": "_range_value_gjj0p_gg_",
42
- "_range_compare": "_range_compare_gjj0p_gg_",
43
- "_disabled": "__disabled_gjj0p_gg_",
44
- "__SHumanizedDate": "___SHumanizedDate_gjj0p_gg_",
45
- "__SMask": "___SMask_gjj0p_gg_",
46
- "__SSingleDateInput": "___SSingleDateInput_gjj0p_gg_",
47
- "__SValue": "___SValue_gjj0p_gg_",
48
- "__SDateRange": "___SDateRange_gjj0p_gg_",
49
- "_noHumanizedDate": "__noHumanizedDate_gjj0p_gg_",
50
- "__SRangeSep": "___SRangeSep_gjj0p_gg_",
51
- "_fulfilled": "__fulfilled_gjj0p_gg_",
52
- "__SRangeComparatorHeader": "___SRangeComparatorHeader_gjj0p_gg_",
53
- "__SRangeCalendar": "___SRangeCalendar_gjj0p_gg_",
54
- "__SFooter": "___SFooter_gjj0p_gg_",
55
- "__SPeriodsList": "___SPeriodsList_gjj0p_gg_",
56
- "__STooltip": "___STooltip_gjj0p_gg_",
57
- "__SCompareToggle": "___SCompareToggle_gjj0p_gg_",
58
- "__SPopper": "___SPopper_gjj0p_gg_"
25
+ "__SHeader": "___SHeader_9ubmf_gg_",
26
+ "__STitle": "___STitle_9ubmf_gg_",
27
+ "__SToday": "___SToday_9ubmf_gg_",
28
+ "__SPeriod": "___SPeriod_9ubmf_gg_",
29
+ "__SButton": "___SButton_9ubmf_gg_",
30
+ "__SInner": "___SInner_9ubmf_gg_",
31
+ "__SInputMask": "___SInputMask_9ubmf_gg_",
32
+ "_animationsDisabled": "__animationsDisabled_9ubmf_gg_",
33
+ "__SIndicator": "___SIndicator_9ubmf_gg_",
34
+ "__SRangeIndicator": "___SRangeIndicator_9ubmf_gg_",
35
+ "_range_value": "_range_value_9ubmf_gg_",
36
+ "_range_compare": "_range_compare_9ubmf_gg_",
37
+ "_disabled": "__disabled_9ubmf_gg_",
38
+ "__SHumanizedDate": "___SHumanizedDate_9ubmf_gg_",
39
+ "__SMask": "___SMask_9ubmf_gg_",
40
+ "__SSingleDateInput": "___SSingleDateInput_9ubmf_gg_",
41
+ "__SValue": "___SValue_9ubmf_gg_",
42
+ "__SDateRange": "___SDateRange_9ubmf_gg_",
43
+ "_noHumanizedDate": "__noHumanizedDate_9ubmf_gg_",
44
+ "__SRangeSep": "___SRangeSep_9ubmf_gg_",
45
+ "_fulfilled": "__fulfilled_9ubmf_gg_",
46
+ "__SRangeComparatorHeader": "___SRangeComparatorHeader_9ubmf_gg_",
47
+ "__SRangeCalendar": "___SRangeCalendar_9ubmf_gg_",
48
+ "__SFooter": "___SFooter_9ubmf_gg_",
49
+ "__SPeriodsList": "___SPeriodsList_9ubmf_gg_",
50
+ "__STooltip": "___STooltip_9ubmf_gg_",
51
+ "__SCompareToggle": "___SCompareToggle_9ubmf_gg_",
52
+ "__SPopper": "___SPopper_9ubmf_gg_"
59
53
  })
60
54
  );
61
- var INTERACTION_TAGS = ["INPUT"];
62
- var INTERACTION_KEYS = ["ArrowDown", "Enter", " "];
63
- var defaultDisplayedPeriod = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
64
- var getLatestDate = function getLatestDate2() {
65
- for (var _len = arguments.length, dateRanges = new Array(_len), _key = 0; _key < _len; _key++) {
66
- dateRanges[_key] = arguments[_key];
67
- }
68
- var allDates = dateRanges.flat().filter(Boolean).filter(function(date) {
69
- return !Number.isNaN(new Date(date).getTime());
70
- });
55
+ const INTERACTION_TAGS = ["INPUT"];
56
+ const INTERACTION_KEYS = ["ArrowDown", "Enter", " "];
57
+ const defaultDisplayedPeriod = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
58
+ const getLatestDate = (...dateRanges) => {
59
+ const allDates = dateRanges.flat().filter(Boolean).filter((date) => !Number.isNaN(new Date(date).getTime()));
71
60
  if (!allDates.length) return null;
72
- allDates.sort(function(a, b) {
73
- return new Date(b).getTime() - new Date(a).getTime();
74
- });
75
- var latestDate = allDates[0];
61
+ allDates.sort((a, b) => new Date(b).getTime() - new Date(a).getTime());
62
+ const latestDate = allDates[0];
76
63
  return latestDate;
77
64
  };
78
- var DateRangeComparatorAbstract = /* @__PURE__ */ (function(_Component) {
79
- function DateRangeComparatorAbstract2() {
80
- var _this;
81
- _classCallCheck(this, DateRangeComparatorAbstract2);
82
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
83
- args[_key2] = arguments[_key2];
84
- }
85
- _this = _callSuper(this, DateRangeComparatorAbstract2, [].concat(args));
86
- _defineProperty(_this, "prevButtonRef", /* @__PURE__ */ React.createRef());
87
- _defineProperty(_this, "nextButtonRef", /* @__PURE__ */ React.createRef());
88
- _defineProperty(_this, "popperRef", /* @__PURE__ */ React.createRef());
89
- _defineProperty(_this, "resetButtonRef", /* @__PURE__ */ React.createRef());
90
- _defineProperty(_this, "applyButtonRef", /* @__PURE__ */ React.createRef());
91
- _defineProperty(_this, "periodRefs", []);
92
- _defineProperty(_this, "unitRefs", {});
93
- _defineProperty(_this, "navigateView", function(direction) {
94
- var displayedPeriod = _this.asProps.displayedPeriod;
95
- var action = direction >= 1 ? "add" : "subtract";
96
- var date = dayjs(displayedPeriod)[action](1, _this.navigateStep).toDate();
97
- _this.handlers.displayedPeriod(date);
98
- });
99
- _defineProperty(_this, "bindHandlerNavigateClick", function(direction) {
100
- return function() {
101
- return _this.navigateView(direction);
102
- };
65
+ class DateRangeComparatorAbstract extends Component {
66
+ constructor(...args) {
67
+ super(...args);
68
+ _defineProperty(this, "prevButtonRef", /* @__PURE__ */ React.createRef());
69
+ _defineProperty(this, "nextButtonRef", /* @__PURE__ */ React.createRef());
70
+ _defineProperty(this, "popperRef", /* @__PURE__ */ React.createRef());
71
+ _defineProperty(this, "resetButtonRef", /* @__PURE__ */ React.createRef());
72
+ _defineProperty(this, "applyButtonRef", /* @__PURE__ */ React.createRef());
73
+ _defineProperty(this, "periodRefs", []);
74
+ _defineProperty(this, "unitRefs", {});
75
+ _defineProperty(this, "navigateView", (direction) => {
76
+ const {
77
+ displayedPeriod
78
+ } = this.asProps;
79
+ const action = direction >= 1 ? "add" : "subtract";
80
+ const date = dayjs(displayedPeriod)[action](1, this.navigateStep).toDate();
81
+ this.handlers.displayedPeriod(date);
103
82
  });
104
- _defineProperty(_this, "handleApplyClick", function() {
105
- var _this$asProps = _this.asProps, value = _this$asProps.value, preselectedValue = _this$asProps.preselectedValue, preselectedCompare = _this$asProps.preselectedCompare;
106
- return _this.handleApply(preselectedValue !== null && preselectedValue !== void 0 ? preselectedValue : value === null || value === void 0 ? void 0 : value.value, preselectedCompare !== null && preselectedCompare !== void 0 ? preselectedCompare : value === null || value === void 0 ? void 0 : value.compare);
83
+ _defineProperty(this, "bindHandlerNavigateClick", (direction) => () => this.navigateView(direction));
84
+ _defineProperty(this, "handleApplyClick", () => {
85
+ const {
86
+ value,
87
+ preselectedValue,
88
+ preselectedCompare
89
+ } = this.asProps;
90
+ return this.handleApply(preselectedValue ?? (value == null ? void 0 : value.value), preselectedCompare ?? (value == null ? void 0 : value.compare));
107
91
  });
108
- _defineProperty(_this, "handleApply", function(value, compare) {
109
- _this.handlers.value({
92
+ _defineProperty(this, "handleApply", (value, compare) => {
93
+ this.handlers.value({
110
94
  value,
111
95
  compare
112
96
  });
113
- _this.handlers.visible(false);
97
+ this.handlers.visible(false);
114
98
  });
115
- _defineProperty(_this, "handleKeydownDown", function(place) {
116
- return function(e) {
117
- var _this$asProps2 = _this.asProps, displayedPeriod = _this$asProps2.displayedPeriod, preselectedValue = _this$asProps2.preselectedValue, visible = _this$asProps2.visible, focusedRange = _this$asProps2.focusedRange;
118
- var key = e.key, target = e.target;
119
- var highlighted = focusedRange === "compare" ? _this.asProps.compareHighlighted : _this.asProps.highlighted;
120
- if ([" ", "Enter"].includes(key) && [_this.prevButtonRef.current, _this.nextButtonRef.current].includes(target)) return;
121
- if (place === "trigger" && INTERACTION_KEYS.includes(key)) {
122
- e.preventDefault();
123
- e.stopPropagation();
124
- _this.handlers.visible(!visible);
125
- setTimeout(function() {
126
- var popper = _this.popperRef.current;
127
- if (popper) {
128
- popper.focus();
129
- }
130
- }, 0);
131
- }
132
- var day = _this.keyDiff[key];
133
- var setNextDisplayedPeriod = function setNextDisplayedPeriod2(next_highlighted2) {
134
- var _next_highlighted = _slicedToArray(next_highlighted2, 2), startPeriod = _next_highlighted[0], endPeriod = _next_highlighted[1];
135
- var highlightedPeriod = endPeriod || startPeriod;
136
- var displayedPeriodNormalized = displayedPeriod === null || displayedPeriod === void 0 ? void 0 : displayedPeriod.getDate();
137
- var highlightedPeriodNormalized = highlightedPeriod === null || highlightedPeriod === void 0 ? void 0 : highlightedPeriod.getDate();
138
- if (_this.navigateStep === "month") {
139
- displayedPeriodNormalized = displayedPeriod === null || displayedPeriod === void 0 ? void 0 : displayedPeriod.getMonth();
140
- highlightedPeriodNormalized = highlightedPeriod === null || highlightedPeriod === void 0 ? void 0 : highlightedPeriod.getMonth();
141
- }
142
- if (_this.navigateStep === "year") {
143
- displayedPeriodNormalized = displayedPeriod === null || displayedPeriod === void 0 ? void 0 : displayedPeriod.getYear();
144
- highlightedPeriodNormalized = highlightedPeriod === null || highlightedPeriod === void 0 ? void 0 : highlightedPeriod.getYear();
145
- }
146
- var offset = highlightedPeriodNormalized - displayedPeriodNormalized;
147
- if (offset < 0 || offset > 1) {
148
- return highlightedPeriod;
149
- }
150
- return displayedPeriod;
151
- };
152
- var isPeriodTarget = _this.periodRefs.find(function(el) {
153
- return el === target;
154
- });
155
- var isResetButtonTarget = target === _this.resetButtonRef.current;
156
- var isApplyButtonTarget = target === _this.applyButtonRef.current;
157
- var areTargetedControls = isPeriodTarget || isResetButtonTarget || isApplyButtonTarget;
158
- if (place === "popper" && e.key === " " && highlighted.length && !areTargetedControls) {
159
- var highlightedDate = highlighted[1] || highlighted[0];
160
- if (!_this.isDisabled(highlightedDate)) {
161
- _this.handleChange(highlightedDate);
99
+ _defineProperty(this, "handleKeydownDown", (place) => (e) => {
100
+ var _a;
101
+ const {
102
+ displayedPeriod,
103
+ preselectedValue,
104
+ visible,
105
+ focusedRange
106
+ } = this.asProps;
107
+ const {
108
+ key,
109
+ target
110
+ } = e;
111
+ const highlighted = focusedRange === "compare" ? this.asProps.compareHighlighted : this.asProps.highlighted;
112
+ if ([" ", "Enter"].includes(key) && [this.prevButtonRef.current, this.nextButtonRef.current].includes(target)) return;
113
+ if (place === "trigger" && INTERACTION_KEYS.includes(key)) {
114
+ e.preventDefault();
115
+ e.stopPropagation();
116
+ this.handlers.visible(!visible);
117
+ setTimeout(() => {
118
+ const popper = this.popperRef.current;
119
+ if (popper) {
120
+ popper.focus();
162
121
  }
163
- e.preventDefault();
122
+ }, 0);
123
+ }
124
+ const day = this.keyDiff[key];
125
+ const setNextDisplayedPeriod = (next_highlighted) => {
126
+ const [startPeriod, endPeriod] = next_highlighted;
127
+ const highlightedPeriod = endPeriod || startPeriod;
128
+ let displayedPeriodNormalized = displayedPeriod == null ? void 0 : displayedPeriod.getDate();
129
+ let highlightedPeriodNormalized = highlightedPeriod == null ? void 0 : highlightedPeriod.getDate();
130
+ if (this.navigateStep === "month") {
131
+ displayedPeriodNormalized = displayedPeriod == null ? void 0 : displayedPeriod.getMonth();
132
+ highlightedPeriodNormalized = highlightedPeriod == null ? void 0 : highlightedPeriod.getMonth();
164
133
  }
165
- if (place === "popper" && e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
166
- return _this.handleApplyClick();
134
+ if (this.navigateStep === "year") {
135
+ displayedPeriodNormalized = displayedPeriod == null ? void 0 : displayedPeriod.getYear();
136
+ highlightedPeriodNormalized = highlightedPeriod == null ? void 0 : highlightedPeriod.getYear();
167
137
  }
168
- var changedDate = void 0;
169
- if (day) {
170
- if (INTERACTION_TAGS.includes(e.target.tagName)) return;
171
- if (highlighted.length) {
172
- var next_highlighted;
173
- if ((preselectedValue === null || preselectedValue === void 0 ? void 0 : preselectedValue.length) === 1) {
174
- next_highlighted = [preselectedValue[0], dayjs(highlighted[1] || highlighted[0]).add(day, _this.keyStep).toDate()];
175
- changedDate = next_highlighted[1];
176
- } else {
177
- next_highlighted = [dayjs(highlighted[0]).add(day, _this.keyStep).toDate()];
178
- changedDate = next_highlighted[0];
179
- }
180
- if (focusedRange === "compare") {
181
- _this.handlers.compareHighlighted(next_highlighted);
182
- } else {
183
- _this.handlers.highlighted(next_highlighted);
184
- }
185
- _this.handlers.displayedPeriod(setNextDisplayedPeriod(next_highlighted));
138
+ const offset = highlightedPeriodNormalized - displayedPeriodNormalized;
139
+ if (offset < 0 || offset > 1) {
140
+ return highlightedPeriod;
141
+ }
142
+ return displayedPeriod;
143
+ };
144
+ const isPeriodTarget = this.periodRefs.find((el) => el === target);
145
+ const isResetButtonTarget = target === this.resetButtonRef.current;
146
+ const isApplyButtonTarget = target === this.applyButtonRef.current;
147
+ const areTargetedControls = isPeriodTarget || isResetButtonTarget || isApplyButtonTarget;
148
+ if (place === "popper" && e.key === " " && highlighted.length && !areTargetedControls) {
149
+ const highlightedDate = highlighted[1] || highlighted[0];
150
+ if (!this.isDisabled(highlightedDate)) {
151
+ this.handleChange(highlightedDate);
152
+ }
153
+ e.preventDefault();
154
+ }
155
+ if (place === "popper" && e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
156
+ return this.handleApplyClick();
157
+ }
158
+ let changedDate = void 0;
159
+ if (day) {
160
+ if (INTERACTION_TAGS.includes(e.target.tagName)) return;
161
+ if (highlighted.length) {
162
+ let next_highlighted;
163
+ if ((preselectedValue == null ? void 0 : preselectedValue.length) === 1) {
164
+ next_highlighted = [preselectedValue[0], dayjs(highlighted[1] || highlighted[0]).add(day, this.keyStep).toDate()];
165
+ changedDate = next_highlighted[1];
166
+ } else {
167
+ next_highlighted = [dayjs(highlighted[0]).add(day, this.keyStep).toDate()];
168
+ changedDate = next_highlighted[0];
169
+ }
170
+ if (focusedRange === "compare") {
171
+ this.handlers.compareHighlighted(next_highlighted);
186
172
  } else {
187
- var _highlighted = [displayedPeriod ? displayedPeriod : dayjs().toDate()];
188
- if (focusedRange === "compare") {
189
- _this.handlers.compareHighlighted(_highlighted);
190
- } else {
191
- _this.handlers.highlighted(_highlighted);
192
- }
193
- changedDate = _highlighted[0];
173
+ this.handlers.highlighted(next_highlighted);
194
174
  }
195
- e.preventDefault();
196
- if (changedDate) {
197
- var _this$unitRefs$format;
198
- var formatter = _this.keyStep === "month" ? formatMMYY : formatDDMMYY;
199
- var formattedDate = formatter(changedDate, _this.asProps.locale);
200
- (_this$unitRefs$format = _this.unitRefs[formattedDate]) === null || _this$unitRefs$format === void 0 || _this$unitRefs$format.focus();
175
+ this.handlers.displayedPeriod(setNextDisplayedPeriod(next_highlighted));
176
+ } else {
177
+ const highlighted2 = [displayedPeriod ? displayedPeriod : dayjs().toDate()];
178
+ if (focusedRange === "compare") {
179
+ this.handlers.compareHighlighted(highlighted2);
180
+ } else {
181
+ this.handlers.highlighted(highlighted2);
201
182
  }
183
+ changedDate = highlighted2[0];
202
184
  }
203
- };
185
+ e.preventDefault();
186
+ if (changedDate) {
187
+ const formatter = this.keyStep === "month" ? formatMMYY : formatDDMMYY;
188
+ const formattedDate = formatter(changedDate, this.asProps.locale);
189
+ (_a = this.unitRefs[formattedDate]) == null ? void 0 : _a.focus();
190
+ }
191
+ }
204
192
  });
205
- _defineProperty(_this, "triggerFormattingProps", {
193
+ _defineProperty(this, "triggerFormattingProps", {
206
194
  day: "numeric",
207
195
  month: "short",
208
196
  year: "numeric"
209
197
  });
210
- _defineProperty(_this, "handleChange", function(date) {
211
- var _value, _value2, _value3;
212
- var _this$asProps3 = _this.asProps, focusedRange = _this$asProps3.focusedRange, preselectedCompare = _this$asProps3.preselectedCompare, preselectedValue = _this$asProps3.preselectedValue;
213
- var highlighted = [];
214
- var value = focusedRange === "compare" ? preselectedCompare : preselectedValue;
198
+ _defineProperty(this, "handleChange", (date) => {
199
+ const {
200
+ focusedRange,
201
+ preselectedCompare,
202
+ preselectedValue
203
+ } = this.asProps;
204
+ let highlighted = [];
205
+ let value = focusedRange === "compare" ? preselectedCompare : preselectedValue;
215
206
  if (Array.isArray(date)) {
216
207
  value = date;
217
- } else if (!((_value = value) !== null && _value !== void 0 && _value.length)) {
208
+ } else if (!(value == null ? void 0 : value.length)) {
218
209
  value = [date];
219
210
  highlighted = [date];
220
- } else if (((_value2 = value) === null || _value2 === void 0 ? void 0 : _value2.length) >= 2) {
211
+ } else if ((value == null ? void 0 : value.length) >= 2) {
221
212
  value = [date];
222
213
  highlighted = [date];
223
- } else if (((_value3 = value) === null || _value3 === void 0 ? void 0 : _value3[0]) > date) {
224
- var _value4;
225
- value = [date, (_value4 = value) === null || _value4 === void 0 ? void 0 : _value4[0]];
214
+ } else if ((value == null ? void 0 : value[0]) > date) {
215
+ value = [date, value == null ? void 0 : value[0]];
226
216
  } else {
227
- var _value5;
228
- value = [(_value5 = value) === null || _value5 === void 0 ? void 0 : _value5[0], date];
217
+ value = [value == null ? void 0 : value[0], date];
229
218
  }
230
219
  if (focusedRange === "compare") {
231
- _this.handlers.preselectedCompare(value);
232
- _this.handlers.compareHighlighted(highlighted);
220
+ this.handlers.preselectedCompare(value);
221
+ this.handlers.compareHighlighted(highlighted);
233
222
  } else {
234
- _this.handlers.preselectedValue(value);
235
- _this.handlers.highlighted(highlighted);
223
+ this.handlers.preselectedValue(value);
224
+ this.handlers.highlighted(highlighted);
236
225
  }
237
226
  });
238
- return _this;
239
227
  }
240
- _inherits(DateRangeComparatorAbstract2, _Component);
241
- return _createClass(DateRangeComparatorAbstract2, [{
242
- key: "getPeriodProps",
243
- value: function getPeriodProps() {
244
- var _this$asProps$value, _this2 = this;
245
- var _this$asProps4 = this.asProps, _this$asProps4$period = _this$asProps4.periods, periods = _this$asProps4$period === void 0 ? this.getDefaultPeriods() : _this$asProps4$period, onHighlightedChange = _this$asProps4.onHighlightedChange, onCompareHighlightedChange = _this$asProps4.onCompareHighlightedChange, onDisplayedPeriodChange = _this$asProps4.onDisplayedPeriodChange, preselectedValue = _this$asProps4.preselectedValue, preselectedCompare = _this$asProps4.preselectedCompare, focusedRange = _this$asProps4.focusedRange, getI18nText = _this$asProps4.getI18nText;
246
- var value = preselectedValue !== null && preselectedValue !== void 0 ? preselectedValue : (_this$asProps$value = this.asProps.value) === null || _this$asProps$value === void 0 ? void 0 : _this$asProps$value.value;
247
- if (focusedRange === "compare") {
248
- var _this$asProps$value2;
249
- value = preselectedCompare !== null && preselectedCompare !== void 0 ? preselectedCompare : (_this$asProps$value2 = this.asProps.value) === null || _this$asProps$value2 === void 0 ? void 0 : _this$asProps$value2.compare;
250
- }
251
- return {
252
- periods,
253
- value,
254
- "onChange": function onChange(value2) {
255
- if (focusedRange === "compare") {
256
- _this2.handlers.preselectedCompare(value2);
257
- } else {
258
- _this2.handlers.preselectedValue(value2);
259
- }
260
- },
261
- "onHighlightedChange": focusedRange === "compare" ? onCompareHighlightedChange : onHighlightedChange,
262
- onDisplayedPeriodChange,
263
- "role": "listbox",
264
- "aria-label": getI18nText("periods"),
265
- "periodRef": function periodRef(index) {
266
- return function(element) {
267
- if (!element) return;
268
- _this2.periodRefs[index] = element;
269
- };
270
- }
271
- };
272
- }
273
- }, {
274
- key: "getPrevProps",
275
- value: function getPrevProps() {
276
- var getI18nText = this.asProps.getI18nText;
277
- var navigateStep = this.navigateStep;
278
- return {
279
- getI18nText,
280
- "ref": this.prevButtonRef,
281
- "onClick": this.bindHandlerNavigateClick(-1),
282
- "aria-label": navigateStep === "month" ? getI18nText("prevMonth") : getI18nText("prevYear")
283
- };
284
- }
285
- }, {
286
- key: "getNextProps",
287
- value: function getNextProps() {
288
- var getI18nText = this.asProps.getI18nText;
289
- var navigateStep = this.navigateStep;
290
- return {
291
- getI18nText,
292
- "ref": this.nextButtonRef,
293
- "onClick": this.bindHandlerNavigateClick(1),
294
- "aria-label": navigateStep === "month" ? getI18nText("nextMonth") : getI18nText("nextYear")
295
- };
296
- }
297
- }, {
298
- key: "uncontrolledProps",
299
- value: function uncontrolledProps() {
300
- var _this3 = this;
301
- return {
302
- displayedPeriod: null,
303
- visible: [null, function(visible) {
304
- if (!visible) {
305
- _this3.handlers.highlighted([]);
306
- _this3.handlers.compareHighlighted([]);
307
- _this3.handlers.preselectedValue(void 0);
308
- _this3.handlers.preselectedCompare(void 0);
309
- _this3.handlers.compareToggle(void 0);
310
- _this3.handlers.focusedRange("value");
311
- } else {
312
- var _this3$asProps$value;
313
- _this3.handlers.compareToggle(!!((_this3$asProps$value = _this3.asProps.value) !== null && _this3$asProps$value !== void 0 && (_this3$asProps$value = _this3$asProps$value.compare) !== null && _this3$asProps$value !== void 0 && _this3$asProps$value.length));
314
- }
315
- var _this3$asProps = _this3.asProps, value = _this3$asProps.value, displayedPeriod = _this3$asProps.displayedPeriod;
316
- var newDisplayedPeriod = value ? getLatestDate(value.value, value.compare) : void 0;
317
- if (visible) {
318
- if (newDisplayedPeriod && newDisplayedPeriod !== displayedPeriod) {
319
- _this3.handlers.displayedPeriod(newDisplayedPeriod);
320
- } else if (!newDisplayedPeriod) {
321
- var _this3$props = _this3.props, _displayedPeriod = _this3$props.displayedPeriod, _defaultDisplayedPeriod = _this3$props.defaultDisplayedPeriod;
322
- _this3.handlers.displayedPeriod(_displayedPeriod || _defaultDisplayedPeriod);
323
- }
324
- }
325
- }],
326
- highlighted: null,
327
- compareHighlighted: null,
328
- preselectedValue: null,
329
- preselectedCompare: null,
330
- compareToggle: null,
331
- focusedRange: null,
332
- value: [null, function(value) {
333
- var dates = [value === null || value === void 0 ? void 0 : value.value, value === null || value === void 0 ? void 0 : value.compare].flat(2).filter(function(date) {
334
- var _date$isValid;
335
- return date === null || date === void 0 || (_date$isValid = date.isValid) === null || _date$isValid === void 0 ? void 0 : _date$isValid.call(date);
336
- });
337
- if (dates.length > 0) _this3.handlers.displayedPeriod(getLatestDate(value));
338
- }]
339
- };
340
- }
341
- }, {
342
- key: "getApplyProps",
343
- value: function getApplyProps() {
344
- var getI18nText = this.asProps.getI18nText;
345
- return {
346
- getI18nText,
347
- onClick: this.handleApplyClick,
348
- ref: this.applyButtonRef
349
- };
350
- }
351
- }, {
352
- key: "getResetProps",
353
- value: function getResetProps() {
354
- var _this4 = this;
355
- var getI18nText = this.asProps.getI18nText;
356
- return {
357
- getI18nText,
358
- onClick: function onClick() {
359
- return _this4.handleApply(null, null);
360
- },
361
- ref: this.resetButtonRef
362
- };
363
- }
364
- }, {
365
- key: "isDisabled",
366
- value: function isDisabled(date) {
367
- var disabled = this.asProps.disabled;
368
- return disabled.some(includesDate(dayjs(date), "date"));
369
- }
370
- }, {
371
- key: "getDefaultPeriods",
372
- value: function getDefaultPeriods() {
373
- var getI18nText = this.asProps.getI18nText;
374
- var today = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
375
- return [{
376
- children: getI18nText("lastMonth"),
377
- value: [dayjs(today).subtract(1, "month").startOf("month").toDate(), dayjs(today).startOf("month").toDate()]
378
- }, {
379
- children: getI18nText("last3Months"),
380
- value: [dayjs(today).subtract(2, "month").startOf("month").toDate(), dayjs(today).startOf("month").toDate()]
381
- }, {
382
- children: getI18nText("last6Months"),
383
- value: [dayjs(today).subtract(5, "month").startOf("month").toDate(), dayjs(today).startOf("month").toDate()]
384
- }, {
385
- children: getI18nText("last12Months"),
386
- value: [dayjs(today).subtract(11, "month").startOf("month").toDate(), dayjs(today).startOf("month").toDate()]
387
- }];
388
- }
389
- }, {
390
- key: "getTitleProps",
391
- value: function getTitleProps(_props, index) {
392
- var _this$asProps5 = this.asProps, locale = _this$asProps5.locale, displayedPeriod = _this$asProps5.displayedPeriod;
393
- return {
394
- children: new Intl.DateTimeFormat(locale, {
395
- month: "long",
396
- year: "numeric"
397
- }).format(dayjs(displayedPeriod).add(index, this.navigateStep).startOf(this.navigateStep).toDate())
398
- };
228
+ static defaultProps({
229
+ primaryRange,
230
+ defaultPrimaryRange,
231
+ secondaryRange,
232
+ defaultSecondaryRange
233
+ }) {
234
+ return {
235
+ i18n: localizedMessages,
236
+ locale: "en",
237
+ defaultValue: null,
238
+ defaultHighlighted: [],
239
+ defaultCompareHighlighted: [],
240
+ defaultDisplayedPeriod: getLatestDate(primaryRange, defaultPrimaryRange, secondaryRange, defaultSecondaryRange) || defaultDisplayedPeriod,
241
+ defaultVisible: false,
242
+ defaultPreselectedValue: null,
243
+ defaultPreselectedCompare: null,
244
+ defaultCompareToggle: null,
245
+ defaultFocusedRange: "value",
246
+ disabled: [],
247
+ size: "m"
248
+ };
249
+ }
250
+ getPeriodProps() {
251
+ var _a, _b;
252
+ const {
253
+ periods = this.getDefaultPeriods(),
254
+ onHighlightedChange,
255
+ onCompareHighlightedChange,
256
+ onDisplayedPeriodChange,
257
+ preselectedValue,
258
+ preselectedCompare,
259
+ focusedRange,
260
+ getI18nText
261
+ } = this.asProps;
262
+ let value = preselectedValue ?? ((_a = this.asProps.value) == null ? void 0 : _a.value);
263
+ if (focusedRange === "compare") {
264
+ value = preselectedCompare ?? ((_b = this.asProps.value) == null ? void 0 : _b.compare);
399
265
  }
400
- }, {
401
- key: "getTriggerProps",
402
- value: function getTriggerProps(_ref0) {
403
- var _this$asProps$value3, _this$asProps$value4, _this5 = this;
404
- var _ref0$placeholder = _ref0.placeholder, placeholder = _ref0$placeholder === void 0 ? "Select date ranges" : _ref0$placeholder, _ref0$separator = _ref0.separator, separator = _ref0$separator === void 0 ? "vs." : _ref0$separator;
405
- var _this$asProps6 = this.asProps, locale = _this$asProps6.locale, visible = _this$asProps6.visible;
406
- var value = (_this$asProps$value3 = this.asProps.value) === null || _this$asProps$value3 === void 0 ? void 0 : _this$asProps$value3.value;
407
- var compare = (_this$asProps$value4 = this.asProps.value) === null || _this$asProps$value4 === void 0 ? void 0 : _this$asProps$value4.compare;
408
- var formattingProps = _objectSpread({
409
- locale
410
- }, this.triggerFormattingProps);
411
- var children = placeholder;
412
- if (value !== null && value !== void 0 && value[0] && value !== null && value !== void 0 && value[1]) {
413
- children = shortDateRangeFormat(value, formattingProps);
414
- }
415
- if (compare !== null && compare !== void 0 && compare[0] && compare !== null && compare !== void 0 && compare[1]) {
416
- children = "".concat(children || "", " ").concat(separator, " ").concat(shortDateRangeFormat(compare, formattingProps));
266
+ return {
267
+ periods,
268
+ value,
269
+ "onChange": (value2) => {
270
+ if (focusedRange === "compare") {
271
+ this.handlers.preselectedCompare(value2);
272
+ } else {
273
+ this.handlers.preselectedValue(value2);
274
+ }
275
+ },
276
+ "onHighlightedChange": focusedRange === "compare" ? onCompareHighlightedChange : onHighlightedChange,
277
+ onDisplayedPeriodChange,
278
+ "role": "listbox",
279
+ "aria-label": getI18nText("periods"),
280
+ "periodRef": (index) => (element) => {
281
+ if (!element) return;
282
+ this.periodRefs[index] = element;
417
283
  }
418
- return {
419
- children,
420
- visible,
421
- onClick: function onClick() {
422
- return _this5.handlers.visible(!visible);
423
- },
424
- onKeyDown: this.handleKeydownDown("trigger")
425
- };
426
- }
427
- }, {
428
- key: "getRangeInput",
429
- value: function getRangeInput() {
430
- throw new Error("not implemented");
431
- }
432
- }, {
433
- key: "getRangeInputProps",
434
- value: function getRangeInputProps() {
435
- return {
436
- inputRole: null
437
- };
438
- }
439
- }, {
440
- key: "getValueDateRangeProps",
441
- value: function getValueDateRangeProps() {
442
- var _this6 = this;
443
- var _this$asProps7 = this.asProps, value = _this$asProps7.value, onDisplayedPeriodChange = _this$asProps7.onDisplayedPeriodChange, locale = _this$asProps7.locale, disabled = _this$asProps7.disabled, disabledErrorText = _this$asProps7.disabledErrorText, getI18nText = _this$asProps7.getI18nText, focusedRange = _this$asProps7.focusedRange, preselectedValue = _this$asProps7.preselectedValue, animationsDisabled = _this$asProps7.animationsDisabled, visible = _this$asProps7.visible;
444
- return {
445
- popoverVisible: visible,
446
- focused: focusedRange === "value" ? true : void 0,
447
- value: preselectedValue !== null && preselectedValue !== void 0 ? preselectedValue : value === null || value === void 0 ? void 0 : value.value,
448
- onChange: function onChange(value2) {
449
- return _this6.handlers.preselectedValue(value2);
450
- },
451
- onDisplayedPeriodChange,
452
- locale,
453
- disabledDates: disabled,
454
- disabledErrorText,
455
- children: this.getRangeInput(),
456
- getI18nText,
457
- onFocus: function onFocus() {
458
- _this6.handlers.focusedRange("value");
459
- },
460
- animationsDisabled
461
- };
462
- }
463
- }, {
464
- key: "getCompareDateRangeProps",
465
- value: function getCompareDateRangeProps() {
466
- var _value$compare, _this7 = this;
467
- var _this$asProps8 = this.asProps, value = _this$asProps8.value, onDisplayedPeriodChange = _this$asProps8.onDisplayedPeriodChange, locale = _this$asProps8.locale, disabled = _this$asProps8.disabled, disabledErrorText = _this$asProps8.disabledErrorText, getI18nText = _this$asProps8.getI18nText, focusedRange = _this$asProps8.focusedRange, preselectedCompare = _this$asProps8.preselectedCompare, compareToggle = _this$asProps8.compareToggle, animationsDisabled = _this$asProps8.animationsDisabled, visible = _this$asProps8.visible;
468
- return {
469
- popoverVisible: visible,
470
- focused: focusedRange === "compare" ? true : void 0,
471
- disabled: !(compareToggle !== null && compareToggle !== void 0 ? compareToggle : value === null || value === void 0 || (_value$compare = value.compare) === null || _value$compare === void 0 ? void 0 : _value$compare.length),
472
- value: preselectedCompare !== null && preselectedCompare !== void 0 ? preselectedCompare : value === null || value === void 0 ? void 0 : value.compare,
473
- onChange: function onChange(value2) {
474
- return _this7.handlers.preselectedCompare(value2);
475
- },
476
- onDisplayedPeriodChange,
477
- locale,
478
- disabledDates: disabled,
479
- children: this.getRangeInput(),
480
- getI18nText,
481
- disabledErrorText,
482
- onFocus: function onFocus() {
483
- _this7.handlers.focusedRange("compare");
484
- },
485
- animationsDisabled
486
- };
487
- }
488
- }, {
489
- key: "getCompareToggleProps",
490
- value: function getCompareToggleProps() {
491
- var _this8 = this;
492
- var _this$asProps9 = this.asProps, getI18nText = _this$asProps9.getI18nText, compareToggle = _this$asProps9.compareToggle;
493
- return {
494
- getI18nText,
495
- checked: compareToggle,
496
- onChange: function onChange(checked) {
497
- if (checked) {
498
- _this8.handlers.compareToggle(true);
499
- _this8.handlers.focusedRange("compare");
500
- } else {
501
- _this8.handlers.compareToggle(false);
502
- _this8.handlers.focusedRange("value");
503
- _this8.handlers.preselectedCompare([]);
284
+ };
285
+ }
286
+ getPrevProps() {
287
+ const {
288
+ getI18nText
289
+ } = this.asProps;
290
+ const {
291
+ navigateStep
292
+ } = this;
293
+ return {
294
+ getI18nText,
295
+ "ref": this.prevButtonRef,
296
+ "onClick": this.bindHandlerNavigateClick(-1),
297
+ "aria-label": navigateStep === "month" ? getI18nText("prevMonth") : getI18nText("prevYear")
298
+ };
299
+ }
300
+ getNextProps() {
301
+ const {
302
+ getI18nText
303
+ } = this.asProps;
304
+ const {
305
+ navigateStep
306
+ } = this;
307
+ return {
308
+ getI18nText,
309
+ "ref": this.nextButtonRef,
310
+ "onClick": this.bindHandlerNavigateClick(1),
311
+ "aria-label": navigateStep === "month" ? getI18nText("nextMonth") : getI18nText("nextYear")
312
+ };
313
+ }
314
+ uncontrolledProps() {
315
+ return {
316
+ displayedPeriod: null,
317
+ visible: [null, (visible) => {
318
+ var _a, _b;
319
+ if (!visible) {
320
+ this.handlers.highlighted([]);
321
+ this.handlers.compareHighlighted([]);
322
+ this.handlers.preselectedValue(void 0);
323
+ this.handlers.preselectedCompare(void 0);
324
+ this.handlers.compareToggle(void 0);
325
+ this.handlers.focusedRange("value");
326
+ } else {
327
+ this.handlers.compareToggle(!!((_b = (_a = this.asProps.value) == null ? void 0 : _a.compare) == null ? void 0 : _b.length));
328
+ }
329
+ const {
330
+ value,
331
+ displayedPeriod
332
+ } = this.asProps;
333
+ const newDisplayedPeriod = value ? getLatestDate(value.value, value.compare) : void 0;
334
+ if (visible) {
335
+ if (newDisplayedPeriod && newDisplayedPeriod !== displayedPeriod) {
336
+ this.handlers.displayedPeriod(newDisplayedPeriod);
337
+ } else if (!newDisplayedPeriod) {
338
+ const {
339
+ displayedPeriod: displayedPeriod2,
340
+ defaultDisplayedPeriod: defaultDisplayedPeriod2
341
+ } = this.props;
342
+ this.handlers.displayedPeriod(displayedPeriod2 || defaultDisplayedPeriod2);
504
343
  }
505
344
  }
506
- };
507
- }
508
- }, {
509
- key: "getCalendarProps",
510
- value: function getCalendarProps(_props, index) {
511
- var _this$asProps0 = this.asProps, locale = _this$asProps0.locale, displayedPeriod = _this$asProps0.displayedPeriod, disabled = _this$asProps0.disabled, value = _this$asProps0.value, onCompareHighlightedChange = _this$asProps0.onCompareHighlightedChange, highlighted = _this$asProps0.highlighted, compareHighlighted = _this$asProps0.compareHighlighted, onHighlightedChange = _this$asProps0.onHighlightedChange, preselectedCompare = _this$asProps0.preselectedCompare, preselectedValue = _this$asProps0.preselectedValue, focusedRange = _this$asProps0.focusedRange, getI18nText = _this$asProps0.getI18nText;
512
- return {
513
- locale,
514
- displayedPeriod: dayjs(displayedPeriod).add(index, this.navigateStep).startOf(this.navigateStep).toDate(),
515
- disabled,
516
- onChange: this.handleChange,
517
- highlighted,
518
- compareHighlighted,
519
- onCompareHighlightedChange,
520
- onHighlightedChange,
521
- range: focusedRange,
522
- value: preselectedValue !== null && preselectedValue !== void 0 ? preselectedValue : value === null || value === void 0 ? void 0 : value.value,
523
- compare: preselectedCompare !== null && preselectedCompare !== void 0 ? preselectedCompare : value === null || value === void 0 ? void 0 : value.compare,
524
- unitRefs: this.unitRefs,
525
- getI18nText,
526
- actionsDescribing: index === 0 ? "range-compare" : null,
527
- tabIndex: index === 0 ? 0 : -1
528
- };
529
- }
530
- }, {
531
- key: "getPopperProps",
532
- value: function getPopperProps() {
533
- return {
534
- p: 0,
535
- ref: this.popperRef,
536
- onKeyDown: this.handleKeydownDown("popper")
537
- };
538
- }
539
- }, {
540
- key: "render",
541
- value: function render() {
542
- var _ref = this.asProps, _ref4;
543
- var _this$asProps1 = this.asProps, Children = _this$asProps1.Children, styles = _this$asProps1.styles, providedAriaLabel = _this$asProps1["aria-label"];
544
- return /* @__PURE__ */ React.createElement(React.Fragment, null, (_ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(Dropdown, assignProps({
545
- "use:aria-label": providedAriaLabel,
546
- "__excludeProps": ["onChange", "value"]
547
- }, _ref), /* @__PURE__ */ React.createElement(Children, _ref4.cn("Children", {})))));
345
+ }],
346
+ highlighted: null,
347
+ compareHighlighted: null,
348
+ preselectedValue: null,
349
+ preselectedCompare: null,
350
+ compareToggle: null,
351
+ focusedRange: null,
352
+ value: [null, (value) => {
353
+ const dates = [value == null ? void 0 : value.value, value == null ? void 0 : value.compare].flat(2).filter((date) => {
354
+ var _a;
355
+ return (_a = date == null ? void 0 : date.isValid) == null ? void 0 : _a.call(date);
356
+ });
357
+ if (dates.length > 0) this.handlers.displayedPeriod(getLatestDate(value));
358
+ }]
359
+ };
360
+ }
361
+ getApplyProps() {
362
+ const {
363
+ getI18nText
364
+ } = this.asProps;
365
+ return {
366
+ getI18nText,
367
+ onClick: this.handleApplyClick,
368
+ ref: this.applyButtonRef
369
+ };
370
+ }
371
+ getResetProps() {
372
+ const {
373
+ getI18nText
374
+ } = this.asProps;
375
+ return {
376
+ getI18nText,
377
+ onClick: () => this.handleApply(null, null),
378
+ ref: this.resetButtonRef
379
+ };
380
+ }
381
+ isDisabled(date) {
382
+ const {
383
+ disabled
384
+ } = this.asProps;
385
+ return disabled.some(includesDate(dayjs(date), "date"));
386
+ }
387
+ getDefaultPeriods() {
388
+ const {
389
+ getI18nText
390
+ } = this.asProps;
391
+ const today = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
392
+ return [{
393
+ children: getI18nText("lastMonth"),
394
+ value: [dayjs(today).subtract(1, "month").startOf("month").toDate(), dayjs(today).startOf("month").toDate()]
395
+ }, {
396
+ children: getI18nText("last3Months"),
397
+ value: [dayjs(today).subtract(2, "month").startOf("month").toDate(), dayjs(today).startOf("month").toDate()]
398
+ }, {
399
+ children: getI18nText("last6Months"),
400
+ value: [dayjs(today).subtract(5, "month").startOf("month").toDate(), dayjs(today).startOf("month").toDate()]
401
+ }, {
402
+ children: getI18nText("last12Months"),
403
+ value: [dayjs(today).subtract(11, "month").startOf("month").toDate(), dayjs(today).startOf("month").toDate()]
404
+ }];
405
+ }
406
+ getTitleProps(_props, index) {
407
+ const {
408
+ locale,
409
+ displayedPeriod
410
+ } = this.asProps;
411
+ return {
412
+ children: new Intl.DateTimeFormat(locale, {
413
+ month: "long",
414
+ year: "numeric"
415
+ }).format(dayjs(displayedPeriod).add(index, this.navigateStep).startOf(this.navigateStep).toDate())
416
+ };
417
+ }
418
+ getTriggerProps({
419
+ placeholder = "Select date ranges",
420
+ separator = "vs."
421
+ }) {
422
+ var _a, _b;
423
+ const {
424
+ locale,
425
+ visible
426
+ } = this.asProps;
427
+ const value = (_a = this.asProps.value) == null ? void 0 : _a.value;
428
+ const compare = (_b = this.asProps.value) == null ? void 0 : _b.compare;
429
+ const formattingProps = {
430
+ locale,
431
+ ...this.triggerFormattingProps
432
+ };
433
+ let children = placeholder;
434
+ if ((value == null ? void 0 : value[0]) && (value == null ? void 0 : value[1])) {
435
+ children = shortDateRangeFormat(value, formattingProps);
548
436
  }
549
- }], [{
550
- key: "defaultProps",
551
- value: function defaultProps(_ref1) {
552
- var primaryRange = _ref1.primaryRange, defaultPrimaryRange = _ref1.defaultPrimaryRange, secondaryRange = _ref1.secondaryRange, defaultSecondaryRange = _ref1.defaultSecondaryRange;
553
- return {
554
- i18n: localizedMessages,
555
- locale: "en",
556
- defaultValue: null,
557
- defaultHighlighted: [],
558
- defaultCompareHighlighted: [],
559
- defaultDisplayedPeriod: getLatestDate(primaryRange, defaultPrimaryRange, secondaryRange, defaultSecondaryRange) || defaultDisplayedPeriod,
560
- defaultVisible: false,
561
- defaultPreselectedValue: null,
562
- defaultPreselectedCompare: null,
563
- defaultCompareToggle: null,
564
- defaultFocusedRange: "value",
565
- disabled: [],
566
- size: "m"
567
- };
437
+ if ((compare == null ? void 0 : compare[0]) && (compare == null ? void 0 : compare[1])) {
438
+ children = `${children || ""} ${separator} ${shortDateRangeFormat(compare, formattingProps)}`;
568
439
  }
569
- }]);
570
- })(Component);
440
+ return {
441
+ children,
442
+ visible,
443
+ onClick: () => this.handlers.visible(!visible),
444
+ onKeyDown: this.handleKeydownDown("trigger")
445
+ };
446
+ }
447
+ getRangeInput() {
448
+ throw new Error("not implemented");
449
+ }
450
+ getRangeInputProps() {
451
+ return {
452
+ inputRole: null
453
+ };
454
+ }
455
+ getValueDateRangeProps() {
456
+ const {
457
+ value,
458
+ onDisplayedPeriodChange,
459
+ locale,
460
+ disabled,
461
+ disabledErrorText,
462
+ getI18nText,
463
+ focusedRange,
464
+ preselectedValue,
465
+ animationsDisabled,
466
+ visible
467
+ } = this.asProps;
468
+ return {
469
+ popoverVisible: visible,
470
+ focused: focusedRange === "value" ? true : void 0,
471
+ value: preselectedValue ?? (value == null ? void 0 : value.value),
472
+ onChange: (value2) => this.handlers.preselectedValue(value2),
473
+ onDisplayedPeriodChange,
474
+ locale,
475
+ disabledDates: disabled,
476
+ disabledErrorText,
477
+ children: this.getRangeInput(),
478
+ getI18nText,
479
+ onFocus: () => {
480
+ this.handlers.focusedRange("value");
481
+ },
482
+ animationsDisabled
483
+ };
484
+ }
485
+ getCompareDateRangeProps() {
486
+ var _a;
487
+ const {
488
+ value,
489
+ onDisplayedPeriodChange,
490
+ locale,
491
+ disabled,
492
+ disabledErrorText,
493
+ getI18nText,
494
+ focusedRange,
495
+ preselectedCompare,
496
+ compareToggle,
497
+ animationsDisabled,
498
+ visible
499
+ } = this.asProps;
500
+ return {
501
+ popoverVisible: visible,
502
+ focused: focusedRange === "compare" ? true : void 0,
503
+ disabled: !(compareToggle ?? ((_a = value == null ? void 0 : value.compare) == null ? void 0 : _a.length)),
504
+ value: preselectedCompare ?? (value == null ? void 0 : value.compare),
505
+ onChange: (value2) => this.handlers.preselectedCompare(value2),
506
+ onDisplayedPeriodChange,
507
+ locale,
508
+ disabledDates: disabled,
509
+ children: this.getRangeInput(),
510
+ getI18nText,
511
+ disabledErrorText,
512
+ onFocus: () => {
513
+ this.handlers.focusedRange("compare");
514
+ },
515
+ animationsDisabled
516
+ };
517
+ }
518
+ getCompareToggleProps() {
519
+ const {
520
+ getI18nText,
521
+ compareToggle
522
+ } = this.asProps;
523
+ return {
524
+ getI18nText,
525
+ checked: compareToggle,
526
+ onChange: (checked) => {
527
+ if (checked) {
528
+ this.handlers.compareToggle(true);
529
+ this.handlers.focusedRange("compare");
530
+ } else {
531
+ this.handlers.compareToggle(false);
532
+ this.handlers.focusedRange("value");
533
+ this.handlers.preselectedCompare([]);
534
+ }
535
+ }
536
+ };
537
+ }
538
+ getCalendarProps(_props, index) {
539
+ const {
540
+ locale,
541
+ displayedPeriod,
542
+ disabled,
543
+ value,
544
+ onCompareHighlightedChange,
545
+ highlighted,
546
+ compareHighlighted,
547
+ onHighlightedChange,
548
+ preselectedCompare,
549
+ preselectedValue,
550
+ focusedRange,
551
+ getI18nText
552
+ } = this.asProps;
553
+ return {
554
+ locale,
555
+ displayedPeriod: dayjs(displayedPeriod).add(index, this.navigateStep).startOf(this.navigateStep).toDate(),
556
+ disabled,
557
+ onChange: this.handleChange,
558
+ highlighted,
559
+ compareHighlighted,
560
+ onCompareHighlightedChange,
561
+ onHighlightedChange,
562
+ range: focusedRange,
563
+ value: preselectedValue ?? (value == null ? void 0 : value.value),
564
+ compare: preselectedCompare ?? (value == null ? void 0 : value.compare),
565
+ unitRefs: this.unitRefs,
566
+ getI18nText,
567
+ actionsDescribing: index === 0 ? "range-compare" : null,
568
+ tabIndex: index === 0 ? 0 : -1
569
+ };
570
+ }
571
+ getPopperProps() {
572
+ return {
573
+ p: 0,
574
+ ref: this.popperRef,
575
+ onKeyDown: this.handleKeydownDown("popper")
576
+ };
577
+ }
578
+ render() {
579
+ var _ref = this.asProps, _ref4;
580
+ const {
581
+ Children,
582
+ styles,
583
+ "aria-label": providedAriaLabel
584
+ } = this.asProps;
585
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, (_ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(Dropdown, assignProps({
586
+ "use:aria-label": providedAriaLabel,
587
+ "__excludeProps": ["onChange", "value"]
588
+ }, _ref), /* @__PURE__ */ React.createElement(Children, _ref4.cn("Children", {})))));
589
+ }
590
+ }
571
591
  _defineProperty(DateRangeComparatorAbstract, "displayName", "DateRangeComparator");
572
592
  _defineProperty(DateRangeComparatorAbstract, "style", style);
573
593
  _defineProperty(DateRangeComparatorAbstract, "enhance", [i18nEnhance(localizedMessages)]);
574
- _defineProperty(DateRangeComparatorAbstract, "subtract", function(date, amount, unit) {
594
+ _defineProperty(DateRangeComparatorAbstract, "subtract", (date, amount, unit) => {
575
595
  return dayjs(date).subtract(amount, unit).toDate();
576
596
  });
577
597
  function Apply(props) {
578
598
  var _ref2 = arguments[0];
579
- var getI18nText = props.getI18nText;
599
+ const {
600
+ getI18nText
601
+ } = props;
580
602
  return /* @__PURE__ */ React.createElement(Button, assignProps({
581
603
  "use": "primary",
582
604
  "children": getI18nText("apply")
@@ -584,7 +606,9 @@ function Apply(props) {
584
606
  }
585
607
  function Reset(props) {
586
608
  var _ref3 = arguments[0];
587
- var getI18nText = props.getI18nText;
609
+ const {
610
+ getI18nText
611
+ } = props;
588
612
  return /* @__PURE__ */ React.createElement(Button, assignProps({
589
613
  "use": "tertiary",
590
614
  "theme": "muted",
@@ -593,7 +617,10 @@ function Reset(props) {
593
617
  }
594
618
  function Trigger(props) {
595
619
  var _ref5;
596
- var STrigger = props.Root, styles = props.styles;
620
+ const {
621
+ Root: STrigger,
622
+ styles
623
+ } = props;
597
624
  return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(STrigger, _ref5.cn("STrigger", {
598
625
  "render": Dropdown.Trigger,
599
626
  "tag": LinkTrigger
@@ -601,7 +628,11 @@ function Trigger(props) {
601
628
  }
602
629
  function CompareToggle(props) {
603
630
  var _ref6;
604
- var SCompareToggle = props.Root, styles = props.styles, getI18nText = props.getI18nText;
631
+ const {
632
+ Root: SCompareToggle,
633
+ styles,
634
+ getI18nText
635
+ } = props;
605
636
  return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SCompareToggle, _ref6.cn("SCompareToggle", {
606
637
  "render": Checkbox,
607
638
  "label": getI18nText("compare")
@@ -609,7 +640,11 @@ function CompareToggle(props) {
609
640
  }
610
641
  function Header(props) {
611
642
  var _ref7;
612
- var SRangeComparatorHeader = props.Root, Children = props.Children, styles = props.styles;
643
+ const {
644
+ Root: SRangeComparatorHeader,
645
+ Children,
646
+ styles
647
+ } = props;
613
648
  return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(SRangeComparatorHeader, _ref7.cn("SRangeComparatorHeader", {
614
649
  "render": Flex,
615
650
  "gap": 4,
@@ -618,7 +653,11 @@ function Header(props) {
618
653
  }
619
654
  function Body(props) {
620
655
  var _ref8;
621
- var SBody = props.Root, Children = props.Children, styles = props.styles;
656
+ const {
657
+ Root: SBody,
658
+ Children,
659
+ styles
660
+ } = props;
622
661
  return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SBody, _ref8.cn("SBody", {
623
662
  "render": Flex,
624
663
  "gap": 4
@@ -626,7 +665,11 @@ function Body(props) {
626
665
  }
627
666
  function Footer(props) {
628
667
  var _ref9;
629
- var SFooter = props.Root, styles = props.styles, Children = props.Children;
668
+ const {
669
+ Root: SFooter,
670
+ styles,
671
+ Children
672
+ } = props;
630
673
  return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SFooter, _ref9.cn("SFooter", {
631
674
  "render": Flex,
632
675
  "gap": 2