all
This commit is contained in:
@@ -2060,4 +2060,4 @@ function clearNumberFormat(ctx, locale, format) {
|
||||
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
||||
}
|
||||
}
|
||||
export { parseDateTimeArgs as A, datetime as B, parseNumberArgs as C, number as D, getLocaleChain as E, MISSING_RESOLVE_VALUE as M, NOT_REOSLVED as N, assign as a, isString as b, isObject$1 as c, isArray as d, isBoolean as e, createCompileError as f, isEmptyObject as g, getGlobalThis as h, isNumber as i, isPlainObject as j, hasOwn$1 as k, handleFlatJson as l, makeSymbol as m, isRegExp as n, isFunction as o, createCoreContext as p, compileToFunction as q, registerMessageCompiler as r, setDevToolsHook as s, resolveValue as t, updateFallbackLocale as u, clearDateTimeFormat as v, clearNumberFormat as w, setAdditionalMeta as x, parseTranslateArgs as y, translate as z };
|
||||
export { parseDateTimeArgs as A, datetime as B, parseNumberArgs as C, number as D, getLocaleChain as E, MISSING_RESOLVE_VALUE as M, NOT_REOSLVED as N, assign as a, isString as b, isObject$1 as c, isBoolean as d, isEmptyObject as e, createCompileError as f, getGlobalThis as g, isPlainObject as h, isNumber as i, isArray as j, hasOwn$1 as k, handleFlatJson as l, makeSymbol as m, isRegExp as n, isFunction as o, compileToFunction as p, createCoreContext as q, registerMessageCompiler as r, setDevToolsHook as s, resolveValue as t, updateFallbackLocale as u, clearDateTimeFormat as v, clearNumberFormat as w, setAdditionalMeta as x, parseTranslateArgs as y, translate as z };
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -149,7 +149,9 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
|
||||
}
|
||||
}
|
||||
}
|
||||
new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
||||
new Set(
|
||||
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
||||
);
|
||||
function toRaw(observed) {
|
||||
const raw = observed && observed["__v_raw"];
|
||||
return raw ? toRaw(raw) : observed;
|
||||
@@ -170,11 +172,13 @@ function triggerRefValue(ref, newVal) {
|
||||
}
|
||||
}
|
||||
}
|
||||
var _a;
|
||||
class ComputedRefImpl {
|
||||
constructor(getter, _setter, isReadonly, isSSR) {
|
||||
this._setter = _setter;
|
||||
this.dep = void 0;
|
||||
this.__v_isRef = true;
|
||||
this[_a] = false;
|
||||
this._dirty = true;
|
||||
this.effect = new ReactiveEffect(getter, () => {
|
||||
if (!this._dirty) {
|
||||
@@ -199,6 +203,7 @@ class ComputedRefImpl {
|
||||
this._setter(newValue);
|
||||
}
|
||||
}
|
||||
_a = "__v_isReadonly";
|
||||
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
||||
let getter;
|
||||
let setter;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { computed, isRef, reactive, unref, toRefs, getCurrentScope, onScopeDispose, getCurrentInstance, onMounted, nextTick, ref, watch, customRef, onUpdated } from "vue";
|
||||
var _a$1;
|
||||
const isClient$1 = typeof window !== "undefined";
|
||||
const toString$1 = Object.prototype.toString;
|
||||
import { getCurrentScope, onScopeDispose, computed, toRefs, getCurrentInstance, onMounted, nextTick, ref, unref, isRef, reactive, watch, customRef, onUpdated } from "vue";
|
||||
var _a;
|
||||
const isClient = typeof window !== "undefined";
|
||||
const toString = Object.prototype.toString;
|
||||
const isFunction = (val) => typeof val === "function";
|
||||
const isNumber = (val) => typeof val === "number";
|
||||
const isString = (val) => typeof val === "string";
|
||||
const isObject$1 = (val) => toString$1.call(val) === "[object Object]";
|
||||
const isObject = (val) => toString.call(val) === "[object Object]";
|
||||
const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
|
||||
const noop = () => {
|
||||
};
|
||||
isClient$1 && ((_a$1 = window == null ? void 0 : window.navigator) == null ? void 0 : _a$1.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
||||
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
||||
function resolveUnref(r) {
|
||||
return typeof r === "function" ? r() : unref(r);
|
||||
}
|
||||
@@ -141,7 +141,7 @@ function useTimeoutFn(cb, interval, options = {}) {
|
||||
}
|
||||
if (immediate) {
|
||||
isPending.value = true;
|
||||
if (isClient$1)
|
||||
if (isClient)
|
||||
start();
|
||||
}
|
||||
tryOnScopeDispose(stop);
|
||||
@@ -156,7 +156,7 @@ function unrefElement(elRef) {
|
||||
const plain = resolveUnref(elRef);
|
||||
return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
|
||||
}
|
||||
const defaultWindow = isClient$1 ? window : void 0;
|
||||
const defaultWindow = isClient ? window : void 0;
|
||||
function useEventListener(...args) {
|
||||
let target;
|
||||
let event;
|
||||
@@ -561,9 +561,4 @@ function useWindowSize(options = {}) {
|
||||
useEventListener("orientationchange", update, { passive: true });
|
||||
return { width, height };
|
||||
}
|
||||
var _a;
|
||||
const isClient = typeof window !== "undefined";
|
||||
const toString = Object.prototype.toString;
|
||||
const isObject = (val) => toString.call(val) === "[object Object]";
|
||||
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
||||
export { TransitionPresets as T, useResizeObserver as a, useThrottleFn as b, useEventListener as c, useEyeDropper as d, useTransition as e, useMousePressed as f, isObject as g, isObject$1 as i, onClickOutside as o, reactiveOmit as r, templateRef as t, useWindowSize as u };
|
||||
export { TransitionPresets as T, useResizeObserver as a, useThrottleFn as b, useEventListener as c, useEyeDropper as d, useTransition as e, useMousePressed as f, isObject as i, onClickOutside as o, reactiveOmit as r, templateRef as t, useWindowSize as u };
|
||||
|
||||
261
package/component/es/_chunks/js-image-compressor/index.js
Normal file
261
package/component/es/_chunks/js-image-compressor/index.js
Normal file
@@ -0,0 +1,261 @@
|
||||
var jsImageCompressor = { exports: {} };
|
||||
var imageCompressor_min = { exports: {} };
|
||||
(function(module, exports) {
|
||||
!function(e, t) {
|
||||
module.exports = t();
|
||||
}(window, function() {
|
||||
return function(e) {
|
||||
var t = {};
|
||||
function n(r) {
|
||||
if (t[r])
|
||||
return t[r].exports;
|
||||
var a = t[r] = { i: r, l: false, exports: {} };
|
||||
return e[r].call(a.exports, a, a.exports, n), a.l = true, a.exports;
|
||||
}
|
||||
return n.m = e, n.c = t, n.d = function(e2, t2, r) {
|
||||
n.o(e2, t2) || Object.defineProperty(e2, t2, { enumerable: true, get: r });
|
||||
}, n.r = function(e2) {
|
||||
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e2, "__esModule", { value: true });
|
||||
}, n.t = function(e2, t2) {
|
||||
if (1 & t2 && (e2 = n(e2)), 8 & t2)
|
||||
return e2;
|
||||
if (4 & t2 && "object" == typeof e2 && e2 && e2.__esModule)
|
||||
return e2;
|
||||
var r = /* @__PURE__ */ Object.create(null);
|
||||
if (n.r(r), Object.defineProperty(r, "default", { enumerable: true, value: e2 }), 2 & t2 && "string" != typeof e2)
|
||||
for (var a in e2)
|
||||
n.d(r, a, function(t3) {
|
||||
return e2[t3];
|
||||
}.bind(null, a));
|
||||
return r;
|
||||
}, n.n = function(e2) {
|
||||
var t2 = e2 && e2.__esModule ? function() {
|
||||
return e2.default;
|
||||
} : function() {
|
||||
return e2;
|
||||
};
|
||||
return n.d(t2, "a", t2), t2;
|
||||
}, n.o = function(e2, t2) {
|
||||
return Object.prototype.hasOwnProperty.call(e2, t2);
|
||||
}, n.p = "", n(n.s = 0);
|
||||
}([function(e, t, n) {
|
||||
n.r(t);
|
||||
var r = window, a = /^image\//, i = /\.\w+$/, o = {}, s = { file: null, quality: 0.8, convertSize: 2048e3, loose: true, redressOrientation: true }, f = function(e2) {
|
||||
return "function" == typeof e2;
|
||||
}, c = function(e2) {
|
||||
return a.test(e2);
|
||||
};
|
||||
function l(e2) {
|
||||
e2 = Object.assign({}, s, e2), this.options = e2, this.file = e2.file, this.image = null, this.ParsedOrientationInfo = null, this.init();
|
||||
}
|
||||
var u = l.prototype;
|
||||
for (var h in t.default = l, u.init = function() {
|
||||
var e2 = this, t2 = this.file, n2 = this.options;
|
||||
t2 && c(t2.type) ? (c(n2.mimeType) || (n2.mimeType = t2.type), o.file2Image(t2, function(r2) {
|
||||
f(e2.beforeCompress) && (e2.image = r2, t2.width = r2.naturalWidth, t2.height = r2.naturalHeight, e2.beforeCompress(t2)), "image/jpeg" === t2.type && n2.redressOrientation ? e2.getParsedOrientationInfo(function(t3) {
|
||||
e2.parsedOrientationInfo = t3, e2.rendCanvas();
|
||||
}) : (e2.parsedOrientationInfo = { rotate: 0, scaleX: 1, scaleY: 1 }, e2.rendCanvas());
|
||||
}, e2.error)) : e2.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!");
|
||||
}, u.rendCanvas = function() {
|
||||
var e2 = this, t2 = this.options, n2 = this.image, r2 = this.getExpectedEdge(), a2 = r2.dWidth, i2 = r2.dHeight, s2 = r2.width, f2 = r2.height, c2 = o.image2Canvas(n2, a2, i2, e2.beforeDraw.bind(e2), e2.afterDraw.bind(e2), s2, f2);
|
||||
o.canvas2Blob(c2, function(t3) {
|
||||
t3 && (t3.width = c2.width, t3.height = c2.height), e2.success(t3);
|
||||
}, t2.quality, t2.mimeType);
|
||||
}, u.beforeCompress = function() {
|
||||
f(this.options.beforeCompress) && this.options.beforeCompress(this.file);
|
||||
}, u.getExpectedEdge = function() {
|
||||
var e2, t2 = this.image, n2 = this.parsedOrientationInfo.rotate, r2 = this.options, a2 = t2.naturalWidth, i2 = t2.naturalHeight, o2 = Math.abs(n2) % 180 == 90;
|
||||
o2 && (e2 = i2, i2 = a2, a2 = e2);
|
||||
var s2 = a2 / i2, f2 = Math.max(r2.maxWidth, 0) || 1 / 0, c2 = Math.max(r2.maxHeight, 0) || 1 / 0, l2 = Math.max(r2.minWidth, 0) || 0, u2 = Math.max(r2.minHeight, 0) || 0, h2 = Math.max(r2.width, 0) || a2, d = Math.max(r2.height, 0) || i2;
|
||||
f2 < 1 / 0 && c2 < 1 / 0 ? c2 * s2 > f2 ? c2 = f2 / s2 : f2 = c2 * s2 : f2 < 1 / 0 ? c2 = f2 / s2 : c2 < 1 / 0 && (f2 = c2 * s2), l2 > 0 && u2 > 0 ? u2 * s2 > l2 ? u2 = l2 / s2 : l2 = u2 * s2 : l2 > 0 ? u2 = l2 / s2 : u2 > 0 && (l2 = u2 * s2), d * s2 > h2 ? d = h2 / s2 : h2 = d * s2;
|
||||
var g = h2 = Math.floor(Math.min(Math.max(h2, l2), f2)), p = d = Math.floor(Math.min(Math.max(d, u2), c2));
|
||||
return o2 && (e2 = p, p = g, g = e2), { dWidth: g, dHeight: p, width: h2, height: d };
|
||||
}, u.getParsedOrientationInfo = function(e2) {
|
||||
var t2 = this;
|
||||
this.getOrientation(function(n2) {
|
||||
f(e2) && e2(t2.parseOrientation(n2));
|
||||
});
|
||||
}, u.getOrientation = function(e2) {
|
||||
var t2 = this;
|
||||
o.file2ArrayBuffer(this.file, function(n2) {
|
||||
f(e2) && e2(t2.resetAndGetOrientation(n2));
|
||||
});
|
||||
}, u.resetAndGetOrientation = function(e2) {
|
||||
var t2, n2 = new DataView(e2);
|
||||
try {
|
||||
var r2, a2, i2;
|
||||
if (255 === n2.getUint8(0) && 216 === n2.getUint8(1))
|
||||
for (var s2 = n2.byteLength, f2 = 2; f2 + 1 < s2; ) {
|
||||
if (255 === n2.getUint8(f2) && 225 === n2.getUint8(f2 + 1)) {
|
||||
a2 = f2;
|
||||
break;
|
||||
}
|
||||
f2 += 1;
|
||||
}
|
||||
if (a2) {
|
||||
var c2 = a2 + 4, l2 = a2 + 10;
|
||||
if ("Exif" === o.getStringFromCharCode(n2, c2, 4)) {
|
||||
var u2 = n2.getUint16(l2);
|
||||
if (((r2 = 18761 === u2) || 19789 === u2) && 42 === n2.getUint16(l2 + 2, r2)) {
|
||||
var h2 = n2.getUint32(l2 + 4, r2);
|
||||
h2 >= 8 && (i2 = l2 + h2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i2) {
|
||||
var d;
|
||||
s2 = n2.getUint16(i2, r2);
|
||||
for (d = 0; d < s2; d += 1)
|
||||
if (f2 = i2 + 12 * d + 2, 274 === n2.getUint16(f2, r2)) {
|
||||
f2 += 8, t2 = n2.getUint16(f2, r2), n2.setUint16(f2, 1, r2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (e3) {
|
||||
console.error(e3), t2 = 1;
|
||||
}
|
||||
return t2;
|
||||
}, u.parseOrientation = function(e2) {
|
||||
var t2 = 0, n2 = 1, r2 = 1;
|
||||
switch (e2) {
|
||||
case 2:
|
||||
n2 = -1;
|
||||
break;
|
||||
case 3:
|
||||
t2 = -180;
|
||||
break;
|
||||
case 4:
|
||||
r2 = -1;
|
||||
break;
|
||||
case 5:
|
||||
t2 = 90, r2 = -1;
|
||||
break;
|
||||
case 6:
|
||||
t2 = 90;
|
||||
break;
|
||||
case 7:
|
||||
t2 = 90, n2 = -1;
|
||||
break;
|
||||
case 8:
|
||||
t2 = -90;
|
||||
}
|
||||
return { rotate: t2, scaleX: n2, scaleY: r2 };
|
||||
}, u.beforeDraw = function(e2, t2) {
|
||||
var n2 = this.parsedOrientationInfo, r2 = n2.rotate, a2 = n2.scaleX, i2 = n2.scaleY, o2 = this.file, s2 = this.options, c2 = "transparent", l2 = t2.width, u2 = t2.height;
|
||||
switch (o2.size > s2.convertSize && "image/png" === s2.mimeType && (c2 = "#fff", s2.mimeType = "image/jpeg"), e2.fillStyle = c2, e2.fillRect(0, 0, l2, u2), f(s2.beforeDraw) && s2.beforeDraw.call(this, e2, t2), e2.save(), r2) {
|
||||
case 90:
|
||||
e2.translate(l2, 0);
|
||||
break;
|
||||
case -90:
|
||||
e2.translate(0, u2);
|
||||
break;
|
||||
case -180:
|
||||
e2.translate(l2, u2);
|
||||
}
|
||||
e2.rotate(r2 * Math.PI / 180), e2.scale(a2, i2);
|
||||
}, u.afterDraw = function(e2, t2) {
|
||||
var n2 = this.options;
|
||||
f(n2.afterDraw) && n2.afterDraw.call(this, e2, t2);
|
||||
}, u.error = function(e2) {
|
||||
var t2 = this.options;
|
||||
if (!f(t2.error))
|
||||
throw new Error(e2);
|
||||
t2.error.call(this, e2);
|
||||
}, u.success = function(e2) {
|
||||
var t2, n2, r2 = this.options, a2 = this.file, o2 = this.image, s2 = this.getExpectedEdge(), l2 = o2.naturalHeight, u2 = o2.naturalWidth;
|
||||
if (e2 && e2.size)
|
||||
if (!r2.loose && e2.size > a2.size && !(s2.width > u2 || s2.height > l2))
|
||||
console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"), e2 = a2;
|
||||
else {
|
||||
var h2 = new Date();
|
||||
e2.lastModified = h2.getTime(), e2.lastModifiedDate = h2, e2.name = a2.name, e2.name && e2.type !== a2.type && (e2.name = e2.name.replace(i, (t2 = e2.type, "jpeg" === (n2 = c(t2) ? t2.substr(6) : "") && (n2 = "jpg"), "." + n2)));
|
||||
}
|
||||
else
|
||||
console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"), e2 = a2;
|
||||
f(r2.success) && r2.success.call(this, e2);
|
||||
}, o.file2DataUrl = function(e2, t2, n2) {
|
||||
var r2 = new FileReader();
|
||||
r2.onload = function() {
|
||||
t2(r2.result);
|
||||
}, r2.onerror = function() {
|
||||
f(n2) && n2("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01");
|
||||
}, r2.readAsDataURL(e2);
|
||||
}, o.file2ArrayBuffer = function(e2, t2, n2) {
|
||||
var r2 = new FileReader();
|
||||
r2.onload = function(e3) {
|
||||
t2(e3.target.result);
|
||||
}, r2.onerror = function() {
|
||||
f(n2) && n2("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01");
|
||||
}, r2.readAsArrayBuffer(e2);
|
||||
}, o.getStringFromCharCode = function(e2, t2, n2) {
|
||||
var r2, a2 = "";
|
||||
for (n2 += t2, r2 = t2; r2 < n2; r2 += 1)
|
||||
a2 += String.fromCharCode(e2.getUint8(r2));
|
||||
return a2;
|
||||
}, o.file2Image = function(e2, t2, n2) {
|
||||
var a2 = new Image(), i2 = r.URL || r.webkitURL;
|
||||
if (r.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(r.navigator.userAgent) && (a2.crossOrigin = "anonymous"), a2.alt = e2.name, a2.onerror = function() {
|
||||
f(n2) && n2("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01");
|
||||
}, i2) {
|
||||
var o2 = i2.createObjectURL(e2);
|
||||
a2.onload = function() {
|
||||
t2(a2), i2.revokeObjectURL(o2);
|
||||
}, a2.src = o2;
|
||||
} else
|
||||
this.file2DataUrl(e2, function(e3) {
|
||||
a2.onload = function() {
|
||||
t2(a2);
|
||||
}, a2.src = e3;
|
||||
}, n2);
|
||||
}, o.url2Image = function(e2, t2, n2) {
|
||||
var r2 = new Image();
|
||||
r2.src = e2, r2.onload = function() {
|
||||
t2(r2);
|
||||
}, r2.onerror = function() {
|
||||
f(n2) && n2("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01");
|
||||
};
|
||||
}, o.image2Canvas = function(e2, t2, n2, r2, a2, i2, o2) {
|
||||
var s2 = document.createElement("canvas"), c2 = s2.getContext("2d");
|
||||
return s2.width = i2 || e2.naturalWidth, s2.height = o2 || e2.naturalHeight, f(r2) && r2(c2, s2), c2.save(), c2.drawImage(e2, 0, 0, t2, n2), c2.restore(), f(a2) && a2(c2, s2), s2;
|
||||
}, o.canvas2DataUrl = function(e2, t2, n2) {
|
||||
return e2.toDataURL(n2 || "image/jpeg", t2);
|
||||
}, o.dataUrl2Image = function(e2, t2, n2) {
|
||||
var r2 = new Image();
|
||||
r2.onload = function() {
|
||||
t2(r2);
|
||||
}, r2.error = function() {
|
||||
f(n2) && n2("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01");
|
||||
}, r2.src = e2;
|
||||
}, o.dataUrl2Blob = function(e2, t2) {
|
||||
for (var n2 = e2.split(",")[1], r2 = e2.match(/^data:(.*?)(;base64)?,/)[1], a2 = atob(n2), i2 = n2.length, o2 = new Uint8Array(i2), s2 = 0; s2 < i2; s2++)
|
||||
o2[s2] = a2.charCodeAt(s2);
|
||||
return new Blob([o2], { type: t2 || r2 });
|
||||
}, o.blob2DataUrl = function(e2, t2, n2) {
|
||||
this.file2DataUrl(e2, t2, n2);
|
||||
}, o.blob2Image = function(e2, t2, n2) {
|
||||
this.file2Image(e2, t2, n2);
|
||||
}, o.canvas2Blob = function(e2, t2, n2, r2) {
|
||||
var a2 = this;
|
||||
HTMLCanvasElement.prototype.toBlob || Object.defineProperty(HTMLCanvasElement.prototype, "toBlob", { value: function(e3, t3, n3) {
|
||||
var r3 = this.toDataURL(t3, n3);
|
||||
e3(a2.dataUrl2Blob(r3));
|
||||
} }), e2.toBlob(function(e3) {
|
||||
t2(e3);
|
||||
}, r2 || "image/jpeg", n2 || 0.8);
|
||||
}, o.upload = function(e2, t2, n2) {
|
||||
var r2 = new XMLHttpRequest(), a2 = new FormData();
|
||||
a2.append("file", t2), r2.onreadystatechange = function() {
|
||||
if (4 !== r2.readyState || 200 !== r2.status)
|
||||
throw new Error(r2);
|
||||
n2 && n2(r2.responseText);
|
||||
}, r2.open("POST", e2, true), r2.send(a2);
|
||||
}, o)
|
||||
o.hasOwnProperty(h) && (l[h] = o[h]);
|
||||
}]).default;
|
||||
});
|
||||
})(imageCompressor_min);
|
||||
{
|
||||
jsImageCompressor.exports = imageCompressor_min.exports;
|
||||
}
|
||||
var ImageCompressor = jsImageCompressor.exports;
|
||||
export { ImageCompressor as I };
|
||||
@@ -1,5 +1,5 @@
|
||||
import { m as makeSymbol, a as assign, i as isNumber, b as isString, c as isObject, d as isArray, e as isBoolean, f as createCompileError, g as isEmptyObject, r as registerMessageCompiler, h as getGlobalThis, s as setDevToolsHook, j as isPlainObject, k as hasOwn, l as handleFlatJson, n as isRegExp, o as isFunction, p as createCoreContext, u as updateFallbackLocale, q as compileToFunction, t as resolveValue, v as clearDateTimeFormat, w as clearNumberFormat, x as setAdditionalMeta, N as NOT_REOSLVED, y as parseTranslateArgs, z as translate, M as MISSING_RESOLVE_VALUE, A as parseDateTimeArgs, B as datetime, C as parseNumberArgs, D as number, E as getLocaleChain } from "../@intlify/index.js";
|
||||
import { h, Fragment, getCurrentInstance, inject, onMounted, onUnmounted, isRef, ref, computed, watch, createVNode, Text } from "vue";
|
||||
import { m as makeSymbol, a as assign, i as isNumber, b as isString, c as isObject, d as isBoolean, e as isEmptyObject, r as registerMessageCompiler, g as getGlobalThis, s as setDevToolsHook, f as createCompileError, h as isPlainObject, j as isArray, k as hasOwn, l as handleFlatJson, n as isRegExp, o as isFunction, u as updateFallbackLocale, p as compileToFunction, q as createCoreContext, t as resolveValue, v as clearDateTimeFormat, w as clearNumberFormat, x as setAdditionalMeta, N as NOT_REOSLVED, y as parseTranslateArgs, z as translate, M as MISSING_RESOLVE_VALUE, A as parseDateTimeArgs, B as datetime, C as parseNumberArgs, D as number, E as getLocaleChain } from "../@intlify/index.js";
|
||||
import { h, Fragment, getCurrentInstance, inject, onMounted, onUnmounted, ref, computed, watch, isRef, createVNode, Text } from "vue";
|
||||
/*!
|
||||
* vue-i18n v9.1.10
|
||||
* (c) 2022 kazuya kawaguchi
|
||||
@@ -80,8 +80,12 @@ function createComposer(options = {}) {
|
||||
const { __root } = options;
|
||||
const _isGlobal = __root === void 0;
|
||||
let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
|
||||
const _locale = ref(__root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : "en-US");
|
||||
const _fallbackLocale = ref(__root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value);
|
||||
const _locale = ref(
|
||||
__root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : "en-US"
|
||||
);
|
||||
const _fallbackLocale = ref(
|
||||
__root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
|
||||
);
|
||||
const _messages = ref(getLocaleMessages(_locale.value, options));
|
||||
const _datetimeFormats = ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
|
||||
const _numberFormats = ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
|
||||
@@ -215,23 +219,44 @@ function createComposer(options = {}) {
|
||||
type: "vnode"
|
||||
};
|
||||
function transrateVNode(...args) {
|
||||
return wrapWithDeps((context) => {
|
||||
let ret;
|
||||
const _context2 = context;
|
||||
try {
|
||||
_context2.processor = processor;
|
||||
ret = translate(_context2, ...args);
|
||||
} finally {
|
||||
_context2.processor = null;
|
||||
}
|
||||
return ret;
|
||||
}, () => parseTranslateArgs(...args), "translate", (root) => root[TransrateVNodeSymbol](...args), (key) => [createVNode(Text, null, key, 0)], (val) => isArray(val));
|
||||
return wrapWithDeps(
|
||||
(context) => {
|
||||
let ret;
|
||||
const _context2 = context;
|
||||
try {
|
||||
_context2.processor = processor;
|
||||
ret = translate(_context2, ...args);
|
||||
} finally {
|
||||
_context2.processor = null;
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
() => parseTranslateArgs(...args),
|
||||
"translate",
|
||||
(root) => root[TransrateVNodeSymbol](...args),
|
||||
(key) => [createVNode(Text, null, key, 0)],
|
||||
(val) => isArray(val)
|
||||
);
|
||||
}
|
||||
function numberParts(...args) {
|
||||
return wrapWithDeps((context) => number(context, ...args), () => parseNumberArgs(...args), "number format", (root) => root[NumberPartsSymbol](...args), () => [], (val) => isString(val) || isArray(val));
|
||||
return wrapWithDeps(
|
||||
(context) => number(context, ...args),
|
||||
() => parseNumberArgs(...args),
|
||||
"number format",
|
||||
(root) => root[NumberPartsSymbol](...args),
|
||||
() => [],
|
||||
(val) => isString(val) || isArray(val)
|
||||
);
|
||||
}
|
||||
function datetimeParts(...args) {
|
||||
return wrapWithDeps((context) => datetime(context, ...args), () => parseDateTimeArgs(...args), "datetime format", (root) => root[DatetimePartsSymbol](...args), () => [], (val) => isString(val) || isArray(val));
|
||||
return wrapWithDeps(
|
||||
(context) => datetime(context, ...args),
|
||||
() => parseDateTimeArgs(...args),
|
||||
"datetime format",
|
||||
(root) => root[DatetimePartsSymbol](...args),
|
||||
() => [],
|
||||
(val) => isString(val) || isArray(val)
|
||||
);
|
||||
}
|
||||
function setPluralRules(rules) {
|
||||
_pluralRules = rules;
|
||||
|
||||
Reference in New Issue
Block a user