@instructure/ui-text-area 8.12.1-snapshot.7 → 8.13.0

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,16 @@
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.13.0](https://github.com/instructure/instructure-ui/compare/v8.12.0...v8.13.0) (2021-12-01)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **ui-text-area:** fix jumping scroll issue ([9f4d9f9](https://github.com/instructure/instructure-ui/commit/9f4d9f91f603496ac87a04d953afe7fe9004874d))
11
+
12
+ ### Features
13
+
14
+ - **ui-form-field:** make FormField messages accept `ReactNode` text, not just `string` ([4d36973](https://github.com/instructure/instructure-ui/commit/4d369733414715a70bae0628378e8d82214eab3e))
15
+
6
16
  # [8.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
7
17
 
8
18
  **Note:** Version bump only for package @instructure/ui-text-area
@@ -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: (...args) => locator('textarea').find(...args)
27
+ findInput: function () {
28
+ return locator('textarea').find(...arguments);
29
+ }
28
30
  });
@@ -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$props$styles, _this$props$styles2, _this$props$styles3;
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, ...args) => {
253
- this._textarea = textarea;
254
- textareaRef.apply(this, [textarea].concat(args));
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,
@@ -63,7 +63,7 @@ const propTypes = {
63
63
 
64
64
  /**
65
65
  * object with shape: `{
66
- * text: PropTypes.string,
66
+ * text: PropTypes.node,
67
67
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
68
68
  * }`
69
69
  */
@@ -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: (...args) => (0, _locator.locator)('textarea').find(...args)
36
+ findInput: function () {
37
+ return (0, _locator.locator)('textarea').find(...arguments);
38
+ }
37
39
  });
38
40
  exports.TextAreaLocator = TextAreaLocator;
@@ -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.TextArea = exports.default = void 0;
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$props$styles, _this$props$styles2, _this$props$styles3;
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, ...args) => {
256
- this._textarea = textarea;
257
- textareaRef.apply(this, [textarea].concat(args));
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,
@@ -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.allowedProps = exports.propTypes = void 0;
8
+ exports.propTypes = exports.allowedProps = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -75,7 +75,7 @@ const propTypes = {
75
75
 
76
76
  /**
77
77
  * object with shape: `{
78
- * text: PropTypes.string,
78
+ * text: PropTypes.node,
79
79
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
80
80
  * }`
81
81
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-text-area",
3
- "version": "8.12.1-snapshot.7+1e7ac8219",
3
+ "version": "8.13.0",
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.7+1e7ac8219",
29
- "@instructure/emotion": "8.12.1-snapshot.7+1e7ac8219",
30
- "@instructure/shared-types": "8.12.1-snapshot.7+1e7ac8219",
31
- "@instructure/ui-dom-utils": "8.12.1-snapshot.7+1e7ac8219",
32
- "@instructure/ui-form-field": "8.12.1-snapshot.7+1e7ac8219",
33
- "@instructure/ui-prop-types": "8.12.1-snapshot.7+1e7ac8219",
34
- "@instructure/ui-react-utils": "8.12.1-snapshot.7+1e7ac8219",
35
- "@instructure/ui-testable": "8.12.1-snapshot.7+1e7ac8219",
36
- "@instructure/ui-utils": "8.12.1-snapshot.7+1e7ac8219",
37
- "@instructure/uid": "8.12.1-snapshot.7+1e7ac8219",
28
+ "@instructure/debounce": "8.13.0",
29
+ "@instructure/emotion": "8.13.0",
30
+ "@instructure/shared-types": "8.13.0",
31
+ "@instructure/ui-dom-utils": "8.13.0",
32
+ "@instructure/ui-form-field": "8.13.0",
33
+ "@instructure/ui-prop-types": "8.13.0",
34
+ "@instructure/ui-react-utils": "8.13.0",
35
+ "@instructure/ui-testable": "8.13.0",
36
+ "@instructure/ui-utils": "8.13.0",
37
+ "@instructure/uid": "8.13.0",
38
38
  "prop-types": "^15"
39
39
  },
40
40
  "devDependencies": {
41
- "@instructure/ui-babel-preset": "8.12.1-snapshot.7+1e7ac8219",
42
- "@instructure/ui-color-utils": "8.12.1-snapshot.7+1e7ac8219",
43
- "@instructure/ui-test-locator": "8.12.1-snapshot.7+1e7ac8219",
44
- "@instructure/ui-test-utils": "8.12.1-snapshot.7+1e7ac8219",
45
- "@instructure/ui-themes": "8.12.1-snapshot.7+1e7ac8219"
41
+ "@instructure/ui-babel-preset": "8.13.0",
42
+ "@instructure/ui-color-utils": "8.13.0",
43
+ "@instructure/ui-test-locator": "8.13.0",
44
+ "@instructure/ui-test-utils": "8.13.0",
45
+ "@instructure/ui-themes": "8.13.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=16.8 <=17"
@@ -50,6 +50,5 @@
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "sideEffects": false,
54
- "gitHead": "1e7ac821932a91fe9ef761c96f747c7ea1f3925a"
53
+ "sideEffects": false
55
54
  }
@@ -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() {
@@ -105,7 +105,7 @@ const propTypes: PropValidators<PropKeys> = {
105
105
  maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
106
106
  /**
107
107
  * object with shape: `{
108
- * text: PropTypes.string,
108
+ * text: PropTypes.node,
109
109
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
110
110
  * }`
111
111
  */
@@ -20,7 +20,7 @@ declare class TextArea extends Component<TextAreaProps> {
20
20
  width?: string | undefined;
21
21
  height?: string | undefined;
22
22
  maxHeight?: string | number | undefined;
23
- messages?: import("@instructure/ui-form-field").FormMessage[] | undefined;
23
+ messages?: import("@instructure/ui-form-field/types/FormPropTypes").FormMessage[] | undefined;
24
24
  inline?: boolean | undefined;
25
25
  placeholder?: string | undefined;
26
26
  disabled?: boolean | undefined;
@@ -41,7 +41,7 @@ declare class TextArea extends Component<TextAreaProps> {
41
41
  width?: string | undefined;
42
42
  height?: string | undefined;
43
43
  maxHeight?: string | number | undefined;
44
- messages?: import("@instructure/ui-form-field").FormMessage[] | undefined;
44
+ messages?: import("@instructure/ui-form-field/types/FormPropTypes").FormMessage[] | undefined;
45
45
  inline?: boolean | undefined;
46
46
  placeholder?: string | undefined;
47
47
  disabled?: boolean | undefined;
@@ -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,EAA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aAAa,CAAC;IAC7C,MAAM,CAAC,QAAQ,CAAC,WAAW,cAAa;IAExC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;;MAYlB;IAED,SAAS,EAAE;QAAE,MAAM,IAAI,IAAI,CAAA;KAAE,GAAG,IAAI,CAAO;IAC3C,QAAQ,EAAE,yBAAyB,GAAG,SAAS,CAAA;;IAU/C,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,oBAAoB;IAuBpB,eAAe,qBAcd;IAED,QAAQ;IAyCR,IAAI,qBAoDH;IAED,KAAK;IAML,YAAY,uBAgBX;IAGD,kBAAkB,sBAGjB;IAED,IAAI,SAAS,QAGZ;IAED,IAAI,OAAO,wBAOV;IAED,IAAI,EAAE,QAGL;IAED,IAAI,OAAO,YAGV;IAED,IAAI,KAAK,QAGR;IAED,MAAM;CA4EP;AAED,eAAe,QAAQ,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,CAAA"}
package/LICENSE.md DELETED
@@ -1,27 +0,0 @@
1
- ---
2
- title: The MIT License (MIT)
3
- category: Getting Started
4
- order: 9
5
- ---
6
-
7
- # The MIT License (MIT)
8
-
9
- Copyright (c) 2015 Instructure, Inc.
10
-
11
- **Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions.**
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.