@instructure/ui-selectable 10.13.0 → 10.13.1-pr-snapshot-1741357986437
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 +8 -0
- package/lib/Selectable/index.js +14 -14
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.13.1-pr-snapshot-1741357986437](https://github.com/instructure/instructure-ui/compare/v10.13.0...v10.13.1-pr-snapshot-1741357986437) (2025-03-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-selectable
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [10.13.0](https://github.com/instructure/instructure-ui/compare/v10.12.0...v10.13.0) (2025-03-06)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-selectable
|
package/lib/Selectable/index.js
CHANGED
|
@@ -7,11 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.Selectable = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _keycode = _interopRequireDefault(require("keycode"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
11
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
12
12
|
var _console = require("@instructure/console");
|
|
13
13
|
var _props = require("./props");
|
|
14
|
-
var
|
|
14
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
15
15
|
var _dec, _class, _Selectable;
|
|
16
16
|
/*
|
|
17
17
|
* The MIT License (MIT)
|
|
@@ -42,7 +42,7 @@ category: components
|
|
|
42
42
|
tags: autocomplete, typeahead, combobox, dropdown, search
|
|
43
43
|
---
|
|
44
44
|
**/
|
|
45
|
-
let Selectable = exports.Selectable = (_dec = (0,
|
|
45
|
+
let Selectable = exports.Selectable = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec(_class = (_Selectable = class Selectable extends _react.Component {
|
|
46
46
|
constructor(...args) {
|
|
47
47
|
super(...args);
|
|
48
48
|
this._id = this.props.id || this.props.deterministicId();
|
|
@@ -65,7 +65,7 @@ let Selectable = exports.Selectable = (_dec = (0, _withDeterministicId.withDeter
|
|
|
65
65
|
if (isShowingOptions) {
|
|
66
66
|
onRequestHideOptions === null || onRequestHideOptions === void 0 ? void 0 : onRequestHideOptions(event);
|
|
67
67
|
} else {
|
|
68
|
-
if (!(0,
|
|
68
|
+
if (!(0, _uiDomUtils.isActiveElement)(this._trigger)) {
|
|
69
69
|
;
|
|
70
70
|
this._trigger.focus();
|
|
71
71
|
}
|
|
@@ -164,7 +164,7 @@ let Selectable = exports.Selectable = (_dec = (0, _withDeterministicId.withDeter
|
|
|
164
164
|
...rest
|
|
165
165
|
} = {}) => {
|
|
166
166
|
return {
|
|
167
|
-
onMouseDown: (0,
|
|
167
|
+
onMouseDown: (0, _uiUtils.createChainedFunction)(event => {
|
|
168
168
|
// if we call preventDefault, label can't be selected and copied, so we only call it when the options are shown
|
|
169
169
|
if (event.target !== this._trigger && isShowingOptions) {
|
|
170
170
|
event.preventDefault(); // prevent trigger from losing focus
|
|
@@ -188,15 +188,15 @@ let Selectable = exports.Selectable = (_dec = (0, _withDeterministicId.withDeter
|
|
|
188
188
|
} = {}) => {
|
|
189
189
|
return {
|
|
190
190
|
id: this._id,
|
|
191
|
-
ref: (0,
|
|
191
|
+
ref: (0, _uiUtils.createChainedFunction)(ref, el => this._trigger = el),
|
|
192
192
|
'aria-haspopup': 'listbox',
|
|
193
193
|
'aria-expanded': isShowingOptions,
|
|
194
194
|
'aria-controls': isShowingOptions ? this._listId : void 0,
|
|
195
195
|
'aria-describedby': this._descriptionId,
|
|
196
196
|
'aria-activedescendant': isShowingOptions ? highlightedOptionId : void 0,
|
|
197
|
-
onKeyDown: (0,
|
|
198
|
-
onKeyUp: (0,
|
|
199
|
-
onClick: (0,
|
|
197
|
+
onKeyDown: (0, _uiUtils.createChainedFunction)(this.handleKeyDown, onKeyDown),
|
|
198
|
+
onKeyUp: (0, _uiUtils.createChainedFunction)(this.handleKeyUp, onKeyUp),
|
|
199
|
+
onClick: (0, _uiUtils.createChainedFunction)(this.handleOpenClose, onClick),
|
|
200
200
|
...rest
|
|
201
201
|
};
|
|
202
202
|
},
|
|
@@ -220,10 +220,10 @@ let Selectable = exports.Selectable = (_dec = (0, _withDeterministicId.withDeter
|
|
|
220
220
|
return {
|
|
221
221
|
id: this._listId,
|
|
222
222
|
role: 'listbox',
|
|
223
|
-
onMouseDown: (0,
|
|
223
|
+
onMouseDown: (0, _uiUtils.createChainedFunction)(event => {
|
|
224
224
|
event.preventDefault(); // prevent trigger from losing focus
|
|
225
225
|
}, onMouseDown),
|
|
226
|
-
onClick: (0,
|
|
226
|
+
onClick: (0, _uiUtils.createChainedFunction)(event => {
|
|
227
227
|
// prevent synthetic event from firing on the document
|
|
228
228
|
// this event could inadvertently close a parent dialog
|
|
229
229
|
event.stopPropagation();
|
|
@@ -243,12 +243,12 @@ let Selectable = exports.Selectable = (_dec = (0, _withDeterministicId.withDeter
|
|
|
243
243
|
id,
|
|
244
244
|
role: 'option',
|
|
245
245
|
'aria-selected': this.isSelectedOption(id) ? 'true' : 'false',
|
|
246
|
-
onClick: (0,
|
|
246
|
+
onClick: (0, _uiUtils.createChainedFunction)(event => {
|
|
247
247
|
onRequestSelectOption === null || onRequestSelectOption === void 0 ? void 0 : onRequestSelectOption(event, {
|
|
248
248
|
id
|
|
249
249
|
});
|
|
250
250
|
}, onClick),
|
|
251
|
-
onMouseOver: (0,
|
|
251
|
+
onMouseOver: (0, _uiUtils.createChainedFunction)(event => {
|
|
252
252
|
onRequestHighlightOption === null || onRequestHighlightOption === void 0 ? void 0 : onRequestHighlightOption(event, {
|
|
253
253
|
id
|
|
254
254
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-selectable",
|
|
3
|
-
"version": "10.13.
|
|
3
|
+
"version": "10.13.1-pr-snapshot-1741357986437",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "10.13.
|
|
26
|
+
"@instructure/ui-babel-preset": "10.13.1-pr-snapshot-1741357986437",
|
|
27
27
|
"@testing-library/jest-dom": "^6.6.3",
|
|
28
28
|
"@testing-library/react": "^16.0.1",
|
|
29
29
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.26.0",
|
|
34
|
-
"@instructure/console": "10.13.
|
|
35
|
-
"@instructure/shared-types": "10.13.
|
|
36
|
-
"@instructure/ui-dom-utils": "10.13.
|
|
37
|
-
"@instructure/ui-react-utils": "10.13.
|
|
38
|
-
"@instructure/ui-testable": "10.13.
|
|
39
|
-
"@instructure/ui-utils": "10.13.
|
|
34
|
+
"@instructure/console": "10.13.1-pr-snapshot-1741357986437",
|
|
35
|
+
"@instructure/shared-types": "10.13.1-pr-snapshot-1741357986437",
|
|
36
|
+
"@instructure/ui-dom-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
37
|
+
"@instructure/ui-react-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
38
|
+
"@instructure/ui-testable": "10.13.1-pr-snapshot-1741357986437",
|
|
39
|
+
"@instructure/ui-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
40
40
|
"keycode": "^2",
|
|
41
41
|
"prop-types": "^15.8.1"
|
|
42
42
|
},
|