@instructure/ui-select 11.7.3-snapshot-25 → 11.7.3-snapshot-27

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.
@@ -32,6 +32,11 @@ id: Select.Group
32
32
  @module Group
33
33
  **/
34
34
  class Group extends Component {
35
+ static displayName = "Group";
36
+ static componentId = 'Select.Group';
37
+ static allowedProps = allowedProps;
38
+ static defaultProps = {};
39
+
35
40
  /* istanbul ignore next */
36
41
  render() {
37
42
  // this component is only used for prop validation. Select.Group children
@@ -39,9 +44,5 @@ class Group extends Component {
39
44
  return null;
40
45
  }
41
46
  }
42
- Group.displayName = "Group";
43
- Group.componentId = 'Select.Group';
44
- Group.allowedProps = allowedProps;
45
- Group.defaultProps = {};
46
47
  export default Group;
47
48
  export { Group };
@@ -32,6 +32,15 @@ id: Select.Option
32
32
  @module Option
33
33
  **/
34
34
  class Option extends Component {
35
+ static displayName = "Option";
36
+ static componentId = 'Select.Option';
37
+ static allowedProps = allowedProps;
38
+ static defaultProps = {
39
+ isHighlighted: false,
40
+ isSelected: false,
41
+ isDisabled: false
42
+ };
43
+
35
44
  /* istanbul ignore next */
36
45
  render() {
37
46
  // this component is only used for prop validation. Select.Option children
@@ -39,13 +48,5 @@ class Option extends Component {
39
48
  return null;
40
49
  }
41
50
  }
42
- Option.displayName = "Option";
43
- Option.componentId = 'Select.Option';
44
- Option.allowedProps = allowedProps;
45
- Option.defaultProps = {
46
- isHighlighted: false,
47
- isSelected: false,
48
- isDisabled: false
49
- };
50
51
  export default Option;
51
52
  export { Option };
@@ -1,8 +1,4 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- const _excluded = ["id", "renderLabel", "children"],
3
- _excluded2 = ["renderLabel", "inputValue", "placeholder", "isRequired", "shouldNotWrap", "size", "isInline", "width", "htmlSize", "messages", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onInputChange", "onRequestHideOptions", "layout"],
4
- _excluded3 = ["ref"];
5
- var _dec, _dec2, _class, _Select, _Options$Separator, _Options$Separator2;
1
+ var _dec, _dec2, _class;
6
2
  /*
7
3
  * The MIT License (MIT)
8
4
  *
@@ -54,8 +50,10 @@ const selectSizeToIconSize = {
54
50
  // because the Select component is re-rendered on every prop change of the <Select.Option>
55
51
  // and with a large amount of options, this can cause a lot of unnecessary re-renders.
56
52
  const MemoedOption = /*#__PURE__*/memo(function Opt(props) {
57
- const optionsItemProps = props.optionsItemProps,
58
- children = props.children;
53
+ const {
54
+ optionsItemProps,
55
+ children
56
+ } = props;
59
57
  return (
60
58
  // The main <Options> that renders this is always an "ul"
61
59
  _jsx(Options.Item, {
@@ -80,58 +78,50 @@ category: components
80
78
  tags: autocomplete, typeahead, combobox, dropdown, search, form
81
79
  ---
82
80
  **/
83
- let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _dec(_class = _dec2(_class = (_Select = class Select extends Component {
84
- constructor(...args) {
85
- super(...args);
86
- this.SCROLL_TOLERANCE = 0.5;
87
- this.state = {
88
- hasInputRef: false
89
- };
90
- this.ref = null;
91
- this._input = null;
92
- this._defaultId = this.props.deterministicId();
93
- this._inputContainer = null;
94
- this._listView = null;
95
- // temporarily stores actionable options
96
- this._optionIds = [];
97
- // best guess for first calculation of list height
98
- this._optionHeight = 36;
99
- this.handleInputRef = node => {
100
- var _this$props$inputRef, _this$props;
101
- // ensures list is positioned with respect to input if list is open on mount
102
- if (!this.state.hasInputRef) {
103
- this.setState({
104
- hasInputRef: true
105
- });
106
- }
107
- this._input = node;
108
- (_this$props$inputRef = (_this$props = this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, node);
109
- };
110
- this.handleListRef = node => {
111
- var _this$props$listRef, _this$props2;
112
- (_this$props$listRef = (_this$props2 = this.props).listRef) === null || _this$props$listRef === void 0 ? void 0 : _this$props$listRef.call(_this$props2, node);
113
-
114
- // store option height to calculate list maxHeight
115
- if (node && node.querySelector('[role="option"]')) {
116
- this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
117
- }
118
- };
119
- this.handleInputContainerRef = node => {
120
- this._inputContainer = node;
121
- };
122
- }
81
+ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _dec(_class = _dec2(_class = class Select extends Component {
82
+ static displayName = "Select";
83
+ static componentId = 'Select';
84
+ SCROLL_TOLERANCE = 0.5;
85
+ static allowedProps = allowedProps;
86
+ static defaultProps = {
87
+ inputValue: '',
88
+ isShowingOptions: false,
89
+ size: 'medium',
90
+ // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
91
+ interaction: undefined,
92
+ isRequired: false,
93
+ isInline: false,
94
+ visibleOptionsCount: 8,
95
+ placement: 'bottom stretch',
96
+ constrain: 'window',
97
+ shouldNotWrap: false,
98
+ scrollToHighlightedOption: true,
99
+ isOptionContentAppliedToInput: false
100
+ };
101
+ static Option = Option;
102
+ static Group = Group;
123
103
  componentDidMount() {
124
- var _this$props$makeStyle, _this$props3;
125
- (_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
104
+ this.props.makeStyles?.();
126
105
  }
127
106
  componentDidUpdate() {
128
- var _this$props$makeStyle2, _this$props4;
129
- (_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
107
+ this.props.makeStyles?.();
130
108
  if (this.props.scrollToHighlightedOption) {
131
109
  // scroll option into view if needed
132
110
  requestAnimationFrame(() => this.scrollToOption(this.highlightedOptionId));
133
111
  }
134
112
  }
113
+ state = {
114
+ hasInputRef: false
115
+ };
116
+ ref = null;
117
+ _input = null;
118
+ _defaultId = this.props.deterministicId();
119
+ _inputContainer = null;
120
+ _listView = null;
121
+ // temporarily stores actionable options
122
+ _optionIds = [];
123
+ // best guess for first calculation of list height
124
+ _optionHeight = 36;
135
125
  focus() {
136
126
  this._input && this._input.focus();
137
127
  }
@@ -151,7 +141,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
151
141
  return this.props.id || this._defaultId;
152
142
  }
153
143
  get width() {
154
- return this._inputContainer ? this._inputContainer.offsetWidth : void 0;
144
+ return this._inputContainer ? this._inputContainer.offsetWidth : undefined;
155
145
  }
156
146
  get interaction() {
157
147
  return getInteraction({
@@ -200,10 +190,31 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
200
190
  return selectedOptionId[0];
201
191
  }
202
192
  if (selectedOptionId.length === 0) {
203
- return void 0;
193
+ return undefined;
204
194
  }
205
195
  return selectedOptionId;
206
196
  }
197
+ handleInputRef = node => {
198
+ // ensures list is positioned with respect to input if list is open on mount
199
+ if (!this.state.hasInputRef) {
200
+ this.setState({
201
+ hasInputRef: true
202
+ });
203
+ }
204
+ this._input = node;
205
+ this.props.inputRef?.(node);
206
+ };
207
+ handleListRef = node => {
208
+ this.props.listRef?.(node);
209
+
210
+ // store option height to calculate list maxHeight
211
+ if (node && node.querySelector('[role="option"]')) {
212
+ this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
213
+ }
214
+ };
215
+ handleInputContainerRef = node => {
216
+ this._inputContainer = node;
217
+ };
207
218
  scrollToOption(id) {
208
219
  if (!this._listView || !id) return;
209
220
  const option = this._listView.querySelector(`[id="${CSS.escape(id)}"]`);
@@ -220,22 +231,25 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
220
231
  }
221
232
  }
222
233
  highlightOption(event, id) {
223
- const onRequestHighlightOption = this.props.onRequestHighlightOption;
234
+ const {
235
+ onRequestHighlightOption
236
+ } = this.props;
224
237
  if (id) {
225
- onRequestHighlightOption === null || onRequestHighlightOption === void 0 ? void 0 : onRequestHighlightOption(event, {
238
+ onRequestHighlightOption?.(event, {
226
239
  id
227
240
  });
228
241
  }
229
242
  }
230
243
  getEventHandlers() {
231
- const _this$props5 = this.props,
232
- isShowingOptions = _this$props5.isShowingOptions,
233
- onRequestShowOptions = _this$props5.onRequestShowOptions,
234
- onRequestHideOptions = _this$props5.onRequestHideOptions,
235
- onRequestSelectOption = _this$props5.onRequestSelectOption;
244
+ const {
245
+ isShowingOptions,
246
+ onRequestShowOptions,
247
+ onRequestHideOptions,
248
+ onRequestSelectOption
249
+ } = this.props;
236
250
  return this.interaction === 'enabled' ? {
237
251
  onRequestShowOptions: event => {
238
- onRequestShowOptions === null || onRequestShowOptions === void 0 ? void 0 : onRequestShowOptions(event);
252
+ onRequestShowOptions?.(event);
239
253
  const selectedOptionId = this.selectedOptionId;
240
254
  if (selectedOptionId && !Array.isArray(selectedOptionId)) {
241
255
  // highlight selected option on show
@@ -243,7 +257,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
243
257
  }
244
258
  },
245
259
  onRequestHideOptions: event => {
246
- onRequestHideOptions === null || onRequestHideOptions === void 0 ? void 0 : onRequestHideOptions(event);
260
+ onRequestHideOptions?.(event);
247
261
  },
248
262
  onRequestHighlightOption: (event, {
249
263
  id,
@@ -252,7 +266,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
252
266
  if (!isShowingOptions) return;
253
267
  const highlightedOptionId = this.highlightedOptionId;
254
268
  // if id exists, use that
255
- let highlightId = this._optionIds.indexOf(id) > -1 ? id : void 0;
269
+ let highlightId = this._optionIds.indexOf(id) > -1 ? id : undefined;
256
270
  if (!highlightId) {
257
271
  if (!highlightedOptionId) {
258
272
  // nothing highlighted yet, highlight first option
@@ -260,7 +274,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
260
274
  } else {
261
275
  // find next id based on direction
262
276
  const index = this._optionIds.indexOf(highlightedOptionId);
263
- highlightId = index > -1 ? this._optionIds[index + direction] : void 0;
277
+ highlightId = index > -1 ? this._optionIds[index + direction] : undefined;
264
278
  }
265
279
  }
266
280
  if (highlightId) {
@@ -279,7 +293,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
279
293
  }) => {
280
294
  if (id && this._optionIds.indexOf(id) !== -1) {
281
295
  // only select if id exists as a valid option
282
- onRequestSelectOption === null || onRequestSelectOption === void 0 ? void 0 : onRequestSelectOption(event, {
296
+ onRequestSelectOption?.(event, {
283
297
  id
284
298
  });
285
299
  }
@@ -287,19 +301,21 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
287
301
  } : {};
288
302
  }
289
303
  renderOption(option, data) {
290
- const getOptionProps = data.getOptionProps,
291
- getDisabledOptionProps = data.getDisabledOptionProps;
292
- const _option$props = option.props,
293
- id = _option$props.id,
294
- isDisabled = _option$props.isDisabled,
295
- isHighlighted = _option$props.isHighlighted,
296
- isSelected = _option$props.isSelected,
297
- renderBeforeLabel = _option$props.renderBeforeLabel,
298
- renderAfterLabel = _option$props.renderAfterLabel,
299
- children = _option$props.children;
304
+ const {
305
+ getOptionProps,
306
+ getDisabledOptionProps
307
+ } = data;
308
+ const {
309
+ id,
310
+ isDisabled,
311
+ isHighlighted,
312
+ isSelected,
313
+ renderBeforeLabel,
314
+ renderAfterLabel,
315
+ children
316
+ } = option.props;
300
317
  const getRenderOptionLabel = renderOptionLabel => {
301
- var _renderOptionLabel$pr;
302
- return typeof renderOptionLabel === 'function' && !(renderOptionLabel !== null && renderOptionLabel !== void 0 && (_renderOptionLabel$pr = renderOptionLabel.prototype) !== null && _renderOptionLabel$pr !== void 0 && _renderOptionLabel$pr.isReactComponent) ? renderOptionLabel.bind(null, {
318
+ return typeof renderOptionLabel === 'function' && !renderOptionLabel?.prototype?.isReactComponent ? renderOptionLabel.bind(null, {
303
319
  id,
304
320
  isDisabled,
305
321
  isSelected,
@@ -307,10 +323,10 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
307
323
  children
308
324
  }) : renderOptionLabel;
309
325
  };
310
- const _this$props6 = this.props,
311
- isOptionContentAppliedToInput = _this$props6.isOptionContentAppliedToInput,
312
- _this$props6$size = _this$props6.size,
313
- size = _this$props6$size === void 0 ? 'medium' : _this$props6$size;
326
+ const {
327
+ isOptionContentAppliedToInput,
328
+ size = 'medium'
329
+ } = this.props;
314
330
  const iconSize = selectSizeToIconSize[size];
315
331
  const checkIcon = isSelected && !isOptionContentAppliedToInput ? _jsx(CheckInstUIIcon, {
316
332
  inline: false,
@@ -326,7 +342,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
326
342
  }),
327
343
  // Options.Item props
328
344
  renderBeforeLabel: getRenderOptionLabel(renderBeforeLabel),
329
- renderAfterLabel: checkIcon !== null && checkIcon !== void 0 ? checkIcon : getRenderOptionLabel(renderAfterLabel)
345
+ renderAfterLabel: checkIcon ?? getRenderOptionLabel(renderAfterLabel)
330
346
  };
331
347
  // should option be treated as highlighted or selected
332
348
  if (isSelected && isHighlighted) {
@@ -356,20 +372,23 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
356
372
  });
357
373
  }
358
374
  renderGroup(group, data) {
359
- const getOptionProps = data.getOptionProps,
360
- getDisabledOptionProps = data.getDisabledOptionProps,
361
- isFirstChild = data.isFirstChild,
362
- isLastChild = data.isLastChild,
363
- afterGroup = data.afterGroup;
364
- const _group$props = group.props,
365
- id = _group$props.id,
366
- renderLabel = _group$props.renderLabel,
367
- children = _group$props.children,
368
- rest = _objectWithoutProperties(_group$props, _excluded);
375
+ const {
376
+ getOptionProps,
377
+ getDisabledOptionProps,
378
+ isFirstChild,
379
+ isLastChild,
380
+ afterGroup
381
+ } = data;
382
+ const {
383
+ id,
384
+ renderLabel,
385
+ children,
386
+ ...rest
387
+ } = group.props;
369
388
  const groupChildren = [];
370
389
  // add a separator above
371
390
  if (!isFirstChild && !afterGroup) {
372
- groupChildren.push(_Options$Separator || (_Options$Separator = _jsx(Options.Separator, {})));
391
+ groupChildren.push(_jsx(Options.Separator, {}));
373
392
  }
374
393
  // create a sublist as a group
375
394
  // a wrapping listitem will be created by Options
@@ -388,20 +407,23 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
388
407
  }));
389
408
  // add a separator below
390
409
  if (!isLastChild) {
391
- groupChildren.push(_Options$Separator2 || (_Options$Separator2 = _jsx(Options.Separator, {})));
410
+ groupChildren.push(_jsx(Options.Separator, {}));
392
411
  }
393
412
  return groupChildren;
394
413
  }
395
414
  renderList(data) {
396
- const getListProps = data.getListProps,
397
- getOptionProps = data.getOptionProps,
398
- getDisabledOptionProps = data.getDisabledOptionProps;
399
- const _this$props7 = this.props,
400
- isShowingOptions = _this$props7.isShowingOptions,
401
- optionsMaxWidth = _this$props7.optionsMaxWidth,
402
- optionsMaxHeight = _this$props7.optionsMaxHeight,
403
- visibleOptionsCount = _this$props7.visibleOptionsCount,
404
- children = _this$props7.children;
415
+ const {
416
+ getListProps,
417
+ getOptionProps,
418
+ getDisabledOptionProps
419
+ } = data;
420
+ const {
421
+ isShowingOptions,
422
+ optionsMaxWidth,
423
+ optionsMaxHeight,
424
+ visibleOptionsCount,
425
+ children
426
+ } = this.props;
405
427
  let lastWasGroup = false;
406
428
  const viewProps = isShowingOptions ? {
407
429
  display: 'block',
@@ -452,10 +474,10 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
452
474
  });
453
475
  }
454
476
  renderIcon() {
455
- const _this$props8 = this.props,
456
- isShowingOptions = _this$props8.isShowingOptions,
457
- _this$props8$size = _this$props8.size,
458
- size = _this$props8$size === void 0 ? 'medium' : _this$props8$size;
477
+ const {
478
+ isShowingOptions,
479
+ size = 'medium'
480
+ } = this.props;
459
481
  const iconSize = selectSizeToIconSize[size];
460
482
  return _jsx("span", {
461
483
  children: isShowingOptions ? _jsx(ChevronUpInstUIIcon, {
@@ -512,50 +534,58 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
512
534
  return defaultReturn;
513
535
  }
514
536
  handleRenderBeforeInput() {
515
- const _this$props9 = this.props,
516
- renderBeforeInput = _this$props9.renderBeforeInput,
517
- inputValue = _this$props9.inputValue,
518
- isOptionContentAppliedToInput = _this$props9.isOptionContentAppliedToInput;
537
+ const {
538
+ renderBeforeInput,
539
+ inputValue,
540
+ isOptionContentAppliedToInput
541
+ } = this.props;
519
542
  return this.handleInputContentRender(renderBeforeInput, inputValue, isOptionContentAppliedToInput, 'before', null // default for before
520
543
  );
521
544
  }
522
545
  handleRenderAfterInput() {
523
- const _this$props0 = this.props,
524
- renderAfterInput = _this$props0.renderAfterInput,
525
- inputValue = _this$props0.inputValue,
526
- isOptionContentAppliedToInput = _this$props0.isOptionContentAppliedToInput;
546
+ const {
547
+ renderAfterInput,
548
+ inputValue,
549
+ isOptionContentAppliedToInput
550
+ } = this.props;
527
551
  return this.handleInputContentRender(renderAfterInput, inputValue, isOptionContentAppliedToInput, 'after', this.renderIcon() // default for after
528
552
  );
529
553
  }
530
554
  renderInput(data) {
531
- const getInputProps = data.getInputProps,
532
- getTriggerProps = data.getTriggerProps;
533
- const _this$props1 = this.props,
534
- renderLabel = _this$props1.renderLabel,
535
- inputValue = _this$props1.inputValue,
536
- placeholder = _this$props1.placeholder,
537
- isRequired = _this$props1.isRequired,
538
- shouldNotWrap = _this$props1.shouldNotWrap,
539
- size = _this$props1.size,
540
- isInline = _this$props1.isInline,
541
- width = _this$props1.width,
542
- htmlSize = _this$props1.htmlSize,
543
- messages = _this$props1.messages,
544
- renderBeforeInput = _this$props1.renderBeforeInput,
545
- renderAfterInput = _this$props1.renderAfterInput,
546
- onFocus = _this$props1.onFocus,
547
- onBlur = _this$props1.onBlur,
548
- onInputChange = _this$props1.onInputChange,
549
- onRequestHideOptions = _this$props1.onRequestHideOptions,
550
- layout = _this$props1.layout,
551
- rest = _objectWithoutProperties(_this$props1, _excluded2);
552
- const interaction = this.interaction;
555
+ const {
556
+ getInputProps,
557
+ getTriggerProps
558
+ } = data;
559
+ const {
560
+ renderLabel,
561
+ inputValue,
562
+ placeholder,
563
+ isRequired,
564
+ shouldNotWrap,
565
+ size,
566
+ isInline,
567
+ width,
568
+ htmlSize,
569
+ messages,
570
+ renderBeforeInput,
571
+ renderAfterInput,
572
+ onFocus,
573
+ onBlur,
574
+ onInputChange,
575
+ onRequestHideOptions,
576
+ layout,
577
+ ...rest
578
+ } = this.props;
579
+ const {
580
+ interaction
581
+ } = this;
553
582
  const passthroughProps = omitProps(rest, Select.allowedProps);
554
- const _getTriggerProps = getTriggerProps({
555
- ...passthroughProps
556
- }),
557
- ref = _getTriggerProps.ref,
558
- triggerProps = _objectWithoutProperties(_getTriggerProps, _excluded3);
583
+ const {
584
+ ref,
585
+ ...triggerProps
586
+ } = getTriggerProps({
587
+ ...passthroughProps
588
+ });
559
589
  const isEditable = typeof onInputChange !== 'undefined';
560
590
 
561
591
  // props to ensure screen readers treat uneditable selects as accessible
@@ -570,7 +600,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
570
600
  // that its 'read-only' and that this is a 'textfield', see INSTUI-4500
571
601
  role: utils.isSafari() || utils.isAndroidOrIOS() || interaction === 'disabled' && utils.isChromium() ? 'button' : 'combobox',
572
602
  title: inputValue,
573
- 'aria-autocomplete': void 0,
603
+ 'aria-autocomplete': undefined,
574
604
  'aria-readonly': true
575
605
  } : interaction === 'disabled' && utils.isChromium() ? {
576
606
  role: 'button'
@@ -601,14 +631,14 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
601
631
  // On iOS VoiceOver, if there is a custom element instead of the changing up and down arrow button
602
632
  // the listbox closes on a swipe, so a DOM change is enforced by the key change
603
633
  // that seems to inform VoiceOver to behave the correct way
604
- renderAfterInput: utils.isAndroidOrIOS() && renderAfterInput !== void 0 ? _jsx("span", {
634
+ renderAfterInput: utils.isAndroidOrIOS() && renderAfterInput !== undefined ? _jsx("span", {
605
635
  children: this.handleRenderAfterInput()
606
636
  }, this.props.isShowingOptions ? 'open' : 'closed') : this.handleRenderAfterInput(),
607
637
  // If `inputValue` is provided, we need to pass a default onChange handler,
608
638
  // because TextInput `value` is a controlled prop,
609
639
  // and onChange is not required for Select
610
640
  // (before it was handled by TextInput's defaultProp)
611
- onChange: typeof onInputChange === 'function' ? onInputChange : inputValue ? () => {} : void 0,
641
+ onChange: typeof onInputChange === 'function' ? onInputChange : inputValue ? () => {} : undefined,
612
642
  onFocus,
613
643
  onBlur: utils.createChainedFunction(onBlur, onRequestHideOptions),
614
644
  ...overrideProps
@@ -626,13 +656,14 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
626
656
  });
627
657
  }
628
658
  render() {
629
- const _this$props10 = this.props,
630
- constrain = _this$props10.constrain,
631
- placement = _this$props10.placement,
632
- mountNode = _this$props10.mountNode,
633
- assistiveText = _this$props10.assistiveText,
634
- isShowingOptions = _this$props10.isShowingOptions,
635
- styles = _this$props10.styles;
659
+ const {
660
+ constrain,
661
+ placement,
662
+ mountNode,
663
+ assistiveText,
664
+ isShowingOptions,
665
+ styles
666
+ } = this.props;
636
667
  // clear temporary option store
637
668
  this._optionIds = [];
638
669
  const highlightedOptionId = this.highlightedOptionId;
@@ -661,7 +692,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
661
692
  getTriggerProps
662
693
  }), _jsx("span", {
663
694
  ...getDescriptionProps(),
664
- css: styles === null || styles === void 0 ? void 0 : styles.assistiveText,
695
+ css: styles?.assistiveText,
665
696
  children: assistiveText
666
697
  }), _jsx(Popover, {
667
698
  constrain: constrain,
@@ -670,12 +701,12 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
670
701
  // in order to be able to navigate through the list items with a swipe.
671
702
  // The swipe would result in closing the listbox if mounted elsewhere.
672
703
  ,
673
- mountNode: mountNode !== void 0 ? mountNode : utils.isAndroidOrIOS() ? this.ref : void 0,
704
+ mountNode: mountNode !== undefined ? mountNode : utils.isAndroidOrIOS() ? this.ref : undefined,
674
705
  positionTarget: this._inputContainer,
675
706
  isShowingContent: isShowingOptions,
676
707
  shouldReturnFocus: false,
677
708
  withArrow: false,
678
- borderWidth: styles === null || styles === void 0 ? void 0 : styles.popoverBorderWidth,
709
+ borderWidth: styles?.popoverBorderWidth,
679
710
  children: this.renderList({
680
711
  getListProps,
681
712
  getOptionProps,
@@ -685,20 +716,6 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
685
716
  })
686
717
  });
687
718
  }
688
- }, _Select.displayName = "Select", _Select.componentId = 'Select', _Select.allowedProps = allowedProps, _Select.defaultProps = {
689
- inputValue: '',
690
- isShowingOptions: false,
691
- size: 'medium',
692
- // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
693
- interaction: void 0,
694
- isRequired: false,
695
- isInline: false,
696
- visibleOptionsCount: 8,
697
- placement: 'bottom stretch',
698
- constrain: 'window',
699
- shouldNotWrap: false,
700
- scrollToHighlightedOption: true,
701
- isOptionContentAppliedToInput: false
702
- }, _Select.Option = Option, _Select.Group = Group, _Select)) || _class) || _class);
719
+ }) || _class) || _class);
703
720
  export default Select;
704
721
  export { Select };
@@ -38,6 +38,11 @@ id: Select.Group
38
38
  @module Group
39
39
  **/
40
40
  class Group extends _react.Component {
41
+ static displayName = "Group";
42
+ static componentId = 'Select.Group';
43
+ static allowedProps = _props.allowedProps;
44
+ static defaultProps = {};
45
+
41
46
  /* istanbul ignore next */
42
47
  render() {
43
48
  // this component is only used for prop validation. Select.Group children
@@ -46,8 +51,4 @@ class Group extends _react.Component {
46
51
  }
47
52
  }
48
53
  exports.Group = Group;
49
- Group.displayName = "Group";
50
- Group.componentId = 'Select.Group';
51
- Group.allowedProps = _props.allowedProps;
52
- Group.defaultProps = {};
53
54
  var _default = exports.default = Group;
@@ -38,6 +38,15 @@ id: Select.Option
38
38
  @module Option
39
39
  **/
40
40
  class Option extends _react.Component {
41
+ static displayName = "Option";
42
+ static componentId = 'Select.Option';
43
+ static allowedProps = _props.allowedProps;
44
+ static defaultProps = {
45
+ isHighlighted: false,
46
+ isSelected: false,
47
+ isDisabled: false
48
+ };
49
+
41
50
  /* istanbul ignore next */
42
51
  render() {
43
52
  // this component is only used for prop validation. Select.Option children
@@ -46,12 +55,4 @@ class Option extends _react.Component {
46
55
  }
47
56
  }
48
57
  exports.Option = Option;
49
- Option.displayName = "Option";
50
- Option.componentId = 'Select.Option';
51
- Option.allowedProps = _props.allowedProps;
52
- Option.defaultProps = {
53
- isHighlighted: false,
54
- isSelected: false,
55
- isDisabled: false
56
- };
57
58
  var _default = exports.default = Option;