zzz-pc-view 0.0.90 → 0.0.91
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.
- package/package.json +1 -1
- package/src/index.es.js +15 -15
- package/src/index.umd.js +1 -1
- package/src/utils/operator/selectCtrl.d.ts +22 -25
package/package.json
CHANGED
package/src/index.es.js
CHANGED
|
@@ -1926,27 +1926,27 @@ const selectCtrlByAll = (param) => {
|
|
|
1926
1926
|
};
|
|
1927
1927
|
const selectCtrlByInvert = (param) => {
|
|
1928
1928
|
const { keyProp, selected, defaultBoolean } = param;
|
|
1929
|
-
return (
|
|
1930
|
-
//
|
|
1931
|
-
param.
|
|
1932
|
-
// 将列表转换为映射对象,反转每个元素的选择状态
|
|
1929
|
+
return param.toMap ? (
|
|
1930
|
+
// 如果 toMap 为真,则使用 reduce 方法将列表转换为键值对对象
|
|
1931
|
+
param.list.reduce(
|
|
1933
1932
|
(map2, item) => {
|
|
1934
1933
|
const key2 = item[keyProp];
|
|
1935
|
-
|
|
1934
|
+
const isSelect = Object.prototype.hasOwnProperty.call(selected, key2) ? selected[key2] : defaultBoolean;
|
|
1935
|
+
map2[key2] = !isSelect;
|
|
1936
1936
|
return map2;
|
|
1937
1937
|
},
|
|
1938
1938
|
{}
|
|
1939
|
-
) : param.list.reduce(
|
|
1940
|
-
// 将列表转换为数组,只包含反转后选择状态为 true 的元素
|
|
1941
|
-
(list2, item) => {
|
|
1942
|
-
const key2 = item[keyProp];
|
|
1943
|
-
if (Object.prototype.hasOwnProperty.call(selected, key2) ? !selected[key2] : defaultBoolean) {
|
|
1944
|
-
list2.push(key2);
|
|
1945
|
-
}
|
|
1946
|
-
return list2;
|
|
1947
|
-
},
|
|
1948
|
-
[]
|
|
1949
1939
|
)
|
|
1940
|
+
) : (
|
|
1941
|
+
// 如果 toMap 为假,则使用 reduce 方法将列表转换为数组
|
|
1942
|
+
param.list.reduce((list2, item) => {
|
|
1943
|
+
const key2 = item[keyProp];
|
|
1944
|
+
const isSelect = Object.prototype.hasOwnProperty.call(selected, key2) ? selected[key2] : defaultBoolean;
|
|
1945
|
+
if (!isSelect) {
|
|
1946
|
+
list2.push(key2);
|
|
1947
|
+
}
|
|
1948
|
+
return list2;
|
|
1949
|
+
}, [])
|
|
1950
1950
|
);
|
|
1951
1951
|
};
|
|
1952
1952
|
const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|