@instructure/ui-select 8.38.2-snapshot-4 → 8.38.2-snapshot-6
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/SelectLocator.js +2 -7
- package/es/Select/index.js +39 -38
- package/lib/Select/SelectLocator.js +2 -7
- package/lib/Select/index.js +39 -38
- package/package.json +23 -23
- package/tsconfig.build.tsbuildinfo +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.38.2-snapshot-
|
|
6
|
+
## [8.38.2-snapshot-6](https://github.com/instructure/instructure-ui/compare/v8.38.1...v8.38.2-snapshot-6) (2023-07-17)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-select
|
|
9
9
|
|
|
@@ -34,13 +34,8 @@ import { Select } from './index';
|
|
|
34
34
|
|
|
35
35
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
36
36
|
export const SelectLocator = locator(Select.selector, {
|
|
37
|
-
findInput:
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
findOptionsList: async function (element) {
|
|
41
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
42
|
-
args[_key - 1] = arguments[_key];
|
|
43
|
-
}
|
|
37
|
+
findInput: (...args) => locator('input').find(...args),
|
|
38
|
+
findOptionsList: async (element, ...args) => {
|
|
44
39
|
const content = await PopoverLocator.findContent(element, ...args);
|
|
45
40
|
return content ? OptionsLocator.find(content.getDOMNode()) : null;
|
|
46
41
|
}
|
package/es/Select/index.js
CHANGED
|
@@ -76,8 +76,8 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
76
76
|
@tsProps
|
|
77
77
|
**/
|
|
78
78
|
let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Select extends Component {
|
|
79
|
-
constructor() {
|
|
80
|
-
super(...
|
|
79
|
+
constructor(...args) {
|
|
80
|
+
super(...args);
|
|
81
81
|
this.state = {
|
|
82
82
|
hasInputRef: false
|
|
83
83
|
};
|
|
@@ -236,9 +236,10 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
|
|
|
236
236
|
onRequestHideOptions: event => {
|
|
237
237
|
onRequestHideOptions === null || onRequestHideOptions === void 0 ? void 0 : onRequestHideOptions(event);
|
|
238
238
|
},
|
|
239
|
-
onRequestHighlightOption: (event,
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
onRequestHighlightOption: (event, {
|
|
240
|
+
id,
|
|
241
|
+
direction
|
|
242
|
+
}) => {
|
|
242
243
|
if (!isShowingOptions) return;
|
|
243
244
|
const highlightedOptionId = this.highlightedOptionId;
|
|
244
245
|
// if id exists, use that
|
|
@@ -264,8 +265,9 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
|
|
|
264
265
|
onRequestHighlightLastOption: event => {
|
|
265
266
|
this.highlightOption(event, this._optionIds[this._optionIds.length - 1]);
|
|
266
267
|
},
|
|
267
|
-
onRequestSelectOption: (event,
|
|
268
|
-
|
|
268
|
+
onRequestSelectOption: (event, {
|
|
269
|
+
id
|
|
270
|
+
}) => {
|
|
269
271
|
if (id && this._optionIds.indexOf(id) !== -1) {
|
|
270
272
|
// only select if id exists as a valid option
|
|
271
273
|
onRequestSelectOption === null || onRequestSelectOption === void 0 ? void 0 : onRequestSelectOption(event, {
|
|
@@ -514,37 +516,36 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
|
|
|
514
516
|
highlightedOptionId: highlightedOptionId,
|
|
515
517
|
isShowingOptions: isShowingOptions,
|
|
516
518
|
selectedOptionId: selectedOptionId
|
|
517
|
-
}, this.getEventHandlers()),
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
});
|
|
519
|
+
}, this.getEventHandlers()), ({
|
|
520
|
+
getRootProps,
|
|
521
|
+
getInputProps,
|
|
522
|
+
getTriggerProps,
|
|
523
|
+
getListProps,
|
|
524
|
+
getOptionProps,
|
|
525
|
+
getDisabledOptionProps,
|
|
526
|
+
getDescriptionProps
|
|
527
|
+
}) => jsx("span", Object.assign({}, getRootProps({
|
|
528
|
+
css: styles === null || styles === void 0 ? void 0 : styles.select
|
|
529
|
+
}), {
|
|
530
|
+
ref: el => this.ref = el
|
|
531
|
+
}), this.renderInput({
|
|
532
|
+
getInputProps,
|
|
533
|
+
getTriggerProps
|
|
534
|
+
}), jsx("span", Object.assign({}, getDescriptionProps(), {
|
|
535
|
+
css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
|
|
536
|
+
}), assistiveText), jsx(Popover, {
|
|
537
|
+
constrain: constrain,
|
|
538
|
+
placement: placement,
|
|
539
|
+
mountNode: mountNode,
|
|
540
|
+
positionTarget: this._inputContainer,
|
|
541
|
+
isShowingContent: isShowingOptions,
|
|
542
|
+
shouldReturnFocus: false,
|
|
543
|
+
withArrow: false
|
|
544
|
+
}, this.renderList({
|
|
545
|
+
getListProps,
|
|
546
|
+
getOptionProps,
|
|
547
|
+
getDisabledOptionProps
|
|
548
|
+
}))));
|
|
548
549
|
}
|
|
549
550
|
}, _class2.displayName = "Select", _class2.componentId = 'Select', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
|
|
550
551
|
inputValue: '',
|
|
@@ -41,13 +41,8 @@ var _index = require("./index");
|
|
|
41
41
|
|
|
42
42
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
43
43
|
const SelectLocator = (0, _locator.locator)(_index.Select.selector, {
|
|
44
|
-
findInput:
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
findOptionsList: async function (element) {
|
|
48
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
49
|
-
args[_key - 1] = arguments[_key];
|
|
50
|
-
}
|
|
44
|
+
findInput: (...args) => (0, _locator.locator)('input').find(...args),
|
|
45
|
+
findOptionsList: async (element, ...args) => {
|
|
51
46
|
const content = await _PopoverLocator.PopoverLocator.findContent(element, ...args);
|
|
52
47
|
return content ? _OptionsLocator.OptionsLocator.find(content.getDOMNode()) : null;
|
|
53
48
|
}
|
package/lib/Select/index.js
CHANGED
|
@@ -88,8 +88,8 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
88
88
|
@tsProps
|
|
89
89
|
**/
|
|
90
90
|
let Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Select extends _react.Component {
|
|
91
|
-
constructor() {
|
|
92
|
-
super(...
|
|
91
|
+
constructor(...args) {
|
|
92
|
+
super(...args);
|
|
93
93
|
this.state = {
|
|
94
94
|
hasInputRef: false
|
|
95
95
|
};
|
|
@@ -248,9 +248,10 @@ let Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0
|
|
|
248
248
|
onRequestHideOptions: event => {
|
|
249
249
|
onRequestHideOptions === null || onRequestHideOptions === void 0 ? void 0 : onRequestHideOptions(event);
|
|
250
250
|
},
|
|
251
|
-
onRequestHighlightOption: (event,
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
onRequestHighlightOption: (event, {
|
|
252
|
+
id,
|
|
253
|
+
direction
|
|
254
|
+
}) => {
|
|
254
255
|
if (!isShowingOptions) return;
|
|
255
256
|
const highlightedOptionId = this.highlightedOptionId;
|
|
256
257
|
// if id exists, use that
|
|
@@ -276,8 +277,9 @@ let Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0
|
|
|
276
277
|
onRequestHighlightLastOption: event => {
|
|
277
278
|
this.highlightOption(event, this._optionIds[this._optionIds.length - 1]);
|
|
278
279
|
},
|
|
279
|
-
onRequestSelectOption: (event,
|
|
280
|
-
|
|
280
|
+
onRequestSelectOption: (event, {
|
|
281
|
+
id
|
|
282
|
+
}) => {
|
|
281
283
|
if (id && this._optionIds.indexOf(id) !== -1) {
|
|
282
284
|
// only select if id exists as a valid option
|
|
283
285
|
onRequestSelectOption === null || onRequestSelectOption === void 0 ? void 0 : onRequestSelectOption(event, {
|
|
@@ -526,37 +528,36 @@ let Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0
|
|
|
526
528
|
highlightedOptionId: highlightedOptionId,
|
|
527
529
|
isShowingOptions: isShowingOptions,
|
|
528
530
|
selectedOptionId: selectedOptionId
|
|
529
|
-
}, this.getEventHandlers()),
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
});
|
|
531
|
+
}, this.getEventHandlers()), ({
|
|
532
|
+
getRootProps,
|
|
533
|
+
getInputProps,
|
|
534
|
+
getTriggerProps,
|
|
535
|
+
getListProps,
|
|
536
|
+
getOptionProps,
|
|
537
|
+
getDisabledOptionProps,
|
|
538
|
+
getDescriptionProps
|
|
539
|
+
}) => (0, _emotion.jsx)("span", Object.assign({}, getRootProps({
|
|
540
|
+
css: styles === null || styles === void 0 ? void 0 : styles.select
|
|
541
|
+
}), {
|
|
542
|
+
ref: el => this.ref = el
|
|
543
|
+
}), this.renderInput({
|
|
544
|
+
getInputProps,
|
|
545
|
+
getTriggerProps
|
|
546
|
+
}), (0, _emotion.jsx)("span", Object.assign({}, getDescriptionProps(), {
|
|
547
|
+
css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
|
|
548
|
+
}), assistiveText), (0, _emotion.jsx)(_Popover.Popover, {
|
|
549
|
+
constrain: constrain,
|
|
550
|
+
placement: placement,
|
|
551
|
+
mountNode: mountNode,
|
|
552
|
+
positionTarget: this._inputContainer,
|
|
553
|
+
isShowingContent: isShowingOptions,
|
|
554
|
+
shouldReturnFocus: false,
|
|
555
|
+
withArrow: false
|
|
556
|
+
}, this.renderList({
|
|
557
|
+
getListProps,
|
|
558
|
+
getOptionProps,
|
|
559
|
+
getDisabledOptionProps
|
|
560
|
+
}))));
|
|
560
561
|
}
|
|
561
562
|
}, _class2.displayName = "Select", _class2.componentId = 'Select', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
|
562
563
|
inputValue: '',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-select",
|
|
3
|
-
"version": "8.38.2-snapshot-
|
|
3
|
+
"version": "8.38.2-snapshot-6",
|
|
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.38.2-snapshot-
|
|
27
|
-
"@instructure/ui-color-utils": "8.38.2-snapshot-
|
|
28
|
-
"@instructure/ui-test-locator": "8.38.2-snapshot-
|
|
29
|
-
"@instructure/ui-test-utils": "8.38.2-snapshot-
|
|
30
|
-
"@instructure/ui-themes": "8.38.2-snapshot-
|
|
26
|
+
"@instructure/ui-babel-preset": "8.38.2-snapshot-6",
|
|
27
|
+
"@instructure/ui-color-utils": "8.38.2-snapshot-6",
|
|
28
|
+
"@instructure/ui-test-locator": "8.38.2-snapshot-6",
|
|
29
|
+
"@instructure/ui-test-utils": "8.38.2-snapshot-6",
|
|
30
|
+
"@instructure/ui-themes": "8.38.2-snapshot-6"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@babel/runtime": "^7.22.
|
|
34
|
-
"@instructure/emotion": "8.38.2-snapshot-
|
|
35
|
-
"@instructure/shared-types": "8.38.2-snapshot-
|
|
36
|
-
"@instructure/ui-dom-utils": "8.38.2-snapshot-
|
|
37
|
-
"@instructure/ui-form-field": "8.38.2-snapshot-
|
|
38
|
-
"@instructure/ui-icons": "8.38.2-snapshot-
|
|
39
|
-
"@instructure/ui-options": "8.38.2-snapshot-
|
|
40
|
-
"@instructure/ui-popover": "8.38.2-snapshot-
|
|
41
|
-
"@instructure/ui-position": "8.38.2-snapshot-
|
|
42
|
-
"@instructure/ui-prop-types": "8.38.2-snapshot-
|
|
43
|
-
"@instructure/ui-react-utils": "8.38.2-snapshot-
|
|
44
|
-
"@instructure/ui-selectable": "8.38.2-snapshot-
|
|
45
|
-
"@instructure/ui-testable": "8.38.2-snapshot-
|
|
46
|
-
"@instructure/ui-text-input": "8.38.2-snapshot-
|
|
47
|
-
"@instructure/ui-utils": "8.38.2-snapshot-
|
|
48
|
-
"@instructure/ui-view": "8.38.2-snapshot-
|
|
49
|
-
"@instructure/uid": "8.38.2-snapshot-
|
|
33
|
+
"@babel/runtime": "^7.22.6",
|
|
34
|
+
"@instructure/emotion": "8.38.2-snapshot-6",
|
|
35
|
+
"@instructure/shared-types": "8.38.2-snapshot-6",
|
|
36
|
+
"@instructure/ui-dom-utils": "8.38.2-snapshot-6",
|
|
37
|
+
"@instructure/ui-form-field": "8.38.2-snapshot-6",
|
|
38
|
+
"@instructure/ui-icons": "8.38.2-snapshot-6",
|
|
39
|
+
"@instructure/ui-options": "8.38.2-snapshot-6",
|
|
40
|
+
"@instructure/ui-popover": "8.38.2-snapshot-6",
|
|
41
|
+
"@instructure/ui-position": "8.38.2-snapshot-6",
|
|
42
|
+
"@instructure/ui-prop-types": "8.38.2-snapshot-6",
|
|
43
|
+
"@instructure/ui-react-utils": "8.38.2-snapshot-6",
|
|
44
|
+
"@instructure/ui-selectable": "8.38.2-snapshot-6",
|
|
45
|
+
"@instructure/ui-testable": "8.38.2-snapshot-6",
|
|
46
|
+
"@instructure/ui-text-input": "8.38.2-snapshot-6",
|
|
47
|
+
"@instructure/ui-utils": "8.38.2-snapshot-6",
|
|
48
|
+
"@instructure/ui-view": "8.38.2-snapshot-6",
|
|
49
|
+
"@instructure/uid": "8.38.2-snapshot-6",
|
|
50
50
|
"prop-types": "^15.8.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|