awing-library 2.1.171-dev → 2.1.172-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.
- package/lib/AWING/GroupTable/CustomRow.d.ts +0 -1
- package/lib/AWING/GroupTable/CustomRow.js +6 -34
- package/lib/AWING/GroupTable/GroupTable.js +3 -3
- package/lib/AWING/GroupTable/component.d.ts +0 -1
- package/lib/AWING/GroupTable/component.js +2 -2
- package/lib/AWING/GroupTable/interface.d.ts +0 -1
- package/lib/translate/en/translation.json +0 -9
- package/lib/translate/vi/translation.json +0 -9
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ interface RowProps {
|
|
|
4
4
|
info: DataObject;
|
|
5
5
|
headCells: HeadCell[];
|
|
6
6
|
onRowClicked?: (rowInfo: DataObject) => void;
|
|
7
|
-
handleChangeStatus?: (name: string, value: number) => void;
|
|
8
7
|
}
|
|
9
8
|
export default function CustomRow(props: RowProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
@@ -2,45 +2,17 @@
|
|
|
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");
|
|
7
5
|
function CustomRow(props) {
|
|
8
|
-
var info = props.info, headCells = props.headCells, onRowClicked = props.onRowClicked
|
|
6
|
+
var info = props.info, headCells = props.headCells, onRowClicked = props.onRowClicked;
|
|
9
7
|
var groupKeys = headCells.filter(function (headCell) { return headCell.isGrouping; });
|
|
10
|
-
var t = (0, react_i18next_1.useTranslation)().t;
|
|
11
8
|
return ((0, jsx_runtime_1.jsxs)(material_1.TableRow, { onClick: function () {
|
|
12
9
|
onRowClicked && onRowClicked(info);
|
|
13
10
|
}, 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) {
|
|
14
|
-
return !headCell.isGrouping && ((0, jsx_runtime_1.jsx)(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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)) }));
|
|
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));
|
|
44
16
|
})] }));
|
|
45
17
|
}
|
|
46
18
|
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;
|
|
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
|
|
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) {
|
|
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
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)(CustomRow, __assign({}, row.props, { info: __assign(__assign({}, dt), { rowIndex: groupPageIndex * groupPageSize + index }), headCells: headCells, onRowClicked: onRowClicked }), 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,7 +8,6 @@ interface GroupComponentProps {
|
|
|
8
8
|
totalCount: number;
|
|
9
9
|
}>;
|
|
10
10
|
onRowClicked?: (rowInfo: any) => void;
|
|
11
|
-
handleChangeStatus?: (name: string, value: number) => void;
|
|
12
11
|
}
|
|
13
12
|
export default function GroupComponent(props: GroupComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
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;
|
|
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 }))] }));
|
|
51
51
|
}
|
|
52
52
|
exports.default = GroupComponent;
|
|
@@ -828,14 +828,5 @@
|
|
|
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
|
-
}
|
|
840
831
|
}
|
|
841
832
|
}
|
|
@@ -832,14 +832,5 @@
|
|
|
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
|
-
}
|
|
844
835
|
}
|
|
845
836
|
}
|