awing-library 2.1.113-beta → 2.1.115-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.
@@ -265,7 +265,7 @@ var CampaignContainer = function () {
265
265
  }
266
266
  else {
267
267
  text = (0, Utils_1.checkPriority)(row.campaignGroup.priority, Types_1.CampaignPriority.ClassB)
268
- ? (0, Helpers_1.roundDecimalNumber)(row.campaignGroup.bookingAmount)
268
+ ? (0, Helpers_1.formatNumber)(row.campaignGroup.bookingAmount)
269
269
  : 'N/A';
270
270
  }
271
271
  return (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: '150px', textAlign: 'right' }, children: text });
@@ -126,11 +126,11 @@ function SubCampaignPreview(_a) {
126
126
  name: translationText.delete,
127
127
  },
128
128
  ]), true) }), style: { padding: '8px 8px 4px' } }), (0, jsx_runtime_1.jsxs)(material_1.CardContent, { style: { padding: '0 8px' }, children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: translationText.booking, placement: "left", arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "h3", sx: { fontSize: '24px!important' }, children: [(0, Utils_1.checkPriority)(subCampaign.campaignGroup.priority, Types_1.CampaignPriority.ClassB) && subCampaign.campaignGroup.bookingAmount > 0
129
- ? (0, Helpers_1.roundDecimalNumber)(subCampaign.campaignGroup.bookingAmount)
129
+ ? (0, Helpers_1.formatNumber)(subCampaign.campaignGroup.bookingAmount)
130
130
  : '', (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", children: (0, Utils_1.checkPriority)(subCampaign.campaignGroup.priority, Types_1.CampaignPriority.ClassB) && subCampaign.campaignGroup.bonusAmount > 0
131
- ? " (+".concat((0, Helpers_1.roundDecimalNumber)(subCampaign.campaignGroup.bonusAmount), ")")
131
+ ? " (+".concat((0, Helpers_1.formatNumber)(subCampaign.campaignGroup.bonusAmount), ")")
132
132
  : '' })] }) }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: translationText.bonus, placement: "right", arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", children: subCampaign.campaignGroup.numberHasRun
133
- ? "".concat(translationText.numberHasRunText, ": ").concat((0, Helpers_1.roundDecimalNumber)(subCampaign.campaignGroup.numberHasRun))
133
+ ? "".concat(translationText.numberHasRunText, ": ").concat((0, Helpers_1.formatNumber)(subCampaign.campaignGroup.numberHasRun))
134
134
  : '' }) })] }), (0, jsx_runtime_1.jsx)(material_1.CardActions, { style: { padding: '0 8px' }, children: subCampaign.campaignGroup.isReserved && ((0, jsx_runtime_1.jsx)(material_1.Chip, { label: translationText.reserved, style: {
135
135
  height: 18,
136
136
  backgroundColor: '#c49f47',
@@ -1,7 +1,7 @@
1
1
  import { CampaignPriority, CampaignAttribute, CampaignGroupModel, CampaignModel, Campaign, CampaignPartner, CampaignAd, Timestamp, PlaceFilter, CampaignAdWeight, CampaignAdAdvanced, CampaignAdvancedRule, CampaignGroup } from './Types';
2
2
  export declare const getIndexPriority: (priorityCompare: CampaignPriority) => number;
3
3
  export declare const checkPriority: (keyPriority: number | "ClassA" | "ClassB" | "ClassC" | undefined, priorityCompare: `${CampaignPriority}`) => boolean;
4
- export declare const getTotalBooking: (campaignGroupModels: CampaignGroupModel[]) => string | null;
4
+ export declare const getTotalBooking: (campaignGroupModels: CampaignGroupModel[]) => string;
5
5
  export declare const formatListCampaign: (listCampaign?: CampaignModel[], ids?: string[]) => any[];
6
6
  export declare const checkCampaignIsRunning: (campaignGroupModel: CampaignGroupModel) => boolean;
7
7
  export declare const getCampaignPriority: (priority?: number | `${CampaignPriority}`) => any;
@@ -41,7 +41,7 @@ var getTotalBooking = function (campaignGroupModels) {
41
41
  for (var i = 0; i < campaignGroupModels.length; i++) {
42
42
  result += ((_b = (_a = campaignGroupModels[i]) === null || _a === void 0 ? void 0 : _a.campaignGroup) === null || _b === void 0 ? void 0 : _b.bookingAmount) || 0;
43
43
  }
44
- return (0, Helpers_1.roundDecimalNumber)(result);
44
+ return (0, Helpers_1.formatNumber)(result);
45
45
  }
46
46
  else
47
47
  return 'N/A';
@@ -98,7 +98,7 @@ function Container() {
98
98
  field: 'totalRun',
99
99
  headerName: "".concat(t('CampaignPlan.HasRun'), " (").concat(t('CampaignPlan.NumberOfConnections'), ")"),
100
100
  valueGetter: function (row) {
101
- return (0, Helpers_1.roundDecimalNumber)(row.totalRun);
101
+ return (0, Helpers_1.formatNumber)(row.totalRun);
102
102
  },
103
103
  width: 200,
104
104
  TableCellProps: {
@@ -110,7 +110,7 @@ function Container() {
110
110
  headerName: "".concat(t('CampaignPlan.WillRun'), " (").concat(t('CampaignPlan.NumberOfConnections'), ")"),
111
111
  valueGetter: function (row) {
112
112
  return row.isContainClassB
113
- ? (0, Helpers_1.roundDecimalNumber)(row.totalExpected)
113
+ ? (0, Helpers_1.formatNumber)(row.totalExpected)
114
114
  : 'N/A';
115
115
  },
116
116
  width: 200,
@@ -123,7 +123,7 @@ function Container() {
123
123
  headerName: "".concat(t('CampaignPlan.AmountBooking'), " (+").concat(t('CampaignPlan.BonusText'), ")"),
124
124
  valueGetter: function (row) {
125
125
  return row.isContainClassB
126
- ? (0, Helpers_1.roundDecimalNumber)(Number(row.total))
126
+ ? (0, Helpers_1.formatNumber)(Number(row.total))
127
127
  : 'N/A';
128
128
  },
129
129
  width: 180,
@@ -80,7 +80,7 @@ function CampaignPlanDetail() {
80
80
  field: 'totalRun',
81
81
  headerName: t('CampaignPlan.HasRun'),
82
82
  valueGetter: function (row) {
83
- return (0, Helpers_1.roundDecimalNumber)(row.totalRun);
83
+ return (0, Helpers_1.formatNumber)(row.totalRun);
84
84
  },
85
85
  TableCellProps: {
86
86
  align: 'right',
@@ -92,7 +92,7 @@ function CampaignPlanDetail() {
92
92
  valueGetter: function (row) {
93
93
  return row.priority ===
94
94
  Utils_1.CAMPAIGN_PRIORITY.CLASS_B
95
- ? (0, Helpers_1.roundDecimalNumber)(row.totalExpected)
95
+ ? (0, Helpers_1.formatNumber)(row.totalExpected)
96
96
  : 'N/A';
97
97
  },
98
98
  TableCellProps: {
@@ -105,7 +105,7 @@ function CampaignPlanDetail() {
105
105
  valueGetter: function (row) {
106
106
  return row.priority ===
107
107
  Utils_1.CAMPAIGN_PRIORITY.CLASS_B
108
- ? (0, Helpers_1.roundDecimalNumber)(Number(row.total))
108
+ ? (0, Helpers_1.formatNumber)(Number(row.total))
109
109
  : 'N/A';
110
110
  },
111
111
  TableCellProps: {
@@ -9,7 +9,7 @@ var ArrowDropUp_1 = __importDefault(require("@mui/icons-material/ArrowDropUp"));
9
9
  var material_1 = require("@mui/material");
10
10
  var styles_1 = require("@mui/styles");
11
11
  var Enum_1 = require("../../Enum");
12
- var helper_1 = require("../../helper");
12
+ var Helpers_1 = require("../../../../Utils/Helpers");
13
13
  var react_1 = __importDefault(require("react"));
14
14
  var react_i18next_1 = require("react-i18next");
15
15
  var useStyles = (0, styles_1.makeStyles)(function () { return ({
@@ -85,19 +85,17 @@ var RowAdvanceComponent = function (_a) {
85
85
  var fieldNameShowOn = groupNames[priorityGroupLevel - 1];
86
86
  var colSpanFirstCell = priorityGroupLevel;
87
87
  var startDate = (row === null || row === void 0 ? void 0 : row.fromDate)
88
- ? (0, helper_1.timestampToStringDDMMYYYY)(row === null || row === void 0 ? void 0 : row.fromDate)
89
- : (0, helper_1.timestampToStringDDMMYYYY)(row === null || row === void 0 ? void 0 : row.date);
88
+ ? (0, Helpers_1.timestampToStringDDMMYYYY)(row === null || row === void 0 ? void 0 : row.fromDate)
89
+ : (0, Helpers_1.timestampToStringDDMMYYYY)(row === null || row === void 0 ? void 0 : row.date);
90
90
  var endDate = (row === null || row === void 0 ? void 0 : row.toDate)
91
- ? (0, helper_1.timestampToStringDDMMYYYY)(row === null || row === void 0 ? void 0 : row.toDate)
92
- : (0, helper_1.timestampToStringDDMMYYYY)(row === null || row === void 0 ? void 0 : row.date);
91
+ ? (0, Helpers_1.timestampToStringDDMMYYYY)(row === null || row === void 0 ? void 0 : row.toDate)
92
+ : (0, Helpers_1.timestampToStringDDMMYYYY)(row === null || row === void 0 ? void 0 : row.date);
93
93
  var fromDateToDate = startDate === endDate ? startDate : startDate + ' - ' + endDate;
94
- var totalRate = !(row === null || row === void 0 ? void 0 : row.rate)
95
- ? ''
96
- : Number((0, helper_1.roundDecimalNumber)(row === null || row === void 0 ? void 0 : row.rate)).toFixed(2);
94
+ var totalRate = !(row === null || row === void 0 ? void 0 : row.rate) ? '' : (0, Helpers_1.formatNumber)(Number(row === null || row === void 0 ? void 0 : row.rate));
97
95
  var totalView = (row === null || row === void 0 ? void 0 : row.quantity) !== undefined
98
- ? (0, helper_1.roundDecimalNumber)(row === null || row === void 0 ? void 0 : row.quantity)
99
- : (0, helper_1.roundDecimalNumber)(row === null || row === void 0 ? void 0 : row.totalQuantity);
100
- var ctr = (((row === null || row === void 0 ? void 0 : row.click) / (row === null || row === void 0 ? void 0 : row.view)) * 100).toFixed(2);
96
+ ? (0, Helpers_1.formatNumber)(row === null || row === void 0 ? void 0 : row.quantity)
97
+ : (0, Helpers_1.formatNumber)(row === null || row === void 0 ? void 0 : row.totalQuantity);
98
+ var ctr = (0, Helpers_1.formatNumber)(((row === null || row === void 0 ? void 0 : row.click) / (row === null || row === void 0 ? void 0 : row.view)) * 100);
101
99
  function styledRow(priority) {
102
100
  if ((groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) === 1 && priorityGroupLevel === 1) {
103
101
  return classes.styledSecondaryRow;
@@ -10,7 +10,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DataSetConfigs = void 0;
13
- var helper_1 = require("./helper");
13
+ var Helpers_1 = require("../../Utils/Helpers");
14
14
  var DataSetConfigs = function (exportData, campaigns, places, t) {
15
15
  var results = [
16
16
  {
@@ -40,7 +40,7 @@ var DataSetConfigs = function (exportData, campaigns, places, t) {
40
40
  { value: campaignName, style: { font: { sz: '13' } } },
41
41
  { value: placeName, style: { font: { sz: '13' } } },
42
42
  {
43
- value: (0, helper_1.timestampToStringDDMMYYYY)(data.date),
43
+ value: (0, Helpers_1.timestampToStringDDMMYYYY)(data.date),
44
44
  style: { font: { sz: '13' } },
45
45
  },
46
46
  { value: data.rate, style: { font: { sz: '13' } } },
@@ -1,7 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- export declare function roundDecimalNumber(number: any): string | null;
3
2
  export declare function dateToStringDDMMYYYY(date: any): string | null;
4
- export declare function timestampToStringDDMMYYYY(date: any): string | null;
5
3
  export type DataObject = {
6
4
  [key: string]: any;
7
5
  };
@@ -1,21 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.timestampToStringDDMMYYYY = exports.dateToStringDDMMYYYY = exports.roundDecimalNumber = void 0;
4
- function roundDecimalNumber(number) {
5
- if (typeof number !== "number")
6
- return null;
7
- var str = JSON.stringify(Math.round(number * 1000000) / 1000000);
8
- var signIndex = str.indexOf(".");
9
- if (signIndex === -1) {
10
- return str.replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
11
- }
12
- else {
13
- return (str.slice(0, signIndex).replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,") +
14
- str.slice(signIndex));
15
- }
16
- }
17
- exports.roundDecimalNumber = roundDecimalNumber;
18
- // format: 'DD/MM/YYYY' => 07/02/2020
3
+ exports.dateToStringDDMMYYYY = void 0;
19
4
  function dateToStringDDMMYYYY(date) {
20
5
  if (!date)
21
6
  return null;
@@ -26,11 +11,3 @@ function dateToStringDDMMYYYY(date) {
26
11
  return _date.toLocaleDateString("".concat(_language), options);
27
12
  }
28
13
  exports.dateToStringDDMMYYYY = dateToStringDDMMYYYY;
29
- // format: 'DD/MM/YYYY' => 07/02/2020
30
- function timestampToStringDDMMYYYY(date) {
31
- if (!date)
32
- return null;
33
- // const _date = new Date(date.seconds * 1000);
34
- return dateToStringDDMMYYYY(new Date(date.seconds * 1000));
35
- }
36
- exports.timestampToStringDDMMYYYY = timestampToStringDDMMYYYY;
@@ -38,7 +38,7 @@ var UserComponent = function (_a) {
38
38
  };
39
39
  var handleChangeParams = (0, react_1.useCallback)(function (params) {
40
40
  setGridUser(rows.filter(function (row) {
41
- return row.username.includes(params.searchString);
41
+ return [row.name, row.username].join(" ").includes(params.searchString.trim());
42
42
  }));
43
43
  setQueryParams({
44
44
  pageIndex: params.pageIndex,
@@ -146,6 +146,7 @@ function Container() {
146
146
  align: 'right',
147
147
  };
148
148
  },
149
+ type: 'number',
149
150
  },
150
151
  {
151
152
  field: 'totalRun',
@@ -159,6 +160,7 @@ function Container() {
159
160
  align: 'right',
160
161
  };
161
162
  },
163
+ type: 'number',
162
164
  },
163
165
  {
164
166
  field: 'rate',
@@ -173,7 +175,7 @@ function Container() {
173
175
  align: 'right',
174
176
  };
175
177
  },
176
- valueGetter: function (row) { return row.rate.toFixed(2); },
178
+ type: 'number',
177
179
  },
178
180
  ], rows: (0, Helpers_1.offlinePaginate)(schedules, queryInput.pageIndex, queryInput.pageSize), sortModel: sortModels, onSortModelChange: setSortModels, getRowId: function (row) {
179
181
  return [(0, Helpers_1.generateUUID)(), row.campaignId, row.groupId].join('.');
@@ -31,6 +31,7 @@ var Recoils_1 = require("../Recoils");
31
31
  var ClassicDrawer_1 = __importDefault(require("../../../Commons/Components/ClassicDrawer"));
32
32
  var Router_1 = require("../../../AWING/Router");
33
33
  var AWING_1 = require("../../../AWING");
34
+ var Helpers_1 = require("../../../Utils/Helpers");
34
35
  function CompletionRate() {
35
36
  var t = (0, react_i18next_1.useTranslation)().t;
36
37
  var navigate = (0, Router_1.useNavigate)();
@@ -69,7 +70,7 @@ function CompletionRate() {
69
70
  }, children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: 2, sx: {
70
71
  textAlign: 'center',
71
72
  fontWeight: 'bold',
72
- }, children: t('ScheduleCompletionRate.Total') }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (completionRateInfo === null || completionRateInfo === void 0 ? void 0 : completionRateInfo.totalQuantity) || 0 }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (completionRateInfo === null || completionRateInfo === void 0 ? void 0 : completionRateInfo.totalRun) || 0 }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (completionRateInfo === null || completionRateInfo === void 0 ? void 0 : completionRateInfo.rate) || 0 })] }), spanningRowsPosition: "top", columns: [
73
+ }, children: t('ScheduleCompletionRate.Total') }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (0, Helpers_1.formatNumber)((completionRateInfo === null || completionRateInfo === void 0 ? void 0 : completionRateInfo.totalQuantity) || 0) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (0, Helpers_1.formatNumber)((completionRateInfo === null || completionRateInfo === void 0 ? void 0 : completionRateInfo.totalRun) || 0) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (0, Helpers_1.formatNumber)((completionRateInfo === null || completionRateInfo === void 0 ? void 0 : completionRateInfo.rate) || 0) })] }), spanningRowsPosition: "top", columns: [
73
74
  {
74
75
  field: '#',
75
76
  headerName: '#',
@@ -96,6 +97,9 @@ function CompletionRate() {
96
97
  align: 'right',
97
98
  };
98
99
  },
100
+ valueGetter: function (row) {
101
+ return (0, Helpers_1.formatNumber)((row === null || row === void 0 ? void 0 : row.totalQuantity) || 0);
102
+ }
99
103
  },
100
104
  {
101
105
  field: 'totalRun',
@@ -108,16 +112,19 @@ function CompletionRate() {
108
112
  align: 'right',
109
113
  };
110
114
  },
115
+ valueGetter: function (row) {
116
+ return (0, Helpers_1.formatNumber)((row === null || row === void 0 ? void 0 : row.totalRun) || 0);
117
+ }
111
118
  },
112
119
  {
113
120
  field: 'rate',
114
121
  headerName: "".concat(t('ScheduleCompletionRate.CompletionRate'), "(%)"),
115
122
  valueGetter: function (row) {
116
- return (row === null || row === void 0 ? void 0 : row.totalQuantity) !== 0
123
+ return (0, Helpers_1.formatNumber)((row === null || row === void 0 ? void 0 : row.totalQuantity) !== 0
117
124
  ? (((row === null || row === void 0 ? void 0 : row.totalRun) || 0) /
118
125
  ((row === null || row === void 0 ? void 0 : row.totalQuantity) || 0)) *
119
126
  100
120
- : 0;
127
+ : 0);
121
128
  },
122
129
  TableCellProps: {
123
130
  align: 'right',
@@ -31,6 +31,7 @@ var Router_1 = require("../../../AWING/Router");
31
31
  var Recoils_1 = require("../Recoils");
32
32
  var ClassicDrawer_1 = __importDefault(require("../../../Commons/Components/ClassicDrawer"));
33
33
  var AWING_1 = require("../../../AWING");
34
+ var Helpers_1 = require("../../../Utils/Helpers");
34
35
  function CompletionRateDate() {
35
36
  var t = (0, react_i18next_1.useTranslation)().t;
36
37
  var _a = (0, Router_1.useParams)(), campaignId = _a.campaignId, groupId = _a.groupId, date = _a.date;
@@ -55,9 +56,9 @@ function CompletionRateDate() {
55
56
  }, children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: 2, sx: {
56
57
  textAlign: 'center',
57
58
  fontWeight: 'bold',
58
- }, children: t('ScheduleCompletionRate.Total') }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (completionRateDateInfo === null || completionRateDateInfo === void 0 ? void 0 : completionRateDateInfo.totalQuantity) || 0 }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (completionRateDateInfo === null || completionRateDateInfo === void 0 ? void 0 : completionRateDateInfo.totalRun) || 0 }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: ((completionRateDateInfo === null || completionRateDateInfo === void 0 ? void 0 : completionRateDateInfo.totalRun) /
59
+ }, children: t('ScheduleCompletionRate.Total') }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (0, Helpers_1.formatNumber)((completionRateDateInfo === null || completionRateDateInfo === void 0 ? void 0 : completionRateDateInfo.totalQuantity) || 0) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (0, Helpers_1.formatNumber)((completionRateDateInfo === null || completionRateDateInfo === void 0 ? void 0 : completionRateDateInfo.totalRun) || 0) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", sx: { fontWeight: 'bold' }, children: (0, Helpers_1.formatNumber)(((completionRateDateInfo === null || completionRateDateInfo === void 0 ? void 0 : completionRateDateInfo.totalRun) /
59
60
  (completionRateDateInfo === null || completionRateDateInfo === void 0 ? void 0 : completionRateDateInfo.totalQuantity)) *
60
- 100 || 0 })] }), spanningRowsPosition: "top", columns: [
61
+ 100 || 0) })] }), spanningRowsPosition: "top", columns: [
61
62
  {
62
63
  field: '#',
63
64
  headerName: '#',
@@ -89,6 +90,7 @@ function CompletionRateDate() {
89
90
  align: 'right',
90
91
  };
91
92
  },
93
+ type: 'number',
92
94
  },
93
95
  {
94
96
  field: 'totalRun',
@@ -101,14 +103,16 @@ function CompletionRateDate() {
101
103
  align: 'right',
102
104
  };
103
105
  },
106
+ type: 'number',
104
107
  },
105
108
  {
106
109
  field: 'rate',
107
110
  headerName: "".concat(t('ScheduleCompletionRate.CompletionRate'), "(%)"),
108
111
  valueGetter: function (row) {
109
- return row.totalQuantity !== 0
110
- ? (row.totalRun / row.totalQuantity) * 100
111
- : 0;
112
+ return (0, Helpers_1.formatNumber)(row.totalQuantity !== 0
113
+ ? (row.totalRun / row.totalQuantity) *
114
+ 100
115
+ : 0);
112
116
  },
113
117
  TableCellProps: {
114
118
  align: 'right',
@@ -23,7 +23,7 @@ var AgeRangeTabs = function (_a) {
23
23
  return label;
24
24
  },
25
25
  label: function (tooltipItem) {
26
- return ((0, Helpers_1.roundDecimalNumber)(Number(tooltipItem.formattedValue)) + '%');
26
+ return ((0, Helpers_1.formatNumber)(Number(tooltipItem.formattedValue)) + '%');
27
27
  },
28
28
  },
29
29
  },
@@ -84,12 +84,12 @@ var AgeRangeTabs = function (_a) {
84
84
  borderBottom: '1px solid #a3a3a345',
85
85
  }, children: ageItem }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
86
86
  borderBottom: '1px solid #a3a3a345',
87
- }, children: (0, Helpers_1.roundDecimalNumber)(ages[ageItem]) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
87
+ }, children: (0, Helpers_1.formatNumber)(ages[ageItem] || 0) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
88
88
  borderBottom: '1px solid #a3a3a345',
89
89
  }, children: ages[ageItem] > 0
90
- ? ((ages[ageItem] *
90
+ ? (0, Helpers_1.formatNumber)((ages[ageItem] *
91
91
  100) /
92
- total).toFixed(2)
92
+ total)
93
93
  : 0 })] }, index));
94
94
  })), total && total > 0 && ((0, jsx_runtime_1.jsxs)(material_1.TableRow, { hover: true, children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
95
95
  borderBottom: '1px solid #a3a3a345',
@@ -97,7 +97,7 @@ var AgeRangeTabs = function (_a) {
97
97
  }, children: t('Common.Total') }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
98
98
  borderBottom: '1px solid #a3a3a345',
99
99
  fontWeight: 'bold',
100
- }, children: (0, Helpers_1.roundDecimalNumber)(total) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
100
+ }, children: (0, Helpers_1.formatNumber)(total) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
101
101
  borderBottom: '1px solid #a3a3a345',
102
102
  fontWeight: 'bold',
103
103
  }, children: "100" })] }))] })] }) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 6, children: (0, jsx_runtime_1.jsx)(BarLineComponent_1.default, { type: 'bar', dataChart: convertToChartData(ages), data: [], optionCustom: options, chart: chart }) })] }) }));
@@ -88,7 +88,7 @@ var TableAndPieChart = function (_a) {
88
88
  return (' ' +
89
89
  (tooltipItem === null || tooltipItem === void 0 ? void 0 : tooltipItem.label) +
90
90
  ': ' +
91
- (tooltipItem === null || tooltipItem === void 0 ? void 0 : tooltipItem.parsed).toFixed(2) +
91
+ (0, Helpers_1.formatNumber)(tooltipItem === null || tooltipItem === void 0 ? void 0 : tooltipItem.parsed) +
92
92
  '(%)');
93
93
  },
94
94
  title: function (tooltipItems) {
@@ -117,12 +117,12 @@ var TableAndPieChart = function (_a) {
117
117
  borderBottom: '1px solid #a3a3a345',
118
118
  }, children: graphicCustomerItem }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
119
119
  borderBottom: '1px solid #a3a3a345',
120
- }, children: (0, Helpers_1.roundDecimalNumber)(graphicCustomers[graphicCustomerItem]) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
120
+ }, children: (0, Helpers_1.formatNumber)(graphicCustomers[graphicCustomerItem]) || 0 }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
121
121
  borderBottom: '1px solid #a3a3a345',
122
122
  }, children: graphicCustomers[graphicCustomerItem] > 0
123
- ? ((graphicCustomers[graphicCustomerItem] *
123
+ ? (0, Helpers_1.formatNumber)((graphicCustomers[graphicCustomerItem] *
124
124
  100) /
125
- total).toFixed(2)
125
+ total)
126
126
  : 0 })] }));
127
127
  })), total && total > 0 && ((0, jsx_runtime_1.jsxs)(material_1.TableRow, { hover: true, children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
128
128
  borderBottom: '1px solid #a3a3a345',
@@ -130,7 +130,7 @@ var TableAndPieChart = function (_a) {
130
130
  }, children: translationText.total }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
131
131
  borderBottom: '1px solid #a3a3a345',
132
132
  fontWeight: 'bold',
133
- }, children: (0, Helpers_1.roundDecimalNumber)(total) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
133
+ }, children: (0, Helpers_1.formatNumber)(total) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "center", style: {
134
134
  borderBottom: '1px solid #a3a3a345',
135
135
  fontWeight: 'bold',
136
136
  }, children: "100" })] }))] })] }) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 6, children: (0, jsx_runtime_1.jsx)("div", { style: { maxHeight: '400px' }, children: (0, jsx_runtime_1.jsx)(PieComponent_1.default, { type: 'pie', data: dataChart, chart: chart, optionCustom: optionCustom }) }) })] }) }));
@@ -33,7 +33,7 @@ var CircularProgress_1 = __importDefault(require("../CircularProgress"));
33
33
  var CustomRow_1 = __importDefault(require("./CustomRow"));
34
34
  var NoData_1 = __importDefault(require("../NoData"));
35
35
  var constants_1 = require("../../constants");
36
- var isEqual = require("lodash/isEqual");
36
+ var lodash_1 = require("lodash");
37
37
  function GroupTable(props) {
38
38
  var headCells = props.headCells, filters = props.filters, onGetData = props.onGetData, customRow = props.customRow, onRowClicked = props.onRowClicked;
39
39
  var row = customRow || CustomRow_1.default;
@@ -51,13 +51,13 @@ function GroupTable(props) {
51
51
  (0, react_1.useEffect)(function () {
52
52
  handleGetGroupData();
53
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
54
- }, [groupPageSize, groupPageIndex]);
54
+ }, [JSON.stringify(headCells), groupPageSize, groupPageIndex]);
55
55
  var handleGetGroupData = function () {
56
56
  setLoading(true);
57
57
  onGetData(filters, groupPageIndex, groupPageSize).then(function (result) {
58
58
  setLoading(false);
59
- !isEqual(data, result.data) && setData(result.data);
60
- !isEqual(totalCount, result.totalCount) &&
59
+ !(0, lodash_1.isEqual)(data, result.data) && setData(result.data);
60
+ !(0, lodash_1.isEqual)(totalCount, result.totalCount) &&
61
61
  setTotalCount(result.totalCount);
62
62
  });
63
63
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.113-beta",
3
+ "version": "2.1.115-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",