es-grid-template 1.9.67 → 1.9.69

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.
@@ -196,10 +196,10 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
196
196
  value: any;
197
197
  rowData: RecordType;
198
198
  }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
199
- onCellStyles?: Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "display" | "position"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "display" | "position">);
200
- onCellHeaderStyles?: Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "display" | "position"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "display" | "position">);
199
+ onCellStyles?: Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position">);
200
+ onCellHeaderStyles?: Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position">);
201
201
  onCell?: (rowData: RecordType, index: number) => import("react").TdHTMLAttributes<HTMLTableCellElement>;
202
- onCellFooterStyles?: Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "display" | "position"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "display" | "position">);
202
+ onCellFooterStyles?: Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position">);
203
203
  getValue?: (row: any, rowIndex: number) => any;
204
204
  getCellProps?: (value: any, row: any, rowIndex: number) => import("./../../grid-component/type").CellProps;
205
205
  headerCellProps?: import("./../../grid-component/type").CellProps;
@@ -297,9 +297,11 @@ const TableHeadCell2 = props => {
297
297
  onChange: e => {
298
298
  table.getToggleAllRowsSelectedHandler()(e);
299
299
  const prevSelected = isSelectionChange?.rowsData ?? [];
300
- const allRowsInPage = table.getRowModel().flatRows;
300
+ const allRows = table.getRowModel().flatRows;
301
+ const allRowsInPage = allRows.map(it => it.original);
301
302
  if (table.getIsAllRowsSelected()) {
302
303
  const cc = excludeItems(prevSelected, allRowsInPage);
304
+ console.log(cc);
303
305
  setIsSelectionChange({
304
306
  isChange: true,
305
307
  type: 'all',
@@ -308,7 +310,8 @@ const TableHeadCell2 = props => {
308
310
  });
309
311
  } else {
310
312
  const abc = [...prevSelected, ...allRowsInPage];
311
- const newSeletedRows = removeDuplicatesByKey(abc, 'id');
313
+ const newSeletedRows = removeDuplicatesByKey(abc, 'rowId');
314
+ console.log('newSeletedRows', newSeletedRows);
312
315
  setIsSelectionChange({
313
316
  isChange: true,
314
317
  type: 'all',
@@ -817,8 +817,8 @@ export const isDateValue = value => {
817
817
 
818
818
  // number timestamp
819
819
  if (typeof value === 'number') {
820
- const date = new Date(value);
821
- return !isNaN(date.getTime());
820
+ // const date = new Date(value)
821
+ return false;
822
822
  }
823
823
  if (typeof value !== 'string') return false;
824
824
  const str = value.trim();
@@ -1045,7 +1045,6 @@ export const shouldInclude = (item, queries, ignoreAccents) => {
1045
1045
  // ignoreAccents = false => so sánh có dấu + uperrcase sensitive
1046
1046
  const abc = ignoreAccents === false ? itemValue === value : itemStr === queryStr;
1047
1047
  condition = isDateComparison ? compareDates(itemDate, queryDate) : abc;
1048
- // condition = isDateComparison ? compareDates(itemDate, queryDate) : (itemValue === value)
1049
1048
  break;
1050
1049
  case "notequal":
1051
1050
  const abcN = ignoreAccents === false ? itemValue !== value : itemStr !== queryStr;
@@ -1054,8 +1053,6 @@ export const shouldInclude = (item, queries, ignoreAccents) => {
1054
1053
  case "greaterthan":
1055
1054
  // @ts-ignore
1056
1055
  condition = isDateComparison ? itemDate > queryDate : itemValue > value;
1057
-
1058
- // condition = isDateComparison ? invalidDate(itemDate) && invalidDate(queryDate) && itemDate > queryDate : itemValue > value;
1059
1056
  break;
1060
1057
  case "greaterthanorequal":
1061
1058
  // @ts-ignore
@@ -305,9 +305,11 @@ const TableHeadCell2 = props => {
305
305
  onChange: e => {
306
306
  table.getToggleAllRowsSelectedHandler()(e);
307
307
  const prevSelected = isSelectionChange?.rowsData ?? [];
308
- const allRowsInPage = table.getRowModel().flatRows;
308
+ const allRows = table.getRowModel().flatRows;
309
+ const allRowsInPage = allRows.map(it => it.original);
309
310
  if (table.getIsAllRowsSelected()) {
310
311
  const cc = (0, _utils.excludeItems)(prevSelected, allRowsInPage);
312
+ console.log(cc);
311
313
  setIsSelectionChange({
312
314
  isChange: true,
313
315
  type: 'all',
@@ -316,7 +318,8 @@ const TableHeadCell2 = props => {
316
318
  });
317
319
  } else {
318
320
  const abc = [...prevSelected, ...allRowsInPage];
319
- const newSeletedRows = (0, _utils.removeDuplicatesByKey)(abc, 'id');
321
+ const newSeletedRows = (0, _utils.removeDuplicatesByKey)(abc, 'rowId');
322
+ console.log('newSeletedRows', newSeletedRows);
320
323
  setIsSelectionChange({
321
324
  isChange: true,
322
325
  type: 'all',
@@ -928,8 +928,8 @@ const isDateValue = value => {
928
928
 
929
929
  // number timestamp
930
930
  if (typeof value === 'number') {
931
- const date = new Date(value);
932
- return !isNaN(date.getTime());
931
+ // const date = new Date(value)
932
+ return false;
933
933
  }
934
934
  if (typeof value !== 'string') return false;
935
935
  const str = value.trim();
@@ -1159,7 +1159,6 @@ const shouldInclude = (item, queries, ignoreAccents) => {
1159
1159
  // ignoreAccents = false => so sánh có dấu + uperrcase sensitive
1160
1160
  const abc = ignoreAccents === false ? itemValue === value : itemStr === queryStr;
1161
1161
  condition = isDateComparison ? compareDates(itemDate, queryDate) : abc;
1162
- // condition = isDateComparison ? compareDates(itemDate, queryDate) : (itemValue === value)
1163
1162
  break;
1164
1163
  case "notequal":
1165
1164
  const abcN = ignoreAccents === false ? itemValue !== value : itemStr !== queryStr;
@@ -1168,8 +1167,6 @@ const shouldInclude = (item, queries, ignoreAccents) => {
1168
1167
  case "greaterthan":
1169
1168
  // @ts-ignore
1170
1169
  condition = isDateComparison ? itemDate > queryDate : itemValue > value;
1171
-
1172
- // condition = isDateComparison ? invalidDate(itemDate) && invalidDate(queryDate) && itemDate > queryDate : itemValue > value;
1173
1170
  break;
1174
1171
  case "greaterthanorequal":
1175
1172
  // @ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-grid-template",
3
- "version": "1.9.67",
3
+ "version": "1.9.69",
4
4
  "description": "es-grid-template",
5
5
  "keywords": [
6
6
  "react",