@deephaven/components 0.5.2-beta.0 → 0.6.1-demo.10

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.
Files changed (119) hide show
  1. package/dist/AutoCompleteInput.js +410 -448
  2. package/dist/AutoCompleteInput.js.map +1 -1
  3. package/dist/AutoResizeTextarea.js +17 -46
  4. package/dist/AutoResizeTextarea.js.map +1 -1
  5. package/dist/BasicModal.js +18 -19
  6. package/dist/BasicModal.js.map +1 -1
  7. package/dist/Button.js +30 -21
  8. package/dist/Button.js.map +1 -1
  9. package/dist/ButtonGroup.js +6 -4
  10. package/dist/ButtonGroup.js.map +1 -1
  11. package/dist/ButtonOld.js +10 -8
  12. package/dist/ButtonOld.js.map +1 -1
  13. package/dist/CardFlip.js +10 -8
  14. package/dist/CardFlip.js.map +1 -1
  15. package/dist/Checkbox.js +18 -31
  16. package/dist/Checkbox.js.map +1 -1
  17. package/dist/Collapse.js +65 -105
  18. package/dist/Collapse.js.map +1 -1
  19. package/dist/ComboBox.js +432 -460
  20. package/dist/ComboBox.js.map +1 -1
  21. package/dist/CustomTimeSelect.js +485 -517
  22. package/dist/CustomTimeSelect.js.map +1 -1
  23. package/dist/DebouncedSearchInput.js +61 -91
  24. package/dist/DebouncedSearchInput.js.map +1 -1
  25. package/dist/DeephavenSpinner.js +6 -6
  26. package/dist/DeephavenSpinner.js.map +1 -1
  27. package/dist/DragUtils.js +65 -113
  28. package/dist/DragUtils.js.map +1 -1
  29. package/dist/DraggableItemList.d.ts +1 -0
  30. package/dist/DraggableItemList.d.ts.map +1 -1
  31. package/dist/DraggableItemList.js +219 -257
  32. package/dist/DraggableItemList.js.map +1 -1
  33. package/dist/HierarchicalCheckboxMenu.js +160 -227
  34. package/dist/HierarchicalCheckboxMenu.js.map +1 -1
  35. package/dist/ItemList.d.ts +4 -2
  36. package/dist/ItemList.d.ts.map +1 -1
  37. package/dist/ItemList.js +595 -598
  38. package/dist/ItemList.js.map +1 -1
  39. package/dist/ItemListItem.js +194 -215
  40. package/dist/ItemListItem.js.map +1 -1
  41. package/dist/LoadingOverlay.js +9 -10
  42. package/dist/LoadingOverlay.js.map +1 -1
  43. package/dist/LoadingSpinner.js +4 -3
  44. package/dist/LoadingSpinner.js.map +1 -1
  45. package/dist/MaskedInput.js +59 -70
  46. package/dist/MaskedInput.js.map +1 -1
  47. package/dist/Option.js +5 -3
  48. package/dist/Option.js.map +1 -1
  49. package/dist/RadioGroup.js +16 -34
  50. package/dist/RadioGroup.js.map +1 -1
  51. package/dist/RadioItem.js +14 -33
  52. package/dist/RadioItem.js.map +1 -1
  53. package/dist/SearchInput.js +42 -75
  54. package/dist/SearchInput.js.map +1 -1
  55. package/dist/Select.js +10 -8
  56. package/dist/Select.js.map +1 -1
  57. package/dist/SelectValueList.js +97 -134
  58. package/dist/SelectValueList.js.map +1 -1
  59. package/dist/SocketedButton.js +13 -11
  60. package/dist/SocketedButton.js.map +1 -1
  61. package/dist/ThemeExport.js.map +1 -1
  62. package/dist/TimeInput.js +16 -53
  63. package/dist/TimeInput.js.map +1 -1
  64. package/dist/TimeSlider.js +62 -88
  65. package/dist/TimeSlider.js.map +1 -1
  66. package/dist/ToastNotification.js +14 -13
  67. package/dist/ToastNotification.js.map +1 -1
  68. package/dist/UISwitch.js +9 -8
  69. package/dist/UISwitch.js.map +1 -1
  70. package/dist/context-actions/ContextActionUtils.js +173 -231
  71. package/dist/context-actions/ContextActionUtils.js.map +1 -1
  72. package/dist/context-actions/ContextActions.js +135 -177
  73. package/dist/context-actions/ContextActions.js.map +1 -1
  74. package/dist/context-actions/ContextMenu.js +509 -543
  75. package/dist/context-actions/ContextMenu.js.map +1 -1
  76. package/dist/context-actions/ContextMenuItem.js +32 -22
  77. package/dist/context-actions/ContextMenuItem.js.map +1 -1
  78. package/dist/context-actions/ContextMenuRoot.js +112 -152
  79. package/dist/context-actions/ContextMenuRoot.js.map +1 -1
  80. package/dist/context-actions/GlobalContextAction.js +49 -84
  81. package/dist/context-actions/GlobalContextAction.js.map +1 -1
  82. package/dist/context-actions/GlobalContextActions.js +25 -57
  83. package/dist/context-actions/GlobalContextActions.js.map +1 -1
  84. package/dist/context-actions/index.js +4 -4
  85. package/dist/context-actions/index.js.map +1 -1
  86. package/dist/index.js +39 -39
  87. package/dist/index.js.map +1 -1
  88. package/dist/menu-actions/DropdownMenu.js +126 -159
  89. package/dist/menu-actions/DropdownMenu.js.map +1 -1
  90. package/dist/menu-actions/Menu.js +215 -245
  91. package/dist/menu-actions/Menu.js.map +1 -1
  92. package/dist/menu-actions/index.js +1 -1
  93. package/dist/menu-actions/index.js.map +1 -1
  94. package/dist/navigation/Menu.js +14 -18
  95. package/dist/navigation/Menu.js.map +1 -1
  96. package/dist/navigation/MenuItem.js +15 -14
  97. package/dist/navigation/MenuItem.js.map +1 -1
  98. package/dist/navigation/Page.js +7 -5
  99. package/dist/navigation/Page.js.map +1 -1
  100. package/dist/navigation/Stack.js +14 -39
  101. package/dist/navigation/Stack.js.map +1 -1
  102. package/dist/navigation/index.js +4 -4
  103. package/dist/navigation/index.js.map +1 -1
  104. package/dist/popper/Popper.js +209 -235
  105. package/dist/popper/Popper.js.map +1 -1
  106. package/dist/popper/Tooltip.js +227 -257
  107. package/dist/popper/Tooltip.js.map +1 -1
  108. package/dist/popper/index.js +2 -2
  109. package/dist/popper/index.js.map +1 -1
  110. package/dist/shortcuts/GlobalShortcuts.js +2 -2
  111. package/dist/shortcuts/GlobalShortcuts.js.map +1 -1
  112. package/dist/shortcuts/Shortcut.js +263 -291
  113. package/dist/shortcuts/Shortcut.js.map +1 -1
  114. package/dist/shortcuts/ShortcutRegistry.js +48 -71
  115. package/dist/shortcuts/ShortcutRegistry.js.map +1 -1
  116. package/dist/shortcuts/index.js +4 -4
  117. package/dist/shortcuts/index.js.map +1 -1
  118. package/dist/tsconfig.tsbuildinfo +1 -1
  119. package/package.json +30 -54
@@ -1,29 +1,7 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
-
3
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
4
2
 
5
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
4
 
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
-
9
- 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); } }
10
-
11
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
12
-
13
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
-
15
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
-
17
- 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); }; }
18
-
19
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
20
-
21
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
-
23
- 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; } }
24
-
25
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
26
-
27
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
28
6
 
29
7
  import React, { Component } from 'react';
@@ -31,8 +9,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
31
9
  import { vsCheck, dhSort } from '@deephaven/icons';
32
10
  import { TimeUtils } from '@deephaven/utils';
33
11
  import classNames from 'classnames';
34
- import TimeInput from './TimeInput';
35
- import DropdownMenu from './menu-actions/DropdownMenu';
12
+ import TimeInput from "./TimeInput.js";
13
+ import DropdownMenu from "./menu-actions/DropdownMenu.js";
36
14
  import "./CustomTimeSelect.css";
37
15
  import "./context-actions/ContextActions.css";
38
16
  var CUSTOM_OPTION = -1;
@@ -43,584 +21,574 @@ var MENU_NAVIGATION_DIRECTION;
43
21
  MENU_NAVIGATION_DIRECTION["DOWN"] = "DOWN";
44
22
  })(MENU_NAVIGATION_DIRECTION || (MENU_NAVIGATION_DIRECTION = {}));
45
23
 
46
- var CustomTimeSelect = /*#__PURE__*/function (_Component) {
47
- _inherits(CustomTimeSelect, _Component);
48
-
49
- var _super = _createSuper(CustomTimeSelect);
50
-
51
- function CustomTimeSelect(props) {
52
- var _this;
53
-
54
- _classCallCheck(this, CustomTimeSelect);
55
-
56
- _this = _super.call(this, props);
57
-
58
- _defineProperty(_assertThisInitialized(_this), "csContainer", void 0);
59
-
60
- _defineProperty(_assertThisInitialized(_this), "menuContainer", void 0);
61
-
62
- _defineProperty(_assertThisInitialized(_this), "button", void 0);
63
-
64
- _defineProperty(_assertThisInitialized(_this), "input", void 0);
65
-
66
- var value = props.value,
67
- valueToTime = props.valueToTime;
68
- _this.toggleMenu = _this.toggleMenu.bind(_assertThisInitialized(_this));
69
- _this.handleMenuKeyDown = _this.handleMenuKeyDown.bind(_assertThisInitialized(_this));
70
- _this.closeMenu = _this.closeMenu.bind(_assertThisInitialized(_this));
71
- _this.handleOptionClick = _this.handleOptionClick.bind(_assertThisInitialized(_this));
72
- _this.handleOptionFocus = _this.handleOptionFocus.bind(_assertThisInitialized(_this));
73
- _this.handleMenuOpened = _this.handleMenuOpened.bind(_assertThisInitialized(_this));
74
- _this.handleMenuExited = _this.handleMenuExited.bind(_assertThisInitialized(_this));
75
- _this.handleCustomInput = _this.handleCustomInput.bind(_assertThisInitialized(_this));
76
- _this.csContainer = /*#__PURE__*/React.createRef();
77
- _this.menuContainer = /*#__PURE__*/React.createRef();
78
- _this.button = /*#__PURE__*/React.createRef();
79
- _this.input = /*#__PURE__*/React.createRef();
80
- _this.state = {
24
+ class CustomTimeSelect extends Component {
25
+ constructor(props) {
26
+ super(props);
27
+
28
+ _defineProperty(this, "csContainer", void 0);
29
+
30
+ _defineProperty(this, "menuContainer", void 0);
31
+
32
+ _defineProperty(this, "button", void 0);
33
+
34
+ _defineProperty(this, "input", void 0);
35
+
36
+ var {
37
+ value,
38
+ valueToTime
39
+ } = props;
40
+ this.toggleMenu = this.toggleMenu.bind(this);
41
+ this.handleMenuKeyDown = this.handleMenuKeyDown.bind(this);
42
+ this.closeMenu = this.closeMenu.bind(this);
43
+ this.handleOptionClick = this.handleOptionClick.bind(this);
44
+ this.handleOptionFocus = this.handleOptionFocus.bind(this);
45
+ this.handleMenuOpened = this.handleMenuOpened.bind(this);
46
+ this.handleMenuExited = this.handleMenuExited.bind(this);
47
+ this.handleCustomInput = this.handleCustomInput.bind(this);
48
+ this.csContainer = /*#__PURE__*/React.createRef();
49
+ this.menuContainer = /*#__PURE__*/React.createRef();
50
+ this.button = /*#__PURE__*/React.createRef();
51
+ this.input = /*#__PURE__*/React.createRef();
52
+ this.state = {
81
53
  keyboardOptionIndex: 0,
82
54
  menuIsOpen: false,
83
55
  inputWidth: 100,
84
56
  customTime: valueToTime(value),
85
57
  inputFocused: false
86
58
  };
87
- return _this;
88
59
  }
89
60
 
90
- _createClass(CustomTimeSelect, [{
91
- key: "getSelectedText",
92
- value: function getSelectedText() {
93
- var _this$props = this.props,
94
- options = _this$props.options,
95
- value = _this$props.value,
96
- placeholder = _this$props.placeholder;
97
- var customTime = this.state.customTime;
98
-
99
- if (value === null) {
100
- return placeholder;
101
- }
102
-
103
- for (var i = 0; i < options.length; i += 1) {
104
- var option = options[i];
61
+ getSelectedText() {
62
+ var {
63
+ options,
64
+ value,
65
+ placeholder
66
+ } = this.props;
67
+ var {
68
+ customTime
69
+ } = this.state;
70
+
71
+ if (value === null) {
72
+ return placeholder;
73
+ }
105
74
 
106
- if (option.value === value) {
107
- return option.title;
108
- }
109
- }
75
+ for (var i = 0; i < options.length; i += 1) {
76
+ var option = options[i];
110
77
 
111
- return TimeUtils.formatTime(customTime);
112
- }
113
- }, {
114
- key: "setInputWidth",
115
- value: function setInputWidth() {
116
- if (this.csContainer.current) {
117
- this.setState({
118
- inputWidth: this.csContainer.current.getBoundingClientRect().width
119
- });
78
+ if (option.value === value) {
79
+ return option.title;
120
80
  }
121
81
  }
122
- }, {
123
- key: "focus",
124
- value: function focus() {
125
- var _this$button$current;
126
82
 
127
- (_this$button$current = this.button.current) === null || _this$button$current === void 0 ? void 0 : _this$button$current.focus();
128
- }
129
- }, {
130
- key: "updateInputValue",
131
- value: function updateInputValue(value) {
132
- var onChange = this.props.onChange;
133
- onChange(value);
134
- }
135
- }, {
136
- key: "handleResize",
137
- value: function handleResize() {
138
- this.setInputWidth();
83
+ return TimeUtils.formatTime(customTime);
84
+ }
85
+
86
+ setInputWidth() {
87
+ if (this.csContainer.current) {
88
+ this.setState({
89
+ inputWidth: this.csContainer.current.getBoundingClientRect().width
90
+ });
139
91
  }
140
- }, {
141
- key: "handleMenuKeyDown",
142
- value: function handleMenuKeyDown(event) {
143
- var _this$button$current2;
144
-
145
- var _this$state = this.state,
146
- keyboardOptionIndex = _this$state.keyboardOptionIndex,
147
- inputFocused = _this$state.inputFocused;
148
- var options = this.props.options;
149
-
150
- switch (event.key) {
151
- case 'Enter':
152
- case ' ':
153
- // Space Bar
154
- if (inputFocused) {
155
- this.updateFromCustom();
156
- } else {
157
- this.updateInputValue(options[keyboardOptionIndex].value);
158
- }
159
-
160
- this.closeMenu();
161
- (_this$button$current2 = this.button.current) === null || _this$button$current2 === void 0 ? void 0 : _this$button$current2.focus();
162
- event.stopPropagation();
163
- event.preventDefault();
164
- break;
92
+ }
165
93
 
166
- case 'Tab':
167
- if (event.shiftKey) {
168
- this.handleMenuNavigation(CustomTimeSelect.MENU_NAVIGATION_DIRECTION.UP);
169
- } else {
170
- this.handleMenuNavigation(CustomTimeSelect.MENU_NAVIGATION_DIRECTION.DOWN);
171
- }
94
+ focus() {
95
+ var _this$button$current;
172
96
 
173
- event.stopPropagation();
174
- event.preventDefault();
175
- break;
97
+ (_this$button$current = this.button.current) === null || _this$button$current === void 0 ? void 0 : _this$button$current.focus();
98
+ }
176
99
 
177
- case 'ArrowUp':
178
- this.handleMenuNavigation(CustomTimeSelect.MENU_NAVIGATION_DIRECTION.UP);
179
- event.stopPropagation();
180
- event.preventDefault();
181
- break;
100
+ updateInputValue(value) {
101
+ var {
102
+ onChange
103
+ } = this.props;
104
+ onChange(value);
105
+ }
106
+
107
+ handleResize() {
108
+ this.setInputWidth();
109
+ }
110
+
111
+ handleMenuKeyDown(event) {
112
+ var _this$button$current2;
113
+
114
+ var {
115
+ keyboardOptionIndex,
116
+ inputFocused
117
+ } = this.state;
118
+ var {
119
+ options
120
+ } = this.props;
121
+
122
+ switch (event.key) {
123
+ case 'Enter':
124
+ case ' ':
125
+ // Space Bar
126
+ if (inputFocused) {
127
+ this.updateFromCustom();
128
+ } else {
129
+ this.updateInputValue(options[keyboardOptionIndex].value);
130
+ }
182
131
 
183
- case 'ArrowDown':
132
+ this.closeMenu();
133
+ (_this$button$current2 = this.button.current) === null || _this$button$current2 === void 0 ? void 0 : _this$button$current2.focus();
134
+ event.stopPropagation();
135
+ event.preventDefault();
136
+ break;
137
+
138
+ case 'Tab':
139
+ if (event.shiftKey) {
140
+ this.handleMenuNavigation(CustomTimeSelect.MENU_NAVIGATION_DIRECTION.UP);
141
+ } else {
184
142
  this.handleMenuNavigation(CustomTimeSelect.MENU_NAVIGATION_DIRECTION.DOWN);
185
- event.stopPropagation();
186
- event.preventDefault();
187
- break;
143
+ }
188
144
 
189
- case 'Escape':
190
- this.closeMenu();
191
- break;
145
+ event.stopPropagation();
146
+ event.preventDefault();
147
+ break;
192
148
 
193
- default:
194
- break;
195
- }
149
+ case 'ArrowUp':
150
+ this.handleMenuNavigation(CustomTimeSelect.MENU_NAVIGATION_DIRECTION.UP);
151
+ event.stopPropagation();
152
+ event.preventDefault();
153
+ break;
154
+
155
+ case 'ArrowDown':
156
+ this.handleMenuNavigation(CustomTimeSelect.MENU_NAVIGATION_DIRECTION.DOWN);
157
+ event.stopPropagation();
158
+ event.preventDefault();
159
+ break;
160
+
161
+ case 'Escape':
162
+ this.closeMenu();
163
+ break;
164
+
165
+ default:
166
+ break;
196
167
  }
197
- }, {
198
- key: "handleMenuNavigation",
199
- value: function handleMenuNavigation(direction) {
200
- var _this$state2 = this.state,
201
- keyboardOptionIndex = _this$state2.keyboardOptionIndex,
202
- inputFocused = _this$state2.inputFocused;
203
- var options = this.props.options;
204
- var menuOptionsLength = options.length;
205
- var newKeyboardOptionIndex = keyboardOptionIndex;
206
-
207
- switch (direction) {
208
- case CustomTimeSelect.MENU_NAVIGATION_DIRECTION.UP:
209
- if (!inputFocused && keyboardOptionIndex === 0) {
210
- this.focusInput();
211
- break;
212
- } else if (inputFocused) {
213
- this.focusOption(keyboardOptionIndex);
214
- }
215
-
216
- if (keyboardOptionIndex > 0 && !inputFocused) {
217
- newKeyboardOptionIndex = (newKeyboardOptionIndex - 1) % menuOptionsLength;
218
- this.setState({
219
- keyboardOptionIndex: newKeyboardOptionIndex
220
- });
221
- } else if (keyboardOptionIndex === 0) {
222
- newKeyboardOptionIndex = menuOptionsLength - 1;
223
- this.setState({
224
- keyboardOptionIndex: newKeyboardOptionIndex
225
- });
226
- }
227
-
228
- this.scrollOptionIntoView(newKeyboardOptionIndex);
229
- break;
168
+ }
230
169
 
231
- case CustomTimeSelect.MENU_NAVIGATION_DIRECTION.DOWN:
232
- if (!inputFocused && keyboardOptionIndex === menuOptionsLength - 1) {
233
- this.focusInput();
234
- break;
235
- } else if (inputFocused) {
236
- this.focusOption(keyboardOptionIndex);
237
- }
238
-
239
- if (keyboardOptionIndex < menuOptionsLength && !(inputFocused && keyboardOptionIndex === 0)) {
240
- newKeyboardOptionIndex = (newKeyboardOptionIndex + 1) % menuOptionsLength;
241
- this.setState({
242
- keyboardOptionIndex: newKeyboardOptionIndex
243
- });
244
- }
245
-
246
- this.scrollOptionIntoView(newKeyboardOptionIndex);
170
+ handleMenuNavigation(direction) {
171
+ var {
172
+ keyboardOptionIndex,
173
+ inputFocused
174
+ } = this.state;
175
+ var {
176
+ options
177
+ } = this.props;
178
+ var menuOptionsLength = options.length;
179
+ var newKeyboardOptionIndex = keyboardOptionIndex;
180
+
181
+ switch (direction) {
182
+ case CustomTimeSelect.MENU_NAVIGATION_DIRECTION.UP:
183
+ if (!inputFocused && keyboardOptionIndex === 0) {
184
+ this.focusInput();
247
185
  break;
186
+ } else if (inputFocused) {
187
+ this.focusOption(keyboardOptionIndex);
188
+ }
189
+
190
+ if (keyboardOptionIndex > 0 && !inputFocused) {
191
+ newKeyboardOptionIndex = (newKeyboardOptionIndex - 1) % menuOptionsLength;
192
+ this.setState({
193
+ keyboardOptionIndex: newKeyboardOptionIndex
194
+ });
195
+ } else if (keyboardOptionIndex === 0) {
196
+ newKeyboardOptionIndex = menuOptionsLength - 1;
197
+ this.setState({
198
+ keyboardOptionIndex: newKeyboardOptionIndex
199
+ });
200
+ }
248
201
 
249
- default:
202
+ this.scrollOptionIntoView(newKeyboardOptionIndex);
203
+ break;
204
+
205
+ case CustomTimeSelect.MENU_NAVIGATION_DIRECTION.DOWN:
206
+ if (!inputFocused && keyboardOptionIndex === menuOptionsLength - 1) {
207
+ this.focusInput();
250
208
  break;
251
- }
252
- }
253
- }, {
254
- key: "handleOptionClick",
255
- value: function handleOptionClick(event) {
256
- var optionIndex = Number(event.currentTarget.value);
257
- var _this$props2 = this.props,
258
- options = _this$props2.options,
259
- timeToValue = _this$props2.timeToValue;
260
- var customTime = this.state.customTime;
261
-
262
- if (optionIndex === CUSTOM_OPTION) {
263
- var update = timeToValue(customTime);
264
- this.updateAndClose(update);
265
- } else {
266
- this.updateAndClose(options[optionIndex].value);
267
- }
268
- }
269
- }, {
270
- key: "updateAndClose",
271
- value: function updateAndClose(update) {
272
- var _this$button$current3;
209
+ } else if (inputFocused) {
210
+ this.focusOption(keyboardOptionIndex);
211
+ }
273
212
 
274
- this.updateInputValue(update);
275
- this.closeMenu();
276
- (_this$button$current3 = this.button.current) === null || _this$button$current3 === void 0 ? void 0 : _this$button$current3.focus();
213
+ if (keyboardOptionIndex < menuOptionsLength && !(inputFocused && keyboardOptionIndex === 0)) {
214
+ newKeyboardOptionIndex = (newKeyboardOptionIndex + 1) % menuOptionsLength;
215
+ this.setState({
216
+ keyboardOptionIndex: newKeyboardOptionIndex
217
+ });
218
+ }
219
+
220
+ this.scrollOptionIntoView(newKeyboardOptionIndex);
221
+ break;
222
+
223
+ default:
224
+ break;
277
225
  }
278
- }, {
279
- key: "handleOptionFocus",
280
- value: function handleOptionFocus(event) {
281
- this.setState({
282
- keyboardOptionIndex: Number(event.target.value)
283
- });
226
+ }
227
+
228
+ handleOptionClick(event) {
229
+ var optionIndex = Number(event.currentTarget.value);
230
+ var {
231
+ options,
232
+ timeToValue
233
+ } = this.props;
234
+ var {
235
+ customTime
236
+ } = this.state;
237
+
238
+ if (optionIndex === CUSTOM_OPTION) {
239
+ var update = timeToValue(customTime);
240
+ this.updateAndClose(update);
241
+ } else {
242
+ this.updateAndClose(options[optionIndex].value);
284
243
  }
285
- }, {
286
- key: "handleMenuOpened",
287
- value: function handleMenuOpened() {
288
- var _this$menuContainer$c;
289
-
290
- var _this$props3 = this.props,
291
- options = _this$props3.options,
292
- value = _this$props3.value;
293
- var keyboardOptionIndex = this.state.keyboardOptionIndex;
294
- this.scrollOptionIntoView(keyboardOptionIndex);
295
- var activeOption = (_this$menuContainer$c = this.menuContainer.current) === null || _this$menuContainer$c === void 0 ? void 0 : _this$menuContainer$c.querySelector('.cs-option-btn.keyboard-active');
296
-
297
- if (activeOption instanceof HTMLElement) {
298
- activeOption.focus();
299
- }
244
+ }
300
245
 
301
- if (value === null) {
302
- return;
303
- }
246
+ updateAndClose(update) {
247
+ var _this$button$current3;
304
248
 
305
- var valueIndex = options.map(function (option) {
306
- return option.value;
307
- }).indexOf(value);
249
+ this.updateInputValue(update);
250
+ this.closeMenu();
251
+ (_this$button$current3 = this.button.current) === null || _this$button$current3 === void 0 ? void 0 : _this$button$current3.focus();
252
+ }
308
253
 
309
- if (valueIndex < 0) {
310
- // The custom option should be selected
311
- this.focusInput();
312
- }
313
- }
314
- }, {
315
- key: "focusInput",
316
- value: function focusInput() {
317
- var _this$input$current;
254
+ handleOptionFocus(event) {
255
+ this.setState({
256
+ keyboardOptionIndex: Number(event.target.value)
257
+ });
258
+ }
318
259
 
319
- (_this$input$current = this.input.current) === null || _this$input$current === void 0 ? void 0 : _this$input$current.focus();
260
+ handleMenuOpened() {
261
+ var _this$menuContainer$c;
262
+
263
+ var {
264
+ options,
265
+ value
266
+ } = this.props;
267
+ var {
268
+ keyboardOptionIndex
269
+ } = this.state;
270
+ this.scrollOptionIntoView(keyboardOptionIndex);
271
+ var activeOption = (_this$menuContainer$c = this.menuContainer.current) === null || _this$menuContainer$c === void 0 ? void 0 : _this$menuContainer$c.querySelector('.cs-option-btn.keyboard-active');
272
+
273
+ if (activeOption instanceof HTMLElement) {
274
+ activeOption.focus();
320
275
  }
321
- }, {
322
- key: "focusOption",
323
- value: function focusOption(index) {
324
- var _this$menuContainer$c2;
325
276
 
326
- var options = (_this$menuContainer$c2 = this.menuContainer.current) === null || _this$menuContainer$c2 === void 0 ? void 0 : _this$menuContainer$c2.querySelector('.cs-options');
277
+ if (value === null) {
278
+ return;
279
+ }
327
280
 
328
- if (options && options.children) {
329
- var option = options.children.item(index);
281
+ var valueIndex = options.map(option => option.value).indexOf(value);
330
282
 
331
- if (option instanceof HTMLElement) {
332
- option.focus();
333
- }
334
- }
283
+ if (valueIndex < 0) {
284
+ // The custom option should be selected
285
+ this.focusInput();
335
286
  }
336
- }, {
337
- key: "handleMenuExited",
338
- value: function handleMenuExited() {
339
- var menuIsOpen = this.state.menuIsOpen;
340
-
341
- if (menuIsOpen) {
342
- this.setState({
343
- menuIsOpen: false,
344
- keyboardOptionIndex: 0
345
- });
287
+ }
288
+
289
+ focusInput() {
290
+ var _this$input$current;
291
+
292
+ (_this$input$current = this.input.current) === null || _this$input$current === void 0 ? void 0 : _this$input$current.focus();
293
+ }
294
+
295
+ focusOption(index) {
296
+ var _this$menuContainer$c2;
297
+
298
+ var options = (_this$menuContainer$c2 = this.menuContainer.current) === null || _this$menuContainer$c2 === void 0 ? void 0 : _this$menuContainer$c2.querySelector('.cs-options');
299
+
300
+ if (options && options.children) {
301
+ var option = options.children.item(index);
302
+
303
+ if (option instanceof HTMLElement) {
304
+ option.focus();
346
305
  }
347
306
  }
348
- }, {
349
- key: "handleCustomInput",
350
- value: function handleCustomInput(value) {
351
- var timeToValue = this.props.timeToValue;
352
- var update = timeToValue(value);
353
- this.updateInputValue(update);
307
+ }
308
+
309
+ handleMenuExited() {
310
+ var {
311
+ menuIsOpen
312
+ } = this.state;
313
+
314
+ if (menuIsOpen) {
354
315
  this.setState({
355
- customTime: value
316
+ menuIsOpen: false,
317
+ keyboardOptionIndex: 0
356
318
  });
357
319
  }
358
- }, {
359
- key: "updateFromCustom",
360
- value: function updateFromCustom() {
361
- var timeToValue = this.props.timeToValue;
362
- var customTime = this.state.customTime;
363
- var update = timeToValue(customTime);
364
- this.updateInputValue(update);
365
- }
366
- }, {
367
- key: "toggleMenu",
368
- value: function toggleMenu(event) {
369
- var menuIsOpen = this.state.menuIsOpen;
320
+ }
370
321
 
371
- if (menuIsOpen) {
372
- this.closeMenu();
373
- } else {
374
- this.openMenu();
375
- }
322
+ handleCustomInput(value) {
323
+ var {
324
+ timeToValue
325
+ } = this.props;
326
+ var update = timeToValue(value);
327
+ this.updateInputValue(update);
328
+ this.setState({
329
+ customTime: value
330
+ });
331
+ }
376
332
 
377
- event.stopPropagation();
333
+ updateFromCustom() {
334
+ var {
335
+ timeToValue
336
+ } = this.props;
337
+ var {
338
+ customTime
339
+ } = this.state;
340
+ var update = timeToValue(customTime);
341
+ this.updateInputValue(update);
342
+ }
343
+
344
+ toggleMenu(event) {
345
+ var {
346
+ menuIsOpen
347
+ } = this.state;
348
+
349
+ if (menuIsOpen) {
350
+ this.closeMenu();
351
+ } else {
352
+ this.openMenu();
378
353
  }
379
- }, {
380
- key: "openMenu",
381
- value: function openMenu() {
382
- this.updateKeyboardIndex();
383
- this.setInputWidth();
384
- this.setState({
385
- menuIsOpen: true
386
- });
354
+
355
+ event.stopPropagation();
356
+ }
357
+
358
+ openMenu() {
359
+ this.updateKeyboardIndex();
360
+ this.setInputWidth();
361
+ this.setState({
362
+ menuIsOpen: true
363
+ });
364
+ }
365
+
366
+ closeMenu() {
367
+ var focusButton = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
368
+ this.setState({
369
+ menuIsOpen: false
370
+ });
371
+
372
+ if (focusButton) {
373
+ var _this$button$current4;
374
+
375
+ (_this$button$current4 = this.button.current) === null || _this$button$current4 === void 0 ? void 0 : _this$button$current4.focus();
387
376
  }
388
- }, {
389
- key: "closeMenu",
390
- value: function closeMenu() {
391
- var focusButton = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
392
- this.setState({
393
- menuIsOpen: false
394
- });
377
+ }
395
378
 
396
- if (focusButton) {
397
- var _this$button$current4;
379
+ updateKeyboardIndex() {
380
+ var {
381
+ options,
382
+ value
383
+ } = this.props;
398
384
 
399
- (_this$button$current4 = this.button.current) === null || _this$button$current4 === void 0 ? void 0 : _this$button$current4.focus();
400
- }
385
+ if (value === null) {
386
+ return;
401
387
  }
402
- }, {
403
- key: "updateKeyboardIndex",
404
- value: function updateKeyboardIndex() {
405
- var _this$props4 = this.props,
406
- options = _this$props4.options,
407
- value = _this$props4.value;
408
-
409
- if (value === null) {
410
- return;
411
- }
412
388
 
413
- var valueIndex = options.map(function (option) {
414
- return option.value;
415
- }).indexOf(value);
389
+ var valueIndex = options.map(option => option.value).indexOf(value);
416
390
 
417
- if (valueIndex > 0) {
418
- this.setState({
419
- keyboardOptionIndex: valueIndex
420
- });
421
- }
391
+ if (valueIndex > 0) {
392
+ this.setState({
393
+ keyboardOptionIndex: valueIndex
394
+ });
422
395
  }
423
- }, {
424
- key: "scrollOptionIntoView",
425
- value: function scrollOptionIntoView(index) {
426
- var _this$menuContainer$c3;
396
+ }
427
397
 
428
- var options = (_this$menuContainer$c3 = this.menuContainer.current) === null || _this$menuContainer$c3 === void 0 ? void 0 : _this$menuContainer$c3.querySelector('.cs-options');
398
+ scrollOptionIntoView(index) {
399
+ var _this$menuContainer$c3;
429
400
 
430
- if (options && options.children) {
431
- var activeOption = options.children.item(index);
401
+ var options = (_this$menuContainer$c3 = this.menuContainer.current) === null || _this$menuContainer$c3 === void 0 ? void 0 : _this$menuContainer$c3.querySelector('.cs-options');
432
402
 
433
- if (activeOption instanceof HTMLElement && activeOption.offsetTop > CustomTimeSelect.DROP_DOWN_MENU_HEIGHT) {
434
- options.scrollTop = activeOption.offsetTop - CustomTimeSelect.DROP_DOWN_MENU_HEIGHT;
435
- } else if (activeOption instanceof HTMLElement && activeOption.offsetTop < 0 || index === 0) {
436
- options.scrollTop = 0;
437
- }
403
+ if (options && options.children) {
404
+ var activeOption = options.children.item(index);
405
+
406
+ if (activeOption instanceof HTMLElement && activeOption.offsetTop > CustomTimeSelect.DROP_DOWN_MENU_HEIGHT) {
407
+ options.scrollTop = activeOption.offsetTop - CustomTimeSelect.DROP_DOWN_MENU_HEIGHT;
408
+ } else if (activeOption instanceof HTMLElement && activeOption.offsetTop < 0 || index === 0) {
409
+ options.scrollTop = 0;
438
410
  }
439
411
  }
440
- }, {
441
- key: "renderMenuElement",
442
- value: function renderMenuElement() {
443
- var inputWidth = this.state.inputWidth;
444
- return /*#__PURE__*/React.createElement("div", {
445
- className: "cs-menu-container",
446
- ref: this.menuContainer,
447
- role: "presentation",
448
- onKeyDown: this.handleMenuKeyDown,
449
- onClick: function onClick(event) {
450
- event.stopPropagation();
451
- },
452
- style: {
453
- width: inputWidth
454
- }
455
- }, /*#__PURE__*/React.createElement("div", {
456
- className: "cs-options-container"
457
- }, /*#__PURE__*/React.createElement("div", {
458
- className: "cs-options"
459
- }, this.renderOptions())));
460
- }
461
- }, {
462
- key: "renderOptions",
463
- value: function renderOptions() {
464
- var _this2 = this;
465
-
466
- var _this$props5 = this.props,
467
- options = _this$props5.options,
468
- value = _this$props5.value,
469
- icon = _this$props5.icon,
470
- customText = _this$props5.customText;
471
- var _this$state3 = this.state,
472
- keyboardOptionIndex = _this$state3.keyboardOptionIndex,
473
- customTime = _this$state3.customTime,
474
- inputFocused = _this$state3.inputFocused;
475
- var matchFound = false;
476
- var optionArray = [];
477
-
478
- for (var index = 0; index < options.length; index += 1) {
479
- var option = options[index];
480
- var key = "option-".concat(index, "-").concat(option.value);
481
- matchFound = matchFound || option.value === value;
482
- optionArray.push( /*#__PURE__*/React.createElement("button", {
483
- key: key,
484
- type: "button",
485
- value: index,
486
- className: classNames('cs-option-btn', {
487
- 'keyboard-active': keyboardOptionIndex === index && !inputFocused
488
- }),
489
- onClick: this.handleOptionClick,
490
- onFocus: this.handleOptionFocus
491
- }, option.value === value && /*#__PURE__*/React.createElement(FontAwesomeIcon, {
492
- icon: icon,
493
- className: "mr-2"
494
- }), option.value !== value && /*#__PURE__*/React.createElement("span", {
495
- className: "mr-4"
496
- }), option.title));
412
+ }
413
+
414
+ renderMenuElement() {
415
+ var {
416
+ inputWidth
417
+ } = this.state;
418
+ return /*#__PURE__*/React.createElement("div", {
419
+ className: "cs-menu-container",
420
+ ref: this.menuContainer,
421
+ role: "presentation",
422
+ onKeyDown: this.handleMenuKeyDown,
423
+ onClick: event => {
424
+ event.stopPropagation();
425
+ },
426
+ style: {
427
+ width: inputWidth
497
428
  }
429
+ }, /*#__PURE__*/React.createElement("div", {
430
+ className: "cs-options-container"
431
+ }, /*#__PURE__*/React.createElement("div", {
432
+ className: "cs-options"
433
+ }, this.renderOptions())));
434
+ }
498
435
 
499
- optionArray.push( /*#__PURE__*/React.createElement("hr", {
500
- className: "cs-divider",
501
- key: "option-divider"
502
- }));
436
+ renderOptions() {
437
+ var {
438
+ options,
439
+ value,
440
+ icon,
441
+ customText
442
+ } = this.props;
443
+ var {
444
+ keyboardOptionIndex,
445
+ customTime,
446
+ inputFocused
447
+ } = this.state;
448
+ var matchFound = false;
449
+ var optionArray = [];
450
+
451
+ for (var index = 0; index < options.length; index += 1) {
452
+ var option = options[index];
453
+ var key = "option-".concat(index, "-").concat(option.value);
454
+ matchFound = matchFound || option.value === value;
503
455
  optionArray.push( /*#__PURE__*/React.createElement("button", {
504
- key: "option-custom-label",
456
+ key: key,
505
457
  type: "button",
506
- value: CUSTOM_OPTION,
458
+ value: index,
507
459
  className: classNames('cs-option-btn', {
508
- 'keyboard-active': inputFocused
460
+ 'keyboard-active': keyboardOptionIndex === index && !inputFocused
509
461
  }),
510
462
  onClick: this.handleOptionClick,
511
463
  onFocus: this.handleOptionFocus
512
- }, !matchFound && value !== null ? /*#__PURE__*/React.createElement(FontAwesomeIcon, {
464
+ }, option.value === value && /*#__PURE__*/React.createElement(FontAwesomeIcon, {
513
465
  icon: icon,
514
466
  className: "mr-2"
515
- }) : /*#__PURE__*/React.createElement("span", {
467
+ }), option.value !== value && /*#__PURE__*/React.createElement("span", {
516
468
  className: "mr-4"
517
- }), customText));
518
- optionArray.push( /*#__PURE__*/React.createElement("div", {
519
- key: "cs-custom-container",
520
- className: "cs-custom-container"
521
- }, /*#__PURE__*/React.createElement("span", {
522
- className: "mr-2"
523
- }), /*#__PURE__*/React.createElement(TimeInput, {
524
- key: "option-input",
525
- ref: this.input,
526
- onChange: this.handleCustomInput,
527
- value: customTime,
528
- onFocus: function onFocus() {
529
- return _this2.setState({
530
- inputFocused: true
531
- });
532
- },
533
- onBlur: function onBlur() {
534
- return _this2.setState({
535
- inputFocused: false
536
- });
537
- }
538
- }), /*#__PURE__*/React.createElement("span", {
539
- className: "ml-2"
540
- })));
541
- optionArray.push( /*#__PURE__*/React.createElement("hr", {
542
- key: "option-end",
543
- className: "mb-2"
544
- }));
545
- return optionArray;
469
+ }), option.title));
546
470
  }
547
- }, {
548
- key: "render",
549
- value: function render() {
550
- var _this$props6 = this.props,
551
- disabled = _this$props6.disabled,
552
- invalid = _this$props6.invalid,
553
- value = _this$props6.value;
554
- var menuIsOpen = this.state.menuIsOpen;
555
- var popperOptions = this.props.popperOptions;
556
- popperOptions = _objectSpread({
557
- placement: 'bottom-end',
558
- modifiers: {
559
- preventOverflow: {
560
- enabled: false
561
- }
562
- }
563
- }, popperOptions);
564
- return /*#__PURE__*/React.createElement("div", {
565
- className: "input-group cs-container context-menu",
566
- ref: this.csContainer
567
- }, /*#__PURE__*/React.createElement("div", {
568
- className: classNames('input-group-append cs-dropdown', {
569
- 'cs-dropdown-invalid': invalid
570
- })
571
- }, /*#__PURE__*/React.createElement("button", {
572
- type: "button",
573
- className: classNames('btn cs-btn form-control', {
574
- 'cs-btn-invalid': invalid
575
- }),
576
- ref: this.button,
577
- onClick: this.toggleMenu,
578
- disabled: disabled
579
- }, /*#__PURE__*/React.createElement("span", {
580
- className: classNames({
581
- 'text-muted': value === null
582
- })
583
- }, this.getSelectedText()), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
584
- icon: dhSort,
585
- className: "cs-caret"
586
- })), /*#__PURE__*/React.createElement(DropdownMenu, {
587
- isShown: menuIsOpen,
588
- actions: {
589
- menuElement: this.renderMenuElement()
590
- },
591
- popperOptions: popperOptions,
592
- popperClassName: "CustomTimeSelect",
593
- onMenuOpened: this.handleMenuOpened,
594
- onMenuClosed: this.handleMenuExited,
595
- menuStyle: {
596
- maxWidth: '100rem'
471
+
472
+ optionArray.push( /*#__PURE__*/React.createElement("hr", {
473
+ className: "cs-divider",
474
+ key: "option-divider"
475
+ }));
476
+ optionArray.push( /*#__PURE__*/React.createElement("button", {
477
+ key: "option-custom-label",
478
+ type: "button",
479
+ value: CUSTOM_OPTION,
480
+ className: classNames('cs-option-btn', {
481
+ 'keyboard-active': inputFocused
482
+ }),
483
+ onClick: this.handleOptionClick,
484
+ onFocus: this.handleOptionFocus
485
+ }, !matchFound && value !== null ? /*#__PURE__*/React.createElement(FontAwesomeIcon, {
486
+ icon: icon,
487
+ className: "mr-2"
488
+ }) : /*#__PURE__*/React.createElement("span", {
489
+ className: "mr-4"
490
+ }), customText));
491
+ optionArray.push( /*#__PURE__*/React.createElement("div", {
492
+ key: "cs-custom-container",
493
+ className: "cs-custom-container"
494
+ }, /*#__PURE__*/React.createElement("span", {
495
+ className: "mr-2"
496
+ }), /*#__PURE__*/React.createElement(TimeInput, {
497
+ key: "option-input",
498
+ ref: this.input,
499
+ onChange: this.handleCustomInput,
500
+ value: customTime,
501
+ onFocus: () => this.setState({
502
+ inputFocused: true
503
+ }),
504
+ onBlur: () => this.setState({
505
+ inputFocused: false
506
+ })
507
+ }), /*#__PURE__*/React.createElement("span", {
508
+ className: "ml-2"
509
+ })));
510
+ optionArray.push( /*#__PURE__*/React.createElement("hr", {
511
+ key: "option-end",
512
+ className: "mb-2"
513
+ }));
514
+ return optionArray;
515
+ }
516
+
517
+ render() {
518
+ var {
519
+ disabled,
520
+ invalid,
521
+ value
522
+ } = this.props;
523
+ var {
524
+ menuIsOpen
525
+ } = this.state;
526
+ var {
527
+ popperOptions
528
+ } = this.props;
529
+ popperOptions = _objectSpread({
530
+ placement: 'bottom-end',
531
+ modifiers: {
532
+ preventOverflow: {
533
+ enabled: false
597
534
  }
598
- }))));
599
- }
600
- }]);
535
+ }
536
+ }, popperOptions);
537
+ return /*#__PURE__*/React.createElement("div", {
538
+ className: "input-group cs-container context-menu",
539
+ ref: this.csContainer
540
+ }, /*#__PURE__*/React.createElement("div", {
541
+ className: classNames('input-group-append cs-dropdown', {
542
+ 'cs-dropdown-invalid': invalid
543
+ })
544
+ }, /*#__PURE__*/React.createElement("button", {
545
+ type: "button",
546
+ className: classNames('btn cs-btn form-control', {
547
+ 'cs-btn-invalid': invalid
548
+ }),
549
+ ref: this.button,
550
+ onClick: this.toggleMenu,
551
+ disabled: disabled
552
+ }, /*#__PURE__*/React.createElement("span", {
553
+ className: classNames({
554
+ 'text-muted': value === null
555
+ })
556
+ }, this.getSelectedText()), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
557
+ icon: dhSort,
558
+ className: "cs-caret"
559
+ })), /*#__PURE__*/React.createElement(DropdownMenu, {
560
+ isShown: menuIsOpen,
561
+ actions: {
562
+ menuElement: this.renderMenuElement()
563
+ },
564
+ popperOptions: popperOptions,
565
+ popperClassName: "CustomTimeSelect",
566
+ onMenuOpened: this.handleMenuOpened,
567
+ onMenuClosed: this.handleMenuExited,
568
+ menuStyle: {
569
+ maxWidth: '100rem'
570
+ }
571
+ }))));
572
+ }
601
573
 
602
- return CustomTimeSelect;
603
- }(Component);
574
+ }
604
575
 
605
576
  _defineProperty(CustomTimeSelect, "MENU_NAVIGATION_DIRECTION", MENU_NAVIGATION_DIRECTION);
606
577
 
607
578
  _defineProperty(CustomTimeSelect, "DROP_DOWN_MENU_HEIGHT", 125);
608
579
 
609
580
  _defineProperty(CustomTimeSelect, "defaultProps", {
610
- onChange: function onChange() {// no-op
581
+ onChange() {// no-op
611
582
  },
583
+
612
584
  value: null,
613
585
  disabled: false,
614
586
  popperOptions: {},
615
587
  icon: vsCheck,
616
588
  customText: 'Custom',
617
589
  placeholder: 'Select a time',
618
- valueToTime: function valueToTime(value) {
619
- return value === null ? 0 : Math.round(value / 1000);
620
- },
621
- timeToValue: function timeToValue(time) {
622
- return time * 1000;
623
- },
590
+ valueToTime: value => value === null ? 0 : Math.round(value / 1000),
591
+ timeToValue: time => time * 1000,
624
592
  invalid: false
625
593
  });
626
594