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