@vuact/runtime-dom 3.5.28-vuact.2 → 3.5.30-vuact.0
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 +191 -73
- package/dist/runtime-dom.cjs.prod.js +189 -70
- package/dist/runtime-dom.d.ts +795 -742
- package/dist/runtime-dom.esm-browser.js +3043 -2689
- package/dist/runtime-dom.esm-browser.prod.js +4 -3
- package/dist/runtime-dom.esm-bundler.js +195 -78
- package/dist/runtime-dom.global.js +3022 -2666
- package/dist/runtime-dom.global.prod.js +4 -3
- package/package.json +8 -8
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* @vue/runtime-dom v3.5.30
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -93,7 +93,7 @@ const nodeOps = {
|
|
|
93
93
|
|
|
94
94
|
const TRANSITION = "transition";
|
|
95
95
|
const ANIMATION = "animation";
|
|
96
|
-
const vtcKey = Symbol("_vtc");
|
|
96
|
+
const vtcKey = /* @__PURE__ */ Symbol("_vtc");
|
|
97
97
|
const DOMTransitionPropsValidators = {
|
|
98
98
|
name: String,
|
|
99
99
|
type: String,
|
|
@@ -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) {
|
|
@@ -347,7 +347,7 @@ function getTransitionInfo(el, expectedType) {
|
|
|
347
347
|
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
|
|
348
348
|
propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
|
|
349
349
|
}
|
|
350
|
-
const hasTransform = type === TRANSITION && /\b(transform|all)(
|
|
350
|
+
const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
|
|
351
351
|
getStyleProperties(`${TRANSITION}Property`).toString()
|
|
352
352
|
);
|
|
353
353
|
return {
|
|
@@ -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) {
|
|
@@ -385,9 +386,11 @@ function patchClass(el, value, isSVG) {
|
|
|
385
386
|
}
|
|
386
387
|
}
|
|
387
388
|
|
|
388
|
-
const vShowOriginalDisplay = Symbol("_vod");
|
|
389
|
-
const vShowHidden = Symbol("_vsh");
|
|
389
|
+
const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
|
|
390
|
+
const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
|
|
390
391
|
const vShow = {
|
|
392
|
+
// used for prop mismatch check during hydration
|
|
393
|
+
name: "show",
|
|
391
394
|
beforeMount(el, { value }, { transition }) {
|
|
392
395
|
el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
|
|
393
396
|
if (transition && value) {
|
|
@@ -421,9 +424,6 @@ const vShow = {
|
|
|
421
424
|
setDisplay(el, value);
|
|
422
425
|
}
|
|
423
426
|
};
|
|
424
|
-
{
|
|
425
|
-
vShow.name = "show";
|
|
426
|
-
}
|
|
427
427
|
function setDisplay(el, value) {
|
|
428
428
|
el.style.display = value ? el[vShowOriginalDisplay] : "none";
|
|
429
429
|
el[vShowHidden] = !value;
|
|
@@ -436,12 +436,12 @@ function initVShowForSSR() {
|
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
|
|
439
|
+
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("CSS_VAR_TEXT" );
|
|
440
440
|
function useCssVars(getter) {
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
-
const displayRE = /(
|
|
444
|
+
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
445
445
|
function patchStyle(el, prev, next) {
|
|
446
446
|
const style = el.style;
|
|
447
447
|
const isCssString = shared.isString(next);
|
|
@@ -618,7 +618,7 @@ function addEventListener(el, event, handler, options) {
|
|
|
618
618
|
function removeEventListener(el, event, handler, options) {
|
|
619
619
|
el.removeEventListener(event, handler, options);
|
|
620
620
|
}
|
|
621
|
-
const veiKey = Symbol("_vei");
|
|
621
|
+
const veiKey = /* @__PURE__ */ Symbol("_vei");
|
|
622
622
|
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
623
623
|
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
624
624
|
const existingInvoker = invokers[rawName];
|
|
@@ -717,7 +717,9 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
|
|
|
717
717
|
}
|
|
718
718
|
} else if (
|
|
719
719
|
// #11081 force set props for possible async custom element
|
|
720
|
-
el._isVueCE &&
|
|
720
|
+
el._isVueCE && // #12408 check if it's declared prop or it's async custom element
|
|
721
|
+
(shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
|
|
722
|
+
el._def.__asyncLoader && (/[A-Z]/.test(key) || !shared.isString(nextValue)))
|
|
721
723
|
) {
|
|
722
724
|
patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key);
|
|
723
725
|
} else {
|
|
@@ -742,6 +744,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
742
744
|
if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
|
|
743
745
|
return false;
|
|
744
746
|
}
|
|
747
|
+
if (key === "sandbox" && el.tagName === "IFRAME") {
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
745
750
|
if (key === "form") {
|
|
746
751
|
return false;
|
|
747
752
|
}
|
|
@@ -762,13 +767,23 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
762
767
|
}
|
|
763
768
|
return key in el;
|
|
764
769
|
}
|
|
770
|
+
function shouldSetAsPropForVueCE(el, key) {
|
|
771
|
+
const props = (
|
|
772
|
+
// @ts-expect-error _def is private
|
|
773
|
+
el._def.props
|
|
774
|
+
);
|
|
775
|
+
if (!props) {
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
const camelKey = shared.camelize(key);
|
|
779
|
+
return Array.isArray(props) ? props.some((prop) => shared.camelize(prop) === camelKey) : Object.keys(props).some((prop) => shared.camelize(prop) === camelKey);
|
|
780
|
+
}
|
|
765
781
|
|
|
766
782
|
const REMOVAL = {};
|
|
767
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
768
783
|
// @__NO_SIDE_EFFECTS__
|
|
769
784
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
770
|
-
|
|
771
|
-
if (shared.isPlainObject(Comp)) shared.extend(Comp, extraOptions);
|
|
785
|
+
let Comp = runtimeCore.defineComponent(options, extraOptions);
|
|
786
|
+
if (shared.isPlainObject(Comp)) Comp = shared.extend({}, Comp, extraOptions);
|
|
772
787
|
class VueCustomElement extends VueElement {
|
|
773
788
|
constructor(initialProps) {
|
|
774
789
|
super(Comp, initialProps, _createApp);
|
|
@@ -777,10 +792,9 @@ function defineCustomElement(options, extraOptions, _createApp) {
|
|
|
777
792
|
VueCustomElement.def = Comp;
|
|
778
793
|
return VueCustomElement;
|
|
779
794
|
}
|
|
780
|
-
|
|
781
|
-
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
795
|
+
const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
782
796
|
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
|
|
783
|
-
};
|
|
797
|
+
});
|
|
784
798
|
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
785
799
|
};
|
|
786
800
|
class VueElement extends BaseClass {
|
|
@@ -804,8 +818,11 @@ class VueElement extends BaseClass {
|
|
|
804
818
|
this._nonce = this._def.nonce;
|
|
805
819
|
this._connected = false;
|
|
806
820
|
this._resolved = false;
|
|
821
|
+
this._patching = false;
|
|
822
|
+
this._dirty = false;
|
|
807
823
|
this._numberProps = null;
|
|
808
824
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
825
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
809
826
|
this._ob = null;
|
|
810
827
|
if (this.shadowRoot && _createApp !== createApp) {
|
|
811
828
|
this._root = this.shadowRoot;
|
|
@@ -816,7 +833,11 @@ class VueElement extends BaseClass {
|
|
|
816
833
|
);
|
|
817
834
|
}
|
|
818
835
|
if (_def.shadowRoot !== false) {
|
|
819
|
-
this.attachShadow(
|
|
836
|
+
this.attachShadow(
|
|
837
|
+
shared.extend({}, _def.shadowRootOptions, {
|
|
838
|
+
mode: "open"
|
|
839
|
+
})
|
|
840
|
+
);
|
|
820
841
|
this._root = this.shadowRoot;
|
|
821
842
|
} else {
|
|
822
843
|
this._root = this;
|
|
@@ -830,7 +851,8 @@ class VueElement extends BaseClass {
|
|
|
830
851
|
}
|
|
831
852
|
this._connected = true;
|
|
832
853
|
let parent = this;
|
|
833
|
-
while (parent = parent &&
|
|
854
|
+
while (parent = parent && // #12479 should check assignedSlot first to get correct parent
|
|
855
|
+
(parent.assignedSlot || parent.parentNode || parent.host)) {
|
|
834
856
|
if (parent instanceof VueElement) {
|
|
835
857
|
this._parent = parent;
|
|
836
858
|
break;
|
|
@@ -876,9 +898,18 @@ class VueElement extends BaseClass {
|
|
|
876
898
|
this._app && this._app.unmount();
|
|
877
899
|
if (this._instance) this._instance.ce = void 0;
|
|
878
900
|
this._app = this._instance = null;
|
|
901
|
+
if (this._teleportTargets) {
|
|
902
|
+
this._teleportTargets.clear();
|
|
903
|
+
this._teleportTargets = void 0;
|
|
904
|
+
}
|
|
879
905
|
}
|
|
880
906
|
});
|
|
881
907
|
}
|
|
908
|
+
_processMutations(mutations) {
|
|
909
|
+
for (const m of mutations) {
|
|
910
|
+
this._setAttr(m.attributeName);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
882
913
|
/**
|
|
883
914
|
* resolve inner component definition (handle possible async component)
|
|
884
915
|
*/
|
|
@@ -889,11 +920,7 @@ class VueElement extends BaseClass {
|
|
|
889
920
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
890
921
|
this._setAttr(this.attributes[i].name);
|
|
891
922
|
}
|
|
892
|
-
this._ob = new MutationObserver((
|
|
893
|
-
for (const m of mutations) {
|
|
894
|
-
this._setAttr(m.attributeName);
|
|
895
|
-
}
|
|
896
|
-
});
|
|
923
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
897
924
|
this._ob.observe(this, { attributes: true });
|
|
898
925
|
const resolve = (def, isAsync = false) => {
|
|
899
926
|
this._resolved = true;
|
|
@@ -924,9 +951,10 @@ class VueElement extends BaseClass {
|
|
|
924
951
|
};
|
|
925
952
|
const asyncDef = this._def.__asyncLoader;
|
|
926
953
|
if (asyncDef) {
|
|
927
|
-
this._pendingResolve = asyncDef().then(
|
|
928
|
-
|
|
929
|
-
|
|
954
|
+
this._pendingResolve = asyncDef().then((def) => {
|
|
955
|
+
def.configureApp = this._def.configureApp;
|
|
956
|
+
resolve(this._def = def, true);
|
|
957
|
+
});
|
|
930
958
|
} else {
|
|
931
959
|
resolve(this._def);
|
|
932
960
|
}
|
|
@@ -969,7 +997,7 @@ class VueElement extends BaseClass {
|
|
|
969
997
|
return this._getProp(key);
|
|
970
998
|
},
|
|
971
999
|
set(val) {
|
|
972
|
-
this._setProp(key, val, true,
|
|
1000
|
+
this._setProp(key, val, true, !this._patching);
|
|
973
1001
|
}
|
|
974
1002
|
});
|
|
975
1003
|
}
|
|
@@ -995,6 +1023,7 @@ class VueElement extends BaseClass {
|
|
|
995
1023
|
*/
|
|
996
1024
|
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
997
1025
|
if (val !== this._props[key]) {
|
|
1026
|
+
this._dirty = true;
|
|
998
1027
|
if (val === REMOVAL) {
|
|
999
1028
|
delete this._props[key];
|
|
1000
1029
|
} else {
|
|
@@ -1008,7 +1037,10 @@ class VueElement extends BaseClass {
|
|
|
1008
1037
|
}
|
|
1009
1038
|
if (shouldReflect) {
|
|
1010
1039
|
const ob = this._ob;
|
|
1011
|
-
|
|
1040
|
+
if (ob) {
|
|
1041
|
+
this._processMutations(ob.takeRecords());
|
|
1042
|
+
ob.disconnect();
|
|
1043
|
+
}
|
|
1012
1044
|
if (val === true) {
|
|
1013
1045
|
this.setAttribute(shared.hyphenate(key), "");
|
|
1014
1046
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -1042,6 +1074,7 @@ class VueElement extends BaseClass {
|
|
|
1042
1074
|
this._styles.forEach((s) => this._root.removeChild(s));
|
|
1043
1075
|
this._styles.length = 0;
|
|
1044
1076
|
}
|
|
1077
|
+
this._styleAnchors.delete(this._def);
|
|
1045
1078
|
this._applyStyles(newStyles);
|
|
1046
1079
|
this._instance = null;
|
|
1047
1080
|
this._update();
|
|
@@ -1066,7 +1099,7 @@ class VueElement extends BaseClass {
|
|
|
1066
1099
|
}
|
|
1067
1100
|
return vnode;
|
|
1068
1101
|
}
|
|
1069
|
-
_applyStyles(styles, owner) {
|
|
1102
|
+
_applyStyles(styles, owner, parentComp) {
|
|
1070
1103
|
if (!styles) return;
|
|
1071
1104
|
if (owner) {
|
|
1072
1105
|
if (owner === this._def || this._styleChildren.has(owner)) {
|
|
@@ -1075,11 +1108,19 @@ class VueElement extends BaseClass {
|
|
|
1075
1108
|
this._styleChildren.add(owner);
|
|
1076
1109
|
}
|
|
1077
1110
|
const nonce = this._nonce;
|
|
1111
|
+
const root = this.shadowRoot;
|
|
1112
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
1113
|
+
let last = null;
|
|
1078
1114
|
for (let i = styles.length - 1; i >= 0; i--) {
|
|
1079
1115
|
const s = document.createElement("style");
|
|
1080
1116
|
if (nonce) s.setAttribute("nonce", nonce);
|
|
1081
1117
|
s.textContent = styles[i];
|
|
1082
|
-
|
|
1118
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
1119
|
+
last = s;
|
|
1120
|
+
if (i === 0) {
|
|
1121
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
1122
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
1123
|
+
}
|
|
1083
1124
|
{
|
|
1084
1125
|
if (owner) {
|
|
1085
1126
|
if (owner.__hmrId) {
|
|
@@ -1096,6 +1137,28 @@ class VueElement extends BaseClass {
|
|
|
1096
1137
|
}
|
|
1097
1138
|
}
|
|
1098
1139
|
}
|
|
1140
|
+
_getStyleAnchor(comp) {
|
|
1141
|
+
if (!comp) {
|
|
1142
|
+
return null;
|
|
1143
|
+
}
|
|
1144
|
+
const anchor = this._styleAnchors.get(comp);
|
|
1145
|
+
if (anchor && anchor.parentNode === this.shadowRoot) {
|
|
1146
|
+
return anchor;
|
|
1147
|
+
}
|
|
1148
|
+
if (anchor) {
|
|
1149
|
+
this._styleAnchors.delete(comp);
|
|
1150
|
+
}
|
|
1151
|
+
return null;
|
|
1152
|
+
}
|
|
1153
|
+
_getRootStyleInsertionAnchor(root) {
|
|
1154
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
1155
|
+
const node = root.childNodes[i];
|
|
1156
|
+
if (!(node instanceof HTMLStyleElement)) {
|
|
1157
|
+
return node;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
return null;
|
|
1161
|
+
}
|
|
1099
1162
|
/**
|
|
1100
1163
|
* Only called when shadowRoot is false
|
|
1101
1164
|
*/
|
|
@@ -1112,7 +1175,7 @@ class VueElement extends BaseClass {
|
|
|
1112
1175
|
* Only called when shadowRoot is false
|
|
1113
1176
|
*/
|
|
1114
1177
|
_renderSlots() {
|
|
1115
|
-
const outlets =
|
|
1178
|
+
const outlets = this._getSlots();
|
|
1116
1179
|
const scopeId = this._instance.type.__scopeId;
|
|
1117
1180
|
for (let i = 0; i < outlets.length; i++) {
|
|
1118
1181
|
const o = outlets[i];
|
|
@@ -1141,8 +1204,47 @@ class VueElement extends BaseClass {
|
|
|
1141
1204
|
/**
|
|
1142
1205
|
* @internal
|
|
1143
1206
|
*/
|
|
1144
|
-
|
|
1145
|
-
this
|
|
1207
|
+
_getSlots() {
|
|
1208
|
+
const roots = [this];
|
|
1209
|
+
if (this._teleportTargets) {
|
|
1210
|
+
roots.push(...this._teleportTargets);
|
|
1211
|
+
}
|
|
1212
|
+
const slots = /* @__PURE__ */ new Set();
|
|
1213
|
+
for (const root of roots) {
|
|
1214
|
+
const found = root.querySelectorAll("slot");
|
|
1215
|
+
for (let i = 0; i < found.length; i++) {
|
|
1216
|
+
slots.add(found[i]);
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
return Array.from(slots);
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* @internal
|
|
1223
|
+
*/
|
|
1224
|
+
_injectChildStyle(comp, parentComp) {
|
|
1225
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* @internal
|
|
1229
|
+
*/
|
|
1230
|
+
_beginPatch() {
|
|
1231
|
+
this._patching = true;
|
|
1232
|
+
this._dirty = false;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* @internal
|
|
1236
|
+
*/
|
|
1237
|
+
_endPatch() {
|
|
1238
|
+
this._patching = false;
|
|
1239
|
+
if (this._dirty && this._instance) {
|
|
1240
|
+
this._update();
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* @internal
|
|
1245
|
+
*/
|
|
1246
|
+
_hasShadowRoot() {
|
|
1247
|
+
return this._def.shadowRoot !== false;
|
|
1146
1248
|
}
|
|
1147
1249
|
/**
|
|
1148
1250
|
* @internal
|
|
@@ -1150,6 +1252,7 @@ class VueElement extends BaseClass {
|
|
|
1150
1252
|
_removeChildStyle(comp) {
|
|
1151
1253
|
{
|
|
1152
1254
|
this._styleChildren.delete(comp);
|
|
1255
|
+
this._styleAnchors.delete(comp);
|
|
1153
1256
|
if (this._childStyles && comp.__hmrId) {
|
|
1154
1257
|
const oldStyles = this._childStyles.get(comp.__hmrId);
|
|
1155
1258
|
if (oldStyles) {
|
|
@@ -1206,8 +1309,8 @@ function useCssModule(name = "$style") {
|
|
|
1206
1309
|
|
|
1207
1310
|
const positionMap = /* @__PURE__ */ new WeakMap();
|
|
1208
1311
|
const newPositionMap = /* @__PURE__ */ new WeakMap();
|
|
1209
|
-
const moveCbKey = Symbol("_moveCb");
|
|
1210
|
-
const enterCbKey = Symbol("_enterCb");
|
|
1312
|
+
const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
|
|
1313
|
+
const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
|
|
1211
1314
|
const decorate = (t) => {
|
|
1212
1315
|
delete t.props.mode;
|
|
1213
1316
|
return t;
|
|
@@ -1239,7 +1342,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1239
1342
|
prevChildren.forEach(callPendingCbs);
|
|
1240
1343
|
prevChildren.forEach(recordPosition);
|
|
1241
1344
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
1242
|
-
forceReflow();
|
|
1345
|
+
forceReflow(instance.vnode.el);
|
|
1243
1346
|
movedChildren.forEach((c) => {
|
|
1244
1347
|
const el = c.el;
|
|
1245
1348
|
const style = el.style;
|
|
@@ -1249,7 +1352,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1249
1352
|
if (e && e.target !== el) {
|
|
1250
1353
|
return;
|
|
1251
1354
|
}
|
|
1252
|
-
if (!e ||
|
|
1355
|
+
if (!e || e.propertyName.endsWith("transform")) {
|
|
1253
1356
|
el.removeEventListener("transitionend", cb);
|
|
1254
1357
|
el[moveCbKey] = null;
|
|
1255
1358
|
removeTransitionClass(el, moveClass);
|
|
@@ -1278,10 +1381,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1278
1381
|
instance
|
|
1279
1382
|
)
|
|
1280
1383
|
);
|
|
1281
|
-
positionMap.set(
|
|
1282
|
-
child,
|
|
1283
|
-
child.el.getBoundingClientRect()
|
|
1284
|
-
);
|
|
1384
|
+
positionMap.set(child, getPosition(child.el));
|
|
1285
1385
|
}
|
|
1286
1386
|
}
|
|
1287
1387
|
}
|
|
@@ -1312,7 +1412,7 @@ function callPendingCbs(c) {
|
|
|
1312
1412
|
}
|
|
1313
1413
|
}
|
|
1314
1414
|
function recordPosition(c) {
|
|
1315
|
-
newPositionMap.set(c, c.el
|
|
1415
|
+
newPositionMap.set(c, getPosition(c.el));
|
|
1316
1416
|
}
|
|
1317
1417
|
function applyTranslation(c) {
|
|
1318
1418
|
const oldPos = positionMap.get(c);
|
|
@@ -1320,12 +1420,29 @@ function applyTranslation(c) {
|
|
|
1320
1420
|
const dx = oldPos.left - newPos.left;
|
|
1321
1421
|
const dy = oldPos.top - newPos.top;
|
|
1322
1422
|
if (dx || dy) {
|
|
1323
|
-
const
|
|
1324
|
-
s
|
|
1423
|
+
const el = c.el;
|
|
1424
|
+
const s = el.style;
|
|
1425
|
+
const rect = el.getBoundingClientRect();
|
|
1426
|
+
let scaleX = 1;
|
|
1427
|
+
let scaleY = 1;
|
|
1428
|
+
if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
|
|
1429
|
+
if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
|
|
1430
|
+
if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
|
|
1431
|
+
if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
|
|
1432
|
+
if (Math.abs(scaleX - 1) < 0.01) scaleX = 1;
|
|
1433
|
+
if (Math.abs(scaleY - 1) < 0.01) scaleY = 1;
|
|
1434
|
+
s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
|
|
1325
1435
|
s.transitionDuration = "0s";
|
|
1326
1436
|
return c;
|
|
1327
1437
|
}
|
|
1328
1438
|
}
|
|
1439
|
+
function getPosition(el) {
|
|
1440
|
+
const rect = el.getBoundingClientRect();
|
|
1441
|
+
return {
|
|
1442
|
+
left: rect.left,
|
|
1443
|
+
top: rect.top
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1329
1446
|
function hasCSSTransform(el, root, moveClass) {
|
|
1330
1447
|
const clone = el.cloneNode();
|
|
1331
1448
|
const _vtc = el[vtcKey];
|
|
@@ -1357,25 +1474,23 @@ function onCompositionEnd(e) {
|
|
|
1357
1474
|
target.dispatchEvent(new Event("input"));
|
|
1358
1475
|
}
|
|
1359
1476
|
}
|
|
1360
|
-
const assignKey = Symbol("_assign");
|
|
1477
|
+
const assignKey = /* @__PURE__ */ Symbol("_assign");
|
|
1478
|
+
function castValue(value, trim, number) {
|
|
1479
|
+
if (trim) value = value.trim();
|
|
1480
|
+
if (number) value = shared.looseToNumber(value);
|
|
1481
|
+
return value;
|
|
1482
|
+
}
|
|
1361
1483
|
const vModelText = {
|
|
1362
1484
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
1363
1485
|
el[assignKey] = getModelAssigner(vnode);
|
|
1364
1486
|
const castToNumber = number || vnode.props && vnode.props.type === "number";
|
|
1365
1487
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
1366
1488
|
if (e.target.composing) return;
|
|
1367
|
-
|
|
1368
|
-
if (trim) {
|
|
1369
|
-
domValue = domValue.trim();
|
|
1370
|
-
}
|
|
1371
|
-
if (castToNumber) {
|
|
1372
|
-
domValue = shared.looseToNumber(domValue);
|
|
1373
|
-
}
|
|
1374
|
-
el[assignKey](domValue);
|
|
1489
|
+
el[assignKey](castValue(el.value, trim, castToNumber));
|
|
1375
1490
|
});
|
|
1376
|
-
if (trim) {
|
|
1491
|
+
if (trim || castToNumber) {
|
|
1377
1492
|
addEventListener(el, "change", () => {
|
|
1378
|
-
el.value = el.value
|
|
1493
|
+
el.value = castValue(el.value, trim, castToNumber);
|
|
1379
1494
|
});
|
|
1380
1495
|
}
|
|
1381
1496
|
if (!lazy) {
|
|
@@ -1638,15 +1753,16 @@ const modifierGuards = {
|
|
|
1638
1753
|
exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
|
|
1639
1754
|
};
|
|
1640
1755
|
const withModifiers = (fn, modifiers) => {
|
|
1756
|
+
if (!fn) return fn;
|
|
1641
1757
|
const cache = fn._withMods || (fn._withMods = {});
|
|
1642
1758
|
const cacheKey = modifiers.join(".");
|
|
1643
|
-
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
|
|
1759
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|
|
1644
1760
|
for (let i = 0; i < modifiers.length; i++) {
|
|
1645
1761
|
const guard = modifierGuards[modifiers[i]];
|
|
1646
1762
|
if (guard && guard(event, modifiers)) return;
|
|
1647
1763
|
}
|
|
1648
1764
|
return fn(event, ...args);
|
|
1649
|
-
});
|
|
1765
|
+
}));
|
|
1650
1766
|
};
|
|
1651
1767
|
const keyNames = {
|
|
1652
1768
|
esc: "escape",
|
|
@@ -1660,7 +1776,7 @@ const keyNames = {
|
|
|
1660
1776
|
const withKeys = (fn, modifiers) => {
|
|
1661
1777
|
const cache = fn._withKeys || (fn._withKeys = {});
|
|
1662
1778
|
const cacheKey = modifiers.join(".");
|
|
1663
|
-
return cache[cacheKey] || (cache[cacheKey] = (event) => {
|
|
1779
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event) => {
|
|
1664
1780
|
if (!("key" in event)) {
|
|
1665
1781
|
return;
|
|
1666
1782
|
}
|
|
@@ -1670,7 +1786,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
1670
1786
|
)) {
|
|
1671
1787
|
return fn(event);
|
|
1672
1788
|
}
|
|
1673
|
-
});
|
|
1789
|
+
}));
|
|
1674
1790
|
};
|
|
1675
1791
|
|
|
1676
1792
|
const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps);
|
|
@@ -1684,13 +1800,13 @@ function ensureHydrationRenderer() {
|
|
|
1684
1800
|
enabledHydration = true;
|
|
1685
1801
|
return renderer;
|
|
1686
1802
|
}
|
|
1687
|
-
const render = (...args) => {
|
|
1803
|
+
const render = ((...args) => {
|
|
1688
1804
|
ensureRenderer().render(...args);
|
|
1689
|
-
};
|
|
1690
|
-
const hydrate = (...args) => {
|
|
1805
|
+
});
|
|
1806
|
+
const hydrate = ((...args) => {
|
|
1691
1807
|
ensureHydrationRenderer().hydrate(...args);
|
|
1692
|
-
};
|
|
1693
|
-
const createApp = (...args) => {
|
|
1808
|
+
});
|
|
1809
|
+
const createApp = ((...args) => {
|
|
1694
1810
|
const app = ensureRenderer().createApp(...args);
|
|
1695
1811
|
{
|
|
1696
1812
|
injectNativeTagCheck(app);
|
|
@@ -1715,8 +1831,8 @@ const createApp = (...args) => {
|
|
|
1715
1831
|
return proxy;
|
|
1716
1832
|
};
|
|
1717
1833
|
return app;
|
|
1718
|
-
};
|
|
1719
|
-
const createSSRApp = (...args) => {
|
|
1834
|
+
});
|
|
1835
|
+
const createSSRApp = ((...args) => {
|
|
1720
1836
|
const app = ensureHydrationRenderer().createApp(...args);
|
|
1721
1837
|
{
|
|
1722
1838
|
injectNativeTagCheck(app);
|
|
@@ -1730,7 +1846,7 @@ const createSSRApp = (...args) => {
|
|
|
1730
1846
|
}
|
|
1731
1847
|
};
|
|
1732
1848
|
return app;
|
|
1733
|
-
};
|
|
1849
|
+
});
|
|
1734
1850
|
function resolveRootNamespace(container) {
|
|
1735
1851
|
if (container instanceof SVGElement) {
|
|
1736
1852
|
return "svg";
|
|
@@ -1809,6 +1925,8 @@ exports.defineCustomElement = defineCustomElement;
|
|
|
1809
1925
|
exports.defineSSRCustomElement = defineSSRCustomElement;
|
|
1810
1926
|
exports.hydrate = hydrate;
|
|
1811
1927
|
exports.initDirectivesForSSR = initDirectivesForSSR;
|
|
1928
|
+
exports.nodeOps = nodeOps;
|
|
1929
|
+
exports.patchProp = patchProp;
|
|
1812
1930
|
exports.render = render;
|
|
1813
1931
|
exports.rendererOptions = rendererOptions;
|
|
1814
1932
|
exports.useCssModule = useCssModule;
|