awing-library 2.1.11-beta → 2.1.12-beta
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.
|
@@ -63,6 +63,14 @@ function ControlPanel(_a) {
|
|
|
63
63
|
var _c = (0, react_1.useState)(), queryInput = _c[0], setQueryInput = _c[1];
|
|
64
64
|
var _d = (0, react_1.useState)([]), elementInputs = _d[0], setElementInputs = _d[1];
|
|
65
65
|
var _e = (0, react_1.useState)(false), isShowFilterEnhanced = _e[0], setIsHideFieldAdvanced = _e[1];
|
|
66
|
+
var _f = (0, react_1.useState)(0), flagView = _f[0], setFlagView = _f[1];
|
|
67
|
+
var getView = function () {
|
|
68
|
+
onChangeQueryInput(queryInput);
|
|
69
|
+
setFlagView(flagView + 1);
|
|
70
|
+
};
|
|
71
|
+
var disabledViewBy = (queryInput === null || queryInput === void 0 ? void 0 : queryInput.campaignIds) &&
|
|
72
|
+
(queryInput === null || queryInput === void 0 ? void 0 : queryInput.campaignIds.length) > 0 &&
|
|
73
|
+
flagView > 0;
|
|
66
74
|
var handleInitialFilter = function (initialFilters) {
|
|
67
75
|
var initValue = initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.reduce(function (acc, curr) {
|
|
68
76
|
if ((curr === null || curr === void 0 ? void 0 : curr.type) === Enums_1.TYPE_FILTERS.DATE_RANGE_PICKER) {
|
|
@@ -93,7 +101,7 @@ function ControlPanel(_a) {
|
|
|
93
101
|
return item === null || item === void 0 ? void 0 : item.onChange(Number(e.target.value));
|
|
94
102
|
}, SelectProps: {
|
|
95
103
|
native: true,
|
|
96
|
-
}, variant: "outlined", style: { minWidth: 160 }, disabled: isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.chartLoading, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("option", { value: Number(item === null || item === void 0 ? void 0 : item.initialData[0].value), children: item === null || item === void 0 ? void 0 : item.initialData[0].label }), (0, jsx_runtime_1.jsx)("option", { value: Number(item === null || item === void 0 ? void 0 : item.initialData[1].value), children: item === null || item === void 0 ? void 0 : item.initialData[1].label })] }) }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'viewBy' }, item);
|
|
104
|
+
}, variant: "outlined", style: { minWidth: 160 }, disabled: (isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.chartLoading) || !disabledViewBy, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("option", { value: Number(item === null || item === void 0 ? void 0 : item.initialData[0].value), children: item === null || item === void 0 ? void 0 : item.initialData[0].label }), (0, jsx_runtime_1.jsx)("option", { value: Number(item === null || item === void 0 ? void 0 : item.initialData[1].value), children: item === null || item === void 0 ? void 0 : item.initialData[1].label })] }) }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'viewBy' }, item);
|
|
97
105
|
updatedElementInputs.push(element);
|
|
98
106
|
break;
|
|
99
107
|
}
|
|
@@ -217,9 +225,7 @@ function ControlPanel(_a) {
|
|
|
217
225
|
paddingTop: '24px',
|
|
218
226
|
display: 'flex',
|
|
219
227
|
flex: 'none',
|
|
220
|
-
}, justifyContent: "flex-end", children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", onClick: function () {
|
|
221
|
-
onChangeQueryInput(queryInput);
|
|
222
|
-
}, style: { height: '40px' }, disabled: (_b = isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.chartLoading) !== null && _b !== void 0 ? _b : false, children: t('Common.View') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", title: t('Common.Download'), onClick: function () { return onChangeExportInput(queryInput); }, color: "inherit", disabled: isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.exportLoading, style: {
|
|
228
|
+
}, justifyContent: "flex-end", children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", onClick: getView, style: { height: '40px' }, disabled: (_b = isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.chartLoading) !== null && _b !== void 0 ? _b : false, children: t('Common.View') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", title: t('Common.Download'), onClick: function () { return onChangeExportInput(queryInput); }, color: "inherit", disabled: isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.exportLoading, style: {
|
|
223
229
|
marginLeft: '16px',
|
|
224
230
|
height: '40px',
|
|
225
231
|
}, children: (isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.exportLoading) ? ((0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, { styleWrap: {
|