@dhis2-ui/file-input 10.16.3-alpha.1 → 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/file-input/file-input.js +3 -4
- package/build/cjs/file-input-field/file-input-field.js +56 -59
- package/build/cjs/file-input-field-with-list/file-input-field-with-list.js +9 -12
- package/build/cjs/file-input-field-with-list/file-input-field-with-list.prod.stories.js +3 -4
- package/build/cjs/file-input-field-with-list/file-list-item-with-remove.js +3 -4
- package/build/cjs/file-list/file-list-item.js +10 -11
- package/build/cjs/file-list/file-list-placeholder.js +10 -13
- package/build/cjs/file-list/file-list.js +10 -13
- package/build/cjs/locales/index.js +97 -59
- package/build/es/file-input/file-input.js +2 -2
- package/build/es/file-input-field/file-input-field.js +56 -59
- package/build/es/file-input-field-with-list/file-input-field-with-list.js +8 -10
- package/build/es/file-input-field-with-list/file-input-field-with-list.prod.stories.js +3 -4
- 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 +10 -11
- package/build/es/file-list/file-list-placeholder.js +10 -13
- package/build/es/file-list/file-list.js +10 -13
- package/build/es/locales/index.js +72 -34
- package/package.json +8 -8
- package/src/locales/index.js +105 -34
|
@@ -12,15 +12,14 @@ var _statusIcon = require("@dhis2-ui/status-icon");
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
function
|
|
16
|
-
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; }
|
|
15
|
+
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); }
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
17
|
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; }
|
|
19
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
20
19
|
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); }
|
|
21
20
|
class FileInput extends _react.Component {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...
|
|
21
|
+
constructor(...args) {
|
|
22
|
+
super(...args);
|
|
24
23
|
_defineProperty(this, "ref", /*#__PURE__*/(0, _react.createRef)());
|
|
25
24
|
_defineProperty(this, "handleClick", () => {
|
|
26
25
|
this.ref.current.click();
|
|
@@ -22,65 +22,62 @@ const translate = (prop, interpolationObject) => {
|
|
|
22
22
|
};
|
|
23
23
|
const defaultButtonLabel = () => _index3.default.t('Upload a file');
|
|
24
24
|
const defaultPlaceholder = () => _index3.default.t('No file uploaded yet');
|
|
25
|
-
const FileInputField =
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
warning: warning
|
|
82
|
-
}), /*#__PURE__*/_react.default.createElement(_index2.FileList, null, children ? children : /*#__PURE__*/_react.default.createElement(_index2.FileListPlaceholder, null, translate(placeholder))));
|
|
83
|
-
};
|
|
25
|
+
const FileInputField = ({
|
|
26
|
+
accept = '*',
|
|
27
|
+
buttonLabel = defaultButtonLabel,
|
|
28
|
+
children,
|
|
29
|
+
className,
|
|
30
|
+
dataTest = 'dhis2-uiwidgets-fileinputfield',
|
|
31
|
+
disabled,
|
|
32
|
+
error,
|
|
33
|
+
helpText,
|
|
34
|
+
initialFocus,
|
|
35
|
+
label,
|
|
36
|
+
large,
|
|
37
|
+
multiple,
|
|
38
|
+
name,
|
|
39
|
+
onBlur,
|
|
40
|
+
onChange,
|
|
41
|
+
onFocus,
|
|
42
|
+
onKeyDown,
|
|
43
|
+
placeholder = defaultPlaceholder,
|
|
44
|
+
required,
|
|
45
|
+
small,
|
|
46
|
+
tabIndex,
|
|
47
|
+
valid,
|
|
48
|
+
validationText,
|
|
49
|
+
warning
|
|
50
|
+
}) => /*#__PURE__*/_react.default.createElement(_field.Field, {
|
|
51
|
+
className: className,
|
|
52
|
+
dataTest: dataTest,
|
|
53
|
+
helpText: helpText,
|
|
54
|
+
validationText: validationText,
|
|
55
|
+
error: error,
|
|
56
|
+
warning: warning,
|
|
57
|
+
valid: valid
|
|
58
|
+
}, label && /*#__PURE__*/_react.default.createElement(_label.Label, {
|
|
59
|
+
required: required,
|
|
60
|
+
disabled: disabled,
|
|
61
|
+
htmlFor: name
|
|
62
|
+
}, label), /*#__PURE__*/_react.default.createElement(_index.FileInput, {
|
|
63
|
+
accept: accept,
|
|
64
|
+
buttonLabel: translate(buttonLabel),
|
|
65
|
+
className: className,
|
|
66
|
+
disabled: disabled,
|
|
67
|
+
error: error,
|
|
68
|
+
initialFocus: initialFocus,
|
|
69
|
+
large: large,
|
|
70
|
+
multiple: multiple,
|
|
71
|
+
name: name,
|
|
72
|
+
onBlur: onBlur,
|
|
73
|
+
onChange: onChange,
|
|
74
|
+
onFocus: onFocus,
|
|
75
|
+
onKeyDown: onKeyDown,
|
|
76
|
+
small: small,
|
|
77
|
+
tabIndex: tabIndex,
|
|
78
|
+
valid: valid,
|
|
79
|
+
warning: warning
|
|
80
|
+
}), /*#__PURE__*/_react.default.createElement(_index2.FileList, null, children ? children : /*#__PURE__*/_react.default.createElement(_index2.FileListPlaceholder, null, translate(placeholder))));
|
|
84
81
|
exports.FileInputField = FileInputField;
|
|
85
82
|
FileInputField.propTypes = {
|
|
86
83
|
/** The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) */
|
|
@@ -10,8 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _index = require("../file-input-field/index.js");
|
|
11
11
|
var _index2 = _interopRequireDefault(require("../locales/index.js"));
|
|
12
12
|
var _fileListItemWithRemove = require("./file-list-item-with-remove.js");
|
|
13
|
-
function
|
|
14
|
-
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; }
|
|
13
|
+
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); }
|
|
15
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
15
|
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; }
|
|
17
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -24,12 +23,11 @@ const translate = (prop, interpolationObject) => {
|
|
|
24
23
|
return prop;
|
|
25
24
|
};
|
|
26
25
|
class FileInputFieldWithList extends _react.Component {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...
|
|
29
|
-
_defineProperty(this, "handleChange", (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
26
|
+
constructor(...args) {
|
|
27
|
+
super(...args);
|
|
28
|
+
_defineProperty(this, "handleChange", ({
|
|
29
|
+
files: fileList
|
|
30
|
+
}, event) => {
|
|
33
31
|
const {
|
|
34
32
|
onChange,
|
|
35
33
|
name
|
|
@@ -39,10 +37,9 @@ class FileInputFieldWithList extends _react.Component {
|
|
|
39
37
|
name: name
|
|
40
38
|
}, event);
|
|
41
39
|
});
|
|
42
|
-
_defineProperty(this, "handleRemove", (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} = _ref2;
|
|
40
|
+
_defineProperty(this, "handleRemove", ({
|
|
41
|
+
file: fileToRemove
|
|
42
|
+
}, event) => {
|
|
46
43
|
const {
|
|
47
44
|
files,
|
|
48
45
|
onChange,
|
|
@@ -16,10 +16,9 @@ import { FileInputFieldWithList } from '@dhis2/ui'
|
|
|
16
16
|
\`\`\`
|
|
17
17
|
`;
|
|
18
18
|
const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], `${name}-${i + 1}.txt`));
|
|
19
|
-
const onChange =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
19
|
+
const onChange = ({
|
|
20
|
+
files
|
|
21
|
+
}) => {
|
|
23
22
|
console.log('files: ', files);
|
|
24
23
|
};
|
|
25
24
|
var _default = exports.default = {
|
|
@@ -7,15 +7,14 @@ exports.FileListItemWithRemove = void 0;
|
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _index = require("../file-list/index.js");
|
|
10
|
-
function
|
|
11
|
-
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; }
|
|
10
|
+
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); }
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
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; }
|
|
14
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
14
|
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); }
|
|
16
15
|
class FileListItemWithRemove extends _react.Component {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...
|
|
16
|
+
constructor(...args) {
|
|
17
|
+
super(...args);
|
|
19
18
|
_defineProperty(this, "handleRemove", event => {
|
|
20
19
|
const {
|
|
21
20
|
onRemove,
|
|
@@ -12,17 +12,16 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
const FileListItem =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref;
|
|
15
|
+
const FileListItem = ({
|
|
16
|
+
className,
|
|
17
|
+
label,
|
|
18
|
+
onRemove,
|
|
19
|
+
removeText,
|
|
20
|
+
loading,
|
|
21
|
+
onCancel,
|
|
22
|
+
cancelText,
|
|
23
|
+
dataTest = 'dhis2-uicore-filelistitem'
|
|
24
|
+
}) => {
|
|
26
25
|
const handleKeyDown = event => {
|
|
27
26
|
if (!onRemove) {
|
|
28
27
|
return;
|
|
@@ -9,19 +9,16 @@ var _uiConstants = require("@dhis2/ui-constants");
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const FileListPlaceholder =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
dynamic: [_uiConstants.spacers.dp4, _uiConstants.colors.grey700]
|
|
23
|
-
}, [`p.__jsx-style-dynamic-selector{margin:0;padding-top:${_uiConstants.spacers.dp4};font-size:14px;color:${_uiConstants.colors.grey700};}`]));
|
|
24
|
-
};
|
|
12
|
+
const FileListPlaceholder = ({
|
|
13
|
+
children,
|
|
14
|
+
dataTest = 'dhis2-uicore-filelistplaceholder'
|
|
15
|
+
}) => /*#__PURE__*/_react.default.createElement("p", {
|
|
16
|
+
"data-test": dataTest,
|
|
17
|
+
className: _style.default.dynamic([["1287857385", [_uiConstants.spacers.dp4, _uiConstants.colors.grey700]]])
|
|
18
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
19
|
+
id: "1287857385",
|
|
20
|
+
dynamic: [_uiConstants.spacers.dp4, _uiConstants.colors.grey700]
|
|
21
|
+
}, [`p.__jsx-style-dynamic-selector{margin:0;padding-top:${_uiConstants.spacers.dp4};font-size:14px;color:${_uiConstants.colors.grey700};}`]));
|
|
25
22
|
exports.FileListPlaceholder = FileListPlaceholder;
|
|
26
23
|
FileListPlaceholder.propTypes = {
|
|
27
24
|
children: _propTypes.default.string,
|
|
@@ -8,19 +8,16 @@ var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const FileList =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
id: "2770071620"
|
|
22
|
-
}, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
|
|
23
|
-
};
|
|
11
|
+
const FileList = ({
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
dataTest = 'dhis2-uicore-filelist'
|
|
15
|
+
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
16
|
+
"data-test": dataTest,
|
|
17
|
+
className: "jsx-2770071620" + " " + (className || "")
|
|
18
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
19
|
+
id: "2770071620"
|
|
20
|
+
}, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
|
|
24
21
|
exports.FileList = FileList;
|
|
25
22
|
FileList.propTypes = {
|
|
26
23
|
children: _propTypes.default.node,
|
|
@@ -14,31 +14,31 @@ var _translations6 = _interopRequireDefault(require("./en/translations.json"));
|
|
|
14
14
|
var _translations7 = _interopRequireDefault(require("./es/translations.json"));
|
|
15
15
|
var _translations8 = _interopRequireDefault(require("./es_419/translations.json"));
|
|
16
16
|
var _translations9 = _interopRequireDefault(require("./fr/translations.json"));
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
17
|
+
var _translations0 = _interopRequireDefault(require("./hi_IN/translations.json"));
|
|
18
|
+
var _translations1 = _interopRequireDefault(require("./id/translations.json"));
|
|
19
|
+
var _translations10 = _interopRequireDefault(require("./km/translations.json"));
|
|
20
|
+
var _translations11 = _interopRequireDefault(require("./ko_KR/translations.json"));
|
|
21
|
+
var _translations12 = _interopRequireDefault(require("./lo/translations.json"));
|
|
22
|
+
var _translations13 = _interopRequireDefault(require("./my/translations.json"));
|
|
23
|
+
var _translations14 = _interopRequireDefault(require("./nb/translations.json"));
|
|
24
|
+
var _translations15 = _interopRequireDefault(require("./nl/translations.json"));
|
|
25
|
+
var _translations16 = _interopRequireDefault(require("./prs/translations.json"));
|
|
26
|
+
var _translations17 = _interopRequireDefault(require("./ps/translations.json"));
|
|
27
|
+
var _translations18 = _interopRequireDefault(require("./pt/translations.json"));
|
|
28
|
+
var _translations19 = _interopRequireDefault(require("./pt_BR/translations.json"));
|
|
29
|
+
var _translations20 = _interopRequireDefault(require("./ru/translations.json"));
|
|
30
|
+
var _translations21 = _interopRequireDefault(require("./si/translations.json"));
|
|
31
|
+
var _translations22 = _interopRequireDefault(require("./sv/translations.json"));
|
|
32
|
+
var _translations23 = _interopRequireDefault(require("./tet/translations.json"));
|
|
33
|
+
var _translations24 = _interopRequireDefault(require("./tg/translations.json"));
|
|
34
|
+
var _translations25 = _interopRequireDefault(require("./uk/translations.json"));
|
|
35
|
+
var _translations26 = _interopRequireDefault(require("./ur/translations.json"));
|
|
36
|
+
var _translations27 = _interopRequireDefault(require("./uz_Latn/translations.json"));
|
|
37
|
+
var _translations28 = _interopRequireDefault(require("./uz_UZ_Cyrl/translations.json"));
|
|
38
|
+
var _translations29 = _interopRequireDefault(require("./uz_UZ_Latn/translations.json"));
|
|
39
|
+
var _translations30 = _interopRequireDefault(require("./vi/translations.json"));
|
|
40
|
+
var _translations31 = _interopRequireDefault(require("./zh/translations.json"));
|
|
41
|
+
var _translations32 = _interopRequireDefault(require("./zh_CN/translations.json"));
|
|
42
42
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
43
43
|
//------------------------------------------------------------------------------
|
|
44
44
|
// <auto-generated>
|
|
@@ -50,38 +50,76 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
50
50
|
//------------------------------------------------------------------------------
|
|
51
51
|
|
|
52
52
|
const namespace = 'default';
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
_d2I18n.default.
|
|
58
|
-
_d2I18n.default.
|
|
59
|
-
_d2I18n.default.
|
|
60
|
-
_d2I18n.default.
|
|
61
|
-
_d2I18n.default.
|
|
62
|
-
_d2I18n.default.
|
|
63
|
-
_d2I18n.default.
|
|
64
|
-
_d2I18n.default.
|
|
65
|
-
_d2I18n.default.
|
|
66
|
-
_d2I18n.default.
|
|
67
|
-
_d2I18n.default.
|
|
68
|
-
_d2I18n.default.
|
|
69
|
-
_d2I18n.default.
|
|
70
|
-
_d2I18n.default.
|
|
71
|
-
_d2I18n.default.
|
|
72
|
-
_d2I18n.default.
|
|
73
|
-
_d2I18n.default.
|
|
74
|
-
_d2I18n.default.
|
|
75
|
-
_d2I18n.default.
|
|
76
|
-
_d2I18n.default.
|
|
77
|
-
_d2I18n.default.
|
|
78
|
-
_d2I18n.default.
|
|
79
|
-
_d2I18n.default.
|
|
80
|
-
_d2I18n.default.
|
|
81
|
-
_d2I18n.default.
|
|
82
|
-
_d2I18n.default.
|
|
83
|
-
_d2I18n.default.
|
|
84
|
-
_d2I18n.default.
|
|
85
|
-
_d2I18n.default.
|
|
86
|
-
_d2I18n.default.
|
|
53
|
+
|
|
54
|
+
// Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
|
|
55
|
+
// custom translations from the datastore (added by the app adapter)
|
|
56
|
+
|
|
57
|
+
_d2I18n.default.addResourceBundle('ar', namespace, _translations.default, true, false);
|
|
58
|
+
_d2I18n.default.addResourceBundle('ar', namespace, _translations.default, true, false);
|
|
59
|
+
_d2I18n.default.addResourceBundle('ar_IQ', namespace, _translations2.default, true, false);
|
|
60
|
+
_d2I18n.default.addResourceBundle('ar-IQ', namespace, _translations2.default, true, false);
|
|
61
|
+
_d2I18n.default.addResourceBundle('ckb', namespace, _translations3.default, true, false);
|
|
62
|
+
_d2I18n.default.addResourceBundle('ckb', namespace, _translations3.default, true, false);
|
|
63
|
+
_d2I18n.default.addResourceBundle('cs', namespace, _translations4.default, true, false);
|
|
64
|
+
_d2I18n.default.addResourceBundle('cs', namespace, _translations4.default, true, false);
|
|
65
|
+
_d2I18n.default.addResourceBundle('da', namespace, _translations5.default, true, false);
|
|
66
|
+
_d2I18n.default.addResourceBundle('da', namespace, _translations5.default, true, false);
|
|
67
|
+
_d2I18n.default.addResourceBundle('en', namespace, _translations6.default, true, false);
|
|
68
|
+
_d2I18n.default.addResourceBundle('en', namespace, _translations6.default, true, false);
|
|
69
|
+
_d2I18n.default.addResourceBundle('es', namespace, _translations7.default, true, false);
|
|
70
|
+
_d2I18n.default.addResourceBundle('es', namespace, _translations7.default, true, false);
|
|
71
|
+
_d2I18n.default.addResourceBundle('es_419', namespace, _translations8.default, true, false);
|
|
72
|
+
_d2I18n.default.addResourceBundle('es-419', namespace, _translations8.default, true, false);
|
|
73
|
+
_d2I18n.default.addResourceBundle('fr', namespace, _translations9.default, true, false);
|
|
74
|
+
_d2I18n.default.addResourceBundle('fr', namespace, _translations9.default, true, false);
|
|
75
|
+
_d2I18n.default.addResourceBundle('hi_IN', namespace, _translations0.default, true, false);
|
|
76
|
+
_d2I18n.default.addResourceBundle('hi-IN', namespace, _translations0.default, true, false);
|
|
77
|
+
_d2I18n.default.addResourceBundle('id', namespace, _translations1.default, true, false);
|
|
78
|
+
_d2I18n.default.addResourceBundle('id', namespace, _translations1.default, true, false);
|
|
79
|
+
_d2I18n.default.addResourceBundle('km', namespace, _translations10.default, true, false);
|
|
80
|
+
_d2I18n.default.addResourceBundle('km', namespace, _translations10.default, true, false);
|
|
81
|
+
_d2I18n.default.addResourceBundle('ko_KR', namespace, _translations11.default, true, false);
|
|
82
|
+
_d2I18n.default.addResourceBundle('ko-KR', namespace, _translations11.default, true, false);
|
|
83
|
+
_d2I18n.default.addResourceBundle('lo', namespace, _translations12.default, true, false);
|
|
84
|
+
_d2I18n.default.addResourceBundle('lo', namespace, _translations12.default, true, false);
|
|
85
|
+
_d2I18n.default.addResourceBundle('my', namespace, _translations13.default, true, false);
|
|
86
|
+
_d2I18n.default.addResourceBundle('my', namespace, _translations13.default, true, false);
|
|
87
|
+
_d2I18n.default.addResourceBundle('nb', namespace, _translations14.default, true, false);
|
|
88
|
+
_d2I18n.default.addResourceBundle('nb', namespace, _translations14.default, true, false);
|
|
89
|
+
_d2I18n.default.addResourceBundle('nl', namespace, _translations15.default, true, false);
|
|
90
|
+
_d2I18n.default.addResourceBundle('nl', namespace, _translations15.default, true, false);
|
|
91
|
+
_d2I18n.default.addResourceBundle('prs', namespace, _translations16.default, true, false);
|
|
92
|
+
_d2I18n.default.addResourceBundle('prs', namespace, _translations16.default, true, false);
|
|
93
|
+
_d2I18n.default.addResourceBundle('ps', namespace, _translations17.default, true, false);
|
|
94
|
+
_d2I18n.default.addResourceBundle('ps', namespace, _translations17.default, true, false);
|
|
95
|
+
_d2I18n.default.addResourceBundle('pt', namespace, _translations18.default, true, false);
|
|
96
|
+
_d2I18n.default.addResourceBundle('pt', namespace, _translations18.default, true, false);
|
|
97
|
+
_d2I18n.default.addResourceBundle('pt_BR', namespace, _translations19.default, true, false);
|
|
98
|
+
_d2I18n.default.addResourceBundle('pt-BR', namespace, _translations19.default, true, false);
|
|
99
|
+
_d2I18n.default.addResourceBundle('ru', namespace, _translations20.default, true, false);
|
|
100
|
+
_d2I18n.default.addResourceBundle('ru', namespace, _translations20.default, true, false);
|
|
101
|
+
_d2I18n.default.addResourceBundle('si', namespace, _translations21.default, true, false);
|
|
102
|
+
_d2I18n.default.addResourceBundle('si', namespace, _translations21.default, true, false);
|
|
103
|
+
_d2I18n.default.addResourceBundle('sv', namespace, _translations22.default, true, false);
|
|
104
|
+
_d2I18n.default.addResourceBundle('sv', namespace, _translations22.default, true, false);
|
|
105
|
+
_d2I18n.default.addResourceBundle('tet', namespace, _translations23.default, true, false);
|
|
106
|
+
_d2I18n.default.addResourceBundle('tet', namespace, _translations23.default, true, false);
|
|
107
|
+
_d2I18n.default.addResourceBundle('tg', namespace, _translations24.default, true, false);
|
|
108
|
+
_d2I18n.default.addResourceBundle('tg', namespace, _translations24.default, true, false);
|
|
109
|
+
_d2I18n.default.addResourceBundle('uk', namespace, _translations25.default, true, false);
|
|
110
|
+
_d2I18n.default.addResourceBundle('uk', namespace, _translations25.default, true, false);
|
|
111
|
+
_d2I18n.default.addResourceBundle('ur', namespace, _translations26.default, true, false);
|
|
112
|
+
_d2I18n.default.addResourceBundle('ur', namespace, _translations26.default, true, false);
|
|
113
|
+
_d2I18n.default.addResourceBundle('uz_Latn', namespace, _translations27.default, true, false);
|
|
114
|
+
_d2I18n.default.addResourceBundle('uz-Latn', namespace, _translations27.default, true, false);
|
|
115
|
+
_d2I18n.default.addResourceBundle('uz_UZ_Cyrl', namespace, _translations28.default, true, false);
|
|
116
|
+
_d2I18n.default.addResourceBundle('uz-Cyrl-UZ', namespace, _translations28.default, true, false);
|
|
117
|
+
_d2I18n.default.addResourceBundle('uz_UZ_Latn', namespace, _translations29.default, true, false);
|
|
118
|
+
_d2I18n.default.addResourceBundle('uz-Latn-UZ', namespace, _translations29.default, true, false);
|
|
119
|
+
_d2I18n.default.addResourceBundle('vi', namespace, _translations30.default, true, false);
|
|
120
|
+
_d2I18n.default.addResourceBundle('vi', namespace, _translations30.default, true, false);
|
|
121
|
+
_d2I18n.default.addResourceBundle('zh', namespace, _translations31.default, true, false);
|
|
122
|
+
_d2I18n.default.addResourceBundle('zh', namespace, _translations31.default, true, false);
|
|
123
|
+
_d2I18n.default.addResourceBundle('zh_CN', namespace, _translations32.default, true, false);
|
|
124
|
+
_d2I18n.default.addResourceBundle('zh-CN', namespace, _translations32.default, true, false);
|
|
87
125
|
var _default = exports.default = _d2I18n.default;
|
|
@@ -10,8 +10,8 @@ import cx from 'classnames';
|
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import React, { createRef, Component } from 'react';
|
|
12
12
|
class FileInput extends Component {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
15
|
_defineProperty(this, "ref", /*#__PURE__*/createRef());
|
|
16
16
|
_defineProperty(this, "handleClick", () => {
|
|
17
17
|
this.ref.current.click();
|
|
@@ -16,65 +16,62 @@ const translate = (prop, interpolationObject) => {
|
|
|
16
16
|
};
|
|
17
17
|
const defaultButtonLabel = () => i18n.t('Upload a file');
|
|
18
18
|
const defaultPlaceholder = () => i18n.t('No file uploaded yet');
|
|
19
|
-
const FileInputField =
|
|
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
|
-
warning: warning
|
|
76
|
-
}), /*#__PURE__*/React.createElement(FileList, null, children ? children : /*#__PURE__*/React.createElement(FileListPlaceholder, null, translate(placeholder))));
|
|
77
|
-
};
|
|
19
|
+
const FileInputField = ({
|
|
20
|
+
accept = '*',
|
|
21
|
+
buttonLabel = defaultButtonLabel,
|
|
22
|
+
children,
|
|
23
|
+
className,
|
|
24
|
+
dataTest = 'dhis2-uiwidgets-fileinputfield',
|
|
25
|
+
disabled,
|
|
26
|
+
error,
|
|
27
|
+
helpText,
|
|
28
|
+
initialFocus,
|
|
29
|
+
label,
|
|
30
|
+
large,
|
|
31
|
+
multiple,
|
|
32
|
+
name,
|
|
33
|
+
onBlur,
|
|
34
|
+
onChange,
|
|
35
|
+
onFocus,
|
|
36
|
+
onKeyDown,
|
|
37
|
+
placeholder = defaultPlaceholder,
|
|
38
|
+
required,
|
|
39
|
+
small,
|
|
40
|
+
tabIndex,
|
|
41
|
+
valid,
|
|
42
|
+
validationText,
|
|
43
|
+
warning
|
|
44
|
+
}) => /*#__PURE__*/React.createElement(Field, {
|
|
45
|
+
className: className,
|
|
46
|
+
dataTest: dataTest,
|
|
47
|
+
helpText: helpText,
|
|
48
|
+
validationText: validationText,
|
|
49
|
+
error: error,
|
|
50
|
+
warning: warning,
|
|
51
|
+
valid: valid
|
|
52
|
+
}, label && /*#__PURE__*/React.createElement(Label, {
|
|
53
|
+
required: required,
|
|
54
|
+
disabled: disabled,
|
|
55
|
+
htmlFor: name
|
|
56
|
+
}, label), /*#__PURE__*/React.createElement(FileInput, {
|
|
57
|
+
accept: accept,
|
|
58
|
+
buttonLabel: translate(buttonLabel),
|
|
59
|
+
className: className,
|
|
60
|
+
disabled: disabled,
|
|
61
|
+
error: error,
|
|
62
|
+
initialFocus: initialFocus,
|
|
63
|
+
large: large,
|
|
64
|
+
multiple: multiple,
|
|
65
|
+
name: name,
|
|
66
|
+
onBlur: onBlur,
|
|
67
|
+
onChange: onChange,
|
|
68
|
+
onFocus: onFocus,
|
|
69
|
+
onKeyDown: onKeyDown,
|
|
70
|
+
small: small,
|
|
71
|
+
tabIndex: tabIndex,
|
|
72
|
+
valid: valid,
|
|
73
|
+
warning: warning
|
|
74
|
+
}), /*#__PURE__*/React.createElement(FileList, null, children ? children : /*#__PURE__*/React.createElement(FileListPlaceholder, null, translate(placeholder))));
|
|
78
75
|
FileInputField.propTypes = {
|
|
79
76
|
/** The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) */
|
|
80
77
|
accept: PropTypes.string,
|
|
@@ -16,12 +16,11 @@ const translate = (prop, interpolationObject) => {
|
|
|
16
16
|
return prop;
|
|
17
17
|
};
|
|
18
18
|
class FileInputFieldWithList extends Component {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...
|
|
21
|
-
_defineProperty(this, "handleChange", (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
19
|
+
constructor(...args) {
|
|
20
|
+
super(...args);
|
|
21
|
+
_defineProperty(this, "handleChange", ({
|
|
22
|
+
files: fileList
|
|
23
|
+
}, event) => {
|
|
25
24
|
const {
|
|
26
25
|
onChange,
|
|
27
26
|
name
|
|
@@ -31,10 +30,9 @@ class FileInputFieldWithList extends Component {
|
|
|
31
30
|
name: name
|
|
32
31
|
}, event);
|
|
33
32
|
});
|
|
34
|
-
_defineProperty(this, "handleRemove", (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref2;
|
|
33
|
+
_defineProperty(this, "handleRemove", ({
|
|
34
|
+
file: fileToRemove
|
|
35
|
+
}, event) => {
|
|
38
36
|
const {
|
|
39
37
|
files,
|
|
40
38
|
onChange,
|
|
@@ -9,10 +9,9 @@ import { FileInputFieldWithList } from '@dhis2/ui'
|
|
|
9
9
|
\`\`\`
|
|
10
10
|
`;
|
|
11
11
|
const files = new Array(10).fill('dummy-file-name').map((name, i) => new File([], `${name}-${i + 1}.txt`));
|
|
12
|
-
const onChange =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
12
|
+
const onChange = ({
|
|
13
|
+
files
|
|
14
|
+
}) => {
|
|
16
15
|
console.log('files: ', files);
|
|
17
16
|
};
|
|
18
17
|
export default {
|
|
@@ -5,8 +5,8 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
6
|
import { FileListItem } from '../file-list/index.js';
|
|
7
7
|
class FileListItemWithRemove extends Component {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...
|
|
8
|
+
constructor(...args) {
|
|
9
|
+
super(...args);
|
|
10
10
|
_defineProperty(this, "handleRemove", event => {
|
|
11
11
|
const {
|
|
12
12
|
onRemove,
|
|
@@ -5,17 +5,16 @@ import { CircularLoader } from '@dhis2-ui/loader';
|
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
const FileListItem =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
8
|
+
const FileListItem = ({
|
|
9
|
+
className,
|
|
10
|
+
label,
|
|
11
|
+
onRemove,
|
|
12
|
+
removeText,
|
|
13
|
+
loading,
|
|
14
|
+
onCancel,
|
|
15
|
+
cancelText,
|
|
16
|
+
dataTest = 'dhis2-uicore-filelistitem'
|
|
17
|
+
}) => {
|
|
19
18
|
const handleKeyDown = event => {
|
|
20
19
|
if (!onRemove) {
|
|
21
20
|
return;
|
|
@@ -2,19 +2,16 @@ import _JSXStyle from "styled-jsx/style";
|
|
|
2
2
|
import { colors, spacers } from '@dhis2/ui-constants';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
const FileListPlaceholder =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
dynamic: [spacers.dp4, colors.grey700]
|
|
16
|
-
}, [`p.__jsx-style-dynamic-selector{margin:0;padding-top:${spacers.dp4};font-size:14px;color:${colors.grey700};}`]));
|
|
17
|
-
};
|
|
5
|
+
const FileListPlaceholder = ({
|
|
6
|
+
children,
|
|
7
|
+
dataTest = 'dhis2-uicore-filelistplaceholder'
|
|
8
|
+
}) => /*#__PURE__*/React.createElement("p", {
|
|
9
|
+
"data-test": dataTest,
|
|
10
|
+
className: _JSXStyle.dynamic([["1287857385", [spacers.dp4, colors.grey700]]])
|
|
11
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
12
|
+
id: "1287857385",
|
|
13
|
+
dynamic: [spacers.dp4, colors.grey700]
|
|
14
|
+
}, [`p.__jsx-style-dynamic-selector{margin:0;padding-top:${spacers.dp4};font-size:14px;color:${colors.grey700};}`]));
|
|
18
15
|
FileListPlaceholder.propTypes = {
|
|
19
16
|
children: PropTypes.string,
|
|
20
17
|
dataTest: PropTypes.string
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
const FileList =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
id: "2770071620"
|
|
15
|
-
}, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
|
|
16
|
-
};
|
|
4
|
+
const FileList = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
dataTest = 'dhis2-uicore-filelist'
|
|
8
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
"data-test": dataTest,
|
|
10
|
+
className: "jsx-2770071620" + " " + (className || "")
|
|
11
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
12
|
+
id: "2770071620"
|
|
13
|
+
}, ["div.jsx-2770071620{padding-top:4px;}", ".file-input+div.jsx-2770071620{padding-top:0;}"]));
|
|
17
14
|
FileList.propTypes = {
|
|
18
15
|
children: PropTypes.node,
|
|
19
16
|
className: PropTypes.string,
|
|
@@ -42,38 +42,76 @@ import viTranslations from './vi/translations.json';
|
|
|
42
42
|
import zhTranslations from './zh/translations.json';
|
|
43
43
|
import zh_CNTranslations from './zh_CN/translations.json';
|
|
44
44
|
const namespace = 'default';
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
i18n.
|
|
50
|
-
i18n.
|
|
51
|
-
i18n.
|
|
52
|
-
i18n.
|
|
53
|
-
i18n.
|
|
54
|
-
i18n.
|
|
55
|
-
i18n.
|
|
56
|
-
i18n.
|
|
57
|
-
i18n.
|
|
58
|
-
i18n.
|
|
59
|
-
i18n.
|
|
60
|
-
i18n.
|
|
61
|
-
i18n.
|
|
62
|
-
i18n.
|
|
63
|
-
i18n.
|
|
64
|
-
i18n.
|
|
65
|
-
i18n.
|
|
66
|
-
i18n.
|
|
67
|
-
i18n.
|
|
68
|
-
i18n.
|
|
69
|
-
i18n.
|
|
70
|
-
i18n.
|
|
71
|
-
i18n.
|
|
72
|
-
i18n.
|
|
73
|
-
i18n.
|
|
74
|
-
i18n.
|
|
75
|
-
i18n.
|
|
76
|
-
i18n.
|
|
77
|
-
i18n.
|
|
78
|
-
i18n.
|
|
45
|
+
|
|
46
|
+
// Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
|
|
47
|
+
// custom translations from the datastore (added by the app adapter)
|
|
48
|
+
|
|
49
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
50
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
51
|
+
i18n.addResourceBundle('ar_IQ', namespace, ar_IQTranslations, true, false);
|
|
52
|
+
i18n.addResourceBundle('ar-IQ', namespace, ar_IQTranslations, true, false);
|
|
53
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
|
|
54
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
|
|
55
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
56
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
57
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false);
|
|
58
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false);
|
|
59
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
60
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
61
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
62
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
63
|
+
i18n.addResourceBundle('es_419', namespace, es_419Translations, true, false);
|
|
64
|
+
i18n.addResourceBundle('es-419', namespace, es_419Translations, true, false);
|
|
65
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
66
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
67
|
+
i18n.addResourceBundle('hi_IN', namespace, hi_INTranslations, true, false);
|
|
68
|
+
i18n.addResourceBundle('hi-IN', namespace, hi_INTranslations, true, false);
|
|
69
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false);
|
|
70
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false);
|
|
71
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
|
|
72
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
|
|
73
|
+
i18n.addResourceBundle('ko_KR', namespace, ko_KRTranslations, true, false);
|
|
74
|
+
i18n.addResourceBundle('ko-KR', namespace, ko_KRTranslations, true, false);
|
|
75
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
76
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
77
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false);
|
|
78
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false);
|
|
79
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
80
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
81
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
82
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
83
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
|
|
84
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
|
|
85
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
|
|
86
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
|
|
87
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
88
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
89
|
+
i18n.addResourceBundle('pt_BR', namespace, pt_BRTranslations, true, false);
|
|
90
|
+
i18n.addResourceBundle('pt-BR', namespace, pt_BRTranslations, true, false);
|
|
91
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
92
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
93
|
+
i18n.addResourceBundle('si', namespace, siTranslations, true, false);
|
|
94
|
+
i18n.addResourceBundle('si', namespace, siTranslations, true, false);
|
|
95
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
|
|
96
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
|
|
97
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
|
|
98
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
|
|
99
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
|
|
100
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
|
|
101
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
102
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
103
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
|
|
104
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
|
|
105
|
+
i18n.addResourceBundle('uz_Latn', namespace, uz_LatnTranslations, true, false);
|
|
106
|
+
i18n.addResourceBundle('uz-Latn', namespace, uz_LatnTranslations, true, false);
|
|
107
|
+
i18n.addResourceBundle('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
108
|
+
i18n.addResourceBundle('uz-Cyrl-UZ', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
109
|
+
i18n.addResourceBundle('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations, true, false);
|
|
110
|
+
i18n.addResourceBundle('uz-Latn-UZ', namespace, uz_UZ_LatnTranslations, true, false);
|
|
111
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
112
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
113
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
114
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
115
|
+
i18n.addResourceBundle('zh_CN', namespace, zh_CNTranslations, true, false);
|
|
116
|
+
i18n.addResourceBundle('zh-CN', namespace, zh_CNTranslations, true, false);
|
|
79
117
|
export default i18n;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/file-input",
|
|
3
|
-
"version": "10.16.
|
|
3
|
+
"version": "10.16.4",
|
|
4
4
|
"description": "UI FileInput",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@dhis2/prop-types": "^3.1.2",
|
|
37
|
-
"@dhis2-ui/button": "10.16.
|
|
38
|
-
"@dhis2-ui/field": "10.16.
|
|
39
|
-
"@dhis2-ui/label": "10.16.
|
|
40
|
-
"@dhis2-ui/loader": "10.16.
|
|
41
|
-
"@dhis2-ui/status-icon": "10.16.
|
|
42
|
-
"@dhis2/ui-constants": "10.16.
|
|
43
|
-
"@dhis2/ui-icons": "10.16.
|
|
37
|
+
"@dhis2-ui/button": "10.16.4",
|
|
38
|
+
"@dhis2-ui/field": "10.16.4",
|
|
39
|
+
"@dhis2-ui/label": "10.16.4",
|
|
40
|
+
"@dhis2-ui/loader": "10.16.4",
|
|
41
|
+
"@dhis2-ui/status-icon": "10.16.4",
|
|
42
|
+
"@dhis2/ui-constants": "10.16.4",
|
|
43
|
+
"@dhis2/ui-icons": "10.16.4",
|
|
44
44
|
"classnames": "^2.3.1",
|
|
45
45
|
"prop-types": "^15.7.2"
|
|
46
46
|
},
|
package/src/locales/index.js
CHANGED
|
@@ -44,39 +44,110 @@ import zhTranslations from './zh/translations.json'
|
|
|
44
44
|
import zh_CNTranslations from './zh_CN/translations.json'
|
|
45
45
|
|
|
46
46
|
const namespace = 'default'
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
i18n.
|
|
52
|
-
i18n.
|
|
53
|
-
|
|
54
|
-
i18n.
|
|
55
|
-
i18n.
|
|
56
|
-
|
|
57
|
-
i18n.
|
|
58
|
-
i18n.
|
|
59
|
-
|
|
60
|
-
i18n.
|
|
61
|
-
i18n.
|
|
62
|
-
|
|
63
|
-
i18n.
|
|
64
|
-
i18n.
|
|
65
|
-
|
|
66
|
-
i18n.
|
|
67
|
-
i18n.
|
|
68
|
-
|
|
69
|
-
i18n.
|
|
70
|
-
i18n.
|
|
71
|
-
|
|
72
|
-
i18n.
|
|
73
|
-
i18n.
|
|
74
|
-
|
|
75
|
-
i18n.
|
|
76
|
-
i18n.
|
|
77
|
-
|
|
78
|
-
i18n.
|
|
79
|
-
i18n.
|
|
80
|
-
|
|
47
|
+
|
|
48
|
+
// Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
|
|
49
|
+
// custom translations from the datastore (added by the app adapter)
|
|
50
|
+
|
|
51
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false)
|
|
52
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false)
|
|
53
|
+
|
|
54
|
+
i18n.addResourceBundle('ar_IQ', namespace, ar_IQTranslations, true, false)
|
|
55
|
+
i18n.addResourceBundle('ar-IQ', namespace, ar_IQTranslations, true, false)
|
|
56
|
+
|
|
57
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false)
|
|
58
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false)
|
|
59
|
+
|
|
60
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false)
|
|
61
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false)
|
|
62
|
+
|
|
63
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false)
|
|
64
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false)
|
|
65
|
+
|
|
66
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false)
|
|
67
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false)
|
|
68
|
+
|
|
69
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false)
|
|
70
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false)
|
|
71
|
+
|
|
72
|
+
i18n.addResourceBundle('es_419', namespace, es_419Translations, true, false)
|
|
73
|
+
i18n.addResourceBundle('es-419', namespace, es_419Translations, true, false)
|
|
74
|
+
|
|
75
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false)
|
|
76
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false)
|
|
77
|
+
|
|
78
|
+
i18n.addResourceBundle('hi_IN', namespace, hi_INTranslations, true, false)
|
|
79
|
+
i18n.addResourceBundle('hi-IN', namespace, hi_INTranslations, true, false)
|
|
80
|
+
|
|
81
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false)
|
|
82
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false)
|
|
83
|
+
|
|
84
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false)
|
|
85
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false)
|
|
86
|
+
|
|
87
|
+
i18n.addResourceBundle('ko_KR', namespace, ko_KRTranslations, true, false)
|
|
88
|
+
i18n.addResourceBundle('ko-KR', namespace, ko_KRTranslations, true, false)
|
|
89
|
+
|
|
90
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false)
|
|
91
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false)
|
|
92
|
+
|
|
93
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false)
|
|
94
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false)
|
|
95
|
+
|
|
96
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false)
|
|
97
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false)
|
|
98
|
+
|
|
99
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false)
|
|
100
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false)
|
|
101
|
+
|
|
102
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false)
|
|
103
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false)
|
|
104
|
+
|
|
105
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false)
|
|
106
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false)
|
|
107
|
+
|
|
108
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false)
|
|
109
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false)
|
|
110
|
+
|
|
111
|
+
i18n.addResourceBundle('pt_BR', namespace, pt_BRTranslations, true, false)
|
|
112
|
+
i18n.addResourceBundle('pt-BR', namespace, pt_BRTranslations, true, false)
|
|
113
|
+
|
|
114
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false)
|
|
115
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false)
|
|
116
|
+
|
|
117
|
+
i18n.addResourceBundle('si', namespace, siTranslations, true, false)
|
|
118
|
+
i18n.addResourceBundle('si', namespace, siTranslations, true, false)
|
|
119
|
+
|
|
120
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false)
|
|
121
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false)
|
|
122
|
+
|
|
123
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false)
|
|
124
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false)
|
|
125
|
+
|
|
126
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false)
|
|
127
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false)
|
|
128
|
+
|
|
129
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false)
|
|
130
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false)
|
|
131
|
+
|
|
132
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false)
|
|
133
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false)
|
|
134
|
+
|
|
135
|
+
i18n.addResourceBundle('uz_Latn', namespace, uz_LatnTranslations, true, false)
|
|
136
|
+
i18n.addResourceBundle('uz-Latn', namespace, uz_LatnTranslations, true, false)
|
|
137
|
+
|
|
138
|
+
i18n.addResourceBundle('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations, true, false)
|
|
139
|
+
i18n.addResourceBundle('uz-Cyrl-UZ', namespace, uz_UZ_CyrlTranslations, true, false)
|
|
140
|
+
|
|
141
|
+
i18n.addResourceBundle('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations, true, false)
|
|
142
|
+
i18n.addResourceBundle('uz-Latn-UZ', namespace, uz_UZ_LatnTranslations, true, false)
|
|
143
|
+
|
|
144
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false)
|
|
145
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false)
|
|
146
|
+
|
|
147
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false)
|
|
148
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false)
|
|
149
|
+
|
|
150
|
+
i18n.addResourceBundle('zh_CN', namespace, zh_CNTranslations, true, false)
|
|
151
|
+
i18n.addResourceBundle('zh-CN', namespace, zh_CNTranslations, true, false)
|
|
81
152
|
|
|
82
153
|
export default i18n
|