vue 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/vue.cjs.js +1 -1
- package/dist/vue.cjs.prod.js +1 -1
- package/dist/vue.esm-browser.js +232 -158
- package/dist/vue.esm-browser.prod.js +10 -9
- package/dist/vue.esm-bundler.js +1 -1
- package/dist/vue.global.js +232 -158
- package/dist/vue.global.prod.js +10 -9
- package/dist/vue.runtime.esm-browser.js +152 -80
- package/dist/vue.runtime.esm-browser.prod.js +4 -3
- package/dist/vue.runtime.esm-bundler.js +1 -1
- package/dist/vue.runtime.global.js +152 -80
- package/dist/vue.runtime.global.prod.js +4 -3
- package/jsx-runtime/index.d.ts +1 -1
- package/jsx.d.ts +1 -1
- package/package.json +6 -6
package/dist/vue.esm-bundler.js
CHANGED
package/dist/vue.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vue v3.5.
|
|
2
|
+
* vue v3.5.23
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1218,7 +1218,7 @@ var Vue = (function (exports) {
|
|
|
1218
1218
|
iter._next = iter.next;
|
|
1219
1219
|
iter.next = () => {
|
|
1220
1220
|
const result = iter._next();
|
|
1221
|
-
if (result.
|
|
1221
|
+
if (!result.done) {
|
|
1222
1222
|
result.value = wrapValue(result.value);
|
|
1223
1223
|
}
|
|
1224
1224
|
return result;
|
|
@@ -1345,7 +1345,8 @@ var Vue = (function (exports) {
|
|
|
1345
1345
|
return res;
|
|
1346
1346
|
}
|
|
1347
1347
|
if (isRef(res)) {
|
|
1348
|
-
|
|
1348
|
+
const value = targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
1349
|
+
return isReadonly2 && isObject(value) ? readonly(value) : value;
|
|
1349
1350
|
}
|
|
1350
1351
|
if (isObject(res)) {
|
|
1351
1352
|
return isReadonly2 ? readonly(res) : reactive(res);
|
|
@@ -2695,14 +2696,11 @@ var Vue = (function (exports) {
|
|
|
2695
2696
|
let isHmrUpdating = false;
|
|
2696
2697
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2697
2698
|
{
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
reload: tryWrap(reload)
|
|
2704
|
-
};
|
|
2705
|
-
}
|
|
2699
|
+
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
2700
|
+
createRecord: tryWrap(createRecord),
|
|
2701
|
+
rerender: tryWrap(rerender),
|
|
2702
|
+
reload: tryWrap(reload)
|
|
2703
|
+
};
|
|
2706
2704
|
}
|
|
2707
2705
|
const map = /* @__PURE__ */ new Map();
|
|
2708
2706
|
function registerHMR(instance) {
|
|
@@ -3069,9 +3067,6 @@ var Vue = (function (exports) {
|
|
|
3069
3067
|
insert(mainAnchor, container, anchor);
|
|
3070
3068
|
const mount = (container2, anchor2) => {
|
|
3071
3069
|
if (shapeFlag & 16) {
|
|
3072
|
-
if (parentComponent && parentComponent.isCE) {
|
|
3073
|
-
parentComponent.ce._teleportTarget = container2;
|
|
3074
|
-
}
|
|
3075
3070
|
mountChildren(
|
|
3076
3071
|
children,
|
|
3077
3072
|
container2,
|
|
@@ -3093,6 +3088,9 @@ var Vue = (function (exports) {
|
|
|
3093
3088
|
} else if (namespace !== "mathml" && isTargetMathML(target)) {
|
|
3094
3089
|
namespace = "mathml";
|
|
3095
3090
|
}
|
|
3091
|
+
if (parentComponent && parentComponent.isCE) {
|
|
3092
|
+
(parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3093
|
+
}
|
|
3096
3094
|
if (!disabled) {
|
|
3097
3095
|
mount(target, targetAnchor);
|
|
3098
3096
|
updateCssVars(n2, false);
|
|
@@ -4199,14 +4197,16 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4199
4197
|
if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
|
|
4200
4198
|
clientText = clientText.slice(1);
|
|
4201
4199
|
}
|
|
4202
|
-
|
|
4200
|
+
const { textContent } = el;
|
|
4201
|
+
if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
|
|
4202
|
+
textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
|
|
4203
4203
|
if (!isMismatchAllowed(el, 0 /* TEXT */)) {
|
|
4204
4204
|
warn$1(
|
|
4205
4205
|
`Hydration text content mismatch on`,
|
|
4206
4206
|
el,
|
|
4207
4207
|
`
|
|
4208
|
-
- rendered on server: ${
|
|
4209
|
-
- expected on client: ${
|
|
4208
|
+
- rendered on server: ${textContent}
|
|
4209
|
+
- expected on client: ${clientText}`
|
|
4210
4210
|
);
|
|
4211
4211
|
logMismatchError();
|
|
4212
4212
|
}
|
|
@@ -4801,7 +4801,10 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4801
4801
|
error: error.value
|
|
4802
4802
|
});
|
|
4803
4803
|
} else if (loadingComponent && !delayed.value) {
|
|
4804
|
-
return
|
|
4804
|
+
return createInnerComp(
|
|
4805
|
+
loadingComponent,
|
|
4806
|
+
instance
|
|
4807
|
+
);
|
|
4805
4808
|
}
|
|
4806
4809
|
};
|
|
4807
4810
|
}
|
|
@@ -5252,12 +5255,13 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5252
5255
|
|
|
5253
5256
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
5254
5257
|
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
5258
|
+
const hasProps = Object.keys(props).length > 0;
|
|
5255
5259
|
if (name !== "default") props.name = name;
|
|
5256
5260
|
return openBlock(), createBlock(
|
|
5257
5261
|
Fragment,
|
|
5258
5262
|
null,
|
|
5259
5263
|
[createVNode("slot", props, fallback && fallback())],
|
|
5260
|
-
64
|
|
5264
|
+
hasProps ? -2 : 64
|
|
5261
5265
|
);
|
|
5262
5266
|
}
|
|
5263
5267
|
let slot = slots[name];
|
|
@@ -7092,15 +7096,25 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7092
7096
|
optimized
|
|
7093
7097
|
);
|
|
7094
7098
|
} else {
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7099
|
+
const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
|
|
7100
|
+
try {
|
|
7101
|
+
if (customElement) {
|
|
7102
|
+
customElement._beginPatch();
|
|
7103
|
+
}
|
|
7104
|
+
patchElement(
|
|
7105
|
+
n1,
|
|
7106
|
+
n2,
|
|
7107
|
+
parentComponent,
|
|
7108
|
+
parentSuspense,
|
|
7109
|
+
namespace,
|
|
7110
|
+
slotScopeIds,
|
|
7111
|
+
optimized
|
|
7112
|
+
);
|
|
7113
|
+
} finally {
|
|
7114
|
+
if (customElement) {
|
|
7115
|
+
customElement._endPatch();
|
|
7116
|
+
}
|
|
7117
|
+
}
|
|
7104
7118
|
}
|
|
7105
7119
|
};
|
|
7106
7120
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
@@ -9314,7 +9328,8 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
9314
9328
|
pendingId,
|
|
9315
9329
|
effects,
|
|
9316
9330
|
parentComponent: parentComponent2,
|
|
9317
|
-
container: container2
|
|
9331
|
+
container: container2,
|
|
9332
|
+
isInFallback
|
|
9318
9333
|
} = suspense;
|
|
9319
9334
|
let delayEnter = false;
|
|
9320
9335
|
if (suspense.isHydrating) {
|
|
@@ -9331,6 +9346,9 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
9331
9346
|
0
|
|
9332
9347
|
);
|
|
9333
9348
|
queuePostFlushCb(effects);
|
|
9349
|
+
if (isInFallback && vnode2.ssFallback) {
|
|
9350
|
+
vnode2.ssFallback.el = null;
|
|
9351
|
+
}
|
|
9334
9352
|
}
|
|
9335
9353
|
};
|
|
9336
9354
|
}
|
|
@@ -9339,6 +9357,9 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
9339
9357
|
anchor = next(activeBranch);
|
|
9340
9358
|
}
|
|
9341
9359
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
9360
|
+
if (!delayEnter && isInFallback && vnode2.ssFallback) {
|
|
9361
|
+
vnode2.ssFallback.el = null;
|
|
9362
|
+
}
|
|
9342
9363
|
}
|
|
9343
9364
|
if (!delayEnter) {
|
|
9344
9365
|
move(pendingBranch, container2, anchor, 0);
|
|
@@ -9457,6 +9478,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
9457
9478
|
optimized2
|
|
9458
9479
|
);
|
|
9459
9480
|
if (placeholder) {
|
|
9481
|
+
vnode2.placeholder = null;
|
|
9460
9482
|
remove(placeholder);
|
|
9461
9483
|
}
|
|
9462
9484
|
updateHOCHostEl(instance, vnode2.el);
|
|
@@ -10387,31 +10409,28 @@ Component that was made reactive: `,
|
|
|
10387
10409
|
};
|
|
10388
10410
|
|
|
10389
10411
|
function h(type, propsOrChildren, children) {
|
|
10390
|
-
|
|
10412
|
+
try {
|
|
10391
10413
|
setBlockTracking(-1);
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
if (isVNode(propsOrChildren)) {
|
|
10402
|
-
return doCreateVNode(type, null, [propsOrChildren]);
|
|
10414
|
+
const l = arguments.length;
|
|
10415
|
+
if (l === 2) {
|
|
10416
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
10417
|
+
if (isVNode(propsOrChildren)) {
|
|
10418
|
+
return createVNode(type, null, [propsOrChildren]);
|
|
10419
|
+
}
|
|
10420
|
+
return createVNode(type, propsOrChildren);
|
|
10421
|
+
} else {
|
|
10422
|
+
return createVNode(type, null, propsOrChildren);
|
|
10403
10423
|
}
|
|
10404
|
-
return doCreateVNode(type, propsOrChildren);
|
|
10405
10424
|
} else {
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
children = [children];
|
|
10425
|
+
if (l > 3) {
|
|
10426
|
+
children = Array.prototype.slice.call(arguments, 2);
|
|
10427
|
+
} else if (l === 3 && isVNode(children)) {
|
|
10428
|
+
children = [children];
|
|
10429
|
+
}
|
|
10430
|
+
return createVNode(type, propsOrChildren, children);
|
|
10413
10431
|
}
|
|
10414
|
-
|
|
10432
|
+
} finally {
|
|
10433
|
+
setBlockTracking(1);
|
|
10415
10434
|
}
|
|
10416
10435
|
}
|
|
10417
10436
|
|
|
@@ -10621,7 +10640,7 @@ Component that was made reactive: `,
|
|
|
10621
10640
|
return true;
|
|
10622
10641
|
}
|
|
10623
10642
|
|
|
10624
|
-
const version = "3.5.
|
|
10643
|
+
const version = "3.5.23";
|
|
10625
10644
|
const warn = warn$1 ;
|
|
10626
10645
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10627
10646
|
const devtools = devtools$1 ;
|
|
@@ -10838,11 +10857,11 @@ Component that was made reactive: `,
|
|
|
10838
10857
|
const resolve = () => finishLeave(el, done);
|
|
10839
10858
|
addTransitionClass(el, leaveFromClass);
|
|
10840
10859
|
if (!el._enterCancelled) {
|
|
10841
|
-
forceReflow();
|
|
10860
|
+
forceReflow(el);
|
|
10842
10861
|
addTransitionClass(el, leaveActiveClass);
|
|
10843
10862
|
} else {
|
|
10844
10863
|
addTransitionClass(el, leaveActiveClass);
|
|
10845
|
-
forceReflow();
|
|
10864
|
+
forceReflow(el);
|
|
10846
10865
|
}
|
|
10847
10866
|
nextFrame(() => {
|
|
10848
10867
|
if (!el._isLeaving) {
|
|
@@ -10988,8 +11007,9 @@ Component that was made reactive: `,
|
|
|
10988
11007
|
if (s === "auto") return 0;
|
|
10989
11008
|
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
10990
11009
|
}
|
|
10991
|
-
function forceReflow() {
|
|
10992
|
-
|
|
11010
|
+
function forceReflow(el) {
|
|
11011
|
+
const targetDocument = el ? el.ownerDocument : document;
|
|
11012
|
+
return targetDocument.body.offsetHeight;
|
|
10993
11013
|
}
|
|
10994
11014
|
|
|
10995
11015
|
function patchClass(el, value, isSVG) {
|
|
@@ -11423,6 +11443,9 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11423
11443
|
if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
|
|
11424
11444
|
return false;
|
|
11425
11445
|
}
|
|
11446
|
+
if (key === "sandbox" && el.tagName === "IFRAME") {
|
|
11447
|
+
return false;
|
|
11448
|
+
}
|
|
11426
11449
|
if (key === "form") {
|
|
11427
11450
|
return false;
|
|
11428
11451
|
}
|
|
@@ -11483,6 +11506,8 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11483
11506
|
this._nonce = this._def.nonce;
|
|
11484
11507
|
this._connected = false;
|
|
11485
11508
|
this._resolved = false;
|
|
11509
|
+
this._patching = false;
|
|
11510
|
+
this._dirty = false;
|
|
11486
11511
|
this._numberProps = null;
|
|
11487
11512
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
11488
11513
|
this._ob = null;
|
|
@@ -11495,7 +11520,11 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11495
11520
|
);
|
|
11496
11521
|
}
|
|
11497
11522
|
if (_def.shadowRoot !== false) {
|
|
11498
|
-
this.attachShadow(
|
|
11523
|
+
this.attachShadow(
|
|
11524
|
+
extend({}, _def.shadowRootOptions, {
|
|
11525
|
+
mode: "open"
|
|
11526
|
+
})
|
|
11527
|
+
);
|
|
11499
11528
|
this._root = this.shadowRoot;
|
|
11500
11529
|
} else {
|
|
11501
11530
|
this._root = this;
|
|
@@ -11555,9 +11584,18 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11555
11584
|
this._app && this._app.unmount();
|
|
11556
11585
|
if (this._instance) this._instance.ce = void 0;
|
|
11557
11586
|
this._app = this._instance = null;
|
|
11587
|
+
if (this._teleportTargets) {
|
|
11588
|
+
this._teleportTargets.clear();
|
|
11589
|
+
this._teleportTargets = void 0;
|
|
11590
|
+
}
|
|
11558
11591
|
}
|
|
11559
11592
|
});
|
|
11560
11593
|
}
|
|
11594
|
+
_processMutations(mutations) {
|
|
11595
|
+
for (const m of mutations) {
|
|
11596
|
+
this._setAttr(m.attributeName);
|
|
11597
|
+
}
|
|
11598
|
+
}
|
|
11561
11599
|
/**
|
|
11562
11600
|
* resolve inner component definition (handle possible async component)
|
|
11563
11601
|
*/
|
|
@@ -11568,11 +11606,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11568
11606
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
11569
11607
|
this._setAttr(this.attributes[i].name);
|
|
11570
11608
|
}
|
|
11571
|
-
this._ob = new MutationObserver((
|
|
11572
|
-
for (const m of mutations) {
|
|
11573
|
-
this._setAttr(m.attributeName);
|
|
11574
|
-
}
|
|
11575
|
-
});
|
|
11609
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
11576
11610
|
this._ob.observe(this, { attributes: true });
|
|
11577
11611
|
const resolve = (def, isAsync = false) => {
|
|
11578
11612
|
this._resolved = true;
|
|
@@ -11649,7 +11683,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11649
11683
|
return this._getProp(key);
|
|
11650
11684
|
},
|
|
11651
11685
|
set(val) {
|
|
11652
|
-
this._setProp(key, val, true,
|
|
11686
|
+
this._setProp(key, val, true, !this._patching);
|
|
11653
11687
|
}
|
|
11654
11688
|
});
|
|
11655
11689
|
}
|
|
@@ -11675,6 +11709,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11675
11709
|
*/
|
|
11676
11710
|
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
11677
11711
|
if (val !== this._props[key]) {
|
|
11712
|
+
this._dirty = true;
|
|
11678
11713
|
if (val === REMOVAL) {
|
|
11679
11714
|
delete this._props[key];
|
|
11680
11715
|
} else {
|
|
@@ -11688,7 +11723,10 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11688
11723
|
}
|
|
11689
11724
|
if (shouldReflect) {
|
|
11690
11725
|
const ob = this._ob;
|
|
11691
|
-
|
|
11726
|
+
if (ob) {
|
|
11727
|
+
this._processMutations(ob.takeRecords());
|
|
11728
|
+
ob.disconnect();
|
|
11729
|
+
}
|
|
11692
11730
|
if (val === true) {
|
|
11693
11731
|
this.setAttribute(hyphenate(key), "");
|
|
11694
11732
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -11792,7 +11830,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11792
11830
|
* Only called when shadowRoot is false
|
|
11793
11831
|
*/
|
|
11794
11832
|
_renderSlots() {
|
|
11795
|
-
const outlets =
|
|
11833
|
+
const outlets = this._getSlots();
|
|
11796
11834
|
const scopeId = this._instance.type.__scopeId;
|
|
11797
11835
|
for (let i = 0; i < outlets.length; i++) {
|
|
11798
11836
|
const o = outlets[i];
|
|
@@ -11818,12 +11856,45 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11818
11856
|
parent.removeChild(o);
|
|
11819
11857
|
}
|
|
11820
11858
|
}
|
|
11859
|
+
/**
|
|
11860
|
+
* @internal
|
|
11861
|
+
*/
|
|
11862
|
+
_getSlots() {
|
|
11863
|
+
const roots = [this];
|
|
11864
|
+
if (this._teleportTargets) {
|
|
11865
|
+
roots.push(...this._teleportTargets);
|
|
11866
|
+
}
|
|
11867
|
+
const slots = /* @__PURE__ */ new Set();
|
|
11868
|
+
for (const root of roots) {
|
|
11869
|
+
const found = root.querySelectorAll("slot");
|
|
11870
|
+
for (let i = 0; i < found.length; i++) {
|
|
11871
|
+
slots.add(found[i]);
|
|
11872
|
+
}
|
|
11873
|
+
}
|
|
11874
|
+
return Array.from(slots);
|
|
11875
|
+
}
|
|
11821
11876
|
/**
|
|
11822
11877
|
* @internal
|
|
11823
11878
|
*/
|
|
11824
11879
|
_injectChildStyle(comp) {
|
|
11825
11880
|
this._applyStyles(comp.styles, comp);
|
|
11826
11881
|
}
|
|
11882
|
+
/**
|
|
11883
|
+
* @internal
|
|
11884
|
+
*/
|
|
11885
|
+
_beginPatch() {
|
|
11886
|
+
this._patching = true;
|
|
11887
|
+
this._dirty = false;
|
|
11888
|
+
}
|
|
11889
|
+
/**
|
|
11890
|
+
* @internal
|
|
11891
|
+
*/
|
|
11892
|
+
_endPatch() {
|
|
11893
|
+
this._patching = false;
|
|
11894
|
+
if (this._dirty && this._instance) {
|
|
11895
|
+
this._update();
|
|
11896
|
+
}
|
|
11897
|
+
}
|
|
11827
11898
|
/**
|
|
11828
11899
|
* @internal
|
|
11829
11900
|
*/
|
|
@@ -11907,7 +11978,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11907
11978
|
prevChildren.forEach(callPendingCbs);
|
|
11908
11979
|
prevChildren.forEach(recordPosition);
|
|
11909
11980
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
11910
|
-
forceReflow();
|
|
11981
|
+
forceReflow(instance.vnode.el);
|
|
11911
11982
|
movedChildren.forEach((c) => {
|
|
11912
11983
|
const el = c.el;
|
|
11913
11984
|
const style = el.style;
|
|
@@ -11946,10 +12017,10 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11946
12017
|
instance
|
|
11947
12018
|
)
|
|
11948
12019
|
);
|
|
11949
|
-
positionMap.set(
|
|
11950
|
-
child,
|
|
11951
|
-
child.el.
|
|
11952
|
-
);
|
|
12020
|
+
positionMap.set(child, {
|
|
12021
|
+
left: child.el.offsetLeft,
|
|
12022
|
+
top: child.el.offsetTop
|
|
12023
|
+
});
|
|
11953
12024
|
}
|
|
11954
12025
|
}
|
|
11955
12026
|
}
|
|
@@ -11980,7 +12051,10 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11980
12051
|
}
|
|
11981
12052
|
}
|
|
11982
12053
|
function recordPosition(c) {
|
|
11983
|
-
newPositionMap.set(c,
|
|
12054
|
+
newPositionMap.set(c, {
|
|
12055
|
+
left: c.el.offsetLeft,
|
|
12056
|
+
top: c.el.offsetTop
|
|
12057
|
+
});
|
|
11984
12058
|
}
|
|
11985
12059
|
function applyTranslation(c) {
|
|
11986
12060
|
const oldPos = positionMap.get(c);
|
|
@@ -12026,24 +12100,22 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
12026
12100
|
}
|
|
12027
12101
|
}
|
|
12028
12102
|
const assignKey = Symbol("_assign");
|
|
12103
|
+
function castValue(value, trim, number) {
|
|
12104
|
+
if (trim) value = value.trim();
|
|
12105
|
+
if (number) value = looseToNumber(value);
|
|
12106
|
+
return value;
|
|
12107
|
+
}
|
|
12029
12108
|
const vModelText = {
|
|
12030
12109
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
12031
12110
|
el[assignKey] = getModelAssigner(vnode);
|
|
12032
12111
|
const castToNumber = number || vnode.props && vnode.props.type === "number";
|
|
12033
12112
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
12034
12113
|
if (e.target.composing) return;
|
|
12035
|
-
|
|
12036
|
-
if (trim) {
|
|
12037
|
-
domValue = domValue.trim();
|
|
12038
|
-
}
|
|
12039
|
-
if (castToNumber) {
|
|
12040
|
-
domValue = looseToNumber(domValue);
|
|
12041
|
-
}
|
|
12042
|
-
el[assignKey](domValue);
|
|
12114
|
+
el[assignKey](castValue(el.value, trim, castToNumber));
|
|
12043
12115
|
});
|
|
12044
|
-
if (trim) {
|
|
12116
|
+
if (trim || castToNumber) {
|
|
12045
12117
|
addEventListener(el, "change", () => {
|
|
12046
|
-
el.value = el.value
|
|
12118
|
+
el.value = castValue(el.value, trim, castToNumber);
|
|
12047
12119
|
});
|
|
12048
12120
|
}
|
|
12049
12121
|
if (!lazy) {
|
|
@@ -15933,80 +16005,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
|
|
|
15933
16005
|
}
|
|
15934
16006
|
}
|
|
15935
16007
|
|
|
15936
|
-
const transformBind = (dir, _node, context) => {
|
|
15937
|
-
const { modifiers, loc } = dir;
|
|
15938
|
-
const arg = dir.arg;
|
|
15939
|
-
let { exp } = dir;
|
|
15940
|
-
if (exp && exp.type === 4 && !exp.content.trim()) {
|
|
15941
|
-
{
|
|
15942
|
-
exp = void 0;
|
|
15943
|
-
}
|
|
15944
|
-
}
|
|
15945
|
-
if (!exp) {
|
|
15946
|
-
if (arg.type !== 4 || !arg.isStatic) {
|
|
15947
|
-
context.onError(
|
|
15948
|
-
createCompilerError(
|
|
15949
|
-
52,
|
|
15950
|
-
arg.loc
|
|
15951
|
-
)
|
|
15952
|
-
);
|
|
15953
|
-
return {
|
|
15954
|
-
props: [
|
|
15955
|
-
createObjectProperty(arg, createSimpleExpression("", true, loc))
|
|
15956
|
-
]
|
|
15957
|
-
};
|
|
15958
|
-
}
|
|
15959
|
-
transformBindShorthand(dir);
|
|
15960
|
-
exp = dir.exp;
|
|
15961
|
-
}
|
|
15962
|
-
if (arg.type !== 4) {
|
|
15963
|
-
arg.children.unshift(`(`);
|
|
15964
|
-
arg.children.push(`) || ""`);
|
|
15965
|
-
} else if (!arg.isStatic) {
|
|
15966
|
-
arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
|
15967
|
-
}
|
|
15968
|
-
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
15969
|
-
if (arg.type === 4) {
|
|
15970
|
-
if (arg.isStatic) {
|
|
15971
|
-
arg.content = camelize(arg.content);
|
|
15972
|
-
} else {
|
|
15973
|
-
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
15974
|
-
}
|
|
15975
|
-
} else {
|
|
15976
|
-
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
15977
|
-
arg.children.push(`)`);
|
|
15978
|
-
}
|
|
15979
|
-
}
|
|
15980
|
-
if (!context.inSSR) {
|
|
15981
|
-
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
15982
|
-
injectPrefix(arg, ".");
|
|
15983
|
-
}
|
|
15984
|
-
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
15985
|
-
injectPrefix(arg, "^");
|
|
15986
|
-
}
|
|
15987
|
-
}
|
|
15988
|
-
return {
|
|
15989
|
-
props: [createObjectProperty(arg, exp)]
|
|
15990
|
-
};
|
|
15991
|
-
};
|
|
15992
|
-
const transformBindShorthand = (dir, context) => {
|
|
15993
|
-
const arg = dir.arg;
|
|
15994
|
-
const propName = camelize(arg.content);
|
|
15995
|
-
dir.exp = createSimpleExpression(propName, false, arg.loc);
|
|
15996
|
-
};
|
|
15997
|
-
const injectPrefix = (arg, prefix) => {
|
|
15998
|
-
if (arg.type === 4) {
|
|
15999
|
-
if (arg.isStatic) {
|
|
16000
|
-
arg.content = prefix + arg.content;
|
|
16001
|
-
} else {
|
|
16002
|
-
arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
16003
|
-
}
|
|
16004
|
-
} else {
|
|
16005
|
-
arg.children.unshift(`'${prefix}' + (`);
|
|
16006
|
-
arg.children.push(`)`);
|
|
16007
|
-
}
|
|
16008
|
-
};
|
|
16009
|
-
|
|
16010
16008
|
const transformFor = createStructuralDirectiveTransform(
|
|
16011
16009
|
"for",
|
|
16012
16010
|
(node, dir, context) => {
|
|
@@ -16018,10 +16016,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
|
|
|
16018
16016
|
const isTemplate = isTemplateNode(node);
|
|
16019
16017
|
const memo = findDir(node, "memo");
|
|
16020
16018
|
const keyProp = findProp(node, `key`, false, true);
|
|
16021
|
-
|
|
16022
|
-
if (isDirKey && !keyProp.exp) {
|
|
16023
|
-
transformBindShorthand(keyProp);
|
|
16024
|
-
}
|
|
16019
|
+
keyProp && keyProp.type === 7;
|
|
16025
16020
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
16026
16021
|
const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
16027
16022
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
@@ -17131,6 +17126,58 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
|
|
|
17131
17126
|
return ret;
|
|
17132
17127
|
};
|
|
17133
17128
|
|
|
17129
|
+
const transformBind = (dir, _node, context) => {
|
|
17130
|
+
const { modifiers, loc } = dir;
|
|
17131
|
+
const arg = dir.arg;
|
|
17132
|
+
let { exp } = dir;
|
|
17133
|
+
if (exp && exp.type === 4 && !exp.content.trim()) {
|
|
17134
|
+
{
|
|
17135
|
+
exp = void 0;
|
|
17136
|
+
}
|
|
17137
|
+
}
|
|
17138
|
+
if (arg.type !== 4) {
|
|
17139
|
+
arg.children.unshift(`(`);
|
|
17140
|
+
arg.children.push(`) || ""`);
|
|
17141
|
+
} else if (!arg.isStatic) {
|
|
17142
|
+
arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
|
17143
|
+
}
|
|
17144
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
17145
|
+
if (arg.type === 4) {
|
|
17146
|
+
if (arg.isStatic) {
|
|
17147
|
+
arg.content = camelize(arg.content);
|
|
17148
|
+
} else {
|
|
17149
|
+
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
17150
|
+
}
|
|
17151
|
+
} else {
|
|
17152
|
+
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
17153
|
+
arg.children.push(`)`);
|
|
17154
|
+
}
|
|
17155
|
+
}
|
|
17156
|
+
if (!context.inSSR) {
|
|
17157
|
+
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
17158
|
+
injectPrefix(arg, ".");
|
|
17159
|
+
}
|
|
17160
|
+
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
17161
|
+
injectPrefix(arg, "^");
|
|
17162
|
+
}
|
|
17163
|
+
}
|
|
17164
|
+
return {
|
|
17165
|
+
props: [createObjectProperty(arg, exp)]
|
|
17166
|
+
};
|
|
17167
|
+
};
|
|
17168
|
+
const injectPrefix = (arg, prefix) => {
|
|
17169
|
+
if (arg.type === 4) {
|
|
17170
|
+
if (arg.isStatic) {
|
|
17171
|
+
arg.content = prefix + arg.content;
|
|
17172
|
+
} else {
|
|
17173
|
+
arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
17174
|
+
}
|
|
17175
|
+
} else {
|
|
17176
|
+
arg.children.unshift(`'${prefix}' + (`);
|
|
17177
|
+
arg.children.push(`)`);
|
|
17178
|
+
}
|
|
17179
|
+
};
|
|
17180
|
+
|
|
17134
17181
|
const transformText = (node, context) => {
|
|
17135
17182
|
if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
|
|
17136
17183
|
return () => {
|
|
@@ -17312,9 +17359,36 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
|
|
|
17312
17359
|
}
|
|
17313
17360
|
};
|
|
17314
17361
|
|
|
17362
|
+
const transformVBindShorthand = (node, context) => {
|
|
17363
|
+
if (node.type === 1) {
|
|
17364
|
+
for (const prop of node.props) {
|
|
17365
|
+
if (prop.type === 7 && prop.name === "bind" && (!prop.exp || // #13930 :foo in in-DOM templates will be parsed into :foo="" by browser
|
|
17366
|
+
prop.exp.type === 4 && !prop.exp.content.trim()) && prop.arg) {
|
|
17367
|
+
const arg = prop.arg;
|
|
17368
|
+
if (arg.type !== 4 || !arg.isStatic) {
|
|
17369
|
+
context.onError(
|
|
17370
|
+
createCompilerError(
|
|
17371
|
+
52,
|
|
17372
|
+
arg.loc
|
|
17373
|
+
)
|
|
17374
|
+
);
|
|
17375
|
+
prop.exp = createSimpleExpression("", true, arg.loc);
|
|
17376
|
+
} else {
|
|
17377
|
+
const propName = camelize(arg.content);
|
|
17378
|
+
if (validFirstIdentCharRE.test(propName[0]) || // allow hyphen first char for https://github.com/vuejs/language-tools/pull/3424
|
|
17379
|
+
propName[0] === "-") {
|
|
17380
|
+
prop.exp = createSimpleExpression(propName, false, arg.loc);
|
|
17381
|
+
}
|
|
17382
|
+
}
|
|
17383
|
+
}
|
|
17384
|
+
}
|
|
17385
|
+
}
|
|
17386
|
+
};
|
|
17387
|
+
|
|
17315
17388
|
function getBaseTransformPreset(prefixIdentifiers) {
|
|
17316
17389
|
return [
|
|
17317
17390
|
[
|
|
17391
|
+
transformVBindShorthand,
|
|
17318
17392
|
transformOnce,
|
|
17319
17393
|
transformIf,
|
|
17320
17394
|
transformMemo,
|