@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.
- package/build/cjs/text-area/text-area.js +3 -4
- package/build/cjs/text-area/text-area.prod.stories.js +3 -9
- package/build/cjs/text-area-field/text-area-field.js +63 -66
- package/build/es/text-area/text-area.js +2 -2
- package/build/es/text-area/text-area.prod.stories.js +3 -9
- package/build/es/text-area-field/text-area-field.js +63 -66
- package/package.json +7 -7
|
@@ -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
|
|
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(...
|
|
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 =
|
|
38
|
-
|
|
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 =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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(...
|
|
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 =
|
|
31
|
-
|
|
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 =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
+
"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.
|
|
37
|
-
"@dhis2-ui/field": "10.16.
|
|
38
|
-
"@dhis2-ui/loader": "10.16.
|
|
39
|
-
"@dhis2-ui/status-icon": "10.16.
|
|
40
|
-
"@dhis2/ui-constants": "10.16.
|
|
41
|
-
"@dhis2/ui-icons": "10.16.
|
|
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
|
},
|