awing-library 2.1.154-beta → 2.1.156-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.
|
@@ -15,6 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var react_1 = require("react");
|
|
18
19
|
var GetApp_1 = __importDefault(require("@mui/icons-material/GetApp"));
|
|
19
20
|
var material_1 = require("@mui/material");
|
|
20
21
|
var styles_1 = require("@mui/styles");
|
|
@@ -80,11 +81,12 @@ var useStyles = (0, styles_1.makeStyles)(function () { return ({
|
|
|
80
81
|
},
|
|
81
82
|
}); });
|
|
82
83
|
var Filters = function (_a) {
|
|
83
|
-
var _b,
|
|
84
|
-
var campaigns = _a.campaigns, handleFilters = _a.handleFilters, loadingFlags = _a.loadingFlags, PlaceMultiSelect = _a.placeMultiSelectComponent, handleExportExcel = _a.handleExportExcel, _d = _a.disabledCampaignFilter, disabledCampaignFilter = _d === void 0 ? false : _d, isFutureDate = _a.isFutureDate;
|
|
84
|
+
var campaigns = _a.campaigns, handleFilters = _a.handleFilters, loadingFlags = _a.loadingFlags, PlaceMultiSelect = _a.placeMultiSelectComponent, handleExportExcel = _a.handleExportExcel, _b = _a.disabledCampaignFilter, disabledCampaignFilter = _b === void 0 ? false : _b, isFutureDate = _a.isFutureDate;
|
|
85
85
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
86
|
-
var
|
|
87
|
-
var
|
|
86
|
+
var campaignOptions = __assign({ 0: { id: '-1', name: t('Common.SelectAll') } }, campaigns);
|
|
87
|
+
var options = lodash_1.default.values(campaignOptions);
|
|
88
|
+
var _c = (0, recoil_1.useRecoilState)(Atom_1.CampaignScheduleTypeViewState), typeView = _c[0], setTypeView = _c[1];
|
|
89
|
+
var _d = (0, react_1.useState)(options[0].id), campaignId = _d[0], setCampaignId = _d[1];
|
|
88
90
|
var classes = useStyles();
|
|
89
91
|
var handleChangeDateRange = function (value) {
|
|
90
92
|
handleFilters('startDate', value.startDate);
|
|
@@ -107,11 +109,13 @@ var Filters = function (_a) {
|
|
|
107
109
|
else {
|
|
108
110
|
return false;
|
|
109
111
|
}
|
|
110
|
-
} }) }), !disabledCampaignFilter && ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, children: (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { size: "small", disablePortal: true, id: "combo-box-demo", options:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
} }) }), !disabledCampaignFilter && ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, children: (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { size: "small", disablePortal: true, id: "combo-box-demo", options: options !== null && options !== void 0 ? options : [], value: options.find(function (item) { return item.id === campaignId; }), getOptionLabel: function (option) { var _a; return (_a = option.name) !== null && _a !== void 0 ? _a : ''; }, onChange: function (event, campaign) {
|
|
113
|
+
var _a;
|
|
114
|
+
handleFilters('campaignId', (campaign === null || campaign === void 0 ? void 0 : campaign.id) === options[0].id
|
|
115
|
+
? undefined
|
|
116
|
+
: campaign === null || campaign === void 0 ? void 0 : campaign.id);
|
|
117
|
+
setCampaignId((_a = campaign === null || campaign === void 0 ? void 0 : campaign.id) !== null && _a !== void 0 ? _a : options[0].id);
|
|
118
|
+
}, renderInput: function (params) { return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({}, params, { label: t('Schedule.CampaignName'), sx: { backgroundColor: 'white' }, variant: "outlined" }))); } }) })), (0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: disabledCampaignFilter ? 6 : 3, className: classes.ellipsisPlaceFilter, children: [(0, jsx_runtime_1.jsx)(PlaceMultiSelect, { isDisplayTextField: true, onChange: function (placeIds) {
|
|
115
119
|
return handleFilters('placeIds', placeIds);
|
|
116
120
|
} }), (0, jsx_runtime_1.jsx)(material_1.Button, { sx: {
|
|
117
121
|
height: '40px',
|
|
@@ -93,7 +93,7 @@ function ControlPanel(_a) {
|
|
|
93
93
|
var handleElementInput = function (initialFilters) {
|
|
94
94
|
var updatedElementInputs = [];
|
|
95
95
|
initialFilters.map(function (item, idx) {
|
|
96
|
-
var _a, _b, _c, _d, _e, _f;
|
|
96
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
97
97
|
switch (item === null || item === void 0 ? void 0 : item.type) {
|
|
98
98
|
case Enums_1.TYPE_FILTERS.VIEW_BY: {
|
|
99
99
|
var element = __assign({ component: ((0, jsx_runtime_1.jsx)(material_1.TextField, { select: true, fullWidth: true, label: t('Common.ViewBy'), size: "small", onChange: function (e) {
|
|
@@ -123,8 +123,20 @@ function ControlPanel(_a) {
|
|
|
123
123
|
updatedElementInputs.push(element);
|
|
124
124
|
break;
|
|
125
125
|
}
|
|
126
|
+
case Enums_1.TYPE_FILTERS.SEARCH_BY_PLACE: {
|
|
127
|
+
var element = __assign({ component: ((0, jsx_runtime_1.jsx)(material_1.TextField, { select: true, fullWidth: true, label: t('Common.TitleTypeView'), size: "small", onChange: function (e) {
|
|
128
|
+
return handleChangeQueryInput &&
|
|
129
|
+
handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.value);
|
|
130
|
+
}, SelectProps: {
|
|
131
|
+
native: true,
|
|
132
|
+
}, variant: "outlined", style: { minWidth: 150 }, disabled: false, children: (_a = item === null || item === void 0 ? void 0 : item.initialData) === null || _a === void 0 ? void 0 : _a.map(function (data, index) {
|
|
133
|
+
return ((0, jsx_runtime_1.jsx)("option", { value: data.value, children: data.label }, item.value));
|
|
134
|
+
}) }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'SearchByPlace' }, item);
|
|
135
|
+
updatedElementInputs.push(element);
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
126
138
|
case Enums_1.TYPE_FILTERS.DATE_RANGE_PICKER: {
|
|
127
|
-
var element = __assign({ component: ((0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker, __assign({ isShowCalendarInfo: (
|
|
139
|
+
var element = __assign({ component: ((0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker, __assign({ isShowCalendarInfo: (_b = item === null || item === void 0 ? void 0 : item.isShowCalendarInfo) !== null && _b !== void 0 ? _b : true, isFutureDate: (_c = item === null || item === void 0 ? void 0 : item.isFutureDate) !== null && _c !== void 0 ? _c : false, label: "".concat(t('Common.StartDate'), " - ").concat(t('Common.EndDate')), initialStartDate: (_d = item === null || item === void 0 ? void 0 : item.defaultValue) === null || _d === void 0 ? void 0 : _d.startDate, initialEndDate: (_e = item === null || item === void 0 ? void 0 : item.defaultValue) === null || _e === void 0 ? void 0 : _e.endDate, variant: "outlined", textFieldProps: {
|
|
128
140
|
fullWidth: true,
|
|
129
141
|
className: classes.outlinedInput,
|
|
130
142
|
}, callback: handleChangeDateRange }, ((item === null || item === void 0 ? void 0 : item.isDayBlocked) && {
|
|
@@ -167,7 +179,7 @@ function ControlPanel(_a) {
|
|
|
167
179
|
break;
|
|
168
180
|
}
|
|
169
181
|
case Enums_1.TYPE_FILTERS.NETWORK: {
|
|
170
|
-
var element = __assign({ component: ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (
|
|
182
|
+
var element = __assign({ component: ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (_f = queryInput === null || queryInput === void 0 ? void 0 : queryInput.isCampaignNetwork) !== null && _f !== void 0 ? _f : true }), label: t('Statistic.Network.Title'), labelPlacement: "start", onChange: function (e) {
|
|
171
183
|
handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.checked);
|
|
172
184
|
} }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'isCampaignNetwork' }, item);
|
|
173
185
|
updatedElementInputs.push(element);
|
|
@@ -181,7 +193,7 @@ function ControlPanel(_a) {
|
|
|
181
193
|
break;
|
|
182
194
|
}
|
|
183
195
|
case Enums_1.TYPE_FILTERS.INCLUDE_RESERVED: {
|
|
184
|
-
var element = __assign({ component: ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (
|
|
196
|
+
var element = __assign({ component: ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (_g = queryInput === null || queryInput === void 0 ? void 0 : queryInput.includeReserved) !== null && _g !== void 0 ? _g : true }), label: t('StatisticSchedulePlan.IncludeCampaignReserved'), labelPlacement: "start", onChange: function (e) {
|
|
185
197
|
handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.checked);
|
|
186
198
|
} }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'includeReserved' }, item);
|
|
187
199
|
updatedElementInputs.push(element);
|
|
@@ -9,7 +9,8 @@ export declare enum TYPE_FILTERS {
|
|
|
9
9
|
NETWORK = "NetWork",
|
|
10
10
|
CAMPAIGN_DEFAULT = "CampaignDefault",
|
|
11
11
|
INCLUDE_RESERVED = "IncludeReserved",
|
|
12
|
-
DATE_RANGE_PICKER = "DateRangePicker"
|
|
12
|
+
DATE_RANGE_PICKER = "DateRangePicker",
|
|
13
|
+
SEARCH_BY_PLACE = "SearchByPlace"
|
|
13
14
|
}
|
|
14
15
|
export declare enum TYPE_CHART {
|
|
15
16
|
PIE = "Pie",
|
|
@@ -14,6 +14,7 @@ var TYPE_FILTERS;
|
|
|
14
14
|
TYPE_FILTERS["CAMPAIGN_DEFAULT"] = "CampaignDefault";
|
|
15
15
|
TYPE_FILTERS["INCLUDE_RESERVED"] = "IncludeReserved";
|
|
16
16
|
TYPE_FILTERS["DATE_RANGE_PICKER"] = "DateRangePicker";
|
|
17
|
+
TYPE_FILTERS["SEARCH_BY_PLACE"] = "SearchByPlace";
|
|
17
18
|
})(TYPE_FILTERS || (exports.TYPE_FILTERS = TYPE_FILTERS = {}));
|
|
18
19
|
var TYPE_CHART;
|
|
19
20
|
(function (TYPE_CHART) {
|