@dhis2/analytics 26.12.2 → 26.13.0
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/__demo__/DimensionsPanel.stories.js +29 -4
- package/build/cjs/__demo__/FileMenu.stories.js +1 -9
- package/build/cjs/__demo__/data/avgTotalAggregationType.visualization.json +256 -1
- package/build/cjs/__demo__/data/deep.visualization.json +613 -310
- package/build/cjs/__demo__/data/deepWithFilters.visualization.json +0 -3
- package/build/cjs/__demo__/data/degs.visualization.json +2 -7
- package/build/cjs/__demo__/data/diseaseWeeks.visualization.json +317 -153
- package/build/cjs/__demo__/data/emptyColumns.visualization.json +2 -7
- package/build/cjs/__demo__/data/emptyRows.visualization.json +292 -297
- package/build/cjs/__demo__/data/hierarchy.visualization.json +197 -1
- package/build/cjs/__demo__/data/lastFiveYears.visualization.json +2 -7
- package/build/cjs/__demo__/data/narrative.visualization.json +2 -7
- package/build/cjs/__demo__/data/simple.visualization.json +115 -105
- package/build/cjs/__demo__/data/target-with-legend.visualization.json +370 -115
- package/build/cjs/__demo__/data/under-above-100.legendSet.json +87 -103
- package/build/cjs/__demo__/data/weeklyColumns.visualization.json +2 -7
- package/build/cjs/__fixtures__/json/chartAllFields.json +8 -33
- package/build/cjs/api/dimensions.js +11 -1
- package/build/cjs/api/expression.js +19 -9
- package/build/cjs/assets/DimensionItemIcons/CalculationIcon.js +1 -1
- package/build/cjs/assets/DimensionItemIcons/DataElementIcon.js +1 -1
- package/build/cjs/assets/DimensionItemIcons/GenericIcon.js +1 -1
- package/build/cjs/assets/DimensionItemIcons/PeriodIcon.js +1 -1
- package/build/cjs/components/DataDimension/DataDimension.js +68 -10
- package/build/cjs/components/DataDimension/Info/CalculationInfo.js +3 -3
- package/build/cjs/components/DataDimension/Info/DataElementInfo.js +4 -4
- package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +5 -5
- package/build/cjs/components/DataDimension/Info/DataSetInfo.js +3 -3
- package/build/cjs/components/DataDimension/Info/EventDataItemInfo.js +6 -6
- package/build/cjs/components/DataDimension/Info/IndicatorInfo.js +3 -3
- package/build/cjs/components/DataDimension/Info/InfoPopover.js +7 -3
- package/build/cjs/components/DataDimension/Info/InfoTable.js +1 -1
- package/build/cjs/components/DataDimension/Info/OptionInfo.js +70 -0
- package/build/cjs/components/DataDimension/Info/ProgramIndicatorInfo.js +9 -6
- package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +257 -0
- package/build/cjs/components/DataDimension/ItemOptionsSelector/styles/ItemOptionSelector.style.js +10 -0
- package/build/cjs/components/DataDimension/{DataTypeSelector.js → ItemSelector/DataTypeSelector.js} +4 -4
- package/build/cjs/components/DataDimension/{DetailSelector.js → ItemSelector/DetailSelector.js} +2 -2
- package/build/cjs/components/DataDimension/{GroupSelector.js → ItemSelector/GroupSelector.js} +3 -3
- package/build/cjs/components/DataDimension/{ItemSelector.js → ItemSelector/ItemSelector.js} +76 -163
- package/build/cjs/components/DataDimension/{MetricSelector.js → ItemSelector/MetricSelector.js} +3 -3
- package/build/cjs/components/DataDimension/SelectedEmptyPlaceholder.js +17 -0
- package/build/cjs/components/DataDimension/SourceEmptyPlaceholder.js +113 -0
- package/build/cjs/components/DataDimension/TransferOption.js +34 -3
- package/build/cjs/components/DataDimension/styles/EmptyPlaceholder.style.js +10 -0
- package/build/cjs/components/DataDimension/styles/TransferOption.style.js +2 -2
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +3 -3
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionItem.style.js +2 -2
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +1 -1
- package/build/cjs/components/DynamicDimension/ItemSelector.js +64 -111
- package/build/cjs/components/styles/DimensionSelector.style.js +2 -2
- package/build/cjs/locales/en/translations.json +18 -11
- package/build/cjs/modules/dataTypes.js +3 -1
- package/build/cjs/modules/dimensionListItem.js +4 -0
- package/build/es/__demo__/DimensionsPanel.stories.js +27 -3
- package/build/es/__demo__/FileMenu.stories.js +1 -9
- package/build/es/__demo__/data/avgTotalAggregationType.visualization.json +256 -1
- package/build/es/__demo__/data/deep.visualization.json +613 -310
- package/build/es/__demo__/data/deepWithFilters.visualization.json +0 -3
- package/build/es/__demo__/data/degs.visualization.json +2 -7
- package/build/es/__demo__/data/diseaseWeeks.visualization.json +317 -153
- package/build/es/__demo__/data/emptyColumns.visualization.json +2 -7
- package/build/es/__demo__/data/emptyRows.visualization.json +292 -297
- package/build/es/__demo__/data/hierarchy.visualization.json +197 -1
- package/build/es/__demo__/data/lastFiveYears.visualization.json +2 -7
- package/build/es/__demo__/data/narrative.visualization.json +2 -7
- package/build/es/__demo__/data/simple.visualization.json +115 -105
- package/build/es/__demo__/data/target-with-legend.visualization.json +370 -115
- package/build/es/__demo__/data/under-above-100.legendSet.json +87 -103
- package/build/es/__demo__/data/weeklyColumns.visualization.json +2 -7
- package/build/es/__fixtures__/json/chartAllFields.json +8 -33
- package/build/es/api/dimensions.js +12 -2
- package/build/es/api/expression.js +18 -8
- package/build/es/assets/DimensionItemIcons/CalculationIcon.js +1 -1
- package/build/es/assets/DimensionItemIcons/DataElementIcon.js +1 -1
- package/build/es/assets/DimensionItemIcons/GenericIcon.js +1 -1
- package/build/es/assets/DimensionItemIcons/PeriodIcon.js +1 -1
- package/build/es/components/DataDimension/DataDimension.js +69 -11
- package/build/es/components/DataDimension/Info/CalculationInfo.js +3 -3
- package/build/es/components/DataDimension/Info/DataElementInfo.js +4 -4
- package/build/es/components/DataDimension/Info/DataElementOperandInfo.js +5 -5
- package/build/es/components/DataDimension/Info/DataSetInfo.js +3 -3
- package/build/es/components/DataDimension/Info/EventDataItemInfo.js +6 -6
- package/build/es/components/DataDimension/Info/IndicatorInfo.js +3 -3
- package/build/es/components/DataDimension/Info/InfoPopover.js +9 -5
- package/build/es/components/DataDimension/Info/InfoTable.js +1 -1
- package/build/es/components/DataDimension/Info/OptionInfo.js +62 -0
- package/build/es/components/DataDimension/Info/ProgramIndicatorInfo.js +10 -7
- package/build/es/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +247 -0
- package/build/es/components/DataDimension/ItemOptionsSelector/styles/ItemOptionSelector.style.js +4 -0
- package/build/es/components/DataDimension/{DataTypeSelector.js → ItemSelector/DataTypeSelector.js} +4 -4
- package/build/es/components/DataDimension/{DetailSelector.js → ItemSelector/DetailSelector.js} +2 -2
- package/build/es/components/DataDimension/{GroupSelector.js → ItemSelector/GroupSelector.js} +3 -3
- package/build/es/components/DataDimension/{ItemSelector.js → ItemSelector/ItemSelector.js} +76 -163
- package/build/es/components/DataDimension/{MetricSelector.js → ItemSelector/MetricSelector.js} +3 -3
- package/build/es/components/DataDimension/SelectedEmptyPlaceholder.js +9 -0
- package/build/es/components/DataDimension/SourceEmptyPlaceholder.js +105 -0
- package/build/es/components/DataDimension/TransferOption.js +35 -4
- package/build/es/components/DataDimension/styles/EmptyPlaceholder.style.js +4 -0
- package/build/es/components/DataDimension/styles/TransferOption.style.js +2 -2
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +3 -3
- package/build/es/components/DimensionsPanel/List/styles/DimensionItem.style.js +2 -2
- package/build/es/components/DynamicDimension/DynamicDimension.js +1 -1
- package/build/es/components/DynamicDimension/ItemSelector.js +66 -113
- package/build/es/components/styles/DimensionSelector.style.js +2 -2
- package/build/es/locales/en/translations.json +18 -11
- package/build/es/modules/dataTypes.js +2 -0
- package/build/es/modules/dimensionListItem.js +5 -1
- package/package.json +2 -2
- /package/build/cjs/components/DataDimension/{styles → ItemSelector/styles}/DataTypeSelector.style.js +0 -0
- /package/build/cjs/components/DataDimension/{styles → ItemSelector/styles}/DetailSelector.style.js +0 -0
- /package/build/cjs/components/DataDimension/{styles → ItemSelector/styles}/GroupSelector.style.js +0 -0
- /package/build/cjs/components/DataDimension/{styles → ItemSelector/styles}/MetricSelector.style.js +0 -0
- /package/build/es/components/DataDimension/{styles → ItemSelector/styles}/DataTypeSelector.style.js +0 -0
- /package/build/es/components/DataDimension/{styles → ItemSelector/styles}/DetailSelector.style.js +0 -0
- /package/build/es/components/DataDimension/{styles → ItemSelector/styles}/GroupSelector.style.js +0 -0
- /package/build/es/components/DataDimension/{styles → ItemSelector/styles}/MetricSelector.style.js +0 -0
|
@@ -2,21 +2,23 @@ import _JSXStyle from "styled-jsx/style";
|
|
|
2
2
|
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); }
|
|
3
3
|
import { useDataEngine } from '@dhis2/app-runtime';
|
|
4
4
|
import { Transfer, InputField, IconInfo16, Button, IconAdd24 } from '@dhis2/ui';
|
|
5
|
+
import cx from 'classnames';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
|
-
import React, {
|
|
7
|
-
import { apiFetchOptions } from '
|
|
8
|
-
import i18n from '
|
|
9
|
-
import { DATA_SETS_CONSTANTS, REPORTING_RATE } from '
|
|
10
|
-
import { DIMENSION_TYPE_ALL, DIMENSION_TYPE_DATA_ELEMENT,
|
|
11
|
-
import { getIcon, getDimensionType } from '
|
|
12
|
-
import { TRANSFER_HEIGHT, TRANSFER_OPTIONS_WIDTH, TRANSFER_SELECTED_WIDTH } from '
|
|
13
|
-
import { useDebounce, useDidUpdateEffect } from '
|
|
14
|
-
import styles from '
|
|
15
|
-
import CalculationModal from '
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { apiFetchOptions } from '../../../api/dimensions.js';
|
|
9
|
+
import i18n from '../../../locales/index.js';
|
|
10
|
+
import { DATA_SETS_CONSTANTS, REPORTING_RATE } from '../../../modules/dataSets.js';
|
|
11
|
+
import { DIMENSION_TYPE_ALL, DIMENSION_TYPE_DATA_ELEMENT, TOTALS, DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM } from '../../../modules/dataTypes.js';
|
|
12
|
+
import { getIcon, getDimensionType } from '../../../modules/dimensionListItem.js';
|
|
13
|
+
import { TRANSFER_HEIGHT, TRANSFER_OPTIONS_WIDTH, TRANSFER_SELECTED_WIDTH } from '../../../modules/dimensionSelectorHelper.js';
|
|
14
|
+
import { useDebounce, useDidUpdateEffect } from '../../../modules/utils.js';
|
|
15
|
+
import styles from '../../styles/DimensionSelector.style.js';
|
|
16
|
+
import CalculationModal from '../Calculation/CalculationModal.js';
|
|
17
|
+
import { SelectedEmptyPlaceholder } from '../SelectedEmptyPlaceholder.js';
|
|
18
|
+
import { SourceEmptyPlaceholder } from '../SourceEmptyPlaceholder.js';
|
|
19
|
+
import { TransferOption } from '../TransferOption.js';
|
|
16
20
|
import DataTypeSelector from './DataTypeSelector.js';
|
|
17
21
|
import GroupSelector from './GroupSelector.js';
|
|
18
|
-
import { InfoPopover } from './Info/InfoPopover.js';
|
|
19
|
-
import { TransferOption } from './TransferOption.js';
|
|
20
22
|
const LeftHeader = _ref => {
|
|
21
23
|
let {
|
|
22
24
|
searchTerm,
|
|
@@ -76,11 +78,6 @@ LeftHeader.propTypes = {
|
|
|
76
78
|
setSubGroup: PropTypes.func,
|
|
77
79
|
subGroup: PropTypes.string
|
|
78
80
|
};
|
|
79
|
-
const EmptySelection = () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
|
|
80
|
-
className: `jsx-${styles.__hash}` + " " + "emptyList"
|
|
81
|
-
}, i18n.t('No items selected')), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
82
|
-
id: styles.__hash
|
|
83
|
-
}, styles));
|
|
84
81
|
const RightHeader = _ref3 => {
|
|
85
82
|
let {
|
|
86
83
|
infoBoxMessage
|
|
@@ -100,99 +97,7 @@ const RightHeader = _ref3 => {
|
|
|
100
97
|
RightHeader.propTypes = {
|
|
101
98
|
infoBoxMessage: PropTypes.string
|
|
102
99
|
};
|
|
103
|
-
const
|
|
104
|
-
let {
|
|
105
|
-
loading,
|
|
106
|
-
searchTerm,
|
|
107
|
-
options,
|
|
108
|
-
noItemsMessage,
|
|
109
|
-
dataType,
|
|
110
|
-
dataTest
|
|
111
|
-
} = _ref4;
|
|
112
|
-
let message = '';
|
|
113
|
-
if (!loading && !options.length && !searchTerm) {
|
|
114
|
-
if (noItemsMessage) {
|
|
115
|
-
message = noItemsMessage;
|
|
116
|
-
} else {
|
|
117
|
-
switch (dataType) {
|
|
118
|
-
case DIMENSION_TYPE_INDICATOR:
|
|
119
|
-
message = i18n.t('No indicators found');
|
|
120
|
-
break;
|
|
121
|
-
case DIMENSION_TYPE_DATA_ELEMENT:
|
|
122
|
-
message = i18n.t('No data elements found');
|
|
123
|
-
break;
|
|
124
|
-
case DIMENSION_TYPE_DATA_SET:
|
|
125
|
-
message = i18n.t('No data sets found');
|
|
126
|
-
break;
|
|
127
|
-
case DIMENSION_TYPE_EVENT_DATA_ITEM:
|
|
128
|
-
message = i18n.t('No event data items found');
|
|
129
|
-
break;
|
|
130
|
-
case DIMENSION_TYPE_PROGRAM_INDICATOR:
|
|
131
|
-
message = i18n.t('No program indicators found');
|
|
132
|
-
break;
|
|
133
|
-
case DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM:
|
|
134
|
-
message = i18n.t('No calculations found');
|
|
135
|
-
break;
|
|
136
|
-
default:
|
|
137
|
-
message = i18n.t('No data');
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
} else if (!loading && !options.length && searchTerm) {
|
|
142
|
-
switch (dataType) {
|
|
143
|
-
case DIMENSION_TYPE_INDICATOR:
|
|
144
|
-
message = i18n.t('No indicators found for "{{- searchTerm}}"', {
|
|
145
|
-
searchTerm
|
|
146
|
-
});
|
|
147
|
-
break;
|
|
148
|
-
case DIMENSION_TYPE_DATA_ELEMENT:
|
|
149
|
-
message = i18n.t('No data elements found for "{{- searchTerm}}"', {
|
|
150
|
-
searchTerm
|
|
151
|
-
});
|
|
152
|
-
break;
|
|
153
|
-
case DIMENSION_TYPE_DATA_SET:
|
|
154
|
-
message = i18n.t('No data sets found for "{{- searchTerm}}"', {
|
|
155
|
-
searchTerm
|
|
156
|
-
});
|
|
157
|
-
break;
|
|
158
|
-
case DIMENSION_TYPE_EVENT_DATA_ITEM:
|
|
159
|
-
message = i18n.t('No event data items found for "{{- searchTerm}}"', {
|
|
160
|
-
searchTerm
|
|
161
|
-
});
|
|
162
|
-
break;
|
|
163
|
-
case DIMENSION_TYPE_PROGRAM_INDICATOR:
|
|
164
|
-
message = i18n.t('No program indicators found for "{{- searchTerm}}"', {
|
|
165
|
-
searchTerm
|
|
166
|
-
});
|
|
167
|
-
break;
|
|
168
|
-
case DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM:
|
|
169
|
-
message = i18n.t('No calculations found for "{{- searchTerm}}"', {
|
|
170
|
-
searchTerm
|
|
171
|
-
});
|
|
172
|
-
break;
|
|
173
|
-
default:
|
|
174
|
-
message = i18n.t('Nothing found for "{{- searchTerm}}"', {
|
|
175
|
-
searchTerm
|
|
176
|
-
});
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return message && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
|
|
181
|
-
"data-test": dataTest,
|
|
182
|
-
className: `jsx-${styles.__hash}` + " " + "emptyList"
|
|
183
|
-
}, message), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
184
|
-
id: styles.__hash
|
|
185
|
-
}, styles));
|
|
186
|
-
};
|
|
187
|
-
SourceEmptyPlaceholder.propTypes = {
|
|
188
|
-
dataTest: PropTypes.string,
|
|
189
|
-
dataType: PropTypes.string,
|
|
190
|
-
loading: PropTypes.bool,
|
|
191
|
-
noItemsMessage: PropTypes.string,
|
|
192
|
-
options: PropTypes.array,
|
|
193
|
-
searchTerm: PropTypes.string
|
|
194
|
-
};
|
|
195
|
-
const ItemSelector = _ref5 => {
|
|
100
|
+
const ItemSelector = _ref4 => {
|
|
196
101
|
let {
|
|
197
102
|
selectedItems,
|
|
198
103
|
noItemsMessage,
|
|
@@ -200,11 +105,18 @@ const ItemSelector = _ref5 => {
|
|
|
200
105
|
rightFooter,
|
|
201
106
|
displayNameProp,
|
|
202
107
|
infoBoxMessage,
|
|
108
|
+
itemsRef,
|
|
109
|
+
currentCalculation,
|
|
110
|
+
setCurrentCalculation,
|
|
111
|
+
infoDataItem,
|
|
112
|
+
setInfoDataItem,
|
|
203
113
|
dataTypes,
|
|
204
114
|
dataTest,
|
|
205
|
-
onEDISave
|
|
206
|
-
|
|
207
|
-
|
|
115
|
+
onEDISave,
|
|
116
|
+
onEditClick,
|
|
117
|
+
isOptionViewMode,
|
|
118
|
+
supportsEDI
|
|
119
|
+
} = _ref4;
|
|
208
120
|
const [state, setState] = useState({
|
|
209
121
|
searchTerm: '',
|
|
210
122
|
dataTypes,
|
|
@@ -215,16 +127,8 @@ const ItemSelector = _ref5 => {
|
|
|
215
127
|
},
|
|
216
128
|
options: [],
|
|
217
129
|
loading: true,
|
|
218
|
-
nextPage: 1
|
|
219
|
-
supportsEDI: dataTypes.map(_ref6 => {
|
|
220
|
-
let {
|
|
221
|
-
id
|
|
222
|
-
} = _ref6;
|
|
223
|
-
return id;
|
|
224
|
-
}).includes(DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM)
|
|
130
|
+
nextPage: 1
|
|
225
131
|
});
|
|
226
|
-
const [currentCalculation, setCurrentCalculation] = useState();
|
|
227
|
-
const [currentDataItem, setCurrentDataItem] = useState();
|
|
228
132
|
const debouncedSearchTerm = useDebounce(state.searchTerm, 500);
|
|
229
133
|
const dataEngine = useDataEngine();
|
|
230
134
|
const setSearchTerm = searchTerm => setState(state => ({
|
|
@@ -274,7 +178,8 @@ const ItemSelector = _ref5 => {
|
|
|
274
178
|
value: item.id,
|
|
275
179
|
disabled: item.disabled,
|
|
276
180
|
type: item.dimensionItemType,
|
|
277
|
-
expression: item.expression
|
|
181
|
+
expression: item.expression,
|
|
182
|
+
optionSetId: item.optionSetId
|
|
278
183
|
});
|
|
279
184
|
}
|
|
280
185
|
});
|
|
@@ -299,19 +204,22 @@ const ItemSelector = _ref5 => {
|
|
|
299
204
|
};
|
|
300
205
|
useDidUpdateEffect(() => {
|
|
301
206
|
fetchItems(1);
|
|
302
|
-
}, [debouncedSearchTerm, state.filter]);
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
207
|
+
}, [debouncedSearchTerm, state.filter]); // does this effect dep work?
|
|
208
|
+
|
|
209
|
+
const onChange = selectedIds => {
|
|
210
|
+
const newSelectedItems = selectedIds.map(id => {
|
|
211
|
+
const matchingItem = [...state.options, ...selectedItems].find(item => item.value === id);
|
|
306
212
|
return {
|
|
307
|
-
value,
|
|
213
|
+
value: id,
|
|
308
214
|
label: matchingItem.label,
|
|
309
215
|
type: matchingItem.type,
|
|
216
|
+
optionSetId: matchingItem.optionSetId,
|
|
310
217
|
...(matchingItem.expression ? {
|
|
311
218
|
expression: matchingItem.expression
|
|
312
219
|
} : {})
|
|
313
220
|
};
|
|
314
|
-
})
|
|
221
|
+
});
|
|
222
|
+
onSelect(newSelectedItems);
|
|
315
223
|
};
|
|
316
224
|
const onEndReached = () => {
|
|
317
225
|
if (state.nextPage) {
|
|
@@ -322,17 +230,13 @@ const ItemSelector = _ref5 => {
|
|
|
322
230
|
const item = selectedItems.find(item => item.value === value);
|
|
323
231
|
return !item || item.isActive;
|
|
324
232
|
};
|
|
325
|
-
const
|
|
326
|
-
var _find;
|
|
327
|
-
return (_find = [...state.options, ...selectedItems].find(item => item.value === value)) === null || _find === void 0 ? void 0 : _find.type;
|
|
328
|
-
};
|
|
329
|
-
const onSaveCalculation = async _ref7 => {
|
|
233
|
+
const onSaveCalculation = async _ref5 => {
|
|
330
234
|
let {
|
|
331
235
|
id,
|
|
332
236
|
name,
|
|
333
237
|
expression,
|
|
334
238
|
isNew
|
|
335
|
-
} =
|
|
239
|
+
} = _ref5;
|
|
336
240
|
onEDISave({
|
|
337
241
|
id,
|
|
338
242
|
name,
|
|
@@ -355,10 +259,10 @@ const ItemSelector = _ref5 => {
|
|
|
355
259
|
}]);
|
|
356
260
|
}
|
|
357
261
|
};
|
|
358
|
-
const onDeleteCalculation =
|
|
262
|
+
const onDeleteCalculation = _ref6 => {
|
|
359
263
|
let {
|
|
360
264
|
id
|
|
361
|
-
} =
|
|
265
|
+
} = _ref6;
|
|
362
266
|
// close the modal
|
|
363
267
|
setCurrentCalculation();
|
|
364
268
|
|
|
@@ -395,22 +299,30 @@ const ItemSelector = _ref5 => {
|
|
|
395
299
|
}
|
|
396
300
|
}));
|
|
397
301
|
return /*#__PURE__*/React.createElement("div", {
|
|
398
|
-
className: `jsx-${styles.__hash}` + " " +
|
|
302
|
+
className: `jsx-${styles.__hash}` + " " + (cx('transfer-container', {
|
|
303
|
+
hidden: isOptionViewMode
|
|
304
|
+
}) || "")
|
|
399
305
|
}, /*#__PURE__*/React.createElement(Transfer, {
|
|
400
|
-
onChange:
|
|
306
|
+
onChange: _ref7 => {
|
|
401
307
|
let {
|
|
402
308
|
selected
|
|
403
|
-
} =
|
|
309
|
+
} = _ref7;
|
|
404
310
|
return onChange(selected);
|
|
405
311
|
},
|
|
406
312
|
selected: selectedItems.map(item => item.value),
|
|
407
|
-
options: [...state.options,
|
|
313
|
+
options: [...state.options,
|
|
314
|
+
// remove items already in the options list
|
|
315
|
+
...selectedItems.filter(selectedItem => {
|
|
316
|
+
var _state$options;
|
|
317
|
+
return !((_state$options = state.options) !== null && _state$options !== void 0 && _state$options.find(option => option.value === selectedItem.value));
|
|
318
|
+
})],
|
|
408
319
|
loading: state.loading,
|
|
409
320
|
loadingPicked: state.loading,
|
|
410
321
|
sourceEmptyPlaceholder: /*#__PURE__*/React.createElement(SourceEmptyPlaceholder, {
|
|
411
322
|
loading: state.loading,
|
|
412
323
|
searchTerm: debouncedSearchTerm,
|
|
413
324
|
options: state.options,
|
|
325
|
+
allItemsSelectedMessage: state.options.length === selectedItems.length && !state.nextPage ? i18n.t('All available items are already selected') : '',
|
|
414
326
|
noItemsMessage: noItemsMessage,
|
|
415
327
|
dataType: state.filter.dataType,
|
|
416
328
|
dataTest: `${dataTest}-empty-source`
|
|
@@ -429,7 +341,7 @@ const ItemSelector = _ref5 => {
|
|
|
429
341
|
displayNameProp: displayNameProp,
|
|
430
342
|
dataTest: `${dataTest}-left-header`
|
|
431
343
|
}),
|
|
432
|
-
leftFooter:
|
|
344
|
+
leftFooter: supportsEDI ? /*#__PURE__*/React.createElement("div", {
|
|
433
345
|
className: `jsx-${styles.__hash}` + " " + "calculation-button"
|
|
434
346
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
435
347
|
icon: /*#__PURE__*/React.createElement(IconAdd24, null),
|
|
@@ -440,49 +352,40 @@ const ItemSelector = _ref5 => {
|
|
|
440
352
|
height: TRANSFER_HEIGHT,
|
|
441
353
|
optionsWidth: TRANSFER_OPTIONS_WIDTH,
|
|
442
354
|
selectedWidth: TRANSFER_SELECTED_WIDTH,
|
|
443
|
-
selectedEmptyComponent: /*#__PURE__*/React.createElement(
|
|
355
|
+
selectedEmptyComponent: /*#__PURE__*/React.createElement(SelectedEmptyPlaceholder, null),
|
|
444
356
|
rightHeader: /*#__PURE__*/React.createElement(RightHeader, {
|
|
445
357
|
infoBoxMessage: infoBoxMessage
|
|
446
358
|
}),
|
|
447
359
|
rightFooter: rightFooter,
|
|
448
360
|
renderOption: props => {
|
|
449
|
-
|
|
361
|
+
// console.log('renderOption', props)
|
|
450
362
|
return /*#__PURE__*/React.createElement(TransferOption
|
|
451
363
|
/* eslint-disable react/prop-types */, _extends({}, props, {
|
|
452
364
|
active: isActive(props.value),
|
|
453
|
-
showingInfo: (
|
|
454
|
-
icon: getIcon(
|
|
365
|
+
showingInfo: (infoDataItem === null || infoDataItem === void 0 ? void 0 : infoDataItem.id) === props.value,
|
|
366
|
+
icon: getIcon(props.type),
|
|
367
|
+
dataItemType: props.type,
|
|
455
368
|
dimensionType: getDimensionType({
|
|
456
|
-
type:
|
|
369
|
+
type: props.type,
|
|
457
370
|
expression: props.expression
|
|
458
371
|
}),
|
|
459
372
|
dataTest: `${dataTest}-transfer-option`,
|
|
460
373
|
itemsRef: itemsRef,
|
|
461
|
-
onEditClick:
|
|
462
|
-
|
|
463
|
-
name: props.label,
|
|
464
|
-
expression: props.expression
|
|
465
|
-
}) : undefined,
|
|
466
|
-
onInfoClick: () => setCurrentDataItem({
|
|
374
|
+
onEditClick: () => onEditClick(props),
|
|
375
|
+
onInfoClick: () => setInfoDataItem({
|
|
467
376
|
id: props.value,
|
|
468
|
-
type:
|
|
377
|
+
type: props.type
|
|
469
378
|
})
|
|
470
379
|
/* eslint-enable react/prop-types */
|
|
471
380
|
}));
|
|
472
381
|
},
|
|
473
382
|
dataTest: `${dataTest}-transfer`
|
|
474
|
-
}), currentCalculation &&
|
|
383
|
+
}), currentCalculation && supportsEDI && /*#__PURE__*/React.createElement(CalculationModal, {
|
|
475
384
|
calculation: currentCalculation,
|
|
476
385
|
onSave: onSaveCalculation,
|
|
477
386
|
onClose: () => setCurrentCalculation(),
|
|
478
387
|
onDelete: onDeleteCalculation,
|
|
479
388
|
displayNameProp: displayNameProp
|
|
480
|
-
}), currentDataItem && /*#__PURE__*/React.createElement(InfoPopover, {
|
|
481
|
-
dataTest: `${dataTest}-info`,
|
|
482
|
-
item: currentDataItem,
|
|
483
|
-
reference: itemsRef.current.get(currentDataItem.id),
|
|
484
|
-
onClose: () => setCurrentDataItem(),
|
|
485
|
-
displayNameProp: displayNameProp
|
|
486
389
|
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
487
390
|
id: styles.__hash
|
|
488
391
|
}, styles));
|
|
@@ -490,19 +393,29 @@ const ItemSelector = _ref5 => {
|
|
|
490
393
|
ItemSelector.propTypes = {
|
|
491
394
|
displayNameProp: PropTypes.string.isRequired,
|
|
492
395
|
onSelect: PropTypes.func.isRequired,
|
|
396
|
+
currentCalculation: PropTypes.object,
|
|
493
397
|
dataTest: PropTypes.string,
|
|
494
398
|
dataTypes: PropTypes.array,
|
|
495
399
|
infoBoxMessage: PropTypes.string,
|
|
400
|
+
infoDataItem: PropTypes.object,
|
|
401
|
+
isOptionViewMode: PropTypes.bool,
|
|
402
|
+
itemsRef: PropTypes.object,
|
|
496
403
|
noItemsMessage: PropTypes.string,
|
|
497
404
|
rightFooter: PropTypes.node,
|
|
498
405
|
selectedItems: PropTypes.arrayOf(PropTypes.exact({
|
|
499
406
|
label: PropTypes.string.isRequired,
|
|
500
407
|
value: PropTypes.string.isRequired,
|
|
408
|
+
access: PropTypes.object,
|
|
501
409
|
isActive: PropTypes.bool,
|
|
502
410
|
type: PropTypes.string,
|
|
503
|
-
expression: PropTypes.string
|
|
411
|
+
expression: PropTypes.string,
|
|
412
|
+
optionSetId: PropTypes.string
|
|
504
413
|
})),
|
|
505
|
-
|
|
414
|
+
setCurrentCalculation: PropTypes.func,
|
|
415
|
+
setInfoDataItem: PropTypes.func,
|
|
416
|
+
supportsEDI: PropTypes.bool,
|
|
417
|
+
onEDISave: PropTypes.func,
|
|
418
|
+
onEditClick: PropTypes.func
|
|
506
419
|
};
|
|
507
420
|
ItemSelector.defaultProps = {
|
|
508
421
|
selectedItems: []
|
package/build/es/components/DataDimension/{MetricSelector.js → ItemSelector/MetricSelector.js}
RENAMED
|
@@ -2,9 +2,9 @@ import _JSXStyle from "styled-jsx/style";
|
|
|
2
2
|
import { SingleSelectField, SingleSelectOption } from '@dhis2/ui';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import i18n from '
|
|
6
|
-
import { DATA_SETS_CONSTANTS } from '
|
|
7
|
-
import { DIMENSION_TYPE_ALL } from '
|
|
5
|
+
import i18n from '../../../locales/index.js';
|
|
6
|
+
import { DATA_SETS_CONSTANTS } from '../../../modules/dataSets.js';
|
|
7
|
+
import { DIMENSION_TYPE_ALL } from '../../../modules/dataTypes.js';
|
|
8
8
|
import styles from './styles/MetricSelector.style.js';
|
|
9
9
|
export const MetricSelector = _ref => {
|
|
10
10
|
let {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import i18n from '@dhis2/d2-i18n';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import styles from './styles/EmptyPlaceholder.style.js';
|
|
5
|
+
export const SelectedEmptyPlaceholder = () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
|
|
6
|
+
className: `jsx-${styles.__hash}` + " " + "empty-list"
|
|
7
|
+
}, i18n.t('No items selected')), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
8
|
+
id: styles.__hash
|
|
9
|
+
}, styles));
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import i18n from '@dhis2/d2-i18n';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { DIMENSION_TYPE_DATA_ELEMENT, DIMENSION_TYPE_DATA_SET, DIMENSION_TYPE_EVENT_DATA_ITEM, DIMENSION_TYPE_PROGRAM_INDICATOR, DIMENSION_TYPE_INDICATOR, DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM } from '../../modules/dataTypes.js';
|
|
6
|
+
import styles from './styles/EmptyPlaceholder.style.js';
|
|
7
|
+
export const SourceEmptyPlaceholder = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
loading,
|
|
10
|
+
searchTerm,
|
|
11
|
+
options,
|
|
12
|
+
allItemsSelectedMessage,
|
|
13
|
+
noItemsMessage,
|
|
14
|
+
dataType,
|
|
15
|
+
dataTest
|
|
16
|
+
} = _ref;
|
|
17
|
+
let message = '';
|
|
18
|
+
if (allItemsSelectedMessage && !loading && options.length && !searchTerm) {
|
|
19
|
+
message = allItemsSelectedMessage;
|
|
20
|
+
} else if (!loading && !options.length && !searchTerm) {
|
|
21
|
+
if (noItemsMessage) {
|
|
22
|
+
message = noItemsMessage;
|
|
23
|
+
} else {
|
|
24
|
+
switch (dataType) {
|
|
25
|
+
case DIMENSION_TYPE_INDICATOR:
|
|
26
|
+
message = i18n.t('No indicators found');
|
|
27
|
+
break;
|
|
28
|
+
case DIMENSION_TYPE_DATA_ELEMENT:
|
|
29
|
+
message = i18n.t('No data elements found');
|
|
30
|
+
break;
|
|
31
|
+
case DIMENSION_TYPE_DATA_SET:
|
|
32
|
+
message = i18n.t('No data sets found');
|
|
33
|
+
break;
|
|
34
|
+
case DIMENSION_TYPE_EVENT_DATA_ITEM:
|
|
35
|
+
message = i18n.t('No event data items found');
|
|
36
|
+
break;
|
|
37
|
+
case DIMENSION_TYPE_PROGRAM_INDICATOR:
|
|
38
|
+
message = i18n.t('No program indicators found');
|
|
39
|
+
break;
|
|
40
|
+
case DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM:
|
|
41
|
+
message = i18n.t('No calculations found');
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
message = i18n.t('No data');
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} else if (!loading && !options.length && searchTerm) {
|
|
49
|
+
switch (dataType) {
|
|
50
|
+
case DIMENSION_TYPE_INDICATOR:
|
|
51
|
+
message = i18n.t('No indicators found for "{{- searchTerm}}"', {
|
|
52
|
+
searchTerm
|
|
53
|
+
});
|
|
54
|
+
break;
|
|
55
|
+
case DIMENSION_TYPE_DATA_ELEMENT:
|
|
56
|
+
message = i18n.t('No data elements found for "{{- searchTerm}}"', {
|
|
57
|
+
searchTerm
|
|
58
|
+
});
|
|
59
|
+
break;
|
|
60
|
+
case DIMENSION_TYPE_DATA_SET:
|
|
61
|
+
message = i18n.t('No data sets found for "{{- searchTerm}}"', {
|
|
62
|
+
searchTerm
|
|
63
|
+
});
|
|
64
|
+
break;
|
|
65
|
+
case DIMENSION_TYPE_EVENT_DATA_ITEM:
|
|
66
|
+
message = i18n.t('No event data items found for "{{- searchTerm}}"', {
|
|
67
|
+
searchTerm
|
|
68
|
+
});
|
|
69
|
+
break;
|
|
70
|
+
case DIMENSION_TYPE_PROGRAM_INDICATOR:
|
|
71
|
+
message = i18n.t('No program indicators found for "{{- searchTerm}}"', {
|
|
72
|
+
searchTerm
|
|
73
|
+
});
|
|
74
|
+
break;
|
|
75
|
+
case DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM:
|
|
76
|
+
message = i18n.t('No calculations found for "{{- searchTerm}}"', {
|
|
77
|
+
searchTerm
|
|
78
|
+
});
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
message = i18n.t('Nothing found for "{{- searchTerm}}"', {
|
|
82
|
+
searchTerm
|
|
83
|
+
});
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return message && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
|
|
88
|
+
"data-test": dataTest,
|
|
89
|
+
className: `jsx-${styles.__hash}` + " " + "empty-list"
|
|
90
|
+
}, message), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
91
|
+
id: styles.__hash
|
|
92
|
+
}, styles));
|
|
93
|
+
};
|
|
94
|
+
SourceEmptyPlaceholder.defaultProps = {
|
|
95
|
+
options: []
|
|
96
|
+
};
|
|
97
|
+
SourceEmptyPlaceholder.propTypes = {
|
|
98
|
+
allItemsSelectedMessage: PropTypes.string,
|
|
99
|
+
dataTest: PropTypes.string,
|
|
100
|
+
dataType: PropTypes.string,
|
|
101
|
+
loading: PropTypes.bool,
|
|
102
|
+
noItemsMessage: PropTypes.string,
|
|
103
|
+
options: PropTypes.array,
|
|
104
|
+
searchTerm: PropTypes.string
|
|
105
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
import
|
|
2
|
+
import i18n from '@dhis2/d2-i18n';
|
|
3
|
+
import { IconEdit16, IconInfo16, IconList16, Tooltip } from '@dhis2/ui';
|
|
3
4
|
import cx from 'classnames';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
6
|
import React from 'react';
|
|
7
|
+
import { DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM, DIMENSION_TYPE_PROGRAM_ATTRIBUTE, DIMENSION_TYPE_PROGRAM_DATA_ELEMENT } from '../../modules/dataTypes.js';
|
|
6
8
|
import styles from './styles/TransferOption.style.js';
|
|
7
9
|
export const TransferOption = _ref => {
|
|
8
10
|
let {
|
|
@@ -15,8 +17,10 @@ export const TransferOption = _ref => {
|
|
|
15
17
|
value,
|
|
16
18
|
icon,
|
|
17
19
|
active,
|
|
20
|
+
dataItemType,
|
|
18
21
|
dimensionType,
|
|
19
22
|
dataTest,
|
|
23
|
+
optionSetId,
|
|
20
24
|
itemsRef,
|
|
21
25
|
showingInfo,
|
|
22
26
|
onEditClick,
|
|
@@ -54,14 +58,39 @@ export const TransferOption = _ref => {
|
|
|
54
58
|
className: `jsx-${styles.__hash}` + " " + "icon"
|
|
55
59
|
}, icon), /*#__PURE__*/React.createElement("span", {
|
|
56
60
|
className: `jsx-${styles.__hash}` + " " + "label"
|
|
57
|
-
}, label),
|
|
61
|
+
}, label), dataItemType === DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM &&
|
|
62
|
+
// XXX check needed?!
|
|
63
|
+
onEditClick && /*#__PURE__*/React.createElement("span", {
|
|
58
64
|
onClick: e => {
|
|
59
65
|
e.stopPropagation();
|
|
60
66
|
onEditClick();
|
|
61
67
|
},
|
|
62
|
-
"data-test": `${dataTest}-edit-button`,
|
|
68
|
+
"data-test": `${dataTest}-edit-calculation-button`,
|
|
63
69
|
className: `jsx-${styles.__hash}` + " " + "edit"
|
|
64
|
-
}, /*#__PURE__*/React.createElement(IconEdit16, null))
|
|
70
|
+
}, /*#__PURE__*/React.createElement(IconEdit16, null)), [DIMENSION_TYPE_PROGRAM_ATTRIBUTE, DIMENSION_TYPE_PROGRAM_DATA_ELEMENT].includes(dataItemType) && optionSetId && /*#__PURE__*/React.createElement(Tooltip, {
|
|
71
|
+
"aria-label": "disabled",
|
|
72
|
+
content: i18n.t('Click to choose from available options'),
|
|
73
|
+
openDelay: 500,
|
|
74
|
+
closeDelay: 0
|
|
75
|
+
}, _ref2 => {
|
|
76
|
+
let {
|
|
77
|
+
ref,
|
|
78
|
+
onMouseOver,
|
|
79
|
+
onMouseOut
|
|
80
|
+
} = _ref2;
|
|
81
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
82
|
+
ref: ref,
|
|
83
|
+
onMouseOver: onMouseOver,
|
|
84
|
+
onMouseOut: onMouseOut,
|
|
85
|
+
onClick: e => {
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
onMouseOut();
|
|
88
|
+
onEditClick();
|
|
89
|
+
},
|
|
90
|
+
"data-test": `${dataTest}-option-set-button`,
|
|
91
|
+
className: `jsx-${styles.__hash}` + " " + "option-set-button"
|
|
92
|
+
}, /*#__PURE__*/React.createElement(IconList16, null));
|
|
93
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
65
94
|
className: `jsx-${styles.__hash}` + " " + (cx('group', 'nowrap', 'typeGroup') || "")
|
|
66
95
|
}, /*#__PURE__*/React.createElement("span", {
|
|
67
96
|
className: `jsx-${styles.__hash}` + " " + "type"
|
|
@@ -94,12 +123,14 @@ TransferOption.propTypes = {
|
|
|
94
123
|
label: PropTypes.string.isRequired,
|
|
95
124
|
value: PropTypes.string.isRequired,
|
|
96
125
|
active: PropTypes.bool,
|
|
126
|
+
dataItemType: PropTypes.string,
|
|
97
127
|
dataTest: PropTypes.string,
|
|
98
128
|
dimensionType: PropTypes.string,
|
|
99
129
|
disabled: PropTypes.bool,
|
|
100
130
|
highlighted: PropTypes.bool,
|
|
101
131
|
icon: PropTypes.node,
|
|
102
132
|
itemsRef: PropTypes.object,
|
|
133
|
+
optionSetId: PropTypes.string,
|
|
103
134
|
selected: PropTypes.bool,
|
|
104
135
|
showingInfo: PropTypes.bool,
|
|
105
136
|
onClick: PropTypes.func,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { spacers, colors } from '@dhis2/ui';
|
|
2
|
+
const _defaultExport = [`.empty-list.jsx-3468764855{text-align:center;font-size:14px;line-height:16px;margin:${spacers.dp24} 0 0;color:${colors.grey700};}`];
|
|
3
|
+
_defaultExport.__hash = "3468764855";
|
|
4
|
+
export default _defaultExport;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { colors, spacers, theme } from '@dhis2/ui';
|
|
2
|
-
const _defaultExport = [`.wrapper.jsx-
|
|
3
|
-
_defaultExport.__hash = "
|
|
2
|
+
const _defaultExport = [`.wrapper.jsx-1354743119:last-child{margin-bottom:${spacers.dp4};}`, `.item.jsx-1354743119{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;background:${colors.white};font-size:14px;line-height:16px;border-bottom:1px solid ${colors.grey300};-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}`, `.item.jsx-1354743119:hover{background:${colors.grey100};}`, ".disabled.jsx-1354743119{opacity:0.3;cursor:not-allowed;}", ".inactive.jsx-1354743119{opacity:0.3;}", ".labelGroup.jsx-1354743119{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;margin:5px 4px;}", ".typeGroup.jsx-1354743119{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;margin:0;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}", ".nowrap.jsx-1354743119{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".icon.jsx-1354743119,.label.jsx-1354743119{line-height:16px;margin:2px 0;}", `.icon.jsx-1354743119{margin-right:${spacers.dp4};display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:text-bottom;}`, `.label.jsx-1354743119{font-size:14px;color:${colors.grey900};}`, `.type.jsx-1354743119{font-size:10px;-webkit-letter-spacing:-0.2px;-moz-letter-spacing:-0.2px;-ms-letter-spacing:-0.2px;letter-spacing:-0.2px;color:${colors.grey600};font-family:ui-monospace,'Cascadia Code','Source Code Pro',Menlo, Consolas,'DejaVu Sans Mono',monospace;font-weight:normal;margin:9px 0 0 0;}`, `.edit.jsx-1354743119,.option-set-button.jsx-1354743119{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-left:${spacers.dp8};cursor:pointer;color:${colors.grey600};background-color:${colors.white};border:1px solid ${colors.grey300};border-radius:3px;padding:0 2px;height:20px;}`, `.option-set-button.jsx-1354743119:hover,.edit.jsx-1354743119:hover{background-color:${colors.grey050};border-color:#c7cbd0;color:${colors.grey900};}`, `.info.jsx-1354743119{margin:0 0 0 2px;padding:${spacers.dp8} ${spacers.dp4} 0 ${spacers.dp4};-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;cursor:pointer;color:${colors.grey600};}`, `.info.active.jsx-1354743119{background-color:${colors.grey300};color:${colors.grey900};}`, `.highlighted.jsx-1354743119{background:${theme.secondary700};}`, `.highlighted.jsx-1354743119:hover{background:${theme.secondary800};}`, `.highlighted.jsx-1354743119 .edit.jsx-1354743119,.highlighted.jsx-1354743119 .label.jsx-1354743119{color:${colors.white};}`, `.highlighted.jsx-1354743119 .icon.jsx-1354743119,.highlighted.jsx-1354743119 .option-set-button.jsx-1354743119,.highlighted.jsx-1354743119 .type.jsx-1354743119,.highlighted.jsx-1354743119 .info.jsx-1354743119{color:${theme.secondary050};}`, `.info.jsx-1354743119:hover{background-color:${colors.grey200};border-radius:0px;}`, `.highlighted.jsx-1354743119 .option-set-button.jsx-1354743119,.highlighted.jsx-1354743119 .edit.jsx-1354743119{background-color:transparent;border-color:${theme.secondary900};}`, `.highlighted.jsx-1354743119 .edit.jsx-1354743119:hover,.highlighted.jsx-1354743119 .info.jsx-1354743119:hover,.highlighted.jsx-1354743119 .info.active.jsx-1354743119,.highlighted.jsx-1354743119 .option-set-button.jsx-1354743119:hover{background-color:${theme.secondary900};}`];
|
|
3
|
+
_defaultExport.__hash = "1354743119";
|
|
4
4
|
export default _defaultExport;
|
|
@@ -8,10 +8,10 @@ const OptionsButton = _ref => {
|
|
|
8
8
|
} = _ref;
|
|
9
9
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
|
|
10
10
|
onClick: onClick,
|
|
11
|
-
className: "jsx-
|
|
11
|
+
className: "jsx-2074438274"
|
|
12
12
|
}, /*#__PURE__*/React.createElement(IconMore16, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
13
|
-
id: "
|
|
14
|
-
}, ["button.jsx-
|
|
13
|
+
id: "2074438274"
|
|
14
|
+
}, ["button.jsx-2074438274{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;height:100%;width:20px;padding:0;border:none;background:none;outline:none;cursor:pointer;border-top-right-radius:2px;border-bottom-left-radius:2px;}", "button.jsx-2074438274:hover{background-color:rgba(33,41,52,0.08);}", "button.jsx-2074438274:active{background-color:rgba(33,41,52,0.13);}"]));
|
|
15
15
|
};
|
|
16
16
|
OptionsButton.propTypes = {
|
|
17
17
|
onClick: PropTypes.func
|