|
|
@@ -1,7 +1,7 @@
|
|
|
import { defineComponent, h, getCurrentInstance, effectScope, inject, onMounted, onUnmounted, shallowRef, ref, computed, onBeforeMount, watch, Fragment, isRef, createVNode, Text, resolveComponent, TransitionGroup, nextTick, resolveDirective, withDirectives, openBlock, createElementBlock, normalizeStyle, createBlock, normalizeClass, createSlots, withCtx, renderSlot, createCommentVNode, createTextVNode, toDisplayString as toDisplayString$1, createElementVNode, defineAsyncComponent, renderList, mergeProps, vShow, withModifiers, resolveDynamicComponent, useCssVars, watchEffect, onBeforeUpdate, toHandlers, Transition } from "vue";
|
|
|
var normalize = "";
|
|
|
/*!
|
|
|
- * shared v9.13.1
|
|
|
+ * shared v9.14.2
|
|
|
* (c) 2024 kazuya kawaguchi
|
|
|
* Released under the MIT License.
|
|
|
*/
|
|
|
@@ -14,9 +14,11 @@ const isDate$1 = (val) => toTypeString(val) === "[object Date]";
|
|
|
const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
|
|
|
const isEmptyObject = (val) => isPlainObject$2(val) && Object.keys(val).length === 0;
|
|
|
const assign$2 = Object.assign;
|
|
|
+const _create = Object.create;
|
|
|
+const create = (obj = null) => _create(obj);
|
|
|
let _globalThis;
|
|
|
const getGlobalThis = () => {
|
|
|
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
|
+ return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : create());
|
|
|
};
|
|
|
function escapeHtml(rawText) {
|
|
|
return rawText.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
|
@@ -68,7 +70,13 @@ function deepCopy(src, des) {
|
|
|
while (stack.length) {
|
|
|
const { src: src2, des: des2 } = stack.pop();
|
|
|
Object.keys(src2).forEach((key) => {
|
|
|
- if (isNotObjectOrIsArray(src2[key]) || isNotObjectOrIsArray(des2[key])) {
|
|
|
+ if (key === "__proto__") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (isObject$3(src2[key]) && !isObject$3(des2[key])) {
|
|
|
+ des2[key] = Array.isArray(src2[key]) ? [] : create();
|
|
|
+ }
|
|
|
+ if (isNotObjectOrIsArray(des2[key]) || isNotObjectOrIsArray(src2[key])) {
|
|
|
des2[key] = src2[key];
|
|
|
} else {
|
|
|
stack.push({ src: src2[key], des: des2[key] });
|
|
|
@@ -77,7 +85,7 @@ function deepCopy(src, des) {
|
|
|
}
|
|
|
}
|
|
|
/*!
|
|
|
- * message-compiler v9.13.1
|
|
|
+ * message-compiler v9.14.2
|
|
|
* (c) 2024 kazuya kawaguchi
|
|
|
* Released under the MIT License.
|
|
|
*/
|
|
|
@@ -1518,7 +1526,7 @@ function baseCompile$1(source2, options = {}) {
|
|
|
}
|
|
|
}
|
|
|
/*!
|
|
|
- * core-base v9.13.1
|
|
|
+ * core-base v9.14.2
|
|
|
* (c) 2024 kazuya kawaguchi
|
|
|
* Released under the MIT License.
|
|
|
*/
|
|
|
@@ -1711,7 +1719,7 @@ const cache = /* @__PURE__ */ new Map();
|
|
|
function resolveWithKeyValue(obj, path) {
|
|
|
return isObject$3(obj) ? obj[path] : null;
|
|
|
}
|
|
|
-function resolveValue(obj, path) {
|
|
|
+function resolveValue$1(obj, path) {
|
|
|
if (!isObject$3(obj)) {
|
|
|
return null;
|
|
|
}
|
|
|
@@ -1775,7 +1783,7 @@ function createMessageContext(options = {}) {
|
|
|
};
|
|
|
const _list = options.list || [];
|
|
|
const list = (index2) => _list[index2];
|
|
|
- const _named = options.named || {};
|
|
|
+ const _named = options.named || create();
|
|
|
isNumber$2(options.pluralIndex) && normalizeNamed(pluralIndex, _named);
|
|
|
const named = (key) => _named[key];
|
|
|
function message(key) {
|
|
|
@@ -1818,7 +1826,7 @@ function createMessageContext(options = {}) {
|
|
|
["type"]: type,
|
|
|
["interpolate"]: interpolate,
|
|
|
["normalize"]: normalize2,
|
|
|
- ["values"]: assign$2({}, _list, _named)
|
|
|
+ ["values"]: assign$2(create(), _list, _named)
|
|
|
};
|
|
|
return ctx;
|
|
|
}
|
|
|
@@ -1953,7 +1961,7 @@ function appendItemToChain(chain, target, blocks) {
|
|
|
}
|
|
|
return follow;
|
|
|
}
|
|
|
-const VERSION$2 = "9.13.1";
|
|
|
+const VERSION$2 = "9.14.2";
|
|
|
const NOT_REOSLVED = -1;
|
|
|
const DEFAULT_LOCALE = "en-US";
|
|
|
const MISSING_RESOLVE_VALUE = "";
|
|
|
@@ -2000,11 +2008,11 @@ function createCoreContext(options = {}) {
|
|
|
const locale = isString$3(options.locale) || isFunction$2(options.locale) ? options.locale : DEFAULT_LOCALE;
|
|
|
const _locale = isFunction$2(locale) ? DEFAULT_LOCALE : locale;
|
|
|
const fallbackLocale = isArray$1(options.fallbackLocale) || isPlainObject$2(options.fallbackLocale) || isString$3(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale;
|
|
|
- const messages = isPlainObject$2(options.messages) ? options.messages : { [_locale]: {} };
|
|
|
- const datetimeFormats = isPlainObject$2(options.datetimeFormats) ? options.datetimeFormats : { [_locale]: {} };
|
|
|
- const numberFormats = isPlainObject$2(options.numberFormats) ? options.numberFormats : { [_locale]: {} };
|
|
|
- const modifiers = assign$2({}, options.modifiers || {}, getDefaultLinkedModifiers());
|
|
|
- const pluralRules = options.pluralRules || {};
|
|
|
+ const messages = isPlainObject$2(options.messages) ? options.messages : createResources(_locale);
|
|
|
+ const datetimeFormats = isPlainObject$2(options.datetimeFormats) ? options.datetimeFormats : createResources(_locale);
|
|
|
+ const numberFormats = isPlainObject$2(options.numberFormats) ? options.numberFormats : createResources(_locale);
|
|
|
+ const modifiers = assign$2(create(), options.modifiers, getDefaultLinkedModifiers());
|
|
|
+ const pluralRules = options.pluralRules || create();
|
|
|
const missing = isFunction$2(options.missing) ? options.missing : null;
|
|
|
const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
|
|
|
const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
|
|
|
@@ -2058,6 +2066,7 @@ function createCoreContext(options = {}) {
|
|
|
}
|
|
|
return context;
|
|
|
}
|
|
|
+const createResources = (locale) => ({ [locale]: create() });
|
|
|
function handleMissing(context, key, locale, missingWarn, type) {
|
|
|
const { missing, onWarn } = context;
|
|
|
if (missing !== null) {
|
|
|
@@ -2094,10 +2103,14 @@ function format(ast) {
|
|
|
return msg;
|
|
|
}
|
|
|
function formatParts(ctx, ast) {
|
|
|
- const body = ast.b || ast.body;
|
|
|
- if ((body.t || body.type) === 1) {
|
|
|
+ const body = resolveBody(ast);
|
|
|
+ if (body == null) {
|
|
|
+ throw createUnhandleNodeError(0);
|
|
|
+ }
|
|
|
+ const type = resolveType(body);
|
|
|
+ if (type === 1) {
|
|
|
const plural = body;
|
|
|
- const cases = plural.c || plural.cases;
|
|
|
+ const cases = resolveCases(plural);
|
|
|
return ctx.plural(cases.reduce((messages, c) => [
|
|
|
...messages,
|
|
|
formatMessageParts(ctx, c)
|
|
|
@@ -2106,54 +2119,119 @@ function formatParts(ctx, ast) {
|
|
|
return formatMessageParts(ctx, body);
|
|
|
}
|
|
|
}
|
|
|
+const PROPS_BODY = ["b", "body"];
|
|
|
+function resolveBody(node) {
|
|
|
+ return resolveProps(node, PROPS_BODY);
|
|
|
+}
|
|
|
+const PROPS_CASES = ["c", "cases"];
|
|
|
+function resolveCases(node) {
|
|
|
+ return resolveProps(node, PROPS_CASES, []);
|
|
|
+}
|
|
|
function formatMessageParts(ctx, node) {
|
|
|
- const _static = node.s || node.static;
|
|
|
- if (_static) {
|
|
|
- return ctx.type === "text" ? _static : ctx.normalize([_static]);
|
|
|
+ const static_ = resolveStatic(node);
|
|
|
+ if (static_ != null) {
|
|
|
+ return ctx.type === "text" ? static_ : ctx.normalize([static_]);
|
|
|
} else {
|
|
|
- const messages = (node.i || node.items).reduce((acm, c) => [...acm, formatMessagePart(ctx, c)], []);
|
|
|
+ const messages = resolveItems(node).reduce((acm, c) => [...acm, formatMessagePart(ctx, c)], []);
|
|
|
return ctx.normalize(messages);
|
|
|
}
|
|
|
}
|
|
|
+const PROPS_STATIC = ["s", "static"];
|
|
|
+function resolveStatic(node) {
|
|
|
+ return resolveProps(node, PROPS_STATIC);
|
|
|
+}
|
|
|
+const PROPS_ITEMS = ["i", "items"];
|
|
|
+function resolveItems(node) {
|
|
|
+ return resolveProps(node, PROPS_ITEMS, []);
|
|
|
+}
|
|
|
function formatMessagePart(ctx, node) {
|
|
|
- const type = node.t || node.type;
|
|
|
+ const type = resolveType(node);
|
|
|
switch (type) {
|
|
|
case 3: {
|
|
|
- const text = node;
|
|
|
- return text.v || text.value;
|
|
|
+ return resolveValue(node, type);
|
|
|
}
|
|
|
case 9: {
|
|
|
- const literal = node;
|
|
|
- return literal.v || literal.value;
|
|
|
+ return resolveValue(node, type);
|
|
|
}
|
|
|
case 4: {
|
|
|
const named = node;
|
|
|
- return ctx.interpolate(ctx.named(named.k || named.key));
|
|
|
+ if (hasOwn(named, "k") && named.k) {
|
|
|
+ return ctx.interpolate(ctx.named(named.k));
|
|
|
+ }
|
|
|
+ if (hasOwn(named, "key") && named.key) {
|
|
|
+ return ctx.interpolate(ctx.named(named.key));
|
|
|
+ }
|
|
|
+ throw createUnhandleNodeError(type);
|
|
|
}
|
|
|
case 5: {
|
|
|
const list = node;
|
|
|
- return ctx.interpolate(ctx.list(list.i != null ? list.i : list.index));
|
|
|
+ if (hasOwn(list, "i") && isNumber$2(list.i)) {
|
|
|
+ return ctx.interpolate(ctx.list(list.i));
|
|
|
+ }
|
|
|
+ if (hasOwn(list, "index") && isNumber$2(list.index)) {
|
|
|
+ return ctx.interpolate(ctx.list(list.index));
|
|
|
+ }
|
|
|
+ throw createUnhandleNodeError(type);
|
|
|
}
|
|
|
case 6: {
|
|
|
const linked = node;
|
|
|
- const modifier = linked.m || linked.modifier;
|
|
|
- return ctx.linked(formatMessagePart(ctx, linked.k || linked.key), modifier ? formatMessagePart(ctx, modifier) : void 0, ctx.type);
|
|
|
+ const modifier = resolveLinkedModifier(linked);
|
|
|
+ const key = resolveLinkedKey(linked);
|
|
|
+ return ctx.linked(formatMessagePart(ctx, key), modifier ? formatMessagePart(ctx, modifier) : void 0, ctx.type);
|
|
|
}
|
|
|
case 7: {
|
|
|
- const linkedKey = node;
|
|
|
- return linkedKey.v || linkedKey.value;
|
|
|
+ return resolveValue(node, type);
|
|
|
}
|
|
|
case 8: {
|
|
|
- const linkedModifier = node;
|
|
|
- return linkedModifier.v || linkedModifier.value;
|
|
|
+ return resolveValue(node, type);
|
|
|
}
|
|
|
default:
|
|
|
- throw new Error(`unhandled node type on format message part: ${type}`);
|
|
|
+ throw new Error(`unhandled node on format message part: ${type}`);
|
|
|
}
|
|
|
}
|
|
|
+const PROPS_TYPE = ["t", "type"];
|
|
|
+function resolveType(node) {
|
|
|
+ return resolveProps(node, PROPS_TYPE);
|
|
|
+}
|
|
|
+const PROPS_VALUE = ["v", "value"];
|
|
|
+function resolveValue(node, type) {
|
|
|
+ const resolved = resolveProps(node, PROPS_VALUE);
|
|
|
+ if (resolved) {
|
|
|
+ return resolved;
|
|
|
+ } else {
|
|
|
+ throw createUnhandleNodeError(type);
|
|
|
+ }
|
|
|
+}
|
|
|
+const PROPS_MODIFIER = ["m", "modifier"];
|
|
|
+function resolveLinkedModifier(node) {
|
|
|
+ return resolveProps(node, PROPS_MODIFIER);
|
|
|
+}
|
|
|
+const PROPS_KEY = ["k", "key"];
|
|
|
+function resolveLinkedKey(node) {
|
|
|
+ const resolved = resolveProps(node, PROPS_KEY);
|
|
|
+ if (resolved) {
|
|
|
+ return resolved;
|
|
|
+ } else {
|
|
|
+ throw createUnhandleNodeError(6);
|
|
|
+ }
|
|
|
+}
|
|
|
+function resolveProps(node, props2, defaultValue) {
|
|
|
+ for (let i = 0; i < props2.length; i++) {
|
|
|
+ const prop = props2[i];
|
|
|
+ if (hasOwn(node, prop) && node[prop] != null) {
|
|
|
+ return node[prop];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return defaultValue;
|
|
|
+}
|
|
|
+function createUnhandleNodeError(type) {
|
|
|
+ return new Error(`unhandled node type: ${type}`);
|
|
|
+}
|
|
|
const defaultOnCacheKey = (message) => message;
|
|
|
-let compileCache = /* @__PURE__ */ Object.create(null);
|
|
|
-const isMessageAST = (val) => isObject$3(val) && (val.t === 0 || val.type === 0) && ("b" in val || "body" in val);
|
|
|
+let compileCache = create();
|
|
|
+function isMessageAST(val) {
|
|
|
+ return isObject$3(val) && resolveType(val) === 0 && (hasOwn(val, "b") || hasOwn(val, "body"));
|
|
|
+}
|
|
|
function baseCompile(message, options = {}) {
|
|
|
let detectError = false;
|
|
|
const onError = options.onError || defaultOnError;
|
|
|
@@ -2225,7 +2303,7 @@ function translate(context, ...args) {
|
|
|
let [formatScope, targetLocale, message] = !resolvedMessage ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) : [
|
|
|
key,
|
|
|
locale,
|
|
|
- messages[locale] || {}
|
|
|
+ messages[locale] || create()
|
|
|
];
|
|
|
let format2 = formatScope;
|
|
|
let cacheBaseKey = key;
|
|
|
@@ -2277,13 +2355,13 @@ function escapeParams(options) {
|
|
|
function resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {
|
|
|
const { messages, onWarn, messageResolver: resolveValue2, localeFallbacker } = context;
|
|
|
const locales = localeFallbacker(context, fallbackLocale, locale);
|
|
|
- let message = {};
|
|
|
+ let message = create();
|
|
|
let targetLocale;
|
|
|
let format2 = null;
|
|
|
const type = "translate";
|
|
|
for (let i = 0; i < locales.length; i++) {
|
|
|
targetLocale = locales[i];
|
|
|
- message = messages[targetLocale] || {};
|
|
|
+ message = messages[targetLocale] || create();
|
|
|
if ((format2 = resolveValue2(message, key)) === null) {
|
|
|
format2 = message[key];
|
|
|
}
|
|
|
@@ -2331,7 +2409,7 @@ function evaluateMessage(context, msg, msgCtx) {
|
|
|
}
|
|
|
function parseTranslateArgs(...args) {
|
|
|
const [arg1, arg2, arg3] = args;
|
|
|
- const options = {};
|
|
|
+ const options = create();
|
|
|
if (!isString$3(arg1) && !isNumber$2(arg1) && !isMessageFunction(arg1) && !isMessageAST(arg1)) {
|
|
|
throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
|
|
|
}
|
|
|
@@ -2475,8 +2553,8 @@ const DATETIME_FORMAT_OPTIONS_KEYS = [
|
|
|
];
|
|
|
function parseDateTimeArgs(...args) {
|
|
|
const [arg1, arg2, arg3, arg4] = args;
|
|
|
- const options = {};
|
|
|
- let overrides = {};
|
|
|
+ const options = create();
|
|
|
+ let overrides = create();
|
|
|
let value;
|
|
|
if (isString$3(arg1)) {
|
|
|
const matches2 = arg1.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
|
|
|
@@ -2597,8 +2675,8 @@ const NUMBER_FORMAT_OPTIONS_KEYS = [
|
|
|
];
|
|
|
function parseNumberArgs(...args) {
|
|
|
const [arg1, arg2, arg3, arg4] = args;
|
|
|
- const options = {};
|
|
|
- let overrides = {};
|
|
|
+ const options = create();
|
|
|
+ let overrides = create();
|
|
|
if (!isNumber$2(arg1)) {
|
|
|
throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
|
|
|
}
|
|
|
@@ -2638,11 +2716,11 @@ function clearNumberFormat(ctx, locale, format2) {
|
|
|
initFeatureFlags$1();
|
|
|
}
|
|
|
/*!
|
|
|
- * vue-i18n v9.13.1
|
|
|
+ * vue-i18n v9.14.2
|
|
|
* (c) 2024 kazuya kawaguchi
|
|
|
* Released under the MIT License.
|
|
|
*/
|
|
|
-const VERSION$1 = "9.13.1";
|
|
|
+const VERSION$1 = "9.14.2";
|
|
|
function initFeatureFlags() {
|
|
|
if (typeof __VUE_I18N_FULL_INSTALL__ !== "boolean") {
|
|
|
getGlobalThis().__VUE_I18N_FULL_INSTALL__ = true;
|
|
|
@@ -2722,7 +2800,7 @@ function handleFlatJson(obj) {
|
|
|
let hasStringValue = false;
|
|
|
for (let i = 0; i < lastIndex; i++) {
|
|
|
if (!(subKeys[i] in currentObj)) {
|
|
|
- currentObj[subKeys[i]] = {};
|
|
|
+ currentObj[subKeys[i]] = create();
|
|
|
}
|
|
|
if (!isObject$3(currentObj[subKeys[i]])) {
|
|
|
hasStringValue = true;
|
|
|
@@ -2743,13 +2821,13 @@ function handleFlatJson(obj) {
|
|
|
}
|
|
|
function getLocaleMessages(locale, options) {
|
|
|
const { messages, __i18n, messageResolver, flatJson } = options;
|
|
|
- const ret = isPlainObject$2(messages) ? messages : isArray$1(__i18n) ? {} : { [locale]: {} };
|
|
|
+ const ret = isPlainObject$2(messages) ? messages : isArray$1(__i18n) ? create() : { [locale]: create() };
|
|
|
if (isArray$1(__i18n)) {
|
|
|
__i18n.forEach((custom) => {
|
|
|
if ("locale" in custom && "resource" in custom) {
|
|
|
const { locale: locale2, resource } = custom;
|
|
|
if (locale2) {
|
|
|
- ret[locale2] = ret[locale2] || {};
|
|
|
+ ret[locale2] = ret[locale2] || create();
|
|
|
deepCopy(resource, ret[locale2]);
|
|
|
} else {
|
|
|
deepCopy(resource, ret);
|
|
|
@@ -2772,7 +2850,7 @@ function getComponentOptions(instance2) {
|
|
|
return instance2.type;
|
|
|
}
|
|
|
function adjustI18nResources(gl, options, componentOptions) {
|
|
|
- let messages = isObject$3(options.messages) ? options.messages : {};
|
|
|
+ let messages = isObject$3(options.messages) ? options.messages : create();
|
|
|
if ("__i18nGlobal" in componentOptions) {
|
|
|
messages = getLocaleMessages(gl.locale.value, {
|
|
|
messages,
|
|
|
@@ -3519,7 +3597,7 @@ function getInterpolateArg({ slots }, keys) {
|
|
|
arg[key] = slot();
|
|
|
}
|
|
|
return arg;
|
|
|
- }, {});
|
|
|
+ }, create());
|
|
|
}
|
|
|
}
|
|
|
function getFragmentableTag(tag) {
|
|
|
@@ -3545,7 +3623,7 @@ const TranslationImpl = /* @__PURE__ */ defineComponent({
|
|
|
});
|
|
|
return () => {
|
|
|
const keys = Object.keys(slots).filter((key) => key !== "_");
|
|
|
- const options = {};
|
|
|
+ const options = create();
|
|
|
if (props2.locale) {
|
|
|
options.locale = props2.locale;
|
|
|
}
|
|
|
@@ -3554,7 +3632,7 @@ const TranslationImpl = /* @__PURE__ */ defineComponent({
|
|
|
}
|
|
|
const arg = getInterpolateArg(context, keys);
|
|
|
const children = i18n[TranslateVNodeSymbol](props2.keypath, arg, options);
|
|
|
- const assignedAttrs = assign$2({}, attrs);
|
|
|
+ const assignedAttrs = assign$2(create(), attrs);
|
|
|
const tag = isString$3(props2.tag) || isObject$3(props2.tag) ? props2.tag : getFragmentableTag();
|
|
|
return h(tag, assignedAttrs, children);
|
|
|
};
|
|
|
@@ -3568,7 +3646,7 @@ function renderFormatter(props2, context, slotKeys, partFormatter) {
|
|
|
const { slots, attrs } = context;
|
|
|
return () => {
|
|
|
const options = { part: true };
|
|
|
- let overrides = {};
|
|
|
+ let overrides = create();
|
|
|
if (props2.locale) {
|
|
|
options.locale = props2.locale;
|
|
|
}
|
|
|
@@ -3579,8 +3657,8 @@ function renderFormatter(props2, context, slotKeys, partFormatter) {
|
|
|
options.key = props2.format.key;
|
|
|
}
|
|
|
overrides = Object.keys(props2.format).reduce((options2, prop) => {
|
|
|
- return slotKeys.includes(prop) ? assign$2({}, options2, { [prop]: props2.format[prop] }) : options2;
|
|
|
- }, {});
|
|
|
+ return slotKeys.includes(prop) ? assign$2(create(), options2, { [prop]: props2.format[prop] }) : options2;
|
|
|
+ }, create());
|
|
|
}
|
|
|
const parts = partFormatter(...[props2.value, options, overrides]);
|
|
|
let children = [options.key];
|
|
|
@@ -3596,7 +3674,7 @@ function renderFormatter(props2, context, slotKeys, partFormatter) {
|
|
|
} else if (isString$3(parts)) {
|
|
|
children = [parts];
|
|
|
}
|
|
|
- const assignedAttrs = assign$2({}, attrs);
|
|
|
+ const assignedAttrs = assign$2(create(), attrs);
|
|
|
const tag = isString$3(props2.tag) || isObject$3(props2.tag) ? props2.tag : getFragmentableTag();
|
|
|
return h(tag, assignedAttrs, children);
|
|
|
};
|
|
|
@@ -4370,7 +4448,7 @@ if (__INTLIFY_JIT_COMPILATION__) {
|
|
|
} else {
|
|
|
registerMessageCompiler(compileToFunction);
|
|
|
}
|
|
|
-registerMessageResolver(resolveValue);
|
|
|
+registerMessageResolver(resolveValue$1);
|
|
|
registerLocaleFallbacker(fallbackWithLocaleChain);
|
|
|
if (__INTLIFY_PROD_DEVTOOLS__) {
|
|
|
const target = getGlobalThis();
|
|
|
@@ -11830,7 +11908,7 @@ var lodash = { exports: {} };
|
|
|
copyObject(source2, keys(source2), object, customizer);
|
|
|
});
|
|
|
var at = flatRest(baseAt);
|
|
|
- function create(prototype, properties) {
|
|
|
+ function create2(prototype, properties) {
|
|
|
var result2 = baseCreate(prototype);
|
|
|
return properties == null ? result2 : baseAssign(result2, properties);
|
|
|
}
|
|
|
@@ -12577,7 +12655,7 @@ var lodash = { exports: {} };
|
|
|
lodash2.conforms = conforms;
|
|
|
lodash2.constant = constant;
|
|
|
lodash2.countBy = countBy;
|
|
|
- lodash2.create = create;
|
|
|
+ lodash2.create = create2;
|
|
|
lodash2.curry = curry;
|
|
|
lodash2.curryRight = curryRight;
|
|
|
lodash2.debounce = debounce;
|
|
|
@@ -25459,7 +25537,7 @@ var codemirror$1 = { exports: {} };
|
|
|
};
|
|
|
CodeMirror2.fromTextArea = fromTextArea;
|
|
|
addLegacyProps(CodeMirror2);
|
|
|
- CodeMirror2.version = "5.65.17";
|
|
|
+ CodeMirror2.version = "5.65.18";
|
|
|
return CodeMirror2;
|
|
|
});
|
|
|
})(codemirror$1);
|
|
|
@@ -34756,7 +34834,7 @@ function createInstance(defaultConfig) {
|
|
|
var instance2 = bind(Axios.prototype.request, context);
|
|
|
utils.extend(instance2, Axios.prototype, context);
|
|
|
utils.extend(instance2, context);
|
|
|
- instance2.create = function create(instanceConfig) {
|
|
|
+ instance2.create = function create2(instanceConfig) {
|
|
|
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
|
};
|
|
|
return instance2;
|
|
|
@@ -37816,14 +37894,37 @@ function _sfc_render$1a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
}
|
|
|
var FormConfig = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["render", _sfc_render$1a]]);
|
|
|
/*!
|
|
|
- * Viewer.js v1.11.6
|
|
|
+ * Viewer.js v1.11.7
|
|
|
* https://fengyuanchen.github.io/viewerjs
|
|
|
*
|
|
|
* Copyright 2015-present Chen Fengyuan
|
|
|
* Released under the MIT license
|
|
|
*
|
|
|
- * Date: 2023-09-17T03:16:38.052Z
|
|
|
+ * Date: 2024-11-24T04:32:19.116Z
|
|
|
*/
|
|
|
+function _classCallCheck(a, n) {
|
|
|
+ if (!(a instanceof n))
|
|
|
+ throw new TypeError("Cannot call a class as a function");
|
|
|
+}
|
|
|
+function _defineProperties(e, r) {
|
|
|
+ for (var t = 0; t < r.length; t++) {
|
|
|
+ var o = r[t];
|
|
|
+ o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
|
+ }
|
|
|
+}
|
|
|
+function _createClass(e, r, t) {
|
|
|
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
|
+ writable: false
|
|
|
+ }), e;
|
|
|
+}
|
|
|
+function _defineProperty(e, r, t) {
|
|
|
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
|
+ value: t,
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true,
|
|
|
+ writable: true
|
|
|
+ }) : e[r] = t, e;
|
|
|
+}
|
|
|
function ownKeys(e, r) {
|
|
|
var t = Object.keys(e);
|
|
|
if (Object.getOwnPropertySymbols) {
|
|
|
@@ -37845,6 +37946,22 @@ function _objectSpread2(e) {
|
|
|
}
|
|
|
return e;
|
|
|
}
|
|
|
+function _toPrimitive(t, r) {
|
|
|
+ if ("object" != typeof t || !t)
|
|
|
+ return t;
|
|
|
+ var e = t[Symbol.toPrimitive];
|
|
|
+ if (void 0 !== e) {
|
|
|
+ var i = e.call(t, r || "default");
|
|
|
+ if ("object" != typeof i)
|
|
|
+ return i;
|
|
|
+ throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
|
+ }
|
|
|
+ return ("string" === r ? String : Number)(t);
|
|
|
+}
|
|
|
+function _toPropertyKey(t) {
|
|
|
+ var i = _toPrimitive(t, "string");
|
|
|
+ return "symbol" == typeof i ? i : i + "";
|
|
|
+}
|
|
|
function _typeof(o) {
|
|
|
"@babel/helpers - typeof";
|
|
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
|
@@ -37853,61 +37970,6 @@ function _typeof(o) {
|
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
|
}, _typeof(o);
|
|
|
}
|
|
|
-function _classCallCheck(instance2, Constructor) {
|
|
|
- if (!(instance2 instanceof Constructor)) {
|
|
|
- throw new TypeError("Cannot call a class as a function");
|
|
|
- }
|
|
|
-}
|
|
|
-function _defineProperties(target, props2) {
|
|
|
- for (var i = 0; i < props2.length; i++) {
|
|
|
- var descriptor = props2[i];
|
|
|
- descriptor.enumerable = descriptor.enumerable || false;
|
|
|
- descriptor.configurable = true;
|
|
|
- if ("value" in descriptor)
|
|
|
- descriptor.writable = true;
|
|
|
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
|
- }
|
|
|
-}
|
|
|
-function _createClass(Constructor, protoProps, staticProps) {
|
|
|
- if (protoProps)
|
|
|
- _defineProperties(Constructor.prototype, protoProps);
|
|
|
- if (staticProps)
|
|
|
- _defineProperties(Constructor, staticProps);
|
|
|
- Object.defineProperty(Constructor, "prototype", {
|
|
|
- writable: false
|
|
|
- });
|
|
|
- return Constructor;
|
|
|
-}
|
|
|
-function _defineProperty(obj, key, value) {
|
|
|
- key = _toPropertyKey(key);
|
|
|
- if (key in obj) {
|
|
|
- Object.defineProperty(obj, key, {
|
|
|
- value,
|
|
|
- enumerable: true,
|
|
|
- configurable: true,
|
|
|
- writable: true
|
|
|
- });
|
|
|
- } else {
|
|
|
- obj[key] = value;
|
|
|
- }
|
|
|
- return obj;
|
|
|
-}
|
|
|
-function _toPrimitive(input, hint) {
|
|
|
- if (typeof input !== "object" || input === null)
|
|
|
- return input;
|
|
|
- var prim = input[Symbol.toPrimitive];
|
|
|
- if (prim !== void 0) {
|
|
|
- var res = prim.call(input, hint || "default");
|
|
|
- if (typeof res !== "object")
|
|
|
- return res;
|
|
|
- throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
|
- }
|
|
|
- return (hint === "string" ? String : Number)(input);
|
|
|
-}
|
|
|
-function _toPropertyKey(arg) {
|
|
|
- var key = _toPrimitive(arg, "string");
|
|
|
- return typeof key === "symbol" ? key : String(key);
|
|
|
-}
|
|
|
var DEFAULTS = {
|
|
|
backdrop: true,
|
|
|
button: true,
|
|
|
@@ -39108,15 +39170,15 @@ var methods = {
|
|
|
_this.hidden();
|
|
|
};
|
|
|
if (options.transition && !immediate) {
|
|
|
- var onViewerTransitionEnd = function onViewerTransitionEnd2(event) {
|
|
|
+ var _onViewerTransitionEnd = function onViewerTransitionEnd(event) {
|
|
|
if (event && event.target === viewer2) {
|
|
|
- removeListener(viewer2, EVENT_TRANSITION_END, onViewerTransitionEnd2);
|
|
|
+ removeListener(viewer2, EVENT_TRANSITION_END, _onViewerTransitionEnd);
|
|
|
_this.hidden();
|
|
|
}
|
|
|
};
|
|
|
var onImageTransitionEnd = function onImageTransitionEnd2() {
|
|
|
if (hasClass(viewer2, CLASS_TRANSITION)) {
|
|
|
- addListener(viewer2, EVENT_TRANSITION_END, onViewerTransitionEnd);
|
|
|
+ addListener(viewer2, EVENT_TRANSITION_END, _onViewerTransitionEnd);
|
|
|
removeClass(viewer2, CLASS_IN);
|
|
|
} else {
|
|
|
hideImmediately();
|
|
|
@@ -39127,7 +39189,7 @@ var methods = {
|
|
|
if (_this.viewed && hasClass(image, CLASS_TRANSITION)) {
|
|
|
removeListener(image, EVENT_TRANSITION_END, onImageTransitionEnd);
|
|
|
} else if (hasClass(viewer2, CLASS_TRANSITION)) {
|
|
|
- removeListener(viewer2, EVENT_TRANSITION_END, onViewerTransitionEnd);
|
|
|
+ removeListener(viewer2, EVENT_TRANSITION_END, _onViewerTransitionEnd);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -39609,27 +39671,27 @@ var methods = {
|
|
|
player.appendChild(image);
|
|
|
});
|
|
|
if (isNumber(options.interval) && options.interval > 0) {
|
|
|
- var prev2 = function prev3() {
|
|
|
+ var _prev = function prev2() {
|
|
|
clearTimeout(_this7.playing.timeout);
|
|
|
removeClass(list[index2], CLASS_IN);
|
|
|
index2 -= 1;
|
|
|
index2 = index2 >= 0 ? index2 : total - 1;
|
|
|
addClass(list[index2], CLASS_IN);
|
|
|
- _this7.playing.timeout = setTimeout(prev3, options.interval);
|
|
|
+ _this7.playing.timeout = setTimeout(_prev, options.interval);
|
|
|
};
|
|
|
- var next2 = function next3() {
|
|
|
+ var _next = function next2() {
|
|
|
clearTimeout(_this7.playing.timeout);
|
|
|
removeClass(list[index2], CLASS_IN);
|
|
|
index2 += 1;
|
|
|
index2 = index2 < total ? index2 : 0;
|
|
|
addClass(list[index2], CLASS_IN);
|
|
|
- _this7.playing.timeout = setTimeout(next3, options.interval);
|
|
|
+ _this7.playing.timeout = setTimeout(_next, options.interval);
|
|
|
};
|
|
|
if (total > 1) {
|
|
|
this.playing = {
|
|
|
- prev: prev2,
|
|
|
- next: next2,
|
|
|
- timeout: setTimeout(next2, options.interval)
|
|
|
+ prev: _prev,
|
|
|
+ next: _next,
|
|
|
+ timeout: setTimeout(_next, options.interval)
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
@@ -40141,7 +40203,7 @@ var Viewer$1 = /* @__PURE__ */ function() {
|
|
|
this.id = getUniqueID();
|
|
|
this.init();
|
|
|
}
|
|
|
- _createClass(Viewer2, [{
|
|
|
+ return _createClass(Viewer2, [{
|
|
|
key: "init",
|
|
|
value: function init() {
|
|
|
var _this = this;
|
|
|
@@ -40384,7 +40446,6 @@ var Viewer$1 = /* @__PURE__ */ function() {
|
|
|
assign(DEFAULTS, isPlainObject(options) && options);
|
|
|
}
|
|
|
}]);
|
|
|
- return Viewer2;
|
|
|
}();
|
|
|
assign(Viewer$1.prototype, render, events, handlers, methods, others);
|
|
|
var __extends$3 = globalThis && globalThis.__extends || function() {
|
|
|
@@ -43582,23 +43643,54 @@ const _sfc_main$1f = {
|
|
|
}
|
|
|
this.$refs.uploadInput.value = [];
|
|
|
},
|
|
|
+ getQueryParams(queryName) {
|
|
|
+ const urlSearchParams = new URLSearchParams(window.location.search);
|
|
|
+ const query = urlSearchParams.get(queryName);
|
|
|
+ return JSON.parse(query);
|
|
|
+ },
|
|
|
uploadAction(res, file, key) {
|
|
|
this.fileList.findIndex((item2) => item2.key === key);
|
|
|
const xhr2 = new XMLHttpRequest();
|
|
|
+ let headers = this.getQueryParams("headers");
|
|
|
+ console.log(headers.Authorization, "this.headers.Authorization");
|
|
|
const url = this.action;
|
|
|
xhr2.open("POST", url, true);
|
|
|
this.headers.map((item2) => {
|
|
|
+ if (item2.key == "Authorization") {
|
|
|
+ item2.value = headers.Authorization;
|
|
|
+ console.log(item2.value, "====111");
|
|
|
+ }
|
|
|
item2.key && xhr2.setRequestHeader(item2.key, item2.fx ? executeExpression(item2.value, {}, this.formContext) : item2.value);
|
|
|
});
|
|
|
let formData = new FormData();
|
|
|
- formData.append("file", file);
|
|
|
+ formData.append("multiPartFile", file);
|
|
|
formData.append("fname", file.name);
|
|
|
formData.append("key", key);
|
|
|
xhr2.withCredentials = this.withCredentials;
|
|
|
xhr2.onreadystatechange = () => {
|
|
|
if (xhr2.readyState === 4) {
|
|
|
let resData = JSON.parse(xhr2.response);
|
|
|
- if (resData && resData.url) {
|
|
|
+ if (resData && resData.code == 0) {
|
|
|
+ console.log("\u7528\u7684\u65B0\u7684");
|
|
|
+ this.$set(this.fileList, this.fileList.findIndex((item2) => item2.key === key), {
|
|
|
+ ...this.fileList[this.fileList.findIndex((item2) => item2.key === key)],
|
|
|
+ percent: 100,
|
|
|
+ ...resData.data
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$set(this.fileList, this.fileList.findIndex((item2) => item2.key === key), {
|
|
|
+ ...this.fileList[this.fileList.findIndex((item2) => item2.key === key)],
|
|
|
+ status: "success",
|
|
|
+ ...resData.data
|
|
|
+ });
|
|
|
+ this.$emit("on-upload-success", {
|
|
|
+ ...this.fileList[this.fileList.findIndex((item2) => item2.key === key)],
|
|
|
+ status: "success",
|
|
|
+ ...resData.data
|
|
|
+ });
|
|
|
+ this.$emit("update:modelValue", this.fileList);
|
|
|
+ }, 200);
|
|
|
+ } else if (resData && resData.url) {
|
|
|
this.fileList[this.fileList.findIndex((item2) => item2.key === key)] = {
|
|
|
...this.fileList[this.fileList.findIndex((item2) => item2.key === key)],
|
|
|
url: resData.url,
|
|
|
@@ -50064,13 +50156,15 @@ const _sfc_main$Z = Object.assign({
|
|
|
url: item2 == null ? void 0 : item2.url,
|
|
|
key: item2 == null ? void 0 : item2.key,
|
|
|
name: item2 == null ? void 0 : item2.name,
|
|
|
+ ...item2,
|
|
|
isImage: true
|
|
|
};
|
|
|
} else {
|
|
|
return {
|
|
|
name: item2 == null ? void 0 : item2.name,
|
|
|
key: item2 == null ? void 0 : item2.key,
|
|
|
- url: item2 == null ? void 0 : item2.name
|
|
|
+ url: item2 == null ? void 0 : item2.name,
|
|
|
+ ...item2
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
@@ -50081,7 +50175,8 @@ const _sfc_main$Z = Object.assign({
|
|
|
return {
|
|
|
name: (_b = item2.name) != null ? _b : (_a2 = item2.file) == null ? void 0 : _a2.name,
|
|
|
url: item2.url,
|
|
|
- key: item2.key
|
|
|
+ key: item2.key,
|
|
|
+ ...item2
|
|
|
};
|
|
|
}));
|
|
|
}
|
|
|
@@ -50096,6 +50191,7 @@ const _sfc_main$Z = Object.assign({
|
|
|
});
|
|
|
let formData = new FormData();
|
|
|
formData.append("file", file.file);
|
|
|
+ formData.append("multiPartFile", file.file);
|
|
|
formData.append("fname", file.file.name);
|
|
|
formData.append("key", key);
|
|
|
xhr2.withCredentials = props2.withCredentials;
|
|
|
@@ -50108,7 +50204,8 @@ const _sfc_main$Z = Object.assign({
|
|
|
url: resData.url,
|
|
|
percent: 100,
|
|
|
status: "done",
|
|
|
- ...resData
|
|
|
+ ...resData,
|
|
|
+ ...resData.data
|
|
|
};
|
|
|
emit2("on-upload-success", {
|
|
|
...fileList.value[index2],
|
|
|
@@ -50330,7 +50427,7 @@ const _sfc_main$Z = Object.assign({
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
-var FmVantUploader = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-6b6ad645"]]);
|
|
|
+var FmVantUploader = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-4d36ef61"]]);
|
|
|
const _sfc_main$Y = {
|
|
|
components: {
|
|
|
FmVantSelect,
|
|
|
@@ -55352,7 +55449,7 @@ const idb = {
|
|
|
},
|
|
|
name: "form-making-v3",
|
|
|
cursor: 0,
|
|
|
- key: "/#********#/"
|
|
|
+ key: "aRpXsQD/tiA5awcoXM/2lA=="
|
|
|
};
|
|
|
var historyManager = {
|
|
|
clear() {
|
|
|
@@ -55664,23 +55761,54 @@ const _sfc_main$K = {
|
|
|
}
|
|
|
this.$refs.uploadInput.value = [];
|
|
|
},
|
|
|
+ getQueryParams(queryName) {
|
|
|
+ const urlSearchParams = new URLSearchParams(window.location.search);
|
|
|
+ const query = urlSearchParams.get(queryName);
|
|
|
+ return JSON.parse(query);
|
|
|
+ },
|
|
|
uploadAction(res, file, key) {
|
|
|
this.fileList.findIndex((item2) => item2.key === key);
|
|
|
const xhr2 = new XMLHttpRequest();
|
|
|
+ let headers = this.getQueryParams("headers");
|
|
|
+ console.log(headers.Authorization, "this.headers.Authorization");
|
|
|
const url = this.action;
|
|
|
xhr2.open("POST", url, true);
|
|
|
this.headers.map((item2) => {
|
|
|
+ if (item2.key == "Authorization") {
|
|
|
+ item2.value = headers.Authorization;
|
|
|
+ console.log(item2.value, "====111");
|
|
|
+ }
|
|
|
item2.key && xhr2.setRequestHeader(item2.key, item2.fx ? executeExpression(item2.value, {}, this.formContext) : item2.value);
|
|
|
});
|
|
|
let formData = new FormData();
|
|
|
- formData.append("file", file);
|
|
|
+ formData.append("multiPartFile", file);
|
|
|
formData.append("fname", file.name);
|
|
|
formData.append("key", key);
|
|
|
xhr2.withCredentials = this.withCredentials;
|
|
|
xhr2.onreadystatechange = () => {
|
|
|
if (xhr2 && xhr2.readyState === 4) {
|
|
|
let resData = xhr2.response ? JSON.parse(xhr2.response) : {};
|
|
|
- if (resData && resData.url) {
|
|
|
+ if (resData && resData.code == 0) {
|
|
|
+ this.$set(this.fileList, this.fileList.findIndex((item2) => item2.key === key), {
|
|
|
+ ...this.fileList[this.fileList.findIndex((item2) => item2.key === key)],
|
|
|
+ percent: 100,
|
|
|
+ ...resData.data
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$set(this.fileList, this.fileList.findIndex((item2) => item2.key === key), {
|
|
|
+ ...this.fileList[this.fileList.findIndex((item2) => item2.key === key)],
|
|
|
+ status: "success",
|
|
|
+ ...resData.data
|
|
|
+ });
|
|
|
+ this.$emit("on-upload-success", {
|
|
|
+ ...this.fileList[this.fileList.findIndex((item2) => item2.key === key)],
|
|
|
+ status: "success",
|
|
|
+ ...resData.data
|
|
|
+ });
|
|
|
+ console.log(this.fileList, "====");
|
|
|
+ this.$emit("update:modelValue", this.fileList);
|
|
|
+ }, 200);
|
|
|
+ } else if (resData && resData.url) {
|
|
|
this.fileList[this.fileList.findIndex((item2) => item2.key === key)] = {
|
|
|
...this.fileList[this.fileList.findIndex((item2) => item2.key === key)],
|
|
|
url: resData.url,
|
|
|
@@ -76128,7 +76256,7 @@ const loadOptions = (opts) => {
|
|
|
window.FormMaking_OPTIONS = {
|
|
|
...opts,
|
|
|
aceurl: (_a2 = opts.aceurl) != null ? _a2 : "https://form.making.link/public/lib/ace",
|
|
|
- key: "/#\u2014\u2014\u2014\u2014#/",
|
|
|
+ key: "03202501060166M",
|
|
|
version
|
|
|
};
|
|
|
};
|
|
|
@@ -76185,7 +76313,7 @@ const install = function(app, opts = {
|
|
|
components: []
|
|
|
}) {
|
|
|
opts = {
|
|
|
- key: "/#\u2014\u2014\u2014\u2014#/",
|
|
|
+ key: "03202501060166M",
|
|
|
locale: "en",
|
|
|
i18n: null,
|
|
|
components: [],
|