awing-library 2.1.169-dev → 2.1.171-dev

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.
@@ -50,7 +50,7 @@ var CampaignContainer = function () {
50
50
  var _e = (0, react_1.useState)(), listCampaign = _e[0], setListCampaign = _e[1];
51
51
  var _f = (0, react_1.useState)(true), loading = _f[0], setLoading = _f[1];
52
52
  (0, react_1.useEffect)(function () {
53
- if (location.pathname.endsWith(Constant_1.Constants.CAMPAIGN_PATH)) {
53
+ if (location.pathname.endsWith("/" + Constant_1.Constants.CAMPAIGN_PATH)) {
54
54
  fetchDirectories();
55
55
  }
56
56
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -1,5 +1,6 @@
1
1
  import { CampaignModel, Directory, CampaignGroupModel, Attribute } from '../Types';
2
2
  import { WeightContainerProps } from './TabSubCampaign/Weight';
3
+ import { MenuOption } from '../../../AWING';
3
4
  export declare const directoriesState: import("recoil").RecoilState<Directory[]>;
4
5
  export declare const attributesState: import("recoil").RecoilState<Attribute[]>;
5
6
  export declare const isCreateState: import("recoil").RecoilState<boolean>;
@@ -48,3 +49,4 @@ export declare const readyForSubmitState: import("recoil").RecoilValueReadOnly<b
48
49
  * Nếu Weight render trong AdRow thì sẽ không đóng được DateRangePicker
49
50
  */
50
51
  export declare const weightState: import("recoil").RecoilState<WeightContainerProps>;
52
+ export declare const cacheSearchPageState: import("recoil").RecoilState<Record<string, MenuOption[]>>;
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.weightState = exports.readyForSubmitState = exports.tabPartnerValidState = exports.tabSubCampaignValidState = exports.tabInfomationValidState = exports.campaignPartnerState = exports.campaignGroupsState = exports.campaignAttributesState = exports.campaignState = exports.campaignModelState = exports.confirmExitState = exports.isCreateState = exports.attributesState = exports.directoriesState = void 0;
14
+ exports.cacheSearchPageState = exports.weightState = exports.readyForSubmitState = exports.tabPartnerValidState = exports.tabSubCampaignValidState = exports.tabInfomationValidState = exports.campaignPartnerState = exports.campaignGroupsState = exports.campaignAttributesState = exports.campaignState = exports.campaignModelState = exports.confirmExitState = exports.isCreateState = exports.attributesState = exports.directoriesState = void 0;
15
15
  var recoil_1 = require("recoil");
16
16
  var Utils_1 = require("../Utils");
17
17
  var atoms_1 = require("./TabSubCampaign/atoms");
@@ -207,3 +207,7 @@ exports.weightState = (0, recoil_1.atom)({
207
207
  isOpen: false,
208
208
  }
209
209
  });
210
+ exports.cacheSearchPageState = (0, recoil_1.atom)({
211
+ key: 'cacheSearchPageState',
212
+ default: {},
213
+ });
@@ -5,7 +5,7 @@ interface Props {
5
5
  isExportType: boolean;
6
6
  onChangeQueryInput: (changeType: string, newValue: any) => void;
7
7
  onQueryData: () => void;
8
- onExportData: (exportType?: string) => void;
8
+ onExportData: (exportType?: string) => void | Promise<void>;
9
9
  domains: any[];
10
10
  }
11
11
  declare const ChartFilterBox: (props: Props) => import("react/jsx-runtime").JSX.Element;
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
13
36
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
37
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
38
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -53,7 +76,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
53
76
  var jsx_runtime_1 = require("react/jsx-runtime");
54
77
  var GetApp_1 = __importDefault(require("@mui/icons-material/GetApp"));
55
78
  var material_1 = require("@mui/material");
56
- var react_1 = require("react");
79
+ var react_1 = __importStar(require("react"));
57
80
  var react_i18next_1 = require("react-i18next");
58
81
  // import { EnhancedDateRangePicker } from 'Components/DateRangePicker'
59
82
  var Helpers_1 = require("../../../../Utils/Helpers");
@@ -65,6 +88,7 @@ var SplitButtonExportType_1 = __importDefault(require("./SplitButtonExportType")
65
88
  var Enum_1 = require("../../../../ACM-AXN/Campaign/Enum");
66
89
  var i18n_1 = __importDefault(require("../../../../i18n"));
67
90
  var Context_1 = __importDefault(require("./Context"));
91
+ var lab_1 = require("@mui/lab");
68
92
  var textFieldStyle = {
69
93
  '& .MuiOutlinedInput-input': {
70
94
  padding: '10.5px !important',
@@ -89,7 +113,8 @@ var ChartFilterBox = function (props) {
89
113
  var
90
114
  // startDate, endDate,
91
115
  subCampaigns = props.subCampaigns, queryInput = props.queryInput, isExportType = props.isExportType, onChangeQueryInput = props.onChangeQueryInput, onQueryData = props.onQueryData, onExportData = props.onExportData, domains = props.domains;
92
- var _a = (0, Context_1.default)(), client = _a.services, PlaceMultiSelect = _a.placeMultiSelectComponent;
116
+ var _a = react_1.default.useState(false), loading = _a[0], setLoading = _a[1];
117
+ var _b = (0, Context_1.default)(), client = _b.services, PlaceMultiSelect = _b.placeMultiSelectComponent;
93
118
  var placeGroups = (0, react_1.useMemo)(function () {
94
119
  return subCampaigns.map(function (x) { return ({
95
120
  groupId: x.campaignGroup.id,
@@ -209,6 +234,22 @@ var ChartFilterBox = function (props) {
209
234
  MONTH: t('Common.Month'),
210
235
  },
211
236
  };
237
+ var handleExport = react_1.default.useCallback(function () {
238
+ setLoading(true);
239
+ var result = onExportData();
240
+ if (result instanceof Promise) {
241
+ result
242
+ .then(function () {
243
+ setLoading(false);
244
+ })
245
+ .catch(function () {
246
+ setLoading(false);
247
+ });
248
+ }
249
+ else {
250
+ setLoading(false);
251
+ }
252
+ }, [onExportData]);
212
253
  return ((0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 1 }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 3, children: (0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker
213
254
  // noBorder
214
255
  , {
@@ -228,6 +269,6 @@ var ChartFilterBox = function (props) {
228
269
  } }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, children: (0, jsx_runtime_1.jsx)(PlaceMultiSelect, { disableCheckPermission: !client.domainsGetAll, onChange: placeMultiSelectSubmit, initialOption: {
229
270
  placeGroups: placeGroups,
230
271
  domains: domains.map(function (d) { return (__assign(__assign({}, d), { name: d.domainName })); }),
231
- }, isDisplayTextField: true, TextFieldProps: { sx: textFieldStyle }, onGetPlacesByFilter: handleGetPlacesByFilter }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 1, children: (0, jsx_runtime_1.jsx)(material_1.FormControl, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { color: "primary", variant: "contained", fullWidth: true, onClick: function () { return onQueryData(); }, children: translationText.view }) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 3, children: (0, jsx_runtime_1.jsx)(material_1.FormControl, { children: !isExportType ? ((0, jsx_runtime_1.jsx)(material_1.Button, { variant: "outlined", onClick: function () { return onExportData(); }, children: (0, jsx_runtime_1.jsx)(GetApp_1.default, {}) })) : ((0, jsx_runtime_1.jsx)(SplitButtonExportType_1.default, { onSubmit: function (exportType) { return onExportData(exportType); } })) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 1 })] }));
272
+ }, isDisplayTextField: true, TextFieldProps: { sx: textFieldStyle }, onGetPlacesByFilter: handleGetPlacesByFilter }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 1, children: (0, jsx_runtime_1.jsx)(material_1.FormControl, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { color: "primary", variant: "contained", fullWidth: true, onClick: function () { return onQueryData(); }, children: translationText.view }) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 3, children: (0, jsx_runtime_1.jsx)(material_1.FormControl, { children: !isExportType ? ((0, jsx_runtime_1.jsx)(lab_1.LoadingButton, { variant: "outlined", onClick: handleExport, loading: loading, children: (0, jsx_runtime_1.jsx)(GetApp_1.default, {}) })) : ((0, jsx_runtime_1.jsx)(SplitButtonExportType_1.default, { onSubmit: function (exportType) { return onExportData(exportType); } })) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 1 })] }));
232
273
  };
233
274
  exports.default = ChartFilterBox;
@@ -90,7 +90,7 @@ var EventContainer = function (props) {
90
90
  var places = placeIds.length ? placesOfCampaign.filter(function (p) {
91
91
  return placeIds.includes(p.placeId);
92
92
  }) : placesOfCampaign;
93
- client
93
+ return client
94
94
  .campaignStatisticGetEvents({
95
95
  startDate: (0, moment_1.default)(time.startDate).format(Enum_1.DATE_FORMAT),
96
96
  endDate: (0, moment_1.default)(time.endDate).format(Enum_1.DATE_FORMAT),
@@ -200,6 +200,6 @@ function AdRow(props) {
200
200
  paddingBottom: 0,
201
201
  paddingTop: 0,
202
202
  borderBottomWidth: open ? 1 : 0,
203
- }, colSpan: 3, children: (0, jsx_runtime_1.jsx)(material_1.Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: (0, jsx_runtime_1.jsx)(material_1.Box, { margin: 1, children: (0, jsx_runtime_1.jsx)(AdDetail_1.default, __assign({ ad: ad, onChange: onChange }, other)) }) }) })] })] }));
203
+ }, colSpan: 3, children: (0, jsx_runtime_1.jsx)(material_1.Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: (0, jsx_runtime_1.jsx)(material_1.Box, { margin: 1, sx: { height: '416px' }, children: (0, jsx_runtime_1.jsx)(AdDetail_1.default, __assign({ ad: ad, onChange: onChange }, other)) }) }) })] })] }));
204
204
  }
205
205
  exports.default = AdRow;
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
14
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
15
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -43,24 +54,38 @@ var react_1 = require("react");
43
54
  var recoil_1 = require("recoil");
44
55
  var atoms_1 = require("./atoms");
45
56
  var Hooks_1 = __importDefault(require("../../Hooks"));
57
+ var Recoils_1 = require("../Recoils");
46
58
  function useSearchPage(type) {
47
59
  var _this = this;
48
60
  var directoryId = (0, recoil_1.useRecoilValue)(atoms_1.campaignPageIdState);
61
+ var _a = (0, recoil_1.useRecoilState)(Recoils_1.cacheSearchPageState), cache = _a[0], setCache = _a[1];
49
62
  var service = (0, Hooks_1.default)().service;
50
63
  return (0, react_1.useCallback)(function (searchString) { return __awaiter(_this, void 0, void 0, function () {
51
- var temp;
64
+ var options;
52
65
  var _a;
53
66
  return __generator(this, function (_b) {
54
67
  switch (_b.label) {
55
- case 0: return [4 /*yield*/, service.pagesPaging(searchString, 10, 0, directoryId[type])];
68
+ case 0:
69
+ if (Object.keys(cache).includes(searchString || type)) {
70
+ return [2 /*return*/, cache[searchString || type]];
71
+ }
72
+ return [4 /*yield*/, service
73
+ .pagesPaging(searchString, 10, 0, directoryId[type])
74
+ .then(function (_a) {
75
+ var items = _a.items;
76
+ return items === null || items === void 0 ? void 0 : items.map(function (page) { return ({
77
+ text: page.title,
78
+ value: page.pageId,
79
+ }); });
80
+ })];
56
81
  case 1:
57
- temp = _b.sent();
58
- return [2 /*return*/, (_a = temp.items) === null || _a === void 0 ? void 0 : _a.map(function (page) { return ({
59
- text: page.title,
60
- value: page.pageId,
61
- }); })];
82
+ options = _b.sent();
83
+ setCache(__assign(__assign({}, cache), (_a = {}, _a[searchString || type] = options, _a)));
84
+ return [2 /*return*/, options];
62
85
  }
63
86
  });
64
- }); }, [service, directoryId, type]);
87
+ }); },
88
+ // eslint-disable-next-line react-hooks/exhaustive-deps
89
+ [directoryId, type]);
65
90
  }
66
91
  exports.default = useSearchPage;
@@ -111,7 +111,8 @@ var CreateOrEdit = function () {
111
111
  if (service.attributesGetByObjectTypeCode) {
112
112
  service.attributesGetByObjectTypeCode(Enum_1.DirectoryRoot.Campaign).then(setAttributes);
113
113
  }
114
- }, [service, setDirectories, setAttributes]);
114
+ // eslint-disable-next-line react-hooks/exhaustive-deps
115
+ }, []);
115
116
  (0, react_1.useLayoutEffect)(function () {
116
117
  if (tabName && route.includes(tabName)) {
117
118
  setValue(String(route.indexOf(tabName)));
@@ -260,7 +260,6 @@ interface CampaignService extends PrmissionService {
260
260
  campaignsPut: (id: string, body: CampaignModel) => Promise<void>;
261
261
  campaignsPost: (body: CampaignModel) => Promise<void>;
262
262
  directoriesPost: (body: Directory) => Promise<void>;
263
- pagesPaging: (searchString?: string, pageSize?: number, pageIndex?: number, directoryId?: string) => Promise<any>;
264
263
  pagesGetSources: (loginId?: string, welcomeId?: string) => Promise<any>;
265
264
  deviceInfoGetAllRuleOsVersions: () => Promise<RuleOsVersion[]>;
266
265
  deviceInfoGetAllRuleDevices: () => Promise<RuleDevice[]>;
@@ -33,7 +33,7 @@ var Autocomplete_1 = __importDefault(require("@mui/material/Autocomplete"));
33
33
  var Checkbox_1 = __importDefault(require("@mui/material/Checkbox"));
34
34
  var CheckBoxOutlineBlank_1 = __importDefault(require("@mui/icons-material/CheckBoxOutlineBlank"));
35
35
  var CheckBox_1 = __importDefault(require("@mui/icons-material/CheckBox"));
36
- var throttle_1 = __importDefault(require("lodash/throttle"));
36
+ var lodash_1 = require("lodash");
37
37
  function AsyncAutocomplete(props) {
38
38
  var _a;
39
39
  var multiple = props.multiple, _b = props.value, value = _b === void 0 ? null : _b, onChange = props.onChange, fetchData = props.fetchData, getOptionValue = props.getOptionValue, getOptionLabel = props.getOptionLabel, readOnly = props.readOnly, TextFieldProps = props.TextFieldProps, renderOption = props.renderOption;
@@ -41,7 +41,7 @@ function AsyncAutocomplete(props) {
41
41
  var _d = react_2.default.useState([]), options = _d[0], setOptions = _d[1];
42
42
  var _e = react_2.default.useState(false), loading = _e[0], setLoading = _e[1];
43
43
  var fetch = react_2.default.useMemo(function () {
44
- return (0, throttle_1.default)(function (input, callback) {
44
+ return (0, lodash_1.debounce)(function (input, callback) {
45
45
  setLoading(true);
46
46
  fetchData(input)
47
47
  .then(function (response) {
@@ -4,6 +4,7 @@ interface RowProps {
4
4
  info: DataObject;
5
5
  headCells: HeadCell[];
6
6
  onRowClicked?: (rowInfo: DataObject) => void;
7
+ handleChangeStatus?: (name: string, value: number) => void;
7
8
  }
8
9
  export default function CustomRow(props: RowProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -2,17 +2,45 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var jsx_runtime_1 = require("react/jsx-runtime");
4
4
  var material_1 = require("@mui/material");
5
+ var Types_1 = require("../../ACM-AXN/PlaceGroup/Types");
6
+ var react_i18next_1 = require("react-i18next");
5
7
  function CustomRow(props) {
6
- var info = props.info, headCells = props.headCells, onRowClicked = props.onRowClicked;
8
+ var info = props.info, headCells = props.headCells, onRowClicked = props.onRowClicked, handleChangeStatus = props.handleChangeStatus;
7
9
  var groupKeys = headCells.filter(function (headCell) { return headCell.isGrouping; });
10
+ var t = (0, react_i18next_1.useTranslation)().t;
8
11
  return ((0, jsx_runtime_1.jsxs)(material_1.TableRow, { onClick: function () {
9
12
  onRowClicked && onRowClicked(info);
10
13
  }, style: { cursor: onRowClicked ? 'pointer' : 'text' }, children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: groupKeys.length + 1, align: 'right', style: { borderBottom: '1px solid #a3a3a345' }, children: info.rowIndex + 1 }), headCells.map(function (headCell, index) {
11
- return !headCell.isGrouping && ((0, jsx_runtime_1.jsx)(material_1.TableCell, { style: { borderBottom: '1px solid #a3a3a345' }, align: headCell.numberic ? 'right' : 'left', children: headCell.getDisplay
12
- ? headCell.getDisplay(info)
13
- : info[headCell.field] === 0
14
- ? info[headCell.field]
15
- : info[headCell.field] || 'N/A' }, index));
14
+ return !headCell.isGrouping && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: headCell.field === 'status' ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { style: {
15
+ borderBottom: '1px solid #a3a3a345',
16
+ }, align: headCell.numberic ? 'right' : 'left', children: (0, jsx_runtime_1.jsx)(material_1.Select, { size: "small", fullWidth: true, MenuProps: {
17
+ anchorOrigin: {
18
+ vertical: 'bottom',
19
+ horizontal: 'left',
20
+ },
21
+ transformOrigin: {
22
+ vertical: 'top',
23
+ horizontal: 'left',
24
+ },
25
+ }, name: info.placeId, value: info.status, onClick: function (e) { return e.stopPropagation(); }, inputProps: {
26
+ onChange: function (e) {
27
+ // e.preventDefault();
28
+ console.log('e', e);
29
+ handleChangeStatus &&
30
+ handleChangeStatus(e.target.name, e.target.value);
31
+ },
32
+ }, children: Object.values(Types_1.PlaceStatus)
33
+ .filter(function (item) {
34
+ return isNaN(Number(item));
35
+ })
36
+ .map(function (key, idx) { return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: idx, children: t('PlaceManagement.Status.' +
37
+ key) }, key)); }) }, info.placeId) }, index)) : ((0, jsx_runtime_1.jsx)(material_1.TableCell, { style: {
38
+ borderBottom: '1px solid #a3a3a345',
39
+ }, align: headCell.numberic ? 'right' : 'left', children: headCell.getDisplay
40
+ ? headCell.getDisplay(info)
41
+ : info[headCell.field] === 0
42
+ ? info[headCell.field]
43
+ : info[headCell.field] || 'N/A' }, index)) }));
16
44
  })] }));
17
45
  }
18
46
  exports.default = CustomRow;
@@ -35,7 +35,7 @@ var NoData_1 = __importDefault(require("../NoData"));
35
35
  var constants_1 = require("../../constants");
36
36
  var lodash_1 = require("lodash");
37
37
  function GroupTable(props) {
38
- var headCells = props.headCells, filters = props.filters, onGetData = props.onGetData, customRow = props.customRow, onRowClicked = props.onRowClicked;
38
+ var headCells = props.headCells, filters = props.filters, onGetData = props.onGetData, customRow = props.customRow, onRowClicked = props.onRowClicked, handleChangeStatus = props.handleChangeStatus;
39
39
  var row = customRow || CustomRow_1.default;
40
40
  var _a = (0, react_1.useState)([]), data = _a[0], setData = _a[1];
41
41
  var _b = (0, react_1.useState)(0), groupPageIndex = _b[0], setGroupPageIndex = _b[1];
@@ -72,9 +72,9 @@ function GroupTable(props) {
72
72
  field: groupKeys[filters.length],
73
73
  value: dt[groupKeys[filters.length]],
74
74
  },
75
- ], false), displayData: __assign(__assign({}, dt), { groupIndex: groupPageIndex * groupPageSize + index }), onGetData: onGetData, onRowClicked: onRowClicked }, index)); }) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: data.map(function (dt, index) {
75
+ ], false), displayData: __assign(__assign({}, dt), { groupIndex: groupPageIndex * groupPageSize + index }), onGetData: onGetData, onRowClicked: onRowClicked, handleChangeStatus: handleChangeStatus }, index)); }) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: data.map(function (dt, index) {
76
76
  var CustomRow = row;
77
- return ((0, jsx_runtime_1.jsx)(CustomRow, __assign({}, row.props, { info: __assign(__assign({}, dt), { rowIndex: groupPageIndex * groupPageSize + index }), headCells: headCells, onRowClicked: onRowClicked }), index));
77
+ return ((0, jsx_runtime_1.jsx)(CustomRow, __assign({}, row.props, { info: __assign(__assign({}, dt), { rowIndex: groupPageIndex * groupPageSize + index }), headCells: headCells, onRowClicked: onRowClicked, handleChangeStatus: handleChangeStatus }), index));
78
78
  }) })), data.length === 0 ? ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: headCells.length + 1, padding: "none", style: { borderBottom: "1px solid #a3a3a345" }, children: (0, jsx_runtime_1.jsx)(NoData_1.default, {}) }) })) : ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: headCells.length + 1, padding: "none", style: {
79
79
  borderBottom: "1px solid #a3a3a345",
80
80
  }, children: (0, jsx_runtime_1.jsx)(Pagination_1.default, { rowsPerPageOptions: constants_1.DEFAULT_ROWS_PER_PAGE, style: {
@@ -8,6 +8,7 @@ interface GroupComponentProps {
8
8
  totalCount: number;
9
9
  }>;
10
10
  onRowClicked?: (rowInfo: any) => void;
11
+ handleChangeStatus?: (name: string, value: number) => void;
11
12
  }
12
13
  export default function GroupComponent(props: GroupComponentProps): import("react/jsx-runtime").JSX.Element;
13
14
  export {};
@@ -9,7 +9,7 @@ var material_1 = require("@mui/material");
9
9
  var icons_material_1 = require("@mui/icons-material");
10
10
  var GroupTable_1 = __importDefault(require("./GroupTable"));
11
11
  function GroupComponent(props) {
12
- var headCells = props.headCells, filters = props.filters, displayData = props.displayData, onGetData = props.onGetData, onRowClicked = props.onRowClicked;
12
+ var headCells = props.headCells, filters = props.filters, displayData = props.displayData, onGetData = props.onGetData, onRowClicked = props.onRowClicked, handleChangeStatus = props.handleChangeStatus;
13
13
  var _a = (0, react_1.useState)(false), open = _a[0], setOpen = _a[1];
14
14
  var handleOpen = function () {
15
15
  setOpen(!open);
@@ -47,6 +47,6 @@ function GroupComponent(props) {
47
47
  } }, ind));
48
48
  }
49
49
  }
50
- })] }, "group-header-filters.length-".concat(filters.length)), open && ((0, jsx_runtime_1.jsx)(GroupTable_1.default, { headCells: headCells, filters: filters, onGetData: onGetData, onRowClicked: onRowClicked }))] }));
50
+ })] }, "group-header-filters.length-".concat(filters.length)), open && ((0, jsx_runtime_1.jsx)(GroupTable_1.default, { headCells: headCells, filters: filters, onGetData: onGetData, onRowClicked: onRowClicked, handleChangeStatus: handleChangeStatus }))] }));
51
51
  }
52
52
  exports.default = GroupComponent;
@@ -7,5 +7,6 @@ export interface GroupTableProps {
7
7
  totalCount: number;
8
8
  }>;
9
9
  onRowClicked?: (rowInfo: any) => void;
10
+ handleChangeStatus?: (name: string, value: number) => void;
10
11
  customRow?: any;
11
12
  }
@@ -52,7 +52,7 @@ var Drawer = function (props) {
52
52
  var navigate = (0, Router_1.useNavigate)();
53
53
  var location = (0, Router_1.useLocation)();
54
54
  var t = (0, react_i18next_1.useTranslation)(undefined, { i18n: i18n_1.default }).t;
55
- var _b = react_1.default.useState(true), open = _b[0], setOpen = _b[1];
55
+ var _b = react_1.default.useState(false), open = _b[0], setOpen = _b[1];
56
56
  var _c = react_1.default.useState(false), loading = _c[0], setLoading = _c[1];
57
57
  var timer = react_1.default.useRef();
58
58
  react_1.default.useEffect(function () {
@@ -63,6 +63,7 @@ var Drawer = function (props) {
63
63
  }, []);
64
64
  var closeDrawer = function (action) {
65
65
  if (action === void 0) { action = CloseAction.Close; }
66
+ setOpen(false);
66
67
  timer.current = window.setTimeout(function () {
67
68
  var _a;
68
69
  ((_a = location.state) === null || _a === void 0 ? void 0 : _a.type) === 'history'
@@ -828,5 +828,14 @@
828
828
  "YEARLY": "Yearly",
829
829
  "MONTHLY": "Monthly",
830
830
  "WEEKLY": "Weekly"
831
+ },
832
+ "PlaceManagement": {
833
+ "Status": {
834
+ "Label": "Status",
835
+ "Active": "Active",
836
+ "OnPause": "On Pause",
837
+ "Maintenance": "Maintenance",
838
+ "InActive": "Inactive"
839
+ }
831
840
  }
832
841
  }
@@ -832,5 +832,14 @@
832
832
  "YEARLY": "Hàng năm",
833
833
  "MONTHLY": "Hàng tháng",
834
834
  "WEEKLY": "Hàng tuần"
835
+ },
836
+ "PlaceManagement": {
837
+ "Status": {
838
+ "Label": "Trạng thái",
839
+ "Active": "Đang hoạt động",
840
+ "OnPause": "Tạm dừng hoạt động",
841
+ "Maintenance": "Bảo trì",
842
+ "InActive": "Dừng hoạt động"
843
+ }
835
844
  }
836
845
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.169-dev",
3
+ "version": "2.1.171-dev",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",