@dhis2-ui/organisation-unit-tree 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/__e2e__/children_as_child_nodes.js +8 -11
- package/build/cjs/__e2e__/common.js +19 -26
- package/build/cjs/__e2e__/controlled_expanded.js +7 -10
- package/build/cjs/__e2e__/displaying_loading_error.js +1 -4
- package/build/cjs/__e2e__/expanded.js +25 -34
- package/build/cjs/__e2e__/force_reload.js +15 -22
- package/build/cjs/__e2e__/get-organisation-unit-data.js +25 -29
- package/build/cjs/__e2e__/highlight.js +7 -10
- package/build/cjs/__e2e__/loading_state.js +7 -13
- package/build/cjs/__e2e__/multi_selection.js +8 -11
- package/build/cjs/__e2e__/no_selection.js +15 -21
- package/build/cjs/__e2e__/path_based_filtering.js +16 -22
- package/build/cjs/__e2e__/single_selection.js +10 -16
- package/build/cjs/__e2e__/sub_unit_as_root.js +5 -7
- package/build/cjs/__e2e__/tree_api.js +15 -21
- package/build/cjs/__stories__/custom-expanded-imperative-open.js +7 -10
- package/build/cjs/__stories__/custom-node-label.js +4 -5
- package/build/cjs/__stories__/development-stories.js +6 -8
- package/build/cjs/__stories__/force-reload-all.js +1 -2
- package/build/cjs/__stories__/loading-error-grandchild.js +1 -4
- package/build/cjs/__stories__/loading.js +1 -4
- package/build/cjs/__stories__/multiple-roots.js +9 -12
- package/build/cjs/__stories__/root-error.js +1 -4
- package/build/cjs/__stories__/root-loading.js +1 -4
- package/build/cjs/__stories__/shared.js +46 -79
- package/build/cjs/features/controlled_expanded/index.js +3 -6
- package/build/cjs/locales/index.js +49 -27
- package/build/cjs/organisation-unit-node/error-message.js +10 -13
- package/build/cjs/organisation-unit-node/label/disabled-selection-label.js +9 -12
- package/build/cjs/organisation-unit-node/label/icon-empty.js +19 -22
- package/build/cjs/organisation-unit-node/label/icon-folder-closed.js +25 -28
- package/build/cjs/organisation-unit-node/label/icon-folder-open.js +34 -37
- package/build/cjs/organisation-unit-node/label/icon-single.js +28 -31
- package/build/cjs/organisation-unit-node/label/icon.js +6 -7
- package/build/cjs/organisation-unit-node/label/iconized-checkbox.js +12 -13
- package/build/cjs/organisation-unit-node/label/label-container.js +13 -16
- package/build/cjs/organisation-unit-node/label/label.js +27 -30
- package/build/cjs/organisation-unit-node/label/single-selection-label.js +18 -21
- package/build/cjs/organisation-unit-node/organisation-unit-node-children.js +27 -29
- package/build/cjs/organisation-unit-node/organisation-unit-node.js +22 -23
- package/build/cjs/organisation-unit-node/use-open-state.js +8 -9
- package/build/cjs/organisation-unit-node/use-org-children.js +14 -21
- package/build/cjs/organisation-unit-node/use-org-children.test.js +40 -59
- package/build/cjs/organisation-unit-node/use-org-data/use-org-data.js +13 -20
- package/build/cjs/organisation-unit-node/use-org-data/use-org-data.test.js +17 -27
- package/build/cjs/organisation-unit-tree/default-render-node-label/default-render-node-label.js +3 -6
- package/build/cjs/organisation-unit-tree/organisation-unit-tree-root-error.js +9 -12
- package/build/cjs/organisation-unit-tree/organisation-unit-tree-root-loading.js +10 -13
- package/build/cjs/organisation-unit-tree/organisation-unit-tree.js +24 -26
- package/build/cjs/organisation-unit-tree/use-expanded/create-expand-handlers.js +14 -17
- package/build/cjs/organisation-unit-tree/use-expanded/use-expanded.js +8 -9
- package/build/cjs/organisation-unit-tree/use-root-org-data/patch-missing-display-name.js +1 -2
- package/build/cjs/organisation-unit-tree/use-root-org-data/use-root-org-data.js +10 -14
- package/build/cjs/organisation-unit-tree/use-root-org-data/use-root-org-unit.test.js +32 -46
- package/build/es/__e2e__/children_as_child_nodes.js +8 -11
- package/build/es/__e2e__/common.js +18 -24
- package/build/es/__e2e__/controlled_expanded.js +6 -8
- package/build/es/__e2e__/displaying_loading_error.js +1 -4
- package/build/es/__e2e__/expanded.js +25 -34
- package/build/es/__e2e__/force_reload.js +14 -20
- package/build/es/__e2e__/get-organisation-unit-data.js +25 -29
- package/build/es/__e2e__/highlight.js +7 -10
- package/build/es/__e2e__/loading_state.js +7 -13
- package/build/es/__e2e__/multi_selection.js +8 -11
- package/build/es/__e2e__/no_selection.js +15 -21
- package/build/es/__e2e__/path_based_filtering.js +16 -22
- package/build/es/__e2e__/single_selection.js +10 -16
- package/build/es/__e2e__/sub_unit_as_root.js +4 -5
- package/build/es/__e2e__/tree_api.js +15 -21
- package/build/es/__stories__/custom-expanded-imperative-open.js +6 -8
- package/build/es/__stories__/custom-node-label.js +4 -5
- package/build/es/__stories__/development-stories.js +5 -6
- package/build/es/__stories__/loading-error-grandchild.js +1 -4
- package/build/es/__stories__/loading.js +1 -4
- package/build/es/__stories__/multiple-roots.js +9 -12
- package/build/es/__stories__/root-error.js +1 -4
- package/build/es/__stories__/root-loading.js +1 -4
- package/build/es/__stories__/shared.js +45 -77
- package/build/es/features/controlled_expanded/index.js +3 -6
- package/build/es/locales/index.js +40 -18
- package/build/es/organisation-unit-node/error-message.js +10 -13
- package/build/es/organisation-unit-node/label/disabled-selection-label.js +9 -12
- package/build/es/organisation-unit-node/label/icon-empty.js +19 -22
- package/build/es/organisation-unit-node/label/icon-folder-closed.js +25 -28
- package/build/es/organisation-unit-node/label/icon-folder-open.js +34 -37
- package/build/es/organisation-unit-node/label/icon-single.js +28 -31
- package/build/es/organisation-unit-node/label/icon.js +6 -7
- package/build/es/organisation-unit-node/label/iconized-checkbox.js +12 -13
- package/build/es/organisation-unit-node/label/label-container.js +13 -16
- package/build/es/organisation-unit-node/label/label.js +27 -30
- package/build/es/organisation-unit-node/label/single-selection-label.js +18 -21
- package/build/es/organisation-unit-node/organisation-unit-node-children.js +27 -29
- package/build/es/organisation-unit-node/organisation-unit-node.js +22 -23
- package/build/es/organisation-unit-node/use-open-state.js +8 -9
- package/build/es/organisation-unit-node/use-org-children.js +14 -21
- package/build/es/organisation-unit-node/use-org-children.test.js +40 -59
- package/build/es/organisation-unit-node/use-org-data/use-org-data.js +13 -20
- package/build/es/organisation-unit-node/use-org-data/use-org-data.test.js +17 -27
- package/build/es/organisation-unit-tree/default-render-node-label/default-render-node-label.js +3 -6
- package/build/es/organisation-unit-tree/organisation-unit-tree-root-error.js +9 -12
- package/build/es/organisation-unit-tree/organisation-unit-tree-root-loading.js +10 -13
- package/build/es/organisation-unit-tree/organisation-unit-tree.js +23 -24
- package/build/es/organisation-unit-tree/use-expanded/create-expand-handlers.js +14 -17
- package/build/es/organisation-unit-tree/use-expanded/use-expanded.js +8 -9
- package/build/es/organisation-unit-tree/use-root-org-data/patch-missing-display-name.js +1 -2
- package/build/es/organisation-unit-tree/use-root-org-data/use-root-org-data.js +10 -14
- package/build/es/organisation-unit-tree/use-root-org-data/use-root-org-unit.test.js +32 -46
- package/package.json +6 -6
- package/src/locales/index.js +57 -18
- package/src/organisation-unit-tree/use-root-org-data/use-root-org-unit.test.js +14 -14
|
@@ -8,24 +8,21 @@ var _button = require("@dhis2-ui/button");
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _index = require("../index.js");
|
|
10
10
|
var _shared = require("./shared.js");
|
|
11
|
-
function
|
|
12
|
-
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; }
|
|
11
|
+
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); }
|
|
13
12
|
const CustomExpandedImperativeOpen = () => {
|
|
14
13
|
const orgUnit2Path = '/A0000000000/A0000000001';
|
|
15
14
|
const initiallyExpanded = (0, _index.getAllExpandedOrgUnitPaths)([]);
|
|
16
15
|
const [expanded, setExpanded] = (0, _react.useState)(initiallyExpanded);
|
|
17
|
-
const handleExpand =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
16
|
+
const handleExpand = ({
|
|
17
|
+
path
|
|
18
|
+
}) => {
|
|
21
19
|
if (!expanded.includes(path)) {
|
|
22
20
|
setExpanded([...expanded, path]);
|
|
23
21
|
}
|
|
24
22
|
};
|
|
25
|
-
const handleCollapse =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref2;
|
|
23
|
+
const handleCollapse = ({
|
|
24
|
+
path
|
|
25
|
+
}) => {
|
|
29
26
|
const pathIndex = expanded.indexOf(path);
|
|
30
27
|
if (pathIndex !== -1) {
|
|
31
28
|
const updatedExpanded = pathIndex === 0 ? expanded.slice(1) : [...expanded.slice(0, pathIndex), ...expanded.slice(pathIndex + 1)];
|
|
@@ -12,11 +12,10 @@ const CustomNodeLabel = () => /*#__PURE__*/_react.default.createElement(_index.O
|
|
|
12
12
|
name: "Root org unit",
|
|
13
13
|
roots: "A0000000000",
|
|
14
14
|
initiallyExpanded: ['/A0000000000/A0000000001'],
|
|
15
|
-
renderNodeLabel:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = _ref;
|
|
15
|
+
renderNodeLabel: ({
|
|
16
|
+
label,
|
|
17
|
+
node
|
|
18
|
+
}) => {
|
|
20
19
|
if (node.path !== '/A0000000000/A0000000001') {
|
|
21
20
|
return label;
|
|
22
21
|
}
|
|
@@ -7,15 +7,13 @@ exports.DxWithRealBackend = exports.DxSingleSelection = exports.DxNoSelection =
|
|
|
7
7
|
var _appRuntime = require("@dhis2/app-runtime");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _index = require("../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 _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
-
const DX_onChange = (selected, setSelected, singleSelection) =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
12
|
+
const DX_onChange = (selected, setSelected, singleSelection) => ({
|
|
13
|
+
id,
|
|
14
|
+
path,
|
|
15
|
+
checked
|
|
16
|
+
}) => {
|
|
19
17
|
console.log('onChange', {
|
|
20
18
|
path,
|
|
21
19
|
id,
|
|
@@ -9,8 +9,7 @@ var _ui = require("@dhis2/ui");
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _index = require("../index.js");
|
|
11
11
|
var _shared = require("./shared.js");
|
|
12
|
-
function
|
|
13
|
-
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; }
|
|
12
|
+
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); }
|
|
14
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
14
|
const ForceReloadAll = () => {
|
|
16
15
|
const [forceReload, _setForceReload] = (0, _react.useState)(false);
|
|
@@ -12,10 +12,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
const LoadingErrorGrandchild = () => /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
|
|
13
13
|
data: {
|
|
14
14
|
..._shared.customData,
|
|
15
|
-
organisationUnits:
|
|
16
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
17
|
-
args[_key] = arguments[_key];
|
|
18
|
-
}
|
|
15
|
+
organisationUnits: (...args) => {
|
|
19
16
|
const [, {
|
|
20
17
|
id
|
|
21
18
|
}] = args;
|
|
@@ -12,10 +12,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
const Loading = () => /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
|
|
13
13
|
data: {
|
|
14
14
|
..._shared.customData,
|
|
15
|
-
organisationUnits:
|
|
16
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
17
|
-
args[_key] = arguments[_key];
|
|
18
|
-
}
|
|
15
|
+
organisationUnits: (...args) => {
|
|
19
16
|
const [, {
|
|
20
17
|
id
|
|
21
18
|
}] = args;
|
|
@@ -8,17 +8,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _index = require("../index.js");
|
|
9
9
|
var _shared = require("./shared.js");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const MultipleRoots = (_,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
initiallyExpanded: ['/A0000000000/A0000000001']
|
|
21
|
-
});
|
|
22
|
-
};
|
|
11
|
+
const MultipleRoots = (_, {
|
|
12
|
+
onChange,
|
|
13
|
+
selected
|
|
14
|
+
}) => /*#__PURE__*/_react.default.createElement(_index.OrganisationUnitTree, {
|
|
15
|
+
selected: selected,
|
|
16
|
+
onChange: onChange,
|
|
17
|
+
roots: ['A0000000000', 'A0000000001'],
|
|
18
|
+
initiallyExpanded: ['/A0000000000/A0000000001']
|
|
19
|
+
});
|
|
23
20
|
exports.MultipleRoots = MultipleRoots;
|
|
24
21
|
MultipleRoots.decorators = [(0, _shared.createDecoratorStatefulMultiSelection)(), (0, _shared.createDecoratorCustomDataProvider)()];
|
|
@@ -12,10 +12,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
const RootError = () => /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
|
|
13
13
|
data: {
|
|
14
14
|
..._shared.customData,
|
|
15
|
-
organisationUnits:
|
|
16
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
17
|
-
args[_key] = arguments[_key];
|
|
18
|
-
}
|
|
15
|
+
organisationUnits: (...args) => {
|
|
19
16
|
const [, {
|
|
20
17
|
id
|
|
21
18
|
}] = args;
|
|
@@ -12,10 +12,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
const RootLoading = () => /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
|
|
13
13
|
data: {
|
|
14
14
|
..._shared.customData,
|
|
15
|
-
organisationUnits:
|
|
16
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
17
|
-
args[_key] = arguments[_key];
|
|
18
|
-
}
|
|
15
|
+
organisationUnits: (...args) => {
|
|
19
16
|
const [, {
|
|
20
17
|
id
|
|
21
18
|
}] = args;
|
|
@@ -7,68 +7,43 @@ exports.onExpand = exports.onCollapse = exports.onChildrenLoaded = exports.onCha
|
|
|
7
7
|
var _appRuntime = require("@dhis2/app-runtime");
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
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
|
const log = exports.log = true;
|
|
14
|
-
const onChange =
|
|
15
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16
|
-
args[_key] = arguments[_key];
|
|
17
|
-
}
|
|
18
|
-
return log && console.log('onChange', ...args);
|
|
19
|
-
};
|
|
13
|
+
const onChange = (...args) => log && console.log('onChange', ...args);
|
|
20
14
|
exports.onChange = onChange;
|
|
21
|
-
const onExpand =
|
|
22
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
23
|
-
args[_key2] = arguments[_key2];
|
|
24
|
-
}
|
|
25
|
-
return log && console.log('onExpand', ...args);
|
|
26
|
-
};
|
|
15
|
+
const onExpand = (...args) => log && console.log('onExpand', ...args);
|
|
27
16
|
exports.onExpand = onExpand;
|
|
28
|
-
const onCollapse =
|
|
29
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
30
|
-
args[_key3] = arguments[_key3];
|
|
31
|
-
}
|
|
32
|
-
return log && console.log('onCollapse', ...args);
|
|
33
|
-
};
|
|
17
|
+
const onCollapse = (...args) => log && console.log('onCollapse', ...args);
|
|
34
18
|
exports.onCollapse = onCollapse;
|
|
35
|
-
const onChildrenLoaded =
|
|
36
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
37
|
-
args[_key4] = arguments[_key4];
|
|
38
|
-
}
|
|
39
|
-
return log && console.log('onChildrenLoaded', ...args);
|
|
40
|
-
};
|
|
19
|
+
const onChildrenLoaded = (...args) => log && console.log('onChildrenLoaded', ...args);
|
|
41
20
|
exports.onChildrenLoaded = onChildrenLoaded;
|
|
42
|
-
const createResponse =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
21
|
+
const createResponse = ({
|
|
22
|
+
fields,
|
|
23
|
+
id,
|
|
24
|
+
path,
|
|
25
|
+
displayName,
|
|
26
|
+
children
|
|
27
|
+
}) => ({
|
|
28
|
+
...(fields.includes('id') ? {
|
|
29
|
+
id
|
|
30
|
+
} : {}),
|
|
31
|
+
...(fields.includes('path') ? {
|
|
32
|
+
path
|
|
33
|
+
} : {}),
|
|
34
|
+
...(fields.includes('displayName') ? {
|
|
35
|
+
displayName
|
|
36
|
+
} : {}),
|
|
37
|
+
...(fields.includes('children::size') ? {
|
|
38
|
+
children: children.length
|
|
39
|
+
} : {}),
|
|
40
|
+
...(fields.includes('children[id,path,displayName]') ? {
|
|
48
41
|
children
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
...(fields.includes('path') ? {
|
|
55
|
-
path
|
|
56
|
-
} : {}),
|
|
57
|
-
...(fields.includes('displayName') ? {
|
|
58
|
-
displayName
|
|
59
|
-
} : {}),
|
|
60
|
-
...(fields.includes('children::size') ? {
|
|
61
|
-
children: children.length
|
|
62
|
-
} : {}),
|
|
63
|
-
...(fields.includes('children[id,path,displayName]') ? {
|
|
64
|
-
children
|
|
65
|
-
} : {})
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
const getOrganisationUnitData = (id, _ref2) => {
|
|
69
|
-
let {
|
|
70
|
-
fields
|
|
71
|
-
} = _ref2;
|
|
42
|
+
} : {})
|
|
43
|
+
});
|
|
44
|
+
const getOrganisationUnitData = (id, {
|
|
45
|
+
fields
|
|
46
|
+
}) => {
|
|
72
47
|
let data;
|
|
73
48
|
if (id === 'A0000000000') {
|
|
74
49
|
data = createResponse({
|
|
@@ -171,11 +146,10 @@ const getOrganisationUnitData = (id, _ref2) => {
|
|
|
171
146
|
};
|
|
172
147
|
exports.getOrganisationUnitData = getOrganisationUnitData;
|
|
173
148
|
const customData = exports.customData = {
|
|
174
|
-
organisationUnits: (_,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
} = _ref3;
|
|
149
|
+
organisationUnits: (_, {
|
|
150
|
+
id,
|
|
151
|
+
params = {}
|
|
152
|
+
}) => {
|
|
179
153
|
const data = getOrganisationUnitData(id, params);
|
|
180
154
|
if (!data) {
|
|
181
155
|
return Promise.reject(new Error('404 - Org unit not found'));
|
|
@@ -183,18 +157,14 @@ const customData = exports.customData = {
|
|
|
183
157
|
return Promise.resolve(data);
|
|
184
158
|
}
|
|
185
159
|
};
|
|
186
|
-
const StatefulMultiSelectionWrapper =
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
} = _ref4;
|
|
160
|
+
const StatefulMultiSelectionWrapper = ({
|
|
161
|
+
children,
|
|
162
|
+
onSelectionChange = () => null
|
|
163
|
+
}) => {
|
|
191
164
|
const [selected, setSelected] = (0, _react.useState)([]);
|
|
192
165
|
return children({
|
|
193
166
|
selected,
|
|
194
|
-
onChange:
|
|
195
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
196
|
-
args[_key5] = arguments[_key5];
|
|
197
|
-
}
|
|
167
|
+
onChange: (...args) => {
|
|
198
168
|
onChange(...args);
|
|
199
169
|
const [{
|
|
200
170
|
selected: newSelected
|
|
@@ -212,16 +182,13 @@ StatefulMultiSelectionWrapper.propTypes = {
|
|
|
212
182
|
const createDecoratorStatefulMultiSelection = args => {
|
|
213
183
|
return Story => /*#__PURE__*/_react.default.createElement(StatefulMultiSelectionWrapper, {
|
|
214
184
|
onSelectionChange: args === null || args === void 0 ? void 0 : args.onSelectionChange
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
onChange: onChange
|
|
223
|
-
});
|
|
224
|
-
});
|
|
185
|
+
}, ({
|
|
186
|
+
selected,
|
|
187
|
+
onChange
|
|
188
|
+
}) => /*#__PURE__*/_react.default.createElement(Story, {
|
|
189
|
+
selected: selected,
|
|
190
|
+
onChange: onChange
|
|
191
|
+
}));
|
|
225
192
|
};
|
|
226
193
|
exports.createDecoratorStatefulMultiSelection = createDecoratorStatefulMultiSelection;
|
|
227
194
|
const createDecoratorCustomDataProvider = args => {
|
|
@@ -58,12 +58,9 @@ const expectOrgUnitsToNotBeDisplayed = ids => {
|
|
|
58
58
|
const curData = (0, _getOrganisationUnitData.getOrganisationUnitData)(cur, {
|
|
59
59
|
fields: ['children[id,path,displayName]']
|
|
60
60
|
});
|
|
61
|
-
const childrenIds = curData.children.map(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} = _ref;
|
|
65
|
-
return id;
|
|
66
|
-
});
|
|
61
|
+
const childrenIds = curData.children.map(({
|
|
62
|
+
id
|
|
63
|
+
}) => id);
|
|
67
64
|
return [...acc, ...childrenIds];
|
|
68
65
|
}, []);
|
|
69
66
|
expectOrgUnitsToNotBeDisplayed(hiddenChildrenIds);
|
|
@@ -14,15 +14,15 @@ var _translations6 = _interopRequireDefault(require("./fr/translations.json"));
|
|
|
14
14
|
var _translations7 = _interopRequireDefault(require("./lo/translations.json"));
|
|
15
15
|
var _translations8 = _interopRequireDefault(require("./nb/translations.json"));
|
|
16
16
|
var _translations9 = _interopRequireDefault(require("./nl/translations.json"));
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
17
|
+
var _translations0 = _interopRequireDefault(require("./pt/translations.json"));
|
|
18
|
+
var _translations1 = _interopRequireDefault(require("./ru/translations.json"));
|
|
19
|
+
var _translations10 = _interopRequireDefault(require("./uk/translations.json"));
|
|
20
|
+
var _translations11 = _interopRequireDefault(require("./uz_Latn/translations.json"));
|
|
21
|
+
var _translations12 = _interopRequireDefault(require("./uz_UZ_Cyrl/translations.json"));
|
|
22
|
+
var _translations13 = _interopRequireDefault(require("./uz_UZ_Latn/translations.json"));
|
|
23
|
+
var _translations14 = _interopRequireDefault(require("./vi/translations.json"));
|
|
24
|
+
var _translations15 = _interopRequireDefault(require("./zh/translations.json"));
|
|
25
|
+
var _translations16 = _interopRequireDefault(require("./zh_CN/translations.json"));
|
|
26
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
27
|
//------------------------------------------------------------------------------
|
|
28
28
|
// <auto-generated>
|
|
@@ -34,22 +34,44 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
34
34
|
//------------------------------------------------------------------------------
|
|
35
35
|
|
|
36
36
|
const namespace = 'default';
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_d2I18n.default.
|
|
42
|
-
_d2I18n.default.
|
|
43
|
-
_d2I18n.default.
|
|
44
|
-
_d2I18n.default.
|
|
45
|
-
_d2I18n.default.
|
|
46
|
-
_d2I18n.default.
|
|
47
|
-
_d2I18n.default.
|
|
48
|
-
_d2I18n.default.
|
|
49
|
-
_d2I18n.default.
|
|
50
|
-
_d2I18n.default.
|
|
51
|
-
_d2I18n.default.
|
|
52
|
-
_d2I18n.default.
|
|
53
|
-
_d2I18n.default.
|
|
54
|
-
_d2I18n.default.
|
|
37
|
+
|
|
38
|
+
// Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
|
|
39
|
+
// custom translations from the datastore (added by the app adapter)
|
|
40
|
+
|
|
41
|
+
_d2I18n.default.addResourceBundle('ar', namespace, _translations.default, true, false);
|
|
42
|
+
_d2I18n.default.addResourceBundle('ar', namespace, _translations.default, true, false);
|
|
43
|
+
_d2I18n.default.addResourceBundle('cs', namespace, _translations2.default, true, false);
|
|
44
|
+
_d2I18n.default.addResourceBundle('cs', namespace, _translations2.default, true, false);
|
|
45
|
+
_d2I18n.default.addResourceBundle('en', namespace, _translations3.default, true, false);
|
|
46
|
+
_d2I18n.default.addResourceBundle('en', namespace, _translations3.default, true, false);
|
|
47
|
+
_d2I18n.default.addResourceBundle('es', namespace, _translations4.default, true, false);
|
|
48
|
+
_d2I18n.default.addResourceBundle('es', namespace, _translations4.default, true, false);
|
|
49
|
+
_d2I18n.default.addResourceBundle('es_419', namespace, _translations5.default, true, false);
|
|
50
|
+
_d2I18n.default.addResourceBundle('es-419', namespace, _translations5.default, true, false);
|
|
51
|
+
_d2I18n.default.addResourceBundle('fr', namespace, _translations6.default, true, false);
|
|
52
|
+
_d2I18n.default.addResourceBundle('fr', namespace, _translations6.default, true, false);
|
|
53
|
+
_d2I18n.default.addResourceBundle('lo', namespace, _translations7.default, true, false);
|
|
54
|
+
_d2I18n.default.addResourceBundle('lo', namespace, _translations7.default, true, false);
|
|
55
|
+
_d2I18n.default.addResourceBundle('nb', namespace, _translations8.default, true, false);
|
|
56
|
+
_d2I18n.default.addResourceBundle('nb', namespace, _translations8.default, true, false);
|
|
57
|
+
_d2I18n.default.addResourceBundle('nl', namespace, _translations9.default, true, false);
|
|
58
|
+
_d2I18n.default.addResourceBundle('nl', namespace, _translations9.default, true, false);
|
|
59
|
+
_d2I18n.default.addResourceBundle('pt', namespace, _translations0.default, true, false);
|
|
60
|
+
_d2I18n.default.addResourceBundle('pt', namespace, _translations0.default, true, false);
|
|
61
|
+
_d2I18n.default.addResourceBundle('ru', namespace, _translations1.default, true, false);
|
|
62
|
+
_d2I18n.default.addResourceBundle('ru', namespace, _translations1.default, true, false);
|
|
63
|
+
_d2I18n.default.addResourceBundle('uk', namespace, _translations10.default, true, false);
|
|
64
|
+
_d2I18n.default.addResourceBundle('uk', namespace, _translations10.default, true, false);
|
|
65
|
+
_d2I18n.default.addResourceBundle('uz_Latn', namespace, _translations11.default, true, false);
|
|
66
|
+
_d2I18n.default.addResourceBundle('uz-Latn', namespace, _translations11.default, true, false);
|
|
67
|
+
_d2I18n.default.addResourceBundle('uz_UZ_Cyrl', namespace, _translations12.default, true, false);
|
|
68
|
+
_d2I18n.default.addResourceBundle('uz-Cyrl-UZ', namespace, _translations12.default, true, false);
|
|
69
|
+
_d2I18n.default.addResourceBundle('uz_UZ_Latn', namespace, _translations13.default, true, false);
|
|
70
|
+
_d2I18n.default.addResourceBundle('uz-Latn-UZ', namespace, _translations13.default, true, false);
|
|
71
|
+
_d2I18n.default.addResourceBundle('vi', namespace, _translations14.default, true, false);
|
|
72
|
+
_d2I18n.default.addResourceBundle('vi', namespace, _translations14.default, true, false);
|
|
73
|
+
_d2I18n.default.addResourceBundle('zh', namespace, _translations15.default, true, false);
|
|
74
|
+
_d2I18n.default.addResourceBundle('zh', namespace, _translations15.default, true, false);
|
|
75
|
+
_d2I18n.default.addResourceBundle('zh_CN', namespace, _translations16.default, true, false);
|
|
76
|
+
_d2I18n.default.addResourceBundle('zh-CN', namespace, _translations16.default, true, false);
|
|
55
77
|
var _default = exports.default = _d2I18n.default;
|
|
@@ -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 ErrorMessage =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
dynamic: [_uiConstants.colors.grey800, _uiConstants.spacers.dp4, _uiConstants.theme.error]
|
|
23
|
-
}, [`span.__jsx-style-dynamic-selector{font-size:14px;color:${_uiConstants.colors.grey800};margin:${_uiConstants.spacers.dp4};color:${_uiConstants.theme.error};}`]));
|
|
24
|
-
};
|
|
12
|
+
const ErrorMessage = ({
|
|
13
|
+
children,
|
|
14
|
+
dataTest
|
|
15
|
+
}) => /*#__PURE__*/_react.default.createElement("span", {
|
|
16
|
+
"data-test": `${dataTest}-error`,
|
|
17
|
+
className: _style.default.dynamic([["3198585030", [_uiConstants.colors.grey800, _uiConstants.spacers.dp4, _uiConstants.theme.error]]])
|
|
18
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
19
|
+
id: "3198585030",
|
|
20
|
+
dynamic: [_uiConstants.colors.grey800, _uiConstants.spacers.dp4, _uiConstants.theme.error]
|
|
21
|
+
}, [`span.__jsx-style-dynamic-selector{font-size:14px;color:${_uiConstants.colors.grey800};margin:${_uiConstants.spacers.dp4};color:${_uiConstants.theme.error};}`]));
|
|
25
22
|
exports.ErrorMessage = ErrorMessage;
|
|
26
23
|
ErrorMessage.propTypes = {
|
|
27
24
|
children: _propTypes.default.any.isRequired,
|
|
@@ -15,18 +15,15 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
15
15
|
* @param {bool} [props.loading]
|
|
16
16
|
* @returns {React.Component}
|
|
17
17
|
*/
|
|
18
|
-
const DisabledSelectionLabel =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onChange: onToggleOpen
|
|
28
|
-
}, children);
|
|
29
|
-
};
|
|
18
|
+
const DisabledSelectionLabel = ({
|
|
19
|
+
children,
|
|
20
|
+
loading,
|
|
21
|
+
onToggleOpen
|
|
22
|
+
}) => /*#__PURE__*/_react.default.createElement(_singleSelectionLabel.SingleSelectionLabel, {
|
|
23
|
+
checked: false,
|
|
24
|
+
loading: loading,
|
|
25
|
+
onChange: onToggleOpen
|
|
26
|
+
}, children);
|
|
30
27
|
exports.DisabledSelectionLabel = DisabledSelectionLabel;
|
|
31
28
|
DisabledSelectionLabel.propTypes = {
|
|
32
29
|
children: _propTypes.default.any.isRequired,
|
|
@@ -8,28 +8,25 @@ 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 IconEmpty =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
id: "3201893673"
|
|
31
|
-
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
32
|
-
};
|
|
11
|
+
const IconEmpty = ({
|
|
12
|
+
dataTest
|
|
13
|
+
}) => /*#__PURE__*/_react.default.createElement("svg", {
|
|
14
|
+
height: "18px",
|
|
15
|
+
version: "1.1",
|
|
16
|
+
viewBox: "0 0 18 18",
|
|
17
|
+
width: "18px",
|
|
18
|
+
"data-test": `${dataTest}-iconempty`,
|
|
19
|
+
className: "jsx-3201893673"
|
|
20
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
21
|
+
fill: "none",
|
|
22
|
+
fillRule: "evenodd",
|
|
23
|
+
id: "icon/empty",
|
|
24
|
+
stroke: "none",
|
|
25
|
+
strokeWidth: "1",
|
|
26
|
+
className: "jsx-3201893673"
|
|
27
|
+
}), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
28
|
+
id: "3201893673"
|
|
29
|
+
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
33
30
|
exports.IconEmpty = IconEmpty;
|
|
34
31
|
IconEmpty.propTypes = {
|
|
35
32
|
dataTest: _propTypes.default.string.isRequired
|
|
@@ -8,34 +8,31 @@ 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 IconFolderClosed =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
id: "3201893673"
|
|
37
|
-
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
38
|
-
};
|
|
11
|
+
const IconFolderClosed = ({
|
|
12
|
+
dataTest
|
|
13
|
+
}) => /*#__PURE__*/_react.default.createElement("svg", {
|
|
14
|
+
width: "18px",
|
|
15
|
+
height: "18px",
|
|
16
|
+
viewBox: "0 0 18 18",
|
|
17
|
+
version: "1.1",
|
|
18
|
+
"data-test": `${dataTest}-iconfolderclosed`,
|
|
19
|
+
className: "jsx-3201893673"
|
|
20
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
21
|
+
id: "icon/folder/closed",
|
|
22
|
+
stroke: "none",
|
|
23
|
+
strokeWidth: "1",
|
|
24
|
+
fill: "none",
|
|
25
|
+
fillRule: "evenodd",
|
|
26
|
+
className: "jsx-3201893673"
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
28
|
+
d: "M2,3.5 C1.17157288,3.5 0.5,4.17157288 0.5,5 L0.5,13 C0.5,13.8284271 1.17157288,14.5 2,14.5 L12,14.5 C12.8284271,14.5 13.5,13.8284271 13.5,13 L13.5,7 C13.5,6.17157288 12.8284271,5.5 12,5.5 L6.69098301,5.5 L5.82917961,3.7763932 C5.7444836,3.60700119 5.57135204,3.5 5.38196601,3.5 L2,3.5 Z",
|
|
29
|
+
id: "Path-2",
|
|
30
|
+
stroke: "#6C7787",
|
|
31
|
+
fill: "#D5DDE5",
|
|
32
|
+
className: "jsx-3201893673"
|
|
33
|
+
})), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
34
|
+
id: "3201893673"
|
|
35
|
+
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
39
36
|
exports.IconFolderClosed = IconFolderClosed;
|
|
40
37
|
IconFolderClosed.propTypes = {
|
|
41
38
|
dataTest: _propTypes.default.string.isRequired
|