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