@sheinx/hooks 3.9.12-beta.8 → 3.9.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["use-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiBjD,eAAO,MAAM,IAAI;IACf;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEJ,CAAC;AAEF,QAAA,MAAM,OAAO;;;;
|
|
1
|
+
{"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["use-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiBjD,eAAO,MAAM,IAAI;IACf;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEJ,CAAC;AAEF,QAAA,MAAM,OAAO;;;;CA4wBZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -216,9 +216,10 @@ var useTree = function useTree(props) {
|
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
context.cachedValue = values;
|
|
219
|
-
// why
|
|
219
|
+
// why slice: 外部可能对数组做splice等操作,影响context.cachedValue在内部的判断逻辑
|
|
220
220
|
// 表现出来的bug现象是:外部删除了某个叶子结点,但是Tree的勾选情况没有同步更新; 另外是为了对齐老版本的表现
|
|
221
|
-
|
|
221
|
+
// 由于values是KeygenResult[](string|number等原始值),slice()浅拷贝即可隔离引用,无需deepClone
|
|
222
|
+
return values.slice();
|
|
222
223
|
};
|
|
223
224
|
var getPath = function getPath(id) {
|
|
224
225
|
return context.pathMap.get(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["use-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiBjD,eAAO,MAAM,IAAI;IACf;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEJ,CAAC;AAEF,QAAA,MAAM,OAAO;;;;
|
|
1
|
+
{"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["use-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiBjD,eAAO,MAAM,IAAI;IACf;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEJ,CAAC;AAEF,QAAA,MAAM,OAAO;;;;CA4wBZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -20,7 +20,7 @@ import { useInputAble } from "../../common/use-input-able";
|
|
|
20
20
|
import { getExpandVirtualData } from "../use-table/use-table-tree";
|
|
21
21
|
import { usePersistFn } from "../../common/use-persist-fn";
|
|
22
22
|
import { isFunc, isString, isNumber, isArray, isUnMatchedData, isOptionalDisabled } from "../../utils/is";
|
|
23
|
-
import { devUseWarning, produce, shallowEqual
|
|
23
|
+
import { devUseWarning, produce, shallowEqual } from "../../utils";
|
|
24
24
|
function toArray(value) {
|
|
25
25
|
if (!value) return [];
|
|
26
26
|
if (!Array.isArray(value)) return [value];
|
|
@@ -209,9 +209,10 @@ var useTree = function useTree(props) {
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
context.cachedValue = values;
|
|
212
|
-
// why
|
|
212
|
+
// why slice: 外部可能对数组做splice等操作,影响context.cachedValue在内部的判断逻辑
|
|
213
213
|
// 表现出来的bug现象是:外部删除了某个叶子结点,但是Tree的勾选情况没有同步更新; 另外是为了对齐老版本的表现
|
|
214
|
-
|
|
214
|
+
// 由于values是KeygenResult[](string|number等原始值),slice()浅拷贝即可隔离引用,无需deepClone
|
|
215
|
+
return values.slice();
|
|
215
216
|
};
|
|
216
217
|
var getPath = function getPath(id) {
|
|
217
218
|
return context.pathMap.get(id);
|