@instructure/ui-selectable 8.56.0 → 8.56.2-pr-snapshot-1721749364069

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 CHANGED
@@ -3,6 +3,22 @@
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.56.2-pr-snapshot-1721749364069](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2-pr-snapshot-1721749364069) (2024-07-23)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-selectable
9
+
10
+
11
+
12
+
13
+
14
+ ## [8.56.1](https://github.com/instructure/instructure-ui/compare/v8.56.0...v8.56.1) (2024-06-13)
15
+
16
+ **Note:** Version bump only for package @instructure/ui-selectable
17
+
18
+
19
+
20
+
21
+
6
22
  # [8.56.0](https://github.com/instructure/instructure-ui/compare/v8.55.1...v8.56.0) (2024-05-06)
7
23
 
8
24
  **Note:** Version bump only for package @instructure/ui-selectable
@@ -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 _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js");
11
- var _createChainedFunction = require("@instructure/ui-utils/lib/createChainedFunction.js");
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 _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
14
+ var _uiReactUtils = require("@instructure/ui-react-utils");
15
15
  var _dec, _class, _class2;
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, _withDeterministicId.withDeterministicId)(), _dec(_class = (_class2 = class Selectable extends _react.Component {
45
+ let Selectable = exports.Selectable = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec(_class = (_class2 = 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, _isActiveElement.isActiveElement)(this._trigger)) {
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, _createChainedFunction.createChainedFunction)(event => {
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,16 +188,16 @@ let Selectable = exports.Selectable = (_dec = (0, _withDeterministicId.withDeter
188
188
  } = {}) => {
189
189
  return {
190
190
  id: this._id,
191
- ref: (0, _createChainedFunction.createChainedFunction)(ref, el => this._trigger = el),
191
+ ref: (0, _uiUtils.createChainedFunction)(ref, el => this._trigger = el),
192
192
  'aria-haspopup': 'listbox',
193
193
  'aria-expanded': isShowingOptions,
194
194
  'aria-owns': isShowingOptions ? this._listId : void 0,
195
195
  'aria-controls': isShowingOptions ? this._listId : void 0,
196
196
  'aria-describedby': this._descriptionId,
197
197
  'aria-activedescendant': isShowingOptions ? highlightedOptionId : void 0,
198
- onKeyDown: (0, _createChainedFunction.createChainedFunction)(this.handleKeyDown, onKeyDown),
199
- onKeyUp: (0, _createChainedFunction.createChainedFunction)(this.handleKeyUp, onKeyUp),
200
- onClick: (0, _createChainedFunction.createChainedFunction)(this.handleOpenClose, onClick),
198
+ onKeyDown: (0, _uiUtils.createChainedFunction)(this.handleKeyDown, onKeyDown),
199
+ onKeyUp: (0, _uiUtils.createChainedFunction)(this.handleKeyUp, onKeyUp),
200
+ onClick: (0, _uiUtils.createChainedFunction)(this.handleOpenClose, onClick),
201
201
  ...rest
202
202
  };
203
203
  },
@@ -221,10 +221,10 @@ let Selectable = exports.Selectable = (_dec = (0, _withDeterministicId.withDeter
221
221
  return {
222
222
  id: this._listId,
223
223
  role: 'listbox',
224
- onMouseDown: (0, _createChainedFunction.createChainedFunction)(event => {
224
+ onMouseDown: (0, _uiUtils.createChainedFunction)(event => {
225
225
  event.preventDefault(); // prevent trigger from losing focus
226
226
  }, onMouseDown),
227
- onClick: (0, _createChainedFunction.createChainedFunction)(event => {
227
+ onClick: (0, _uiUtils.createChainedFunction)(event => {
228
228
  // prevent synthetic event from firing on the document
229
229
  // this event could inadvertently close a parent dialog
230
230
  event.stopPropagation();
@@ -244,12 +244,12 @@ let Selectable = exports.Selectable = (_dec = (0, _withDeterministicId.withDeter
244
244
  id,
245
245
  role: 'option',
246
246
  'aria-selected': this.isSelectedOption(id) ? 'true' : 'false',
247
- onClick: (0, _createChainedFunction.createChainedFunction)(event => {
247
+ onClick: (0, _uiUtils.createChainedFunction)(event => {
248
248
  onRequestSelectOption === null || onRequestSelectOption === void 0 ? void 0 : onRequestSelectOption(event, {
249
249
  id
250
250
  });
251
251
  }, onClick),
252
- onMouseOver: (0, _createChainedFunction.createChainedFunction)(event => {
252
+ onMouseOver: (0, _uiUtils.createChainedFunction)(event => {
253
253
  onRequestHighlightOption === null || onRequestHighlightOption === void 0 ? void 0 : onRequestHighlightOption(event, {
254
254
  id
255
255
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-selectable",
3
- "version": "8.56.0",
3
+ "version": "8.56.2-pr-snapshot-1721749364069",
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,17 +23,17 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.56.0",
27
- "@instructure/ui-test-utils": "8.56.0"
26
+ "@instructure/ui-babel-preset": "8.56.2-pr-snapshot-1721749364069",
27
+ "@instructure/ui-test-utils": "8.56.2-pr-snapshot-1721749364069"
28
28
  },
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.23.2",
31
- "@instructure/console": "8.56.0",
32
- "@instructure/shared-types": "8.56.0",
33
- "@instructure/ui-dom-utils": "8.56.0",
34
- "@instructure/ui-react-utils": "8.56.0",
35
- "@instructure/ui-testable": "8.56.0",
36
- "@instructure/ui-utils": "8.56.0",
31
+ "@instructure/console": "8.56.2-pr-snapshot-1721749364069",
32
+ "@instructure/shared-types": "8.56.2-pr-snapshot-1721749364069",
33
+ "@instructure/ui-dom-utils": "8.56.2-pr-snapshot-1721749364069",
34
+ "@instructure/ui-react-utils": "8.56.2-pr-snapshot-1721749364069",
35
+ "@instructure/ui-testable": "8.56.2-pr-snapshot-1721749364069",
36
+ "@instructure/ui-utils": "8.56.2-pr-snapshot-1721749364069",
37
37
  "keycode": "^2.2.1",
38
38
  "prop-types": "^15.8.1"
39
39
  },