@vue/runtime-dom 3.5.21 → 3.5.23
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/runtime-dom.cjs.js +83 -30
- package/dist/runtime-dom.cjs.prod.js +83 -30
- package/dist/runtime-dom.d.ts +24 -9
- package/dist/runtime-dom.esm-browser.js +152 -80
- package/dist/runtime-dom.esm-browser.prod.js +4 -3
- package/dist/runtime-dom.esm-bundler.js +83 -30
- package/dist/runtime-dom.global.js +152 -80
- package/dist/runtime-dom.global.prod.js +4 -3
- package/package.json +4 -4
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.
|
|
2
|
+
* @vue/runtime-dom v3.5.23
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -217,11 +217,11 @@ function resolveTransitionProps(rawProps) {
|
|
|
217
217
|
const resolve = () => finishLeave(el, done);
|
|
218
218
|
addTransitionClass(el, leaveFromClass);
|
|
219
219
|
if (!el._enterCancelled) {
|
|
220
|
-
forceReflow();
|
|
220
|
+
forceReflow(el);
|
|
221
221
|
addTransitionClass(el, leaveActiveClass);
|
|
222
222
|
} else {
|
|
223
223
|
addTransitionClass(el, leaveActiveClass);
|
|
224
|
-
forceReflow();
|
|
224
|
+
forceReflow(el);
|
|
225
225
|
}
|
|
226
226
|
nextFrame(() => {
|
|
227
227
|
if (!el._isLeaving) {
|
|
@@ -367,8 +367,9 @@ function toMs(s) {
|
|
|
367
367
|
if (s === "auto") return 0;
|
|
368
368
|
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
369
369
|
}
|
|
370
|
-
function forceReflow() {
|
|
371
|
-
|
|
370
|
+
function forceReflow(el) {
|
|
371
|
+
const targetDocument = el ? el.ownerDocument : document;
|
|
372
|
+
return targetDocument.body.offsetHeight;
|
|
372
373
|
}
|
|
373
374
|
|
|
374
375
|
function patchClass(el, value, isSVG) {
|
|
@@ -741,6 +742,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
741
742
|
if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
|
|
742
743
|
return false;
|
|
743
744
|
}
|
|
745
|
+
if (key === "sandbox" && el.tagName === "IFRAME") {
|
|
746
|
+
return false;
|
|
747
|
+
}
|
|
744
748
|
if (key === "form") {
|
|
745
749
|
return false;
|
|
746
750
|
}
|
|
@@ -801,6 +805,8 @@ class VueElement extends BaseClass {
|
|
|
801
805
|
this._nonce = this._def.nonce;
|
|
802
806
|
this._connected = false;
|
|
803
807
|
this._resolved = false;
|
|
808
|
+
this._patching = false;
|
|
809
|
+
this._dirty = false;
|
|
804
810
|
this._numberProps = null;
|
|
805
811
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
806
812
|
this._ob = null;
|
|
@@ -813,7 +819,11 @@ class VueElement extends BaseClass {
|
|
|
813
819
|
);
|
|
814
820
|
}
|
|
815
821
|
if (_def.shadowRoot !== false) {
|
|
816
|
-
this.attachShadow(
|
|
822
|
+
this.attachShadow(
|
|
823
|
+
shared.extend({}, _def.shadowRootOptions, {
|
|
824
|
+
mode: "open"
|
|
825
|
+
})
|
|
826
|
+
);
|
|
817
827
|
this._root = this.shadowRoot;
|
|
818
828
|
} else {
|
|
819
829
|
this._root = this;
|
|
@@ -873,9 +883,18 @@ class VueElement extends BaseClass {
|
|
|
873
883
|
this._app && this._app.unmount();
|
|
874
884
|
if (this._instance) this._instance.ce = void 0;
|
|
875
885
|
this._app = this._instance = null;
|
|
886
|
+
if (this._teleportTargets) {
|
|
887
|
+
this._teleportTargets.clear();
|
|
888
|
+
this._teleportTargets = void 0;
|
|
889
|
+
}
|
|
876
890
|
}
|
|
877
891
|
});
|
|
878
892
|
}
|
|
893
|
+
_processMutations(mutations) {
|
|
894
|
+
for (const m of mutations) {
|
|
895
|
+
this._setAttr(m.attributeName);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
879
898
|
/**
|
|
880
899
|
* resolve inner component definition (handle possible async component)
|
|
881
900
|
*/
|
|
@@ -886,11 +905,7 @@ class VueElement extends BaseClass {
|
|
|
886
905
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
887
906
|
this._setAttr(this.attributes[i].name);
|
|
888
907
|
}
|
|
889
|
-
this._ob = new MutationObserver((
|
|
890
|
-
for (const m of mutations) {
|
|
891
|
-
this._setAttr(m.attributeName);
|
|
892
|
-
}
|
|
893
|
-
});
|
|
908
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
894
909
|
this._ob.observe(this, { attributes: true });
|
|
895
910
|
const resolve = (def, isAsync = false) => {
|
|
896
911
|
this._resolved = true;
|
|
@@ -967,7 +982,7 @@ class VueElement extends BaseClass {
|
|
|
967
982
|
return this._getProp(key);
|
|
968
983
|
},
|
|
969
984
|
set(val) {
|
|
970
|
-
this._setProp(key, val, true,
|
|
985
|
+
this._setProp(key, val, true, !this._patching);
|
|
971
986
|
}
|
|
972
987
|
});
|
|
973
988
|
}
|
|
@@ -993,6 +1008,7 @@ class VueElement extends BaseClass {
|
|
|
993
1008
|
*/
|
|
994
1009
|
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
995
1010
|
if (val !== this._props[key]) {
|
|
1011
|
+
this._dirty = true;
|
|
996
1012
|
if (val === REMOVAL) {
|
|
997
1013
|
delete this._props[key];
|
|
998
1014
|
} else {
|
|
@@ -1006,7 +1022,10 @@ class VueElement extends BaseClass {
|
|
|
1006
1022
|
}
|
|
1007
1023
|
if (shouldReflect) {
|
|
1008
1024
|
const ob = this._ob;
|
|
1009
|
-
|
|
1025
|
+
if (ob) {
|
|
1026
|
+
this._processMutations(ob.takeRecords());
|
|
1027
|
+
ob.disconnect();
|
|
1028
|
+
}
|
|
1010
1029
|
if (val === true) {
|
|
1011
1030
|
this.setAttribute(shared.hyphenate(key), "");
|
|
1012
1031
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -1110,7 +1129,7 @@ class VueElement extends BaseClass {
|
|
|
1110
1129
|
* Only called when shadowRoot is false
|
|
1111
1130
|
*/
|
|
1112
1131
|
_renderSlots() {
|
|
1113
|
-
const outlets =
|
|
1132
|
+
const outlets = this._getSlots();
|
|
1114
1133
|
const scopeId = this._instance.type.__scopeId;
|
|
1115
1134
|
for (let i = 0; i < outlets.length; i++) {
|
|
1116
1135
|
const o = outlets[i];
|
|
@@ -1136,12 +1155,45 @@ class VueElement extends BaseClass {
|
|
|
1136
1155
|
parent.removeChild(o);
|
|
1137
1156
|
}
|
|
1138
1157
|
}
|
|
1158
|
+
/**
|
|
1159
|
+
* @internal
|
|
1160
|
+
*/
|
|
1161
|
+
_getSlots() {
|
|
1162
|
+
const roots = [this];
|
|
1163
|
+
if (this._teleportTargets) {
|
|
1164
|
+
roots.push(...this._teleportTargets);
|
|
1165
|
+
}
|
|
1166
|
+
const slots = /* @__PURE__ */ new Set();
|
|
1167
|
+
for (const root of roots) {
|
|
1168
|
+
const found = root.querySelectorAll("slot");
|
|
1169
|
+
for (let i = 0; i < found.length; i++) {
|
|
1170
|
+
slots.add(found[i]);
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
return Array.from(slots);
|
|
1174
|
+
}
|
|
1139
1175
|
/**
|
|
1140
1176
|
* @internal
|
|
1141
1177
|
*/
|
|
1142
1178
|
_injectChildStyle(comp) {
|
|
1143
1179
|
this._applyStyles(comp.styles, comp);
|
|
1144
1180
|
}
|
|
1181
|
+
/**
|
|
1182
|
+
* @internal
|
|
1183
|
+
*/
|
|
1184
|
+
_beginPatch() {
|
|
1185
|
+
this._patching = true;
|
|
1186
|
+
this._dirty = false;
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* @internal
|
|
1190
|
+
*/
|
|
1191
|
+
_endPatch() {
|
|
1192
|
+
this._patching = false;
|
|
1193
|
+
if (this._dirty && this._instance) {
|
|
1194
|
+
this._update();
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1145
1197
|
/**
|
|
1146
1198
|
* @internal
|
|
1147
1199
|
*/
|
|
@@ -1237,7 +1289,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1237
1289
|
prevChildren.forEach(callPendingCbs);
|
|
1238
1290
|
prevChildren.forEach(recordPosition);
|
|
1239
1291
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
1240
|
-
forceReflow();
|
|
1292
|
+
forceReflow(instance.vnode.el);
|
|
1241
1293
|
movedChildren.forEach((c) => {
|
|
1242
1294
|
const el = c.el;
|
|
1243
1295
|
const style = el.style;
|
|
@@ -1276,10 +1328,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1276
1328
|
instance
|
|
1277
1329
|
)
|
|
1278
1330
|
);
|
|
1279
|
-
positionMap.set(
|
|
1280
|
-
child,
|
|
1281
|
-
child.el.
|
|
1282
|
-
);
|
|
1331
|
+
positionMap.set(child, {
|
|
1332
|
+
left: child.el.offsetLeft,
|
|
1333
|
+
top: child.el.offsetTop
|
|
1334
|
+
});
|
|
1283
1335
|
}
|
|
1284
1336
|
}
|
|
1285
1337
|
}
|
|
@@ -1310,7 +1362,10 @@ function callPendingCbs(c) {
|
|
|
1310
1362
|
}
|
|
1311
1363
|
}
|
|
1312
1364
|
function recordPosition(c) {
|
|
1313
|
-
newPositionMap.set(c,
|
|
1365
|
+
newPositionMap.set(c, {
|
|
1366
|
+
left: c.el.offsetLeft,
|
|
1367
|
+
top: c.el.offsetTop
|
|
1368
|
+
});
|
|
1314
1369
|
}
|
|
1315
1370
|
function applyTranslation(c) {
|
|
1316
1371
|
const oldPos = positionMap.get(c);
|
|
@@ -1356,24 +1411,22 @@ function onCompositionEnd(e) {
|
|
|
1356
1411
|
}
|
|
1357
1412
|
}
|
|
1358
1413
|
const assignKey = Symbol("_assign");
|
|
1414
|
+
function castValue(value, trim, number) {
|
|
1415
|
+
if (trim) value = value.trim();
|
|
1416
|
+
if (number) value = shared.looseToNumber(value);
|
|
1417
|
+
return value;
|
|
1418
|
+
}
|
|
1359
1419
|
const vModelText = {
|
|
1360
1420
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
1361
1421
|
el[assignKey] = getModelAssigner(vnode);
|
|
1362
1422
|
const castToNumber = number || vnode.props && vnode.props.type === "number";
|
|
1363
1423
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
1364
1424
|
if (e.target.composing) return;
|
|
1365
|
-
|
|
1366
|
-
if (trim) {
|
|
1367
|
-
domValue = domValue.trim();
|
|
1368
|
-
}
|
|
1369
|
-
if (castToNumber) {
|
|
1370
|
-
domValue = shared.looseToNumber(domValue);
|
|
1371
|
-
}
|
|
1372
|
-
el[assignKey](domValue);
|
|
1425
|
+
el[assignKey](castValue(el.value, trim, castToNumber));
|
|
1373
1426
|
});
|
|
1374
|
-
if (trim) {
|
|
1427
|
+
if (trim || castToNumber) {
|
|
1375
1428
|
addEventListener(el, "change", () => {
|
|
1376
|
-
el.value = el.value
|
|
1429
|
+
el.value = castValue(el.value, trim, castToNumber);
|
|
1377
1430
|
});
|
|
1378
1431
|
}
|
|
1379
1432
|
if (!lazy) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.
|
|
2
|
+
* @vue/runtime-dom v3.5.23
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -216,11 +216,11 @@ function resolveTransitionProps(rawProps) {
|
|
|
216
216
|
const resolve = () => finishLeave(el, done);
|
|
217
217
|
addTransitionClass(el, leaveFromClass);
|
|
218
218
|
if (!el._enterCancelled) {
|
|
219
|
-
forceReflow();
|
|
219
|
+
forceReflow(el);
|
|
220
220
|
addTransitionClass(el, leaveActiveClass);
|
|
221
221
|
} else {
|
|
222
222
|
addTransitionClass(el, leaveActiveClass);
|
|
223
|
-
forceReflow();
|
|
223
|
+
forceReflow(el);
|
|
224
224
|
}
|
|
225
225
|
nextFrame(() => {
|
|
226
226
|
if (!el._isLeaving) {
|
|
@@ -363,8 +363,9 @@ function toMs(s) {
|
|
|
363
363
|
if (s === "auto") return 0;
|
|
364
364
|
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
365
365
|
}
|
|
366
|
-
function forceReflow() {
|
|
367
|
-
|
|
366
|
+
function forceReflow(el) {
|
|
367
|
+
const targetDocument = el ? el.ownerDocument : document;
|
|
368
|
+
return targetDocument.body.offsetHeight;
|
|
368
369
|
}
|
|
369
370
|
|
|
370
371
|
function patchClass(el, value, isSVG) {
|
|
@@ -713,6 +714,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
713
714
|
if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
|
|
714
715
|
return false;
|
|
715
716
|
}
|
|
717
|
+
if (key === "sandbox" && el.tagName === "IFRAME") {
|
|
718
|
+
return false;
|
|
719
|
+
}
|
|
716
720
|
if (key === "form") {
|
|
717
721
|
return false;
|
|
718
722
|
}
|
|
@@ -773,6 +777,8 @@ class VueElement extends BaseClass {
|
|
|
773
777
|
this._nonce = this._def.nonce;
|
|
774
778
|
this._connected = false;
|
|
775
779
|
this._resolved = false;
|
|
780
|
+
this._patching = false;
|
|
781
|
+
this._dirty = false;
|
|
776
782
|
this._numberProps = null;
|
|
777
783
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
778
784
|
this._ob = null;
|
|
@@ -780,7 +786,11 @@ class VueElement extends BaseClass {
|
|
|
780
786
|
this._root = this.shadowRoot;
|
|
781
787
|
} else {
|
|
782
788
|
if (_def.shadowRoot !== false) {
|
|
783
|
-
this.attachShadow(
|
|
789
|
+
this.attachShadow(
|
|
790
|
+
shared.extend({}, _def.shadowRootOptions, {
|
|
791
|
+
mode: "open"
|
|
792
|
+
})
|
|
793
|
+
);
|
|
784
794
|
this._root = this.shadowRoot;
|
|
785
795
|
} else {
|
|
786
796
|
this._root = this;
|
|
@@ -840,9 +850,18 @@ class VueElement extends BaseClass {
|
|
|
840
850
|
this._app && this._app.unmount();
|
|
841
851
|
if (this._instance) this._instance.ce = void 0;
|
|
842
852
|
this._app = this._instance = null;
|
|
853
|
+
if (this._teleportTargets) {
|
|
854
|
+
this._teleportTargets.clear();
|
|
855
|
+
this._teleportTargets = void 0;
|
|
856
|
+
}
|
|
843
857
|
}
|
|
844
858
|
});
|
|
845
859
|
}
|
|
860
|
+
_processMutations(mutations) {
|
|
861
|
+
for (const m of mutations) {
|
|
862
|
+
this._setAttr(m.attributeName);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
846
865
|
/**
|
|
847
866
|
* resolve inner component definition (handle possible async component)
|
|
848
867
|
*/
|
|
@@ -853,11 +872,7 @@ class VueElement extends BaseClass {
|
|
|
853
872
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
854
873
|
this._setAttr(this.attributes[i].name);
|
|
855
874
|
}
|
|
856
|
-
this._ob = new MutationObserver((
|
|
857
|
-
for (const m of mutations) {
|
|
858
|
-
this._setAttr(m.attributeName);
|
|
859
|
-
}
|
|
860
|
-
});
|
|
875
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
861
876
|
this._ob.observe(this, { attributes: true });
|
|
862
877
|
const resolve = (def, isAsync = false) => {
|
|
863
878
|
this._resolved = true;
|
|
@@ -925,7 +940,7 @@ class VueElement extends BaseClass {
|
|
|
925
940
|
return this._getProp(key);
|
|
926
941
|
},
|
|
927
942
|
set(val) {
|
|
928
|
-
this._setProp(key, val, true,
|
|
943
|
+
this._setProp(key, val, true, !this._patching);
|
|
929
944
|
}
|
|
930
945
|
});
|
|
931
946
|
}
|
|
@@ -951,6 +966,7 @@ class VueElement extends BaseClass {
|
|
|
951
966
|
*/
|
|
952
967
|
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
953
968
|
if (val !== this._props[key]) {
|
|
969
|
+
this._dirty = true;
|
|
954
970
|
if (val === REMOVAL) {
|
|
955
971
|
delete this._props[key];
|
|
956
972
|
} else {
|
|
@@ -964,7 +980,10 @@ class VueElement extends BaseClass {
|
|
|
964
980
|
}
|
|
965
981
|
if (shouldReflect) {
|
|
966
982
|
const ob = this._ob;
|
|
967
|
-
|
|
983
|
+
if (ob) {
|
|
984
|
+
this._processMutations(ob.takeRecords());
|
|
985
|
+
ob.disconnect();
|
|
986
|
+
}
|
|
968
987
|
if (val === true) {
|
|
969
988
|
this.setAttribute(shared.hyphenate(key), "");
|
|
970
989
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -1043,7 +1062,7 @@ class VueElement extends BaseClass {
|
|
|
1043
1062
|
* Only called when shadowRoot is false
|
|
1044
1063
|
*/
|
|
1045
1064
|
_renderSlots() {
|
|
1046
|
-
const outlets =
|
|
1065
|
+
const outlets = this._getSlots();
|
|
1047
1066
|
const scopeId = this._instance.type.__scopeId;
|
|
1048
1067
|
for (let i = 0; i < outlets.length; i++) {
|
|
1049
1068
|
const o = outlets[i];
|
|
@@ -1069,12 +1088,45 @@ class VueElement extends BaseClass {
|
|
|
1069
1088
|
parent.removeChild(o);
|
|
1070
1089
|
}
|
|
1071
1090
|
}
|
|
1091
|
+
/**
|
|
1092
|
+
* @internal
|
|
1093
|
+
*/
|
|
1094
|
+
_getSlots() {
|
|
1095
|
+
const roots = [this];
|
|
1096
|
+
if (this._teleportTargets) {
|
|
1097
|
+
roots.push(...this._teleportTargets);
|
|
1098
|
+
}
|
|
1099
|
+
const slots = /* @__PURE__ */ new Set();
|
|
1100
|
+
for (const root of roots) {
|
|
1101
|
+
const found = root.querySelectorAll("slot");
|
|
1102
|
+
for (let i = 0; i < found.length; i++) {
|
|
1103
|
+
slots.add(found[i]);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
return Array.from(slots);
|
|
1107
|
+
}
|
|
1072
1108
|
/**
|
|
1073
1109
|
* @internal
|
|
1074
1110
|
*/
|
|
1075
1111
|
_injectChildStyle(comp) {
|
|
1076
1112
|
this._applyStyles(comp.styles, comp);
|
|
1077
1113
|
}
|
|
1114
|
+
/**
|
|
1115
|
+
* @internal
|
|
1116
|
+
*/
|
|
1117
|
+
_beginPatch() {
|
|
1118
|
+
this._patching = true;
|
|
1119
|
+
this._dirty = false;
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* @internal
|
|
1123
|
+
*/
|
|
1124
|
+
_endPatch() {
|
|
1125
|
+
this._patching = false;
|
|
1126
|
+
if (this._dirty && this._instance) {
|
|
1127
|
+
this._update();
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1078
1130
|
/**
|
|
1079
1131
|
* @internal
|
|
1080
1132
|
*/
|
|
@@ -1147,7 +1199,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1147
1199
|
prevChildren.forEach(callPendingCbs);
|
|
1148
1200
|
prevChildren.forEach(recordPosition);
|
|
1149
1201
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
1150
|
-
forceReflow();
|
|
1202
|
+
forceReflow(instance.vnode.el);
|
|
1151
1203
|
movedChildren.forEach((c) => {
|
|
1152
1204
|
const el = c.el;
|
|
1153
1205
|
const style = el.style;
|
|
@@ -1186,10 +1238,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1186
1238
|
instance
|
|
1187
1239
|
)
|
|
1188
1240
|
);
|
|
1189
|
-
positionMap.set(
|
|
1190
|
-
child,
|
|
1191
|
-
child.el.
|
|
1192
|
-
);
|
|
1241
|
+
positionMap.set(child, {
|
|
1242
|
+
left: child.el.offsetLeft,
|
|
1243
|
+
top: child.el.offsetTop
|
|
1244
|
+
});
|
|
1193
1245
|
}
|
|
1194
1246
|
}
|
|
1195
1247
|
}
|
|
@@ -1218,7 +1270,10 @@ function callPendingCbs(c) {
|
|
|
1218
1270
|
}
|
|
1219
1271
|
}
|
|
1220
1272
|
function recordPosition(c) {
|
|
1221
|
-
newPositionMap.set(c,
|
|
1273
|
+
newPositionMap.set(c, {
|
|
1274
|
+
left: c.el.offsetLeft,
|
|
1275
|
+
top: c.el.offsetTop
|
|
1276
|
+
});
|
|
1222
1277
|
}
|
|
1223
1278
|
function applyTranslation(c) {
|
|
1224
1279
|
const oldPos = positionMap.get(c);
|
|
@@ -1264,24 +1319,22 @@ function onCompositionEnd(e) {
|
|
|
1264
1319
|
}
|
|
1265
1320
|
}
|
|
1266
1321
|
const assignKey = Symbol("_assign");
|
|
1322
|
+
function castValue(value, trim, number) {
|
|
1323
|
+
if (trim) value = value.trim();
|
|
1324
|
+
if (number) value = shared.looseToNumber(value);
|
|
1325
|
+
return value;
|
|
1326
|
+
}
|
|
1267
1327
|
const vModelText = {
|
|
1268
1328
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
1269
1329
|
el[assignKey] = getModelAssigner(vnode);
|
|
1270
1330
|
const castToNumber = number || vnode.props && vnode.props.type === "number";
|
|
1271
1331
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
1272
1332
|
if (e.target.composing) return;
|
|
1273
|
-
|
|
1274
|
-
if (trim) {
|
|
1275
|
-
domValue = domValue.trim();
|
|
1276
|
-
}
|
|
1277
|
-
if (castToNumber) {
|
|
1278
|
-
domValue = shared.looseToNumber(domValue);
|
|
1279
|
-
}
|
|
1280
|
-
el[assignKey](domValue);
|
|
1333
|
+
el[assignKey](castValue(el.value, trim, castToNumber));
|
|
1281
1334
|
});
|
|
1282
|
-
if (trim) {
|
|
1335
|
+
if (trim || castToNumber) {
|
|
1283
1336
|
addEventListener(el, "change", () => {
|
|
1284
|
-
el.value = el.value
|
|
1337
|
+
el.value = castValue(el.value, trim, castToNumber);
|
|
1285
1338
|
});
|
|
1286
1339
|
}
|
|
1287
1340
|
if (!lazy) {
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export type VueElementConstructor<P = {}> = {
|
|
|
92
92
|
export interface CustomElementOptions {
|
|
93
93
|
styles?: string[];
|
|
94
94
|
shadowRoot?: boolean;
|
|
95
|
+
shadowRootOptions?: Omit<ShadowRootInit, 'mode'>;
|
|
95
96
|
nonce?: string;
|
|
96
97
|
configureApp?: (app: App) => void;
|
|
97
98
|
}
|
|
@@ -124,6 +125,8 @@ export declare class VueElement extends BaseClass implements ComponentCustomElem
|
|
|
124
125
|
_isVueCE: boolean;
|
|
125
126
|
private _connected;
|
|
126
127
|
private _resolved;
|
|
128
|
+
private _patching;
|
|
129
|
+
private _dirty;
|
|
127
130
|
private _numberProps;
|
|
128
131
|
private _styleChildren;
|
|
129
132
|
private _pendingResolve;
|
|
@@ -148,6 +151,7 @@ export declare class VueElement extends BaseClass implements ComponentCustomElem
|
|
|
148
151
|
private _setParent;
|
|
149
152
|
private _inheritParentContext;
|
|
150
153
|
disconnectedCallback(): void;
|
|
154
|
+
private _processMutations;
|
|
151
155
|
/**
|
|
152
156
|
* resolve inner component definition (handle possible async component)
|
|
153
157
|
*/
|
|
@@ -496,7 +500,6 @@ export interface DataHTMLAttributes extends HTMLAttributes {
|
|
|
496
500
|
export interface DetailsHTMLAttributes extends HTMLAttributes {
|
|
497
501
|
name?: string | undefined;
|
|
498
502
|
open?: Booleanish | undefined;
|
|
499
|
-
onToggle?: ((payload: ToggleEvent) => void) | undefined;
|
|
500
503
|
}
|
|
501
504
|
export interface DelHTMLAttributes extends HTMLAttributes {
|
|
502
505
|
cite?: string | undefined;
|
|
@@ -505,6 +508,7 @@ export interface DelHTMLAttributes extends HTMLAttributes {
|
|
|
505
508
|
export interface DialogHTMLAttributes extends HTMLAttributes {
|
|
506
509
|
open?: Booleanish | undefined;
|
|
507
510
|
onClose?: ((payload: Event) => void) | undefined;
|
|
511
|
+
onCancel?: ((payload: Event) => void) | undefined;
|
|
508
512
|
}
|
|
509
513
|
export interface EmbedHTMLAttributes extends HTMLAttributes {
|
|
510
514
|
height?: Numberish | undefined;
|
|
@@ -605,6 +609,7 @@ export interface InputHTMLAttributes extends HTMLAttributes {
|
|
|
605
609
|
type?: InputTypeHTMLAttribute | undefined;
|
|
606
610
|
value?: any;
|
|
607
611
|
width?: Numberish | undefined;
|
|
612
|
+
onCancel?: ((payload: Event) => void) | undefined;
|
|
608
613
|
}
|
|
609
614
|
export interface KeygenHTMLAttributes extends HTMLAttributes {
|
|
610
615
|
autofocus?: Booleanish | undefined;
|
|
@@ -1282,18 +1287,18 @@ export interface Events {
|
|
|
1282
1287
|
onBlur: FocusEvent;
|
|
1283
1288
|
onChange: Event;
|
|
1284
1289
|
onBeforeinput: InputEvent;
|
|
1285
|
-
|
|
1290
|
+
onFormdata: FormDataEvent;
|
|
1291
|
+
onInput: InputEvent;
|
|
1286
1292
|
onReset: Event;
|
|
1287
1293
|
onSubmit: SubmitEvent;
|
|
1288
1294
|
onInvalid: Event;
|
|
1295
|
+
onFullscreenchange: Event;
|
|
1296
|
+
onFullscreenerror: Event;
|
|
1289
1297
|
onLoad: Event;
|
|
1290
1298
|
onError: Event;
|
|
1291
1299
|
onKeydown: KeyboardEvent;
|
|
1292
1300
|
onKeypress: KeyboardEvent;
|
|
1293
1301
|
onKeyup: KeyboardEvent;
|
|
1294
|
-
onAuxclick: PointerEvent;
|
|
1295
|
-
onClick: PointerEvent;
|
|
1296
|
-
onContextmenu: PointerEvent;
|
|
1297
1302
|
onDblclick: MouseEvent;
|
|
1298
1303
|
onMousedown: MouseEvent;
|
|
1299
1304
|
onMouseenter: MouseEvent;
|
|
@@ -1331,6 +1336,11 @@ export interface Events {
|
|
|
1331
1336
|
onTouchend: TouchEvent;
|
|
1332
1337
|
onTouchmove: TouchEvent;
|
|
1333
1338
|
onTouchstart: TouchEvent;
|
|
1339
|
+
onAuxclick: PointerEvent;
|
|
1340
|
+
onClick: PointerEvent;
|
|
1341
|
+
onContextmenu: PointerEvent;
|
|
1342
|
+
onGotpointercapture: PointerEvent;
|
|
1343
|
+
onLostpointercapture: PointerEvent;
|
|
1334
1344
|
onPointerdown: PointerEvent;
|
|
1335
1345
|
onPointermove: PointerEvent;
|
|
1336
1346
|
onPointerup: PointerEvent;
|
|
@@ -1339,23 +1349,29 @@ export interface Events {
|
|
|
1339
1349
|
onPointerleave: PointerEvent;
|
|
1340
1350
|
onPointerover: PointerEvent;
|
|
1341
1351
|
onPointerout: PointerEvent;
|
|
1352
|
+
onBeforetoggle: ToggleEvent;
|
|
1353
|
+
onToggle: ToggleEvent;
|
|
1342
1354
|
onWheel: WheelEvent;
|
|
1355
|
+
onAnimationcancel: AnimationEvent;
|
|
1343
1356
|
onAnimationstart: AnimationEvent;
|
|
1344
1357
|
onAnimationend: AnimationEvent;
|
|
1345
1358
|
onAnimationiteration: AnimationEvent;
|
|
1359
|
+
onSecuritypolicyviolation: SecurityPolicyViolationEvent;
|
|
1360
|
+
onTransitioncancel: TransitionEvent;
|
|
1346
1361
|
onTransitionend: TransitionEvent;
|
|
1362
|
+
onTransitionrun: TransitionEvent;
|
|
1347
1363
|
onTransitionstart: TransitionEvent;
|
|
1348
1364
|
}
|
|
1349
1365
|
type EventHandlers<E> = {
|
|
1350
1366
|
[K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void;
|
|
1351
1367
|
};
|
|
1352
1368
|
|
|
1353
|
-
export
|
|
1369
|
+
export interface ReservedProps {
|
|
1354
1370
|
key?: PropertyKey | undefined;
|
|
1355
1371
|
ref?: VNodeRef | undefined;
|
|
1356
1372
|
ref_for?: boolean | undefined;
|
|
1357
1373
|
ref_key?: string | undefined;
|
|
1358
|
-
}
|
|
1374
|
+
}
|
|
1359
1375
|
export type NativeElements = {
|
|
1360
1376
|
[K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] & ReservedProps;
|
|
1361
1377
|
};
|
|
@@ -1365,10 +1381,9 @@ export type NativeElements = {
|
|
|
1365
1381
|
*
|
|
1366
1382
|
* To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`.
|
|
1367
1383
|
*/
|
|
1368
|
-
type DomStub = {};
|
|
1369
1384
|
type DomType<T> = typeof globalThis extends {
|
|
1370
1385
|
window: unknown;
|
|
1371
|
-
} ? T :
|
|
1386
|
+
} ? T : never;
|
|
1372
1387
|
declare module '@vue/reactivity' {
|
|
1373
1388
|
interface RefUnwrapBailTypes {
|
|
1374
1389
|
runtimeDOMBailTypes: DomType<Node | Window>;
|