@tarojs/runtime 3.4.10 → 3.4.13
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/dist/dom/event.d.ts +2 -0
- package/dist/runtime.esm.js +32 -15
- package/dist/runtime.esm.js.map +1 -1
- package/package.json +4 -4
package/dist/dom/event.d.ts
CHANGED
package/dist/runtime.esm.js
CHANGED
|
@@ -2833,26 +2833,43 @@ class TaroEvent {
|
|
|
2833
2833
|
}
|
|
2834
2834
|
get target() {
|
|
2835
2835
|
var _a, _b;
|
|
2836
|
-
const
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
target
|
|
2836
|
+
const cacheTarget = this.cacheTarget;
|
|
2837
|
+
if (!cacheTarget) {
|
|
2838
|
+
const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
|
|
2839
|
+
const element = getDocument().getElementById(target.id);
|
|
2840
|
+
target.dataset = element !== null ? element.dataset : EMPTY_OBJ;
|
|
2841
|
+
for (const key in (_b = this.mpEvent) === null || _b === void 0 ? void 0 : _b.detail) {
|
|
2842
|
+
target[key] = this.mpEvent.detail[key];
|
|
2843
|
+
}
|
|
2844
|
+
this.cacheTarget = target;
|
|
2845
|
+
return target;
|
|
2846
|
+
}
|
|
2847
|
+
else {
|
|
2848
|
+
return cacheTarget;
|
|
2841
2849
|
}
|
|
2842
|
-
return target;
|
|
2843
2850
|
}
|
|
2844
2851
|
get currentTarget() {
|
|
2845
|
-
var _a, _b;
|
|
2846
|
-
const
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2852
|
+
var _a, _b, _c, _d;
|
|
2853
|
+
const cacheCurrentTarget = this.cacheCurrentTarget;
|
|
2854
|
+
if (!cacheCurrentTarget) {
|
|
2855
|
+
const doc = getDocument();
|
|
2856
|
+
const currentTarget = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.currentTarget) || null);
|
|
2857
|
+
const element = doc.getElementById(currentTarget.id);
|
|
2858
|
+
const targetElement = doc.getElementById(((_c = (_b = this.mpEvent) === null || _b === void 0 ? void 0 : _b.target) === null || _c === void 0 ? void 0 : _c.id) || null);
|
|
2859
|
+
if (element === null || (element && element === targetElement)) {
|
|
2860
|
+
this.cacheCurrentTarget = this.target;
|
|
2861
|
+
return this.target;
|
|
2862
|
+
}
|
|
2863
|
+
currentTarget.dataset = element.dataset;
|
|
2864
|
+
for (const key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
|
|
2865
|
+
currentTarget[key] = this.mpEvent.detail[key];
|
|
2866
|
+
}
|
|
2867
|
+
this.cacheCurrentTarget = currentTarget;
|
|
2868
|
+
return currentTarget;
|
|
2850
2869
|
}
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
currentTarget[key] = this.mpEvent.detail[key];
|
|
2870
|
+
else {
|
|
2871
|
+
return cacheCurrentTarget;
|
|
2854
2872
|
}
|
|
2855
|
-
return currentTarget;
|
|
2856
2873
|
}
|
|
2857
2874
|
}
|
|
2858
2875
|
function createEvent(event, node) {
|