@vue/runtime-dom 3.6.0-beta.1 → 3.6.0-beta.11
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 +1379 -1736
- package/dist/runtime-dom.cjs.prod.js +1288 -1593
- package/dist/runtime-dom.d.ts +1319 -1296
- package/dist/runtime-dom.esm-browser.js +8962 -12330
- package/dist/runtime-dom.esm-browser.prod.js +7 -6
- package/dist/runtime-dom.esm-bundler.js +1445 -1802
- package/dist/runtime-dom.global.js +10138 -13404
- package/dist/runtime-dom.global.prod.js +7 -6
- package/package.json +4 -4
|
@@ -1,1774 +1,1464 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-beta.
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
* @vue/runtime-dom v3.6.0-beta.11
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/
|
|
6
|
+
Object.defineProperties(exports, {
|
|
7
|
+
__esModule: { value: true },
|
|
8
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
9
|
+
});
|
|
10
|
+
let _vue_runtime_core = require("@vue/runtime-core");
|
|
11
|
+
let _vue_shared = require("@vue/shared");
|
|
12
|
+
//#region packages/runtime-dom/src/nodeOps.ts
|
|
13
13
|
let policy = void 0;
|
|
14
14
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
15
|
-
if (tt) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
createHTML: (val) => val
|
|
19
|
-
});
|
|
20
|
-
} catch (e) {
|
|
21
|
-
}
|
|
22
|
-
}
|
|
15
|
+
if (tt) try {
|
|
16
|
+
policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
|
|
17
|
+
} catch (e) {}
|
|
23
18
|
const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
|
|
24
19
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
25
20
|
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
26
21
|
const doc = typeof document !== "undefined" ? document : null;
|
|
27
22
|
const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
|
|
28
23
|
const nodeOps = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
);
|
|
74
|
-
const template = templateContainer.content;
|
|
75
|
-
if (namespace === "svg" || namespace === "mathml") {
|
|
76
|
-
const wrapper = template.firstChild;
|
|
77
|
-
while (wrapper.firstChild) {
|
|
78
|
-
template.appendChild(wrapper.firstChild);
|
|
79
|
-
}
|
|
80
|
-
template.removeChild(wrapper);
|
|
81
|
-
}
|
|
82
|
-
parent.insertBefore(template, anchor);
|
|
83
|
-
}
|
|
84
|
-
return [
|
|
85
|
-
// first
|
|
86
|
-
before ? before.nextSibling : parent.firstChild,
|
|
87
|
-
// last
|
|
88
|
-
anchor ? anchor.previousSibling : parent.lastChild
|
|
89
|
-
];
|
|
90
|
-
}
|
|
24
|
+
insert: (child, parent, anchor) => {
|
|
25
|
+
parent.insertBefore(child, anchor || null);
|
|
26
|
+
},
|
|
27
|
+
remove: (child) => {
|
|
28
|
+
const parent = child.parentNode;
|
|
29
|
+
if (parent) parent.removeChild(child);
|
|
30
|
+
},
|
|
31
|
+
createElement: (tag, namespace, is, props) => {
|
|
32
|
+
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
|
|
33
|
+
if (tag === "select" && props && props.multiple != null) el.setAttribute("multiple", props.multiple);
|
|
34
|
+
return el;
|
|
35
|
+
},
|
|
36
|
+
createText: (text) => doc.createTextNode(text),
|
|
37
|
+
createComment: (text) => doc.createComment(text),
|
|
38
|
+
setText: (node, text) => {
|
|
39
|
+
node.nodeValue = text;
|
|
40
|
+
},
|
|
41
|
+
setElementText: (el, text) => {
|
|
42
|
+
el.textContent = text;
|
|
43
|
+
},
|
|
44
|
+
parentNode: (node) => node.parentNode,
|
|
45
|
+
nextSibling: (node) => node.nextSibling,
|
|
46
|
+
querySelector: (selector) => doc.querySelector(selector),
|
|
47
|
+
setScopeId(el, id) {
|
|
48
|
+
el.setAttribute(id, "");
|
|
49
|
+
},
|
|
50
|
+
insertStaticContent(content, parent, anchor, namespace, start, end) {
|
|
51
|
+
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
52
|
+
if (start && (start === end || start.nextSibling)) while (true) {
|
|
53
|
+
parent.insertBefore(start.cloneNode(true), anchor);
|
|
54
|
+
if (start === end || !(start = start.nextSibling)) break;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
templateContainer.innerHTML = unsafeToTrustedHTML(namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content);
|
|
58
|
+
const template = templateContainer.content;
|
|
59
|
+
if (namespace === "svg" || namespace === "mathml") {
|
|
60
|
+
const wrapper = template.firstChild;
|
|
61
|
+
while (wrapper.firstChild) template.appendChild(wrapper.firstChild);
|
|
62
|
+
template.removeChild(wrapper);
|
|
63
|
+
}
|
|
64
|
+
parent.insertBefore(template, anchor);
|
|
65
|
+
}
|
|
66
|
+
return [before ? before.nextSibling : parent.firstChild, anchor ? anchor.previousSibling : parent.lastChild];
|
|
67
|
+
}
|
|
91
68
|
};
|
|
92
|
-
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region packages/runtime-dom/src/components/Transition.ts
|
|
93
71
|
const TRANSITION = "transition";
|
|
94
72
|
const ANIMATION = "animation";
|
|
95
|
-
const vtcKey =
|
|
73
|
+
const vtcKey = Symbol("_vtc");
|
|
96
74
|
const DOMTransitionPropsValidators = {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
75
|
+
name: String,
|
|
76
|
+
type: String,
|
|
77
|
+
css: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: true
|
|
80
|
+
},
|
|
81
|
+
duration: [
|
|
82
|
+
String,
|
|
83
|
+
Number,
|
|
84
|
+
Object
|
|
85
|
+
],
|
|
86
|
+
enterFromClass: String,
|
|
87
|
+
enterActiveClass: String,
|
|
88
|
+
enterToClass: String,
|
|
89
|
+
appearFromClass: String,
|
|
90
|
+
appearActiveClass: String,
|
|
91
|
+
appearToClass: String,
|
|
92
|
+
leaveFromClass: String,
|
|
93
|
+
leaveActiveClass: String,
|
|
94
|
+
leaveToClass: String
|
|
113
95
|
};
|
|
114
|
-
const TransitionPropsValidators = /* @__PURE__ */
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
96
|
+
const TransitionPropsValidators = /* @__PURE__ */ (0, _vue_shared.extend)({}, _vue_runtime_core.BaseTransitionPropsValidators, DOMTransitionPropsValidators);
|
|
97
|
+
/**
|
|
98
|
+
* Wrap logic that attaches extra properties to Transition in a function
|
|
99
|
+
* so that it can be annotated as pure
|
|
100
|
+
*/
|
|
119
101
|
const decorate$1 = (t) => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
102
|
+
t.displayName = "Transition";
|
|
103
|
+
t.props = TransitionPropsValidators;
|
|
104
|
+
return t;
|
|
123
105
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
106
|
+
/**
|
|
107
|
+
* DOM Transition is a higher-order-component based on the platform-agnostic
|
|
108
|
+
* base Transition component, with DOM-specific logic.
|
|
109
|
+
*/
|
|
110
|
+
const Transition = /* @__PURE__ */ decorate$1((props, { slots }) => (0, _vue_runtime_core.h)(_vue_runtime_core.BaseTransition, resolveTransitionProps(props), slots));
|
|
111
|
+
/**
|
|
112
|
+
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
113
|
+
* with custom HOCs.
|
|
114
|
+
*/
|
|
127
115
|
const callHook = (hook, args = []) => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
} else if (hook) {
|
|
131
|
-
hook(...args);
|
|
132
|
-
}
|
|
116
|
+
if ((0, _vue_shared.isArray)(hook)) hook.forEach((h) => h(...args));
|
|
117
|
+
else if (hook) hook(...args);
|
|
133
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* Check if a hook expects a callback (2nd arg), which means the user
|
|
121
|
+
* intends to explicitly control the end of the transition.
|
|
122
|
+
*/
|
|
134
123
|
const hasExplicitCallback = (hook) => {
|
|
135
|
-
|
|
124
|
+
return hook ? (0, _vue_shared.isArray)(hook) ? hook.some((h) => h.length > 1) : hook.length > 1 : false;
|
|
136
125
|
};
|
|
137
126
|
function resolveTransitionProps(rawProps) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const resolve = () => finishLeave(el, done);
|
|
217
|
-
addTransitionClass(el, leaveFromClass);
|
|
218
|
-
if (!el._enterCancelled) {
|
|
219
|
-
forceReflow(el);
|
|
220
|
-
addTransitionClass(el, leaveActiveClass);
|
|
221
|
-
} else {
|
|
222
|
-
addTransitionClass(el, leaveActiveClass);
|
|
223
|
-
forceReflow(el);
|
|
224
|
-
}
|
|
225
|
-
nextFrame(() => {
|
|
226
|
-
if (!el._isLeaving) {
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
removeTransitionClass(el, leaveFromClass);
|
|
230
|
-
addTransitionClass(el, leaveToClass);
|
|
231
|
-
if (!hasExplicitCallback(onLeave)) {
|
|
232
|
-
whenTransitionEnds(el, type, leaveDuration, resolve);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
callHook(onLeave, [el, resolve]);
|
|
236
|
-
},
|
|
237
|
-
onEnterCancelled(el) {
|
|
238
|
-
finishEnter(el, false, void 0, true);
|
|
239
|
-
callHook(onEnterCancelled, [el]);
|
|
240
|
-
},
|
|
241
|
-
onAppearCancelled(el) {
|
|
242
|
-
finishEnter(el, true, void 0, true);
|
|
243
|
-
callHook(onAppearCancelled, [el]);
|
|
244
|
-
},
|
|
245
|
-
onLeaveCancelled(el) {
|
|
246
|
-
finishLeave(el);
|
|
247
|
-
callHook(onLeaveCancelled, [el]);
|
|
248
|
-
}
|
|
249
|
-
});
|
|
127
|
+
const baseProps = {};
|
|
128
|
+
for (const key in rawProps) if (!(key in DOMTransitionPropsValidators)) baseProps[key] = rawProps[key];
|
|
129
|
+
if (rawProps.css === false) return baseProps;
|
|
130
|
+
const { name = "v", type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;
|
|
131
|
+
const durations = normalizeDuration(duration);
|
|
132
|
+
const enterDuration = durations && durations[0];
|
|
133
|
+
const leaveDuration = durations && durations[1];
|
|
134
|
+
const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps;
|
|
135
|
+
const finishEnter = (el, isAppear, done, isCancelled) => {
|
|
136
|
+
el._enterCancelled = isCancelled;
|
|
137
|
+
removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
138
|
+
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
139
|
+
done && done();
|
|
140
|
+
};
|
|
141
|
+
const finishLeave = (el, done) => {
|
|
142
|
+
el._isLeaving = false;
|
|
143
|
+
removeTransitionClass(el, leaveFromClass);
|
|
144
|
+
removeTransitionClass(el, leaveToClass);
|
|
145
|
+
removeTransitionClass(el, leaveActiveClass);
|
|
146
|
+
done && done();
|
|
147
|
+
};
|
|
148
|
+
const makeEnterHook = (isAppear) => {
|
|
149
|
+
return (el, done) => {
|
|
150
|
+
const hook = isAppear ? onAppear : onEnter;
|
|
151
|
+
const resolve = () => finishEnter(el, isAppear, done);
|
|
152
|
+
callHook(hook, [el, resolve]);
|
|
153
|
+
nextFrame(() => {
|
|
154
|
+
removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
|
|
155
|
+
addTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
156
|
+
if (!hasExplicitCallback(hook)) whenTransitionEnds(el, type, enterDuration, resolve);
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
return (0, _vue_shared.extend)(baseProps, {
|
|
161
|
+
onBeforeEnter(el) {
|
|
162
|
+
callHook(onBeforeEnter, [el]);
|
|
163
|
+
addTransitionClass(el, enterFromClass);
|
|
164
|
+
addTransitionClass(el, enterActiveClass);
|
|
165
|
+
},
|
|
166
|
+
onBeforeAppear(el) {
|
|
167
|
+
callHook(onBeforeAppear, [el]);
|
|
168
|
+
addTransitionClass(el, appearFromClass);
|
|
169
|
+
addTransitionClass(el, appearActiveClass);
|
|
170
|
+
},
|
|
171
|
+
onEnter: makeEnterHook(false),
|
|
172
|
+
onAppear: makeEnterHook(true),
|
|
173
|
+
onLeave(el, done) {
|
|
174
|
+
el._isLeaving = true;
|
|
175
|
+
const resolve = () => finishLeave(el, done);
|
|
176
|
+
addTransitionClass(el, leaveFromClass);
|
|
177
|
+
if (!el._enterCancelled) {
|
|
178
|
+
forceReflow(el);
|
|
179
|
+
addTransitionClass(el, leaveActiveClass);
|
|
180
|
+
} else {
|
|
181
|
+
addTransitionClass(el, leaveActiveClass);
|
|
182
|
+
forceReflow(el);
|
|
183
|
+
}
|
|
184
|
+
nextFrame(() => {
|
|
185
|
+
if (!el._isLeaving) return;
|
|
186
|
+
removeTransitionClass(el, leaveFromClass);
|
|
187
|
+
addTransitionClass(el, leaveToClass);
|
|
188
|
+
if (!hasExplicitCallback(onLeave)) whenTransitionEnds(el, type, leaveDuration, resolve);
|
|
189
|
+
});
|
|
190
|
+
callHook(onLeave, [el, resolve]);
|
|
191
|
+
},
|
|
192
|
+
onEnterCancelled(el) {
|
|
193
|
+
finishEnter(el, false, void 0, true);
|
|
194
|
+
callHook(onEnterCancelled, [el]);
|
|
195
|
+
},
|
|
196
|
+
onAppearCancelled(el) {
|
|
197
|
+
finishEnter(el, true, void 0, true);
|
|
198
|
+
callHook(onAppearCancelled, [el]);
|
|
199
|
+
},
|
|
200
|
+
onLeaveCancelled(el) {
|
|
201
|
+
finishLeave(el);
|
|
202
|
+
callHook(onLeaveCancelled, [el]);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
250
205
|
}
|
|
251
206
|
function normalizeDuration(duration) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
return [n, n];
|
|
259
|
-
}
|
|
207
|
+
if (duration == null) return null;
|
|
208
|
+
else if ((0, _vue_shared.isObject)(duration)) return [NumberOf(duration.enter), NumberOf(duration.leave)];
|
|
209
|
+
else {
|
|
210
|
+
const n = NumberOf(duration);
|
|
211
|
+
return [n, n];
|
|
212
|
+
}
|
|
260
213
|
}
|
|
261
214
|
function NumberOf(val) {
|
|
262
|
-
|
|
263
|
-
return res;
|
|
215
|
+
return (0, _vue_shared.toNumber)(val);
|
|
264
216
|
}
|
|
265
217
|
function addTransitionClass(el, cls) {
|
|
266
|
-
|
|
267
|
-
|
|
218
|
+
cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
|
|
219
|
+
(el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
|
|
268
220
|
}
|
|
269
221
|
function removeTransitionClass(el, cls) {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
}
|
|
222
|
+
cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
|
|
223
|
+
const _vtc = el[vtcKey];
|
|
224
|
+
if (_vtc) {
|
|
225
|
+
_vtc.delete(cls);
|
|
226
|
+
if (!_vtc.size) el[vtcKey] = void 0;
|
|
227
|
+
}
|
|
278
228
|
}
|
|
279
229
|
function nextFrame(cb) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
230
|
+
requestAnimationFrame(() => {
|
|
231
|
+
requestAnimationFrame(cb);
|
|
232
|
+
});
|
|
283
233
|
}
|
|
284
234
|
let endId = 0;
|
|
285
235
|
function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
if (e.target === el && ++ended >= propCount) {
|
|
307
|
-
end();
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
setTimeout(() => {
|
|
311
|
-
if (ended < propCount) {
|
|
312
|
-
end();
|
|
313
|
-
}
|
|
314
|
-
}, timeout + 1);
|
|
315
|
-
el.addEventListener(endEvent, onEnd);
|
|
236
|
+
const id = el._endId = ++endId;
|
|
237
|
+
const resolveIfNotStale = () => {
|
|
238
|
+
if (id === el._endId) resolve();
|
|
239
|
+
};
|
|
240
|
+
if (explicitTimeout != null) return setTimeout(resolveIfNotStale, explicitTimeout);
|
|
241
|
+
const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
|
|
242
|
+
if (!type) return resolve();
|
|
243
|
+
const endEvent = type + "end";
|
|
244
|
+
let ended = 0;
|
|
245
|
+
const end = () => {
|
|
246
|
+
el.removeEventListener(endEvent, onEnd);
|
|
247
|
+
resolveIfNotStale();
|
|
248
|
+
};
|
|
249
|
+
const onEnd = (e) => {
|
|
250
|
+
if (e.target === el && ++ended >= propCount) end();
|
|
251
|
+
};
|
|
252
|
+
setTimeout(() => {
|
|
253
|
+
if (ended < propCount) end();
|
|
254
|
+
}, timeout + 1);
|
|
255
|
+
el.addEventListener(endEvent, onEnd);
|
|
316
256
|
}
|
|
317
257
|
function getTransitionInfo(el, expectedType) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
hasTransform
|
|
354
|
-
};
|
|
258
|
+
const styles = window.getComputedStyle(el);
|
|
259
|
+
const getStyleProperties = (key) => (styles[key] || "").split(", ");
|
|
260
|
+
const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
|
|
261
|
+
const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
|
|
262
|
+
const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
|
263
|
+
const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
|
|
264
|
+
const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
|
|
265
|
+
const animationTimeout = getTimeout(animationDelays, animationDurations);
|
|
266
|
+
let type = null;
|
|
267
|
+
let timeout = 0;
|
|
268
|
+
let propCount = 0;
|
|
269
|
+
if (expectedType === TRANSITION) {
|
|
270
|
+
if (transitionTimeout > 0) {
|
|
271
|
+
type = TRANSITION;
|
|
272
|
+
timeout = transitionTimeout;
|
|
273
|
+
propCount = transitionDurations.length;
|
|
274
|
+
}
|
|
275
|
+
} else if (expectedType === ANIMATION) {
|
|
276
|
+
if (animationTimeout > 0) {
|
|
277
|
+
type = ANIMATION;
|
|
278
|
+
timeout = animationTimeout;
|
|
279
|
+
propCount = animationDurations.length;
|
|
280
|
+
}
|
|
281
|
+
} else {
|
|
282
|
+
timeout = Math.max(transitionTimeout, animationTimeout);
|
|
283
|
+
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
|
|
284
|
+
propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
|
|
285
|
+
}
|
|
286
|
+
const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
|
|
287
|
+
return {
|
|
288
|
+
type,
|
|
289
|
+
timeout,
|
|
290
|
+
propCount,
|
|
291
|
+
hasTransform
|
|
292
|
+
};
|
|
355
293
|
}
|
|
356
294
|
function getTimeout(delays, durations) {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
|
|
295
|
+
while (delays.length < durations.length) delays = delays.concat(delays);
|
|
296
|
+
return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
|
|
361
297
|
}
|
|
362
298
|
function toMs(s) {
|
|
363
|
-
|
|
364
|
-
|
|
299
|
+
if (s === "auto") return 0;
|
|
300
|
+
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
365
301
|
}
|
|
366
302
|
function forceReflow(el) {
|
|
367
|
-
|
|
368
|
-
return targetDocument.body.offsetHeight;
|
|
303
|
+
return (el ? el.ownerDocument : document).body.offsetHeight;
|
|
369
304
|
}
|
|
370
|
-
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region packages/runtime-dom/src/modules/class.ts
|
|
371
307
|
function patchClass(el, value, isSVG) {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
el.removeAttribute("class");
|
|
378
|
-
} else if (isSVG) {
|
|
379
|
-
el.setAttribute("class", value);
|
|
380
|
-
} else {
|
|
381
|
-
el.className = value;
|
|
382
|
-
}
|
|
308
|
+
const transitionClasses = el[vtcKey];
|
|
309
|
+
if (transitionClasses) value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
|
|
310
|
+
if (value == null) el.removeAttribute("class");
|
|
311
|
+
else if (isSVG) el.setAttribute("class", value);
|
|
312
|
+
else el.className = value;
|
|
383
313
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
const
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region packages/runtime-dom/src/directives/vShow.ts
|
|
316
|
+
const vShowOriginalDisplay = Symbol("_vod");
|
|
317
|
+
const vShowHidden = Symbol("_vsh");
|
|
387
318
|
const vShow = {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
transition.leave(el, () => {
|
|
412
|
-
setDisplay(el, false);
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
} else {
|
|
416
|
-
setDisplay(el, value);
|
|
417
|
-
}
|
|
418
|
-
},
|
|
419
|
-
beforeUnmount(el, { value }) {
|
|
420
|
-
setDisplay(el, value);
|
|
421
|
-
}
|
|
319
|
+
name: "show",
|
|
320
|
+
beforeMount(el, { value }, { transition }) {
|
|
321
|
+
el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
|
|
322
|
+
if (transition && value) transition.beforeEnter(el);
|
|
323
|
+
else setDisplay(el, value);
|
|
324
|
+
},
|
|
325
|
+
mounted(el, { value }, { transition }) {
|
|
326
|
+
if (transition && value) transition.enter(el);
|
|
327
|
+
},
|
|
328
|
+
updated(el, { value, oldValue }, { transition }) {
|
|
329
|
+
if (!value === !oldValue) return;
|
|
330
|
+
if (transition) if (value) {
|
|
331
|
+
transition.beforeEnter(el);
|
|
332
|
+
setDisplay(el, true);
|
|
333
|
+
transition.enter(el);
|
|
334
|
+
} else transition.leave(el, () => {
|
|
335
|
+
setDisplay(el, false);
|
|
336
|
+
});
|
|
337
|
+
else setDisplay(el, value);
|
|
338
|
+
},
|
|
339
|
+
beforeUnmount(el, { value }) {
|
|
340
|
+
setDisplay(el, value);
|
|
341
|
+
}
|
|
422
342
|
};
|
|
423
343
|
function setDisplay(el, value) {
|
|
424
|
-
|
|
425
|
-
|
|
344
|
+
el.style.display = value ? el[vShowOriginalDisplay] : "none";
|
|
345
|
+
el[vShowHidden] = !value;
|
|
426
346
|
}
|
|
427
347
|
function initVShowForSSR() {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
}
|
|
432
|
-
};
|
|
348
|
+
vShow.getSSRProps = ({ value }) => {
|
|
349
|
+
if (!value) return { style: { display: "none" } };
|
|
350
|
+
};
|
|
433
351
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region packages/runtime-dom/src/helpers/useCssVars.ts
|
|
354
|
+
const CSS_VAR_TEXT = Symbol("");
|
|
355
|
+
/**
|
|
356
|
+
* Runtime helper for SFC's CSS variable injection feature.
|
|
357
|
+
* @private
|
|
358
|
+
*/
|
|
359
|
+
function useCssVars(getter) {}
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region packages/runtime-dom/src/modules/style.ts
|
|
440
362
|
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
441
363
|
function patchStyle(el, prev, next) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
const cssVarText = style[CSS_VAR_TEXT];
|
|
472
|
-
if (cssVarText) {
|
|
473
|
-
next += ";" + cssVarText;
|
|
474
|
-
}
|
|
475
|
-
style.cssText = next;
|
|
476
|
-
hasControlledDisplay = displayRE.test(next);
|
|
477
|
-
}
|
|
478
|
-
} else if (prev) {
|
|
479
|
-
el.removeAttribute("style");
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
if (vShowOriginalDisplay in el) {
|
|
483
|
-
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
484
|
-
if (el[vShowHidden]) {
|
|
485
|
-
style.display = "none";
|
|
486
|
-
}
|
|
487
|
-
}
|
|
364
|
+
const style = el.style;
|
|
365
|
+
const isCssString = (0, _vue_shared.isString)(next);
|
|
366
|
+
let hasControlledDisplay = false;
|
|
367
|
+
if (next && !isCssString) {
|
|
368
|
+
if (prev) if (!(0, _vue_shared.isString)(prev)) {
|
|
369
|
+
for (const key in prev) if (next[key] == null) setStyle(style, key, "");
|
|
370
|
+
} else for (const prevStyle of prev.split(";")) {
|
|
371
|
+
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
|
|
372
|
+
if (next[key] == null) setStyle(style, key, "");
|
|
373
|
+
}
|
|
374
|
+
for (const key in next) {
|
|
375
|
+
if (key === "display") hasControlledDisplay = true;
|
|
376
|
+
const value = next[key];
|
|
377
|
+
if (value != null) {
|
|
378
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !(0, _vue_shared.isString)(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
379
|
+
} else setStyle(style, key, "");
|
|
380
|
+
}
|
|
381
|
+
} else if (isCssString) {
|
|
382
|
+
if (prev !== next) {
|
|
383
|
+
const cssVarText = style[CSS_VAR_TEXT];
|
|
384
|
+
if (cssVarText) next += ";" + cssVarText;
|
|
385
|
+
style.cssText = next;
|
|
386
|
+
hasControlledDisplay = displayRE.test(next);
|
|
387
|
+
}
|
|
388
|
+
} else if (prev) el.removeAttribute("style");
|
|
389
|
+
if (vShowOriginalDisplay in el) {
|
|
390
|
+
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
391
|
+
if (el[vShowHidden]) style.display = "none";
|
|
392
|
+
}
|
|
488
393
|
}
|
|
489
394
|
const importantRE = /\s*!important$/;
|
|
490
395
|
function setStyle(style, name, rawVal) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
shared.hyphenate(prefixed),
|
|
502
|
-
val.replace(importantRE, ""),
|
|
503
|
-
"important"
|
|
504
|
-
);
|
|
505
|
-
} else {
|
|
506
|
-
style[prefixed] = val;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}
|
|
396
|
+
if ((0, _vue_shared.isArray)(rawVal)) rawVal.forEach((v) => setStyle(style, name, v));
|
|
397
|
+
else {
|
|
398
|
+
const val = rawVal == null ? "" : String(rawVal);
|
|
399
|
+
if (name.startsWith("--")) style.setProperty(name, val);
|
|
400
|
+
else {
|
|
401
|
+
const prefixed = autoPrefix(style, name);
|
|
402
|
+
if (importantRE.test(val)) style.setProperty((0, _vue_shared.hyphenate)(prefixed), val.replace(importantRE, ""), "important");
|
|
403
|
+
else style[prefixed] = val;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
510
406
|
}
|
|
511
|
-
const prefixes = [
|
|
407
|
+
const prefixes = [
|
|
408
|
+
"Webkit",
|
|
409
|
+
"Moz",
|
|
410
|
+
"ms"
|
|
411
|
+
];
|
|
512
412
|
const prefixCache = {};
|
|
513
413
|
function autoPrefix(style, rawName) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
const prefixed = prefixes[i] + name;
|
|
525
|
-
if (prefixed in style) {
|
|
526
|
-
return prefixCache[rawName] = prefixed;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
return rawName;
|
|
414
|
+
const cached = prefixCache[rawName];
|
|
415
|
+
if (cached) return cached;
|
|
416
|
+
let name = (0, _vue_runtime_core.camelize)(rawName);
|
|
417
|
+
if (name !== "filter" && name in style) return prefixCache[rawName] = name;
|
|
418
|
+
name = (0, _vue_shared.capitalize)(name);
|
|
419
|
+
for (let i = 0; i < prefixes.length; i++) {
|
|
420
|
+
const prefixed = prefixes[i] + name;
|
|
421
|
+
if (prefixed in style) return prefixCache[rawName] = prefixed;
|
|
422
|
+
}
|
|
423
|
+
return rawName;
|
|
530
424
|
}
|
|
531
|
-
|
|
425
|
+
/**
|
|
426
|
+
* Browsers update textarea width/height directly during native resize.
|
|
427
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
428
|
+
* still follow normal vnode style patching.
|
|
429
|
+
*/
|
|
430
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
431
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && (0, _vue_shared.isString)(next) && prev === next;
|
|
432
|
+
}
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
532
435
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
533
|
-
function patchAttr(el, key, value, isSVG, instance, isBoolean =
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
el.setAttributeNS(xlinkNS, key, value);
|
|
539
|
-
}
|
|
540
|
-
} else {
|
|
541
|
-
if (value == null || isBoolean && !shared.includeBooleanAttr(value)) {
|
|
542
|
-
el.removeAttribute(key);
|
|
543
|
-
} else {
|
|
544
|
-
el.setAttribute(
|
|
545
|
-
key,
|
|
546
|
-
isBoolean ? "" : shared.isSymbol(value) ? String(value) : value
|
|
547
|
-
);
|
|
548
|
-
}
|
|
549
|
-
}
|
|
436
|
+
function patchAttr(el, key, value, isSVG, instance, isBoolean = (0, _vue_shared.isSpecialBooleanAttr)(key)) {
|
|
437
|
+
if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
438
|
+
else el.setAttributeNS(xlinkNS, key, value);
|
|
439
|
+
else if (value == null || isBoolean && !(0, _vue_shared.includeBooleanAttr)(value)) el.removeAttribute(key);
|
|
440
|
+
else el.setAttribute(key, isBoolean ? "" : (0, _vue_shared.isSymbol)(value) ? String(value) : value);
|
|
550
441
|
}
|
|
551
|
-
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region packages/runtime-dom/src/modules/props.ts
|
|
552
444
|
function patchDOMProp(el, key, value, parentComponent, attrName) {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
value = "";
|
|
583
|
-
needRemove = true;
|
|
584
|
-
} else if (type === "number") {
|
|
585
|
-
value = 0;
|
|
586
|
-
needRemove = true;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
try {
|
|
590
|
-
el[key] = value;
|
|
591
|
-
} catch (e) {
|
|
592
|
-
}
|
|
593
|
-
needRemove && el.removeAttribute(attrName || key);
|
|
445
|
+
if (key === "innerHTML" || key === "textContent") {
|
|
446
|
+
if (value != null) el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
const tag = el.tagName;
|
|
450
|
+
if (key === "value" && (0, _vue_shared.canSetValueDirectly)(tag)) {
|
|
451
|
+
const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
|
|
452
|
+
const newValue = value == null ? el.type === "checkbox" ? "on" : "" : String(value);
|
|
453
|
+
if (oldValue !== newValue || !("_value" in el)) el.value = newValue;
|
|
454
|
+
if (value == null) el.removeAttribute(key);
|
|
455
|
+
el._value = value;
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
let needRemove = false;
|
|
459
|
+
if (value === "" || value == null) {
|
|
460
|
+
const type = typeof el[key];
|
|
461
|
+
if (type === "boolean") value = (0, _vue_shared.includeBooleanAttr)(value);
|
|
462
|
+
else if (value == null && type === "string") {
|
|
463
|
+
value = "";
|
|
464
|
+
needRemove = true;
|
|
465
|
+
} else if (type === "number") {
|
|
466
|
+
value = 0;
|
|
467
|
+
needRemove = true;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
try {
|
|
471
|
+
el[key] = value;
|
|
472
|
+
} catch (e) {}
|
|
473
|
+
needRemove && el.removeAttribute(attrName || key);
|
|
594
474
|
}
|
|
595
|
-
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region packages/runtime-dom/src/modules/events.ts
|
|
596
477
|
function addEventListener(el, event, handler, options) {
|
|
597
|
-
|
|
478
|
+
el.addEventListener(event, handler, options);
|
|
598
479
|
}
|
|
599
480
|
function removeEventListener(el, event, handler, options) {
|
|
600
|
-
|
|
481
|
+
el.removeEventListener(event, handler, options);
|
|
601
482
|
}
|
|
602
|
-
const veiKey =
|
|
483
|
+
const veiKey = Symbol("_vei");
|
|
603
484
|
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
addEventListener(el, name, invoker, options);
|
|
616
|
-
} else if (existingInvoker) {
|
|
617
|
-
removeEventListener(el, name, existingInvoker, options);
|
|
618
|
-
invokers[rawName] = void 0;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
485
|
+
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
486
|
+
const existingInvoker = invokers[rawName];
|
|
487
|
+
if (nextValue && existingInvoker) existingInvoker.value = nextValue;
|
|
488
|
+
else {
|
|
489
|
+
const [name, options] = parseName(rawName);
|
|
490
|
+
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(nextValue, instance), options);
|
|
491
|
+
else if (existingInvoker) {
|
|
492
|
+
removeEventListener(el, name, existingInvoker, options);
|
|
493
|
+
invokers[rawName] = void 0;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
621
496
|
}
|
|
622
497
|
const optionsModifierRE = /(?:Once|Passive|Capture)$/;
|
|
623
498
|
function parseName(name) {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
return [event, options];
|
|
499
|
+
let options;
|
|
500
|
+
if (optionsModifierRE.test(name)) {
|
|
501
|
+
options = {};
|
|
502
|
+
let m;
|
|
503
|
+
while (m = name.match(optionsModifierRE)) {
|
|
504
|
+
name = name.slice(0, name.length - m[0].length);
|
|
505
|
+
options[m[0].toLowerCase()] = true;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return [name[2] === ":" ? name.slice(3) : (0, _vue_shared.hyphenate)(name.slice(2)), options];
|
|
635
509
|
}
|
|
636
510
|
let cachedNow = 0;
|
|
637
511
|
const p = /* @__PURE__ */ Promise.resolve();
|
|
638
512
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
|
|
639
513
|
function createInvoker(initialValue, instance) {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
instance,
|
|
649
|
-
5,
|
|
650
|
-
[e]
|
|
651
|
-
);
|
|
652
|
-
};
|
|
653
|
-
invoker.value = initialValue;
|
|
654
|
-
invoker.attached = getNow();
|
|
655
|
-
return invoker;
|
|
514
|
+
const invoker = (e) => {
|
|
515
|
+
if (!e._vts) e._vts = Date.now();
|
|
516
|
+
else if (e._vts <= invoker.attached) return;
|
|
517
|
+
(0, _vue_runtime_core.callWithAsyncErrorHandling)(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
|
|
518
|
+
};
|
|
519
|
+
invoker.value = initialValue;
|
|
520
|
+
invoker.attached = getNow();
|
|
521
|
+
return invoker;
|
|
656
522
|
}
|
|
657
523
|
function patchStopImmediatePropagation(e, value) {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
);
|
|
667
|
-
} else {
|
|
668
|
-
return value;
|
|
669
|
-
}
|
|
524
|
+
if ((0, _vue_shared.isArray)(value)) {
|
|
525
|
+
const originalStop = e.stopImmediatePropagation;
|
|
526
|
+
e.stopImmediatePropagation = () => {
|
|
527
|
+
originalStop.call(e);
|
|
528
|
+
e._stopped = true;
|
|
529
|
+
};
|
|
530
|
+
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
531
|
+
} else return value;
|
|
670
532
|
}
|
|
671
|
-
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region packages/runtime-dom/src/patchProp.ts
|
|
672
535
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
} else if (
|
|
688
|
-
// #11081 force set props for possible async custom element
|
|
689
|
-
el._isVueCE && (/[A-Z]/.test(key) || !shared.isString(nextValue))
|
|
690
|
-
) {
|
|
691
|
-
patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key);
|
|
692
|
-
} else {
|
|
693
|
-
if (key === "true-value") {
|
|
694
|
-
el._trueValue = nextValue;
|
|
695
|
-
} else if (key === "false-value") {
|
|
696
|
-
el._falseValue = nextValue;
|
|
697
|
-
}
|
|
698
|
-
patchAttr(el, key, nextValue, isSVG);
|
|
699
|
-
}
|
|
536
|
+
const isSVG = namespace === "svg";
|
|
537
|
+
if (key === "class") patchClass(el, nextValue, isSVG);
|
|
538
|
+
else if (key === "style") patchStyle(el, prevValue, nextValue);
|
|
539
|
+
else if ((0, _vue_shared.isOn)(key)) {
|
|
540
|
+
if (!(0, _vue_shared.isModelListener)(key)) patchEvent(el, key, prevValue, nextValue, parentComponent);
|
|
541
|
+
} else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
|
|
542
|
+
patchDOMProp(el, key, nextValue, parentComponent);
|
|
543
|
+
if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
|
|
544
|
+
} else if (el._isVueCE && (shouldSetAsPropForVueCE(el, key) || el._def.__asyncLoader && (/[A-Z]/.test(key) || !(0, _vue_shared.isString)(nextValue)))) patchDOMProp(el, (0, _vue_shared.camelize)(key), nextValue, parentComponent, key);
|
|
545
|
+
else {
|
|
546
|
+
if (key === "true-value") el._trueValue = nextValue;
|
|
547
|
+
else if (key === "false-value") el._falseValue = nextValue;
|
|
548
|
+
patchAttr(el, key, nextValue, isSVG, parentComponent);
|
|
549
|
+
}
|
|
700
550
|
};
|
|
701
551
|
function shouldSetAsProp(el, key, value, isSVG) {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
}
|
|
711
|
-
if (shared.shouldSetAsAttr(el.tagName, key)) {
|
|
712
|
-
return false;
|
|
713
|
-
}
|
|
714
|
-
if (shared.isNativeOn(key) && shared.isString(value)) {
|
|
715
|
-
return false;
|
|
716
|
-
}
|
|
717
|
-
return key in el;
|
|
552
|
+
if (isSVG) {
|
|
553
|
+
if (key === "innerHTML" || key === "textContent") return true;
|
|
554
|
+
if (key in el && (0, _vue_shared.isNativeOn)(key) && (0, _vue_shared.isFunction)(value)) return true;
|
|
555
|
+
return false;
|
|
556
|
+
}
|
|
557
|
+
if ((0, _vue_shared.shouldSetAsAttr)(el.tagName, key)) return false;
|
|
558
|
+
if ((0, _vue_shared.isNativeOn)(key) && (0, _vue_shared.isString)(value)) return false;
|
|
559
|
+
return key in el;
|
|
718
560
|
}
|
|
719
|
-
|
|
561
|
+
function shouldSetAsPropForVueCE(el, key) {
|
|
562
|
+
const props = el._def.props;
|
|
563
|
+
if (!props) return false;
|
|
564
|
+
const camelKey = (0, _vue_shared.camelize)(key);
|
|
565
|
+
return Array.isArray(props) ? props.some((prop) => (0, _vue_shared.camelize)(prop) === camelKey) : Object.keys(props).some((prop) => (0, _vue_shared.camelize)(prop) === camelKey);
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region packages/runtime-dom/src/apiCustomElement.ts
|
|
720
569
|
const REMOVAL = {};
|
|
721
|
-
|
|
570
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
722
571
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
572
|
+
let Comp = (0, _vue_runtime_core.defineComponent)(options, extraOptions);
|
|
573
|
+
if ((0, _vue_shared.isPlainObject)(Comp)) Comp = (0, _vue_shared.extend)({}, Comp, extraOptions);
|
|
574
|
+
class VueCustomElement extends VueElement {
|
|
575
|
+
constructor(initialProps) {
|
|
576
|
+
super(Comp, initialProps, _createApp);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
VueCustomElement.def = Comp;
|
|
580
|
+
return VueCustomElement;
|
|
732
581
|
}
|
|
733
|
-
const defineSSRCustomElement = (
|
|
734
|
-
|
|
582
|
+
const defineSSRCustomElement = ((options, extraOptions) => {
|
|
583
|
+
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
|
|
735
584
|
});
|
|
736
|
-
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
585
|
+
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {};
|
|
586
|
+
var VueElementBase = class VueElementBase extends BaseClass {
|
|
587
|
+
constructor(def, props = {}, createAppFn) {
|
|
588
|
+
super();
|
|
589
|
+
this._isVueCE = true;
|
|
590
|
+
this._instance = null;
|
|
591
|
+
this._app = null;
|
|
592
|
+
this._connected = false;
|
|
593
|
+
this._resolved = false;
|
|
594
|
+
this._numberProps = null;
|
|
595
|
+
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
596
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
597
|
+
this._patching = false;
|
|
598
|
+
this._dirty = false;
|
|
599
|
+
this._ob = null;
|
|
600
|
+
this._def = def;
|
|
601
|
+
this._props = props;
|
|
602
|
+
this._createApp = createAppFn;
|
|
603
|
+
this._nonce = def.nonce;
|
|
604
|
+
if (this._needsHydration()) this._root = this.shadowRoot;
|
|
605
|
+
else if (def.shadowRoot !== false) {
|
|
606
|
+
this.attachShadow((0, _vue_shared.extend)({}, def.shadowRootOptions, { mode: "open" }));
|
|
607
|
+
this._root = this.shadowRoot;
|
|
608
|
+
} else this._root = this;
|
|
609
|
+
}
|
|
610
|
+
connectedCallback() {
|
|
611
|
+
if (!this.isConnected) return;
|
|
612
|
+
if (!this.shadowRoot && !this._resolved) this._parseSlots();
|
|
613
|
+
this._connected = true;
|
|
614
|
+
let parent = this;
|
|
615
|
+
while (parent = parent && (parent.assignedSlot || parent.parentNode || parent.host)) if (parent instanceof VueElementBase) {
|
|
616
|
+
this._parent = parent;
|
|
617
|
+
break;
|
|
618
|
+
}
|
|
619
|
+
if (!this._instance) if (this._resolved) this._mountComponent(this._def);
|
|
620
|
+
else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
|
|
621
|
+
this._pendingResolve = void 0;
|
|
622
|
+
this._resolveDef();
|
|
623
|
+
});
|
|
624
|
+
else this._resolveDef();
|
|
625
|
+
}
|
|
626
|
+
disconnectedCallback() {
|
|
627
|
+
this._connected = false;
|
|
628
|
+
(0, _vue_runtime_core.nextTick)(() => {
|
|
629
|
+
if (!this._connected) {
|
|
630
|
+
if (this._ob) {
|
|
631
|
+
this._ob.disconnect();
|
|
632
|
+
this._ob = null;
|
|
633
|
+
}
|
|
634
|
+
this._unmount();
|
|
635
|
+
if (this._teleportTargets) {
|
|
636
|
+
this._teleportTargets.clear();
|
|
637
|
+
this._teleportTargets = void 0;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
_setParent(parent = this._parent) {
|
|
643
|
+
if (parent && this._instance) {
|
|
644
|
+
this._instance.parent = parent._instance;
|
|
645
|
+
this._inheritParentContext(parent);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
_inheritParentContext(parent = this._parent) {
|
|
649
|
+
if (parent && this._app) Object.setPrototypeOf(this._app._context.provides, parent._instance.provides);
|
|
650
|
+
}
|
|
651
|
+
_processMutations(mutations) {
|
|
652
|
+
for (const m of mutations) this._setAttr(m.attributeName);
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* resolve inner component definition (handle possible async component)
|
|
656
|
+
*/
|
|
657
|
+
_resolveDef() {
|
|
658
|
+
if (this._pendingResolve) return;
|
|
659
|
+
for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
|
|
660
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
661
|
+
this._ob.observe(this, { attributes: true });
|
|
662
|
+
const resolve = (def) => {
|
|
663
|
+
this._resolved = true;
|
|
664
|
+
this._pendingResolve = void 0;
|
|
665
|
+
const { props, styles } = def;
|
|
666
|
+
let numberProps;
|
|
667
|
+
if (props && !(0, _vue_shared.isArray)(props)) for (const key in props) {
|
|
668
|
+
const opt = props[key];
|
|
669
|
+
if (opt === Number || opt && opt.type === Number) {
|
|
670
|
+
if (key in this._props) this._props[key] = (0, _vue_shared.toNumber)(this._props[key]);
|
|
671
|
+
(numberProps || (numberProps = Object.create(null)))[(0, _vue_shared.camelize)(key)] = true;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
this._numberProps = numberProps;
|
|
675
|
+
this._resolveProps(def);
|
|
676
|
+
if (this.shadowRoot) this._applyStyles(styles);
|
|
677
|
+
this._mountComponent(def);
|
|
678
|
+
};
|
|
679
|
+
const asyncDef = this._def.__asyncLoader;
|
|
680
|
+
if (asyncDef) {
|
|
681
|
+
const { configureApp } = this._def;
|
|
682
|
+
this._pendingResolve = asyncDef().then((def) => {
|
|
683
|
+
def.configureApp = configureApp;
|
|
684
|
+
this._def = def;
|
|
685
|
+
resolve(def);
|
|
686
|
+
});
|
|
687
|
+
} else resolve(this._def);
|
|
688
|
+
}
|
|
689
|
+
_mountComponent(def) {
|
|
690
|
+
this._mount(def);
|
|
691
|
+
this._processExposed();
|
|
692
|
+
}
|
|
693
|
+
_processExposed() {
|
|
694
|
+
const exposed = this._instance && this._instance.exposed;
|
|
695
|
+
if (!exposed) return;
|
|
696
|
+
for (const key in exposed) if (!(0, _vue_shared.hasOwn)(this, key)) Object.defineProperty(this, key, { get: () => (0, _vue_runtime_core.unref)(exposed[key]) });
|
|
697
|
+
}
|
|
698
|
+
_processInstance() {
|
|
699
|
+
this._instance.ce = this;
|
|
700
|
+
this._instance.isCE = true;
|
|
701
|
+
const dispatch = (event, args) => {
|
|
702
|
+
this.dispatchEvent(new CustomEvent(event, (0, _vue_shared.isPlainObject)(args[0]) ? (0, _vue_shared.extend)({ detail: args }, args[0]) : { detail: args }));
|
|
703
|
+
};
|
|
704
|
+
this._instance.emit = (event, ...args) => {
|
|
705
|
+
dispatch(event, args);
|
|
706
|
+
if ((0, _vue_shared.hyphenate)(event) !== event) dispatch((0, _vue_shared.hyphenate)(event), args);
|
|
707
|
+
};
|
|
708
|
+
this._setParent();
|
|
709
|
+
}
|
|
710
|
+
_resolveProps(def) {
|
|
711
|
+
const { props } = def;
|
|
712
|
+
const declaredPropKeys = (0, _vue_shared.isArray)(props) ? props : Object.keys(props || {});
|
|
713
|
+
for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
|
|
714
|
+
for (const key of declaredPropKeys.map(_vue_shared.camelize)) Object.defineProperty(this, key, {
|
|
715
|
+
get() {
|
|
716
|
+
return this._getProp(key);
|
|
717
|
+
},
|
|
718
|
+
set(val) {
|
|
719
|
+
this._setProp(key, val, true, !this._patching);
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
_setAttr(key) {
|
|
724
|
+
if (key.startsWith("data-v-")) return;
|
|
725
|
+
const has = this.hasAttribute(key);
|
|
726
|
+
let value = has ? this.getAttribute(key) : REMOVAL;
|
|
727
|
+
const camelKey = (0, _vue_shared.camelize)(key);
|
|
728
|
+
if (has && this._numberProps && this._numberProps[camelKey]) value = (0, _vue_shared.toNumber)(value);
|
|
729
|
+
this._setProp(camelKey, value, false, true);
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* @internal
|
|
733
|
+
*/
|
|
734
|
+
_getProp(key) {
|
|
735
|
+
return this._props[key];
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* @internal
|
|
739
|
+
*/
|
|
740
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
741
|
+
if (val !== this._props[key]) {
|
|
742
|
+
this._dirty = true;
|
|
743
|
+
if (val === REMOVAL) delete this._props[key];
|
|
744
|
+
else {
|
|
745
|
+
this._props[key] = val;
|
|
746
|
+
if (key === "key" && this._app && this._app._ceVNode) this._app._ceVNode.key = val;
|
|
747
|
+
}
|
|
748
|
+
if (shouldUpdate && this._instance) this._update();
|
|
749
|
+
if (shouldReflect) {
|
|
750
|
+
const ob = this._ob;
|
|
751
|
+
if (ob) {
|
|
752
|
+
this._processMutations(ob.takeRecords());
|
|
753
|
+
ob.disconnect();
|
|
754
|
+
}
|
|
755
|
+
if (val === true) this.setAttribute((0, _vue_shared.hyphenate)(key), "");
|
|
756
|
+
else if (typeof val === "string" || typeof val === "number") this.setAttribute((0, _vue_shared.hyphenate)(key), val + "");
|
|
757
|
+
else if (!val) this.removeAttribute((0, _vue_shared.hyphenate)(key));
|
|
758
|
+
ob && ob.observe(this, { attributes: true });
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
_applyStyles(styles, owner, parentComp) {
|
|
763
|
+
if (!styles) return;
|
|
764
|
+
if (owner) {
|
|
765
|
+
if (owner === this._def || this._styleChildren.has(owner)) return;
|
|
766
|
+
this._styleChildren.add(owner);
|
|
767
|
+
}
|
|
768
|
+
const nonce = this._nonce;
|
|
769
|
+
const root = this.shadowRoot;
|
|
770
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
771
|
+
let last = null;
|
|
772
|
+
for (let i = styles.length - 1; i >= 0; i--) {
|
|
773
|
+
const s = document.createElement("style");
|
|
774
|
+
if (nonce) s.setAttribute("nonce", nonce);
|
|
775
|
+
s.textContent = styles[i];
|
|
776
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
777
|
+
last = s;
|
|
778
|
+
if (i === 0) {
|
|
779
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
780
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
_getStyleAnchor(comp) {
|
|
785
|
+
if (!comp) return null;
|
|
786
|
+
const anchor = this._styleAnchors.get(comp);
|
|
787
|
+
if (anchor && anchor.parentNode === this.shadowRoot) return anchor;
|
|
788
|
+
if (anchor) this._styleAnchors.delete(comp);
|
|
789
|
+
return null;
|
|
790
|
+
}
|
|
791
|
+
_getRootStyleInsertionAnchor(root) {
|
|
792
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
793
|
+
const node = root.childNodes[i];
|
|
794
|
+
if (!(node instanceof HTMLStyleElement)) return node;
|
|
795
|
+
}
|
|
796
|
+
return null;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Only called when shadowRoot is false
|
|
800
|
+
*/
|
|
801
|
+
_parseSlots() {
|
|
802
|
+
const slots = this._slots = {};
|
|
803
|
+
let n;
|
|
804
|
+
while (n = this.firstChild) {
|
|
805
|
+
const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
|
|
806
|
+
(slots[slotName] || (slots[slotName] = [])).push(n);
|
|
807
|
+
this.removeChild(n);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Only called when shadowRoot is false
|
|
812
|
+
*/
|
|
813
|
+
_renderSlots() {
|
|
814
|
+
const outlets = this._getSlots();
|
|
815
|
+
const scopeId = this._instance.type.__scopeId;
|
|
816
|
+
const slotReplacements = /* @__PURE__ */ new Map();
|
|
817
|
+
for (let i = 0; i < outlets.length; i++) {
|
|
818
|
+
const o = outlets[i];
|
|
819
|
+
const slotName = o.getAttribute("name") || "default";
|
|
820
|
+
const content = this._slots[slotName];
|
|
821
|
+
const parent = o.parentNode;
|
|
822
|
+
const replacementNodes = [];
|
|
823
|
+
if (content) for (const n of content) {
|
|
824
|
+
if (scopeId && n.nodeType === 1) {
|
|
825
|
+
const id = scopeId + "-s";
|
|
826
|
+
const walker = document.createTreeWalker(n, 1);
|
|
827
|
+
n.setAttribute(id, "");
|
|
828
|
+
let child;
|
|
829
|
+
while (child = walker.nextNode()) child.setAttribute(id, "");
|
|
830
|
+
}
|
|
831
|
+
parent.insertBefore(n, o);
|
|
832
|
+
replacementNodes.push(n);
|
|
833
|
+
}
|
|
834
|
+
else while (o.firstChild) {
|
|
835
|
+
const child = o.firstChild;
|
|
836
|
+
parent.insertBefore(child, o);
|
|
837
|
+
replacementNodes.push(child);
|
|
838
|
+
}
|
|
839
|
+
parent.removeChild(o);
|
|
840
|
+
slotReplacements.set(o, {
|
|
841
|
+
nodes: replacementNodes,
|
|
842
|
+
usedFallback: !content
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
this._updateSlotNodes(slotReplacements);
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* @internal
|
|
849
|
+
*/
|
|
850
|
+
_getSlots() {
|
|
851
|
+
const roots = [this];
|
|
852
|
+
if (this._teleportTargets) roots.push(...this._teleportTargets);
|
|
853
|
+
const slots = /* @__PURE__ */ new Set();
|
|
854
|
+
for (const root of roots) {
|
|
855
|
+
const found = root.querySelectorAll("slot");
|
|
856
|
+
for (let i = 0; i < found.length; i++) slots.add(found[i]);
|
|
857
|
+
}
|
|
858
|
+
return Array.from(slots);
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* @internal
|
|
862
|
+
*/
|
|
863
|
+
_injectChildStyle(comp, parentComp) {
|
|
864
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* @internal
|
|
868
|
+
*/
|
|
869
|
+
_beginPatch() {
|
|
870
|
+
this._patching = true;
|
|
871
|
+
this._dirty = false;
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* @internal
|
|
875
|
+
*/
|
|
876
|
+
_endPatch() {
|
|
877
|
+
this._patching = false;
|
|
878
|
+
if (this._dirty && this._instance) this._update();
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* @internal
|
|
882
|
+
*/
|
|
883
|
+
_hasShadowRoot() {
|
|
884
|
+
return this._def.shadowRoot !== false;
|
|
885
|
+
}
|
|
886
|
+
/**
|
|
887
|
+
* @internal
|
|
888
|
+
*/
|
|
889
|
+
_removeChildStyle(comp) {}
|
|
890
|
+
};
|
|
891
|
+
var VueElement = class extends VueElementBase {
|
|
892
|
+
constructor(def, props = {}, createAppFn = createApp) {
|
|
893
|
+
super(def, props, createAppFn);
|
|
894
|
+
}
|
|
895
|
+
_needsHydration() {
|
|
896
|
+
if (this.shadowRoot && this._createApp !== createApp) return true;
|
|
897
|
+
return false;
|
|
898
|
+
}
|
|
899
|
+
_mount(def) {
|
|
900
|
+
this._app = this._createApp(def);
|
|
901
|
+
this._inheritParentContext();
|
|
902
|
+
if (def.configureApp) def.configureApp(this._app);
|
|
903
|
+
this._app._ceVNode = this._createVNode();
|
|
904
|
+
this._app.mount(this._root);
|
|
905
|
+
}
|
|
906
|
+
_update() {
|
|
907
|
+
if (!this._app) return;
|
|
908
|
+
const vnode = this._createVNode();
|
|
909
|
+
vnode.appContext = this._app._context;
|
|
910
|
+
render(vnode, this._root);
|
|
911
|
+
}
|
|
912
|
+
_unmount() {
|
|
913
|
+
if (this._app) this._app.unmount();
|
|
914
|
+
if (this._instance && this._instance.ce) this._instance.ce = void 0;
|
|
915
|
+
this._app = this._instance = null;
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Only called when shadowRoot is false
|
|
919
|
+
*/
|
|
920
|
+
_updateSlotNodes(replacements) {}
|
|
921
|
+
_createVNode() {
|
|
922
|
+
const baseProps = {};
|
|
923
|
+
if (!this.shadowRoot) baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
|
|
924
|
+
const vnode = (0, _vue_runtime_core.createVNode)(this._def, (0, _vue_shared.extend)(baseProps, this._props));
|
|
925
|
+
if (!this._instance) vnode.ce = (instance) => {
|
|
926
|
+
this._instance = instance;
|
|
927
|
+
this._processInstance();
|
|
928
|
+
};
|
|
929
|
+
return vnode;
|
|
930
|
+
}
|
|
737
931
|
};
|
|
738
|
-
class VueElementBase extends BaseClass {
|
|
739
|
-
constructor(def, props = {}, createAppFn) {
|
|
740
|
-
super();
|
|
741
|
-
this._isVueCE = true;
|
|
742
|
-
/**
|
|
743
|
-
* @internal
|
|
744
|
-
*/
|
|
745
|
-
this._instance = null;
|
|
746
|
-
/**
|
|
747
|
-
* @internal
|
|
748
|
-
*/
|
|
749
|
-
this._app = null;
|
|
750
|
-
this._connected = false;
|
|
751
|
-
this._resolved = false;
|
|
752
|
-
this._numberProps = null;
|
|
753
|
-
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
754
|
-
this._patching = false;
|
|
755
|
-
this._dirty = false;
|
|
756
|
-
this._ob = null;
|
|
757
|
-
this._def = def;
|
|
758
|
-
this._props = props;
|
|
759
|
-
this._createApp = createAppFn;
|
|
760
|
-
this._nonce = def.nonce;
|
|
761
|
-
if (this._needsHydration()) {
|
|
762
|
-
this._root = this.shadowRoot;
|
|
763
|
-
} else {
|
|
764
|
-
if (def.shadowRoot !== false) {
|
|
765
|
-
this.attachShadow(
|
|
766
|
-
shared.extend({}, def.shadowRootOptions, {
|
|
767
|
-
mode: "open"
|
|
768
|
-
})
|
|
769
|
-
);
|
|
770
|
-
this._root = this.shadowRoot;
|
|
771
|
-
} else {
|
|
772
|
-
this._root = this;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
connectedCallback() {
|
|
777
|
-
if (!this.isConnected) return;
|
|
778
|
-
if (!this.shadowRoot && !this._resolved) {
|
|
779
|
-
this._parseSlots();
|
|
780
|
-
}
|
|
781
|
-
this._connected = true;
|
|
782
|
-
let parent = this;
|
|
783
|
-
while (parent = parent && (parent.parentNode || parent.host)) {
|
|
784
|
-
if (parent instanceof VueElementBase) {
|
|
785
|
-
this._parent = parent;
|
|
786
|
-
break;
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
if (!this._instance) {
|
|
790
|
-
if (this._resolved) {
|
|
791
|
-
this._mountComponent(this._def);
|
|
792
|
-
} else {
|
|
793
|
-
if (parent && parent._pendingResolve) {
|
|
794
|
-
this._pendingResolve = parent._pendingResolve.then(() => {
|
|
795
|
-
this._pendingResolve = void 0;
|
|
796
|
-
this._resolveDef();
|
|
797
|
-
});
|
|
798
|
-
} else {
|
|
799
|
-
this._resolveDef();
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
disconnectedCallback() {
|
|
805
|
-
this._connected = false;
|
|
806
|
-
runtimeCore.nextTick(() => {
|
|
807
|
-
if (!this._connected) {
|
|
808
|
-
if (this._ob) {
|
|
809
|
-
this._ob.disconnect();
|
|
810
|
-
this._ob = null;
|
|
811
|
-
}
|
|
812
|
-
this._unmount();
|
|
813
|
-
if (this._teleportTargets) {
|
|
814
|
-
this._teleportTargets.clear();
|
|
815
|
-
this._teleportTargets = void 0;
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
});
|
|
819
|
-
}
|
|
820
|
-
_setParent(parent = this._parent) {
|
|
821
|
-
if (parent && this._instance) {
|
|
822
|
-
this._instance.parent = parent._instance;
|
|
823
|
-
this._inheritParentContext(parent);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
_inheritParentContext(parent = this._parent) {
|
|
827
|
-
if (parent && this._app) {
|
|
828
|
-
Object.setPrototypeOf(
|
|
829
|
-
this._app._context.provides,
|
|
830
|
-
parent._instance.provides
|
|
831
|
-
);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
_processMutations(mutations) {
|
|
835
|
-
for (const m of mutations) {
|
|
836
|
-
this._setAttr(m.attributeName);
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
/**
|
|
840
|
-
* resolve inner component definition (handle possible async component)
|
|
841
|
-
*/
|
|
842
|
-
_resolveDef() {
|
|
843
|
-
if (this._pendingResolve) {
|
|
844
|
-
return;
|
|
845
|
-
}
|
|
846
|
-
for (let i = 0; i < this.attributes.length; i++) {
|
|
847
|
-
this._setAttr(this.attributes[i].name);
|
|
848
|
-
}
|
|
849
|
-
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
850
|
-
this._ob.observe(this, { attributes: true });
|
|
851
|
-
const resolve = (def) => {
|
|
852
|
-
this._resolved = true;
|
|
853
|
-
this._pendingResolve = void 0;
|
|
854
|
-
const { props, styles } = def;
|
|
855
|
-
let numberProps;
|
|
856
|
-
if (props && !shared.isArray(props)) {
|
|
857
|
-
for (const key in props) {
|
|
858
|
-
const opt = props[key];
|
|
859
|
-
if (opt === Number || opt && opt.type === Number) {
|
|
860
|
-
if (key in this._props) {
|
|
861
|
-
this._props[key] = shared.toNumber(this._props[key]);
|
|
862
|
-
}
|
|
863
|
-
(numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[shared.camelize(key)] = true;
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
this._numberProps = numberProps;
|
|
868
|
-
this._resolveProps(def);
|
|
869
|
-
if (this.shadowRoot) {
|
|
870
|
-
this._applyStyles(styles);
|
|
871
|
-
}
|
|
872
|
-
this._mountComponent(def);
|
|
873
|
-
};
|
|
874
|
-
const asyncDef = this._def.__asyncLoader;
|
|
875
|
-
if (asyncDef) {
|
|
876
|
-
const { configureApp } = this._def;
|
|
877
|
-
this._pendingResolve = asyncDef().then((def) => {
|
|
878
|
-
def.configureApp = configureApp;
|
|
879
|
-
this._def = def;
|
|
880
|
-
resolve(def);
|
|
881
|
-
});
|
|
882
|
-
} else {
|
|
883
|
-
resolve(this._def);
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
_mountComponent(def) {
|
|
887
|
-
this._mount(def);
|
|
888
|
-
this._processExposed();
|
|
889
|
-
}
|
|
890
|
-
_processExposed() {
|
|
891
|
-
const exposed = this._instance && this._instance.exposed;
|
|
892
|
-
if (!exposed) return;
|
|
893
|
-
for (const key in exposed) {
|
|
894
|
-
if (!shared.hasOwn(this, key)) {
|
|
895
|
-
Object.defineProperty(this, key, {
|
|
896
|
-
// unwrap ref to be consistent with public instance behavior
|
|
897
|
-
get: () => runtimeCore.unref(exposed[key])
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
_processInstance() {
|
|
903
|
-
this._instance.ce = this;
|
|
904
|
-
this._instance.isCE = true;
|
|
905
|
-
const dispatch = (event, args) => {
|
|
906
|
-
this.dispatchEvent(
|
|
907
|
-
new CustomEvent(
|
|
908
|
-
event,
|
|
909
|
-
shared.isPlainObject(args[0]) ? shared.extend({ detail: args }, args[0]) : { detail: args }
|
|
910
|
-
)
|
|
911
|
-
);
|
|
912
|
-
};
|
|
913
|
-
this._instance.emit = (event, ...args) => {
|
|
914
|
-
dispatch(event, args);
|
|
915
|
-
if (shared.hyphenate(event) !== event) {
|
|
916
|
-
dispatch(shared.hyphenate(event), args);
|
|
917
|
-
}
|
|
918
|
-
};
|
|
919
|
-
this._setParent();
|
|
920
|
-
}
|
|
921
|
-
_resolveProps(def) {
|
|
922
|
-
const { props } = def;
|
|
923
|
-
const declaredPropKeys = shared.isArray(props) ? props : Object.keys(props || {});
|
|
924
|
-
for (const key of Object.keys(this)) {
|
|
925
|
-
if (key[0] !== "_" && declaredPropKeys.includes(key)) {
|
|
926
|
-
this._setProp(key, this[key]);
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
for (const key of declaredPropKeys.map(shared.camelize)) {
|
|
930
|
-
Object.defineProperty(this, key, {
|
|
931
|
-
get() {
|
|
932
|
-
return this._getProp(key);
|
|
933
|
-
},
|
|
934
|
-
set(val) {
|
|
935
|
-
this._setProp(key, val, true, !this._patching);
|
|
936
|
-
}
|
|
937
|
-
});
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
_setAttr(key) {
|
|
941
|
-
if (key.startsWith("data-v-")) return;
|
|
942
|
-
const has = this.hasAttribute(key);
|
|
943
|
-
let value = has ? this.getAttribute(key) : REMOVAL;
|
|
944
|
-
const camelKey = shared.camelize(key);
|
|
945
|
-
if (has && this._numberProps && this._numberProps[camelKey]) {
|
|
946
|
-
value = shared.toNumber(value);
|
|
947
|
-
}
|
|
948
|
-
this._setProp(camelKey, value, false, true);
|
|
949
|
-
}
|
|
950
|
-
/**
|
|
951
|
-
* @internal
|
|
952
|
-
*/
|
|
953
|
-
_getProp(key) {
|
|
954
|
-
return this._props[key];
|
|
955
|
-
}
|
|
956
|
-
/**
|
|
957
|
-
* @internal
|
|
958
|
-
*/
|
|
959
|
-
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
960
|
-
if (val !== this._props[key]) {
|
|
961
|
-
this._dirty = true;
|
|
962
|
-
if (val === REMOVAL) {
|
|
963
|
-
delete this._props[key];
|
|
964
|
-
} else {
|
|
965
|
-
this._props[key] = val;
|
|
966
|
-
if (key === "key" && this._app && this._app._ceVNode) {
|
|
967
|
-
this._app._ceVNode.key = val;
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
if (shouldUpdate && this._instance) {
|
|
971
|
-
this._update();
|
|
972
|
-
}
|
|
973
|
-
if (shouldReflect) {
|
|
974
|
-
const ob = this._ob;
|
|
975
|
-
if (ob) {
|
|
976
|
-
this._processMutations(ob.takeRecords());
|
|
977
|
-
ob.disconnect();
|
|
978
|
-
}
|
|
979
|
-
if (val === true) {
|
|
980
|
-
this.setAttribute(shared.hyphenate(key), "");
|
|
981
|
-
} else if (typeof val === "string" || typeof val === "number") {
|
|
982
|
-
this.setAttribute(shared.hyphenate(key), val + "");
|
|
983
|
-
} else if (!val) {
|
|
984
|
-
this.removeAttribute(shared.hyphenate(key));
|
|
985
|
-
}
|
|
986
|
-
ob && ob.observe(this, { attributes: true });
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
_applyStyles(styles, owner) {
|
|
991
|
-
if (!styles) return;
|
|
992
|
-
if (owner) {
|
|
993
|
-
if (owner === this._def || this._styleChildren.has(owner)) {
|
|
994
|
-
return;
|
|
995
|
-
}
|
|
996
|
-
this._styleChildren.add(owner);
|
|
997
|
-
}
|
|
998
|
-
const nonce = this._nonce;
|
|
999
|
-
for (let i = styles.length - 1; i >= 0; i--) {
|
|
1000
|
-
const s = document.createElement("style");
|
|
1001
|
-
if (nonce) s.setAttribute("nonce", nonce);
|
|
1002
|
-
s.textContent = styles[i];
|
|
1003
|
-
this.shadowRoot.prepend(s);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
/**
|
|
1007
|
-
* Only called when shadowRoot is false
|
|
1008
|
-
*/
|
|
1009
|
-
_parseSlots() {
|
|
1010
|
-
const slots = this._slots = {};
|
|
1011
|
-
let n;
|
|
1012
|
-
while (n = this.firstChild) {
|
|
1013
|
-
const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
|
|
1014
|
-
(slots[slotName] || (slots[slotName] = [])).push(n);
|
|
1015
|
-
this.removeChild(n);
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
/**
|
|
1019
|
-
* Only called when shadowRoot is false
|
|
1020
|
-
*/
|
|
1021
|
-
_renderSlots() {
|
|
1022
|
-
const outlets = this._getSlots();
|
|
1023
|
-
const scopeId = this._instance.type.__scopeId;
|
|
1024
|
-
const slotReplacements = /* @__PURE__ */ new Map();
|
|
1025
|
-
for (let i = 0; i < outlets.length; i++) {
|
|
1026
|
-
const o = outlets[i];
|
|
1027
|
-
const slotName = o.getAttribute("name") || "default";
|
|
1028
|
-
const content = this._slots[slotName];
|
|
1029
|
-
const parent = o.parentNode;
|
|
1030
|
-
const replacementNodes = [];
|
|
1031
|
-
if (content) {
|
|
1032
|
-
for (const n of content) {
|
|
1033
|
-
if (scopeId && n.nodeType === 1) {
|
|
1034
|
-
const id = scopeId + "-s";
|
|
1035
|
-
const walker = document.createTreeWalker(n, 1);
|
|
1036
|
-
n.setAttribute(id, "");
|
|
1037
|
-
let child;
|
|
1038
|
-
while (child = walker.nextNode()) {
|
|
1039
|
-
child.setAttribute(id, "");
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
parent.insertBefore(n, o);
|
|
1043
|
-
replacementNodes.push(n);
|
|
1044
|
-
}
|
|
1045
|
-
} else {
|
|
1046
|
-
while (o.firstChild) {
|
|
1047
|
-
const child = o.firstChild;
|
|
1048
|
-
parent.insertBefore(child, o);
|
|
1049
|
-
replacementNodes.push(child);
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
parent.removeChild(o);
|
|
1053
|
-
slotReplacements.set(o, replacementNodes);
|
|
1054
|
-
}
|
|
1055
|
-
this._updateSlotNodes(slotReplacements);
|
|
1056
|
-
}
|
|
1057
|
-
/**
|
|
1058
|
-
* @internal
|
|
1059
|
-
*/
|
|
1060
|
-
_getSlots() {
|
|
1061
|
-
const roots = [this];
|
|
1062
|
-
if (this._teleportTargets) {
|
|
1063
|
-
roots.push(...this._teleportTargets);
|
|
1064
|
-
}
|
|
1065
|
-
const slots = /* @__PURE__ */ new Set();
|
|
1066
|
-
for (const root of roots) {
|
|
1067
|
-
const found = root.querySelectorAll("slot");
|
|
1068
|
-
for (let i = 0; i < found.length; i++) {
|
|
1069
|
-
slots.add(found[i]);
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
return Array.from(slots);
|
|
1073
|
-
}
|
|
1074
|
-
/**
|
|
1075
|
-
* @internal
|
|
1076
|
-
*/
|
|
1077
|
-
_injectChildStyle(comp) {
|
|
1078
|
-
this._applyStyles(comp.styles, comp);
|
|
1079
|
-
}
|
|
1080
|
-
/**
|
|
1081
|
-
* @internal
|
|
1082
|
-
*/
|
|
1083
|
-
_beginPatch() {
|
|
1084
|
-
this._patching = true;
|
|
1085
|
-
this._dirty = false;
|
|
1086
|
-
}
|
|
1087
|
-
/**
|
|
1088
|
-
* @internal
|
|
1089
|
-
*/
|
|
1090
|
-
_endPatch() {
|
|
1091
|
-
this._patching = false;
|
|
1092
|
-
if (this._dirty && this._instance) {
|
|
1093
|
-
this._update();
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
/**
|
|
1097
|
-
* @internal
|
|
1098
|
-
*/
|
|
1099
|
-
_removeChildStyle(comp) {
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
class VueElement extends VueElementBase {
|
|
1103
|
-
constructor(def, props = {}, createAppFn = createApp) {
|
|
1104
|
-
super(def, props, createAppFn);
|
|
1105
|
-
}
|
|
1106
|
-
_needsHydration() {
|
|
1107
|
-
if (this.shadowRoot && this._createApp !== createApp) {
|
|
1108
|
-
return true;
|
|
1109
|
-
}
|
|
1110
|
-
return false;
|
|
1111
|
-
}
|
|
1112
|
-
_mount(def) {
|
|
1113
|
-
this._app = this._createApp(def);
|
|
1114
|
-
this._inheritParentContext();
|
|
1115
|
-
if (def.configureApp) {
|
|
1116
|
-
def.configureApp(this._app);
|
|
1117
|
-
}
|
|
1118
|
-
this._app._ceVNode = this._createVNode();
|
|
1119
|
-
this._app.mount(this._root);
|
|
1120
|
-
}
|
|
1121
|
-
_update() {
|
|
1122
|
-
if (!this._app) return;
|
|
1123
|
-
const vnode = this._createVNode();
|
|
1124
|
-
vnode.appContext = this._app._context;
|
|
1125
|
-
render(vnode, this._root);
|
|
1126
|
-
}
|
|
1127
|
-
_unmount() {
|
|
1128
|
-
if (this._app) {
|
|
1129
|
-
this._app.unmount();
|
|
1130
|
-
}
|
|
1131
|
-
if (this._instance && this._instance.ce) {
|
|
1132
|
-
this._instance.ce = void 0;
|
|
1133
|
-
}
|
|
1134
|
-
this._app = this._instance = null;
|
|
1135
|
-
}
|
|
1136
|
-
/**
|
|
1137
|
-
* Only called when shadowRoot is false
|
|
1138
|
-
*/
|
|
1139
|
-
_updateSlotNodes(replacements) {
|
|
1140
|
-
}
|
|
1141
|
-
_createVNode() {
|
|
1142
|
-
const baseProps = {};
|
|
1143
|
-
if (!this.shadowRoot) {
|
|
1144
|
-
baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
|
|
1145
|
-
}
|
|
1146
|
-
const vnode = runtimeCore.createVNode(this._def, shared.extend(baseProps, this._props));
|
|
1147
|
-
if (!this._instance) {
|
|
1148
|
-
vnode.ce = (instance) => {
|
|
1149
|
-
this._instance = instance;
|
|
1150
|
-
this._processInstance();
|
|
1151
|
-
};
|
|
1152
|
-
}
|
|
1153
|
-
return vnode;
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
932
|
function useHost(caller) {
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
}
|
|
1162
|
-
return null;
|
|
933
|
+
const { hasInstance, value } = (0, _vue_runtime_core.useInstanceOption)("ce", true);
|
|
934
|
+
const el = value;
|
|
935
|
+
if (el) return el;
|
|
936
|
+
return null;
|
|
1163
937
|
}
|
|
938
|
+
/**
|
|
939
|
+
* Retrieve the shadowRoot of the current custom element. Only usable in setup()
|
|
940
|
+
* of a `defineCustomElement` component.
|
|
941
|
+
*/
|
|
1164
942
|
function useShadowRoot() {
|
|
1165
|
-
|
|
1166
|
-
|
|
943
|
+
const el = useHost();
|
|
944
|
+
return el && el.shadowRoot;
|
|
1167
945
|
}
|
|
1168
|
-
|
|
946
|
+
//#endregion
|
|
947
|
+
//#region packages/runtime-dom/src/helpers/useCssModule.ts
|
|
1169
948
|
function useCssModule(name = "$style") {
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
const mod = modules[name];
|
|
1180
|
-
if (!mod) {
|
|
1181
|
-
return shared.EMPTY_OBJ;
|
|
1182
|
-
}
|
|
1183
|
-
return mod;
|
|
1184
|
-
}
|
|
949
|
+
{
|
|
950
|
+
const { hasInstance, value: type } = (0, _vue_runtime_core.useInstanceOption)("type", true);
|
|
951
|
+
if (!hasInstance) return _vue_shared.EMPTY_OBJ;
|
|
952
|
+
const modules = type.__cssModules;
|
|
953
|
+
if (!modules) return _vue_shared.EMPTY_OBJ;
|
|
954
|
+
const mod = modules[name];
|
|
955
|
+
if (!mod) return _vue_shared.EMPTY_OBJ;
|
|
956
|
+
return mod;
|
|
957
|
+
}
|
|
1185
958
|
}
|
|
1186
|
-
|
|
959
|
+
//#endregion
|
|
960
|
+
//#region packages/runtime-dom/src/components/TransitionGroup.ts
|
|
1187
961
|
const positionMap = /* @__PURE__ */ new WeakMap();
|
|
1188
962
|
const newPositionMap = /* @__PURE__ */ new WeakMap();
|
|
1189
|
-
const moveCbKey =
|
|
1190
|
-
const enterCbKey =
|
|
963
|
+
const moveCbKey = Symbol("_moveCb");
|
|
964
|
+
const enterCbKey = Symbol("_enterCb");
|
|
965
|
+
/**
|
|
966
|
+
* Wrap logic that modifies TransitionGroup properties in a function
|
|
967
|
+
* so that it can be annotated as pure
|
|
968
|
+
*/
|
|
1191
969
|
const decorate = (t) => {
|
|
1192
|
-
|
|
1193
|
-
|
|
970
|
+
delete t.props.mode;
|
|
971
|
+
return t;
|
|
1194
972
|
};
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
state,
|
|
1245
|
-
instance
|
|
1246
|
-
)
|
|
1247
|
-
);
|
|
1248
|
-
positionMap.set(child, {
|
|
1249
|
-
left: child.el.offsetLeft,
|
|
1250
|
-
top: child.el.offsetTop
|
|
1251
|
-
});
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
children = slots.default ? runtimeCore.getTransitionRawChildren(slots.default()) : [];
|
|
1256
|
-
for (let i = 0; i < children.length; i++) {
|
|
1257
|
-
const child = children[i];
|
|
1258
|
-
if (child.key != null) {
|
|
1259
|
-
runtimeCore.setTransitionHooks(
|
|
1260
|
-
child,
|
|
1261
|
-
runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance)
|
|
1262
|
-
);
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
return runtimeCore.createVNode(tag, null, children);
|
|
1266
|
-
};
|
|
1267
|
-
}
|
|
973
|
+
const TransitionGroup = /* @__PURE__ */ decorate({
|
|
974
|
+
name: "TransitionGroup",
|
|
975
|
+
props: /* @__PURE__ */ (0, _vue_shared.extend)({}, TransitionPropsValidators, {
|
|
976
|
+
tag: String,
|
|
977
|
+
moveClass: String
|
|
978
|
+
}),
|
|
979
|
+
setup(props, { slots }) {
|
|
980
|
+
const instance = (0, _vue_runtime_core.getCurrentInstance)();
|
|
981
|
+
const state = (0, _vue_runtime_core.useTransitionState)();
|
|
982
|
+
let prevChildren;
|
|
983
|
+
let children;
|
|
984
|
+
(0, _vue_runtime_core.onUpdated)(() => {
|
|
985
|
+
if (!prevChildren.length) return;
|
|
986
|
+
const moveClass = props.moveClass || `${props.name || "v"}-move`;
|
|
987
|
+
if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
|
|
988
|
+
prevChildren = [];
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
|
|
992
|
+
prevChildren.forEach(recordPosition);
|
|
993
|
+
const movedChildren = prevChildren.filter(applyTranslation);
|
|
994
|
+
forceReflow(instance.vnode.el);
|
|
995
|
+
movedChildren.forEach((c) => {
|
|
996
|
+
const el = c.el;
|
|
997
|
+
handleMovedChildren(el, moveClass);
|
|
998
|
+
});
|
|
999
|
+
prevChildren = [];
|
|
1000
|
+
});
|
|
1001
|
+
return () => {
|
|
1002
|
+
const rawProps = (0, _vue_runtime_core.toRaw)(props);
|
|
1003
|
+
const cssTransitionProps = resolveTransitionProps(rawProps);
|
|
1004
|
+
let tag = rawProps.tag || _vue_runtime_core.Fragment;
|
|
1005
|
+
prevChildren = [];
|
|
1006
|
+
if (children) for (let i = 0; i < children.length; i++) {
|
|
1007
|
+
const child = children[i];
|
|
1008
|
+
if (child.el && child.el instanceof Element) {
|
|
1009
|
+
prevChildren.push(child);
|
|
1010
|
+
(0, _vue_runtime_core.setTransitionHooks)(child, (0, _vue_runtime_core.resolveTransitionHooks)(child, cssTransitionProps, state, instance));
|
|
1011
|
+
positionMap.set(child, getPosition(child.el));
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
children = slots.default ? (0, _vue_runtime_core.getTransitionRawChildren)(slots.default()) : [];
|
|
1015
|
+
for (let i = 0; i < children.length; i++) {
|
|
1016
|
+
const child = children[i];
|
|
1017
|
+
if (child.key != null) (0, _vue_runtime_core.setTransitionHooks)(child, (0, _vue_runtime_core.resolveTransitionHooks)(child, cssTransitionProps, state, instance));
|
|
1018
|
+
}
|
|
1019
|
+
return (0, _vue_runtime_core.createVNode)(tag, null, children);
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1268
1022
|
});
|
|
1269
|
-
const TransitionGroup = TransitionGroupImpl;
|
|
1270
1023
|
function callPendingCbs(el) {
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
}
|
|
1274
|
-
if (el[enterCbKey]) {
|
|
1275
|
-
el[enterCbKey]();
|
|
1276
|
-
}
|
|
1024
|
+
if (el[moveCbKey]) el[moveCbKey]();
|
|
1025
|
+
if (el[enterCbKey]) el[enterCbKey]();
|
|
1277
1026
|
}
|
|
1278
1027
|
function recordPosition(c) {
|
|
1279
|
-
|
|
1280
|
-
left: c.el.offsetLeft,
|
|
1281
|
-
top: c.el.offsetTop
|
|
1282
|
-
});
|
|
1028
|
+
newPositionMap.set(c, getPosition(c.el));
|
|
1283
1029
|
}
|
|
1284
1030
|
function applyTranslation(c) {
|
|
1285
|
-
|
|
1286
|
-
positionMap.get(c),
|
|
1287
|
-
newPositionMap.get(c),
|
|
1288
|
-
c.el
|
|
1289
|
-
)) {
|
|
1290
|
-
return c;
|
|
1291
|
-
}
|
|
1031
|
+
if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
|
|
1292
1032
|
}
|
|
1293
1033
|
function baseApplyTranslation(oldPos, newPos, el) {
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1034
|
+
const dx = oldPos.left - newPos.left;
|
|
1035
|
+
const dy = oldPos.top - newPos.top;
|
|
1036
|
+
if (dx || dy) {
|
|
1037
|
+
const s = el.style;
|
|
1038
|
+
const rect = el.getBoundingClientRect();
|
|
1039
|
+
let scaleX = 1;
|
|
1040
|
+
let scaleY = 1;
|
|
1041
|
+
if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
|
|
1042
|
+
if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
|
|
1043
|
+
if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
|
|
1044
|
+
if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
|
|
1045
|
+
if (Math.abs(scaleX - 1) < .01) scaleX = 1;
|
|
1046
|
+
if (Math.abs(scaleY - 1) < .01) scaleY = 1;
|
|
1047
|
+
s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
|
|
1048
|
+
s.transitionDuration = "0s";
|
|
1049
|
+
return true;
|
|
1050
|
+
}
|
|
1051
|
+
return false;
|
|
1052
|
+
}
|
|
1053
|
+
function getPosition(el) {
|
|
1054
|
+
const rect = el.getBoundingClientRect();
|
|
1055
|
+
return {
|
|
1056
|
+
left: rect.left,
|
|
1057
|
+
top: rect.top
|
|
1058
|
+
};
|
|
1303
1059
|
}
|
|
1304
1060
|
function hasCSSTransform(el, root, moveClass) {
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
container.removeChild(clone);
|
|
1318
|
-
return hasTransform;
|
|
1061
|
+
const clone = el.cloneNode();
|
|
1062
|
+
const _vtc = el[vtcKey];
|
|
1063
|
+
if (_vtc) _vtc.forEach((cls) => {
|
|
1064
|
+
cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
|
|
1065
|
+
});
|
|
1066
|
+
moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
|
|
1067
|
+
clone.style.display = "none";
|
|
1068
|
+
const container = root.nodeType === 1 ? root : root.parentNode;
|
|
1069
|
+
container.appendChild(clone);
|
|
1070
|
+
const { hasTransform } = getTransitionInfo(clone);
|
|
1071
|
+
container.removeChild(clone);
|
|
1072
|
+
return hasTransform;
|
|
1319
1073
|
}
|
|
1320
1074
|
const handleMovedChildren = (el, moveClass) => {
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
};
|
|
1334
|
-
el.addEventListener("transitionend", cb);
|
|
1075
|
+
const style = el.style;
|
|
1076
|
+
addTransitionClass(el, moveClass);
|
|
1077
|
+
style.transform = style.webkitTransform = style.transitionDuration = "";
|
|
1078
|
+
const cb = el[moveCbKey] = (e) => {
|
|
1079
|
+
if (e && e.target !== el) return;
|
|
1080
|
+
if (!e || e.propertyName.endsWith("transform")) {
|
|
1081
|
+
el.removeEventListener("transitionend", cb);
|
|
1082
|
+
el[moveCbKey] = null;
|
|
1083
|
+
removeTransitionClass(el, moveClass);
|
|
1084
|
+
}
|
|
1085
|
+
};
|
|
1086
|
+
el.addEventListener("transitionend", cb);
|
|
1335
1087
|
};
|
|
1336
|
-
|
|
1088
|
+
//#endregion
|
|
1089
|
+
//#region packages/runtime-dom/src/directives/vModel.ts
|
|
1337
1090
|
const getModelAssigner = (vnode) => {
|
|
1338
|
-
|
|
1339
|
-
|
|
1091
|
+
const fn = vnode.props["onUpdate:modelValue"] || false;
|
|
1092
|
+
return (0, _vue_shared.isArray)(fn) ? (value) => (0, _vue_shared.invokeArrayFns)(fn, value) : fn;
|
|
1340
1093
|
};
|
|
1341
1094
|
function onCompositionStart(e) {
|
|
1342
|
-
|
|
1095
|
+
e.target.composing = true;
|
|
1343
1096
|
}
|
|
1344
1097
|
function onCompositionEnd(e) {
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1098
|
+
const target = e.target;
|
|
1099
|
+
if (target.composing) {
|
|
1100
|
+
target.composing = false;
|
|
1101
|
+
target.dispatchEvent(new Event("input"));
|
|
1102
|
+
}
|
|
1350
1103
|
}
|
|
1351
|
-
const assignKey =
|
|
1104
|
+
const assignKey = Symbol("_assign");
|
|
1352
1105
|
const vModelText = {
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
el.value = value == null ? "" : value;
|
|
1365
|
-
},
|
|
1366
|
-
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
1367
|
-
el[assignKey] = getModelAssigner(vnode);
|
|
1368
|
-
vModelTextUpdate(el, oldValue, value, trim, number, lazy);
|
|
1369
|
-
}
|
|
1106
|
+
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
1107
|
+
el[assignKey] = getModelAssigner(vnode);
|
|
1108
|
+
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
1109
|
+
},
|
|
1110
|
+
mounted(el, { value }) {
|
|
1111
|
+
el.value = value == null ? "" : value;
|
|
1112
|
+
},
|
|
1113
|
+
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
1114
|
+
el[assignKey] = getModelAssigner(vnode);
|
|
1115
|
+
vModelTextUpdate(el, oldValue, value, trim, number, lazy);
|
|
1116
|
+
}
|
|
1370
1117
|
};
|
|
1371
1118
|
function castValue(value, trim, number) {
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1119
|
+
if (trim) value = value.trim();
|
|
1120
|
+
if (number) value = (0, _vue_shared.looseToNumber)(value);
|
|
1121
|
+
return value;
|
|
1375
1122
|
}
|
|
1123
|
+
/**
|
|
1124
|
+
* @internal
|
|
1125
|
+
*/
|
|
1376
1126
|
const vModelTextInit = (el, trim, number, lazy, set) => {
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
addEventListener(el, "compositionstart", onCompositionStart);
|
|
1390
|
-
addEventListener(el, "compositionend", onCompositionEnd);
|
|
1391
|
-
addEventListener(el, "change", onCompositionEnd);
|
|
1392
|
-
}
|
|
1127
|
+
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
1128
|
+
if (e.target.composing) return;
|
|
1129
|
+
(set || el[assignKey])(castValue(el.value, trim, number || el.type === "number"));
|
|
1130
|
+
});
|
|
1131
|
+
if (trim || number) addEventListener(el, "change", () => {
|
|
1132
|
+
el.value = castValue(el.value, trim, number || el.type === "number");
|
|
1133
|
+
});
|
|
1134
|
+
if (!lazy) {
|
|
1135
|
+
addEventListener(el, "compositionstart", onCompositionStart);
|
|
1136
|
+
addEventListener(el, "compositionend", onCompositionEnd);
|
|
1137
|
+
addEventListener(el, "change", onCompositionEnd);
|
|
1138
|
+
}
|
|
1393
1139
|
};
|
|
1140
|
+
/**
|
|
1141
|
+
* @internal
|
|
1142
|
+
*/
|
|
1394
1143
|
const vModelTextUpdate = (el, oldValue, value, trim, number, lazy) => {
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
if (trim && el.value.trim() === newValue) {
|
|
1406
|
-
return;
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
el.value = newValue;
|
|
1144
|
+
if (el.composing) return;
|
|
1145
|
+
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? (0, _vue_shared.looseToNumber)(el.value) : el.value;
|
|
1146
|
+
const newValue = value == null ? "" : value;
|
|
1147
|
+
if (elValue === newValue) return;
|
|
1148
|
+
const rootNode = el.getRootNode();
|
|
1149
|
+
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
|
|
1150
|
+
if (lazy && value === oldValue) return;
|
|
1151
|
+
if (trim && el.value.trim() === newValue) return;
|
|
1152
|
+
}
|
|
1153
|
+
el.value = newValue;
|
|
1410
1154
|
};
|
|
1411
1155
|
const vModelCheckbox = {
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
vnode.props.value
|
|
1425
|
-
);
|
|
1426
|
-
},
|
|
1427
|
-
beforeUpdate(el, binding, vnode) {
|
|
1428
|
-
el[assignKey] = getModelAssigner(vnode);
|
|
1429
|
-
vModelCheckboxUpdate(
|
|
1430
|
-
el,
|
|
1431
|
-
binding.oldValue,
|
|
1432
|
-
binding.value,
|
|
1433
|
-
vnode.props.value
|
|
1434
|
-
);
|
|
1435
|
-
}
|
|
1156
|
+
deep: true,
|
|
1157
|
+
created(el, _, vnode) {
|
|
1158
|
+
el[assignKey] = getModelAssigner(vnode);
|
|
1159
|
+
vModelCheckboxInit(el);
|
|
1160
|
+
},
|
|
1161
|
+
mounted(el, binding, vnode) {
|
|
1162
|
+
vModelCheckboxUpdate(el, binding.oldValue, binding.value, vnode.props.value);
|
|
1163
|
+
},
|
|
1164
|
+
beforeUpdate(el, binding, vnode) {
|
|
1165
|
+
el[assignKey] = getModelAssigner(vnode);
|
|
1166
|
+
vModelCheckboxUpdate(el, binding.oldValue, binding.value, vnode.props.value);
|
|
1167
|
+
}
|
|
1436
1168
|
};
|
|
1169
|
+
/**
|
|
1170
|
+
* @internal
|
|
1171
|
+
*/
|
|
1437
1172
|
const vModelCheckboxInit = (el, set) => {
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
}
|
|
1460
|
-
assign(cloned);
|
|
1461
|
-
} else {
|
|
1462
|
-
assign(getCheckboxValue(el, checked));
|
|
1463
|
-
}
|
|
1464
|
-
});
|
|
1173
|
+
addEventListener(el, "change", () => {
|
|
1174
|
+
const assign = set || el[assignKey];
|
|
1175
|
+
const modelValue = el._modelValue;
|
|
1176
|
+
const elementValue = getValue(el);
|
|
1177
|
+
const checked = el.checked;
|
|
1178
|
+
if ((0, _vue_shared.isArray)(modelValue)) {
|
|
1179
|
+
const index = (0, _vue_shared.looseIndexOf)(modelValue, elementValue);
|
|
1180
|
+
const found = index !== -1;
|
|
1181
|
+
if (checked && !found) assign(modelValue.concat(elementValue));
|
|
1182
|
+
else if (!checked && found) {
|
|
1183
|
+
const filtered = [...modelValue];
|
|
1184
|
+
filtered.splice(index, 1);
|
|
1185
|
+
assign(filtered);
|
|
1186
|
+
}
|
|
1187
|
+
} else if ((0, _vue_shared.isSet)(modelValue)) {
|
|
1188
|
+
const cloned = new Set(modelValue);
|
|
1189
|
+
if (checked) cloned.add(elementValue);
|
|
1190
|
+
else cloned.delete(elementValue);
|
|
1191
|
+
assign(cloned);
|
|
1192
|
+
} else assign(getCheckboxValue(el, checked));
|
|
1193
|
+
});
|
|
1465
1194
|
};
|
|
1195
|
+
/**
|
|
1196
|
+
* @internal
|
|
1197
|
+
*/
|
|
1466
1198
|
const vModelCheckboxUpdate = (el, oldValue, value, rawValue = getValue(el)) => {
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
}
|
|
1477
|
-
if (el.checked !== checked) {
|
|
1478
|
-
el.checked = checked;
|
|
1479
|
-
}
|
|
1199
|
+
el._modelValue = value;
|
|
1200
|
+
let checked;
|
|
1201
|
+
if ((0, _vue_shared.isArray)(value)) checked = (0, _vue_shared.looseIndexOf)(value, rawValue) > -1;
|
|
1202
|
+
else if ((0, _vue_shared.isSet)(value)) checked = value.has(rawValue);
|
|
1203
|
+
else {
|
|
1204
|
+
if (value === oldValue) return;
|
|
1205
|
+
checked = (0, _vue_shared.looseEqual)(value, getCheckboxValue(el, true));
|
|
1206
|
+
}
|
|
1207
|
+
if (el.checked !== checked) el.checked = checked;
|
|
1480
1208
|
};
|
|
1481
1209
|
const vModelRadio = {
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1210
|
+
created(el, { value }, vnode) {
|
|
1211
|
+
el.checked = (0, _vue_shared.looseEqual)(value, vnode.props.value);
|
|
1212
|
+
el[assignKey] = getModelAssigner(vnode);
|
|
1213
|
+
addEventListener(el, "change", () => {
|
|
1214
|
+
el[assignKey](getValue(el));
|
|
1215
|
+
});
|
|
1216
|
+
},
|
|
1217
|
+
beforeUpdate(el, { value, oldValue }, vnode) {
|
|
1218
|
+
el[assignKey] = getModelAssigner(vnode);
|
|
1219
|
+
if (value !== oldValue) el.checked = (0, _vue_shared.looseEqual)(value, vnode.props.value);
|
|
1220
|
+
}
|
|
1495
1221
|
};
|
|
1496
1222
|
const vModelSelect = {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
updated(el, { value }) {
|
|
1512
|
-
vModelSetSelected(el, value);
|
|
1513
|
-
}
|
|
1223
|
+
deep: true,
|
|
1224
|
+
created(el, { value, modifiers: { number } }, vnode) {
|
|
1225
|
+
vModelSelectInit(el, value, number);
|
|
1226
|
+
el[assignKey] = getModelAssigner(vnode);
|
|
1227
|
+
},
|
|
1228
|
+
mounted(el, { value }) {
|
|
1229
|
+
vModelSetSelected(el, value);
|
|
1230
|
+
},
|
|
1231
|
+
beforeUpdate(el, _binding, vnode) {
|
|
1232
|
+
el[assignKey] = getModelAssigner(vnode);
|
|
1233
|
+
},
|
|
1234
|
+
updated(el, { value }) {
|
|
1235
|
+
vModelSetSelected(el, value);
|
|
1236
|
+
}
|
|
1514
1237
|
};
|
|
1238
|
+
/**
|
|
1239
|
+
* @internal
|
|
1240
|
+
*/
|
|
1515
1241
|
const vModelSelectInit = (el, value, number, set) => {
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
runtimeCore.nextTick(() => {
|
|
1526
|
-
el._assigning = false;
|
|
1527
|
-
});
|
|
1528
|
-
});
|
|
1242
|
+
const isSetModel = (0, _vue_shared.isSet)(value);
|
|
1243
|
+
addEventListener(el, "change", () => {
|
|
1244
|
+
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? (0, _vue_shared.looseToNumber)(getValue(o)) : getValue(o));
|
|
1245
|
+
(set || el[assignKey])(el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]);
|
|
1246
|
+
el._assigning = true;
|
|
1247
|
+
(0, _vue_runtime_core.nextTick)(() => {
|
|
1248
|
+
el._assigning = false;
|
|
1249
|
+
});
|
|
1250
|
+
});
|
|
1529
1251
|
};
|
|
1252
|
+
/**
|
|
1253
|
+
* @internal
|
|
1254
|
+
*/
|
|
1530
1255
|
const vModelSetSelected = (el, value) => {
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
option.selected = value.has(optionValue);
|
|
1550
|
-
}
|
|
1551
|
-
} else if (shared.looseEqual(getValue(option), value)) {
|
|
1552
|
-
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
1553
|
-
return;
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
if (!isMultiple && el.selectedIndex !== -1) {
|
|
1557
|
-
el.selectedIndex = -1;
|
|
1558
|
-
}
|
|
1256
|
+
if (el._assigning) return;
|
|
1257
|
+
const isMultiple = el.multiple;
|
|
1258
|
+
const isArrayValue = (0, _vue_shared.isArray)(value);
|
|
1259
|
+
if (isMultiple && !isArrayValue && !(0, _vue_shared.isSet)(value)) return;
|
|
1260
|
+
for (let i = 0, l = el.options.length; i < l; i++) {
|
|
1261
|
+
const option = el.options[i];
|
|
1262
|
+
const optionValue = getValue(option);
|
|
1263
|
+
if (isMultiple) if (isArrayValue) {
|
|
1264
|
+
const optionType = typeof optionValue;
|
|
1265
|
+
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
1266
|
+
else option.selected = (0, _vue_shared.looseIndexOf)(value, optionValue) > -1;
|
|
1267
|
+
} else option.selected = value.has(optionValue);
|
|
1268
|
+
else if ((0, _vue_shared.looseEqual)(getValue(option), value)) {
|
|
1269
|
+
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
|
|
1559
1274
|
};
|
|
1275
|
+
/**
|
|
1276
|
+
* @internal retrieve raw value set via :value bindings
|
|
1277
|
+
*/
|
|
1560
1278
|
function getValue(el) {
|
|
1561
|
-
|
|
1279
|
+
return "_value" in el ? el._value : el.value;
|
|
1562
1280
|
}
|
|
1563
1281
|
function getCheckboxValue(el, checked) {
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
if (el.hasAttribute(attr)) {
|
|
1570
|
-
return el.getAttribute(attr);
|
|
1571
|
-
}
|
|
1572
|
-
return checked;
|
|
1282
|
+
const key = checked ? "_trueValue" : "_falseValue";
|
|
1283
|
+
if (key in el) return el[key];
|
|
1284
|
+
const attr = checked ? "true-value" : "false-value";
|
|
1285
|
+
if (el.hasAttribute(attr)) return el.getAttribute(attr);
|
|
1286
|
+
return checked;
|
|
1573
1287
|
}
|
|
1574
1288
|
const vModelDynamic = {
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1289
|
+
created(el, binding, vnode) {
|
|
1290
|
+
callModelHook(el, binding, vnode, null, "created");
|
|
1291
|
+
},
|
|
1292
|
+
mounted(el, binding, vnode) {
|
|
1293
|
+
callModelHook(el, binding, vnode, null, "mounted");
|
|
1294
|
+
},
|
|
1295
|
+
beforeUpdate(el, binding, vnode, prevVNode) {
|
|
1296
|
+
callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
|
|
1297
|
+
},
|
|
1298
|
+
updated(el, binding, vnode, prevVNode) {
|
|
1299
|
+
callModelHook(el, binding, vnode, prevVNode, "updated");
|
|
1300
|
+
}
|
|
1587
1301
|
};
|
|
1588
1302
|
function resolveDynamicModel(tagName, type) {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
case "radio":
|
|
1599
|
-
return vModelRadio;
|
|
1600
|
-
default:
|
|
1601
|
-
return vModelText;
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1303
|
+
switch (tagName) {
|
|
1304
|
+
case "SELECT": return vModelSelect;
|
|
1305
|
+
case "TEXTAREA": return vModelText;
|
|
1306
|
+
default: switch (type) {
|
|
1307
|
+
case "checkbox": return vModelCheckbox;
|
|
1308
|
+
case "radio": return vModelRadio;
|
|
1309
|
+
default: return vModelText;
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1604
1312
|
}
|
|
1605
1313
|
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
vnode.props && vnode.props.type
|
|
1609
|
-
);
|
|
1610
|
-
const fn = modelToUse[hook];
|
|
1611
|
-
fn && fn(el, binding, vnode, prevVNode);
|
|
1314
|
+
const fn = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type)[hook];
|
|
1315
|
+
fn && fn(el, binding, vnode, prevVNode);
|
|
1612
1316
|
}
|
|
1613
1317
|
function initVModelForSSR() {
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
return { checked: true };
|
|
1631
|
-
}
|
|
1632
|
-
};
|
|
1633
|
-
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
1634
|
-
if (typeof vnode.type !== "string") {
|
|
1635
|
-
return;
|
|
1636
|
-
}
|
|
1637
|
-
const modelToUse = resolveDynamicModel(
|
|
1638
|
-
// resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
|
|
1639
|
-
vnode.type.toUpperCase(),
|
|
1640
|
-
vnode.props && vnode.props.type
|
|
1641
|
-
);
|
|
1642
|
-
if (modelToUse.getSSRProps) {
|
|
1643
|
-
return modelToUse.getSSRProps(binding, vnode);
|
|
1644
|
-
}
|
|
1645
|
-
};
|
|
1318
|
+
vModelText.getSSRProps = ({ value }) => ({ value });
|
|
1319
|
+
vModelRadio.getSSRProps = ({ value }, vnode) => {
|
|
1320
|
+
if (vnode.props && (0, _vue_shared.looseEqual)(vnode.props.value, value)) return { checked: true };
|
|
1321
|
+
};
|
|
1322
|
+
vModelCheckbox.getSSRProps = ({ value }, vnode) => {
|
|
1323
|
+
if ((0, _vue_shared.isArray)(value)) {
|
|
1324
|
+
if (vnode.props && (0, _vue_shared.looseIndexOf)(value, vnode.props.value) > -1) return { checked: true };
|
|
1325
|
+
} else if ((0, _vue_shared.isSet)(value)) {
|
|
1326
|
+
if (vnode.props && value.has(vnode.props.value)) return { checked: true };
|
|
1327
|
+
} else if (value) return { checked: true };
|
|
1328
|
+
};
|
|
1329
|
+
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
1330
|
+
if (typeof vnode.type !== "string") return;
|
|
1331
|
+
const modelToUse = resolveDynamicModel(vnode.type.toUpperCase(), vnode.props && vnode.props.type);
|
|
1332
|
+
if (modelToUse.getSSRProps) return modelToUse.getSSRProps(binding, vnode);
|
|
1333
|
+
};
|
|
1646
1334
|
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1335
|
+
//#endregion
|
|
1336
|
+
//#region packages/runtime-dom/src/directives/vOn.ts
|
|
1337
|
+
const systemModifiers = [
|
|
1338
|
+
"ctrl",
|
|
1339
|
+
"shift",
|
|
1340
|
+
"alt",
|
|
1341
|
+
"meta"
|
|
1342
|
+
];
|
|
1649
1343
|
const modifierGuards = {
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1344
|
+
stop: (e) => e.stopPropagation(),
|
|
1345
|
+
prevent: (e) => e.preventDefault(),
|
|
1346
|
+
self: (e) => e.target !== e.currentTarget,
|
|
1347
|
+
ctrl: (e) => !e.ctrlKey,
|
|
1348
|
+
shift: (e) => !e.shiftKey,
|
|
1349
|
+
alt: (e) => !e.altKey,
|
|
1350
|
+
meta: (e) => !e.metaKey,
|
|
1351
|
+
left: (e) => "button" in e && e.button !== 0,
|
|
1352
|
+
middle: (e) => "button" in e && e.button !== 1,
|
|
1353
|
+
right: (e) => "button" in e && e.button !== 2,
|
|
1354
|
+
exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
|
|
1661
1355
|
};
|
|
1356
|
+
/**
|
|
1357
|
+
* @private
|
|
1358
|
+
*/
|
|
1662
1359
|
const withModifiers = (fn, modifiers) => {
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1360
|
+
if (!fn) return fn;
|
|
1361
|
+
const cache = fn._withMods || (fn._withMods = {});
|
|
1362
|
+
const cacheKey = modifiers.join(".");
|
|
1363
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|
|
1364
|
+
for (let i = 0; i < modifiers.length; i++) {
|
|
1365
|
+
const guard = modifierGuards[modifiers[i]];
|
|
1366
|
+
if (guard && guard(event, modifiers)) return;
|
|
1367
|
+
}
|
|
1368
|
+
return fn(event, ...args);
|
|
1369
|
+
}));
|
|
1672
1370
|
};
|
|
1673
1371
|
const keyNames = {
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1372
|
+
esc: "escape",
|
|
1373
|
+
space: " ",
|
|
1374
|
+
up: "arrow-up",
|
|
1375
|
+
left: "arrow-left",
|
|
1376
|
+
right: "arrow-right",
|
|
1377
|
+
down: "arrow-down",
|
|
1378
|
+
delete: "backspace"
|
|
1681
1379
|
};
|
|
1380
|
+
/**
|
|
1381
|
+
* @private
|
|
1382
|
+
*/
|
|
1682
1383
|
const withKeys = (fn, modifiers) => {
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
if (modifiers.some(
|
|
1691
|
-
(k) => k === eventKey || keyNames[k] === eventKey
|
|
1692
|
-
)) {
|
|
1693
|
-
return fn(event);
|
|
1694
|
-
}
|
|
1695
|
-
}));
|
|
1384
|
+
const cache = fn._withKeys || (fn._withKeys = {});
|
|
1385
|
+
const cacheKey = modifiers.join(".");
|
|
1386
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event) => {
|
|
1387
|
+
if (!("key" in event)) return;
|
|
1388
|
+
const eventKey = (0, _vue_shared.hyphenate)(event.key);
|
|
1389
|
+
if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) return fn(event);
|
|
1390
|
+
}));
|
|
1696
1391
|
};
|
|
1697
|
-
|
|
1698
|
-
|
|
1392
|
+
//#endregion
|
|
1393
|
+
//#region packages/runtime-dom/src/index.ts
|
|
1394
|
+
const rendererOptions = /* @__PURE__ */ (0, _vue_shared.extend)({ patchProp }, nodeOps);
|
|
1699
1395
|
let renderer;
|
|
1700
1396
|
let enabledHydration = false;
|
|
1701
1397
|
function ensureRenderer() {
|
|
1702
|
-
|
|
1398
|
+
return renderer || (renderer = (0, _vue_runtime_core.createRenderer)(rendererOptions));
|
|
1703
1399
|
}
|
|
1704
1400
|
function ensureHydrationRenderer() {
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1401
|
+
renderer = enabledHydration ? renderer : (0, _vue_runtime_core.createHydrationRenderer)(rendererOptions);
|
|
1402
|
+
enabledHydration = true;
|
|
1403
|
+
return renderer;
|
|
1708
1404
|
}
|
|
1709
1405
|
const render = ((...args) => {
|
|
1710
|
-
|
|
1406
|
+
ensureRenderer().render(...args);
|
|
1711
1407
|
});
|
|
1712
1408
|
const hydrate = ((...args) => {
|
|
1713
|
-
|
|
1409
|
+
ensureHydrationRenderer().hydrate(...args);
|
|
1714
1410
|
});
|
|
1715
1411
|
const createApp = ((...args) => {
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
}
|
|
1733
|
-
return proxy;
|
|
1734
|
-
};
|
|
1735
|
-
return app;
|
|
1412
|
+
const app = ensureRenderer().createApp(...args);
|
|
1413
|
+
const { mount } = app;
|
|
1414
|
+
app.mount = (containerOrSelector) => {
|
|
1415
|
+
const container = normalizeContainer(containerOrSelector);
|
|
1416
|
+
if (!container) return;
|
|
1417
|
+
const component = app._component;
|
|
1418
|
+
if (!(0, _vue_shared.isFunction)(component) && !component.render && !component.template) component.template = container.innerHTML;
|
|
1419
|
+
if (container.nodeType === 1) container.textContent = "";
|
|
1420
|
+
const proxy = mount(container, false, resolveRootNamespace(container));
|
|
1421
|
+
if (container instanceof Element) {
|
|
1422
|
+
container.removeAttribute("v-cloak");
|
|
1423
|
+
container.setAttribute("data-v-app", "");
|
|
1424
|
+
}
|
|
1425
|
+
return proxy;
|
|
1426
|
+
};
|
|
1427
|
+
return app;
|
|
1736
1428
|
});
|
|
1737
1429
|
const createSSRApp = ((...args) => {
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
return app;
|
|
1430
|
+
(0, _vue_runtime_core.setIsHydratingEnabled)(true);
|
|
1431
|
+
const app = ensureHydrationRenderer().createApp(...args);
|
|
1432
|
+
const { mount } = app;
|
|
1433
|
+
app.mount = (containerOrSelector) => {
|
|
1434
|
+
const container = normalizeContainer(containerOrSelector);
|
|
1435
|
+
if (container) return mount(container, true, resolveRootNamespace(container));
|
|
1436
|
+
};
|
|
1437
|
+
return app;
|
|
1747
1438
|
});
|
|
1748
1439
|
function resolveRootNamespace(container) {
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
}
|
|
1752
|
-
if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
|
|
1753
|
-
return "mathml";
|
|
1754
|
-
}
|
|
1440
|
+
if (container instanceof SVGElement) return "svg";
|
|
1441
|
+
if (typeof MathMLElement === "function" && container instanceof MathMLElement) return "mathml";
|
|
1755
1442
|
}
|
|
1443
|
+
/**
|
|
1444
|
+
* @internal
|
|
1445
|
+
*/
|
|
1756
1446
|
function normalizeContainer(container) {
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
return res;
|
|
1760
|
-
}
|
|
1761
|
-
return container;
|
|
1447
|
+
if ((0, _vue_shared.isString)(container)) return document.querySelector(container);
|
|
1448
|
+
return container;
|
|
1762
1449
|
}
|
|
1763
1450
|
let ssrDirectiveInitialized = false;
|
|
1451
|
+
/**
|
|
1452
|
+
* @internal
|
|
1453
|
+
*/
|
|
1764
1454
|
const initDirectivesForSSR = () => {
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1455
|
+
if (!ssrDirectiveInitialized) {
|
|
1456
|
+
ssrDirectiveInitialized = true;
|
|
1457
|
+
initVModelForSSR();
|
|
1458
|
+
initVShowForSSR();
|
|
1459
|
+
}
|
|
1460
|
+
};
|
|
1461
|
+
//#endregion
|
|
1772
1462
|
exports.Transition = Transition;
|
|
1773
1463
|
exports.TransitionGroup = TransitionGroup;
|
|
1774
1464
|
exports.VueElement = VueElement;
|
|
@@ -1794,6 +1484,11 @@ exports.vModelText = vModelText;
|
|
|
1794
1484
|
exports.vShow = vShow;
|
|
1795
1485
|
exports.withKeys = withKeys;
|
|
1796
1486
|
exports.withModifiers = withModifiers;
|
|
1797
|
-
Object.keys(
|
|
1798
|
-
|
|
1487
|
+
Object.keys(_vue_runtime_core).forEach(function(k) {
|
|
1488
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
1489
|
+
enumerable: true,
|
|
1490
|
+
get: function() {
|
|
1491
|
+
return _vue_runtime_core[k];
|
|
1492
|
+
}
|
|
1493
|
+
});
|
|
1799
1494
|
});
|