magtool 1.6.21 → 1.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cpt/Timezone.js +30 -33
- package/package.json +1 -1
package/dist/cpt/Timezone.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as N, reactive as S, getCurrentInstance as
|
|
2
|
-
import { useMap as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as N, reactive as S, getCurrentInstance as x, inject as k, computed as u, watch as w, resolveComponent as g, createElementBlock as f, openBlock as c, createVNode as M, mergeProps as B, unref as s, createSlots as L, withCtx as v, Fragment as O, renderList as D, createBlock as E, normalizeClass as P, createElementVNode as m, createCommentVNode as j, toDisplayString as i, createTextVNode as F } from "vue";
|
|
2
|
+
import { useMap as I } from "asamap";
|
|
3
|
+
const U = { class: "SuperTimezone" }, $ = { class: "flexMode vc hb g16" }, A = { class: "flexMode vc" }, Z = { key: 0 }, q = N({
|
|
4
4
|
name: "SuperTimezone"
|
|
5
|
-
}),
|
|
5
|
+
}), Q = /* @__PURE__ */ Object.assign(q, {
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: {
|
|
8
8
|
type: String,
|
|
@@ -26,20 +26,18 @@ const $ = { class: "SuperTimezone" }, A = { class: "flexMode vc hb g16" }, Z = {
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
emits: ["change", "update:modelValue", "update:timezone"],
|
|
29
|
-
setup(T, { emit:
|
|
30
|
-
const _ = T,
|
|
29
|
+
setup(T, { emit: V }) {
|
|
30
|
+
const _ = T, r = S({
|
|
31
31
|
v: "",
|
|
32
32
|
timezone: "",
|
|
33
33
|
name: "",
|
|
34
34
|
options: [],
|
|
35
35
|
filterTxt: ""
|
|
36
|
-
}), { proxy:
|
|
36
|
+
}), { proxy: G } = x(), h = k("store");
|
|
37
37
|
h.common();
|
|
38
|
-
const d = h.asa(),
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
l.filterTxt = e.toLowerCase();
|
|
42
|
-
}, z = u(() => U("common.timezone").map((e) => (e.v = e.value.toString(), e.des_en_us = e.label_en_us.toLowerCase(), e.des_zh_cn = e.label_zh_cn.toLowerCase(), e.hide = !1, e))), b = u(() => {
|
|
38
|
+
const d = h.asa(), l = V, y = (e) => {
|
|
39
|
+
n.value ? (l("update:modelValue", n.value.label), l("update:timezone", n.value.value)) : (l("update:modelValue", ""), l("update:timezone", "")), l("change");
|
|
40
|
+
}, z = u(() => I("common.timezone").map((e) => (e.v = e.value.toString(), e.des_en_us = e.label_en_us.toLowerCase(), e.des_zh_cn = e.label_zh_cn.toLowerCase(), e.hide = !1, e))), b = u(() => {
|
|
43
41
|
if (_.usePreTimezone) {
|
|
44
42
|
const e = [
|
|
45
43
|
{
|
|
@@ -53,14 +51,14 @@ const $ = { class: "SuperTimezone" }, A = { class: "flexMode vc hb g16" }, Z = {
|
|
|
53
51
|
value: d.accountTimezone.timezone,
|
|
54
52
|
hide: !1
|
|
55
53
|
},
|
|
56
|
-
{ ...
|
|
54
|
+
{ ...C.value }
|
|
57
55
|
], o = [];
|
|
58
56
|
return z.value.forEach((a) => {
|
|
59
57
|
e.filter1((p) => p.label === a.label).data || o.push(a);
|
|
60
58
|
}), [...e, ...o];
|
|
61
59
|
} else
|
|
62
60
|
return z.value;
|
|
63
|
-
}),
|
|
61
|
+
}), n = u(() => b.value.filter1((e) => e.label === r.v).data), C = u(() => {
|
|
64
62
|
const e = Intl.DateTimeFormat().resolvedOptions().timeZone, o = (/* @__PURE__ */ new Date()).getTimezoneOffset(), a = Math.floor(Math.abs(o) / 60);
|
|
65
63
|
return {
|
|
66
64
|
label: e,
|
|
@@ -69,41 +67,40 @@ const $ = { class: "SuperTimezone" }, A = { class: "flexMode vc hb g16" }, Z = {
|
|
|
69
67
|
hide: !1
|
|
70
68
|
};
|
|
71
69
|
});
|
|
72
|
-
return
|
|
70
|
+
return w(
|
|
73
71
|
() => _.modelValue,
|
|
74
72
|
(e, o) => {
|
|
75
|
-
e !== void 0 && e !== o && (
|
|
73
|
+
e !== void 0 && e !== o && (r.v = e);
|
|
76
74
|
},
|
|
77
75
|
{
|
|
78
76
|
immediate: !0
|
|
79
77
|
}
|
|
80
78
|
), (e, o) => {
|
|
81
79
|
const a = g("el-option"), p = g("el-select");
|
|
82
|
-
return c(), f("div",
|
|
83
|
-
|
|
84
|
-
modelValue: r
|
|
85
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) => r
|
|
80
|
+
return c(), f("div", U, [
|
|
81
|
+
M(p, B({
|
|
82
|
+
modelValue: s(r).v,
|
|
83
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => s(r).v = t),
|
|
86
84
|
filterable: "",
|
|
87
|
-
placeholder: e.$l("Timezone")
|
|
88
|
-
"filter-method": y
|
|
85
|
+
placeholder: e.$l("Timezone")
|
|
89
86
|
}, e.$attrs, {
|
|
90
|
-
onChange:
|
|
87
|
+
onChange: y,
|
|
91
88
|
class: "wp100"
|
|
92
|
-
}),
|
|
89
|
+
}), L({
|
|
93
90
|
default: v(() => [
|
|
94
|
-
(c(!0), f(
|
|
91
|
+
(c(!0), f(O, null, D(s(b), (t, H) => (c(), E(a, {
|
|
95
92
|
key: t.label,
|
|
96
93
|
label: t.label,
|
|
97
94
|
value: t.label,
|
|
98
95
|
class: P(t.hide && "hide")
|
|
99
96
|
}, {
|
|
100
97
|
default: v(() => [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
t.tip ? (c(), f("span",
|
|
98
|
+
m("div", $, [
|
|
99
|
+
m("div", A, [
|
|
100
|
+
m("span", null, i(t.label), 1),
|
|
101
|
+
t.tip ? (c(), f("span", Z, "(" + i(t.tip) + ")", 1)) : j("", !0)
|
|
105
102
|
]),
|
|
106
|
-
|
|
103
|
+
m("span", null, i(t.value < 1 ? t.value : "+" + t.value), 1)
|
|
107
104
|
])
|
|
108
105
|
]),
|
|
109
106
|
_: 2
|
|
@@ -111,10 +108,10 @@ const $ = { class: "SuperTimezone" }, A = { class: "flexMode vc hb g16" }, Z = {
|
|
|
111
108
|
]),
|
|
112
109
|
_: 2
|
|
113
110
|
}, [
|
|
114
|
-
|
|
111
|
+
s(n) ? {
|
|
115
112
|
name: "prefix",
|
|
116
113
|
fn: v(() => [
|
|
117
|
-
|
|
114
|
+
F(" [" + i(s(n).value) + "] ", 1)
|
|
118
115
|
]),
|
|
119
116
|
key: "0"
|
|
120
117
|
} : void 0
|
|
@@ -124,5 +121,5 @@ const $ = { class: "SuperTimezone" }, A = { class: "flexMode vc hb g16" }, Z = {
|
|
|
124
121
|
}
|
|
125
122
|
});
|
|
126
123
|
export {
|
|
127
|
-
|
|
124
|
+
Q as default
|
|
128
125
|
};
|