@semcore/date-picker 4.58.0-prerelease.4 → 4.58.0-prerelease.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/DatePicker.js +27 -36
- package/lib/cjs/DatePicker.js.map +1 -1
- package/lib/cjs/DateRangeComparator.js +38 -43
- package/lib/cjs/DateRangeComparator.js.map +1 -1
- package/lib/cjs/DateRangePicker.js +17 -22
- package/lib/cjs/DateRangePicker.js.map +1 -1
- package/lib/cjs/MonthDateRangeComparator.js +42 -47
- package/lib/cjs/MonthDateRangeComparator.js.map +1 -1
- package/lib/cjs/MonthPicker.js +16 -21
- package/lib/cjs/MonthPicker.js.map +1 -1
- package/lib/cjs/MonthRangePicker.js +18 -23
- package/lib/cjs/MonthRangePicker.js.map +1 -1
- package/lib/cjs/components/ButtonTrigger.js +8 -10
- package/lib/cjs/components/ButtonTrigger.js.map +1 -1
- package/lib/cjs/components/Calendar.js +109 -125
- package/lib/cjs/components/Calendar.js.map +1 -1
- package/lib/cjs/components/DateRangeComparatorAbstract.js +121 -104
- package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
- package/lib/cjs/components/InputTrigger.js +179 -189
- package/lib/cjs/components/InputTrigger.js.map +1 -1
- package/lib/cjs/components/PickerAbstract.js +58 -57
- package/lib/cjs/components/PickerAbstract.js.map +1 -1
- package/lib/cjs/components/RangePickerAbstract.js +97 -76
- package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
- package/lib/cjs/components/index.js +41 -46
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/calendar.shadow.css +12 -14
- package/lib/cjs/style/date-picker.shadow.css +6 -7
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/translations/de.json +6 -2
- package/lib/cjs/translations/es.json +6 -2
- package/lib/cjs/translations/fr.json +6 -2
- package/lib/cjs/translations/it.json +6 -2
- package/lib/cjs/translations/ja.json +6 -2
- package/lib/cjs/translations/ko.json +6 -2
- package/lib/cjs/translations/nl.json +6 -2
- package/lib/cjs/translations/pl.json +6 -2
- package/lib/cjs/translations/pt.json +6 -2
- package/lib/cjs/translations/sv.json +6 -2
- package/lib/cjs/translations/tr.json +6 -2
- package/lib/cjs/translations/vi.json +6 -2
- package/lib/cjs/translations/zh.json +6 -2
- package/lib/cjs/utils/cronTabScheduler.js +8 -5
- package/lib/cjs/utils/cronTabScheduler.js.map +1 -1
- package/lib/cjs/utils/datesIntersects.js +3 -4
- package/lib/cjs/utils/datesIntersects.js.map +1 -1
- package/lib/cjs/utils/formatDate.js +3 -5
- package/lib/cjs/utils/formatDate.js.map +1 -1
- package/lib/cjs/utils/includesDate.js +2 -3
- package/lib/cjs/utils/includesDate.js.map +1 -1
- package/lib/cjs/utils/isBetweenPlugin.js +21 -0
- package/lib/cjs/utils/isBetweenPlugin.js.map +1 -0
- package/lib/cjs/utils/shortDateRangeFormat.js +2 -2
- package/lib/cjs/utils/shortDateRangeFormat.js.map +1 -1
- package/lib/es6/DatePicker.js +22 -28
- package/lib/es6/DatePicker.js.map +1 -1
- package/lib/es6/DateRangeComparator.js +23 -27
- package/lib/es6/DateRangeComparator.js.map +1 -1
- package/lib/es6/DateRangePicker.js +13 -17
- package/lib/es6/DateRangePicker.js.map +1 -1
- package/lib/es6/MonthDateRangeComparator.js +28 -32
- package/lib/es6/MonthDateRangeComparator.js.map +1 -1
- package/lib/es6/MonthPicker.js +13 -17
- package/lib/es6/MonthPicker.js.map +1 -1
- package/lib/es6/MonthRangePicker.js +14 -18
- package/lib/es6/MonthRangePicker.js.map +1 -1
- package/lib/es6/components/ButtonTrigger.js +5 -5
- package/lib/es6/components/ButtonTrigger.js.map +1 -1
- package/lib/es6/components/Calendar.js +100 -112
- package/lib/es6/components/Calendar.js.map +1 -1
- package/lib/es6/components/DateRangeComparatorAbstract.js +120 -101
- package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
- package/lib/es6/components/InputTrigger.js +173 -180
- package/lib/es6/components/InputTrigger.js.map +1 -1
- package/lib/es6/components/PickerAbstract.js +58 -55
- package/lib/es6/components/PickerAbstract.js.map +1 -1
- package/lib/es6/components/RangePickerAbstract.js +94 -71
- package/lib/es6/components/RangePickerAbstract.js.map +1 -1
- package/lib/es6/components/index.js +35 -38
- package/lib/es6/components/index.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/calendar.shadow.css +12 -14
- package/lib/es6/style/date-picker.shadow.css +6 -7
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/translations/de.json +6 -2
- package/lib/es6/translations/es.json +6 -2
- package/lib/es6/translations/fr.json +6 -2
- package/lib/es6/translations/it.json +6 -2
- package/lib/es6/translations/ja.json +6 -2
- package/lib/es6/translations/ko.json +6 -2
- package/lib/es6/translations/nl.json +6 -2
- package/lib/es6/translations/pl.json +6 -2
- package/lib/es6/translations/pt.json +6 -2
- package/lib/es6/translations/sv.json +6 -2
- package/lib/es6/translations/tr.json +6 -2
- package/lib/es6/translations/vi.json +6 -2
- package/lib/es6/translations/zh.json +6 -2
- package/lib/es6/utils/cronTabScheduler.js +7 -4
- package/lib/es6/utils/cronTabScheduler.js.map +1 -1
- package/lib/es6/utils/datesIntersects.js +1 -1
- package/lib/es6/utils/datesIntersects.js.map +1 -1
- package/lib/es6/utils/formatDate.js.map +1 -1
- package/lib/es6/utils/includesDate.js.map +1 -1
- package/lib/es6/utils/isBetweenPlugin.js +16 -0
- package/lib/es6/utils/isBetweenPlugin.js.map +1 -0
- package/lib/es6/utils/shortDateRangeFormat.js +1 -1
- package/lib/es6/utils/shortDateRangeFormat.js.map +1 -1
- package/lib/esm/DatePicker.mjs +27 -33
- package/lib/esm/DateRangeComparator.mjs +26 -30
- package/lib/esm/DateRangePicker.mjs +17 -21
- package/lib/esm/MonthDateRangeComparator.mjs +31 -35
- package/lib/esm/MonthPicker.mjs +16 -20
- package/lib/esm/MonthRangePicker.mjs +18 -22
- package/lib/esm/components/ButtonTrigger.mjs +5 -5
- package/lib/esm/components/Calendar.mjs +103 -115
- package/lib/esm/components/DateRangeComparatorAbstract.mjs +105 -89
- package/lib/esm/components/InputTrigger.mjs +143 -181
- package/lib/esm/components/PickerAbstract.mjs +61 -62
- package/lib/esm/components/RangePickerAbstract.mjs +94 -73
- package/lib/esm/components/index.mjs +29 -33
- package/lib/esm/style/calendar.shadow.css +12 -14
- package/lib/esm/style/date-picker.shadow.css +6 -7
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/translations/de.json.mjs +18 -6
- package/lib/esm/translations/es.json.mjs +18 -6
- package/lib/esm/translations/fr.json.mjs +18 -6
- package/lib/esm/translations/it.json.mjs +18 -6
- package/lib/esm/translations/ja.json.mjs +18 -6
- package/lib/esm/translations/ko.json.mjs +18 -6
- package/lib/esm/translations/nl.json.mjs +18 -6
- package/lib/esm/translations/pl.json.mjs +18 -6
- package/lib/esm/translations/pt.json.mjs +18 -6
- package/lib/esm/translations/sv.json.mjs +18 -6
- package/lib/esm/translations/tr.json.mjs +18 -6
- package/lib/esm/translations/vi.json.mjs +18 -6
- package/lib/esm/translations/zh.json.mjs +18 -6
- package/lib/esm/utils/cronTabScheduler.mjs +4 -4
- package/lib/esm/utils/datesIntersects.mjs +1 -1
- package/lib/esm/utils/isBetweenPlugin.mjs +13 -0
- package/lib/esm/utils/shortDateRangeFormat.mjs +1 -2
- package/lib/types/index.d.ts +140 -171
- package/package.json +16 -16
|
@@ -1,67 +1,64 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
5
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
6
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
8
7
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
8
|
+
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
9
9
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
10
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
11
10
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
12
|
-
import { sstyled } from "@semcore/
|
|
13
|
-
import
|
|
14
|
-
import React from "react";
|
|
11
|
+
import { sstyled, assignProps, Component, createComponent } from "@semcore/core";
|
|
12
|
+
import { Box, NeighborLocation, Flex } from "@semcore/base-components";
|
|
15
13
|
import BaseTrigger from "@semcore/base-trigger";
|
|
14
|
+
import assignProps$1 from "@semcore/core/lib/utils/assignProps";
|
|
15
|
+
import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
|
|
16
|
+
import Calendar from "@semcore/icon/Calendar/m";
|
|
16
17
|
import InputMask from "@semcore/input-mask";
|
|
17
18
|
import Tooltip from "@semcore/tooltip";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import NeighborLocation from "@semcore/neighbor-location";
|
|
19
|
+
import dayjs from "dayjs";
|
|
20
|
+
import React from "react";
|
|
21
21
|
import { datesIntersects } from "../utils/datesIntersects.mjs";
|
|
22
22
|
import { includesDate } from "../utils/includesDate.mjs";
|
|
23
|
-
|
|
24
|
-
import useEnhancedEffect from "@semcore/utils/lib/use/useEnhancedEffect";
|
|
25
|
-
import assignProps$1 from "@semcore/utils/lib/assignProps";
|
|
26
|
-
var _excluded = ["children", "id", "role", "aria-haspopup", "aria-label", "style"], _excluded2 = ["children", "id", "role", "aria-haspopup", "aria-label", "style"], _excluded3 = ["value", "onChange", "onDisplayedPeriodChange", "locale", "w", "ariaHasPopup", "showError"], _excluded4 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "showError"], _excluded5 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "inputId", "showError"], _excluded6 = ["date", "onDateChange", "onDisplayedPeriodChange", "locale", "styles", "parts", "disabledDates", "forwardRef", "placeholders", "labelPrefix", "onMaskPipeBlock", "containerFocused", "animationsDisabled", "getI18nText", "inputId", "inputRole", "__excludeProps", "Root"];
|
|
23
|
+
var _excluded = ["children", "id", "role", "aria-haspopup", "aria-label", "style"], _excluded2 = ["children", "id", "role", "aria-haspopup", "aria-label", "style"], _excluded3 = ["value", "onChange", "onDisplayedPeriodChange", "locale", "w", "ariaHasPopup", "showError", "neighborLocation"], _excluded4 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "showError", "neighborLocation"], _excluded5 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "inputId", "showError", "neighborLocation"], _excluded6 = ["date", "onDateChange", "onDisplayedPeriodChange", "locale", "styles", "parts", "disabledDates", "forwardRef", "placeholders", "labelPrefix", "onMaskPipeBlock", "containerFocused", "animationsDisabled", "getI18nText", "inputId", "inputRole", "__excludeProps", "Root"];
|
|
27
24
|
/*!__reshadow-styles__:"../style/date-picker.shadow.css"*/
|
|
28
25
|
var style = (
|
|
29
26
|
/*__reshadow_css_start__*/
|
|
30
27
|
(sstyled.insert(
|
|
31
28
|
/*__inner_css_start__*/
|
|
32
|
-
".
|
|
29
|
+
".___SPopper_1h6ds_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_1h6ds_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_1h6ds_gg_:active,.___SPopper_1h6ds_gg_:focus{-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_1h6ds_gg_:hover{-webkit-text-decoration:none;text-decoration:none}}.___SHeader_1h6ds_gg_,.___STitle_1h6ds_gg_{display:flex;align-items:center}.___STitle_1h6ds_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899));height:32px;width:100%;justify-content:center}.___SToday_1h6ds_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_1h6ds_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_1h6ds_gg_ .___SInner_1h6ds_gg_{justify-content:flex-start}.___SInputMask_1h6ds_gg_{color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899));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_1h6ds_gg_.__animationsDisabled_1h6ds_gg_{transition:none}.___SInputMask_1h6ds_gg_ .___SValue_1h6ds_gg_{letter-spacing:0}.___SInputMask_1h6ds_gg_ .___SValue_1h6ds_gg_:focus{outline:0}.___SIndicator_1h6ds_gg_{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@supports (color:color(display-p3 0 0 0%)){.___SIndicator_1h6ds_gg_{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___SIndicator_1h6ds_gg_{color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}.___SRangeIndicator_1h6ds_gg_{border-radius:50%;flex-shrink:0}.___SRangeIndicator_1h6ds_gg_._range_value_1h6ds_gg_{background-color:var(--intergalactic-date-picker-cell-active, rgb(118, 128, 231))}.___SRangeIndicator_1h6ds_gg_._range_compare_1h6ds_gg_{background-color:var(--intergalactic-date-picker-cell-comparison-active, rgb(162, 97, 253))}.___SRangeIndicator_1h6ds_gg_.__disabled_1h6ds_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4)}.___SHumanizedDate_1h6ds_gg_{position:absolute;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.___SMask_1h6ds_gg_{letter-spacing:0;white-space:nowrap;overflow:hidden}.___SDateRange_1h6ds_gg_ .___SMask_1h6ds_gg_,.___SDateRange_1h6ds_gg_ .___SValue_1h6ds_gg_,.___SSingleDateInput_1h6ds_gg_ .___SMask_1h6ds_gg_,.___SSingleDateInput_1h6ds_gg_ .___SValue_1h6ds_gg_{opacity:0}.___SSingleDateInput_1h6ds_gg_:focus-within .___SHumanizedDate_1h6ds_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_1h6ds_gg_:focus-within .___SMask_1h6ds_gg_,.___SSingleDateInput_1h6ds_gg_:focus-within .___SValue_1h6ds_gg_{opacity:1}.___SDateRange_1h6ds_gg_:focus-within .___SHumanizedDate_1h6ds_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_1h6ds_gg_:focus-within .___SMask_1h6ds_gg_,.___SDateRange_1h6ds_gg_:focus-within .___SValue_1h6ds_gg_{opacity:1}.___SInputMask_1h6ds_gg_.__noHumanizedDate_1h6ds_gg_ .___SMask_1h6ds_gg_,.___SInputMask_1h6ds_gg_.__noHumanizedDate_1h6ds_gg_ .___SValue_1h6ds_gg_{opacity:1}.___SDateRange_1h6ds_gg_ .___SInputMask_1h6ds_gg_:focus-within .___SMask_1h6ds_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(1, 79, 255, 0.116))}@supports (color:color(display-p3 0 0 0%)){.___SDateRange_1h6ds_gg_ .___SInputMask_1h6ds_gg_:focus-within .___SMask_1h6ds_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(1, 79, 255, 0.116))}@media (color-gamut:p3){.___SDateRange_1h6ds_gg_ .___SInputMask_1h6ds_gg_:focus-within .___SMask_1h6ds_gg_{background-color:var(--intergalactic-bg-highlight-focus, color(display-p3 0.12361 0.30547 0.96332 / 0.116))}}}.___SDateRange_1h6ds_gg_:focus-within .___SRangeSep_1h6ds_gg_,.___SRangeSep_1h6ds_gg_.__fulfilled_1h6ds_gg_{color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899))}.___SRangeComparatorHeader_1h6ds_gg_{border-bottom:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161));padding:var(--intergalactic-spacing-4x, 16px)}@supports (color:color(display-p3 0 0 0%)){.___SRangeComparatorHeader_1h6ds_gg_{border-bottom:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@media (color-gamut:p3){.___SRangeComparatorHeader_1h6ds_gg_{border-bottom:1px solid var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161))}}}.___SFooter_1h6ds_gg_,.___SRangeCalendar_1h6ds_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___SFooter_1h6ds_gg_{border-top:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@supports (color:color(display-p3 0 0 0%)){.___SFooter_1h6ds_gg_{border-top:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@media (color-gamut:p3){.___SFooter_1h6ds_gg_{border-top:1px solid var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161))}}}.___SPeriodsList_1h6ds_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___STooltip_1h6ds_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SCompareToggle_1h6ds_gg_{white-space:nowrap}@media (prefers-reduced-motion){.___SInputMask_1h6ds_gg_{transition:none}}",
|
|
33
30
|
/*__inner_css_end__*/
|
|
34
|
-
"
|
|
31
|
+
"1h6ds_gg_"
|
|
35
32
|
), /*__reshadow_css_end__*/
|
|
36
33
|
{
|
|
37
|
-
"__SHeader": "
|
|
38
|
-
"__STitle": "
|
|
39
|
-
"__SToday": "
|
|
40
|
-
"__SPeriod": "
|
|
41
|
-
"__SButton": "
|
|
42
|
-
"__SInner": "
|
|
43
|
-
"__SInputMask": "
|
|
44
|
-
"_animationsDisabled": "
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"__SDateRange": "
|
|
55
|
-
"_noHumanizedDate": "
|
|
56
|
-
"__SRangeSep": "
|
|
57
|
-
"_fulfilled": "
|
|
58
|
-
"__SRangeComparatorHeader": "
|
|
59
|
-
"__SRangeCalendar": "
|
|
60
|
-
"__SFooter": "
|
|
61
|
-
"__SPeriodsList": "
|
|
62
|
-
"__STooltip": "
|
|
63
|
-
"__SCompareToggle": "
|
|
64
|
-
"__SPopper": "
|
|
34
|
+
"__SHeader": "___SHeader_1h6ds_gg_",
|
|
35
|
+
"__STitle": "___STitle_1h6ds_gg_",
|
|
36
|
+
"__SToday": "___SToday_1h6ds_gg_",
|
|
37
|
+
"__SPeriod": "___SPeriod_1h6ds_gg_",
|
|
38
|
+
"__SButton": "___SButton_1h6ds_gg_",
|
|
39
|
+
"__SInner": "___SInner_1h6ds_gg_",
|
|
40
|
+
"__SInputMask": "___SInputMask_1h6ds_gg_",
|
|
41
|
+
"_animationsDisabled": "__animationsDisabled_1h6ds_gg_",
|
|
42
|
+
"__SIndicator": "___SIndicator_1h6ds_gg_",
|
|
43
|
+
"__SRangeIndicator": "___SRangeIndicator_1h6ds_gg_",
|
|
44
|
+
"_range_value": "_range_value_1h6ds_gg_",
|
|
45
|
+
"_range_compare": "_range_compare_1h6ds_gg_",
|
|
46
|
+
"_disabled": "__disabled_1h6ds_gg_",
|
|
47
|
+
"__SHumanizedDate": "___SHumanizedDate_1h6ds_gg_",
|
|
48
|
+
"__SMask": "___SMask_1h6ds_gg_",
|
|
49
|
+
"__SSingleDateInput": "___SSingleDateInput_1h6ds_gg_",
|
|
50
|
+
"__SValue": "___SValue_1h6ds_gg_",
|
|
51
|
+
"__SDateRange": "___SDateRange_1h6ds_gg_",
|
|
52
|
+
"_noHumanizedDate": "__noHumanizedDate_1h6ds_gg_",
|
|
53
|
+
"__SRangeSep": "___SRangeSep_1h6ds_gg_",
|
|
54
|
+
"_fulfilled": "__fulfilled_1h6ds_gg_",
|
|
55
|
+
"__SRangeComparatorHeader": "___SRangeComparatorHeader_1h6ds_gg_",
|
|
56
|
+
"__SRangeCalendar": "___SRangeCalendar_1h6ds_gg_",
|
|
57
|
+
"__SFooter": "___SFooter_1h6ds_gg_",
|
|
58
|
+
"__SPeriodsList": "___SPeriodsList_1h6ds_gg_",
|
|
59
|
+
"__STooltip": "___STooltip_1h6ds_gg_",
|
|
60
|
+
"__SCompareToggle": "___SCompareToggle_1h6ds_gg_",
|
|
61
|
+
"__SPopper": "___SPopper_1h6ds_gg_"
|
|
65
62
|
})
|
|
66
63
|
);
|
|
67
64
|
var defaultAllowedParts = {
|
|
@@ -70,24 +67,16 @@ var defaultAllowedParts = {
|
|
|
70
67
|
day: true
|
|
71
68
|
};
|
|
72
69
|
var exampleDate = new Date(2e3, 4, 29);
|
|
73
|
-
var InputTriggerRoot = /* @__PURE__ */ function(_Component) {
|
|
74
|
-
_inherits(InputTriggerRoot2, _Component);
|
|
75
|
-
var _super = _createSuper(InputTriggerRoot2);
|
|
70
|
+
var InputTriggerRoot = /* @__PURE__ */ (function(_Component) {
|
|
76
71
|
function InputTriggerRoot2() {
|
|
77
72
|
_classCallCheck(this, InputTriggerRoot2);
|
|
78
|
-
return
|
|
73
|
+
return _callSuper(this, InputTriggerRoot2, arguments);
|
|
79
74
|
}
|
|
80
|
-
|
|
75
|
+
_inherits(InputTriggerRoot2, _Component);
|
|
76
|
+
return _createClass(InputTriggerRoot2, [{
|
|
81
77
|
key: "getSingleDateInputProps",
|
|
82
78
|
value: function getSingleDateInputProps() {
|
|
83
|
-
var _this$asProps = this.asProps;
|
|
84
|
-
_this$asProps.children;
|
|
85
|
-
var id = _this$asProps.id;
|
|
86
|
-
_this$asProps.role;
|
|
87
|
-
var ariaHasPopup = _this$asProps["aria-haspopup"];
|
|
88
|
-
_this$asProps["aria-label"];
|
|
89
|
-
_this$asProps.style;
|
|
90
|
-
var otherProps = _objectWithoutProperties(_this$asProps, _excluded);
|
|
79
|
+
var _this$asProps = this.asProps, _children = _this$asProps.children, id = _this$asProps.id, _role = _this$asProps.role, ariaHasPopup = _this$asProps["aria-haspopup"], _ariaLabel = _this$asProps["aria-label"], _style = _this$asProps.style, otherProps = _objectWithoutProperties(_this$asProps, _excluded);
|
|
91
80
|
return _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
92
81
|
ariaHasPopup,
|
|
93
82
|
inputId: id
|
|
@@ -96,14 +85,7 @@ var InputTriggerRoot = /* @__PURE__ */ function(_Component) {
|
|
|
96
85
|
}, {
|
|
97
86
|
key: "getDateRangeProps",
|
|
98
87
|
value: function getDateRangeProps() {
|
|
99
|
-
var _this$asProps2 = this.asProps;
|
|
100
|
-
_this$asProps2.children;
|
|
101
|
-
var id = _this$asProps2.id;
|
|
102
|
-
_this$asProps2.role;
|
|
103
|
-
var ariaHasPopup = _this$asProps2["aria-haspopup"];
|
|
104
|
-
_this$asProps2["aria-label"];
|
|
105
|
-
_this$asProps2.style;
|
|
106
|
-
var otherProps = _objectWithoutProperties(_this$asProps2, _excluded2);
|
|
88
|
+
var _this$asProps2 = this.asProps, _children = _this$asProps2.children, id = _this$asProps2.id, _rolw = _this$asProps2.role, ariaHasPopup = _this$asProps2["aria-haspopup"], _ariaLabel = _this$asProps2["aria-label"], _style = _this$asProps2.style, otherProps = _objectWithoutProperties(_this$asProps2, _excluded2);
|
|
107
89
|
return _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
108
90
|
ariaHasPopup,
|
|
109
91
|
inputId: id
|
|
@@ -115,52 +97,50 @@ var InputTriggerRoot = /* @__PURE__ */ function(_Component) {
|
|
|
115
97
|
var _ref = this.asProps, _ref8;
|
|
116
98
|
var SInputTrigger = Box;
|
|
117
99
|
var _this$asProps3 = this.asProps, Children = _this$asProps3.Children, style2 = _this$asProps3.style, getI18nText = _this$asProps3.getI18nText;
|
|
118
|
-
return _ref8 = sstyled
|
|
100
|
+
return _ref8 = sstyled(style2), /* @__PURE__ */ React.createElement(SInputTrigger, _ref8.cn("SInputTrigger", _objectSpread({}, assignProps({
|
|
119
101
|
"aria-label": getI18nText("input"),
|
|
120
102
|
"__excludeProps": ["onChange", "value", "role", "id"]
|
|
121
103
|
}, _ref))), /* @__PURE__ */ React.createElement(Children, _ref8.cn("Children", {})));
|
|
122
104
|
}
|
|
123
105
|
}]);
|
|
124
|
-
|
|
125
|
-
}(Component);
|
|
106
|
+
})(Component);
|
|
126
107
|
_defineProperty(InputTriggerRoot, "displayName", "InputTrigger");
|
|
127
108
|
_defineProperty(InputTriggerRoot, "style", style);
|
|
128
109
|
_defineProperty(InputTriggerRoot, "defaultProps", {
|
|
129
110
|
duration: 300,
|
|
130
111
|
popoverVisible: true
|
|
131
112
|
});
|
|
132
|
-
var SingleDateInputRoot = /* @__PURE__ */ function(_Component2) {
|
|
133
|
-
_inherits(SingleDateInputRoot2, _Component2);
|
|
134
|
-
var _super2 = _createSuper(SingleDateInputRoot2);
|
|
113
|
+
var SingleDateInputRoot = /* @__PURE__ */ (function(_Component2) {
|
|
135
114
|
function SingleDateInputRoot2() {
|
|
136
115
|
var _this;
|
|
137
116
|
_classCallCheck(this, SingleDateInputRoot2);
|
|
138
117
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
139
118
|
args[_key] = arguments[_key];
|
|
140
119
|
}
|
|
141
|
-
_this =
|
|
142
|
-
_defineProperty(
|
|
120
|
+
_this = _callSuper(this, SingleDateInputRoot2, [].concat(args));
|
|
121
|
+
_defineProperty(_this, "state", {
|
|
143
122
|
errorText: null,
|
|
144
123
|
showError: false,
|
|
145
124
|
focused: false
|
|
146
125
|
});
|
|
147
|
-
_defineProperty(
|
|
126
|
+
_defineProperty(_this, "handleFocus", function() {
|
|
148
127
|
_this.setState({
|
|
149
128
|
focused: true
|
|
150
129
|
});
|
|
151
130
|
});
|
|
152
|
-
_defineProperty(
|
|
131
|
+
_defineProperty(_this, "handleBlur", function() {
|
|
153
132
|
_this.setState({
|
|
154
133
|
focused: false
|
|
155
134
|
});
|
|
156
135
|
});
|
|
157
|
-
_defineProperty(
|
|
136
|
+
_defineProperty(_this, "handleInputMaskPipeBlock", function(value) {
|
|
158
137
|
if (value === _this.asProps.disabledDateInputAttempt) return;
|
|
159
138
|
_this.handlers.disabledDateInputAttempt(value);
|
|
160
139
|
});
|
|
161
140
|
return _this;
|
|
162
141
|
}
|
|
163
|
-
|
|
142
|
+
_inherits(SingleDateInputRoot2, _Component2);
|
|
143
|
+
return _createClass(SingleDateInputRoot2, [{
|
|
164
144
|
key: "uncontrolledProps",
|
|
165
145
|
value: function uncontrolledProps() {
|
|
166
146
|
var _this2 = this;
|
|
@@ -192,18 +172,14 @@ var SingleDateInputRoot = /* @__PURE__ */ function(_Component2) {
|
|
|
192
172
|
}, {
|
|
193
173
|
key: "getMaskedInputProps",
|
|
194
174
|
value: function getMaskedInputProps() {
|
|
195
|
-
var _this$asProps4 = this.asProps, value = _this$asProps4.value, onChange = _this$asProps4.onChange, onDisplayedPeriodChange = _this$asProps4.onDisplayedPeriodChange, locale = _this$asProps4.locale;
|
|
196
|
-
_this$asProps4.w;
|
|
197
|
-
_this$asProps4.ariaHasPopup;
|
|
198
|
-
_this$asProps4.showError;
|
|
199
|
-
var otherProps = _objectWithoutProperties(_this$asProps4, _excluded3);
|
|
175
|
+
var _this$asProps4 = this.asProps, value = _this$asProps4.value, onChange = _this$asProps4.onChange, onDisplayedPeriodChange = _this$asProps4.onDisplayedPeriodChange, locale = _this$asProps4.locale, _w = _this$asProps4.w, _ariaHasPopup = _this$asProps4.ariaHasPopup, _showError = _this$asProps4.showError, neighborLocation = _this$asProps4.neighborLocation, otherProps = _objectWithoutProperties(_this$asProps4, _excluded3);
|
|
200
176
|
return _objectSpread({
|
|
201
|
-
date: value,
|
|
202
|
-
onDateChange: onChange,
|
|
177
|
+
"date": value,
|
|
178
|
+
"onDateChange": onChange,
|
|
203
179
|
onDisplayedPeriodChange,
|
|
204
180
|
locale,
|
|
205
181
|
"aria-haspopup": "true",
|
|
206
|
-
onMaskPipeBlock: this.handleInputMaskPipeBlock
|
|
182
|
+
"onMaskPipeBlock": this.handleInputMaskPipeBlock
|
|
207
183
|
}, otherProps);
|
|
208
184
|
}
|
|
209
185
|
}, {
|
|
@@ -214,7 +190,7 @@ var SingleDateInputRoot = /* @__PURE__ */ function(_Component2) {
|
|
|
214
190
|
var _this$state = this.state, errorText = _this$state.errorText, showErrorState = _this$state.showError, focused = _this$state.focused;
|
|
215
191
|
var showError = showErrorState && showErrorProps;
|
|
216
192
|
var SSingleDateInput = InputMask;
|
|
217
|
-
return _ref9 = sstyled
|
|
193
|
+
return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SSingleDateInput, _ref9.cn("SSingleDateInput", _objectSpread({}, assignProps({
|
|
218
194
|
"tag": Tooltip,
|
|
219
195
|
"placement": "top-start",
|
|
220
196
|
"title": errorText,
|
|
@@ -228,8 +204,7 @@ var SingleDateInputRoot = /* @__PURE__ */ function(_Component2) {
|
|
|
228
204
|
}, _ref2))), /* @__PURE__ */ React.createElement(NeighborLocation, _ref9.cn("NeighborLocation", {}), /* @__PURE__ */ React.createElement(Children, _ref9.cn("Children", {}))));
|
|
229
205
|
}
|
|
230
206
|
}]);
|
|
231
|
-
|
|
232
|
-
}(Component);
|
|
207
|
+
})(Component);
|
|
233
208
|
_defineProperty(SingleDateInputRoot, "displayName", "SingleDateInput");
|
|
234
209
|
_defineProperty(SingleDateInputRoot, "style", style);
|
|
235
210
|
_defineProperty(SingleDateInputRoot, "defaultProps", {
|
|
@@ -239,25 +214,23 @@ _defineProperty(SingleDateInputRoot, "defaultProps", {
|
|
|
239
214
|
defaultDisabledDateInputAttempt: false,
|
|
240
215
|
showError: true
|
|
241
216
|
});
|
|
242
|
-
var DateRangeRoot = /* @__PURE__ */ function(_Component3) {
|
|
243
|
-
_inherits(DateRangeRoot2, _Component3);
|
|
244
|
-
var _super3 = _createSuper(DateRangeRoot2);
|
|
217
|
+
var DateRangeRoot = /* @__PURE__ */ (function(_Component3) {
|
|
245
218
|
function DateRangeRoot2() {
|
|
246
219
|
var _this3;
|
|
247
220
|
_classCallCheck(this, DateRangeRoot2);
|
|
248
221
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
249
222
|
args[_key2] = arguments[_key2];
|
|
250
223
|
}
|
|
251
|
-
_this3 =
|
|
252
|
-
_defineProperty(
|
|
224
|
+
_this3 = _callSuper(this, DateRangeRoot2, [].concat(args));
|
|
225
|
+
_defineProperty(_this3, "state", {
|
|
253
226
|
containerFocused: false,
|
|
254
227
|
errorText: null,
|
|
255
228
|
showError: false,
|
|
256
229
|
lastChangedInput: "from"
|
|
257
230
|
});
|
|
258
|
-
_defineProperty(
|
|
259
|
-
_defineProperty(
|
|
260
|
-
_defineProperty(
|
|
231
|
+
_defineProperty(_this3, "fromRef", /* @__PURE__ */ React.createRef());
|
|
232
|
+
_defineProperty(_this3, "toRef", /* @__PURE__ */ React.createRef());
|
|
233
|
+
_defineProperty(_this3, "handleFromChange", function(value, event) {
|
|
261
234
|
var _this3$asProps$value$, _this3$asProps$value, _this3$asProps$value$2, _this3$asProps$value2;
|
|
262
235
|
var onChange = _this3.asProps.onChange;
|
|
263
236
|
var prevValue = [(_this3$asProps$value$ = (_this3$asProps$value = _this3.asProps.value) === null || _this3$asProps$value === void 0 ? void 0 : _this3$asProps$value[0]) !== null && _this3$asProps$value$ !== void 0 ? _this3$asProps$value$ : null, (_this3$asProps$value$2 = (_this3$asProps$value2 = _this3.asProps.value) === null || _this3$asProps$value2 === void 0 ? void 0 : _this3$asProps$value2[1]) !== null && _this3$asProps$value$2 !== void 0 ? _this3$asProps$value$2 : null];
|
|
@@ -271,13 +244,13 @@ var DateRangeRoot = /* @__PURE__ */ function(_Component3) {
|
|
|
271
244
|
}, 0);
|
|
272
245
|
}
|
|
273
246
|
});
|
|
274
|
-
_defineProperty(
|
|
247
|
+
_defineProperty(_this3, "handleToChange", function(value, event) {
|
|
275
248
|
var _this3$asProps$value$3, _this3$asProps$value3, _this3$asProps$value$4, _this3$asProps$value4;
|
|
276
249
|
var onChange = _this3.asProps.onChange;
|
|
277
250
|
var prevValue = [(_this3$asProps$value$3 = (_this3$asProps$value3 = _this3.asProps.value) === null || _this3$asProps$value3 === void 0 ? void 0 : _this3$asProps$value3[0]) !== null && _this3$asProps$value$3 !== void 0 ? _this3$asProps$value$3 : null, (_this3$asProps$value$4 = (_this3$asProps$value4 = _this3.asProps.value) === null || _this3$asProps$value4 === void 0 ? void 0 : _this3$asProps$value4[1]) !== null && _this3$asProps$value$4 !== void 0 ? _this3$asProps$value$4 : null];
|
|
278
251
|
onChange([prevValue[0], value], event);
|
|
279
252
|
});
|
|
280
|
-
_defineProperty(
|
|
253
|
+
_defineProperty(_this3, "handleFromKeydown", function(event) {
|
|
281
254
|
if (!_this3.toRef.current) return;
|
|
282
255
|
if (!_this3.fromRef.current) return;
|
|
283
256
|
_this3.setState({
|
|
@@ -290,7 +263,7 @@ var DateRangeRoot = /* @__PURE__ */ function(_Component3) {
|
|
|
290
263
|
}, 0);
|
|
291
264
|
}
|
|
292
265
|
});
|
|
293
|
-
_defineProperty(
|
|
266
|
+
_defineProperty(_this3, "handleToKeydown", function(event) {
|
|
294
267
|
if (!_this3.toRef.current) return;
|
|
295
268
|
if (!_this3.fromRef.current) return;
|
|
296
269
|
_this3.setState({
|
|
@@ -311,21 +284,21 @@ var DateRangeRoot = /* @__PURE__ */ function(_Component3) {
|
|
|
311
284
|
}, 0);
|
|
312
285
|
}
|
|
313
286
|
});
|
|
314
|
-
_defineProperty(
|
|
287
|
+
_defineProperty(_this3, "handleInputMaskPipeBlock", function(value) {
|
|
315
288
|
if (value === _this3.asProps.disabledDateInputAttempt) return;
|
|
316
289
|
_this3.handlers.disabledDateInputAttempt(value);
|
|
317
290
|
});
|
|
318
|
-
_defineProperty(
|
|
291
|
+
_defineProperty(_this3, "handleFocus", function() {
|
|
319
292
|
_this3.setState({
|
|
320
293
|
containerFocused: true
|
|
321
294
|
});
|
|
322
295
|
});
|
|
323
|
-
_defineProperty(
|
|
296
|
+
_defineProperty(_this3, "handleBlur", function() {
|
|
324
297
|
_this3.setState({
|
|
325
298
|
containerFocused: false
|
|
326
299
|
});
|
|
327
300
|
});
|
|
328
|
-
_defineProperty(
|
|
301
|
+
_defineProperty(_this3, "updateDisabledDateInputAttempt", function(value) {
|
|
329
302
|
var disabledDates = _this3.asProps.disabledDates;
|
|
330
303
|
var invalid = false;
|
|
331
304
|
if (value) {
|
|
@@ -343,7 +316,8 @@ var DateRangeRoot = /* @__PURE__ */ function(_Component3) {
|
|
|
343
316
|
});
|
|
344
317
|
return _this3;
|
|
345
318
|
}
|
|
346
|
-
|
|
319
|
+
_inherits(DateRangeRoot2, _Component3);
|
|
320
|
+
return _createClass(DateRangeRoot2, [{
|
|
347
321
|
key: "uncontrolledProps",
|
|
348
322
|
value: function uncontrolledProps() {
|
|
349
323
|
var _this4 = this;
|
|
@@ -381,44 +355,39 @@ var DateRangeRoot = /* @__PURE__ */ function(_Component3) {
|
|
|
381
355
|
}, {
|
|
382
356
|
key: "getFromMaskedInputProps",
|
|
383
357
|
value: function getFromMaskedInputProps() {
|
|
384
|
-
var _this$asProps6 = this.asProps, value = _this$asProps6.value, locale = _this$asProps6.locale, onDisplayedPeriodChange = _this$asProps6.onDisplayedPeriodChange, ariaHasPopup = _this$asProps6.ariaHasPopup;
|
|
385
|
-
_this$asProps6.showError;
|
|
386
|
-
var otherProps = _objectWithoutProperties(_this$asProps6, _excluded4);
|
|
358
|
+
var _this$asProps6 = this.asProps, value = _this$asProps6.value, locale = _this$asProps6.locale, onDisplayedPeriodChange = _this$asProps6.onDisplayedPeriodChange, ariaHasPopup = _this$asProps6.ariaHasPopup, _showError = _this$asProps6.showError, neighborLocation = _this$asProps6.neighborLocation, otherProps = _objectWithoutProperties(_this$asProps6, _excluded4);
|
|
387
359
|
return assignProps$1({
|
|
388
|
-
ref: this.fromRef,
|
|
389
|
-
date: value === null || value === void 0 ? void 0 : value[0],
|
|
390
|
-
onDateChange: this.handleFromChange,
|
|
391
|
-
onKeyDown: this.handleFromKeydown,
|
|
360
|
+
"ref": this.fromRef,
|
|
361
|
+
"date": value === null || value === void 0 ? void 0 : value[0],
|
|
362
|
+
"onDateChange": this.handleFromChange,
|
|
363
|
+
"onKeyDown": this.handleFromKeydown,
|
|
392
364
|
locale,
|
|
393
|
-
flex: 1,
|
|
365
|
+
"flex": 1,
|
|
394
366
|
onDisplayedPeriodChange,
|
|
395
367
|
"aria-haspopup": ariaHasPopup,
|
|
396
|
-
onMaskPipeBlock: this.handleInputMaskPipeBlock,
|
|
397
|
-
containerFocused: this.state.containerFocused
|
|
368
|
+
"onMaskPipeBlock": this.handleInputMaskPipeBlock,
|
|
369
|
+
"containerFocused": this.state.containerFocused
|
|
398
370
|
}, otherProps);
|
|
399
371
|
}
|
|
400
372
|
}, {
|
|
401
373
|
key: "getToMaskedInputProps",
|
|
402
374
|
value: function getToMaskedInputProps() {
|
|
403
|
-
var _this$asProps7 = this.asProps, value = _this$asProps7.value, locale = _this$asProps7.locale, onDisplayedPeriodChange = _this$asProps7.onDisplayedPeriodChange, ariaHasPopup = _this$asProps7.ariaHasPopup;
|
|
404
|
-
_this$asProps7.inputId;
|
|
405
|
-
_this$asProps7.showError;
|
|
406
|
-
var otherProps = _objectWithoutProperties(_this$asProps7, _excluded5);
|
|
375
|
+
var _this$asProps7 = this.asProps, value = _this$asProps7.value, locale = _this$asProps7.locale, onDisplayedPeriodChange = _this$asProps7.onDisplayedPeriodChange, ariaHasPopup = _this$asProps7.ariaHasPopup, _inputId = _this$asProps7.inputId, _showError = _this$asProps7.showError, neighborLocation = _this$asProps7.neighborLocation, otherProps = _objectWithoutProperties(_this$asProps7, _excluded5);
|
|
407
376
|
var ariaLabel = this.asProps.getI18nText("toDate", {
|
|
408
377
|
date: this.asProps.getI18nText("input")
|
|
409
378
|
});
|
|
410
379
|
return assignProps$1({
|
|
411
|
-
ref: this.toRef,
|
|
412
|
-
date: value === null || value === void 0 ? void 0 : value[1],
|
|
413
|
-
onDateChange: this.handleToChange,
|
|
414
|
-
onKeyDown: this.handleToKeydown,
|
|
380
|
+
"ref": this.toRef,
|
|
381
|
+
"date": value === null || value === void 0 ? void 0 : value[1],
|
|
382
|
+
"onDateChange": this.handleToChange,
|
|
383
|
+
"onKeyDown": this.handleToKeydown,
|
|
415
384
|
locale,
|
|
416
|
-
flex: 1,
|
|
385
|
+
"flex": 1,
|
|
417
386
|
onDisplayedPeriodChange,
|
|
418
387
|
"aria-label": ariaLabel,
|
|
419
388
|
"aria-haspopup": ariaHasPopup,
|
|
420
|
-
onMaskPipeBlock: this.handleInputMaskPipeBlock,
|
|
421
|
-
containerFocused: this.state.containerFocused
|
|
389
|
+
"onMaskPipeBlock": this.handleInputMaskPipeBlock,
|
|
390
|
+
"containerFocused": this.state.containerFocused
|
|
422
391
|
}, otherProps);
|
|
423
392
|
}
|
|
424
393
|
}, {
|
|
@@ -444,12 +413,12 @@ var DateRangeRoot = /* @__PURE__ */ function(_Component3) {
|
|
|
444
413
|
}, {
|
|
445
414
|
key: "render",
|
|
446
415
|
value: function render() {
|
|
447
|
-
var _ref3 = this.asProps,
|
|
416
|
+
var _ref3 = this.asProps, _ref0;
|
|
448
417
|
var SDateRange = InputMask;
|
|
449
418
|
var _this$asProps8 = this.asProps, Children = _this$asProps8.Children, styles = _this$asProps8.styles, w = _this$asProps8.w, state = _this$asProps8.state, showErrorProps = _this$asProps8.showError, popoverVisible = _this$asProps8.popoverVisible;
|
|
450
419
|
var _this$state2 = this.state, errorText = _this$state2.errorText, lastChangedInput = _this$state2.lastChangedInput, showErrorState = _this$state2.showError, containerFocused = _this$state2.containerFocused;
|
|
451
420
|
var showError = showErrorState && showErrorProps;
|
|
452
|
-
return
|
|
421
|
+
return _ref0 = sstyled(styles), /* @__PURE__ */ React.createElement(SDateRange, _ref0.cn("SDateRange", _objectSpread({}, assignProps({
|
|
453
422
|
"tag": Tooltip,
|
|
454
423
|
"ignorePortalsStacking": true,
|
|
455
424
|
"placement": lastChangedInput === "to" ? "top-end" : "top-start",
|
|
@@ -461,11 +430,10 @@ var DateRangeRoot = /* @__PURE__ */ function(_Component3) {
|
|
|
461
430
|
"w": w,
|
|
462
431
|
"onFocus": this.handleFocus,
|
|
463
432
|
"onBlur": this.handleBlur
|
|
464
|
-
}, _ref3))), /* @__PURE__ */ React.createElement(Children,
|
|
433
|
+
}, _ref3))), /* @__PURE__ */ React.createElement(Children, _ref0.cn("Children", {})));
|
|
465
434
|
}
|
|
466
435
|
}]);
|
|
467
|
-
|
|
468
|
-
}(Component);
|
|
436
|
+
})(Component);
|
|
469
437
|
_defineProperty(DateRangeRoot, "displayName", "DateRange");
|
|
470
438
|
_defineProperty(DateRangeRoot, "style", style);
|
|
471
439
|
_defineProperty(DateRangeRoot, "defaultProps", {
|
|
@@ -475,48 +443,45 @@ _defineProperty(DateRangeRoot, "defaultProps", {
|
|
|
475
443
|
defaultDisabledDateInputAttempt: false,
|
|
476
444
|
showError: true
|
|
477
445
|
});
|
|
478
|
-
|
|
479
|
-
var _ref4 = arguments[0],
|
|
446
|
+
function FromMaskedInput(props) {
|
|
447
|
+
var _ref4 = arguments[0], _ref1;
|
|
480
448
|
var SFromMaskedInput = MaskedInput;
|
|
481
449
|
var getI18nText = props.getI18nText;
|
|
482
|
-
return
|
|
450
|
+
return _ref1 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SFromMaskedInput, _ref1.cn("SFromMaskedInput", _objectSpread({}, assignProps({
|
|
483
451
|
"labelPrefix": getI18nText("fromDatePlaceholder")
|
|
484
452
|
}, _ref4))));
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
var _ref5 = arguments[0],
|
|
453
|
+
}
|
|
454
|
+
function ToMaskedInput(props) {
|
|
455
|
+
var _ref5 = arguments[0], _ref10;
|
|
488
456
|
var SToMaskedInput = MaskedInput;
|
|
489
457
|
var getI18nText = props.getI18nText;
|
|
490
|
-
return
|
|
458
|
+
return _ref10 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SToMaskedInput, _ref10.cn("SToMaskedInput", _objectSpread({}, assignProps({
|
|
491
459
|
"labelPrefix": getI18nText("toDatePlaceholder")
|
|
492
460
|
}, _ref5))));
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
var _ref6 = arguments[0],
|
|
461
|
+
}
|
|
462
|
+
function Indicator(props) {
|
|
463
|
+
var _ref6 = arguments[0], _ref11;
|
|
496
464
|
var SIndicator = InputMask.Addon;
|
|
497
|
-
return
|
|
465
|
+
return _ref11 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SIndicator, _ref11.cn("SIndicator", _objectSpread({}, assignProps({
|
|
498
466
|
"tag": Calendar,
|
|
499
467
|
"aria-hidden": "true",
|
|
500
468
|
"tabIndex": -1
|
|
501
469
|
}, _ref6))));
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
var _ref7 = arguments[0],
|
|
470
|
+
}
|
|
471
|
+
function RangeSep(props) {
|
|
472
|
+
var _ref7 = arguments[0], _ref12;
|
|
505
473
|
var SRangeSep = InputMask.Addon;
|
|
506
|
-
return
|
|
474
|
+
return _ref12 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SRangeSep, _ref12.cn("SRangeSep", _objectSpread({}, assignProps({
|
|
507
475
|
"tag": Flex,
|
|
508
476
|
"alignItems": "center",
|
|
509
477
|
"justifyContent": "center",
|
|
510
478
|
"pl": 0,
|
|
511
479
|
"flex": "0"
|
|
512
480
|
}, _ref7))), "–");
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
var
|
|
516
|
-
var outerValue =
|
|
517
|
-
_ref16.__excludeProps;
|
|
518
|
-
_ref16.Root;
|
|
519
|
-
var otherProps = _objectWithoutProperties(_ref16, _excluded6);
|
|
481
|
+
}
|
|
482
|
+
function MaskedInput(_ref14) {
|
|
483
|
+
var _ref13;
|
|
484
|
+
var outerValue = _ref14.date, onDateChange = _ref14.onDateChange, onDisplayedPeriodChange = _ref14.onDisplayedPeriodChange, locale = _ref14.locale, styles = _ref14.styles, _ref14$parts = _ref14.parts, allowedParts = _ref14$parts === void 0 ? defaultAllowedParts : _ref14$parts, disabledDates = _ref14.disabledDates, forwardRef = _ref14.forwardRef, providedPlaceholders = _ref14.placeholders, _ref14$labelPrefix = _ref14.labelPrefix, labelPrefix = _ref14$labelPrefix === void 0 ? "Date" : _ref14$labelPrefix, onMaskPipeBlock = _ref14.onMaskPipeBlock, containerFocused = _ref14.containerFocused, animationsDisabled = _ref14.animationsDisabled, getI18nText = _ref14.getI18nText, inputId = _ref14.inputId, _ref14$inputRole = _ref14.inputRole, inputRole = _ref14$inputRole === void 0 ? "combobox" : _ref14$inputRole, __excludeProps = _ref14.__excludeProps, _root = _ref14.Root, otherProps = _objectWithoutProperties(_ref14, _excluded6);
|
|
520
485
|
var ref = React.useRef();
|
|
521
486
|
var _React$useState = React.useState(void 0), _React$useState2 = _slicedToArray(_React$useState, 2), width = _React$useState2[0], setWidth = _React$useState2[1];
|
|
522
487
|
var placeholders = React.useMemo(function() {
|
|
@@ -534,7 +499,6 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
534
499
|
throw new Error("InputTrigger placeholder prop should contain fields year, month and day each one with string value of single character length. [see above what was received] (".concat(placeholders, ")"), placeholders);
|
|
535
500
|
}
|
|
536
501
|
var _React$useMemo = React.useMemo(function() {
|
|
537
|
-
var _sep;
|
|
538
502
|
var options = {
|
|
539
503
|
year: "numeric",
|
|
540
504
|
month: "numeric",
|
|
@@ -560,7 +524,7 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
560
524
|
} finally {
|
|
561
525
|
_iterator.f();
|
|
562
526
|
}
|
|
563
|
-
sep2 =
|
|
527
|
+
sep2 = sep2 !== null && sep2 !== void 0 ? sep2 : " ";
|
|
564
528
|
return {
|
|
565
529
|
sep: sep2,
|
|
566
530
|
order: order2
|
|
@@ -620,7 +584,7 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
620
584
|
}
|
|
621
585
|
}
|
|
622
586
|
if (placeholdersOnly) {
|
|
623
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
587
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(null);
|
|
624
588
|
return "";
|
|
625
589
|
}
|
|
626
590
|
var getOffsetTo = function getOffsetTo2(partName2) {
|
|
@@ -653,20 +617,20 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
653
617
|
}
|
|
654
618
|
var year = parsed.year, month = parsed.month, day = parsed.day;
|
|
655
619
|
if (allowedParts.month) {
|
|
656
|
-
if (month[0] !== "_" && parseInt(month[0], 10) > 1) {
|
|
620
|
+
if (month[0] !== "_" && Number.parseInt(month[0], 10) > 1) {
|
|
657
621
|
month = "0".concat(month[0]);
|
|
658
622
|
indexesOfPipedChars.push(getOffsetTo("month"));
|
|
659
623
|
}
|
|
660
624
|
if (month === "00") month = "01";
|
|
661
|
-
if (month[0] !== "_" && month[1] !== "_" && parseInt(month, 10) > 12) return false;
|
|
625
|
+
if (month[0] !== "_" && month[1] !== "_" && Number.parseInt(month, 10) > 12) return false;
|
|
662
626
|
}
|
|
663
627
|
if (allowedParts.day) {
|
|
664
|
-
if (day[0] !== "_" && parseInt(day[0], 10) > 3) {
|
|
628
|
+
if (day[0] !== "_" && Number.parseInt(day[0], 10) > 3) {
|
|
665
629
|
day = "0".concat(day[0]);
|
|
666
630
|
indexesOfPipedChars.push(getOffsetTo("day"));
|
|
667
631
|
}
|
|
668
632
|
if (day === "00") day = "01";
|
|
669
|
-
if (day[0] !== "_" && day[1] !== "_" && parseInt(day, 10) > 31) return false;
|
|
633
|
+
if (day[0] !== "_" && day[1] !== "_" && Number.parseInt(day, 10) > 31) return false;
|
|
670
634
|
}
|
|
671
635
|
year = year.split("").map(function(_char) {
|
|
672
636
|
return _char === "_" ? placeholders.year : _char;
|
|
@@ -683,17 +647,17 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
683
647
|
var fulfilled = yearFulfilled && monthFulfilled && dayFulfilled;
|
|
684
648
|
if (fulfilled) {
|
|
685
649
|
var date = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
686
|
-
var yearParsed = allowedParts.year ? parseInt(year, 10) : 0;
|
|
687
|
-
var monthParsed = allowedParts.month ? parseInt(month, 10) - 1 : 0;
|
|
688
|
-
var dayParsed = allowedParts.day ? parseInt(day, 10) : 1;
|
|
650
|
+
var yearParsed = allowedParts.year ? Number.parseInt(year, 10) : 0;
|
|
651
|
+
var monthParsed = allowedParts.month ? Number.parseInt(month, 10) - 1 : 0;
|
|
652
|
+
var dayParsed = allowedParts.day ? Number.parseInt(day, 10) : 1;
|
|
689
653
|
date.setFullYear(yearParsed, monthParsed, dayParsed);
|
|
690
654
|
if (disabledDates !== null && disabledDates !== void 0 && disabledDates.some(includesDate(dayjs(date), "date"))) {
|
|
691
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
655
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(date);
|
|
692
656
|
return false;
|
|
693
657
|
}
|
|
694
658
|
if (allowedParts.day) {
|
|
695
|
-
if (date.getDate() !== parseInt(day, 10)) {
|
|
696
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
659
|
+
if (date.getDate() !== Number.parseInt(day, 10)) {
|
|
660
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(date);
|
|
697
661
|
return false;
|
|
698
662
|
}
|
|
699
663
|
}
|
|
@@ -712,7 +676,7 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
712
676
|
} finally {
|
|
713
677
|
_iterator4.f();
|
|
714
678
|
}
|
|
715
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
679
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(null);
|
|
716
680
|
return {
|
|
717
681
|
value: result.join(sep),
|
|
718
682
|
indexesOfPipedChars
|
|
@@ -739,9 +703,9 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
739
703
|
var fulfilled = yearFulfilled && monthFulfilled && dayFulfilled;
|
|
740
704
|
if (fulfilled) {
|
|
741
705
|
var date = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
742
|
-
var yearParsed = allowedParts.year ? parseInt(year, 10) : 0;
|
|
743
|
-
var monthParsed = allowedParts.month ? parseInt(month, 10) - 1 : 0;
|
|
744
|
-
var dayParsed = allowedParts.day ? parseInt(day, 10) : 1;
|
|
706
|
+
var yearParsed = allowedParts.year ? Number.parseInt(year, 10) : 0;
|
|
707
|
+
var monthParsed = allowedParts.month ? Number.parseInt(month, 10) - 1 : 0;
|
|
708
|
+
var dayParsed = allowedParts.day ? Number.parseInt(day, 10) : 1;
|
|
745
709
|
date.setFullYear(yearParsed, monthParsed, dayParsed);
|
|
746
710
|
onDateChange(date);
|
|
747
711
|
lastKnownOuterValue.current = {
|
|
@@ -757,9 +721,9 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
757
721
|
}
|
|
758
722
|
if (yearFulfilled && allowedParts.year) {
|
|
759
723
|
var _date = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
760
|
-
_date.setFullYear(parseInt(year, 10));
|
|
724
|
+
_date.setFullYear(Number.parseInt(year, 10));
|
|
761
725
|
if (monthFulfilled && allowedParts.month) {
|
|
762
|
-
_date.setMonth(parseInt(month, 10) - 1);
|
|
726
|
+
_date.setMonth(Number.parseInt(month, 10) - 1);
|
|
763
727
|
}
|
|
764
728
|
onDisplayedPeriodChange(_date);
|
|
765
729
|
}
|
|
@@ -782,12 +746,10 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
782
746
|
return result.join(sep);
|
|
783
747
|
}, [sep, order, placeholders]);
|
|
784
748
|
var aliases = React.useMemo(function() {
|
|
785
|
-
|
|
786
|
-
return _ref17 = {}, _defineProperty(_ref17, placeholders.year, /\d/), _defineProperty(_ref17, placeholders.month, /\d/), _defineProperty(_ref17, placeholders.day, /\d/), _ref17;
|
|
749
|
+
return _defineProperty(_defineProperty(_defineProperty({}, placeholders.year, /\d/), placeholders.month, /\d/), placeholders.day, /\d/);
|
|
787
750
|
}, [placeholders]);
|
|
788
751
|
var maskOnlySymbols = React.useMemo(function() {
|
|
789
|
-
|
|
790
|
-
return _ref18 = {}, _defineProperty(_ref18, placeholders.year, true), _defineProperty(_ref18, placeholders.month, true), _defineProperty(_ref18, placeholders.day, true), _defineProperty(_ref18, sep, true), _ref18;
|
|
752
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, placeholders.year, true), placeholders.month, true), placeholders.day, true), sep, true);
|
|
791
753
|
}, [sep, placeholders]);
|
|
792
754
|
var humanizedDate = React.useMemo(function() {
|
|
793
755
|
var outerDate = outerValue;
|
|
@@ -810,8 +772,8 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
810
772
|
var computedStyle = window.getComputedStyle(ref.current);
|
|
811
773
|
var typographyRelatedStyles = ["height", "font-size", "font-family", "font-weight", "font-style", "line-height", "letter-spacing", "text-transform", "word-spacing"];
|
|
812
774
|
for (var _i2 = 0, _typographyRelatedSty = typographyRelatedStyles; _i2 < _typographyRelatedSty.length; _i2++) {
|
|
813
|
-
var
|
|
814
|
-
measureSpan.style[
|
|
775
|
+
var _style2 = _typographyRelatedSty[_i2];
|
|
776
|
+
measureSpan.style[_style2] = computedStyle[_style2];
|
|
815
777
|
}
|
|
816
778
|
measureSpan.style.position = "absolute";
|
|
817
779
|
measureSpan.style.visibility = "hidden";
|
|
@@ -819,7 +781,7 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
819
781
|
for (var _i3 = 0, _stringsToMeasure = stringsToMeasure; _i3 < _stringsToMeasure.length; _i3++) {
|
|
820
782
|
var string = _stringsToMeasure[_i3];
|
|
821
783
|
measureSpan.innerHTML = string;
|
|
822
|
-
widths.push(measureSpan.
|
|
784
|
+
widths.push(Math.ceil(measureSpan.getBoundingClientRect().width));
|
|
823
785
|
}
|
|
824
786
|
measureSpan.remove();
|
|
825
787
|
var maxWidth = Math.max.apply(Math, widths);
|
|
@@ -837,19 +799,19 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
837
799
|
var focused = containerFocused !== null && containerFocused !== void 0 ? containerFocused : innerFocused;
|
|
838
800
|
var handleFocus = React.useCallback(function(event) {
|
|
839
801
|
var _otherProps$onFocus;
|
|
840
|
-
(_otherProps$onFocus = otherProps.onFocus) === null || _otherProps$onFocus === void 0
|
|
802
|
+
(_otherProps$onFocus = otherProps.onFocus) === null || _otherProps$onFocus === void 0 || _otherProps$onFocus.call(otherProps, event);
|
|
841
803
|
setInnerFocused(true);
|
|
842
804
|
}, []);
|
|
843
805
|
var handleBlur = React.useCallback(function(event) {
|
|
844
806
|
var _otherProps$onBlur;
|
|
845
|
-
(_otherProps$onBlur = otherProps.onBlur) === null || _otherProps$onBlur === void 0
|
|
807
|
+
(_otherProps$onBlur = otherProps.onBlur) === null || _otherProps$onBlur === void 0 || _otherProps$onBlur.call(otherProps, event);
|
|
846
808
|
setInnerFocused(false);
|
|
847
809
|
}, []);
|
|
848
810
|
useEnhancedEffect(function() {
|
|
849
811
|
if (focused) return;
|
|
850
812
|
setAppliedWidth(width);
|
|
851
813
|
}, [width, focused]);
|
|
852
|
-
return
|
|
814
|
+
return _ref13 = sstyled(styles), /* @__PURE__ */ React.createElement(InputMask.Value, _extends({
|
|
853
815
|
"aria-label": labelPrefix,
|
|
854
816
|
title: mask,
|
|
855
817
|
mask,
|
|
@@ -871,8 +833,8 @@ var MaskedInput = function MaskedInput2(_ref16) {
|
|
|
871
833
|
animationsDisabled,
|
|
872
834
|
inputRole,
|
|
873
835
|
inputMode: "numeric"
|
|
874
|
-
}), humanizedDate && /* @__PURE__ */ React.createElement(SHumanizedDate,
|
|
875
|
-
}
|
|
836
|
+
}), humanizedDate && /* @__PURE__ */ React.createElement(SHumanizedDate, _ref13.cn("SHumanizedDate", {}), humanizedDate));
|
|
837
|
+
}
|
|
876
838
|
var SingleDateInput = createComponent(SingleDateInputRoot, {
|
|
877
839
|
Indicator,
|
|
878
840
|
MaskedInput
|