@instructure/ui-simple-select 11.7.9-snapshot-0 → 11.7.9-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 +1 -1
- package/lib/SimpleSelect/v1/index.js +15 -19
- package/lib/SimpleSelect/v2/index.js +15 -19
- package/package.json +12 -12
- 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
|
-
## [11.7.9-snapshot-
|
|
6
|
+
## [11.7.9-snapshot-2](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-2) (2026-10-12)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-simple-select
|
|
9
9
|
|
|
@@ -7,11 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.SimpleSelect = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var utils = _interopRequireWildcard(require("@instructure/ui-utils"));
|
|
10
|
-
var
|
|
11
|
-
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
12
|
-
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
13
|
-
var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
|
|
14
|
-
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
10
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
15
11
|
var _v11_ = require("@instructure/ui-select/v11_6");
|
|
16
12
|
var _index = require("./Option/index.js");
|
|
17
13
|
var _index2 = require("./Group/index.js");
|
|
@@ -47,7 +43,7 @@ category: components
|
|
|
47
43
|
tags: form, field, dropdown
|
|
48
44
|
---
|
|
49
45
|
**/
|
|
50
|
-
let SimpleSelect = exports.SimpleSelect = (_dec = (0,
|
|
46
|
+
let SimpleSelect = exports.SimpleSelect = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec(_class = class SimpleSelect extends _react.Component {
|
|
51
47
|
static displayName = 'SimpleSelect';
|
|
52
48
|
static componentId = 'SimpleSelect';
|
|
53
49
|
static Option = _index.Option;
|
|
@@ -95,7 +91,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
95
91
|
return typeof this.props.value !== 'undefined';
|
|
96
92
|
}
|
|
97
93
|
get interaction() {
|
|
98
|
-
return (0,
|
|
94
|
+
return (0, _uiReactUtils.getInteraction)({
|
|
99
95
|
props: this.props
|
|
100
96
|
});
|
|
101
97
|
}
|
|
@@ -156,9 +152,9 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
156
152
|
let match;
|
|
157
153
|
for (let i = 0; i < children.length; i++) {
|
|
158
154
|
const child = children[i];
|
|
159
|
-
if ((0,
|
|
155
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.Option])) {
|
|
160
156
|
match = child;
|
|
161
|
-
} else if ((0,
|
|
157
|
+
} else if ((0, _uiReactUtils.matchComponentTypes)(child, [_index2.Group])) {
|
|
162
158
|
// first child is a group, not an option, find first child in group
|
|
163
159
|
match = _react.Children.toArray(child.props.children)[0];
|
|
164
160
|
}
|
|
@@ -173,11 +169,11 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
173
169
|
let match;
|
|
174
170
|
for (let i = 0; i < children.length; ++i) {
|
|
175
171
|
const child = children[i];
|
|
176
|
-
if ((0,
|
|
172
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.Option])) {
|
|
177
173
|
if (child.props[field] === value) {
|
|
178
174
|
match = child;
|
|
179
175
|
}
|
|
180
|
-
} else if ((0,
|
|
176
|
+
} else if ((0, _uiReactUtils.matchComponentTypes)(child, [_index2.Group])) {
|
|
181
177
|
const groupChildren = _react.Children.toArray(child.props.children);
|
|
182
178
|
for (let j = 0; j < groupChildren.length; ++j) {
|
|
183
179
|
const groupChild = groupChildren[j];
|
|
@@ -202,12 +198,12 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
202
198
|
if (!child) return undefined;
|
|
203
199
|
|
|
204
200
|
// If it's a regular option, return it
|
|
205
|
-
if ((0,
|
|
201
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.Option])) {
|
|
206
202
|
return child;
|
|
207
203
|
}
|
|
208
204
|
|
|
209
205
|
// If it's a group, get its options
|
|
210
|
-
if ((0,
|
|
206
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index2.Group])) {
|
|
211
207
|
const groupOptions = _react.Children.toArray(child.props.children);
|
|
212
208
|
const groupIndex = position === 'first' ? 0 : groupOptions.length - 1;
|
|
213
209
|
return groupOptions[groupIndex];
|
|
@@ -313,9 +309,9 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
313
309
|
renderChildren() {
|
|
314
310
|
let children = _react.Children.toArray(this.props.children);
|
|
315
311
|
children = _react.Children.map(children, child => {
|
|
316
|
-
if ((0,
|
|
312
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.Option])) {
|
|
317
313
|
return this.renderOption(child);
|
|
318
|
-
} else if ((0,
|
|
314
|
+
} else if ((0, _uiReactUtils.matchComponentTypes)(child, [_index2.Group])) {
|
|
319
315
|
return this.renderGroup(child);
|
|
320
316
|
}
|
|
321
317
|
return null;
|
|
@@ -331,7 +327,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
331
327
|
id: this._emptyOptionId,
|
|
332
328
|
isHighlighted: false,
|
|
333
329
|
isSelected: false,
|
|
334
|
-
children: (0,
|
|
330
|
+
children: (0, _uiReactUtils.callRenderProp)(this.props.renderEmptyOption)
|
|
335
331
|
});
|
|
336
332
|
}
|
|
337
333
|
renderOption(option) {
|
|
@@ -366,7 +362,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
366
362
|
isDisabled: isDisabled,
|
|
367
363
|
renderBeforeLabel: getRenderLabel(renderBeforeLabel),
|
|
368
364
|
renderAfterLabel: getRenderLabel(renderAfterLabel),
|
|
369
|
-
...(0,
|
|
365
|
+
...(0, _uiReactUtils.passthroughProps)(rest),
|
|
370
366
|
children: children
|
|
371
367
|
}, option.key || id);
|
|
372
368
|
}
|
|
@@ -379,7 +375,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
379
375
|
} = group.props;
|
|
380
376
|
return (0, _jsxRuntime.jsx)(_v11_.Select.Group, {
|
|
381
377
|
renderLabel: renderLabel,
|
|
382
|
-
...(0,
|
|
378
|
+
...(0, _uiReactUtils.passthroughProps)(rest),
|
|
383
379
|
children: _react.Children.map(children, child => this.renderOption(child))
|
|
384
380
|
}, group.key || id);
|
|
385
381
|
}
|
|
@@ -448,7 +444,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
448
444
|
onRequestSelectOption: this.handleSelectOption,
|
|
449
445
|
isOptionContentAppliedToInput: this.props.isOptionContentAppliedToInput,
|
|
450
446
|
layout: layout,
|
|
451
|
-
...(0,
|
|
447
|
+
...(0, _uiReactUtils.passthroughProps)(rest),
|
|
452
448
|
"data-cid": "SimpleSelect",
|
|
453
449
|
children: this.renderChildren()
|
|
454
450
|
});
|
|
@@ -7,11 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.SimpleSelect = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var utils = _interopRequireWildcard(require("@instructure/ui-utils"));
|
|
10
|
-
var
|
|
11
|
-
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
12
|
-
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
13
|
-
var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
|
|
14
|
-
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
10
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
15
11
|
var _latest = require("@instructure/ui-select/latest");
|
|
16
12
|
var _index = require("./Option/index.js");
|
|
17
13
|
var _index2 = require("./Group/index.js");
|
|
@@ -47,7 +43,7 @@ category: components
|
|
|
47
43
|
tags: form, field, dropdown
|
|
48
44
|
---
|
|
49
45
|
**/
|
|
50
|
-
let SimpleSelect = exports.SimpleSelect = (_dec = (0,
|
|
46
|
+
let SimpleSelect = exports.SimpleSelect = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec(_class = class SimpleSelect extends _react.Component {
|
|
51
47
|
static displayName = 'SimpleSelect';
|
|
52
48
|
static componentId = 'SimpleSelect';
|
|
53
49
|
static Option = _index.Option;
|
|
@@ -92,7 +88,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
92
88
|
return typeof this.props.value !== 'undefined';
|
|
93
89
|
}
|
|
94
90
|
get interaction() {
|
|
95
|
-
return (0,
|
|
91
|
+
return (0, _uiReactUtils.getInteraction)({
|
|
96
92
|
props: this.props
|
|
97
93
|
});
|
|
98
94
|
}
|
|
@@ -153,9 +149,9 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
153
149
|
let match;
|
|
154
150
|
for (let i = 0; i < children.length; i++) {
|
|
155
151
|
const child = children[i];
|
|
156
|
-
if ((0,
|
|
152
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.Option])) {
|
|
157
153
|
match = child;
|
|
158
|
-
} else if ((0,
|
|
154
|
+
} else if ((0, _uiReactUtils.matchComponentTypes)(child, [_index2.Group])) {
|
|
159
155
|
// first child is a group, not an option, find first child in group
|
|
160
156
|
match = _react.Children.toArray(child.props.children)[0];
|
|
161
157
|
}
|
|
@@ -170,11 +166,11 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
170
166
|
let match;
|
|
171
167
|
for (let i = 0; i < children.length; ++i) {
|
|
172
168
|
const child = children[i];
|
|
173
|
-
if ((0,
|
|
169
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.Option])) {
|
|
174
170
|
if (child.props[field] === value) {
|
|
175
171
|
match = child;
|
|
176
172
|
}
|
|
177
|
-
} else if ((0,
|
|
173
|
+
} else if ((0, _uiReactUtils.matchComponentTypes)(child, [_index2.Group])) {
|
|
178
174
|
const groupChildren = _react.Children.toArray(child.props.children);
|
|
179
175
|
for (let j = 0; j < groupChildren.length; ++j) {
|
|
180
176
|
const groupChild = groupChildren[j];
|
|
@@ -199,12 +195,12 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
199
195
|
if (!child) return undefined;
|
|
200
196
|
|
|
201
197
|
// If it's a regular option, return it
|
|
202
|
-
if ((0,
|
|
198
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.Option])) {
|
|
203
199
|
return child;
|
|
204
200
|
}
|
|
205
201
|
|
|
206
202
|
// If it's a group, get its options
|
|
207
|
-
if ((0,
|
|
203
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index2.Group])) {
|
|
208
204
|
const groupOptions = _react.Children.toArray(child.props.children);
|
|
209
205
|
const groupIndex = position === 'first' ? 0 : groupOptions.length - 1;
|
|
210
206
|
return groupOptions[groupIndex];
|
|
@@ -310,9 +306,9 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
310
306
|
renderChildren() {
|
|
311
307
|
let children = _react.Children.toArray(this.props.children);
|
|
312
308
|
children = _react.Children.map(children, child => {
|
|
313
|
-
if ((0,
|
|
309
|
+
if ((0, _uiReactUtils.matchComponentTypes)(child, [_index.Option])) {
|
|
314
310
|
return this.renderOption(child);
|
|
315
|
-
} else if ((0,
|
|
311
|
+
} else if ((0, _uiReactUtils.matchComponentTypes)(child, [_index2.Group])) {
|
|
316
312
|
return this.renderGroup(child);
|
|
317
313
|
}
|
|
318
314
|
return null;
|
|
@@ -328,7 +324,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
328
324
|
id: this._emptyOptionId,
|
|
329
325
|
isHighlighted: false,
|
|
330
326
|
isSelected: false,
|
|
331
|
-
children: (0,
|
|
327
|
+
children: (0, _uiReactUtils.callRenderProp)(this.props.renderEmptyOption)
|
|
332
328
|
});
|
|
333
329
|
}
|
|
334
330
|
renderOption(option) {
|
|
@@ -363,7 +359,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
363
359
|
isDisabled: isDisabled,
|
|
364
360
|
renderBeforeLabel: getRenderLabel(renderBeforeLabel),
|
|
365
361
|
renderAfterLabel: getRenderLabel(renderAfterLabel),
|
|
366
|
-
...(0,
|
|
362
|
+
...(0, _uiReactUtils.passthroughProps)(rest),
|
|
367
363
|
children: children
|
|
368
364
|
}, option.key || id);
|
|
369
365
|
}
|
|
@@ -376,7 +372,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
376
372
|
} = group.props;
|
|
377
373
|
return (0, _jsxRuntime.jsx)(_latest.Select.Group, {
|
|
378
374
|
renderLabel: renderLabel,
|
|
379
|
-
...(0,
|
|
375
|
+
...(0, _uiReactUtils.passthroughProps)(rest),
|
|
380
376
|
children: _react.Children.map(children, child => this.renderOption(child))
|
|
381
377
|
}, group.key || id);
|
|
382
378
|
}
|
|
@@ -445,7 +441,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
|
445
441
|
onRequestSelectOption: this.handleSelectOption,
|
|
446
442
|
isOptionContentAppliedToInput: this.props.isOptionContentAppliedToInput,
|
|
447
443
|
layout: layout,
|
|
448
|
-
...(0,
|
|
444
|
+
...(0, _uiReactUtils.passthroughProps)(rest),
|
|
449
445
|
"data-cid": "SimpleSelect",
|
|
450
446
|
children: this.renderChildren()
|
|
451
447
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-simple-select",
|
|
3
|
-
"version": "11.7.9-snapshot-
|
|
3
|
+
"version": "11.7.9-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",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/console": "11.7.9-snapshot-
|
|
19
|
-
"@instructure/shared-types": "11.7.9-snapshot-
|
|
20
|
-
"@instructure/ui-form-field": "11.7.9-snapshot-
|
|
21
|
-
"@instructure/ui-position": "11.7.9-snapshot-
|
|
22
|
-
"@instructure/ui-react-utils": "11.7.9-snapshot-
|
|
23
|
-
"@instructure/ui-select": "11.7.9-snapshot-
|
|
18
|
+
"@instructure/console": "11.7.9-snapshot-2",
|
|
19
|
+
"@instructure/shared-types": "11.7.9-snapshot-2",
|
|
20
|
+
"@instructure/ui-form-field": "11.7.9-snapshot-2",
|
|
21
|
+
"@instructure/ui-position": "11.7.9-snapshot-2",
|
|
22
|
+
"@instructure/ui-react-utils": "11.7.9-snapshot-2",
|
|
23
|
+
"@instructure/ui-select": "11.7.9-snapshot-2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"
|
|
27
|
-
"@instructure/ui-color-utils": "11.7.9-snapshot-
|
|
28
|
-
"@instructure/ui-
|
|
29
|
-
"@instructure/ui-utils": "11.7.9-snapshot-
|
|
30
|
-
"
|
|
26
|
+
"@instructure/ui-babel-preset": "11.7.9-snapshot-2",
|
|
27
|
+
"@instructure/ui-color-utils": "11.7.9-snapshot-2",
|
|
28
|
+
"@instructure/ui-icons": "11.7.9-snapshot-2",
|
|
29
|
+
"@instructure/ui-utils": "11.7.9-snapshot-2",
|
|
30
|
+
"vitest": "^5.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=18 <=19"
|