es-grid-template 1.9.46 → 1.9.48
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/type.d.ts +2 -0
- package/es/group-component/hook/utils.d.ts +3 -3
- package/es/table-component/TableContainer.js +3 -3
- package/es/table-component/TableContainerEdit.js +1 -1
- package/es/table-component/body/EditableCell.js +6 -6
- package/es/table-component/body/TableBodyCell.js +5 -3
- package/es/table-component/header/TableHeadCell2.js +3 -1
- package/es/table-component/header/TableHeadGroupCell.js +3 -1
- package/es/table-component/style.js +1 -1
- package/es/table-component/style.scss +2 -87
- package/es/table-virtuoso/body/TableBodyCell.js +5 -3
- package/es/table-virtuoso/header/TableHeadCell.js +4 -0
- package/lib/grid-component/type.d.ts +2 -0
- package/lib/group-component/hook/utils.d.ts +3 -3
- package/lib/table-component/TableContainer.js +3 -3
- package/lib/table-component/TableContainerEdit.js +1 -1
- package/lib/table-component/body/EditableCell.js +6 -6
- package/lib/table-component/body/TableBodyCell.js +5 -3
- package/lib/table-component/header/TableHeadCell2.js +3 -1
- package/lib/table-component/header/TableHeadGroupCell.js +3 -1
- package/lib/table-component/style.js +1 -1
- package/lib/table-component/style.scss +2 -87
- package/lib/table-virtuoso/body/TableBodyCell.js +5 -3
- package/lib/table-virtuoso/header/TableHeadCell.js +4 -0
- package/package.json +1 -1
|
@@ -356,6 +356,8 @@ export type TableProps<RecordType = AnyObject> = {
|
|
|
356
356
|
locale?: Locale;
|
|
357
357
|
/** Cấu hình wrap text */
|
|
358
358
|
wrapSettings?: IWrapSettings;
|
|
359
|
+
/** Hiển thị grid line */
|
|
360
|
+
gridLines?: "Both" | "Horizontal" | "Vertical" | "None";
|
|
359
361
|
/** Bật chế độ tải dữ liệu vô hạn */
|
|
360
362
|
infiniteScroll?: boolean;
|
|
361
363
|
/** Hàm gọi khi cuộn đến cuối */
|
|
@@ -194,10 +194,10 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
|
|
|
194
194
|
value: any;
|
|
195
195
|
rowData: RecordType;
|
|
196
196
|
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
|
|
197
|
-
onCellStyles?: Omit<CSSProperties, "
|
|
198
|
-
onCellHeaderStyles?: Omit<CSSProperties, "
|
|
197
|
+
onCellStyles?: Omit<CSSProperties, "position" | "display" | "left" | "minWidth" | "right" | "width"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "position" | "display" | "left" | "minWidth" | "right" | "width">);
|
|
198
|
+
onCellHeaderStyles?: Omit<CSSProperties, "position" | "display" | "left" | "minWidth" | "right" | "width"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "position" | "display" | "left" | "minWidth" | "right" | "width">);
|
|
199
199
|
onCell?: (rowData: RecordType, index: number) => import("react").TdHTMLAttributes<HTMLTableCellElement>;
|
|
200
|
-
onCellFooterStyles?: Omit<CSSProperties, "
|
|
200
|
+
onCellFooterStyles?: Omit<CSSProperties, "position" | "display" | "left" | "minWidth" | "right" | "width"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "position" | "display" | "left" | "minWidth" | "right" | "width">);
|
|
201
201
|
getValue?: (row: any, rowIndex: number) => any;
|
|
202
202
|
getCellProps?: (value: any, row: any, rowIndex: number) => import("./../../grid-component/type").CellProps;
|
|
203
203
|
headerCellProps?: import("./../../grid-component/type").CellProps;
|
|
@@ -244,7 +244,7 @@ const TableContainer = props => {
|
|
|
244
244
|
flex: 1,
|
|
245
245
|
overflow: 'hidden'
|
|
246
246
|
}
|
|
247
|
-
}, /*#__PURE__*/React.createElement(Toolbar, {
|
|
247
|
+
}, toolbarItemTop && toolbarItemTop?.length > 0 && /*#__PURE__*/React.createElement(Toolbar, {
|
|
248
248
|
items: toolbarItemTop ?? []
|
|
249
249
|
// mode={'scroll'}
|
|
250
250
|
,
|
|
@@ -264,7 +264,7 @@ const TableContainer = props => {
|
|
|
264
264
|
showTotal: (totalItems, range) =>
|
|
265
265
|
// @ts-ignore
|
|
266
266
|
`${range[0]}-${range[1]} / ${totalItems} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
|
|
267
|
-
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/React.createElement("div", {
|
|
267
|
+
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && toolbarItemTopRight.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
268
268
|
style: {
|
|
269
269
|
flex: 1,
|
|
270
270
|
overflow: 'hidden'
|
|
@@ -367,7 +367,7 @@ const TableContainer = props => {
|
|
|
367
367
|
fixedRightColumns: fixedRightColumns
|
|
368
368
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
369
369
|
ref: bottomToolbarRef
|
|
370
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
370
|
+
}, toolbarItemBottom && toolbarItemBottom.length > 0 && false && /*#__PURE__*/React.createElement("div", {
|
|
371
371
|
style: {
|
|
372
372
|
flex: 1,
|
|
373
373
|
overflow: 'hidden'
|
|
@@ -2046,7 +2046,7 @@ const TableContainerEdit = props => {
|
|
|
2046
2046
|
flex: 1,
|
|
2047
2047
|
overflow: 'hidden'
|
|
2048
2048
|
}
|
|
2049
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
2049
|
+
}, toolbarItemsTop && toolbarItemsTop.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
2050
2050
|
className: classNames('ui-rc-toolbar-bottom border-0', {
|
|
2051
2051
|
'ui-rc-toolbar-bottom_border-bottom': !pagination || infiniteScroll
|
|
2052
2052
|
})
|
|
@@ -308,13 +308,13 @@ const EditableCell = props => {
|
|
|
308
308
|
|
|
309
309
|
// chỉ nhận giá trị dạng HH:mm | mm:HH => convert
|
|
310
310
|
|
|
311
|
-
let time = value ??
|
|
311
|
+
let time = value ?? undefined;
|
|
312
312
|
const typeTime = getDateValueType(value);
|
|
313
313
|
if (typeTime === 'time') {
|
|
314
|
-
time = value ? dayjs(value, timeFormat) :
|
|
314
|
+
time = value ? dayjs(value, timeFormat) : undefined;
|
|
315
315
|
} else {
|
|
316
|
-
const abc = moment(value).format(timeFormat);
|
|
317
|
-
time = abc ? dayjs(abc, timeFormat) :
|
|
316
|
+
const abc = value ? moment(value).format(timeFormat) : undefined;
|
|
317
|
+
time = abc ? dayjs(abc, timeFormat) : undefined;
|
|
318
318
|
}
|
|
319
319
|
const maxTimeValue = !isEmpty(column.maxTime) ? dayjs(column.maxTime).format(timeFormat) : null;
|
|
320
320
|
const minTimeValue = !isEmpty(column.minTime) ? dayjs(column.minTime).format(timeFormat) : null;
|
|
@@ -351,7 +351,7 @@ const EditableCell = props => {
|
|
|
351
351
|
} else {
|
|
352
352
|
// const datetime = dayjs(dateString as string, timeFormat, true);
|
|
353
353
|
|
|
354
|
-
const newVal = moment(newDate.toDate()).format();
|
|
354
|
+
const newVal = newDate ? moment(newDate.toDate()).format() : undefined;
|
|
355
355
|
|
|
356
356
|
// const newVal = datetime.isValid() ? moment(datetime.toDate()).format() : ''
|
|
357
357
|
onChange(newVal);
|
|
@@ -373,7 +373,7 @@ const EditableCell = props => {
|
|
|
373
373
|
newValue = newState;
|
|
374
374
|
} else {
|
|
375
375
|
const datetime = dayjs(newState, timeFormat, true);
|
|
376
|
-
const newVal = datetime.isValid() ? moment(datetime.toDate()).format() :
|
|
376
|
+
const newVal = datetime.isValid() ? moment(datetime.toDate()).format() : undefined;
|
|
377
377
|
onChange(newVal);
|
|
378
378
|
newValue = newVal;
|
|
379
379
|
}
|
|
@@ -182,8 +182,12 @@ const TableBodyCell = props => {
|
|
|
182
182
|
const expandIconColumnIndex = expandable?.expandIconColumnIndex ?? 0;
|
|
183
183
|
const [isOpenTooltip, setIsOpenTooltip] = React.useState(false);
|
|
184
184
|
const record = cell.row.original;
|
|
185
|
+
const allRows = table.getRowModel().flatRows;
|
|
186
|
+
const rowNumber = allRows.findIndex(it => it.id === cell.row.id);
|
|
185
187
|
const columnMeta = React.useMemo(() => cell.column.columnDef.meta ?? {}, [cell.column.columnDef.meta]);
|
|
186
|
-
const
|
|
188
|
+
const cellStyles1 = typeof columnMeta.onCellStyles === 'function' ? columnMeta.onCellStyles(cell.getValue(), cell) : columnMeta.onCellStyles;
|
|
189
|
+
const cellStyles2 = typeof columnMeta.getCellProps === 'function' ? columnMeta.getCellProps(cell.getValue(), record, rowNumber).style : undefined;
|
|
190
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
187
191
|
|
|
188
192
|
// const tooltipContent: any = (isOpenTooltip === false)
|
|
189
193
|
// ? ''
|
|
@@ -191,8 +195,6 @@ const TableBodyCell = props => {
|
|
|
191
195
|
// ? (typeof columnMeta.tooltipDescription === 'function' ? columnMeta.tooltipDescription({ value: cell.getValue(), rowData: record }) : columnMeta.tooltipDescription)
|
|
192
196
|
// : cell.getValue()
|
|
193
197
|
|
|
194
|
-
const allRows = table.getRowModel().flatRows;
|
|
195
|
-
const rowNumber = allRows.findIndex(it => it.id === cell.row.id);
|
|
196
198
|
const colIndex = cell.column.getIndex();
|
|
197
199
|
const isPinned = cell.column.getIsPinned();
|
|
198
200
|
const isLastLeftPinnedColumn = isPinned === "left" && cell.column.getIsLastColumn("left");
|
|
@@ -57,7 +57,9 @@ const TableHeadCell2 = props => {
|
|
|
57
57
|
const originalColumn = column.columnDef.meta ?? {};
|
|
58
58
|
const fieldOriginalKey = originalColumn?.fieldOriginal;
|
|
59
59
|
const fieldOriginal = fieldOriginalKey ? visibleCols.find(it => it.id === fieldOriginalKey) : undefined;
|
|
60
|
-
const
|
|
60
|
+
const cellStyles1 = typeof originalColumn.onCellHeaderStyles === 'function' ? originalColumn.onCellHeaderStyles(header) : originalColumn.onCellHeaderStyles;
|
|
61
|
+
const cellStyles2 = originalColumn?.headerCellProps?.style ?? undefined;
|
|
62
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
61
63
|
const filtered = ((fieldOriginal ? fieldOriginal.getFilterValue() : column.getFilterValue()) ?? []).length > 0;
|
|
62
64
|
|
|
63
65
|
// const cellContent = originalColumn.headerTemplate ? originalColumn.headerTemplate : (t ? t(originalColumn.headerText) : originalColumn.headerText)
|
|
@@ -24,7 +24,9 @@ const TableHeadGroupCell = props => {
|
|
|
24
24
|
const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
|
|
25
25
|
const isFirstRightPinnedColumn = isPinned === 'right' && column.getIsFirstColumn('right');
|
|
26
26
|
const originalColumn = column.columnDef.meta ?? {};
|
|
27
|
-
const
|
|
27
|
+
const cellStyles1 = typeof originalColumn.onCellHeaderStyles === 'function' ? originalColumn.onCellHeaderStyles(header) : originalColumn.onCellHeaderStyles;
|
|
28
|
+
const cellStyles2 = originalColumn?.headerCellProps?.style ?? undefined;
|
|
29
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
28
30
|
|
|
29
31
|
// const cellContent = originalColumn.headerTemplate ? originalColumn.headerTemplate : (t ? t(originalColumn.headerText) : originalColumn.headerText)
|
|
30
32
|
|
|
@@ -48,4 +48,4 @@ const colorDark = '#e6e4f3e6 ';
|
|
|
48
48
|
export const GridStyle = styled.div.withConfig({
|
|
49
49
|
displayName: "GridStyle",
|
|
50
50
|
componentId: "es-grid-template__sc-hdqm5k-0"
|
|
51
|
-
})(["&.", "-grid{color:", ";font-size:", ";background-color:", ";font-family:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:'';pointer-events:none;}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{justify-content:flex-end;text-align:right;}&.", "-grid-cell-ellipsis{.ui-rc_cell-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;&.select-cell{padding-right:18px;position:relative;}.caret-down{float:right;position:absolute;right:0;&::before{content:'';display:inline-block;margin-left:4px;vertical-align:middle;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #6f7777;}}}}&.", "-grid-cell-wrap{white-space:normal;text-overflow:ellipsis;word-break:break-word;}.", "-grid-header-text-wrap{white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}}.", "-grid-thead{background-color:", ";font-weight:", ";.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{font-weight:", ";background-color:", ";color:", ";&.", "-grid-row-odd{background-color:#f9f8fd;}&.", "-grid-row-even{}&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, fontSize, BgColor, fontFamily, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, fwHeader, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwBody, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
51
|
+
})(["&.", "-grid{color:", ";font-size:", ";background-color:", ";font-family:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:'';pointer-events:none;}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{justify-content:flex-end;text-align:right;}&.", "-grid-cell-ellipsis{.ui-rc_cell-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;&.select-cell{padding-right:18px;position:relative;}.caret-down{float:right;position:absolute;right:0;&::before{content:'';display:inline-block;margin-left:4px;vertical-align:middle;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #6f7777;}}}}&.", "-grid-cell-wrap{white-space:normal;text-overflow:ellipsis;word-break:break-word;}.", "-grid-header-text-wrap{white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}}.", "-grid-thead{background-color:", ";font-weight:", ";.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{font-weight:", ";background-color:", ";color:", ";&.", "-grid-row-odd{background-color:#f9f8fd;}&.", "-grid-row-even{}&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}.ui-rc-toolbar-bottom{border-right:1px solid #e0e0e0;border-left:1px solid #e0e0e0;.be-toolbar-item{.ui-rc-btn{font-size:12px;}.toolbar-dropdown-button{font-size:12px;.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-color:#28c76f;}.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-color:#28c76f;.ui-rc-btn-icon{color:#28c76f;}}}}}.ui-rc-toolbar-bottom_border-bottom{border-bottom:1px solid #e0e0e0;}.ui-rc-toolbar-bottom{position:relative;padding:.15rem 0.5rem;background-color:#ffffff;.toolbar-button{border-radius:3px;}.ui-rc-btn{border-radius:3px;height:28px;&.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-start-start-radius:0;border-end-start-radius:0;}&.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-start-end-radius:0;border-end-end-radius:0;}}}}"], props => props.$prefix, color, fontSize, BgColor, fontFamily, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, fwHeader, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwBody, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
@@ -627,91 +627,6 @@ $cell-index-focus-bg-Dark: #E6EFFD !default;
|
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
|
|
630
|
-
|
|
631
|
-
// bottom toolbar
|
|
632
|
-
.ui-rc-toolbar-bottom {
|
|
633
|
-
// border-bottom: 1px solid #e0e0e0;
|
|
634
|
-
border-right: 1px solid #e0e0e0;
|
|
635
|
-
border-left: 1px solid #e0e0e0;
|
|
636
|
-
|
|
637
|
-
.be-toolbar-item {
|
|
638
|
-
.ui-rc-btn {
|
|
639
|
-
font-size: 12px;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
.toolbar-dropdown-button {
|
|
643
|
-
font-size: 12px;
|
|
644
|
-
|
|
645
|
-
.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item {
|
|
646
|
-
border-color: #28c76f;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item {
|
|
650
|
-
border-color: #28c76f;
|
|
651
|
-
|
|
652
|
-
.ui-rc-btn-icon {
|
|
653
|
-
color: #28c76f;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
.ui-rc-toolbar-bottom_border-bottom {
|
|
662
|
-
border-bottom: 1px solid #e0e0e0;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
.ui-rc-toolbar-bottom {
|
|
666
|
-
position: relative;
|
|
667
|
-
padding: .15rem 0.5rem;
|
|
668
|
-
background-color: #ffffff;
|
|
669
|
-
|
|
670
|
-
// &::before {
|
|
671
|
-
// content: "";
|
|
672
|
-
// position: absolute;
|
|
673
|
-
// border-left: 1px solid #e0e0e0;
|
|
674
|
-
// height: 100%;
|
|
675
|
-
// bottom: 0;
|
|
676
|
-
// left: 0;
|
|
677
|
-
// //z-index: -1;
|
|
678
|
-
// }
|
|
679
|
-
|
|
680
|
-
// &::after {
|
|
681
|
-
// content: "";
|
|
682
|
-
// position: absolute;
|
|
683
|
-
// border-left: 1px solid #e0e0e0;
|
|
684
|
-
// height: 100%;
|
|
685
|
-
// bottom: 0;
|
|
686
|
-
// visibility: visible;
|
|
687
|
-
// right: 0;
|
|
688
|
-
// //z-index: -1;
|
|
689
|
-
// }
|
|
690
|
-
|
|
691
|
-
.toolbar-button {
|
|
692
|
-
border-radius: 3px;
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
.ui-rc-btn {
|
|
699
|
-
border-radius: 3px;
|
|
700
|
-
height: 28px;
|
|
701
|
-
|
|
702
|
-
&.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item {
|
|
703
|
-
border-start-start-radius: 0;
|
|
704
|
-
border-end-start-radius: 0;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
&.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item {
|
|
708
|
-
border-start-end-radius: 0;
|
|
709
|
-
border-end-end-radius: 0;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
|
|
715
630
|
.spinner-loading {
|
|
716
631
|
position: absolute;
|
|
717
632
|
top: 0;
|
|
@@ -800,7 +715,7 @@ $cell-index-focus-bg-Dark: #E6EFFD !default;
|
|
|
800
715
|
// margin: 1rem auto;
|
|
801
716
|
// }
|
|
802
717
|
|
|
803
|
-
|
|
718
|
+
// ------------ expand icon -------------------- //
|
|
804
719
|
.ui-rc-table-row-expand {
|
|
805
720
|
color: inherit;
|
|
806
721
|
text-decoration: none;
|
|
@@ -887,7 +802,7 @@ $cell-index-focus-bg-Dark: #E6EFFD !default;
|
|
|
887
802
|
.ui-rc-table-row-expand-icon-collapsed::before {
|
|
888
803
|
transform: rotate(-180deg);
|
|
889
804
|
}
|
|
890
|
-
|
|
805
|
+
// ------------ expand icon end -------------------- //
|
|
891
806
|
|
|
892
807
|
.#{$prefix}-grid-filter-dropdown {
|
|
893
808
|
box-sizing: border-box;
|
|
@@ -170,13 +170,15 @@ const TableBodyCell = props => {
|
|
|
170
170
|
const [isOpenTooltip, setIsOpenTooltip] = React.useState(false);
|
|
171
171
|
const record = cell.row.original;
|
|
172
172
|
const columnMeta = cell.column.columnDef.meta ?? {};
|
|
173
|
-
const
|
|
173
|
+
const allRows = table.getRowModel().flatRows;
|
|
174
|
+
const rowNumber = allRows.findIndex(it => it.id === cell.row.id);
|
|
175
|
+
const cellStyles1 = typeof columnMeta.onCellStyles === 'function' ? columnMeta.onCellStyles(cell.getValue(), cell) : columnMeta.onCellStyles;
|
|
176
|
+
const cellStyles2 = typeof columnMeta.getCellProps === 'function' ? columnMeta.getCellProps(cell.getValue(), record, rowNumber).style : undefined;
|
|
177
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
174
178
|
const tooltipContent = isOpenTooltip === false ? '' : columnMeta?.tooltipDescription ? typeof columnMeta.tooltipDescription === 'function' ? columnMeta.tooltipDescription({
|
|
175
179
|
value: cell.getValue(),
|
|
176
180
|
rowData: record
|
|
177
181
|
}) : columnMeta.tooltipDescription : cell.getValue();
|
|
178
|
-
const allRows = table.getRowModel().flatRows;
|
|
179
|
-
const rowNumber = allRows.findIndex(it => it.id === cell.row.id);
|
|
180
182
|
const colIndex = cell.column.getIndex();
|
|
181
183
|
const isPinned = cell.column.getIsPinned();
|
|
182
184
|
const isLastLeftPinnedColumn = isPinned === "left" && cell.column.getIsLastColumn("left");
|
|
@@ -52,7 +52,11 @@ const TableHeadCell = props => {
|
|
|
52
52
|
React.useEffect(() => {
|
|
53
53
|
setSelectedKeys(filterValue);
|
|
54
54
|
}, []);
|
|
55
|
+
const cellStyles1 = typeof originalColumn.onCellHeaderStyles === 'function' ? originalColumn.onCellHeaderStyles(header) : originalColumn.onCellHeaderStyles;
|
|
56
|
+
const cellStyles2 = originalColumn?.headerCellProps?.style ?? undefined;
|
|
57
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
55
58
|
const style = {
|
|
59
|
+
...cellStyles,
|
|
56
60
|
transition: 'width transform 0.2s ease-in-out',
|
|
57
61
|
whiteSpace: 'nowrap',
|
|
58
62
|
borderTopWidth: rowIndex > 0 ? 0 : undefined
|
|
@@ -356,6 +356,8 @@ export type TableProps<RecordType = AnyObject> = {
|
|
|
356
356
|
locale?: Locale;
|
|
357
357
|
/** Cấu hình wrap text */
|
|
358
358
|
wrapSettings?: IWrapSettings;
|
|
359
|
+
/** Hiển thị grid line */
|
|
360
|
+
gridLines?: "Both" | "Horizontal" | "Vertical" | "None";
|
|
359
361
|
/** Bật chế độ tải dữ liệu vô hạn */
|
|
360
362
|
infiniteScroll?: boolean;
|
|
361
363
|
/** Hàm gọi khi cuộn đến cuối */
|
|
@@ -194,10 +194,10 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
|
|
|
194
194
|
value: any;
|
|
195
195
|
rowData: RecordType;
|
|
196
196
|
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
|
|
197
|
-
onCellStyles?: Omit<CSSProperties, "width" | "minWidth" | "
|
|
198
|
-
onCellHeaderStyles?: Omit<CSSProperties, "width" | "minWidth" | "
|
|
197
|
+
onCellStyles?: Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display">);
|
|
198
|
+
onCellHeaderStyles?: Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display">);
|
|
199
199
|
onCell?: (rowData: RecordType, index: number) => import("react").TdHTMLAttributes<HTMLTableCellElement>;
|
|
200
|
-
onCellFooterStyles?: Omit<CSSProperties, "width" | "minWidth" | "
|
|
200
|
+
onCellFooterStyles?: Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display">);
|
|
201
201
|
getValue?: (row: any, rowIndex: number) => any;
|
|
202
202
|
getCellProps?: (value: any, row: any, rowIndex: number) => import("./../../grid-component/type").CellProps;
|
|
203
203
|
headerCellProps?: import("./../../grid-component/type").CellProps;
|
|
@@ -251,7 +251,7 @@ const TableContainer = props => {
|
|
|
251
251
|
flex: 1,
|
|
252
252
|
overflow: 'hidden'
|
|
253
253
|
}
|
|
254
|
-
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
254
|
+
}, toolbarItemTop && toolbarItemTop?.length > 0 && /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
255
255
|
items: toolbarItemTop ?? []
|
|
256
256
|
// mode={'scroll'}
|
|
257
257
|
,
|
|
@@ -271,7 +271,7 @@ const TableContainer = props => {
|
|
|
271
271
|
showTotal: (totalItems, range) =>
|
|
272
272
|
// @ts-ignore
|
|
273
273
|
`${range[0]}-${range[1]} / ${totalItems} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
|
|
274
|
-
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/_react.default.createElement("div", {
|
|
274
|
+
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && toolbarItemTopRight.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
275
275
|
style: {
|
|
276
276
|
flex: 1,
|
|
277
277
|
overflow: 'hidden'
|
|
@@ -374,7 +374,7 @@ const TableContainer = props => {
|
|
|
374
374
|
fixedRightColumns: fixedRightColumns
|
|
375
375
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
376
376
|
ref: bottomToolbarRef
|
|
377
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
377
|
+
}, toolbarItemBottom && toolbarItemBottom.length > 0 && false && /*#__PURE__*/_react.default.createElement("div", {
|
|
378
378
|
style: {
|
|
379
379
|
flex: 1,
|
|
380
380
|
overflow: 'hidden'
|
|
@@ -2047,7 +2047,7 @@ const TableContainerEdit = props => {
|
|
|
2047
2047
|
flex: 1,
|
|
2048
2048
|
overflow: 'hidden'
|
|
2049
2049
|
}
|
|
2050
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
2050
|
+
}, toolbarItemsTop && toolbarItemsTop.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
2051
2051
|
className: (0, _classnames.default)('ui-rc-toolbar-bottom border-0', {
|
|
2052
2052
|
'ui-rc-toolbar-bottom_border-bottom': !pagination || infiniteScroll
|
|
2053
2053
|
})
|
|
@@ -316,13 +316,13 @@ const EditableCell = props => {
|
|
|
316
316
|
|
|
317
317
|
// chỉ nhận giá trị dạng HH:mm | mm:HH => convert
|
|
318
318
|
|
|
319
|
-
let time = value ??
|
|
319
|
+
let time = value ?? undefined;
|
|
320
320
|
const typeTime = (0, _utils.getDateValueType)(value);
|
|
321
321
|
if (typeTime === 'time') {
|
|
322
|
-
time = value ? (0, _dayjs.default)(value, timeFormat) :
|
|
322
|
+
time = value ? (0, _dayjs.default)(value, timeFormat) : undefined;
|
|
323
323
|
} else {
|
|
324
|
-
const abc = (0, _moment.default)(value).format(timeFormat);
|
|
325
|
-
time = abc ? (0, _dayjs.default)(abc, timeFormat) :
|
|
324
|
+
const abc = value ? (0, _moment.default)(value).format(timeFormat) : undefined;
|
|
325
|
+
time = abc ? (0, _dayjs.default)(abc, timeFormat) : undefined;
|
|
326
326
|
}
|
|
327
327
|
const maxTimeValue = !(0, _utils.isEmpty)(column.maxTime) ? (0, _dayjs.default)(column.maxTime).format(timeFormat) : null;
|
|
328
328
|
const minTimeValue = !(0, _utils.isEmpty)(column.minTime) ? (0, _dayjs.default)(column.minTime).format(timeFormat) : null;
|
|
@@ -359,7 +359,7 @@ const EditableCell = props => {
|
|
|
359
359
|
} else {
|
|
360
360
|
// const datetime = dayjs(dateString as string, timeFormat, true);
|
|
361
361
|
|
|
362
|
-
const newVal = (0, _moment.default)(newDate.toDate()).format();
|
|
362
|
+
const newVal = newDate ? (0, _moment.default)(newDate.toDate()).format() : undefined;
|
|
363
363
|
|
|
364
364
|
// const newVal = datetime.isValid() ? moment(datetime.toDate()).format() : ''
|
|
365
365
|
onChange(newVal);
|
|
@@ -381,7 +381,7 @@ const EditableCell = props => {
|
|
|
381
381
|
newValue = newState;
|
|
382
382
|
} else {
|
|
383
383
|
const datetime = (0, _dayjs.default)(newState, timeFormat, true);
|
|
384
|
-
const newVal = datetime.isValid() ? (0, _moment.default)(datetime.toDate()).format() :
|
|
384
|
+
const newVal = datetime.isValid() ? (0, _moment.default)(datetime.toDate()).format() : undefined;
|
|
385
385
|
onChange(newVal);
|
|
386
386
|
newValue = newVal;
|
|
387
387
|
}
|
|
@@ -189,8 +189,12 @@ const TableBodyCell = props => {
|
|
|
189
189
|
const expandIconColumnIndex = expandable?.expandIconColumnIndex ?? 0;
|
|
190
190
|
const [isOpenTooltip, setIsOpenTooltip] = _react.default.useState(false);
|
|
191
191
|
const record = cell.row.original;
|
|
192
|
+
const allRows = table.getRowModel().flatRows;
|
|
193
|
+
const rowNumber = allRows.findIndex(it => it.id === cell.row.id);
|
|
192
194
|
const columnMeta = _react.default.useMemo(() => cell.column.columnDef.meta ?? {}, [cell.column.columnDef.meta]);
|
|
193
|
-
const
|
|
195
|
+
const cellStyles1 = typeof columnMeta.onCellStyles === 'function' ? columnMeta.onCellStyles(cell.getValue(), cell) : columnMeta.onCellStyles;
|
|
196
|
+
const cellStyles2 = typeof columnMeta.getCellProps === 'function' ? columnMeta.getCellProps(cell.getValue(), record, rowNumber).style : undefined;
|
|
197
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
194
198
|
|
|
195
199
|
// const tooltipContent: any = (isOpenTooltip === false)
|
|
196
200
|
// ? ''
|
|
@@ -198,8 +202,6 @@ const TableBodyCell = props => {
|
|
|
198
202
|
// ? (typeof columnMeta.tooltipDescription === 'function' ? columnMeta.tooltipDescription({ value: cell.getValue(), rowData: record }) : columnMeta.tooltipDescription)
|
|
199
203
|
// : cell.getValue()
|
|
200
204
|
|
|
201
|
-
const allRows = table.getRowModel().flatRows;
|
|
202
|
-
const rowNumber = allRows.findIndex(it => it.id === cell.row.id);
|
|
203
205
|
const colIndex = cell.column.getIndex();
|
|
204
206
|
const isPinned = cell.column.getIsPinned();
|
|
205
207
|
const isLastLeftPinnedColumn = isPinned === "left" && cell.column.getIsLastColumn("left");
|
|
@@ -66,7 +66,9 @@ const TableHeadCell2 = props => {
|
|
|
66
66
|
const originalColumn = column.columnDef.meta ?? {};
|
|
67
67
|
const fieldOriginalKey = originalColumn?.fieldOriginal;
|
|
68
68
|
const fieldOriginal = fieldOriginalKey ? visibleCols.find(it => it.id === fieldOriginalKey) : undefined;
|
|
69
|
-
const
|
|
69
|
+
const cellStyles1 = typeof originalColumn.onCellHeaderStyles === 'function' ? originalColumn.onCellHeaderStyles(header) : originalColumn.onCellHeaderStyles;
|
|
70
|
+
const cellStyles2 = originalColumn?.headerCellProps?.style ?? undefined;
|
|
71
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
70
72
|
const filtered = ((fieldOriginal ? fieldOriginal.getFilterValue() : column.getFilterValue()) ?? []).length > 0;
|
|
71
73
|
|
|
72
74
|
// const cellContent = originalColumn.headerTemplate ? originalColumn.headerTemplate : (t ? t(originalColumn.headerText) : originalColumn.headerText)
|
|
@@ -33,7 +33,9 @@ const TableHeadGroupCell = props => {
|
|
|
33
33
|
const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
|
|
34
34
|
const isFirstRightPinnedColumn = isPinned === 'right' && column.getIsFirstColumn('right');
|
|
35
35
|
const originalColumn = column.columnDef.meta ?? {};
|
|
36
|
-
const
|
|
36
|
+
const cellStyles1 = typeof originalColumn.onCellHeaderStyles === 'function' ? originalColumn.onCellHeaderStyles(header) : originalColumn.onCellHeaderStyles;
|
|
37
|
+
const cellStyles2 = originalColumn?.headerCellProps?.style ?? undefined;
|
|
38
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
37
39
|
|
|
38
40
|
// const cellContent = originalColumn.headerTemplate ? originalColumn.headerTemplate : (t ? t(originalColumn.headerText) : originalColumn.headerText)
|
|
39
41
|
|
|
@@ -55,4 +55,4 @@ const colorDark = '#e6e4f3e6 ';
|
|
|
55
55
|
const GridStyle = exports.GridStyle = _styledComponents.default.div.withConfig({
|
|
56
56
|
displayName: "GridStyle",
|
|
57
57
|
componentId: "es-grid-template__sc-hdqm5k-0"
|
|
58
|
-
})(["&.", "-grid{color:", ";font-size:", ";background-color:", ";font-family:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:'';pointer-events:none;}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{justify-content:flex-end;text-align:right;}&.", "-grid-cell-ellipsis{.ui-rc_cell-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;&.select-cell{padding-right:18px;position:relative;}.caret-down{float:right;position:absolute;right:0;&::before{content:'';display:inline-block;margin-left:4px;vertical-align:middle;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #6f7777;}}}}&.", "-grid-cell-wrap{white-space:normal;text-overflow:ellipsis;word-break:break-word;}.", "-grid-header-text-wrap{white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}}.", "-grid-thead{background-color:", ";font-weight:", ";.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{font-weight:", ";background-color:", ";color:", ";&.", "-grid-row-odd{background-color:#f9f8fd;}&.", "-grid-row-even{}&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, fontSize, BgColor, fontFamily, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, fwHeader, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwBody, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
58
|
+
})(["&.", "-grid{color:", ";font-size:", ";background-color:", ";font-family:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:'';pointer-events:none;}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{justify-content:flex-end;text-align:right;}&.", "-grid-cell-ellipsis{.ui-rc_cell-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;&.select-cell{padding-right:18px;position:relative;}.caret-down{float:right;position:absolute;right:0;&::before{content:'';display:inline-block;margin-left:4px;vertical-align:middle;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #6f7777;}}}}&.", "-grid-cell-wrap{white-space:normal;text-overflow:ellipsis;word-break:break-word;}.", "-grid-header-text-wrap{white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}}.", "-grid-thead{background-color:", ";font-weight:", ";.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{font-weight:", ";background-color:", ";color:", ";&.", "-grid-row-odd{background-color:#f9f8fd;}&.", "-grid-row-even{}&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}.ui-rc-toolbar-bottom{border-right:1px solid #e0e0e0;border-left:1px solid #e0e0e0;.be-toolbar-item{.ui-rc-btn{font-size:12px;}.toolbar-dropdown-button{font-size:12px;.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-color:#28c76f;}.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-color:#28c76f;.ui-rc-btn-icon{color:#28c76f;}}}}}.ui-rc-toolbar-bottom_border-bottom{border-bottom:1px solid #e0e0e0;}.ui-rc-toolbar-bottom{position:relative;padding:.15rem 0.5rem;background-color:#ffffff;.toolbar-button{border-radius:3px;}.ui-rc-btn{border-radius:3px;height:28px;&.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-start-start-radius:0;border-end-start-radius:0;}&.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-start-end-radius:0;border-end-end-radius:0;}}}}"], props => props.$prefix, color, fontSize, BgColor, fontFamily, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, fwHeader, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwBody, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
@@ -627,91 +627,6 @@ $cell-index-focus-bg-Dark: #E6EFFD !default;
|
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
|
|
630
|
-
|
|
631
|
-
// bottom toolbar
|
|
632
|
-
.ui-rc-toolbar-bottom {
|
|
633
|
-
// border-bottom: 1px solid #e0e0e0;
|
|
634
|
-
border-right: 1px solid #e0e0e0;
|
|
635
|
-
border-left: 1px solid #e0e0e0;
|
|
636
|
-
|
|
637
|
-
.be-toolbar-item {
|
|
638
|
-
.ui-rc-btn {
|
|
639
|
-
font-size: 12px;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
.toolbar-dropdown-button {
|
|
643
|
-
font-size: 12px;
|
|
644
|
-
|
|
645
|
-
.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item {
|
|
646
|
-
border-color: #28c76f;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item {
|
|
650
|
-
border-color: #28c76f;
|
|
651
|
-
|
|
652
|
-
.ui-rc-btn-icon {
|
|
653
|
-
color: #28c76f;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
.ui-rc-toolbar-bottom_border-bottom {
|
|
662
|
-
border-bottom: 1px solid #e0e0e0;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
.ui-rc-toolbar-bottom {
|
|
666
|
-
position: relative;
|
|
667
|
-
padding: .15rem 0.5rem;
|
|
668
|
-
background-color: #ffffff;
|
|
669
|
-
|
|
670
|
-
// &::before {
|
|
671
|
-
// content: "";
|
|
672
|
-
// position: absolute;
|
|
673
|
-
// border-left: 1px solid #e0e0e0;
|
|
674
|
-
// height: 100%;
|
|
675
|
-
// bottom: 0;
|
|
676
|
-
// left: 0;
|
|
677
|
-
// //z-index: -1;
|
|
678
|
-
// }
|
|
679
|
-
|
|
680
|
-
// &::after {
|
|
681
|
-
// content: "";
|
|
682
|
-
// position: absolute;
|
|
683
|
-
// border-left: 1px solid #e0e0e0;
|
|
684
|
-
// height: 100%;
|
|
685
|
-
// bottom: 0;
|
|
686
|
-
// visibility: visible;
|
|
687
|
-
// right: 0;
|
|
688
|
-
// //z-index: -1;
|
|
689
|
-
// }
|
|
690
|
-
|
|
691
|
-
.toolbar-button {
|
|
692
|
-
border-radius: 3px;
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
.ui-rc-btn {
|
|
699
|
-
border-radius: 3px;
|
|
700
|
-
height: 28px;
|
|
701
|
-
|
|
702
|
-
&.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item {
|
|
703
|
-
border-start-start-radius: 0;
|
|
704
|
-
border-end-start-radius: 0;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
&.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item {
|
|
708
|
-
border-start-end-radius: 0;
|
|
709
|
-
border-end-end-radius: 0;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
|
|
715
630
|
.spinner-loading {
|
|
716
631
|
position: absolute;
|
|
717
632
|
top: 0;
|
|
@@ -800,7 +715,7 @@ $cell-index-focus-bg-Dark: #E6EFFD !default;
|
|
|
800
715
|
// margin: 1rem auto;
|
|
801
716
|
// }
|
|
802
717
|
|
|
803
|
-
|
|
718
|
+
// ------------ expand icon -------------------- //
|
|
804
719
|
.ui-rc-table-row-expand {
|
|
805
720
|
color: inherit;
|
|
806
721
|
text-decoration: none;
|
|
@@ -887,7 +802,7 @@ $cell-index-focus-bg-Dark: #E6EFFD !default;
|
|
|
887
802
|
.ui-rc-table-row-expand-icon-collapsed::before {
|
|
888
803
|
transform: rotate(-180deg);
|
|
889
804
|
}
|
|
890
|
-
|
|
805
|
+
// ------------ expand icon end -------------------- //
|
|
891
806
|
|
|
892
807
|
.#{$prefix}-grid-filter-dropdown {
|
|
893
808
|
box-sizing: border-box;
|
|
@@ -177,13 +177,15 @@ const TableBodyCell = props => {
|
|
|
177
177
|
const [isOpenTooltip, setIsOpenTooltip] = _react.default.useState(false);
|
|
178
178
|
const record = cell.row.original;
|
|
179
179
|
const columnMeta = cell.column.columnDef.meta ?? {};
|
|
180
|
-
const
|
|
180
|
+
const allRows = table.getRowModel().flatRows;
|
|
181
|
+
const rowNumber = allRows.findIndex(it => it.id === cell.row.id);
|
|
182
|
+
const cellStyles1 = typeof columnMeta.onCellStyles === 'function' ? columnMeta.onCellStyles(cell.getValue(), cell) : columnMeta.onCellStyles;
|
|
183
|
+
const cellStyles2 = typeof columnMeta.getCellProps === 'function' ? columnMeta.getCellProps(cell.getValue(), record, rowNumber).style : undefined;
|
|
184
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
181
185
|
const tooltipContent = isOpenTooltip === false ? '' : columnMeta?.tooltipDescription ? typeof columnMeta.tooltipDescription === 'function' ? columnMeta.tooltipDescription({
|
|
182
186
|
value: cell.getValue(),
|
|
183
187
|
rowData: record
|
|
184
188
|
}) : columnMeta.tooltipDescription : cell.getValue();
|
|
185
|
-
const allRows = table.getRowModel().flatRows;
|
|
186
|
-
const rowNumber = allRows.findIndex(it => it.id === cell.row.id);
|
|
187
189
|
const colIndex = cell.column.getIndex();
|
|
188
190
|
const isPinned = cell.column.getIsPinned();
|
|
189
191
|
const isLastLeftPinnedColumn = isPinned === "left" && cell.column.getIsLastColumn("left");
|
|
@@ -61,7 +61,11 @@ const TableHeadCell = props => {
|
|
|
61
61
|
_react.default.useEffect(() => {
|
|
62
62
|
setSelectedKeys(filterValue);
|
|
63
63
|
}, []);
|
|
64
|
+
const cellStyles1 = typeof originalColumn.onCellHeaderStyles === 'function' ? originalColumn.onCellHeaderStyles(header) : originalColumn.onCellHeaderStyles;
|
|
65
|
+
const cellStyles2 = originalColumn?.headerCellProps?.style ?? undefined;
|
|
66
|
+
const cellStyles = cellStyles2 ?? cellStyles1;
|
|
64
67
|
const style = {
|
|
68
|
+
...cellStyles,
|
|
65
69
|
transition: 'width transform 0.2s ease-in-out',
|
|
66
70
|
whiteSpace: 'nowrap',
|
|
67
71
|
borderTopWidth: rowIndex > 0 ? 0 : undefined
|