@instructure/ui-number-input 8.56.2-pr-snapshot-1721749364069 → 8.56.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
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
|
-
## [8.56.2
|
|
6
|
+
## [8.56.2](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2) (2024-08-06)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-number-input
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.NumberInputLocator = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
8
8
|
var _index = require("./index");
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
@@ -31,7 +31,7 @@ var _index = require("./index");
|
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
34
|
-
const NumberInputLocator = exports.NumberInputLocator = (0,
|
|
35
|
-
findInput: (...args) => (0,
|
|
36
|
-
findArrowButtons: (...args) => (0,
|
|
34
|
+
const NumberInputLocator = exports.NumberInputLocator = (0, _locator.locator)(_index.NumberInput.selector, {
|
|
35
|
+
findInput: (...args) => (0, _locator.locator)('input').find(...args),
|
|
36
|
+
findArrowButtons: (...args) => (0, _locator.locator)('button').findAll(...args)
|
|
37
37
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
var _react = require("@testing-library/react");
|
|
5
|
-
var
|
|
5
|
+
var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
|
|
6
6
|
var _index = require("../index");
|
|
7
7
|
var _NumberInput = _interopRequireDefault(require("../__examples__/NumberInput.examples"));
|
|
8
8
|
var _generateA11yTests = require("@instructure/ui-scripts/lib/test/generateA11yTests");
|
|
@@ -38,7 +38,7 @@ describe('<Breadcrumb />', () => {
|
|
|
38
38
|
it(component.description, async () => {
|
|
39
39
|
const _render = (0, _react.render)(component.content),
|
|
40
40
|
container = _render.container;
|
|
41
|
-
const axeCheck = await (0,
|
|
41
|
+
const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
|
|
42
42
|
expect(axeCheck).toBe(true);
|
|
43
43
|
});
|
|
44
44
|
}
|
package/lib/NumberInput/index.js
CHANGED
|
@@ -8,10 +8,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.NumberInput = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _keycode = _interopRequireDefault(require("keycode"));
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
11
|
+
var _FormField = require("@instructure/ui-form-field/lib/FormField");
|
|
12
|
+
var _IconArrowOpenDownLine = require("@instructure/ui-icons/lib/IconArrowOpenDownLine.js");
|
|
13
|
+
var _IconArrowOpenUpLine2 = require("@instructure/ui-icons/lib/IconArrowOpenUpLine.js");
|
|
14
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
15
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
16
|
+
var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
|
|
17
|
+
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
18
|
+
var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
|
|
19
|
+
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
15
20
|
var _emotion = require("@instructure/emotion");
|
|
16
21
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
17
22
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -47,7 +52,7 @@ category: components
|
|
|
47
52
|
id: NumberInput
|
|
48
53
|
---
|
|
49
54
|
**/
|
|
50
|
-
let NumberInput = exports.NumberInput = (_dec = (0,
|
|
55
|
+
let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class NumberInput extends _react.Component {
|
|
51
56
|
constructor(...args) {
|
|
52
57
|
super(...args);
|
|
53
58
|
this.state = {
|
|
@@ -126,7 +131,7 @@ let NumberInput = exports.NumberInput = (_dec = (0, _uiReactUtils.withDeterminis
|
|
|
126
131
|
return !!this.props.messages && this.props.messages.some(message => message.type === 'error');
|
|
127
132
|
}
|
|
128
133
|
get interaction() {
|
|
129
|
-
return (0,
|
|
134
|
+
return (0, _getInteraction.getInteraction)({
|
|
130
135
|
props: this.props
|
|
131
136
|
});
|
|
132
137
|
}
|
|
@@ -166,13 +171,13 @@ let NumberInput = exports.NumberInput = (_dec = (0, _uiReactUtils.withDeterminis
|
|
|
166
171
|
onMouseDown: this.handleClickUpArrow,
|
|
167
172
|
tabIndex: -1,
|
|
168
173
|
type: "button"
|
|
169
|
-
}, _IconArrowOpenUpLine || (_IconArrowOpenUpLine = (0, _emotion.jsx)(
|
|
174
|
+
}, _IconArrowOpenUpLine || (_IconArrowOpenUpLine = (0, _emotion.jsx)(_IconArrowOpenUpLine2.IconArrowOpenUpLine, null))), (0, _emotion.jsx)("button", {
|
|
170
175
|
"aria-hidden": true,
|
|
171
176
|
css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.arrow,
|
|
172
177
|
onMouseDown: this.handleClickDownArrow,
|
|
173
178
|
tabIndex: -1,
|
|
174
179
|
type: "button"
|
|
175
|
-
}, _IconArrowOpenDownLin || (_IconArrowOpenDownLin = (0, _emotion.jsx)(
|
|
180
|
+
}, _IconArrowOpenDownLin || (_IconArrowOpenDownLin = (0, _emotion.jsx)(_IconArrowOpenDownLine.IconArrowOpenDownLine, null))));
|
|
176
181
|
}
|
|
177
182
|
render() {
|
|
178
183
|
var _this$props$styles4, _this$props$styles5, _this$props$styles6;
|
|
@@ -185,8 +190,8 @@ let NumberInput = exports.NumberInput = (_dec = (0, _uiReactUtils.withDeterminis
|
|
|
185
190
|
value = _this$props4.value,
|
|
186
191
|
width = _this$props4.width;
|
|
187
192
|
const interaction = this.interaction;
|
|
188
|
-
return (0, _emotion.jsx)(
|
|
189
|
-
label: (0,
|
|
193
|
+
return (0, _emotion.jsx)(_FormField.FormField, Object.assign({}, (0, _pickProps.pickProps)(this.props, _FormField.FormField.allowedProps), {
|
|
194
|
+
label: (0, _callRenderProp.callRenderProp)(renderLabel),
|
|
190
195
|
inline: display === 'inline-block',
|
|
191
196
|
id: this.id,
|
|
192
197
|
elementRef: this.handleRef
|
|
@@ -197,7 +202,7 @@ let NumberInput = exports.NumberInput = (_dec = (0, _uiReactUtils.withDeterminis
|
|
|
197
202
|
} : void 0
|
|
198
203
|
}, (0, _emotion.jsx)("span", {
|
|
199
204
|
css: (_this$props$styles5 = this.props.styles) === null || _this$props$styles5 === void 0 ? void 0 : _this$props$styles5.inputContainer
|
|
200
|
-
}, (0, _emotion.jsx)("input", Object.assign({}, (0,
|
|
205
|
+
}, (0, _emotion.jsx)("input", Object.assign({}, (0, _omitProps.omitProps)(this.props, [..._FormField.FormField.allowedProps, ...NumberInput.allowedProps]), {
|
|
201
206
|
css: (_this$props$styles6 = this.props.styles) === null || _this$props$styles6 === void 0 ? void 0 : _this$props$styles6.input,
|
|
202
207
|
"aria-invalid": this.invalid ? 'true' : void 0,
|
|
203
208
|
id: this.id,
|
package/lib/NumberInput/props.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
9
|
+
var _FormPropTypes = require("@instructure/ui-form-field/lib/FormPropTypes.js");
|
|
10
10
|
/*
|
|
11
11
|
* The MIT License (MIT)
|
|
12
12
|
*
|
|
@@ -35,7 +35,7 @@ const propTypes = exports.propTypes = {
|
|
|
35
35
|
renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
|
|
36
36
|
id: _propTypes.default.string,
|
|
37
37
|
interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
|
|
38
|
-
messages: _propTypes.default.arrayOf(
|
|
38
|
+
messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
|
|
39
39
|
placeholder: _propTypes.default.string,
|
|
40
40
|
isRequired: _propTypes.default.bool,
|
|
41
41
|
showArrows: _propTypes.default.bool,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-number-input",
|
|
3
|
-
"version": "8.56.2
|
|
3
|
+
"version": "8.56.2",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"homepage": "https://instructure.github.io/instructure-ui/",
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
"ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "8.56.2
|
|
27
|
-
"@instructure/ui-babel-preset": "8.56.2
|
|
28
|
-
"@instructure/ui-scripts": "8.56.2
|
|
29
|
-
"@instructure/ui-test-locator": "8.56.2
|
|
30
|
-
"@instructure/ui-test-utils": "8.56.2
|
|
31
|
-
"@instructure/ui-themes": "8.56.2
|
|
26
|
+
"@instructure/ui-axe-check": "8.56.2",
|
|
27
|
+
"@instructure/ui-babel-preset": "8.56.2",
|
|
28
|
+
"@instructure/ui-scripts": "8.56.2",
|
|
29
|
+
"@instructure/ui-test-locator": "8.56.2",
|
|
30
|
+
"@instructure/ui-test-utils": "8.56.2",
|
|
31
|
+
"@instructure/ui-themes": "8.56.2",
|
|
32
32
|
"@testing-library/react": "^14.1.2"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/runtime": "^7.23.2",
|
|
36
|
-
"@instructure/emotion": "8.56.2
|
|
37
|
-
"@instructure/shared-types": "8.56.2
|
|
38
|
-
"@instructure/ui-form-field": "8.56.2
|
|
39
|
-
"@instructure/ui-icons": "8.56.2
|
|
40
|
-
"@instructure/ui-react-utils": "8.56.2
|
|
41
|
-
"@instructure/ui-testable": "8.56.2
|
|
42
|
-
"@instructure/ui-utils": "8.56.2
|
|
43
|
-
"@instructure/uid": "8.56.2
|
|
36
|
+
"@instructure/emotion": "8.56.2",
|
|
37
|
+
"@instructure/shared-types": "8.56.2",
|
|
38
|
+
"@instructure/ui-form-field": "8.56.2",
|
|
39
|
+
"@instructure/ui-icons": "8.56.2",
|
|
40
|
+
"@instructure/ui-react-utils": "8.56.2",
|
|
41
|
+
"@instructure/ui-testable": "8.56.2",
|
|
42
|
+
"@instructure/ui-utils": "8.56.2",
|
|
43
|
+
"@instructure/uid": "8.56.2",
|
|
44
44
|
"keycode": "^2.2.1",
|
|
45
45
|
"prop-types": "^15.8.1"
|
|
46
46
|
},
|