@dhis2-ui/text-area 7.13.0 → 7.14.3
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.
|
@@ -7,12 +7,10 @@ exports.TextArea = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _statusIcon = require("@dhis2-ui/status-icon");
|
|
11
11
|
|
|
12
12
|
var _uiConstants = require("@dhis2/ui-constants");
|
|
13
13
|
|
|
14
|
-
var _uiIcons = require("@dhis2/ui-icons");
|
|
15
|
-
|
|
16
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
15
|
|
|
18
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -29,54 +27,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
29
27
|
|
|
30
28
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
29
|
|
|
32
|
-
const StatusIcon = ({
|
|
33
|
-
error,
|
|
34
|
-
warning,
|
|
35
|
-
valid,
|
|
36
|
-
loading,
|
|
37
|
-
className,
|
|
38
|
-
defaultTo
|
|
39
|
-
}) => {
|
|
40
|
-
if (error) {
|
|
41
|
-
return /*#__PURE__*/_react.default.createElement(_uiIcons.IconErrorFilled24, {
|
|
42
|
-
color: _uiConstants.theme.error
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (warning) {
|
|
47
|
-
return /*#__PURE__*/_react.default.createElement(_uiIcons.IconWarningFilled24, {
|
|
48
|
-
color: _uiConstants.theme.warning
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (valid) {
|
|
53
|
-
return /*#__PURE__*/_react.default.createElement(_uiIcons.IconCheckmark24, {
|
|
54
|
-
color: _uiConstants.theme.valid
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (loading) {
|
|
59
|
-
return /*#__PURE__*/_react.default.createElement(_loader.CircularLoader, {
|
|
60
|
-
small: true,
|
|
61
|
-
className: className
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return defaultTo;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
StatusIcon.defaultProps = {
|
|
69
|
-
defaultTo: null
|
|
70
|
-
};
|
|
71
|
-
StatusIcon.propTypes = {
|
|
72
|
-
className: _propTypes.default.string,
|
|
73
|
-
defaultTo: _propTypes.default.element,
|
|
74
|
-
error: _propTypes.default.bool,
|
|
75
|
-
loading: _propTypes.default.bool,
|
|
76
|
-
valid: _propTypes.default.bool,
|
|
77
|
-
warning: _propTypes.default.bool
|
|
78
|
-
};
|
|
79
|
-
|
|
80
30
|
class TextArea extends _react.Component {
|
|
81
31
|
constructor(...args) {
|
|
82
32
|
super(...args);
|
|
@@ -235,14 +185,12 @@ class TextArea extends _react.Component {
|
|
|
235
185
|
warning,
|
|
236
186
|
'read-only': readOnly
|
|
237
187
|
}) || "")
|
|
238
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
239
|
-
className: `jsx-${_textAreaStyles.styles.__hash}` + " " + _style.default.dynamic([["3036048772", [width, height, resize]]]) + " " + "status-icon"
|
|
240
|
-
}, /*#__PURE__*/_react.default.createElement(StatusIcon, {
|
|
188
|
+
}), /*#__PURE__*/_react.default.createElement(_statusIcon.StatusIcon, {
|
|
241
189
|
error: error,
|
|
242
190
|
valid: valid,
|
|
243
191
|
loading: loading,
|
|
244
192
|
warning: warning
|
|
245
|
-
})
|
|
193
|
+
}), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
246
194
|
id: _textAreaStyles.styles.__hash
|
|
247
195
|
}, _textAreaStyles.styles), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
248
196
|
id: "3036048772",
|
|
@@ -7,6 +7,6 @@ exports.styles = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _uiConstants = require("@dhis2/ui-constants");
|
|
9
9
|
|
|
10
|
-
const styles = [
|
|
10
|
+
const styles = [`.textarea.jsx-1940988187{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:${_uiConstants.spacers.dp8};}`, `textarea.jsx-1940988187{box-sizing:border-box;padding:8px 12px;color:${_uiConstants.colors.grey900};background-color:white;border:1px solid ${_uiConstants.colors.grey500};border-radius:3px;box-shadow:inset 0 0 0 1px rgba(102,113,123,0.15), inset 0 1px 2px 0 rgba(102,113,123,0.1);outline:0;font-size:14px;line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}`, "textarea.dense.jsx-1940988187{padding:4px 12px;}", `textarea.jsx-1940988187:focus{outline:none;box-shadow:inset 0 0 0 2px ${_uiConstants.theme.focus};border-color:${_uiConstants.theme.focus};}`, `textarea.valid.jsx-1940988187{border-color:${_uiConstants.theme.valid};}`, `textarea.warning.jsx-1940988187{border-color:${_uiConstants.theme.warning};}`, `textarea.error.jsx-1940988187{border-color:${_uiConstants.theme.error};}`, `textarea.read-only.jsx-1940988187{background-color:${_uiConstants.colors.grey100};border-color:${_uiConstants.colors.grey500};cursor:text;}`, `textarea.disabled.jsx-1940988187{background-color:${_uiConstants.colors.grey100};border-color:${_uiConstants.colors.grey500};color:${_uiConstants.theme.disabled};cursor:not-allowed;}`];
|
|
11
11
|
exports.styles = styles;
|
|
12
|
-
styles.__hash = "
|
|
12
|
+
styles.__hash = "1940988187";
|
|
@@ -2,61 +2,12 @@ import _JSXStyle from "styled-jsx/style";
|
|
|
2
2
|
|
|
3
3
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { IconErrorFilled24, IconWarningFilled24, IconCheckmark24 } from '@dhis2/ui-icons';
|
|
5
|
+
import { StatusIcon } from '@dhis2-ui/status-icon';
|
|
6
|
+
import { sharedPropTypes } from '@dhis2/ui-constants';
|
|
8
7
|
import cx from 'classnames';
|
|
9
8
|
import PropTypes from 'prop-types';
|
|
10
9
|
import React, { Component } from 'react';
|
|
11
10
|
import { styles } from './text-area.styles.js';
|
|
12
|
-
|
|
13
|
-
const StatusIcon = ({
|
|
14
|
-
error,
|
|
15
|
-
warning,
|
|
16
|
-
valid,
|
|
17
|
-
loading,
|
|
18
|
-
className,
|
|
19
|
-
defaultTo
|
|
20
|
-
}) => {
|
|
21
|
-
if (error) {
|
|
22
|
-
return /*#__PURE__*/React.createElement(IconErrorFilled24, {
|
|
23
|
-
color: theme.error
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (warning) {
|
|
28
|
-
return /*#__PURE__*/React.createElement(IconWarningFilled24, {
|
|
29
|
-
color: theme.warning
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (valid) {
|
|
34
|
-
return /*#__PURE__*/React.createElement(IconCheckmark24, {
|
|
35
|
-
color: theme.valid
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (loading) {
|
|
40
|
-
return /*#__PURE__*/React.createElement(CircularLoader, {
|
|
41
|
-
small: true,
|
|
42
|
-
className: className
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return defaultTo;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
StatusIcon.defaultProps = {
|
|
50
|
-
defaultTo: null
|
|
51
|
-
};
|
|
52
|
-
StatusIcon.propTypes = {
|
|
53
|
-
className: PropTypes.string,
|
|
54
|
-
defaultTo: PropTypes.element,
|
|
55
|
-
error: PropTypes.bool,
|
|
56
|
-
loading: PropTypes.bool,
|
|
57
|
-
valid: PropTypes.bool,
|
|
58
|
-
warning: PropTypes.bool
|
|
59
|
-
};
|
|
60
11
|
export class TextArea extends Component {
|
|
61
12
|
constructor(...args) {
|
|
62
13
|
super(...args);
|
|
@@ -215,14 +166,12 @@ export class TextArea extends Component {
|
|
|
215
166
|
warning,
|
|
216
167
|
'read-only': readOnly
|
|
217
168
|
}) || "")
|
|
218
|
-
}), /*#__PURE__*/React.createElement(
|
|
219
|
-
className: `jsx-${styles.__hash}` + " " + _JSXStyle.dynamic([["3036048772", [width, height, resize]]]) + " " + "status-icon"
|
|
220
|
-
}, /*#__PURE__*/React.createElement(StatusIcon, {
|
|
169
|
+
}), /*#__PURE__*/React.createElement(StatusIcon, {
|
|
221
170
|
error: error,
|
|
222
171
|
valid: valid,
|
|
223
172
|
loading: loading,
|
|
224
173
|
warning: warning
|
|
225
|
-
})
|
|
174
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
226
175
|
id: styles.__hash
|
|
227
176
|
}, styles), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
228
177
|
id: "3036048772",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { colors, theme, spacers } from '@dhis2/ui-constants';
|
|
2
|
-
export const styles = [
|
|
3
|
-
styles.__hash = "
|
|
2
|
+
export const styles = [`.textarea.jsx-1940988187{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:${spacers.dp8};}`, `textarea.jsx-1940988187{box-sizing:border-box;padding:8px 12px;color:${colors.grey900};background-color:white;border:1px solid ${colors.grey500};border-radius:3px;box-shadow:inset 0 0 0 1px rgba(102,113,123,0.15), inset 0 1px 2px 0 rgba(102,113,123,0.1);outline:0;font-size:14px;line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}`, "textarea.dense.jsx-1940988187{padding:4px 12px;}", `textarea.jsx-1940988187:focus{outline:none;box-shadow:inset 0 0 0 2px ${theme.focus};border-color:${theme.focus};}`, `textarea.valid.jsx-1940988187{border-color:${theme.valid};}`, `textarea.warning.jsx-1940988187{border-color:${theme.warning};}`, `textarea.error.jsx-1940988187{border-color:${theme.error};}`, `textarea.read-only.jsx-1940988187{background-color:${colors.grey100};border-color:${colors.grey500};cursor:text;}`, `textarea.disabled.jsx-1940988187{background-color:${colors.grey100};border-color:${colors.grey500};color:${theme.disabled};cursor:not-allowed;}`];
|
|
3
|
+
styles.__hash = "1940988187";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/text-area",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.14.3",
|
|
4
4
|
"description": "UI TextArea",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,11 +32,12 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@dhis2/prop-types": "^3.0.0-beta.1",
|
|
35
|
-
"@dhis2-ui/box": "7.
|
|
36
|
-
"@dhis2-ui/field": "7.
|
|
37
|
-
"@dhis2-ui/loader": "7.
|
|
38
|
-
"@dhis2/
|
|
39
|
-
"@dhis2/ui-
|
|
35
|
+
"@dhis2-ui/box": "7.14.3",
|
|
36
|
+
"@dhis2-ui/field": "7.14.3",
|
|
37
|
+
"@dhis2-ui/loader": "7.14.3",
|
|
38
|
+
"@dhis2-ui/status-icon": "7.14.3",
|
|
39
|
+
"@dhis2/ui-constants": "7.14.3",
|
|
40
|
+
"@dhis2/ui-icons": "7.14.3",
|
|
40
41
|
"classnames": "^2.3.1",
|
|
41
42
|
"prop-types": "^15.7.2"
|
|
42
43
|
},
|