@dhis2-ui/text-area 10.16.3 → 10.16.4

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.
@@ -11,15 +11,14 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
  var _textAreaStyles = require("./text-area.styles.js");
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
16
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
19
18
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
19
  class TextArea extends _react.Component {
21
- constructor() {
22
- super(...arguments);
20
+ constructor(...args) {
21
+ super(...args);
23
22
  _defineProperty(this, "textareaRef", /*#__PURE__*/_react.default.createRef());
24
23
  _defineProperty(this, "state", {
25
24
  height: 'auto'
@@ -34,15 +34,9 @@ window.onBlur = (payload, event) => {
34
34
  console.log('onBlur payload', payload);
35
35
  console.log('onBlur event', event);
36
36
  };
37
- const onChange = function () {
38
- return window.onChange(...arguments);
39
- };
40
- const onFocus = function () {
41
- return window.onFocus(...arguments);
42
- };
43
- const onBlur = function () {
44
- return window.onBlur(...arguments);
45
- };
37
+ const onChange = (...args) => window.onChange(...args);
38
+ const onFocus = (...args) => window.onFocus(...args);
39
+ const onBlur = (...args) => window.onBlur(...args);
46
40
  var _default = exports.default = {
47
41
  title: 'Text Area',
48
42
  component: _index.TextArea,
@@ -11,72 +11,69 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
  var _react = _interopRequireDefault(require("react"));
12
12
  var _index = require("../text-area/index.js");
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- const TextAreaField = _ref => {
15
- let {
16
- className,
17
- onChange,
18
- onFocus,
19
- onKeyDown,
20
- onBlur,
21
- initialFocus,
22
- dense,
23
- required,
24
- label,
25
- disabled,
26
- placeholder,
27
- name,
28
- valid,
29
- error,
30
- warning,
31
- loading,
32
- value,
33
- tabIndex,
34
- helpText,
35
- validationText,
36
- autoGrow,
37
- readOnly,
38
- resize = 'vertical',
39
- rows = 4,
40
- inputWidth,
41
- dataTest = 'dhis2-uiwidgets-textareafield'
42
- } = _ref;
43
- return /*#__PURE__*/_react.default.createElement(_field.Field, {
44
- className: className,
45
- dataTest: dataTest,
46
- disabled: disabled,
47
- required: required,
48
- name: name,
49
- helpText: helpText,
50
- validationText: validationText,
51
- error: error,
52
- warning: warning,
53
- valid: valid,
54
- label: label
55
- }, /*#__PURE__*/_react.default.createElement(_box.Box, {
56
- width: inputWidth,
57
- minWidth: "220px"
58
- }, /*#__PURE__*/_react.default.createElement(_index.TextArea, {
59
- onFocus: onFocus,
60
- onKeyDown: onKeyDown,
61
- onBlur: onBlur,
62
- onChange: onChange,
63
- name: name,
64
- value: value || '',
65
- placeholder: placeholder,
66
- disabled: disabled,
67
- valid: valid,
68
- warning: warning,
69
- error: error,
70
- loading: loading,
71
- dense: dense,
72
- tabIndex: tabIndex,
73
- initialFocus: initialFocus,
74
- autoGrow: autoGrow,
75
- readOnly: readOnly,
76
- resize: resize,
77
- rows: rows
78
- })));
79
- };
14
+ const TextAreaField = ({
15
+ className,
16
+ onChange,
17
+ onFocus,
18
+ onKeyDown,
19
+ onBlur,
20
+ initialFocus,
21
+ dense,
22
+ required,
23
+ label,
24
+ disabled,
25
+ placeholder,
26
+ name,
27
+ valid,
28
+ error,
29
+ warning,
30
+ loading,
31
+ value,
32
+ tabIndex,
33
+ helpText,
34
+ validationText,
35
+ autoGrow,
36
+ readOnly,
37
+ resize = 'vertical',
38
+ rows = 4,
39
+ inputWidth,
40
+ dataTest = 'dhis2-uiwidgets-textareafield'
41
+ }) => /*#__PURE__*/_react.default.createElement(_field.Field, {
42
+ className: className,
43
+ dataTest: dataTest,
44
+ disabled: disabled,
45
+ required: required,
46
+ name: name,
47
+ helpText: helpText,
48
+ validationText: validationText,
49
+ error: error,
50
+ warning: warning,
51
+ valid: valid,
52
+ label: label
53
+ }, /*#__PURE__*/_react.default.createElement(_box.Box, {
54
+ width: inputWidth,
55
+ minWidth: "220px"
56
+ }, /*#__PURE__*/_react.default.createElement(_index.TextArea, {
57
+ onFocus: onFocus,
58
+ onKeyDown: onKeyDown,
59
+ onBlur: onBlur,
60
+ onChange: onChange,
61
+ name: name,
62
+ value: value || '',
63
+ placeholder: placeholder,
64
+ disabled: disabled,
65
+ valid: valid,
66
+ warning: warning,
67
+ error: error,
68
+ loading: loading,
69
+ dense: dense,
70
+ tabIndex: tabIndex,
71
+ initialFocus: initialFocus,
72
+ autoGrow: autoGrow,
73
+ readOnly: readOnly,
74
+ resize: resize,
75
+ rows: rows
76
+ })));
80
77
  exports.TextAreaField = TextAreaField;
81
78
  TextAreaField.propTypes = {
82
79
  /** Grow the text area in response to overflow instead of adding a scroll bar */
@@ -9,8 +9,8 @@ import PropTypes from 'prop-types';
9
9
  import React, { Component } from 'react';
10
10
  import { styles } from './text-area.styles.js';
11
11
  export class TextArea extends Component {
12
- constructor() {
13
- super(...arguments);
12
+ constructor(...args) {
13
+ super(...args);
14
14
  _defineProperty(this, "textareaRef", /*#__PURE__*/React.createRef());
15
15
  _defineProperty(this, "state", {
16
16
  height: 'auto'
@@ -27,15 +27,9 @@ window.onBlur = (payload, event) => {
27
27
  console.log('onBlur payload', payload);
28
28
  console.log('onBlur event', event);
29
29
  };
30
- const onChange = function () {
31
- return window.onChange(...arguments);
32
- };
33
- const onFocus = function () {
34
- return window.onFocus(...arguments);
35
- };
36
- const onBlur = function () {
37
- return window.onBlur(...arguments);
38
- };
30
+ const onChange = (...args) => window.onChange(...args);
31
+ const onFocus = (...args) => window.onFocus(...args);
32
+ const onBlur = (...args) => window.onBlur(...args);
39
33
  export default {
40
34
  title: 'Text Area',
41
35
  component: TextArea,
@@ -4,72 +4,69 @@ import { Field } from '@dhis2-ui/field';
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
6
  import { TextArea } from '../text-area/index.js';
7
- const TextAreaField = _ref => {
8
- let {
9
- className,
10
- onChange,
11
- onFocus,
12
- onKeyDown,
13
- onBlur,
14
- initialFocus,
15
- dense,
16
- required,
17
- label,
18
- disabled,
19
- placeholder,
20
- name,
21
- valid,
22
- error,
23
- warning,
24
- loading,
25
- value,
26
- tabIndex,
27
- helpText,
28
- validationText,
29
- autoGrow,
30
- readOnly,
31
- resize = 'vertical',
32
- rows = 4,
33
- inputWidth,
34
- dataTest = 'dhis2-uiwidgets-textareafield'
35
- } = _ref;
36
- return /*#__PURE__*/React.createElement(Field, {
37
- className: className,
38
- dataTest: dataTest,
39
- disabled: disabled,
40
- required: required,
41
- name: name,
42
- helpText: helpText,
43
- validationText: validationText,
44
- error: error,
45
- warning: warning,
46
- valid: valid,
47
- label: label
48
- }, /*#__PURE__*/React.createElement(Box, {
49
- width: inputWidth,
50
- minWidth: "220px"
51
- }, /*#__PURE__*/React.createElement(TextArea, {
52
- onFocus: onFocus,
53
- onKeyDown: onKeyDown,
54
- onBlur: onBlur,
55
- onChange: onChange,
56
- name: name,
57
- value: value || '',
58
- placeholder: placeholder,
59
- disabled: disabled,
60
- valid: valid,
61
- warning: warning,
62
- error: error,
63
- loading: loading,
64
- dense: dense,
65
- tabIndex: tabIndex,
66
- initialFocus: initialFocus,
67
- autoGrow: autoGrow,
68
- readOnly: readOnly,
69
- resize: resize,
70
- rows: rows
71
- })));
72
- };
7
+ const TextAreaField = ({
8
+ className,
9
+ onChange,
10
+ onFocus,
11
+ onKeyDown,
12
+ onBlur,
13
+ initialFocus,
14
+ dense,
15
+ required,
16
+ label,
17
+ disabled,
18
+ placeholder,
19
+ name,
20
+ valid,
21
+ error,
22
+ warning,
23
+ loading,
24
+ value,
25
+ tabIndex,
26
+ helpText,
27
+ validationText,
28
+ autoGrow,
29
+ readOnly,
30
+ resize = 'vertical',
31
+ rows = 4,
32
+ inputWidth,
33
+ dataTest = 'dhis2-uiwidgets-textareafield'
34
+ }) => /*#__PURE__*/React.createElement(Field, {
35
+ className: className,
36
+ dataTest: dataTest,
37
+ disabled: disabled,
38
+ required: required,
39
+ name: name,
40
+ helpText: helpText,
41
+ validationText: validationText,
42
+ error: error,
43
+ warning: warning,
44
+ valid: valid,
45
+ label: label
46
+ }, /*#__PURE__*/React.createElement(Box, {
47
+ width: inputWidth,
48
+ minWidth: "220px"
49
+ }, /*#__PURE__*/React.createElement(TextArea, {
50
+ onFocus: onFocus,
51
+ onKeyDown: onKeyDown,
52
+ onBlur: onBlur,
53
+ onChange: onChange,
54
+ name: name,
55
+ value: value || '',
56
+ placeholder: placeholder,
57
+ disabled: disabled,
58
+ valid: valid,
59
+ warning: warning,
60
+ error: error,
61
+ loading: loading,
62
+ dense: dense,
63
+ tabIndex: tabIndex,
64
+ initialFocus: initialFocus,
65
+ autoGrow: autoGrow,
66
+ readOnly: readOnly,
67
+ resize: resize,
68
+ rows: rows
69
+ })));
73
70
  TextAreaField.propTypes = {
74
71
  /** Grow the text area in response to overflow instead of adding a scroll bar */
75
72
  autoGrow: PropTypes.bool,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/text-area",
3
- "version": "10.16.3",
3
+ "version": "10.16.4",
4
4
  "description": "UI TextArea",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,12 +33,12 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@dhis2/prop-types": "^3.1.2",
36
- "@dhis2-ui/box": "10.16.3",
37
- "@dhis2-ui/field": "10.16.3",
38
- "@dhis2-ui/loader": "10.16.3",
39
- "@dhis2-ui/status-icon": "10.16.3",
40
- "@dhis2/ui-constants": "10.16.3",
41
- "@dhis2/ui-icons": "10.16.3",
36
+ "@dhis2-ui/box": "10.16.4",
37
+ "@dhis2-ui/field": "10.16.4",
38
+ "@dhis2-ui/loader": "10.16.4",
39
+ "@dhis2-ui/status-icon": "10.16.4",
40
+ "@dhis2/ui-constants": "10.16.4",
41
+ "@dhis2/ui-icons": "10.16.4",
42
42
  "classnames": "^2.3.1",
43
43
  "prop-types": "^15.7.2"
44
44
  },