@vue/runtime-dom 3.5.26 → 3.5.28

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,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.26
2
+ * @vue/runtime-dom v3.5.28
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1194,6 +1194,12 @@ class VueElement extends BaseClass {
1194
1194
  this._update();
1195
1195
  }
1196
1196
  }
1197
+ /**
1198
+ * @internal
1199
+ */
1200
+ _hasShadowRoot() {
1201
+ return this._def.shadowRoot !== false;
1202
+ }
1197
1203
  /**
1198
1204
  * @internal
1199
1205
  */
@@ -1328,10 +1334,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1328
1334
  instance
1329
1335
  )
1330
1336
  );
1331
- positionMap.set(child, {
1332
- left: child.el.offsetLeft,
1333
- top: child.el.offsetTop
1334
- });
1337
+ positionMap.set(child, getPosition(child.el));
1335
1338
  }
1336
1339
  }
1337
1340
  }
@@ -1362,10 +1365,7 @@ function callPendingCbs(c) {
1362
1365
  }
1363
1366
  }
1364
1367
  function recordPosition(c) {
1365
- newPositionMap.set(c, {
1366
- left: c.el.offsetLeft,
1367
- top: c.el.offsetTop
1368
- });
1368
+ newPositionMap.set(c, getPosition(c.el));
1369
1369
  }
1370
1370
  function applyTranslation(c) {
1371
1371
  const oldPos = positionMap.get(c);
@@ -1373,12 +1373,29 @@ function applyTranslation(c) {
1373
1373
  const dx = oldPos.left - newPos.left;
1374
1374
  const dy = oldPos.top - newPos.top;
1375
1375
  if (dx || dy) {
1376
- const s = c.el.style;
1377
- s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
1376
+ const el = c.el;
1377
+ const s = el.style;
1378
+ const rect = el.getBoundingClientRect();
1379
+ let scaleX = 1;
1380
+ let scaleY = 1;
1381
+ if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
1382
+ if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
1383
+ if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
1384
+ if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
1385
+ if (Math.abs(scaleX - 1) < 0.01) scaleX = 1;
1386
+ if (Math.abs(scaleY - 1) < 0.01) scaleY = 1;
1387
+ s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
1378
1388
  s.transitionDuration = "0s";
1379
1389
  return c;
1380
1390
  }
1381
1391
  }
1392
+ function getPosition(el) {
1393
+ const rect = el.getBoundingClientRect();
1394
+ return {
1395
+ left: rect.left,
1396
+ top: rect.top
1397
+ };
1398
+ }
1382
1399
  function hasCSSTransform(el, root, moveClass) {
1383
1400
  const clone = el.cloneNode();
1384
1401
  const _vtc = el[vtcKey];
@@ -1689,6 +1706,7 @@ const modifierGuards = {
1689
1706
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1690
1707
  };
1691
1708
  const withModifiers = (fn, modifiers) => {
1709
+ if (!fn) return fn;
1692
1710
  const cache = fn._withMods || (fn._withMods = {});
1693
1711
  const cacheKey = modifiers.join(".");
1694
1712
  return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.26
2
+ * @vue/runtime-dom v3.5.28
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1127,6 +1127,12 @@ class VueElement extends BaseClass {
1127
1127
  this._update();
1128
1128
  }
1129
1129
  }
1130
+ /**
1131
+ * @internal
1132
+ */
1133
+ _hasShadowRoot() {
1134
+ return this._def.shadowRoot !== false;
1135
+ }
1130
1136
  /**
1131
1137
  * @internal
1132
1138
  */
@@ -1238,10 +1244,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1238
1244
  instance
1239
1245
  )
1240
1246
  );
1241
- positionMap.set(child, {
1242
- left: child.el.offsetLeft,
1243
- top: child.el.offsetTop
1244
- });
1247
+ positionMap.set(child, getPosition(child.el));
1245
1248
  }
1246
1249
  }
1247
1250
  }
@@ -1270,10 +1273,7 @@ function callPendingCbs(c) {
1270
1273
  }
1271
1274
  }
1272
1275
  function recordPosition(c) {
1273
- newPositionMap.set(c, {
1274
- left: c.el.offsetLeft,
1275
- top: c.el.offsetTop
1276
- });
1276
+ newPositionMap.set(c, getPosition(c.el));
1277
1277
  }
1278
1278
  function applyTranslation(c) {
1279
1279
  const oldPos = positionMap.get(c);
@@ -1281,12 +1281,29 @@ function applyTranslation(c) {
1281
1281
  const dx = oldPos.left - newPos.left;
1282
1282
  const dy = oldPos.top - newPos.top;
1283
1283
  if (dx || dy) {
1284
- const s = c.el.style;
1285
- s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
1284
+ const el = c.el;
1285
+ const s = el.style;
1286
+ const rect = el.getBoundingClientRect();
1287
+ let scaleX = 1;
1288
+ let scaleY = 1;
1289
+ if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
1290
+ if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
1291
+ if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
1292
+ if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
1293
+ if (Math.abs(scaleX - 1) < 0.01) scaleX = 1;
1294
+ if (Math.abs(scaleY - 1) < 0.01) scaleY = 1;
1295
+ s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
1286
1296
  s.transitionDuration = "0s";
1287
1297
  return c;
1288
1298
  }
1289
1299
  }
1300
+ function getPosition(el) {
1301
+ const rect = el.getBoundingClientRect();
1302
+ return {
1303
+ left: rect.left,
1304
+ top: rect.top
1305
+ };
1306
+ }
1290
1307
  function hasCSSTransform(el, root, moveClass) {
1291
1308
  const clone = el.cloneNode();
1292
1309
  const _vtc = el[vtcKey];
@@ -1594,6 +1611,7 @@ const modifierGuards = {
1594
1611
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1595
1612
  };
1596
1613
  const withModifiers = (fn, modifiers) => {
1614
+ if (!fn) return fn;
1597
1615
  const cache = fn._withMods || (fn._withMods = {});
1598
1616
  const cacheKey = modifiers.join(".");
1599
1617
  return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
@@ -1,4 +1,4 @@
1
- import { RendererOptions, BaseTransitionProps, FunctionalComponent, ObjectDirective, Directive, SetupContext, RenderFunction, ComponentOptions, App, ComponentCustomElementInterface, ConcreteComponent, CreateAppFunction, ComponentObjectPropsOptions, EmitsOptions, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentInjectOptions, SlotsType, Component, ComponentProvideOptions, ExtractPropTypes, EmitsToProps, ComponentOptionsBase, CreateComponentPublicInstanceWithMixins, ComponentPublicInstance, DefineComponent, VNodeRef, RootRenderFunction, RootHydrateFunction } from '@vue/runtime-core';
1
+ import { RendererOptions, BaseTransitionProps, FunctionalComponent, ObjectDirective, Directive, App, ComponentCustomElementInterface, ConcreteComponent, CreateAppFunction, SetupContext, RenderFunction, ComponentOptions, ComponentObjectPropsOptions, EmitsOptions, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentInjectOptions, SlotsType, Component, ComponentProvideOptions, ExtractPropTypes, EmitsToProps, ComponentOptionsBase, CreateComponentPublicInstanceWithMixins, ComponentPublicInstance, DefineComponent, VNodeRef, RootHydrateFunction, RootRenderFunction } from '@vue/runtime-core';
2
2
  export * from '@vue/runtime-core';
3
3
  import * as CSS from 'csstype';
4
4
 
@@ -593,10 +593,22 @@ export interface InsHTMLAttributes extends HTMLAttributes {
593
593
  datetime?: string | undefined;
594
594
  }
595
595
  export type InputTypeHTMLAttribute = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});
596
+ type AutoFillAddressKind = 'billing' | 'shipping';
597
+ type AutoFillBase = '' | 'off' | 'on';
598
+ type AutoFillContactField = 'email' | 'tel' | 'tel-area-code' | 'tel-country-code' | 'tel-extension' | 'tel-local' | 'tel-local-prefix' | 'tel-local-suffix' | 'tel-national';
599
+ type AutoFillContactKind = 'home' | 'mobile' | 'work';
600
+ type AutoFillCredentialField = 'webauthn';
601
+ type AutoFillNormalField = 'additional-name' | 'address-level1' | 'address-level2' | 'address-level3' | 'address-level4' | 'address-line1' | 'address-line2' | 'address-line3' | 'bday-day' | 'bday-month' | 'bday-year' | 'cc-csc' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-family-name' | 'cc-given-name' | 'cc-name' | 'cc-number' | 'cc-type' | 'country' | 'country-name' | 'current-password' | 'family-name' | 'given-name' | 'honorific-prefix' | 'honorific-suffix' | 'name' | 'new-password' | 'one-time-code' | 'organization' | 'postal-code' | 'street-address' | 'transaction-amount' | 'transaction-currency' | 'username';
602
+ type OptionalPrefixToken<T extends string> = `${T} ` | '';
603
+ type OptionalPostfixToken<T extends string> = ` ${T}` | '';
604
+ type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`;
605
+ type AutoFillSection = `section-${string}`;
606
+ type AutoFill = AutoFillBase | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<AutoFillAddressKind>}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`;
607
+ export type InputAutoCompleteAttribute = AutoFill | (string & {});
596
608
  export interface InputHTMLAttributes extends HTMLAttributes {
597
609
  accept?: string | undefined;
598
610
  alt?: string | undefined;
599
- autocomplete?: string | undefined;
611
+ autocomplete?: InputAutoCompleteAttribute | undefined;
600
612
  autofocus?: Booleanish | undefined;
601
613
  capture?: boolean | 'user' | 'environment' | undefined;
602
614
  checked?: Booleanish | any[] | Set<any> | undefined;