Comparing version 1.0.4 to 1.0.5
186
index.es.js
@@ -7,4 +7,4 @@ import P from "vconsole"; | ||
const e = r.__vccOpts || r; | ||
for (const [n, a] of t) | ||
e[n] = a; | ||
for (const [n, i] of t) | ||
e[n] = i; | ||
return e; | ||
@@ -18,3 +18,3 @@ }, J = { | ||
mounted() { | ||
if (this.$env.dark && (this.loadDarkMode(), this.listenDarkModeChange()), location.href.indexOf("debug=true") > -1) { | ||
if (this.$env.dark && (this.loadDarkMode(), this.listenDarkModeChange()), location.href.indexOf("debug=true") > -1 && typeof XMLHttpRequest < "u") { | ||
new P(); | ||
@@ -45,3 +45,3 @@ const r = document.querySelector("#__vconsole .vc-switch"); | ||
}, K = { class: "SumorApp" }; | ||
function V(r, t, e, n, a, o) { | ||
function V(r, t, e, n, i, o) { | ||
return Z(), R("div", K, [ | ||
@@ -51,3 +51,3 @@ W(r.$slots, "default", {}, void 0, !0) | ||
} | ||
const zt = /* @__PURE__ */ G(J, [["render", V], ["__scopeId", "data-v-2197e737"]]), C = async (r, t, e) => { | ||
const zt = /* @__PURE__ */ G(J, [["render", V], ["__scopeId", "data-v-959a2723"]]), C = async (r, t, e) => { | ||
e = e || {}; | ||
@@ -57,9 +57,9 @@ let n = !1; | ||
t[o] instanceof File && (n = !0); | ||
let a; | ||
let i; | ||
if (n) { | ||
a = new FormData(); | ||
i = new FormData(); | ||
for (const o in t) | ||
typeof t[o] == "object" && !(t[o] instanceof File) && (t[o] = JSON.stringify(t[o])), a.append(o, t[o]); | ||
typeof t[o] == "object" && !(t[o] instanceof File) && (t[o] = JSON.stringify(t[o])), i.append(o, t[o]); | ||
} else | ||
a = t; | ||
i = t; | ||
try { | ||
@@ -69,3 +69,3 @@ return await Q({ | ||
url: r, | ||
data: a, | ||
data: i, | ||
headers: { | ||
@@ -79,3 +79,3 @@ "Content-Type": n ? "multipart/form-data" : "application/json;charset=utf-8", | ||
} catch (o) { | ||
let i = o.response ? o.response.data : {}; | ||
let a = o.response ? o.response.data : {}; | ||
return { | ||
@@ -85,3 +85,3 @@ error: !0, | ||
message: o.message, | ||
...i | ||
...a | ||
}; | ||
@@ -100,5 +100,5 @@ } | ||
var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }; | ||
return function(n, a, o) { | ||
var i = a.prototype, f = i.format; | ||
o.en.formats = e, i.format = function(u) { | ||
return function(n, i, o) { | ||
var a = i.prototype, f = a.format; | ||
o.en.formats = e, a.format = function(u) { | ||
u === void 0 && (u = "YYYY-MM-DDTHH:mm:ssZ"); | ||
@@ -125,8 +125,8 @@ var d = this.$locale().formats, h = function(x, c) { | ||
})(O, function() { | ||
var e = "minute", n = /[+-]\d\d(?::?\d\d)?/g, a = /([+-]|\d\d)/g; | ||
return function(o, i, f) { | ||
var u = i.prototype; | ||
var e = "minute", n = /[+-]\d\d(?::?\d\d)?/g, i = /([+-]|\d\d)/g; | ||
return function(o, a, f) { | ||
var u = a.prototype; | ||
f.utc = function(s) { | ||
var l = { date: s, utc: !0, args: arguments }; | ||
return new i(l); | ||
return new a(l); | ||
}, u.utc = function(s) { | ||
@@ -160,3 +160,3 @@ var l = f(this.toDate(), { locale: this.$L, utc: !0 }); | ||
return null; | ||
var M = ("" + $[0]).match(a) || ["-", 0, 0], k = M[0], D = 60 * +M[1] + +M[2]; | ||
var M = ("" + $[0]).match(i) || ["-", 0, 0], k = M[0], D = 60 * +M[1] + +M[2]; | ||
return D === 0 ? 0 : k === "+" ? D : -D; | ||
@@ -211,3 +211,3 @@ }(s), s === null)) | ||
var e = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, n = {}; | ||
return function(a, o, i) { | ||
return function(i, o, a) { | ||
var f, u = function(c, p, w) { | ||
@@ -227,7 +227,7 @@ w === void 0 && (w = {}); | ||
var g = s[3], $ = g === 24 ? 0 : g, M = s[0] + "-" + s[1] + "-" + s[2] + " " + $ + ":" + s[4] + ":" + s[5] + ":000", k = +c; | ||
return (i.utc(M).valueOf() - (k -= k % 1e3)) / 6e4; | ||
return (a.utc(M).valueOf() - (k -= k % 1e3)) / 6e4; | ||
}, h = o.prototype; | ||
h.tz = function(c, p) { | ||
c === void 0 && (c = f); | ||
var w = this.utcOffset(), s = this.toDate(), l = s.toLocaleString("en-US", { timeZone: c }), y = Math.round((s - new Date(l)) / 1e3 / 60), m = i(l, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(15 * -Math.round(s.getTimezoneOffset() / 15) - y, !0); | ||
var w = this.utcOffset(), s = this.toDate(), l = s.toLocaleString("en-US", { timeZone: c }), y = Math.round((s - new Date(l)) / 1e3 / 60), m = a(l, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(15 * -Math.round(s.getTimezoneOffset() / 15) - y, !0); | ||
if (p) { | ||
@@ -239,3 +239,3 @@ var v = m.utcOffset(); | ||
}, h.offsetName = function(c) { | ||
var p = this.$x.$timezone || i.tz.guess(), w = u(this.valueOf(), p, { timeZoneName: c }).find(function(s) { | ||
var p = this.$x.$timezone || a.tz.guess(), w = u(this.valueOf(), p, { timeZoneName: c }).find(function(s) { | ||
return s.type.toLowerCase() === "timezonename"; | ||
@@ -249,8 +249,8 @@ }); | ||
return x.call(this, c, p); | ||
var w = i(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L }); | ||
var w = a(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L }); | ||
return x.call(w, c, p).tz(this.$x.$timezone, !0); | ||
}, i.tz = function(c, p, w) { | ||
var s = w && p, l = w || p || f, y = d(+i(), l); | ||
}, a.tz = function(c, p, w) { | ||
var s = w && p, l = w || p || f, y = d(+a(), l); | ||
if (typeof c != "string") | ||
return i(c).tz(l); | ||
return a(c).tz(l); | ||
var m = function($, M, k) { | ||
@@ -262,7 +262,7 @@ var D = $ - 60 * M * 1e3, T = d(D, k); | ||
return T === z ? [D, T] : [$ - 60 * Math.min(T, z) * 1e3, Math.max(T, z)]; | ||
}(i.utc(c, s).valueOf(), y, l), v = m[0], _ = m[1], g = i(v).utcOffset(_); | ||
}(a.utc(c, s).valueOf(), y, l), v = m[0], _ = m[1], g = a(v).utcOffset(_); | ||
return g.$x.$timezone = l, g; | ||
}, i.tz.guess = function() { | ||
}, a.tz.guess = function() { | ||
return Intl.DateTimeFormat().resolvedOptions().timeZone; | ||
}, i.tz.setDefault = function(c) { | ||
}, a.tz.setDefault = function(c) { | ||
f = c; | ||
@@ -274,4 +274,4 @@ }; | ||
var st = U.exports; | ||
const it = /* @__PURE__ */ L(st); | ||
var at = { exports: {} }; | ||
const at = /* @__PURE__ */ L(st); | ||
var it = { exports: {} }; | ||
(function(r, t) { | ||
@@ -281,14 +281,14 @@ (function(e, n) { | ||
})(O, function(e) { | ||
function n(i) { | ||
return i && typeof i == "object" && "default" in i ? i : { default: i }; | ||
function n(a) { | ||
return a && typeof a == "object" && "default" in a ? a : { default: a }; | ||
} | ||
var a = n(e), o = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(i, f) { | ||
return f === "W" ? i + "周" : i + "日"; | ||
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(i, f) { | ||
var u = 100 * i + f; | ||
var i = n(e), o = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(a, f) { | ||
return f === "W" ? a + "周" : a + "日"; | ||
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(a, f) { | ||
var u = 100 * a + f; | ||
return u < 600 ? "凌晨" : u < 900 ? "早上" : u < 1100 ? "上午" : u < 1300 ? "中午" : u < 1800 ? "下午" : "晚上"; | ||
} }; | ||
return a.default.locale(o, null, !0), o; | ||
return i.default.locale(o, null, !0), o; | ||
}); | ||
})(at); | ||
})(it); | ||
var X = { exports: {} }; | ||
@@ -299,12 +299,12 @@ (function(r, t) { | ||
})(O, function() { | ||
return function(e, n, a) { | ||
return function(e, n, i) { | ||
e = e || {}; | ||
var o = n.prototype, i = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }; | ||
var o = n.prototype, a = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }; | ||
function f(d, h, x, c) { | ||
return o.fromToBase(d, h, x, c); | ||
} | ||
a.en.relativeTime = i, o.fromToBase = function(d, h, x, c, p) { | ||
for (var w, s, l, y = x.$locale().relativeTime || i, m = e.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], v = m.length, _ = 0; _ < v; _ += 1) { | ||
i.en.relativeTime = a, o.fromToBase = function(d, h, x, c, p) { | ||
for (var w, s, l, y = x.$locale().relativeTime || a, m = e.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], v = m.length, _ = 0; _ < v; _ += 1) { | ||
var g = m[_]; | ||
g.d && (w = c ? a(d).diff(x, g.d, !0) : x.diff(d, g.d, !0)); | ||
g.d && (w = c ? i(d).diff(x, g.d, !0) : x.diff(d, g.d, !0)); | ||
var $ = (e.rounding || Math.round)(Math.abs(w)); | ||
@@ -328,3 +328,3 @@ if (l = w > 0, $ <= g.r || !g.r) { | ||
var u = function(d) { | ||
return d.$u ? a.utc() : a(); | ||
return d.$u ? i.utc() : i(); | ||
}; | ||
@@ -346,6 +346,6 @@ o.toNow = function(d) { | ||
})(O, function() { | ||
return function(e, n, a) { | ||
return function(e, n, i) { | ||
n.prototype.dayOfYear = function(o) { | ||
var i = Math.round((a(this).startOf("day") - a(this).startOf("year")) / 864e5) + 1; | ||
return o == null ? i : this.add(o - i, "day"); | ||
var a = Math.round((i(this).startOf("day") - i(this).startOf("year")) / 864e5) + 1; | ||
return o == null ? a : this.add(o - a, "day"); | ||
}; | ||
@@ -363,3 +363,3 @@ }; | ||
var e = "week", n = "year"; | ||
return function(a, o, i) { | ||
return function(i, o, a) { | ||
var f = o.prototype; | ||
@@ -371,8 +371,8 @@ f.week = function(u) { | ||
if (this.month() === 11 && this.date() > 25) { | ||
var h = i(this).startOf(n).add(1, n).date(d), x = i(this).endOf(e); | ||
var h = a(this).startOf(n).add(1, n).date(d), x = a(this).endOf(e); | ||
if (h.isBefore(x)) | ||
return 1; | ||
} | ||
var c = i(this).startOf(n).date(d).startOf(e).subtract(1, "millisecond"), p = this.diff(c, e, !0); | ||
return p < 0 ? i(this).startOf("week").week() : Math.ceil(p); | ||
var c = a(this).startOf(n).date(d).startOf(e).subtract(1, "millisecond"), p = this.diff(c, e, !0); | ||
return p < 0 ? a(this).startOf("week").week() : Math.ceil(p); | ||
}, f.weeks = function(u) { | ||
@@ -392,13 +392,13 @@ return u === void 0 && (u = null), this.week(u); | ||
var e = "month", n = "quarter"; | ||
return function(a, o) { | ||
var i = o.prototype; | ||
i.quarter = function(d) { | ||
return function(i, o) { | ||
var a = o.prototype; | ||
a.quarter = function(d) { | ||
return this.$utils().u(d) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (d - 1)); | ||
}; | ||
var f = i.add; | ||
i.add = function(d, h) { | ||
var f = a.add; | ||
a.add = function(d, h) { | ||
return d = Number(d), this.$utils().p(h) === n ? this.add(3 * d, e) : f.bind(this)(d, h); | ||
}; | ||
var u = i.startOf; | ||
i.startOf = function(d, h) { | ||
var u = a.startOf; | ||
a.startOf = function(d, h) { | ||
var x = this.$utils(), c = !!x.u(h) || h; | ||
@@ -418,3 +418,3 @@ if (x.p(d) === n) { | ||
Y.extend(ot); | ||
Y.extend(it); | ||
Y.extend(at); | ||
Y.extend(dt); | ||
@@ -450,4 +450,4 @@ Y.extend(lt); | ||
if (!e) { | ||
const n = document.getElementsByTagName("head")[0], a = document.createElement("link"); | ||
a.type = "text/css", a.rel = "stylesheet", a.href = r, n.appendChild(a); | ||
const n = document.getElementsByTagName("head")[0], i = document.createElement("link"); | ||
i.type = "text/css", i.rel = "stylesheet", i.href = r, n.appendChild(i); | ||
} | ||
@@ -461,3 +461,3 @@ }, | ||
e || await new Promise((n) => { | ||
const a = document.getElementsByTagName("head")[0], o = document.createElement("script"); | ||
const i = document.getElementsByTagName("head")[0], o = document.createElement("script"); | ||
o.src = r, o.type = "text/javascript", o.addEventListener ? o.addEventListener("load", function() { | ||
@@ -467,3 +467,3 @@ n(); | ||
window.event.srcElement.readyState === "loaded" && n(); | ||
}), a.appendChild(o); | ||
}), i.appendChild(o); | ||
}); | ||
@@ -474,9 +474,9 @@ } | ||
await S.js(N); | ||
const t = await new Promise((a) => { | ||
const t = await new Promise((i) => { | ||
const o = new FileReader(); | ||
o.readAsArrayBuffer(r), o.onload = () => { | ||
const i = window.XLSX.read(o.result, { | ||
const a = window.XLSX.read(o.result, { | ||
type: "array" | ||
}); | ||
a(i); | ||
i(a); | ||
}; | ||
@@ -488,6 +488,6 @@ }), e = t.Props.SheetNames[0], n = t.Sheets[e]; | ||
await S.js(N); | ||
const n = "default", a = window.XLSX.utils.aoa_to_sheet(e), o = window.XLSX.utils.book_new(); | ||
window.XLSX.utils.book_append_sheet(o, a, n), t = t || "xlsx", r = r || "export"; | ||
const i = `${r}.${t}`; | ||
return window.XLSX.writeFile(o, i); | ||
const n = "default", i = window.XLSX.utils.aoa_to_sheet(e), o = window.XLSX.utils.book_new(); | ||
window.XLSX.utils.book_append_sheet(o, i, n), t = t || "xlsx", r = r || "export"; | ||
const a = `${r}.${t}`; | ||
return window.XLSX.writeFile(o, a); | ||
} | ||
@@ -527,5 +527,5 @@ }, _t = "https://library.sumor.com/qrcode/qrcode.min.js", $t = async (r) => (await S.js(_t), await new Promise((t) => { | ||
}, Dt = ({ title: r, description: t, keywords: e }) => { | ||
const n = (a, o) => { | ||
const i = document.getElementsByTagName("head")[0], f = document.createElement("meta"); | ||
f.setAttribute("name", a), f.setAttribute("content", o), i.appendChild(f); | ||
const n = (i, o) => { | ||
const a = document.getElementsByTagName("head")[0], f = document.createElement("meta"); | ||
f.setAttribute("name", i), f.setAttribute("content", o), a.appendChild(f); | ||
}; | ||
@@ -536,4 +536,4 @@ document.title = r, document.getElementsByName("description")[0] ? document.getElementsByName("description")[0].content = t : n("description", t), document.getElementsByName("keywords")[0] ? document.getElementsByName("keywords")[0].content = e : n("keywords", e); | ||
const { width: t, height: e } = I(); | ||
let n, a, o = !1; | ||
return typeof navigator < "u" && (n = navigator.language || navigator.browserLanguage, o = /micromessenger/i.test(navigator.userAgent)), n = n || "zh-CN", a = kt() || "Asia/Shanghai", { | ||
let n, i, o = !1; | ||
return typeof navigator < "u" && (n = navigator.language || navigator.browserLanguage, o = /micromessenger/i.test(navigator.userAgent)), n = n || "zh-CN", i = kt() || "Asia/Shanghai", { | ||
table: xt, | ||
@@ -551,3 +551,3 @@ qrcode: $t, | ||
language: n, | ||
timezone: a, | ||
timezone: i, | ||
pageInfo: { | ||
@@ -587,6 +587,6 @@ title: "", | ||
}, | ||
setPageInfo({ title: t, name: e, keywords: n, desc: a, description: o }) { | ||
if (this.pageInfo.title = t || e || "", this.pageInfo.description = a || o || "", this.pageInfo.keywords = n || "", r) { | ||
const i = E(); | ||
i.pageInfo = { | ||
setPageInfo({ title: t, name: e, keywords: n, desc: i, description: o }) { | ||
if (this.pageInfo.title = t || e || "", this.pageInfo.description = i || o || "", this.pageInfo.keywords = n || "", r) { | ||
const a = E(); | ||
a.pageInfo = { | ||
title: this.pageInfo.title, | ||
@@ -603,3 +603,3 @@ description: this.pageInfo.description, | ||
let n = document.documentElement.className.split(" "); | ||
n = n.filter((a) => a !== e), t && n.push(e), document.documentElement.className = n.join(" "); | ||
n = n.filter((i) => i !== e), t && n.push(e), document.documentElement.className = n.join(" "); | ||
} | ||
@@ -631,7 +631,7 @@ this.dark = t; | ||
n.language = this.language, n.timezone = this.timezone; | ||
const a = await C(t, e, n); | ||
if (a.error) | ||
return a; | ||
const i = await C(t, e, n); | ||
if (i.error) | ||
return i; | ||
{ | ||
let o = a.headers["sumor-instance"] || ""; | ||
let o = i.headers["sumor-instance"] || ""; | ||
return o = o.split("_"), this.instance = { | ||
@@ -642,3 +642,3 @@ version: o[0], | ||
time: o[3] | ||
}, a.data; | ||
}, i.data; | ||
} | ||
@@ -654,6 +654,6 @@ }, | ||
o = Object.assign({}, this.data, o), this.pending = !0; | ||
const i = await e(t, o); | ||
if (this.pending = !1, i.error) | ||
throw i; | ||
return i.data; | ||
const a = await e(t, o); | ||
if (this.pending = !1, a.error) | ||
throw a; | ||
return a.data; | ||
} | ||
@@ -660,0 +660,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"name":"@sumor/ux","type":"module","main":"./index.umd.cjs","module":"./index.es.js","exports":{".":{"import":"./index.es.js","require":"./index.umd.cjs"}},"dependencies":{"vue":"^3.3.4","axios":"^1.3.2","dayjs":"^1.11.10","vconsole":"^3.15.1"},"version":"1.0.4"} | ||
{"name":"@sumor/ux","type":"module","main":"./index.umd.cjs","module":"./index.es.js","exports":{".":{"import":"./index.es.js","require":"./index.umd.cjs"}},"dependencies":{"vue":"^3.3.4","axios":"^1.3.2","dayjs":"^1.11.10","vconsole":"^3.15.1"},"version":"1.0.5"} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40366