es-grid-template 1.8.33 → 1.8.35

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.
@@ -596,7 +596,7 @@ const TableContainerEdit = props => {
596
596
  marginBottom: '.25rem',
597
597
  fontSize: 14
598
598
  }
599
- }, "D\u1EEF li\u1EC7u sao ch\xE9p v\u01B0\u1EE3t qu\xE1 s\u1ED1 d\xF2ng cho ph\xE9p (", onCellPaste?.maxRowsPaste ?? 200, " d\xF2ng).Ph\u1EA7n m\u1EC1n s\u1EBD ch\u1EC9 l\u1EA5y 500 d\xF2ng \u0111\u1EA7u ti\xEAn."), /*#__PURE__*/React.createElement(Title, {
599
+ }, "D\u1EEF li\u1EC7u sao ch\xE9p v\u01B0\u1EE3t qu\xE1 s\u1ED1 d\xF2ng cho ph\xE9p (", onCellPaste?.maxRowsPaste ?? 200, " d\xF2ng).Ph\u1EA7n m\u1EC1n s\u1EBD ch\u1EC9 l\u1EA5y (", onCellPaste?.maxRowsPaste ?? 200, " d\xF2ng \u0111\u1EA7u ti\xEAn."), /*#__PURE__*/React.createElement(Title, {
600
600
  level: 5,
601
601
  style: {
602
602
  marginTop: '.75rem'
@@ -2,7 +2,8 @@ import type { Row, Table } from "@tanstack/react-table";
2
2
  import { type Column } from "@tanstack/react-table";
3
3
  import type { VirtualItem } from "@tanstack/react-virtual";
4
4
  import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterOperator, IColumnType, IFormat, RangeState, Sorter, TypeFilter } from "./../type";
5
- import { Key, type CSSProperties } from "react";
5
+ import type { Key } from "react";
6
+ import { type CSSProperties } from "react";
6
7
  import dayjs from "dayjs";
7
8
  import type { IPositionCell } from "../useContext";
8
9
  import type { ColumnDef } from "@tanstack/react-table";
@@ -135,7 +136,6 @@ export declare const convertToObjTrue: (arr: any) => {
135
136
  [k: string]: any;
136
137
  };
137
138
  export declare const getDiffent2Array: (a: any[], b: any[]) => any[];
138
- export declare function isTree(arr: any[]): boolean;
139
139
  export declare function findFirst(items: Column<any>[]): Column<any, unknown>;
140
140
  export declare function isTreeArray(arr: any[], options?: any): boolean;
141
141
  export declare function updateColumnWidthsRecursive(columns: any[], sizing: Record<string, number>): any[];
@@ -1,9 +1,6 @@
1
1
  import { SELECTION_COLUMN } from "rc-master-ui/es/table/hooks/useSelection";
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import { presetPalettes } from "@ant-design/colors";
4
-
5
- // import type { AnyObject } from './type';
6
-
7
4
  // import moment from "moment/moment"
8
5
 
9
6
  import dayjs from "dayjs";
@@ -1902,76 +1899,69 @@ export const convertToObjTrue = arr => {
1902
1899
  export const getDiffent2Array = (a, b) => {
1903
1900
  return [...a.filter(x => !b.includes(x)), ...b.filter(x => !a.includes(x))];
1904
1901
  };
1905
- export function isTree(arr) {
1906
- if (!Array.isArray(arr)) {
1907
- return false;
1908
- }
1909
- function checkNode(node) {
1910
- if (typeof node !== "object" || node === null) {
1911
- return false;
1912
- }
1913
- if ("children" in node) {
1914
- if (!Array.isArray(node.children)) {
1915
- return false;
1916
- }
1917
- if (node.children.length === 0) {
1918
- return false;
1919
- }
1920
- for (const child of node.children) {
1921
- if (!checkNode(child)) {
1922
- return false;
1923
- }
1924
- }
1925
- }
1926
- return true;
1927
- }
1928
- for (const item of arr) {
1929
- if (!checkNode(item)) return false;
1930
- }
1931
- return true;
1932
- }
1933
- export function findFirst(items) {
1934
- const leftItem = items.find(item => item.getIsPinned() === 'left');
1935
- if (leftItem) return leftItem;
1936
- return null;
1937
- }
1938
1902
 
1939
- // export function isTreeArray(arr: any[]): boolean {
1903
+ // export function isTree(arr: any[]): boolean {
1904
+ // if (!Array.isArray(arr)){
1905
+ // return false
1906
+ // }
1940
1907
 
1941
- // // if (!Array.isArray(arr)) return false;
1908
+ // function checkNode(node: any): boolean {
1909
+ // if (typeof node !== "object" || node === null) {
1910
+ // return false
1911
+ // }
1942
1912
 
1943
- // // return arr.every(item => {
1944
- // // if ("children" in item) {
1945
- // // return Array.isArray(item.children) && item.children.length > 0;
1946
- // // }
1947
- // // return true; // node lá thì hợp lệ
1948
- // // });
1913
+ // if ("children" in node) {
1949
1914
 
1950
- // if (!Array.isArray(arr)) return false;
1915
+ // if (!Array.isArray(node.children)) {
1916
+ // return false
1917
+ // }
1918
+ // if (node.children.length === 0) {
1919
+ // return false
1920
+ // }
1951
1921
 
1952
- // return arr.every(item => {
1953
- // if (typeof item !== "object" || item === null) return false;
1922
+ // for (const child of node.children) {
1923
+ // if (!checkNode(child)) {
1924
+ // return false
1925
+ // }
1926
+ // }
1954
1927
 
1955
- // if ("children" in item) {
1956
- // return Array.isArray(item.children);
1957
1928
  // }
1958
1929
 
1959
- // return false; // node lá thì hợp lệ
1960
- // });
1930
+ // return true;
1931
+ // }
1961
1932
 
1933
+ // for (const item of arr) {
1934
+ // if (!checkNode(item)) return false;
1935
+ // }
1936
+
1937
+ // return true;
1962
1938
  // }
1963
1939
 
1940
+ export function findFirst(items) {
1941
+ const leftItem = items.find(item => item.getIsPinned() === 'left');
1942
+ if (leftItem) return leftItem;
1943
+ return null;
1944
+ }
1964
1945
  export function isTreeArray(arr, options) {
1965
- if (!Array.isArray(arr) || arr.length === 0) return false;
1946
+ if (!Array.isArray(arr) || arr.length === 0) {
1947
+ return false;
1948
+ }
1966
1949
  const requireNonEmpty = options?.requireNonEmptyChildren ?? false;
1967
1950
  let hasParent = false;
1968
1951
  for (const item of arr) {
1969
- if (typeof item !== 'object' || item === null) return false;
1952
+ if (typeof item !== 'object' || item === null) {
1953
+ return false;
1954
+ }
1970
1955
  if ('children' in item) {
1971
1956
  const children = item.children;
1972
- if (!Array.isArray(children)) return false;
1957
+ if (!Array.isArray(children)) {
1958
+ // return false;
1959
+ hasParent = false;
1960
+ }
1973
1961
  if (requireNonEmpty) {
1974
- if (children.length > 0) hasParent = true;
1962
+ if (children.length > 0) {
1963
+ hasParent = true;
1964
+ }
1975
1965
  } else {
1976
1966
  hasParent = true;
1977
1967
  }
@@ -603,7 +603,7 @@ const TableContainerEdit = props => {
603
603
  marginBottom: '.25rem',
604
604
  fontSize: 14
605
605
  }
606
- }, "D\u1EEF li\u1EC7u sao ch\xE9p v\u01B0\u1EE3t qu\xE1 s\u1ED1 d\xF2ng cho ph\xE9p (", onCellPaste?.maxRowsPaste ?? 200, " d\xF2ng).Ph\u1EA7n m\u1EC1n s\u1EBD ch\u1EC9 l\u1EA5y 500 d\xF2ng \u0111\u1EA7u ti\xEAn."), /*#__PURE__*/_react.default.createElement(Title, {
606
+ }, "D\u1EEF li\u1EC7u sao ch\xE9p v\u01B0\u1EE3t qu\xE1 s\u1ED1 d\xF2ng cho ph\xE9p (", onCellPaste?.maxRowsPaste ?? 200, " d\xF2ng).Ph\u1EA7n m\u1EC1n s\u1EBD ch\u1EC9 l\u1EA5y (", onCellPaste?.maxRowsPaste ?? 200, " d\xF2ng \u0111\u1EA7u ti\xEAn."), /*#__PURE__*/_react.default.createElement(Title, {
607
607
  level: 5,
608
608
  style: {
609
609
  marginTop: '.75rem'
@@ -2,7 +2,8 @@ import type { Row, Table } from "@tanstack/react-table";
2
2
  import { type Column } from "@tanstack/react-table";
3
3
  import type { VirtualItem } from "@tanstack/react-virtual";
4
4
  import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterOperator, IColumnType, IFormat, RangeState, Sorter, TypeFilter } from "./../type";
5
- import { Key, type CSSProperties } from "react";
5
+ import type { Key } from "react";
6
+ import { type CSSProperties } from "react";
6
7
  import dayjs from "dayjs";
7
8
  import type { IPositionCell } from "../useContext";
8
9
  import type { ColumnDef } from "@tanstack/react-table";
@@ -135,7 +136,6 @@ export declare const convertToObjTrue: (arr: any) => {
135
136
  [k: string]: any;
136
137
  };
137
138
  export declare const getDiffent2Array: (a: any[], b: any[]) => any[];
138
- export declare function isTree(arr: any[]): boolean;
139
139
  export declare function findFirst(items: Column<any>[]): Column<any, unknown>;
140
140
  export declare function isTreeArray(arr: any[], options?: any): boolean;
141
141
  export declare function updateColumnWidthsRecursive(columns: any[], sizing: Record<string, number>): any[];
@@ -47,7 +47,6 @@ exports.isEmpty = exports.isEditable = exports.isDisable = void 0;
47
47
  exports.isEqualSet = isEqualSet;
48
48
  exports.isObjEmpty = exports.isNullOrUndefined = exports.isNameColor = exports.isFormattedNumber = void 0;
49
49
  exports.isObjEqual = isObjEqual;
50
- exports.isTree = isTree;
51
50
  exports.isTreeArray = isTreeArray;
52
51
  exports.parseBooleanToValue = exports.onRemoveBgSelectedCell = exports.onAddBgSelectedCell = exports.newGuid = void 0;
53
52
  exports.parseClipboardEvent = parseClipboardEvent;
@@ -69,8 +68,6 @@ var _uuid = require("uuid");
69
68
  var _colors = require("@ant-design/colors");
70
69
  var _dayjs = _interopRequireDefault(require("dayjs"));
71
70
  var _moment = _interopRequireDefault(require("moment"));
72
- // import type { AnyObject } from './type';
73
-
74
71
  // import moment from "moment/moment"
75
72
 
76
73
  const newGuid = () => {
@@ -2024,77 +2021,69 @@ exports.convertToObjTrue = convertToObjTrue;
2024
2021
  const getDiffent2Array = (a, b) => {
2025
2022
  return [...a.filter(x => !b.includes(x)), ...b.filter(x => !a.includes(x))];
2026
2023
  };
2027
- exports.getDiffent2Array = getDiffent2Array;
2028
- function isTree(arr) {
2029
- if (!Array.isArray(arr)) {
2030
- return false;
2031
- }
2032
- function checkNode(node) {
2033
- if (typeof node !== "object" || node === null) {
2034
- return false;
2035
- }
2036
- if ("children" in node) {
2037
- if (!Array.isArray(node.children)) {
2038
- return false;
2039
- }
2040
- if (node.children.length === 0) {
2041
- return false;
2042
- }
2043
- for (const child of node.children) {
2044
- if (!checkNode(child)) {
2045
- return false;
2046
- }
2047
- }
2048
- }
2049
- return true;
2050
- }
2051
- for (const item of arr) {
2052
- if (!checkNode(item)) return false;
2053
- }
2054
- return true;
2055
- }
2056
- function findFirst(items) {
2057
- const leftItem = items.find(item => item.getIsPinned() === 'left');
2058
- if (leftItem) return leftItem;
2059
- return null;
2060
- }
2061
2024
 
2062
- // export function isTreeArray(arr: any[]): boolean {
2025
+ // export function isTree(arr: any[]): boolean {
2026
+ // if (!Array.isArray(arr)){
2027
+ // return false
2028
+ // }
2063
2029
 
2064
- // // if (!Array.isArray(arr)) return false;
2030
+ // function checkNode(node: any): boolean {
2031
+ // if (typeof node !== "object" || node === null) {
2032
+ // return false
2033
+ // }
2065
2034
 
2066
- // // return arr.every(item => {
2067
- // // if ("children" in item) {
2068
- // // return Array.isArray(item.children) && item.children.length > 0;
2069
- // // }
2070
- // // return true; // node lá thì hợp lệ
2071
- // // });
2035
+ // if ("children" in node) {
2072
2036
 
2073
- // if (!Array.isArray(arr)) return false;
2037
+ // if (!Array.isArray(node.children)) {
2038
+ // return false
2039
+ // }
2040
+ // if (node.children.length === 0) {
2041
+ // return false
2042
+ // }
2074
2043
 
2075
- // return arr.every(item => {
2076
- // if (typeof item !== "object" || item === null) return false;
2044
+ // for (const child of node.children) {
2045
+ // if (!checkNode(child)) {
2046
+ // return false
2047
+ // }
2048
+ // }
2077
2049
 
2078
- // if ("children" in item) {
2079
- // return Array.isArray(item.children);
2080
2050
  // }
2081
2051
 
2082
- // return false; // node lá thì hợp lệ
2083
- // });
2052
+ // return true;
2053
+ // }
2084
2054
 
2085
- // }
2055
+ // for (const item of arr) {
2056
+ // if (!checkNode(item)) return false;
2057
+ // }
2086
2058
 
2059
+ // return true;
2060
+ // }
2061
+ exports.getDiffent2Array = getDiffent2Array;
2062
+ function findFirst(items) {
2063
+ const leftItem = items.find(item => item.getIsPinned() === 'left');
2064
+ if (leftItem) return leftItem;
2065
+ return null;
2066
+ }
2087
2067
  function isTreeArray(arr, options) {
2088
- if (!Array.isArray(arr) || arr.length === 0) return false;
2068
+ if (!Array.isArray(arr) || arr.length === 0) {
2069
+ return false;
2070
+ }
2089
2071
  const requireNonEmpty = options?.requireNonEmptyChildren ?? false;
2090
2072
  let hasParent = false;
2091
2073
  for (const item of arr) {
2092
- if (typeof item !== 'object' || item === null) return false;
2074
+ if (typeof item !== 'object' || item === null) {
2075
+ return false;
2076
+ }
2093
2077
  if ('children' in item) {
2094
2078
  const children = item.children;
2095
- if (!Array.isArray(children)) return false;
2079
+ if (!Array.isArray(children)) {
2080
+ // return false;
2081
+ hasParent = false;
2082
+ }
2096
2083
  if (requireNonEmpty) {
2097
- if (children.length > 0) hasParent = true;
2084
+ if (children.length > 0) {
2085
+ hasParent = true;
2086
+ }
2098
2087
  } else {
2099
2088
  hasParent = true;
2100
2089
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-grid-template",
3
- "version": "1.8.33",
3
+ "version": "1.8.35",
4
4
  "description": "es-grid-template",
5
5
  "keywords": [
6
6
  "react",