@instructure/ui-simple-select 7.14.1 → 7.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/es/SimpleSelect/index.js +15 -6
- package/lib/SimpleSelect/index.js +15 -6
- package/package.json +14 -14
- package/src/SimpleSelect/index.js +12 -4
- package/types/index.d.ts +9 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [7.15.0](https://github.com/instructure/instructure-ui/compare/v7.14.1...v7.15.0) (2022-02-03)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **ui-simple-select:** add `optionsMaxHeight` prop to SimpleSelect ([6dad00d](https://github.com/instructure/instructure-ui/commit/6dad00d))
|
|
11
|
+
|
|
6
12
|
## [7.14.1](https://github.com/instructure/instructure-ui/compare/v7.14.0...v7.14.1) (2021-12-06)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @instructure/ui-simple-select
|
package/es/SimpleSelect/index.js
CHANGED
|
@@ -346,6 +346,7 @@ var SimpleSelect = (_dec = testable(), _dec(_class = (_temp = _class2 = /*#__PUR
|
|
|
346
346
|
isInline = _this$props.isInline,
|
|
347
347
|
width = _this$props.width,
|
|
348
348
|
optionsMaxWidth = _this$props.optionsMaxWidth,
|
|
349
|
+
optionsMaxHeight = _this$props.optionsMaxHeight,
|
|
349
350
|
visibleOptionsCount = _this$props.visibleOptionsCount,
|
|
350
351
|
messages = _this$props.messages,
|
|
351
352
|
placement = _this$props.placement,
|
|
@@ -361,7 +362,7 @@ var SimpleSelect = (_dec = testable(), _dec(_class = (_temp = _class2 = /*#__PUR
|
|
|
361
362
|
onShowOptions = _this$props.onShowOptions,
|
|
362
363
|
onHideOptions = _this$props.onHideOptions,
|
|
363
364
|
children = _this$props.children,
|
|
364
|
-
rest = _objectWithoutProperties(_this$props, ["renderLabel", "value", "defaultValue", "id", "size", "assistiveText", "placeholder", "interaction", "isRequired", "isInline", "width", "optionsMaxWidth", "visibleOptionsCount", "messages", "placement", "constrain", "mountNode", "inputRef", "listRef", "renderEmptyOption", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onShowOptions", "onHideOptions", "children"]);
|
|
365
|
+
rest = _objectWithoutProperties(_this$props, ["renderLabel", "value", "defaultValue", "id", "size", "assistiveText", "placeholder", "interaction", "isRequired", "isInline", "width", "optionsMaxWidth", "optionsMaxHeight", "visibleOptionsCount", "messages", "placement", "constrain", "mountNode", "inputRef", "listRef", "renderEmptyOption", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onShowOptions", "onHideOptions", "children"]);
|
|
365
366
|
|
|
366
367
|
return /*#__PURE__*/React.createElement(Select, Object.assign({
|
|
367
368
|
renderLabel: renderLabel,
|
|
@@ -376,6 +377,7 @@ var SimpleSelect = (_dec = testable(), _dec(_class = (_temp = _class2 = /*#__PUR
|
|
|
376
377
|
isInline: isInline,
|
|
377
378
|
width: width,
|
|
378
379
|
optionsMaxWidth: optionsMaxWidth,
|
|
380
|
+
optionsMaxHeight: optionsMaxHeight,
|
|
379
381
|
visibleOptionsCount: visibleOptionsCount,
|
|
380
382
|
messages: messages,
|
|
381
383
|
placement: placement,
|
|
@@ -484,15 +486,21 @@ var SimpleSelect = (_dec = testable(), _dec(_class = (_temp = _class2 = /*#__PUR
|
|
|
484
486
|
width: PropTypes.string,
|
|
485
487
|
|
|
486
488
|
/**
|
|
487
|
-
* The
|
|
488
|
-
* set, the list will only display as wide as the text input.
|
|
489
|
+
* The number of options that should be visible before having to scroll. Works best when the options are the same height.
|
|
489
490
|
*/
|
|
490
|
-
|
|
491
|
+
visibleOptionsCount: PropTypes.number,
|
|
491
492
|
|
|
492
493
|
/**
|
|
493
|
-
* The
|
|
494
|
+
* The max height the options list can be before having to scroll. If
|
|
495
|
+
* set, it will __override__ the `visibleOptionsCount` prop.
|
|
494
496
|
*/
|
|
495
|
-
|
|
497
|
+
optionsMaxHeight: PropTypes.string,
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* The max width the options list can be before option text wraps. If not
|
|
501
|
+
* set, the list will only display as wide as the text input.
|
|
502
|
+
*/
|
|
503
|
+
optionsMaxWidth: PropTypes.string,
|
|
496
504
|
|
|
497
505
|
/**
|
|
498
506
|
* Displays messages and validation for the input. It should be an object
|
|
@@ -591,6 +599,7 @@ var SimpleSelect = (_dec = testable(), _dec(_class = (_temp = _class2 = /*#__PUR
|
|
|
591
599
|
isInline: false,
|
|
592
600
|
width: void 0,
|
|
593
601
|
optionsMaxWidth: void 0,
|
|
602
|
+
optionsMaxHeight: void 0,
|
|
594
603
|
visibleOptionsCount: 8,
|
|
595
604
|
messages: void 0,
|
|
596
605
|
placement: 'bottom stretch',
|
|
@@ -356,6 +356,7 @@ var SimpleSelect = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _cl
|
|
|
356
356
|
isInline = _this$props.isInline,
|
|
357
357
|
width = _this$props.width,
|
|
358
358
|
optionsMaxWidth = _this$props.optionsMaxWidth,
|
|
359
|
+
optionsMaxHeight = _this$props.optionsMaxHeight,
|
|
359
360
|
visibleOptionsCount = _this$props.visibleOptionsCount,
|
|
360
361
|
messages = _this$props.messages,
|
|
361
362
|
placement = _this$props.placement,
|
|
@@ -371,7 +372,7 @@ var SimpleSelect = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _cl
|
|
|
371
372
|
onShowOptions = _this$props.onShowOptions,
|
|
372
373
|
onHideOptions = _this$props.onHideOptions,
|
|
373
374
|
children = _this$props.children,
|
|
374
|
-
rest = (0, _objectWithoutProperties2.default)(_this$props, ["renderLabel", "value", "defaultValue", "id", "size", "assistiveText", "placeholder", "interaction", "isRequired", "isInline", "width", "optionsMaxWidth", "visibleOptionsCount", "messages", "placement", "constrain", "mountNode", "inputRef", "listRef", "renderEmptyOption", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onShowOptions", "onHideOptions", "children"]);
|
|
375
|
+
rest = (0, _objectWithoutProperties2.default)(_this$props, ["renderLabel", "value", "defaultValue", "id", "size", "assistiveText", "placeholder", "interaction", "isRequired", "isInline", "width", "optionsMaxWidth", "optionsMaxHeight", "visibleOptionsCount", "messages", "placement", "constrain", "mountNode", "inputRef", "listRef", "renderEmptyOption", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onShowOptions", "onHideOptions", "children"]);
|
|
375
376
|
return /*#__PURE__*/_react.default.createElement(_Select.Select, Object.assign({
|
|
376
377
|
renderLabel: renderLabel,
|
|
377
378
|
inputValue: this.state.inputValue,
|
|
@@ -385,6 +386,7 @@ var SimpleSelect = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _cl
|
|
|
385
386
|
isInline: isInline,
|
|
386
387
|
width: width,
|
|
387
388
|
optionsMaxWidth: optionsMaxWidth,
|
|
389
|
+
optionsMaxHeight: optionsMaxHeight,
|
|
388
390
|
visibleOptionsCount: visibleOptionsCount,
|
|
389
391
|
messages: messages,
|
|
390
392
|
placement: placement,
|
|
@@ -492,15 +494,21 @@ var SimpleSelect = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _cl
|
|
|
492
494
|
width: _propTypes.default.string,
|
|
493
495
|
|
|
494
496
|
/**
|
|
495
|
-
* The
|
|
496
|
-
* set, the list will only display as wide as the text input.
|
|
497
|
+
* The number of options that should be visible before having to scroll. Works best when the options are the same height.
|
|
497
498
|
*/
|
|
498
|
-
|
|
499
|
+
visibleOptionsCount: _propTypes.default.number,
|
|
499
500
|
|
|
500
501
|
/**
|
|
501
|
-
* The
|
|
502
|
+
* The max height the options list can be before having to scroll. If
|
|
503
|
+
* set, it will __override__ the `visibleOptionsCount` prop.
|
|
502
504
|
*/
|
|
503
|
-
|
|
505
|
+
optionsMaxHeight: _propTypes.default.string,
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* The max width the options list can be before option text wraps. If not
|
|
509
|
+
* set, the list will only display as wide as the text input.
|
|
510
|
+
*/
|
|
511
|
+
optionsMaxWidth: _propTypes.default.string,
|
|
504
512
|
|
|
505
513
|
/**
|
|
506
514
|
* Displays messages and validation for the input. It should be an object
|
|
@@ -599,6 +607,7 @@ var SimpleSelect = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _cl
|
|
|
599
607
|
isInline: false,
|
|
600
608
|
width: void 0,
|
|
601
609
|
optionsMaxWidth: void 0,
|
|
610
|
+
optionsMaxHeight: void 0,
|
|
602
611
|
visibleOptionsCount: 8,
|
|
603
612
|
messages: void 0,
|
|
604
613
|
placement: 'bottom stretch',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-simple-select",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.15.0",
|
|
4
4
|
"description": "A component for standard select element behavior.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -24,22 +24,22 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.9.2",
|
|
27
|
-
"@instructure/console": "^7.
|
|
28
|
-
"@instructure/ui-form-field": "^7.
|
|
29
|
-
"@instructure/ui-position": "^7.
|
|
30
|
-
"@instructure/ui-prop-types": "^7.
|
|
31
|
-
"@instructure/ui-react-utils": "^7.
|
|
32
|
-
"@instructure/ui-select": "^7.
|
|
33
|
-
"@instructure/ui-testable": "^7.
|
|
34
|
-
"@instructure/ui-themeable": "^7.
|
|
35
|
-
"@instructure/uid": "^7.
|
|
27
|
+
"@instructure/console": "^7.15.0",
|
|
28
|
+
"@instructure/ui-form-field": "^7.15.0",
|
|
29
|
+
"@instructure/ui-position": "^7.15.0",
|
|
30
|
+
"@instructure/ui-prop-types": "^7.15.0",
|
|
31
|
+
"@instructure/ui-react-utils": "^7.15.0",
|
|
32
|
+
"@instructure/ui-select": "^7.15.0",
|
|
33
|
+
"@instructure/ui-testable": "^7.15.0",
|
|
34
|
+
"@instructure/ui-themeable": "^7.15.0",
|
|
35
|
+
"@instructure/uid": "^7.15.0",
|
|
36
36
|
"prop-types": "^15"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@instructure/ui-babel-preset": "^7.
|
|
40
|
-
"@instructure/ui-color-utils": "^7.
|
|
41
|
-
"@instructure/ui-test-locator": "^7.
|
|
42
|
-
"@instructure/ui-test-utils": "^7.
|
|
39
|
+
"@instructure/ui-babel-preset": "^7.15.0",
|
|
40
|
+
"@instructure/ui-color-utils": "^7.15.0",
|
|
41
|
+
"@instructure/ui-test-locator": "^7.15.0",
|
|
42
|
+
"@instructure/ui-test-utils": "^7.15.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": "^16.8"
|
|
@@ -107,15 +107,20 @@ class SimpleSelect extends Component {
|
|
|
107
107
|
* The width of the text input.
|
|
108
108
|
*/
|
|
109
109
|
width: PropTypes.string,
|
|
110
|
+
/**
|
|
111
|
+
* The number of options that should be visible before having to scroll. Works best when the options are the same height.
|
|
112
|
+
*/
|
|
113
|
+
visibleOptionsCount: PropTypes.number,
|
|
114
|
+
/**
|
|
115
|
+
* The max height the options list can be before having to scroll. If
|
|
116
|
+
* set, it will __override__ the `visibleOptionsCount` prop.
|
|
117
|
+
*/
|
|
118
|
+
optionsMaxHeight: PropTypes.string,
|
|
110
119
|
/**
|
|
111
120
|
* The max width the options list can be before option text wraps. If not
|
|
112
121
|
* set, the list will only display as wide as the text input.
|
|
113
122
|
*/
|
|
114
123
|
optionsMaxWidth: PropTypes.string,
|
|
115
|
-
/**
|
|
116
|
-
* The number of options that should be visible before having to scroll.
|
|
117
|
-
*/
|
|
118
|
-
visibleOptionsCount: PropTypes.number,
|
|
119
124
|
/**
|
|
120
125
|
* Displays messages and validation for the input. It should be an object
|
|
121
126
|
* with the following shape:
|
|
@@ -201,6 +206,7 @@ class SimpleSelect extends Component {
|
|
|
201
206
|
isInline: false,
|
|
202
207
|
width: undefined,
|
|
203
208
|
optionsMaxWidth: undefined,
|
|
209
|
+
optionsMaxHeight: undefined,
|
|
204
210
|
visibleOptionsCount: 8,
|
|
205
211
|
messages: undefined,
|
|
206
212
|
placement: 'bottom stretch',
|
|
@@ -477,6 +483,7 @@ class SimpleSelect extends Component {
|
|
|
477
483
|
isInline,
|
|
478
484
|
width,
|
|
479
485
|
optionsMaxWidth,
|
|
486
|
+
optionsMaxHeight,
|
|
480
487
|
visibleOptionsCount,
|
|
481
488
|
messages,
|
|
482
489
|
placement,
|
|
@@ -509,6 +516,7 @@ class SimpleSelect extends Component {
|
|
|
509
516
|
isInline={isInline}
|
|
510
517
|
width={width}
|
|
511
518
|
optionsMaxWidth={optionsMaxWidth}
|
|
519
|
+
optionsMaxHeight={optionsMaxHeight}
|
|
512
520
|
visibleOptionsCount={visibleOptionsCount}
|
|
513
521
|
messages={messages}
|
|
514
522
|
placement={placement}
|
package/types/index.d.ts
CHANGED
|
@@ -64,15 +64,20 @@ export interface SimpleSelectProps {
|
|
|
64
64
|
* The width of the text input.
|
|
65
65
|
*/
|
|
66
66
|
width?: string;
|
|
67
|
+
/**
|
|
68
|
+
* The number of options that should be visible before having to scroll. Works best when the options are the same height.
|
|
69
|
+
*/
|
|
70
|
+
visibleOptionsCount?: number;
|
|
71
|
+
/**
|
|
72
|
+
* The max height the options list can be before having to scroll. If
|
|
73
|
+
* set, it will __override__ the `visibleOptionsCount` prop.
|
|
74
|
+
*/
|
|
75
|
+
optionsMaxHeight?: string;
|
|
67
76
|
/**
|
|
68
77
|
* The max width the options list can be before option text wraps. If not
|
|
69
78
|
* set, the list will only display as wide as the text input.
|
|
70
79
|
*/
|
|
71
80
|
optionsMaxWidth?: string;
|
|
72
|
-
/**
|
|
73
|
-
* The number of options that should be visible before having to scroll.
|
|
74
|
-
*/
|
|
75
|
-
visibleOptionsCount?: number;
|
|
76
81
|
/**
|
|
77
82
|
* Displays messages and validation for the input. It should be an object
|
|
78
83
|
* with the following shape:
|