@instructure/ui-text-area 8.12.1-snapshot.43 → 8.12.1-snapshot.47
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/TextArea/TextAreaLocator.js +3 -1
- package/es/TextArea/index.js +13 -6
- package/lib/TextArea/TextAreaLocator.js +3 -1
- package/lib/TextArea/index.js +14 -7
- package/lib/TextArea/props.js +1 -1
- package/package.json +17 -17
- package/src/TextArea/index.tsx +1 -3
- package/types/TextArea/index.d.ts.map +1 -1
|
@@ -24,5 +24,7 @@
|
|
|
24
24
|
import { locator } from '@instructure/ui-test-locator';
|
|
25
25
|
import { TextArea } from './index';
|
|
26
26
|
export const TextAreaLocator = locator(TextArea.selector, {
|
|
27
|
-
findInput: (
|
|
27
|
+
findInput: function () {
|
|
28
|
+
return locator('textarea').find(...arguments);
|
|
29
|
+
}
|
|
28
30
|
});
|
package/es/TextArea/index.js
CHANGED
|
@@ -67,7 +67,7 @@ let TextArea = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
|
|
|
67
67
|
|
|
68
68
|
const offset = this._textarea.offsetHeight - this._textarea.clientHeight;
|
|
69
69
|
let height = ''; // Notes:
|
|
70
|
-
// 1. height has be reset to `auto` every time this method runs, or scrollHeight will not reset
|
|
70
|
+
// 1. height has to be reset to `auto` every time this method runs, or scrollHeight will not reset
|
|
71
71
|
// 2. `this._textarea.scrollHeight` will not reset if assigned to a variable; it needs to be written out each time
|
|
72
72
|
|
|
73
73
|
this._textarea.style.height = 'auto';
|
|
@@ -98,7 +98,6 @@ let TextArea = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
|
|
|
98
98
|
|
|
99
99
|
this._height = height;
|
|
100
100
|
this._textarea.style.height = height;
|
|
101
|
-
this._textarea.scrollTop = this._textarea.scrollHeight;
|
|
102
101
|
};
|
|
103
102
|
|
|
104
103
|
this.handleChange = event => {
|
|
@@ -223,7 +222,10 @@ let TextArea = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
|
|
|
223
222
|
}
|
|
224
223
|
|
|
225
224
|
render() {
|
|
226
|
-
var _this
|
|
225
|
+
var _this = this,
|
|
226
|
+
_this$props$styles,
|
|
227
|
+
_this$props$styles2,
|
|
228
|
+
_this$props$styles3;
|
|
227
229
|
|
|
228
230
|
const _this$props4 = this.props,
|
|
229
231
|
autoGrow = _this$props4.autoGrow,
|
|
@@ -249,9 +251,14 @@ let TextArea = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
|
|
|
249
251
|
value: value,
|
|
250
252
|
defaultValue: defaultValue,
|
|
251
253
|
placeholder: placeholder,
|
|
252
|
-
ref: (textarea
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
ref: function (textarea) {
|
|
255
|
+
_this._textarea = textarea;
|
|
256
|
+
|
|
257
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
258
|
+
args[_key - 1] = arguments[_key];
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
textareaRef.apply(_this, [textarea].concat(args));
|
|
255
262
|
},
|
|
256
263
|
style: style,
|
|
257
264
|
id: this.id,
|
|
@@ -33,6 +33,8 @@ var _index = require("./index");
|
|
|
33
33
|
* SOFTWARE.
|
|
34
34
|
*/
|
|
35
35
|
const TextAreaLocator = (0, _locator.locator)(_index.TextArea.selector, {
|
|
36
|
-
findInput: (
|
|
36
|
+
findInput: function () {
|
|
37
|
+
return (0, _locator.locator)('textarea').find(...arguments);
|
|
38
|
+
}
|
|
37
39
|
});
|
|
38
40
|
exports.TextAreaLocator = TextAreaLocator;
|
package/lib/TextArea/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = exports.TextArea = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
@@ -70,7 +70,7 @@ let TextArea = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
70
70
|
|
|
71
71
|
const offset = this._textarea.offsetHeight - this._textarea.clientHeight;
|
|
72
72
|
let height = ''; // Notes:
|
|
73
|
-
// 1. height has be reset to `auto` every time this method runs, or scrollHeight will not reset
|
|
73
|
+
// 1. height has to be reset to `auto` every time this method runs, or scrollHeight will not reset
|
|
74
74
|
// 2. `this._textarea.scrollHeight` will not reset if assigned to a variable; it needs to be written out each time
|
|
75
75
|
|
|
76
76
|
this._textarea.style.height = 'auto';
|
|
@@ -101,7 +101,6 @@ let TextArea = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
101
101
|
|
|
102
102
|
this._height = height;
|
|
103
103
|
this._textarea.style.height = height;
|
|
104
|
-
this._textarea.scrollTop = this._textarea.scrollHeight;
|
|
105
104
|
};
|
|
106
105
|
|
|
107
106
|
this.handleChange = event => {
|
|
@@ -226,7 +225,10 @@ let TextArea = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
226
225
|
}
|
|
227
226
|
|
|
228
227
|
render() {
|
|
229
|
-
var _this
|
|
228
|
+
var _this = this,
|
|
229
|
+
_this$props$styles,
|
|
230
|
+
_this$props$styles2,
|
|
231
|
+
_this$props$styles3;
|
|
230
232
|
|
|
231
233
|
const _this$props4 = this.props,
|
|
232
234
|
autoGrow = _this$props4.autoGrow,
|
|
@@ -252,9 +254,14 @@ let TextArea = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
252
254
|
value: value,
|
|
253
255
|
defaultValue: defaultValue,
|
|
254
256
|
placeholder: placeholder,
|
|
255
|
-
ref: (textarea
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
ref: function (textarea) {
|
|
258
|
+
_this._textarea = textarea;
|
|
259
|
+
|
|
260
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
261
|
+
args[_key - 1] = arguments[_key];
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
textareaRef.apply(_this, [textarea].concat(args));
|
|
258
265
|
},
|
|
259
266
|
style: style,
|
|
260
267
|
id: this.id,
|
package/lib/TextArea/props.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-text-area",
|
|
3
|
-
"version": "8.12.1-snapshot.
|
|
3
|
+
"version": "8.12.1-snapshot.47+70bc15c4e",
|
|
4
4
|
"description": "A styled HTML text area component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,24 +25,24 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.13.10",
|
|
28
|
-
"@instructure/debounce": "8.12.1-snapshot.
|
|
29
|
-
"@instructure/emotion": "8.12.1-snapshot.
|
|
30
|
-
"@instructure/shared-types": "8.12.1-snapshot.
|
|
31
|
-
"@instructure/ui-dom-utils": "8.12.1-snapshot.
|
|
32
|
-
"@instructure/ui-form-field": "8.12.1-snapshot.
|
|
33
|
-
"@instructure/ui-prop-types": "8.12.1-snapshot.
|
|
34
|
-
"@instructure/ui-react-utils": "8.12.1-snapshot.
|
|
35
|
-
"@instructure/ui-testable": "8.12.1-snapshot.
|
|
36
|
-
"@instructure/ui-utils": "8.12.1-snapshot.
|
|
37
|
-
"@instructure/uid": "8.12.1-snapshot.
|
|
28
|
+
"@instructure/debounce": "8.12.1-snapshot.47+70bc15c4e",
|
|
29
|
+
"@instructure/emotion": "8.12.1-snapshot.47+70bc15c4e",
|
|
30
|
+
"@instructure/shared-types": "8.12.1-snapshot.47+70bc15c4e",
|
|
31
|
+
"@instructure/ui-dom-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
32
|
+
"@instructure/ui-form-field": "8.12.1-snapshot.47+70bc15c4e",
|
|
33
|
+
"@instructure/ui-prop-types": "8.12.1-snapshot.47+70bc15c4e",
|
|
34
|
+
"@instructure/ui-react-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
35
|
+
"@instructure/ui-testable": "8.12.1-snapshot.47+70bc15c4e",
|
|
36
|
+
"@instructure/ui-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
37
|
+
"@instructure/uid": "8.12.1-snapshot.47+70bc15c4e",
|
|
38
38
|
"prop-types": "^15"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@instructure/ui-babel-preset": "8.12.1-snapshot.
|
|
42
|
-
"@instructure/ui-color-utils": "8.12.1-snapshot.
|
|
43
|
-
"@instructure/ui-test-locator": "8.12.1-snapshot.
|
|
44
|
-
"@instructure/ui-test-utils": "8.12.1-snapshot.
|
|
45
|
-
"@instructure/ui-themes": "8.12.1-snapshot.
|
|
41
|
+
"@instructure/ui-babel-preset": "8.12.1-snapshot.47+70bc15c4e",
|
|
42
|
+
"@instructure/ui-color-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
43
|
+
"@instructure/ui-test-locator": "8.12.1-snapshot.47+70bc15c4e",
|
|
44
|
+
"@instructure/ui-test-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
45
|
+
"@instructure/ui-themes": "8.12.1-snapshot.47+70bc15c4e"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=17"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"sideEffects": false,
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "70bc15c4e8d89589a1372954f7a230ddde5ef71b"
|
|
55
55
|
}
|
package/src/TextArea/index.tsx
CHANGED
|
@@ -183,7 +183,7 @@ class TextArea extends Component<TextAreaProps> {
|
|
|
183
183
|
let height = ''
|
|
184
184
|
|
|
185
185
|
// Notes:
|
|
186
|
-
// 1. height has be reset to `auto` every time this method runs, or scrollHeight will not reset
|
|
186
|
+
// 1. height has to be reset to `auto` every time this method runs, or scrollHeight will not reset
|
|
187
187
|
// 2. `this._textarea.scrollHeight` will not reset if assigned to a variable; it needs to be written out each time
|
|
188
188
|
// @ts-expect-error ts-migrate(2339) FIXME: Property '_textarea' does not exist on type 'TextA... Remove this comment to see the full error message
|
|
189
189
|
this._textarea.style.height = 'auto'
|
|
@@ -225,8 +225,6 @@ class TextArea extends Component<TextAreaProps> {
|
|
|
225
225
|
this._height = height
|
|
226
226
|
// @ts-expect-error ts-migrate(2339) FIXME: Property '_textarea' does not exist on type 'TextA... Remove this comment to see the full error message
|
|
227
227
|
this._textarea.style.height = height
|
|
228
|
-
// @ts-expect-error ts-migrate(2339) FIXME: Property '_textarea' does not exist on type 'TextA... Remove this comment to see the full error message
|
|
229
|
-
this._textarea.scrollTop = this._textarea.scrollHeight
|
|
230
228
|
}
|
|
231
229
|
|
|
232
230
|
focus() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextArea/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAE1E,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAQrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C;;;;GAIG;AACH,c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