@instructure/ui-select 8.25.1-snapshot-1 → 8.25.1-snapshot-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.
- package/CHANGELOG.md +1 -1
- package/es/Select/Group/index.js +6 -5
- package/es/Select/Option/index.js +10 -9
- package/es/Select/index.js +65 -60
- package/lib/Select/Group/index.js +6 -5
- package/lib/Select/Option/index.js +10 -9
- package/lib/Select/index.js +65 -60
- package/package.json +22 -22
- package/src/Select/index.tsx +6 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Select/SelectLocator.d.ts +9 -9
- package/types/Select/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
-
## [8.25.1-snapshot-
|
|
6
|
+
## [8.25.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-select
|
|
9
9
|
|
package/es/Select/Group/index.js
CHANGED
|
@@ -33,7 +33,13 @@ id: Select.Group
|
|
|
33
33
|
**/
|
|
34
34
|
|
|
35
35
|
class Group extends Component {
|
|
36
|
+
static displayName = "Group";
|
|
37
|
+
static componentId = 'Select.Group';
|
|
38
|
+
static allowedProps = allowedProps;
|
|
39
|
+
static propTypes = propTypes;
|
|
40
|
+
static defaultProps = {};
|
|
36
41
|
/* istanbul ignore next */
|
|
42
|
+
|
|
37
43
|
render() {
|
|
38
44
|
// this component is only used for prop validation. Select.Group children
|
|
39
45
|
// are parsed in Select and rendered as Options components
|
|
@@ -42,10 +48,5 @@ class Group extends Component {
|
|
|
42
48
|
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
Group.displayName = "Group";
|
|
46
|
-
Group.componentId = 'Select.Group';
|
|
47
|
-
Group.allowedProps = allowedProps;
|
|
48
|
-
Group.propTypes = propTypes;
|
|
49
|
-
Group.defaultProps = {};
|
|
50
51
|
export default Group;
|
|
51
52
|
export { Group };
|
|
@@ -33,7 +33,17 @@ id: Select.Option
|
|
|
33
33
|
**/
|
|
34
34
|
|
|
35
35
|
class Option extends Component {
|
|
36
|
+
static displayName = "Option";
|
|
37
|
+
static componentId = 'Select.Option';
|
|
38
|
+
static allowedProps = allowedProps;
|
|
39
|
+
static propTypes = propTypes;
|
|
40
|
+
static defaultProps = {
|
|
41
|
+
isHighlighted: false,
|
|
42
|
+
isSelected: false,
|
|
43
|
+
isDisabled: false
|
|
44
|
+
};
|
|
36
45
|
/* istanbul ignore next */
|
|
46
|
+
|
|
37
47
|
render() {
|
|
38
48
|
// this component is only used for prop validation. Select.Option children
|
|
39
49
|
// are parsed in Select and rendered as Options.Item components
|
|
@@ -42,14 +52,5 @@ class Option extends Component {
|
|
|
42
52
|
|
|
43
53
|
}
|
|
44
54
|
|
|
45
|
-
Option.displayName = "Option";
|
|
46
|
-
Option.componentId = 'Select.Option';
|
|
47
|
-
Option.allowedProps = allowedProps;
|
|
48
|
-
Option.propTypes = propTypes;
|
|
49
|
-
Option.defaultProps = {
|
|
50
|
-
isHighlighted: false,
|
|
51
|
-
isSelected: false,
|
|
52
|
-
isDisabled: false
|
|
53
|
-
};
|
|
54
55
|
export default Option;
|
|
55
56
|
export { Option };
|
package/es/Select/index.js
CHANGED
|
@@ -3,7 +3,7 @@ const _excluded = ["id", "renderLabel", "children"],
|
|
|
3
3
|
_excluded2 = ["renderLabel", "inputValue", "placeholder", "isRequired", "shouldNotWrap", "size", "isInline", "width", "htmlSize", "messages", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onInputChange", "onRequestHideOptions"],
|
|
4
4
|
_excluded3 = ["ref"];
|
|
5
5
|
|
|
6
|
-
var _dec, _dec2, _dec3, _class,
|
|
6
|
+
var _dec, _dec2, _dec3, _class, _Options$Separator, _Options$Separator2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
@@ -55,63 +55,54 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
55
55
|
---
|
|
56
56
|
@tsProps
|
|
57
57
|
**/
|
|
58
|
-
let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
hasInputRef: true
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
this._input = node;
|
|
83
|
-
(_this$props$inputRef = (_this$props = this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, node);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
this.handleListRef = node => {
|
|
87
|
-
var _this$props$listRef, _this$props2;
|
|
88
|
-
|
|
89
|
-
(_this$props$listRef = (_this$props2 = this.props).listRef) === null || _this$props$listRef === void 0 ? void 0 : _this$props$listRef.call(_this$props2, node); // store option height to calculate list maxHeight
|
|
90
|
-
|
|
91
|
-
if (node && node.querySelector('[role="option"]')) {
|
|
92
|
-
this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
this.handleInputContainerRef = node => {
|
|
97
|
-
this._inputContainer = node;
|
|
98
|
-
};
|
|
99
|
-
}
|
|
58
|
+
let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = class Select extends Component {
|
|
59
|
+
static displayName = "Select";
|
|
60
|
+
static componentId = 'Select';
|
|
61
|
+
static allowedProps = allowedProps;
|
|
62
|
+
static propTypes = propTypes;
|
|
63
|
+
static defaultProps = {
|
|
64
|
+
inputValue: '',
|
|
65
|
+
isShowingOptions: false,
|
|
66
|
+
size: 'medium',
|
|
67
|
+
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
68
|
+
interaction: void 0,
|
|
69
|
+
isRequired: false,
|
|
70
|
+
isInline: false,
|
|
71
|
+
visibleOptionsCount: 8,
|
|
72
|
+
placement: 'bottom stretch',
|
|
73
|
+
constrain: 'window',
|
|
74
|
+
shouldNotWrap: false
|
|
75
|
+
};
|
|
76
|
+
static Option = Option;
|
|
77
|
+
static Group = Group;
|
|
100
78
|
|
|
101
79
|
componentDidMount() {
|
|
102
|
-
var _this$props$makeStyle, _this$
|
|
80
|
+
var _this$props$makeStyle, _this$props;
|
|
103
81
|
|
|
104
|
-
(_this$props$makeStyle = (_this$
|
|
82
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
105
83
|
}
|
|
106
84
|
|
|
107
85
|
componentDidUpdate() {
|
|
108
|
-
var _this$props$makeStyle2, _this$
|
|
86
|
+
var _this$props$makeStyle2, _this$props2;
|
|
109
87
|
|
|
110
|
-
(_this$props$makeStyle2 = (_this$
|
|
88
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2); // scroll option into view if needed
|
|
111
89
|
|
|
112
90
|
this.scrollToOption(this.highlightedOptionId);
|
|
113
91
|
}
|
|
114
92
|
|
|
93
|
+
state = {
|
|
94
|
+
hasInputRef: false
|
|
95
|
+
};
|
|
96
|
+
ref = null;
|
|
97
|
+
_input = null;
|
|
98
|
+
_defaultId = this.props.deterministicId();
|
|
99
|
+
_inputContainer = null;
|
|
100
|
+
_listView = null; // temporarily stores actionable options
|
|
101
|
+
|
|
102
|
+
_optionIds = []; // best guess for first calculation of list height
|
|
103
|
+
|
|
104
|
+
_optionHeight = 36;
|
|
105
|
+
|
|
115
106
|
focus() {
|
|
116
107
|
this._input && this._input.focus();
|
|
117
108
|
}
|
|
@@ -193,6 +184,32 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
|
|
|
193
184
|
return selectedOptionId;
|
|
194
185
|
}
|
|
195
186
|
|
|
187
|
+
handleInputRef = node => {
|
|
188
|
+
var _this$props$inputRef, _this$props3;
|
|
189
|
+
|
|
190
|
+
// ensures list is positioned with respect to input if list is open on mount
|
|
191
|
+
if (!this.state.hasInputRef) {
|
|
192
|
+
this.setState({
|
|
193
|
+
hasInputRef: true
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
this._input = node;
|
|
198
|
+
(_this$props$inputRef = (_this$props3 = this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props3, node);
|
|
199
|
+
};
|
|
200
|
+
handleListRef = node => {
|
|
201
|
+
var _this$props$listRef, _this$props4;
|
|
202
|
+
|
|
203
|
+
(_this$props$listRef = (_this$props4 = this.props).listRef) === null || _this$props$listRef === void 0 ? void 0 : _this$props$listRef.call(_this$props4, node); // store option height to calculate list maxHeight
|
|
204
|
+
|
|
205
|
+
if (node && node.querySelector('[role="option"]')) {
|
|
206
|
+
this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
handleInputContainerRef = node => {
|
|
210
|
+
this._inputContainer = node;
|
|
211
|
+
};
|
|
212
|
+
|
|
196
213
|
scrollToOption(id) {
|
|
197
214
|
if (this._listView) {
|
|
198
215
|
const option = this._listView.querySelector(`[id="${id}"]`);
|
|
@@ -570,18 +587,6 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
|
|
|
570
587
|
});
|
|
571
588
|
}
|
|
572
589
|
|
|
573
|
-
}
|
|
574
|
-
inputValue: '',
|
|
575
|
-
isShowingOptions: false,
|
|
576
|
-
size: 'medium',
|
|
577
|
-
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
578
|
-
interaction: void 0,
|
|
579
|
-
isRequired: false,
|
|
580
|
-
isInline: false,
|
|
581
|
-
visibleOptionsCount: 8,
|
|
582
|
-
placement: 'bottom stretch',
|
|
583
|
-
constrain: 'window',
|
|
584
|
-
shouldNotWrap: false
|
|
585
|
-
}, _class2.Option = Option, _class2.Group = Group, _class2)) || _class) || _class) || _class);
|
|
590
|
+
}) || _class) || _class) || _class);
|
|
586
591
|
export default Select;
|
|
587
592
|
export { Select };
|
|
@@ -42,7 +42,13 @@ id: Select.Group
|
|
|
42
42
|
@tsProps
|
|
43
43
|
**/
|
|
44
44
|
class Group extends _react.Component {
|
|
45
|
+
static displayName = "Group";
|
|
46
|
+
static componentId = 'Select.Group';
|
|
47
|
+
static allowedProps = _props.allowedProps;
|
|
48
|
+
static propTypes = _props.propTypes;
|
|
49
|
+
static defaultProps = {};
|
|
45
50
|
/* istanbul ignore next */
|
|
51
|
+
|
|
46
52
|
render() {
|
|
47
53
|
// this component is only used for prop validation. Select.Group children
|
|
48
54
|
// are parsed in Select and rendered as Options components
|
|
@@ -52,10 +58,5 @@ class Group extends _react.Component {
|
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
exports.Group = Group;
|
|
55
|
-
Group.displayName = "Group";
|
|
56
|
-
Group.componentId = 'Select.Group';
|
|
57
|
-
Group.allowedProps = _props.allowedProps;
|
|
58
|
-
Group.propTypes = _props.propTypes;
|
|
59
|
-
Group.defaultProps = {};
|
|
60
61
|
var _default = Group;
|
|
61
62
|
exports.default = _default;
|
|
@@ -42,7 +42,17 @@ id: Select.Option
|
|
|
42
42
|
@tsProps
|
|
43
43
|
**/
|
|
44
44
|
class Option extends _react.Component {
|
|
45
|
+
static displayName = "Option";
|
|
46
|
+
static componentId = 'Select.Option';
|
|
47
|
+
static allowedProps = _props.allowedProps;
|
|
48
|
+
static propTypes = _props.propTypes;
|
|
49
|
+
static defaultProps = {
|
|
50
|
+
isHighlighted: false,
|
|
51
|
+
isSelected: false,
|
|
52
|
+
isDisabled: false
|
|
53
|
+
};
|
|
45
54
|
/* istanbul ignore next */
|
|
55
|
+
|
|
46
56
|
render() {
|
|
47
57
|
// this component is only used for prop validation. Select.Option children
|
|
48
58
|
// are parsed in Select and rendered as Options.Item components
|
|
@@ -52,14 +62,5 @@ class Option extends _react.Component {
|
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
exports.Option = Option;
|
|
55
|
-
Option.displayName = "Option";
|
|
56
|
-
Option.componentId = 'Select.Option';
|
|
57
|
-
Option.allowedProps = _props.allowedProps;
|
|
58
|
-
Option.propTypes = _props.propTypes;
|
|
59
|
-
Option.defaultProps = {
|
|
60
|
-
isHighlighted: false,
|
|
61
|
-
isSelected: false,
|
|
62
|
-
isDisabled: false
|
|
63
|
-
};
|
|
64
65
|
var _default = Option;
|
|
65
66
|
exports.default = _default;
|
package/lib/Select/index.js
CHANGED
|
@@ -59,7 +59,7 @@ const _excluded = ["id", "renderLabel", "children"],
|
|
|
59
59
|
_excluded2 = ["renderLabel", "inputValue", "placeholder", "isRequired", "shouldNotWrap", "size", "isInline", "width", "htmlSize", "messages", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onInputChange", "onRequestHideOptions"],
|
|
60
60
|
_excluded3 = ["ref"];
|
|
61
61
|
|
|
62
|
-
var _dec, _dec2, _dec3, _class,
|
|
62
|
+
var _dec, _dec2, _dec3, _class, _Options$Separator, _Options$Separator2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
---
|
|
@@ -68,63 +68,54 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
68
68
|
---
|
|
69
69
|
@tsProps
|
|
70
70
|
**/
|
|
71
|
-
let Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
hasInputRef: true
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
this._input = node;
|
|
96
|
-
(_this$props$inputRef = (_this$props = this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, node);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
this.handleListRef = node => {
|
|
100
|
-
var _this$props$listRef, _this$props2;
|
|
101
|
-
|
|
102
|
-
(_this$props$listRef = (_this$props2 = this.props).listRef) === null || _this$props$listRef === void 0 ? void 0 : _this$props$listRef.call(_this$props2, node); // store option height to calculate list maxHeight
|
|
103
|
-
|
|
104
|
-
if (node && node.querySelector('[role="option"]')) {
|
|
105
|
-
this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
this.handleInputContainerRef = node => {
|
|
110
|
-
this._inputContainer = node;
|
|
111
|
-
};
|
|
112
|
-
}
|
|
71
|
+
let Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = class Select extends _react.Component {
|
|
72
|
+
static displayName = "Select";
|
|
73
|
+
static componentId = 'Select';
|
|
74
|
+
static allowedProps = _props.allowedProps;
|
|
75
|
+
static propTypes = _props.propTypes;
|
|
76
|
+
static defaultProps = {
|
|
77
|
+
inputValue: '',
|
|
78
|
+
isShowingOptions: false,
|
|
79
|
+
size: 'medium',
|
|
80
|
+
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
81
|
+
interaction: void 0,
|
|
82
|
+
isRequired: false,
|
|
83
|
+
isInline: false,
|
|
84
|
+
visibleOptionsCount: 8,
|
|
85
|
+
placement: 'bottom stretch',
|
|
86
|
+
constrain: 'window',
|
|
87
|
+
shouldNotWrap: false
|
|
88
|
+
};
|
|
89
|
+
static Option = _Option.Option;
|
|
90
|
+
static Group = _Group.Group;
|
|
113
91
|
|
|
114
92
|
componentDidMount() {
|
|
115
|
-
var _this$props$makeStyle, _this$
|
|
93
|
+
var _this$props$makeStyle, _this$props;
|
|
116
94
|
|
|
117
|
-
(_this$props$makeStyle = (_this$
|
|
95
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
118
96
|
}
|
|
119
97
|
|
|
120
98
|
componentDidUpdate() {
|
|
121
|
-
var _this$props$makeStyle2, _this$
|
|
99
|
+
var _this$props$makeStyle2, _this$props2;
|
|
122
100
|
|
|
123
|
-
(_this$props$makeStyle2 = (_this$
|
|
101
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2); // scroll option into view if needed
|
|
124
102
|
|
|
125
103
|
this.scrollToOption(this.highlightedOptionId);
|
|
126
104
|
}
|
|
127
105
|
|
|
106
|
+
state = {
|
|
107
|
+
hasInputRef: false
|
|
108
|
+
};
|
|
109
|
+
ref = null;
|
|
110
|
+
_input = null;
|
|
111
|
+
_defaultId = this.props.deterministicId();
|
|
112
|
+
_inputContainer = null;
|
|
113
|
+
_listView = null; // temporarily stores actionable options
|
|
114
|
+
|
|
115
|
+
_optionIds = []; // best guess for first calculation of list height
|
|
116
|
+
|
|
117
|
+
_optionHeight = 36;
|
|
118
|
+
|
|
128
119
|
focus() {
|
|
129
120
|
this._input && this._input.focus();
|
|
130
121
|
}
|
|
@@ -206,6 +197,32 @@ let Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0
|
|
|
206
197
|
return selectedOptionId;
|
|
207
198
|
}
|
|
208
199
|
|
|
200
|
+
handleInputRef = node => {
|
|
201
|
+
var _this$props$inputRef, _this$props3;
|
|
202
|
+
|
|
203
|
+
// ensures list is positioned with respect to input if list is open on mount
|
|
204
|
+
if (!this.state.hasInputRef) {
|
|
205
|
+
this.setState({
|
|
206
|
+
hasInputRef: true
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
this._input = node;
|
|
211
|
+
(_this$props$inputRef = (_this$props3 = this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props3, node);
|
|
212
|
+
};
|
|
213
|
+
handleListRef = node => {
|
|
214
|
+
var _this$props$listRef, _this$props4;
|
|
215
|
+
|
|
216
|
+
(_this$props$listRef = (_this$props4 = this.props).listRef) === null || _this$props$listRef === void 0 ? void 0 : _this$props$listRef.call(_this$props4, node); // store option height to calculate list maxHeight
|
|
217
|
+
|
|
218
|
+
if (node && node.querySelector('[role="option"]')) {
|
|
219
|
+
this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
handleInputContainerRef = node => {
|
|
223
|
+
this._inputContainer = node;
|
|
224
|
+
};
|
|
225
|
+
|
|
209
226
|
scrollToOption(id) {
|
|
210
227
|
if (this._listView) {
|
|
211
228
|
const option = this._listView.querySelector(`[id="${id}"]`);
|
|
@@ -579,19 +596,7 @@ let Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0
|
|
|
579
596
|
});
|
|
580
597
|
}
|
|
581
598
|
|
|
582
|
-
}
|
|
583
|
-
inputValue: '',
|
|
584
|
-
isShowingOptions: false,
|
|
585
|
-
size: 'medium',
|
|
586
|
-
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
587
|
-
interaction: void 0,
|
|
588
|
-
isRequired: false,
|
|
589
|
-
isInline: false,
|
|
590
|
-
visibleOptionsCount: 8,
|
|
591
|
-
placement: 'bottom stretch',
|
|
592
|
-
constrain: 'window',
|
|
593
|
-
shouldNotWrap: false
|
|
594
|
-
}, _class2.Option = _Option.Option, _class2.Group = _Group.Group, _class2)) || _class) || _class) || _class);
|
|
599
|
+
}) || _class) || _class) || _class);
|
|
595
600
|
exports.Select = Select;
|
|
596
601
|
var _default = Select;
|
|
597
602
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-select",
|
|
3
|
-
"version": "8.25.1-snapshot-
|
|
3
|
+
"version": "8.25.1-snapshot-10",
|
|
4
4
|
"description": "A component for select and autocomplete behavior.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.25.1-snapshot-
|
|
27
|
-
"@instructure/ui-color-utils": "8.25.1-snapshot-
|
|
28
|
-
"@instructure/ui-test-locator": "8.25.1-snapshot-
|
|
29
|
-
"@instructure/ui-test-utils": "8.25.1-snapshot-
|
|
30
|
-
"@instructure/ui-themes": "8.25.1-snapshot-
|
|
26
|
+
"@instructure/ui-babel-preset": "8.25.1-snapshot-10",
|
|
27
|
+
"@instructure/ui-color-utils": "8.25.1-snapshot-10",
|
|
28
|
+
"@instructure/ui-test-locator": "8.25.1-snapshot-10",
|
|
29
|
+
"@instructure/ui-test-utils": "8.25.1-snapshot-10",
|
|
30
|
+
"@instructure/ui-themes": "8.25.1-snapshot-10"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@instructure/emotion": "8.25.1-snapshot-
|
|
35
|
-
"@instructure/shared-types": "8.25.1-snapshot-
|
|
36
|
-
"@instructure/ui-dom-utils": "8.25.1-snapshot-
|
|
37
|
-
"@instructure/ui-form-field": "8.25.1-snapshot-
|
|
38
|
-
"@instructure/ui-icons": "8.25.1-snapshot-
|
|
39
|
-
"@instructure/ui-options": "8.25.1-snapshot-
|
|
40
|
-
"@instructure/ui-popover": "8.25.1-snapshot-
|
|
41
|
-
"@instructure/ui-position": "8.25.1-snapshot-
|
|
42
|
-
"@instructure/ui-prop-types": "8.25.1-snapshot-
|
|
43
|
-
"@instructure/ui-react-utils": "8.25.1-snapshot-
|
|
44
|
-
"@instructure/ui-selectable": "8.25.1-snapshot-
|
|
45
|
-
"@instructure/ui-testable": "8.25.1-snapshot-
|
|
46
|
-
"@instructure/ui-text-input": "8.25.1-snapshot-
|
|
47
|
-
"@instructure/ui-utils": "8.25.1-snapshot-
|
|
48
|
-
"@instructure/ui-view": "8.25.1-snapshot-
|
|
49
|
-
"@instructure/uid": "8.25.1-snapshot-
|
|
34
|
+
"@instructure/emotion": "8.25.1-snapshot-10",
|
|
35
|
+
"@instructure/shared-types": "8.25.1-snapshot-10",
|
|
36
|
+
"@instructure/ui-dom-utils": "8.25.1-snapshot-10",
|
|
37
|
+
"@instructure/ui-form-field": "8.25.1-snapshot-10",
|
|
38
|
+
"@instructure/ui-icons": "8.25.1-snapshot-10",
|
|
39
|
+
"@instructure/ui-options": "8.25.1-snapshot-10",
|
|
40
|
+
"@instructure/ui-popover": "8.25.1-snapshot-10",
|
|
41
|
+
"@instructure/ui-position": "8.25.1-snapshot-10",
|
|
42
|
+
"@instructure/ui-prop-types": "8.25.1-snapshot-10",
|
|
43
|
+
"@instructure/ui-react-utils": "8.25.1-snapshot-10",
|
|
44
|
+
"@instructure/ui-selectable": "8.25.1-snapshot-10",
|
|
45
|
+
"@instructure/ui-testable": "8.25.1-snapshot-10",
|
|
46
|
+
"@instructure/ui-text-input": "8.25.1-snapshot-10",
|
|
47
|
+
"@instructure/ui-utils": "8.25.1-snapshot-10",
|
|
48
|
+
"@instructure/ui-view": "8.25.1-snapshot-10",
|
|
49
|
+
"@instructure/uid": "8.25.1-snapshot-10",
|
|
50
50
|
"prop-types": "^15"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
package/src/Select/index.tsx
CHANGED
|
@@ -52,7 +52,8 @@ import type { ViewProps } from '@instructure/ui-view'
|
|
|
52
52
|
import type { TextInputProps } from '@instructure/ui-text-input'
|
|
53
53
|
import type {
|
|
54
54
|
OptionsItemProps,
|
|
55
|
-
OptionsSeparatorProps
|
|
55
|
+
OptionsSeparatorProps,
|
|
56
|
+
OptionsItemRenderProps
|
|
56
57
|
} from '@instructure/ui-options'
|
|
57
58
|
import type {
|
|
58
59
|
SelectableProps,
|
|
@@ -67,9 +68,7 @@ import generateComponentTheme from './theme'
|
|
|
67
68
|
import { Group } from './Group'
|
|
68
69
|
import type { SelectGroupProps } from './Group/props'
|
|
69
70
|
import { Option } from './Option'
|
|
70
|
-
import type { SelectOptionProps } from './Option/props'
|
|
71
|
-
|
|
72
|
-
import type { RenderSelectOptionLabel } from './Option/props'
|
|
71
|
+
import type { SelectOptionProps, RenderSelectOptionLabel } from './Option/props'
|
|
73
72
|
|
|
74
73
|
import type { SelectProps } from './props'
|
|
75
74
|
import { allowedProps, propTypes } from './props'
|
|
@@ -348,7 +347,9 @@ class Select extends Component<SelectProps> {
|
|
|
348
347
|
|
|
349
348
|
const getRenderOptionLabel = (
|
|
350
349
|
renderOptionLabel: RenderSelectOptionLabel
|
|
351
|
-
):
|
|
350
|
+
):
|
|
351
|
+
| React.ReactNode
|
|
352
|
+
| ((_args: OptionsItemRenderProps) => React.ReactNode) => {
|
|
352
353
|
return typeof renderOptionLabel === 'function' &&
|
|
353
354
|
!renderOptionLabel?.prototype?.isReactComponent
|
|
354
355
|
? renderOptionLabel.bind(null, {
|