|
@@ -88,6 +88,37 @@ const looseToNumber = (val) => {
|
|
|
const n = parseFloat(val);
|
|
|
return isNaN(n) ? val : n;
|
|
|
};
|
|
|
+const toDisplayString = (val) => {
|
|
|
+ return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
|
|
|
+};
|
|
|
+const replacer = (_key, val) => {
|
|
|
+ if (val && val.__v_isRef) {
|
|
|
+ return replacer(_key, val.value);
|
|
|
+ } else if (isMap(val)) {
|
|
|
+ return {
|
|
|
+ [`Map(${val.size})`]: [...val.entries()].reduce(
|
|
|
+ (entries, [key, val2], i) => {
|
|
|
+ entries[stringifySymbol(key, i) + " =>"] = val2;
|
|
|
+ return entries;
|
|
|
+ },
|
|
|
+ {}
|
|
|
+ )
|
|
|
+ };
|
|
|
+ } else if (isSet(val)) {
|
|
|
+ return {
|
|
|
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
|
|
|
+ };
|
|
|
+ } else if (isSymbol(val)) {
|
|
|
+ return stringifySymbol(val);
|
|
|
+ } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
|
|
|
+ return String(val);
|
|
|
+ }
|
|
|
+ return val;
|
|
|
+};
|
|
|
+const stringifySymbol = (v, i = "") => {
|
|
|
+ var _a;
|
|
|
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
|
|
|
+};
|
|
|
const LOCALE_ZH_HANS = "zh-Hans";
|
|
|
const LOCALE_ZH_HANT = "zh-Hant";
|
|
|
const LOCALE_EN = "en";
|
|
@@ -4931,6 +4962,135 @@ 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" || ctx.$mpPlatform === "mp-xhs") && (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 (instance && instance.ctx.$getTriggerEventDetail) {
|
|
|
+ if (typeof e2.detail === "number") {
|
|
|
+ e2.detail = instance.ctx.$getTriggerEventDetail(e2.detail);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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 ? String(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, instance) {
|
|
|
+ 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 vFor(source, renderItem) {
|
|
|
+ let ret;
|
|
|
+ if (isArray(source) || isString(source)) {
|
|
|
+ ret = new Array(source.length);
|
|
|
+ for (let i = 0, l = source.length; i < l; i++) {
|
|
|
+ ret[i] = renderItem(source[i], i, i);
|
|
|
+ }
|
|
|
+ } else if (typeof source === "number") {
|
|
|
+ if (!Number.isInteger(source)) {
|
|
|
+ warn(`The v-for range expect an integer value but got ${source}.`);
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ ret = new Array(source);
|
|
|
+ for (let i = 0; i < source; i++) {
|
|
|
+ ret[i] = renderItem(i + 1, i, i);
|
|
|
+ }
|
|
|
+ } else if (isObject(source)) {
|
|
|
+ if (source[Symbol.iterator]) {
|
|
|
+ ret = Array.from(source, (item, i) => renderItem(item, i, i));
|
|
|
+ } else {
|
|
|
+ const keys = Object.keys(source);
|
|
|
+ ret = new Array(keys.length);
|
|
|
+ for (let i = 0, l = keys.length; i < l; i++) {
|
|
|
+ const key = keys[i];
|
|
|
+ ret[i] = renderItem(source[key], key, i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ret = [];
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+const o = (value, key) => vOn(value, key);
|
|
|
+const f = (source, renderItem) => vFor(source, renderItem);
|
|
|
+const t = (val) => toDisplayString(val);
|
|
|
function createApp$1(rootComponent, rootProps = null) {
|
|
|
rootComponent && (rootComponent.mpType = "app");
|
|
|
return createVueApp(rootComponent, rootProps).use(plugin);
|
|
@@ -5011,9 +5171,9 @@ function assertType(value, type) {
|
|
|
let valid;
|
|
|
const expectedType = getType(type);
|
|
|
if (isSimpleType(expectedType)) {
|
|
|
- const t = typeof value;
|
|
|
- valid = t === expectedType.toLowerCase();
|
|
|
- if (!valid && t === "object") {
|
|
|
+ const t2 = typeof value;
|
|
|
+ valid = t2 === expectedType.toLowerCase();
|
|
|
+ if (!valid && t2 === "object") {
|
|
|
valid = value instanceof type;
|
|
|
}
|
|
|
} else if (expectedType === "Object") {
|
|
@@ -7700,5 +7860,8 @@ const createSubpackageApp = initCreateSubpackageApp();
|
|
|
}
|
|
|
exports._export_sfc = _export_sfc;
|
|
|
exports.createSSRApp = createSSRApp;
|
|
|
+exports.f = f;
|
|
|
exports.index = index;
|
|
|
+exports.o = o;
|
|
|
+exports.t = t;
|
|
|
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map
|