react-table-edit 1.5.44 → 1.5.46
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/index.js +108 -259
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +108 -259
- package/dist/index.mjs.map +1 -1
- package/dist/styles/date-picker.css +74 -771
- package/dist/styles/date-picker.css.map +1 -1
- package/dist/styles/form-wizard.css.map +1 -1
- package/dist/styles/index.css +341 -840
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/select-table.css.map +1 -1
- package/dist/styles/sidebar.css +14 -0
- package/dist/styles/sidebar.css.map +1 -1
- package/dist/styles/tab-menu.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19836,20 +19836,17 @@ const isNullOrUndefined$1 = (d) => {
|
|
|
19836
19836
|
const generateUUID = () => {
|
|
19837
19837
|
// Public Domain/MIT
|
|
19838
19838
|
let d = new Date().getTime(); //Timestamp
|
|
19839
|
-
let d2 = (typeof performance !== 'undefined' &&
|
|
19840
|
-
performance.now &&
|
|
19841
|
-
performance.now() * 1000) ||
|
|
19842
|
-
0; //Time in microseconds since page-load or 0 if unsupported
|
|
19839
|
+
let d2 = (typeof performance !== 'undefined' && performance.now && performance.now() * 1000) || 0; //Time in microseconds since page-load or 0 if unsupported
|
|
19843
19840
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
19844
19841
|
let r = Math.random() * 16; //random number between 0 and 16
|
|
19845
19842
|
if (d > 0) {
|
|
19846
19843
|
//Use timestamp until depleted
|
|
19847
|
-
r = (
|
|
19844
|
+
r = (d + r) % 16 | 0;
|
|
19848
19845
|
d = Math.floor(d / 16);
|
|
19849
19846
|
}
|
|
19850
19847
|
else {
|
|
19851
19848
|
//Use microseconds since page-load if supported
|
|
19852
|
-
r = (
|
|
19849
|
+
r = (d2 + r) % 16 | 0;
|
|
19853
19850
|
d2 = Math.floor(d2 / 16);
|
|
19854
19851
|
}
|
|
19855
19852
|
return (c === 'x' ? r : 0x3).toString(16);
|
|
@@ -19871,16 +19868,12 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19871
19868
|
// eslint-disable-next-line
|
|
19872
19869
|
if (str || str == '0') {
|
|
19873
19870
|
str = str.toString();
|
|
19874
|
-
const value = decimalSeparator !== '.'
|
|
19875
|
-
? str.toString().replaceAll('.', decimalSeparator ?? '')
|
|
19876
|
-
: str;
|
|
19871
|
+
const value = decimalSeparator !== '.' ? str.toString().replaceAll('.', decimalSeparator ?? '') : str;
|
|
19877
19872
|
const arr = value.toString().split(decimalSeparator ?? '', 2);
|
|
19878
19873
|
let flag = value.toString().includes(decimalSeparator ?? '');
|
|
19879
19874
|
if (arr[0].length < 3) {
|
|
19880
19875
|
const intergerArr = haveNegative ? arr[0] : arr[0].replace('-', '');
|
|
19881
|
-
return flag
|
|
19882
|
-
? `${intergerArr}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19883
|
-
: intergerArr;
|
|
19876
|
+
return flag ? `${intergerArr}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}` : intergerArr;
|
|
19884
19877
|
}
|
|
19885
19878
|
else {
|
|
19886
19879
|
let flagNegative = false;
|
|
@@ -19904,9 +19897,7 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19904
19897
|
if (flagNegative && haveNegative) {
|
|
19905
19898
|
arr[0] = '-'.concat(arr[0]);
|
|
19906
19899
|
}
|
|
19907
|
-
return flag
|
|
19908
|
-
? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19909
|
-
: arr[0];
|
|
19900
|
+
return flag ? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}` : arr[0];
|
|
19910
19901
|
}
|
|
19911
19902
|
}
|
|
19912
19903
|
else {
|
|
@@ -19929,7 +19920,7 @@ const formatDateTime = (data, format = 'dd/MM/yyyy') => {
|
|
|
19929
19920
|
MM: String(date.getMonth() + 1).padStart(2, '0'),
|
|
19930
19921
|
yyyy: date.getFullYear(),
|
|
19931
19922
|
HH: String(date.getHours()).padStart(2, '0'),
|
|
19932
|
-
mm: String(date.getMinutes()).padStart(2, '0')
|
|
19923
|
+
mm: String(date.getMinutes()).padStart(2, '0')
|
|
19933
19924
|
};
|
|
19934
19925
|
return format.replace(/dd|DD|MM|yyyy|HH|mm/g, (match) => map[match]);
|
|
19935
19926
|
};
|
|
@@ -19950,7 +19941,7 @@ const FindNodeByPath = (tree, path) => {
|
|
|
19950
19941
|
parent: current,
|
|
19951
19942
|
lastIndex: levels.at(-1),
|
|
19952
19943
|
firstIndex: levels.length === 1 ? levels[0] : -1,
|
|
19953
|
-
node
|
|
19944
|
+
node
|
|
19954
19945
|
};
|
|
19955
19946
|
};
|
|
19956
19947
|
/**
|
|
@@ -19978,7 +19969,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19978
19969
|
const objHeaderWidthFixLeft = {};
|
|
19979
19970
|
let maxDepth = 0;
|
|
19980
19971
|
// Tính depth tối đa
|
|
19981
|
-
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) => col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth));
|
|
19972
|
+
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) => (col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth)));
|
|
19982
19973
|
maxDepth = calculateDepth(columns);
|
|
19983
19974
|
let leftTotal = 0;
|
|
19984
19975
|
let rightTotal = 0;
|
|
@@ -20016,8 +20007,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20016
20007
|
newCell.numericSettings = { fraction: setting.fraction };
|
|
20017
20008
|
}
|
|
20018
20009
|
}
|
|
20019
|
-
newCell.headerDisplay =
|
|
20020
|
-
setting.headerText || (newCell.headerDisplay ?? newCell.headerText);
|
|
20010
|
+
newCell.headerDisplay = setting.headerText || (newCell.headerDisplay ?? newCell.headerText);
|
|
20021
20011
|
}
|
|
20022
20012
|
else {
|
|
20023
20013
|
if (newCell.columns?.length) {
|
|
@@ -20053,13 +20043,11 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20053
20043
|
...col,
|
|
20054
20044
|
columns: col.columns ?? [],
|
|
20055
20045
|
colspan,
|
|
20056
|
-
rowspan: hasChildren ? 1 : maxDepth - level
|
|
20046
|
+
rowspan: hasChildren ? 1 : maxDepth - level
|
|
20057
20047
|
};
|
|
20058
20048
|
levels[level].push(cell);
|
|
20059
20049
|
const headerKey = `${level}-${indexCol}`;
|
|
20060
|
-
if (cell.fixedType === 'left' &&
|
|
20061
|
-
cell.visible !== false &&
|
|
20062
|
-
cell.isGroup !== true) {
|
|
20050
|
+
if (cell.fixedType === 'left' && cell.visible !== false && cell.isGroup !== true) {
|
|
20063
20051
|
objHeaderWidthFixLeft[headerKey] = leftTotal;
|
|
20064
20052
|
}
|
|
20065
20053
|
if (!hasChildren) {
|
|
@@ -20067,48 +20055,33 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20067
20055
|
const width = cell.width ?? 40;
|
|
20068
20056
|
cell.index = index;
|
|
20069
20057
|
flat.push(cell);
|
|
20070
|
-
if (cell.fixedType === 'left' &&
|
|
20071
|
-
cell.visible !== false &&
|
|
20072
|
-
cell.isGroup !== true) {
|
|
20058
|
+
if (cell.fixedType === 'left' && cell.visible !== false && cell.isGroup !== true) {
|
|
20073
20059
|
objWidthFixLeft[index] = leftTotal;
|
|
20074
20060
|
leftTotal += width;
|
|
20075
20061
|
}
|
|
20076
|
-
if (cell.fixedType === 'right' &&
|
|
20077
|
-
cell.visible !== false &&
|
|
20078
|
-
cell.isGroup !== true) {
|
|
20062
|
+
if (cell.fixedType === 'right' && cell.visible !== false && cell.isGroup !== true) {
|
|
20079
20063
|
rightTotal -= width;
|
|
20080
20064
|
objWidthFixRight[index] = rightTotal;
|
|
20081
20065
|
}
|
|
20082
20066
|
}
|
|
20083
|
-
if (cell.fixedType === 'right' &&
|
|
20084
|
-
cell.visible !== false &&
|
|
20085
|
-
cell.isGroup !== true) {
|
|
20067
|
+
if (cell.fixedType === 'right' && cell.visible !== false && cell.isGroup !== true) {
|
|
20086
20068
|
objHeaderWidthFixRight[headerKey] = rightTotal;
|
|
20087
20069
|
}
|
|
20088
20070
|
return colspanSum + colspan;
|
|
20089
20071
|
}, 0);
|
|
20090
20072
|
};
|
|
20091
20073
|
calcTotalRightWidth(columns);
|
|
20092
|
-
|
|
20093
|
-
|
|
20094
|
-
}
|
|
20095
|
-
traverse(columns);
|
|
20074
|
+
const newColumns = (settingColumns?.length ?? 0) > 0 ? applySetting(columns) : columns;
|
|
20075
|
+
traverse(newColumns);
|
|
20096
20076
|
// Danh sách các cột được hiển thị
|
|
20097
20077
|
// const flatVisble = flat.filter((e) => e.visible !== false)
|
|
20098
|
-
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20099
|
-
x.field !== 'command' &&
|
|
20100
|
-
x.field !== '#' &&
|
|
20101
|
-
x.field !== 'checkbox');
|
|
20078
|
+
const flatVisbleContent = flat.filter((x) => x.visible !== false && x.field !== 'command' && x.field !== '#' && x.field !== 'checkbox');
|
|
20102
20079
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột cố định
|
|
20103
20080
|
const lastObjWidthFixLeft = Math.max(...Object.keys(objWidthFixLeft).map(Number), 0);
|
|
20104
20081
|
const fisrtObjWidthFixRight = Math.min(...Object.keys(objWidthFixRight).map(Number), flat.length);
|
|
20105
20082
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột có thể sửa
|
|
20106
20083
|
const indexFirstEdit = flat.findIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition);
|
|
20107
|
-
const indexLastEdit = flat
|
|
20108
|
-
.map((item, idx) => item.editEnable && item.visible !== false && !item.disabledCondition
|
|
20109
|
-
? idx
|
|
20110
|
-
: -1)
|
|
20111
|
-
.reduce((acc, val) => (val > acc ? val : acc), -1);
|
|
20084
|
+
const indexLastEdit = flat.map((item, idx) => (item.editEnable && item.visible !== false && !item.disabledCondition ? idx : -1)).reduce((acc, val) => (val > acc ? val : acc), -1);
|
|
20112
20085
|
return {
|
|
20113
20086
|
levels,
|
|
20114
20087
|
flat,
|
|
@@ -20121,7 +20094,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20121
20094
|
objHeaderWidthFixRight,
|
|
20122
20095
|
objHeaderWidthFixLeft,
|
|
20123
20096
|
indexFirstEdit,
|
|
20124
|
-
indexLastEdit
|
|
20097
|
+
indexLastEdit
|
|
20125
20098
|
};
|
|
20126
20099
|
};
|
|
20127
20100
|
/**
|
|
@@ -20131,10 +20104,7 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20131
20104
|
const isFilterMatch = filters.every((filter) => {
|
|
20132
20105
|
const { key, value, ope } = filter;
|
|
20133
20106
|
const rowValue = row[key];
|
|
20134
|
-
if (rowValue === undefined ||
|
|
20135
|
-
rowValue === null ||
|
|
20136
|
-
value === undefined ||
|
|
20137
|
-
value === null) {
|
|
20107
|
+
if (rowValue === undefined || rowValue === null || value === undefined || value === null) {
|
|
20138
20108
|
return false;
|
|
20139
20109
|
}
|
|
20140
20110
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -20167,10 +20137,7 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20167
20137
|
const isSearchMatch = !keyword ||
|
|
20168
20138
|
searchKeys.some((key) => {
|
|
20169
20139
|
const val = row[key];
|
|
20170
|
-
return val
|
|
20171
|
-
?.toString()
|
|
20172
|
-
.toLowerCase()
|
|
20173
|
-
.includes(keyword.trim().toLowerCase());
|
|
20140
|
+
return val?.toString().toLowerCase().includes(keyword.trim().toLowerCase());
|
|
20174
20141
|
});
|
|
20175
20142
|
return isFilterMatch && isSearchMatch;
|
|
20176
20143
|
};
|
|
@@ -20330,7 +20297,7 @@ const TableElement$1 = React__default["default"].memo((props) => {
|
|
|
20330
20297
|
|
|
20331
20298
|
const defaultMaxHeight$1 = 250;
|
|
20332
20299
|
const SelectTable = React$5.forwardRef((props, ref) => {
|
|
20333
|
-
const { id, menuWidth, width, invalid, placeholder, textAlign, options, columns, value, fieldValue, fieldLabel, maxHeight, isClearable, component, isMulti, noHeader, isDisabled, showFooter, formatSetting, allowCreate, onPaste, onChange, handleAdd, onKeyDown, onOpenMenu, loadOptions, onCloseMenu, footerComponent, formatOptionLabel, compareFunction
|
|
20300
|
+
const { id, menuWidth, width, invalid, placeholder, textAlign, options, columns, value, fieldValue, fieldLabel, maxHeight, isClearable, component, isMulti, noHeader, isDisabled, showFooter, formatSetting, allowCreate, onPaste, onChange, handleAdd, onKeyDown, onOpenMenu, loadOptions, onCloseMenu, footerComponent, formatOptionLabel, compareFunction } = props;
|
|
20334
20301
|
const selectTableRef = React$5.useRef(null);
|
|
20335
20302
|
const selectMenuTableRef = React$5.useRef(null);
|
|
20336
20303
|
const inputRef = React$5.useRef(null);
|
|
@@ -20347,8 +20314,8 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20347
20314
|
{
|
|
20348
20315
|
headerText: 'Name',
|
|
20349
20316
|
field: fieldLabel ?? 'label',
|
|
20350
|
-
width: menuWidth
|
|
20351
|
-
}
|
|
20317
|
+
width: menuWidth
|
|
20318
|
+
}
|
|
20352
20319
|
];
|
|
20353
20320
|
const closeMenu = () => {
|
|
20354
20321
|
setDropdownOpen(false);
|
|
@@ -20362,7 +20329,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20362
20329
|
...val,
|
|
20363
20330
|
[fieldLabel ?? 'label']: val.valueCreate,
|
|
20364
20331
|
isCreated: undefined,
|
|
20365
|
-
isCreatedItem: true
|
|
20332
|
+
isCreatedItem: true
|
|
20366
20333
|
};
|
|
20367
20334
|
options.unshift(newVal);
|
|
20368
20335
|
onChange(newVal);
|
|
@@ -20372,9 +20339,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20372
20339
|
};
|
|
20373
20340
|
React$5.useEffect(() => {
|
|
20374
20341
|
if (dropdownOpen && value && !isMulti && selectMenuTableRef) {
|
|
20375
|
-
const index = currentOptions?.findIndex((row) => compareFunction
|
|
20376
|
-
? compareFunction(row)
|
|
20377
|
-
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']);
|
|
20342
|
+
const index = currentOptions?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']));
|
|
20378
20343
|
if (index >= 0) {
|
|
20379
20344
|
selectMenuTableRef.current.scrollTo({ top: (index - 1) * 30 });
|
|
20380
20345
|
}
|
|
@@ -20421,28 +20386,14 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20421
20386
|
}
|
|
20422
20387
|
}
|
|
20423
20388
|
};
|
|
20424
|
-
const listKeyUse = [
|
|
20425
|
-
'Escape',
|
|
20426
|
-
'Space',
|
|
20427
|
-
'Enter',
|
|
20428
|
-
'Tab',
|
|
20429
|
-
'NumpadEnter',
|
|
20430
|
-
'ArrowDown',
|
|
20431
|
-
'ArrowUp',
|
|
20432
|
-
'F9',
|
|
20433
|
-
];
|
|
20389
|
+
const listKeyUse = ['Escape', 'Space', 'Enter', 'Tab', 'NumpadEnter', 'ArrowDown', 'ArrowUp', 'F9'];
|
|
20434
20390
|
const handleOnKeyDown = (e) => {
|
|
20435
20391
|
let key = '';
|
|
20436
20392
|
if (onKeyDown &&
|
|
20437
20393
|
(!dropdownOpen ||
|
|
20438
20394
|
!listKeyUse.includes(e.code) ||
|
|
20439
|
-
((e.code === 'Enter' ||
|
|
20440
|
-
|
|
20441
|
-
e.code === 'NumpadEnter' ||
|
|
20442
|
-
e.code === 'Space') &&
|
|
20443
|
-
!(currentOptions[indexFocus] || haveCreateNew)) ||
|
|
20444
|
-
((e.code === 'ArrowDown' || e.code === 'ArrowUp') &&
|
|
20445
|
-
currentOptions.length === 0) ||
|
|
20395
|
+
((e.code === 'Enter' || e.code === 'Tab' || e.code === 'NumpadEnter' || e.code === 'Space') && !(currentOptions[indexFocus] || haveCreateNew)) ||
|
|
20396
|
+
((e.code === 'ArrowDown' || e.code === 'ArrowUp') && currentOptions.length === 0) ||
|
|
20446
20397
|
(e.code === 'Escape' && !(isClearable && value && !isDisabled)))) {
|
|
20447
20398
|
key = onKeyDown(e);
|
|
20448
20399
|
}
|
|
@@ -20459,7 +20410,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20459
20410
|
valueCreate: searchTerm,
|
|
20460
20411
|
[fieldValue ?? 'value']: searchTerm,
|
|
20461
20412
|
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20462
|
-
isCreated: true
|
|
20413
|
+
isCreated: true
|
|
20463
20414
|
};
|
|
20464
20415
|
}
|
|
20465
20416
|
else {
|
|
@@ -20481,16 +20432,14 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20481
20432
|
flag = true;
|
|
20482
20433
|
}
|
|
20483
20434
|
}
|
|
20484
|
-
else if (e.code === 'Enter' ||
|
|
20485
|
-
e.code === 'Tab' ||
|
|
20486
|
-
e.code === 'NumpadEnter') {
|
|
20435
|
+
else if (e.code === 'Enter' || e.code === 'Tab' || e.code === 'NumpadEnter') {
|
|
20487
20436
|
let newItem;
|
|
20488
20437
|
if (haveCreateNew && indexFocus === 0) {
|
|
20489
20438
|
newItem = {
|
|
20490
20439
|
valueCreate: searchTerm,
|
|
20491
20440
|
[fieldValue ?? 'value']: searchTerm,
|
|
20492
20441
|
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20493
|
-
isCreated: true
|
|
20442
|
+
isCreated: true
|
|
20494
20443
|
};
|
|
20495
20444
|
}
|
|
20496
20445
|
else {
|
|
@@ -20509,10 +20458,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20509
20458
|
newIndex = indexFocus + 1;
|
|
20510
20459
|
}
|
|
20511
20460
|
else if (value) {
|
|
20512
|
-
newIndex =
|
|
20513
|
-
currentOptions?.findIndex((row) => compareFunction
|
|
20514
|
-
? compareFunction(row)
|
|
20515
|
-
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) + 1;
|
|
20461
|
+
newIndex = currentOptions?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value'])) + 1;
|
|
20516
20462
|
}
|
|
20517
20463
|
if (newIndex < currentOptions.length) {
|
|
20518
20464
|
setIndexFocus(newIndex);
|
|
@@ -20536,10 +20482,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20536
20482
|
newIndex = indexFocus - 1;
|
|
20537
20483
|
}
|
|
20538
20484
|
else if (value) {
|
|
20539
|
-
newIndex =
|
|
20540
|
-
currentOptions?.findIndex((row) => compareFunction
|
|
20541
|
-
? compareFunction(row)
|
|
20542
|
-
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) - 1;
|
|
20485
|
+
newIndex = currentOptions?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value'])) - 1;
|
|
20543
20486
|
}
|
|
20544
20487
|
if (newIndex >= 0) {
|
|
20545
20488
|
setIndexFocus(newIndex);
|
|
@@ -20572,11 +20515,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20572
20515
|
scrollToElement(selectMenuTableRef.current, selectMenuTableRef.current.scrollHeight);
|
|
20573
20516
|
}
|
|
20574
20517
|
else if (flag === 0 && rect.bottom + 30 > parentRect.bottom) {
|
|
20575
|
-
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop -
|
|
20576
|
-
selectMenuTableRef.current.offsetTop -
|
|
20577
|
-
parentRect.height +
|
|
20578
|
-
rect.height +
|
|
20579
|
-
50);
|
|
20518
|
+
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - selectMenuTableRef.current.offsetTop - parentRect.height + rect.height + 50);
|
|
20580
20519
|
}
|
|
20581
20520
|
else if (flag === 2 && rect.top < parentRect.top + 50) {
|
|
20582
20521
|
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - 65);
|
|
@@ -20590,7 +20529,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20590
20529
|
timeOutElement = setTimeout(() => {
|
|
20591
20530
|
elemment.scrollTo({
|
|
20592
20531
|
top,
|
|
20593
|
-
behavior: 'smooth'
|
|
20532
|
+
behavior: 'smooth'
|
|
20594
20533
|
});
|
|
20595
20534
|
}, 100);
|
|
20596
20535
|
};
|
|
@@ -20600,12 +20539,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20600
20539
|
}
|
|
20601
20540
|
for (let index = 0; index < columnsSearch.length; index++) {
|
|
20602
20541
|
const key = columnsSearch[index].field.trim();
|
|
20603
|
-
if (data[key] &&
|
|
20604
|
-
data[key]
|
|
20605
|
-
.toString()
|
|
20606
|
-
.trim()
|
|
20607
|
-
.toLowerCase()
|
|
20608
|
-
.includes(keyword.trim().toLowerCase())) {
|
|
20542
|
+
if (data[key] && data[key].toString().trim().toLowerCase().includes(keyword.trim().toLowerCase())) {
|
|
20609
20543
|
return true;
|
|
20610
20544
|
}
|
|
20611
20545
|
}
|
|
@@ -20621,8 +20555,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20621
20555
|
if (!searchTerm) {
|
|
20622
20556
|
setOptionsLoad(undefined);
|
|
20623
20557
|
}
|
|
20624
|
-
else if (allowCreate &&
|
|
20625
|
-
!currentOptions?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
|
|
20558
|
+
else if (allowCreate && !currentOptions?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
|
|
20626
20559
|
setHaveCreateNew(true);
|
|
20627
20560
|
return;
|
|
20628
20561
|
}
|
|
@@ -20636,22 +20569,15 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20636
20569
|
const { indexRow, row, isSelected, level = 0 } = props;
|
|
20637
20570
|
return (jsxRuntime.jsxs("tr", { id: `row-select-table-${indexRow}`, style: { paddingLeft: 10 * level }, className: classNames$1('r-select-row', { 'last-row': indexRow === currentOptions.length - 1 }, { 'fisrt-row': indexRow === 0 }), children: [isMulti && (jsxRuntime.jsx("td", { className: classNames$1(`r-select-rowcell`, {
|
|
20638
20571
|
'r-select-move': indexFocus === indexRow,
|
|
20639
|
-
'r-select-active': !isMulti &&
|
|
20640
|
-
value &&
|
|
20641
|
-
(compareFunction
|
|
20642
|
-
? compareFunction(row)
|
|
20643
|
-
: value[fieldValue ?? 'value'] ===
|
|
20644
|
-
row[fieldValue ?? 'value']),
|
|
20572
|
+
'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value'])
|
|
20645
20573
|
}), style: {
|
|
20646
20574
|
width: 40,
|
|
20647
20575
|
textAlign: 'center',
|
|
20648
20576
|
padding: 0,
|
|
20649
|
-
paddingBottom: 6
|
|
20577
|
+
paddingBottom: 6
|
|
20650
20578
|
}, onClick: (e) => {
|
|
20651
20579
|
if (isMulti) {
|
|
20652
|
-
const index = value?.findIndex((x) => compareFunction
|
|
20653
|
-
? compareFunction(row)
|
|
20654
|
-
: x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']);
|
|
20580
|
+
const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
|
|
20655
20581
|
if (index > -1) {
|
|
20656
20582
|
value?.splice(index, 1);
|
|
20657
20583
|
handChange([...value]);
|
|
@@ -20669,42 +20595,28 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20669
20595
|
}
|
|
20670
20596
|
}, children: jsxRuntime.jsx(Input$1, { checked: isSelected, type: "checkbox", className: "cursor-pointer", onChange: () => { }, style: { textAlign: 'center', marginTop: 6 } }) })), (columns ? columns : defaultColumns).map((col, indexCol) => {
|
|
20671
20597
|
let valueDisplay = row[col.field];
|
|
20672
|
-
if (col.type === 'numeric' ||
|
|
20673
|
-
(col.
|
|
20674
|
-
valueDisplay =
|
|
20675
|
-
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
|
|
20598
|
+
if (col.type === 'numeric' || (col.typeCondition && col.typeCondition(row) === 'numeric')) {
|
|
20599
|
+
valueDisplay = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
|
|
20676
20600
|
}
|
|
20677
20601
|
else if (col.type === 'date') {
|
|
20678
|
-
valueDisplay = valueDisplay
|
|
20679
|
-
? formatDateTime(valueDisplay, formatSetting?.dateFormat)
|
|
20680
|
-
: '';
|
|
20602
|
+
valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat) : '';
|
|
20681
20603
|
}
|
|
20682
20604
|
else if (col.type === 'datetime') {
|
|
20683
|
-
valueDisplay = valueDisplay
|
|
20684
|
-
? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
20685
|
-
: '';
|
|
20605
|
+
valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
|
|
20686
20606
|
}
|
|
20687
20607
|
return (jsxRuntime.jsxs(React$5.Fragment, { children: [col.visible !== false && (jsxRuntime.jsx("td", { id: `select-${id}-${indexRow}-${indexCol}`,
|
|
20688
20608
|
// ref={refRow}
|
|
20689
20609
|
className: classNames$1(`r-select-rowcell`, {
|
|
20690
20610
|
'r-select-move': indexFocus === indexRow,
|
|
20691
|
-
'r-select-active': !isMulti &&
|
|
20692
|
-
value &&
|
|
20693
|
-
(compareFunction
|
|
20694
|
-
? compareFunction(row)
|
|
20695
|
-
: value[fieldValue ?? 'value'] ===
|
|
20696
|
-
row[fieldValue ?? 'value']),
|
|
20611
|
+
'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value'])
|
|
20697
20612
|
}), style: {
|
|
20698
20613
|
minWidth: col.minWidth,
|
|
20699
20614
|
width: col.width,
|
|
20700
20615
|
maxWidth: col.maxWidth,
|
|
20701
|
-
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
20616
|
+
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
20702
20617
|
}, onClick: (e) => {
|
|
20703
20618
|
if (isMulti) {
|
|
20704
|
-
const index = value?.findIndex((x) => compareFunction
|
|
20705
|
-
? compareFunction(row)
|
|
20706
|
-
: x[fieldValue ?? 'value'] ===
|
|
20707
|
-
row[fieldValue ?? 'value']);
|
|
20619
|
+
const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
|
|
20708
20620
|
if (index > -1) {
|
|
20709
20621
|
value?.splice(index, 1);
|
|
20710
20622
|
handChange([...value]);
|
|
@@ -20731,7 +20643,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20731
20643
|
setIndexFocus(indexRow);
|
|
20732
20644
|
}
|
|
20733
20645
|
e.stopPropagation();
|
|
20734
|
-
}, children: col.template ?
|
|
20646
|
+
}, children: col.template ? col.template(row, indexRow) : col.type === 'numeric' && Number(row[col.field]) < 0 ? jsxRuntime.jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [" ", `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] }) : valueDisplay }, `col-${indexRow}-${indexCol}`)), checkOverflow(indexRow, indexCol) && (jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `select-${id}-${indexRow}-${indexCol}`, children: col.template ? col.template(row, indexRow) : valueDisplay }))] }, indexCol));
|
|
20735
20647
|
})] }, `row-${indexRow}`));
|
|
20736
20648
|
});
|
|
20737
20649
|
return (jsxRuntime.jsx("div", { className: classNames$1('react-select-table', { 'is-invalid': invalid }), ref: ref, id: id, children: jsxRuntime.jsx("div", { ref: selectTableRef, children: jsxRuntime.jsxs(Dropdown$1$1, { isOpen: dropdownOpen, toggle: () => { }, onMouseDown: (e) => e.preventDefault(), children: [jsxRuntime.jsxs(DropdownToggle$1, { onClick: (e) => {
|
|
@@ -20741,26 +20653,14 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20741
20653
|
}
|
|
20742
20654
|
e.preventDefault();
|
|
20743
20655
|
}, tag: "div", style: {
|
|
20744
|
-
width: width
|
|
20745
|
-
? width
|
|
20746
|
-
: selectTableRef?.current?.clientWidth
|
|
20747
|
-
? selectTableRef?.current?.clientWidth
|
|
20748
|
-
: 'auto',
|
|
20656
|
+
width: width ? width : selectTableRef?.current?.clientWidth ? selectTableRef?.current?.clientWidth : 'auto'
|
|
20749
20657
|
}, className: classNames$1('select-table-control', { 'r-select-is-disabled': isDisabled }, { 'r-select-is-open': dropdownOpen }, { 'r-select-is-focus': isFocus }, { 'r-select-is-invalid': invalid }), children: [jsxRuntime.jsxs("div", { className: "select-table-container", children: [isMulti ? (jsxRuntime.jsx("div", { className: classNames$1('select-value is-mutil', {
|
|
20750
|
-
'd-none': searchTerm
|
|
20658
|
+
'd-none': searchTerm
|
|
20751
20659
|
}), children: value?.map((ele, index) => {
|
|
20752
|
-
return (jsxRuntime.jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel
|
|
20753
|
-
? formatOptionLabel(ele)
|
|
20754
|
-
: ele[fieldLabel ?? 'label']] }, index));
|
|
20660
|
+
return (jsxRuntime.jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel ? formatOptionLabel(ele) : ele[fieldLabel ?? 'label']] }, index));
|
|
20755
20661
|
}) })) : (jsxRuntime.jsxs("div", { className: classNames$1('select-value', {
|
|
20756
|
-
'd-none': searchTerm
|
|
20757
|
-
}), children: [value
|
|
20758
|
-
? formatOptionLabel
|
|
20759
|
-
? formatOptionLabel(value)
|
|
20760
|
-
: value[fieldLabel ?? 'label']
|
|
20761
|
-
: '', ' '] })), !((isMulti ? value?.length > 0 : value) ||
|
|
20762
|
-
isDisabled ||
|
|
20763
|
-
searchTerm) && (jsxRuntime.jsx("div", { className: classNames$1('select-placeholder'), children: placeholder })), jsxRuntime.jsx("div", { className: "input-container", children: jsxRuntime.jsx("input", { style: { textAlign: textAlign ?? 'left' }, ref: inputRef, className: classNames$1('select-input'), readOnly: isDisabled, value: searchTerm, onPaste: (e) => onPaste && !dropdownOpen && onPaste(e), onChange: (val) => {
|
|
20662
|
+
'd-none': searchTerm
|
|
20663
|
+
}), children: [value ? (formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? 'label']) : '', ' '] })), !((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && jsxRuntime.jsx("div", { className: classNames$1('select-placeholder'), children: placeholder }), jsxRuntime.jsx("div", { className: "input-container", children: jsxRuntime.jsx("input", { style: { textAlign: textAlign ?? 'left' }, ref: inputRef, className: classNames$1('select-input'), readOnly: isDisabled, value: searchTerm, onPaste: (e) => onPaste && !dropdownOpen && onPaste(e), onChange: (val) => {
|
|
20764
20664
|
if (val.target.value) {
|
|
20765
20665
|
if (loadOptions && val.target.value) {
|
|
20766
20666
|
setIsLoading(true);
|
|
@@ -20782,23 +20682,21 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20782
20682
|
width: width ? width + 2 : 'min-content',
|
|
20783
20683
|
position: 'fixed',
|
|
20784
20684
|
borderRadius: 4,
|
|
20785
|
-
zIndex: 9999
|
|
20685
|
+
zIndex: 9999
|
|
20786
20686
|
}, children: jsxRuntime.jsx(DropdownItem$1, { className: classNames$1('p-0 menu-select-table'), tag: "div", header: true, children: dropdownOpen && (jsxRuntime.jsx("div", { style: { backgroundColor: 'none' }, onMouseDown: (e) => {
|
|
20787
20687
|
if (!isDisabled) {
|
|
20788
20688
|
inputRef?.current.focus();
|
|
20789
20689
|
e.preventDefault();
|
|
20790
20690
|
}
|
|
20791
20691
|
}, children: jsxRuntime.jsxs("div", { className: "r-select-grid", children: [jsxRuntime.jsx("div", { className: classNames$1('r-select-gridtable', {
|
|
20792
|
-
'no-header': noHeader || (columns?.length ?? 0) === 0
|
|
20692
|
+
'no-header': noHeader || (columns?.length ?? 0) === 0
|
|
20793
20693
|
}), ref: selectMenuTableRef, style: {
|
|
20794
20694
|
width: menuWidth,
|
|
20795
20695
|
minWidth: selectTableRef?.current?.clientWidth,
|
|
20796
|
-
maxHeight: maxHeight ?? defaultMaxHeight$1
|
|
20696
|
+
maxHeight: maxHeight ?? defaultMaxHeight$1
|
|
20797
20697
|
}, children: jsxRuntime.jsx(TableElement$1, { haveCreateNew: haveCreateNew, isLoading: isLoading, searchTerm: searchTerm, fieldLabel: fieldLabel, noHeader: noHeader, closeMenu: closeMenu, value: value, isMulti: isMulti, currentOptions: currentOptions, fieldValue: fieldValue, columns: columns, defaultColumns: defaultColumns, indexFocus: indexFocus, formatSetting: formatSetting, handChange: handChange, compareFunction: compareFunction, setIndexFocus: setIndexFocus, setSearchTerm: setSearchTerm }) }), jsxRuntime.jsxs("div", { className: classNames$1('r-select-footer', {
|
|
20798
|
-
'd-none': !(showFooter === true ||
|
|
20799
|
-
|
|
20800
|
-
isMulti),
|
|
20801
|
-
}), children: [jsxRuntime.jsxs(Button$1$1, { outline: true, color: "primary", onClick: () => handleAdd?.(), className: classNames$1('r-btn d-flex align-items-center', { 'd-none': !handleAdd }), children: [jsxRuntime.jsx(SvgPlus, { className: "me-50", fontSize: 16 }), t('AddNew'), " (F9)"] }), isMulti && (jsxRuntime.jsx("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", children: t('countSelected', { item: value?.length ?? 0 }) })), footerComponent ? footerComponent() : null] })] }) })) }) })] }) }) }));
|
|
20698
|
+
'd-none': !(showFooter === true || handleAdd || isMulti)
|
|
20699
|
+
}), children: [jsxRuntime.jsxs(Button$1$1, { outline: true, color: "primary", onClick: () => handleAdd?.(), className: classNames$1('r-btn d-flex align-items-center', { 'd-none': !handleAdd }), children: [jsxRuntime.jsx(SvgPlus, { className: "me-50", fontSize: 16 }), t('AddNew'), " (F9)"] }), isMulti && jsxRuntime.jsx("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", children: t('countSelected', { item: value?.length ?? 0 }) }), footerComponent ? footerComponent() : null] })] }) })) }) })] }) }) }));
|
|
20802
20700
|
});
|
|
20803
20701
|
|
|
20804
20702
|
const PagingComponent = ({ totalItem, gridRef, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
|
|
@@ -39797,6 +39695,8 @@ const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, form
|
|
|
39797
39695
|
allowNegative: column.numericSettings?.allowNegative ?? false,
|
|
39798
39696
|
decimalScale: column.numericSettings?.fraction ?? 0
|
|
39799
39697
|
};
|
|
39698
|
+
console.log(column.numericSettings?.fraction);
|
|
39699
|
+
console.log(column.field);
|
|
39800
39700
|
let floatValue = parseFloat(valueFilter ?? '0');
|
|
39801
39701
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "r-filter-popup", onKeyDown: (e) => {
|
|
39802
39702
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
@@ -69644,7 +69544,7 @@ const UnExpandAllIcon = ({ className, color = '#7F7F7F', size = 24, onClick, sty
|
|
|
69644
69544
|
};
|
|
69645
69545
|
|
|
69646
69546
|
const RenderContentCol = React__default["default"].memo((props) => {
|
|
69647
|
-
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti
|
|
69547
|
+
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti } = props;
|
|
69648
69548
|
const cellId = `content-${idTable}-row${indexRow}col-${indexCol}`;
|
|
69649
69549
|
const checkOverflow = () => {
|
|
69650
69550
|
const element = document.getElementById(cellId);
|
|
@@ -69666,12 +69566,10 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69666
69566
|
const RenderElement = () => {
|
|
69667
69567
|
if (col.field === '#' || col.type === '#') {
|
|
69668
69568
|
return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer text-center', {
|
|
69669
|
-
'r-active-cell': isSelected
|
|
69569
|
+
'r-active-cell': isSelected
|
|
69670
69570
|
}), style: {
|
|
69671
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69672
|
-
|
|
69673
|
-
: 400,
|
|
69674
|
-
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
69571
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
|
|
69572
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal'
|
|
69675
69573
|
}, onDoubleClick: (e) => {
|
|
69676
69574
|
e.preventDefault();
|
|
69677
69575
|
handleCloseContext();
|
|
@@ -69680,15 +69578,11 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69680
69578
|
}
|
|
69681
69579
|
else if (col.type === 'checkbox' || col.field === 'checkbox') {
|
|
69682
69580
|
return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
69683
|
-
'r-active-cell': isSelected
|
|
69581
|
+
'r-active-cell': isSelected
|
|
69684
69582
|
}), style: {
|
|
69685
69583
|
display: 'flex',
|
|
69686
|
-
justifyContent: col.textAlign === 'center'
|
|
69687
|
-
|
|
69688
|
-
: col.textAlign === 'right'
|
|
69689
|
-
? 'flex-end'
|
|
69690
|
-
: 'flex-start',
|
|
69691
|
-
alignItems: 'center',
|
|
69584
|
+
justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
|
|
69585
|
+
alignItems: 'center'
|
|
69692
69586
|
}, onClick: (e) => {
|
|
69693
69587
|
setSelectedRows(toggleSelect());
|
|
69694
69588
|
e.stopPropagation();
|
|
@@ -69698,12 +69592,8 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69698
69592
|
let value = row[col.field];
|
|
69699
69593
|
// ✅ Format dữ liệu theo loại cột
|
|
69700
69594
|
if (col.type === 'numeric') {
|
|
69701
|
-
value =
|
|
69702
|
-
|
|
69703
|
-
if (!zeroVisiable &&
|
|
69704
|
-
!col.zeroVisiable &&
|
|
69705
|
-
!(row?.sortOrder < 0 || row?.sortOrder > 100000) &&
|
|
69706
|
-
(value === '0' || value === 0)) {
|
|
69595
|
+
value = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69596
|
+
if (!zeroVisiable && !col.zeroVisiable && !(row?.sortOrder < 0 || row?.sortOrder > 100000) && (value === '0' || value === 0)) {
|
|
69707
69597
|
value = '';
|
|
69708
69598
|
}
|
|
69709
69599
|
}
|
|
@@ -69711,43 +69601,31 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69711
69601
|
value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
|
|
69712
69602
|
}
|
|
69713
69603
|
else if (col.type === 'datetime') {
|
|
69714
|
-
value = value
|
|
69715
|
-
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69716
|
-
: '';
|
|
69604
|
+
value = value ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
|
|
69717
69605
|
}
|
|
69718
69606
|
if (col.template) {
|
|
69719
69607
|
value = col.template(row, indexRow) ?? '';
|
|
69720
69608
|
}
|
|
69721
69609
|
const isNegative = col.type === 'numeric' && Number(row[col.field]) < 0;
|
|
69722
|
-
const textColor = isNegative
|
|
69723
|
-
|
|
69724
|
-
|
|
69725
|
-
const
|
|
69726
|
-
const suffix = isNegative ? (formatSetting?.suffixNegative ?? '') : '';
|
|
69727
|
-
const displayText = isNegative
|
|
69728
|
-
? `${prefix}${value}${suffix}`
|
|
69729
|
-
: (value ?? '');
|
|
69610
|
+
const textColor = isNegative ? formatSetting?.colorNegative ?? 'red' : undefined;
|
|
69611
|
+
const prefix = isNegative ? formatSetting?.prefixNegative ?? '-' : '';
|
|
69612
|
+
const suffix = isNegative ? formatSetting?.suffixNegative ?? '' : '';
|
|
69613
|
+
const displayText = isNegative ? `${prefix}${value}${suffix}` : value ?? '';
|
|
69730
69614
|
return (jsxRuntime.jsxs("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
69731
|
-
'r-active-cell': isSelected
|
|
69615
|
+
'r-active-cell': isSelected
|
|
69732
69616
|
}), style: {
|
|
69733
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69734
|
-
|
|
69735
|
-
: 400,
|
|
69736
|
-
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
69617
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
|
|
69618
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal'
|
|
69737
69619
|
}, children: [jsxRuntime.jsx("div", { className: "r-cell-text", style: {
|
|
69738
69620
|
display: 'flex',
|
|
69739
|
-
justifyContent: col.textAlign === 'center'
|
|
69740
|
-
|
|
69741
|
-
: col.textAlign === 'right'
|
|
69742
|
-
? 'flex-end'
|
|
69743
|
-
: 'flex-start',
|
|
69744
|
-
alignItems: 'center',
|
|
69621
|
+
justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
|
|
69622
|
+
alignItems: 'center'
|
|
69745
69623
|
}, children: jsxRuntime.jsx("div", { id: cellId, style: {
|
|
69746
69624
|
color: textColor,
|
|
69747
69625
|
overflow: 'hidden',
|
|
69748
69626
|
textOverflow: 'ellipsis',
|
|
69749
69627
|
whiteSpace: 'pre',
|
|
69750
|
-
maxWidth: '100%'
|
|
69628
|
+
maxWidth: '100%'
|
|
69751
69629
|
}, children: displayText }) }), checkOverflow() && (jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: cellId, placement: "top", children: jsxRuntime.jsx("div", { style: { color: textColor }, onClick: (e) => {
|
|
69752
69630
|
e.stopPropagation();
|
|
69753
69631
|
e.preventDefault();
|
|
@@ -69756,15 +69634,10 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69756
69634
|
};
|
|
69757
69635
|
const clickTimerRef = React$5.useRef(null);
|
|
69758
69636
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: col.visible !== false && col.isGroup !== true && (jsxRuntime.jsx("td", { className: classNames$1(`r-rowcell fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, {
|
|
69759
|
-
'fixed-last': (col.fixedType === 'left' &&
|
|
69760
|
-
indexCol === lastObjWidthFixLeft) ||
|
|
69761
|
-
(col.fixedType === 'right' &&
|
|
69762
|
-
indexCol === fisrtObjWidthFixRight),
|
|
69637
|
+
'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight)
|
|
69763
69638
|
}, { 'r-active': isSelected }), style: {
|
|
69764
69639
|
left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
|
|
69765
|
-
right: col.fixedType === 'right'
|
|
69766
|
-
? objWidthFixRight[indexCol]
|
|
69767
|
-
: undefined,
|
|
69640
|
+
right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined
|
|
69768
69641
|
}, onClick: (e) => {
|
|
69769
69642
|
const tag = e.target?.nodeName;
|
|
69770
69643
|
if (tag !== 'DIV' && tag !== 'TD') {
|
|
@@ -69978,9 +69851,9 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69978
69851
|
? colSum.textAlign
|
|
69979
69852
|
: 'left',
|
|
69980
69853
|
}, children: (haveSum || colSum.haveSum === true) &&
|
|
69981
|
-
Number(row[colSum.field] ?? '0') < 0 ? (jsxRuntime.
|
|
69854
|
+
Number(row[colSum.field] ?? '0') < 0 ? (jsxRuntime.jsx("div", { style: {
|
|
69982
69855
|
color: formatSetting?.colorNegative ?? 'red',
|
|
69983
|
-
}, children:
|
|
69856
|
+
}, children: `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}` })) : (sumValue) }) }, `group-sum-cell-${level}-${indexRow}-${indexCol}`));
|
|
69984
69857
|
})] }), expand && (jsxRuntime.jsx(RenderContent, { datas: row.children, level: level + 1 }))] }, `row-${level}-${indexRow}`));
|
|
69985
69858
|
}
|
|
69986
69859
|
else {
|
|
@@ -70055,7 +69928,7 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
70055
69928
|
}) }) })), (viewData.length ?? 0) === 0 && !isLoading && (jsxRuntime.jsxs("div", { className: "r-no-data", children: [jsxRuntime.jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [jsxRuntime.jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), jsxRuntime.jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [jsxRuntime.jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), jsxRuntime.jsx("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })] })] }) }), t('No data available.')] }))] }));
|
|
70056
69929
|
});
|
|
70057
69930
|
|
|
70058
|
-
const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoading, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, handleCellClick, contextMenuItems, headerHeight, handleContextMenuClick
|
|
69931
|
+
const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoading, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, handleCellClick, contextMenuItems, headerHeight, handleContextMenuClick }) => {
|
|
70059
69932
|
const { t } = reactI18next.useTranslation();
|
|
70060
69933
|
const gridRef = React$5.useRef(null);
|
|
70061
69934
|
const [openPopupSetupColumn, setOpenPopupSetupColumn] = React$5.useState(false);
|
|
@@ -70068,8 +69941,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70068
69941
|
const [expandsAll, setExpandsAll] = React$5.useState(true);
|
|
70069
69942
|
const [maximize, setMaximize] = React$5.useState(false);
|
|
70070
69943
|
const [windowHeight, setWindowHeight] = React$5.useState(window.innerHeight);
|
|
70071
|
-
const fieldKey = columns.find((item) => item.isPrimarykey === true)?.field ??
|
|
70072
|
-
'id';
|
|
69944
|
+
const fieldKey = columns.find((item) => item.isPrimarykey === true)?.field ?? 'id';
|
|
70073
69945
|
React$5.useEffect(() => {
|
|
70074
69946
|
const handleResize = () => {
|
|
70075
69947
|
setWindowHeight(window.innerHeight);
|
|
@@ -70079,19 +69951,14 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70079
69951
|
}, []);
|
|
70080
69952
|
const heightTable = React$5.useMemo(() => {
|
|
70081
69953
|
if (maximize) {
|
|
70082
|
-
return
|
|
70083
|
-
(pagingSetting?.allowPaging ? 50 : 0) -
|
|
70084
|
-
(haveSum ? 30 : 0) -
|
|
70085
|
-
(headerHeight ?? 59) -
|
|
70086
|
-
(toolbarSetting?.showBottomToolbar ? 42 : 0) -
|
|
70087
|
-
(toolbarSetting?.showTopToolbar ? 42 : 0));
|
|
69954
|
+
return windowHeight - (pagingSetting?.allowPaging ? 50 : 0) - (haveSum ? 30 : 0) - (headerHeight ?? 59) - (toolbarSetting?.showBottomToolbar ? 42 : 0) - (toolbarSetting?.showTopToolbar ? 42 : 0);
|
|
70088
69955
|
}
|
|
70089
69956
|
return height;
|
|
70090
69957
|
}, [height, maximize, windowHeight]);
|
|
70091
69958
|
const optionsGroupColumn = React$5.useMemo(() => {
|
|
70092
69959
|
return contentColumns.map((col) => ({
|
|
70093
69960
|
...col,
|
|
70094
|
-
headerText: t(col.headerText)
|
|
69961
|
+
headerText: t(col.headerText)
|
|
70095
69962
|
}));
|
|
70096
69963
|
}, [contentColumns]);
|
|
70097
69964
|
React$5.useEffect(() => {
|
|
@@ -70100,7 +69967,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70100
69967
|
}
|
|
70101
69968
|
setExpandsAll(true);
|
|
70102
69969
|
}, [groupSetting?.groupColumns]);
|
|
70103
|
-
const { levels: headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight
|
|
69970
|
+
const { levels: headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight } = React$5.useMemo(() => {
|
|
70104
69971
|
const rs = calculateTableStructure(columns, settingColumns?.value, groupSetting?.groupColumns);
|
|
70105
69972
|
setContentColumns(rs.flat);
|
|
70106
69973
|
return rs;
|
|
@@ -70118,17 +69985,12 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70118
69985
|
}
|
|
70119
69986
|
};
|
|
70120
69987
|
const searchTemplate = () => {
|
|
70121
|
-
return (jsxRuntime.jsx("div", { className: "me-50 r-search", children: jsxRuntime.jsx(ReactInput, { style: { width: '230px' }, value: searchSetting?.searchTerm !== undefined
|
|
70122
|
-
? searchSetting?.searchTerm
|
|
70123
|
-
: searchTerm, setSearchTerm: searchSetting?.setSearchTerm
|
|
70124
|
-
? searchSetting?.setSearchTerm
|
|
70125
|
-
: setSearchTerm, placeholder: t('Search'), onKeyPress: handleKeyPress }) }));
|
|
69988
|
+
return (jsxRuntime.jsx("div", { className: "me-50 r-search", children: jsxRuntime.jsx(ReactInput, { style: { width: '230px' }, value: searchSetting?.searchTerm !== undefined ? searchSetting?.searchTerm : searchTerm, setSearchTerm: searchSetting?.setSearchTerm ? searchSetting?.setSearchTerm : setSearchTerm, placeholder: t('Search'), onKeyPress: handleKeyPress }) }));
|
|
70126
69989
|
};
|
|
70127
69990
|
const groupbtnTemplate = () => {
|
|
70128
69991
|
return (jsxRuntime.jsxs(UncontrolledDropdown, { children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", id: "group-dropdown-toggle", style: { position: 'relative' }, onClick: (e) => e.preventDefault(), children: jsxRuntime.jsx(GroupIcon, { color: "#7F7F7F", size: 24 }) }), jsxRuntime.jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-1", children: [jsxRuntime.jsx("div", { className: "mb-1", style: { fontSize: 16, fontWeight: 500 }, children: "Nh\u00F3m d\u1EEF li\u1EC7u theo c\u1ED9t" }), jsxRuntime.jsxs("div", { className: 'form-group', children: [jsxRuntime.jsx(Label$1, { id: `label-group-1`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 1" }), jsxRuntime.jsx("div", { className: "form-input", children: jsxRuntime.jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[0]
|
|
70129
69992
|
? {
|
|
70130
|
-
headerText: t(contentColumns.find((x) => x.field === groupColumns[0])?.headerText ??
|
|
70131
|
-
contentColumns.find((x) => x.field === groupColumns[0])?.headerText),
|
|
69993
|
+
headerText: t(contentColumns.find((x) => x.field === groupColumns[0])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[0])?.headerText)
|
|
70132
69994
|
}
|
|
70133
69995
|
: undefined, onChange: (val) => {
|
|
70134
69996
|
if (val) {
|
|
@@ -70140,8 +70002,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70140
70002
|
setGroupColumns([...groupColumns]);
|
|
70141
70003
|
}, isClearable: groupColumns?.length === 1 }) })] }), jsxRuntime.jsxs("div", { className: 'form-group', children: [jsxRuntime.jsx(Label$1, { id: `label-group-2`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 2" }), jsxRuntime.jsx("div", { className: "form-input", children: jsxRuntime.jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[1]
|
|
70142
70004
|
? {
|
|
70143
|
-
headerText: t(contentColumns.find((x) => x.field === groupColumns[1])?.headerText ??
|
|
70144
|
-
contentColumns.find((x) => x.field === groupColumns[1])?.headerText),
|
|
70005
|
+
headerText: t(contentColumns.find((x) => x.field === groupColumns[1])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[1])?.headerText)
|
|
70145
70006
|
}
|
|
70146
70007
|
: undefined, onChange: (val) => {
|
|
70147
70008
|
if (val) {
|
|
@@ -70153,8 +70014,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70153
70014
|
setGroupColumns([...groupColumns]);
|
|
70154
70015
|
}, isClearable: groupColumns?.length === 2 }) })] }), jsxRuntime.jsxs("div", { className: 'form-group', children: [jsxRuntime.jsx(Label$1, { id: `label-group-3`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 3" }), jsxRuntime.jsx("div", { className: "form-input", children: jsxRuntime.jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[2]
|
|
70155
70016
|
? {
|
|
70156
|
-
headerText: t(contentColumns.find((x) => x.field === groupColumns[2])?.headerText ??
|
|
70157
|
-
contentColumns.find((x) => x.field === groupColumns[2])?.headerText),
|
|
70017
|
+
headerText: t(contentColumns.find((x) => x.field === groupColumns[2])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[2])?.headerText)
|
|
70158
70018
|
}
|
|
70159
70019
|
: undefined, onChange: (val) => {
|
|
70160
70020
|
if (groupSetting) {
|
|
@@ -70168,7 +70028,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70168
70028
|
}
|
|
70169
70029
|
}, isClearable: groupColumns?.length === 3 }) })] }), jsxRuntime.jsxs("div", { className: "border-top d-flex justify-content-end mt-1", children: [jsxRuntime.jsx(Button$1$1, { color: "primary", className: "mt-1 me-50 rounded", size: "sm", onClick: () => {
|
|
70170
70030
|
groupSetting?.onGroup({
|
|
70171
|
-
columnGrouped: groupColumns.filter((x) => x)
|
|
70031
|
+
columnGrouped: groupColumns.filter((x) => x)
|
|
70172
70032
|
});
|
|
70173
70033
|
document.getElementById('group-dropdown-toggle')?.click();
|
|
70174
70034
|
}, children: `${t('Apply')}` }), jsxRuntime.jsx(Button$1$1, { color: "secondary", outline: true, className: "mt-1 rounded", size: "sm", onClick: () => {
|
|
@@ -70177,16 +70037,14 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70177
70037
|
}, children: `${t('Delete')}` })] })] })] }));
|
|
70178
70038
|
};
|
|
70179
70039
|
const chooseColumnsTemplate = () => {
|
|
70180
|
-
return
|
|
70040
|
+
return jsxRuntime.jsx(SvgSettings, { className: "r-toolbar-icon", fontSize: 20, color: "#7F7F7F", onClick: () => setOpenPopupSetupColumn(true) });
|
|
70181
70041
|
};
|
|
70182
70042
|
const expandTemplate = () => {
|
|
70183
70043
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!expandsAll && (jsxRuntime.jsx(ExpandAllIcon, { onClick: () => {
|
|
70184
70044
|
setExpandsAll(true);
|
|
70185
|
-
}, color: "#7F7F7F", size: 24 })), expandsAll &&
|
|
70045
|
+
}, color: "#7F7F7F", size: 24 })), expandsAll && jsxRuntime.jsx(UnExpandAllIcon, { onClick: () => setExpandsAll(false), color: "#7F7F7F", size: 24 })] }));
|
|
70186
70046
|
};
|
|
70187
|
-
const defaultToolbarOption = searchSetting?.searchEnable
|
|
70188
|
-
? [{ template: searchTemplate, align: 'left' }]
|
|
70189
|
-
: [];
|
|
70047
|
+
const defaultToolbarOption = searchSetting?.searchEnable ? [{ template: searchTemplate, align: 'left' }] : [];
|
|
70190
70048
|
if (groupSetting) {
|
|
70191
70049
|
defaultToolbarOption.push({ template: groupbtnTemplate, align: 'left' });
|
|
70192
70050
|
}
|
|
@@ -70195,10 +70053,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70195
70053
|
}
|
|
70196
70054
|
let toolbarTopOption = [];
|
|
70197
70055
|
if (toolbarSetting?.toolbarOptions) {
|
|
70198
|
-
toolbarTopOption = [
|
|
70199
|
-
...defaultToolbarOption,
|
|
70200
|
-
...toolbarSetting?.toolbarOptions,
|
|
70201
|
-
];
|
|
70056
|
+
toolbarTopOption = [...defaultToolbarOption, ...toolbarSetting?.toolbarOptions];
|
|
70202
70057
|
}
|
|
70203
70058
|
else {
|
|
70204
70059
|
toolbarTopOption = [...defaultToolbarOption];
|
|
@@ -70229,9 +70084,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70229
70084
|
React$5.useEffect(() => {
|
|
70230
70085
|
if (setSelectedItem) {
|
|
70231
70086
|
if (isMulti) {
|
|
70232
|
-
if (dataSource &&
|
|
70233
|
-
selectedRows &&
|
|
70234
|
-
selectedRows?.length !== selectedItem?.length) {
|
|
70087
|
+
if (dataSource && selectedRows && selectedRows?.length !== selectedItem?.length) {
|
|
70235
70088
|
setSelectedItem([...selectedRows]);
|
|
70236
70089
|
if (handleSelect) {
|
|
70237
70090
|
handleSelect([...selectedRows]);
|
|
@@ -70240,8 +70093,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70240
70093
|
}
|
|
70241
70094
|
else {
|
|
70242
70095
|
if (dataSource && selectedRows?.length > 0) {
|
|
70243
|
-
if (!selectedItem ||
|
|
70244
|
-
selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
70096
|
+
if (!selectedItem || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
70245
70097
|
setSelectedItem({ ...selectedRows[0] });
|
|
70246
70098
|
if (handleSelect) {
|
|
70247
70099
|
handleSelect({ ...selectedRows[0] });
|
|
@@ -70260,8 +70112,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70260
70112
|
React$5.useEffect(() => {
|
|
70261
70113
|
if (!isMulti) {
|
|
70262
70114
|
if (dataSource && selectedItem && selectedItem[fieldKey]) {
|
|
70263
|
-
if (selectedRows?.length === 0 ||
|
|
70264
|
-
selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
70115
|
+
if (selectedRows?.length === 0 || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
70265
70116
|
setSelectedRows([selectedItem]);
|
|
70266
70117
|
}
|
|
70267
70118
|
}
|
|
@@ -70270,18 +70121,16 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70270
70121
|
}
|
|
70271
70122
|
}
|
|
70272
70123
|
else {
|
|
70273
|
-
if (dataSource &&
|
|
70274
|
-
selectedItem &&
|
|
70275
|
-
selectedRows?.length !== selectedItem.length) {
|
|
70124
|
+
if (dataSource && selectedItem && selectedRows?.length !== selectedItem.length) {
|
|
70276
70125
|
setSelectedRows(selectedItem ? [...selectedItem] : []);
|
|
70277
70126
|
}
|
|
70278
70127
|
}
|
|
70279
70128
|
}, [selectedItem]);
|
|
70280
70129
|
return (jsxRuntime.jsxs("div", { className: classNames$1('r-table-edit r-virtualized-table', {
|
|
70281
|
-
'is-maximized': maximize
|
|
70282
|
-
}), children: [jsxRuntime.jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar &&
|
|
70130
|
+
'is-maximized': maximize
|
|
70131
|
+
}), children: [jsxRuntime.jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar && jsxRuntime.jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption, maximize: maximize, setMaximize: setMaximize }), headerComponent && headerComponent(), jsxRuntime.jsxs("div", { ref: gridRef, className: "r-gridtable", style: {
|
|
70283
70132
|
height: `${heightTable ? `${heightTable}px` : 'auto'}`,
|
|
70284
|
-
position: 'relative'
|
|
70133
|
+
position: 'relative'
|
|
70285
70134
|
}, children: [jsxRuntime.jsx(TableElement, { idTable: idTable, gridRef: gridRef, isLoading: isLoading, dataSource: dataSource, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, fieldKey: fieldKey, lastObjWidthFixLeft: lastObjWidthFixLeft, fisrtObjWidthFixRight: fisrtObjWidthFixRight, selectedRows: selectedRows, isMulti: isMulti, filterBy: filterBy, orderBy: orderBy, formatSetting: formatSetting, contentColumns: contentColumns, headerColumns: headerColumns, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, searchTerm: searchTerm, searchSetting: searchSetting, columnsAggregate: columnsAggregate, haveSum: haveSum, expandsAll: expandsAll, zeroVisiable: zeroVisiable, contextMenuItems: contextMenuItems, handleContextMenuClick: handleContextMenuClick, setFilterBy: setFilterBy, setSelectedRows: setSelectedRows, setOrderBy: setOrderBy, handleDoubleClick: handleDoubleClick, handleCellClick: handleCellClick, querySetting: querySetting, setContentColumns: setContentColumns, setExpandsAll: setExpandsAll }), isLoading && (jsxRuntime.jsx("div", { className: "r-loading-overlay", children: jsxRuntime.jsxs("div", { className: "r-loading", children: [jsxRuntime.jsx(Spinner$1, { className: "me-1" }), t('Loading...')] }) }))] })] }), pagingSetting?.allowPaging && (jsxRuntime.jsx(PagingComponent, { gridRef: gridRef, onChangePage: onChangePage, pageSize: pagingSetting?.pageSize ?? 0, currentPage: pagingSetting?.currentPage ?? 0, pageOptions: pagingSetting?.pageOptions ?? [20, 30, 50, 100], totalItem: pagingSetting?.totalItem ?? 0, onChangePageSize: onChangePageSize })), jsxRuntime.jsx(SettingColumn, { gridRef: gridRef, handleSidebar: () => {
|
|
70286
70135
|
setOpenPopupSetupColumn(!openPopupSetupColumn);
|
|
70287
70136
|
}, settingColumns: settingColumns, openSidebar: openPopupSetupColumn, column: [...contentColumns], resetDefaultColumns: resetDefaultColumns, setColumn: (newColumns) => {
|
|
@@ -70292,7 +70141,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
70292
70141
|
visible: x.visible,
|
|
70293
70142
|
fixedType: x.fixedType,
|
|
70294
70143
|
width: x.width,
|
|
70295
|
-
sortOrder: index + 1
|
|
70144
|
+
sortOrder: index + 1
|
|
70296
70145
|
})));
|
|
70297
70146
|
}
|
|
70298
70147
|
} })] }));
|