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

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-1](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-1) (2022-06-10)
6
+ ## [8.25.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
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, _class2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
1
+ var _dec, _dec2, _dec3, _class, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
2
2
 
3
3
  /*
4
4
  * The MIT License (MIT)
@@ -43,87 +43,31 @@ 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 = (_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
- }
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
+ };
127
71
 
128
72
  get id() {
129
73
  if (this.props.id) {
@@ -148,15 +92,15 @@ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle
148
92
  }
149
93
 
150
94
  componentDidMount() {
151
- var _this$props$makeStyle, _this$props2;
95
+ var _this$props$makeStyle, _this$props;
152
96
 
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);
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);
154
98
  }
155
99
 
156
100
  componentDidUpdate() {
157
- var _this$props$makeStyle2, _this$props3;
101
+ var _this$props$makeStyle2, _this$props2;
158
102
 
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);
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);
160
104
  }
161
105
 
162
106
  get makeStyleVariables() {
@@ -167,6 +111,67 @@ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle
167
111
  };
168
112
  }
169
113
 
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
+
170
175
  arrowClicked(event, callback) {
171
176
  const interaction = this.interaction;
172
177
  event.preventDefault();
@@ -245,16 +250,6 @@ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle
245
250
  })), showArrows ? this.renderArrows() : null)));
246
251
  }
247
252
 
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);
253
+ }) || _class) || _class) || _class);
259
254
  export default NumberInput;
260
255
  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, _class2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
42
+ var _dec, _dec2, _dec3, _class, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
43
43
 
44
44
  /**
45
45
  ---
@@ -48,87 +48,31 @@ 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 = (_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
- }
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
+ };
132
76
 
133
77
  get id() {
134
78
  if (this.props.id) {
@@ -153,15 +97,15 @@ let NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
153
97
  }
154
98
 
155
99
  componentDidMount() {
156
- var _this$props$makeStyle, _this$props2;
100
+ var _this$props$makeStyle, _this$props;
157
101
 
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);
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);
159
103
  }
160
104
 
161
105
  componentDidUpdate() {
162
- var _this$props$makeStyle2, _this$props3;
106
+ var _this$props$makeStyle2, _this$props2;
163
107
 
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);
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);
165
109
  }
166
110
 
167
111
  get makeStyleVariables() {
@@ -172,6 +116,67 @@ let NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
172
116
  };
173
117
  }
174
118
 
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
+
175
180
  arrowClicked(event, callback) {
176
181
  const interaction = this.interaction;
177
182
  event.preventDefault();
@@ -250,17 +255,7 @@ let NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
250
255
  })), showArrows ? this.renderArrows() : null)));
251
256
  }
252
257
 
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);
258
+ }) || _class) || _class) || _class);
264
259
  exports.NumberInput = NumberInput;
265
260
  var _default = NumberInput;
266
261
  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-1",
3
+ "version": "8.25.1-snapshot-10",
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-1",
27
- "@instructure/ui-test-locator": "8.25.1-snapshot-1",
28
- "@instructure/ui-test-utils": "8.25.1-snapshot-1",
29
- "@instructure/ui-themes": "8.25.1-snapshot-1"
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"
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.13.10",
33
- "@instructure/emotion": "8.25.1-snapshot-1",
34
- "@instructure/shared-types": "8.25.1-snapshot-1",
35
- "@instructure/ui-form-field": "8.25.1-snapshot-1",
36
- "@instructure/ui-icons": "8.25.1-snapshot-1",
37
- "@instructure/ui-react-utils": "8.25.1-snapshot-1",
38
- "@instructure/ui-testable": "8.25.1-snapshot-1",
39
- "@instructure/ui-utils": "8.25.1-snapshot-1",
40
- "@instructure/uid": "8.25.1-snapshot-1",
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",
41
41
  "keycode": "^2",
42
42
  "prop-types": "^15"
43
43
  },