awing-library 2.1.5-beta → 2.1.7-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.
package/README.md CHANGED
@@ -37,29 +37,6 @@ yarn build
37
37
  ```shell
38
38
  yarn link
39
39
  ```
40
-
41
- - Step 3: Xoá dependencies trong node_modules
42
-
43
- ```shell
44
- rm -rf node_modules/react node_modules/react-dom node_modules/@mui/styles node_modules/@mui/material
45
- ```
46
-
47
- ## In project
48
-
49
- _Sau khi thực hiện mỗi lệnh đều phải trở về thư mục gốc của project_
50
-
51
- - Xoá thư mục awing-library tại project
52
-
53
- ```shell
54
- rm -rf node_modules/awing-library
55
- ```
56
-
57
- - Link awing-library to project
58
-
59
- ```shell
60
- yarn link awing-library
61
- ```
62
-
63
40
  - Tạo Link react
64
41
 
65
42
  ```shell
@@ -88,10 +65,17 @@ cd node_modules/@mui/styles
88
65
  yarn link
89
66
  ```
90
67
 
91
- **Sau đó qua lại library**
68
+ ## In project
92
69
 
93
- - liên kết các dependencies vừa tạo link
70
+ _Sau khi thực hiện mỗi lệnh đều phải trở về thư mục gốc của project_
71
+
72
+ - Xoá dependencies trong node_modules
73
+
74
+ ```shell
75
+ rm -rf node_modules/react node_modules/react-dom node_modules/@mui/styles node_modules/@mui/material node_modules/awing-library
76
+ ```
94
77
 
78
+ - Link library to project
95
79
  ```shell
96
- yarn link react react-dom @mui/material @mui/styles
80
+ yarn link react react-dom @mui/material @mui/styles awing-library
97
81
  ```
@@ -123,6 +123,7 @@ var PageContainer = function () {
123
123
  }, 100), []);
124
124
  var getPagePaging = (0, react_1.useCallback)(function (input, directoryId) {
125
125
  var _a;
126
+ console.log("call");
126
127
  var searchString = input.searchString, pageSize = input.pageSize, pageIndex = input.pageIndex, advancedObject = input.advancedObject;
127
128
  handleFetchPaging(searchString, pageSize, pageIndex, directoryId ||
128
129
  (advancedObject === null || advancedObject === void 0 ? void 0 : advancedObject.directoryId) ||
@@ -10,6 +10,15 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
+ if (ar || !(i in from)) {
16
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
+ ar[i] = from[i];
18
+ }
19
+ }
20
+ return to.concat(ar || Array.prototype.slice.call(from));
21
+ };
13
22
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
24
  };
@@ -23,6 +32,7 @@ var react_i18next_1 = require("react-i18next");
23
32
  var Enums_1 = require("./Enums");
24
33
  var styles_1 = require("@mui/styles");
25
34
  var AWING_1 = require("../../AWING");
35
+ var icons_material_1 = require("@mui/icons-material");
26
36
  var useStyles = (0, styles_1.makeStyles)(function () { return ({
27
37
  outlinedInput: {
28
38
  '& .MuiOutlinedInput-input': {
@@ -46,12 +56,13 @@ var useStyles = (0, styles_1.makeStyles)(function () { return ({
46
56
  },
47
57
  }); });
48
58
  function ControlPanel(_a) {
49
- var _b, _c, _d, _e, _f, _g;
59
+ var _b;
50
60
  var onChangeQueryInput = _a.onChangeQueryInput, onChangeExportInput = _a.onChangeExportInput, initialFilters = _a.initialFilters, isLoadings = _a.isLoadings, infoSX = _a.infoSX;
51
61
  var classes = useStyles();
52
62
  var t = (0, react_i18next_1.useTranslation)().t;
53
- var _h = (0, react_1.useState)(), queryInput = _h[0], setQueryInput = _h[1];
54
- var _j = (0, react_1.useState)(), elementInputs = _j[0], setElementInputs = _j[1];
63
+ var _c = (0, react_1.useState)(), queryInput = _c[0], setQueryInput = _c[1];
64
+ var _d = (0, react_1.useState)([]), elementInputs = _d[0], setElementInputs = _d[1];
65
+ var _e = (0, react_1.useState)(false), isShowFilterEnhanced = _e[0], setIsHideFieldAdvanced = _e[1];
55
66
  var handleInitialFilter = function (initialFilters) {
56
67
  var initValue = initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.reduce(function (acc, curr) {
57
68
  if ((curr === null || curr === void 0 ? void 0 : curr.type) === Enums_1.TYPE_FILTERS.DATE_RANGE_PICKER) {
@@ -73,90 +84,100 @@ function ControlPanel(_a) {
73
84
  handleChangeQueryInput('endDate', value.endDate);
74
85
  };
75
86
  var handleElementInput = function (initialFilters) {
76
- var updatedElementInputs = {};
77
- initialFilters.map(function (item) {
87
+ var updatedElementInputs = [];
88
+ initialFilters.map(function (item, idx) {
78
89
  var _a, _b, _c;
79
90
  switch (item === null || item === void 0 ? void 0 : item.type) {
80
91
  case Enums_1.TYPE_FILTERS.VIEW_BY: {
81
- updatedElementInputs.viewBy = ((0, jsx_runtime_1.jsx)(material_1.TextField, { select: true, fullWidth: true, label: t('Common.ViewBy'), size: "small", onChange: function (e) {
82
- return item === null || item === void 0 ? void 0 : item.onChange(Number(e.target.value));
83
- }, SelectProps: {
84
- native: true,
85
- }, 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 })] }) }));
92
+ 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) {
93
+ return item === null || item === void 0 ? void 0 : item.onChange(Number(e.target.value));
94
+ }, SelectProps: {
95
+ 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);
97
+ updatedElementInputs.push(element);
86
98
  break;
87
99
  }
88
100
  case Enums_1.TYPE_FILTERS.VIEW_USER: {
89
- updatedElementInputs.viewUser = ((0, jsx_runtime_1.jsx)(material_1.TextField, { select: true, fullWidth: true, label: t('Common.ViewBy'), size: "small", onChange: function (e) {
90
- return item === null || item === void 0 ? void 0 : item.onChange(Number(e.target.value));
91
- }, SelectProps: {
92
- native: true,
93
- }, variant: "outlined", style: { minWidth: 180 }, 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 })] }) }));
101
+ 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) {
102
+ return item === null || item === void 0 ? void 0 : item.onChange(Number(e.target.value));
103
+ }, SelectProps: {
104
+ native: true,
105
+ }, variant: "outlined", style: { minWidth: 180 }, 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: 'viewUser' }, item);
106
+ updatedElementInputs.push(element);
94
107
  break;
95
108
  }
96
109
  case Enums_1.TYPE_FILTERS.VIEW_TIME: {
97
- updatedElementInputs.viewTime = ((0, jsx_runtime_1.jsx)(material_1.TextField, { select: true, fullWidth: true, label: t('Common.ViewBy'), size: "small", onChange: function (e) {
98
- return handleChangeQueryInput &&
99
- handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.value);
100
- }, SelectProps: {
101
- native: true,
102
- }, variant: "outlined", style: { minWidth: 150 }, disabled: false, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("option", { value: 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: item === null || item === void 0 ? void 0 : item.initialData[1].value, children: item === null || item === void 0 ? void 0 : item.initialData[1].label })] }) }));
110
+ 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) {
111
+ return handleChangeQueryInput &&
112
+ handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.value);
113
+ }, SelectProps: {
114
+ native: true,
115
+ }, variant: "outlined", style: { minWidth: 150 }, disabled: false, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("option", { value: 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: 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: 'viewTime' }, item);
116
+ updatedElementInputs.push(element);
103
117
  break;
104
118
  }
105
119
  case Enums_1.TYPE_FILTERS.DATE_RANGE_PICKER: {
106
- updatedElementInputs.dateRangePicker = ((0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker, __assign({ isShowCalendarInfo: true, label: "".concat(t('Common.StartDate'), " - ").concat(t('Common.EndDate')), initialStartDate: (item === null || item === void 0 ? void 0 : item.isPassTime)
107
- ? (0, moment_1.default)()
108
- : (0, moment_1.default)().subtract(7, 'days'), initialEndDate: (item === null || item === void 0 ? void 0 : item.isPassTime)
109
- ? (0, moment_1.default)().add(7, 'days')
110
- : (0, moment_1.default)(), variant: "outlined", textFieldProps: {
111
- fullWidth: true,
112
- className: classes.outlinedInput,
113
- }, callback: handleChangeDateRange }, ((item === null || item === void 0 ? void 0 : item.isDayBlocked) && {
114
- isDayBlocked: item.isDayBlocked,
115
- }))));
120
+ var element = __assign({ component: ((0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker, __assign({ isShowCalendarInfo: true, label: "".concat(t('Common.StartDate'), " - ").concat(t('Common.EndDate')), initialStartDate: (item === null || item === void 0 ? void 0 : item.isPassTime)
121
+ ? (0, moment_1.default)()
122
+ : (0, moment_1.default)().subtract(7, 'days'), initialEndDate: (item === null || item === void 0 ? void 0 : item.isPassTime)
123
+ ? (0, moment_1.default)().add(7, 'days')
124
+ : (0, moment_1.default)(), variant: "outlined", textFieldProps: {
125
+ fullWidth: true,
126
+ className: classes.outlinedInput,
127
+ }, callback: handleChangeDateRange }, ((item === null || item === void 0 ? void 0 : item.isDayBlocked) && {
128
+ isDayBlocked: item.isDayBlocked,
129
+ })), idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'dateRangePicker' }, item);
130
+ updatedElementInputs.push(element);
116
131
  break;
117
132
  }
118
133
  case Enums_1.TYPE_FILTERS.CAMPAIGN: {
119
134
  var CampaignFilter = item === null || item === void 0 ? void 0 : item.nodeElement;
120
- updatedElementInputs.campaign = ((0, jsx_runtime_1.jsx)(CampaignFilter, { defaultValue: [], disabled: queryInput === null || queryInput === void 0 ? void 0 : queryInput.isCampaignDefault, onSubmit: function (campaignIds) {
121
- return handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, campaignIds);
122
- }, disableMulti: item === null || item === void 0 ? void 0 : item.disableMulti }));
135
+ var element = __assign({ component: ((0, jsx_runtime_1.jsx)(CampaignFilter, { defaultValue: [], disabled: queryInput === null || queryInput === void 0 ? void 0 : queryInput.isCampaignDefault, onSubmit: function (campaignIds) {
136
+ return handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, campaignIds);
137
+ }, disableMulti: item === null || item === void 0 ? void 0 : item.disableMulti }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'campaign' }, item);
138
+ updatedElementInputs.push(element);
123
139
  break;
124
140
  }
125
141
  case Enums_1.TYPE_FILTERS.PLACE: {
126
142
  var PlaceFilter = item === null || item === void 0 ? void 0 : item.nodeElement;
127
- updatedElementInputs.place = ((0, jsx_runtime_1.jsx)(PlaceFilter, { isDisplayTextField: true, onChange: function (placeIds) {
128
- return handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, placeIds);
129
- } }));
143
+ var element = __assign({ component: ((0, jsx_runtime_1.jsx)(PlaceFilter, { isDisplayTextField: true, onChange: function (placeIds) {
144
+ return handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, placeIds);
145
+ } }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'place' }, item);
146
+ updatedElementInputs.push(element);
130
147
  break;
131
148
  }
132
149
  case Enums_1.TYPE_FILTERS.PLACE_AUTOCOMPLETE: {
133
150
  var PlaceFilter = item === null || item === void 0 ? void 0 : item.nodeElement;
134
- updatedElementInputs.placeAutoComplete = ((0, jsx_runtime_1.jsx)(PlaceFilter, { onChange: function (event, value) {
135
- return handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, value === null || value === void 0 ? void 0 : value.placeId);
136
- } }));
151
+ var element = __assign({ component: ((0, jsx_runtime_1.jsx)(PlaceFilter, { onChange: function (event, value) {
152
+ return handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, value === null || value === void 0 ? void 0 : value.placeId);
153
+ } }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'placeAutoComplete' }, item);
154
+ updatedElementInputs.push(element);
137
155
  break;
138
156
  }
139
157
  case Enums_1.TYPE_FILTERS.NETWORK: {
140
- updatedElementInputs.isCampaignNetwork = ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (_a = queryInput === null || queryInput === void 0 ? void 0 : queryInput.isCampaignNetwork) !== null && _a !== void 0 ? _a : true }), label: t('Statistic.Network.Title'), labelPlacement: "start", onChange: function (e) {
141
- handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.checked);
142
- } }));
158
+ var element = __assign({ component: ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (_a = queryInput === null || queryInput === void 0 ? void 0 : queryInput.isCampaignNetwork) !== null && _a !== void 0 ? _a : true }), label: t('Statistic.Network.Title'), labelPlacement: "start", onChange: function (e) {
159
+ handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.checked);
160
+ } }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'isCampaignNetwork' }, item);
161
+ updatedElementInputs.push(element);
143
162
  break;
144
163
  }
145
164
  case Enums_1.TYPE_FILTERS.CAMPAIGN_DEFAULT: {
146
- updatedElementInputs.isCampaignDefault = ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (_b = queryInput === null || queryInput === void 0 ? void 0 : queryInput.isCampaignDefault) !== null && _b !== void 0 ? _b : false }), label: t('Statistic.CampaignDefault'), labelPlacement: "start", onChange: function (e) {
147
- handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.checked);
148
- } }));
165
+ var element = __assign({ component: ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (_b = queryInput === null || queryInput === void 0 ? void 0 : queryInput.isCampaignDefault) !== null && _b !== void 0 ? _b : false }), label: t('Statistic.CampaignDefault'), labelPlacement: "start", onChange: function (e) {
166
+ handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.checked);
167
+ } }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'isCampaignDefault' }, item);
168
+ updatedElementInputs.push(element);
149
169
  break;
150
170
  }
151
171
  case Enums_1.TYPE_FILTERS.INCLUDE_RESERVED: {
152
- updatedElementInputs.includeReserved = ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (_c = queryInput === null || queryInput === void 0 ? void 0 : queryInput.includeReserved) !== null && _c !== void 0 ? _c : true }), label: t('StatisticSchedulePlan.IncludeCampaignReserved'), labelPlacement: "start", onChange: function (e) {
153
- handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.checked);
154
- } }));
172
+ var element = __assign({ component: ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", defaultChecked: (_c = queryInput === null || queryInput === void 0 ? void 0 : queryInput.includeReserved) !== null && _c !== void 0 ? _c : true }), label: t('StatisticSchedulePlan.IncludeCampaignReserved'), labelPlacement: "start", onChange: function (e) {
173
+ handleChangeQueryInput(item === null || item === void 0 ? void 0 : item.name, e.target.checked);
174
+ } }, idx)), isEnhanced: (item === null || item === void 0 ? void 0 : item.isEnhanced) ? item === null || item === void 0 ? void 0 : item.isEnhanced : false, name: 'includeReserved' }, item);
175
+ updatedElementInputs.push(element);
155
176
  break;
156
177
  }
157
178
  }
158
179
  });
159
- setElementInputs(__assign(__assign({}, elementInputs), updatedElementInputs));
180
+ setElementInputs(__spreadArray([], updatedElementInputs, true));
160
181
  };
161
182
  (0, react_1.useEffect)(function () {
162
183
  setQueryInput(handleInitialFilter(initialFilters));
@@ -171,38 +192,57 @@ function ControlPanel(_a) {
171
192
  }
172
193
  onChangeQueryInput(tmpQueryInput);
173
194
  }, []);
174
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, justifyContent: 'flex-end', children: [((elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.viewBy) ||
175
- (elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.viewTime) ||
176
- (elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.viewUser)) && ((0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, item: true, lg: 1, justifyContent: "flex-start", children: (_c = (_b = elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.viewBy) !== null && _b !== void 0 ? _b : elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.viewTime) !== null && _c !== void 0 ? _c : elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.viewUser })), (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, item: true, lg: (elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.viewBy) ||
177
- (elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.viewTime) ||
178
- (elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.viewUser)
179
- ? 11
180
- : 12, style: { display: 'flex' }, justifyContent: "flex-end", spacing: 2, children: [(elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.dateRangePicker) && ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, lg: (infoSX === null || infoSX === void 0 ? void 0 : infoSX.dateRangePicker) || 3, xs: 12, sx: {
181
- '& .MuiInputBase-input': {
182
- height: '1.25rem',
183
- },
184
- }, children: elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.dateRangePicker })), (elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.campaign) && ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, lg: (infoSX === null || infoSX === void 0 ? void 0 : infoSX.campaign) || 3, children: elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.campaign })), ((elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.place) ||
185
- (elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.placeAutoComplete)) && ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, lg: (infoSX === null || infoSX === void 0 ? void 0 : infoSX.place) || (infoSX === null || infoSX === void 0 ? void 0 : infoSX.placeAutoComplete) || 3, sx: {
186
- '& .MuiInputBase-input': {
187
- textOverflow: 'ellipsis',
188
- },
189
- }, children: (_d = elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.place) !== null && _d !== void 0 ? _d : elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.placeAutoComplete })), (0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, style: {
190
- paddingTop: '24px',
195
+ var onShowFilterEnhanced = function () {
196
+ setIsHideFieldAdvanced(!isShowFilterEnhanced);
197
+ };
198
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, justifyContent: "flex-end", spacing: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 10, spacing: 2, sx: { paddingRight: '0.5rem' }, children: (0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, justifyContent: "flex-end", spacing: 2, children: elementInputs
199
+ .filter(function (item) {
200
+ return item.isEnhanced === false ||
201
+ item.isEnhanced === undefined;
202
+ })
203
+ .map(function (fieldFilterEnhanced) {
204
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: (fieldFilterEnhanced === null || fieldFilterEnhanced === void 0 ? void 0 : fieldFilterEnhanced.col)
205
+ ? fieldFilterEnhanced === null || fieldFilterEnhanced === void 0 ? void 0 : fieldFilterEnhanced.col
206
+ : 3 }, ((fieldFilterEnhanced === null || fieldFilterEnhanced === void 0 ? void 0 : fieldFilterEnhanced.type) ===
207
+ Enums_1.TYPE_FILTERS.DATE_RANGE_PICKER
208
+ ? {
209
+ sx: {
210
+ '& .MuiInputBase-input': {
211
+ height: '1.25rem',
212
+ },
213
+ },
214
+ }
215
+ : {}), { children: fieldFilterEnhanced === null || fieldFilterEnhanced === void 0 ? void 0 : fieldFilterEnhanced.component })) }));
216
+ }) }) }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: 2, style: {
217
+ paddingTop: '24px',
218
+ display: 'flex',
219
+ 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: {
223
+ marginLeft: '16px',
224
+ height: '40px',
225
+ }, children: (isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.exportLoading) ? ((0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, { styleWrap: {
226
+ display: 'flex',
227
+ justifyContent: 'center',
228
+ }, styleIcon: {
229
+ width: '25px !important',
230
+ height: '25px !important',
231
+ } })) : ((0, jsx_runtime_1.jsx)(GetApp_1.default, {})) }), elementInputs.filter(function (item) { return item.isEnhanced === true; })
232
+ .length > 0 && ((0, jsx_runtime_1.jsx)("div", { style: { marginLeft: '10px' }, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: onShowFilterEnhanced, children: isShowFilterEnhanced ? ((0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {})) : ((0, jsx_runtime_1.jsx)(icons_material_1.ExpandLess, {})) }) }))] })] }), isShowFilterEnhanced && ((0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, justifyContent: "flex-end", spacing: 2, sx: { paddingRight: '3rem' }, children: elementInputs
233
+ .filter(function (item) { return item.isEnhanced === true; })
234
+ .map(function (fieldFilterEnhanced) {
235
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: (fieldFilterEnhanced === null || fieldFilterEnhanced === void 0 ? void 0 : fieldFilterEnhanced.col)
236
+ ? fieldFilterEnhanced === null || fieldFilterEnhanced === void 0 ? void 0 : fieldFilterEnhanced.col
237
+ : 3, style: __assign({}, ((fieldFilterEnhanced === null || fieldFilterEnhanced === void 0 ? void 0 : fieldFilterEnhanced.type) ===
238
+ Enums_1.TYPE_FILTERS.INCLUDE_RESERVED ||
239
+ Enums_1.TYPE_FILTERS.CAMPAIGN_DEFAULT
240
+ ? {
241
+ paddingTop: '1.5rem',
191
242
  display: 'flex',
192
- }, justifyContent: "flex-end", children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", onClick: function () {
193
- onChangeQueryInput(queryInput);
194
- }, style: { height: '40px' }, disabled: (_e = isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.chartLoading) !== null && _e !== void 0 ? _e : 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: {
195
- marginLeft: '16px',
196
- height: '40px',
197
- }, children: (isLoadings === null || isLoadings === void 0 ? void 0 : isLoadings.exportLoading) ? ((0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, { styleWrap: {
198
- display: 'flex',
199
- justifyContent: 'center',
200
- }, styleIcon: {
201
- width: '25px !important',
202
- height: '25px !important',
203
- } })) : ((0, jsx_runtime_1.jsx)(GetApp_1.default, {})) })] })] })] }), (0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, xs: 12, justifyContent: "flex-end", style: {
204
- marginTop: 0,
205
- marginLeft: 0,
206
- }, spacing: 2, children: (0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, item: true, justifyContent: "flex-end", children: (_g = (_f = elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.isCampaignNetwork) !== null && _f !== void 0 ? _f : elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.isCampaignDefault) !== null && _g !== void 0 ? _g : elementInputs === null || elementInputs === void 0 ? void 0 : elementInputs.includeReserved }) })] }));
243
+ flex: 'none',
244
+ }
245
+ : null)), children: fieldFilterEnhanced === null || fieldFilterEnhanced === void 0 ? void 0 : fieldFilterEnhanced.component }) }));
246
+ }) }))] }));
207
247
  }
208
248
  exports.default = ControlPanel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.5-beta",
3
+ "version": "2.1.7-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",