@instructure/ui-select 8.17.1-snapshot.1 → 8.17.1-snapshot.18
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/es/Select/index.js +5 -6
- package/lib/Select/index.js +6 -6
- package/package.json +23 -23
- package/src/Select/index.tsx +7 -8
- package/src/Select/props.ts +2 -1
- package/tsconfig.build.json +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Select/index.d.ts.map +1 -1
- package/types/Select/props.d.ts +2 -1
- package/types/Select/props.d.ts.map +1 -1
package/es/Select/index.js
CHANGED
|
@@ -3,7 +3,7 @@ const _excluded = ["id", "renderLabel", "children"],
|
|
|
3
3
|
_excluded2 = ["renderLabel", "inputValue", "placeholder", "isRequired", "shouldNotWrap", "size", "isInline", "width", "htmlSize", "messages", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onInputChange", "onRequestHideOptions"],
|
|
4
4
|
_excluded3 = ["ref"];
|
|
5
5
|
|
|
6
|
-
var _dec, _dec2, _class, _class2, _temp, _Options$Separator, _Options$Separator2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
|
|
6
|
+
var _dec, _dec2, _dec3, _class, _class2, _temp, _Options$Separator, _Options$Separator2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
@@ -33,8 +33,7 @@ var _dec, _dec2, _class, _class2, _temp, _Options$Separator, _Options$Separator2
|
|
|
33
33
|
import React, { Children, Component } from 'react';
|
|
34
34
|
import { createChainedFunction } from '@instructure/ui-utils';
|
|
35
35
|
import { testable } from '@instructure/ui-testable';
|
|
36
|
-
import {
|
|
37
|
-
import { matchComponentTypes, omitProps, getInteraction } from '@instructure/ui-react-utils';
|
|
36
|
+
import { matchComponentTypes, omitProps, getInteraction, withDeterministicId } from '@instructure/ui-react-utils';
|
|
38
37
|
import { getBoundingClientRect, isActiveElement } from '@instructure/ui-dom-utils';
|
|
39
38
|
import { View } from '@instructure/ui-view';
|
|
40
39
|
import { Selectable } from '@instructure/ui-selectable';
|
|
@@ -56,14 +55,14 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
56
55
|
---
|
|
57
56
|
@tsProps
|
|
58
57
|
**/
|
|
59
|
-
let Select = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
58
|
+
let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = class Select extends Component {
|
|
60
59
|
constructor() {
|
|
61
60
|
super(...arguments);
|
|
62
61
|
this.state = {
|
|
63
62
|
hasInputRef: false
|
|
64
63
|
};
|
|
65
64
|
this.ref = null;
|
|
66
|
-
this._defaultId =
|
|
65
|
+
this._defaultId = this.props.deterministicId();
|
|
67
66
|
this._inputContainer = null;
|
|
68
67
|
this._listView = null;
|
|
69
68
|
this._optionIds = [];
|
|
@@ -582,6 +581,6 @@ let Select = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
|
|
|
582
581
|
placement: 'bottom stretch',
|
|
583
582
|
constrain: 'window',
|
|
584
583
|
shouldNotWrap: false
|
|
585
|
-
}, _class2.Option = Option, _class2.Group = Group, _temp)) || _class) || _class);
|
|
584
|
+
}, _class2.Option = Option, _class2.Group = Group, _temp)) || _class) || _class) || _class);
|
|
586
585
|
export default Select;
|
|
587
586
|
export { Select };
|
package/lib/Select/index.js
CHANGED
|
@@ -17,14 +17,14 @@ var _createChainedFunction = require("@instructure/ui-utils/lib/createChainedFun
|
|
|
17
17
|
|
|
18
18
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
19
19
|
|
|
20
|
-
var _uid = require("@instructure/uid");
|
|
21
|
-
|
|
22
20
|
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
23
21
|
|
|
24
22
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
25
23
|
|
|
26
24
|
var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
|
|
27
25
|
|
|
26
|
+
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
27
|
+
|
|
28
28
|
var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingClientRect.js");
|
|
29
29
|
|
|
30
30
|
var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js");
|
|
@@ -59,7 +59,7 @@ const _excluded = ["id", "renderLabel", "children"],
|
|
|
59
59
|
_excluded2 = ["renderLabel", "inputValue", "placeholder", "isRequired", "shouldNotWrap", "size", "isInline", "width", "htmlSize", "messages", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onInputChange", "onRequestHideOptions"],
|
|
60
60
|
_excluded3 = ["ref"];
|
|
61
61
|
|
|
62
|
-
var _dec, _dec2, _class, _class2, _temp, _Options$Separator, _Options$Separator2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
|
|
62
|
+
var _dec, _dec2, _dec3, _class, _class2, _temp, _Options$Separator, _Options$Separator2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
---
|
|
@@ -68,14 +68,14 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
68
68
|
---
|
|
69
69
|
@tsProps
|
|
70
70
|
**/
|
|
71
|
-
let Select = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
71
|
+
let Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = class Select extends _react.Component {
|
|
72
72
|
constructor() {
|
|
73
73
|
super(...arguments);
|
|
74
74
|
this.state = {
|
|
75
75
|
hasInputRef: false
|
|
76
76
|
};
|
|
77
77
|
this.ref = null;
|
|
78
|
-
this._defaultId =
|
|
78
|
+
this._defaultId = this.props.deterministicId();
|
|
79
79
|
this._inputContainer = null;
|
|
80
80
|
this._listView = null;
|
|
81
81
|
this._optionIds = [];
|
|
@@ -590,7 +590,7 @@ let Select = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _
|
|
|
590
590
|
placement: 'bottom stretch',
|
|
591
591
|
constrain: 'window',
|
|
592
592
|
shouldNotWrap: false
|
|
593
|
-
}, _class2.Option = _Option.Option, _class2.Group = _Group.Group, _temp)) || _class) || _class);
|
|
593
|
+
}, _class2.Option = _Option.Option, _class2.Group = _Group.Group, _temp)) || _class) || _class) || _class);
|
|
594
594
|
exports.Select = Select;
|
|
595
595
|
var _default = Select;
|
|
596
596
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-select",
|
|
3
|
-
"version": "8.17.1-snapshot.
|
|
3
|
+
"version": "8.17.1-snapshot.18+9f145a7d2",
|
|
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,30 +23,30 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.17.1-snapshot.
|
|
27
|
-
"@instructure/ui-color-utils": "8.17.1-snapshot.
|
|
28
|
-
"@instructure/ui-test-locator": "8.17.1-snapshot.
|
|
29
|
-
"@instructure/ui-test-utils": "8.17.1-snapshot.
|
|
30
|
-
"@instructure/ui-themes": "8.17.1-snapshot.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.17.1-snapshot.18+9f145a7d2",
|
|
27
|
+
"@instructure/ui-color-utils": "8.17.1-snapshot.18+9f145a7d2",
|
|
28
|
+
"@instructure/ui-test-locator": "8.17.1-snapshot.18+9f145a7d2",
|
|
29
|
+
"@instructure/ui-test-utils": "8.17.1-snapshot.18+9f145a7d2",
|
|
30
|
+
"@instructure/ui-themes": "8.17.1-snapshot.18+9f145a7d2"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@instructure/emotion": "8.17.1-snapshot.
|
|
35
|
-
"@instructure/shared-types": "8.17.1-snapshot.
|
|
36
|
-
"@instructure/ui-dom-utils": "8.17.1-snapshot.
|
|
37
|
-
"@instructure/ui-form-field": "8.17.1-snapshot.
|
|
38
|
-
"@instructure/ui-icons": "8.17.1-snapshot.
|
|
39
|
-
"@instructure/ui-options": "8.17.1-snapshot.
|
|
40
|
-
"@instructure/ui-popover": "8.17.1-snapshot.
|
|
41
|
-
"@instructure/ui-position": "8.17.1-snapshot.
|
|
42
|
-
"@instructure/ui-prop-types": "8.17.1-snapshot.
|
|
43
|
-
"@instructure/ui-react-utils": "8.17.1-snapshot.
|
|
44
|
-
"@instructure/ui-selectable": "8.17.1-snapshot.
|
|
45
|
-
"@instructure/ui-testable": "8.17.1-snapshot.
|
|
46
|
-
"@instructure/ui-text-input": "8.17.1-snapshot.
|
|
47
|
-
"@instructure/ui-utils": "8.17.1-snapshot.
|
|
48
|
-
"@instructure/ui-view": "8.17.1-snapshot.
|
|
49
|
-
"@instructure/uid": "8.17.1-snapshot.
|
|
34
|
+
"@instructure/emotion": "8.17.1-snapshot.18+9f145a7d2",
|
|
35
|
+
"@instructure/shared-types": "8.17.1-snapshot.18+9f145a7d2",
|
|
36
|
+
"@instructure/ui-dom-utils": "8.17.1-snapshot.18+9f145a7d2",
|
|
37
|
+
"@instructure/ui-form-field": "8.17.1-snapshot.18+9f145a7d2",
|
|
38
|
+
"@instructure/ui-icons": "8.17.1-snapshot.18+9f145a7d2",
|
|
39
|
+
"@instructure/ui-options": "8.17.1-snapshot.18+9f145a7d2",
|
|
40
|
+
"@instructure/ui-popover": "8.17.1-snapshot.18+9f145a7d2",
|
|
41
|
+
"@instructure/ui-position": "8.17.1-snapshot.18+9f145a7d2",
|
|
42
|
+
"@instructure/ui-prop-types": "8.17.1-snapshot.18+9f145a7d2",
|
|
43
|
+
"@instructure/ui-react-utils": "8.17.1-snapshot.18+9f145a7d2",
|
|
44
|
+
"@instructure/ui-selectable": "8.17.1-snapshot.18+9f145a7d2",
|
|
45
|
+
"@instructure/ui-testable": "8.17.1-snapshot.18+9f145a7d2",
|
|
46
|
+
"@instructure/ui-text-input": "8.17.1-snapshot.18+9f145a7d2",
|
|
47
|
+
"@instructure/ui-utils": "8.17.1-snapshot.18+9f145a7d2",
|
|
48
|
+
"@instructure/ui-view": "8.17.1-snapshot.18+9f145a7d2",
|
|
49
|
+
"@instructure/uid": "8.17.1-snapshot.18+9f145a7d2",
|
|
50
50
|
"prop-types": "^15"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"sideEffects": false,
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "9f145a7d2f84eda965b570fa5702e1fda0c92e58"
|
|
60
60
|
}
|
package/src/Select/index.tsx
CHANGED
|
@@ -27,11 +27,11 @@ import React, { Children, Component } from 'react'
|
|
|
27
27
|
|
|
28
28
|
import { createChainedFunction } from '@instructure/ui-utils'
|
|
29
29
|
import { testable } from '@instructure/ui-testable'
|
|
30
|
-
import { uid } from '@instructure/uid'
|
|
31
30
|
import {
|
|
32
31
|
matchComponentTypes,
|
|
33
32
|
omitProps,
|
|
34
|
-
getInteraction
|
|
33
|
+
getInteraction,
|
|
34
|
+
withDeterministicId
|
|
35
35
|
} from '@instructure/ui-react-utils'
|
|
36
36
|
import {
|
|
37
37
|
getBoundingClientRect,
|
|
@@ -85,6 +85,7 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
85
85
|
---
|
|
86
86
|
@tsProps
|
|
87
87
|
**/
|
|
88
|
+
@withDeterministicId()
|
|
88
89
|
@withStyle(generateStyle, generateComponentTheme)
|
|
89
90
|
@testable()
|
|
90
91
|
class Select extends Component<SelectProps> {
|
|
@@ -124,10 +125,8 @@ class Select extends Component<SelectProps> {
|
|
|
124
125
|
state = {
|
|
125
126
|
hasInputRef: false
|
|
126
127
|
}
|
|
127
|
-
|
|
128
128
|
ref: HTMLInputElement | null = null
|
|
129
|
-
|
|
130
|
-
private _defaultId = uid('Select')
|
|
129
|
+
private _defaultId = this.props.deterministicId!()
|
|
131
130
|
private _inputContainer: HTMLSpanElement | null = null
|
|
132
131
|
private _listView: Element | null = null
|
|
133
132
|
// temporarily stores actionable options
|
|
@@ -238,9 +237,9 @@ class Select extends Component<SelectProps> {
|
|
|
238
237
|
|
|
239
238
|
// store option height to calculate list maxHeight
|
|
240
239
|
if (node && node.querySelector('[role="option"]')) {
|
|
241
|
-
this._optionHeight = (
|
|
242
|
-
|
|
243
|
-
).offsetHeight
|
|
240
|
+
this._optionHeight = (node.querySelector(
|
|
241
|
+
'[role="option"]'
|
|
242
|
+
) as HTMLElement).offsetHeight
|
|
244
243
|
}
|
|
245
244
|
}
|
|
246
245
|
|
package/src/Select/props.ts
CHANGED
|
@@ -44,6 +44,7 @@ import type {
|
|
|
44
44
|
PositionConstraint,
|
|
45
45
|
PositionMountNode
|
|
46
46
|
} from '@instructure/ui-position'
|
|
47
|
+
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
|
|
47
48
|
|
|
48
49
|
type SelectOwnProps = {
|
|
49
50
|
/**
|
|
@@ -260,7 +261,7 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
|
260
261
|
|
|
261
262
|
type SelectProps = SelectOwnProps &
|
|
262
263
|
WithStyleProps<SelectTheme, SelectStyle> &
|
|
263
|
-
OtherHTMLAttributes<SelectOwnProps, InputHTMLAttributes<SelectOwnProps>>
|
|
264
|
+
OtherHTMLAttributes<SelectOwnProps, InputHTMLAttributes<SelectOwnProps>> & WithDeterministicIdProps
|
|
264
265
|
|
|
265
266
|
type SelectStyle = ComponentStyle<'select' | 'icon' | 'assistiveText'>
|
|
266
267
|
|
package/tsconfig.build.json
CHANGED
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
{ "path": "../ui-popover/tsconfig.build.json" },
|
|
22
22
|
{ "path": "../ui-position/tsconfig.build.json" },
|
|
23
23
|
{ "path": "../ui-prop-types/tsconfig.build.json" },
|
|
24
|
-
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
25
24
|
{ "path": "../ui-selectable/tsconfig.build.json" },
|
|
26
25
|
{ "path": "../ui-testable/tsconfig.build.json" },
|
|
27
26
|
{ "path": "../ui-text-input/tsconfig.build.json" },
|
|
28
27
|
{ "path": "../ui-utils/tsconfig.build.json" },
|
|
29
28
|
{ "path": "../ui-view/tsconfig.build.json" },
|
|
29
|
+
{ "path": "../ui-utils/tsconfig.build.json" },
|
|
30
|
+
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
30
31
|
{ "path": "../uid/tsconfig.build.json" }
|
|
31
32
|
]
|
|
32
33
|
}
|