@vue/runtime-dom 3.4.8 → 3.4.9
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 +5 -5
- package/dist/runtime-dom.cjs.prod.js +5 -5
- package/dist/runtime-dom.esm-browser.js +80 -66
- package/dist/runtime-dom.esm-browser.prod.js +4 -4
- package/dist/runtime-dom.esm-bundler.js +5 -5
- package/dist/runtime-dom.global.js +80 -66
- package/dist/runtime-dom.global.prod.js +5 -5
- package/package.json +17 -3
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.4.
|
|
2
|
+
* @vue/runtime-dom v3.4.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -418,6 +418,7 @@ function useCssVars(getter) {
|
|
|
418
418
|
|
|
419
419
|
function patchStyle(el, prev, next) {
|
|
420
420
|
const style = el.style;
|
|
421
|
+
const currentDisplay = style.display;
|
|
421
422
|
const isCssString = shared.isString(next);
|
|
422
423
|
if (next && !isCssString) {
|
|
423
424
|
if (prev && !shared.isString(prev)) {
|
|
@@ -431,7 +432,6 @@ function patchStyle(el, prev, next) {
|
|
|
431
432
|
setStyle(style, key, next[key]);
|
|
432
433
|
}
|
|
433
434
|
} else {
|
|
434
|
-
const currentDisplay = style.display;
|
|
435
435
|
if (isCssString) {
|
|
436
436
|
if (prev !== next) {
|
|
437
437
|
const cssVarText = style[CSS_VAR_TEXT];
|
|
@@ -443,9 +443,9 @@ function patchStyle(el, prev, next) {
|
|
|
443
443
|
} else if (prev) {
|
|
444
444
|
el.removeAttribute("style");
|
|
445
445
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
446
|
+
}
|
|
447
|
+
if (vShowOldKey in el) {
|
|
448
|
+
style.display = currentDisplay;
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
const semicolonRE = /[^\\];\s*$/;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.4.
|
|
2
|
+
* @vue/runtime-dom v3.4.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -412,6 +412,7 @@ function useCssVars(getter) {
|
|
|
412
412
|
|
|
413
413
|
function patchStyle(el, prev, next) {
|
|
414
414
|
const style = el.style;
|
|
415
|
+
const currentDisplay = style.display;
|
|
415
416
|
const isCssString = shared.isString(next);
|
|
416
417
|
if (next && !isCssString) {
|
|
417
418
|
if (prev && !shared.isString(prev)) {
|
|
@@ -425,7 +426,6 @@ function patchStyle(el, prev, next) {
|
|
|
425
426
|
setStyle(style, key, next[key]);
|
|
426
427
|
}
|
|
427
428
|
} else {
|
|
428
|
-
const currentDisplay = style.display;
|
|
429
429
|
if (isCssString) {
|
|
430
430
|
if (prev !== next) {
|
|
431
431
|
const cssVarText = style[CSS_VAR_TEXT];
|
|
@@ -437,9 +437,9 @@ function patchStyle(el, prev, next) {
|
|
|
437
437
|
} else if (prev) {
|
|
438
438
|
el.removeAttribute("style");
|
|
439
439
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
440
|
+
}
|
|
441
|
+
if (vShowOldKey in el) {
|
|
442
|
+
style.display = currentDisplay;
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
const importantRE = /\s*!important$/;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.4.
|
|
2
|
+
* @vue/runtime-dom v3.4.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2673,6 +2673,10 @@ const SuspenseImpl = {
|
|
|
2673
2673
|
rendererInternals
|
|
2674
2674
|
);
|
|
2675
2675
|
} else {
|
|
2676
|
+
if (parentSuspense && parentSuspense.deps > 0) {
|
|
2677
|
+
n2.suspense = n1.suspense;
|
|
2678
|
+
return;
|
|
2679
|
+
}
|
|
2676
2680
|
patchSuspense(
|
|
2677
2681
|
n1,
|
|
2678
2682
|
n2,
|
|
@@ -4746,58 +4750,6 @@ function useSlots() {
|
|
|
4746
4750
|
function useAttrs() {
|
|
4747
4751
|
return getContext().attrs;
|
|
4748
4752
|
}
|
|
4749
|
-
function useModel(props, name, options = EMPTY_OBJ) {
|
|
4750
|
-
const i = getCurrentInstance();
|
|
4751
|
-
if (!i) {
|
|
4752
|
-
warn$1(`useModel() called without active instance.`);
|
|
4753
|
-
return ref();
|
|
4754
|
-
}
|
|
4755
|
-
if (!i.propsOptions[0][name]) {
|
|
4756
|
-
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
4757
|
-
return ref();
|
|
4758
|
-
}
|
|
4759
|
-
const camelizedName = camelize(name);
|
|
4760
|
-
const hyphenatedName = hyphenate(name);
|
|
4761
|
-
const res = customRef((track, trigger) => {
|
|
4762
|
-
let localValue;
|
|
4763
|
-
watchSyncEffect(() => {
|
|
4764
|
-
const propValue = props[name];
|
|
4765
|
-
if (hasChanged(localValue, propValue)) {
|
|
4766
|
-
localValue = propValue;
|
|
4767
|
-
trigger();
|
|
4768
|
-
}
|
|
4769
|
-
});
|
|
4770
|
-
return {
|
|
4771
|
-
get() {
|
|
4772
|
-
track();
|
|
4773
|
-
return options.get ? options.get(localValue) : localValue;
|
|
4774
|
-
},
|
|
4775
|
-
set(value) {
|
|
4776
|
-
const rawProps = i.vnode.props;
|
|
4777
|
-
if (!(rawProps && // check if parent has passed v-model
|
|
4778
|
-
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
4779
|
-
localValue = value;
|
|
4780
|
-
trigger();
|
|
4781
|
-
}
|
|
4782
|
-
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
4783
|
-
}
|
|
4784
|
-
};
|
|
4785
|
-
});
|
|
4786
|
-
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
4787
|
-
res[Symbol.iterator] = () => {
|
|
4788
|
-
let i2 = 0;
|
|
4789
|
-
return {
|
|
4790
|
-
next() {
|
|
4791
|
-
if (i2 < 2) {
|
|
4792
|
-
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
4793
|
-
} else {
|
|
4794
|
-
return { done: true };
|
|
4795
|
-
}
|
|
4796
|
-
}
|
|
4797
|
-
};
|
|
4798
|
-
};
|
|
4799
|
-
return res;
|
|
4800
|
-
}
|
|
4801
4753
|
function getContext() {
|
|
4802
4754
|
const i = getCurrentInstance();
|
|
4803
4755
|
if (!i) {
|
|
@@ -6584,8 +6536,17 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
6584
6536
|
actual = el.hasAttribute(key);
|
|
6585
6537
|
expected = includeBooleanAttr(clientValue);
|
|
6586
6538
|
} else {
|
|
6587
|
-
|
|
6588
|
-
|
|
6539
|
+
if (el.hasAttribute(key)) {
|
|
6540
|
+
actual = el.getAttribute(key);
|
|
6541
|
+
} else if (key in el) {
|
|
6542
|
+
const serverValue = el[key];
|
|
6543
|
+
if (!isObject(serverValue)) {
|
|
6544
|
+
actual = serverValue == null ? "" : String(serverValue);
|
|
6545
|
+
}
|
|
6546
|
+
}
|
|
6547
|
+
if (!isObject(clientValue)) {
|
|
6548
|
+
expected = clientValue == null ? "" : String(clientValue);
|
|
6549
|
+
}
|
|
6589
6550
|
}
|
|
6590
6551
|
if (actual !== expected) {
|
|
6591
6552
|
mismatchType = `attribute`;
|
|
@@ -6594,15 +6555,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
6594
6555
|
}
|
|
6595
6556
|
if (mismatchType) {
|
|
6596
6557
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
el,
|
|
6600
|
-
`
|
|
6558
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
6559
|
+
const postSegment = `
|
|
6601
6560
|
- rendered on server: ${format(actual)}
|
|
6602
6561
|
- expected on client: ${format(expected)}
|
|
6603
6562
|
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
6604
|
-
You should fix the source of the mismatch
|
|
6605
|
-
|
|
6563
|
+
You should fix the source of the mismatch.`;
|
|
6564
|
+
{
|
|
6565
|
+
warn$1(preSegment, el, postSegment);
|
|
6566
|
+
}
|
|
6606
6567
|
return true;
|
|
6607
6568
|
}
|
|
6608
6569
|
return false;
|
|
@@ -9258,6 +9219,59 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
9258
9219
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
9259
9220
|
};
|
|
9260
9221
|
|
|
9222
|
+
function useModel(props, name, options = EMPTY_OBJ) {
|
|
9223
|
+
const i = getCurrentInstance();
|
|
9224
|
+
if (!i) {
|
|
9225
|
+
warn$1(`useModel() called without active instance.`);
|
|
9226
|
+
return ref();
|
|
9227
|
+
}
|
|
9228
|
+
if (!i.propsOptions[0][name]) {
|
|
9229
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
9230
|
+
return ref();
|
|
9231
|
+
}
|
|
9232
|
+
const camelizedName = camelize(name);
|
|
9233
|
+
const hyphenatedName = hyphenate(name);
|
|
9234
|
+
const res = customRef((track, trigger) => {
|
|
9235
|
+
let localValue;
|
|
9236
|
+
watchSyncEffect(() => {
|
|
9237
|
+
const propValue = props[name];
|
|
9238
|
+
if (hasChanged(localValue, propValue)) {
|
|
9239
|
+
localValue = propValue;
|
|
9240
|
+
trigger();
|
|
9241
|
+
}
|
|
9242
|
+
});
|
|
9243
|
+
return {
|
|
9244
|
+
get() {
|
|
9245
|
+
track();
|
|
9246
|
+
return options.get ? options.get(localValue) : localValue;
|
|
9247
|
+
},
|
|
9248
|
+
set(value) {
|
|
9249
|
+
const rawProps = i.vnode.props;
|
|
9250
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
9251
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
9252
|
+
localValue = value;
|
|
9253
|
+
trigger();
|
|
9254
|
+
}
|
|
9255
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
9256
|
+
}
|
|
9257
|
+
};
|
|
9258
|
+
});
|
|
9259
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
9260
|
+
res[Symbol.iterator] = () => {
|
|
9261
|
+
let i2 = 0;
|
|
9262
|
+
return {
|
|
9263
|
+
next() {
|
|
9264
|
+
if (i2 < 2) {
|
|
9265
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
9266
|
+
} else {
|
|
9267
|
+
return { done: true };
|
|
9268
|
+
}
|
|
9269
|
+
}
|
|
9270
|
+
};
|
|
9271
|
+
};
|
|
9272
|
+
return res;
|
|
9273
|
+
}
|
|
9274
|
+
|
|
9261
9275
|
function h(type, propsOrChildren, children) {
|
|
9262
9276
|
const l = arguments.length;
|
|
9263
9277
|
if (l === 2) {
|
|
@@ -9480,7 +9494,7 @@ function isMemoSame(cached, memo) {
|
|
|
9480
9494
|
return true;
|
|
9481
9495
|
}
|
|
9482
9496
|
|
|
9483
|
-
const version = "3.4.
|
|
9497
|
+
const version = "3.4.9";
|
|
9484
9498
|
const warn = warn$1 ;
|
|
9485
9499
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9486
9500
|
const devtools = devtools$1 ;
|
|
@@ -9949,6 +9963,7 @@ function setVarsOnNode(el, vars) {
|
|
|
9949
9963
|
|
|
9950
9964
|
function patchStyle(el, prev, next) {
|
|
9951
9965
|
const style = el.style;
|
|
9966
|
+
const currentDisplay = style.display;
|
|
9952
9967
|
const isCssString = isString(next);
|
|
9953
9968
|
if (next && !isCssString) {
|
|
9954
9969
|
if (prev && !isString(prev)) {
|
|
@@ -9962,7 +9977,6 @@ function patchStyle(el, prev, next) {
|
|
|
9962
9977
|
setStyle(style, key, next[key]);
|
|
9963
9978
|
}
|
|
9964
9979
|
} else {
|
|
9965
|
-
const currentDisplay = style.display;
|
|
9966
9980
|
if (isCssString) {
|
|
9967
9981
|
if (prev !== next) {
|
|
9968
9982
|
const cssVarText = style[CSS_VAR_TEXT];
|
|
@@ -9974,9 +9988,9 @@ function patchStyle(el, prev, next) {
|
|
|
9974
9988
|
} else if (prev) {
|
|
9975
9989
|
el.removeAttribute("style");
|
|
9976
9990
|
}
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9991
|
+
}
|
|
9992
|
+
if (vShowOldKey in el) {
|
|
9993
|
+
style.display = currentDisplay;
|
|
9980
9994
|
}
|
|
9981
9995
|
}
|
|
9982
9996
|
const semicolonRE = /[^\\];\s*$/;
|