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