@semcore/date-picker 4.56.0 → 16.0.0-prerelease.11

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 (94) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/lib/cjs/DatePicker.js +3 -4
  3. package/lib/cjs/DatePicker.js.map +1 -1
  4. package/lib/cjs/DateRangeComparator.js +2 -2
  5. package/lib/cjs/DateRangeComparator.js.map +1 -1
  6. package/lib/cjs/DateRangePicker.js +2 -2
  7. package/lib/cjs/DateRangePicker.js.map +1 -1
  8. package/lib/cjs/MonthDateRangeComparator.js +2 -2
  9. package/lib/cjs/MonthDateRangeComparator.js.map +1 -1
  10. package/lib/cjs/MonthPicker.js +2 -2
  11. package/lib/cjs/MonthPicker.js.map +1 -1
  12. package/lib/cjs/MonthRangePicker.js +2 -2
  13. package/lib/cjs/MonthRangePicker.js.map +1 -1
  14. package/lib/cjs/components/ButtonTrigger.js +3 -4
  15. package/lib/cjs/components/ButtonTrigger.js.map +1 -1
  16. package/lib/cjs/components/Calendar.js +27 -29
  17. package/lib/cjs/components/Calendar.js.map +1 -1
  18. package/lib/cjs/components/DateRangeComparatorAbstract.js +30 -31
  19. package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
  20. package/lib/cjs/components/InputTrigger.js +35 -37
  21. package/lib/cjs/components/InputTrigger.js.map +1 -1
  22. package/lib/cjs/components/PickerAbstract.js +30 -31
  23. package/lib/cjs/components/PickerAbstract.js.map +1 -1
  24. package/lib/cjs/components/RangePickerAbstract.js +30 -31
  25. package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
  26. package/lib/cjs/components/index.js +1 -1
  27. package/lib/cjs/components/index.js.map +1 -1
  28. package/lib/cjs/index.d.js.map +1 -1
  29. package/lib/cjs/style/calendar.shadow.css +5 -1
  30. package/lib/es6/DatePicker.js +2 -2
  31. package/lib/es6/DatePicker.js.map +1 -1
  32. package/lib/es6/DateRangeComparator.js +1 -1
  33. package/lib/es6/DateRangeComparator.js.map +1 -1
  34. package/lib/es6/DateRangePicker.js +1 -1
  35. package/lib/es6/DateRangePicker.js.map +1 -1
  36. package/lib/es6/MonthDateRangeComparator.js +1 -1
  37. package/lib/es6/MonthDateRangeComparator.js.map +1 -1
  38. package/lib/es6/MonthPicker.js +1 -1
  39. package/lib/es6/MonthPicker.js.map +1 -1
  40. package/lib/es6/MonthRangePicker.js +1 -1
  41. package/lib/es6/MonthRangePicker.js.map +1 -1
  42. package/lib/es6/components/ButtonTrigger.js +2 -2
  43. package/lib/es6/components/ButtonTrigger.js.map +1 -1
  44. package/lib/es6/components/Calendar.js +25 -25
  45. package/lib/es6/components/Calendar.js.map +1 -1
  46. package/lib/es6/components/DateRangeComparatorAbstract.js +31 -31
  47. package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
  48. package/lib/es6/components/InputTrigger.js +33 -33
  49. package/lib/es6/components/InputTrigger.js.map +1 -1
  50. package/lib/es6/components/PickerAbstract.js +31 -31
  51. package/lib/es6/components/PickerAbstract.js.map +1 -1
  52. package/lib/es6/components/RangePickerAbstract.js +31 -31
  53. package/lib/es6/components/RangePickerAbstract.js.map +1 -1
  54. package/lib/es6/components/index.js +1 -1
  55. package/lib/es6/components/index.js.map +1 -1
  56. package/lib/es6/index.d.js.map +1 -1
  57. package/lib/es6/style/calendar.shadow.css +5 -1
  58. package/lib/esm/DatePicker.mjs +114 -103
  59. package/lib/esm/DateRangeComparator.mjs +166 -149
  60. package/lib/esm/DateRangePicker.mjs +85 -77
  61. package/lib/esm/MonthDateRangeComparator.mjs +187 -169
  62. package/lib/esm/MonthPicker.mjs +78 -71
  63. package/lib/esm/MonthRangePicker.mjs +94 -85
  64. package/lib/esm/components/ButtonTrigger.mjs +16 -15
  65. package/lib/esm/components/Calendar.mjs +404 -286
  66. package/lib/esm/components/DateRangeComparatorAbstract.mjs +453 -329
  67. package/lib/esm/components/InputTrigger.mjs +757 -518
  68. package/lib/esm/components/PickerAbstract.mjs +191 -148
  69. package/lib/esm/components/RangePickerAbstract.mjs +305 -220
  70. package/lib/esm/components/index.mjs +127 -109
  71. package/lib/esm/index.mjs +13 -13
  72. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +32 -32
  73. package/lib/esm/translations/de.json.mjs +83 -56
  74. package/lib/esm/translations/en.json.mjs +95 -64
  75. package/lib/esm/translations/es.json.mjs +83 -56
  76. package/lib/esm/translations/fr.json.mjs +83 -56
  77. package/lib/esm/translations/it.json.mjs +83 -56
  78. package/lib/esm/translations/ja.json.mjs +83 -56
  79. package/lib/esm/translations/ko.json.mjs +83 -56
  80. package/lib/esm/translations/nl.json.mjs +83 -56
  81. package/lib/esm/translations/pl.json.mjs +83 -56
  82. package/lib/esm/translations/pt.json.mjs +83 -56
  83. package/lib/esm/translations/ru.json.mjs +35 -24
  84. package/lib/esm/translations/sv.json.mjs +83 -56
  85. package/lib/esm/translations/tr.json.mjs +83 -56
  86. package/lib/esm/translations/vi.json.mjs +83 -56
  87. package/lib/esm/translations/zh.json.mjs +83 -56
  88. package/lib/esm/utils/cronTabScheduler.mjs +58 -52
  89. package/lib/esm/utils/datesIntersects.mjs +15 -11
  90. package/lib/esm/utils/formatDate.mjs +25 -18
  91. package/lib/esm/utils/includesDate.mjs +13 -9
  92. package/lib/esm/utils/shortDateRangeFormat.mjs +53 -31
  93. package/lib/types/index.d.ts +1 -1
  94. package/package.json +15 -18
@@ -1,231 +1,274 @@
1
- import H from "@babel/runtime/helpers/esm/classCallCheck";
2
- import M from "@babel/runtime/helpers/esm/createClass";
3
- import s from "@babel/runtime/helpers/esm/assertThisInitialized";
4
- import z from "@babel/runtime/helpers/esm/inherits";
5
- import E from "@babel/runtime/helpers/esm/createSuper";
6
- import o from "@babel/runtime/helpers/esm/defineProperty";
7
- import { sstyled as V } from "@semcore/utils/lib/core/index";
8
- import { CORE_INSTANCE as b, sstyled as N, assignProps as A, Component as F } from "@semcore/core";
9
- import g from "react";
10
- import c from "dayjs";
11
- import Y from "@semcore/dropdown";
12
- import K from "@semcore/utils/lib/enhances/i18nEnhance";
13
- import { localizedMessages as D } from "../translations/__intergalactic-dynamic-locales.mjs";
14
- import { includesDate as B } from "../utils/includesDate.mjs";
15
- import { formatMMYY as j, formatDDMMYY as L } from "../utils/formatDate.mjs";
16
- var O = (
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 { sstyled, CORE_INSTANCE, assignProps, Component } from "@semcore/core";
8
+ import React from "react";
9
+ import dayjs from "dayjs";
10
+ import Dropdown from "@semcore/dropdown";
11
+ import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
12
+ import { localizedMessages } from "../translations/__intergalactic-dynamic-locales.mjs";
13
+ import { includesDate } from "../utils/includesDate.mjs";
14
+ import { formatMMYY, formatDDMMYY } from "../utils/formatDate.mjs";
15
+ var style = (
17
16
  /*__reshadow_css_start__*/
18
- (V.insert(
17
+ (sstyled.insert(
19
18
  /*__inner_css_start__*/
20
- ".___SPopper_1mx7u_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_1mx7u_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_1mx7u_gg_:active,.___SPopper_1mx7u_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_1mx7u_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_1mx7u_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_1mx7u_gg_,.___STitle_1mx7u_gg_{display:flex;align-items:center}.___STitle_1mx7u_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_1mx7u_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_1mx7u_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_1mx7u_gg_ .___SInner_1mx7u_gg_{justify-content:flex-start}.___SInputMask_1mx7u_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_1mx7u_gg_.__animationsDisabled_1mx7u_gg_{transition:none}.___SInputMask_1mx7u_gg_ .___SValue_1mx7u_gg_{letter-spacing:0}.___SIndicator_1mx7u_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SRangeIndicator_1mx7u_gg_{border-radius:50%;flex-shrink:0}.___SRangeIndicator_1mx7u_gg_._range_value_1mx7u_gg_{background-color:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SRangeIndicator_1mx7u_gg_._range_compare_1mx7u_gg_{background-color:var(--intergalactic-date-picker-cell-comparison-active, #8649e1)}.___SRangeIndicator_1mx7u_gg_.__disabled_1mx7u_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SHumanizedDate_1mx7u_gg_{position:absolute;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.___SMask_1mx7u_gg_{letter-spacing:0;white-space:nowrap;overflow:hidden}.___SDateRange_1mx7u_gg_ .___SMask_1mx7u_gg_,.___SDateRange_1mx7u_gg_ .___SValue_1mx7u_gg_,.___SSingleDateInput_1mx7u_gg_ .___SMask_1mx7u_gg_,.___SSingleDateInput_1mx7u_gg_ .___SValue_1mx7u_gg_{opacity:0}.___SSingleDateInput_1mx7u_gg_:focus-within .___SHumanizedDate_1mx7u_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_1mx7u_gg_:focus-within .___SMask_1mx7u_gg_,.___SSingleDateInput_1mx7u_gg_:focus-within .___SValue_1mx7u_gg_{opacity:1}.___SDateRange_1mx7u_gg_:focus-within .___SHumanizedDate_1mx7u_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_1mx7u_gg_:focus-within .___SMask_1mx7u_gg_,.___SDateRange_1mx7u_gg_:focus-within .___SValue_1mx7u_gg_{opacity:1}.___SInputMask_1mx7u_gg_.__noHumanizedDate_1mx7u_gg_ .___SMask_1mx7u_gg_,.___SInputMask_1mx7u_gg_.__noHumanizedDate_1mx7u_gg_ .___SValue_1mx7u_gg_{opacity:1}.___SDateRange_1mx7u_gg_ .___SInputMask_1mx7u_gg_:focus-within .___SMask_1mx7u_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_1mx7u_gg_:focus-within .___SRangeSep_1mx7u_gg_,.___SRangeSep_1mx7u_gg_.__fulfilled_1mx7u_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SRangeComparatorHeader_1mx7u_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SRangeCalendar_1mx7u_gg_,.___SRangeComparatorHeader_1mx7u_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___SFooter_1mx7u_gg_{border-top:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SFooter_1mx7u_gg_,.___SPeriodsList_1mx7u_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___STooltip_1mx7u_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SCompareToggle_1mx7u_gg_{white-space:nowrap}@media (prefers-reduced-motion){.___SInputMask_1mx7u_gg_{transition:none}}",
21
- "1mx7u_gg_"
19
+ ".___SPopper_1plgq_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_1plgq_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_1plgq_gg_:active,.___SPopper_1plgq_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_1plgq_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_1plgq_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_1plgq_gg_,.___STitle_1plgq_gg_{display:flex;align-items:center}.___STitle_1plgq_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_1plgq_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_1plgq_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_1plgq_gg_ .___SInner_1plgq_gg_{justify-content:flex-start}.___SInputMask_1plgq_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_1plgq_gg_.__animationsDisabled_1plgq_gg_{transition:none}.___SInputMask_1plgq_gg_ .___SValue_1plgq_gg_{letter-spacing:0}.___SIndicator_1plgq_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SRangeIndicator_1plgq_gg_{border-radius:50%;flex-shrink:0}.___SRangeIndicator_1plgq_gg_._range_value_1plgq_gg_{background-color:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SRangeIndicator_1plgq_gg_._range_compare_1plgq_gg_{background-color:var(--intergalactic-date-picker-cell-comparison-active, #8649e1)}.___SRangeIndicator_1plgq_gg_.__disabled_1plgq_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SHumanizedDate_1plgq_gg_{position:absolute;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.___SMask_1plgq_gg_{letter-spacing:0;white-space:nowrap;overflow:hidden}.___SDateRange_1plgq_gg_ .___SMask_1plgq_gg_,.___SDateRange_1plgq_gg_ .___SValue_1plgq_gg_,.___SSingleDateInput_1plgq_gg_ .___SMask_1plgq_gg_,.___SSingleDateInput_1plgq_gg_ .___SValue_1plgq_gg_{opacity:0}.___SSingleDateInput_1plgq_gg_:focus-within .___SHumanizedDate_1plgq_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_1plgq_gg_:focus-within .___SMask_1plgq_gg_,.___SSingleDateInput_1plgq_gg_:focus-within .___SValue_1plgq_gg_{opacity:1}.___SDateRange_1plgq_gg_:focus-within .___SHumanizedDate_1plgq_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_1plgq_gg_:focus-within .___SMask_1plgq_gg_,.___SDateRange_1plgq_gg_:focus-within .___SValue_1plgq_gg_{opacity:1}.___SInputMask_1plgq_gg_.__noHumanizedDate_1plgq_gg_ .___SMask_1plgq_gg_,.___SInputMask_1plgq_gg_.__noHumanizedDate_1plgq_gg_ .___SValue_1plgq_gg_{opacity:1}.___SDateRange_1plgq_gg_ .___SInputMask_1plgq_gg_:focus-within .___SMask_1plgq_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_1plgq_gg_:focus-within .___SRangeSep_1plgq_gg_,.___SRangeSep_1plgq_gg_.__fulfilled_1plgq_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SRangeComparatorHeader_1plgq_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SRangeCalendar_1plgq_gg_,.___SRangeComparatorHeader_1plgq_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___SFooter_1plgq_gg_{border-top:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SFooter_1plgq_gg_,.___SPeriodsList_1plgq_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___STooltip_1plgq_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SCompareToggle_1plgq_gg_{white-space:nowrap}@media (prefers-reduced-motion){.___SInputMask_1plgq_gg_{transition:none}}",
20
+ "1plgq_gg_"
22
21
  ), {
23
- __SHeader: "___SHeader_1mx7u_gg_",
24
- __STitle: "___STitle_1mx7u_gg_",
25
- __SToday: "___SToday_1mx7u_gg_",
26
- __SPeriod: "___SPeriod_1mx7u_gg_",
27
- __SButton: "___SButton_1mx7u_gg_",
28
- __SInner: "___SInner_1mx7u_gg_",
29
- __SInputMask: "___SInputMask_1mx7u_gg_",
30
- _animationsDisabled: "__animationsDisabled_1mx7u_gg_",
31
- __SValue: "___SValue_1mx7u_gg_",
32
- __SIndicator: "___SIndicator_1mx7u_gg_",
33
- __SRangeIndicator: "___SRangeIndicator_1mx7u_gg_",
34
- _range_value: "_range_value_1mx7u_gg_",
35
- _range_compare: "_range_compare_1mx7u_gg_",
36
- _disabled: "__disabled_1mx7u_gg_",
37
- __SHumanizedDate: "___SHumanizedDate_1mx7u_gg_",
38
- __SMask: "___SMask_1mx7u_gg_",
39
- __SSingleDateInput: "___SSingleDateInput_1mx7u_gg_",
40
- __SDateRange: "___SDateRange_1mx7u_gg_",
41
- _noHumanizedDate: "__noHumanizedDate_1mx7u_gg_",
42
- __SRangeSep: "___SRangeSep_1mx7u_gg_",
43
- _fulfilled: "__fulfilled_1mx7u_gg_",
44
- __SRangeComparatorHeader: "___SRangeComparatorHeader_1mx7u_gg_",
45
- __SRangeCalendar: "___SRangeCalendar_1mx7u_gg_",
46
- __SFooter: "___SFooter_1mx7u_gg_",
47
- __SPeriodsList: "___SPeriodsList_1mx7u_gg_",
48
- __STooltip: "___STooltip_1mx7u_gg_",
49
- __SCompareToggle: "___SCompareToggle_1mx7u_gg_",
50
- __SPopper: "___SPopper_1mx7u_gg_"
22
+ "__SHeader": "___SHeader_1plgq_gg_",
23
+ "__STitle": "___STitle_1plgq_gg_",
24
+ "__SToday": "___SToday_1plgq_gg_",
25
+ "__SPeriod": "___SPeriod_1plgq_gg_",
26
+ "__SButton": "___SButton_1plgq_gg_",
27
+ "__SInner": "___SInner_1plgq_gg_",
28
+ "__SInputMask": "___SInputMask_1plgq_gg_",
29
+ "_animationsDisabled": "__animationsDisabled_1plgq_gg_",
30
+ "__SValue": "___SValue_1plgq_gg_",
31
+ "__SIndicator": "___SIndicator_1plgq_gg_",
32
+ "__SRangeIndicator": "___SRangeIndicator_1plgq_gg_",
33
+ "_range_value": "_range_value_1plgq_gg_",
34
+ "_range_compare": "_range_compare_1plgq_gg_",
35
+ "_disabled": "__disabled_1plgq_gg_",
36
+ "__SHumanizedDate": "___SHumanizedDate_1plgq_gg_",
37
+ "__SMask": "___SMask_1plgq_gg_",
38
+ "__SSingleDateInput": "___SSingleDateInput_1plgq_gg_",
39
+ "__SDateRange": "___SDateRange_1plgq_gg_",
40
+ "_noHumanizedDate": "__noHumanizedDate_1plgq_gg_",
41
+ "__SRangeSep": "___SRangeSep_1plgq_gg_",
42
+ "_fulfilled": "__fulfilled_1plgq_gg_",
43
+ "__SRangeComparatorHeader": "___SRangeComparatorHeader_1plgq_gg_",
44
+ "__SRangeCalendar": "___SRangeCalendar_1plgq_gg_",
45
+ "__SFooter": "___SFooter_1plgq_gg_",
46
+ "__SPeriodsList": "___SPeriodsList_1plgq_gg_",
47
+ "__STooltip": "___STooltip_1plgq_gg_",
48
+ "__SCompareToggle": "___SCompareToggle_1plgq_gg_",
49
+ "__SPopper": "___SPopper_1plgq_gg_"
51
50
  })
52
- ), G = ["INPUT"], U = ["ArrowDown", "Enter", " "], $ = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)), S = /* @__PURE__ */ function(x) {
53
- z(l, x);
54
- var m = E(l);
55
- function l() {
56
- var _;
57
- H(this, l);
58
- for (var e = arguments.length, a = new Array(e), t = 0; t < e; t++)
59
- a[t] = arguments[t];
60
- return _ = m.call.apply(m, [this].concat(a)), o(s(_), "popperRef", /* @__PURE__ */ g.createRef()), o(s(_), "unitRefs", {}), o(s(_), "navigateStep", void 0), o(s(_), "keyDiff", void 0), o(s(_), "keyStep", void 0), o(s(_), "navigateView", function(i) {
61
- var r = _.asProps.displayedPeriod, n = i >= 1 ? "add" : "subtract", d = c(r)[n](1, _.navigateStep).toDate();
62
- _.handlers.displayedPeriod(d);
63
- }), o(s(_), "bindHandlerNavigateClick", function(i) {
51
+ );
52
+ var INTERACTION_TAGS = ["INPUT"];
53
+ var INTERACTION_KEYS = ["ArrowDown", "Enter", " "];
54
+ var defaultDisplayedPeriod = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
55
+ var PickerAbstract = /* @__PURE__ */ function(_Component) {
56
+ _inherits(PickerAbstract2, _Component);
57
+ var _super = _createSuper(PickerAbstract2);
58
+ function PickerAbstract2() {
59
+ var _this;
60
+ _classCallCheck(this, PickerAbstract2);
61
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
62
+ args[_key] = arguments[_key];
63
+ }
64
+ _this = _super.call.apply(_super, [this].concat(args));
65
+ _defineProperty(_assertThisInitialized(_this), "popperRef", /* @__PURE__ */ React.createRef());
66
+ _defineProperty(_assertThisInitialized(_this), "unitRefs", {});
67
+ _defineProperty(_assertThisInitialized(_this), "navigateStep", void 0);
68
+ _defineProperty(_assertThisInitialized(_this), "keyDiff", void 0);
69
+ _defineProperty(_assertThisInitialized(_this), "keyStep", void 0);
70
+ _defineProperty(_assertThisInitialized(_this), "navigateView", function(direction) {
71
+ var displayedPeriod = _this.asProps.displayedPeriod;
72
+ var action = direction >= 1 ? "add" : "subtract";
73
+ var date = dayjs(displayedPeriod)[action](1, _this.navigateStep).toDate();
74
+ _this.handlers.displayedPeriod(date);
75
+ });
76
+ _defineProperty(_assertThisInitialized(_this), "bindHandlerNavigateClick", function(direction) {
64
77
  return function() {
65
- _.navigateView(i);
78
+ _this.navigateView(direction);
66
79
  };
67
- }), o(s(_), "handlerKeyDown", function(i) {
68
- return function(r) {
69
- var n = _.asProps, d = n.value, p = n.displayedPeriod, u = n.highlighted;
70
- n.disabled;
71
- var k = n.visible, I = r.key;
72
- i === "trigger" && U.includes(I) && (r.stopPropagation(), _.handlers.visible(!k), setTimeout(function() {
73
- var h = _.popperRef.current;
74
- h && h.focus();
75
- }, 0));
76
- var P = _.keyDiff[r.key], y = function(T) {
77
- return T.toDate();
80
+ });
81
+ _defineProperty(_assertThisInitialized(_this), "handlerKeyDown", function(place) {
82
+ return function(e) {
83
+ var _this$asProps = _this.asProps, value = _this$asProps.value, displayedPeriod = _this$asProps.displayedPeriod, highlighted = _this$asProps.highlighted;
84
+ _this$asProps.disabled;
85
+ var visible = _this$asProps.visible;
86
+ var key = e.key;
87
+ if (place === "trigger" && INTERACTION_KEYS.includes(key)) {
88
+ e.stopPropagation();
89
+ _this.handlers.visible(!visible);
90
+ setTimeout(function() {
91
+ var popper = _this.popperRef.current;
92
+ if (popper) {
93
+ popper.focus();
94
+ }
95
+ }, 0);
96
+ }
97
+ var day = _this.keyDiff[e.key];
98
+ var getCurrentHighlightedDay = function getCurrentHighlightedDay2(day2) {
99
+ return day2.toDate();
78
100
  };
79
- if (i === "popper" && (r.key === " " || r.key === "Enter" && u.length) && (_.isDisabled(u[0]) || _.handlers.value(u[0]), r.preventDefault()), P) {
80
- if (G.includes(r.target.tagName)) return;
81
- var w = !u[0] && !d ? c(u[0] || p) : c(p).add(P, _.keyStep), v = y(w) || y(c(u[0] || p));
82
- if (v) {
83
- var f;
84
- _.handlers.highlighted([v]), _.handlers.displayedPeriod(v), r.preventDefault();
85
- var C = _.keyStep === "month" ? j : L, R = C(v, _.asProps.locale);
86
- (f = _.unitRefs[R]) === null || f === void 0 || f.focus();
101
+ if (place === "popper" && (e.key === " " || e.key === "Enter" && highlighted.length)) {
102
+ if (!_this.isDisabled(highlighted[0])) {
103
+ _this.handlers.value(highlighted[0]);
104
+ }
105
+ e.preventDefault();
106
+ }
107
+ if (day) {
108
+ if (INTERACTION_TAGS.includes(e.target.tagName)) return;
109
+ var current_highlighted = !highlighted[0] && !value ? dayjs(highlighted[0] || displayedPeriod) : dayjs(displayedPeriod).add(day, _this.keyStep);
110
+ var current_day = getCurrentHighlightedDay(current_highlighted) || getCurrentHighlightedDay(dayjs(highlighted[0] || displayedPeriod));
111
+ if (current_day) {
112
+ var _this$unitRefs$format;
113
+ _this.handlers.highlighted([current_day]);
114
+ _this.handlers.displayedPeriod(current_day);
115
+ e.preventDefault();
116
+ var formatter = _this.keyStep === "month" ? formatMMYY : formatDDMMYY;
117
+ var formattedDate = formatter(current_day, _this.asProps.locale);
118
+ (_this$unitRefs$format = _this.unitRefs[formattedDate]) === null || _this$unitRefs$format === void 0 ? void 0 : _this$unitRefs$format.focus();
87
119
  }
88
120
  }
89
121
  };
90
- }), _;
122
+ });
123
+ return _this;
91
124
  }
92
- return M(l, [{
125
+ _createClass(PickerAbstract2, [{
93
126
  key: "uncontrolledProps",
94
- value: function() {
95
- var e = this;
127
+ value: function uncontrolledProps() {
128
+ var _this2 = this;
96
129
  return {
97
130
  displayedPeriod: null,
98
- visible: [null, function(a) {
99
- var t = e.asProps, i = t.value, r = t.displayedPeriod;
100
- if (a || e.handlers.highlighted([]), a) {
101
- if (i && i !== r)
102
- e.handlers.displayedPeriod(i);
103
- else if (!i) {
104
- var n = e.props, d = n.displayedPeriod, p = n.defaultDisplayedPeriod;
105
- e.handlers.displayedPeriod(d || p);
131
+ visible: [null, function(visible) {
132
+ var _this2$asProps = _this2.asProps, value = _this2$asProps.value, displayedPeriod = _this2$asProps.displayedPeriod;
133
+ if (!visible) {
134
+ _this2.handlers.highlighted([]);
135
+ }
136
+ if (visible) {
137
+ if (value && value !== displayedPeriod) {
138
+ _this2.handlers.displayedPeriod(value);
139
+ } else if (!value) {
140
+ var _this2$props = _this2.props, _displayedPeriod = _this2$props.displayedPeriod, _defaultDisplayedPeriod = _this2$props.defaultDisplayedPeriod;
141
+ _this2.handlers.displayedPeriod(_displayedPeriod || _defaultDisplayedPeriod);
106
142
  }
107
143
  }
108
144
  }],
109
145
  highlighted: null,
110
- value: [null, function(a) {
111
- a && e.handlers.visible(!1), e.handlers.displayedPeriod(a ?? void 0);
146
+ value: [null, function(value) {
147
+ if (value) {
148
+ _this2.handlers.visible(false);
149
+ }
150
+ _this2.handlers.displayedPeriod(value !== null && value !== void 0 ? value : void 0);
112
151
  }]
113
152
  };
114
153
  }
115
154
  }, {
116
155
  key: "isDisabled",
117
- value: function(e) {
118
- var a = this.asProps.disabled;
119
- return a.some(B(c(e), "date"));
156
+ value: function isDisabled(date) {
157
+ var disabled = this.asProps.disabled;
158
+ return disabled.some(includesDate(dayjs(date), "date"));
120
159
  }
121
160
  }, {
122
161
  key: "getButtonTriggerProps",
123
- value: function() {
124
- var e = this.asProps, a = e.value, t = e.size, i = e.visible;
162
+ value: function getButtonTriggerProps() {
163
+ var _this$asProps2 = this.asProps, value = _this$asProps2.value, size = _this$asProps2.size, visible = _this$asProps2.visible;
125
164
  return {
126
- popoverVisible: i,
127
- size: t,
128
- empty: !a,
165
+ popoverVisible: visible,
166
+ size,
167
+ empty: !value,
129
168
  onKeyDown: this.handlerKeyDown("trigger")
130
169
  };
131
170
  }
132
171
  }, {
133
172
  key: "getPopperProps",
134
- value: function() {
135
- var e = this[b];
173
+ value: function getPopperProps() {
174
+ var Picker = this[CORE_INSTANCE];
136
175
  return {
137
176
  tabIndex: 0,
138
177
  ref: this.popperRef,
139
178
  onKeyDown: this.handlerKeyDown("popper"),
140
- children: /* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement(e.Header, null), /* @__PURE__ */ g.createElement(e.Calendar, null))
179
+ children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Picker.Header, null), /* @__PURE__ */ React.createElement(Picker.Calendar, null))
141
180
  };
142
181
  }
143
182
  }, {
144
183
  key: "getHeaderProps",
145
- value: function() {
146
- var e = this[b];
184
+ value: function getHeaderProps() {
185
+ var Picker = this[CORE_INSTANCE];
147
186
  return {
148
- children: /* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement(e.Prev, null), /* @__PURE__ */ g.createElement(e.Title, null), /* @__PURE__ */ g.createElement(e.Next, null))
187
+ 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))
149
188
  };
150
189
  }
151
190
  }, {
152
191
  key: "getTitleProps",
153
- value: function() {
192
+ value: function getTitleProps() {
154
193
  return {};
155
194
  }
156
195
  }, {
157
196
  key: "getNextProps",
158
- value: function() {
159
- var e = this.asProps.getI18nText, a = this.navigateStep;
197
+ value: function getNextProps() {
198
+ var getI18nText = this.asProps.getI18nText;
199
+ var navigateStep = this.navigateStep;
160
200
  return {
161
201
  onClick: this.bindHandlerNavigateClick(1),
162
- getI18nText: e,
163
- "aria-label": e(a === "month" ? "nextMonth" : "nextYear")
202
+ getI18nText,
203
+ "aria-label": navigateStep === "month" ? getI18nText("nextMonth") : getI18nText("nextYear")
164
204
  };
165
205
  }
166
206
  }, {
167
207
  key: "getPrevProps",
168
- value: function() {
169
- var e = this.asProps.getI18nText, a = this.navigateStep;
208
+ value: function getPrevProps() {
209
+ var getI18nText = this.asProps.getI18nText;
210
+ var navigateStep = this.navigateStep;
170
211
  return {
171
212
  onClick: this.bindHandlerNavigateClick(-1),
172
- getI18nText: e,
173
- "aria-label": e(a === "month" ? "prevMonth" : "prevYear")
213
+ getI18nText,
214
+ "aria-label": navigateStep === "month" ? getI18nText("prevMonth") : getI18nText("prevYear")
174
215
  };
175
216
  }
176
217
  }, {
177
218
  key: "getCalendarProps",
178
- value: function() {
179
- var e = this.asProps, a = e.locale, t = e.displayedPeriod, i = e.disabled, r = e.value, n = e.highlighted, d = e.onVisibleChange, p = e.onChange, u = e.getI18nText;
219
+ value: function getCalendarProps() {
220
+ var _this$asProps3 = this.asProps, locale = _this$asProps3.locale, displayedPeriod = _this$asProps3.displayedPeriod, disabled = _this$asProps3.disabled, value = _this$asProps3.value, highlighted = _this$asProps3.highlighted, onVisibleChange = _this$asProps3.onVisibleChange, onChange = _this$asProps3.onChange, getI18nText = _this$asProps3.getI18nText;
180
221
  return {
181
- locale: a,
182
- displayedPeriod: t,
183
- disabled: i,
184
- onChange: p,
185
- highlighted: n,
186
- value: [r, r],
187
- renderOutdated: !0,
188
- onVisibleChange: d,
222
+ locale,
223
+ displayedPeriod,
224
+ disabled,
225
+ onChange,
226
+ highlighted,
227
+ value: [value, value],
228
+ renderOutdated: true,
229
+ onVisibleChange,
189
230
  unitRefs: this.unitRefs,
190
- getI18nText: u,
231
+ getI18nText,
191
232
  actionsDescribing: null
192
233
  };
193
234
  }
194
235
  }, {
195
236
  key: "render",
196
- value: function() {
197
- var e = this.asProps, a, t = this.asProps, i = t.styles, r = t.Children, n = t["aria-label"];
198
- return /* @__PURE__ */ g.createElement(g.Fragment, null, (a = N(i), /* @__PURE__ */ g.createElement(Y, A({
199
- "use:aria-label": n,
200
- __excludeProps: ["onChange", "value"]
201
- }, e), /* @__PURE__ */ g.createElement(r, a.cn("Children", {})))));
237
+ value: function render() {
238
+ var _ref = this.asProps, _ref2;
239
+ var _this$asProps4 = this.asProps, styles = _this$asProps4.styles, Children = _this$asProps4.Children, providedAriaLabel = _this$asProps4["aria-label"];
240
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, (_ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(Dropdown, assignProps({
241
+ "use:aria-label": providedAriaLabel,
242
+ "__excludeProps": ["onChange", "value"]
243
+ }, _ref), /* @__PURE__ */ React.createElement(Children, _ref2.cn("Children", {})))));
202
244
  }
203
245
  }], [{
204
246
  key: "defaultProps",
205
- value: function(e) {
206
- var a = e.value, t = e.defaultValue;
247
+ value: function defaultProps(_ref3) {
248
+ var value = _ref3.value, defaultValue = _ref3.defaultValue;
207
249
  return {
208
- i18n: D,
250
+ i18n: localizedMessages,
209
251
  locale: "en",
210
- defaultDisplayedPeriod: a || t || $,
252
+ defaultDisplayedPeriod: value || defaultValue || defaultDisplayedPeriod,
211
253
  defaultValue: null,
212
- defaultVisible: !1,
254
+ defaultVisible: false,
213
255
  defaultHighlighted: [],
214
256
  disabled: [],
215
257
  size: "m"
216
258
  };
217
259
  }
218
- }]), l;
219
- }(F);
220
- o(S, "displayName", "DatePicker");
221
- o(S, "style", O);
222
- o(S, "enhance", [K(D)]);
223
- o(S, "add", function(x, m, l) {
224
- return c(x).add(m, l).toDate();
260
+ }]);
261
+ return PickerAbstract2;
262
+ }(Component);
263
+ _defineProperty(PickerAbstract, "displayName", "DatePicker");
264
+ _defineProperty(PickerAbstract, "style", style);
265
+ _defineProperty(PickerAbstract, "enhance", [i18nEnhance(localizedMessages)]);
266
+ _defineProperty(PickerAbstract, "add", function(date, amount, unit) {
267
+ return dayjs(date).add(amount, unit).toDate();
225
268
  });
226
- o(S, "subtract", function(x, m, l) {
227
- return c(x).subtract(m, l).toDate();
269
+ _defineProperty(PickerAbstract, "subtract", function(date, amount, unit) {
270
+ return dayjs(date).subtract(amount, unit).toDate();
228
271
  });
229
272
  export {
230
- S as default
273
+ PickerAbstract as default
231
274
  };