es-grid-template 1.8.47 → 1.8.48
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.
|
@@ -27,7 +27,7 @@ const TableContainer = props => {
|
|
|
27
27
|
table,
|
|
28
28
|
id,
|
|
29
29
|
prefix,
|
|
30
|
-
|
|
30
|
+
commandClick,
|
|
31
31
|
editAble,
|
|
32
32
|
rowKey,
|
|
33
33
|
format,
|
|
@@ -160,7 +160,18 @@ const TableContainer = props => {
|
|
|
160
160
|
// })
|
|
161
161
|
}
|
|
162
162
|
}, [columnSizingInfo]);
|
|
163
|
-
const triggerCommandClick =
|
|
163
|
+
const triggerCommandClick = args => {
|
|
164
|
+
// const { id: idCommand, rowId, rowData, index } = args
|
|
165
|
+
|
|
166
|
+
// const tmpData = [...dataSource]
|
|
167
|
+
|
|
168
|
+
if (commandClick) {
|
|
169
|
+
commandClick({
|
|
170
|
+
...args,
|
|
171
|
+
rows: originData
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
};
|
|
164
175
|
return /*#__PURE__*/React.createElement("div", {
|
|
165
176
|
ref: containerRef,
|
|
166
177
|
id: id
|
|
@@ -1916,92 +1916,11 @@ export const convertToObjTrue = arr => {
|
|
|
1916
1916
|
export const getDiffent2Array = (a, b) => {
|
|
1917
1917
|
return [...a.filter(x => !b.includes(x)), ...b.filter(x => !a.includes(x))];
|
|
1918
1918
|
};
|
|
1919
|
-
|
|
1920
|
-
// export function isTree(arr: any[]): boolean {
|
|
1921
|
-
// if (!Array.isArray(arr)){
|
|
1922
|
-
// return false
|
|
1923
|
-
// }
|
|
1924
|
-
|
|
1925
|
-
// function checkNode(node: any): boolean {
|
|
1926
|
-
// if (typeof node !== "object" || node === null) {
|
|
1927
|
-
// return false
|
|
1928
|
-
// }
|
|
1929
|
-
|
|
1930
|
-
// if ("children" in node) {
|
|
1931
|
-
|
|
1932
|
-
// if (!Array.isArray(node.children)) {
|
|
1933
|
-
// return false
|
|
1934
|
-
// }
|
|
1935
|
-
// if (node.children.length === 0) {
|
|
1936
|
-
// return false
|
|
1937
|
-
// }
|
|
1938
|
-
|
|
1939
|
-
// for (const child of node.children) {
|
|
1940
|
-
// if (!checkNode(child)) {
|
|
1941
|
-
// return false
|
|
1942
|
-
// }
|
|
1943
|
-
// }
|
|
1944
|
-
|
|
1945
|
-
// }
|
|
1946
|
-
|
|
1947
|
-
// return true;
|
|
1948
|
-
// }
|
|
1949
|
-
|
|
1950
|
-
// for (const item of arr) {
|
|
1951
|
-
// if (!checkNode(item)) return false;
|
|
1952
|
-
// }
|
|
1953
|
-
|
|
1954
|
-
// return true;
|
|
1955
|
-
// }
|
|
1956
|
-
|
|
1957
1919
|
export function findFirst(items) {
|
|
1958
1920
|
const leftItem = items.find(item => item.getIsPinned() === 'left');
|
|
1959
1921
|
if (leftItem) return leftItem;
|
|
1960
1922
|
return null;
|
|
1961
1923
|
}
|
|
1962
|
-
|
|
1963
|
-
// export function isTreeArray(arr: any[]): boolean {
|
|
1964
|
-
// if (!Array.isArray(arr) || arr.length === 0) {
|
|
1965
|
-
|
|
1966
|
-
// return false
|
|
1967
|
-
// }
|
|
1968
|
-
|
|
1969
|
-
// // const requireNonEmpty = options?.requireNonEmptyChildren ?? false
|
|
1970
|
-
// let hasParent = false
|
|
1971
|
-
|
|
1972
|
-
// for (const item of arr) {
|
|
1973
|
-
// if (typeof item !== 'object' || item === null) {
|
|
1974
|
-
|
|
1975
|
-
// return false
|
|
1976
|
-
// }
|
|
1977
|
-
|
|
1978
|
-
// if ('children' in item) {
|
|
1979
|
-
// const children = (item as any).children
|
|
1980
|
-
// if (!Array.isArray(children)) {
|
|
1981
|
-
// // return false;
|
|
1982
|
-
// hasParent = false
|
|
1983
|
-
// }
|
|
1984
|
-
|
|
1985
|
-
// if (children && children.length > 0) {
|
|
1986
|
-
// hasParent = true
|
|
1987
|
-
// }
|
|
1988
|
-
|
|
1989
|
-
// // if (requireNonEmpty) {
|
|
1990
|
-
|
|
1991
|
-
// // if (children.length > 0) {
|
|
1992
|
-
// // hasParent = true
|
|
1993
|
-
// // }
|
|
1994
|
-
// // } else {
|
|
1995
|
-
|
|
1996
|
-
// // hasParent = true
|
|
1997
|
-
|
|
1998
|
-
// // }
|
|
1999
|
-
// }
|
|
2000
|
-
// }
|
|
2001
|
-
|
|
2002
|
-
// return hasParent
|
|
2003
|
-
// }
|
|
2004
|
-
|
|
2005
1924
|
export function isTreeArray(arr) {
|
|
2006
1925
|
if (!Array.isArray(arr) || arr.length === 0) {
|
|
2007
1926
|
return false;
|
|
@@ -37,7 +37,7 @@ const TableContainer = props => {
|
|
|
37
37
|
table,
|
|
38
38
|
id,
|
|
39
39
|
prefix,
|
|
40
|
-
|
|
40
|
+
commandClick,
|
|
41
41
|
editAble,
|
|
42
42
|
rowKey,
|
|
43
43
|
format,
|
|
@@ -170,7 +170,18 @@ const TableContainer = props => {
|
|
|
170
170
|
// })
|
|
171
171
|
}
|
|
172
172
|
}, [columnSizingInfo]);
|
|
173
|
-
const triggerCommandClick =
|
|
173
|
+
const triggerCommandClick = args => {
|
|
174
|
+
// const { id: idCommand, rowId, rowData, index } = args
|
|
175
|
+
|
|
176
|
+
// const tmpData = [...dataSource]
|
|
177
|
+
|
|
178
|
+
if (commandClick) {
|
|
179
|
+
commandClick({
|
|
180
|
+
...args,
|
|
181
|
+
rows: originData
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
};
|
|
174
185
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
175
186
|
ref: containerRef,
|
|
176
187
|
id: id
|
|
@@ -2037,92 +2037,12 @@ exports.convertToObjTrue = convertToObjTrue;
|
|
|
2037
2037
|
const getDiffent2Array = (a, b) => {
|
|
2038
2038
|
return [...a.filter(x => !b.includes(x)), ...b.filter(x => !a.includes(x))];
|
|
2039
2039
|
};
|
|
2040
|
-
|
|
2041
|
-
// export function isTree(arr: any[]): boolean {
|
|
2042
|
-
// if (!Array.isArray(arr)){
|
|
2043
|
-
// return false
|
|
2044
|
-
// }
|
|
2045
|
-
|
|
2046
|
-
// function checkNode(node: any): boolean {
|
|
2047
|
-
// if (typeof node !== "object" || node === null) {
|
|
2048
|
-
// return false
|
|
2049
|
-
// }
|
|
2050
|
-
|
|
2051
|
-
// if ("children" in node) {
|
|
2052
|
-
|
|
2053
|
-
// if (!Array.isArray(node.children)) {
|
|
2054
|
-
// return false
|
|
2055
|
-
// }
|
|
2056
|
-
// if (node.children.length === 0) {
|
|
2057
|
-
// return false
|
|
2058
|
-
// }
|
|
2059
|
-
|
|
2060
|
-
// for (const child of node.children) {
|
|
2061
|
-
// if (!checkNode(child)) {
|
|
2062
|
-
// return false
|
|
2063
|
-
// }
|
|
2064
|
-
// }
|
|
2065
|
-
|
|
2066
|
-
// }
|
|
2067
|
-
|
|
2068
|
-
// return true;
|
|
2069
|
-
// }
|
|
2070
|
-
|
|
2071
|
-
// for (const item of arr) {
|
|
2072
|
-
// if (!checkNode(item)) return false;
|
|
2073
|
-
// }
|
|
2074
|
-
|
|
2075
|
-
// return true;
|
|
2076
|
-
// }
|
|
2077
2040
|
exports.getDiffent2Array = getDiffent2Array;
|
|
2078
2041
|
function findFirst(items) {
|
|
2079
2042
|
const leftItem = items.find(item => item.getIsPinned() === 'left');
|
|
2080
2043
|
if (leftItem) return leftItem;
|
|
2081
2044
|
return null;
|
|
2082
2045
|
}
|
|
2083
|
-
|
|
2084
|
-
// export function isTreeArray(arr: any[]): boolean {
|
|
2085
|
-
// if (!Array.isArray(arr) || arr.length === 0) {
|
|
2086
|
-
|
|
2087
|
-
// return false
|
|
2088
|
-
// }
|
|
2089
|
-
|
|
2090
|
-
// // const requireNonEmpty = options?.requireNonEmptyChildren ?? false
|
|
2091
|
-
// let hasParent = false
|
|
2092
|
-
|
|
2093
|
-
// for (const item of arr) {
|
|
2094
|
-
// if (typeof item !== 'object' || item === null) {
|
|
2095
|
-
|
|
2096
|
-
// return false
|
|
2097
|
-
// }
|
|
2098
|
-
|
|
2099
|
-
// if ('children' in item) {
|
|
2100
|
-
// const children = (item as any).children
|
|
2101
|
-
// if (!Array.isArray(children)) {
|
|
2102
|
-
// // return false;
|
|
2103
|
-
// hasParent = false
|
|
2104
|
-
// }
|
|
2105
|
-
|
|
2106
|
-
// if (children && children.length > 0) {
|
|
2107
|
-
// hasParent = true
|
|
2108
|
-
// }
|
|
2109
|
-
|
|
2110
|
-
// // if (requireNonEmpty) {
|
|
2111
|
-
|
|
2112
|
-
// // if (children.length > 0) {
|
|
2113
|
-
// // hasParent = true
|
|
2114
|
-
// // }
|
|
2115
|
-
// // } else {
|
|
2116
|
-
|
|
2117
|
-
// // hasParent = true
|
|
2118
|
-
|
|
2119
|
-
// // }
|
|
2120
|
-
// }
|
|
2121
|
-
// }
|
|
2122
|
-
|
|
2123
|
-
// return hasParent
|
|
2124
|
-
// }
|
|
2125
|
-
|
|
2126
2046
|
function isTreeArray(arr) {
|
|
2127
2047
|
if (!Array.isArray(arr) || arr.length === 0) {
|
|
2128
2048
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-grid-template",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.48",
|
|
4
4
|
"description": "es-grid-template",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"rc-checkbox": "^3.5.0",
|
|
65
65
|
"rc-dropdown": "^4.2.1",
|
|
66
66
|
"rc-field-form": "^2.6.0",
|
|
67
|
-
"rc-master-ui": "1.1.
|
|
67
|
+
"rc-master-ui": "1.1.47",
|
|
68
68
|
"rc-select": "^14.16.3",
|
|
69
69
|
"rc-tooltip": "^6.3.0",
|
|
70
70
|
"rc-tree": "^5.10.1",
|