@dhis2-ui/file-input 8.2.0 → 8.2.1
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/file-input/file-input.js +3 -3
- package/build/cjs/file-input/file-input.stories.js +4 -10
- package/build/cjs/file-input-field/file-input-field.js +57 -54
- package/build/cjs/file-input-field/file-input-field.stories.js +3 -9
- package/build/cjs/file-input-field-with-list/file-input-field-with-list.js +10 -8
- package/build/cjs/file-input-field-with-list/file-input-field-with-list.stories.js +8 -13
- package/build/cjs/file-input-field-with-list/file-list-item-with-remove.js +2 -2
- package/build/cjs/file-list/file-list-item.js +37 -34
- package/build/cjs/file-list/file-list-placeholder.js +13 -10
- package/build/cjs/file-list/file-list.js +13 -10
- package/build/cjs/index.js +10 -10
- package/build/es/file-input/file-input.js +3 -3
- package/build/es/file-input/file-input.stories.js +3 -9
- package/build/es/file-input-field/file-input-field.js +57 -54
- package/build/es/file-input-field/file-input-field.stories.js +2 -8
- package/build/es/file-input-field-with-list/file-input-field-with-list.js +10 -8
- package/build/es/file-input-field-with-list/file-input-field-with-list.stories.js +7 -12
- package/build/es/file-input-field-with-list/file-list-item-with-remove.js +2 -2
- package/build/es/file-list/file-list-item.js +37 -34
- package/build/es/file-list/file-list-placeholder.js +13 -10
- package/build/es/file-list/file-list.js +13 -10
- package/package.json +8 -8
|
@@ -30,8 +30,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
30
30
|
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
31
|
|
|
32
32
|
class FileInput extends _react.Component {
|
|
33
|
-
constructor(
|
|
34
|
-
super(...
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
35
|
|
|
36
36
|
_defineProperty(this, "ref", /*#__PURE__*/(0, _react.createRef)());
|
|
37
37
|
|
|
@@ -121,7 +121,7 @@ class FileInput extends _react.Component {
|
|
|
121
121
|
}), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
122
122
|
id: "1746996489",
|
|
123
123
|
dynamic: [_uiConstants.spacers.dp8, _uiConstants.spacers.dp4]
|
|
124
|
-
}, ["input.__jsx-style-dynamic-selector{display:none;}",
|
|
124
|
+
}, ["input.__jsx-style-dynamic-selector{display:none;}", ".file-input.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:".concat(_uiConstants.spacers.dp8, ";padding-bottom:").concat(_uiConstants.spacers.dp4, ";}")]));
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = exports.Statuses = exports.Sizes = exports.Multiple = exports.Disabled = exports.Default = void 0;
|
|
7
7
|
|
|
8
8
|
var _uiConstants = require("@dhis2/ui-constants");
|
|
9
9
|
|
|
@@ -15,14 +15,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
15
|
|
|
16
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
17
|
|
|
18
|
-
const subtitle =
|
|
19
|
-
const description =
|
|
20
|
-
Use a file input component in forms and interfaces wherever a user needs to be able to select and upload a file from their local machine.
|
|
21
|
-
|
|
22
|
-
\`\`\`js
|
|
23
|
-
import { FileInput } from '@dhis2/ui'
|
|
24
|
-
\`\`\`
|
|
25
|
-
`;
|
|
18
|
+
const subtitle = "The file input component allows users to select and upload files from their local machine.";
|
|
19
|
+
const description = "\nUse a file input component in forms and interfaces wherever a user needs to be able to select and upload a file from their local machine.\n\n```js\nimport { FileInput } from '@dhis2/ui'\n```\n";
|
|
26
20
|
|
|
27
21
|
const onChange = (payload, event) => {
|
|
28
22
|
console.log('onChange payload', payload);
|
|
@@ -39,7 +33,7 @@ const {
|
|
|
39
33
|
statusArgType
|
|
40
34
|
} = _uiConstants.sharedPropTypes;
|
|
41
35
|
var _default = {
|
|
42
|
-
title: '
|
|
36
|
+
title: 'File Input',
|
|
43
37
|
component: _index.FileInput,
|
|
44
38
|
// Default args for each story unless overridden
|
|
45
39
|
args: {
|
|
@@ -30,60 +30,63 @@ const translate = (prop, interpolationObject) => {
|
|
|
30
30
|
return prop;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const FileInputField =
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
33
|
+
const FileInputField = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
accept,
|
|
36
|
+
buttonLabel,
|
|
37
|
+
children,
|
|
38
|
+
className,
|
|
39
|
+
dataTest,
|
|
40
|
+
disabled,
|
|
41
|
+
error,
|
|
42
|
+
helpText,
|
|
43
|
+
initialFocus,
|
|
44
|
+
label,
|
|
45
|
+
large,
|
|
46
|
+
multiple,
|
|
47
|
+
name,
|
|
48
|
+
onBlur,
|
|
49
|
+
onChange,
|
|
50
|
+
onFocus,
|
|
51
|
+
placeholder,
|
|
52
|
+
required,
|
|
53
|
+
small,
|
|
54
|
+
tabIndex,
|
|
55
|
+
valid,
|
|
56
|
+
validationText,
|
|
57
|
+
warning
|
|
58
|
+
} = _ref;
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement(_field.Field, {
|
|
60
|
+
className: className,
|
|
61
|
+
dataTest: dataTest,
|
|
62
|
+
helpText: helpText,
|
|
63
|
+
validationText: validationText,
|
|
64
|
+
error: error,
|
|
65
|
+
warning: warning,
|
|
66
|
+
valid: valid
|
|
67
|
+
}, label && /*#__PURE__*/_react.default.createElement(_label.Label, {
|
|
68
|
+
required: required,
|
|
69
|
+
disabled: disabled,
|
|
70
|
+
htmlFor: name
|
|
71
|
+
}, label), /*#__PURE__*/_react.default.createElement(_index.FileInput, {
|
|
72
|
+
accept: accept,
|
|
73
|
+
buttonLabel: translate(buttonLabel),
|
|
74
|
+
className: className,
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
error: error,
|
|
77
|
+
initialFocus: initialFocus,
|
|
78
|
+
large: large,
|
|
79
|
+
multiple: multiple,
|
|
80
|
+
name: name,
|
|
81
|
+
onBlur: onBlur,
|
|
82
|
+
onChange: onChange,
|
|
83
|
+
onFocus: onFocus,
|
|
84
|
+
small: small,
|
|
85
|
+
tabIndex: tabIndex,
|
|
86
|
+
valid: valid,
|
|
87
|
+
warning: warning
|
|
88
|
+
}), /*#__PURE__*/_react.default.createElement(_index.FileList, null, children ? children : /*#__PURE__*/_react.default.createElement(_index.FileListPlaceholder, null, translate(placeholder))));
|
|
89
|
+
};
|
|
87
90
|
|
|
88
91
|
exports.FileInputField = FileInputField;
|
|
89
92
|
FileInputField.defaultProps = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = exports.WithLabel = exports.Statuses = exports.Sizes = exports.Required = exports.PlaceholderText = exports.Multiple = exports.HelpText = exports.FileList = exports.Disabled = exports.DesignSystemStackingOrderEmptyFileList = exports.DesignSystemStackingOrder = exports.DefaultButtonLabelAndPlaceholder = exports.Default = void 0;
|
|
7
7
|
|
|
8
8
|
var _uiConstants = require("@dhis2/ui-constants");
|
|
9
9
|
|
|
@@ -17,13 +17,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
17
17
|
|
|
18
18
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
19
|
|
|
20
|
-
const description = `
|
|
21
|
-
The \`FileInputField\` component wraps the \`FileInput\` component in a \`Field\` wrapper to add labels, help text, and validation text.
|
|
22
|
-
|
|
23
|
-
\`\`\`js
|
|
24
|
-
import { FileInputField, FileListItem } from '@dhis2/ui'
|
|
25
|
-
\`\`\`
|
|
26
|
-
`;
|
|
20
|
+
const description = "\nThe `FileInputField` component wraps the `FileInput` component in a `Field` wrapper to add labels, help text, and validation text.\n\n```js\nimport { FileInputField, FileListItem } from '@dhis2/ui'\n```\n";
|
|
27
21
|
|
|
28
22
|
const onChange = obj => console.log('onChange', obj);
|
|
29
23
|
|
|
@@ -32,7 +26,7 @@ const onRemove = () => console.log('onRemove');
|
|
|
32
26
|
const onCancel = () => console.log('onCancel');
|
|
33
27
|
|
|
34
28
|
var _default = {
|
|
35
|
-
title: '
|
|
29
|
+
title: 'File Input Field',
|
|
36
30
|
component: _fileInputField.FileInputField,
|
|
37
31
|
parameters: {
|
|
38
32
|
docs: {
|
|
@@ -35,12 +35,13 @@ const translate = (prop, interpolationObject) => {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
class FileInputFieldWithList extends _react.Component {
|
|
38
|
-
constructor(
|
|
39
|
-
super(...
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
40
|
|
|
41
|
-
_defineProperty(this, "handleChange", ({
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
_defineProperty(this, "handleChange", (_ref, event) => {
|
|
42
|
+
let {
|
|
43
|
+
files: fileList
|
|
44
|
+
} = _ref;
|
|
44
45
|
const {
|
|
45
46
|
onChange,
|
|
46
47
|
name
|
|
@@ -51,9 +52,10 @@ class FileInputFieldWithList extends _react.Component {
|
|
|
51
52
|
}, event);
|
|
52
53
|
});
|
|
53
54
|
|
|
54
|
-
_defineProperty(this, "handleRemove", ({
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
_defineProperty(this, "handleRemove", (_ref2, event) => {
|
|
56
|
+
let {
|
|
57
|
+
file: fileToRemove
|
|
58
|
+
} = _ref2;
|
|
57
59
|
const {
|
|
58
60
|
files,
|
|
59
61
|
onChange,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = exports.DefaultPlaceholder = exports.DefaultButtonLabelAndRemoveText = exports.Default = void 0;
|
|
7
7
|
|
|
8
8
|
var _uiConstants = require("@dhis2/ui-constants");
|
|
9
9
|
|
|
@@ -13,23 +13,18 @@ var _fileInputFieldWithList = require("./file-input-field-with-list.js");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
const description = `
|
|
17
|
-
|
|
16
|
+
const description = "\nA FileInputField with logic for creating a dynamic list of removable files from an array of `File` objects.\n\n```js\nimport { FileInputFieldWithList } from '@dhis2/ui'\n```\n";
|
|
17
|
+
const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], "".concat(name, "-").concat(i + 1, ".txt")));
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], `${name}-${i + 1}.txt`));
|
|
24
|
-
|
|
25
|
-
const onChange = ({
|
|
26
|
-
files
|
|
27
|
-
}) => {
|
|
19
|
+
const onChange = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
files
|
|
22
|
+
} = _ref;
|
|
28
23
|
console.log('files: ', files);
|
|
29
24
|
};
|
|
30
25
|
|
|
31
26
|
var _default = {
|
|
32
|
-
title: '
|
|
27
|
+
title: 'File Input Field With List',
|
|
33
28
|
component: _fileInputFieldWithList.FileInputFieldWithList,
|
|
34
29
|
parameters: {
|
|
35
30
|
docs: {
|
|
@@ -20,8 +20,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
22
|
class FileListItemWithRemove extends _react.Component {
|
|
23
|
-
constructor(
|
|
24
|
-
super(...
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
25
|
|
|
26
26
|
_defineProperty(this, "handleRemove", event => {
|
|
27
27
|
const {
|
|
@@ -21,40 +21,43 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
const FileListItem =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
const FileListItem = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
className,
|
|
27
|
+
label,
|
|
28
|
+
onRemove,
|
|
29
|
+
removeText,
|
|
30
|
+
loading,
|
|
31
|
+
onCancel,
|
|
32
|
+
cancelText,
|
|
33
|
+
dataTest
|
|
34
|
+
} = _ref;
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement("p", {
|
|
36
|
+
"data-test": dataTest,
|
|
37
|
+
className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + ((0, _classnames.default)('selected-file', className) || "")
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
39
|
+
className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "icon"
|
|
40
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_loader.CircularLoader, {
|
|
41
|
+
extrasmall: true
|
|
42
|
+
}) : /*#__PURE__*/_react.default.createElement(_uiIcons.IconAttachment16, {
|
|
43
|
+
color: _uiConstants.colors.grey700
|
|
44
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
45
|
+
className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "text"
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
47
|
+
className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "label"
|
|
48
|
+
}, label), loading && onCancel && cancelText && /*#__PURE__*/_react.default.createElement("span", {
|
|
49
|
+
onClick: event => onCancel({}, event),
|
|
50
|
+
"data-test": "".concat(dataTest, "-cancel"),
|
|
51
|
+
className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "action"
|
|
52
|
+
}, cancelText), !loading && /*#__PURE__*/_react.default.createElement("span", {
|
|
53
|
+
onClick: event => onRemove({}, event),
|
|
54
|
+
"data-test": "".concat(dataTest, "-remove"),
|
|
55
|
+
className: _style.default.dynamic([["3793849083", [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]]]) + " " + "action"
|
|
56
|
+
}, removeText)), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
57
|
+
id: "3793849083",
|
|
58
|
+
dynamic: [_uiConstants.spacers.dp4, _uiConstants.colors.grey900, _uiConstants.colors.grey700, _uiConstants.colors.red700, _uiConstants.colors.red800, _uiConstants.theme.focus]
|
|
59
|
+
}, ["p.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding-top:".concat(_uiConstants.spacers.dp4, ";}"), ".icon.__jsx-style-dynamic-selector{margin-right:4px;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-top:1px;}", ".text.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".label.__jsx-style-dynamic-selector{font-size:14px;color:".concat(_uiConstants.colors.grey900, ";word-break:break-all;}"), ".label.__jsx-style-dynamic-selector::after{content:' ';display:inline-block;width:12px;}", ".action.__jsx-style-dynamic-selector{font-size:12px;line-height:12px;margin-top:0;-webkit-text-decoration:underline;text-decoration:underline;cursor:pointer;color:".concat(_uiConstants.colors.grey700, ";}"), ".action.__jsx-style-dynamic-selector:hover{color:".concat(_uiConstants.colors.red700, ";}"), ".action.__jsx-style-dynamic-selector:active{color:".concat(_uiConstants.colors.red800, ";}"), ".action.__jsx-style-dynamic-selector:focus{outline:3px solid ".concat(_uiConstants.theme.focus, ";outline-offset:2px;}")]));
|
|
60
|
+
};
|
|
58
61
|
|
|
59
62
|
exports.FileListItem = FileListItem;
|
|
60
63
|
FileListItem.defaultProps = {
|
|
@@ -15,16 +15,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
const FileListPlaceholder =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const FileListPlaceholder = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
children,
|
|
21
|
+
dataTest
|
|
22
|
+
} = _ref;
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement("p", {
|
|
24
|
+
"data-test": dataTest,
|
|
25
|
+
className: _style.default.dynamic([["1287857385", [_uiConstants.spacers.dp4, _uiConstants.colors.grey700]]])
|
|
26
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
27
|
+
id: "1287857385",
|
|
28
|
+
dynamic: [_uiConstants.spacers.dp4, _uiConstants.colors.grey700]
|
|
29
|
+
}, ["p.__jsx-style-dynamic-selector{margin:0;padding-top:".concat(_uiConstants.spacers.dp4, ";font-size:14px;color:").concat(_uiConstants.colors.grey700, ";}")]));
|
|
30
|
+
};
|
|
28
31
|
|
|
29
32
|
exports.FileListPlaceholder = FileListPlaceholder;
|
|
30
33
|
FileListPlaceholder.defaultProps = {
|
|
@@ -13,16 +13,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
const FileList =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
16
|
+
const FileList = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
className,
|
|
20
|
+
dataTest
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
|
+
"data-test": dataTest,
|
|
24
|
+
className: "jsx-2770071620" + " " + (className || "")
|
|
25
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
26
|
+
id: "2770071620"
|
|
27
|
+
}, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
|
|
28
|
+
};
|
|
26
29
|
|
|
27
30
|
exports.FileList = FileList;
|
|
28
31
|
FileList.defaultProps = {
|
package/build/cjs/index.js
CHANGED
|
@@ -9,34 +9,34 @@ Object.defineProperty(exports, "FileInput", {
|
|
|
9
9
|
return _index.FileInput;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "FileInputField", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _index3.FileInputField;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "FileInputFieldWithList", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _index4.FileInputFieldWithList;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "FileList", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function () {
|
|
27
|
-
return _index2.
|
|
27
|
+
return _index2.FileList;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "FileListItem", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function () {
|
|
33
|
-
return
|
|
33
|
+
return _index2.FileListItem;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "FileListPlaceholder", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function () {
|
|
39
|
-
return
|
|
39
|
+
return _index2.FileListPlaceholder;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -11,8 +11,8 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import React, { createRef, Component } from 'react';
|
|
12
12
|
|
|
13
13
|
class FileInput extends Component {
|
|
14
|
-
constructor(
|
|
15
|
-
super(...
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
16
|
|
|
17
17
|
_defineProperty(this, "ref", /*#__PURE__*/createRef());
|
|
18
18
|
|
|
@@ -102,7 +102,7 @@ class FileInput extends Component {
|
|
|
102
102
|
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
103
103
|
id: "1746996489",
|
|
104
104
|
dynamic: [spacers.dp8, spacers.dp4]
|
|
105
|
-
}, ["input.__jsx-style-dynamic-selector{display:none;}",
|
|
105
|
+
}, ["input.__jsx-style-dynamic-selector{display:none;}", ".file-input.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:".concat(spacers.dp8, ";padding-bottom:").concat(spacers.dp4, ";}")]));
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
}
|
|
@@ -3,14 +3,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import { sharedPropTypes } from '@dhis2/ui-constants';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { FileInput } from './index.js';
|
|
6
|
-
const subtitle =
|
|
7
|
-
const description =
|
|
8
|
-
Use a file input component in forms and interfaces wherever a user needs to be able to select and upload a file from their local machine.
|
|
9
|
-
|
|
10
|
-
\`\`\`js
|
|
11
|
-
import { FileInput } from '@dhis2/ui'
|
|
12
|
-
\`\`\`
|
|
13
|
-
`;
|
|
6
|
+
const subtitle = "The file input component allows users to select and upload files from their local machine.";
|
|
7
|
+
const description = "\nUse a file input component in forms and interfaces wherever a user needs to be able to select and upload a file from their local machine.\n\n```js\nimport { FileInput } from '@dhis2/ui'\n```\n";
|
|
14
8
|
|
|
15
9
|
const onChange = (payload, event) => {
|
|
16
10
|
console.log('onChange payload', payload);
|
|
@@ -27,7 +21,7 @@ const {
|
|
|
27
21
|
statusArgType
|
|
28
22
|
} = sharedPropTypes;
|
|
29
23
|
export default {
|
|
30
|
-
title: '
|
|
24
|
+
title: 'File Input',
|
|
31
25
|
component: FileInput,
|
|
32
26
|
// Default args for each story unless overridden
|
|
33
27
|
args: {
|
|
@@ -14,60 +14,63 @@ const translate = (prop, interpolationObject) => {
|
|
|
14
14
|
return prop;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
const FileInputField =
|
|
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
|
-
|
|
17
|
+
const FileInputField = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
accept,
|
|
20
|
+
buttonLabel,
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
dataTest,
|
|
24
|
+
disabled,
|
|
25
|
+
error,
|
|
26
|
+
helpText,
|
|
27
|
+
initialFocus,
|
|
28
|
+
label,
|
|
29
|
+
large,
|
|
30
|
+
multiple,
|
|
31
|
+
name,
|
|
32
|
+
onBlur,
|
|
33
|
+
onChange,
|
|
34
|
+
onFocus,
|
|
35
|
+
placeholder,
|
|
36
|
+
required,
|
|
37
|
+
small,
|
|
38
|
+
tabIndex,
|
|
39
|
+
valid,
|
|
40
|
+
validationText,
|
|
41
|
+
warning
|
|
42
|
+
} = _ref;
|
|
43
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
44
|
+
className: className,
|
|
45
|
+
dataTest: dataTest,
|
|
46
|
+
helpText: helpText,
|
|
47
|
+
validationText: validationText,
|
|
48
|
+
error: error,
|
|
49
|
+
warning: warning,
|
|
50
|
+
valid: valid
|
|
51
|
+
}, label && /*#__PURE__*/React.createElement(Label, {
|
|
52
|
+
required: required,
|
|
53
|
+
disabled: disabled,
|
|
54
|
+
htmlFor: name
|
|
55
|
+
}, label), /*#__PURE__*/React.createElement(FileInput, {
|
|
56
|
+
accept: accept,
|
|
57
|
+
buttonLabel: translate(buttonLabel),
|
|
58
|
+
className: className,
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
error: error,
|
|
61
|
+
initialFocus: initialFocus,
|
|
62
|
+
large: large,
|
|
63
|
+
multiple: multiple,
|
|
64
|
+
name: name,
|
|
65
|
+
onBlur: onBlur,
|
|
66
|
+
onChange: onChange,
|
|
67
|
+
onFocus: onFocus,
|
|
68
|
+
small: small,
|
|
69
|
+
tabIndex: tabIndex,
|
|
70
|
+
valid: valid,
|
|
71
|
+
warning: warning
|
|
72
|
+
}), /*#__PURE__*/React.createElement(FileList, null, children ? children : /*#__PURE__*/React.createElement(FileListPlaceholder, null, translate(placeholder))));
|
|
73
|
+
};
|
|
71
74
|
|
|
72
75
|
FileInputField.defaultProps = {
|
|
73
76
|
accept: '*',
|
|
@@ -4,13 +4,7 @@ import { sharedPropTypes } from '@dhis2/ui-constants';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { FileListItem } from '../index.js';
|
|
6
6
|
import { FileInputField } from './file-input-field.js';
|
|
7
|
-
const description = `
|
|
8
|
-
The \`FileInputField\` component wraps the \`FileInput\` component in a \`Field\` wrapper to add labels, help text, and validation text.
|
|
9
|
-
|
|
10
|
-
\`\`\`js
|
|
11
|
-
import { FileInputField, FileListItem } from '@dhis2/ui'
|
|
12
|
-
\`\`\`
|
|
13
|
-
`;
|
|
7
|
+
const description = "\nThe `FileInputField` component wraps the `FileInput` component in a `Field` wrapper to add labels, help text, and validation text.\n\n```js\nimport { FileInputField, FileListItem } from '@dhis2/ui'\n```\n";
|
|
14
8
|
|
|
15
9
|
const onChange = obj => console.log('onChange', obj);
|
|
16
10
|
|
|
@@ -19,7 +13,7 @@ const onRemove = () => console.log('onRemove');
|
|
|
19
13
|
const onCancel = () => console.log('onCancel');
|
|
20
14
|
|
|
21
15
|
export default {
|
|
22
|
-
title: '
|
|
16
|
+
title: 'File Input Field',
|
|
23
17
|
component: FileInputField,
|
|
24
18
|
parameters: {
|
|
25
19
|
docs: {
|
|
@@ -16,12 +16,13 @@ const translate = (prop, interpolationObject) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
class FileInputFieldWithList extends Component {
|
|
19
|
-
constructor(
|
|
20
|
-
super(...
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
21
|
|
|
22
|
-
_defineProperty(this, "handleChange", ({
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
_defineProperty(this, "handleChange", (_ref, event) => {
|
|
23
|
+
let {
|
|
24
|
+
files: fileList
|
|
25
|
+
} = _ref;
|
|
25
26
|
const {
|
|
26
27
|
onChange,
|
|
27
28
|
name
|
|
@@ -32,9 +33,10 @@ class FileInputFieldWithList extends Component {
|
|
|
32
33
|
}, event);
|
|
33
34
|
});
|
|
34
35
|
|
|
35
|
-
_defineProperty(this, "handleRemove", ({
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
_defineProperty(this, "handleRemove", (_ref2, event) => {
|
|
37
|
+
let {
|
|
38
|
+
file: fileToRemove
|
|
39
|
+
} = _ref2;
|
|
38
40
|
const {
|
|
39
41
|
files,
|
|
40
42
|
onChange,
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { sharedPropTypes } from '@dhis2/ui-constants';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FileInputFieldWithList } from './file-input-field-with-list.js';
|
|
4
|
-
const description = `
|
|
5
|
-
|
|
4
|
+
const description = "\nA FileInputField with logic for creating a dynamic list of removable files from an array of `File` objects.\n\n```js\nimport { FileInputFieldWithList } from '@dhis2/ui'\n```\n";
|
|
5
|
+
const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], "".concat(name, "-").concat(i + 1, ".txt")));
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], `${name}-${i + 1}.txt`));
|
|
12
|
-
|
|
13
|
-
const onChange = ({
|
|
14
|
-
files
|
|
15
|
-
}) => {
|
|
7
|
+
const onChange = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
files
|
|
10
|
+
} = _ref;
|
|
16
11
|
console.log('files: ', files);
|
|
17
12
|
};
|
|
18
13
|
|
|
19
14
|
export default {
|
|
20
|
-
title: '
|
|
15
|
+
title: 'File Input Field With List',
|
|
21
16
|
component: FileInputFieldWithList,
|
|
22
17
|
parameters: {
|
|
23
18
|
docs: {
|
|
@@ -5,8 +5,8 @@ import React, { Component } from 'react';
|
|
|
5
5
|
import { FileListItem } from '../index.js';
|
|
6
6
|
|
|
7
7
|
class FileListItemWithRemove extends Component {
|
|
8
|
-
constructor(
|
|
9
|
-
super(...
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
10
|
|
|
11
11
|
_defineProperty(this, "handleRemove", event => {
|
|
12
12
|
const {
|
|
@@ -6,40 +6,43 @@ import cx from 'classnames';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
const FileListItem =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
9
|
+
const FileListItem = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
className,
|
|
12
|
+
label,
|
|
13
|
+
onRemove,
|
|
14
|
+
removeText,
|
|
15
|
+
loading,
|
|
16
|
+
onCancel,
|
|
17
|
+
cancelText,
|
|
18
|
+
dataTest
|
|
19
|
+
} = _ref;
|
|
20
|
+
return /*#__PURE__*/React.createElement("p", {
|
|
21
|
+
"data-test": dataTest,
|
|
22
|
+
className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + (cx('selected-file', className) || "")
|
|
23
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
24
|
+
className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "icon"
|
|
25
|
+
}, loading ? /*#__PURE__*/React.createElement(CircularLoader, {
|
|
26
|
+
extrasmall: true
|
|
27
|
+
}) : /*#__PURE__*/React.createElement(IconAttachment16, {
|
|
28
|
+
color: colors.grey700
|
|
29
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
30
|
+
className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "text"
|
|
31
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
32
|
+
className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "label"
|
|
33
|
+
}, label), loading && onCancel && cancelText && /*#__PURE__*/React.createElement("span", {
|
|
34
|
+
onClick: event => onCancel({}, event),
|
|
35
|
+
"data-test": "".concat(dataTest, "-cancel"),
|
|
36
|
+
className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "action"
|
|
37
|
+
}, cancelText), !loading && /*#__PURE__*/React.createElement("span", {
|
|
38
|
+
onClick: event => onRemove({}, event),
|
|
39
|
+
"data-test": "".concat(dataTest, "-remove"),
|
|
40
|
+
className: _JSXStyle.dynamic([["3793849083", [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]]]) + " " + "action"
|
|
41
|
+
}, removeText)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
42
|
+
id: "3793849083",
|
|
43
|
+
dynamic: [spacers.dp4, colors.grey900, colors.grey700, colors.red700, colors.red800, theme.focus]
|
|
44
|
+
}, ["p.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding-top:".concat(spacers.dp4, ";}"), ".icon.__jsx-style-dynamic-selector{margin-right:4px;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-top:1px;}", ".text.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".label.__jsx-style-dynamic-selector{font-size:14px;color:".concat(colors.grey900, ";word-break:break-all;}"), ".label.__jsx-style-dynamic-selector::after{content:' ';display:inline-block;width:12px;}", ".action.__jsx-style-dynamic-selector{font-size:12px;line-height:12px;margin-top:0;-webkit-text-decoration:underline;text-decoration:underline;cursor:pointer;color:".concat(colors.grey700, ";}"), ".action.__jsx-style-dynamic-selector:hover{color:".concat(colors.red700, ";}"), ".action.__jsx-style-dynamic-selector:active{color:".concat(colors.red800, ";}"), ".action.__jsx-style-dynamic-selector:focus{outline:3px solid ".concat(theme.focus, ";outline-offset:2px;}")]));
|
|
45
|
+
};
|
|
43
46
|
|
|
44
47
|
FileListItem.defaultProps = {
|
|
45
48
|
dataTest: 'dhis2-uicore-filelistitem'
|
|
@@ -3,16 +3,19 @@ import { colors, spacers } from '@dhis2/ui-constants';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
-
const FileListPlaceholder =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
const FileListPlaceholder = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
children,
|
|
9
|
+
dataTest
|
|
10
|
+
} = _ref;
|
|
11
|
+
return /*#__PURE__*/React.createElement("p", {
|
|
12
|
+
"data-test": dataTest,
|
|
13
|
+
className: _JSXStyle.dynamic([["1287857385", [spacers.dp4, colors.grey700]]])
|
|
14
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
15
|
+
id: "1287857385",
|
|
16
|
+
dynamic: [spacers.dp4, colors.grey700]
|
|
17
|
+
}, ["p.__jsx-style-dynamic-selector{margin:0;padding-top:".concat(spacers.dp4, ";font-size:14px;color:").concat(colors.grey700, ";}")]));
|
|
18
|
+
};
|
|
16
19
|
|
|
17
20
|
FileListPlaceholder.defaultProps = {
|
|
18
21
|
dataTest: 'dhis2-uicore-filelistplaceholder'
|
|
@@ -2,16 +2,19 @@ import _JSXStyle from "styled-jsx/style";
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
const FileList =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
5
|
+
const FileList = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
dataTest
|
|
10
|
+
} = _ref;
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
"data-test": dataTest,
|
|
13
|
+
className: "jsx-2770071620" + " " + (className || "")
|
|
14
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
15
|
+
id: "2770071620"
|
|
16
|
+
}, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
|
|
17
|
+
};
|
|
15
18
|
|
|
16
19
|
FileList.defaultProps = {
|
|
17
20
|
dataTest: 'dhis2-uicore-filelist'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/file-input",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.1",
|
|
4
4
|
"description": "UI FileInput",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.0.0-beta.1",
|
|
36
|
-
"@dhis2-ui/button": "8.2.
|
|
37
|
-
"@dhis2-ui/field": "8.2.
|
|
38
|
-
"@dhis2-ui/label": "8.2.
|
|
39
|
-
"@dhis2-ui/loader": "8.2.
|
|
40
|
-
"@dhis2-ui/status-icon": "8.2.
|
|
41
|
-
"@dhis2/ui-constants": "8.2.
|
|
42
|
-
"@dhis2/ui-icons": "8.2.
|
|
36
|
+
"@dhis2-ui/button": "8.2.1",
|
|
37
|
+
"@dhis2-ui/field": "8.2.1",
|
|
38
|
+
"@dhis2-ui/label": "8.2.1",
|
|
39
|
+
"@dhis2-ui/loader": "8.2.1",
|
|
40
|
+
"@dhis2-ui/status-icon": "8.2.1",
|
|
41
|
+
"@dhis2/ui-constants": "8.2.1",
|
|
42
|
+
"@dhis2/ui-icons": "8.2.1",
|
|
43
43
|
"classnames": "^2.3.1",
|
|
44
44
|
"prop-types": "^15.7.2"
|
|
45
45
|
},
|