|
|
@@ -14,6 +14,58 @@ function makeMap(str, expectsLowerCase) {
|
|
|
}
|
|
|
return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
|
|
|
}
|
|
|
+function normalizeStyle(value) {
|
|
|
+ if (isArray(value)) {
|
|
|
+ const res = {};
|
|
|
+ for (let i = 0; i < value.length; i++) {
|
|
|
+ const item = value[i];
|
|
|
+ const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
|
|
|
+ if (normalized) {
|
|
|
+ for (const key in normalized) {
|
|
|
+ res[key] = normalized[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ } else if (isString(value)) {
|
|
|
+ return value;
|
|
|
+ } else if (isObject(value)) {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+}
|
|
|
+const listDelimiterRE = /;(?![^(]*\))/g;
|
|
|
+const propertyDelimiterRE = /:([^]+)/;
|
|
|
+const styleCommentRE = /\/\*.*?\*\//gs;
|
|
|
+function parseStringStyle(cssText) {
|
|
|
+ const ret = {};
|
|
|
+ cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
|
+ if (item) {
|
|
|
+ const tmp = item.split(propertyDelimiterRE);
|
|
|
+ tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+function normalizeClass(value) {
|
|
|
+ let res = "";
|
|
|
+ if (isString(value)) {
|
|
|
+ res = value;
|
|
|
+ } else if (isArray(value)) {
|
|
|
+ for (let i = 0; i < value.length; i++) {
|
|
|
+ const normalized = normalizeClass(value[i]);
|
|
|
+ if (normalized) {
|
|
|
+ res += normalized + " ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (isObject(value)) {
|
|
|
+ for (const name in value) {
|
|
|
+ if (value[name]) {
|
|
|
+ res += name + " ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res.trim();
|
|
|
+}
|
|
|
const EMPTY_OBJ = Object.freeze({});
|
|
|
const EMPTY_ARR = Object.freeze([]);
|
|
|
const NOOP = () => {
|
|
|
@@ -82,8 +134,8 @@ const def = (obj, key, value) => {
|
|
|
});
|
|
|
};
|
|
|
const looseToNumber = (val) => {
|
|
|
- const n = parseFloat(val);
|
|
|
- return isNaN(n) ? val : n;
|
|
|
+ const n2 = parseFloat(val);
|
|
|
+ return isNaN(n2) ? val : n2;
|
|
|
};
|
|
|
const LINEFEED = "\n";
|
|
|
const SLOT_DEFAULT_NAME = "d";
|
|
|
@@ -269,8 +321,8 @@ const E = function() {
|
|
|
};
|
|
|
E.prototype = {
|
|
|
on: function(name, callback, ctx) {
|
|
|
- var e = this.e || (this.e = {});
|
|
|
- (e[name] || (e[name] = [])).push({
|
|
|
+ var e2 = this.e || (this.e = {});
|
|
|
+ (e2[name] || (e2[name] = [])).push({
|
|
|
fn: callback,
|
|
|
ctx
|
|
|
});
|
|
|
@@ -296,8 +348,8 @@ E.prototype = {
|
|
|
return this;
|
|
|
},
|
|
|
off: function(name, callback) {
|
|
|
- var e = this.e || (this.e = {});
|
|
|
- var evts = e[name];
|
|
|
+ var e2 = this.e || (this.e = {});
|
|
|
+ var evts = e2[name];
|
|
|
var liveEvents = [];
|
|
|
if (evts && callback) {
|
|
|
for (var i = 0, len = evts.length; i < len; i++) {
|
|
|
@@ -305,7 +357,7 @@ E.prototype = {
|
|
|
liveEvents.push(evts[i]);
|
|
|
}
|
|
|
}
|
|
|
- liveEvents.length ? e[name] = liveEvents : delete e[name];
|
|
|
+ liveEvents.length ? e2[name] = liveEvents : delete e2[name];
|
|
|
return this;
|
|
|
}
|
|
|
};
|
|
|
@@ -476,8 +528,8 @@ function tryCatch(fn) {
|
|
|
return function() {
|
|
|
try {
|
|
|
return fn.apply(fn, arguments);
|
|
|
- } catch (e) {
|
|
|
- console.error(e);
|
|
|
+ } catch (e2) {
|
|
|
+ console.error(e2);
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
@@ -659,8 +711,8 @@ function promisify$1(name, fn) {
|
|
|
if (hasCallback(args)) {
|
|
|
return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
|
|
|
}
|
|
|
- return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => {
|
|
|
- invokeApi(name, fn, extend(args, { success: resolve, fail: reject }), rest);
|
|
|
+ return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
|
|
|
+ invokeApi(name, fn, extend(args, { success: resolve2, fail: reject }), rest);
|
|
|
})));
|
|
|
};
|
|
|
}
|
|
|
@@ -901,7 +953,7 @@ const $off = defineSyncApi(API_OFF, (name, callback) => {
|
|
|
}
|
|
|
if (!isArray(name))
|
|
|
name = [name];
|
|
|
- name.forEach((n) => emitter.off(n, callback));
|
|
|
+ name.forEach((n2) => emitter.off(n2, callback));
|
|
|
}, OffProtocol);
|
|
|
const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
|
|
|
emitter.emit(name, ...args);
|
|
|
@@ -912,7 +964,7 @@ let enabled;
|
|
|
function normalizePushMessage(message) {
|
|
|
try {
|
|
|
return JSON.parse(message);
|
|
|
- } catch (e) {
|
|
|
+ } catch (e2) {
|
|
|
}
|
|
|
return message;
|
|
|
}
|
|
|
@@ -952,7 +1004,7 @@ function invokeGetPushCidCallbacks(cid2, errMsg) {
|
|
|
getPushCidCallbacks.length = 0;
|
|
|
}
|
|
|
const API_GET_PUSH_CLIENT_ID = "getPushClientId";
|
|
|
-const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve, reject }) => {
|
|
|
+const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve: resolve2, reject }) => {
|
|
|
Promise.resolve().then(() => {
|
|
|
if (typeof enabled === "undefined") {
|
|
|
enabled = false;
|
|
|
@@ -961,7 +1013,7 @@ const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve, re
|
|
|
}
|
|
|
getPushCidCallbacks.push((cid2, errMsg) => {
|
|
|
if (cid2) {
|
|
|
- resolve({ cid: cid2 });
|
|
|
+ resolve2({ cid: cid2 });
|
|
|
} else {
|
|
|
reject(errMsg);
|
|
|
}
|
|
|
@@ -1026,9 +1078,9 @@ function promisify(name, api) {
|
|
|
if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
|
|
|
return wrapperReturnValue(name, invokeApi(name, api, options, rest));
|
|
|
}
|
|
|
- return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => {
|
|
|
+ return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
|
|
|
invokeApi(name, api, extend({}, options, {
|
|
|
- success: resolve,
|
|
|
+ success: resolve2,
|
|
|
fail: reject
|
|
|
}), rest);
|
|
|
})));
|
|
|
@@ -2357,6 +2409,9 @@ function isShallow(value) {
|
|
|
/* ReactiveFlags.IS_SHALLOW */
|
|
|
]);
|
|
|
}
|
|
|
+function isProxy(value) {
|
|
|
+ return isReactive(value) || isReadonly(value);
|
|
|
+}
|
|
|
function toRaw(observed) {
|
|
|
const raw = observed && observed[
|
|
|
"__v_raw"
|
|
|
@@ -2792,8 +2847,8 @@ const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
|
let currentFlushPromise = null;
|
|
|
const RECURSION_LIMIT = 100;
|
|
|
function nextTick$1(fn) {
|
|
|
- const p = currentFlushPromise || resolvedPromise;
|
|
|
- return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
|
+ const p2 = currentFlushPromise || resolvedPromise;
|
|
|
+ return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
|
|
|
}
|
|
|
function findInsertionIndex(id) {
|
|
|
let start = flushIndex + 1;
|
|
|
@@ -3206,8 +3261,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
warn(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
|
|
|
}
|
|
|
}
|
|
|
- const warnInvalidSource = (s) => {
|
|
|
- warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`);
|
|
|
+ const warnInvalidSource = (s2) => {
|
|
|
+ warn(`Invalid watch source: `, s2, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`);
|
|
|
};
|
|
|
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
|
let getter;
|
|
|
@@ -3221,21 +3276,21 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
deep = true;
|
|
|
} else if (isArray(source)) {
|
|
|
isMultiSource = true;
|
|
|
- forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
|
|
|
- getter = () => source.map((s) => {
|
|
|
- if (isRef(s)) {
|
|
|
- return s.value;
|
|
|
- } else if (isReactive(s)) {
|
|
|
- return traverse(s);
|
|
|
- } else if (isFunction(s)) {
|
|
|
+ forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
|
|
|
+ getter = () => source.map((s2) => {
|
|
|
+ if (isRef(s2)) {
|
|
|
+ return s2.value;
|
|
|
+ } else if (isReactive(s2)) {
|
|
|
+ return traverse(s2);
|
|
|
+ } else if (isFunction(s2)) {
|
|
|
return callWithErrorHandling(
|
|
|
- s,
|
|
|
+ s2,
|
|
|
instance,
|
|
|
2
|
|
|
/* ErrorCodes.WATCH_GETTER */
|
|
|
);
|
|
|
} else {
|
|
|
- warnInvalidSource(s);
|
|
|
+ warnInvalidSource(s2);
|
|
|
}
|
|
|
});
|
|
|
} else if (isFunction(source)) {
|
|
|
@@ -3511,6 +3566,46 @@ function validateDirectiveName(name) {
|
|
|
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
|
}
|
|
|
}
|
|
|
+const COMPONENTS = "components";
|
|
|
+function resolveComponent(name, maybeSelfReference) {
|
|
|
+ return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
|
+}
|
|
|
+function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
|
+ const instance = currentRenderingInstance || currentInstance;
|
|
|
+ if (instance) {
|
|
|
+ const Component2 = instance.type;
|
|
|
+ if (type === COMPONENTS) {
|
|
|
+ const selfName = getComponentName(
|
|
|
+ Component2,
|
|
|
+ false
|
|
|
+ /* do not include inferred name to avoid breaking existing code */
|
|
|
+ );
|
|
|
+ if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
|
+ return Component2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const res = (
|
|
|
+ // local registration
|
|
|
+ // check instance[type] first which is resolved for options API
|
|
|
+ resolve(instance[type] || Component2[type], name) || // global registration
|
|
|
+ resolve(instance.appContext[type], name)
|
|
|
+ );
|
|
|
+ if (!res && maybeSelfReference) {
|
|
|
+ return Component2;
|
|
|
+ }
|
|
|
+ if (warnMissing && !res) {
|
|
|
+ const extra = type === COMPONENTS ? `
|
|
|
+If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
|
+ warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ } else {
|
|
|
+ warn(`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`);
|
|
|
+ }
|
|
|
+}
|
|
|
+function resolve(registry, name) {
|
|
|
+ return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
|
+}
|
|
|
const getPublicInstance = (i) => {
|
|
|
if (!i)
|
|
|
return null;
|
|
|
@@ -3550,9 +3645,9 @@ const PublicInstanceProxyHandlers = {
|
|
|
}
|
|
|
let normalizedProps;
|
|
|
if (key[0] !== "$") {
|
|
|
- const n = accessCache[key];
|
|
|
- if (n !== void 0) {
|
|
|
- switch (n) {
|
|
|
+ const n2 = accessCache[key];
|
|
|
+ if (n2 !== void 0) {
|
|
|
+ switch (n2) {
|
|
|
case 1:
|
|
|
return setupState[key];
|
|
|
case 2:
|
|
|
@@ -4652,6 +4747,12 @@ const Static = Symbol("Static");
|
|
|
function isVNode(value) {
|
|
|
return value ? value.__v_isVNode === true : false;
|
|
|
}
|
|
|
+const InternalObjectKey = `__vInternal`;
|
|
|
+function guardReactiveProps(props) {
|
|
|
+ if (!props)
|
|
|
+ return null;
|
|
|
+ return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
|
|
|
+}
|
|
|
const emptyAppContext = createAppContext();
|
|
|
let uid = 0;
|
|
|
function createComponentInstance(vnode, parent, suspense) {
|
|
|
@@ -4738,6 +4839,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
return instance;
|
|
|
}
|
|
|
let currentInstance = null;
|
|
|
+const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
|
const setCurrentInstance = (instance) => {
|
|
|
currentInstance = instance;
|
|
|
instance.scope.on();
|
|
|
@@ -5093,8 +5195,8 @@ function nextTick(instance, fn) {
|
|
|
_resolve(instance.proxy);
|
|
|
}
|
|
|
});
|
|
|
- return new Promise((resolve) => {
|
|
|
- _resolve = resolve;
|
|
|
+ return new Promise((resolve2) => {
|
|
|
+ _resolve = resolve2;
|
|
|
});
|
|
|
}
|
|
|
function clone(src, seen) {
|
|
|
@@ -5472,8 +5574,8 @@ function setupRenderEffect(instance) {
|
|
|
update.id = instance.uid;
|
|
|
toggleRecurse(instance, true);
|
|
|
{
|
|
|
- effect.onTrack = instance.rtc ? (e) => invokeArrayFns$1(instance.rtc, e) : void 0;
|
|
|
- effect.onTrigger = instance.rtg ? (e) => invokeArrayFns$1(instance.rtg, e) : void 0;
|
|
|
+ effect.onTrack = instance.rtc ? (e2) => invokeArrayFns$1(instance.rtc, e2) : void 0;
|
|
|
+ effect.onTrigger = instance.rtg ? (e2) => invokeArrayFns$1(instance.rtg, e2) : void 0;
|
|
|
update.ownerInstance = instance;
|
|
|
}
|
|
|
update();
|
|
|
@@ -5687,6 +5789,11 @@ function initApp(app) {
|
|
|
}
|
|
|
}
|
|
|
const propsCaches = /* @__PURE__ */ Object.create(null);
|
|
|
+function renderProps(props) {
|
|
|
+ const { uid: uid2, __counter } = getCurrentInstance();
|
|
|
+ const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
|
|
|
+ return uid2 + "," + propsId + "," + __counter;
|
|
|
+}
|
|
|
function pruneComponentPropsCache(uid2) {
|
|
|
delete propsCaches[uid2];
|
|
|
}
|
|
|
@@ -5727,6 +5834,116 @@ function getCreateApp() {
|
|
|
return my[method];
|
|
|
}
|
|
|
}
|
|
|
+function vOn(value, key) {
|
|
|
+ const instance = getCurrentInstance();
|
|
|
+ const ctx = instance.ctx;
|
|
|
+ const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq") && (isString(key) || typeof key === "number") ? "_" + key : "";
|
|
|
+ const name = "e" + instance.$ei++ + extraKey;
|
|
|
+ const mpInstance = ctx.$scope;
|
|
|
+ if (!value) {
|
|
|
+ delete mpInstance[name];
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+ const existingInvoker = mpInstance[name];
|
|
|
+ if (existingInvoker) {
|
|
|
+ existingInvoker.value = value;
|
|
|
+ } else {
|
|
|
+ mpInstance[name] = createInvoker(value, instance);
|
|
|
+ }
|
|
|
+ return name;
|
|
|
+}
|
|
|
+function createInvoker(initialValue, instance) {
|
|
|
+ const invoker = (e2) => {
|
|
|
+ patchMPEvent(e2);
|
|
|
+ let args = [e2];
|
|
|
+ if (e2.detail && e2.detail.__args__) {
|
|
|
+ args = e2.detail.__args__;
|
|
|
+ }
|
|
|
+ const eventValue = invoker.value;
|
|
|
+ const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
|
|
|
+ const eventTarget = e2.target;
|
|
|
+ const eventSync = eventTarget ? eventTarget.dataset ? eventTarget.dataset.eventsync === "true" : false : false;
|
|
|
+ if (bubbles.includes(e2.type) && !eventSync) {
|
|
|
+ setTimeout(invoke);
|
|
|
+ } else {
|
|
|
+ const res = invoke();
|
|
|
+ if (e2.type === "input" && (isArray(res) || isPromise(res))) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ invoker.value = initialValue;
|
|
|
+ return invoker;
|
|
|
+}
|
|
|
+const bubbles = [
|
|
|
+ // touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
|
|
|
+ // 'touchstart',
|
|
|
+ // 'touchmove',
|
|
|
+ // 'touchcancel',
|
|
|
+ // 'touchend',
|
|
|
+ "tap",
|
|
|
+ "longpress",
|
|
|
+ "longtap",
|
|
|
+ "transitionend",
|
|
|
+ "animationstart",
|
|
|
+ "animationiteration",
|
|
|
+ "animationend",
|
|
|
+ "touchforcechange"
|
|
|
+];
|
|
|
+function patchMPEvent(event) {
|
|
|
+ if (event.type && event.target) {
|
|
|
+ event.preventDefault = NOOP;
|
|
|
+ event.stopPropagation = NOOP;
|
|
|
+ event.stopImmediatePropagation = NOOP;
|
|
|
+ if (!hasOwn(event, "detail")) {
|
|
|
+ event.detail = {};
|
|
|
+ }
|
|
|
+ if (hasOwn(event, "markerId")) {
|
|
|
+ event.detail = typeof event.detail === "object" ? event.detail : {};
|
|
|
+ event.detail.markerId = event.markerId;
|
|
|
+ }
|
|
|
+ if (isPlainObject(event.detail) && hasOwn(event.detail, "checked") && !hasOwn(event.detail, "value")) {
|
|
|
+ event.detail.value = event.detail.checked;
|
|
|
+ }
|
|
|
+ if (isPlainObject(event.detail)) {
|
|
|
+ event.target = extend({}, event.target, event.detail);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+function patchStopImmediatePropagation(e2, value) {
|
|
|
+ if (isArray(value)) {
|
|
|
+ const originalStop = e2.stopImmediatePropagation;
|
|
|
+ e2.stopImmediatePropagation = () => {
|
|
|
+ originalStop && originalStop.call(e2);
|
|
|
+ e2._stopped = true;
|
|
|
+ };
|
|
|
+ return value.map((fn) => (e3) => !e3._stopped && fn(e3));
|
|
|
+ } else {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+}
|
|
|
+function stringifyStyle(value) {
|
|
|
+ if (isString(value)) {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ return stringify(normalizeStyle(value));
|
|
|
+}
|
|
|
+function stringify(styles) {
|
|
|
+ let ret = "";
|
|
|
+ if (!styles || isString(styles)) {
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ for (const key in styles) {
|
|
|
+ ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+const o = (value, key) => vOn(value, key);
|
|
|
+const s = (value) => stringifyStyle(value);
|
|
|
+const e = (target, ...sources) => extend(target, ...sources);
|
|
|
+const n = (value) => normalizeClass(value);
|
|
|
+const p = (props) => renderProps(props);
|
|
|
function createApp$1(rootComponent, rootProps = null) {
|
|
|
rootComponent && (rootComponent.mpType = "app");
|
|
|
return createVueApp(rootComponent, rootProps).use(plugin);
|
|
|
@@ -6526,3 +6743,11 @@ const createSubpackageApp = initCreateSubpackageApp();
|
|
|
}
|
|
|
exports._export_sfc = _export_sfc;
|
|
|
exports.createSSRApp = createSSRApp;
|
|
|
+exports.e = e;
|
|
|
+exports.index = index;
|
|
|
+exports.n = n;
|
|
|
+exports.o = o;
|
|
|
+exports.p = p;
|
|
|
+exports.ref = ref;
|
|
|
+exports.resolveComponent = resolveComponent;
|
|
|
+exports.s = s;
|