react-table-edit 1.4.24 → 1.4.26

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.
@@ -1,5 +1,5 @@
1
1
  import { IFTableEditButton, IFTableEditPaging, IFTableEditToolbar } from "../type";
2
- export declare const handleAdd: (dataSource: any[], tableElement: any, columnFistEdit: any, changeDataSource: (data: any[], numberOfRows?: number) => void, pagingSetting: {
2
+ export declare const handleAdd: (dataSource: any[], tableElement: any, indexFirstEdit: any, changeDataSource: (data: any[], numberOfRows?: number) => void, pagingSetting: {
3
3
  setCurrentPage?: (page: number) => void;
4
4
  pageSize?: number;
5
5
  } | undefined, setIndexFocus: (item: number) => void, focusNewElement: (col: number, row: number, onLoad?: boolean) => void, numberOfRows?: number) => void;
@@ -13,8 +13,8 @@ type IFDataProps = {
13
13
  changeOrder: (data: IFOrderTable[]) => void;
14
14
  indexCol: number;
15
15
  indexParent: number;
16
- objWidthFixLeft: any;
17
- objWidthFixRight: any;
16
+ objHeaderWidthFixLeft: any;
17
+ objHeaderWidthFixRight: any;
18
18
  totalCount: number;
19
19
  lastObjWidthFixLeft: number;
20
20
  fisrtObjWidthFixRight: number;
@@ -9,7 +9,7 @@ export interface KeyHandlerParams {
9
9
  idElement: string;
10
10
  pagingClient?: boolean;
11
11
  totalCount: number;
12
- columnLastEdit: number;
12
+ indexLastEdit: number;
13
13
  editDisable?: boolean;
14
14
  addDisable?: boolean;
15
15
  pagingSetting?: IFTableEditPaging;
@@ -45,6 +45,8 @@ export declare const calculateTableStructure: (columns: any[]) => {
45
45
  objWidthFixRight: Record<number, number>;
46
46
  lastObjWidthFixLeft: number;
47
47
  fisrtObjWidthFixRight: number;
48
- firstEdit: any;
49
- lastEdit: any;
48
+ objHeaderWidthFixRight: Record<string, number>;
49
+ objHeaderWidthFixLeft: Record<string, number>;
50
+ indexFirstEdit: number;
51
+ indexLastEdit: number;
50
52
  };
package/dist/index.d.ts CHANGED
@@ -516,8 +516,10 @@ declare const calculateTableStructure: (columns: any[]) => {
516
516
  objWidthFixRight: Record<number, number>;
517
517
  lastObjWidthFixLeft: number;
518
518
  fisrtObjWidthFixRight: number;
519
- firstEdit: any;
520
- lastEdit: any;
519
+ objHeaderWidthFixRight: Record<string, number>;
520
+ objHeaderWidthFixLeft: Record<string, number>;
521
+ indexFirstEdit: number;
522
+ indexLastEdit: number;
521
523
  };
522
524
 
523
525
  type IFDataProps$1 = {
package/dist/index.js CHANGED
@@ -19318,15 +19318,31 @@ const calculateTableStructure = (columns) => {
19318
19318
  const flat = [];
19319
19319
  const objWidthFixLeft = {};
19320
19320
  const objWidthFixRight = {};
19321
+ const objHeaderWidthFixRight = {};
19322
+ const objHeaderWidthFixLeft = {};
19321
19323
  let maxDepth = 0;
19322
19324
  // Tính depth tối đa
19323
19325
  const calculateDepth = (cols, depth = 1) => (Math.max(...cols.map(col => (col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth))));
19324
19326
  maxDepth = calculateDepth(columns);
19325
19327
  let leftTotal = 0;
19326
19328
  let rightTotal = 0;
19329
+ // Tính tổng width của các cột cố định phải
19330
+ const calcTotalRightWidth = (cols) => {
19331
+ cols.forEach(col => {
19332
+ if (col.columns?.length) {
19333
+ calcTotalRightWidth(col.columns);
19334
+ }
19335
+ else {
19336
+ if (col.fixedType === 'right' && col.visible !== false) {
19337
+ rightTotal += col.width ?? 40;
19338
+ }
19339
+ }
19340
+ });
19341
+ };
19342
+ calcTotalRightWidth(columns);
19327
19343
  const traverse = (cols, level = 0) => {
19328
19344
  levels[level] = levels[level] || [];
19329
- return cols.reduce((colspanSum, col) => {
19345
+ return cols.reduce((colspanSum, col, indexCol) => {
19330
19346
  const hasChildren = (col.columns?.length ?? 0) > 0;
19331
19347
  const colspan = hasChildren ? traverse(col.columns, level + 1) : 1;
19332
19348
  const cell = {
@@ -19336,21 +19352,27 @@ const calculateTableStructure = (columns) => {
19336
19352
  rowspan: hasChildren ? 1 : maxDepth - level
19337
19353
  };
19338
19354
  levels[level].push(cell);
19355
+ const headerKey = `${level}-${indexCol}`;
19356
+ if (col.fixedType === 'left' && col.visible !== false) {
19357
+ objHeaderWidthFixLeft[headerKey] = leftTotal;
19358
+ }
19339
19359
  if (!hasChildren) {
19340
- const visible = col.visible !== false;
19341
19360
  const index = flat.length;
19342
19361
  const width = col.width ?? 40;
19343
19362
  cell.index = index;
19344
19363
  flat.push(cell);
19345
- if (col.fixedType === 'left' && visible) {
19364
+ if (col.fixedType === 'left' && col.visible !== false) {
19346
19365
  objWidthFixLeft[index] = leftTotal;
19347
19366
  leftTotal += width;
19348
19367
  }
19349
- if (col.fixedType === 'right' && visible) {
19368
+ if (col.fixedType === 'right' && col.visible !== false) {
19369
+ rightTotal -= width;
19350
19370
  objWidthFixRight[index] = rightTotal;
19351
- rightTotal += width;
19352
19371
  }
19353
19372
  }
19373
+ if (col.fixedType === 'right' && col.visible !== false) {
19374
+ objHeaderWidthFixRight[headerKey] = rightTotal;
19375
+ }
19354
19376
  return colspanSum + colspan;
19355
19377
  }, 0);
19356
19378
  };
@@ -19358,9 +19380,8 @@ const calculateTableStructure = (columns) => {
19358
19380
  const flatVisble = flat.filter((e) => e.visible !== false);
19359
19381
  const lastObjWidthFixLeft = Math.max(...Object.keys(objWidthFixLeft).map(Number), 0);
19360
19382
  const fisrtObjWidthFixRight = Math.min(...Object.keys(objWidthFixRight).map(Number), flat.length);
19361
- const editableColumns = flat.filter(item => item.editEnable && item.visible !== false && !item.disabledCondition);
19362
- const firstEdit = editableColumns[0];
19363
- const lastEdit = editableColumns[editableColumns.length - 1];
19383
+ const indexFirstEdit = flat.findIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition) + 1;
19384
+ const indexLastEdit = flat.findLastIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition) + 1;
19364
19385
  return {
19365
19386
  levels,
19366
19387
  flat,
@@ -19369,8 +19390,10 @@ const calculateTableStructure = (columns) => {
19369
19390
  objWidthFixRight,
19370
19391
  lastObjWidthFixLeft,
19371
19392
  fisrtObjWidthFixRight,
19372
- firstEdit,
19373
- lastEdit
19393
+ objHeaderWidthFixRight,
19394
+ objHeaderWidthFixLeft,
19395
+ indexFirstEdit,
19396
+ indexLastEdit
19374
19397
  };
19375
19398
  };
19376
19399
 
@@ -41816,7 +41839,7 @@ var css_248z$1 = ".react-resizable {\n position: relative;\n}\n.react-resizable
41816
41839
  styleInject(css_248z$1);
41817
41840
 
41818
41841
  const HeaderTableCol$1 = (props) => {
41819
- const { selectEnable, dataSource, setSelectedRows, col, indexCol, indexParent, objWidthFixLeft, objWidthFixRight, totalCount, selectedRows, columns, setColumns, orderBy, changeFilter, filterBy, changeOrder, allowFilter, allowOrder, container, fisrtObjWidthFixRight, lastObjWidthFixLeft, formatSetting, optionsFilter, idTable, isMulti } = props;
41842
+ const { selectEnable, dataSource, setSelectedRows, col, indexCol, indexParent, objHeaderWidthFixLeft, objHeaderWidthFixRight, totalCount, selectedRows, columns, setColumns, orderBy, changeFilter, filterBy, changeOrder, allowFilter, allowOrder, container, fisrtObjWidthFixRight, lastObjWidthFixLeft, formatSetting, optionsFilter, idTable, isMulti } = props;
41820
41843
  const { t } = reactI18next.useTranslation();
41821
41844
  const headerRef = React$5.useRef(null);
41822
41845
  const order = orderBy.find((item) => item.key === col.field);
@@ -41844,8 +41867,8 @@ const HeaderTableCol$1 = (props) => {
41844
41867
  };
41845
41868
  return (jsxRuntime.jsx(React$5.Fragment, { children: col.visible !== false && (jsxRuntime.jsx(Resizable, { className: "r-resize", width: typeof col.width === 'number' ? col.width : Number((col.width ?? "").replaceAll(new RegExp(`[^0-9]`, "g"), '')), height: 0, onResize: handleResize, draggableOpts: { enableUserSelectHack: false }, children: jsxRuntime.jsx("th", { rowSpan: col.rowspan !== 1 ? col.rowspan : 1, colSpan: col.columns?.filter(x => x.visible !== false)?.length ?? 1, className: classNames$1(`r-headercell fix-${col.fixedType}`, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'cell-fixed': col.fixedType }), style: {
41846
41869
  top: `${indexParent * 42}px`,
41847
- left: col.fixedType === 'left' ? objWidthFixLeft[indexCol ?? 0] : undefined,
41848
- right: col.fixedType === 'right' ? objWidthFixRight[indexCol ?? 0] : undefined
41870
+ left: col.fixedType === 'left' ? objHeaderWidthFixLeft[`${indexParent}-${indexCol ?? 0}`] : undefined,
41871
+ right: col.fixedType === 'right' ? objHeaderWidthFixRight[`${indexParent}-${indexCol ?? 0}`] : undefined
41849
41872
  }, children: jsxRuntime.jsxs("div", { style: { justifyContent: 'space-between' }, onClick: () => {
41850
41873
  if (order) {
41851
41874
  if (order.direction === 'asc') {
@@ -41869,7 +41892,7 @@ const HeaderTableCol$1 = (props) => {
41869
41892
  setSelectedRows([]);
41870
41893
  }
41871
41894
  }
41872
- } })), col.field !== 'checkbox' && jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'header-content', style: { justifyContent: col.textAlign ?? 'left' }, children: [jsxRuntime.jsx("span", { id: `header-${idTable}-${indexParent}-${indexCol}`, ref: headerRef, className: 'text-content', children: t(col.headerText ?? '') }), checkOverflow() && jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `header-${idTable}-${indexParent}-${indexCol}`, children: t(col.headerText ?? '') })] }), col.field !== '#' && col.field !== 'command' && jsxRuntime.jsxs("div", { className: 'd-flex', children: [allowOrder && order?.direction === 'asc' && jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: 'ms-25', width: "10", height: "10", viewBox: "0 0 16 18", fill: "none", children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_520_6)", children: jsxRuntime.jsx("path", { d: "M8.70711 0.292893C8.31658 -0.0976311 7.68342 -0.0976311 7.29289 0.292893L0.928932 6.65685C0.538408 7.04738 0.538408 7.68054 0.928932 8.07107C1.31946 8.46159 1.95262 8.46159 2.34315 8.07107L8 2.41421L13.6569 8.07107C14.0474 8.46159 14.6805 8.46159 15.0711 8.07107C15.4616 7.68054 15.4616 7.04738 15.0711 6.65685L8.70711 0.292893ZM8 18H9L9 1H8H7L7 18H8Z", fill: "black" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_520_6", children: jsxRuntime.jsx("rect", { width: "16", height: "18", fill: "white" }) }) })] }), allowOrder && order?.direction === 'desc' && jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: 'ms-25', width: "10", height: "10", viewBox: "0 0 16 18", fill: "none", children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_520_2)", children: jsxRuntime.jsx("path", { d: "M7.29289 17.7071C7.68342 18.0976 8.31658 18.0976 8.70711 17.7071L15.0711 11.3431C15.4616 10.9526 15.4616 10.3195 15.0711 9.92893C14.6805 9.53841 14.0474 9.53841 13.6569 9.92893L8 15.5858L2.34315 9.92893C1.95262 9.53841 1.31946 9.53841 0.928932 9.92893C0.538408 10.3195 0.538408 10.9526 0.928932 11.3431L7.29289 17.7071ZM8 0L7 0L7 17H8H9L9 0L8 0Z", fill: "black" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_520_2", children: jsxRuntime.jsx("rect", { width: "16", height: "18", fill: "white" }) }) })] }), allowFilter && jsxRuntime.jsxs(Dropdown$1, { isOpen: openFilter, toggle: (e) => {
41895
+ } })), col.field !== 'checkbox' && jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'header-content', style: { justifyContent: col.textAlign ?? 'left' }, children: [jsxRuntime.jsx("span", { id: `header-${idTable}-${indexParent}-${indexCol}`, ref: headerRef, className: 'text-content', children: t(col.headerText ?? '') }), checkOverflow() && jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `header-${idTable}-${indexParent}-${indexCol}`, children: t(col.headerText ?? '') })] }), col.field !== '#' && col.field !== 'command' && jsxRuntime.jsxs("div", { className: 'd-flex', children: [allowOrder && order?.direction === 'asc' && jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: 'ms-25', width: "10", height: "10", viewBox: "0 0 16 18", fill: "none", children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_520_6)", children: jsxRuntime.jsx("path", { d: "M8.70711 0.292893C8.31658 -0.0976311 7.68342 -0.0976311 7.29289 0.292893L0.928932 6.65685C0.538408 7.04738 0.538408 7.68054 0.928932 8.07107C1.31946 8.46159 1.95262 8.46159 2.34315 8.07107L8 2.41421L13.6569 8.07107C14.0474 8.46159 14.6805 8.46159 15.0711 8.07107C15.4616 7.68054 15.4616 7.04738 15.0711 6.65685L8.70711 0.292893ZM8 18H9L9 1H8H7L7 18H8Z", fill: "black" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_520_6", children: jsxRuntime.jsx("rect", { width: "16", height: "18", fill: "white" }) }) })] }), allowOrder && order?.direction === 'desc' && jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: 'ms-25', width: "10", height: "10", viewBox: "0 0 16 18", fill: "none", children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_520_2)", children: jsxRuntime.jsx("path", { d: "M7.29289 17.7071C7.68342 18.0976 8.31658 18.0976 8.70711 17.7071L15.0711 11.3431C15.4616 10.9526 15.4616 10.3195 15.0711 9.92893C14.6805 9.53841 14.0474 9.53841 13.6569 9.92893L8 15.5858L2.34315 9.92893C1.95262 9.53841 1.31946 9.53841 0.928932 9.92893C0.538408 10.3195 0.538408 10.9526 0.928932 11.3431L7.29289 17.7071ZM8 0L7 0L7 17H8H9L9 0L8 0Z", fill: "black" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_520_2", children: jsxRuntime.jsx("rect", { width: "16", height: "18", fill: "white" }) }) })] }), allowFilter && (col.columns?.length ?? 0) === 0 && col.allowFilter !== false && jsxRuntime.jsxs(Dropdown$1, { isOpen: openFilter, toggle: (e) => {
41873
41896
  setOpenFilter(!openFilter);
41874
41897
  e.stopPropagation();
41875
41898
  }, onClick: (e) => {
@@ -41946,7 +41969,7 @@ const RenderFilterElement$1 = ({ filter, optionsFilter, formatSetting, filterBy,
41946
41969
  handleSave();
41947
41970
  e.stopPropagation();
41948
41971
  }
41949
- }, children: [((!column.filterType && column.editType === 'numeric') || column.filterType === 'numeric') ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [RenderNumberFilter(), " "] }) : (column.filterType === 'select' ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [RenderSelectFilter(), " "] }) : RenderStringFilter()), jsxRuntime.jsxs("div", { className: 'd-flex justify-content-end', children: [jsxRuntime.jsx(Button$1, { color: 'primary', style: { borderRadius: 3 }, className: 'me-50 py-25 px-50 fw-bold', onClick: handleSave, children: t('Filter') }), jsxRuntime.jsx(Button$1, { className: 'py-25 px-50 fw-bold', outline: true, style: { borderRadius: 3 }, onClick: () => {
41972
+ }, children: [((!column.filterType && column.editType === 'numeric') || column.filterType === 'numeric') ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [RenderNumberFilter(), " "] }) : (column.filterType === 'select' ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [RenderSelectFilter(), " "] }) : RenderStringFilter()), jsxRuntime.jsxs("div", { className: 'd-flex justify-content-end', children: [jsxRuntime.jsx(Button$1, { color: 'primary', style: { borderRadius: 3 }, className: 'me-50 py-25 px-50 fw-bold', onClick: handleSave, children: t('Filter') }), jsxRuntime.jsx(Button$1, { className: 'py-25 px-50 fw-bold', color: 'white', style: { borderRadius: 3, borderWidth: 0 }, onClick: () => {
41950
41973
  if (filterBy) {
41951
41974
  changeFilter(filterBy.filter((x) => x.key !== column.field));
41952
41975
  }
@@ -42343,7 +42366,7 @@ const RenderToolbarTop = ({ toolbarTopOption }) => {
42343
42366
  }) })] }) }));
42344
42367
  };
42345
42368
 
42346
- const handleAdd = (dataSource, tableElement, columnFistEdit,
42369
+ const handleAdd = (dataSource, tableElement, indexFirstEdit,
42347
42370
  /*eslint-disable*/
42348
42371
  changeDataSource, pagingSetting, setIndexFocus, focusNewElement,
42349
42372
  /*eslint-enable*/
@@ -42355,7 +42378,7 @@ numberOfRows) => {
42355
42378
  }
42356
42379
  if (tableElement) {
42357
42380
  setIndexFocus(lengthData);
42358
- focusNewElement(columnFistEdit, lengthData + 1, true);
42381
+ focusNewElement(indexFirstEdit, lengthData + 1, true);
42359
42382
  }
42360
42383
  };
42361
42384
  const handleDuplicate = async (dataSource, indexFocus, fieldKey, defaultValue, fieldUniKey,
@@ -42553,8 +42576,8 @@ const handleArrowDown = (e, params) => {
42553
42576
  }
42554
42577
  };
42555
42578
  const handleTab = (e, params) => {
42556
- const { indexCol, columnLastEdit, indexRow, totalCount, moveIndexRowToNewPage, pagingClient, pagingSetting, setIndexFocus, focusNewElement } = params;
42557
- if (indexCol === columnLastEdit) {
42579
+ const { indexCol, indexLastEdit, indexRow, totalCount, moveIndexRowToNewPage, pagingClient, pagingSetting, setIndexFocus, focusNewElement } = params;
42580
+ if (indexCol === indexLastEdit) {
42558
42581
  if (indexRow === totalCount) {
42559
42582
  moveIndexRowToNewPage();
42560
42583
  }
@@ -42757,7 +42780,7 @@ const TableEdit = React$5.forwardRef((props, ref) => {
42757
42780
  pagingSetting.setCurrentPage(1);
42758
42781
  }
42759
42782
  }, [dataSource]);
42760
- const { levels: headerColumns, flatVisble, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight, firstEdit: columnFirstEdit, lastEdit: columnLastEdit } = React$5.useMemo(() => {
42783
+ const { levels: headerColumns, flatVisble, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight, objHeaderWidthFixLeft, objHeaderWidthFixRight, indexFirstEdit: indexFirstEdit, indexLastEdit: indexLastEdit } = React$5.useMemo(() => {
42761
42784
  const obj = calculateTableStructure(columns);
42762
42785
  setContentColumns(obj.flat);
42763
42786
  return obj;
@@ -43091,13 +43114,13 @@ const TableEdit = React$5.forwardRef((props, ref) => {
43091
43114
  }
43092
43115
  if (tableElement) {
43093
43116
  setIndexFocus(totalCount);
43094
- focusNewElement(columnFirstEdit, totalCount + 1, true);
43117
+ focusNewElement(indexFirstEdit, totalCount + 1, true);
43095
43118
  }
43096
43119
  };
43097
43120
  const checkKeyDown = (e, row, col, indexRow, indexCol) => {
43098
43121
  const idElement = `${idTable}-col${indexCol}-row${indexRow}`;
43099
43122
  const params = {
43100
- columnLastEdit,
43123
+ indexLastEdit,
43101
43124
  contentColumns,
43102
43125
  dataSource,
43103
43126
  addDisable,
@@ -43386,14 +43409,14 @@ const TableEdit = React$5.forwardRef((props, ref) => {
43386
43409
  }, [selectedItem]);
43387
43410
  const renderContentCol = (col, row, indexRow, indexCol, isSelected) => {
43388
43411
  if (col.field === 'command') {
43389
- return (col.visible !== false && jsxRuntime.jsx("td", { className: classNames$1(`r-rowcell p-0 fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'r-active': (isSelected && editDisable) || indexFocus === indexRow }), style: {
43412
+ return (col.visible !== false && jsxRuntime.jsx("td", { role: "gridcell", "aria-colindex": indexCol, className: classNames$1(`r-rowcell p-0 fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'r-active': (isSelected && editDisable) || indexFocus === indexRow }), style: {
43390
43413
  left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
43391
43414
  right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined,
43392
43415
  textAlign: col.textAlign ? col.textAlign : 'left',
43393
43416
  }, children: jsxRuntime.jsx("div", { className: "r-rowcell-div command", children: jsxRuntime.jsx(CommandElement, { commandItems: col.commandItems ?? [], handleCommandClick: handleCommandClick, indexRow: indexRow, rowData: row, setIndexFocus: setIndexFocus, indexFocus: indexFocus }) }) }, `col-${indexRow}-${indexCol}`));
43394
43417
  }
43395
43418
  else if (col.field === '#') {
43396
- return (col.visible !== false && jsxRuntime.jsx("td", { className: classNames$1(`r-rowcell p-0 cursor-pointer fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'r-active': (isSelected && editDisable) || indexFocus === indexRow }), tabIndex: Number(`${indexRow}${indexCol}`), style: {
43419
+ return (col.visible !== false && jsxRuntime.jsx("td", { role: "gridcell", "aria-colindex": indexCol, className: classNames$1(`r-rowcell p-0 cursor-pointer fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'r-active': (isSelected && editDisable) || indexFocus === indexRow }), tabIndex: Number(`${indexRow}${indexCol}`), style: {
43397
43420
  left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
43398
43421
  right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined,
43399
43422
  textAlign: 'center',
@@ -43431,7 +43454,7 @@ const TableEdit = React$5.forwardRef((props, ref) => {
43431
43454
  }, children: jsxRuntime.jsx("div", { className: "r-rowcell-div", children: indexRow + 1 }) }, `col-${indexRow}-${indexCol}`));
43432
43455
  }
43433
43456
  else if (col.field === 'checkbox') {
43434
- return (jsxRuntime.jsx("td", { className: classNames$1(`r-rowcell p-0 fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'r-active': (isSelected && editDisable) || indexFocus === indexRow }), style: {
43457
+ return (jsxRuntime.jsx("td", { role: "gridcell", "aria-colindex": indexCol, className: classNames$1(`r-rowcell p-0 fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'r-active': (isSelected && editDisable) || indexFocus === indexRow }), style: {
43435
43458
  left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
43436
43459
  right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined,
43437
43460
  }, children: jsxRuntime.jsx("div", { className: "r-rowcell-div cursor-pointer", style: { alignItems: 'center' }, onClick: (e) => {
@@ -43471,7 +43494,7 @@ const TableEdit = React$5.forwardRef((props, ref) => {
43471
43494
  }
43472
43495
  const typeDis = !editDisable && (indexFocus === indexRow || col.editType === 'checkbox') && (!col.disabledCondition || !col.disabledCondition(row)) ? (col.editEnable ? 1 : (col.template ? 2 : 3)) : (col.template ? 2 : 3);
43473
43496
  const errorMessage = typeDis === 1 || col.field === '' || !col.validate ? '' : col.validate(row[col.field], row);
43474
- return (jsxRuntime.jsx(React$5.Fragment, { children: col.visible !== false && jsxRuntime.jsx("td", { className: classNames$1(`r-rowcell fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'r-active': (isSelected && editDisable) || indexFocus === indexRow }), style: {
43497
+ return (jsxRuntime.jsx(React$5.Fragment, { children: col.visible !== false && jsxRuntime.jsx("td", { role: "gridcell", "aria-colindex": indexCol, className: classNames$1(`r-rowcell fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'r-active': (isSelected && editDisable) || indexFocus === indexRow }), style: {
43475
43498
  left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
43476
43499
  right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined,
43477
43500
  }, onClick: (e) => {
@@ -43569,33 +43592,30 @@ const TableEdit = React$5.forwardRef((props, ref) => {
43569
43592
  });
43570
43593
  return isFilterMatch && isSearchMatch;
43571
43594
  }
43572
- const renderData = () => {
43573
- return (dataSource.map((row, indexRow) => {
43574
- const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
43575
- const flagSearch = checkRowMatch(row, filterBy, searchSetting?.searchTerm !== undefined ? searchSetting?.searchTerm : searchTerm, searchSetting?.keyField ?? []);
43576
- if (flagSearch) {
43577
- const flagDisplay = !pagingClient || ((indexRow + 1) > ((pagingSetting.pageSize ?? 0) * ((pagingSetting.currentPage ?? 0) - 1)) && (indexRow + 1) <= ((pagingSetting.pageSize ?? 0) * ((pagingSetting.currentPage ?? 0))));
43578
- return (flagDisplay && jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("tr", { className: classNames$1('r-row'), children: contentColumns.map((col, indexCol) => renderContentCol(col, row, indexRow, indexCol, isSelected)) }, `row-${indexRow}`) }));
43579
- }
43580
- }));
43581
- };
43582
43595
  React$5.useEffect(() => {
43583
43596
  if (pagingClient && pagingSetting?.setCurrentPage && (searchSetting?.searchTerm !== undefined ? searchSetting?.searchTerm : searchTerm)) {
43584
43597
  pagingSetting?.setCurrentPage(1);
43585
43598
  }
43586
43599
  }, [searchTerm, searchSetting?.searchTerm]);
43587
- return (jsxRuntime.jsxs(React$5.Fragment, { children: [jsxRuntime.jsxs("div", { className: "react-table-edit", children: [jsxRuntime.jsxs("div", { className: 'r-grid', ref: gridRef, children: [toolbarSetting?.showTopToolbar && jsxRuntime.jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), jsxRuntime.jsx("div", { ref: tableElement, className: "r-gridtable", style: { height: `${height ? `${height}px` : 'auto'}`, minHeight: `${minHeight ? `${minHeight}px` : ''}`, maxHeight: `${maxHeight ? `${maxHeight}px` : '400px'}` }, children: jsxRuntime.jsxs("table", { style: { width: '100%' }, children: [jsxRuntime.jsx(RenderColGroup, { contentColumns: flatVisble }), jsxRuntime.jsx("thead", { className: 'r-gridheader', children: headerColumns.map((element, indexParent) => {
43600
+ return (jsxRuntime.jsxs(React$5.Fragment, { children: [jsxRuntime.jsxs("div", { className: "react-table-edit", children: [jsxRuntime.jsxs("div", { className: 'r-grid', ref: gridRef, children: [toolbarSetting?.showTopToolbar && jsxRuntime.jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), jsxRuntime.jsx("div", { ref: tableElement, className: "r-gridtable", style: { height: `${height ? `${height}px` : 'auto'}`, minHeight: `${minHeight ? `${minHeight}px` : ''}`, maxHeight: `${maxHeight ? `${maxHeight}px` : '400px'}` }, children: jsxRuntime.jsxs("table", { style: { width: '100%' }, role: "presentation", children: [jsxRuntime.jsx(RenderColGroup, { contentColumns: flatVisble }), jsxRuntime.jsx("thead", { className: 'r-gridheader', role: "rowgroup", children: headerColumns.map((element, indexParent) => {
43588
43601
  return (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
43589
- return (jsxRuntime.jsx(HeaderTableCol$1, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: tableElement, filterBy: filterBy, orderBy: orderBy, optionsFilter: optionsFilter, allowFilter: allowFilter, allowOrder: allowOrder, formatSetting: formatSetting, changeFilter: (val) => {
43602
+ return (jsxRuntime.jsx(HeaderTableCol$1, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: tableElement, filterBy: filterBy, orderBy: orderBy, optionsFilter: optionsFilter, allowFilter: allowFilter, allowOrder: allowOrder, formatSetting: formatSetting, changeFilter: (val) => {
43590
43603
  setFilterBy([...val]);
43591
43604
  }, changeOrder: (val) => {
43592
43605
  setOrderBy([...val]);
43593
43606
  }, columns: contentColumns, setColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, totalCount: totalCount }, `header-${indexParent}-${index}`));
43594
43607
  }) }, `header-${-indexParent}`));
43595
- }) }), jsxRuntime.jsx("tbody", { className: 'r-gridcontent', children: renderData() }), jsxRuntime.jsx("tfoot", { className: "r-gridfoot", children: haveSum == true ? jsxRuntime.jsx("tr", { className: 'r-row', children: contentColumns.map((col, index) => {
43608
+ }) }), jsxRuntime.jsx("tbody", { className: 'r-gridcontent', role: "rowgroup", children: dataSource.map((row, indexRow) => {
43609
+ const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
43610
+ const flagSearch = checkRowMatch(row, filterBy, searchSetting?.searchTerm !== undefined ? searchSetting?.searchTerm : searchTerm, searchSetting?.keyField ?? []);
43611
+ if (flagSearch) {
43612
+ const flagDisplay = !pagingClient || ((indexRow + 1) > ((pagingSetting.pageSize ?? 0) * ((pagingSetting.currentPage ?? 0) - 1)) && (indexRow + 1) <= ((pagingSetting.pageSize ?? 0) * ((pagingSetting.currentPage ?? 0))));
43613
+ return (flagDisplay && jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("tr", { "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row'), children: contentColumns.map((col, indexCol) => renderContentCol(col, row, indexRow, indexCol, isSelected)) }, `row-${indexRow}`) }));
43614
+ }
43615
+ }) }), jsxRuntime.jsx("tfoot", { className: "r-gridfoot", children: haveSum == true ? jsxRuntime.jsx("tr", { className: 'r-row', children: contentColumns.map((col, index) => {
43596
43616
  return (renderFooterCol(col, index));
43597
43617
  }) }) : jsxRuntime.jsx(jsxRuntime.Fragment, {}) })] }) }), toolbarSetting?.showBottomToolbar && jsxRuntime.jsx(ToolbarBottom, { handleAdd: (numberOfRows) => {
43598
- handleAdd(dataSource, tableElement.current, columnFirstEdit, changeDataSource, pagingSetting, setIndexFocus, focusNewElement, numberOfRows);
43618
+ handleAdd(dataSource, tableElement.current, indexFirstEdit, changeDataSource, pagingSetting, setIndexFocus, focusNewElement, numberOfRows);
43599
43619
  }, handleDuplicate: () => {
43600
43620
  handleDuplicate(dataSource, indexFocus, fieldKey, defaultValue, fieldUniKey, changeDataSource, tableElement, totalCount, toolbarSetting, buttonSetting, editDisable, addDisable, onDuplicate);
43601
43621
  }, handleInsertAfter: () => {
@@ -65797,7 +65817,7 @@ const VirtualTable = ({ idTable, dataSource, rowHeight = 33, height = 400, colum
65797
65817
  }
65798
65818
  }
65799
65819
  };
65800
- return (jsxRuntime.jsxs("div", { className: "react-table-edit r-virtualized-table", children: [jsxRuntime.jsxs("div", { className: 'r-grid', children: [toolbarSetting?.showTopToolbar && jsxRuntime.jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), jsxRuntime.jsxs("div", { ref: gridRef, className: "r-gridtable", onScroll: handleScroll, style: { height: `${height ? `${height}px` : 'auto'}` }, children: [jsxRuntime.jsxs("table", { style: { width: '100%' }, children: [jsxRuntime.jsx(RenderColGroup, { contentColumns: flatVisble }), jsxRuntime.jsx("thead", { className: 'r-gridheader', children: headerColumns.map((rowColumn, indexParent) => (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: rowColumn.map((column, indexColumn) => (jsxRuntime.jsx(HeaderTableCol, { idTable: idTable, col: column, dataSource: dataSource, indexCol: indexColumn, indexParent: indexParent, isMulti: isMutil ?? false, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, columns: contentColumns, setColumns: setColumns, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, orderBy: orderBy, allowFilter: allowFilter, allowOrder: allowOrder, filterBy: filterBy, optionsFilter: optionsFilter, changeFilter: (val) => {
65820
+ return (jsxRuntime.jsxs("div", { className: "react-table-edit r-virtualized-table", children: [jsxRuntime.jsxs("div", { className: 'r-grid', children: [toolbarSetting?.showTopToolbar && jsxRuntime.jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), jsxRuntime.jsxs("div", { ref: gridRef, className: "r-gridtable", onScroll: handleScroll, style: { height: `${height ? `${height}px` : 'auto'}` }, children: [jsxRuntime.jsxs("table", { role: "presentation", style: { width: '100%' }, children: [jsxRuntime.jsx(RenderColGroup, { contentColumns: flatVisble }), jsxRuntime.jsx("thead", { className: 'r-gridheader', role: "rowgroup", children: headerColumns.map((rowColumn, indexParent) => (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: rowColumn.map((column, indexColumn) => (jsxRuntime.jsx(HeaderTableCol, { idTable: idTable, col: column, dataSource: dataSource, indexCol: indexColumn, indexParent: indexParent, isMulti: isMutil ?? false, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, columns: contentColumns, setColumns: setColumns, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, orderBy: orderBy, allowFilter: allowFilter, allowOrder: allowOrder, filterBy: filterBy, optionsFilter: optionsFilter, changeFilter: (val) => {
65801
65821
  setFilterBy([...val]);
65802
65822
  if (changeFilter) {
65803
65823
  changeFilter(val);
@@ -65807,10 +65827,10 @@ const VirtualTable = ({ idTable, dataSource, rowHeight = 33, height = 400, colum
65807
65827
  if (changeOrder) {
65808
65828
  changeOrder(val);
65809
65829
  }
65810
- }, container: gridRef, totalCount: dataSource.length }, `header-${indexParent}-${indexColumn}`))) }, indexParent))) }), jsxRuntime.jsxs("tbody", { className: 'r-gridcontent', children: [adjustedStartIndex > 0 && (jsxRuntime.jsx("tr", { style: { height: adjustedStartIndex * rowHeight }, children: jsxRuntime.jsx("td", { style: { padding: 0 }, colSpan: flatVisble.length }) })), visibleData.map((row, index) => {
65830
+ }, container: gridRef, totalCount: dataSource.length }, `header-${indexParent}-${indexColumn}`))) }, `header-${-indexParent}`))) }), jsxRuntime.jsxs("tbody", { className: 'r-gridcontent', role: "rowgroup", children: [adjustedStartIndex > 0 && (jsxRuntime.jsx("tr", { style: { height: adjustedStartIndex * rowHeight }, children: jsxRuntime.jsx("td", { style: { padding: 0 }, colSpan: flatVisble.length }) })), visibleData.map((row, index) => {
65811
65831
  const indexRow = index + startIndex;
65812
65832
  const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
65813
- return (jsxRuntime.jsx("tr", { className: classNames$1('r-row'), children: contentColumns.map((column, indexCol) => (jsxRuntime.jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: 'field', objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMutil ?? false, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, handleCommandClick: handleCommandClick, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row }, indexCol))) }, `row-${indexRow}`));
65833
+ return (jsxRuntime.jsx("tr", { "aria-rowindex": indexRow + 1, role: "row", className: 'r-row', children: contentColumns.map((column, indexCol) => (jsxRuntime.jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: 'field', objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMutil ?? false, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, handleCommandClick: handleCommandClick, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row }, indexCol))) }, `row-content-${indexRow}`));
65814
65834
  }), dataSource.length > adjustedEndIndex && (jsxRuntime.jsx("tr", { style: { height: (dataSource.length - adjustedEndIndex) * rowHeight }, children: jsxRuntime.jsx("td", { style: { padding: 0 }, colSpan: flatVisble.length }) }))] }), dataSource.length > 0 && jsxRuntime.jsx("tfoot", { className: "r-gridfoot", children: (columnsAggregate?.length ?? 0) > 0 ? jsxRuntime.jsx("tr", { className: 'r-row', children: contentColumns.map((col, indexCol) => {
65815
65835
  const item = columnsAggregate?.find((x) => x.field === col.field);
65816
65836
  let sumValue = item?.value;