react-table-edit 1.5.33 → 1.5.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import 'react-resizable/css/styles.css';
3
3
  import { IFFilterTable, IFOrderTable, IFTableEditFormat, IHeaderColumnTable } from '../type';
4
4
  type IFDataProps = {
5
5
  idTable: string;
6
- selectEnable: boolean;
6
+ selectEnable?: boolean;
7
7
  dataSource: any[];
8
8
  setSelectedRows: Dispatch<SetStateAction<any[]>>;
9
9
  col: IHeaderColumnTable;
@@ -12,11 +12,12 @@ type IContentColProps = {
12
12
  objWidthFixRight: any;
13
13
  lastObjWidthFixLeft: number;
14
14
  fisrtObjWidthFixRight: number;
15
- selectEnable?: boolean;
16
15
  isMulti?: boolean;
17
16
  fieldKey: string;
18
17
  zeroVisiable?: boolean;
19
18
  setSelectedRows: (value: any[]) => void;
19
+ handleCloseContext: () => void;
20
+ handleDoubleClick?: (row: any, col: IColumnTable) => void;
20
21
  };
21
22
  export declare const RenderContentCol: (props: IContentColProps) => import("react/jsx-runtime").JSX.Element;
22
23
  export {};
@@ -5,8 +5,6 @@ type TableViewProps = {
5
5
  dataSource: any[];
6
6
  height?: number;
7
7
  columns: IColumnTable[];
8
- selectEnable?: boolean;
9
- isMutil?: boolean;
10
8
  isLoading?: boolean;
11
9
  formatSetting?: IFTableEditFormat;
12
10
  pagingSetting?: IFTableEditPaging;
@@ -39,7 +37,7 @@ type TableViewProps = {
39
37
  resetDefaultColumns?: () => void;
40
38
  saveSettingColumn?: (data: IFSettingColumns[]) => void;
41
39
  setSelectedItem?: Dispatch<SetStateAction<any>>;
42
- handleDoubleClick?: (args: any) => void;
40
+ handleDoubleClick?: (row: any, col: IColumnTable) => void;
43
41
  contextMenuItems?: IContextItem[];
44
42
  handleContextMenuClick?: (context: IContextItem, data: any) => void;
45
43
  isMulti?: boolean;
@@ -224,6 +224,8 @@ export type IColumnTable = {
224
224
  onPaste?: (dataRow: any, dataPaste: any) => void;
225
225
  /** Xác thực dữ liệu được paste */
226
226
  onPasteValidate?: (dataPaste: string, dataRow: any, rowIndex: number) => Promise<any>;
227
+ /** Chỉ dùng cho bảng view */
228
+ onClick?: (dataRow: any, rowIndex: number) => void;
227
229
  /**Không có tác dụng */
228
230
  rowspan?: number;
229
231
  };
@@ -267,6 +269,8 @@ export type IFTableEditToolbar = {
267
269
  toolbarBottomOptions?: IFToolbarOptions[];
268
270
  /** Hiển thị thanh công cụ dưới */
269
271
  showBottomToolbar?: boolean;
272
+ /** Hiển thị nút cài đặt cột */
273
+ hiddenSetting?: boolean;
270
274
  };
271
275
  /** Cấu hình tìm kiếm trong bảng */
272
276
  export type IFTableEditSearchSetting = {
package/dist/index.d.ts CHANGED
@@ -228,6 +228,8 @@ type IColumnTable = {
228
228
  onPaste?: (dataRow: any, dataPaste: any) => void;
229
229
  /** Xác thực dữ liệu được paste */
230
230
  onPasteValidate?: (dataPaste: string, dataRow: any, rowIndex: number) => Promise<any>;
231
+ /** Chỉ dùng cho bảng view */
232
+ onClick?: (dataRow: any, rowIndex: number) => void;
231
233
  /**Không có tác dụng */
232
234
  rowspan?: number;
233
235
  };
@@ -271,6 +273,8 @@ type IFTableEditToolbar = {
271
273
  toolbarBottomOptions?: IFToolbarOptions[];
272
274
  /** Hiển thị thanh công cụ dưới */
273
275
  showBottomToolbar?: boolean;
276
+ /** Hiển thị nút cài đặt cột */
277
+ hiddenSetting?: boolean;
274
278
  };
275
279
  /** Cấu hình tìm kiếm trong bảng */
276
280
  type IFTableEditSearchSetting = {
@@ -703,8 +707,6 @@ type TableViewProps = {
703
707
  dataSource: any[];
704
708
  height?: number;
705
709
  columns: IColumnTable[];
706
- selectEnable?: boolean;
707
- isMutil?: boolean;
708
710
  isLoading?: boolean;
709
711
  formatSetting?: IFTableEditFormat;
710
712
  pagingSetting?: IFTableEditPaging;
@@ -737,7 +739,7 @@ type TableViewProps = {
737
739
  resetDefaultColumns?: () => void;
738
740
  saveSettingColumn?: (data: IFSettingColumns[]) => void;
739
741
  setSelectedItem?: Dispatch<SetStateAction<any>>;
740
- handleDoubleClick?: (args: any) => void;
742
+ handleDoubleClick?: (row: any, col: IColumnTable) => void;
741
743
  contextMenuItems?: IContextItem[];
742
744
  handleContextMenuClick?: (context: IContextItem, data: any) => void;
743
745
  isMulti?: boolean;
package/dist/index.js CHANGED
@@ -19838,7 +19838,7 @@ const generateUUID = () => {
19838
19838
  * @param isDone đã nhập xong
19839
19839
  * @returns
19840
19840
  */
19841
- const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10, isDone, haveNegative = true) => {
19841
+ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2, isDone, haveNegative = true) => {
19842
19842
  if (isDone) {
19843
19843
  str = roundNumber(Number(str), fraction);
19844
19844
  }
@@ -20128,7 +20128,7 @@ const getMaxExpandedLevel = (items, fieldChildren = 'children', level = 0) => {
20128
20128
  });
20129
20129
  return max;
20130
20130
  };
20131
- const findItemInTree = (items, filter, keyFilter = "value", keyChildren = "children") => {
20131
+ const findItemInTree = (items, filter, keyFilter = 'value', keyChildren = 'children') => {
20132
20132
  for (let index = 0; index < items.length; index++) {
20133
20133
  const item = items[index];
20134
20134
  if (item[keyFilter] === filter) {
@@ -39042,7 +39042,7 @@ const HeaderTableCol = (props) => {
39042
39042
  left: col.fixedType === 'left' ? objHeaderWidthFixLeft[`${indexParent}-${indexCol ?? 0}`] : undefined,
39043
39043
  right: col.fixedType === 'right' ? objHeaderWidthFixRight[`${indexParent}-${indexCol ?? 0}`] : undefined
39044
39044
  }, children: jsxRuntime.jsxs("div", { style: { justifyContent: col.textAlign === 'center' ? 'center' : 'space-between' }, onClick: () => {
39045
- if (!allowSorting || col.columns?.length) {
39045
+ if (!allowSorting || col.columns?.length || col.field === 'checkbox') {
39046
39046
  return;
39047
39047
  }
39048
39048
  if (order) {
@@ -39840,12 +39840,12 @@ const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleI
39840
39840
  return (jsxRuntime.jsx("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: jsxRuntime.jsxs("div", { className: "r-toolbar-items", children: [jsxRuntime.jsxs("div", { className: "r-toolbar-left", children: [jsxRuntime.jsxs("div", { className: classNames$1('r-toolbar-item d-flex', { 'd-none': editDisable || addDisable }), "aria-disabled": "false", children: [jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => handleAdd(1), className: "d-flex", children: t('Add item') }), !!buttonSetting?.disableAddMulti && (jsxRuntime.jsxs(UncontrolledDropdown, { className: "nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", className: "me-0 d-flex", children: jsxRuntime.jsx(Button$1$1, { type: "button", color: "success", outline: true, style: { marginLeft: -1 }, className: "px-25", children: jsxRuntime.jsx("svg", { fill: "#28c76f", height: "15", width: "20", viewBox: "0 0 20 20", children: jsxRuntime.jsx("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" }) }) }) }), jsxRuntime.jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-0", children: [jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(10), children: "10 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(20), children: "20 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(30), children: "30 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(40), children: "40 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(50), children: "50 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(100), children: "100 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(1000), children: "1000 h\u00E0ng" })] })] }))] }), (focusRow ?? -1) > -1 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', { 'd-none': editDisable || addDisable || buttonSetting?.duplicateDisable }), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => {
39841
39841
  handleDuplicate();
39842
39842
  }, className: "d-flex", children: t('Duplicate') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', { 'd-none': editDisable || addDisable || buttonSetting?.insertBeforeDisable }), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t('Insert item before') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', { 'd-none': editDisable || addDisable || buttonSetting?.insertAfterDisable }), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t('Insert item after') }) })] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: " " })), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', { 'd-none': editDisable || buttonSetting?.deleteAllDisable }), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t('Delete all item') }) }), toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
39843
- return item.align === 'left' ? (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`)) : ('');
39843
+ return (item.align === 'left' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`)));
39844
39844
  })] }), jsxRuntime.jsx("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
39845
- return item.align === 'center' ? (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`)) : ('');
39845
+ return (item.align === 'center' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`)));
39846
39846
  }) }), jsxRuntime.jsxs("div", { className: "r-toolbar-right", children: [toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
39847
- return item.align === 'right' ? (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`)) : ('');
39848
- }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', { 'd-none': editDisable || addDisable }), "aria-disabled": "false", children: jsxRuntime.jsxs(UncontrolledDropdown, { className: "dropdown-user nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", color: "primary", onClick: (e) => e.preventDefault(), children: jsxRuntime.jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsxRuntime.jsx(DropdownMenu$1, { className: "formula-dropdown icon-dropdown", children: jsxRuntime.jsxs("ul", { className: "mb-0 pe-50", children: [jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\u00E2n b\u1EA3n" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\u00E9p h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\u00E1n h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2193 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng d\u01B0\u1EDBi" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2191 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng tr\u00EAn" })] }) })] }) })] })] }) }));
39847
+ return (item.align === 'right' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`)));
39848
+ }), !toolbarSetting?.hiddenSetting && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', { 'd-none': editDisable || addDisable }), "aria-disabled": "false", children: jsxRuntime.jsxs(UncontrolledDropdown, { className: "dropdown-user nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", color: "primary", onClick: (e) => e.preventDefault(), children: jsxRuntime.jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsxRuntime.jsx(DropdownMenu$1, { className: "formula-dropdown icon-dropdown", children: jsxRuntime.jsxs("ul", { className: "mb-0 pe-50", children: [jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\u00E2n b\u1EA3n" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\u00E9p h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\u00E1n h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2193 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng d\u01B0\u1EDBi" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2191 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng tr\u00EAn" })] }) })] }) })] }))] })] }) }));
39849
39849
  };
39850
39850
 
39851
39851
  const RenderToolbarTop = ({ toolbarTopOption }) => {
@@ -68731,7 +68731,7 @@ const UnExpandAllIcon = ({ className, color = '#7F7F7F', size = 24, onClick, sty
68731
68731
  };
68732
68732
 
68733
68733
  const RenderContentCol = (props) => {
68734
- const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, selectEnable, setSelectedRows, fieldKey, isMulti } = props;
68734
+ const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, fieldKey, isMulti } = props;
68735
68735
  const cellId = `content-${idTable}-row${indexRow}col-${indexCol}`;
68736
68736
  const checkOverflow = () => {
68737
68737
  const element = document.getElementById(cellId);
@@ -68739,31 +68739,27 @@ const RenderContentCol = (props) => {
68739
68739
  };
68740
68740
  const RenderElement = () => {
68741
68741
  if (col.type === 'checkbox' || col.field === 'checkbox') {
68742
- return (jsxRuntime.jsx("div", { className: "r-rowcell-div cursor-pointer", style: { display: 'flex', justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start', alignItems: 'center' }, onClick: (e) => {
68743
- console.log(isMulti);
68744
- console.log(selectEnable);
68745
- if (selectEnable) {
68746
- const index = selectedRows?.findIndex((x) => x[fieldKey] === row[fieldKey]);
68747
- if (index > -1) {
68748
- if (isMulti) {
68749
- selectedRows?.splice(index, 1);
68750
- setSelectedRows([...selectedRows]);
68751
- }
68752
- else {
68753
- setSelectedRows([]);
68754
- }
68742
+ return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer', { 'r-active-cell': isSelected }), style: { display: 'flex', justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start', alignItems: 'center' }, onClick: (e) => {
68743
+ const index = selectedRows?.findIndex((x) => x[fieldKey] === row[fieldKey]);
68744
+ if (index > -1) {
68745
+ if (isMulti) {
68746
+ selectedRows?.splice(index, 1);
68747
+ setSelectedRows([...selectedRows]);
68755
68748
  }
68756
68749
  else {
68757
- if (isMulti) {
68758
- setSelectedRows([...selectedRows, row]);
68759
- }
68760
- else {
68761
- setSelectedRows([row]);
68762
- }
68750
+ setSelectedRows([]);
68751
+ }
68752
+ }
68753
+ else {
68754
+ if (isMulti) {
68755
+ setSelectedRows([...selectedRows, row]);
68756
+ }
68757
+ else {
68758
+ setSelectedRows([row]);
68763
68759
  }
68764
- e.stopPropagation();
68765
68760
  }
68766
- }, children: jsxRuntime.jsx(Input$1, { checked: isSelected, type: "checkbox", className: "cursor-pointer", style: { textAlign: col.textAlign ?? 'center' } }) }));
68761
+ e.stopPropagation();
68762
+ }, children: jsxRuntime.jsx(Input$1, { defaultChecked: isSelected, type: "checkbox", className: "cursor-pointer", style: { textAlign: col.textAlign ?? 'center' } }) }));
68767
68763
  }
68768
68764
  else {
68769
68765
  let value = row[col.field];
@@ -68788,9 +68784,13 @@ const RenderContentCol = (props) => {
68788
68784
  const prefix = isNegative ? formatSetting?.prefixNegative ?? '-' : '';
68789
68785
  const suffix = isNegative ? formatSetting?.suffixNegative ?? '' : '';
68790
68786
  const displayText = isNegative ? `${prefix}${value}${suffix}` : value ?? '';
68791
- return (jsxRuntime.jsxs("div", { className: classNames$1('r-rowcell-div'), style: {
68787
+ return (jsxRuntime.jsxs("div", { className: classNames$1('r-rowcell-div cursor-pointer', { 'r-active-cell': isSelected }), style: {
68792
68788
  fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
68793
68789
  fontStyle: row.haveItalicType ? 'italic' : 'normal'
68790
+ }, onDoubleClick: (e) => {
68791
+ e.preventDefault();
68792
+ handleCloseContext();
68793
+ handleDoubleClick?.(row, col);
68794
68794
  }, children: [jsxRuntime.jsx("div", { className: "r-cell-text", style: {
68795
68795
  display: 'flex',
68796
68796
  justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
@@ -68809,24 +68809,22 @@ const RenderContentCol = (props) => {
68809
68809
  right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined
68810
68810
  }, onClick: (e) => {
68811
68811
  if (e.target.nodeName === 'DIV' || e.target.nodeName === 'TD') {
68812
- if (selectEnable) {
68813
- const index = selectedRows?.findIndex((x) => x[fieldKey] === row[fieldKey]);
68814
- if (index > -1) {
68815
- if (isMulti) {
68816
- selectedRows?.splice(index, 1);
68817
- setSelectedRows([...selectedRows]);
68818
- }
68819
- else {
68820
- setSelectedRows([]);
68821
- }
68812
+ const index = selectedRows?.findIndex((x) => x[fieldKey] === row[fieldKey]);
68813
+ if (index > -1) {
68814
+ if (isMulti) {
68815
+ selectedRows?.splice(index, 1);
68816
+ setSelectedRows([...selectedRows]);
68822
68817
  }
68823
68818
  else {
68824
- if (isMulti) {
68825
- setSelectedRows([...selectedRows, row]);
68826
- }
68827
- else {
68828
- setSelectedRows([row]);
68829
- }
68819
+ setSelectedRows([]);
68820
+ }
68821
+ }
68822
+ else {
68823
+ if (isMulti) {
68824
+ setSelectedRows([...selectedRows, row]);
68825
+ }
68826
+ else {
68827
+ setSelectedRows([row]);
68830
68828
  }
68831
68829
  }
68832
68830
  e.stopPropagation();
@@ -68834,7 +68832,7 @@ const RenderContentCol = (props) => {
68834
68832
  }, children: RenderElement() }, `col-${indexRow}-${indexCol}`)) }));
68835
68833
  };
68836
68834
 
68837
- const TableView = ({ idTable, dataSource, height = 400, columns, isMutil = false, isLoading, selectEnable, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, contextMenuItems, handleContextMenuClick }) => {
68835
+ const TableView = ({ idTable, dataSource, height = 400, columns, isLoading, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, contextMenuItems, handleContextMenuClick }) => {
68838
68836
  const { t } = reactI18next.useTranslation();
68839
68837
  const gridRef = React$5.useRef(null);
68840
68838
  const [openPopupSetupColumn, setOpenPopupSetupColumn] = React$5.useState(false);
@@ -69045,8 +69043,10 @@ const TableView = ({ idTable, dataSource, height = 400, columns, isMutil = false
69045
69043
  }
69046
69044
  };
69047
69045
  React$5.useEffect(() => {
69046
+ console.log(selectedRows);
69047
+ console.log(isMulti);
69048
69048
  if (setSelectedItem) {
69049
- if (isMutil) {
69049
+ if (isMulti) {
69050
69050
  if (dataSource && selectedRows && selectedRows?.length !== selectedItem?.length) {
69051
69051
  setSelectedItem([...selectedRows]);
69052
69052
  if (handleSelect) {
@@ -69073,7 +69073,7 @@ const TableView = ({ idTable, dataSource, height = 400, columns, isMutil = false
69073
69073
  }
69074
69074
  }, [selectedRows]);
69075
69075
  React$5.useEffect(() => {
69076
- if (!isMutil) {
69076
+ if (!isMulti) {
69077
69077
  if (dataSource && selectedItem && selectedItem[fieldKey]) {
69078
69078
  if (selectedRows?.length === 0 || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
69079
69079
  setSelectedRows([selectedItem]);
@@ -69139,14 +69139,10 @@ const TableView = ({ idTable, dataSource, height = 400, columns, isMutil = false
69139
69139
  }
69140
69140
  else {
69141
69141
  const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
69142
- return (jsxRuntime.jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', { 'r-last-row': level === 0 && indexRow === viewData.length - 1 }), onDoubleClick: (e) => {
69143
- e.preventDefault();
69144
- handleCloseContext();
69145
- handleDoubleClick?.(row);
69146
- }, onContextMenu: (e) => {
69142
+ return (jsxRuntime.jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', { 'r-last-row': level === 0 && indexRow === viewData.length - 1 }), onContextMenu: (e) => {
69147
69143
  e.preventDefault();
69148
69144
  handleContextMenu(e, row);
69149
- }, children: contentColumns.map((column, indexCol) => (jsxRuntime.jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMutil ?? false, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row, zeroVisiable: zeroVisiable }, indexCol))) }, `row-content-${indexRow}`));
69145
+ }, children: contentColumns.map((column, indexCol) => (jsxRuntime.jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMulti, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row, zeroVisiable: zeroVisiable, handleCloseContext: handleCloseContext, handleDoubleClick: handleDoubleClick }, indexCol))) }, `row-content-${indexRow}`));
69150
69146
  }
69151
69147
  }) }));
69152
69148
  };
@@ -69174,7 +69170,7 @@ const TableView = ({ idTable, dataSource, height = 400, columns, isMutil = false
69174
69170
  }
69175
69171
  }, [context]);
69176
69172
  return (jsxRuntime.jsxs("div", { className: "r-table-edit r-virtualized-table", children: [jsxRuntime.jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar && jsxRuntime.jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), headerComponent && headerComponent(), jsxRuntime.jsxs("div", { ref: gridRef, className: "r-gridtable", style: { height: `${height ? `${height}px` : 'auto'}`, position: 'relative' }, children: [jsxRuntime.jsxs("table", { role: "presentation", style: { width: '100%' }, children: [jsxRuntime.jsx(RenderColGroup, { contentColumns: contentColumns }), jsxRuntime.jsx("thead", { className: "r-gridheader", role: "rowgroup", children: headerColumns.map((rowColumn, indexParent) => {
69177
- return (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: rowColumn.map((col, index) => (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: gridRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: querySetting?.optionsFilter, allowFiltering: querySetting?.allowFiltering, allowSorting: querySetting?.allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
69173
+ return (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: rowColumn.map((col, index) => (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: true, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: gridRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: querySetting?.optionsFilter, allowFiltering: querySetting?.allowFiltering, allowSorting: querySetting?.allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
69178
69174
  setFilterBy([...val]);
69179
69175
  if (querySetting?.changeFilter) {
69180
69176
  querySetting.changeFilter(val);