@zohodesk/components 1.0.0-temp-158 → 1.0.0-temp-160
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/es/Accordion/Accordion.js +3 -7
- package/es/Accordion/AccordionItem.js +2 -4
- package/es/Animation/Animation.js +3 -3
- package/es/AppContainer/AppContainer.js +5 -13
- package/es/Avatar/Avatar.js +11 -23
- package/es/AvatarTeam/AvatarTeam.js +3 -3
- package/es/Button/Button.js +3 -4
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Card/Card.js +10 -21
- package/es/CheckBox/CheckBox.js +3 -5
- package/es/DateTime/CalendarView.js +20 -32
- package/es/DateTime/DateTime.js +6 -67
- package/es/DateTime/DateTimePopupFooter.js +2 -4
- package/es/DateTime/DateTimePopupHeader.js +2 -8
- package/es/DateTime/DateWidget.js +35 -98
- package/es/DateTime/DaysRow.js +2 -4
- package/es/DateTime/Time.js +2 -10
- package/es/DateTime/YearView.js +4 -28
- package/es/DateTime/__tests__/CalendarView.spec.js +0 -1
- package/es/DateTime/__tests__/DateTime.spec.js +0 -1
- package/es/DateTime/__tests__/DateWidget.spec.js +3 -2
- package/es/DateTime/common.js +0 -3
- package/es/DateTime/constants.js +0 -1
- package/es/DateTime/dateFormatUtils/dateFormat.js +30 -63
- package/es/DateTime/dateFormatUtils/dateFormats.js +1 -0
- package/es/DateTime/dateFormatUtils/dayChange.js +4 -13
- package/es/DateTime/dateFormatUtils/index.js +2 -32
- package/es/DateTime/dateFormatUtils/monthChange.js +0 -8
- package/es/DateTime/dateFormatUtils/timeChange.js +6 -22
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -11
- package/es/DateTime/objectUtils.js +20 -14
- package/es/DateTime/typeChecker.js +0 -3
- package/es/DateTime/validator.js +6 -58
- package/es/DropBox/DropBox.js +2 -6
- package/es/DropBox/DropBoxElement/DropBoxElement.js +0 -7
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +3 -5
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +0 -3
- package/es/DropBox/props/defaultProps.js +2 -1
- package/es/DropBox/props/propTypes.js +2 -1
- package/es/DropDown/DropDown.js +4 -8
- package/es/DropDown/DropDownHeading.js +5 -4
- package/es/DropDown/DropDownItem.js +0 -6
- package/es/DropDown/DropDownSearch.js +0 -4
- package/es/DropDown/DropDownSeparator.js +0 -1
- package/es/DropDown/__tests__/DropDown.spec.js +2 -1
- package/es/Heading/Heading.js +3 -2
- package/es/Label/Label.js +3 -2
- package/es/Layout/Box.js +0 -13
- package/es/Layout/Container.js +1 -12
- package/es/Layout/index.js +2 -1
- package/es/ListItem/ListContainer.js +3 -8
- package/es/ListItem/ListItem.js +3 -9
- package/es/ListItem/ListItemWithAvatar.js +3 -9
- package/es/ListItem/ListItemWithCheckBox.js +2 -7
- package/es/ListItem/ListItemWithIcon.js +3 -8
- package/es/ListItem/ListItemWithRadio.js +3 -7
- package/es/Modal/Modal.js +11 -28
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +13 -89
- package/es/MultiSelect/AdvancedMultiSelect.js +9 -32
- package/es/MultiSelect/EmptyState.js +0 -2
- package/es/MultiSelect/MultiSelect.js +32 -99
- package/es/MultiSelect/MultiSelectHeader.js +0 -3
- package/es/MultiSelect/MultiSelectWithAvatar.js +6 -12
- package/es/MultiSelect/SelectedOptions.js +3 -6
- package/es/MultiSelect/Suggestions.js +3 -7
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +6 -4
- package/es/MultiSelect/props/propTypes.js +0 -2
- package/es/PopOver/PopOver.js +2 -18
- package/es/PopOver/__tests__/PopOver.spec.js +1 -2
- package/es/Popup/Popup.js +24 -77
- package/es/Popup/__tests__/Popup.spec.js +5 -17
- package/es/Popup/viewPort.js +4 -16
- package/es/Provider/IdProvider.js +5 -10
- package/es/Provider/LibraryContext.js +4 -6
- package/es/Provider/NumberGenerator/NumberGenerator.js +7 -21
- package/es/Provider/ZindexProvider.js +2 -9
- package/es/Radio/Radio.js +2 -4
- package/es/Responsive/CustomResponsive.js +18 -30
- package/es/Responsive/RefWrapper.js +7 -6
- package/es/Responsive/ResizeComponent.js +25 -35
- package/es/Responsive/ResizeObserver.js +6 -26
- package/es/Responsive/Responsive.js +20 -34
- package/es/Responsive/index.js +3 -1
- package/es/Responsive/sizeObservers.js +7 -28
- package/es/Responsive/utils/index.js +5 -7
- package/es/Responsive/utils/shallowCompare.js +2 -7
- package/es/Responsive/windowResizeObserver.js +0 -7
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +0 -4
- package/es/Ribbon/Ribbon.js +2 -3
- package/es/RippleEffect/RippleEffect.js +3 -1
- package/es/Select/GroupSelect.js +14 -58
- package/es/Select/Select.js +33 -79
- package/es/Select/SelectWithAvatar.js +4 -17
- package/es/Select/SelectWithIcon.js +5 -46
- package/es/Select/__tests__/Select.spec.js +8 -6
- package/es/Select/props/propTypes.js +0 -1
- package/es/Stencils/Stencils.js +3 -3
- package/es/Switch/Switch.js +3 -5
- package/es/Tab/Tab.js +4 -4
- package/es/Tab/TabContent.js +0 -1
- package/es/Tab/TabContentWrapper.js +0 -2
- package/es/Tab/TabWrapper.js +2 -5
- package/es/Tab/Tabs.js +7 -54
- package/es/Tab/__tests__/Tab.spec.js +3 -1
- package/es/Tab/__tests__/TabWrapper.spec.js +0 -1
- package/es/Tag/Tag.js +3 -6
- package/es/TextBox/TextBox.js +3 -15
- package/es/TextBox/__tests__/TextBox.spec.js +4 -1
- package/es/TextBoxIcon/TextBoxIcon.js +2 -9
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +7 -2
- package/es/Textarea/Textarea.js +3 -12
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Tooltip/Tooltip.js +14 -58
- package/es/Tooltip/__tests__/Tooltip.spec.js +0 -5
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +2 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +5 -7
- package/es/deprecated/PortalLayer/PortalLayer.js +20 -25
- package/es/semantic/Button/Button.js +2 -3
- package/es/utils/Common.js +9 -54
- package/es/utils/ContextOptimizer.js +5 -4
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +0 -2
- package/es/utils/css/compileClassNames.js +0 -5
- package/es/utils/css/mergeStyle.js +6 -7
- package/es/utils/css/utils.js +0 -1
- package/es/utils/datetime/common.js +5 -16
- package/es/utils/debounce.js +1 -5
- package/es/utils/dropDownUtils.js +11 -68
- package/es/utils/getInitial.js +0 -4
- package/es/utils/shallowEqual.js +0 -6
- package/lib/Accordion/Accordion.js +18 -42
- package/lib/Accordion/AccordionItem.js +18 -40
- package/lib/Accordion/__tests__/Accordion.spec.js +0 -3
- package/lib/Accordion/index.js +0 -3
- package/lib/Accordion/props/propTypes.js +0 -3
- package/lib/Animation/Animation.js +18 -38
- package/lib/Animation/__tests__/Animation.spec.js +7 -11
- package/lib/Animation/props/propTypes.js +0 -3
- package/lib/AppContainer/AppContainer.js +21 -56
- package/lib/AppContainer/props/propTypes.js +0 -3
- package/lib/Avatar/Avatar.js +38 -78
- package/lib/Avatar/__tests__/Avatar.spec.js +0 -44
- package/lib/Avatar/props/propTypes.js +0 -3
- package/lib/AvatarTeam/AvatarTeam.js +30 -52
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -13
- package/lib/AvatarTeam/props/propTypes.js +0 -3
- package/lib/Button/Button.js +20 -31
- package/lib/Button/css/cssJSLogic.js +17 -18
- package/lib/Button/index.js +0 -3
- package/lib/Button/props/defaultProps.js +0 -2
- package/lib/Button/props/propTypes.js +0 -3
- package/lib/Buttongroup/Buttongroup.js +12 -32
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +0 -10
- package/lib/Buttongroup/props/propTypes.js +0 -3
- package/lib/Card/Card.js +46 -102
- package/lib/Card/__tests__/Card.spec.js +1 -10
- package/lib/Card/index.js +0 -4
- package/lib/Card/props/propTypes.js +0 -3
- package/lib/CheckBox/CheckBox.js +47 -71
- package/lib/CheckBox/__tests__/CheckBox.spec.js +0 -3
- package/lib/CheckBox/props/propTypes.js +0 -3
- package/lib/DateTime/CalendarView.js +42 -82
- package/lib/DateTime/DateTime.js +156 -240
- package/lib/DateTime/DateTimePopupFooter.js +8 -31
- package/lib/DateTime/DateTimePopupHeader.js +17 -48
- package/lib/DateTime/DateWidget.js +250 -352
- package/lib/DateTime/DaysRow.js +5 -27
- package/lib/DateTime/Time.js +32 -73
- package/lib/DateTime/YearView.js +28 -77
- package/lib/DateTime/__tests__/CalendarView.spec.js +5 -13
- package/lib/DateTime/__tests__/DateTime.spec.js +37 -51
- package/lib/DateTime/__tests__/DateWidget.spec.js +8 -10
- package/lib/DateTime/common.js +0 -6
- package/lib/DateTime/constants.js +0 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +122 -184
- package/lib/DateTime/dateFormatUtils/dateFormats.js +1 -0
- package/lib/DateTime/dateFormatUtils/dayChange.js +7 -14
- package/lib/DateTime/dateFormatUtils/index.js +16 -74
- package/lib/DateTime/dateFormatUtils/monthChange.js +9 -19
- package/lib/DateTime/dateFormatUtils/timeChange.js +22 -54
- package/lib/DateTime/dateFormatUtils/yearChange.js +11 -22
- package/lib/DateTime/index.js +0 -2
- package/lib/DateTime/objectUtils.js +20 -24
- package/lib/DateTime/props/propTypes.js +1 -11
- package/lib/DateTime/typeChecker.js +0 -4
- package/lib/DateTime/validator.js +10 -73
- package/lib/DropBox/DropBox.js +10 -34
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +37 -58
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +33 -41
- package/lib/DropBox/DropBoxElement/props/propTypes.js +0 -3
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +9 -14
- package/lib/DropBox/__tests__/DropBox.spec.js +2 -6
- package/lib/DropBox/css/cssJSLogic.js +1 -3
- package/lib/DropBox/props/defaultProps.js +4 -8
- package/lib/DropBox/props/propTypes.js +4 -10
- package/lib/DropDown/DropDown.js +8 -52
- package/lib/DropDown/DropDownHeading.js +20 -39
- package/lib/DropDown/DropDownItem.js +20 -42
- package/lib/DropDown/DropDownSearch.js +17 -40
- package/lib/DropDown/DropDownSeparator.js +4 -24
- package/lib/DropDown/__tests__/DropDown.spec.js +9 -15
- package/lib/DropDown/__tests__/DropDownItem.spec.js +4 -9
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +0 -3
- package/lib/DropDown/index.js +0 -9
- package/lib/DropDown/props/propTypes.js +4 -6
- package/lib/Heading/Heading.js +15 -37
- package/lib/Heading/props/propTypes.js +0 -3
- package/lib/Label/Label.js +19 -39
- package/lib/Label/__tests__/Label.spec.js +1 -14
- package/lib/Label/props/propTypes.js +0 -3
- package/lib/Layout/Box.js +11 -31
- package/lib/Layout/Container.js +10 -29
- package/lib/Layout/__tests__/Box.spec.js +49 -65
- package/lib/Layout/__tests__/Container.spec.js +50 -67
- package/lib/Layout/index.js +0 -3
- package/lib/Layout/props/propTypes.js +0 -3
- package/lib/Layout/utils.js +0 -10
- package/lib/ListItem/ListContainer.js +27 -48
- package/lib/ListItem/ListItem.js +45 -69
- package/lib/ListItem/ListItemWithAvatar.js +48 -75
- package/lib/ListItem/ListItemWithCheckBox.js +39 -64
- package/lib/ListItem/ListItemWithIcon.js +44 -68
- package/lib/ListItem/ListItemWithRadio.js +41 -65
- package/lib/ListItem/index.js +0 -7
- package/lib/ListItem/props/propTypes.js +4 -6
- package/lib/Modal/Modal.js +10 -45
- package/lib/Modal/props/propTypes.js +0 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +166 -294
- package/lib/MultiSelect/AdvancedMultiSelect.js +125 -202
- package/lib/MultiSelect/EmptyState.js +24 -45
- package/lib/MultiSelect/MultiSelect.js +206 -323
- package/lib/MultiSelect/MultiSelectHeader.js +8 -30
- package/lib/MultiSelect/MultiSelectWithAvatar.js +63 -105
- package/lib/MultiSelect/SelectedOptions.js +17 -43
- package/lib/MultiSelect/Suggestions.js +32 -64
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +75 -86
- package/lib/MultiSelect/index.js +0 -5
- package/lib/MultiSelect/props/defaultProps.js +0 -2
- package/lib/MultiSelect/props/propTypes.js +0 -5
- package/lib/PopOver/PopOver.js +49 -95
- package/lib/PopOver/__tests__/PopOver.spec.js +1 -4
- package/lib/PopOver/index.js +0 -4
- package/lib/PopOver/props/propTypes.js +0 -3
- package/lib/Popup/Popup.js +81 -158
- package/lib/Popup/__tests__/Popup.spec.js +8 -43
- package/lib/Popup/viewPort.js +14 -28
- package/lib/Provider/AvatarSize.js +0 -4
- package/lib/Provider/Config.js +0 -2
- package/lib/Provider/CssProvider.js +0 -4
- package/lib/Provider/IdProvider.js +6 -17
- package/lib/Provider/LibraryContext.js +15 -35
- package/lib/Provider/LibraryContextInit.js +0 -4
- package/lib/Provider/NumberGenerator/NumberGenerator.js +15 -44
- package/lib/Provider/ZindexProvider.js +3 -15
- package/lib/Provider/index.js +0 -5
- package/lib/Radio/Radio.js +38 -61
- package/lib/Radio/__tests__/Radiospec.js +5 -9
- package/lib/Radio/props/propTypes.js +0 -3
- package/lib/Responsive/CustomResponsive.js +29 -73
- package/lib/Responsive/RefWrapper.js +11 -17
- package/lib/Responsive/ResizeComponent.js +36 -62
- package/lib/Responsive/ResizeObserver.js +10 -24
- package/lib/Responsive/Responsive.js +30 -80
- package/lib/Responsive/index.js +0 -4
- package/lib/Responsive/props/propTypes.js +0 -3
- package/lib/Responsive/sizeObservers.js +17 -53
- package/lib/Responsive/utils/index.js +3 -11
- package/lib/Responsive/utils/shallowCompare.js +2 -11
- package/lib/Responsive/windowResizeObserver.js +0 -8
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +17 -45
- package/lib/ResponsiveDropBox/props/propTypes.js +0 -3
- package/lib/Ribbon/Ribbon.js +13 -33
- package/lib/Ribbon/__tests__/Ribbon.spec.js +0 -22
- package/lib/Ribbon/props/propTypes.js +0 -3
- package/lib/RippleEffect/RippleEffect.js +10 -18
- package/lib/RippleEffect/props/propTypes.js +0 -3
- package/lib/Select/GroupSelect.js +130 -229
- package/lib/Select/Select.js +209 -290
- package/lib/Select/SelectWithAvatar.js +56 -102
- package/lib/Select/SelectWithIcon.js +76 -132
- package/lib/Select/__tests__/Select.spec.js +91 -133
- package/lib/Select/index.js +0 -5
- package/lib/Select/props/defaultProps.js +4 -5
- package/lib/Select/props/propTypes.js +0 -4
- package/lib/Stencils/Stencils.js +10 -29
- package/lib/Stencils/__tests__/Stencils.spec.js +0 -12
- package/lib/Stencils/props/propTypes.js +0 -3
- package/lib/Switch/Switch.js +34 -57
- package/lib/Switch/props/propTypes.js +0 -3
- package/lib/Tab/Tab.js +27 -40
- package/lib/Tab/TabContent.js +5 -12
- package/lib/Tab/TabContentWrapper.js +6 -13
- package/lib/Tab/TabWrapper.js +19 -37
- package/lib/Tab/Tabs.js +91 -171
- package/lib/Tab/__tests__/Tab.spec.js +58 -67
- package/lib/Tab/__tests__/TabContent.spec.js +6 -10
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +20 -28
- package/lib/Tab/__tests__/TabWrapper.spec.js +0 -12
- package/lib/Tab/__tests__/Tabs.spec.js +39 -53
- package/lib/Tab/index.js +0 -6
- package/lib/Tab/props/propTypes.js +0 -3
- package/lib/Tag/Tag.js +43 -72
- package/lib/Tag/__tests__/Tag.spec.js +8 -14
- package/lib/Tag/props/propTypes.js +0 -3
- package/lib/TextBox/TextBox.js +59 -85
- package/lib/TextBox/__tests__/TextBox.spec.js +4 -14
- package/lib/TextBox/props/propTypes.js +4 -6
- package/lib/TextBoxIcon/TextBoxIcon.js +52 -79
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +5 -14
- package/lib/TextBoxIcon/props/propTypes.js +0 -3
- package/lib/Textarea/Textarea.js +29 -54
- package/lib/Textarea/__tests__/Textarea.spec.js +2 -14
- package/lib/Textarea/props/propTypes.js +0 -3
- package/lib/Tooltip/Tooltip.js +31 -94
- package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -24
- package/lib/Tooltip/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +16 -40
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +25 -53
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/index.js +0 -3
- package/lib/css.js +0 -40
- package/lib/deprecated/PortalLayer/PortalLayer.js +23 -46
- package/lib/deprecated/PortalLayer/props/propTypes.js +0 -3
- package/lib/index.js +0 -57
- package/lib/semantic/Button/Button.js +22 -42
- package/lib/semantic/Button/props/propTypes.js +0 -3
- package/lib/semantic/index.js +0 -2
- package/lib/utils/Common.js +18 -108
- package/lib/utils/ContextOptimizer.js +10 -16
- package/lib/utils/__tests__/constructFullName.spec.js +0 -1
- package/lib/utils/__tests__/debounce.spec.js +2 -3
- package/lib/utils/__tests__/getInitial.spec.js +0 -1
- package/lib/utils/constructFullName.js +4 -13
- package/lib/utils/css/compileClassNames.js +0 -6
- package/lib/utils/css/mergeStyle.js +7 -10
- package/lib/utils/css/utils.js +0 -8
- package/lib/utils/datetime/common.js +5 -34
- package/lib/utils/debounce.js +1 -6
- package/lib/utils/dropDownUtils.js +59 -175
- package/lib/utils/dummyFunction.js +0 -2
- package/lib/utils/getHTMLFontSize.js +0 -1
- package/lib/utils/getInitial.js +0 -6
- package/lib/utils/index.js +0 -4
- package/lib/utils/scrollTo.js +0 -2
- package/lib/utils/shallowEqual.js +0 -8
- package/package.json +2 -2
|
@@ -1,87 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = require("./props/propTypes");
|
|
13
|
-
|
|
14
10
|
var _defaultProps = require("./props/defaultProps");
|
|
15
|
-
|
|
16
11
|
var _datetimejs = _interopRequireDefault(require("@zohodesk/datetimejs"));
|
|
17
|
-
|
|
18
12
|
var _DateTime = _interopRequireDefault(require("./DateTime"));
|
|
19
|
-
|
|
20
13
|
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
21
|
-
|
|
22
14
|
var _icons = require("@zohodesk/icons");
|
|
23
|
-
|
|
24
15
|
var _Layout = require("../Layout");
|
|
25
|
-
|
|
26
16
|
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
27
|
-
|
|
28
17
|
var _DateWidgetModule = _interopRequireDefault(require("./DateWidget.module.css"));
|
|
29
|
-
|
|
30
18
|
var _validator = _interopRequireDefault(require("./validator"));
|
|
31
|
-
|
|
32
19
|
var _common = require("../utils/datetime/common");
|
|
33
|
-
|
|
34
20
|
var _dateFormatUtils = require("./dateFormatUtils");
|
|
35
|
-
|
|
36
21
|
var _dateFormat = require("./dateFormatUtils/dateFormat");
|
|
37
|
-
|
|
38
22
|
var _dayChange = require("./dateFormatUtils/dayChange");
|
|
39
|
-
|
|
40
23
|
var _monthChange = require("./dateFormatUtils/monthChange");
|
|
41
|
-
|
|
42
24
|
var _yearChange = require("./dateFormatUtils/yearChange");
|
|
43
|
-
|
|
44
25
|
var _timeChange = require("./dateFormatUtils/timeChange");
|
|
45
|
-
|
|
46
26
|
var _Common = require("../utils/Common");
|
|
47
|
-
|
|
48
27
|
var _constants = require("./constants");
|
|
49
|
-
|
|
50
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
51
|
-
|
|
52
29
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
53
|
-
|
|
54
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
55
|
-
|
|
30
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
56
31
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
57
|
-
|
|
32
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
33
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
58
34
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
59
|
-
|
|
60
35
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
61
|
-
|
|
62
36
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
63
|
-
|
|
64
37
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
65
|
-
|
|
66
38
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
67
|
-
|
|
68
39
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
69
|
-
|
|
70
40
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
71
|
-
|
|
72
41
|
/* eslint-disable react/no-unused-prop-types */
|
|
73
|
-
|
|
74
42
|
/* eslint css-modules/no-unused-class: [0, { markAsUsed: 'inputLine'] }] */
|
|
75
43
|
var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
76
44
|
_inherits(DateWidgetComponent, _React$Component);
|
|
77
|
-
|
|
78
45
|
var _super = _createSuper(DateWidgetComponent);
|
|
79
|
-
|
|
80
46
|
function DateWidgetComponent(props) {
|
|
81
47
|
var _this;
|
|
82
|
-
|
|
83
48
|
_classCallCheck(this, DateWidgetComponent);
|
|
84
|
-
|
|
85
49
|
_this = _super.call(this, props);
|
|
86
50
|
_this.handleSelect = _this.handleSelect.bind(_assertThisInitialized(_this));
|
|
87
51
|
_this.handleTogglePopup = _this.handleTogglePopup.bind(_assertThisInitialized(_this));
|
|
@@ -121,27 +85,21 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
121
85
|
_this.oldFocusOrder = '';
|
|
122
86
|
_this.focusOrder = '';
|
|
123
87
|
_this.oldKeyDownAction = ''; //'Arrow' || 'valueTyped'
|
|
124
|
-
|
|
125
88
|
_this.keyDownAction = ''; //'Arrow' || 'valueTyped'
|
|
126
|
-
|
|
127
89
|
_this.isMouseDown = false;
|
|
128
90
|
return _this;
|
|
129
91
|
}
|
|
130
|
-
|
|
131
92
|
_createClass(DateWidgetComponent, [{
|
|
132
93
|
key: "componentDidMount",
|
|
133
94
|
value: function componentDidMount() {
|
|
134
95
|
var validation = this.props.validation;
|
|
135
96
|
var selected = this.state.selected;
|
|
136
|
-
|
|
137
97
|
if (validation && validation.validate) {
|
|
138
98
|
this.validateOnSelect(selected, this.props);
|
|
139
99
|
}
|
|
140
|
-
|
|
141
100
|
var _this$handleGetDispla = this.handleGetDisplayText(this.props),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
101
|
+
displayText = _this$handleGetDispla.displayText,
|
|
102
|
+
newSelected = _this$handleGetDispla.selected;
|
|
145
103
|
this.setState({
|
|
146
104
|
displayText: displayText,
|
|
147
105
|
selected: newSelected
|
|
@@ -152,39 +110,35 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
152
110
|
key: "componentDidUpdate",
|
|
153
111
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
154
112
|
var _this$state = this.state,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
113
|
+
selected = _this$state.selected,
|
|
114
|
+
day = _this$state.day,
|
|
115
|
+
month = _this$state.month,
|
|
116
|
+
year = _this$state.year,
|
|
117
|
+
hour = _this$state.hour,
|
|
118
|
+
minute = _this$state.minute,
|
|
119
|
+
noon = _this$state.noon,
|
|
120
|
+
isDateEdited = _this$state.isDateEdited,
|
|
121
|
+
stateFocusOrder = _this$state.stateFocusOrder,
|
|
122
|
+
isFocused = _this$state.isFocused;
|
|
165
123
|
var _this$props = this.props,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
124
|
+
value = _this$props.value,
|
|
125
|
+
validation = _this$props.validation,
|
|
126
|
+
isPopupReady = _this$props.isPopupReady,
|
|
127
|
+
_this$props$dateForma = _this$props.dateFormat,
|
|
128
|
+
dateFormat = _this$props$dateForma === void 0 ? '' : _this$props$dateForma,
|
|
129
|
+
is24Hour = _this$props.is24Hour,
|
|
130
|
+
isHideCurrentYear = _this$props.isHideCurrentYear;
|
|
174
131
|
if (validation && validation.validate) {
|
|
175
132
|
this.validateOnSelect(selected, this.props);
|
|
176
133
|
}
|
|
177
|
-
|
|
178
134
|
if (value !== prevProps.value || dateFormat !== prevProps.dateFormat || is24Hour !== prevProps.is24Hour || isHideCurrentYear !== prevProps.isHideCurrentYear) {
|
|
179
135
|
var _this$handleGetDispla2 = this.handleGetDisplayText(this.props),
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
136
|
+
displayText = _this$handleGetDispla2.displayText,
|
|
137
|
+
_selected = _this$handleGetDispla2.selected;
|
|
183
138
|
this.setState({
|
|
184
139
|
selected: _selected,
|
|
185
140
|
displayText: displayText
|
|
186
141
|
});
|
|
187
|
-
|
|
188
142
|
if (value !== _constants.INVALID_DATE) {
|
|
189
143
|
this.setState({
|
|
190
144
|
day: '',
|
|
@@ -198,30 +152,29 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
198
152
|
});
|
|
199
153
|
}
|
|
200
154
|
}
|
|
201
|
-
|
|
202
155
|
if (prevProps.isPopupReady !== isPopupReady) {
|
|
203
156
|
if (isPopupReady) {
|
|
204
157
|
this.resetLocalDate && this.resetLocalDate();
|
|
205
158
|
}
|
|
206
159
|
}
|
|
207
|
-
|
|
208
160
|
var haveLocalValue = [day, month, year, hour, minute, noon].some(function (value) {
|
|
209
161
|
return !(0, _Common.getIsEmptyValue)(value);
|
|
210
162
|
});
|
|
211
|
-
|
|
212
163
|
if (isDateEdited !== haveLocalValue) {
|
|
213
164
|
this.setState({
|
|
214
165
|
isDateEdited: haveLocalValue
|
|
215
166
|
});
|
|
216
167
|
}
|
|
217
|
-
|
|
218
168
|
if (value !== prevProps.value || dateFormat !== prevProps.dateFormat || is24Hour !== prevProps.is24Hour || (0, _dateFormatUtils.arrayIsNotEqual)([day, month, year, hour, minute, noon], [prevState.day, prevState.month, prevState.year, prevState.hour, prevState.minute, prevState.noon])) {
|
|
219
169
|
this.handleSelectionRangeDetails(this.props);
|
|
220
|
-
}
|
|
170
|
+
}
|
|
221
171
|
|
|
172
|
+
// if (stateFocusOrder !== prevState.stateFocusOrder) {
|
|
222
173
|
|
|
223
174
|
isFocused && !(0, _Common.getIsEmptyValue)(stateFocusOrder) && this.handleSelection(stateFocusOrder);
|
|
224
|
-
this.handleBlurSelectionRange(stateFocusOrder, prevState.stateFocusOrder);
|
|
175
|
+
this.handleBlurSelectionRange(stateFocusOrder, prevState.stateFocusOrder);
|
|
176
|
+
// }
|
|
177
|
+
|
|
225
178
|
// if (prevProps.isPopupOpen !== isPopupOpen) {
|
|
226
179
|
// if (!isPopupOpen) {
|
|
227
180
|
// this.valueInput && this.valueInput.focus({preventScroll:true});
|
|
@@ -232,16 +185,14 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
232
185
|
key: "handleSelect",
|
|
233
186
|
value: function handleSelect(userZoneSelectedTime, fotmattedValue, e) {
|
|
234
187
|
var _this$props2 = this.props,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
188
|
+
id = _this$props2.id,
|
|
189
|
+
onSelect = _this$props2.onSelect,
|
|
190
|
+
closePopupOnly = _this$props2.closePopupOnly,
|
|
191
|
+
validation = _this$props2.validation;
|
|
240
192
|
if (validation && validation.validateOn) {
|
|
241
193
|
var selected = this.state.selected;
|
|
242
194
|
this.validateOnSelect(selected, this.props);
|
|
243
195
|
}
|
|
244
|
-
|
|
245
196
|
onSelect && onSelect(userZoneSelectedTime, id);
|
|
246
197
|
this.valueInput && this.valueInput.focus({
|
|
247
198
|
preventScroll: true
|
|
@@ -255,20 +206,17 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
255
206
|
var defaultValidateRules = ['required'];
|
|
256
207
|
var defaultType = 'onegroup';
|
|
257
208
|
var validation = props.validation,
|
|
258
|
-
|
|
259
|
-
|
|
209
|
+
onPassValidation = props.onPassValidation,
|
|
210
|
+
onFailValidation = props.onFailValidation;
|
|
260
211
|
var targetTag = this.elementRef;
|
|
261
|
-
|
|
262
212
|
if (validation) {
|
|
263
213
|
//validateOn won't work here ...
|
|
264
214
|
var newValidation = _validator["default"].combinePropsValidation(this.props, defaultType, 'onSelect', validation, defaultCheckPropsRules, defaultValidateRules);
|
|
265
|
-
|
|
266
215
|
var validationObj = {
|
|
267
216
|
validation: newValidation,
|
|
268
217
|
onPassValidation: onPassValidation,
|
|
269
218
|
onFailValidation: onFailValidation
|
|
270
219
|
};
|
|
271
|
-
|
|
272
220
|
_validator["default"].executeValidation(value, targetTag, validationObj, defaultType);
|
|
273
221
|
} else {
|
|
274
222
|
onPassValidation && onPassValidation(value, targetTag);
|
|
@@ -278,13 +226,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
278
226
|
key: "handleTogglePopup",
|
|
279
227
|
value: function handleTogglePopup(e, isOpenOnly) {
|
|
280
228
|
var _this$props3 = this.props,
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
229
|
+
togglePopup = _this$props3.togglePopup,
|
|
230
|
+
_this$props3$defaultP = _this$props3.defaultPosition,
|
|
231
|
+
defaultPosition = _this$props3$defaultP === void 0 ? 'bottom' : _this$props3$defaultP,
|
|
232
|
+
openPopupOnly = _this$props3.openPopupOnly,
|
|
233
|
+
isPopupOpen = _this$props3.isPopupOpen,
|
|
234
|
+
removeClose = _this$props3.removeClose;
|
|
288
235
|
if (isOpenOnly) {
|
|
289
236
|
if (!isPopupOpen) {
|
|
290
237
|
togglePopup(e, "".concat(defaultPosition, "Right"));
|
|
@@ -292,26 +239,26 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
292
239
|
removeClose(e);
|
|
293
240
|
}
|
|
294
241
|
}
|
|
295
|
-
|
|
296
242
|
!isOpenOnly && togglePopup(e, "".concat(defaultPosition, "Right"));
|
|
297
243
|
}
|
|
298
244
|
}, {
|
|
299
245
|
key: "handleSelectionRangeDetails",
|
|
300
246
|
value: function handleSelectionRangeDetails(props) {
|
|
301
247
|
var timeZone = props.timeZone,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
248
|
+
dateFormat = props.dateFormat,
|
|
249
|
+
isDateTime = props.isDateTime,
|
|
250
|
+
value = props.value,
|
|
251
|
+
is24Hour = props.is24Hour;
|
|
306
252
|
var _this$state2 = this.state,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
var selected = value === _constants.INVALID_DATE ? '' : value;
|
|
253
|
+
day = _this$state2.day,
|
|
254
|
+
month = _this$state2.month,
|
|
255
|
+
year = _this$state2.year,
|
|
256
|
+
hour = _this$state2.hour,
|
|
257
|
+
minute = _this$state2.minute,
|
|
258
|
+
noon = _this$state2.noon;
|
|
259
|
+
var selected = value === _constants.INVALID_DATE ? '' : value;
|
|
314
260
|
|
|
261
|
+
//New UI Changes
|
|
315
262
|
var dateFormatDetails = (0, _dateFormat.getDateFormatDetails)(dateFormat, {
|
|
316
263
|
isHideCurrentYear: false,
|
|
317
264
|
value: value,
|
|
@@ -342,11 +289,11 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
342
289
|
key: "handleGetDisplayText",
|
|
343
290
|
value: function handleGetDisplayText(props) {
|
|
344
291
|
var timeZone = props.timeZone,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
292
|
+
dateFormat = props.dateFormat,
|
|
293
|
+
isDateTime = props.isDateTime,
|
|
294
|
+
value = props.value,
|
|
295
|
+
is24Hour = props.is24Hour,
|
|
296
|
+
isHideCurrentYear = props.isHideCurrentYear;
|
|
350
297
|
var dateFormatDetails = (0, _dateFormat.getDateFormatDetails)(dateFormat, {
|
|
351
298
|
isHideCurrentYear: isHideCurrentYear,
|
|
352
299
|
value: value,
|
|
@@ -356,21 +303,17 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
356
303
|
var newDateFormat = dateFormatDetails.dateFormat;
|
|
357
304
|
var displayText = '';
|
|
358
305
|
var selected = value === _constants.INVALID_DATE ? '' : value;
|
|
359
|
-
|
|
360
306
|
if (selected) {
|
|
361
307
|
var format = newDateFormat,
|
|
362
|
-
|
|
363
|
-
|
|
308
|
+
convertedValue;
|
|
364
309
|
if (isDateTime) {
|
|
365
310
|
convertedValue = _datetimejs["default"].toDate(_datetimejs["default"].tz.utcToTz(value, timeZone));
|
|
366
311
|
format = "".concat(newDateFormat, " ").concat(is24Hour ? 'HH:mm' : 'hh:mm A');
|
|
367
312
|
} else {
|
|
368
313
|
convertedValue = _datetimejs["default"].toDate(value);
|
|
369
314
|
}
|
|
370
|
-
|
|
371
315
|
displayText = (0, _common.formatDate)(convertedValue, format);
|
|
372
316
|
}
|
|
373
|
-
|
|
374
317
|
return {
|
|
375
318
|
displayText: displayText,
|
|
376
319
|
selected: selected
|
|
@@ -381,20 +324,18 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
381
324
|
value: function handleKeyDown(e) {
|
|
382
325
|
var keyCode = e.keyCode;
|
|
383
326
|
var _this$props4 = this.props,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
327
|
+
isPopupOpen = _this$props4.isPopupOpen,
|
|
328
|
+
isPopupOpenOnEnter = _this$props4.isPopupOpenOnEnter,
|
|
329
|
+
onKeyDown = _this$props4.onKeyDown,
|
|
330
|
+
closePopupOnly = _this$props4.closePopupOnly,
|
|
331
|
+
cantEditOnPopupOpen = _this$props4.cantEditOnPopupOpen;
|
|
389
332
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
390
|
-
|
|
391
333
|
if (isPopupOpen) {
|
|
392
334
|
if (keyCode === 9 && !isAllowedDateType) {
|
|
393
335
|
//on tab click popup close
|
|
394
336
|
closePopupOnly(e);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
|
|
337
|
+
}
|
|
338
|
+
// ~~~~~~~ handle date navigation in dateTime popup ~~~~~
|
|
398
339
|
if (isAllowedDateType) {
|
|
399
340
|
cantEditOnPopupOpen && this.handleDateType(e);
|
|
400
341
|
}
|
|
@@ -422,13 +363,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
422
363
|
value: function handleFocus() {
|
|
423
364
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
424
365
|
var isMouseDown = this.isMouseDown;
|
|
425
|
-
|
|
426
366
|
if (isAllowedDateType && !isMouseDown) {
|
|
427
367
|
var dateFormatSelection = this.state.dateFormatSelection;
|
|
428
368
|
var focusedIndex = dateFormatSelection.focusedIndex;
|
|
429
369
|
var _this$valueInput = this.valueInput,
|
|
430
|
-
|
|
431
|
-
|
|
370
|
+
newSelectionStart = _this$valueInput.selectionStart,
|
|
371
|
+
newSelectionEnd = _this$valueInput.selectionEnd;
|
|
432
372
|
var focusedOrder = focusedIndex["".concat(newSelectionStart, "_").concat(newSelectionEnd)] || 0;
|
|
433
373
|
isAllowedDateType && this.setState({
|
|
434
374
|
stateFocusOrder: focusedOrder,
|
|
@@ -442,7 +382,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
442
382
|
isFocused: true
|
|
443
383
|
});
|
|
444
384
|
}
|
|
445
|
-
|
|
446
385
|
var onFocus = this.props.onFocus;
|
|
447
386
|
onFocus && onFocus();
|
|
448
387
|
}
|
|
@@ -455,7 +394,9 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
455
394
|
this.keyDownAction = '';
|
|
456
395
|
this.setState({
|
|
457
396
|
isFocused: false
|
|
458
|
-
});
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
// const { valueInput } = this;
|
|
459
400
|
// document.getSelection().removeAllRanges();
|
|
460
401
|
// valueInput && valueInput.setSelectionRange(0, 0);
|
|
461
402
|
|
|
@@ -467,8 +408,8 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
467
408
|
value: function handleGetMethods(methods) {
|
|
468
409
|
var getMethods = this.props.getMethods;
|
|
469
410
|
var resetLocalDate = methods.resetLocalDate,
|
|
470
|
-
|
|
471
|
-
|
|
411
|
+
getStateValues = methods.getStateValues,
|
|
412
|
+
toggleYearView = methods.toggleYearView;
|
|
472
413
|
this.resetLocalDate = resetLocalDate;
|
|
473
414
|
this.getDateTimeStateValues = getStateValues;
|
|
474
415
|
this.DateTimeYearViewToggle = toggleYearView;
|
|
@@ -478,75 +419,67 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
478
419
|
key: "handleDateType",
|
|
479
420
|
value: function handleDateType(e) {
|
|
480
421
|
var _this2 = this;
|
|
481
|
-
|
|
482
422
|
var keyCode = e.keyCode,
|
|
483
|
-
|
|
423
|
+
shiftKey = e.shiftKey;
|
|
484
424
|
var input = e.target;
|
|
485
|
-
|
|
486
425
|
if ((0, _dateFormatUtils.getIsSupportedKey)(e)) {
|
|
487
426
|
e.preventDefault();
|
|
488
427
|
}
|
|
489
|
-
|
|
490
428
|
var _this$props5 = this.props,
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
429
|
+
isDateTime = _this$props5.isDateTime,
|
|
430
|
+
timeZone = _this$props5.timeZone,
|
|
431
|
+
value = _this$props5.value,
|
|
432
|
+
onSelect = _this$props5.onSelect,
|
|
433
|
+
id = _this$props5.id,
|
|
434
|
+
min = _this$props5.min,
|
|
435
|
+
max = _this$props5.max,
|
|
436
|
+
minErrorText = _this$props5.minErrorText,
|
|
437
|
+
maxErrorText = _this$props5.maxErrorText,
|
|
438
|
+
onError = _this$props5.onError,
|
|
439
|
+
closePopupOnly = _this$props5.closePopupOnly,
|
|
440
|
+
is24Hour = _this$props5.is24Hour;
|
|
503
441
|
var _this$state3 = this.state,
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
442
|
+
dateFormatSelection = _this$state3.dateFormatSelection,
|
|
443
|
+
day = _this$state3.day,
|
|
444
|
+
month = _this$state3.month,
|
|
445
|
+
year = _this$state3.year,
|
|
446
|
+
hour = _this$state3.hour,
|
|
447
|
+
minute = _this$state3.minute,
|
|
448
|
+
noon = _this$state3.noon,
|
|
449
|
+
selected = _this$state3.selected,
|
|
450
|
+
dateFormatDetails = _this$state3.dateFormatDetails;
|
|
513
451
|
var focusedIndex = dateFormatSelection.focusedIndex,
|
|
514
|
-
|
|
452
|
+
order = dateFormatSelection.order;
|
|
515
453
|
var yearInfo = dateFormatDetails.yearInfo;
|
|
516
|
-
|
|
517
454
|
var _getDateDetails = (0, _dateFormat.getDateDetails)(selected, {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
455
|
+
day: day,
|
|
456
|
+
month: month,
|
|
457
|
+
year: year,
|
|
458
|
+
hour: hour,
|
|
459
|
+
minute: minute,
|
|
460
|
+
noon: noon
|
|
461
|
+
}, isDateTime, timeZone, {
|
|
462
|
+
is24Hour: is24Hour
|
|
463
|
+
}),
|
|
464
|
+
_getDateDetails$day = _getDateDetails.day,
|
|
465
|
+
selectedDay = _getDateDetails$day === void 0 ? '' : _getDateDetails$day,
|
|
466
|
+
_getDateDetails$month = _getDateDetails.month,
|
|
467
|
+
selectedMonth = _getDateDetails$month === void 0 ? '' : _getDateDetails$month,
|
|
468
|
+
_getDateDetails$year = _getDateDetails.year,
|
|
469
|
+
selectedYear = _getDateDetails$year === void 0 ? '' : _getDateDetails$year,
|
|
470
|
+
_getDateDetails$hour = _getDateDetails.hour,
|
|
471
|
+
selectedHour = _getDateDetails$hour === void 0 ? '' : _getDateDetails$hour,
|
|
472
|
+
_getDateDetails$minut = _getDateDetails.minute,
|
|
473
|
+
selectedMinute = _getDateDetails$minut === void 0 ? '' : _getDateDetails$minut,
|
|
474
|
+
_getDateDetails$noon = _getDateDetails.noon,
|
|
475
|
+
selectedNoon = _getDateDetails$noon === void 0 ? '' : _getDateDetails$noon;
|
|
540
476
|
var newSelectionStart = input.selectionStart,
|
|
541
|
-
|
|
477
|
+
newSelectionEnd = input.selectionEnd;
|
|
542
478
|
var focusedOrder = focusedIndex["".concat(newSelectionStart, "_").concat(newSelectionEnd)];
|
|
543
|
-
|
|
544
479
|
var _ref = order[focusedOrder] || {},
|
|
545
|
-
|
|
546
|
-
|
|
480
|
+
type = _ref.type;
|
|
547
481
|
this.oldFocusOrder = this.focusOrder;
|
|
548
482
|
this.focusOrder = focusedOrder;
|
|
549
|
-
|
|
550
483
|
if (keyCode === 38 || keyCode === 40) {
|
|
551
484
|
//up arrow && down arrow
|
|
552
485
|
this.oldKeyDownAction = this.keyDownAction;
|
|
@@ -555,7 +488,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
555
488
|
this.oldKeyDownAction = this.keyDownAction;
|
|
556
489
|
this.keyDownAction = 'valueTyped';
|
|
557
490
|
}
|
|
558
|
-
|
|
559
491
|
var focusedOrders = {
|
|
560
492
|
focusOrder: this.focusOrder,
|
|
561
493
|
oldFocusOrder: this.oldFocusOrder
|
|
@@ -565,14 +497,13 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
565
497
|
keyAction: this.keyDownAction
|
|
566
498
|
};
|
|
567
499
|
var newDay = selectedDay,
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
500
|
+
newMonth = selectedMonth,
|
|
501
|
+
newYear = selectedYear,
|
|
502
|
+
newHour = selectedHour,
|
|
503
|
+
newMinute = selectedMinute,
|
|
504
|
+
newNoon = selectedNoon,
|
|
505
|
+
isValueChanged = false,
|
|
506
|
+
newFocusOrder = focusedOrder;
|
|
576
507
|
if (keyCode === 9 && shiftKey && !(0, _Common.getIsEmptyValue)(focusedOrder) && focusedOrder !== 0) {
|
|
577
508
|
e.preventDefault();
|
|
578
509
|
this.setState({
|
|
@@ -606,7 +537,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
606
537
|
month: selectedMonth,
|
|
607
538
|
year: selectedYear
|
|
608
539
|
}, e, focusedOrders, keyActions);
|
|
609
|
-
|
|
610
540
|
newDay = _getChangedDay.day;
|
|
611
541
|
isValueChanged = _getChangedDay.isChanged;
|
|
612
542
|
newFocusOrder = _getChangedDay.focusOrder;
|
|
@@ -616,7 +546,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
616
546
|
month: selectedMonth,
|
|
617
547
|
year: selectedYear
|
|
618
548
|
}, e, focusedOrders, keyActions);
|
|
619
|
-
|
|
620
549
|
newMonth = _getChangedMonth.month;
|
|
621
550
|
isValueChanged = _getChangedMonth.isChanged;
|
|
622
551
|
newFocusOrder = _getChangedMonth.focusOrder;
|
|
@@ -628,7 +557,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
628
557
|
}, e, focusedOrders, keyActions, {
|
|
629
558
|
yearInfo: yearInfo
|
|
630
559
|
});
|
|
631
|
-
|
|
632
560
|
newYear = _getChangedYear.year;
|
|
633
561
|
isValueChanged = _getChangedYear.isChanged;
|
|
634
562
|
newFocusOrder = _getChangedYear.focusOrder;
|
|
@@ -638,7 +566,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
638
566
|
}, e, focusedOrders, keyActions, {
|
|
639
567
|
is24Hour: is24Hour
|
|
640
568
|
});
|
|
641
|
-
|
|
642
569
|
newHour = _getChangedHour.hour;
|
|
643
570
|
isValueChanged = _getChangedHour.isChanged;
|
|
644
571
|
newFocusOrder = _getChangedHour.focusOrder;
|
|
@@ -646,7 +573,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
646
573
|
var _getChangedMinute = (0, _timeChange.getChangedMinute)({
|
|
647
574
|
minute: selectedMinute
|
|
648
575
|
}, e, focusedOrders, keyActions);
|
|
649
|
-
|
|
650
576
|
newMinute = _getChangedMinute.minute;
|
|
651
577
|
isValueChanged = _getChangedMinute.isChanged;
|
|
652
578
|
newFocusOrder = _getChangedMinute.focusOrder;
|
|
@@ -654,12 +580,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
654
580
|
var _getChangedNoon = (0, _timeChange.getChangedNoon)({
|
|
655
581
|
noon: selectedNoon
|
|
656
582
|
}, e, focusedOrders, keyActions);
|
|
657
|
-
|
|
658
583
|
newNoon = _getChangedNoon.noon;
|
|
659
584
|
isValueChanged = _getChangedNoon.isChanged;
|
|
660
585
|
newFocusOrder = _getChangedNoon.focusOrder;
|
|
661
586
|
}
|
|
662
|
-
|
|
663
587
|
if (isValueChanged) {
|
|
664
588
|
var currentValue = {
|
|
665
589
|
day: newDay,
|
|
@@ -669,7 +593,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
669
593
|
minute: newMinute,
|
|
670
594
|
noon: newNoon
|
|
671
595
|
};
|
|
672
|
-
|
|
673
596
|
var errorCaseHandle = function errorCaseHandle(isEmptyValError) {
|
|
674
597
|
_this2.setState(function () {
|
|
675
598
|
return {
|
|
@@ -684,38 +607,33 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
684
607
|
isError: !isEmptyValError
|
|
685
608
|
};
|
|
686
609
|
});
|
|
687
|
-
|
|
688
610
|
var newSelected = isEmptyValError ? '' : _constants.INVALID_DATE;
|
|
689
611
|
value !== newSelected && onSelect && onSelect(newSelected, id);
|
|
690
612
|
};
|
|
691
|
-
|
|
692
613
|
var _getIsValidDate = (0, _dateFormat.getIsValidDate)(currentValue, isDateTime, {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
614
|
+
is24Hour: is24Hour
|
|
615
|
+
}),
|
|
616
|
+
isError = _getIsValidDate.isError,
|
|
617
|
+
isEmptyValError = _getIsValidDate.isEmptyValError;
|
|
698
618
|
if (isError) {
|
|
699
619
|
errorCaseHandle(isEmptyValError);
|
|
700
620
|
} else {
|
|
701
621
|
var _getSelectedDate = (0, _dateFormat.getSelectedDate)(currentValue, {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
622
|
+
min: min,
|
|
623
|
+
max: max,
|
|
624
|
+
timeZone: timeZone,
|
|
625
|
+
isDateTime: isDateTime,
|
|
626
|
+
is24Hour: is24Hour
|
|
627
|
+
}),
|
|
628
|
+
selectedValue = _getSelectedDate.selectedValue,
|
|
629
|
+
selectedDateError = _getSelectedDate.isError,
|
|
630
|
+
errorType = _getSelectedDate.errorType;
|
|
712
631
|
if (selectedDateError) {
|
|
713
632
|
if (errorType === 'MIN') {
|
|
714
633
|
onError && onError(minErrorText, true);
|
|
715
634
|
} else if (errorType === 'MAX') {
|
|
716
635
|
onError && onError(maxErrorText, true);
|
|
717
636
|
}
|
|
718
|
-
|
|
719
637
|
errorCaseHandle();
|
|
720
638
|
} else {
|
|
721
639
|
this.setState(function () {
|
|
@@ -741,23 +659,17 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
741
659
|
value: function handleSelection() {
|
|
742
660
|
var focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
743
661
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
744
|
-
|
|
745
662
|
if (isAllowedDateType) {
|
|
746
663
|
var dateFormatSelection = this.state.dateFormatSelection;
|
|
747
664
|
var _dateFormatSelection$ = dateFormatSelection.order,
|
|
748
|
-
|
|
749
|
-
|
|
665
|
+
order = _dateFormatSelection$ === void 0 ? {} : _dateFormatSelection$;
|
|
750
666
|
var _ref2 = order[focusOrder] || {},
|
|
751
|
-
|
|
752
|
-
|
|
667
|
+
index = _ref2.index;
|
|
753
668
|
if (!index) {
|
|
754
669
|
focusOrder = 0;
|
|
755
|
-
|
|
756
670
|
var _ref3 = order[focusOrder] || {};
|
|
757
|
-
|
|
758
671
|
index = _ref3.index;
|
|
759
672
|
}
|
|
760
|
-
|
|
761
673
|
if (index && this.valueInput) {
|
|
762
674
|
document.getSelection().removeAllRanges();
|
|
763
675
|
this.valueInput.setSelectionRange(index[0], index[1]);
|
|
@@ -775,31 +687,26 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
775
687
|
var clickIndex = dateFormatSelection.clickIndex;
|
|
776
688
|
var focusOrder = clickIndex[selectionEnd] || clickIndex[selectionEnd - 1] || 0;
|
|
777
689
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
778
|
-
|
|
779
690
|
if (isAllowedDateType) {
|
|
780
691
|
this.setState({
|
|
781
692
|
stateFocusOrder: focusOrder,
|
|
782
693
|
isFocused: true
|
|
783
694
|
});
|
|
784
695
|
}
|
|
785
|
-
|
|
786
696
|
if (!isAllowedDateType) {
|
|
787
697
|
this.handleTogglePopup(e);
|
|
788
698
|
} else {
|
|
789
699
|
var _this$props6 = this.props,
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
700
|
+
isPopupOpenOnClick = _this$props6.isPopupOpenOnClick,
|
|
701
|
+
isReadOnly = _this$props6.isReadOnly,
|
|
702
|
+
isDisabled = _this$props6.isDisabled;
|
|
794
703
|
if (isPopupOpenOnClick && (!isReadOnly || !isDisabled)) {
|
|
795
704
|
this.handleTogglePopup(e, true);
|
|
796
705
|
}
|
|
797
|
-
|
|
798
706
|
var _this$props7 = this.props,
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
707
|
+
isPopupCloseOnClick = _this$props7.isPopupCloseOnClick,
|
|
708
|
+
isPopupOpen = _this$props7.isPopupOpen,
|
|
709
|
+
closePopupOnly = _this$props7.closePopupOnly;
|
|
803
710
|
if (isPopupCloseOnClick && !isPopupOpen) {
|
|
804
711
|
closePopupOnly && closePopupOnly(e);
|
|
805
712
|
}
|
|
@@ -814,49 +721,47 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
814
721
|
key: "handleGetShowValue",
|
|
815
722
|
value: function handleGetShowValue() {
|
|
816
723
|
var _this$state4 = this.state,
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
724
|
+
day = _this$state4.day,
|
|
725
|
+
month = _this$state4.month,
|
|
726
|
+
year = _this$state4.year,
|
|
727
|
+
hour = _this$state4.hour,
|
|
728
|
+
minute = _this$state4.minute,
|
|
729
|
+
noon = _this$state4.noon,
|
|
730
|
+
dateFormatDetails = _this$state4.dateFormatDetails,
|
|
731
|
+
displayText = _this$state4.displayText,
|
|
732
|
+
newDateFormat = _this$state4.newDateFormat,
|
|
733
|
+
isDateEdited = _this$state4.isDateEdited,
|
|
734
|
+
isFocused = _this$state4.isFocused,
|
|
735
|
+
selected = _this$state4.selected;
|
|
829
736
|
var _this$props8 = this.props,
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
737
|
+
isDateTime = _this$props8.isDateTime,
|
|
738
|
+
is24Hour = _this$props8.is24Hour,
|
|
739
|
+
isPopupReady = _this$props8.isPopupReady,
|
|
740
|
+
timeZone = _this$props8.timeZone,
|
|
741
|
+
isPopupOpen = _this$props8.isPopupOpen;
|
|
836
742
|
if (isDateEdited || isFocused || isPopupReady || isPopupOpen) {
|
|
837
743
|
var _getDateDetails2 = (0, _dateFormat.getDateDetails)(selected, {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
744
|
+
day: day,
|
|
745
|
+
month: month,
|
|
746
|
+
year: year,
|
|
747
|
+
hour: hour,
|
|
748
|
+
minute: minute,
|
|
749
|
+
noon: noon
|
|
750
|
+
}, isDateTime, timeZone, {
|
|
751
|
+
is24Hour: is24Hour
|
|
752
|
+
}),
|
|
753
|
+
_getDateDetails2$day = _getDateDetails2.day,
|
|
754
|
+
selectedDay = _getDateDetails2$day === void 0 ? '' : _getDateDetails2$day,
|
|
755
|
+
_getDateDetails2$mont = _getDateDetails2.month,
|
|
756
|
+
selectedMonth = _getDateDetails2$mont === void 0 ? '' : _getDateDetails2$mont,
|
|
757
|
+
_getDateDetails2$year = _getDateDetails2.year,
|
|
758
|
+
selectedYear = _getDateDetails2$year === void 0 ? '' : _getDateDetails2$year,
|
|
759
|
+
_getDateDetails2$hour = _getDateDetails2.hour,
|
|
760
|
+
selectedHour = _getDateDetails2$hour === void 0 ? '' : _getDateDetails2$hour,
|
|
761
|
+
_getDateDetails2$minu = _getDateDetails2.minute,
|
|
762
|
+
selectedMinute = _getDateDetails2$minu === void 0 ? '' : _getDateDetails2$minu,
|
|
763
|
+
_getDateDetails2$noon = _getDateDetails2.noon,
|
|
764
|
+
selectedNoon = _getDateDetails2$noon === void 0 ? '' : _getDateDetails2$noon;
|
|
860
765
|
var dateTimeString = (0, _dateFormat.getDateTimeString)({
|
|
861
766
|
day: selectedDay,
|
|
862
767
|
month: selectedMonth,
|
|
@@ -873,7 +778,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
873
778
|
} else if (displayText) {
|
|
874
779
|
return displayText;
|
|
875
780
|
}
|
|
876
|
-
|
|
877
781
|
var timeFormat = is24Hour ? ' HH:mm' : ' hh:mm --';
|
|
878
782
|
var dateTimeFormat = isDateTime ? "".concat(newDateFormat).concat(timeFormat) : newDateFormat;
|
|
879
783
|
return dateTimeFormat || '';
|
|
@@ -882,27 +786,24 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
882
786
|
key: "handleGetAllowedType",
|
|
883
787
|
value: function handleGetAllowedType() {
|
|
884
788
|
var _this$props9 = this.props,
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
789
|
+
isReadOnly = _this$props9.isReadOnly,
|
|
790
|
+
isDisabled = _this$props9.isDisabled,
|
|
791
|
+
isEditable = _this$props9.isEditable;
|
|
889
792
|
if (isEditable) {
|
|
890
793
|
if (isReadOnly || isDisabled) {
|
|
891
794
|
return false;
|
|
892
795
|
}
|
|
893
|
-
|
|
894
796
|
return true;
|
|
895
797
|
}
|
|
896
|
-
|
|
897
798
|
return false;
|
|
898
799
|
}
|
|
899
800
|
}, {
|
|
900
801
|
key: "handleDateClear",
|
|
901
802
|
value: function handleDateClear() {
|
|
902
803
|
var _this$props10 = this.props,
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
804
|
+
id = _this$props10.id,
|
|
805
|
+
onSelect = _this$props10.onSelect,
|
|
806
|
+
value = _this$props10.value;
|
|
906
807
|
this.setState({
|
|
907
808
|
day: '',
|
|
908
809
|
month: '',
|
|
@@ -914,7 +815,8 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
914
815
|
stateFocusOrder: 0,
|
|
915
816
|
isError: false
|
|
916
817
|
});
|
|
917
|
-
value && onSelect && onSelect('', id);
|
|
818
|
+
value && onSelect && onSelect('', id);
|
|
819
|
+
// this.valueInput && this.valueInput.focus({ preventScroll: true });
|
|
918
820
|
}
|
|
919
821
|
}, {
|
|
920
822
|
key: "handleDateTimeClear",
|
|
@@ -937,85 +839,82 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
937
839
|
var focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
938
840
|
var oldFocusOrder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
939
841
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
940
|
-
|
|
941
842
|
if (isAllowedDateType) {
|
|
942
843
|
// if (focusOrder !== oldFocusOrder) {
|
|
943
844
|
var _this$state$dateForma = this.state.dateFormatSelection,
|
|
944
|
-
|
|
845
|
+
dateFormatSelection = _this$state$dateForma === void 0 ? {} : _this$state$dateForma;
|
|
945
846
|
var _dateFormatSelection$2 = dateFormatSelection.order,
|
|
946
|
-
|
|
947
|
-
var isPopupOpen = this.props.isPopupOpen;
|
|
847
|
+
order = _dateFormatSelection$2 === void 0 ? [] : _dateFormatSelection$2;
|
|
848
|
+
var isPopupOpen = this.props.isPopupOpen;
|
|
948
849
|
|
|
850
|
+
// const { type: oldFocusedType = '' } = order[oldFocusOrder] || {};
|
|
949
851
|
var _ref4 = order[focusOrder] || {},
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
852
|
+
_ref4$type = _ref4.type,
|
|
853
|
+
focusedType = _ref4$type === void 0 ? '' : _ref4$type;
|
|
953
854
|
var _this$getDateTimeStat = this.getDateTimeStateValues(),
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
855
|
+
isYearView = _this$getDateTimeStat.isYearView,
|
|
856
|
+
oldIsMonthOpen = _this$getDateTimeStat.isMonthOpen;
|
|
957
857
|
var yearViewTypes = ['month', 'year'];
|
|
958
858
|
var isMonthOpen = focusedType === 'month';
|
|
959
|
-
|
|
960
859
|
if (isPopupOpen) {
|
|
961
860
|
if (yearViewTypes.indexOf(focusedType) >= 0 && (!isYearView || isMonthOpen !== oldIsMonthOpen)) {
|
|
962
861
|
this.DateTimeYearViewToggle(true, isMonthOpen);
|
|
963
862
|
} else if (yearViewTypes.indexOf(focusedType) === -1 && isYearView) {
|
|
964
863
|
this.DateTimeYearViewToggle(false, false);
|
|
965
864
|
}
|
|
966
|
-
}
|
|
967
|
-
|
|
865
|
+
}
|
|
866
|
+
// }
|
|
968
867
|
}
|
|
969
868
|
}
|
|
970
869
|
}, {
|
|
971
870
|
key: "render",
|
|
972
871
|
value: function render() {
|
|
973
872
|
var _this$props11 = this.props,
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
873
|
+
removeClose = _this$props11.removeClose,
|
|
874
|
+
minErrorText = _this$props11.minErrorText,
|
|
875
|
+
maxErrorText = _this$props11.maxErrorText,
|
|
876
|
+
min = _this$props11.min,
|
|
877
|
+
max = _this$props11.max,
|
|
878
|
+
placeholder = _this$props11.placeholder,
|
|
879
|
+
isPopupOpen = _this$props11.isPopupOpen,
|
|
880
|
+
isPopupReady = _this$props11.isPopupReady,
|
|
881
|
+
isDateTime = _this$props11.isDateTime,
|
|
882
|
+
position = _this$props11.position,
|
|
883
|
+
textBoxVariant = _this$props11.textBoxVariant,
|
|
884
|
+
textBoxSize = _this$props11.textBoxSize,
|
|
885
|
+
_this$props11$childre = _this$props11.children,
|
|
886
|
+
children = _this$props11$childre === void 0 ? null : _this$props11$childre,
|
|
887
|
+
isDisabled = _this$props11.isDisabled,
|
|
888
|
+
getContainerRef = _this$props11.getContainerRef,
|
|
889
|
+
getTargetRef = _this$props11.getTargetRef,
|
|
890
|
+
timeZone = _this$props11.timeZone,
|
|
891
|
+
isReadOnly = _this$props11.isReadOnly,
|
|
892
|
+
dataId = _this$props11.dataId,
|
|
893
|
+
needResponsive = _this$props11.needResponsive,
|
|
894
|
+
className = _this$props11.className,
|
|
895
|
+
needBorder = _this$props11.needBorder,
|
|
896
|
+
defaultTime = _this$props11.defaultTime,
|
|
897
|
+
needDefaultTime = _this$props11.needDefaultTime,
|
|
898
|
+
borderColor = _this$props11.borderColor,
|
|
899
|
+
i18nKeys = _this$props11.i18nKeys,
|
|
900
|
+
needErrorOnBlur = _this$props11.needErrorOnBlur,
|
|
901
|
+
htmlId = _this$props11.htmlId,
|
|
902
|
+
iconOnHover = _this$props11.iconOnHover,
|
|
903
|
+
is24Hour = _this$props11.is24Hour,
|
|
904
|
+
isAbsolutePositioningNeeded = _this$props11.isAbsolutePositioningNeeded,
|
|
905
|
+
positionsOffset = _this$props11.positionsOffset,
|
|
906
|
+
targetOffset = _this$props11.targetOffset,
|
|
907
|
+
isRestrictScroll = _this$props11.isRestrictScroll,
|
|
908
|
+
dropBoxPortalId = _this$props11.dropBoxPortalId,
|
|
909
|
+
a11y = _this$props11.a11y,
|
|
910
|
+
boxSize = _this$props11.boxSize,
|
|
911
|
+
onError = _this$props11.onError;
|
|
1013
912
|
var _this$state5 = this.state,
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
913
|
+
_this$state5$selected = _this$state5.selected,
|
|
914
|
+
value = _this$state5$selected === void 0 ? '' : _this$state5$selected,
|
|
915
|
+
isError = _this$state5.isError,
|
|
916
|
+
isDateEdited = _this$state5.isDateEdited,
|
|
917
|
+
isFocused = _this$state5.isFocused;
|
|
1019
918
|
var showValue = this.handleGetShowValue();
|
|
1020
919
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
1021
920
|
var showClear = !(isDisabled || isReadOnly) && (isDateEdited || value) ? true : false;
|
|
@@ -1100,14 +999,14 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1100
999
|
}));
|
|
1101
1000
|
}
|
|
1102
1001
|
}]);
|
|
1103
|
-
|
|
1104
1002
|
return DateWidgetComponent;
|
|
1105
1003
|
}(_react["default"].Component);
|
|
1106
|
-
|
|
1107
1004
|
DateWidgetComponent.defaultProps = _defaultProps.DateWidget_defaultProps;
|
|
1108
1005
|
DateWidgetComponent.propTypes = _propTypes.DateWidget_propTypes;
|
|
1109
1006
|
var DateWidget = (0, _Popup["default"])(DateWidgetComponent);
|
|
1110
|
-
DateWidget.defaultProps = DateWidgetComponent.defaultProps;
|
|
1007
|
+
DateWidget.defaultProps = DateWidgetComponent.defaultProps;
|
|
1008
|
+
|
|
1009
|
+
// eslint-disable-next-line no-undef
|
|
1111
1010
|
// if (__DOCS__) {
|
|
1112
1011
|
// DateWidgetComponent.docs = {
|
|
1113
1012
|
// componentGroup: 'Form Elements',
|
|
@@ -1118,6 +1017,5 @@ DateWidget.defaultProps = DateWidgetComponent.defaultProps; // eslint-disable-ne
|
|
|
1118
1017
|
// // eslint-disable-next-line react/forbid-foreign-prop-types
|
|
1119
1018
|
// DateWidget.propTypes = DateWidgetComponent.propTypes;
|
|
1120
1019
|
// }
|
|
1121
|
-
|
|
1122
1020
|
var _default = DateWidget;
|
|
1123
1021
|
exports["default"] = _default;
|