react-table-edit 1.5.32 → 1.5.34
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/dist/component/table/header.d.ts +1 -1
- package/dist/component/table-view/content.d.ts +2 -1
- package/dist/component/table-view/index.d.ts +1 -3
- package/dist/component/type/index.d.ts +4 -0
- package/dist/component/utils.d.ts +1 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +91 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +91 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import 'react-resizable/css/styles.css';
|
|
|
3
3
|
import { IFFilterTable, IFOrderTable, IFTableEditFormat, IHeaderColumnTable } from '../type';
|
|
4
4
|
type IFDataProps = {
|
|
5
5
|
idTable: string;
|
|
6
|
-
selectEnable
|
|
6
|
+
selectEnable?: boolean;
|
|
7
7
|
dataSource: any[];
|
|
8
8
|
setSelectedRows: Dispatch<SetStateAction<any[]>>;
|
|
9
9
|
col: IHeaderColumnTable;
|
|
@@ -12,11 +12,12 @@ type IContentColProps = {
|
|
|
12
12
|
objWidthFixRight: any;
|
|
13
13
|
lastObjWidthFixLeft: number;
|
|
14
14
|
fisrtObjWidthFixRight: number;
|
|
15
|
-
selectEnable?: boolean;
|
|
16
15
|
isMulti?: boolean;
|
|
17
16
|
fieldKey: string;
|
|
18
17
|
zeroVisiable?: boolean;
|
|
19
18
|
setSelectedRows: (value: any[]) => void;
|
|
19
|
+
handleCloseContext: () => void;
|
|
20
|
+
handleDoubleClick?: (row: any, col: IColumnTable) => void;
|
|
20
21
|
};
|
|
21
22
|
export declare const RenderContentCol: (props: IContentColProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
export {};
|
|
@@ -5,8 +5,6 @@ type TableViewProps = {
|
|
|
5
5
|
dataSource: any[];
|
|
6
6
|
height?: number;
|
|
7
7
|
columns: IColumnTable[];
|
|
8
|
-
selectEnable?: boolean;
|
|
9
|
-
isMutil?: boolean;
|
|
10
8
|
isLoading?: boolean;
|
|
11
9
|
formatSetting?: IFTableEditFormat;
|
|
12
10
|
pagingSetting?: IFTableEditPaging;
|
|
@@ -39,7 +37,7 @@ type TableViewProps = {
|
|
|
39
37
|
resetDefaultColumns?: () => void;
|
|
40
38
|
saveSettingColumn?: (data: IFSettingColumns[]) => void;
|
|
41
39
|
setSelectedItem?: Dispatch<SetStateAction<any>>;
|
|
42
|
-
handleDoubleClick?: (
|
|
40
|
+
handleDoubleClick?: (row: any, col: IColumnTable) => void;
|
|
43
41
|
contextMenuItems?: IContextItem[];
|
|
44
42
|
handleContextMenuClick?: (context: IContextItem, data: any) => void;
|
|
45
43
|
isMulti?: boolean;
|
|
@@ -224,6 +224,8 @@ export type IColumnTable = {
|
|
|
224
224
|
onPaste?: (dataRow: any, dataPaste: any) => void;
|
|
225
225
|
/** Xác thực dữ liệu được paste */
|
|
226
226
|
onPasteValidate?: (dataPaste: string, dataRow: any, rowIndex: number) => Promise<any>;
|
|
227
|
+
/** Chỉ dùng cho bảng view */
|
|
228
|
+
onClick?: (dataRow: any, rowIndex: number) => void;
|
|
227
229
|
/**Không có tác dụng */
|
|
228
230
|
rowspan?: number;
|
|
229
231
|
};
|
|
@@ -267,6 +269,8 @@ export type IFTableEditToolbar = {
|
|
|
267
269
|
toolbarBottomOptions?: IFToolbarOptions[];
|
|
268
270
|
/** Hiển thị thanh công cụ dưới */
|
|
269
271
|
showBottomToolbar?: boolean;
|
|
272
|
+
/** Hiển thị nút cài đặt cột */
|
|
273
|
+
hiddenSetting?: boolean;
|
|
270
274
|
};
|
|
271
275
|
/** Cấu hình tìm kiếm trong bảng */
|
|
272
276
|
export type IFTableEditSearchSetting = {
|
|
@@ -56,3 +56,4 @@ export declare const calculateTableStructure: (columns: any[], settingColumns?:
|
|
|
56
56
|
*/
|
|
57
57
|
export declare const CheckRowMatch: (row: Record<string, any>, filters: IFFilterTable[], keyword: string, searchKeys: string[]) => boolean;
|
|
58
58
|
export declare const getMaxExpandedLevel: (items: any[], fieldChildren?: string, level?: number) => number;
|
|
59
|
+
export declare const findItemInTree: (items: any[], filter: string, keyFilter?: string, keyChildren?: string) => any;
|
package/dist/index.d.ts
CHANGED
|
@@ -228,6 +228,8 @@ type IColumnTable = {
|
|
|
228
228
|
onPaste?: (dataRow: any, dataPaste: any) => void;
|
|
229
229
|
/** Xác thực dữ liệu được paste */
|
|
230
230
|
onPasteValidate?: (dataPaste: string, dataRow: any, rowIndex: number) => Promise<any>;
|
|
231
|
+
/** Chỉ dùng cho bảng view */
|
|
232
|
+
onClick?: (dataRow: any, rowIndex: number) => void;
|
|
231
233
|
/**Không có tác dụng */
|
|
232
234
|
rowspan?: number;
|
|
233
235
|
};
|
|
@@ -271,6 +273,8 @@ type IFTableEditToolbar = {
|
|
|
271
273
|
toolbarBottomOptions?: IFToolbarOptions[];
|
|
272
274
|
/** Hiển thị thanh công cụ dưới */
|
|
273
275
|
showBottomToolbar?: boolean;
|
|
276
|
+
/** Hiển thị nút cài đặt cột */
|
|
277
|
+
hiddenSetting?: boolean;
|
|
274
278
|
};
|
|
275
279
|
/** Cấu hình tìm kiếm trong bảng */
|
|
276
280
|
type IFTableEditSearchSetting = {
|
|
@@ -703,8 +707,6 @@ type TableViewProps = {
|
|
|
703
707
|
dataSource: any[];
|
|
704
708
|
height?: number;
|
|
705
709
|
columns: IColumnTable[];
|
|
706
|
-
selectEnable?: boolean;
|
|
707
|
-
isMutil?: boolean;
|
|
708
710
|
isLoading?: boolean;
|
|
709
711
|
formatSetting?: IFTableEditFormat;
|
|
710
712
|
pagingSetting?: IFTableEditPaging;
|
|
@@ -737,7 +739,7 @@ type TableViewProps = {
|
|
|
737
739
|
resetDefaultColumns?: () => void;
|
|
738
740
|
saveSettingColumn?: (data: IFSettingColumns[]) => void;
|
|
739
741
|
setSelectedItem?: Dispatch<SetStateAction<any>>;
|
|
740
|
-
handleDoubleClick?: (
|
|
742
|
+
handleDoubleClick?: (row: any, col: IColumnTable) => void;
|
|
741
743
|
contextMenuItems?: IContextItem[];
|
|
742
744
|
handleContextMenuClick?: (context: IContextItem, data: any) => void;
|
|
743
745
|
isMulti?: boolean;
|
|
@@ -802,6 +804,7 @@ declare const calculateTableStructure: (columns: any[], settingColumns?: IFSetti
|
|
|
802
804
|
*/
|
|
803
805
|
declare const CheckRowMatch: (row: Record<string, any>, filters: IFFilterTable[], keyword: string, searchKeys: string[]) => boolean;
|
|
804
806
|
declare const getMaxExpandedLevel: (items: any[], fieldChildren?: string, level?: number) => number;
|
|
807
|
+
declare const findItemInTree: (items: any[], filter: string, keyFilter?: string, keyChildren?: string) => any;
|
|
805
808
|
|
|
806
809
|
type IFSteps = {
|
|
807
810
|
id: string;
|
|
@@ -829,5 +832,5 @@ type IFProps = {
|
|
|
829
832
|
};
|
|
830
833
|
declare const Wizard: React.ForwardRefExoticComponent<IFProps & React.RefAttributes<unknown>>;
|
|
831
834
|
|
|
832
|
-
export { CheckRowMatch, ExportExcelComponent, FindNodeByPath, InputStyleComponent, ModalImportComponent, SelectTable, SelectTableTree, TableView, TabsMenuComponent, Wizard, calculateTableStructure, checkDecimalSeparator, checkThousandSeparator, TableEdit as default, formartNumberic, formatDateTime, generateUUID, getMaxExpandedLevel, isNullOrUndefined, messageBoxConfirm, messageBoxConfirmAsync, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxConfirmAsync, messageHtmlBoxError, notificationError, notificationSuccess, roundNumber, useOnClickOutside };
|
|
835
|
+
export { CheckRowMatch, ExportExcelComponent, FindNodeByPath, InputStyleComponent, ModalImportComponent, SelectTable, SelectTableTree, TableView, TabsMenuComponent, Wizard, calculateTableStructure, checkDecimalSeparator, checkThousandSeparator, TableEdit as default, findItemInTree, formartNumberic, formatDateTime, generateUUID, getMaxExpandedLevel, isNullOrUndefined, messageBoxConfirm, messageBoxConfirmAsync, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxConfirmAsync, messageHtmlBoxError, notificationError, notificationSuccess, roundNumber, useOnClickOutside };
|
|
833
836
|
export type { FromItemsField, ICellInfo, IColumnTable, IColumnType, IColumnsAgg, ICommandItem, IContextItem, IFColumnSelectTable, IFColumnSelectTableTree, IFCurrentPage, IFCurrentPageConfig, IFFilterTable, IFOrderTable, IFPageSize, IFSettingColumns, IFTableEditButton, IFTableEditFormat, IFTableEditPaging, IFTableEditSearchSetting, IFTableEditToolbar, IFTableSelectFormat, IFTableTreeSelectFormat, IFToolbarOptions, IFilterType, IHeaderColumnTable, ISettingFormElement, ISettingNumericElement, ISettingSelectElement };
|
package/dist/index.js
CHANGED
|
@@ -19813,10 +19813,7 @@ const isNullOrUndefined$1 = (d) => {
|
|
|
19813
19813
|
const generateUUID = () => {
|
|
19814
19814
|
// Public Domain/MIT
|
|
19815
19815
|
let d = new Date().getTime(); //Timestamp
|
|
19816
|
-
let d2 = (typeof performance !== 'undefined' &&
|
|
19817
|
-
performance.now &&
|
|
19818
|
-
performance.now() * 1000) ||
|
|
19819
|
-
0; //Time in microseconds since page-load or 0 if unsupported
|
|
19816
|
+
let d2 = (typeof performance !== 'undefined' && performance.now && performance.now() * 1000) || 0; //Time in microseconds since page-load or 0 if unsupported
|
|
19820
19817
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
19821
19818
|
let r = Math.random() * 16; //random number between 0 and 16
|
|
19822
19819
|
if (d > 0) {
|
|
@@ -19841,23 +19838,19 @@ const generateUUID = () => {
|
|
|
19841
19838
|
* @param isDone đã nhập xong
|
|
19842
19839
|
* @returns
|
|
19843
19840
|
*/
|
|
19844
|
-
const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction =
|
|
19841
|
+
const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2, isDone, haveNegative = true) => {
|
|
19845
19842
|
if (isDone) {
|
|
19846
19843
|
str = roundNumber(Number(str), fraction);
|
|
19847
19844
|
}
|
|
19848
19845
|
// eslint-disable-next-line
|
|
19849
19846
|
if (str || str == '0') {
|
|
19850
19847
|
str = str.toString();
|
|
19851
|
-
const value = decimalSeparator !== '.'
|
|
19852
|
-
? str.toString().replaceAll('.', decimalSeparator ?? '')
|
|
19853
|
-
: str;
|
|
19848
|
+
const value = decimalSeparator !== '.' ? str.toString().replaceAll('.', decimalSeparator ?? '') : str;
|
|
19854
19849
|
const arr = value.toString().split(decimalSeparator ?? '', 2);
|
|
19855
19850
|
let flag = value.toString().includes(decimalSeparator ?? '');
|
|
19856
19851
|
if (arr[0].length < 3) {
|
|
19857
19852
|
const intergerArr = haveNegative ? arr[0] : arr[0].replace('-', '');
|
|
19858
|
-
return flag
|
|
19859
|
-
? `${intergerArr}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19860
|
-
: intergerArr;
|
|
19853
|
+
return flag ? `${intergerArr}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}` : intergerArr;
|
|
19861
19854
|
}
|
|
19862
19855
|
else {
|
|
19863
19856
|
let flagNegative = false;
|
|
@@ -19881,9 +19874,7 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10
|
|
|
19881
19874
|
if (flagNegative && haveNegative) {
|
|
19882
19875
|
arr[0] = '-'.concat(arr[0]);
|
|
19883
19876
|
}
|
|
19884
|
-
return flag
|
|
19885
|
-
? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19886
|
-
: arr[0];
|
|
19877
|
+
return flag ? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}` : arr[0];
|
|
19887
19878
|
}
|
|
19888
19879
|
}
|
|
19889
19880
|
else {
|
|
@@ -19906,7 +19897,7 @@ const formatDateTime = (data, format = 'dd/MM/yyyy') => {
|
|
|
19906
19897
|
MM: String(date.getMonth() + 1).padStart(2, '0'),
|
|
19907
19898
|
yyyy: date.getFullYear(),
|
|
19908
19899
|
HH: String(date.getHours()).padStart(2, '0'),
|
|
19909
|
-
mm: String(date.getMinutes()).padStart(2, '0')
|
|
19900
|
+
mm: String(date.getMinutes()).padStart(2, '0')
|
|
19910
19901
|
};
|
|
19911
19902
|
return format.replace(/dd|DD|MM|yyyy|HH|mm/g, (match) => map[match]);
|
|
19912
19903
|
};
|
|
@@ -19927,7 +19918,7 @@ const FindNodeByPath = (tree, path) => {
|
|
|
19927
19918
|
parent: current,
|
|
19928
19919
|
lastIndex: levels.at(-1),
|
|
19929
19920
|
firstIndex: levels.length === 1 ? levels[0] : -1,
|
|
19930
|
-
node
|
|
19921
|
+
node
|
|
19931
19922
|
};
|
|
19932
19923
|
};
|
|
19933
19924
|
/**
|
|
@@ -19955,7 +19946,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19955
19946
|
const objHeaderWidthFixLeft = {};
|
|
19956
19947
|
let maxDepth = 0;
|
|
19957
19948
|
// Tính depth tối đa
|
|
19958
|
-
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) => col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth));
|
|
19949
|
+
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) => (col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth)));
|
|
19959
19950
|
maxDepth = calculateDepth(columns);
|
|
19960
19951
|
let leftTotal = 0;
|
|
19961
19952
|
let rightTotal = 0;
|
|
@@ -19992,8 +19983,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19992
19983
|
cell.numericSettings = { fraction: setting.fraction };
|
|
19993
19984
|
}
|
|
19994
19985
|
}
|
|
19995
|
-
cell.headerDisplay =
|
|
19996
|
-
setting.headerText || (cell.headerDisplay ?? cell.headerText);
|
|
19986
|
+
cell.headerDisplay = setting.headerText || (cell.headerDisplay ?? cell.headerText);
|
|
19997
19987
|
}
|
|
19998
19988
|
else {
|
|
19999
19989
|
if (cell.columns?.length) {
|
|
@@ -20029,13 +20019,11 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20029
20019
|
...col,
|
|
20030
20020
|
columns: col.columns ?? [],
|
|
20031
20021
|
colspan,
|
|
20032
|
-
rowspan: hasChildren ? 1 : maxDepth - level
|
|
20022
|
+
rowspan: hasChildren ? 1 : maxDepth - level
|
|
20033
20023
|
};
|
|
20034
20024
|
levels[level].push(cell);
|
|
20035
20025
|
const headerKey = `${level}-${indexCol}`;
|
|
20036
|
-
if (cell.fixedType === 'left' &&
|
|
20037
|
-
cell.visible !== false &&
|
|
20038
|
-
cell.isGroup !== true) {
|
|
20026
|
+
if (cell.fixedType === 'left' && cell.visible !== false && cell.isGroup !== true) {
|
|
20039
20027
|
objHeaderWidthFixLeft[headerKey] = leftTotal;
|
|
20040
20028
|
}
|
|
20041
20029
|
if (!hasChildren) {
|
|
@@ -20043,22 +20031,16 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20043
20031
|
const width = cell.width ?? 40;
|
|
20044
20032
|
cell.index = index;
|
|
20045
20033
|
flat.push(cell);
|
|
20046
|
-
if (cell.fixedType === 'left' &&
|
|
20047
|
-
cell.visible !== false &&
|
|
20048
|
-
cell.isGroup !== true) {
|
|
20034
|
+
if (cell.fixedType === 'left' && cell.visible !== false && cell.isGroup !== true) {
|
|
20049
20035
|
objWidthFixLeft[index] = leftTotal;
|
|
20050
20036
|
leftTotal += width;
|
|
20051
20037
|
}
|
|
20052
|
-
if (cell.fixedType === 'right' &&
|
|
20053
|
-
cell.visible !== false &&
|
|
20054
|
-
cell.isGroup !== true) {
|
|
20038
|
+
if (cell.fixedType === 'right' && cell.visible !== false && cell.isGroup !== true) {
|
|
20055
20039
|
rightTotal -= width;
|
|
20056
20040
|
objWidthFixRight[index] = rightTotal;
|
|
20057
20041
|
}
|
|
20058
20042
|
}
|
|
20059
|
-
if (cell.fixedType === 'right' &&
|
|
20060
|
-
cell.visible !== false &&
|
|
20061
|
-
cell.isGroup !== true) {
|
|
20043
|
+
if (cell.fixedType === 'right' && cell.visible !== false && cell.isGroup !== true) {
|
|
20062
20044
|
objHeaderWidthFixRight[headerKey] = rightTotal;
|
|
20063
20045
|
}
|
|
20064
20046
|
return colspanSum + colspan;
|
|
@@ -20071,20 +20053,13 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20071
20053
|
traverse(columns);
|
|
20072
20054
|
// Danh sách các cột được hiển thị
|
|
20073
20055
|
// const flatVisble = flat.filter((e) => e.visible !== false)
|
|
20074
|
-
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20075
|
-
x.field !== 'command' &&
|
|
20076
|
-
x.field !== '#' &&
|
|
20077
|
-
x.field !== 'checkbox');
|
|
20056
|
+
const flatVisbleContent = flat.filter((x) => x.visible !== false && x.field !== 'command' && x.field !== '#' && x.field !== 'checkbox');
|
|
20078
20057
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột cố định
|
|
20079
20058
|
const lastObjWidthFixLeft = Math.max(...Object.keys(objWidthFixLeft).map(Number), 0);
|
|
20080
20059
|
const fisrtObjWidthFixRight = Math.min(...Object.keys(objWidthFixRight).map(Number), flat.length);
|
|
20081
20060
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột có thể sửa
|
|
20082
20061
|
const indexFirstEdit = flat.findIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition);
|
|
20083
|
-
const indexLastEdit = flat
|
|
20084
|
-
.map((item, idx) => item.editEnable && item.visible !== false && !item.disabledCondition
|
|
20085
|
-
? idx
|
|
20086
|
-
: -1)
|
|
20087
|
-
.reduce((acc, val) => (val > acc ? val : acc), -1);
|
|
20062
|
+
const indexLastEdit = flat.map((item, idx) => (item.editEnable && item.visible !== false && !item.disabledCondition ? idx : -1)).reduce((acc, val) => (val > acc ? val : acc), -1);
|
|
20088
20063
|
return {
|
|
20089
20064
|
levels,
|
|
20090
20065
|
flat,
|
|
@@ -20097,7 +20072,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20097
20072
|
objHeaderWidthFixRight,
|
|
20098
20073
|
objHeaderWidthFixLeft,
|
|
20099
20074
|
indexFirstEdit,
|
|
20100
|
-
indexLastEdit
|
|
20075
|
+
indexLastEdit
|
|
20101
20076
|
};
|
|
20102
20077
|
};
|
|
20103
20078
|
/**
|
|
@@ -20107,10 +20082,7 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20107
20082
|
const isFilterMatch = filters.every((filter) => {
|
|
20108
20083
|
const { key, value, ope } = filter;
|
|
20109
20084
|
const rowValue = row[key];
|
|
20110
|
-
if (rowValue === undefined ||
|
|
20111
|
-
rowValue === null ||
|
|
20112
|
-
value === undefined ||
|
|
20113
|
-
value === null) {
|
|
20085
|
+
if (rowValue === undefined || rowValue === null || value === undefined || value === null) {
|
|
20114
20086
|
return false;
|
|
20115
20087
|
}
|
|
20116
20088
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -20143,10 +20115,7 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20143
20115
|
const isSearchMatch = !keyword ||
|
|
20144
20116
|
searchKeys.some((key) => {
|
|
20145
20117
|
const val = row[key];
|
|
20146
|
-
return val
|
|
20147
|
-
?.toString()
|
|
20148
|
-
.toLowerCase()
|
|
20149
|
-
.includes(keyword.trim().toLowerCase());
|
|
20118
|
+
return val?.toString().toLowerCase().includes(keyword.trim().toLowerCase());
|
|
20150
20119
|
});
|
|
20151
20120
|
return isFilterMatch && isSearchMatch;
|
|
20152
20121
|
};
|
|
@@ -20159,6 +20128,20 @@ const getMaxExpandedLevel = (items, fieldChildren = 'children', level = 0) => {
|
|
|
20159
20128
|
});
|
|
20160
20129
|
return max;
|
|
20161
20130
|
};
|
|
20131
|
+
const findItemInTree = (items, filter, keyFilter = 'value', keyChildren = 'children') => {
|
|
20132
|
+
for (let index = 0; index < items.length; index++) {
|
|
20133
|
+
const item = items[index];
|
|
20134
|
+
if (item[keyFilter] === filter) {
|
|
20135
|
+
return { ...item };
|
|
20136
|
+
}
|
|
20137
|
+
else if (item[keyChildren]?.length > 0) {
|
|
20138
|
+
const itemFilter = findItemInTree(item[keyChildren], filter, keyFilter, keyChildren);
|
|
20139
|
+
if (itemFilter) {
|
|
20140
|
+
return itemFilter;
|
|
20141
|
+
}
|
|
20142
|
+
}
|
|
20143
|
+
}
|
|
20144
|
+
};
|
|
20162
20145
|
|
|
20163
20146
|
const defaultMaxHeight$1 = 250;
|
|
20164
20147
|
const SelectTable = React$5.forwardRef((props, ref) => {
|
|
@@ -39059,7 +39042,7 @@ const HeaderTableCol = (props) => {
|
|
|
39059
39042
|
left: col.fixedType === 'left' ? objHeaderWidthFixLeft[`${indexParent}-${indexCol ?? 0}`] : undefined,
|
|
39060
39043
|
right: col.fixedType === 'right' ? objHeaderWidthFixRight[`${indexParent}-${indexCol ?? 0}`] : undefined
|
|
39061
39044
|
}, children: jsxRuntime.jsxs("div", { style: { justifyContent: col.textAlign === 'center' ? 'center' : 'space-between' }, onClick: () => {
|
|
39062
|
-
if (!allowSorting || col.columns?.length) {
|
|
39045
|
+
if (!allowSorting || col.columns?.length || col.field === 'checkbox') {
|
|
39063
39046
|
return;
|
|
39064
39047
|
}
|
|
39065
39048
|
if (order) {
|
|
@@ -39857,12 +39840,12 @@ const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleI
|
|
|
39857
39840
|
return (jsxRuntime.jsx("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: jsxRuntime.jsxs("div", { className: "r-toolbar-items", children: [jsxRuntime.jsxs("div", { className: "r-toolbar-left", children: [jsxRuntime.jsxs("div", { className: classNames$1('r-toolbar-item d-flex', { 'd-none': editDisable || addDisable }), "aria-disabled": "false", children: [jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => handleAdd(1), className: "d-flex", children: t('Add item') }), !!buttonSetting?.disableAddMulti && (jsxRuntime.jsxs(UncontrolledDropdown, { className: "nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", className: "me-0 d-flex", children: jsxRuntime.jsx(Button$1$1, { type: "button", color: "success", outline: true, style: { marginLeft: -1 }, className: "px-25", children: jsxRuntime.jsx("svg", { fill: "#28c76f", height: "15", width: "20", viewBox: "0 0 20 20", children: jsxRuntime.jsx("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" }) }) }) }), jsxRuntime.jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-0", children: [jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(10), children: "10 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(20), children: "20 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(30), children: "30 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(40), children: "40 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(50), children: "50 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(100), children: "100 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(1000), children: "1000 h\u00E0ng" })] })] }))] }), (focusRow ?? -1) > -1 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', { 'd-none': editDisable || addDisable || buttonSetting?.duplicateDisable }), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => {
|
|
39858
39841
|
handleDuplicate();
|
|
39859
39842
|
}, className: "d-flex", children: t('Duplicate') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', { 'd-none': editDisable || addDisable || buttonSetting?.insertBeforeDisable }), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t('Insert item before') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', { 'd-none': editDisable || addDisable || buttonSetting?.insertAfterDisable }), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t('Insert item after') }) })] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: " " })), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', { 'd-none': editDisable || buttonSetting?.deleteAllDisable }), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t('Delete all item') }) }), toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
39860
|
-
return item.align === 'left'
|
|
39843
|
+
return (item.align === 'left' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`)));
|
|
39861
39844
|
})] }), jsxRuntime.jsx("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
39862
|
-
return item.align === 'center'
|
|
39845
|
+
return (item.align === 'center' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`)));
|
|
39863
39846
|
}) }), jsxRuntime.jsxs("div", { className: "r-toolbar-right", children: [toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
39864
|
-
return item.align === 'right'
|
|
39865
|
-
}), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', { 'd-none': editDisable || addDisable }), "aria-disabled": "false", children: jsxRuntime.jsxs(UncontrolledDropdown, { className: "dropdown-user nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", color: "primary", onClick: (e) => e.preventDefault(), children: jsxRuntime.jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsxRuntime.jsx(DropdownMenu$1, { className: "formula-dropdown icon-dropdown", children: jsxRuntime.jsxs("ul", { className: "mb-0 pe-50", children: [jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\u00E2n b\u1EA3n" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\u00E9p h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\u00E1n h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2193 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng d\u01B0\u1EDBi" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2191 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng tr\u00EAn" })] }) })] }) })] })] }) }));
|
|
39847
|
+
return (item.align === 'right' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`)));
|
|
39848
|
+
}), !toolbarSetting?.hiddenSetting && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', { 'd-none': editDisable || addDisable }), "aria-disabled": "false", children: jsxRuntime.jsxs(UncontrolledDropdown, { className: "dropdown-user nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", color: "primary", onClick: (e) => e.preventDefault(), children: jsxRuntime.jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsxRuntime.jsx(DropdownMenu$1, { className: "formula-dropdown icon-dropdown", children: jsxRuntime.jsxs("ul", { className: "mb-0 pe-50", children: [jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\u00E2n b\u1EA3n" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\u00E9p h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\u00E1n h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2193 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng d\u01B0\u1EDBi" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2191 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng tr\u00EAn" })] }) })] }) })] }))] })] }) }));
|
|
39866
39849
|
};
|
|
39867
39850
|
|
|
39868
39851
|
const RenderToolbarTop = ({ toolbarTopOption }) => {
|
|
@@ -40071,7 +40054,13 @@ const TableEdit = React$5.forwardRef((props, ref) => {
|
|
|
40071
40054
|
return;
|
|
40072
40055
|
}
|
|
40073
40056
|
let objCallback;
|
|
40074
|
-
|
|
40057
|
+
let ele;
|
|
40058
|
+
if (column.type === 'select') {
|
|
40059
|
+
ele = column.selectSettings?.options?.find((item) => item[column.selectSettings?.fieldValue ?? 'value'] === copyData);
|
|
40060
|
+
}
|
|
40061
|
+
else if (column.type === 'selectTree') {
|
|
40062
|
+
ele = findItemInTree(column.selectSettings?.options ?? [], copyData, column.selectSettings?.fieldValue ?? 'value');
|
|
40063
|
+
}
|
|
40075
40064
|
if (ele) {
|
|
40076
40065
|
objCallback = ele;
|
|
40077
40066
|
}
|
|
@@ -68742,7 +68731,7 @@ const UnExpandAllIcon = ({ className, color = '#7F7F7F', size = 24, onClick, sty
|
|
|
68742
68731
|
};
|
|
68743
68732
|
|
|
68744
68733
|
const RenderContentCol = (props) => {
|
|
68745
|
-
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows,
|
|
68734
|
+
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, fieldKey, isMulti } = props;
|
|
68746
68735
|
const cellId = `content-${idTable}-row${indexRow}col-${indexCol}`;
|
|
68747
68736
|
const checkOverflow = () => {
|
|
68748
68737
|
const element = document.getElementById(cellId);
|
|
@@ -68750,31 +68739,27 @@ const RenderContentCol = (props) => {
|
|
|
68750
68739
|
};
|
|
68751
68740
|
const RenderElement = () => {
|
|
68752
68741
|
if (col.type === 'checkbox' || col.field === 'checkbox') {
|
|
68753
|
-
return (jsxRuntime.jsx("div", { className:
|
|
68754
|
-
|
|
68755
|
-
|
|
68756
|
-
|
|
68757
|
-
|
|
68758
|
-
|
|
68759
|
-
if (isMulti) {
|
|
68760
|
-
selectedRows?.splice(index, 1);
|
|
68761
|
-
setSelectedRows([...selectedRows]);
|
|
68762
|
-
}
|
|
68763
|
-
else {
|
|
68764
|
-
setSelectedRows([]);
|
|
68765
|
-
}
|
|
68742
|
+
return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer', { 'r-active-cell': isSelected }), style: { display: 'flex', justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start', alignItems: 'center' }, onClick: (e) => {
|
|
68743
|
+
const index = selectedRows?.findIndex((x) => x[fieldKey] === row[fieldKey]);
|
|
68744
|
+
if (index > -1) {
|
|
68745
|
+
if (isMulti) {
|
|
68746
|
+
selectedRows?.splice(index, 1);
|
|
68747
|
+
setSelectedRows([...selectedRows]);
|
|
68766
68748
|
}
|
|
68767
68749
|
else {
|
|
68768
|
-
|
|
68769
|
-
|
|
68770
|
-
|
|
68771
|
-
|
|
68772
|
-
|
|
68773
|
-
|
|
68750
|
+
setSelectedRows([]);
|
|
68751
|
+
}
|
|
68752
|
+
}
|
|
68753
|
+
else {
|
|
68754
|
+
if (isMulti) {
|
|
68755
|
+
setSelectedRows([...selectedRows, row]);
|
|
68756
|
+
}
|
|
68757
|
+
else {
|
|
68758
|
+
setSelectedRows([row]);
|
|
68774
68759
|
}
|
|
68775
|
-
e.stopPropagation();
|
|
68776
68760
|
}
|
|
68777
|
-
|
|
68761
|
+
e.stopPropagation();
|
|
68762
|
+
}, children: jsxRuntime.jsx(Input$1, { defaultChecked: isSelected, type: "checkbox", className: "cursor-pointer", style: { textAlign: col.textAlign ?? 'center' } }) }));
|
|
68778
68763
|
}
|
|
68779
68764
|
else {
|
|
68780
68765
|
let value = row[col.field];
|
|
@@ -68799,9 +68784,13 @@ const RenderContentCol = (props) => {
|
|
|
68799
68784
|
const prefix = isNegative ? formatSetting?.prefixNegative ?? '-' : '';
|
|
68800
68785
|
const suffix = isNegative ? formatSetting?.suffixNegative ?? '' : '';
|
|
68801
68786
|
const displayText = isNegative ? `${prefix}${value}${suffix}` : value ?? '';
|
|
68802
|
-
return (jsxRuntime.jsxs("div", { className: classNames$1('r-rowcell-div'), style: {
|
|
68787
|
+
return (jsxRuntime.jsxs("div", { className: classNames$1('r-rowcell-div cursor-pointer', { 'r-active-cell': isSelected }), style: {
|
|
68803
68788
|
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
|
|
68804
68789
|
fontStyle: row.haveItalicType ? 'italic' : 'normal'
|
|
68790
|
+
}, onDoubleClick: (e) => {
|
|
68791
|
+
e.preventDefault();
|
|
68792
|
+
handleCloseContext();
|
|
68793
|
+
handleDoubleClick?.(row, col);
|
|
68805
68794
|
}, children: [jsxRuntime.jsx("div", { className: "r-cell-text", style: {
|
|
68806
68795
|
display: 'flex',
|
|
68807
68796
|
justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
|
|
@@ -68820,24 +68809,22 @@ const RenderContentCol = (props) => {
|
|
|
68820
68809
|
right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined
|
|
68821
68810
|
}, onClick: (e) => {
|
|
68822
68811
|
if (e.target.nodeName === 'DIV' || e.target.nodeName === 'TD') {
|
|
68823
|
-
|
|
68824
|
-
|
|
68825
|
-
if (
|
|
68826
|
-
|
|
68827
|
-
|
|
68828
|
-
setSelectedRows([...selectedRows]);
|
|
68829
|
-
}
|
|
68830
|
-
else {
|
|
68831
|
-
setSelectedRows([]);
|
|
68832
|
-
}
|
|
68812
|
+
const index = selectedRows?.findIndex((x) => x[fieldKey] === row[fieldKey]);
|
|
68813
|
+
if (index > -1) {
|
|
68814
|
+
if (isMulti) {
|
|
68815
|
+
selectedRows?.splice(index, 1);
|
|
68816
|
+
setSelectedRows([...selectedRows]);
|
|
68833
68817
|
}
|
|
68834
68818
|
else {
|
|
68835
|
-
|
|
68836
|
-
|
|
68837
|
-
|
|
68838
|
-
|
|
68839
|
-
|
|
68840
|
-
|
|
68819
|
+
setSelectedRows([]);
|
|
68820
|
+
}
|
|
68821
|
+
}
|
|
68822
|
+
else {
|
|
68823
|
+
if (isMulti) {
|
|
68824
|
+
setSelectedRows([...selectedRows, row]);
|
|
68825
|
+
}
|
|
68826
|
+
else {
|
|
68827
|
+
setSelectedRows([row]);
|
|
68841
68828
|
}
|
|
68842
68829
|
}
|
|
68843
68830
|
e.stopPropagation();
|
|
@@ -68845,7 +68832,7 @@ const RenderContentCol = (props) => {
|
|
|
68845
68832
|
}, children: RenderElement() }, `col-${indexRow}-${indexCol}`)) }));
|
|
68846
68833
|
};
|
|
68847
68834
|
|
|
68848
|
-
const TableView = ({ idTable, dataSource, height = 400, columns,
|
|
68835
|
+
const TableView = ({ idTable, dataSource, height = 400, columns, isLoading, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, contextMenuItems, handleContextMenuClick }) => {
|
|
68849
68836
|
const { t } = reactI18next.useTranslation();
|
|
68850
68837
|
const gridRef = React$5.useRef(null);
|
|
68851
68838
|
const [openPopupSetupColumn, setOpenPopupSetupColumn] = React$5.useState(false);
|
|
@@ -69056,8 +69043,10 @@ const TableView = ({ idTable, dataSource, height = 400, columns, isMutil = false
|
|
|
69056
69043
|
}
|
|
69057
69044
|
};
|
|
69058
69045
|
React$5.useEffect(() => {
|
|
69046
|
+
console.log(selectedRows);
|
|
69047
|
+
console.log(isMulti);
|
|
69059
69048
|
if (setSelectedItem) {
|
|
69060
|
-
if (
|
|
69049
|
+
if (isMulti) {
|
|
69061
69050
|
if (dataSource && selectedRows && selectedRows?.length !== selectedItem?.length) {
|
|
69062
69051
|
setSelectedItem([...selectedRows]);
|
|
69063
69052
|
if (handleSelect) {
|
|
@@ -69084,7 +69073,7 @@ const TableView = ({ idTable, dataSource, height = 400, columns, isMutil = false
|
|
|
69084
69073
|
}
|
|
69085
69074
|
}, [selectedRows]);
|
|
69086
69075
|
React$5.useEffect(() => {
|
|
69087
|
-
if (!
|
|
69076
|
+
if (!isMulti) {
|
|
69088
69077
|
if (dataSource && selectedItem && selectedItem[fieldKey]) {
|
|
69089
69078
|
if (selectedRows?.length === 0 || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
69090
69079
|
setSelectedRows([selectedItem]);
|
|
@@ -69150,14 +69139,10 @@ const TableView = ({ idTable, dataSource, height = 400, columns, isMutil = false
|
|
|
69150
69139
|
}
|
|
69151
69140
|
else {
|
|
69152
69141
|
const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
|
|
69153
|
-
return (jsxRuntime.jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', { 'r-last-row': level === 0 && indexRow === viewData.length - 1 }),
|
|
69154
|
-
e.preventDefault();
|
|
69155
|
-
handleCloseContext();
|
|
69156
|
-
handleDoubleClick?.(row);
|
|
69157
|
-
}, onContextMenu: (e) => {
|
|
69142
|
+
return (jsxRuntime.jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', { 'r-last-row': level === 0 && indexRow === viewData.length - 1 }), onContextMenu: (e) => {
|
|
69158
69143
|
e.preventDefault();
|
|
69159
69144
|
handleContextMenu(e, row);
|
|
69160
|
-
}, children: contentColumns.map((column, indexCol) => (jsxRuntime.jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti:
|
|
69145
|
+
}, children: contentColumns.map((column, indexCol) => (jsxRuntime.jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMulti, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row, zeroVisiable: zeroVisiable, handleCloseContext: handleCloseContext, handleDoubleClick: handleDoubleClick }, indexCol))) }, `row-content-${indexRow}`));
|
|
69161
69146
|
}
|
|
69162
69147
|
}) }));
|
|
69163
69148
|
};
|
|
@@ -69185,7 +69170,7 @@ const TableView = ({ idTable, dataSource, height = 400, columns, isMutil = false
|
|
|
69185
69170
|
}
|
|
69186
69171
|
}, [context]);
|
|
69187
69172
|
return (jsxRuntime.jsxs("div", { className: "r-table-edit r-virtualized-table", children: [jsxRuntime.jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar && jsxRuntime.jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), headerComponent && headerComponent(), jsxRuntime.jsxs("div", { ref: gridRef, className: "r-gridtable", style: { height: `${height ? `${height}px` : 'auto'}`, position: 'relative' }, children: [jsxRuntime.jsxs("table", { role: "presentation", style: { width: '100%' }, children: [jsxRuntime.jsx(RenderColGroup, { contentColumns: contentColumns }), jsxRuntime.jsx("thead", { className: "r-gridheader", role: "rowgroup", children: headerColumns.map((rowColumn, indexParent) => {
|
|
69188
|
-
return (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: rowColumn.map((col, index) => (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable:
|
|
69173
|
+
return (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: rowColumn.map((col, index) => (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: true, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: gridRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: querySetting?.optionsFilter, allowFiltering: querySetting?.allowFiltering, allowSorting: querySetting?.allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
|
|
69189
69174
|
setFilterBy([...val]);
|
|
69190
69175
|
if (querySetting?.changeFilter) {
|
|
69191
69176
|
querySetting.changeFilter(val);
|
|
@@ -69243,6 +69228,7 @@ exports.calculateTableStructure = calculateTableStructure;
|
|
|
69243
69228
|
exports.checkDecimalSeparator = checkDecimalSeparator;
|
|
69244
69229
|
exports.checkThousandSeparator = checkThousandSeparator;
|
|
69245
69230
|
exports["default"] = TableEdit;
|
|
69231
|
+
exports.findItemInTree = findItemInTree;
|
|
69246
69232
|
exports.formartNumberic = formartNumberic;
|
|
69247
69233
|
exports.formatDateTime = formatDateTime;
|
|
69248
69234
|
exports.generateUUID = generateUUID;
|