@instructure/ui-select 10.26.1 → 11.0.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 +23 -2
- package/es/Select/Group/index.js +1 -2
- package/es/Select/Group/props.js +1 -8
- package/es/Select/Option/index.js +1 -2
- package/es/Select/Option/props.js +1 -11
- package/es/Select/index.js +10 -7
- package/es/Select/props.js +1 -45
- package/lib/Select/Group/index.js +0 -1
- package/lib/Select/Group/props.js +1 -9
- package/lib/Select/Option/index.js +0 -1
- package/lib/Select/Option/props.js +1 -12
- package/lib/Select/index.js +9 -6
- package/lib/Select/props.js +1 -45
- package/package.json +21 -24
- package/src/Select/Group/index.tsx +1 -2
- package/src/Select/Group/props.ts +2 -16
- package/src/Select/Option/index.tsx +1 -2
- package/src/Select/Option/props.ts +2 -19
- package/src/Select/index.tsx +6 -5
- package/src/Select/props.ts +1 -48
- package/tsconfig.build.json +1 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Select/Group/index.d.ts +0 -4
- package/types/Select/Group/index.d.ts.map +1 -1
- package/types/Select/Group/props.d.ts +2 -3
- package/types/Select/Group/props.d.ts.map +1 -1
- package/types/Select/Option/index.d.ts +0 -7
- package/types/Select/Option/index.d.ts.map +1 -1
- package/types/Select/Option/props.d.ts +2 -3
- package/types/Select/Option/props.d.ts.map +1 -1
- package/types/Select/index.d.ts +2 -33
- package/types/Select/index.d.ts.map +1 -1
- package/types/Select/props.d.ts +2 -3
- package/types/Select/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,30 @@
|
|
|
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
|
-
|
|
6
|
+
# [11.0.0](https://github.com/instructure/instructure-ui/compare/v10.26.0...v11.0.0) (2025-10-06)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* **many:** InstUI v11 contains the following breaking changes:
|
|
17
|
+
- React 16 and 17 are no longer supported
|
|
18
|
+
- remove `PropTypes` from all packages
|
|
19
|
+
- remove `CodeEditor` component
|
|
20
|
+
- remove `@instui/theme-registry` package
|
|
21
|
+
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
22
|
+
- InstUISettingsProvider's `as` prop is removed
|
|
23
|
+
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
24
|
+
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
25
|
+
- `variables` field on theme objects are removed
|
|
26
|
+
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
27
|
+
`isStacked`, `hover`, and `headers`
|
|
28
|
+
- `Table`'s `caption` prop is now required
|
|
29
|
+
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
9
30
|
|
|
10
31
|
|
|
11
32
|
|
package/es/Select/Group/index.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { Component } from 'react';
|
|
26
|
-
import { allowedProps
|
|
26
|
+
import { allowedProps } from './props';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
---
|
|
@@ -43,7 +43,6 @@ class Group extends Component {
|
|
|
43
43
|
Group.displayName = "Group";
|
|
44
44
|
Group.componentId = 'Select.Group';
|
|
45
45
|
Group.allowedProps = allowedProps;
|
|
46
|
-
Group.propTypes = propTypes;
|
|
47
46
|
Group.defaultProps = {};
|
|
48
47
|
export default Group;
|
|
49
48
|
export { Group };
|
package/es/Select/Group/props.js
CHANGED
|
@@ -22,12 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
27
|
-
import { Option } from '../Option';
|
|
28
|
-
const propTypes = {
|
|
29
|
-
renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
30
|
-
children: ChildrenPropTypes.oneOf([Option])
|
|
31
|
-
};
|
|
32
25
|
const allowedProps = ['renderLabel', 'children'];
|
|
33
|
-
export {
|
|
26
|
+
export { allowedProps };
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { Component } from 'react';
|
|
26
|
-
import { allowedProps
|
|
26
|
+
import { allowedProps } from './props';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
---
|
|
@@ -43,7 +43,6 @@ class Option extends Component {
|
|
|
43
43
|
Option.displayName = "Option";
|
|
44
44
|
Option.componentId = 'Select.Option';
|
|
45
45
|
Option.allowedProps = allowedProps;
|
|
46
|
-
Option.propTypes = propTypes;
|
|
47
46
|
Option.defaultProps = {
|
|
48
47
|
isHighlighted: false,
|
|
49
48
|
isSelected: false,
|
|
@@ -22,15 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
const propTypes = {
|
|
27
|
-
id: PropTypes.string.isRequired,
|
|
28
|
-
isHighlighted: PropTypes.bool,
|
|
29
|
-
isSelected: PropTypes.bool,
|
|
30
|
-
isDisabled: PropTypes.bool,
|
|
31
|
-
renderBeforeLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
32
|
-
renderAfterLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
33
|
-
children: PropTypes.node
|
|
34
|
-
};
|
|
35
25
|
const allowedProps = ['id', 'isHighlighted', 'isSelected', 'isDisabled', 'renderBeforeLabel', 'renderAfterLabel', 'children'];
|
|
36
|
-
export {
|
|
26
|
+
export { allowedProps };
|
package/es/Select/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
2
2
|
const _excluded = ["id", "renderLabel", "children"],
|
|
3
3
|
_excluded2 = ["renderLabel", "inputValue", "placeholder", "isRequired", "shouldNotWrap", "size", "isInline", "width", "htmlSize", "messages", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onInputChange", "onRequestHideOptions", "layout"],
|
|
4
4
|
_excluded3 = ["ref"];
|
|
5
|
-
var _dec, _dec2,
|
|
5
|
+
var _dec, _dec2, _class, _Select, _Options$Separator, _Options$Separator2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
8
8
|
*
|
|
@@ -29,7 +29,7 @@ var _dec, _dec2, _dec3, _class, _Select, _Options$Separator, _Options$Separator2
|
|
|
29
29
|
|
|
30
30
|
import { Children, Component, memo } from 'react';
|
|
31
31
|
import * as utils from '@instructure/ui-utils';
|
|
32
|
-
import {
|
|
32
|
+
import { combineDataCid } from '@instructure/ui-utils';
|
|
33
33
|
import { matchComponentTypes, omitProps, getInteraction, withDeterministicId } from '@instructure/ui-react-utils';
|
|
34
34
|
import { getBoundingClientRect, isActiveElement } from '@instructure/ui-dom-utils';
|
|
35
35
|
import { View } from '@instructure/ui-view';
|
|
@@ -43,7 +43,7 @@ import generateStyle from './styles';
|
|
|
43
43
|
import generateComponentTheme from './theme';
|
|
44
44
|
import { Group } from './Group';
|
|
45
45
|
import { Option } from './Option';
|
|
46
|
-
import { allowedProps
|
|
46
|
+
import { allowedProps } from './props';
|
|
47
47
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
48
48
|
// This memoed Option component is used to prevent unnecessary re-renders of
|
|
49
49
|
// Options.Item when the Select component is re-rendered. This is necessary
|
|
@@ -76,7 +76,7 @@ category: components
|
|
|
76
76
|
tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
77
77
|
---
|
|
78
78
|
**/
|
|
79
|
-
let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme),
|
|
79
|
+
let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_Select = class Select extends Component {
|
|
80
80
|
constructor(...args) {
|
|
81
81
|
super(...args);
|
|
82
82
|
this.SCROLL_TOLERANCE = 0.5;
|
|
@@ -630,7 +630,10 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
|
|
|
630
630
|
...getRootProps({
|
|
631
631
|
css: styles === null || styles === void 0 ? void 0 : styles.select
|
|
632
632
|
}),
|
|
633
|
-
ref: el =>
|
|
633
|
+
ref: el => {
|
|
634
|
+
this.ref = el;
|
|
635
|
+
},
|
|
636
|
+
"data-cid": combineDataCid('Select', this.props),
|
|
634
637
|
children: [this.renderInput({
|
|
635
638
|
getInputProps,
|
|
636
639
|
getTriggerProps
|
|
@@ -660,7 +663,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
|
|
|
660
663
|
})
|
|
661
664
|
});
|
|
662
665
|
}
|
|
663
|
-
}, _Select.displayName = "Select", _Select.componentId = 'Select', _Select.allowedProps = allowedProps, _Select.
|
|
666
|
+
}, _Select.displayName = "Select", _Select.componentId = 'Select', _Select.allowedProps = allowedProps, _Select.defaultProps = {
|
|
664
667
|
inputValue: '',
|
|
665
668
|
isShowingOptions: false,
|
|
666
669
|
size: 'medium',
|
|
@@ -674,6 +677,6 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
|
|
|
674
677
|
shouldNotWrap: false,
|
|
675
678
|
scrollToHighlightedOption: true,
|
|
676
679
|
isOptionContentAppliedToInput: false
|
|
677
|
-
}, _Select.Option = Option, _Select.Group = Group, _Select)) || _class) || _class)
|
|
680
|
+
}, _Select.Option = Option, _Select.Group = Group, _Select)) || _class) || _class);
|
|
678
681
|
export default Select;
|
|
679
682
|
export { Select };
|
package/es/Select/props.js
CHANGED
|
@@ -22,13 +22,6 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
27
|
-
import { FormPropTypes } from '@instructure/ui-form-field';
|
|
28
|
-
import { PositionPropTypes } from '@instructure/ui-position';
|
|
29
|
-
import { Group } from './Group';
|
|
30
|
-
import { Option } from './Option';
|
|
31
|
-
|
|
32
25
|
// These props are directly passed to Selectable
|
|
33
26
|
// TODO: import these from Selectable once TS types can be imported
|
|
34
27
|
|
|
@@ -38,42 +31,5 @@ import { Option } from './Option';
|
|
|
38
31
|
// These props are directly passed to Popover
|
|
39
32
|
// TODO: import these from Popover once TS types can be imported
|
|
40
33
|
|
|
41
|
-
const propTypes = {
|
|
42
|
-
renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
43
|
-
inputValue: PropTypes.string,
|
|
44
|
-
id: PropTypes.string,
|
|
45
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
46
|
-
assistiveText: PropTypes.string,
|
|
47
|
-
placeholder: PropTypes.string,
|
|
48
|
-
interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
|
|
49
|
-
isRequired: PropTypes.bool,
|
|
50
|
-
isInline: PropTypes.bool,
|
|
51
|
-
width: PropTypes.string,
|
|
52
|
-
htmlSize: PropTypes.number,
|
|
53
|
-
visibleOptionsCount: PropTypes.number,
|
|
54
|
-
isOptionContentAppliedToInput: PropTypes.bool,
|
|
55
|
-
optionsMaxHeight: PropTypes.string,
|
|
56
|
-
optionsMaxWidth: PropTypes.string,
|
|
57
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
58
|
-
placement: PositionPropTypes.placement,
|
|
59
|
-
constrain: PositionPropTypes.constrain,
|
|
60
|
-
mountNode: PositionPropTypes.mountNode,
|
|
61
|
-
onFocus: PropTypes.func,
|
|
62
|
-
onBlur: PropTypes.func,
|
|
63
|
-
onInputChange: PropTypes.func,
|
|
64
|
-
isShowingOptions: PropTypes.bool,
|
|
65
|
-
onRequestShowOptions: PropTypes.func,
|
|
66
|
-
onRequestHideOptions: PropTypes.func,
|
|
67
|
-
onRequestHighlightOption: PropTypes.func,
|
|
68
|
-
onRequestSelectOption: PropTypes.func,
|
|
69
|
-
inputRef: PropTypes.func,
|
|
70
|
-
listRef: PropTypes.func,
|
|
71
|
-
renderBeforeInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
72
|
-
renderAfterInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
73
|
-
children: ChildrenPropTypes.oneOf([Group, Option]),
|
|
74
|
-
shouldNotWrap: PropTypes.bool,
|
|
75
|
-
scrollToHighlightedOption: PropTypes.bool,
|
|
76
|
-
layout: PropTypes.oneOf(['stacked', 'inline'])
|
|
77
|
-
};
|
|
78
34
|
const allowedProps = ['renderLabel', 'inputValue', 'isShowingOptions', 'id', 'size', 'assistiveText', 'placeholder', 'interaction', 'isRequired', 'isInline', 'width', 'htmlSize', 'visibleOptionsCount', 'isOptionContentAppliedToInput', 'optionsMaxHeight', 'optionsMaxWidth', 'messages', 'placement', 'constrain', 'mountNode', 'onFocus', 'onBlur', 'onInputChange', 'onRequestShowOptions', 'onRequestHideOptions', 'onRequestHighlightOption', 'onRequestSelectOption', 'inputRef', 'listRef', 'renderBeforeInput', 'renderAfterInput', 'children', 'shouldNotWrap', 'scrollToHighlightedOption', 'layout'];
|
|
79
|
-
export {
|
|
35
|
+
export { allowedProps };
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
10
|
-
var _Option = require("../Option");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
11
7
|
/*
|
|
12
8
|
* The MIT License (MIT)
|
|
13
9
|
*
|
|
@@ -32,8 +28,4 @@ var _Option = require("../Option");
|
|
|
32
28
|
* SOFTWARE.
|
|
33
29
|
*/
|
|
34
30
|
|
|
35
|
-
const propTypes = exports.propTypes = {
|
|
36
|
-
renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
|
|
37
|
-
children: _Children.Children.oneOf([_Option.Option])
|
|
38
|
-
};
|
|
39
31
|
const allowedProps = exports.allowedProps = ['renderLabel', 'children'];
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,13 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
id: _propTypes.default.string.isRequired,
|
|
35
|
-
isHighlighted: _propTypes.default.bool,
|
|
36
|
-
isSelected: _propTypes.default.bool,
|
|
37
|
-
isDisabled: _propTypes.default.bool,
|
|
38
|
-
renderBeforeLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
39
|
-
renderAfterLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
40
|
-
children: _propTypes.default.node
|
|
41
|
-
};
|
|
42
31
|
const allowedProps = exports.allowedProps = ['id', 'isHighlighted', 'isSelected', 'isDisabled', 'renderBeforeLabel', 'renderAfterLabel', 'children'];
|
package/lib/Select/index.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.default = exports.Select = void 0;
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var utils = _interopRequireWildcard(require("@instructure/ui-utils"));
|
|
12
|
-
var
|
|
12
|
+
var _combineDataCid = require("@instructure/ui-utils/lib/combineDataCid.js");
|
|
13
13
|
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
14
14
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
15
15
|
var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
|
|
@@ -33,7 +33,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
33
33
|
const _excluded = ["id", "renderLabel", "children"],
|
|
34
34
|
_excluded2 = ["renderLabel", "inputValue", "placeholder", "isRequired", "shouldNotWrap", "size", "isInline", "width", "htmlSize", "messages", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onInputChange", "onRequestHideOptions", "layout"],
|
|
35
35
|
_excluded3 = ["ref"];
|
|
36
|
-
var _dec, _dec2,
|
|
36
|
+
var _dec, _dec2, _class, _Select, _Options$Separator, _Options$Separator2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
|
|
37
37
|
/*
|
|
38
38
|
* The MIT License (MIT)
|
|
39
39
|
*
|
|
@@ -88,7 +88,7 @@ category: components
|
|
|
88
88
|
tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
89
89
|
---
|
|
90
90
|
**/
|
|
91
|
-
let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
91
|
+
let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_Select = class Select extends _react.Component {
|
|
92
92
|
constructor(...args) {
|
|
93
93
|
super(...args);
|
|
94
94
|
this.SCROLL_TOLERANCE = 0.5;
|
|
@@ -642,7 +642,10 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
|
|
|
642
642
|
...getRootProps({
|
|
643
643
|
css: styles === null || styles === void 0 ? void 0 : styles.select
|
|
644
644
|
}),
|
|
645
|
-
ref: el =>
|
|
645
|
+
ref: el => {
|
|
646
|
+
this.ref = el;
|
|
647
|
+
},
|
|
648
|
+
"data-cid": (0, _combineDataCid.combineDataCid)('Select', this.props),
|
|
646
649
|
children: [this.renderInput({
|
|
647
650
|
getInputProps,
|
|
648
651
|
getTriggerProps
|
|
@@ -672,7 +675,7 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
|
|
|
672
675
|
})
|
|
673
676
|
});
|
|
674
677
|
}
|
|
675
|
-
}, _Select.displayName = "Select", _Select.componentId = 'Select', _Select.allowedProps = _props.allowedProps, _Select.
|
|
678
|
+
}, _Select.displayName = "Select", _Select.componentId = 'Select', _Select.allowedProps = _props.allowedProps, _Select.defaultProps = {
|
|
676
679
|
inputValue: '',
|
|
677
680
|
isShowingOptions: false,
|
|
678
681
|
size: 'medium',
|
|
@@ -686,5 +689,5 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
|
|
|
686
689
|
shouldNotWrap: false,
|
|
687
690
|
scrollToHighlightedOption: true,
|
|
688
691
|
isOptionContentAppliedToInput: false
|
|
689
|
-
}, _Select.Option = _Option.Option, _Select.Group = _Group.Group, _Select)) || _class) || _class)
|
|
692
|
+
}, _Select.Option = _Option.Option, _Select.Group = _Group.Group, _Select)) || _class) || _class);
|
|
690
693
|
var _default = exports.default = Select;
|
package/lib/Select/props.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
10
|
-
var _FormPropTypes = require("@instructure/ui-form-field/lib/FormPropTypes.js");
|
|
11
|
-
var _PositionPropTypes = require("@instructure/ui-position/lib/PositionPropTypes.js");
|
|
12
|
-
var _Group = require("./Group");
|
|
13
|
-
var _Option = require("./Option");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
14
7
|
/*
|
|
15
8
|
* The MIT License (MIT)
|
|
16
9
|
*
|
|
@@ -44,41 +37,4 @@ var _Option = require("./Option");
|
|
|
44
37
|
// These props are directly passed to Popover
|
|
45
38
|
// TODO: import these from Popover once TS types can be imported
|
|
46
39
|
|
|
47
|
-
const propTypes = exports.propTypes = {
|
|
48
|
-
renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
|
|
49
|
-
inputValue: _propTypes.default.string,
|
|
50
|
-
id: _propTypes.default.string,
|
|
51
|
-
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
52
|
-
assistiveText: _propTypes.default.string,
|
|
53
|
-
placeholder: _propTypes.default.string,
|
|
54
|
-
interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
|
|
55
|
-
isRequired: _propTypes.default.bool,
|
|
56
|
-
isInline: _propTypes.default.bool,
|
|
57
|
-
width: _propTypes.default.string,
|
|
58
|
-
htmlSize: _propTypes.default.number,
|
|
59
|
-
visibleOptionsCount: _propTypes.default.number,
|
|
60
|
-
isOptionContentAppliedToInput: _propTypes.default.bool,
|
|
61
|
-
optionsMaxHeight: _propTypes.default.string,
|
|
62
|
-
optionsMaxWidth: _propTypes.default.string,
|
|
63
|
-
messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
|
|
64
|
-
placement: _PositionPropTypes.PositionPropTypes.placement,
|
|
65
|
-
constrain: _PositionPropTypes.PositionPropTypes.constrain,
|
|
66
|
-
mountNode: _PositionPropTypes.PositionPropTypes.mountNode,
|
|
67
|
-
onFocus: _propTypes.default.func,
|
|
68
|
-
onBlur: _propTypes.default.func,
|
|
69
|
-
onInputChange: _propTypes.default.func,
|
|
70
|
-
isShowingOptions: _propTypes.default.bool,
|
|
71
|
-
onRequestShowOptions: _propTypes.default.func,
|
|
72
|
-
onRequestHideOptions: _propTypes.default.func,
|
|
73
|
-
onRequestHighlightOption: _propTypes.default.func,
|
|
74
|
-
onRequestSelectOption: _propTypes.default.func,
|
|
75
|
-
inputRef: _propTypes.default.func,
|
|
76
|
-
listRef: _propTypes.default.func,
|
|
77
|
-
renderBeforeInput: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
78
|
-
renderAfterInput: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
79
|
-
children: _Children.Children.oneOf([_Group.Group, _Option.Option]),
|
|
80
|
-
shouldNotWrap: _propTypes.default.bool,
|
|
81
|
-
scrollToHighlightedOption: _propTypes.default.bool,
|
|
82
|
-
layout: _propTypes.default.oneOf(['stacked', 'inline'])
|
|
83
|
-
};
|
|
84
40
|
const allowedProps = exports.allowedProps = ['renderLabel', 'inputValue', 'isShowingOptions', 'id', 'size', 'assistiveText', 'placeholder', 'interaction', 'isRequired', 'isInline', 'width', 'htmlSize', 'visibleOptionsCount', 'isOptionContentAppliedToInput', 'optionsMaxHeight', 'optionsMaxWidth', 'messages', 'placement', 'constrain', 'mountNode', 'onFocus', 'onBlur', 'onInputChange', 'onRequestShowOptions', 'onRequestHideOptions', 'onRequestHighlightOption', 'onRequestSelectOption', 'inputRef', 'listRef', 'renderBeforeInput', 'renderAfterInput', 'children', 'shouldNotWrap', 'scrollToHighlightedOption', 'layout'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-select",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
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,37 +23,34 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "
|
|
27
|
-
"@instructure/ui-color-utils": "
|
|
28
|
-
"@instructure/ui-scripts": "
|
|
29
|
-
"@instructure/ui-themes": "
|
|
26
|
+
"@instructure/ui-babel-preset": "11.0.0",
|
|
27
|
+
"@instructure/ui-color-utils": "11.0.0",
|
|
28
|
+
"@instructure/ui-scripts": "11.0.0",
|
|
29
|
+
"@instructure/ui-themes": "11.0.0",
|
|
30
30
|
"@testing-library/jest-dom": "^6.6.3",
|
|
31
|
-
"@testing-library/react": "
|
|
31
|
+
"@testing-library/react": "15.0.7",
|
|
32
32
|
"@testing-library/user-event": "^14.6.1",
|
|
33
33
|
"vitest": "^3.2.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.27.6",
|
|
37
|
-
"@instructure/emotion": "
|
|
38
|
-
"@instructure/shared-types": "
|
|
39
|
-
"@instructure/ui-dom-utils": "
|
|
40
|
-
"@instructure/ui-form-field": "
|
|
41
|
-
"@instructure/ui-icons": "
|
|
42
|
-
"@instructure/ui-options": "
|
|
43
|
-
"@instructure/ui-popover": "
|
|
44
|
-
"@instructure/ui-position": "
|
|
45
|
-
"@instructure/ui-
|
|
46
|
-
"@instructure/ui-
|
|
47
|
-
"@instructure/ui-
|
|
48
|
-
"@instructure/ui-
|
|
49
|
-
"@instructure/ui-
|
|
50
|
-
"@instructure/
|
|
51
|
-
"@instructure/ui-view": "10.26.1",
|
|
52
|
-
"@instructure/uid": "10.26.1",
|
|
53
|
-
"prop-types": "^15.8.1"
|
|
37
|
+
"@instructure/emotion": "11.0.0",
|
|
38
|
+
"@instructure/shared-types": "11.0.0",
|
|
39
|
+
"@instructure/ui-dom-utils": "11.0.0",
|
|
40
|
+
"@instructure/ui-form-field": "11.0.0",
|
|
41
|
+
"@instructure/ui-icons": "11.0.0",
|
|
42
|
+
"@instructure/ui-options": "11.0.0",
|
|
43
|
+
"@instructure/ui-popover": "11.0.0",
|
|
44
|
+
"@instructure/ui-position": "11.0.0",
|
|
45
|
+
"@instructure/ui-react-utils": "11.0.0",
|
|
46
|
+
"@instructure/ui-selectable": "11.0.0",
|
|
47
|
+
"@instructure/ui-text-input": "11.0.0",
|
|
48
|
+
"@instructure/ui-utils": "11.0.0",
|
|
49
|
+
"@instructure/ui-view": "11.0.0",
|
|
50
|
+
"@instructure/uid": "11.0.0"
|
|
54
51
|
},
|
|
55
52
|
"peerDependencies": {
|
|
56
|
-
"react": ">=
|
|
53
|
+
"react": ">=18 <=19"
|
|
57
54
|
},
|
|
58
55
|
"publishConfig": {
|
|
59
56
|
"access": "public"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
import { Component } from 'react'
|
|
26
26
|
import type { SelectGroupProps } from './props'
|
|
27
|
-
import { allowedProps
|
|
27
|
+
import { allowedProps } from './props'
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
---
|
|
@@ -37,7 +37,6 @@ class Group extends Component<SelectGroupProps> {
|
|
|
37
37
|
static readonly componentId = 'Select.Group'
|
|
38
38
|
|
|
39
39
|
static allowedProps = allowedProps
|
|
40
|
-
static propTypes = propTypes
|
|
41
40
|
|
|
42
41
|
static defaultProps = {}
|
|
43
42
|
|
|
@@ -22,16 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
import React from 'react'
|
|
25
|
-
import PropTypes from 'prop-types'
|
|
26
25
|
|
|
27
|
-
import {
|
|
28
|
-
import { Option } from '../Option'
|
|
29
|
-
|
|
30
|
-
import type {
|
|
31
|
-
OtherHTMLAttributes,
|
|
32
|
-
PropValidators,
|
|
33
|
-
Renderable
|
|
34
|
-
} from '@instructure/shared-types'
|
|
26
|
+
import type { OtherHTMLAttributes, Renderable } from '@instructure/shared-types'
|
|
35
27
|
|
|
36
28
|
type SelectGroupOwnProps = {
|
|
37
29
|
/**
|
|
@@ -50,13 +42,7 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
|
50
42
|
|
|
51
43
|
type SelectGroupProps = SelectGroupOwnProps &
|
|
52
44
|
OtherHTMLAttributes<SelectGroupOwnProps>
|
|
53
|
-
|
|
54
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
55
|
-
renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
56
|
-
children: ChildrenPropTypes.oneOf([Option])
|
|
57
|
-
}
|
|
58
|
-
|
|
59
45
|
const allowedProps: AllowedPropKeys = ['renderLabel', 'children']
|
|
60
46
|
|
|
61
47
|
export type { SelectGroupProps }
|
|
62
|
-
export {
|
|
48
|
+
export { allowedProps }
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
import { Component } from 'react'
|
|
26
26
|
import type { SelectOptionProps } from './props'
|
|
27
|
-
import { allowedProps
|
|
27
|
+
import { allowedProps } from './props'
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
---
|
|
@@ -37,7 +37,6 @@ class Option extends Component<SelectOptionProps> {
|
|
|
37
37
|
static readonly componentId = 'Select.Option'
|
|
38
38
|
|
|
39
39
|
static allowedProps = allowedProps
|
|
40
|
-
static propTypes = propTypes
|
|
41
40
|
|
|
42
41
|
static defaultProps = {
|
|
43
42
|
isHighlighted: false,
|
|
@@ -23,13 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
-
import
|
|
27
|
-
|
|
28
|
-
import type {
|
|
29
|
-
OtherHTMLAttributes,
|
|
30
|
-
PropValidators,
|
|
31
|
-
Renderable
|
|
32
|
-
} from '@instructure/shared-types'
|
|
26
|
+
import type { OtherHTMLAttributes, Renderable } from '@instructure/shared-types'
|
|
33
27
|
|
|
34
28
|
type OptionProps = {
|
|
35
29
|
/**
|
|
@@ -74,17 +68,6 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
|
74
68
|
|
|
75
69
|
type SelectOptionProps = SelectOptionOwnProps &
|
|
76
70
|
OtherHTMLAttributes<SelectOptionOwnProps>
|
|
77
|
-
|
|
78
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
79
|
-
id: PropTypes.string.isRequired,
|
|
80
|
-
isHighlighted: PropTypes.bool,
|
|
81
|
-
isSelected: PropTypes.bool,
|
|
82
|
-
isDisabled: PropTypes.bool,
|
|
83
|
-
renderBeforeLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
84
|
-
renderAfterLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
85
|
-
children: PropTypes.node
|
|
86
|
-
}
|
|
87
|
-
|
|
88
71
|
const allowedProps: AllowedPropKeys = [
|
|
89
72
|
'id',
|
|
90
73
|
'isHighlighted',
|
|
@@ -96,4 +79,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
96
79
|
]
|
|
97
80
|
|
|
98
81
|
export type { SelectOptionProps, RenderSelectOptionLabel }
|
|
99
|
-
export {
|
|
82
|
+
export { allowedProps }
|
package/src/Select/index.tsx
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import { ComponentElement, Children, Component, memo, ReactNode } from 'react'
|
|
26
26
|
|
|
27
27
|
import * as utils from '@instructure/ui-utils'
|
|
28
|
-
import {
|
|
28
|
+
import { combineDataCid } from '@instructure/ui-utils'
|
|
29
29
|
import {
|
|
30
30
|
matchComponentTypes,
|
|
31
31
|
omitProps,
|
|
@@ -70,7 +70,7 @@ import { Option } from './Option'
|
|
|
70
70
|
import type { SelectOptionProps, RenderSelectOptionLabel } from './Option/props'
|
|
71
71
|
|
|
72
72
|
import type { SelectProps } from './props'
|
|
73
|
-
import { allowedProps
|
|
73
|
+
import { allowedProps } from './props'
|
|
74
74
|
import { Renderable } from '@instructure/shared-types'
|
|
75
75
|
|
|
76
76
|
type GroupChild = ComponentElement<SelectGroupProps, Group>
|
|
@@ -130,13 +130,11 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
130
130
|
**/
|
|
131
131
|
@withDeterministicId()
|
|
132
132
|
@withStyle(generateStyle, generateComponentTheme)
|
|
133
|
-
@testable()
|
|
134
133
|
class Select extends Component<SelectProps> {
|
|
135
134
|
static readonly componentId = 'Select'
|
|
136
135
|
private readonly SCROLL_TOLERANCE = 0.5
|
|
137
136
|
|
|
138
137
|
static allowedProps = allowedProps
|
|
139
|
-
static propTypes = propTypes
|
|
140
138
|
|
|
141
139
|
static defaultProps = {
|
|
142
140
|
inputValue: '',
|
|
@@ -823,7 +821,10 @@ class Select extends Component<SelectProps> {
|
|
|
823
821
|
}) => (
|
|
824
822
|
<span
|
|
825
823
|
{...getRootProps({ css: styles?.select })}
|
|
826
|
-
ref={(el) =>
|
|
824
|
+
ref={(el) => {
|
|
825
|
+
this.ref = el
|
|
826
|
+
}}
|
|
827
|
+
data-cid={combineDataCid('Select', this.props)}
|
|
827
828
|
>
|
|
828
829
|
{this.renderInput({ getInputProps, getTriggerProps })}
|
|
829
830
|
<span {...getDescriptionProps()} css={styles?.assistiveText}>
|