@dhis2-ui/organisation-unit-tree 10.16.3 → 10.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/__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
|
@@ -5,10 +5,7 @@ import { customData, onChange } from './shared.js';
|
|
|
5
5
|
export const Loading = () => /*#__PURE__*/React.createElement(CustomDataProvider, {
|
|
6
6
|
data: {
|
|
7
7
|
...customData,
|
|
8
|
-
organisationUnits:
|
|
9
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10
|
-
args[_key] = arguments[_key];
|
|
11
|
-
}
|
|
8
|
+
organisationUnits: (...args) => {
|
|
12
9
|
const [, {
|
|
13
10
|
id
|
|
14
11
|
}] = args;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OrganisationUnitTree } from '../index.js';
|
|
3
3
|
import { createDecoratorCustomDataProvider, createDecoratorStatefulMultiSelection } from './shared.js';
|
|
4
|
-
export const MultipleRoots = (_,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
initiallyExpanded: ['/A0000000000/A0000000001']
|
|
14
|
-
});
|
|
15
|
-
};
|
|
4
|
+
export const MultipleRoots = (_, {
|
|
5
|
+
onChange,
|
|
6
|
+
selected
|
|
7
|
+
}) => /*#__PURE__*/React.createElement(OrganisationUnitTree, {
|
|
8
|
+
selected: selected,
|
|
9
|
+
onChange: onChange,
|
|
10
|
+
roots: ['A0000000000', 'A0000000001'],
|
|
11
|
+
initiallyExpanded: ['/A0000000000/A0000000001']
|
|
12
|
+
});
|
|
16
13
|
MultipleRoots.decorators = [createDecoratorStatefulMultiSelection(), createDecoratorCustomDataProvider()];
|
|
@@ -5,10 +5,7 @@ import { customData, onChange } from './shared.js';
|
|
|
5
5
|
export const RootError = () => /*#__PURE__*/React.createElement(CustomDataProvider, {
|
|
6
6
|
data: {
|
|
7
7
|
...customData,
|
|
8
|
-
organisationUnits:
|
|
9
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10
|
-
args[_key] = arguments[_key];
|
|
11
|
-
}
|
|
8
|
+
organisationUnits: (...args) => {
|
|
12
9
|
const [, {
|
|
13
10
|
id
|
|
14
11
|
}] = args;
|
|
@@ -5,10 +5,7 @@ import { customData, onChange } from './shared.js';
|
|
|
5
5
|
export const RootLoading = () => /*#__PURE__*/React.createElement(CustomDataProvider, {
|
|
6
6
|
data: {
|
|
7
7
|
...customData,
|
|
8
|
-
organisationUnits:
|
|
9
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10
|
-
args[_key] = arguments[_key];
|
|
11
|
-
}
|
|
8
|
+
organisationUnits: (...args) => {
|
|
12
9
|
const [, {
|
|
13
10
|
id
|
|
14
11
|
}] = args;
|
|
@@ -2,60 +2,36 @@ import { CustomDataProvider } from '@dhis2/app-runtime';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
export const log = true;
|
|
5
|
-
export const onChange =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const createResponse = _ref => {
|
|
30
|
-
let {
|
|
31
|
-
fields,
|
|
32
|
-
id,
|
|
33
|
-
path,
|
|
34
|
-
displayName,
|
|
5
|
+
export const onChange = (...args) => log && console.log('onChange', ...args);
|
|
6
|
+
export const onExpand = (...args) => log && console.log('onExpand', ...args);
|
|
7
|
+
export const onCollapse = (...args) => log && console.log('onCollapse', ...args);
|
|
8
|
+
export const onChildrenLoaded = (...args) => log && console.log('onChildrenLoaded', ...args);
|
|
9
|
+
const createResponse = ({
|
|
10
|
+
fields,
|
|
11
|
+
id,
|
|
12
|
+
path,
|
|
13
|
+
displayName,
|
|
14
|
+
children
|
|
15
|
+
}) => ({
|
|
16
|
+
...(fields.includes('id') ? {
|
|
17
|
+
id
|
|
18
|
+
} : {}),
|
|
19
|
+
...(fields.includes('path') ? {
|
|
20
|
+
path
|
|
21
|
+
} : {}),
|
|
22
|
+
...(fields.includes('displayName') ? {
|
|
23
|
+
displayName
|
|
24
|
+
} : {}),
|
|
25
|
+
...(fields.includes('children::size') ? {
|
|
26
|
+
children: children.length
|
|
27
|
+
} : {}),
|
|
28
|
+
...(fields.includes('children[id,path,displayName]') ? {
|
|
35
29
|
children
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
...(fields.includes('path') ? {
|
|
42
|
-
path
|
|
43
|
-
} : {}),
|
|
44
|
-
...(fields.includes('displayName') ? {
|
|
45
|
-
displayName
|
|
46
|
-
} : {}),
|
|
47
|
-
...(fields.includes('children::size') ? {
|
|
48
|
-
children: children.length
|
|
49
|
-
} : {}),
|
|
50
|
-
...(fields.includes('children[id,path,displayName]') ? {
|
|
51
|
-
children
|
|
52
|
-
} : {})
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export const getOrganisationUnitData = (id, _ref2) => {
|
|
56
|
-
let {
|
|
57
|
-
fields
|
|
58
|
-
} = _ref2;
|
|
30
|
+
} : {})
|
|
31
|
+
});
|
|
32
|
+
export const getOrganisationUnitData = (id, {
|
|
33
|
+
fields
|
|
34
|
+
}) => {
|
|
59
35
|
let data;
|
|
60
36
|
if (id === 'A0000000000') {
|
|
61
37
|
data = createResponse({
|
|
@@ -157,11 +133,10 @@ export const getOrganisationUnitData = (id, _ref2) => {
|
|
|
157
133
|
return data;
|
|
158
134
|
};
|
|
159
135
|
export const customData = {
|
|
160
|
-
organisationUnits: (_,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
} = _ref3;
|
|
136
|
+
organisationUnits: (_, {
|
|
137
|
+
id,
|
|
138
|
+
params = {}
|
|
139
|
+
}) => {
|
|
165
140
|
const data = getOrganisationUnitData(id, params);
|
|
166
141
|
if (!data) {
|
|
167
142
|
return Promise.reject(new Error('404 - Org unit not found'));
|
|
@@ -169,18 +144,14 @@ export const customData = {
|
|
|
169
144
|
return Promise.resolve(data);
|
|
170
145
|
}
|
|
171
146
|
};
|
|
172
|
-
export const StatefulMultiSelectionWrapper =
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
} = _ref4;
|
|
147
|
+
export const StatefulMultiSelectionWrapper = ({
|
|
148
|
+
children,
|
|
149
|
+
onSelectionChange = () => null
|
|
150
|
+
}) => {
|
|
177
151
|
const [selected, setSelected] = useState([]);
|
|
178
152
|
return children({
|
|
179
153
|
selected,
|
|
180
|
-
onChange:
|
|
181
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
182
|
-
args[_key5] = arguments[_key5];
|
|
183
|
-
}
|
|
154
|
+
onChange: (...args) => {
|
|
184
155
|
onChange(...args);
|
|
185
156
|
const [{
|
|
186
157
|
selected: newSelected
|
|
@@ -197,16 +168,13 @@ StatefulMultiSelectionWrapper.propTypes = {
|
|
|
197
168
|
export const createDecoratorStatefulMultiSelection = args => {
|
|
198
169
|
return Story => /*#__PURE__*/React.createElement(StatefulMultiSelectionWrapper, {
|
|
199
170
|
onSelectionChange: args === null || args === void 0 ? void 0 : args.onSelectionChange
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
onChange: onChange
|
|
208
|
-
});
|
|
209
|
-
});
|
|
171
|
+
}, ({
|
|
172
|
+
selected,
|
|
173
|
+
onChange
|
|
174
|
+
}) => /*#__PURE__*/React.createElement(Story, {
|
|
175
|
+
selected: selected,
|
|
176
|
+
onChange: onChange
|
|
177
|
+
}));
|
|
210
178
|
};
|
|
211
179
|
export const createDecoratorCustomDataProvider = args => {
|
|
212
180
|
const data = (args === null || args === void 0 ? void 0 : args.data) || customData;
|
|
@@ -56,12 +56,9 @@ Then('the path should close', () => {
|
|
|
56
56
|
const curData = getOrganisationUnitData(cur, {
|
|
57
57
|
fields: ['children[id,path,displayName]']
|
|
58
58
|
});
|
|
59
|
-
const childrenIds = curData.children.map(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} = _ref;
|
|
63
|
-
return id;
|
|
64
|
-
});
|
|
59
|
+
const childrenIds = curData.children.map(({
|
|
60
|
+
id
|
|
61
|
+
}) => id);
|
|
65
62
|
return [...acc, ...childrenIds];
|
|
66
63
|
}, []);
|
|
67
64
|
expectOrgUnitsToNotBeDisplayed(hiddenChildrenIds);
|
|
@@ -26,22 +26,44 @@ import viTranslations from './vi/translations.json';
|
|
|
26
26
|
import zhTranslations from './zh/translations.json';
|
|
27
27
|
import zh_CNTranslations from './zh_CN/translations.json';
|
|
28
28
|
const namespace = 'default';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
i18n.
|
|
34
|
-
i18n.
|
|
35
|
-
i18n.
|
|
36
|
-
i18n.
|
|
37
|
-
i18n.
|
|
38
|
-
i18n.
|
|
39
|
-
i18n.
|
|
40
|
-
i18n.
|
|
41
|
-
i18n.
|
|
42
|
-
i18n.
|
|
43
|
-
i18n.
|
|
44
|
-
i18n.
|
|
45
|
-
i18n.
|
|
46
|
-
i18n.
|
|
29
|
+
|
|
30
|
+
// Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
|
|
31
|
+
// custom translations from the datastore (added by the app adapter)
|
|
32
|
+
|
|
33
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
34
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
35
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
36
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
37
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
38
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
39
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
40
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
41
|
+
i18n.addResourceBundle('es_419', namespace, es_419Translations, true, false);
|
|
42
|
+
i18n.addResourceBundle('es-419', namespace, es_419Translations, true, false);
|
|
43
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
44
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
45
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
46
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
47
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
48
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
49
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
50
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
51
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
52
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
53
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
54
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
55
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
56
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
57
|
+
i18n.addResourceBundle('uz_Latn', namespace, uz_LatnTranslations, true, false);
|
|
58
|
+
i18n.addResourceBundle('uz-Latn', namespace, uz_LatnTranslations, true, false);
|
|
59
|
+
i18n.addResourceBundle('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
60
|
+
i18n.addResourceBundle('uz-Cyrl-UZ', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
61
|
+
i18n.addResourceBundle('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations, true, false);
|
|
62
|
+
i18n.addResourceBundle('uz-Latn-UZ', namespace, uz_UZ_LatnTranslations, true, false);
|
|
63
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
64
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
65
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
66
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
67
|
+
i18n.addResourceBundle('zh_CN', namespace, zh_CNTranslations, true, false);
|
|
68
|
+
i18n.addResourceBundle('zh-CN', namespace, zh_CNTranslations, true, false);
|
|
47
69
|
export default i18n;
|
|
@@ -2,19 +2,16 @@ import _JSXStyle from "styled-jsx/style";
|
|
|
2
2
|
import { colors, spacers, theme } from '@dhis2/ui-constants';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
export const ErrorMessage =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
dynamic: [colors.grey800, spacers.dp4, theme.error]
|
|
16
|
-
}, [`span.__jsx-style-dynamic-selector{font-size:14px;color:${colors.grey800};margin:${spacers.dp4};color:${theme.error};}`]));
|
|
17
|
-
};
|
|
5
|
+
export const ErrorMessage = ({
|
|
6
|
+
children,
|
|
7
|
+
dataTest
|
|
8
|
+
}) => /*#__PURE__*/React.createElement("span", {
|
|
9
|
+
"data-test": `${dataTest}-error`,
|
|
10
|
+
className: _JSXStyle.dynamic([["3198585030", [colors.grey800, spacers.dp4, theme.error]]])
|
|
11
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
12
|
+
id: "3198585030",
|
|
13
|
+
dynamic: [colors.grey800, spacers.dp4, theme.error]
|
|
14
|
+
}, [`span.__jsx-style-dynamic-selector{font-size:14px;color:${colors.grey800};margin:${spacers.dp4};color:${theme.error};}`]));
|
|
18
15
|
ErrorMessage.propTypes = {
|
|
19
16
|
children: PropTypes.any.isRequired,
|
|
20
17
|
dataTest: PropTypes.string.isRequired
|
|
@@ -9,18 +9,15 @@ import { SingleSelectionLabel } from './single-selection-label.js';
|
|
|
9
9
|
* @param {bool} [props.loading]
|
|
10
10
|
* @returns {React.Component}
|
|
11
11
|
*/
|
|
12
|
-
export const DisabledSelectionLabel =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onChange: onToggleOpen
|
|
22
|
-
}, children);
|
|
23
|
-
};
|
|
12
|
+
export const DisabledSelectionLabel = ({
|
|
13
|
+
children,
|
|
14
|
+
loading,
|
|
15
|
+
onToggleOpen
|
|
16
|
+
}) => /*#__PURE__*/React.createElement(SingleSelectionLabel, {
|
|
17
|
+
checked: false,
|
|
18
|
+
loading: loading,
|
|
19
|
+
onChange: onToggleOpen
|
|
20
|
+
}, children);
|
|
24
21
|
DisabledSelectionLabel.propTypes = {
|
|
25
22
|
children: PropTypes.any.isRequired,
|
|
26
23
|
onToggleOpen: PropTypes.func.isRequired,
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export const IconEmpty =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
id: "3201893673"
|
|
24
|
-
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
25
|
-
};
|
|
4
|
+
export const IconEmpty = ({
|
|
5
|
+
dataTest
|
|
6
|
+
}) => /*#__PURE__*/React.createElement("svg", {
|
|
7
|
+
height: "18px",
|
|
8
|
+
version: "1.1",
|
|
9
|
+
viewBox: "0 0 18 18",
|
|
10
|
+
width: "18px",
|
|
11
|
+
"data-test": `${dataTest}-iconempty`,
|
|
12
|
+
className: "jsx-3201893673"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
14
|
+
fill: "none",
|
|
15
|
+
fillRule: "evenodd",
|
|
16
|
+
id: "icon/empty",
|
|
17
|
+
stroke: "none",
|
|
18
|
+
strokeWidth: "1",
|
|
19
|
+
className: "jsx-3201893673"
|
|
20
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
21
|
+
id: "3201893673"
|
|
22
|
+
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
26
23
|
IconEmpty.propTypes = {
|
|
27
24
|
dataTest: PropTypes.string.isRequired
|
|
28
25
|
};
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export const IconFolderClosed =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
id: "3201893673"
|
|
30
|
-
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
31
|
-
};
|
|
4
|
+
export const IconFolderClosed = ({
|
|
5
|
+
dataTest
|
|
6
|
+
}) => /*#__PURE__*/React.createElement("svg", {
|
|
7
|
+
width: "18px",
|
|
8
|
+
height: "18px",
|
|
9
|
+
viewBox: "0 0 18 18",
|
|
10
|
+
version: "1.1",
|
|
11
|
+
"data-test": `${dataTest}-iconfolderclosed`,
|
|
12
|
+
className: "jsx-3201893673"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
14
|
+
id: "icon/folder/closed",
|
|
15
|
+
stroke: "none",
|
|
16
|
+
strokeWidth: "1",
|
|
17
|
+
fill: "none",
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
className: "jsx-3201893673"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
21
|
+
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",
|
|
22
|
+
id: "Path-2",
|
|
23
|
+
stroke: "#6C7787",
|
|
24
|
+
fill: "#D5DDE5",
|
|
25
|
+
className: "jsx-3201893673"
|
|
26
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
27
|
+
id: "3201893673"
|
|
28
|
+
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
32
29
|
IconFolderClosed.propTypes = {
|
|
33
30
|
dataTest: PropTypes.string.isRequired
|
|
34
31
|
};
|
|
@@ -1,43 +1,40 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export const IconFolderOpen =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
id: "2091325045"
|
|
39
|
-
}, ["svg.jsx-2091325045{margin:3px 0;display:block;}"]));
|
|
40
|
-
};
|
|
4
|
+
export const IconFolderOpen = ({
|
|
5
|
+
dataTest
|
|
6
|
+
}) => /*#__PURE__*/React.createElement("svg", {
|
|
7
|
+
width: "18px",
|
|
8
|
+
height: "18px",
|
|
9
|
+
viewBox: "0 0 18 18",
|
|
10
|
+
version: "1.1",
|
|
11
|
+
"data-test": `${dataTest}-iconfolderopen`,
|
|
12
|
+
className: "jsx-2091325045"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
14
|
+
id: "icon/folder/open",
|
|
15
|
+
stroke: "none",
|
|
16
|
+
strokeWidth: "1",
|
|
17
|
+
fill: "none",
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
className: "jsx-2091325045"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
21
|
+
id: "Group",
|
|
22
|
+
transform: "translate(0.000000, 3.000000)",
|
|
23
|
+
stroke: "#6C7787",
|
|
24
|
+
className: "jsx-2091325045"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
26
|
+
d: "M2,0.5 C1.17157288,0.5 0.5,1.17157288 0.5,2 L0.5,10 C0.5,10.8284271 1.17157288,11.5 2,11.5 L12,11.5 C12.8284271,11.5 13.5,10.8284271 13.5,10 L13.5,4 C13.5,3.17157288 12.8284271,2.5 12,2.5 L6.69098301,2.5 L5.82917961,0.776393202 C5.7444836,0.607001188 5.57135204,0.5 5.38196601,0.5 L2,0.5 Z",
|
|
27
|
+
id: "Path-2",
|
|
28
|
+
fill: "#A0ADBA",
|
|
29
|
+
className: "jsx-2091325045"
|
|
30
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
31
|
+
d: "M1.53632259,10.7093809 C1.47575089,10.7941813 1.44318932,10.8957885 1.44318932,11 C1.44318932,11.2761424 1.66704695,11.5 1.94318932,11.5 L12.4853821,11.5 C12.6468577,11.5 12.7983931,11.4220172 12.8922488,11.2906191 L16.4636774,6.2906191 C16.5242491,6.20581872 16.5568107,6.10421149 16.5568107,6 C16.5568107,5.72385763 16.3329531,5.5 16.0568107,5.5 L5.5146179,5.5 C5.35314234,5.5 5.20160692,5.57798284 5.10775116,5.7093809 L1.53632259,10.7093809 Z",
|
|
32
|
+
id: "Path-3",
|
|
33
|
+
fill: "#FBFCFD",
|
|
34
|
+
className: "jsx-2091325045"
|
|
35
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
36
|
+
id: "2091325045"
|
|
37
|
+
}, ["svg.jsx-2091325045{margin:3px 0;display:block;}"]));
|
|
41
38
|
IconFolderOpen.propTypes = {
|
|
42
39
|
dataTest: PropTypes.string.isRequired
|
|
43
40
|
};
|
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export const IconSingle =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
id: "3201893673"
|
|
33
|
-
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
34
|
-
};
|
|
4
|
+
export const IconSingle = ({
|
|
5
|
+
dataTest
|
|
6
|
+
}) => /*#__PURE__*/React.createElement("svg", {
|
|
7
|
+
height: "18px",
|
|
8
|
+
version: "1.1",
|
|
9
|
+
viewBox: "0 0 18 18",
|
|
10
|
+
width: "18px",
|
|
11
|
+
"data-test": `${dataTest}-iconsingle`,
|
|
12
|
+
className: "jsx-3201893673"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
14
|
+
fill: "none",
|
|
15
|
+
fillRule: "evenodd",
|
|
16
|
+
id: "icon/single",
|
|
17
|
+
stroke: "none",
|
|
18
|
+
strokeWidth: "1",
|
|
19
|
+
className: "jsx-3201893673"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
21
|
+
fill: "#A0ADBA",
|
|
22
|
+
height: "4",
|
|
23
|
+
id: "Rectangle",
|
|
24
|
+
rx: "1",
|
|
25
|
+
width: "4",
|
|
26
|
+
x: "7",
|
|
27
|
+
y: "7",
|
|
28
|
+
className: "jsx-3201893673"
|
|
29
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
30
|
+
id: "3201893673"
|
|
31
|
+
}, ["svg.jsx-3201893673{display:block;margin:3px 0;}"]));
|
|
35
32
|
IconSingle.propTypes = {
|
|
36
33
|
dataTest: PropTypes.string.isRequired
|
|
37
34
|
};
|
|
@@ -11,13 +11,12 @@ import { IconSingle } from './icon-single.js';
|
|
|
11
11
|
* @param {bool} props.open
|
|
12
12
|
* @returns {React.Component}
|
|
13
13
|
*/
|
|
14
|
-
export const Icon =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
14
|
+
export const Icon = ({
|
|
15
|
+
loading,
|
|
16
|
+
hasChildren,
|
|
17
|
+
open,
|
|
18
|
+
dataTest
|
|
19
|
+
}) => {
|
|
21
20
|
if (loading) {
|
|
22
21
|
return /*#__PURE__*/React.createElement(IconEmpty, {
|
|
23
22
|
dataTest: dataTest
|