es-grid-template 1.8.97 → 1.8.99
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/es/grid-component/hooks/utils.d.ts +1 -0
- package/es/grid-component/hooks/utils.js +6 -0
- package/es/grid-component/type.d.ts +1 -0
- package/es/group-component/hook/utils.d.ts +8 -8
- package/es/table-component/TableContainerEdit.js +92 -27
- package/es/table-component/body/EditableCell.js +2 -0
- package/es/table-component/body/TableBodyRow.js +2 -1
- package/lib/grid-component/hooks/utils.d.ts +1 -0
- package/lib/grid-component/hooks/utils.js +11 -4
- package/lib/grid-component/type.d.ts +1 -0
- package/lib/table-component/TableContainerEdit.js +92 -27
- package/lib/table-component/body/EditableCell.js +2 -0
- package/lib/table-component/body/TableBodyRow.js +2 -1
- package/package.json +1 -1
|
@@ -48,6 +48,7 @@ export declare const checkFieldKey: (key: string | undefined) => string;
|
|
|
48
48
|
export declare const convertLabelToTitle: (data: any[]) => any[];
|
|
49
49
|
export declare const convertArrayWithIndent: (inputArray: any[], parentIndent?: number) => any[];
|
|
50
50
|
export declare const getTemplate: (template: any, column?: ColumnTable) => React.ReactNode | React.ReactElement;
|
|
51
|
+
export declare const getToolbarTemplate: (template: any) => React.ReactNode | React.ReactElement;
|
|
51
52
|
export declare const isObjEmpty: (obj: any) => boolean;
|
|
52
53
|
export declare const getColumnsVisible: <T>(columns: ColumnsTable<T>, index: number) => ColumnTable<T>[];
|
|
53
54
|
export declare const updateData: <Record = AnyObject>(initData: Record[], rows: Record[], key: keyof Record) => Record[];
|
|
@@ -391,6 +391,12 @@ export const getTemplate = (template, column) => {
|
|
|
391
391
|
}
|
|
392
392
|
return template;
|
|
393
393
|
};
|
|
394
|
+
export const getToolbarTemplate = template => {
|
|
395
|
+
if (template && typeof template === 'function') {
|
|
396
|
+
return template();
|
|
397
|
+
}
|
|
398
|
+
return template;
|
|
399
|
+
};
|
|
394
400
|
|
|
395
401
|
// export const totalFixedWidth = <T, >(columns: ColumnsTable<T>, type: 'left' | 'right', selectionSettings?: SelectionSettings) => {
|
|
396
402
|
// const totalFixedLeftWidth: number = columns
|
|
@@ -466,6 +466,7 @@ export type ToolbarItem = {
|
|
|
466
466
|
template?: React.ReactNode | React.ReactElement | (() => React.ReactNode | React.ReactElement);
|
|
467
467
|
title?: React.ReactNode;
|
|
468
468
|
disabled?: boolean;
|
|
469
|
+
hasMenu?: boolean;
|
|
469
470
|
[key: string]: any;
|
|
470
471
|
};
|
|
471
472
|
export type LoadOptionsArgs = {
|
|
@@ -162,7 +162,7 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
|
|
|
162
162
|
type?: IColumnType;
|
|
163
163
|
haveSum?: boolean;
|
|
164
164
|
isSummary?: boolean;
|
|
165
|
-
summaryTemplate?: (data: number, key: string) => import("react").
|
|
165
|
+
summaryTemplate?: (data: number, key: string) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
166
166
|
format?: IFormat | ((rowData: any) => IFormat);
|
|
167
167
|
allowFiltering?: boolean;
|
|
168
168
|
sorter?: boolean;
|
|
@@ -177,18 +177,18 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
|
|
|
177
177
|
headerText?: string;
|
|
178
178
|
hidden?: boolean;
|
|
179
179
|
visible?: boolean;
|
|
180
|
-
headerTooltip?: string | boolean | (() => import("react").
|
|
180
|
+
headerTooltip?: string | boolean | (() => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
|
|
181
181
|
columnGroupText?: string;
|
|
182
182
|
align?: import("./../../grid-component/type").ITextAlign;
|
|
183
183
|
textAlign?: import("./../../grid-component/type").ITextAlign;
|
|
184
184
|
headerTextAlign?: import("./../../grid-component/type").ITextAlign;
|
|
185
|
-
template?: import("react").
|
|
185
|
+
template?: import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((args: import("./../../grid-component/type").ColumnTemplate<RecordType>) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
|
|
186
186
|
showTooltip?: boolean;
|
|
187
187
|
tooltipDescription?: string | ((args: {
|
|
188
188
|
value: any;
|
|
189
189
|
rowData: RecordType;
|
|
190
|
-
}) => import("react").
|
|
191
|
-
headerTemplate?: import("react").
|
|
190
|
+
}) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
|
|
191
|
+
headerTemplate?: import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((column: ColumnTable<RecordType>) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
|
|
192
192
|
commandItems?: import("./../../grid-component/type").CommandItem[];
|
|
193
193
|
children?: ColumnTable<RecordType>[];
|
|
194
194
|
editType?: EditType | ((rowData?: RecordType) => EditType);
|
|
@@ -208,9 +208,9 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
|
|
|
208
208
|
ellipsis?: boolean;
|
|
209
209
|
allowResizing?: boolean;
|
|
210
210
|
allowSelection?: boolean | ((rowData: RecordType) => boolean);
|
|
211
|
-
onCellStyles?: Omit<CSSProperties, "
|
|
212
|
-
onCellHeaderStyles?: Omit<CSSProperties, "
|
|
213
|
-
onCellFooterStyles?: Omit<CSSProperties, "
|
|
211
|
+
onCellStyles?: Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width">);
|
|
212
|
+
onCellHeaderStyles?: Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width">);
|
|
213
|
+
onCellFooterStyles?: Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "minWidth" | "position" | "width">);
|
|
214
214
|
sumGroup?: boolean;
|
|
215
215
|
getValue?: (row: any, rowIndex: number) => any;
|
|
216
216
|
getCellProps?: (value: any, row: any, rowIndex: number) => import("./../../grid-component/type").CellProps;
|
|
@@ -19,6 +19,7 @@ import TableWrapper from "./table/TableWrapper";
|
|
|
19
19
|
import withReactContent from "sweetalert2-react-content";
|
|
20
20
|
import Swal from "sweetalert2";
|
|
21
21
|
import { useLocale } from "rc-master-ui/es/locale";
|
|
22
|
+
import { getToolbarTemplate } from "../grid-component/hooks";
|
|
22
23
|
const MySwal = withReactContent(Swal);
|
|
23
24
|
const {
|
|
24
25
|
Paragraph,
|
|
@@ -1225,7 +1226,15 @@ const TableContainerEdit = props => {
|
|
|
1225
1226
|
template: () => {
|
|
1226
1227
|
return /*#__PURE__*/React.createElement(Fragment, null, item.key === 'ADD' && /*#__PURE__*/React.createElement("div", {
|
|
1227
1228
|
className: classNames(`be-toolbar-item`, item?.className)
|
|
1228
|
-
}, /*#__PURE__*/React.createElement(
|
|
1229
|
+
}, item?.hasMenu === false ? /*#__PURE__*/React.createElement(Button, {
|
|
1230
|
+
style: {
|
|
1231
|
+
color: '#28c76f',
|
|
1232
|
+
borderColor: '#28c76f'
|
|
1233
|
+
},
|
|
1234
|
+
variant: 'outlined',
|
|
1235
|
+
onClick: () => handleAddMulti(item, 1),
|
|
1236
|
+
className: "d-flex toolbar-button"
|
|
1237
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')) : /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
1229
1238
|
overlayClassName: 'be-popup-container',
|
|
1230
1239
|
trigger: ['click'],
|
|
1231
1240
|
style: {
|
|
@@ -1242,7 +1251,7 @@ const TableContainerEdit = props => {
|
|
|
1242
1251
|
color: '#28c76f'
|
|
1243
1252
|
},
|
|
1244
1253
|
onClick: () => handleAddMulti(item, 1)
|
|
1245
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1254
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')))));
|
|
1246
1255
|
}
|
|
1247
1256
|
};
|
|
1248
1257
|
}
|
|
@@ -1261,7 +1270,7 @@ const TableContainerEdit = props => {
|
|
|
1261
1270
|
variant: 'outlined',
|
|
1262
1271
|
onClick: () => handleDeleteAll(item),
|
|
1263
1272
|
className: "d-flex toolbar-button"
|
|
1264
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1273
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item')));
|
|
1265
1274
|
}
|
|
1266
1275
|
};
|
|
1267
1276
|
}
|
|
@@ -1278,7 +1287,15 @@ const TableContainerEdit = props => {
|
|
|
1278
1287
|
template: () => {
|
|
1279
1288
|
return /*#__PURE__*/React.createElement(Fragment, null, item.key === 'ADD' && /*#__PURE__*/React.createElement("div", {
|
|
1280
1289
|
className: classNames(`be-toolbar-item`, item?.className)
|
|
1281
|
-
}, /*#__PURE__*/React.createElement(
|
|
1290
|
+
}, item?.hasMenu === false ? /*#__PURE__*/React.createElement(Button, {
|
|
1291
|
+
style: {
|
|
1292
|
+
color: '#28c76f',
|
|
1293
|
+
borderColor: '#28c76f'
|
|
1294
|
+
},
|
|
1295
|
+
variant: 'outlined',
|
|
1296
|
+
onClick: () => handleAddMulti(item, 1),
|
|
1297
|
+
className: "d-flex toolbar-button"
|
|
1298
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')) : /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
1282
1299
|
title: "",
|
|
1283
1300
|
overlayClassName: 'be-popup-container',
|
|
1284
1301
|
style: {
|
|
@@ -1295,7 +1312,7 @@ const TableContainerEdit = props => {
|
|
|
1295
1312
|
color: '#28c76f'
|
|
1296
1313
|
},
|
|
1297
1314
|
onClick: () => handleAddMulti(item, 1)
|
|
1298
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1315
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')))));
|
|
1299
1316
|
}
|
|
1300
1317
|
};
|
|
1301
1318
|
}
|
|
@@ -1314,7 +1331,7 @@ const TableContainerEdit = props => {
|
|
|
1314
1331
|
variant: 'outlined',
|
|
1315
1332
|
onClick: handleDuplicate,
|
|
1316
1333
|
className: "d-flex toolbar-button"
|
|
1317
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate')));
|
|
1334
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate'))));
|
|
1318
1335
|
}
|
|
1319
1336
|
};
|
|
1320
1337
|
}
|
|
@@ -1325,7 +1342,15 @@ const TableContainerEdit = props => {
|
|
|
1325
1342
|
template: () => {
|
|
1326
1343
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1327
1344
|
className: classNames(`be-toolbar-item`, item?.className)
|
|
1328
|
-
}, /*#__PURE__*/React.createElement(
|
|
1345
|
+
}, item?.hasMenu === false ? /*#__PURE__*/React.createElement(Button, {
|
|
1346
|
+
style: {
|
|
1347
|
+
color: '#28c76f',
|
|
1348
|
+
borderColor: '#28c76f'
|
|
1349
|
+
},
|
|
1350
|
+
variant: 'outlined',
|
|
1351
|
+
onClick: () => handleInsertBefore(item, 1),
|
|
1352
|
+
className: "d-flex toolbar-button"
|
|
1353
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before')) : /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
1329
1354
|
overlayClassName: 'be-popup-container',
|
|
1330
1355
|
style: {
|
|
1331
1356
|
color: '#28c76f',
|
|
@@ -1341,7 +1366,7 @@ const TableContainerEdit = props => {
|
|
|
1341
1366
|
color: '#28c76f'
|
|
1342
1367
|
},
|
|
1343
1368
|
onClick: () => handleInsertBefore(item, 1)
|
|
1344
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before'))));
|
|
1369
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before')))));
|
|
1345
1370
|
}
|
|
1346
1371
|
};
|
|
1347
1372
|
}
|
|
@@ -1352,7 +1377,15 @@ const TableContainerEdit = props => {
|
|
|
1352
1377
|
template: () => {
|
|
1353
1378
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1354
1379
|
className: classNames(`be-toolbar-item`, item?.className)
|
|
1355
|
-
}, /*#__PURE__*/React.createElement(
|
|
1380
|
+
}, item?.hasMenu === false ? /*#__PURE__*/React.createElement(Button, {
|
|
1381
|
+
style: {
|
|
1382
|
+
color: '#28c76f',
|
|
1383
|
+
borderColor: '#28c76f'
|
|
1384
|
+
},
|
|
1385
|
+
variant: 'outlined',
|
|
1386
|
+
onClick: () => handleInsertAfter(item, 1),
|
|
1387
|
+
className: "d-flex toolbar-button"
|
|
1388
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after')) : /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
1356
1389
|
overlayClassName: 'be-popup-container',
|
|
1357
1390
|
style: {
|
|
1358
1391
|
color: '#28c76f',
|
|
@@ -1368,7 +1401,7 @@ const TableContainerEdit = props => {
|
|
|
1368
1401
|
color: '#28c76f'
|
|
1369
1402
|
},
|
|
1370
1403
|
onClick: () => handleInsertAfter(item, 1)
|
|
1371
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after'))));
|
|
1404
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after')))));
|
|
1372
1405
|
}
|
|
1373
1406
|
};
|
|
1374
1407
|
}
|
|
@@ -1387,7 +1420,7 @@ const TableContainerEdit = props => {
|
|
|
1387
1420
|
variant: 'outlined',
|
|
1388
1421
|
onClick: () => handleInsertChild(item),
|
|
1389
1422
|
className: "d-flex toolbar-button"
|
|
1390
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children')));
|
|
1423
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children'))));
|
|
1391
1424
|
}
|
|
1392
1425
|
};
|
|
1393
1426
|
}
|
|
@@ -1406,7 +1439,7 @@ const TableContainerEdit = props => {
|
|
|
1406
1439
|
variant: 'outlined',
|
|
1407
1440
|
onClick: handleDeleteAll,
|
|
1408
1441
|
className: "d-flex toolbar-button"
|
|
1409
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1442
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item')));
|
|
1410
1443
|
}
|
|
1411
1444
|
};
|
|
1412
1445
|
}
|
|
@@ -1425,7 +1458,7 @@ const TableContainerEdit = props => {
|
|
|
1425
1458
|
variant: 'outlined',
|
|
1426
1459
|
onClick: () => handleDeleteRows(item),
|
|
1427
1460
|
className: "d-flex toolbar-button"
|
|
1428
|
-
}, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`));
|
|
1461
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`)));
|
|
1429
1462
|
}
|
|
1430
1463
|
};
|
|
1431
1464
|
}
|
|
@@ -1445,7 +1478,15 @@ const TableContainerEdit = props => {
|
|
|
1445
1478
|
template: () => {
|
|
1446
1479
|
return /*#__PURE__*/React.createElement(Fragment, null, item.key === 'ADD' && /*#__PURE__*/React.createElement("div", {
|
|
1447
1480
|
className: classNames(`be-toolbar-item`, item?.className)
|
|
1448
|
-
}, /*#__PURE__*/React.createElement(
|
|
1481
|
+
}, item?.hasMenu === false ? /*#__PURE__*/React.createElement(Button, {
|
|
1482
|
+
style: {
|
|
1483
|
+
color: '#28c76f',
|
|
1484
|
+
borderColor: '#28c76f'
|
|
1485
|
+
},
|
|
1486
|
+
variant: 'outlined',
|
|
1487
|
+
onClick: () => handleAddMulti(item, 1),
|
|
1488
|
+
className: "d-flex toolbar-button"
|
|
1489
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')) : /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
1449
1490
|
overlayClassName: 'be-popup-container',
|
|
1450
1491
|
trigger: ['click'],
|
|
1451
1492
|
style: {
|
|
@@ -1462,7 +1503,7 @@ const TableContainerEdit = props => {
|
|
|
1462
1503
|
color: '#28c76f'
|
|
1463
1504
|
},
|
|
1464
1505
|
onClick: () => handleAddMulti(item, 1)
|
|
1465
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1506
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')))));
|
|
1466
1507
|
}
|
|
1467
1508
|
};
|
|
1468
1509
|
}
|
|
@@ -1481,7 +1522,7 @@ const TableContainerEdit = props => {
|
|
|
1481
1522
|
variant: 'outlined',
|
|
1482
1523
|
onClick: () => handleDeleteAll(item),
|
|
1483
1524
|
className: "d-flex toolbar-button"
|
|
1484
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1525
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item')));
|
|
1485
1526
|
}
|
|
1486
1527
|
};
|
|
1487
1528
|
}
|
|
@@ -1498,7 +1539,15 @@ const TableContainerEdit = props => {
|
|
|
1498
1539
|
template: () => {
|
|
1499
1540
|
return /*#__PURE__*/React.createElement(Fragment, null, item.key === 'ADD' && /*#__PURE__*/React.createElement("div", {
|
|
1500
1541
|
className: classNames(`be-toolbar-item`, item?.className)
|
|
1501
|
-
}, /*#__PURE__*/React.createElement(
|
|
1542
|
+
}, item?.hasMenu === false ? /*#__PURE__*/React.createElement(Button, {
|
|
1543
|
+
style: {
|
|
1544
|
+
color: '#28c76f',
|
|
1545
|
+
borderColor: '#28c76f'
|
|
1546
|
+
},
|
|
1547
|
+
variant: 'outlined',
|
|
1548
|
+
onClick: () => handleAddMulti(item, 1),
|
|
1549
|
+
className: "d-flex toolbar-button"
|
|
1550
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')) : /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
1502
1551
|
title: "",
|
|
1503
1552
|
overlayClassName: 'be-popup-container',
|
|
1504
1553
|
style: {
|
|
@@ -1515,7 +1564,7 @@ const TableContainerEdit = props => {
|
|
|
1515
1564
|
color: '#28c76f'
|
|
1516
1565
|
},
|
|
1517
1566
|
onClick: () => handleAddMulti(item, 1)
|
|
1518
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1567
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')))));
|
|
1519
1568
|
}
|
|
1520
1569
|
};
|
|
1521
1570
|
}
|
|
@@ -1534,7 +1583,7 @@ const TableContainerEdit = props => {
|
|
|
1534
1583
|
variant: 'outlined',
|
|
1535
1584
|
onClick: handleDuplicate,
|
|
1536
1585
|
className: "d-flex toolbar-button"
|
|
1537
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate')));
|
|
1586
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate'))));
|
|
1538
1587
|
}
|
|
1539
1588
|
};
|
|
1540
1589
|
}
|
|
@@ -1545,7 +1594,15 @@ const TableContainerEdit = props => {
|
|
|
1545
1594
|
template: () => {
|
|
1546
1595
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1547
1596
|
className: classNames(`be-toolbar-item`, item?.className)
|
|
1548
|
-
}, /*#__PURE__*/React.createElement(
|
|
1597
|
+
}, item?.hasMenu === false ? /*#__PURE__*/React.createElement(Button, {
|
|
1598
|
+
style: {
|
|
1599
|
+
color: '#28c76f',
|
|
1600
|
+
borderColor: '#28c76f'
|
|
1601
|
+
},
|
|
1602
|
+
variant: 'outlined',
|
|
1603
|
+
onClick: () => handleInsertBefore(item, 1),
|
|
1604
|
+
className: "d-flex toolbar-button"
|
|
1605
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before')) : /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
1549
1606
|
overlayClassName: 'be-popup-container',
|
|
1550
1607
|
style: {
|
|
1551
1608
|
color: '#28c76f',
|
|
@@ -1561,7 +1618,7 @@ const TableContainerEdit = props => {
|
|
|
1561
1618
|
color: '#28c76f'
|
|
1562
1619
|
},
|
|
1563
1620
|
onClick: () => handleInsertBefore(item, 1)
|
|
1564
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before'))));
|
|
1621
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before')))));
|
|
1565
1622
|
}
|
|
1566
1623
|
};
|
|
1567
1624
|
}
|
|
@@ -1572,7 +1629,15 @@ const TableContainerEdit = props => {
|
|
|
1572
1629
|
template: () => {
|
|
1573
1630
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1574
1631
|
className: classNames(`be-toolbar-item`, item?.className)
|
|
1575
|
-
}, /*#__PURE__*/React.createElement(
|
|
1632
|
+
}, item?.hasMenu === false ? /*#__PURE__*/React.createElement(Button, {
|
|
1633
|
+
style: {
|
|
1634
|
+
color: '#28c76f',
|
|
1635
|
+
borderColor: '#28c76f'
|
|
1636
|
+
},
|
|
1637
|
+
variant: 'outlined',
|
|
1638
|
+
onClick: () => handleInsertAfter(item, 1),
|
|
1639
|
+
className: "d-flex toolbar-button"
|
|
1640
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after')) : /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
1576
1641
|
overlayClassName: 'be-popup-container',
|
|
1577
1642
|
style: {
|
|
1578
1643
|
color: '#28c76f',
|
|
@@ -1588,7 +1653,7 @@ const TableContainerEdit = props => {
|
|
|
1588
1653
|
color: '#28c76f'
|
|
1589
1654
|
},
|
|
1590
1655
|
onClick: () => handleInsertAfter(item, 1)
|
|
1591
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after'))));
|
|
1656
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after')))));
|
|
1592
1657
|
}
|
|
1593
1658
|
};
|
|
1594
1659
|
}
|
|
@@ -1607,7 +1672,7 @@ const TableContainerEdit = props => {
|
|
|
1607
1672
|
variant: 'outlined',
|
|
1608
1673
|
onClick: () => handleInsertChild(item),
|
|
1609
1674
|
className: "d-flex toolbar-button"
|
|
1610
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children')));
|
|
1675
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children'))));
|
|
1611
1676
|
}
|
|
1612
1677
|
};
|
|
1613
1678
|
}
|
|
@@ -1626,7 +1691,7 @@ const TableContainerEdit = props => {
|
|
|
1626
1691
|
variant: 'outlined',
|
|
1627
1692
|
onClick: handleDeleteAll,
|
|
1628
1693
|
className: "d-flex toolbar-button"
|
|
1629
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1694
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item')));
|
|
1630
1695
|
}
|
|
1631
1696
|
};
|
|
1632
1697
|
}
|
|
@@ -1645,7 +1710,7 @@ const TableContainerEdit = props => {
|
|
|
1645
1710
|
variant: 'outlined',
|
|
1646
1711
|
onClick: () => handleDeleteRows(item),
|
|
1647
1712
|
className: "d-flex toolbar-button"
|
|
1648
|
-
}, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`));
|
|
1713
|
+
}, item.template ? getToolbarTemplate(item.template) : /*#__PURE__*/React.createElement(React.Fragment, null, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`)));
|
|
1649
1714
|
}
|
|
1650
1715
|
};
|
|
1651
1716
|
}
|
|
@@ -1867,7 +1932,7 @@ const TableContainerEdit = props => {
|
|
|
1867
1932
|
overflow: 'hidden'
|
|
1868
1933
|
}
|
|
1869
1934
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1870
|
-
className: classNames('ui-rc-toolbar-bottom', {
|
|
1935
|
+
className: classNames('ui-rc-toolbar-bottom border-0', {
|
|
1871
1936
|
'ui-rc-toolbar-bottom_border-bottom': !pagination || infiniteScroll
|
|
1872
1937
|
})
|
|
1873
1938
|
}, /*#__PURE__*/React.createElement(Toolbar, {
|
|
@@ -522,6 +522,7 @@ const EditableCell = props => {
|
|
|
522
522
|
popupClassName: 'be-popup-container',
|
|
523
523
|
status: isInvalid ? 'error' : undefined,
|
|
524
524
|
filterOption: filterOption,
|
|
525
|
+
optionRender: column.editSelectSettings?.formatOptionLabel,
|
|
525
526
|
fieldNames: fieldNames ? fieldNames : {
|
|
526
527
|
value: keySelect,
|
|
527
528
|
label: inputKey ?? 'label'
|
|
@@ -676,6 +677,7 @@ const EditableCell = props => {
|
|
|
676
677
|
return /*#__PURE__*/React.createElement(React.Fragment, null, " ", menu);
|
|
677
678
|
}
|
|
678
679
|
},
|
|
680
|
+
optionRender: column.editSelectSettings?.formatOptionLabel,
|
|
679
681
|
filterOption: filterOption,
|
|
680
682
|
fieldNames: fieldNames ? fieldNames : {
|
|
681
683
|
value: keySelect,
|
|
@@ -52,7 +52,8 @@ const TableBodyRow = ({
|
|
|
52
52
|
className: classNames(`${prefix}-grid-row ${rowClass ?? ''}`, {
|
|
53
53
|
[`${prefix}-grid-row-selected`]: row.getIsSelected(),
|
|
54
54
|
[`${prefix}-grid-row-focus`]: row.id === focusedCell?.rowId && !editAble,
|
|
55
|
-
[`${prefix}-grid-row-parent`]: row.subRows && row.subRows.length > 0 || Array.isArray(row.originalSubRows)
|
|
55
|
+
// [`${prefix}-grid-row-parent`]: row.subRows && row.subRows.length > 0 || (Array.isArray(row.originalSubRows) && row.originalSubRows.length > 0),
|
|
56
|
+
[`${prefix}-grid-row-parent`]: row.getCanExpand()
|
|
56
57
|
}),
|
|
57
58
|
style: {
|
|
58
59
|
// display: 'flex',
|
|
@@ -48,6 +48,7 @@ export declare const checkFieldKey: (key: string | undefined) => string;
|
|
|
48
48
|
export declare const convertLabelToTitle: (data: any[]) => any[];
|
|
49
49
|
export declare const convertArrayWithIndent: (inputArray: any[], parentIndent?: number) => any[];
|
|
50
50
|
export declare const getTemplate: (template: any, column?: ColumnTable) => React.ReactNode | React.ReactElement;
|
|
51
|
+
export declare const getToolbarTemplate: (template: any) => React.ReactNode | React.ReactElement;
|
|
51
52
|
export declare const isObjEmpty: (obj: any) => boolean;
|
|
52
53
|
export declare const getColumnsVisible: <T>(columns: ColumnsTable<T>, index: number) => ColumnTable<T>[];
|
|
53
54
|
export declare const updateData: <Record = AnyObject>(initData: Record[], rows: Record[], key: keyof Record) => Record[];
|
|
@@ -24,7 +24,7 @@ exports.getCellsByPosition = getCellsByPosition;
|
|
|
24
24
|
exports.getCellsByPosition2 = getCellsByPosition2;
|
|
25
25
|
exports.getFormat = exports.getFirstSelectCell = exports.getEditType = exports.getDefaultValue = exports.getDatepickerFormat = exports.getDateString = exports.getDateRangeFormat = exports.getColumnsVisible = void 0;
|
|
26
26
|
exports.getHiddenParentKeys = getHiddenParentKeys;
|
|
27
|
-
exports.getVisibleColumnKeys = exports.getTypeFilter = exports.getTemplate = exports.getRowsPasteIndex = exports.getRowNumber = exports.getLastSelectCell = void 0;
|
|
27
|
+
exports.getVisibleColumnKeys = exports.getTypeFilter = exports.getToolbarTemplate = exports.getTemplate = exports.getRowsPasteIndex = exports.getRowNumber = exports.getLastSelectCell = void 0;
|
|
28
28
|
exports.groupAndSum = groupAndSum;
|
|
29
29
|
exports.groupArrayByColumns = groupArrayByColumns;
|
|
30
30
|
exports.hideDraggingPoint = void 0;
|
|
@@ -40,8 +40,8 @@ exports.isRightMostInRegion = isRightMostInRegion;
|
|
|
40
40
|
exports.isTopMostInRegion = exports.isSelectedCell = void 0;
|
|
41
41
|
exports.mergeWithFilter = mergeWithFilter;
|
|
42
42
|
exports.mergeWithFilter2 = mergeWithFilter2;
|
|
43
|
-
exports.
|
|
44
|
-
exports.updateData = exports.updateColumnsByGroup = exports.updateColumns = exports.updateArrayByKey = exports.unFlattenData = exports.sumDataByField = exports.sumByField = exports.sortedSetDSC = exports.sortedSetASC = exports.showDraggingPoint = exports.shouldInclude = exports.removeVietnameseTones = void 0;
|
|
43
|
+
exports.removeFieldRecursive = exports.removeClassCellIndexSelected = exports.removeClassBorderPasteCell = exports.removeBorderPasteClass = exports.removeBorderClass2 = exports.removeBorderClass = exports.parseCells = exports.parseBooleanToValue = exports.onRemoveBorderSelectedCell = exports.onRemoveBgSelectedCell = exports.onRemoveBgCellIndex = exports.onAddBorderSelectedCell = exports.onAddBgSelectedCell = exports.onAddBgCellIndex = exports.newGuid = exports.mergedSets = void 0;
|
|
44
|
+
exports.updateData = exports.updateColumnsByGroup = exports.updateColumns = exports.updateArrayByKey = exports.unFlattenData = exports.sumDataByField = exports.sumByField = exports.sortedSetDSC = exports.sortedSetASC = exports.showDraggingPoint = exports.shouldInclude = exports.removeVietnameseTones = exports.removeInvisibleColumns = void 0;
|
|
45
45
|
exports.updateDataByFilter = updateDataByFilter;
|
|
46
46
|
exports.updateOrInsert = updateOrInsert;
|
|
47
47
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
@@ -466,6 +466,13 @@ const getTemplate = (template, column) => {
|
|
|
466
466
|
}
|
|
467
467
|
return template;
|
|
468
468
|
};
|
|
469
|
+
exports.getTemplate = getTemplate;
|
|
470
|
+
const getToolbarTemplate = template => {
|
|
471
|
+
if (template && typeof template === 'function') {
|
|
472
|
+
return template();
|
|
473
|
+
}
|
|
474
|
+
return template;
|
|
475
|
+
};
|
|
469
476
|
|
|
470
477
|
// export const totalFixedWidth = <T, >(columns: ColumnsTable<T>, type: 'left' | 'right', selectionSettings?: SelectionSettings) => {
|
|
471
478
|
// const totalFixedLeftWidth: number = columns
|
|
@@ -481,7 +488,7 @@ const getTemplate = (template, column) => {
|
|
|
481
488
|
// return totalFixedLeftWidth + selectColumnWidth
|
|
482
489
|
|
|
483
490
|
// }
|
|
484
|
-
exports.
|
|
491
|
+
exports.getToolbarTemplate = getToolbarTemplate;
|
|
485
492
|
const isObjEmpty = obj => {
|
|
486
493
|
if (isNullOrUndefined(obj)) {
|
|
487
494
|
return true;
|
|
@@ -466,6 +466,7 @@ export type ToolbarItem = {
|
|
|
466
466
|
template?: React.ReactNode | React.ReactElement | (() => React.ReactNode | React.ReactElement);
|
|
467
467
|
title?: React.ReactNode;
|
|
468
468
|
disabled?: boolean;
|
|
469
|
+
hasMenu?: boolean;
|
|
469
470
|
[key: string]: any;
|
|
470
471
|
};
|
|
471
472
|
export type LoadOptionsArgs = {
|
|
@@ -24,6 +24,7 @@ var _TableWrapper = _interopRequireDefault(require("./table/TableWrapper"));
|
|
|
24
24
|
var _sweetalert2ReactContent = _interopRequireDefault(require("sweetalert2-react-content"));
|
|
25
25
|
var _sweetalert = _interopRequireDefault(require("sweetalert2"));
|
|
26
26
|
var _locale = require("rc-master-ui/es/locale");
|
|
27
|
+
var _hooks = require("../grid-component/hooks");
|
|
27
28
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
29
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
30
|
const MySwal = (0, _sweetalert2ReactContent.default)(_sweetalert.default);
|
|
@@ -1232,7 +1233,15 @@ const TableContainerEdit = props => {
|
|
|
1232
1233
|
template: () => {
|
|
1233
1234
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'ADD' && /*#__PURE__*/_react.default.createElement("div", {
|
|
1234
1235
|
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1235
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.
|
|
1236
|
+
}, item?.hasMenu === false ? /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
1237
|
+
style: {
|
|
1238
|
+
color: '#28c76f',
|
|
1239
|
+
borderColor: '#28c76f'
|
|
1240
|
+
},
|
|
1241
|
+
variant: 'outlined',
|
|
1242
|
+
onClick: () => handleAddMulti(item, 1),
|
|
1243
|
+
className: "d-flex toolbar-button"
|
|
1244
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')) : /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
|
|
1236
1245
|
overlayClassName: 'be-popup-container',
|
|
1237
1246
|
trigger: ['click'],
|
|
1238
1247
|
style: {
|
|
@@ -1249,7 +1258,7 @@ const TableContainerEdit = props => {
|
|
|
1249
1258
|
color: '#28c76f'
|
|
1250
1259
|
},
|
|
1251
1260
|
onClick: () => handleAddMulti(item, 1)
|
|
1252
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1261
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')))));
|
|
1253
1262
|
}
|
|
1254
1263
|
};
|
|
1255
1264
|
}
|
|
@@ -1268,7 +1277,7 @@ const TableContainerEdit = props => {
|
|
|
1268
1277
|
variant: 'outlined',
|
|
1269
1278
|
onClick: () => handleDeleteAll(item),
|
|
1270
1279
|
className: "d-flex toolbar-button"
|
|
1271
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1280
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item')));
|
|
1272
1281
|
}
|
|
1273
1282
|
};
|
|
1274
1283
|
}
|
|
@@ -1285,7 +1294,15 @@ const TableContainerEdit = props => {
|
|
|
1285
1294
|
template: () => {
|
|
1286
1295
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'ADD' && /*#__PURE__*/_react.default.createElement("div", {
|
|
1287
1296
|
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1288
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.
|
|
1297
|
+
}, item?.hasMenu === false ? /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
1298
|
+
style: {
|
|
1299
|
+
color: '#28c76f',
|
|
1300
|
+
borderColor: '#28c76f'
|
|
1301
|
+
},
|
|
1302
|
+
variant: 'outlined',
|
|
1303
|
+
onClick: () => handleAddMulti(item, 1),
|
|
1304
|
+
className: "d-flex toolbar-button"
|
|
1305
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')) : /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
|
|
1289
1306
|
title: "",
|
|
1290
1307
|
overlayClassName: 'be-popup-container',
|
|
1291
1308
|
style: {
|
|
@@ -1302,7 +1319,7 @@ const TableContainerEdit = props => {
|
|
|
1302
1319
|
color: '#28c76f'
|
|
1303
1320
|
},
|
|
1304
1321
|
onClick: () => handleAddMulti(item, 1)
|
|
1305
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1322
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')))));
|
|
1306
1323
|
}
|
|
1307
1324
|
};
|
|
1308
1325
|
}
|
|
@@ -1321,7 +1338,7 @@ const TableContainerEdit = props => {
|
|
|
1321
1338
|
variant: 'outlined',
|
|
1322
1339
|
onClick: handleDuplicate,
|
|
1323
1340
|
className: "d-flex toolbar-button"
|
|
1324
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate')));
|
|
1341
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate'))));
|
|
1325
1342
|
}
|
|
1326
1343
|
};
|
|
1327
1344
|
}
|
|
@@ -1332,7 +1349,15 @@ const TableContainerEdit = props => {
|
|
|
1332
1349
|
template: () => {
|
|
1333
1350
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1334
1351
|
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1335
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.
|
|
1352
|
+
}, item?.hasMenu === false ? /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
1353
|
+
style: {
|
|
1354
|
+
color: '#28c76f',
|
|
1355
|
+
borderColor: '#28c76f'
|
|
1356
|
+
},
|
|
1357
|
+
variant: 'outlined',
|
|
1358
|
+
onClick: () => handleInsertBefore(item, 1),
|
|
1359
|
+
className: "d-flex toolbar-button"
|
|
1360
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before')) : /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
|
|
1336
1361
|
overlayClassName: 'be-popup-container',
|
|
1337
1362
|
style: {
|
|
1338
1363
|
color: '#28c76f',
|
|
@@ -1348,7 +1373,7 @@ const TableContainerEdit = props => {
|
|
|
1348
1373
|
color: '#28c76f'
|
|
1349
1374
|
},
|
|
1350
1375
|
onClick: () => handleInsertBefore(item, 1)
|
|
1351
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before'))));
|
|
1376
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before')))));
|
|
1352
1377
|
}
|
|
1353
1378
|
};
|
|
1354
1379
|
}
|
|
@@ -1359,7 +1384,15 @@ const TableContainerEdit = props => {
|
|
|
1359
1384
|
template: () => {
|
|
1360
1385
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1361
1386
|
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1362
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.
|
|
1387
|
+
}, item?.hasMenu === false ? /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
1388
|
+
style: {
|
|
1389
|
+
color: '#28c76f',
|
|
1390
|
+
borderColor: '#28c76f'
|
|
1391
|
+
},
|
|
1392
|
+
variant: 'outlined',
|
|
1393
|
+
onClick: () => handleInsertAfter(item, 1),
|
|
1394
|
+
className: "d-flex toolbar-button"
|
|
1395
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after')) : /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
|
|
1363
1396
|
overlayClassName: 'be-popup-container',
|
|
1364
1397
|
style: {
|
|
1365
1398
|
color: '#28c76f',
|
|
@@ -1375,7 +1408,7 @@ const TableContainerEdit = props => {
|
|
|
1375
1408
|
color: '#28c76f'
|
|
1376
1409
|
},
|
|
1377
1410
|
onClick: () => handleInsertAfter(item, 1)
|
|
1378
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after'))));
|
|
1411
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after')))));
|
|
1379
1412
|
}
|
|
1380
1413
|
};
|
|
1381
1414
|
}
|
|
@@ -1394,7 +1427,7 @@ const TableContainerEdit = props => {
|
|
|
1394
1427
|
variant: 'outlined',
|
|
1395
1428
|
onClick: () => handleInsertChild(item),
|
|
1396
1429
|
className: "d-flex toolbar-button"
|
|
1397
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children')));
|
|
1430
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children'))));
|
|
1398
1431
|
}
|
|
1399
1432
|
};
|
|
1400
1433
|
}
|
|
@@ -1413,7 +1446,7 @@ const TableContainerEdit = props => {
|
|
|
1413
1446
|
variant: 'outlined',
|
|
1414
1447
|
onClick: handleDeleteAll,
|
|
1415
1448
|
className: "d-flex toolbar-button"
|
|
1416
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1449
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item')));
|
|
1417
1450
|
}
|
|
1418
1451
|
};
|
|
1419
1452
|
}
|
|
@@ -1432,7 +1465,7 @@ const TableContainerEdit = props => {
|
|
|
1432
1465
|
variant: 'outlined',
|
|
1433
1466
|
onClick: () => handleDeleteRows(item),
|
|
1434
1467
|
className: "d-flex toolbar-button"
|
|
1435
|
-
}, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`));
|
|
1468
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`)));
|
|
1436
1469
|
}
|
|
1437
1470
|
};
|
|
1438
1471
|
}
|
|
@@ -1452,7 +1485,15 @@ const TableContainerEdit = props => {
|
|
|
1452
1485
|
template: () => {
|
|
1453
1486
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'ADD' && /*#__PURE__*/_react.default.createElement("div", {
|
|
1454
1487
|
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1455
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.
|
|
1488
|
+
}, item?.hasMenu === false ? /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
1489
|
+
style: {
|
|
1490
|
+
color: '#28c76f',
|
|
1491
|
+
borderColor: '#28c76f'
|
|
1492
|
+
},
|
|
1493
|
+
variant: 'outlined',
|
|
1494
|
+
onClick: () => handleAddMulti(item, 1),
|
|
1495
|
+
className: "d-flex toolbar-button"
|
|
1496
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')) : /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
|
|
1456
1497
|
overlayClassName: 'be-popup-container',
|
|
1457
1498
|
trigger: ['click'],
|
|
1458
1499
|
style: {
|
|
@@ -1469,7 +1510,7 @@ const TableContainerEdit = props => {
|
|
|
1469
1510
|
color: '#28c76f'
|
|
1470
1511
|
},
|
|
1471
1512
|
onClick: () => handleAddMulti(item, 1)
|
|
1472
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1513
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')))));
|
|
1473
1514
|
}
|
|
1474
1515
|
};
|
|
1475
1516
|
}
|
|
@@ -1488,7 +1529,7 @@ const TableContainerEdit = props => {
|
|
|
1488
1529
|
variant: 'outlined',
|
|
1489
1530
|
onClick: () => handleDeleteAll(item),
|
|
1490
1531
|
className: "d-flex toolbar-button"
|
|
1491
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1532
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item')));
|
|
1492
1533
|
}
|
|
1493
1534
|
};
|
|
1494
1535
|
}
|
|
@@ -1505,7 +1546,15 @@ const TableContainerEdit = props => {
|
|
|
1505
1546
|
template: () => {
|
|
1506
1547
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'ADD' && /*#__PURE__*/_react.default.createElement("div", {
|
|
1507
1548
|
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1508
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.
|
|
1549
|
+
}, item?.hasMenu === false ? /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
1550
|
+
style: {
|
|
1551
|
+
color: '#28c76f',
|
|
1552
|
+
borderColor: '#28c76f'
|
|
1553
|
+
},
|
|
1554
|
+
variant: 'outlined',
|
|
1555
|
+
onClick: () => handleAddMulti(item, 1),
|
|
1556
|
+
className: "d-flex toolbar-button"
|
|
1557
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')) : /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
|
|
1509
1558
|
title: "",
|
|
1510
1559
|
overlayClassName: 'be-popup-container',
|
|
1511
1560
|
style: {
|
|
@@ -1522,7 +1571,7 @@ const TableContainerEdit = props => {
|
|
|
1522
1571
|
color: '#28c76f'
|
|
1523
1572
|
},
|
|
1524
1573
|
onClick: () => handleAddMulti(item, 1)
|
|
1525
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1574
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item')))));
|
|
1526
1575
|
}
|
|
1527
1576
|
};
|
|
1528
1577
|
}
|
|
@@ -1541,7 +1590,7 @@ const TableContainerEdit = props => {
|
|
|
1541
1590
|
variant: 'outlined',
|
|
1542
1591
|
onClick: handleDuplicate,
|
|
1543
1592
|
className: "d-flex toolbar-button"
|
|
1544
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate')));
|
|
1593
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate'))));
|
|
1545
1594
|
}
|
|
1546
1595
|
};
|
|
1547
1596
|
}
|
|
@@ -1552,7 +1601,15 @@ const TableContainerEdit = props => {
|
|
|
1552
1601
|
template: () => {
|
|
1553
1602
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1554
1603
|
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1555
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.
|
|
1604
|
+
}, item?.hasMenu === false ? /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
1605
|
+
style: {
|
|
1606
|
+
color: '#28c76f',
|
|
1607
|
+
borderColor: '#28c76f'
|
|
1608
|
+
},
|
|
1609
|
+
variant: 'outlined',
|
|
1610
|
+
onClick: () => handleInsertBefore(item, 1),
|
|
1611
|
+
className: "d-flex toolbar-button"
|
|
1612
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before')) : /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
|
|
1556
1613
|
overlayClassName: 'be-popup-container',
|
|
1557
1614
|
style: {
|
|
1558
1615
|
color: '#28c76f',
|
|
@@ -1568,7 +1625,7 @@ const TableContainerEdit = props => {
|
|
|
1568
1625
|
color: '#28c76f'
|
|
1569
1626
|
},
|
|
1570
1627
|
onClick: () => handleInsertBefore(item, 1)
|
|
1571
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before'))));
|
|
1628
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before')))));
|
|
1572
1629
|
}
|
|
1573
1630
|
};
|
|
1574
1631
|
}
|
|
@@ -1579,7 +1636,15 @@ const TableContainerEdit = props => {
|
|
|
1579
1636
|
template: () => {
|
|
1580
1637
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1581
1638
|
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1582
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.
|
|
1639
|
+
}, item?.hasMenu === false ? /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
1640
|
+
style: {
|
|
1641
|
+
color: '#28c76f',
|
|
1642
|
+
borderColor: '#28c76f'
|
|
1643
|
+
},
|
|
1644
|
+
variant: 'outlined',
|
|
1645
|
+
onClick: () => handleInsertAfter(item, 1),
|
|
1646
|
+
className: "d-flex toolbar-button"
|
|
1647
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after')) : /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
|
|
1583
1648
|
overlayClassName: 'be-popup-container',
|
|
1584
1649
|
style: {
|
|
1585
1650
|
color: '#28c76f',
|
|
@@ -1595,7 +1660,7 @@ const TableContainerEdit = props => {
|
|
|
1595
1660
|
color: '#28c76f'
|
|
1596
1661
|
},
|
|
1597
1662
|
onClick: () => handleInsertAfter(item, 1)
|
|
1598
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after'))));
|
|
1663
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after')))));
|
|
1599
1664
|
}
|
|
1600
1665
|
};
|
|
1601
1666
|
}
|
|
@@ -1614,7 +1679,7 @@ const TableContainerEdit = props => {
|
|
|
1614
1679
|
variant: 'outlined',
|
|
1615
1680
|
onClick: () => handleInsertChild(item),
|
|
1616
1681
|
className: "d-flex toolbar-button"
|
|
1617
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children')));
|
|
1682
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children'))));
|
|
1618
1683
|
}
|
|
1619
1684
|
};
|
|
1620
1685
|
}
|
|
@@ -1633,7 +1698,7 @@ const TableContainerEdit = props => {
|
|
|
1633
1698
|
variant: 'outlined',
|
|
1634
1699
|
onClick: handleDeleteAll,
|
|
1635
1700
|
className: "d-flex toolbar-button"
|
|
1636
|
-
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1701
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item')));
|
|
1637
1702
|
}
|
|
1638
1703
|
};
|
|
1639
1704
|
}
|
|
@@ -1652,7 +1717,7 @@ const TableContainerEdit = props => {
|
|
|
1652
1717
|
variant: 'outlined',
|
|
1653
1718
|
onClick: () => handleDeleteRows(item),
|
|
1654
1719
|
className: "d-flex toolbar-button"
|
|
1655
|
-
}, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`));
|
|
1720
|
+
}, item.template ? (0, _hooks.getToolbarTemplate)(item.template) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`)));
|
|
1656
1721
|
}
|
|
1657
1722
|
};
|
|
1658
1723
|
}
|
|
@@ -1874,7 +1939,7 @@ const TableContainerEdit = props => {
|
|
|
1874
1939
|
overflow: 'hidden'
|
|
1875
1940
|
}
|
|
1876
1941
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1877
|
-
className: (0, _classnames.default)('ui-rc-toolbar-bottom', {
|
|
1942
|
+
className: (0, _classnames.default)('ui-rc-toolbar-bottom border-0', {
|
|
1878
1943
|
'ui-rc-toolbar-bottom_border-bottom': !pagination || infiniteScroll
|
|
1879
1944
|
})
|
|
1880
1945
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
@@ -530,6 +530,7 @@ const EditableCell = props => {
|
|
|
530
530
|
popupClassName: 'be-popup-container',
|
|
531
531
|
status: isInvalid ? 'error' : undefined,
|
|
532
532
|
filterOption: filterOption,
|
|
533
|
+
optionRender: column.editSelectSettings?.formatOptionLabel,
|
|
533
534
|
fieldNames: fieldNames ? fieldNames : {
|
|
534
535
|
value: keySelect,
|
|
535
536
|
label: inputKey ?? 'label'
|
|
@@ -684,6 +685,7 @@ const EditableCell = props => {
|
|
|
684
685
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, " ", menu);
|
|
685
686
|
}
|
|
686
687
|
},
|
|
688
|
+
optionRender: column.editSelectSettings?.formatOptionLabel,
|
|
687
689
|
filterOption: filterOption,
|
|
688
690
|
fieldNames: fieldNames ? fieldNames : {
|
|
689
691
|
value: keySelect,
|
|
@@ -59,7 +59,8 @@ const TableBodyRow = ({
|
|
|
59
59
|
className: (0, _classnames.default)(`${prefix}-grid-row ${rowClass ?? ''}`, {
|
|
60
60
|
[`${prefix}-grid-row-selected`]: row.getIsSelected(),
|
|
61
61
|
[`${prefix}-grid-row-focus`]: row.id === focusedCell?.rowId && !editAble,
|
|
62
|
-
[`${prefix}-grid-row-parent`]: row.subRows && row.subRows.length > 0 || Array.isArray(row.originalSubRows)
|
|
62
|
+
// [`${prefix}-grid-row-parent`]: row.subRows && row.subRows.length > 0 || (Array.isArray(row.originalSubRows) && row.originalSubRows.length > 0),
|
|
63
|
+
[`${prefix}-grid-row-parent`]: row.getCanExpand()
|
|
63
64
|
}),
|
|
64
65
|
style: {
|
|
65
66
|
// display: 'flex',
|