@vue/compiler-dom 3.2.44 → 3.2.46
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/compiler-dom.cjs.js +25 -27
- package/dist/compiler-dom.cjs.prod.js +23 -25
- package/dist/compiler-dom.d.ts +12 -12
- package/dist/compiler-dom.esm-browser.js +88 -77
- package/dist/compiler-dom.esm-browser.prod.js +1 -1
- package/dist/compiler-dom.esm-bundler.js +23 -23
- package/dist/compiler-dom.global.js +91 -82
- package/dist/compiler-dom.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/compiler-dom.cjs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var compilerCore = require('@vue/compiler-core');
|
|
6
4
|
var shared = require('@vue/shared');
|
|
7
5
|
|
|
@@ -2483,26 +2481,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
2483
2481
|
return compilerCore.createCompilerError(code, loc, DOMErrorMessages );
|
|
2484
2482
|
}
|
|
2485
2483
|
const DOMErrorMessages = {
|
|
2486
|
-
[
|
|
2487
|
-
[
|
|
2488
|
-
[
|
|
2489
|
-
[
|
|
2490
|
-
[
|
|
2491
|
-
[
|
|
2492
|
-
[
|
|
2493
|
-
[
|
|
2494
|
-
[
|
|
2495
|
-
[
|
|
2496
|
-
[
|
|
2484
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
2485
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
2486
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
2487
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
2488
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
2489
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
2490
|
+
[57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
2491
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
2492
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
2493
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
2494
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
2497
2495
|
};
|
|
2498
2496
|
|
|
2499
2497
|
const transformVHtml = (dir, node, context) => {
|
|
2500
2498
|
const { exp, loc } = dir;
|
|
2501
2499
|
if (!exp) {
|
|
2502
|
-
context.onError(createDOMCompilerError(
|
|
2500
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
2503
2501
|
}
|
|
2504
2502
|
if (node.children.length) {
|
|
2505
|
-
context.onError(createDOMCompilerError(
|
|
2503
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
2506
2504
|
node.children.length = 0;
|
|
2507
2505
|
}
|
|
2508
2506
|
return {
|
|
@@ -2515,10 +2513,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
2515
2513
|
const transformVText = (dir, node, context) => {
|
|
2516
2514
|
const { exp, loc } = dir;
|
|
2517
2515
|
if (!exp) {
|
|
2518
|
-
context.onError(createDOMCompilerError(
|
|
2516
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
2519
2517
|
}
|
|
2520
2518
|
if (node.children.length) {
|
|
2521
|
-
context.onError(createDOMCompilerError(
|
|
2519
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
2522
2520
|
node.children.length = 0;
|
|
2523
2521
|
}
|
|
2524
2522
|
return {
|
|
@@ -2539,12 +2537,12 @@ const transformModel = (dir, node, context) => {
|
|
|
2539
2537
|
return baseResult;
|
|
2540
2538
|
}
|
|
2541
2539
|
if (dir.arg) {
|
|
2542
|
-
context.onError(createDOMCompilerError(
|
|
2540
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
2543
2541
|
}
|
|
2544
2542
|
function checkDuplicatedValue() {
|
|
2545
2543
|
const value = compilerCore.findProp(node, 'value');
|
|
2546
2544
|
if (value) {
|
|
2547
|
-
context.onError(createDOMCompilerError(
|
|
2545
|
+
context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
|
|
2548
2546
|
}
|
|
2549
2547
|
}
|
|
2550
2548
|
const { tag } = node;
|
|
@@ -2572,7 +2570,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2572
2570
|
break;
|
|
2573
2571
|
case 'file':
|
|
2574
2572
|
isInvalidType = true;
|
|
2575
|
-
context.onError(createDOMCompilerError(
|
|
2573
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
2576
2574
|
break;
|
|
2577
2575
|
default:
|
|
2578
2576
|
// text type
|
|
@@ -2606,7 +2604,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2606
2604
|
}
|
|
2607
2605
|
}
|
|
2608
2606
|
else {
|
|
2609
|
-
context.onError(createDOMCompilerError(
|
|
2607
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
2610
2608
|
}
|
|
2611
2609
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
2612
2610
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -2730,7 +2728,7 @@ const transformOn = (dir, node, context) => {
|
|
|
2730
2728
|
const transformShow = (dir, node, context) => {
|
|
2731
2729
|
const { exp, loc } = dir;
|
|
2732
2730
|
if (!exp) {
|
|
2733
|
-
context.onError(createDOMCompilerError(
|
|
2731
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
2734
2732
|
}
|
|
2735
2733
|
return {
|
|
2736
2734
|
props: [],
|
|
@@ -2749,7 +2747,7 @@ const transformTransition = (node, context) => {
|
|
|
2749
2747
|
}
|
|
2750
2748
|
// warn multiple transition children
|
|
2751
2749
|
if (hasMultipleChildren(node)) {
|
|
2752
|
-
context.onError(createDOMCompilerError(
|
|
2750
|
+
context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
|
|
2753
2751
|
start: node.children[0].loc.start,
|
|
2754
2752
|
end: node.children[node.children.length - 1].loc.end,
|
|
2755
2753
|
source: ''
|
|
@@ -3084,7 +3082,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
3084
3082
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
3085
3083
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
3086
3084
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
3087
|
-
context.onError(createDOMCompilerError(
|
|
3085
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
3088
3086
|
context.removeNode();
|
|
3089
3087
|
}
|
|
3090
3088
|
};
|
|
@@ -3119,9 +3117,6 @@ function parse(template, options = {}) {
|
|
|
3119
3117
|
return compilerCore.baseParse(template, shared.extend({}, parserOptions, options));
|
|
3120
3118
|
}
|
|
3121
3119
|
|
|
3122
|
-
Object.keys(compilerCore).forEach(function (k) {
|
|
3123
|
-
if (k !== 'default') exports[k] = compilerCore[k];
|
|
3124
|
-
});
|
|
3125
3120
|
exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
|
|
3126
3121
|
exports.DOMNodeTransforms = DOMNodeTransforms;
|
|
3127
3122
|
exports.TRANSITION = TRANSITION;
|
|
@@ -3139,3 +3134,6 @@ exports.createDOMCompilerError = createDOMCompilerError;
|
|
|
3139
3134
|
exports.parse = parse;
|
|
3140
3135
|
exports.parserOptions = parserOptions;
|
|
3141
3136
|
exports.transformStyle = transformStyle;
|
|
3137
|
+
Object.keys(compilerCore).forEach(function(k) {
|
|
3138
|
+
if (k !== 'default') exports[k] = compilerCore[k];
|
|
3139
|
+
});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var compilerCore = require('@vue/compiler-core');
|
|
6
4
|
var shared = require('@vue/shared');
|
|
7
5
|
|
|
@@ -2483,26 +2481,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
2483
2481
|
return compilerCore.createCompilerError(code, loc, DOMErrorMessages );
|
|
2484
2482
|
}
|
|
2485
2483
|
const DOMErrorMessages = {
|
|
2486
|
-
[
|
|
2487
|
-
[
|
|
2488
|
-
[
|
|
2489
|
-
[
|
|
2490
|
-
[
|
|
2491
|
-
[
|
|
2492
|
-
[
|
|
2493
|
-
[
|
|
2494
|
-
[
|
|
2495
|
-
[
|
|
2496
|
-
[
|
|
2484
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
2485
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
2486
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
2487
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
2488
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
2489
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
2490
|
+
[57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
2491
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
2492
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
2493
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
2494
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
2497
2495
|
};
|
|
2498
2496
|
|
|
2499
2497
|
const transformVHtml = (dir, node, context) => {
|
|
2500
2498
|
const { exp, loc } = dir;
|
|
2501
2499
|
if (!exp) {
|
|
2502
|
-
context.onError(createDOMCompilerError(
|
|
2500
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
2503
2501
|
}
|
|
2504
2502
|
if (node.children.length) {
|
|
2505
|
-
context.onError(createDOMCompilerError(
|
|
2503
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
2506
2504
|
node.children.length = 0;
|
|
2507
2505
|
}
|
|
2508
2506
|
return {
|
|
@@ -2515,10 +2513,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
2515
2513
|
const transformVText = (dir, node, context) => {
|
|
2516
2514
|
const { exp, loc } = dir;
|
|
2517
2515
|
if (!exp) {
|
|
2518
|
-
context.onError(createDOMCompilerError(
|
|
2516
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
2519
2517
|
}
|
|
2520
2518
|
if (node.children.length) {
|
|
2521
|
-
context.onError(createDOMCompilerError(
|
|
2519
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
2522
2520
|
node.children.length = 0;
|
|
2523
2521
|
}
|
|
2524
2522
|
return {
|
|
@@ -2539,7 +2537,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2539
2537
|
return baseResult;
|
|
2540
2538
|
}
|
|
2541
2539
|
if (dir.arg) {
|
|
2542
|
-
context.onError(createDOMCompilerError(
|
|
2540
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
2543
2541
|
}
|
|
2544
2542
|
const { tag } = node;
|
|
2545
2543
|
const isCustomElement = context.isCustomElement(tag);
|
|
@@ -2566,7 +2564,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2566
2564
|
break;
|
|
2567
2565
|
case 'file':
|
|
2568
2566
|
isInvalidType = true;
|
|
2569
|
-
context.onError(createDOMCompilerError(
|
|
2567
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
2570
2568
|
break;
|
|
2571
2569
|
}
|
|
2572
2570
|
}
|
|
@@ -2590,7 +2588,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2590
2588
|
}
|
|
2591
2589
|
}
|
|
2592
2590
|
else {
|
|
2593
|
-
context.onError(createDOMCompilerError(
|
|
2591
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
2594
2592
|
}
|
|
2595
2593
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
2596
2594
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -2714,7 +2712,7 @@ const transformOn = (dir, node, context) => {
|
|
|
2714
2712
|
const transformShow = (dir, node, context) => {
|
|
2715
2713
|
const { exp, loc } = dir;
|
|
2716
2714
|
if (!exp) {
|
|
2717
|
-
context.onError(createDOMCompilerError(
|
|
2715
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
2718
2716
|
}
|
|
2719
2717
|
return {
|
|
2720
2718
|
props: [],
|
|
@@ -3022,7 +3020,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
3022
3020
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
3023
3021
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
3024
3022
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
3025
|
-
context.onError(createDOMCompilerError(
|
|
3023
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
3026
3024
|
context.removeNode();
|
|
3027
3025
|
}
|
|
3028
3026
|
};
|
|
@@ -3057,9 +3055,6 @@ function parse(template, options = {}) {
|
|
|
3057
3055
|
return compilerCore.baseParse(template, shared.extend({}, parserOptions, options));
|
|
3058
3056
|
}
|
|
3059
3057
|
|
|
3060
|
-
Object.keys(compilerCore).forEach(function (k) {
|
|
3061
|
-
if (k !== 'default') exports[k] = compilerCore[k];
|
|
3062
|
-
});
|
|
3063
3058
|
exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
|
|
3064
3059
|
exports.DOMNodeTransforms = DOMNodeTransforms;
|
|
3065
3060
|
exports.TRANSITION = TRANSITION;
|
|
@@ -3077,3 +3072,6 @@ exports.createDOMCompilerError = createDOMCompilerError;
|
|
|
3077
3072
|
exports.parse = parse;
|
|
3078
3073
|
exports.parserOptions = parserOptions;
|
|
3079
3074
|
exports.transformStyle = transformStyle;
|
|
3075
|
+
Object.keys(compilerCore).forEach(function(k) {
|
|
3076
|
+
if (k !== 'default') exports[k] = compilerCore[k];
|
|
3077
|
+
});
|
package/dist/compiler-dom.d.ts
CHANGED
|
@@ -18,18 +18,18 @@ declare interface DOMCompilerError extends CompilerError {
|
|
|
18
18
|
export declare const DOMDirectiveTransforms: Record<string, DirectiveTransform>;
|
|
19
19
|
|
|
20
20
|
export declare const enum DOMErrorCodes {
|
|
21
|
-
X_V_HTML_NO_EXPRESSION =
|
|
22
|
-
X_V_HTML_WITH_CHILDREN =
|
|
23
|
-
X_V_TEXT_NO_EXPRESSION =
|
|
24
|
-
X_V_TEXT_WITH_CHILDREN =
|
|
25
|
-
X_V_MODEL_ON_INVALID_ELEMENT =
|
|
26
|
-
X_V_MODEL_ARG_ON_ELEMENT =
|
|
27
|
-
X_V_MODEL_ON_FILE_INPUT_ELEMENT =
|
|
28
|
-
X_V_MODEL_UNNECESSARY_VALUE =
|
|
29
|
-
X_V_SHOW_NO_EXPRESSION =
|
|
30
|
-
X_TRANSITION_INVALID_CHILDREN =
|
|
31
|
-
X_IGNORED_SIDE_EFFECT_TAG =
|
|
32
|
-
__EXTEND_POINT__ =
|
|
21
|
+
X_V_HTML_NO_EXPRESSION = 51,
|
|
22
|
+
X_V_HTML_WITH_CHILDREN = 52,
|
|
23
|
+
X_V_TEXT_NO_EXPRESSION = 53,
|
|
24
|
+
X_V_TEXT_WITH_CHILDREN = 54,
|
|
25
|
+
X_V_MODEL_ON_INVALID_ELEMENT = 55,
|
|
26
|
+
X_V_MODEL_ARG_ON_ELEMENT = 56,
|
|
27
|
+
X_V_MODEL_ON_FILE_INPUT_ELEMENT = 57,
|
|
28
|
+
X_V_MODEL_UNNECESSARY_VALUE = 58,
|
|
29
|
+
X_V_SHOW_NO_EXPRESSION = 59,
|
|
30
|
+
X_TRANSITION_INVALID_CHILDREN = 60,
|
|
31
|
+
X_IGNORED_SIDE_EFFECT_TAG = 61,
|
|
32
|
+
__EXTEND_POINT__ = 62
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export declare const DOMNodeTransforms: NodeTransform[];
|