@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.
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @vuact/runtime-dom v3.5.16
2
+ * @vue/runtime-dom v3.5.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- import { warn, BaseTransitionPropsValidators, h, BaseTransition, assertNumber, getCurrentInstance, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, unref, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, createRenderer, createHydrationRenderer, isRuntimeOnly } from '@vue/runtime-core';
6
+ import { warn, BaseTransitionPropsValidators, h, BaseTransition, assertNumber, getCurrentInstance, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, nextTick, unref, createVNode, defineComponent, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, createRenderer, isRuntimeOnly, createHydrationRenderer } from '@vue/runtime-core';
7
7
  export * from '@vue/runtime-core';
8
- import { extend, isObject, toNumber, isArray, NOOP, isString, hyphenate, capitalize, isSpecialBooleanAttr, includeBooleanAttr, isSymbol, isFunction, isOn, isModelListener, camelize as camelize$1, isPlainObject, hasOwn, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared';
8
+ import { extend, isObject, toNumber, isArray, NOOP, normalizeCssVarValue, isString, hyphenate, capitalize, includeBooleanAttr, isSymbol, isSpecialBooleanAttr, isFunction, isOn, isModelListener, camelize as camelize$1, hasOwn, isPlainObject, EMPTY_OBJ, looseIndexOf, isSet, looseEqual, looseToNumber, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared';
9
9
 
10
10
  let policy = void 0;
11
11
  const tt = typeof window !== "undefined" && window.trustedTypes;
@@ -90,7 +90,7 @@ const nodeOps = {
90
90
 
91
91
  const TRANSITION = "transition";
92
92
  const ANIMATION = "animation";
93
- const vtcKey = Symbol("_vtc");
93
+ const vtcKey = /* @__PURE__ */ Symbol("_vtc");
94
94
  const DOMTransitionPropsValidators = {
95
95
  name: String,
96
96
  type: String,
@@ -214,11 +214,11 @@ function resolveTransitionProps(rawProps) {
214
214
  const resolve = () => finishLeave(el, done);
215
215
  addTransitionClass(el, leaveFromClass);
216
216
  if (!el._enterCancelled) {
217
- forceReflow();
217
+ forceReflow(el);
218
218
  addTransitionClass(el, leaveActiveClass);
219
219
  } else {
220
220
  addTransitionClass(el, leaveActiveClass);
221
- forceReflow();
221
+ forceReflow(el);
222
222
  }
223
223
  nextFrame(() => {
224
224
  if (!el._isLeaving) {
@@ -344,7 +344,7 @@ function getTransitionInfo(el, expectedType) {
344
344
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
345
345
  propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
346
346
  }
347
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
347
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
348
348
  getStyleProperties(`${TRANSITION}Property`).toString()
349
349
  );
350
350
  return {
@@ -364,8 +364,9 @@ function toMs(s) {
364
364
  if (s === "auto") return 0;
365
365
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
366
366
  }
367
- function forceReflow() {
368
- return document.body.offsetHeight;
367
+ function forceReflow(el) {
368
+ const targetDocument = el ? el.ownerDocument : document;
369
+ return targetDocument.body.offsetHeight;
369
370
  }
370
371
 
371
372
  function patchClass(el, value, isSVG) {
@@ -382,9 +383,11 @@ function patchClass(el, value, isSVG) {
382
383
  }
383
384
  }
384
385
 
385
- const vShowOriginalDisplay = Symbol("_vod");
386
- const vShowHidden = Symbol("_vsh");
386
+ const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
387
+ const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
387
388
  const vShow = {
389
+ // used for prop mismatch check during hydration
390
+ name: "show",
388
391
  beforeMount(el, { value }, { transition }) {
389
392
  el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
390
393
  if (transition && value) {
@@ -418,9 +421,6 @@ const vShow = {
418
421
  setDisplay(el, value);
419
422
  }
420
423
  };
421
- if (!!(process.env.NODE_ENV !== "production")) {
422
- vShow.name = "show";
423
- }
424
424
  function setDisplay(el, value) {
425
425
  el.style.display = value ? el[vShowOriginalDisplay] : "none";
426
426
  el[vShowHidden] = !value;
@@ -433,7 +433,7 @@ function initVShowForSSR() {
433
433
  };
434
434
  }
435
435
 
436
- const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
436
+ const CSS_VAR_TEXT = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
437
437
  function useCssVars(getter) {
438
438
  const instance = getCurrentInstance();
439
439
  if (!instance) {
@@ -498,14 +498,15 @@ function setVarsOnNode(el, vars) {
498
498
  const style = el.style;
499
499
  let cssText = "";
500
500
  for (const key in vars) {
501
- style.setProperty(`--${key}`, vars[key]);
502
- cssText += `--${key}: ${vars[key]};`;
501
+ const value = normalizeCssVarValue(vars[key]);
502
+ style.setProperty(`--${key}`, value);
503
+ cssText += `--${key}: ${value};`;
503
504
  }
504
505
  style[CSS_VAR_TEXT] = cssText;
505
506
  }
506
507
  }
507
508
 
508
- const displayRE = /(^|;)\s*display\s*:/;
509
+ const displayRE = /(?:^|;)\s*display\s*:/;
509
510
  function patchStyle(el, prev, next) {
510
511
  const style = el.style;
511
512
  const isCssString = isString(next);
@@ -682,7 +683,7 @@ function addEventListener(el, event, handler, options) {
682
683
  function removeEventListener(el, event, handler, options) {
683
684
  el.removeEventListener(event, handler, options);
684
685
  }
685
- const veiKey = Symbol("_vei");
686
+ const veiKey = /* @__PURE__ */ Symbol("_vei");
686
687
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
687
688
  const invokers = el[veiKey] || (el[veiKey] = {});
688
689
  const existingInvoker = invokers[rawName];
@@ -781,7 +782,9 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
781
782
  }
782
783
  } else if (
783
784
  // #11081 force set props for possible async custom element
784
- el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
785
+ el._isVueCE && // #12408 check if it's declared prop or it's async custom element
786
+ (shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
787
+ el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue)))
785
788
  ) {
786
789
  patchDOMProp(el, camelize$1(key), nextValue, parentComponent, key);
787
790
  } else {
@@ -806,6 +809,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
806
809
  if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
807
810
  return false;
808
811
  }
812
+ if (key === "sandbox" && el.tagName === "IFRAME") {
813
+ return false;
814
+ }
809
815
  if (key === "form") {
810
816
  return false;
811
817
  }
@@ -826,13 +832,23 @@ function shouldSetAsProp(el, key, value, isSVG) {
826
832
  }
827
833
  return key in el;
828
834
  }
835
+ function shouldSetAsPropForVueCE(el, key) {
836
+ const props = (
837
+ // @ts-expect-error _def is private
838
+ el._def.props
839
+ );
840
+ if (!props) {
841
+ return false;
842
+ }
843
+ const camelKey = camelize$1(key);
844
+ return Array.isArray(props) ? props.some((prop) => camelize$1(prop) === camelKey) : Object.keys(props).some((prop) => camelize$1(prop) === camelKey);
845
+ }
829
846
 
830
847
  const REMOVAL = {};
831
- /*! #__NO_SIDE_EFFECTS__ */
832
848
  // @__NO_SIDE_EFFECTS__
833
849
  function defineCustomElement(options, extraOptions, _createApp) {
834
- const Comp = defineComponent(options, extraOptions);
835
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
850
+ let Comp = defineComponent(options, extraOptions);
851
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
836
852
  class VueCustomElement extends VueElement {
837
853
  constructor(initialProps) {
838
854
  super(Comp, initialProps, _createApp);
@@ -841,10 +857,9 @@ function defineCustomElement(options, extraOptions, _createApp) {
841
857
  VueCustomElement.def = Comp;
842
858
  return VueCustomElement;
843
859
  }
844
- /*! #__NO_SIDE_EFFECTS__ */
845
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
860
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
846
861
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
847
- };
862
+ });
848
863
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
849
864
  };
850
865
  class VueElement extends BaseClass {
@@ -868,8 +883,11 @@ class VueElement extends BaseClass {
868
883
  this._nonce = this._def.nonce;
869
884
  this._connected = false;
870
885
  this._resolved = false;
886
+ this._patching = false;
887
+ this._dirty = false;
871
888
  this._numberProps = null;
872
889
  this._styleChildren = /* @__PURE__ */ new WeakSet();
890
+ this._styleAnchors = /* @__PURE__ */ new WeakMap();
873
891
  this._ob = null;
874
892
  if (this.shadowRoot && _createApp !== createApp) {
875
893
  this._root = this.shadowRoot;
@@ -880,7 +898,11 @@ class VueElement extends BaseClass {
880
898
  );
881
899
  }
882
900
  if (_def.shadowRoot !== false) {
883
- this.attachShadow({ mode: "open" });
901
+ this.attachShadow(
902
+ extend({}, _def.shadowRootOptions, {
903
+ mode: "open"
904
+ })
905
+ );
884
906
  this._root = this.shadowRoot;
885
907
  } else {
886
908
  this._root = this;
@@ -894,7 +916,8 @@ class VueElement extends BaseClass {
894
916
  }
895
917
  this._connected = true;
896
918
  let parent = this;
897
- while (parent = parent && (parent.parentNode || parent.host)) {
919
+ while (parent = parent && // #12479 should check assignedSlot first to get correct parent
920
+ (parent.assignedSlot || parent.parentNode || parent.host)) {
898
921
  if (parent instanceof VueElement) {
899
922
  this._parent = parent;
900
923
  break;
@@ -940,9 +963,18 @@ class VueElement extends BaseClass {
940
963
  this._app && this._app.unmount();
941
964
  if (this._instance) this._instance.ce = void 0;
942
965
  this._app = this._instance = null;
966
+ if (this._teleportTargets) {
967
+ this._teleportTargets.clear();
968
+ this._teleportTargets = void 0;
969
+ }
943
970
  }
944
971
  });
945
972
  }
973
+ _processMutations(mutations) {
974
+ for (const m of mutations) {
975
+ this._setAttr(m.attributeName);
976
+ }
977
+ }
946
978
  /**
947
979
  * resolve inner component definition (handle possible async component)
948
980
  */
@@ -953,11 +985,7 @@ class VueElement extends BaseClass {
953
985
  for (let i = 0; i < this.attributes.length; i++) {
954
986
  this._setAttr(this.attributes[i].name);
955
987
  }
956
- this._ob = new MutationObserver((mutations) => {
957
- for (const m of mutations) {
958
- this._setAttr(m.attributeName);
959
- }
960
- });
988
+ this._ob = new MutationObserver(this._processMutations.bind(this));
961
989
  this._ob.observe(this, { attributes: true });
962
990
  const resolve = (def, isAsync = false) => {
963
991
  this._resolved = true;
@@ -988,9 +1016,10 @@ class VueElement extends BaseClass {
988
1016
  };
989
1017
  const asyncDef = this._def.__asyncLoader;
990
1018
  if (asyncDef) {
991
- this._pendingResolve = asyncDef().then(
992
- (def) => resolve(this._def = def, true)
993
- );
1019
+ this._pendingResolve = asyncDef().then((def) => {
1020
+ def.configureApp = this._def.configureApp;
1021
+ resolve(this._def = def, true);
1022
+ });
994
1023
  } else {
995
1024
  resolve(this._def);
996
1025
  }
@@ -1033,7 +1062,7 @@ class VueElement extends BaseClass {
1033
1062
  return this._getProp(key);
1034
1063
  },
1035
1064
  set(val) {
1036
- this._setProp(key, val, true, true);
1065
+ this._setProp(key, val, true, !this._patching);
1037
1066
  }
1038
1067
  });
1039
1068
  }
@@ -1059,6 +1088,7 @@ class VueElement extends BaseClass {
1059
1088
  */
1060
1089
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
1061
1090
  if (val !== this._props[key]) {
1091
+ this._dirty = true;
1062
1092
  if (val === REMOVAL) {
1063
1093
  delete this._props[key];
1064
1094
  } else {
@@ -1072,7 +1102,10 @@ class VueElement extends BaseClass {
1072
1102
  }
1073
1103
  if (shouldReflect) {
1074
1104
  const ob = this._ob;
1075
- ob && ob.disconnect();
1105
+ if (ob) {
1106
+ this._processMutations(ob.takeRecords());
1107
+ ob.disconnect();
1108
+ }
1076
1109
  if (val === true) {
1077
1110
  this.setAttribute(hyphenate(key), "");
1078
1111
  } else if (typeof val === "string" || typeof val === "number") {
@@ -1106,6 +1139,7 @@ class VueElement extends BaseClass {
1106
1139
  this._styles.forEach((s) => this._root.removeChild(s));
1107
1140
  this._styles.length = 0;
1108
1141
  }
1142
+ this._styleAnchors.delete(this._def);
1109
1143
  this._applyStyles(newStyles);
1110
1144
  this._instance = null;
1111
1145
  this._update();
@@ -1130,7 +1164,7 @@ class VueElement extends BaseClass {
1130
1164
  }
1131
1165
  return vnode;
1132
1166
  }
1133
- _applyStyles(styles, owner) {
1167
+ _applyStyles(styles, owner, parentComp) {
1134
1168
  if (!styles) return;
1135
1169
  if (owner) {
1136
1170
  if (owner === this._def || this._styleChildren.has(owner)) {
@@ -1139,11 +1173,19 @@ class VueElement extends BaseClass {
1139
1173
  this._styleChildren.add(owner);
1140
1174
  }
1141
1175
  const nonce = this._nonce;
1176
+ const root = this.shadowRoot;
1177
+ const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
1178
+ let last = null;
1142
1179
  for (let i = styles.length - 1; i >= 0; i--) {
1143
1180
  const s = document.createElement("style");
1144
1181
  if (nonce) s.setAttribute("nonce", nonce);
1145
1182
  s.textContent = styles[i];
1146
- this.shadowRoot.prepend(s);
1183
+ root.insertBefore(s, last || insertionAnchor);
1184
+ last = s;
1185
+ if (i === 0) {
1186
+ if (!parentComp) this._styleAnchors.set(this._def, s);
1187
+ if (owner) this._styleAnchors.set(owner, s);
1188
+ }
1147
1189
  if (!!(process.env.NODE_ENV !== "production")) {
1148
1190
  if (owner) {
1149
1191
  if (owner.__hmrId) {
@@ -1160,6 +1202,28 @@ class VueElement extends BaseClass {
1160
1202
  }
1161
1203
  }
1162
1204
  }
1205
+ _getStyleAnchor(comp) {
1206
+ if (!comp) {
1207
+ return null;
1208
+ }
1209
+ const anchor = this._styleAnchors.get(comp);
1210
+ if (anchor && anchor.parentNode === this.shadowRoot) {
1211
+ return anchor;
1212
+ }
1213
+ if (anchor) {
1214
+ this._styleAnchors.delete(comp);
1215
+ }
1216
+ return null;
1217
+ }
1218
+ _getRootStyleInsertionAnchor(root) {
1219
+ for (let i = 0; i < root.childNodes.length; i++) {
1220
+ const node = root.childNodes[i];
1221
+ if (!(node instanceof HTMLStyleElement)) {
1222
+ return node;
1223
+ }
1224
+ }
1225
+ return null;
1226
+ }
1163
1227
  /**
1164
1228
  * Only called when shadowRoot is false
1165
1229
  */
@@ -1176,7 +1240,7 @@ class VueElement extends BaseClass {
1176
1240
  * Only called when shadowRoot is false
1177
1241
  */
1178
1242
  _renderSlots() {
1179
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
1243
+ const outlets = this._getSlots();
1180
1244
  const scopeId = this._instance.type.__scopeId;
1181
1245
  for (let i = 0; i < outlets.length; i++) {
1182
1246
  const o = outlets[i];
@@ -1205,8 +1269,47 @@ class VueElement extends BaseClass {
1205
1269
  /**
1206
1270
  * @internal
1207
1271
  */
1208
- _injectChildStyle(comp) {
1209
- this._applyStyles(comp.styles, comp);
1272
+ _getSlots() {
1273
+ const roots = [this];
1274
+ if (this._teleportTargets) {
1275
+ roots.push(...this._teleportTargets);
1276
+ }
1277
+ const slots = /* @__PURE__ */ new Set();
1278
+ for (const root of roots) {
1279
+ const found = root.querySelectorAll("slot");
1280
+ for (let i = 0; i < found.length; i++) {
1281
+ slots.add(found[i]);
1282
+ }
1283
+ }
1284
+ return Array.from(slots);
1285
+ }
1286
+ /**
1287
+ * @internal
1288
+ */
1289
+ _injectChildStyle(comp, parentComp) {
1290
+ this._applyStyles(comp.styles, comp, parentComp);
1291
+ }
1292
+ /**
1293
+ * @internal
1294
+ */
1295
+ _beginPatch() {
1296
+ this._patching = true;
1297
+ this._dirty = false;
1298
+ }
1299
+ /**
1300
+ * @internal
1301
+ */
1302
+ _endPatch() {
1303
+ this._patching = false;
1304
+ if (this._dirty && this._instance) {
1305
+ this._update();
1306
+ }
1307
+ }
1308
+ /**
1309
+ * @internal
1310
+ */
1311
+ _hasShadowRoot() {
1312
+ return this._def.shadowRoot !== false;
1210
1313
  }
1211
1314
  /**
1212
1315
  * @internal
@@ -1214,6 +1317,7 @@ class VueElement extends BaseClass {
1214
1317
  _removeChildStyle(comp) {
1215
1318
  if (!!(process.env.NODE_ENV !== "production")) {
1216
1319
  this._styleChildren.delete(comp);
1320
+ this._styleAnchors.delete(comp);
1217
1321
  if (this._childStyles && comp.__hmrId) {
1218
1322
  const oldStyles = this._childStyles.get(comp.__hmrId);
1219
1323
  if (oldStyles) {
@@ -1270,8 +1374,8 @@ function useCssModule(name = "$style") {
1270
1374
 
1271
1375
  const positionMap = /* @__PURE__ */ new WeakMap();
1272
1376
  const newPositionMap = /* @__PURE__ */ new WeakMap();
1273
- const moveCbKey = Symbol("_moveCb");
1274
- const enterCbKey = Symbol("_enterCb");
1377
+ const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
1378
+ const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
1275
1379
  const decorate = (t) => {
1276
1380
  delete t.props.mode;
1277
1381
  return t;
@@ -1303,7 +1407,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1303
1407
  prevChildren.forEach(callPendingCbs);
1304
1408
  prevChildren.forEach(recordPosition);
1305
1409
  const movedChildren = prevChildren.filter(applyTranslation);
1306
- forceReflow();
1410
+ forceReflow(instance.vnode.el);
1307
1411
  movedChildren.forEach((c) => {
1308
1412
  const el = c.el;
1309
1413
  const style = el.style;
@@ -1313,7 +1417,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1313
1417
  if (e && e.target !== el) {
1314
1418
  return;
1315
1419
  }
1316
- if (!e || /transform$/.test(e.propertyName)) {
1420
+ if (!e || e.propertyName.endsWith("transform")) {
1317
1421
  el.removeEventListener("transitionend", cb);
1318
1422
  el[moveCbKey] = null;
1319
1423
  removeTransitionClass(el, moveClass);
@@ -1342,10 +1446,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1342
1446
  instance
1343
1447
  )
1344
1448
  );
1345
- positionMap.set(
1346
- child,
1347
- child.el.getBoundingClientRect()
1348
- );
1449
+ positionMap.set(child, getPosition(child.el));
1349
1450
  }
1350
1451
  }
1351
1452
  }
@@ -1376,7 +1477,7 @@ function callPendingCbs(c) {
1376
1477
  }
1377
1478
  }
1378
1479
  function recordPosition(c) {
1379
- newPositionMap.set(c, c.el.getBoundingClientRect());
1480
+ newPositionMap.set(c, getPosition(c.el));
1380
1481
  }
1381
1482
  function applyTranslation(c) {
1382
1483
  const oldPos = positionMap.get(c);
@@ -1384,12 +1485,29 @@ function applyTranslation(c) {
1384
1485
  const dx = oldPos.left - newPos.left;
1385
1486
  const dy = oldPos.top - newPos.top;
1386
1487
  if (dx || dy) {
1387
- const s = c.el.style;
1388
- s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
1488
+ const el = c.el;
1489
+ const s = el.style;
1490
+ const rect = el.getBoundingClientRect();
1491
+ let scaleX = 1;
1492
+ let scaleY = 1;
1493
+ if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
1494
+ if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
1495
+ if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
1496
+ if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
1497
+ if (Math.abs(scaleX - 1) < 0.01) scaleX = 1;
1498
+ if (Math.abs(scaleY - 1) < 0.01) scaleY = 1;
1499
+ s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
1389
1500
  s.transitionDuration = "0s";
1390
1501
  return c;
1391
1502
  }
1392
1503
  }
1504
+ function getPosition(el) {
1505
+ const rect = el.getBoundingClientRect();
1506
+ return {
1507
+ left: rect.left,
1508
+ top: rect.top
1509
+ };
1510
+ }
1393
1511
  function hasCSSTransform(el, root, moveClass) {
1394
1512
  const clone = el.cloneNode();
1395
1513
  const _vtc = el[vtcKey];
@@ -1421,25 +1539,23 @@ function onCompositionEnd(e) {
1421
1539
  target.dispatchEvent(new Event("input"));
1422
1540
  }
1423
1541
  }
1424
- const assignKey = Symbol("_assign");
1542
+ const assignKey = /* @__PURE__ */ Symbol("_assign");
1543
+ function castValue(value, trim, number) {
1544
+ if (trim) value = value.trim();
1545
+ if (number) value = looseToNumber(value);
1546
+ return value;
1547
+ }
1425
1548
  const vModelText = {
1426
1549
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
1427
1550
  el[assignKey] = getModelAssigner(vnode);
1428
1551
  const castToNumber = number || vnode.props && vnode.props.type === "number";
1429
1552
  addEventListener(el, lazy ? "change" : "input", (e) => {
1430
1553
  if (e.target.composing) return;
1431
- let domValue = el.value;
1432
- if (trim) {
1433
- domValue = domValue.trim();
1434
- }
1435
- if (castToNumber) {
1436
- domValue = looseToNumber(domValue);
1437
- }
1438
- el[assignKey](domValue);
1554
+ el[assignKey](castValue(el.value, trim, castToNumber));
1439
1555
  });
1440
- if (trim) {
1556
+ if (trim || castToNumber) {
1441
1557
  addEventListener(el, "change", () => {
1442
- el.value = el.value.trim();
1558
+ el.value = castValue(el.value, trim, castToNumber);
1443
1559
  });
1444
1560
  }
1445
1561
  if (!lazy) {
@@ -1702,15 +1818,16 @@ const modifierGuards = {
1702
1818
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1703
1819
  };
1704
1820
  const withModifiers = (fn, modifiers) => {
1821
+ if (!fn) return fn;
1705
1822
  const cache = fn._withMods || (fn._withMods = {});
1706
1823
  const cacheKey = modifiers.join(".");
1707
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
1824
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
1708
1825
  for (let i = 0; i < modifiers.length; i++) {
1709
1826
  const guard = modifierGuards[modifiers[i]];
1710
1827
  if (guard && guard(event, modifiers)) return;
1711
1828
  }
1712
1829
  return fn(event, ...args);
1713
- });
1830
+ }));
1714
1831
  };
1715
1832
  const keyNames = {
1716
1833
  esc: "escape",
@@ -1724,7 +1841,7 @@ const keyNames = {
1724
1841
  const withKeys = (fn, modifiers) => {
1725
1842
  const cache = fn._withKeys || (fn._withKeys = {});
1726
1843
  const cacheKey = modifiers.join(".");
1727
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
1844
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
1728
1845
  if (!("key" in event)) {
1729
1846
  return;
1730
1847
  }
@@ -1734,7 +1851,7 @@ const withKeys = (fn, modifiers) => {
1734
1851
  )) {
1735
1852
  return fn(event);
1736
1853
  }
1737
- });
1854
+ }));
1738
1855
  };
1739
1856
 
1740
1857
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -1748,13 +1865,13 @@ function ensureHydrationRenderer() {
1748
1865
  enabledHydration = true;
1749
1866
  return renderer;
1750
1867
  }
1751
- const render = (...args) => {
1868
+ const render = ((...args) => {
1752
1869
  ensureRenderer().render(...args);
1753
- };
1754
- const hydrate = (...args) => {
1870
+ });
1871
+ const hydrate = ((...args) => {
1755
1872
  ensureHydrationRenderer().hydrate(...args);
1756
- };
1757
- const createApp = (...args) => {
1873
+ });
1874
+ const createApp = ((...args) => {
1758
1875
  const app = ensureRenderer().createApp(...args);
1759
1876
  if (!!(process.env.NODE_ENV !== "production")) {
1760
1877
  injectNativeTagCheck(app);
@@ -1779,8 +1896,8 @@ const createApp = (...args) => {
1779
1896
  return proxy;
1780
1897
  };
1781
1898
  return app;
1782
- };
1783
- const createSSRApp = (...args) => {
1899
+ });
1900
+ const createSSRApp = ((...args) => {
1784
1901
  const app = ensureHydrationRenderer().createApp(...args);
1785
1902
  if (!!(process.env.NODE_ENV !== "production")) {
1786
1903
  injectNativeTagCheck(app);
@@ -1794,7 +1911,7 @@ const createSSRApp = (...args) => {
1794
1911
  }
1795
1912
  };
1796
1913
  return app;
1797
- };
1914
+ });
1798
1915
  function resolveRootNamespace(container) {
1799
1916
  if (container instanceof SVGElement) {
1800
1917
  return "svg";
@@ -1864,4 +1981,4 @@ const initDirectivesForSSR = () => {
1864
1981
  }
1865
1982
  } ;
1866
1983
 
1867
- export { Transition, TransitionGroup, VueElement, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, hydrate, initDirectivesForSSR, render, rendererOptions, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers };
1984
+ export { Transition, TransitionGroup, VueElement, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, hydrate, initDirectivesForSSR, nodeOps, patchProp, render, rendererOptions, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers };