@instructure/ui-number-input 10.11.0 → 10.11.1-pr-snapshot-1741369431545
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,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.11.1-pr-snapshot-1741369431545](https://github.com/instructure/instructure-ui/compare/v10.11.0...v10.11.1-pr-snapshot-1741369431545) (2025-03-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-number-input
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [10.11.0](https://github.com/instructure/instructure-ui/compare/v10.10.0...v10.11.0) (2025-02-03)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-number-input
|
|
@@ -5,13 +5,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
6
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
7
7
|
var _vitest = require("vitest");
|
|
8
|
-
var
|
|
8
|
+
var _uiAxeCheck = require("@instructure/ui-axe-check");
|
|
9
9
|
require("@testing-library/jest-dom");
|
|
10
10
|
var _index = require("../index");
|
|
11
11
|
var _NumberInput5 = _interopRequireDefault(require("../__examples__/NumberInput.examples"));
|
|
12
12
|
var _generateA11yTests = require("@instructure/ui-scripts/lib/test/generateA11yTests");
|
|
13
|
-
var
|
|
14
|
-
var _IconZoomOutLine2 = require("@instructure/ui-icons/lib/IconZoomOutLine.js");
|
|
13
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
15
14
|
var _NumberInput, _NumberInput2, _NumberInput3, _NumberInput4, _IconZoomInLine, _IconZoomOutLine;
|
|
16
15
|
/*
|
|
17
16
|
* The MIT License (MIT)
|
|
@@ -252,7 +251,7 @@ describe('<NumberInput />', () => {
|
|
|
252
251
|
it(component.description, async () => {
|
|
253
252
|
const _render10 = (0, _react2.render)(component.content),
|
|
254
253
|
container = _render10.container;
|
|
255
|
-
const axeCheck = await (0,
|
|
254
|
+
const axeCheck = await (0, _uiAxeCheck.runAxeCheck)(container);
|
|
256
255
|
expect(axeCheck).toBe(true);
|
|
257
256
|
});
|
|
258
257
|
}
|
|
@@ -265,8 +264,8 @@ describe('<NumberInput />', () => {
|
|
|
265
264
|
onIncrement: onIncrement,
|
|
266
265
|
onDecrement: onDecrement,
|
|
267
266
|
renderIcons: {
|
|
268
|
-
increase: _IconZoomInLine || (_IconZoomInLine = /*#__PURE__*/_react.default.createElement(
|
|
269
|
-
decrease: _IconZoomOutLine || (_IconZoomOutLine = /*#__PURE__*/_react.default.createElement(
|
|
267
|
+
increase: _IconZoomInLine || (_IconZoomInLine = /*#__PURE__*/_react.default.createElement(_uiIcons.IconZoomInLine, null)),
|
|
268
|
+
decrease: _IconZoomOutLine || (_IconZoomOutLine = /*#__PURE__*/_react.default.createElement(_uiIcons.IconZoomOutLine, null))
|
|
270
269
|
}
|
|
271
270
|
})),
|
|
272
271
|
container = _render11.container;
|
package/lib/NumberInput/index.js
CHANGED
|
@@ -8,16 +8,11 @@ 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
|
|
15
|
-
var
|
|
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");
|
|
20
|
-
var _hasVisibleChildren = require("@instructure/ui-a11y-utils/lib/hasVisibleChildren.js");
|
|
11
|
+
var _uiFormField = require("@instructure/ui-form-field");
|
|
12
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
13
|
+
var _uiTestable = require("@instructure/ui-testable");
|
|
14
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
15
|
+
var _uiA11yUtils = require("@instructure/ui-a11y-utils");
|
|
21
16
|
var _emotion = require("@instructure/emotion");
|
|
22
17
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
23
18
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -53,7 +48,7 @@ category: components
|
|
|
53
48
|
id: NumberInput
|
|
54
49
|
---
|
|
55
50
|
**/
|
|
56
|
-
let NumberInput = exports.NumberInput = (_dec = (0,
|
|
51
|
+
let NumberInput = exports.NumberInput = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_NumberInput = class NumberInput extends _react.Component {
|
|
57
52
|
constructor(...args) {
|
|
58
53
|
super(...args);
|
|
59
54
|
this.state = {
|
|
@@ -132,7 +127,7 @@ let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDet
|
|
|
132
127
|
return !!this.props.messages && this.props.messages.some(message => message.type === 'error' || message.type === 'newError');
|
|
133
128
|
}
|
|
134
129
|
get interaction() {
|
|
135
|
-
return (0,
|
|
130
|
+
return (0, _uiReactUtils.getInteraction)({
|
|
136
131
|
props: this.props
|
|
137
132
|
});
|
|
138
133
|
}
|
|
@@ -172,13 +167,13 @@ let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDet
|
|
|
172
167
|
onMouseDown: this.handleClickUpArrow,
|
|
173
168
|
tabIndex: -1,
|
|
174
169
|
type: "button"
|
|
175
|
-
}, customIcons !== null && customIcons !== void 0 && customIcons.increase ? (0,
|
|
170
|
+
}, customIcons !== null && customIcons !== void 0 && customIcons.increase ? (0, _uiReactUtils.callRenderProp)(customIcons.increase) : _IconArrowOpenUpLine || (_IconArrowOpenUpLine = (0, _emotion.jsx)(_uiIcons.IconArrowOpenUpLine, null))), (0, _emotion.jsx)("button", {
|
|
176
171
|
"aria-hidden": true,
|
|
177
172
|
css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.arrow,
|
|
178
173
|
onMouseDown: this.handleClickDownArrow,
|
|
179
174
|
tabIndex: -1,
|
|
180
175
|
type: "button"
|
|
181
|
-
}, customIcons !== null && customIcons !== void 0 && customIcons.decrease ? (0,
|
|
176
|
+
}, customIcons !== null && customIcons !== void 0 && customIcons.decrease ? (0, _uiReactUtils.callRenderProp)(customIcons.decrease) : _IconArrowOpenDownLin || (_IconArrowOpenDownLin = (0, _emotion.jsx)(_uiIcons.IconArrowOpenDownLine, null))));
|
|
182
177
|
}
|
|
183
178
|
render() {
|
|
184
179
|
var _this$props$styles4, _this$props$styles5, _this$props$styles6;
|
|
@@ -194,12 +189,12 @@ let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDet
|
|
|
194
189
|
allowStringValue = _this$props4.allowStringValue,
|
|
195
190
|
renderIcons = _this$props4.renderIcons;
|
|
196
191
|
const interaction = this.interaction;
|
|
197
|
-
const rawLabel = (0,
|
|
198
|
-
const label = (0,
|
|
192
|
+
const rawLabel = (0, _uiReactUtils.callRenderProp)(renderLabel);
|
|
193
|
+
const label = (0, _uiA11yUtils.hasVisibleChildren)(rawLabel) ? (0, _emotion.jsx)(_react.default.Fragment, null, rawLabel, isRequired && (0, _emotion.jsx)("span", {
|
|
199
194
|
css: this.invalid ? styles === null || styles === void 0 ? void 0 : styles.requiredInvalid : {},
|
|
200
195
|
"aria-hidden": true
|
|
201
196
|
}, ' ', "*")) : rawLabel;
|
|
202
|
-
return (0, _emotion.jsx)(
|
|
197
|
+
return (0, _emotion.jsx)(_uiFormField.FormField, Object.assign({}, (0, _uiReactUtils.pickProps)(this.props, _uiFormField.FormField.allowedProps), {
|
|
203
198
|
label: label,
|
|
204
199
|
inline: display === 'inline-block',
|
|
205
200
|
id: this.id,
|
|
@@ -211,7 +206,7 @@ let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDet
|
|
|
211
206
|
} : void 0
|
|
212
207
|
}, (0, _emotion.jsx)("span", {
|
|
213
208
|
css: (_this$props$styles5 = this.props.styles) === null || _this$props$styles5 === void 0 ? void 0 : _this$props$styles5.inputContainer
|
|
214
|
-
}, (0, _emotion.jsx)("input", Object.assign({}, (0,
|
|
209
|
+
}, (0, _emotion.jsx)("input", Object.assign({}, (0, _uiReactUtils.omitProps)(this.props, [..._uiFormField.FormField.allowedProps, ...NumberInput.allowedProps]), {
|
|
215
210
|
css: (_this$props$styles6 = this.props.styles) === null || _this$props$styles6 === void 0 ? void 0 : _this$props$styles6.input,
|
|
216
211
|
"aria-invalid": this.invalid ? 'true' : void 0,
|
|
217
212
|
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 _uiFormField = require("@instructure/ui-form-field");
|
|
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(_uiFormField.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": "10.11.
|
|
3
|
+
"version": "10.11.1-pr-snapshot-1741369431545",
|
|
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,11 +23,11 @@
|
|
|
23
23
|
"ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "10.11.
|
|
27
|
-
"@instructure/ui-babel-preset": "10.11.
|
|
28
|
-
"@instructure/ui-scripts": "10.11.
|
|
29
|
-
"@instructure/ui-test-utils": "10.11.
|
|
30
|
-
"@instructure/ui-themes": "10.11.
|
|
26
|
+
"@instructure/ui-axe-check": "10.11.1-pr-snapshot-1741369431545",
|
|
27
|
+
"@instructure/ui-babel-preset": "10.11.1-pr-snapshot-1741369431545",
|
|
28
|
+
"@instructure/ui-scripts": "10.11.1-pr-snapshot-1741369431545",
|
|
29
|
+
"@instructure/ui-test-utils": "10.11.1-pr-snapshot-1741369431545",
|
|
30
|
+
"@instructure/ui-themes": "10.11.1-pr-snapshot-1741369431545",
|
|
31
31
|
"@testing-library/jest-dom": "^6.6.3",
|
|
32
32
|
"@testing-library/react": "^16.0.1",
|
|
33
33
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/runtime": "^7.26.0",
|
|
38
|
-
"@instructure/emotion": "10.11.
|
|
39
|
-
"@instructure/shared-types": "10.11.
|
|
40
|
-
"@instructure/ui-form-field": "10.11.
|
|
41
|
-
"@instructure/ui-icons": "10.11.
|
|
42
|
-
"@instructure/ui-react-utils": "10.11.
|
|
43
|
-
"@instructure/ui-testable": "10.11.
|
|
44
|
-
"@instructure/ui-utils": "10.11.
|
|
45
|
-
"@instructure/uid": "10.11.
|
|
38
|
+
"@instructure/emotion": "10.11.1-pr-snapshot-1741369431545",
|
|
39
|
+
"@instructure/shared-types": "10.11.1-pr-snapshot-1741369431545",
|
|
40
|
+
"@instructure/ui-form-field": "10.11.1-pr-snapshot-1741369431545",
|
|
41
|
+
"@instructure/ui-icons": "10.11.1-pr-snapshot-1741369431545",
|
|
42
|
+
"@instructure/ui-react-utils": "10.11.1-pr-snapshot-1741369431545",
|
|
43
|
+
"@instructure/ui-testable": "10.11.1-pr-snapshot-1741369431545",
|
|
44
|
+
"@instructure/ui-utils": "10.11.1-pr-snapshot-1741369431545",
|
|
45
|
+
"@instructure/uid": "10.11.1-pr-snapshot-1741369431545",
|
|
46
46
|
"keycode": "^2",
|
|
47
47
|
"prop-types": "^15.8.1"
|
|
48
48
|
},
|