@semcore/date-picker 4.58.0-prerelease.1 → 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 +19 -21
- package/lib/cjs/style/date-picker.shadow.css +7 -8
- 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 +19 -21
- package/lib/es6/style/date-picker.shadow.css +7 -8
- 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 +19 -21
- package/lib/esm/style/date-picker.shadow.css +7 -8
- 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,15 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
4
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
6
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
7
6
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
8
7
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
8
|
+
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
9
9
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
10
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
11
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
12
|
-
import { sstyled as _sstyled } from "@semcore/
|
|
11
|
+
import { sstyled as _sstyled } from "@semcore/core";
|
|
13
12
|
import { assignProps as _assignProps7 } from "@semcore/core";
|
|
14
13
|
import { assignProps as _assignProps6 } from "@semcore/core";
|
|
15
14
|
import { assignProps as _assignProps5 } from "@semcore/core";
|
|
@@ -19,56 +18,55 @@ import { assignProps as _assignProps2 } from "@semcore/core";
|
|
|
19
18
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
20
19
|
var _excluded = ["children", "id", "role", "aria-haspopup", "aria-label", "style"],
|
|
21
20
|
_excluded2 = ["children", "id", "role", "aria-haspopup", "aria-label", "style"],
|
|
22
|
-
_excluded3 = ["value", "onChange", "onDisplayedPeriodChange", "locale", "w", "ariaHasPopup", "showError"],
|
|
23
|
-
_excluded4 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "showError"],
|
|
24
|
-
_excluded5 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "inputId", "showError"],
|
|
21
|
+
_excluded3 = ["value", "onChange", "onDisplayedPeriodChange", "locale", "w", "ariaHasPopup", "showError", "neighborLocation"],
|
|
22
|
+
_excluded4 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "showError", "neighborLocation"],
|
|
23
|
+
_excluded5 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "inputId", "showError", "neighborLocation"],
|
|
25
24
|
_excluded6 = ["date", "onDateChange", "onDisplayedPeriodChange", "locale", "styles", "parts", "disabledDates", "forwardRef", "placeholders", "labelPrefix", "onMaskPipeBlock", "containerFocused", "animationsDisabled", "getI18nText", "inputId", "inputRole", "__excludeProps", "Root"];
|
|
26
|
-
import
|
|
25
|
+
import { NeighborLocation, Flex, Box } from '@semcore/base-components';
|
|
27
26
|
import BaseTrigger from '@semcore/base-trigger';
|
|
27
|
+
import { createComponent, Root, sstyled, Component } from '@semcore/core';
|
|
28
|
+
import assignProps from '@semcore/core/lib/utils/assignProps';
|
|
29
|
+
import useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';
|
|
30
|
+
import Calendar from '@semcore/icon/Calendar/m';
|
|
28
31
|
import InputMask from '@semcore/input-mask';
|
|
29
32
|
import Tooltip from '@semcore/tooltip';
|
|
30
|
-
import { Flex, Box } from '@semcore/flex-box';
|
|
31
|
-
import Calendar from '@semcore/icon/Calendar/m';
|
|
32
|
-
import createComponent, { Root, sstyled, Component } from '@semcore/core';
|
|
33
|
-
import NeighborLocation from '@semcore/neighbor-location';
|
|
34
|
-
import { datesIntersects } from '../utils/datesIntersects';
|
|
35
|
-
import { includesDate } from '../utils/includesDate';
|
|
36
33
|
import dayjs from 'dayjs';
|
|
37
|
-
import
|
|
34
|
+
import React from 'react';
|
|
38
35
|
/*!__reshadow-styles__:"../style/date-picker.shadow.css"*/
|
|
39
|
-
var style = (
|
|
36
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___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}}", /*__inner_css_end__*/"1h6ds_gg_"),
|
|
40
37
|
/*__reshadow_css_end__*/
|
|
41
38
|
{
|
|
42
|
-
"__SHeader": "
|
|
43
|
-
"__STitle": "
|
|
44
|
-
"__SToday": "
|
|
45
|
-
"__SPeriod": "
|
|
46
|
-
"__SButton": "
|
|
47
|
-
"__SInner": "
|
|
48
|
-
"__SInputMask": "
|
|
49
|
-
"_animationsDisabled": "
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"__SDateRange": "
|
|
60
|
-
"_noHumanizedDate": "
|
|
61
|
-
"__SRangeSep": "
|
|
62
|
-
"_fulfilled": "
|
|
63
|
-
"__SRangeComparatorHeader": "
|
|
64
|
-
"__SRangeCalendar": "
|
|
65
|
-
"__SFooter": "
|
|
66
|
-
"__SPeriodsList": "
|
|
67
|
-
"__STooltip": "
|
|
68
|
-
"__SCompareToggle": "
|
|
69
|
-
"__SPopper": "
|
|
39
|
+
"__SHeader": "___SHeader_1h6ds_gg_",
|
|
40
|
+
"__STitle": "___STitle_1h6ds_gg_",
|
|
41
|
+
"__SToday": "___SToday_1h6ds_gg_",
|
|
42
|
+
"__SPeriod": "___SPeriod_1h6ds_gg_",
|
|
43
|
+
"__SButton": "___SButton_1h6ds_gg_",
|
|
44
|
+
"__SInner": "___SInner_1h6ds_gg_",
|
|
45
|
+
"__SInputMask": "___SInputMask_1h6ds_gg_",
|
|
46
|
+
"_animationsDisabled": "__animationsDisabled_1h6ds_gg_",
|
|
47
|
+
"__SIndicator": "___SIndicator_1h6ds_gg_",
|
|
48
|
+
"__SRangeIndicator": "___SRangeIndicator_1h6ds_gg_",
|
|
49
|
+
"_range_value": "_range_value_1h6ds_gg_",
|
|
50
|
+
"_range_compare": "_range_compare_1h6ds_gg_",
|
|
51
|
+
"_disabled": "__disabled_1h6ds_gg_",
|
|
52
|
+
"__SHumanizedDate": "___SHumanizedDate_1h6ds_gg_",
|
|
53
|
+
"__SMask": "___SMask_1h6ds_gg_",
|
|
54
|
+
"__SSingleDateInput": "___SSingleDateInput_1h6ds_gg_",
|
|
55
|
+
"__SValue": "___SValue_1h6ds_gg_",
|
|
56
|
+
"__SDateRange": "___SDateRange_1h6ds_gg_",
|
|
57
|
+
"_noHumanizedDate": "__noHumanizedDate_1h6ds_gg_",
|
|
58
|
+
"__SRangeSep": "___SRangeSep_1h6ds_gg_",
|
|
59
|
+
"_fulfilled": "__fulfilled_1h6ds_gg_",
|
|
60
|
+
"__SRangeComparatorHeader": "___SRangeComparatorHeader_1h6ds_gg_",
|
|
61
|
+
"__SRangeCalendar": "___SRangeCalendar_1h6ds_gg_",
|
|
62
|
+
"__SFooter": "___SFooter_1h6ds_gg_",
|
|
63
|
+
"__SPeriodsList": "___SPeriodsList_1h6ds_gg_",
|
|
64
|
+
"__STooltip": "___STooltip_1h6ds_gg_",
|
|
65
|
+
"__SCompareToggle": "___SCompareToggle_1h6ds_gg_",
|
|
66
|
+
"__SPopper": "___SPopper_1h6ds_gg_"
|
|
70
67
|
});
|
|
71
|
-
import
|
|
68
|
+
import { datesIntersects } from '../utils/datesIntersects';
|
|
69
|
+
import { includesDate } from '../utils/includesDate';
|
|
72
70
|
var defaultAllowedParts = {
|
|
73
71
|
year: true,
|
|
74
72
|
month: true,
|
|
@@ -76,22 +74,21 @@ var defaultAllowedParts = {
|
|
|
76
74
|
};
|
|
77
75
|
var exampleDate = new Date(2000, 4, 29);
|
|
78
76
|
var InputTriggerRoot = /*#__PURE__*/function (_Component) {
|
|
79
|
-
_inherits(InputTriggerRoot, _Component);
|
|
80
|
-
var _super = _createSuper(InputTriggerRoot);
|
|
81
77
|
function InputTriggerRoot() {
|
|
82
78
|
_classCallCheck(this, InputTriggerRoot);
|
|
83
|
-
return
|
|
79
|
+
return _callSuper(this, InputTriggerRoot, arguments);
|
|
84
80
|
}
|
|
85
|
-
|
|
81
|
+
_inherits(InputTriggerRoot, _Component);
|
|
82
|
+
return _createClass(InputTriggerRoot, [{
|
|
86
83
|
key: "getSingleDateInputProps",
|
|
87
84
|
value: function getSingleDateInputProps() {
|
|
88
85
|
var _this$asProps = this.asProps,
|
|
89
|
-
|
|
86
|
+
_children = _this$asProps.children,
|
|
90
87
|
id = _this$asProps.id,
|
|
91
|
-
|
|
88
|
+
_role = _this$asProps.role,
|
|
92
89
|
ariaHasPopup = _this$asProps['aria-haspopup'],
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
_ariaLabel = _this$asProps['aria-label'],
|
|
91
|
+
_style = _this$asProps.style,
|
|
95
92
|
otherProps = _objectWithoutProperties(_this$asProps, _excluded);
|
|
96
93
|
return _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
97
94
|
ariaHasPopup: ariaHasPopup,
|
|
@@ -102,12 +99,12 @@ var InputTriggerRoot = /*#__PURE__*/function (_Component) {
|
|
|
102
99
|
key: "getDateRangeProps",
|
|
103
100
|
value: function getDateRangeProps() {
|
|
104
101
|
var _this$asProps2 = this.asProps,
|
|
105
|
-
|
|
102
|
+
_children = _this$asProps2.children,
|
|
106
103
|
id = _this$asProps2.id,
|
|
107
|
-
|
|
104
|
+
_rolw = _this$asProps2.role,
|
|
108
105
|
ariaHasPopup = _this$asProps2['aria-haspopup'],
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
_ariaLabel = _this$asProps2['aria-label'],
|
|
107
|
+
_style = _this$asProps2.style,
|
|
111
108
|
otherProps = _objectWithoutProperties(_this$asProps2, _excluded2);
|
|
112
109
|
return _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
113
110
|
ariaHasPopup: ariaHasPopup,
|
|
@@ -130,7 +127,6 @@ var InputTriggerRoot = /*#__PURE__*/function (_Component) {
|
|
|
130
127
|
}, _ref))), /*#__PURE__*/React.createElement(Children, _ref8.cn("Children", {})));
|
|
131
128
|
}
|
|
132
129
|
}]);
|
|
133
|
-
return InputTriggerRoot;
|
|
134
130
|
}(Component);
|
|
135
131
|
_defineProperty(InputTriggerRoot, "displayName", 'InputTrigger');
|
|
136
132
|
_defineProperty(InputTriggerRoot, "style", style);
|
|
@@ -139,37 +135,36 @@ _defineProperty(InputTriggerRoot, "defaultProps", {
|
|
|
139
135
|
popoverVisible: true
|
|
140
136
|
});
|
|
141
137
|
var SingleDateInputRoot = /*#__PURE__*/function (_Component2) {
|
|
142
|
-
_inherits(SingleDateInputRoot, _Component2);
|
|
143
|
-
var _super2 = _createSuper(SingleDateInputRoot);
|
|
144
138
|
function SingleDateInputRoot() {
|
|
145
139
|
var _this;
|
|
146
140
|
_classCallCheck(this, SingleDateInputRoot);
|
|
147
141
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
148
142
|
args[_key] = arguments[_key];
|
|
149
143
|
}
|
|
150
|
-
_this =
|
|
151
|
-
_defineProperty(
|
|
144
|
+
_this = _callSuper(this, SingleDateInputRoot, [].concat(args));
|
|
145
|
+
_defineProperty(_this, "state", {
|
|
152
146
|
errorText: null,
|
|
153
147
|
showError: false,
|
|
154
148
|
focused: false
|
|
155
149
|
});
|
|
156
|
-
_defineProperty(
|
|
150
|
+
_defineProperty(_this, "handleFocus", function () {
|
|
157
151
|
_this.setState({
|
|
158
152
|
focused: true
|
|
159
153
|
});
|
|
160
154
|
});
|
|
161
|
-
_defineProperty(
|
|
155
|
+
_defineProperty(_this, "handleBlur", function () {
|
|
162
156
|
_this.setState({
|
|
163
157
|
focused: false
|
|
164
158
|
});
|
|
165
159
|
});
|
|
166
|
-
_defineProperty(
|
|
160
|
+
_defineProperty(_this, "handleInputMaskPipeBlock", function (value) {
|
|
167
161
|
if (value === _this.asProps.disabledDateInputAttempt) return;
|
|
168
162
|
_this.handlers.disabledDateInputAttempt(value);
|
|
169
163
|
});
|
|
170
164
|
return _this;
|
|
171
165
|
}
|
|
172
|
-
|
|
166
|
+
_inherits(SingleDateInputRoot, _Component2);
|
|
167
|
+
return _createClass(SingleDateInputRoot, [{
|
|
173
168
|
key: "uncontrolledProps",
|
|
174
169
|
value: function uncontrolledProps() {
|
|
175
170
|
var _this2 = this;
|
|
@@ -206,17 +201,18 @@ var SingleDateInputRoot = /*#__PURE__*/function (_Component2) {
|
|
|
206
201
|
onChange = _this$asProps4.onChange,
|
|
207
202
|
onDisplayedPeriodChange = _this$asProps4.onDisplayedPeriodChange,
|
|
208
203
|
locale = _this$asProps4.locale,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
204
|
+
_w = _this$asProps4.w,
|
|
205
|
+
_ariaHasPopup = _this$asProps4.ariaHasPopup,
|
|
206
|
+
_showError = _this$asProps4.showError,
|
|
207
|
+
neighborLocation = _this$asProps4.neighborLocation,
|
|
212
208
|
otherProps = _objectWithoutProperties(_this$asProps4, _excluded3);
|
|
213
209
|
return _objectSpread({
|
|
214
|
-
date: value,
|
|
215
|
-
onDateChange: onChange,
|
|
210
|
+
'date': value,
|
|
211
|
+
'onDateChange': onChange,
|
|
216
212
|
onDisplayedPeriodChange: onDisplayedPeriodChange,
|
|
217
213
|
locale: locale,
|
|
218
214
|
'aria-haspopup': 'true',
|
|
219
|
-
onMaskPipeBlock: this.handleInputMaskPipeBlock
|
|
215
|
+
'onMaskPipeBlock': this.handleInputMaskPipeBlock
|
|
220
216
|
}, otherProps);
|
|
221
217
|
}
|
|
222
218
|
}, {
|
|
@@ -251,7 +247,6 @@ var SingleDateInputRoot = /*#__PURE__*/function (_Component2) {
|
|
|
251
247
|
}, _ref2))), /*#__PURE__*/React.createElement(NeighborLocation, _ref9.cn("NeighborLocation", {}), /*#__PURE__*/React.createElement(Children, _ref9.cn("Children", {}))));
|
|
252
248
|
}
|
|
253
249
|
}]);
|
|
254
|
-
return SingleDateInputRoot;
|
|
255
250
|
}(Component);
|
|
256
251
|
_defineProperty(SingleDateInputRoot, "displayName", 'SingleDateInput');
|
|
257
252
|
_defineProperty(SingleDateInputRoot, "style", style);
|
|
@@ -263,24 +258,22 @@ _defineProperty(SingleDateInputRoot, "defaultProps", {
|
|
|
263
258
|
showError: true
|
|
264
259
|
});
|
|
265
260
|
var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
266
|
-
_inherits(DateRangeRoot, _Component3);
|
|
267
|
-
var _super3 = _createSuper(DateRangeRoot);
|
|
268
261
|
function DateRangeRoot() {
|
|
269
262
|
var _this3;
|
|
270
263
|
_classCallCheck(this, DateRangeRoot);
|
|
271
264
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
272
265
|
args[_key2] = arguments[_key2];
|
|
273
266
|
}
|
|
274
|
-
_this3 =
|
|
275
|
-
_defineProperty(
|
|
267
|
+
_this3 = _callSuper(this, DateRangeRoot, [].concat(args));
|
|
268
|
+
_defineProperty(_this3, "state", {
|
|
276
269
|
containerFocused: false,
|
|
277
270
|
errorText: null,
|
|
278
271
|
showError: false,
|
|
279
272
|
lastChangedInput: 'from'
|
|
280
273
|
});
|
|
281
|
-
_defineProperty(
|
|
282
|
-
_defineProperty(
|
|
283
|
-
_defineProperty(
|
|
274
|
+
_defineProperty(_this3, "fromRef", /*#__PURE__*/React.createRef());
|
|
275
|
+
_defineProperty(_this3, "toRef", /*#__PURE__*/React.createRef());
|
|
276
|
+
_defineProperty(_this3, "handleFromChange", function (value, event) {
|
|
284
277
|
var _this3$asProps$value$, _this3$asProps$value, _this3$asProps$value$2, _this3$asProps$value2;
|
|
285
278
|
var onChange = _this3.asProps.onChange;
|
|
286
279
|
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];
|
|
@@ -294,13 +287,13 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
294
287
|
}, 0);
|
|
295
288
|
}
|
|
296
289
|
});
|
|
297
|
-
_defineProperty(
|
|
290
|
+
_defineProperty(_this3, "handleToChange", function (value, event) {
|
|
298
291
|
var _this3$asProps$value$3, _this3$asProps$value3, _this3$asProps$value$4, _this3$asProps$value4;
|
|
299
292
|
var onChange = _this3.asProps.onChange;
|
|
300
293
|
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];
|
|
301
294
|
onChange([prevValue[0], value], event);
|
|
302
295
|
});
|
|
303
|
-
_defineProperty(
|
|
296
|
+
_defineProperty(_this3, "handleFromKeydown", function (event) {
|
|
304
297
|
if (!_this3.toRef.current) return;
|
|
305
298
|
if (!_this3.fromRef.current) return;
|
|
306
299
|
_this3.setState({
|
|
@@ -313,7 +306,7 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
313
306
|
}, 0);
|
|
314
307
|
}
|
|
315
308
|
});
|
|
316
|
-
_defineProperty(
|
|
309
|
+
_defineProperty(_this3, "handleToKeydown", function (event) {
|
|
317
310
|
if (!_this3.toRef.current) return;
|
|
318
311
|
if (!_this3.fromRef.current) return;
|
|
319
312
|
_this3.setState({
|
|
@@ -334,21 +327,21 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
334
327
|
}, 0);
|
|
335
328
|
}
|
|
336
329
|
});
|
|
337
|
-
_defineProperty(
|
|
330
|
+
_defineProperty(_this3, "handleInputMaskPipeBlock", function (value) {
|
|
338
331
|
if (value === _this3.asProps.disabledDateInputAttempt) return;
|
|
339
332
|
_this3.handlers.disabledDateInputAttempt(value);
|
|
340
333
|
});
|
|
341
|
-
_defineProperty(
|
|
334
|
+
_defineProperty(_this3, "handleFocus", function () {
|
|
342
335
|
_this3.setState({
|
|
343
336
|
containerFocused: true
|
|
344
337
|
});
|
|
345
338
|
});
|
|
346
|
-
_defineProperty(
|
|
339
|
+
_defineProperty(_this3, "handleBlur", function () {
|
|
347
340
|
_this3.setState({
|
|
348
341
|
containerFocused: false
|
|
349
342
|
});
|
|
350
343
|
});
|
|
351
|
-
_defineProperty(
|
|
344
|
+
_defineProperty(_this3, "updateDisabledDateInputAttempt", function (value) {
|
|
352
345
|
var disabledDates = _this3.asProps.disabledDates;
|
|
353
346
|
var invalid = false;
|
|
354
347
|
if (value) {
|
|
@@ -364,7 +357,8 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
364
357
|
});
|
|
365
358
|
return _this3;
|
|
366
359
|
}
|
|
367
|
-
|
|
360
|
+
_inherits(DateRangeRoot, _Component3);
|
|
361
|
+
return _createClass(DateRangeRoot, [{
|
|
368
362
|
key: "uncontrolledProps",
|
|
369
363
|
value: function uncontrolledProps() {
|
|
370
364
|
var _this4 = this;
|
|
@@ -407,19 +401,20 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
407
401
|
locale = _this$asProps6.locale,
|
|
408
402
|
onDisplayedPeriodChange = _this$asProps6.onDisplayedPeriodChange,
|
|
409
403
|
ariaHasPopup = _this$asProps6.ariaHasPopup,
|
|
410
|
-
|
|
404
|
+
_showError = _this$asProps6.showError,
|
|
405
|
+
neighborLocation = _this$asProps6.neighborLocation,
|
|
411
406
|
otherProps = _objectWithoutProperties(_this$asProps6, _excluded4);
|
|
412
407
|
return assignProps({
|
|
413
|
-
ref: this.fromRef,
|
|
414
|
-
date: value === null || value === void 0 ? void 0 : value[0],
|
|
415
|
-
onDateChange: this.handleFromChange,
|
|
416
|
-
onKeyDown: this.handleFromKeydown,
|
|
408
|
+
'ref': this.fromRef,
|
|
409
|
+
'date': value === null || value === void 0 ? void 0 : value[0],
|
|
410
|
+
'onDateChange': this.handleFromChange,
|
|
411
|
+
'onKeyDown': this.handleFromKeydown,
|
|
417
412
|
locale: locale,
|
|
418
|
-
flex: 1,
|
|
413
|
+
'flex': 1,
|
|
419
414
|
onDisplayedPeriodChange: onDisplayedPeriodChange,
|
|
420
415
|
'aria-haspopup': ariaHasPopup,
|
|
421
|
-
onMaskPipeBlock: this.handleInputMaskPipeBlock,
|
|
422
|
-
containerFocused: this.state.containerFocused
|
|
416
|
+
'onMaskPipeBlock': this.handleInputMaskPipeBlock,
|
|
417
|
+
'containerFocused': this.state.containerFocused
|
|
423
418
|
}, otherProps);
|
|
424
419
|
}
|
|
425
420
|
}, {
|
|
@@ -430,24 +425,25 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
430
425
|
locale = _this$asProps7.locale,
|
|
431
426
|
onDisplayedPeriodChange = _this$asProps7.onDisplayedPeriodChange,
|
|
432
427
|
ariaHasPopup = _this$asProps7.ariaHasPopup,
|
|
433
|
-
|
|
434
|
-
|
|
428
|
+
_inputId = _this$asProps7.inputId,
|
|
429
|
+
_showError = _this$asProps7.showError,
|
|
430
|
+
neighborLocation = _this$asProps7.neighborLocation,
|
|
435
431
|
otherProps = _objectWithoutProperties(_this$asProps7, _excluded5);
|
|
436
432
|
var ariaLabel = this.asProps.getI18nText('toDate', {
|
|
437
433
|
date: this.asProps.getI18nText('input')
|
|
438
434
|
});
|
|
439
435
|
return assignProps({
|
|
440
|
-
ref: this.toRef,
|
|
441
|
-
date: value === null || value === void 0 ? void 0 : value[1],
|
|
442
|
-
onDateChange: this.handleToChange,
|
|
443
|
-
onKeyDown: this.handleToKeydown,
|
|
436
|
+
'ref': this.toRef,
|
|
437
|
+
'date': value === null || value === void 0 ? void 0 : value[1],
|
|
438
|
+
'onDateChange': this.handleToChange,
|
|
439
|
+
'onKeyDown': this.handleToKeydown,
|
|
444
440
|
locale: locale,
|
|
445
|
-
flex: 1,
|
|
441
|
+
'flex': 1,
|
|
446
442
|
onDisplayedPeriodChange: onDisplayedPeriodChange,
|
|
447
443
|
'aria-label': ariaLabel,
|
|
448
444
|
'aria-haspopup': ariaHasPopup,
|
|
449
|
-
onMaskPipeBlock: this.handleInputMaskPipeBlock,
|
|
450
|
-
containerFocused: this.state.containerFocused
|
|
445
|
+
'onMaskPipeBlock': this.handleInputMaskPipeBlock,
|
|
446
|
+
'containerFocused': this.state.containerFocused
|
|
451
447
|
}, otherProps);
|
|
452
448
|
}
|
|
453
449
|
}, {
|
|
@@ -474,7 +470,7 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
474
470
|
key: "render",
|
|
475
471
|
value: function render() {
|
|
476
472
|
var _ref3 = this.asProps,
|
|
477
|
-
|
|
473
|
+
_ref0;
|
|
478
474
|
var SDateRange = InputMask;
|
|
479
475
|
var _this$asProps8 = this.asProps,
|
|
480
476
|
Children = _this$asProps8.Children,
|
|
@@ -489,7 +485,7 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
489
485
|
showErrorState = _this$state2.showError,
|
|
490
486
|
containerFocused = _this$state2.containerFocused;
|
|
491
487
|
var showError = showErrorState && showErrorProps;
|
|
492
|
-
return
|
|
488
|
+
return _ref0 = sstyled(styles), /*#__PURE__*/React.createElement(SDateRange, _ref0.cn("SDateRange", _objectSpread({}, _assignProps3({
|
|
493
489
|
"tag": Tooltip,
|
|
494
490
|
"ignorePortalsStacking": true,
|
|
495
491
|
"placement": lastChangedInput === 'to' ? 'top-end' : 'top-start',
|
|
@@ -501,10 +497,9 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
501
497
|
"w": w,
|
|
502
498
|
"onFocus": this.handleFocus,
|
|
503
499
|
"onBlur": this.handleBlur
|
|
504
|
-
}, _ref3))), /*#__PURE__*/React.createElement(Children,
|
|
500
|
+
}, _ref3))), /*#__PURE__*/React.createElement(Children, _ref0.cn("Children", {})));
|
|
505
501
|
}
|
|
506
502
|
}]);
|
|
507
|
-
return DateRangeRoot;
|
|
508
503
|
}(Component);
|
|
509
504
|
_defineProperty(DateRangeRoot, "displayName", 'DateRange');
|
|
510
505
|
_defineProperty(DateRangeRoot, "style", style);
|
|
@@ -515,70 +510,70 @@ _defineProperty(DateRangeRoot, "defaultProps", {
|
|
|
515
510
|
defaultDisabledDateInputAttempt: false,
|
|
516
511
|
showError: true
|
|
517
512
|
});
|
|
518
|
-
|
|
513
|
+
function FromMaskedInput(props) {
|
|
519
514
|
var _ref4 = arguments[0],
|
|
520
|
-
|
|
515
|
+
_ref1;
|
|
521
516
|
var SFromMaskedInput = MaskedInput;
|
|
522
517
|
var getI18nText = props.getI18nText;
|
|
523
|
-
return
|
|
518
|
+
return _ref1 = sstyled(props.styles), /*#__PURE__*/React.createElement(SFromMaskedInput, _ref1.cn("SFromMaskedInput", _objectSpread({}, _assignProps4({
|
|
524
519
|
"labelPrefix": getI18nText('fromDatePlaceholder')
|
|
525
520
|
}, _ref4))));
|
|
526
|
-
}
|
|
527
|
-
|
|
521
|
+
}
|
|
522
|
+
function ToMaskedInput(props) {
|
|
528
523
|
var _ref5 = arguments[0],
|
|
529
|
-
|
|
524
|
+
_ref10;
|
|
530
525
|
var SToMaskedInput = MaskedInput;
|
|
531
526
|
var getI18nText = props.getI18nText;
|
|
532
|
-
return
|
|
527
|
+
return _ref10 = sstyled(props.styles), /*#__PURE__*/React.createElement(SToMaskedInput, _ref10.cn("SToMaskedInput", _objectSpread({}, _assignProps5({
|
|
533
528
|
"labelPrefix": getI18nText('toDatePlaceholder')
|
|
534
529
|
}, _ref5))));
|
|
535
|
-
}
|
|
536
|
-
|
|
530
|
+
}
|
|
531
|
+
function Indicator(props) {
|
|
537
532
|
var _ref6 = arguments[0],
|
|
538
|
-
|
|
533
|
+
_ref11;
|
|
539
534
|
var SIndicator = InputMask.Addon;
|
|
540
|
-
return
|
|
535
|
+
return _ref11 = sstyled(props.styles), /*#__PURE__*/React.createElement(SIndicator, _ref11.cn("SIndicator", _objectSpread({}, _assignProps6({
|
|
541
536
|
"tag": Calendar,
|
|
542
537
|
"aria-hidden": 'true',
|
|
543
538
|
"tabIndex": -1
|
|
544
539
|
}, _ref6))));
|
|
545
|
-
}
|
|
546
|
-
|
|
540
|
+
}
|
|
541
|
+
function RangeSep(props) {
|
|
547
542
|
var _ref7 = arguments[0],
|
|
548
|
-
|
|
543
|
+
_ref12;
|
|
549
544
|
var SRangeSep = InputMask.Addon;
|
|
550
|
-
return
|
|
545
|
+
return _ref12 = sstyled(props.styles), /*#__PURE__*/React.createElement(SRangeSep, _ref12.cn("SRangeSep", _objectSpread({}, _assignProps7({
|
|
551
546
|
"tag": Flex,
|
|
552
547
|
"alignItems": 'center',
|
|
553
548
|
"justifyContent": 'center',
|
|
554
549
|
"pl": 0,
|
|
555
550
|
"flex": '0'
|
|
556
551
|
}, _ref7))), "\u2013");
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
var
|
|
560
|
-
var outerValue =
|
|
561
|
-
onDateChange =
|
|
562
|
-
onDisplayedPeriodChange =
|
|
563
|
-
locale =
|
|
564
|
-
styles =
|
|
565
|
-
|
|
566
|
-
allowedParts =
|
|
567
|
-
disabledDates =
|
|
568
|
-
forwardRef =
|
|
569
|
-
providedPlaceholders =
|
|
570
|
-
|
|
571
|
-
labelPrefix =
|
|
572
|
-
onMaskPipeBlock =
|
|
573
|
-
containerFocused =
|
|
574
|
-
animationsDisabled =
|
|
575
|
-
getI18nText =
|
|
576
|
-
inputId =
|
|
577
|
-
|
|
578
|
-
inputRole =
|
|
579
|
-
__excludeProps =
|
|
580
|
-
_root =
|
|
581
|
-
otherProps = _objectWithoutProperties(
|
|
552
|
+
}
|
|
553
|
+
function MaskedInput(_ref14) {
|
|
554
|
+
var _ref13;
|
|
555
|
+
var outerValue = _ref14.date,
|
|
556
|
+
onDateChange = _ref14.onDateChange,
|
|
557
|
+
onDisplayedPeriodChange = _ref14.onDisplayedPeriodChange,
|
|
558
|
+
locale = _ref14.locale,
|
|
559
|
+
styles = _ref14.styles,
|
|
560
|
+
_ref14$parts = _ref14.parts,
|
|
561
|
+
allowedParts = _ref14$parts === void 0 ? defaultAllowedParts : _ref14$parts,
|
|
562
|
+
disabledDates = _ref14.disabledDates,
|
|
563
|
+
forwardRef = _ref14.forwardRef,
|
|
564
|
+
providedPlaceholders = _ref14.placeholders,
|
|
565
|
+
_ref14$labelPrefix = _ref14.labelPrefix,
|
|
566
|
+
labelPrefix = _ref14$labelPrefix === void 0 ? 'Date' : _ref14$labelPrefix,
|
|
567
|
+
onMaskPipeBlock = _ref14.onMaskPipeBlock,
|
|
568
|
+
containerFocused = _ref14.containerFocused,
|
|
569
|
+
animationsDisabled = _ref14.animationsDisabled,
|
|
570
|
+
getI18nText = _ref14.getI18nText,
|
|
571
|
+
inputId = _ref14.inputId,
|
|
572
|
+
_ref14$inputRole = _ref14.inputRole,
|
|
573
|
+
inputRole = _ref14$inputRole === void 0 ? 'combobox' : _ref14$inputRole,
|
|
574
|
+
__excludeProps = _ref14.__excludeProps,
|
|
575
|
+
_root = _ref14.Root,
|
|
576
|
+
otherProps = _objectWithoutProperties(_ref14, _excluded6);
|
|
582
577
|
var ref = React.useRef();
|
|
583
578
|
var _React$useState = React.useState(undefined),
|
|
584
579
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -593,13 +588,13 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
593
588
|
};
|
|
594
589
|
}, [providedPlaceholders, getI18nText]);
|
|
595
590
|
if (placeholders.year.length !== 1 || placeholders.month.length !== 1 || placeholders.day.length !== 1) {
|
|
591
|
+
// eslint-disable-next-line no-console
|
|
596
592
|
console.error({
|
|
597
593
|
placeholders: placeholders
|
|
598
594
|
});
|
|
599
595
|
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);
|
|
600
596
|
}
|
|
601
597
|
var _React$useMemo = React.useMemo(function () {
|
|
602
|
-
var _sep;
|
|
603
598
|
var options = {
|
|
604
599
|
year: 'numeric',
|
|
605
600
|
month: 'numeric',
|
|
@@ -626,7 +621,7 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
626
621
|
} finally {
|
|
627
622
|
_iterator.f();
|
|
628
623
|
}
|
|
629
|
-
sep =
|
|
624
|
+
sep = sep !== null && sep !== void 0 ? sep : ' ';
|
|
630
625
|
return {
|
|
631
626
|
sep: sep,
|
|
632
627
|
order: order
|
|
@@ -692,7 +687,7 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
692
687
|
}
|
|
693
688
|
}
|
|
694
689
|
if (placeholdersOnly) {
|
|
695
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
690
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(null);
|
|
696
691
|
return '';
|
|
697
692
|
}
|
|
698
693
|
var getOffsetTo = function getOffsetTo(partName) {
|
|
@@ -728,20 +723,20 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
728
723
|
month = parsed.month,
|
|
729
724
|
day = parsed.day;
|
|
730
725
|
if (allowedParts.month) {
|
|
731
|
-
if (month[0] !== '_' && parseInt(month[0], 10) > 1) {
|
|
726
|
+
if (month[0] !== '_' && Number.parseInt(month[0], 10) > 1) {
|
|
732
727
|
month = "0".concat(month[0]);
|
|
733
728
|
indexesOfPipedChars.push(getOffsetTo('month'));
|
|
734
729
|
}
|
|
735
730
|
if (month === '00') month = '01';
|
|
736
|
-
if (month[0] !== '_' && month[1] !== '_' && parseInt(month, 10) > 12) return false;
|
|
731
|
+
if (month[0] !== '_' && month[1] !== '_' && Number.parseInt(month, 10) > 12) return false;
|
|
737
732
|
}
|
|
738
733
|
if (allowedParts.day) {
|
|
739
|
-
if (day[0] !== '_' && parseInt(day[0], 10) > 3) {
|
|
734
|
+
if (day[0] !== '_' && Number.parseInt(day[0], 10) > 3) {
|
|
740
735
|
day = "0".concat(day[0]);
|
|
741
736
|
indexesOfPipedChars.push(getOffsetTo('day'));
|
|
742
737
|
}
|
|
743
738
|
if (day === '00') day = '01';
|
|
744
|
-
if (day[0] !== '_' && day[1] !== '_' && parseInt(day, 10) > 31) return false;
|
|
739
|
+
if (day[0] !== '_' && day[1] !== '_' && Number.parseInt(day, 10) > 31) return false;
|
|
745
740
|
}
|
|
746
741
|
year = year.split('').map(function (_char) {
|
|
747
742
|
return _char === '_' ? placeholders.year : _char;
|
|
@@ -758,17 +753,17 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
758
753
|
var fulfilled = yearFulfilled && monthFulfilled && dayFulfilled;
|
|
759
754
|
if (fulfilled) {
|
|
760
755
|
var date = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
761
|
-
var yearParsed = allowedParts.year ? parseInt(year, 10) : 0;
|
|
762
|
-
var monthParsed = allowedParts.month ? parseInt(month, 10) - 1 : 0;
|
|
763
|
-
var dayParsed = allowedParts.day ? parseInt(day, 10) : 1;
|
|
756
|
+
var yearParsed = allowedParts.year ? Number.parseInt(year, 10) : 0;
|
|
757
|
+
var monthParsed = allowedParts.month ? Number.parseInt(month, 10) - 1 : 0;
|
|
758
|
+
var dayParsed = allowedParts.day ? Number.parseInt(day, 10) : 1;
|
|
764
759
|
date.setFullYear(yearParsed, monthParsed, dayParsed);
|
|
765
760
|
if (disabledDates !== null && disabledDates !== void 0 && disabledDates.some(includesDate(dayjs(date), 'date'))) {
|
|
766
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
761
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(date);
|
|
767
762
|
return false;
|
|
768
763
|
}
|
|
769
764
|
if (allowedParts.day) {
|
|
770
|
-
if (date.getDate() !== parseInt(day, 10)) {
|
|
771
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
765
|
+
if (date.getDate() !== Number.parseInt(day, 10)) {
|
|
766
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(date);
|
|
772
767
|
return false;
|
|
773
768
|
}
|
|
774
769
|
}
|
|
@@ -788,7 +783,7 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
788
783
|
} finally {
|
|
789
784
|
_iterator4.f();
|
|
790
785
|
}
|
|
791
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
786
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(null);
|
|
792
787
|
return {
|
|
793
788
|
value: result.join(sep),
|
|
794
789
|
indexesOfPipedChars: indexesOfPipedChars
|
|
@@ -817,9 +812,9 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
817
812
|
var fulfilled = yearFulfilled && monthFulfilled && dayFulfilled;
|
|
818
813
|
if (fulfilled) {
|
|
819
814
|
var date = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
820
|
-
var yearParsed = allowedParts.year ? parseInt(year, 10) : 0;
|
|
821
|
-
var monthParsed = allowedParts.month ? parseInt(month, 10) - 1 : 0;
|
|
822
|
-
var dayParsed = allowedParts.day ? parseInt(day, 10) : 1;
|
|
815
|
+
var yearParsed = allowedParts.year ? Number.parseInt(year, 10) : 0;
|
|
816
|
+
var monthParsed = allowedParts.month ? Number.parseInt(month, 10) - 1 : 0;
|
|
817
|
+
var dayParsed = allowedParts.day ? Number.parseInt(day, 10) : 1;
|
|
823
818
|
date.setFullYear(yearParsed, monthParsed, dayParsed);
|
|
824
819
|
onDateChange(date);
|
|
825
820
|
lastKnownOuterValue.current = {
|
|
@@ -835,9 +830,9 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
835
830
|
}
|
|
836
831
|
if (yearFulfilled && allowedParts.year) {
|
|
837
832
|
var _date = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
838
|
-
_date.setFullYear(parseInt(year, 10));
|
|
833
|
+
_date.setFullYear(Number.parseInt(year, 10));
|
|
839
834
|
if (monthFulfilled && allowedParts.month) {
|
|
840
|
-
_date.setMonth(parseInt(month, 10) - 1);
|
|
835
|
+
_date.setMonth(Number.parseInt(month, 10) - 1);
|
|
841
836
|
}
|
|
842
837
|
onDisplayedPeriodChange(_date);
|
|
843
838
|
}
|
|
@@ -861,12 +856,10 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
861
856
|
return result.join(sep);
|
|
862
857
|
}, [sep, order, placeholders]);
|
|
863
858
|
var aliases = React.useMemo(function () {
|
|
864
|
-
|
|
865
|
-
return _ref17 = {}, _defineProperty(_ref17, placeholders.year, /\d/), _defineProperty(_ref17, placeholders.month, /\d/), _defineProperty(_ref17, placeholders.day, /\d/), _ref17;
|
|
859
|
+
return _defineProperty(_defineProperty(_defineProperty({}, placeholders.year, /\d/), placeholders.month, /\d/), placeholders.day, /\d/);
|
|
866
860
|
}, [placeholders]);
|
|
867
861
|
var maskOnlySymbols = React.useMemo(function () {
|
|
868
|
-
|
|
869
|
-
return _ref18 = {}, _defineProperty(_ref18, placeholders.year, true), _defineProperty(_ref18, placeholders.month, true), _defineProperty(_ref18, placeholders.day, true), _defineProperty(_ref18, sep, true), _ref18;
|
|
862
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, placeholders.year, true), placeholders.month, true), placeholders.day, true), sep, true);
|
|
870
863
|
}, [sep, placeholders]);
|
|
871
864
|
var humanizedDate = React.useMemo(function () {
|
|
872
865
|
var outerDate = outerValue;
|
|
@@ -889,8 +882,8 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
889
882
|
var computedStyle = window.getComputedStyle(ref.current);
|
|
890
883
|
var typographyRelatedStyles = ['height', 'font-size', 'font-family', 'font-weight', 'font-style', 'line-height', 'letter-spacing', 'text-transform', 'word-spacing'];
|
|
891
884
|
for (var _i2 = 0, _typographyRelatedSty = typographyRelatedStyles; _i2 < _typographyRelatedSty.length; _i2++) {
|
|
892
|
-
var
|
|
893
|
-
measureSpan.style[
|
|
885
|
+
var _style2 = _typographyRelatedSty[_i2];
|
|
886
|
+
measureSpan.style[_style2] = computedStyle[_style2];
|
|
894
887
|
}
|
|
895
888
|
measureSpan.style.position = 'absolute';
|
|
896
889
|
measureSpan.style.visibility = 'hidden';
|
|
@@ -898,7 +891,7 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
898
891
|
for (var _i3 = 0, _stringsToMeasure = stringsToMeasure; _i3 < _stringsToMeasure.length; _i3++) {
|
|
899
892
|
var string = _stringsToMeasure[_i3];
|
|
900
893
|
measureSpan.innerHTML = string;
|
|
901
|
-
widths.push(measureSpan.
|
|
894
|
+
widths.push(Math.ceil(measureSpan.getBoundingClientRect().width));
|
|
902
895
|
}
|
|
903
896
|
measureSpan.remove();
|
|
904
897
|
var maxWidth = Math.max.apply(Math, widths);
|
|
@@ -921,19 +914,19 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
921
914
|
var focused = containerFocused !== null && containerFocused !== void 0 ? containerFocused : innerFocused;
|
|
922
915
|
var handleFocus = React.useCallback(function (event) {
|
|
923
916
|
var _otherProps$onFocus;
|
|
924
|
-
(_otherProps$onFocus = otherProps.onFocus) === null || _otherProps$onFocus === void 0
|
|
917
|
+
(_otherProps$onFocus = otherProps.onFocus) === null || _otherProps$onFocus === void 0 || _otherProps$onFocus.call(otherProps, event);
|
|
925
918
|
setInnerFocused(true);
|
|
926
919
|
}, []);
|
|
927
920
|
var handleBlur = React.useCallback(function (event) {
|
|
928
921
|
var _otherProps$onBlur;
|
|
929
|
-
(_otherProps$onBlur = otherProps.onBlur) === null || _otherProps$onBlur === void 0
|
|
922
|
+
(_otherProps$onBlur = otherProps.onBlur) === null || _otherProps$onBlur === void 0 || _otherProps$onBlur.call(otherProps, event);
|
|
930
923
|
setInnerFocused(false);
|
|
931
924
|
}, []);
|
|
932
925
|
useEnhancedEffect(function () {
|
|
933
926
|
if (focused) return;
|
|
934
927
|
setAppliedWidth(width);
|
|
935
928
|
}, [width, focused]);
|
|
936
|
-
return
|
|
929
|
+
return _ref13 = sstyled(styles), /*#__PURE__*/React.createElement(InputMask.Value, _extends({
|
|
937
930
|
"aria-label": labelPrefix,
|
|
938
931
|
title: mask,
|
|
939
932
|
mask: mask,
|
|
@@ -954,9 +947,9 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
954
947
|
noHumanizedDate: !humanizedDate,
|
|
955
948
|
animationsDisabled: animationsDisabled,
|
|
956
949
|
inputRole: inputRole,
|
|
957
|
-
inputMode:
|
|
958
|
-
}), humanizedDate && /*#__PURE__*/React.createElement(SHumanizedDate,
|
|
959
|
-
}
|
|
950
|
+
inputMode: "numeric"
|
|
951
|
+
}), humanizedDate && /*#__PURE__*/React.createElement(SHumanizedDate, _ref13.cn("SHumanizedDate", {}), humanizedDate));
|
|
952
|
+
}
|
|
960
953
|
var SingleDateInput = createComponent(SingleDateInputRoot, {
|
|
961
954
|
Indicator: Indicator,
|
|
962
955
|
MaskedInput: MaskedInput
|