@instructure/ui-number-input 8.25.1-snapshot-10 → 8.25.1-snapshot-13

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.25.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
6
+ ## [8.25.1-snapshot-13](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-13) (2022-06-22)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-number-input
9
9
 
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _dec3, _class, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
1
+ var _dec, _dec2, _dec3, _class, _class2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
2
2
 
3
3
  /*
4
4
  * The MIT License (MIT)
@@ -43,31 +43,87 @@ id: NumberInput
43
43
  ---
44
44
  @tsProps
45
45
  **/
46
- let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = class NumberInput extends Component {
47
- static displayName = "NumberInput";
48
- static componentId = 'NumberInput';
49
- static allowedProps = allowedProps;
50
- static propTypes = propTypes;
51
- static defaultProps = {
52
- // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
53
- interaction: void 0,
54
- messages: [],
55
- isRequired: false,
56
- showArrows: true,
57
- size: 'medium',
58
- display: 'block',
59
- textAlign: 'start',
60
- inputMode: 'numeric'
61
- };
62
- state = {
63
- hasFocus: false
64
- };
65
- ref = null;
66
- _input = null;
67
- _id;
68
- handleRef = el => {
69
- this.ref = el;
70
- };
46
+ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class NumberInput extends Component {
47
+ constructor() {
48
+ super(...arguments);
49
+ this.state = {
50
+ hasFocus: false
51
+ };
52
+ this.ref = null;
53
+ this._input = null;
54
+ this._id = void 0;
55
+
56
+ this.handleRef = el => {
57
+ this.ref = el;
58
+ };
59
+
60
+ this.handleInputRef = element => {
61
+ this._input = element;
62
+
63
+ if (typeof this.props.inputRef === 'function') {
64
+ this.props.inputRef(element);
65
+ }
66
+ };
67
+
68
+ this.handleFocus = event => {
69
+ this.setState({
70
+ hasFocus: true
71
+ });
72
+
73
+ if (typeof this.props.onFocus === 'function') {
74
+ this.props.onFocus(event);
75
+ }
76
+ };
77
+
78
+ this.handleBlur = event => {
79
+ this.setState({
80
+ hasFocus: false
81
+ });
82
+
83
+ if (typeof this.props.onBlur === 'function') {
84
+ this.props.onBlur(event);
85
+ }
86
+ };
87
+
88
+ this.handleChange = event => {
89
+ if (typeof this.props.onChange === 'function') {
90
+ this.props.onChange(event, event.target.value);
91
+ }
92
+ };
93
+
94
+ this.handleKeyDown = event => {
95
+ const _this$props = this.props,
96
+ onKeyDown = _this$props.onKeyDown,
97
+ onDecrement = _this$props.onDecrement,
98
+ onIncrement = _this$props.onIncrement;
99
+
100
+ if (typeof onKeyDown === 'function') {
101
+ onKeyDown(event);
102
+ }
103
+
104
+ if (event.keyCode === keycode.codes.down) {
105
+ event.preventDefault();
106
+
107
+ if (typeof onDecrement === 'function') {
108
+ onDecrement(event);
109
+ }
110
+ } else if (event.keyCode === keycode.codes.up) {
111
+ event.preventDefault();
112
+
113
+ if (typeof onIncrement === 'function') {
114
+ onIncrement(event);
115
+ }
116
+ }
117
+ };
118
+
119
+ this.handleClickUpArrow = event => {
120
+ this.arrowClicked(event, this.props.onIncrement);
121
+ };
122
+
123
+ this.handleClickDownArrow = event => {
124
+ this.arrowClicked(event, this.props.onDecrement);
125
+ };
126
+ }
71
127
 
72
128
  get id() {
73
129
  if (this.props.id) {
@@ -92,15 +148,15 @@ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle
92
148
  }
93
149
 
94
150
  componentDidMount() {
95
- var _this$props$makeStyle, _this$props;
151
+ var _this$props$makeStyle, _this$props2;
96
152
 
97
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStyleVariables);
153
+ (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2, this.makeStyleVariables);
98
154
  }
99
155
 
100
156
  componentDidUpdate() {
101
- var _this$props$makeStyle2, _this$props2;
157
+ var _this$props$makeStyle2, _this$props3;
102
158
 
103
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleVariables);
159
+ (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3, this.makeStyleVariables);
104
160
  }
105
161
 
106
162
  get makeStyleVariables() {
@@ -111,67 +167,6 @@ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle
111
167
  };
112
168
  }
113
169
 
114
- handleInputRef = element => {
115
- this._input = element;
116
-
117
- if (typeof this.props.inputRef === 'function') {
118
- this.props.inputRef(element);
119
- }
120
- };
121
- handleFocus = event => {
122
- this.setState({
123
- hasFocus: true
124
- });
125
-
126
- if (typeof this.props.onFocus === 'function') {
127
- this.props.onFocus(event);
128
- }
129
- };
130
- handleBlur = event => {
131
- this.setState({
132
- hasFocus: false
133
- });
134
-
135
- if (typeof this.props.onBlur === 'function') {
136
- this.props.onBlur(event);
137
- }
138
- };
139
- handleChange = event => {
140
- if (typeof this.props.onChange === 'function') {
141
- this.props.onChange(event, event.target.value);
142
- }
143
- };
144
- handleKeyDown = event => {
145
- const _this$props3 = this.props,
146
- onKeyDown = _this$props3.onKeyDown,
147
- onDecrement = _this$props3.onDecrement,
148
- onIncrement = _this$props3.onIncrement;
149
-
150
- if (typeof onKeyDown === 'function') {
151
- onKeyDown(event);
152
- }
153
-
154
- if (event.keyCode === keycode.codes.down) {
155
- event.preventDefault();
156
-
157
- if (typeof onDecrement === 'function') {
158
- onDecrement(event);
159
- }
160
- } else if (event.keyCode === keycode.codes.up) {
161
- event.preventDefault();
162
-
163
- if (typeof onIncrement === 'function') {
164
- onIncrement(event);
165
- }
166
- }
167
- };
168
- handleClickUpArrow = event => {
169
- this.arrowClicked(event, this.props.onIncrement);
170
- };
171
- handleClickDownArrow = event => {
172
- this.arrowClicked(event, this.props.onDecrement);
173
- };
174
-
175
170
  arrowClicked(event, callback) {
176
171
  const interaction = this.interaction;
177
172
  event.preventDefault();
@@ -250,6 +245,16 @@ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle
250
245
  })), showArrows ? this.renderArrows() : null)));
251
246
  }
252
247
 
253
- }) || _class) || _class) || _class);
248
+ }, _class2.displayName = "NumberInput", _class2.componentId = 'NumberInput', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
249
+ // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
250
+ interaction: void 0,
251
+ messages: [],
252
+ isRequired: false,
253
+ showArrows: true,
254
+ size: 'medium',
255
+ display: 'block',
256
+ textAlign: 'start',
257
+ inputMode: 'numeric'
258
+ }, _class2)) || _class) || _class) || _class);
254
259
  export default NumberInput;
255
260
  export { NumberInput };
@@ -39,7 +39,7 @@ var _theme = _interopRequireDefault(require("./theme"));
39
39
 
40
40
  var _props = require("./props");
41
41
 
42
- var _dec, _dec2, _dec3, _class, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
42
+ var _dec, _dec2, _dec3, _class, _class2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
43
43
 
44
44
  /**
45
45
  ---
@@ -48,31 +48,87 @@ id: NumberInput
48
48
  ---
49
49
  @tsProps
50
50
  **/
51
- let NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = class NumberInput extends _react.Component {
52
- static displayName = "NumberInput";
53
- static componentId = 'NumberInput';
54
- static allowedProps = _props.allowedProps;
55
- static propTypes = _props.propTypes;
56
- static defaultProps = {
57
- // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
58
- interaction: void 0,
59
- messages: [],
60
- isRequired: false,
61
- showArrows: true,
62
- size: 'medium',
63
- display: 'block',
64
- textAlign: 'start',
65
- inputMode: 'numeric'
66
- };
67
- state = {
68
- hasFocus: false
69
- };
70
- ref = null;
71
- _input = null;
72
- _id;
73
- handleRef = el => {
74
- this.ref = el;
75
- };
51
+ let 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 {
52
+ constructor() {
53
+ super(...arguments);
54
+ this.state = {
55
+ hasFocus: false
56
+ };
57
+ this.ref = null;
58
+ this._input = null;
59
+ this._id = void 0;
60
+
61
+ this.handleRef = el => {
62
+ this.ref = el;
63
+ };
64
+
65
+ this.handleInputRef = element => {
66
+ this._input = element;
67
+
68
+ if (typeof this.props.inputRef === 'function') {
69
+ this.props.inputRef(element);
70
+ }
71
+ };
72
+
73
+ this.handleFocus = event => {
74
+ this.setState({
75
+ hasFocus: true
76
+ });
77
+
78
+ if (typeof this.props.onFocus === 'function') {
79
+ this.props.onFocus(event);
80
+ }
81
+ };
82
+
83
+ this.handleBlur = event => {
84
+ this.setState({
85
+ hasFocus: false
86
+ });
87
+
88
+ if (typeof this.props.onBlur === 'function') {
89
+ this.props.onBlur(event);
90
+ }
91
+ };
92
+
93
+ this.handleChange = event => {
94
+ if (typeof this.props.onChange === 'function') {
95
+ this.props.onChange(event, event.target.value);
96
+ }
97
+ };
98
+
99
+ this.handleKeyDown = event => {
100
+ const _this$props = this.props,
101
+ onKeyDown = _this$props.onKeyDown,
102
+ onDecrement = _this$props.onDecrement,
103
+ onIncrement = _this$props.onIncrement;
104
+
105
+ if (typeof onKeyDown === 'function') {
106
+ onKeyDown(event);
107
+ }
108
+
109
+ if (event.keyCode === _keycode.default.codes.down) {
110
+ event.preventDefault();
111
+
112
+ if (typeof onDecrement === 'function') {
113
+ onDecrement(event);
114
+ }
115
+ } else if (event.keyCode === _keycode.default.codes.up) {
116
+ event.preventDefault();
117
+
118
+ if (typeof onIncrement === 'function') {
119
+ onIncrement(event);
120
+ }
121
+ }
122
+ };
123
+
124
+ this.handleClickUpArrow = event => {
125
+ this.arrowClicked(event, this.props.onIncrement);
126
+ };
127
+
128
+ this.handleClickDownArrow = event => {
129
+ this.arrowClicked(event, this.props.onDecrement);
130
+ };
131
+ }
76
132
 
77
133
  get id() {
78
134
  if (this.props.id) {
@@ -97,15 +153,15 @@ let NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
97
153
  }
98
154
 
99
155
  componentDidMount() {
100
- var _this$props$makeStyle, _this$props;
156
+ var _this$props$makeStyle, _this$props2;
101
157
 
102
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStyleVariables);
158
+ (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2, this.makeStyleVariables);
103
159
  }
104
160
 
105
161
  componentDidUpdate() {
106
- var _this$props$makeStyle2, _this$props2;
162
+ var _this$props$makeStyle2, _this$props3;
107
163
 
108
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleVariables);
164
+ (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3, this.makeStyleVariables);
109
165
  }
110
166
 
111
167
  get makeStyleVariables() {
@@ -116,67 +172,6 @@ let NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
116
172
  };
117
173
  }
118
174
 
119
- handleInputRef = element => {
120
- this._input = element;
121
-
122
- if (typeof this.props.inputRef === 'function') {
123
- this.props.inputRef(element);
124
- }
125
- };
126
- handleFocus = event => {
127
- this.setState({
128
- hasFocus: true
129
- });
130
-
131
- if (typeof this.props.onFocus === 'function') {
132
- this.props.onFocus(event);
133
- }
134
- };
135
- handleBlur = event => {
136
- this.setState({
137
- hasFocus: false
138
- });
139
-
140
- if (typeof this.props.onBlur === 'function') {
141
- this.props.onBlur(event);
142
- }
143
- };
144
- handleChange = event => {
145
- if (typeof this.props.onChange === 'function') {
146
- this.props.onChange(event, event.target.value);
147
- }
148
- };
149
- handleKeyDown = event => {
150
- const _this$props3 = this.props,
151
- onKeyDown = _this$props3.onKeyDown,
152
- onDecrement = _this$props3.onDecrement,
153
- onIncrement = _this$props3.onIncrement;
154
-
155
- if (typeof onKeyDown === 'function') {
156
- onKeyDown(event);
157
- }
158
-
159
- if (event.keyCode === _keycode.default.codes.down) {
160
- event.preventDefault();
161
-
162
- if (typeof onDecrement === 'function') {
163
- onDecrement(event);
164
- }
165
- } else if (event.keyCode === _keycode.default.codes.up) {
166
- event.preventDefault();
167
-
168
- if (typeof onIncrement === 'function') {
169
- onIncrement(event);
170
- }
171
- }
172
- };
173
- handleClickUpArrow = event => {
174
- this.arrowClicked(event, this.props.onIncrement);
175
- };
176
- handleClickDownArrow = event => {
177
- this.arrowClicked(event, this.props.onDecrement);
178
- };
179
-
180
175
  arrowClicked(event, callback) {
181
176
  const interaction = this.interaction;
182
177
  event.preventDefault();
@@ -255,7 +250,17 @@ let NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
255
250
  })), showArrows ? this.renderArrows() : null)));
256
251
  }
257
252
 
258
- }) || _class) || _class) || _class);
253
+ }, _class2.displayName = "NumberInput", _class2.componentId = 'NumberInput', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
254
+ // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
255
+ interaction: void 0,
256
+ messages: [],
257
+ isRequired: false,
258
+ showArrows: true,
259
+ size: 'medium',
260
+ display: 'block',
261
+ textAlign: 'start',
262
+ inputMode: 'numeric'
263
+ }, _class2)) || _class) || _class) || _class);
259
264
  exports.NumberInput = NumberInput;
260
265
  var _default = NumberInput;
261
266
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-number-input",
3
- "version": "8.25.1-snapshot-10",
3
+ "version": "8.25.1-snapshot-13",
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,21 +23,21 @@
23
23
  "ts:check": "run -T tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
24
24
  },
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.25.1-snapshot-10",
27
- "@instructure/ui-test-locator": "8.25.1-snapshot-10",
28
- "@instructure/ui-test-utils": "8.25.1-snapshot-10",
29
- "@instructure/ui-themes": "8.25.1-snapshot-10"
26
+ "@instructure/ui-babel-preset": "8.25.1-snapshot-13",
27
+ "@instructure/ui-test-locator": "8.25.1-snapshot-13",
28
+ "@instructure/ui-test-utils": "8.25.1-snapshot-13",
29
+ "@instructure/ui-themes": "8.25.1-snapshot-13"
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.13.10",
33
- "@instructure/emotion": "8.25.1-snapshot-10",
34
- "@instructure/shared-types": "8.25.1-snapshot-10",
35
- "@instructure/ui-form-field": "8.25.1-snapshot-10",
36
- "@instructure/ui-icons": "8.25.1-snapshot-10",
37
- "@instructure/ui-react-utils": "8.25.1-snapshot-10",
38
- "@instructure/ui-testable": "8.25.1-snapshot-10",
39
- "@instructure/ui-utils": "8.25.1-snapshot-10",
40
- "@instructure/uid": "8.25.1-snapshot-10",
33
+ "@instructure/emotion": "8.25.1-snapshot-13",
34
+ "@instructure/shared-types": "8.25.1-snapshot-13",
35
+ "@instructure/ui-form-field": "8.25.1-snapshot-13",
36
+ "@instructure/ui-icons": "8.25.1-snapshot-13",
37
+ "@instructure/ui-react-utils": "8.25.1-snapshot-13",
38
+ "@instructure/ui-testable": "8.25.1-snapshot-13",
39
+ "@instructure/ui-utils": "8.25.1-snapshot-13",
40
+ "@instructure/uid": "8.25.1-snapshot-13",
41
41
  "keycode": "^2",
42
42
  "prop-types": "^15"
43
43
  },