@instructure/ui-simple-select 10.26.1-snapshot-1 → 10.26.1-snapshot-2
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/SimpleSelect/Group/index.js +1 -2
- package/es/SimpleSelect/Group/props.js +1 -8
- package/es/SimpleSelect/Option/index.js +1 -2
- package/es/SimpleSelect/Option/props.js +1 -10
- package/es/SimpleSelect/index.js +21 -17
- package/es/SimpleSelect/props.js +1 -41
- package/lib/SimpleSelect/Group/index.js +0 -1
- package/lib/SimpleSelect/Group/props.js +1 -9
- package/lib/SimpleSelect/Option/index.js +0 -1
- package/lib/SimpleSelect/Option/props.js +1 -11
- package/lib/SimpleSelect/index.js +20 -16
- package/lib/SimpleSelect/props.js +1 -42
- package/package.json +13 -16
- package/src/SimpleSelect/Group/index.tsx +1 -2
- package/src/SimpleSelect/Group/props.ts +2 -16
- package/src/SimpleSelect/Option/index.tsx +1 -2
- package/src/SimpleSelect/Option/props.ts +2 -17
- package/src/SimpleSelect/index.tsx +26 -19
- package/src/SimpleSelect/props.ts +2 -46
- package/tsconfig.build.json +0 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/SimpleSelect/Group/index.d.ts +0 -4
- package/types/SimpleSelect/Group/index.d.ts.map +1 -1
- package/types/SimpleSelect/Group/props.d.ts +2 -3
- package/types/SimpleSelect/Group/props.d.ts.map +1 -1
- package/types/SimpleSelect/Option/index.d.ts +0 -8
- package/types/SimpleSelect/Option/index.d.ts.map +1 -1
- package/types/SimpleSelect/Option/props.d.ts +2 -3
- package/types/SimpleSelect/Option/props.d.ts.map +1 -1
- package/types/SimpleSelect/index.d.ts +0 -26
- package/types/SimpleSelect/index.d.ts.map +1 -1
- package/types/SimpleSelect/props.d.ts +2 -3
- package/types/SimpleSelect/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
|
-
## [10.26.1-snapshot-
|
6
|
+
## [10.26.1-snapshot-2](https://github.com/instructure/instructure-ui/compare/v10.26.0...v10.26.1-snapshot-2) (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
|
|
@@ -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
|
---
|
@@ -42,7 +42,6 @@ class Group extends Component {
|
|
42
42
|
Group.displayName = "Group";
|
43
43
|
Group.componentId = 'SimpleSelect.Group';
|
44
44
|
Group.allowedProps = allowedProps;
|
45
|
-
Group.propTypes = propTypes;
|
46
45
|
Group.defaultProps = {};
|
47
46
|
export default Group;
|
48
47
|
export { Group };
|
@@ -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
|
---
|
@@ -42,7 +42,6 @@ class Option extends Component {
|
|
42
42
|
Option.displayName = "Option";
|
43
43
|
Option.componentId = 'SimpleSelect.Option';
|
44
44
|
Option.allowedProps = allowedProps;
|
45
|
-
Option.propTypes = propTypes;
|
46
45
|
Option.defaultProps = {
|
47
46
|
isDisabled: false
|
48
47
|
};
|
@@ -22,14 +22,5 @@
|
|
22
22
|
* SOFTWARE.
|
23
23
|
*/
|
24
24
|
|
25
|
-
import PropTypes from 'prop-types';
|
26
|
-
const propTypes = {
|
27
|
-
id: PropTypes.string.isRequired,
|
28
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
29
|
-
isDisabled: PropTypes.bool,
|
30
|
-
renderBeforeLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
31
|
-
renderAfterLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
32
|
-
children: PropTypes.string
|
33
|
-
};
|
34
25
|
const allowedProps = ['id', 'value', 'isDisabled', 'renderBeforeLabel', 'renderAfterLabel', 'children'];
|
35
|
-
export {
|
26
|
+
export { allowedProps };
|
package/es/SimpleSelect/index.js
CHANGED
@@ -2,7 +2,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
2
2
|
const _excluded = ["id", "value", "children", "renderBeforeLabel", "renderAfterLabel"],
|
3
3
|
_excluded2 = ["id", "renderLabel", "children"],
|
4
4
|
_excluded3 = ["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", "layout"];
|
5
|
-
var _dec,
|
5
|
+
var _dec, _class, _SimpleSelect;
|
6
6
|
/*
|
7
7
|
* The MIT License (MIT)
|
8
8
|
*
|
@@ -29,12 +29,11 @@ var _dec, _dec2, _class, _SimpleSelect;
|
|
29
29
|
|
30
30
|
import { isValidElement, Component, Children } from 'react';
|
31
31
|
import * as utils from '@instructure/ui-utils';
|
32
|
-
import { testable } from '@instructure/ui-testable';
|
33
32
|
import { matchComponentTypes, passthroughProps, callRenderProp, getInteraction, withDeterministicId } from '@instructure/ui-react-utils';
|
34
33
|
import { Select } from '@instructure/ui-select';
|
35
34
|
import { Option } from './Option';
|
36
35
|
import { Group } from './Group';
|
37
|
-
import { allowedProps
|
36
|
+
import { allowedProps } from './props';
|
38
37
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
39
38
|
/**
|
40
39
|
---
|
@@ -42,7 +41,7 @@ category: components
|
|
42
41
|
tags: form, field, dropdown
|
43
42
|
---
|
44
43
|
**/
|
45
|
-
let SimpleSelect = (_dec = withDeterministicId(),
|
44
|
+
let SimpleSelect = (_dec = withDeterministicId(), _dec(_class = (_SimpleSelect = class SimpleSelect extends Component {
|
46
45
|
constructor(props) {
|
47
46
|
super(props);
|
48
47
|
this.ref = null;
|
@@ -314,6 +313,7 @@ let SimpleSelect = (_dec = withDeterministicId(), _dec2 = testable(), _dec(_clas
|
|
314
313
|
});
|
315
314
|
}
|
316
315
|
renderOption(option) {
|
316
|
+
var _option$props$isDisab;
|
317
317
|
const _option$props = option.props,
|
318
318
|
id = _option$props.id,
|
319
319
|
value = _option$props.value,
|
@@ -321,25 +321,28 @@ let SimpleSelect = (_dec = withDeterministicId(), _dec2 = testable(), _dec(_clas
|
|
321
321
|
renderBeforeLabel = _option$props.renderBeforeLabel,
|
322
322
|
renderAfterLabel = _option$props.renderAfterLabel,
|
323
323
|
rest = _objectWithoutProperties(_option$props, _excluded);
|
324
|
-
const isDisabled = option.props.isDisabled;
|
324
|
+
const isDisabled = (_option$props$isDisab = option.props.isDisabled) !== null && _option$props$isDisab !== void 0 ? _option$props$isDisab : false; // after the react 19 upgrade `isDisabled` is undefined instead of defaulting to false if not specified (but only in vitest env for some reason)
|
325
325
|
const isSelected = id === this.state.selectedOptionId;
|
326
326
|
const isHighlighted = id === this.state.highlightedOptionId;
|
327
327
|
const getRenderLabel = renderLabel => {
|
328
328
|
var _renderLabel$prototyp;
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
329
|
+
if (typeof renderLabel === 'function' && !(renderLabel !== null && renderLabel !== void 0 && (_renderLabel$prototyp = renderLabel.prototype) !== null && _renderLabel$prototyp !== void 0 && _renderLabel$prototyp.isReactComponent)) {
|
330
|
+
return renderLabel.bind(null, {
|
331
|
+
id,
|
332
|
+
isDisabled,
|
333
|
+
isSelected,
|
334
|
+
isHighlighted,
|
335
|
+
children
|
336
|
+
});
|
337
|
+
}
|
338
|
+
return renderLabel;
|
336
339
|
};
|
337
340
|
return _jsx(Select.Option, {
|
338
341
|
id: id,
|
339
342
|
value: value,
|
340
|
-
isHighlighted:
|
341
|
-
isSelected:
|
342
|
-
isDisabled:
|
343
|
+
isHighlighted: isHighlighted,
|
344
|
+
isSelected: isSelected,
|
345
|
+
isDisabled: isDisabled,
|
343
346
|
renderBeforeLabel: getRenderLabel(renderBeforeLabel),
|
344
347
|
renderAfterLabel: getRenderLabel(renderAfterLabel),
|
345
348
|
...passthroughProps(rest),
|
@@ -423,10 +426,11 @@ let SimpleSelect = (_dec = withDeterministicId(), _dec2 = testable(), _dec(_clas
|
|
423
426
|
isOptionContentAppliedToInput: this.props.isOptionContentAppliedToInput,
|
424
427
|
layout: layout,
|
425
428
|
...passthroughProps(rest),
|
429
|
+
"data-cid": "SimpleSelect",
|
426
430
|
children: this.renderChildren()
|
427
431
|
});
|
428
432
|
}
|
429
|
-
}, _SimpleSelect.displayName = "SimpleSelect", _SimpleSelect.componentId = 'SimpleSelect', _SimpleSelect.Option = Option, _SimpleSelect.Group = Group, _SimpleSelect.allowedProps = allowedProps, _SimpleSelect.
|
433
|
+
}, _SimpleSelect.displayName = "SimpleSelect", _SimpleSelect.componentId = 'SimpleSelect', _SimpleSelect.Option = Option, _SimpleSelect.Group = Group, _SimpleSelect.allowedProps = allowedProps, _SimpleSelect.defaultProps = {
|
430
434
|
size: 'medium',
|
431
435
|
isRequired: false,
|
432
436
|
isInline: false,
|
@@ -435,6 +439,6 @@ let SimpleSelect = (_dec = withDeterministicId(), _dec2 = testable(), _dec(_clas
|
|
435
439
|
constrain: 'window',
|
436
440
|
renderEmptyOption: '---',
|
437
441
|
isOptionContentAppliedToInput: false
|
438
|
-
}, _SimpleSelect)) || _class)
|
442
|
+
}, _SimpleSelect)) || _class);
|
439
443
|
export { SimpleSelect };
|
440
444
|
export default SimpleSelect;
|
package/es/SimpleSelect/props.js
CHANGED
@@ -22,45 +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 { FormPropTypes } from '@instructure/ui-form-field';
|
28
|
-
import { PositionPropTypes } from '@instructure/ui-position';
|
29
|
-
import { Group } from './Group';
|
30
|
-
import { Option } from './Option';
|
31
|
-
const propTypes = {
|
32
|
-
renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
33
|
-
// TODO: it was using the "controllable" util, in the TS migration mimic that behaviour
|
34
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
35
|
-
defaultValue: PropTypes.string,
|
36
|
-
id: PropTypes.string,
|
37
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
38
|
-
assistiveText: PropTypes.string,
|
39
|
-
placeholder: PropTypes.string,
|
40
|
-
interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
|
41
|
-
isRequired: PropTypes.bool,
|
42
|
-
isInline: PropTypes.bool,
|
43
|
-
width: PropTypes.string,
|
44
|
-
visibleOptionsCount: PropTypes.number,
|
45
|
-
optionsMaxHeight: PropTypes.string,
|
46
|
-
optionsMaxWidth: PropTypes.string,
|
47
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
48
|
-
placement: PositionPropTypes.placement,
|
49
|
-
constrain: PositionPropTypes.constrain,
|
50
|
-
mountNode: PositionPropTypes.mountNode,
|
51
|
-
onChange: PropTypes.func,
|
52
|
-
onFocus: PropTypes.func,
|
53
|
-
onBlur: PropTypes.func,
|
54
|
-
onShowOptions: PropTypes.func,
|
55
|
-
onHideOptions: PropTypes.func,
|
56
|
-
inputRef: PropTypes.func,
|
57
|
-
listRef: PropTypes.func,
|
58
|
-
renderEmptyOption: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
59
|
-
renderBeforeInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
60
|
-
renderAfterInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
61
|
-
children: ChildrenPropTypes.oneOf([Group, Option]),
|
62
|
-
isOptionContentAppliedToInput: PropTypes.bool,
|
63
|
-
layout: PropTypes.oneOf(['stacked', 'inline'])
|
64
|
-
};
|
65
25
|
const allowedProps = ['renderLabel', 'value', 'defaultValue', 'id', 'size', 'assistiveText', 'placeholder', 'interaction', 'isRequired', 'isInline', 'width', 'visibleOptionsCount', 'optionsMaxHeight', 'optionsMaxWidth', 'messages', 'placement', 'constrain', 'mountNode', 'onChange', 'onFocus', 'onBlur', 'onShowOptions', 'onHideOptions', 'inputRef', 'listRef', 'renderEmptyOption', 'renderBeforeInput', 'renderAfterInput', 'children', 'layout'];
|
66
|
-
export {
|
26
|
+
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,12 +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
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
36
|
-
isDisabled: _propTypes.default.bool,
|
37
|
-
renderBeforeLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
38
|
-
renderAfterLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
39
|
-
children: _propTypes.default.string
|
40
|
-
};
|
41
31
|
const allowedProps = exports.allowedProps = ['id', 'value', 'isDisabled', 'renderBeforeLabel', 'renderAfterLabel', 'children'];
|
@@ -9,7 +9,6 @@ exports.default = exports.SimpleSelect = 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 _testable = require("@instructure/ui-testable/lib/testable.js");
|
13
12
|
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
14
13
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
15
14
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
@@ -23,7 +22,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
23
22
|
const _excluded = ["id", "value", "children", "renderBeforeLabel", "renderAfterLabel"],
|
24
23
|
_excluded2 = ["id", "renderLabel", "children"],
|
25
24
|
_excluded3 = ["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", "layout"];
|
26
|
-
var _dec,
|
25
|
+
var _dec, _class, _SimpleSelect;
|
27
26
|
/*
|
28
27
|
* The MIT License (MIT)
|
29
28
|
*
|
@@ -53,7 +52,7 @@ category: components
|
|
53
52
|
tags: form, field, dropdown
|
54
53
|
---
|
55
54
|
**/
|
56
|
-
let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withDeterministicId)(),
|
55
|
+
let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec(_class = (_SimpleSelect = class SimpleSelect extends _react.Component {
|
57
56
|
constructor(props) {
|
58
57
|
super(props);
|
59
58
|
this.ref = null;
|
@@ -325,6 +324,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
325
324
|
});
|
326
325
|
}
|
327
326
|
renderOption(option) {
|
327
|
+
var _option$props$isDisab;
|
328
328
|
const _option$props = option.props,
|
329
329
|
id = _option$props.id,
|
330
330
|
value = _option$props.value,
|
@@ -332,25 +332,28 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
332
332
|
renderBeforeLabel = _option$props.renderBeforeLabel,
|
333
333
|
renderAfterLabel = _option$props.renderAfterLabel,
|
334
334
|
rest = (0, _objectWithoutProperties2.default)(_option$props, _excluded);
|
335
|
-
const isDisabled = option.props.isDisabled;
|
335
|
+
const isDisabled = (_option$props$isDisab = option.props.isDisabled) !== null && _option$props$isDisab !== void 0 ? _option$props$isDisab : false; // after the react 19 upgrade `isDisabled` is undefined instead of defaulting to false if not specified (but only in vitest env for some reason)
|
336
336
|
const isSelected = id === this.state.selectedOptionId;
|
337
337
|
const isHighlighted = id === this.state.highlightedOptionId;
|
338
338
|
const getRenderLabel = renderLabel => {
|
339
339
|
var _renderLabel$prototyp;
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
340
|
+
if (typeof renderLabel === 'function' && !(renderLabel !== null && renderLabel !== void 0 && (_renderLabel$prototyp = renderLabel.prototype) !== null && _renderLabel$prototyp !== void 0 && _renderLabel$prototyp.isReactComponent)) {
|
341
|
+
return renderLabel.bind(null, {
|
342
|
+
id,
|
343
|
+
isDisabled,
|
344
|
+
isSelected,
|
345
|
+
isHighlighted,
|
346
|
+
children
|
347
|
+
});
|
348
|
+
}
|
349
|
+
return renderLabel;
|
347
350
|
};
|
348
351
|
return (0, _jsxRuntime.jsx)(_Select.Select.Option, {
|
349
352
|
id: id,
|
350
353
|
value: value,
|
351
|
-
isHighlighted:
|
352
|
-
isSelected:
|
353
|
-
isDisabled:
|
354
|
+
isHighlighted: isHighlighted,
|
355
|
+
isSelected: isSelected,
|
356
|
+
isDisabled: isDisabled,
|
354
357
|
renderBeforeLabel: getRenderLabel(renderBeforeLabel),
|
355
358
|
renderAfterLabel: getRenderLabel(renderAfterLabel),
|
356
359
|
...(0, _passthroughProps.passthroughProps)(rest),
|
@@ -434,10 +437,11 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
434
437
|
isOptionContentAppliedToInput: this.props.isOptionContentAppliedToInput,
|
435
438
|
layout: layout,
|
436
439
|
...(0, _passthroughProps.passthroughProps)(rest),
|
440
|
+
"data-cid": "SimpleSelect",
|
437
441
|
children: this.renderChildren()
|
438
442
|
});
|
439
443
|
}
|
440
|
-
}, _SimpleSelect.displayName = "SimpleSelect", _SimpleSelect.componentId = 'SimpleSelect', _SimpleSelect.Option = _Option.Option, _SimpleSelect.Group = _Group.Group, _SimpleSelect.allowedProps = _props.allowedProps, _SimpleSelect.
|
444
|
+
}, _SimpleSelect.displayName = "SimpleSelect", _SimpleSelect.componentId = 'SimpleSelect', _SimpleSelect.Option = _Option.Option, _SimpleSelect.Group = _Group.Group, _SimpleSelect.allowedProps = _props.allowedProps, _SimpleSelect.defaultProps = {
|
441
445
|
size: 'medium',
|
442
446
|
isRequired: false,
|
443
447
|
isInline: false,
|
@@ -446,5 +450,5 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
446
450
|
constrain: 'window',
|
447
451
|
renderEmptyOption: '---',
|
448
452
|
isOptionContentAppliedToInput: false
|
449
|
-
}, _SimpleSelect)) || _class)
|
453
|
+
}, _SimpleSelect)) || _class);
|
450
454
|
var _default = exports.default = SimpleSelect;
|
@@ -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
|
*
|
@@ -35,38 +28,4 @@ var _Option = require("./Option");
|
|
35
28
|
* SOFTWARE.
|
36
29
|
*/
|
37
30
|
|
38
|
-
const propTypes = exports.propTypes = {
|
39
|
-
renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
|
40
|
-
// TODO: it was using the "controllable" util, in the TS migration mimic that behaviour
|
41
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
42
|
-
defaultValue: _propTypes.default.string,
|
43
|
-
id: _propTypes.default.string,
|
44
|
-
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
45
|
-
assistiveText: _propTypes.default.string,
|
46
|
-
placeholder: _propTypes.default.string,
|
47
|
-
interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
|
48
|
-
isRequired: _propTypes.default.bool,
|
49
|
-
isInline: _propTypes.default.bool,
|
50
|
-
width: _propTypes.default.string,
|
51
|
-
visibleOptionsCount: _propTypes.default.number,
|
52
|
-
optionsMaxHeight: _propTypes.default.string,
|
53
|
-
optionsMaxWidth: _propTypes.default.string,
|
54
|
-
messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
|
55
|
-
placement: _PositionPropTypes.PositionPropTypes.placement,
|
56
|
-
constrain: _PositionPropTypes.PositionPropTypes.constrain,
|
57
|
-
mountNode: _PositionPropTypes.PositionPropTypes.mountNode,
|
58
|
-
onChange: _propTypes.default.func,
|
59
|
-
onFocus: _propTypes.default.func,
|
60
|
-
onBlur: _propTypes.default.func,
|
61
|
-
onShowOptions: _propTypes.default.func,
|
62
|
-
onHideOptions: _propTypes.default.func,
|
63
|
-
inputRef: _propTypes.default.func,
|
64
|
-
listRef: _propTypes.default.func,
|
65
|
-
renderEmptyOption: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
66
|
-
renderBeforeInput: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
67
|
-
renderAfterInput: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
68
|
-
children: _Children.Children.oneOf([_Group.Group, _Option.Option]),
|
69
|
-
isOptionContentAppliedToInput: _propTypes.default.bool,
|
70
|
-
layout: _propTypes.default.oneOf(['stacked', 'inline'])
|
71
|
-
};
|
72
31
|
const allowedProps = exports.allowedProps = ['renderLabel', 'value', 'defaultValue', 'id', 'size', 'assistiveText', 'placeholder', 'interaction', 'isRequired', 'isInline', 'width', 'visibleOptionsCount', 'optionsMaxHeight', 'optionsMaxWidth', 'messages', 'placement', 'constrain', 'mountNode', 'onChange', 'onFocus', 'onBlur', 'onShowOptions', 'onHideOptions', 'inputRef', 'listRef', 'renderEmptyOption', 'renderBeforeInput', 'renderAfterInput', 'children', 'layout'];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@instructure/ui-simple-select",
|
3
|
-
"version": "10.26.1-snapshot-
|
3
|
+
"version": "10.26.1-snapshot-2",
|
4
4
|
"description": "A component for standard select element behavior.",
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
6
6
|
"module": "./es/index.js",
|
@@ -24,28 +24,25 @@
|
|
24
24
|
"license": "MIT",
|
25
25
|
"dependencies": {
|
26
26
|
"@babel/runtime": "^7.27.6",
|
27
|
-
"@instructure/console": "10.26.1-snapshot-
|
28
|
-
"@instructure/shared-types": "10.26.1-snapshot-
|
29
|
-
"@instructure/ui-form-field": "10.26.1-snapshot-
|
30
|
-
"@instructure/ui-position": "10.26.1-snapshot-
|
31
|
-
"@instructure/ui-
|
32
|
-
"@instructure/ui-
|
33
|
-
"@instructure/ui-select": "10.26.1-snapshot-1",
|
34
|
-
"@instructure/ui-testable": "10.26.1-snapshot-1",
|
35
|
-
"prop-types": "^15.8.1"
|
27
|
+
"@instructure/console": "10.26.1-snapshot-2",
|
28
|
+
"@instructure/shared-types": "10.26.1-snapshot-2",
|
29
|
+
"@instructure/ui-form-field": "10.26.1-snapshot-2",
|
30
|
+
"@instructure/ui-position": "10.26.1-snapshot-2",
|
31
|
+
"@instructure/ui-react-utils": "10.26.1-snapshot-2",
|
32
|
+
"@instructure/ui-select": "10.26.1-snapshot-2"
|
36
33
|
},
|
37
34
|
"devDependencies": {
|
38
|
-
"@instructure/ui-babel-preset": "10.26.1-snapshot-
|
39
|
-
"@instructure/ui-color-utils": "10.26.1-snapshot-
|
40
|
-
"@instructure/ui-icons": "10.26.1-snapshot-
|
41
|
-
"@instructure/ui-utils": "10.26.1-snapshot-
|
35
|
+
"@instructure/ui-babel-preset": "10.26.1-snapshot-2",
|
36
|
+
"@instructure/ui-color-utils": "10.26.1-snapshot-2",
|
37
|
+
"@instructure/ui-icons": "10.26.1-snapshot-2",
|
38
|
+
"@instructure/ui-utils": "10.26.1-snapshot-2",
|
42
39
|
"@testing-library/jest-dom": "^6.6.3",
|
43
|
-
"@testing-library/react": "
|
40
|
+
"@testing-library/react": "15.0.7",
|
44
41
|
"@testing-library/user-event": "^14.6.1",
|
45
42
|
"vitest": "^3.2.2"
|
46
43
|
},
|
47
44
|
"peerDependencies": {
|
48
|
-
"react": ">=
|
45
|
+
"react": ">=18 <=19"
|
49
46
|
},
|
50
47
|
"publishConfig": {
|
51
48
|
"access": "public"
|
@@ -25,7 +25,7 @@
|
|
25
25
|
import { Component } from 'react'
|
26
26
|
|
27
27
|
import type { SimpleSelectGroupProps } from './props'
|
28
|
-
import { allowedProps
|
28
|
+
import { allowedProps } from './props'
|
29
29
|
|
30
30
|
/**
|
31
31
|
---
|
@@ -37,7 +37,6 @@ class Group extends Component<SimpleSelectGroupProps> {
|
|
37
37
|
static readonly componentId = 'SimpleSelect.Group'
|
38
38
|
|
39
39
|
static allowedProps = allowedProps
|
40
|
-
static propTypes = propTypes
|
41
40
|
static defaultProps = {}
|
42
41
|
|
43
42
|
/* istanbul ignore next */
|
@@ -23,16 +23,8 @@
|
|
23
23
|
*/
|
24
24
|
|
25
25
|
import React from 'react'
|
26
|
-
import PropTypes from 'prop-types'
|
27
26
|
|
28
|
-
import {
|
29
|
-
|
30
|
-
import { Option } from '../Option'
|
31
|
-
|
32
|
-
import type {
|
33
|
-
OtherHTMLAttributes,
|
34
|
-
PropValidators
|
35
|
-
} from '@instructure/shared-types'
|
27
|
+
import type { OtherHTMLAttributes } from '@instructure/shared-types'
|
36
28
|
|
37
29
|
type SimpleSelectGroupOwnProps = {
|
38
30
|
/**
|
@@ -51,13 +43,7 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
51
43
|
|
52
44
|
type SimpleSelectGroupProps = SimpleSelectGroupOwnProps &
|
53
45
|
OtherHTMLAttributes<SimpleSelectGroupOwnProps>
|
54
|
-
|
55
|
-
const propTypes: PropValidators<PropKeys> = {
|
56
|
-
renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
57
|
-
children: ChildrenPropTypes.oneOf([Option])
|
58
|
-
}
|
59
|
-
|
60
46
|
const allowedProps: AllowedPropKeys = ['renderLabel', 'children']
|
61
47
|
|
62
48
|
export type { SimpleSelectGroupProps }
|
63
|
-
export {
|
49
|
+
export { allowedProps }
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
import { Component } from 'react'
|
26
26
|
import type { SimpleSelectOptionProps } from './props'
|
27
|
-
import { allowedProps
|
27
|
+
import { allowedProps } from './props'
|
28
28
|
|
29
29
|
/**
|
30
30
|
---
|
@@ -36,7 +36,6 @@ class Option extends Component<SimpleSelectOptionProps> {
|
|
36
36
|
static readonly componentId = 'SimpleSelect.Option'
|
37
37
|
|
38
38
|
static allowedProps = allowedProps
|
39
|
-
static propTypes = propTypes
|
40
39
|
static defaultProps = {
|
41
40
|
isDisabled: false
|
42
41
|
}
|
@@ -23,12 +23,7 @@
|
|
23
23
|
*/
|
24
24
|
|
25
25
|
import React from 'react'
|
26
|
-
import
|
27
|
-
|
28
|
-
import type {
|
29
|
-
OtherHTMLAttributes,
|
30
|
-
PropValidators
|
31
|
-
} from '@instructure/shared-types'
|
26
|
+
import type { OtherHTMLAttributes } from '@instructure/shared-types'
|
32
27
|
import { Renderable } from '@instructure/shared-types'
|
33
28
|
|
34
29
|
type OptionProps = {
|
@@ -75,16 +70,6 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
75
70
|
|
76
71
|
type SimpleSelectOptionProps = SimpleSelectOptionOwnProps &
|
77
72
|
OtherHTMLAttributes<SimpleSelectOptionOwnProps>
|
78
|
-
|
79
|
-
const propTypes: PropValidators<PropKeys> = {
|
80
|
-
id: PropTypes.string.isRequired,
|
81
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
82
|
-
isDisabled: PropTypes.bool,
|
83
|
-
renderBeforeLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
84
|
-
renderAfterLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
85
|
-
children: PropTypes.string
|
86
|
-
}
|
87
|
-
|
88
73
|
const allowedProps: AllowedPropKeys = [
|
89
74
|
'id',
|
90
75
|
'value',
|
@@ -95,4 +80,4 @@ const allowedProps: AllowedPropKeys = [
|
|
95
80
|
]
|
96
81
|
|
97
82
|
export type { SimpleSelectOptionProps, RenderSimpleSelectOptionLabel }
|
98
|
-
export {
|
83
|
+
export { allowedProps }
|