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