@semcore/date-picker 16.1.1 → 16.1.2-prerelease.3
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/README.md +2 -28
- package/lib/cjs/DatePicker.js +27 -31
- package/lib/cjs/DatePicker.js.map +1 -1
- package/lib/cjs/DateRangeComparator.js +28 -29
- package/lib/cjs/DateRangeComparator.js.map +1 -1
- package/lib/cjs/DateRangePicker.js +19 -20
- package/lib/cjs/DateRangePicker.js.map +1 -1
- package/lib/cjs/MonthDateRangeComparator.js +33 -34
- package/lib/cjs/MonthDateRangeComparator.js.map +1 -1
- package/lib/cjs/MonthPicker.js +18 -19
- package/lib/cjs/MonthPicker.js.map +1 -1
- package/lib/cjs/MonthRangePicker.js +20 -21
- package/lib/cjs/MonthRangePicker.js.map +1 -1
- package/lib/cjs/components/ButtonTrigger.js +3 -4
- package/lib/cjs/components/ButtonTrigger.js.map +1 -1
- package/lib/cjs/components/Calendar.js +105 -114
- package/lib/cjs/components/Calendar.js.map +1 -1
- package/lib/cjs/components/DateRangeComparatorAbstract.js +93 -95
- package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
- package/lib/cjs/components/InputTrigger.js +158 -166
- package/lib/cjs/components/InputTrigger.js.map +1 -1
- package/lib/cjs/components/PickerAbstract.js +53 -54
- package/lib/cjs/components/PickerAbstract.js.map +1 -1
- package/lib/cjs/components/RangePickerAbstract.js +61 -62
- package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
- package/lib/cjs/components/index.js +35 -39
- 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/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/utils/cronTabScheduler.js +6 -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 +1 -2
- package/lib/cjs/utils/isBetweenPlugin.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 +25 -27
- package/lib/es6/DatePicker.js.map +1 -1
- package/lib/es6/DateRangeComparator.js +26 -26
- package/lib/es6/DateRangeComparator.js.map +1 -1
- package/lib/es6/DateRangePicker.js +16 -16
- package/lib/es6/DateRangePicker.js.map +1 -1
- package/lib/es6/MonthDateRangeComparator.js +31 -31
- package/lib/es6/MonthDateRangeComparator.js.map +1 -1
- package/lib/es6/MonthPicker.js +16 -16
- package/lib/es6/MonthPicker.js.map +1 -1
- package/lib/es6/MonthRangePicker.js +17 -17
- package/lib/es6/MonthRangePicker.js.map +1 -1
- package/lib/es6/components/ButtonTrigger.js +2 -2
- package/lib/es6/components/ButtonTrigger.js.map +1 -1
- package/lib/es6/components/Calendar.js +102 -109
- package/lib/es6/components/Calendar.js.map +1 -1
- package/lib/es6/components/DateRangeComparatorAbstract.js +94 -95
- package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
- package/lib/es6/components/InputTrigger.js +158 -165
- package/lib/es6/components/InputTrigger.js.map +1 -1
- package/lib/es6/components/PickerAbstract.js +52 -52
- package/lib/es6/components/PickerAbstract.js.map +1 -1
- package/lib/es6/components/RangePickerAbstract.js +62 -62
- package/lib/es6/components/RangePickerAbstract.js.map +1 -1
- package/lib/es6/components/index.js +33 -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/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/utils/cronTabScheduler.js +5 -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 +1 -1
- package/lib/es6/utils/isBetweenPlugin.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 +32 -27
- package/lib/esm/DateRangeComparator.mjs +33 -26
- package/lib/esm/DateRangePicker.mjs +25 -18
- package/lib/esm/MonthDateRangeComparator.mjs +38 -31
- package/lib/esm/MonthPicker.mjs +24 -17
- package/lib/esm/MonthRangePicker.mjs +26 -19
- package/lib/esm/components/ButtonTrigger.mjs +1 -1
- package/lib/esm/components/Calendar.mjs +99 -103
- package/lib/esm/components/DateRangeComparatorAbstract.mjs +74 -74
- package/lib/esm/components/InputTrigger.mjs +128 -133
- package/lib/esm/components/PickerAbstract.mjs +55 -53
- package/lib/esm/components/RangePickerAbstract.mjs +63 -61
- package/lib/esm/components/index.mjs +28 -28
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/utils/cronTabScheduler.mjs +4 -4
- package/lib/esm/utils/datesIntersects.mjs +1 -1
- package/lib/esm/utils/isBetweenPlugin.mjs +1 -1
- package/lib/types/index.d.ts +129 -125
- package/package.json +16 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -8,65 +8,67 @@ exports["default"] = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
11
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
|
+
var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
|
|
17
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
18
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
18
19
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
20
|
var _core = require("@semcore/core");
|
|
20
|
-
var _react = _interopRequireDefault(require("react"));
|
|
21
21
|
var _baseTrigger = _interopRequireDefault(require("@semcore/base-trigger"));
|
|
22
|
-
var
|
|
23
|
-
var
|
|
22
|
+
var _assignProps8 = _interopRequireDefault(require("@semcore/core/lib/utils/assignProps"));
|
|
23
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@semcore/core/lib/utils/use/useEnhancedEffect"));
|
|
24
24
|
var _flexBox = require("@semcore/flex-box");
|
|
25
25
|
var _m = _interopRequireDefault(require("@semcore/icon/Calendar/m"));
|
|
26
|
+
var _inputMask = _interopRequireDefault(require("@semcore/input-mask"));
|
|
26
27
|
var _neighborLocation = _interopRequireDefault(require("@semcore/neighbor-location"));
|
|
28
|
+
var _tooltip = _interopRequireDefault(require("@semcore/tooltip"));
|
|
29
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
30
|
+
var _react = _interopRequireDefault(require("react"));
|
|
27
31
|
var _datesIntersects = require("../utils/datesIntersects");
|
|
28
32
|
var _includesDate = require("../utils/includesDate");
|
|
29
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
30
|
-
var _useEnhancedEffect = _interopRequireDefault(require("@semcore/core/lib/utils/use/useEnhancedEffect"));
|
|
31
|
-
var _assignProps8 = _interopRequireDefault(require("@semcore/core/lib/utils/assignProps"));
|
|
32
33
|
var _excluded = ["children", "id", "role", "aria-haspopup", "aria-label", "style"],
|
|
33
34
|
_excluded2 = ["children", "id", "role", "aria-haspopup", "aria-label", "style"],
|
|
34
35
|
_excluded3 = ["value", "onChange", "onDisplayedPeriodChange", "locale", "w", "ariaHasPopup", "showError"],
|
|
35
36
|
_excluded4 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "showError"],
|
|
36
37
|
_excluded5 = ["value", "locale", "onDisplayedPeriodChange", "ariaHasPopup", "inputId", "showError"],
|
|
37
38
|
_excluded6 = ["date", "onDateChange", "onDisplayedPeriodChange", "locale", "styles", "parts", "disabledDates", "forwardRef", "placeholders", "labelPrefix", "onMaskPipeBlock", "containerFocused", "animationsDisabled", "getI18nText", "inputId", "inputRole", "__excludeProps", "Root"];
|
|
39
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
38
40
|
/*!__reshadow-styles__:"../style/date-picker.shadow.css"*/
|
|
39
|
-
var style = (
|
|
41
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SPopper_1rb5x_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_1rb5x_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_1rb5x_gg_:active,.___SPopper_1rb5x_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_1rb5x_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_1rb5x_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_1rb5x_gg_,.___STitle_1rb5x_gg_{display:flex;align-items:center}.___STitle_1rb5x_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_1rb5x_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_1rb5x_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_1rb5x_gg_ .___SInner_1rb5x_gg_{justify-content:flex-start}.___SInputMask_1rb5x_gg_{color:var(--intergalactic-text-primary, #191b23);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_1rb5x_gg_.__animationsDisabled_1rb5x_gg_{transition:none}.___SInputMask_1rb5x_gg_ .___SValue_1rb5x_gg_{letter-spacing:0}.___SIndicator_1rb5x_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SRangeIndicator_1rb5x_gg_{border-radius:50%;flex-shrink:0}.___SRangeIndicator_1rb5x_gg_._range_value_1rb5x_gg_{background-color:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SRangeIndicator_1rb5x_gg_._range_compare_1rb5x_gg_{background-color:var(--intergalactic-date-picker-cell-comparison-active, #8649e1)}.___SRangeIndicator_1rb5x_gg_.__disabled_1rb5x_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SHumanizedDate_1rb5x_gg_{position:absolute;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.___SMask_1rb5x_gg_{letter-spacing:0;white-space:nowrap;overflow:hidden}.___SDateRange_1rb5x_gg_ .___SMask_1rb5x_gg_,.___SDateRange_1rb5x_gg_ .___SValue_1rb5x_gg_,.___SSingleDateInput_1rb5x_gg_ .___SMask_1rb5x_gg_,.___SSingleDateInput_1rb5x_gg_ .___SValue_1rb5x_gg_{opacity:0}.___SSingleDateInput_1rb5x_gg_:focus-within .___SHumanizedDate_1rb5x_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_1rb5x_gg_:focus-within .___SMask_1rb5x_gg_,.___SSingleDateInput_1rb5x_gg_:focus-within .___SValue_1rb5x_gg_{opacity:1}.___SDateRange_1rb5x_gg_:focus-within .___SHumanizedDate_1rb5x_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_1rb5x_gg_:focus-within .___SMask_1rb5x_gg_,.___SDateRange_1rb5x_gg_:focus-within .___SValue_1rb5x_gg_{opacity:1}.___SInputMask_1rb5x_gg_.__noHumanizedDate_1rb5x_gg_ .___SMask_1rb5x_gg_,.___SInputMask_1rb5x_gg_.__noHumanizedDate_1rb5x_gg_ .___SValue_1rb5x_gg_{opacity:1}.___SDateRange_1rb5x_gg_ .___SInputMask_1rb5x_gg_:focus-within .___SMask_1rb5x_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_1rb5x_gg_:focus-within .___SRangeSep_1rb5x_gg_,.___SRangeSep_1rb5x_gg_.__fulfilled_1rb5x_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SRangeComparatorHeader_1rb5x_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SRangeCalendar_1rb5x_gg_,.___SRangeComparatorHeader_1rb5x_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___SFooter_1rb5x_gg_{border-top:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SFooter_1rb5x_gg_,.___SPeriodsList_1rb5x_gg_{padding:var(--intergalactic-spacing-4x, 16px)}.___STooltip_1rb5x_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SCompareToggle_1rb5x_gg_{white-space:nowrap}@media (prefers-reduced-motion){.___SInputMask_1rb5x_gg_{transition:none}}", /*__inner_css_end__*/"1rb5x_gg_"),
|
|
40
42
|
/*__reshadow_css_end__*/
|
|
41
43
|
{
|
|
42
|
-
"__SHeader": "
|
|
43
|
-
"__STitle": "
|
|
44
|
-
"__SToday": "
|
|
45
|
-
"__SPeriod": "
|
|
46
|
-
"__SButton": "
|
|
47
|
-
"__SInner": "
|
|
48
|
-
"__SInputMask": "
|
|
49
|
-
"_animationsDisabled": "
|
|
50
|
-
"__SValue": "
|
|
51
|
-
"__SIndicator": "
|
|
52
|
-
"__SRangeIndicator": "
|
|
53
|
-
"_range_value": "
|
|
54
|
-
"_range_compare": "
|
|
55
|
-
"_disabled": "
|
|
56
|
-
"__SHumanizedDate": "
|
|
57
|
-
"__SMask": "
|
|
58
|
-
"__SSingleDateInput": "
|
|
59
|
-
"__SDateRange": "
|
|
60
|
-
"_noHumanizedDate": "
|
|
61
|
-
"__SRangeSep": "
|
|
62
|
-
"_fulfilled": "
|
|
63
|
-
"__SRangeComparatorHeader": "
|
|
64
|
-
"__SRangeCalendar": "
|
|
65
|
-
"__SFooter": "
|
|
66
|
-
"__SPeriodsList": "
|
|
67
|
-
"__STooltip": "
|
|
68
|
-
"__SCompareToggle": "
|
|
69
|
-
"__SPopper": "
|
|
44
|
+
"__SHeader": "___SHeader_1rb5x_gg_",
|
|
45
|
+
"__STitle": "___STitle_1rb5x_gg_",
|
|
46
|
+
"__SToday": "___SToday_1rb5x_gg_",
|
|
47
|
+
"__SPeriod": "___SPeriod_1rb5x_gg_",
|
|
48
|
+
"__SButton": "___SButton_1rb5x_gg_",
|
|
49
|
+
"__SInner": "___SInner_1rb5x_gg_",
|
|
50
|
+
"__SInputMask": "___SInputMask_1rb5x_gg_",
|
|
51
|
+
"_animationsDisabled": "__animationsDisabled_1rb5x_gg_",
|
|
52
|
+
"__SValue": "___SValue_1rb5x_gg_",
|
|
53
|
+
"__SIndicator": "___SIndicator_1rb5x_gg_",
|
|
54
|
+
"__SRangeIndicator": "___SRangeIndicator_1rb5x_gg_",
|
|
55
|
+
"_range_value": "_range_value_1rb5x_gg_",
|
|
56
|
+
"_range_compare": "_range_compare_1rb5x_gg_",
|
|
57
|
+
"_disabled": "__disabled_1rb5x_gg_",
|
|
58
|
+
"__SHumanizedDate": "___SHumanizedDate_1rb5x_gg_",
|
|
59
|
+
"__SMask": "___SMask_1rb5x_gg_",
|
|
60
|
+
"__SSingleDateInput": "___SSingleDateInput_1rb5x_gg_",
|
|
61
|
+
"__SDateRange": "___SDateRange_1rb5x_gg_",
|
|
62
|
+
"_noHumanizedDate": "__noHumanizedDate_1rb5x_gg_",
|
|
63
|
+
"__SRangeSep": "___SRangeSep_1rb5x_gg_",
|
|
64
|
+
"_fulfilled": "__fulfilled_1rb5x_gg_",
|
|
65
|
+
"__SRangeComparatorHeader": "___SRangeComparatorHeader_1rb5x_gg_",
|
|
66
|
+
"__SRangeCalendar": "___SRangeCalendar_1rb5x_gg_",
|
|
67
|
+
"__SFooter": "___SFooter_1rb5x_gg_",
|
|
68
|
+
"__SPeriodsList": "___SPeriodsList_1rb5x_gg_",
|
|
69
|
+
"__STooltip": "___STooltip_1rb5x_gg_",
|
|
70
|
+
"__SCompareToggle": "___SCompareToggle_1rb5x_gg_",
|
|
71
|
+
"__SPopper": "___SPopper_1rb5x_gg_"
|
|
70
72
|
});
|
|
71
73
|
var defaultAllowedParts = {
|
|
72
74
|
year: true,
|
|
@@ -75,22 +77,21 @@ var defaultAllowedParts = {
|
|
|
75
77
|
};
|
|
76
78
|
var exampleDate = new Date(2000, 4, 29);
|
|
77
79
|
var InputTriggerRoot = /*#__PURE__*/function (_Component) {
|
|
78
|
-
(0, _inherits2["default"])(InputTriggerRoot, _Component);
|
|
79
|
-
var _super = (0, _createSuper2["default"])(InputTriggerRoot);
|
|
80
80
|
function InputTriggerRoot() {
|
|
81
81
|
(0, _classCallCheck2["default"])(this, InputTriggerRoot);
|
|
82
|
-
return
|
|
82
|
+
return _callSuper(this, InputTriggerRoot, arguments);
|
|
83
83
|
}
|
|
84
|
-
(0,
|
|
84
|
+
(0, _inherits2["default"])(InputTriggerRoot, _Component);
|
|
85
|
+
return (0, _createClass2["default"])(InputTriggerRoot, [{
|
|
85
86
|
key: "getSingleDateInputProps",
|
|
86
87
|
value: function getSingleDateInputProps() {
|
|
87
88
|
var _this$asProps = this.asProps,
|
|
88
|
-
|
|
89
|
+
_children = _this$asProps.children,
|
|
89
90
|
id = _this$asProps.id,
|
|
90
|
-
|
|
91
|
+
_role = _this$asProps.role,
|
|
91
92
|
ariaHasPopup = _this$asProps['aria-haspopup'],
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
_ariaLabel = _this$asProps['aria-label'],
|
|
94
|
+
_style = _this$asProps.style,
|
|
94
95
|
otherProps = (0, _objectWithoutProperties2["default"])(_this$asProps, _excluded);
|
|
95
96
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
|
|
96
97
|
ariaHasPopup: ariaHasPopup,
|
|
@@ -101,12 +102,12 @@ var InputTriggerRoot = /*#__PURE__*/function (_Component) {
|
|
|
101
102
|
key: "getDateRangeProps",
|
|
102
103
|
value: function getDateRangeProps() {
|
|
103
104
|
var _this$asProps2 = this.asProps,
|
|
104
|
-
|
|
105
|
+
_children = _this$asProps2.children,
|
|
105
106
|
id = _this$asProps2.id,
|
|
106
|
-
|
|
107
|
+
_rolw = _this$asProps2.role,
|
|
107
108
|
ariaHasPopup = _this$asProps2['aria-haspopup'],
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
_ariaLabel = _this$asProps2['aria-label'],
|
|
110
|
+
_style = _this$asProps2.style,
|
|
110
111
|
otherProps = (0, _objectWithoutProperties2["default"])(_this$asProps2, _excluded2);
|
|
111
112
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
|
|
112
113
|
ariaHasPopup: ariaHasPopup,
|
|
@@ -129,7 +130,6 @@ var InputTriggerRoot = /*#__PURE__*/function (_Component) {
|
|
|
129
130
|
}, _ref))), /*#__PURE__*/_react["default"].createElement(Children, _ref8.cn("Children", {})));
|
|
130
131
|
}
|
|
131
132
|
}]);
|
|
132
|
-
return InputTriggerRoot;
|
|
133
133
|
}(_core.Component);
|
|
134
134
|
(0, _defineProperty2["default"])(InputTriggerRoot, "displayName", 'InputTrigger');
|
|
135
135
|
(0, _defineProperty2["default"])(InputTriggerRoot, "style", style);
|
|
@@ -138,37 +138,36 @@ var InputTriggerRoot = /*#__PURE__*/function (_Component) {
|
|
|
138
138
|
popoverVisible: true
|
|
139
139
|
});
|
|
140
140
|
var SingleDateInputRoot = /*#__PURE__*/function (_Component2) {
|
|
141
|
-
(0, _inherits2["default"])(SingleDateInputRoot, _Component2);
|
|
142
|
-
var _super2 = (0, _createSuper2["default"])(SingleDateInputRoot);
|
|
143
141
|
function SingleDateInputRoot() {
|
|
144
142
|
var _this;
|
|
145
143
|
(0, _classCallCheck2["default"])(this, SingleDateInputRoot);
|
|
146
144
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
147
145
|
args[_key] = arguments[_key];
|
|
148
146
|
}
|
|
149
|
-
_this =
|
|
150
|
-
(0, _defineProperty2["default"])(
|
|
147
|
+
_this = _callSuper(this, SingleDateInputRoot, [].concat(args));
|
|
148
|
+
(0, _defineProperty2["default"])(_this, "state", {
|
|
151
149
|
errorText: null,
|
|
152
150
|
showError: false,
|
|
153
151
|
focused: false
|
|
154
152
|
});
|
|
155
|
-
(0, _defineProperty2["default"])(
|
|
153
|
+
(0, _defineProperty2["default"])(_this, "handleFocus", function () {
|
|
156
154
|
_this.setState({
|
|
157
155
|
focused: true
|
|
158
156
|
});
|
|
159
157
|
});
|
|
160
|
-
(0, _defineProperty2["default"])(
|
|
158
|
+
(0, _defineProperty2["default"])(_this, "handleBlur", function () {
|
|
161
159
|
_this.setState({
|
|
162
160
|
focused: false
|
|
163
161
|
});
|
|
164
162
|
});
|
|
165
|
-
(0, _defineProperty2["default"])(
|
|
163
|
+
(0, _defineProperty2["default"])(_this, "handleInputMaskPipeBlock", function (value) {
|
|
166
164
|
if (value === _this.asProps.disabledDateInputAttempt) return;
|
|
167
165
|
_this.handlers.disabledDateInputAttempt(value);
|
|
168
166
|
});
|
|
169
167
|
return _this;
|
|
170
168
|
}
|
|
171
|
-
(0,
|
|
169
|
+
(0, _inherits2["default"])(SingleDateInputRoot, _Component2);
|
|
170
|
+
return (0, _createClass2["default"])(SingleDateInputRoot, [{
|
|
172
171
|
key: "uncontrolledProps",
|
|
173
172
|
value: function uncontrolledProps() {
|
|
174
173
|
var _this2 = this;
|
|
@@ -205,17 +204,17 @@ var SingleDateInputRoot = /*#__PURE__*/function (_Component2) {
|
|
|
205
204
|
onChange = _this$asProps4.onChange,
|
|
206
205
|
onDisplayedPeriodChange = _this$asProps4.onDisplayedPeriodChange,
|
|
207
206
|
locale = _this$asProps4.locale,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
_w = _this$asProps4.w,
|
|
208
|
+
_ariaHasPopup = _this$asProps4.ariaHasPopup,
|
|
209
|
+
_showError = _this$asProps4.showError,
|
|
211
210
|
otherProps = (0, _objectWithoutProperties2["default"])(_this$asProps4, _excluded3);
|
|
212
211
|
return (0, _objectSpread2["default"])({
|
|
213
|
-
date: value,
|
|
214
|
-
onDateChange: onChange,
|
|
212
|
+
'date': value,
|
|
213
|
+
'onDateChange': onChange,
|
|
215
214
|
onDisplayedPeriodChange: onDisplayedPeriodChange,
|
|
216
215
|
locale: locale,
|
|
217
216
|
'aria-haspopup': 'true',
|
|
218
|
-
onMaskPipeBlock: this.handleInputMaskPipeBlock
|
|
217
|
+
'onMaskPipeBlock': this.handleInputMaskPipeBlock
|
|
219
218
|
}, otherProps);
|
|
220
219
|
}
|
|
221
220
|
}, {
|
|
@@ -250,7 +249,6 @@ var SingleDateInputRoot = /*#__PURE__*/function (_Component2) {
|
|
|
250
249
|
}, _ref2))), /*#__PURE__*/_react["default"].createElement(_neighborLocation["default"], _ref9.cn("NeighborLocation", {}), /*#__PURE__*/_react["default"].createElement(Children, _ref9.cn("Children", {}))));
|
|
251
250
|
}
|
|
252
251
|
}]);
|
|
253
|
-
return SingleDateInputRoot;
|
|
254
252
|
}(_core.Component);
|
|
255
253
|
(0, _defineProperty2["default"])(SingleDateInputRoot, "displayName", 'SingleDateInput');
|
|
256
254
|
(0, _defineProperty2["default"])(SingleDateInputRoot, "style", style);
|
|
@@ -262,24 +260,22 @@ var SingleDateInputRoot = /*#__PURE__*/function (_Component2) {
|
|
|
262
260
|
showError: true
|
|
263
261
|
});
|
|
264
262
|
var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
265
|
-
(0, _inherits2["default"])(DateRangeRoot, _Component3);
|
|
266
|
-
var _super3 = (0, _createSuper2["default"])(DateRangeRoot);
|
|
267
263
|
function DateRangeRoot() {
|
|
268
264
|
var _this3;
|
|
269
265
|
(0, _classCallCheck2["default"])(this, DateRangeRoot);
|
|
270
266
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
271
267
|
args[_key2] = arguments[_key2];
|
|
272
268
|
}
|
|
273
|
-
_this3 =
|
|
274
|
-
(0, _defineProperty2["default"])(
|
|
269
|
+
_this3 = _callSuper(this, DateRangeRoot, [].concat(args));
|
|
270
|
+
(0, _defineProperty2["default"])(_this3, "state", {
|
|
275
271
|
containerFocused: false,
|
|
276
272
|
errorText: null,
|
|
277
273
|
showError: false,
|
|
278
274
|
lastChangedInput: 'from'
|
|
279
275
|
});
|
|
280
|
-
(0, _defineProperty2["default"])(
|
|
281
|
-
(0, _defineProperty2["default"])(
|
|
282
|
-
(0, _defineProperty2["default"])(
|
|
276
|
+
(0, _defineProperty2["default"])(_this3, "fromRef", /*#__PURE__*/_react["default"].createRef());
|
|
277
|
+
(0, _defineProperty2["default"])(_this3, "toRef", /*#__PURE__*/_react["default"].createRef());
|
|
278
|
+
(0, _defineProperty2["default"])(_this3, "handleFromChange", function (value, event) {
|
|
283
279
|
var _this3$asProps$value$, _this3$asProps$value, _this3$asProps$value$2, _this3$asProps$value2;
|
|
284
280
|
var onChange = _this3.asProps.onChange;
|
|
285
281
|
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];
|
|
@@ -293,13 +289,13 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
293
289
|
}, 0);
|
|
294
290
|
}
|
|
295
291
|
});
|
|
296
|
-
(0, _defineProperty2["default"])(
|
|
292
|
+
(0, _defineProperty2["default"])(_this3, "handleToChange", function (value, event) {
|
|
297
293
|
var _this3$asProps$value$3, _this3$asProps$value3, _this3$asProps$value$4, _this3$asProps$value4;
|
|
298
294
|
var onChange = _this3.asProps.onChange;
|
|
299
295
|
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];
|
|
300
296
|
onChange([prevValue[0], value], event);
|
|
301
297
|
});
|
|
302
|
-
(0, _defineProperty2["default"])(
|
|
298
|
+
(0, _defineProperty2["default"])(_this3, "handleFromKeydown", function (event) {
|
|
303
299
|
if (!_this3.toRef.current) return;
|
|
304
300
|
if (!_this3.fromRef.current) return;
|
|
305
301
|
_this3.setState({
|
|
@@ -312,7 +308,7 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
312
308
|
}, 0);
|
|
313
309
|
}
|
|
314
310
|
});
|
|
315
|
-
(0, _defineProperty2["default"])(
|
|
311
|
+
(0, _defineProperty2["default"])(_this3, "handleToKeydown", function (event) {
|
|
316
312
|
if (!_this3.toRef.current) return;
|
|
317
313
|
if (!_this3.fromRef.current) return;
|
|
318
314
|
_this3.setState({
|
|
@@ -333,21 +329,21 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
333
329
|
}, 0);
|
|
334
330
|
}
|
|
335
331
|
});
|
|
336
|
-
(0, _defineProperty2["default"])(
|
|
332
|
+
(0, _defineProperty2["default"])(_this3, "handleInputMaskPipeBlock", function (value) {
|
|
337
333
|
if (value === _this3.asProps.disabledDateInputAttempt) return;
|
|
338
334
|
_this3.handlers.disabledDateInputAttempt(value);
|
|
339
335
|
});
|
|
340
|
-
(0, _defineProperty2["default"])(
|
|
336
|
+
(0, _defineProperty2["default"])(_this3, "handleFocus", function () {
|
|
341
337
|
_this3.setState({
|
|
342
338
|
containerFocused: true
|
|
343
339
|
});
|
|
344
340
|
});
|
|
345
|
-
(0, _defineProperty2["default"])(
|
|
341
|
+
(0, _defineProperty2["default"])(_this3, "handleBlur", function () {
|
|
346
342
|
_this3.setState({
|
|
347
343
|
containerFocused: false
|
|
348
344
|
});
|
|
349
345
|
});
|
|
350
|
-
(0, _defineProperty2["default"])(
|
|
346
|
+
(0, _defineProperty2["default"])(_this3, "updateDisabledDateInputAttempt", function (value) {
|
|
351
347
|
var disabledDates = _this3.asProps.disabledDates;
|
|
352
348
|
var invalid = false;
|
|
353
349
|
if (value) {
|
|
@@ -363,7 +359,8 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
363
359
|
});
|
|
364
360
|
return _this3;
|
|
365
361
|
}
|
|
366
|
-
(0,
|
|
362
|
+
(0, _inherits2["default"])(DateRangeRoot, _Component3);
|
|
363
|
+
return (0, _createClass2["default"])(DateRangeRoot, [{
|
|
367
364
|
key: "uncontrolledProps",
|
|
368
365
|
value: function uncontrolledProps() {
|
|
369
366
|
var _this4 = this;
|
|
@@ -406,19 +403,19 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
406
403
|
locale = _this$asProps6.locale,
|
|
407
404
|
onDisplayedPeriodChange = _this$asProps6.onDisplayedPeriodChange,
|
|
408
405
|
ariaHasPopup = _this$asProps6.ariaHasPopup,
|
|
409
|
-
|
|
406
|
+
_showError = _this$asProps6.showError,
|
|
410
407
|
otherProps = (0, _objectWithoutProperties2["default"])(_this$asProps6, _excluded4);
|
|
411
408
|
return (0, _assignProps8["default"])({
|
|
412
|
-
ref: this.fromRef,
|
|
413
|
-
date: value === null || value === void 0 ? void 0 : value[0],
|
|
414
|
-
onDateChange: this.handleFromChange,
|
|
415
|
-
onKeyDown: this.handleFromKeydown,
|
|
409
|
+
'ref': this.fromRef,
|
|
410
|
+
'date': value === null || value === void 0 ? void 0 : value[0],
|
|
411
|
+
'onDateChange': this.handleFromChange,
|
|
412
|
+
'onKeyDown': this.handleFromKeydown,
|
|
416
413
|
locale: locale,
|
|
417
|
-
flex: 1,
|
|
414
|
+
'flex': 1,
|
|
418
415
|
onDisplayedPeriodChange: onDisplayedPeriodChange,
|
|
419
416
|
'aria-haspopup': ariaHasPopup,
|
|
420
|
-
onMaskPipeBlock: this.handleInputMaskPipeBlock,
|
|
421
|
-
containerFocused: this.state.containerFocused
|
|
417
|
+
'onMaskPipeBlock': this.handleInputMaskPipeBlock,
|
|
418
|
+
'containerFocused': this.state.containerFocused
|
|
422
419
|
}, otherProps);
|
|
423
420
|
}
|
|
424
421
|
}, {
|
|
@@ -429,24 +426,24 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
429
426
|
locale = _this$asProps7.locale,
|
|
430
427
|
onDisplayedPeriodChange = _this$asProps7.onDisplayedPeriodChange,
|
|
431
428
|
ariaHasPopup = _this$asProps7.ariaHasPopup,
|
|
432
|
-
|
|
433
|
-
|
|
429
|
+
_inputId = _this$asProps7.inputId,
|
|
430
|
+
_showError = _this$asProps7.showError,
|
|
434
431
|
otherProps = (0, _objectWithoutProperties2["default"])(_this$asProps7, _excluded5);
|
|
435
432
|
var ariaLabel = this.asProps.getI18nText('toDate', {
|
|
436
433
|
date: this.asProps.getI18nText('input')
|
|
437
434
|
});
|
|
438
435
|
return (0, _assignProps8["default"])({
|
|
439
|
-
ref: this.toRef,
|
|
440
|
-
date: value === null || value === void 0 ? void 0 : value[1],
|
|
441
|
-
onDateChange: this.handleToChange,
|
|
442
|
-
onKeyDown: this.handleToKeydown,
|
|
436
|
+
'ref': this.toRef,
|
|
437
|
+
'date': value === null || value === void 0 ? void 0 : value[1],
|
|
438
|
+
'onDateChange': this.handleToChange,
|
|
439
|
+
'onKeyDown': this.handleToKeydown,
|
|
443
440
|
locale: locale,
|
|
444
|
-
flex: 1,
|
|
441
|
+
'flex': 1,
|
|
445
442
|
onDisplayedPeriodChange: onDisplayedPeriodChange,
|
|
446
443
|
'aria-label': ariaLabel,
|
|
447
444
|
'aria-haspopup': ariaHasPopup,
|
|
448
|
-
onMaskPipeBlock: this.handleInputMaskPipeBlock,
|
|
449
|
-
containerFocused: this.state.containerFocused
|
|
445
|
+
'onMaskPipeBlock': this.handleInputMaskPipeBlock,
|
|
446
|
+
'containerFocused': this.state.containerFocused
|
|
450
447
|
}, otherProps);
|
|
451
448
|
}
|
|
452
449
|
}, {
|
|
@@ -473,7 +470,7 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
473
470
|
key: "render",
|
|
474
471
|
value: function render() {
|
|
475
472
|
var _ref3 = this.asProps,
|
|
476
|
-
|
|
473
|
+
_ref0;
|
|
477
474
|
var SDateRange = _inputMask["default"];
|
|
478
475
|
var _this$asProps8 = this.asProps,
|
|
479
476
|
Children = _this$asProps8.Children,
|
|
@@ -488,7 +485,7 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
488
485
|
showErrorState = _this$state2.showError,
|
|
489
486
|
containerFocused = _this$state2.containerFocused;
|
|
490
487
|
var showError = showErrorState && showErrorProps;
|
|
491
|
-
return
|
|
488
|
+
return _ref0 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SDateRange, _ref0.cn("SDateRange", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
492
489
|
"tag": _tooltip["default"],
|
|
493
490
|
"ignorePortalsStacking": true,
|
|
494
491
|
"placement": lastChangedInput === 'to' ? 'top-end' : 'top-start',
|
|
@@ -500,10 +497,9 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
500
497
|
"w": w,
|
|
501
498
|
"onFocus": this.handleFocus,
|
|
502
499
|
"onBlur": this.handleBlur
|
|
503
|
-
}, _ref3))), /*#__PURE__*/_react["default"].createElement(Children,
|
|
500
|
+
}, _ref3))), /*#__PURE__*/_react["default"].createElement(Children, _ref0.cn("Children", {})));
|
|
504
501
|
}
|
|
505
502
|
}]);
|
|
506
|
-
return DateRangeRoot;
|
|
507
503
|
}(_core.Component);
|
|
508
504
|
(0, _defineProperty2["default"])(DateRangeRoot, "displayName", 'DateRange');
|
|
509
505
|
(0, _defineProperty2["default"])(DateRangeRoot, "style", style);
|
|
@@ -516,27 +512,27 @@ var DateRangeRoot = /*#__PURE__*/function (_Component3) {
|
|
|
516
512
|
});
|
|
517
513
|
var FromMaskedInput = function FromMaskedInput(props) {
|
|
518
514
|
var _ref4 = arguments[0],
|
|
519
|
-
|
|
515
|
+
_ref1;
|
|
520
516
|
var SFromMaskedInput = MaskedInput;
|
|
521
517
|
var getI18nText = props.getI18nText;
|
|
522
|
-
return
|
|
518
|
+
return _ref1 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SFromMaskedInput, _ref1.cn("SFromMaskedInput", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
523
519
|
"labelPrefix": getI18nText('fromDatePlaceholder')
|
|
524
520
|
}, _ref4))));
|
|
525
521
|
};
|
|
526
522
|
var ToMaskedInput = function ToMaskedInput(props) {
|
|
527
523
|
var _ref5 = arguments[0],
|
|
528
|
-
|
|
524
|
+
_ref10;
|
|
529
525
|
var SToMaskedInput = MaskedInput;
|
|
530
526
|
var getI18nText = props.getI18nText;
|
|
531
|
-
return
|
|
527
|
+
return _ref10 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SToMaskedInput, _ref10.cn("SToMaskedInput", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
532
528
|
"labelPrefix": getI18nText('toDatePlaceholder')
|
|
533
529
|
}, _ref5))));
|
|
534
530
|
};
|
|
535
531
|
var Indicator = function Indicator(props) {
|
|
536
532
|
var _ref6 = arguments[0],
|
|
537
|
-
|
|
533
|
+
_ref11;
|
|
538
534
|
var SIndicator = _inputMask["default"].Addon;
|
|
539
|
-
return
|
|
535
|
+
return _ref11 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SIndicator, _ref11.cn("SIndicator", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
540
536
|
"tag": _m["default"],
|
|
541
537
|
"aria-hidden": 'true',
|
|
542
538
|
"tabIndex": -1
|
|
@@ -544,9 +540,9 @@ var Indicator = function Indicator(props) {
|
|
|
544
540
|
};
|
|
545
541
|
var RangeSep = function RangeSep(props) {
|
|
546
542
|
var _ref7 = arguments[0],
|
|
547
|
-
|
|
543
|
+
_ref12;
|
|
548
544
|
var SRangeSep = _inputMask["default"].Addon;
|
|
549
|
-
return
|
|
545
|
+
return _ref12 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SRangeSep, _ref12.cn("SRangeSep", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
550
546
|
"tag": _flexBox.Flex,
|
|
551
547
|
"alignItems": 'center',
|
|
552
548
|
"justifyContent": 'center',
|
|
@@ -554,30 +550,30 @@ var RangeSep = function RangeSep(props) {
|
|
|
554
550
|
"flex": '0'
|
|
555
551
|
}, _ref7))), "\u2013");
|
|
556
552
|
};
|
|
557
|
-
var MaskedInput = function MaskedInput(
|
|
558
|
-
var
|
|
559
|
-
var outerValue =
|
|
560
|
-
onDateChange =
|
|
561
|
-
onDisplayedPeriodChange =
|
|
562
|
-
locale =
|
|
563
|
-
styles =
|
|
564
|
-
|
|
565
|
-
allowedParts =
|
|
566
|
-
disabledDates =
|
|
567
|
-
forwardRef =
|
|
568
|
-
providedPlaceholders =
|
|
569
|
-
|
|
570
|
-
labelPrefix =
|
|
571
|
-
onMaskPipeBlock =
|
|
572
|
-
containerFocused =
|
|
573
|
-
animationsDisabled =
|
|
574
|
-
getI18nText =
|
|
575
|
-
inputId =
|
|
576
|
-
|
|
577
|
-
inputRole =
|
|
578
|
-
__excludeProps =
|
|
579
|
-
_root =
|
|
580
|
-
otherProps = (0, _objectWithoutProperties2["default"])(
|
|
553
|
+
var MaskedInput = function MaskedInput(_ref14) {
|
|
554
|
+
var _ref13;
|
|
555
|
+
var outerValue = _ref14.date,
|
|
556
|
+
onDateChange = _ref14.onDateChange,
|
|
557
|
+
onDisplayedPeriodChange = _ref14.onDisplayedPeriodChange,
|
|
558
|
+
locale = _ref14.locale,
|
|
559
|
+
styles = _ref14.styles,
|
|
560
|
+
_ref14$parts = _ref14.parts,
|
|
561
|
+
allowedParts = _ref14$parts === void 0 ? defaultAllowedParts : _ref14$parts,
|
|
562
|
+
disabledDates = _ref14.disabledDates,
|
|
563
|
+
forwardRef = _ref14.forwardRef,
|
|
564
|
+
providedPlaceholders = _ref14.placeholders,
|
|
565
|
+
_ref14$labelPrefix = _ref14.labelPrefix,
|
|
566
|
+
labelPrefix = _ref14$labelPrefix === void 0 ? 'Date' : _ref14$labelPrefix,
|
|
567
|
+
onMaskPipeBlock = _ref14.onMaskPipeBlock,
|
|
568
|
+
containerFocused = _ref14.containerFocused,
|
|
569
|
+
animationsDisabled = _ref14.animationsDisabled,
|
|
570
|
+
getI18nText = _ref14.getI18nText,
|
|
571
|
+
inputId = _ref14.inputId,
|
|
572
|
+
_ref14$inputRole = _ref14.inputRole,
|
|
573
|
+
inputRole = _ref14$inputRole === void 0 ? 'combobox' : _ref14$inputRole,
|
|
574
|
+
__excludeProps = _ref14.__excludeProps,
|
|
575
|
+
_root = _ref14.Root,
|
|
576
|
+
otherProps = (0, _objectWithoutProperties2["default"])(_ref14, _excluded6);
|
|
581
577
|
var ref = _react["default"].useRef();
|
|
582
578
|
var _React$useState = _react["default"].useState(undefined),
|
|
583
579
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
@@ -598,7 +594,6 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
598
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);
|
|
599
595
|
}
|
|
600
596
|
var _React$useMemo = _react["default"].useMemo(function () {
|
|
601
|
-
var _sep;
|
|
602
597
|
var options = {
|
|
603
598
|
year: 'numeric',
|
|
604
599
|
month: 'numeric',
|
|
@@ -625,7 +620,7 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
625
620
|
} finally {
|
|
626
621
|
_iterator.f();
|
|
627
622
|
}
|
|
628
|
-
sep =
|
|
623
|
+
sep = sep !== null && sep !== void 0 ? sep : ' ';
|
|
629
624
|
return {
|
|
630
625
|
sep: sep,
|
|
631
626
|
order: order
|
|
@@ -691,7 +686,7 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
691
686
|
}
|
|
692
687
|
}
|
|
693
688
|
if (placeholdersOnly) {
|
|
694
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
689
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(null);
|
|
695
690
|
return '';
|
|
696
691
|
}
|
|
697
692
|
var getOffsetTo = function getOffsetTo(partName) {
|
|
@@ -727,20 +722,20 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
727
722
|
month = parsed.month,
|
|
728
723
|
day = parsed.day;
|
|
729
724
|
if (allowedParts.month) {
|
|
730
|
-
if (month[0] !== '_' && parseInt(month[0], 10) > 1) {
|
|
725
|
+
if (month[0] !== '_' && Number.parseInt(month[0], 10) > 1) {
|
|
731
726
|
month = "0".concat(month[0]);
|
|
732
727
|
indexesOfPipedChars.push(getOffsetTo('month'));
|
|
733
728
|
}
|
|
734
729
|
if (month === '00') month = '01';
|
|
735
|
-
if (month[0] !== '_' && month[1] !== '_' && parseInt(month, 10) > 12) return false;
|
|
730
|
+
if (month[0] !== '_' && month[1] !== '_' && Number.parseInt(month, 10) > 12) return false;
|
|
736
731
|
}
|
|
737
732
|
if (allowedParts.day) {
|
|
738
|
-
if (day[0] !== '_' && parseInt(day[0], 10) > 3) {
|
|
733
|
+
if (day[0] !== '_' && Number.parseInt(day[0], 10) > 3) {
|
|
739
734
|
day = "0".concat(day[0]);
|
|
740
735
|
indexesOfPipedChars.push(getOffsetTo('day'));
|
|
741
736
|
}
|
|
742
737
|
if (day === '00') day = '01';
|
|
743
|
-
if (day[0] !== '_' && day[1] !== '_' && parseInt(day, 10) > 31) return false;
|
|
738
|
+
if (day[0] !== '_' && day[1] !== '_' && Number.parseInt(day, 10) > 31) return false;
|
|
744
739
|
}
|
|
745
740
|
year = year.split('').map(function (_char) {
|
|
746
741
|
return _char === '_' ? placeholders.year : _char;
|
|
@@ -757,17 +752,17 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
757
752
|
var fulfilled = yearFulfilled && monthFulfilled && dayFulfilled;
|
|
758
753
|
if (fulfilled) {
|
|
759
754
|
var date = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
760
|
-
var yearParsed = allowedParts.year ? parseInt(year, 10) : 0;
|
|
761
|
-
var monthParsed = allowedParts.month ? parseInt(month, 10) - 1 : 0;
|
|
762
|
-
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;
|
|
763
758
|
date.setFullYear(yearParsed, monthParsed, dayParsed);
|
|
764
759
|
if (disabledDates !== null && disabledDates !== void 0 && disabledDates.some((0, _includesDate.includesDate)((0, _dayjs["default"])(date), 'date'))) {
|
|
765
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
760
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(date);
|
|
766
761
|
return false;
|
|
767
762
|
}
|
|
768
763
|
if (allowedParts.day) {
|
|
769
|
-
if (date.getDate() !== parseInt(day, 10)) {
|
|
770
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
764
|
+
if (date.getDate() !== Number.parseInt(day, 10)) {
|
|
765
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(date);
|
|
771
766
|
return false;
|
|
772
767
|
}
|
|
773
768
|
}
|
|
@@ -787,7 +782,7 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
787
782
|
} finally {
|
|
788
783
|
_iterator4.f();
|
|
789
784
|
}
|
|
790
|
-
onMaskPipeBlock === null || onMaskPipeBlock === void 0
|
|
785
|
+
onMaskPipeBlock === null || onMaskPipeBlock === void 0 || onMaskPipeBlock(null);
|
|
791
786
|
return {
|
|
792
787
|
value: result.join(sep),
|
|
793
788
|
indexesOfPipedChars: indexesOfPipedChars
|
|
@@ -816,9 +811,9 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
816
811
|
var fulfilled = yearFulfilled && monthFulfilled && dayFulfilled;
|
|
817
812
|
if (fulfilled) {
|
|
818
813
|
var date = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
819
|
-
var yearParsed = allowedParts.year ? parseInt(year, 10) : 0;
|
|
820
|
-
var monthParsed = allowedParts.month ? parseInt(month, 10) - 1 : 0;
|
|
821
|
-
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;
|
|
822
817
|
date.setFullYear(yearParsed, monthParsed, dayParsed);
|
|
823
818
|
onDateChange(date);
|
|
824
819
|
lastKnownOuterValue.current = {
|
|
@@ -834,9 +829,9 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
834
829
|
}
|
|
835
830
|
if (yearFulfilled && allowedParts.year) {
|
|
836
831
|
var _date = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
837
|
-
_date.setFullYear(parseInt(year, 10));
|
|
832
|
+
_date.setFullYear(Number.parseInt(year, 10));
|
|
838
833
|
if (monthFulfilled && allowedParts.month) {
|
|
839
|
-
_date.setMonth(parseInt(month, 10) - 1);
|
|
834
|
+
_date.setMonth(Number.parseInt(month, 10) - 1);
|
|
840
835
|
}
|
|
841
836
|
onDisplayedPeriodChange(_date);
|
|
842
837
|
}
|
|
@@ -860,12 +855,10 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
860
855
|
return result.join(sep);
|
|
861
856
|
}, [sep, order, placeholders]);
|
|
862
857
|
var aliases = _react["default"].useMemo(function () {
|
|
863
|
-
|
|
864
|
-
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/);
|
|
865
859
|
}, [placeholders]);
|
|
866
860
|
var maskOnlySymbols = _react["default"].useMemo(function () {
|
|
867
|
-
|
|
868
|
-
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);
|
|
869
862
|
}, [sep, placeholders]);
|
|
870
863
|
var humanizedDate = _react["default"].useMemo(function () {
|
|
871
864
|
var outerDate = outerValue;
|
|
@@ -888,8 +881,8 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
888
881
|
var computedStyle = window.getComputedStyle(ref.current);
|
|
889
882
|
var typographyRelatedStyles = ['height', 'font-size', 'font-family', 'font-weight', 'font-style', 'line-height', 'letter-spacing', 'text-transform', 'word-spacing'];
|
|
890
883
|
for (var _i2 = 0, _typographyRelatedSty = typographyRelatedStyles; _i2 < _typographyRelatedSty.length; _i2++) {
|
|
891
|
-
var
|
|
892
|
-
measureSpan.style[
|
|
884
|
+
var _style2 = _typographyRelatedSty[_i2];
|
|
885
|
+
measureSpan.style[_style2] = computedStyle[_style2];
|
|
893
886
|
}
|
|
894
887
|
measureSpan.style.position = 'absolute';
|
|
895
888
|
measureSpan.style.visibility = 'hidden';
|
|
@@ -920,19 +913,19 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
920
913
|
var focused = containerFocused !== null && containerFocused !== void 0 ? containerFocused : innerFocused;
|
|
921
914
|
var handleFocus = _react["default"].useCallback(function (event) {
|
|
922
915
|
var _otherProps$onFocus;
|
|
923
|
-
(_otherProps$onFocus = otherProps.onFocus) === null || _otherProps$onFocus === void 0
|
|
916
|
+
(_otherProps$onFocus = otherProps.onFocus) === null || _otherProps$onFocus === void 0 || _otherProps$onFocus.call(otherProps, event);
|
|
924
917
|
setInnerFocused(true);
|
|
925
918
|
}, []);
|
|
926
919
|
var handleBlur = _react["default"].useCallback(function (event) {
|
|
927
920
|
var _otherProps$onBlur;
|
|
928
|
-
(_otherProps$onBlur = otherProps.onBlur) === null || _otherProps$onBlur === void 0
|
|
921
|
+
(_otherProps$onBlur = otherProps.onBlur) === null || _otherProps$onBlur === void 0 || _otherProps$onBlur.call(otherProps, event);
|
|
929
922
|
setInnerFocused(false);
|
|
930
923
|
}, []);
|
|
931
924
|
(0, _useEnhancedEffect["default"])(function () {
|
|
932
925
|
if (focused) return;
|
|
933
926
|
setAppliedWidth(width);
|
|
934
927
|
}, [width, focused]);
|
|
935
|
-
return
|
|
928
|
+
return _ref13 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_inputMask["default"].Value, (0, _extends2["default"])({
|
|
936
929
|
"aria-label": labelPrefix,
|
|
937
930
|
title: mask,
|
|
938
931
|
mask: mask,
|
|
@@ -953,8 +946,8 @@ var MaskedInput = function MaskedInput(_ref16) {
|
|
|
953
946
|
noHumanizedDate: !humanizedDate,
|
|
954
947
|
animationsDisabled: animationsDisabled,
|
|
955
948
|
inputRole: inputRole,
|
|
956
|
-
inputMode:
|
|
957
|
-
}), humanizedDate && /*#__PURE__*/_react["default"].createElement(SHumanizedDate,
|
|
949
|
+
inputMode: "numeric"
|
|
950
|
+
}), humanizedDate && /*#__PURE__*/_react["default"].createElement(SHumanizedDate, _ref13.cn("SHumanizedDate", {}), humanizedDate));
|
|
958
951
|
};
|
|
959
952
|
var SingleDateInput = (0, _core.createComponent)(SingleDateInputRoot, {
|
|
960
953
|
Indicator: Indicator,
|
|
@@ -971,6 +964,5 @@ var InputTrigger = (0, _core.createComponent)(InputTriggerRoot, {
|
|
|
971
964
|
SingleDateInput: SingleDateInput,
|
|
972
965
|
DateRange: DateRange
|
|
973
966
|
});
|
|
974
|
-
var _default = InputTrigger;
|
|
975
|
-
exports["default"] = _default;
|
|
967
|
+
var _default = exports["default"] = InputTrigger;
|
|
976
968
|
//# sourceMappingURL=InputTrigger.js.map
|