@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
|
@@ -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
|
**/
|
|
@@ -92,7 +92,7 @@ const nodeOps = {
|
|
|
92
92
|
|
|
93
93
|
const TRANSITION = "transition";
|
|
94
94
|
const ANIMATION = "animation";
|
|
95
|
-
const vtcKey = Symbol("_vtc");
|
|
95
|
+
const vtcKey = /* @__PURE__ */ Symbol("_vtc");
|
|
96
96
|
const DOMTransitionPropsValidators = {
|
|
97
97
|
name: String,
|
|
98
98
|
type: String,
|
|
@@ -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) {
|
|
@@ -343,7 +343,7 @@ function getTransitionInfo(el, expectedType) {
|
|
|
343
343
|
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
|
|
344
344
|
propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
|
|
345
345
|
}
|
|
346
|
-
const hasTransform = type === TRANSITION && /\b(transform|all)(
|
|
346
|
+
const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
|
|
347
347
|
getStyleProperties(`${TRANSITION}Property`).toString()
|
|
348
348
|
);
|
|
349
349
|
return {
|
|
@@ -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) {
|
|
@@ -381,9 +382,11 @@ function patchClass(el, value, isSVG) {
|
|
|
381
382
|
}
|
|
382
383
|
}
|
|
383
384
|
|
|
384
|
-
const vShowOriginalDisplay = Symbol("_vod");
|
|
385
|
-
const vShowHidden = Symbol("_vsh");
|
|
385
|
+
const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
|
|
386
|
+
const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
|
|
386
387
|
const vShow = {
|
|
388
|
+
// used for prop mismatch check during hydration
|
|
389
|
+
name: "show",
|
|
387
390
|
beforeMount(el, { value }, { transition }) {
|
|
388
391
|
el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
|
|
389
392
|
if (transition && value) {
|
|
@@ -429,12 +432,12 @@ function initVShowForSSR() {
|
|
|
429
432
|
};
|
|
430
433
|
}
|
|
431
434
|
|
|
432
|
-
const CSS_VAR_TEXT = Symbol("");
|
|
435
|
+
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("");
|
|
433
436
|
function useCssVars(getter) {
|
|
434
437
|
return;
|
|
435
438
|
}
|
|
436
439
|
|
|
437
|
-
const displayRE = /(
|
|
440
|
+
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
438
441
|
function patchStyle(el, prev, next) {
|
|
439
442
|
const style = el.style;
|
|
440
443
|
const isCssString = shared.isString(next);
|
|
@@ -597,7 +600,7 @@ function addEventListener(el, event, handler, options) {
|
|
|
597
600
|
function removeEventListener(el, event, handler, options) {
|
|
598
601
|
el.removeEventListener(event, handler, options);
|
|
599
602
|
}
|
|
600
|
-
const veiKey = Symbol("_vei");
|
|
603
|
+
const veiKey = /* @__PURE__ */ Symbol("_vei");
|
|
601
604
|
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
602
605
|
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
603
606
|
const existingInvoker = invokers[rawName];
|
|
@@ -686,7 +689,9 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
|
|
|
686
689
|
}
|
|
687
690
|
} else if (
|
|
688
691
|
// #11081 force set props for possible async custom element
|
|
689
|
-
el._isVueCE &&
|
|
692
|
+
el._isVueCE && // #12408 check if it's declared prop or it's async custom element
|
|
693
|
+
(shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
|
|
694
|
+
el._def.__asyncLoader && (/[A-Z]/.test(key) || !shared.isString(nextValue)))
|
|
690
695
|
) {
|
|
691
696
|
patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key);
|
|
692
697
|
} else {
|
|
@@ -711,6 +716,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
711
716
|
if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
|
|
712
717
|
return false;
|
|
713
718
|
}
|
|
719
|
+
if (key === "sandbox" && el.tagName === "IFRAME") {
|
|
720
|
+
return false;
|
|
721
|
+
}
|
|
714
722
|
if (key === "form") {
|
|
715
723
|
return false;
|
|
716
724
|
}
|
|
@@ -731,13 +739,23 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
731
739
|
}
|
|
732
740
|
return key in el;
|
|
733
741
|
}
|
|
742
|
+
function shouldSetAsPropForVueCE(el, key) {
|
|
743
|
+
const props = (
|
|
744
|
+
// @ts-expect-error _def is private
|
|
745
|
+
el._def.props
|
|
746
|
+
);
|
|
747
|
+
if (!props) {
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
750
|
+
const camelKey = shared.camelize(key);
|
|
751
|
+
return Array.isArray(props) ? props.some((prop) => shared.camelize(prop) === camelKey) : Object.keys(props).some((prop) => shared.camelize(prop) === camelKey);
|
|
752
|
+
}
|
|
734
753
|
|
|
735
754
|
const REMOVAL = {};
|
|
736
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
737
755
|
// @__NO_SIDE_EFFECTS__
|
|
738
756
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
739
|
-
|
|
740
|
-
if (shared.isPlainObject(Comp)) shared.extend(Comp, extraOptions);
|
|
757
|
+
let Comp = runtimeCore.defineComponent(options, extraOptions);
|
|
758
|
+
if (shared.isPlainObject(Comp)) Comp = shared.extend({}, Comp, extraOptions);
|
|
741
759
|
class VueCustomElement extends VueElement {
|
|
742
760
|
constructor(initialProps) {
|
|
743
761
|
super(Comp, initialProps, _createApp);
|
|
@@ -746,10 +764,9 @@ function defineCustomElement(options, extraOptions, _createApp) {
|
|
|
746
764
|
VueCustomElement.def = Comp;
|
|
747
765
|
return VueCustomElement;
|
|
748
766
|
}
|
|
749
|
-
|
|
750
|
-
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
767
|
+
const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
751
768
|
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
|
|
752
|
-
};
|
|
769
|
+
});
|
|
753
770
|
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
754
771
|
};
|
|
755
772
|
class VueElement extends BaseClass {
|
|
@@ -773,14 +790,21 @@ class VueElement extends BaseClass {
|
|
|
773
790
|
this._nonce = this._def.nonce;
|
|
774
791
|
this._connected = false;
|
|
775
792
|
this._resolved = false;
|
|
793
|
+
this._patching = false;
|
|
794
|
+
this._dirty = false;
|
|
776
795
|
this._numberProps = null;
|
|
777
796
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
797
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
778
798
|
this._ob = null;
|
|
779
799
|
if (this.shadowRoot && _createApp !== createApp) {
|
|
780
800
|
this._root = this.shadowRoot;
|
|
781
801
|
} else {
|
|
782
802
|
if (_def.shadowRoot !== false) {
|
|
783
|
-
this.attachShadow(
|
|
803
|
+
this.attachShadow(
|
|
804
|
+
shared.extend({}, _def.shadowRootOptions, {
|
|
805
|
+
mode: "open"
|
|
806
|
+
})
|
|
807
|
+
);
|
|
784
808
|
this._root = this.shadowRoot;
|
|
785
809
|
} else {
|
|
786
810
|
this._root = this;
|
|
@@ -794,7 +818,8 @@ class VueElement extends BaseClass {
|
|
|
794
818
|
}
|
|
795
819
|
this._connected = true;
|
|
796
820
|
let parent = this;
|
|
797
|
-
while (parent = parent &&
|
|
821
|
+
while (parent = parent && // #12479 should check assignedSlot first to get correct parent
|
|
822
|
+
(parent.assignedSlot || parent.parentNode || parent.host)) {
|
|
798
823
|
if (parent instanceof VueElement) {
|
|
799
824
|
this._parent = parent;
|
|
800
825
|
break;
|
|
@@ -840,9 +865,18 @@ class VueElement extends BaseClass {
|
|
|
840
865
|
this._app && this._app.unmount();
|
|
841
866
|
if (this._instance) this._instance.ce = void 0;
|
|
842
867
|
this._app = this._instance = null;
|
|
868
|
+
if (this._teleportTargets) {
|
|
869
|
+
this._teleportTargets.clear();
|
|
870
|
+
this._teleportTargets = void 0;
|
|
871
|
+
}
|
|
843
872
|
}
|
|
844
873
|
});
|
|
845
874
|
}
|
|
875
|
+
_processMutations(mutations) {
|
|
876
|
+
for (const m of mutations) {
|
|
877
|
+
this._setAttr(m.attributeName);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
846
880
|
/**
|
|
847
881
|
* resolve inner component definition (handle possible async component)
|
|
848
882
|
*/
|
|
@@ -853,11 +887,7 @@ class VueElement extends BaseClass {
|
|
|
853
887
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
854
888
|
this._setAttr(this.attributes[i].name);
|
|
855
889
|
}
|
|
856
|
-
this._ob = new MutationObserver((
|
|
857
|
-
for (const m of mutations) {
|
|
858
|
-
this._setAttr(m.attributeName);
|
|
859
|
-
}
|
|
860
|
-
});
|
|
890
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
861
891
|
this._ob.observe(this, { attributes: true });
|
|
862
892
|
const resolve = (def, isAsync = false) => {
|
|
863
893
|
this._resolved = true;
|
|
@@ -884,9 +914,10 @@ class VueElement extends BaseClass {
|
|
|
884
914
|
};
|
|
885
915
|
const asyncDef = this._def.__asyncLoader;
|
|
886
916
|
if (asyncDef) {
|
|
887
|
-
this._pendingResolve = asyncDef().then(
|
|
888
|
-
|
|
889
|
-
|
|
917
|
+
this._pendingResolve = asyncDef().then((def) => {
|
|
918
|
+
def.configureApp = this._def.configureApp;
|
|
919
|
+
resolve(this._def = def, true);
|
|
920
|
+
});
|
|
890
921
|
} else {
|
|
891
922
|
resolve(this._def);
|
|
892
923
|
}
|
|
@@ -924,7 +955,7 @@ class VueElement extends BaseClass {
|
|
|
924
955
|
return this._getProp(key);
|
|
925
956
|
},
|
|
926
957
|
set(val) {
|
|
927
|
-
this._setProp(key, val, true,
|
|
958
|
+
this._setProp(key, val, true, !this._patching);
|
|
928
959
|
}
|
|
929
960
|
});
|
|
930
961
|
}
|
|
@@ -950,6 +981,7 @@ class VueElement extends BaseClass {
|
|
|
950
981
|
*/
|
|
951
982
|
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
952
983
|
if (val !== this._props[key]) {
|
|
984
|
+
this._dirty = true;
|
|
953
985
|
if (val === REMOVAL) {
|
|
954
986
|
delete this._props[key];
|
|
955
987
|
} else {
|
|
@@ -963,7 +995,10 @@ class VueElement extends BaseClass {
|
|
|
963
995
|
}
|
|
964
996
|
if (shouldReflect) {
|
|
965
997
|
const ob = this._ob;
|
|
966
|
-
|
|
998
|
+
if (ob) {
|
|
999
|
+
this._processMutations(ob.takeRecords());
|
|
1000
|
+
ob.disconnect();
|
|
1001
|
+
}
|
|
967
1002
|
if (val === true) {
|
|
968
1003
|
this.setAttribute(shared.hyphenate(key), "");
|
|
969
1004
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -1010,7 +1045,7 @@ class VueElement extends BaseClass {
|
|
|
1010
1045
|
}
|
|
1011
1046
|
return vnode;
|
|
1012
1047
|
}
|
|
1013
|
-
_applyStyles(styles, owner) {
|
|
1048
|
+
_applyStyles(styles, owner, parentComp) {
|
|
1014
1049
|
if (!styles) return;
|
|
1015
1050
|
if (owner) {
|
|
1016
1051
|
if (owner === this._def || this._styleChildren.has(owner)) {
|
|
@@ -1019,12 +1054,42 @@ class VueElement extends BaseClass {
|
|
|
1019
1054
|
this._styleChildren.add(owner);
|
|
1020
1055
|
}
|
|
1021
1056
|
const nonce = this._nonce;
|
|
1057
|
+
const root = this.shadowRoot;
|
|
1058
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
1059
|
+
let last = null;
|
|
1022
1060
|
for (let i = styles.length - 1; i >= 0; i--) {
|
|
1023
1061
|
const s = document.createElement("style");
|
|
1024
1062
|
if (nonce) s.setAttribute("nonce", nonce);
|
|
1025
1063
|
s.textContent = styles[i];
|
|
1026
|
-
|
|
1064
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
1065
|
+
last = s;
|
|
1066
|
+
if (i === 0) {
|
|
1067
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
1068
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
_getStyleAnchor(comp) {
|
|
1073
|
+
if (!comp) {
|
|
1074
|
+
return null;
|
|
1075
|
+
}
|
|
1076
|
+
const anchor = this._styleAnchors.get(comp);
|
|
1077
|
+
if (anchor && anchor.parentNode === this.shadowRoot) {
|
|
1078
|
+
return anchor;
|
|
1079
|
+
}
|
|
1080
|
+
if (anchor) {
|
|
1081
|
+
this._styleAnchors.delete(comp);
|
|
1082
|
+
}
|
|
1083
|
+
return null;
|
|
1084
|
+
}
|
|
1085
|
+
_getRootStyleInsertionAnchor(root) {
|
|
1086
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
1087
|
+
const node = root.childNodes[i];
|
|
1088
|
+
if (!(node instanceof HTMLStyleElement)) {
|
|
1089
|
+
return node;
|
|
1090
|
+
}
|
|
1027
1091
|
}
|
|
1092
|
+
return null;
|
|
1028
1093
|
}
|
|
1029
1094
|
/**
|
|
1030
1095
|
* Only called when shadowRoot is false
|
|
@@ -1042,7 +1107,7 @@ class VueElement extends BaseClass {
|
|
|
1042
1107
|
* Only called when shadowRoot is false
|
|
1043
1108
|
*/
|
|
1044
1109
|
_renderSlots() {
|
|
1045
|
-
const outlets =
|
|
1110
|
+
const outlets = this._getSlots();
|
|
1046
1111
|
const scopeId = this._instance.type.__scopeId;
|
|
1047
1112
|
for (let i = 0; i < outlets.length; i++) {
|
|
1048
1113
|
const o = outlets[i];
|
|
@@ -1071,8 +1136,47 @@ class VueElement extends BaseClass {
|
|
|
1071
1136
|
/**
|
|
1072
1137
|
* @internal
|
|
1073
1138
|
*/
|
|
1074
|
-
|
|
1075
|
-
this
|
|
1139
|
+
_getSlots() {
|
|
1140
|
+
const roots = [this];
|
|
1141
|
+
if (this._teleportTargets) {
|
|
1142
|
+
roots.push(...this._teleportTargets);
|
|
1143
|
+
}
|
|
1144
|
+
const slots = /* @__PURE__ */ new Set();
|
|
1145
|
+
for (const root of roots) {
|
|
1146
|
+
const found = root.querySelectorAll("slot");
|
|
1147
|
+
for (let i = 0; i < found.length; i++) {
|
|
1148
|
+
slots.add(found[i]);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
return Array.from(slots);
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* @internal
|
|
1155
|
+
*/
|
|
1156
|
+
_injectChildStyle(comp, parentComp) {
|
|
1157
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
1158
|
+
}
|
|
1159
|
+
/**
|
|
1160
|
+
* @internal
|
|
1161
|
+
*/
|
|
1162
|
+
_beginPatch() {
|
|
1163
|
+
this._patching = true;
|
|
1164
|
+
this._dirty = false;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* @internal
|
|
1168
|
+
*/
|
|
1169
|
+
_endPatch() {
|
|
1170
|
+
this._patching = false;
|
|
1171
|
+
if (this._dirty && this._instance) {
|
|
1172
|
+
this._update();
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* @internal
|
|
1177
|
+
*/
|
|
1178
|
+
_hasShadowRoot() {
|
|
1179
|
+
return this._def.shadowRoot !== false;
|
|
1076
1180
|
}
|
|
1077
1181
|
/**
|
|
1078
1182
|
* @internal
|
|
@@ -1113,8 +1217,8 @@ function useCssModule(name = "$style") {
|
|
|
1113
1217
|
|
|
1114
1218
|
const positionMap = /* @__PURE__ */ new WeakMap();
|
|
1115
1219
|
const newPositionMap = /* @__PURE__ */ new WeakMap();
|
|
1116
|
-
const moveCbKey = Symbol("_moveCb");
|
|
1117
|
-
const enterCbKey = Symbol("_enterCb");
|
|
1220
|
+
const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
|
|
1221
|
+
const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
|
|
1118
1222
|
const decorate = (t) => {
|
|
1119
1223
|
delete t.props.mode;
|
|
1120
1224
|
return t;
|
|
@@ -1146,7 +1250,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1146
1250
|
prevChildren.forEach(callPendingCbs);
|
|
1147
1251
|
prevChildren.forEach(recordPosition);
|
|
1148
1252
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
1149
|
-
forceReflow();
|
|
1253
|
+
forceReflow(instance.vnode.el);
|
|
1150
1254
|
movedChildren.forEach((c) => {
|
|
1151
1255
|
const el = c.el;
|
|
1152
1256
|
const style = el.style;
|
|
@@ -1156,7 +1260,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1156
1260
|
if (e && e.target !== el) {
|
|
1157
1261
|
return;
|
|
1158
1262
|
}
|
|
1159
|
-
if (!e ||
|
|
1263
|
+
if (!e || e.propertyName.endsWith("transform")) {
|
|
1160
1264
|
el.removeEventListener("transitionend", cb);
|
|
1161
1265
|
el[moveCbKey] = null;
|
|
1162
1266
|
removeTransitionClass(el, moveClass);
|
|
@@ -1185,10 +1289,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1185
1289
|
instance
|
|
1186
1290
|
)
|
|
1187
1291
|
);
|
|
1188
|
-
positionMap.set(
|
|
1189
|
-
child,
|
|
1190
|
-
child.el.getBoundingClientRect()
|
|
1191
|
-
);
|
|
1292
|
+
positionMap.set(child, getPosition(child.el));
|
|
1192
1293
|
}
|
|
1193
1294
|
}
|
|
1194
1295
|
}
|
|
@@ -1217,7 +1318,7 @@ function callPendingCbs(c) {
|
|
|
1217
1318
|
}
|
|
1218
1319
|
}
|
|
1219
1320
|
function recordPosition(c) {
|
|
1220
|
-
newPositionMap.set(c, c.el
|
|
1321
|
+
newPositionMap.set(c, getPosition(c.el));
|
|
1221
1322
|
}
|
|
1222
1323
|
function applyTranslation(c) {
|
|
1223
1324
|
const oldPos = positionMap.get(c);
|
|
@@ -1225,12 +1326,29 @@ function applyTranslation(c) {
|
|
|
1225
1326
|
const dx = oldPos.left - newPos.left;
|
|
1226
1327
|
const dy = oldPos.top - newPos.top;
|
|
1227
1328
|
if (dx || dy) {
|
|
1228
|
-
const
|
|
1229
|
-
s
|
|
1329
|
+
const el = c.el;
|
|
1330
|
+
const s = el.style;
|
|
1331
|
+
const rect = el.getBoundingClientRect();
|
|
1332
|
+
let scaleX = 1;
|
|
1333
|
+
let scaleY = 1;
|
|
1334
|
+
if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
|
|
1335
|
+
if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
|
|
1336
|
+
if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
|
|
1337
|
+
if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
|
|
1338
|
+
if (Math.abs(scaleX - 1) < 0.01) scaleX = 1;
|
|
1339
|
+
if (Math.abs(scaleY - 1) < 0.01) scaleY = 1;
|
|
1340
|
+
s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
|
|
1230
1341
|
s.transitionDuration = "0s";
|
|
1231
1342
|
return c;
|
|
1232
1343
|
}
|
|
1233
1344
|
}
|
|
1345
|
+
function getPosition(el) {
|
|
1346
|
+
const rect = el.getBoundingClientRect();
|
|
1347
|
+
return {
|
|
1348
|
+
left: rect.left,
|
|
1349
|
+
top: rect.top
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1234
1352
|
function hasCSSTransform(el, root, moveClass) {
|
|
1235
1353
|
const clone = el.cloneNode();
|
|
1236
1354
|
const _vtc = el[vtcKey];
|
|
@@ -1262,25 +1380,23 @@ function onCompositionEnd(e) {
|
|
|
1262
1380
|
target.dispatchEvent(new Event("input"));
|
|
1263
1381
|
}
|
|
1264
1382
|
}
|
|
1265
|
-
const assignKey = Symbol("_assign");
|
|
1383
|
+
const assignKey = /* @__PURE__ */ Symbol("_assign");
|
|
1384
|
+
function castValue(value, trim, number) {
|
|
1385
|
+
if (trim) value = value.trim();
|
|
1386
|
+
if (number) value = shared.looseToNumber(value);
|
|
1387
|
+
return value;
|
|
1388
|
+
}
|
|
1266
1389
|
const vModelText = {
|
|
1267
1390
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
1268
1391
|
el[assignKey] = getModelAssigner(vnode);
|
|
1269
1392
|
const castToNumber = number || vnode.props && vnode.props.type === "number";
|
|
1270
1393
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
1271
1394
|
if (e.target.composing) return;
|
|
1272
|
-
|
|
1273
|
-
if (trim) {
|
|
1274
|
-
domValue = domValue.trim();
|
|
1275
|
-
}
|
|
1276
|
-
if (castToNumber) {
|
|
1277
|
-
domValue = shared.looseToNumber(domValue);
|
|
1278
|
-
}
|
|
1279
|
-
el[assignKey](domValue);
|
|
1395
|
+
el[assignKey](castValue(el.value, trim, castToNumber));
|
|
1280
1396
|
});
|
|
1281
|
-
if (trim) {
|
|
1397
|
+
if (trim || castToNumber) {
|
|
1282
1398
|
addEventListener(el, "change", () => {
|
|
1283
|
-
el.value = el.value
|
|
1399
|
+
el.value = castValue(el.value, trim, castToNumber);
|
|
1284
1400
|
});
|
|
1285
1401
|
}
|
|
1286
1402
|
if (!lazy) {
|
|
@@ -1540,15 +1656,16 @@ const modifierGuards = {
|
|
|
1540
1656
|
exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
|
|
1541
1657
|
};
|
|
1542
1658
|
const withModifiers = (fn, modifiers) => {
|
|
1659
|
+
if (!fn) return fn;
|
|
1543
1660
|
const cache = fn._withMods || (fn._withMods = {});
|
|
1544
1661
|
const cacheKey = modifiers.join(".");
|
|
1545
|
-
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
|
|
1662
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|
|
1546
1663
|
for (let i = 0; i < modifiers.length; i++) {
|
|
1547
1664
|
const guard = modifierGuards[modifiers[i]];
|
|
1548
1665
|
if (guard && guard(event, modifiers)) return;
|
|
1549
1666
|
}
|
|
1550
1667
|
return fn(event, ...args);
|
|
1551
|
-
});
|
|
1668
|
+
}));
|
|
1552
1669
|
};
|
|
1553
1670
|
const keyNames = {
|
|
1554
1671
|
esc: "escape",
|
|
@@ -1562,7 +1679,7 @@ const keyNames = {
|
|
|
1562
1679
|
const withKeys = (fn, modifiers) => {
|
|
1563
1680
|
const cache = fn._withKeys || (fn._withKeys = {});
|
|
1564
1681
|
const cacheKey = modifiers.join(".");
|
|
1565
|
-
return cache[cacheKey] || (cache[cacheKey] = (event) => {
|
|
1682
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event) => {
|
|
1566
1683
|
if (!("key" in event)) {
|
|
1567
1684
|
return;
|
|
1568
1685
|
}
|
|
@@ -1572,7 +1689,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
1572
1689
|
)) {
|
|
1573
1690
|
return fn(event);
|
|
1574
1691
|
}
|
|
1575
|
-
});
|
|
1692
|
+
}));
|
|
1576
1693
|
};
|
|
1577
1694
|
|
|
1578
1695
|
const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps);
|
|
@@ -1586,13 +1703,13 @@ function ensureHydrationRenderer() {
|
|
|
1586
1703
|
enabledHydration = true;
|
|
1587
1704
|
return renderer;
|
|
1588
1705
|
}
|
|
1589
|
-
const render = (...args) => {
|
|
1706
|
+
const render = ((...args) => {
|
|
1590
1707
|
ensureRenderer().render(...args);
|
|
1591
|
-
};
|
|
1592
|
-
const hydrate = (...args) => {
|
|
1708
|
+
});
|
|
1709
|
+
const hydrate = ((...args) => {
|
|
1593
1710
|
ensureHydrationRenderer().hydrate(...args);
|
|
1594
|
-
};
|
|
1595
|
-
const createApp = (...args) => {
|
|
1711
|
+
});
|
|
1712
|
+
const createApp = ((...args) => {
|
|
1596
1713
|
const app = ensureRenderer().createApp(...args);
|
|
1597
1714
|
const { mount } = app;
|
|
1598
1715
|
app.mount = (containerOrSelector) => {
|
|
@@ -1613,8 +1730,8 @@ const createApp = (...args) => {
|
|
|
1613
1730
|
return proxy;
|
|
1614
1731
|
};
|
|
1615
1732
|
return app;
|
|
1616
|
-
};
|
|
1617
|
-
const createSSRApp = (...args) => {
|
|
1733
|
+
});
|
|
1734
|
+
const createSSRApp = ((...args) => {
|
|
1618
1735
|
const app = ensureHydrationRenderer().createApp(...args);
|
|
1619
1736
|
const { mount } = app;
|
|
1620
1737
|
app.mount = (containerOrSelector) => {
|
|
@@ -1624,7 +1741,7 @@ const createSSRApp = (...args) => {
|
|
|
1624
1741
|
}
|
|
1625
1742
|
};
|
|
1626
1743
|
return app;
|
|
1627
|
-
};
|
|
1744
|
+
});
|
|
1628
1745
|
function resolveRootNamespace(container) {
|
|
1629
1746
|
if (container instanceof SVGElement) {
|
|
1630
1747
|
return "svg";
|
|
@@ -1658,6 +1775,8 @@ exports.defineCustomElement = defineCustomElement;
|
|
|
1658
1775
|
exports.defineSSRCustomElement = defineSSRCustomElement;
|
|
1659
1776
|
exports.hydrate = hydrate;
|
|
1660
1777
|
exports.initDirectivesForSSR = initDirectivesForSSR;
|
|
1778
|
+
exports.nodeOps = nodeOps;
|
|
1779
|
+
exports.patchProp = patchProp;
|
|
1661
1780
|
exports.render = render;
|
|
1662
1781
|
exports.rendererOptions = rendererOptions;
|
|
1663
1782
|
exports.useCssModule = useCssModule;
|